From 1440a3a8cb8b44c4d762758c20b1fc31653ff187 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 24 Feb 2020 10:56:37 +0000 Subject: surface: Add basic surface enumerator Signed-off-by: Daniel Silverstone --- src/surface/surface.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/surface/surface.c b/src/surface/surface.c index f3127bd..426efa9 100644 --- a/src/surface/surface.c +++ b/src/surface/surface.c @@ -151,6 +151,17 @@ nsfb_type_from_name(const char *name) return NSFB_SURFACE_NONE; } +/* exported interface defined in libnsfb.h */ +void +nsfb_enumerate_surface_types(surface_enumeration_cb cb, void *context) +{ + int fend_loop; + + for (fend_loop = 0; fend_loop < surface_count; fend_loop++) { + cb(context, surfaces[fend_loop].name, surfaces[fend_loop].type); + } +} + /* * Local variables: * c-basic-offset: 4 -- cgit v1.2.3