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

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

Date: Mon, 3 Apr 2017 22:47:33 -0300

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: David Bremner


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


Thread: