[rfc patch v3 1/6] lib: add definitions for notmuch_param_t

David Bremner david at tethera.net
Mon Apr 3 18:47:33 PDT 2017


This is not an opaque struct because we envision using static
initialization much like the command-line-options.h structures.
---
 lib/notmuch.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/notmuch.h b/lib/notmuch.h
index d374dc96..fc00f96d 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -219,6 +219,23 @@ typedef struct _notmuch_filenames notmuch_filenames_t;
 typedef struct _notmuch_config_list notmuch_config_list_t;
 #endif /* __DOXYGEN__ */
 
+enum notmuch_param_type {
+    NOTMUCH_PARAM_END = 0,
+    NOTMUCH_PARAM_BOOLEAN,
+    NOTMUCH_PARAM_INT,
+    NOTMUCH_PARAM_STRING
+};
+
+typedef struct notmuch_param_desc {
+    enum notmuch_param_type param_type;
+    int key;
+    union {
+	notmuch_bool_t bool_val;
+	int int_val;
+	const char *string_val;
+    };
+} notmuch_param_t;
+
 /**
  * Create a new, empty notmuch database located at 'path'.
  *
-- 
2.11.0



More information about the notmuch mailing list