summaryrefslogtreecommitdiff
path: root/overlay/overlay.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-22 15:07:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-22 15:28:02 +0100
commit7c52a3cf5243b42b632fd73789d1b484e81b9b0c (patch)
tree7d303d347fd1d3201801486d676bbae246fab35f /overlay/overlay.h
parent184786988e5d78ae230139d76691b9ce7f97dca6 (diff)
overlay: Rudiments of config files and option parsing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/overlay.h')
-rw-r--r--overlay/overlay.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/overlay/overlay.h b/overlay/overlay.h
index 7794b577..f7b94d16 100644
--- a/overlay/overlay.h
+++ b/overlay/overlay.h
@@ -64,18 +64,40 @@ struct overlay {
extern const cairo_user_data_key_t overlay_key;
+struct config {
+ struct config_section {
+ struct config_section *next;
+ struct config_value {
+ struct config_value *next;
+ char *name;
+ char *value;
+ } *values;
+ char name[0];
+ } *sections;
+};
+
+void config_init(struct config *config);
+void config_parse_string(struct config *config, const char *str);
+void config_set_value(struct config *config,
+ const char *section,
+ const char *name,
+ const char *value);
+const char *config_get_value(struct config *config,
+ const char *section,
+ const char *name);
+
#ifdef HAVE_OVERLAY_XVLIB
-cairo_surface_t *x11_overlay_create(enum position pos, int *width, int *height);
+cairo_surface_t *x11_overlay_create(struct config *config, int *width, int *height);
void x11_overlay_stop(void);
#else
-static inline cairo_surface_t *x11_overlay_create(enum position pos, int *width, int *height) { return NULL; }
+static inline cairo_surface_t *x11_overlay_create(struct config *config, int *width, int *height) { return NULL; }
static inline void x11_overlay_stop(void) { }
#endif
#ifdef HAVE_OVERLAY_XLIB
-cairo_surface_t *x11_window_create(enum position pos, int *width, int *height);
+cairo_surface_t *x11_window_create(struct config *config, int *width, int *height);
#else
-static inline cairo_surface_t *x11_window_create(enum position pos, int *width, int *height) { return NULL; }
+static inline cairo_surface_t *x11_window_create(struct config *config, int *width, int *height) { return NULL; }
#endif
#endif /* OVERLAY_H */