aboutsummaryrefslogtreecommitdiff
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2016-03-22 07:54:48 -0300
committerDavid Bremner <david@tethera.net>2016-05-25 06:51:16 -0300
commit92e59568fa4eec466db78af6c21c39ca5826b0d7 (patch)
tree201db8683b73ac1c531dbda1025af9c98dd29066 /lib/notmuch.h
parent3458e3c89c1224d3e2dff7230780589ee3ee4c70 (diff)
lib: config list iterators
Since xapian provides the ability to restrict the iterator to a given prefix, we expose this ability to the user. Otherwise we mimic the other iterator interfances in notmuch (e.g. tags.c).
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index c827e02d..bd977c37 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -206,6 +206,7 @@ typedef struct _notmuch_message notmuch_message_t;
typedef struct _notmuch_tags notmuch_tags_t;
typedef struct _notmuch_directory notmuch_directory_t;
typedef struct _notmuch_filenames notmuch_filenames_t;
+typedef struct _notmuch_config_list notmuch_config_list_t;
#endif /* __DOXYGEN__ */
/**
@@ -1859,6 +1860,49 @@ notmuch_status_t
notmuch_database_get_config (notmuch_database_t *db, const char *key, char **value);
/**
+ * Create an iterator for all config items with keys matching a given prefix
+ */
+notmuch_status_t
+notmuch_database_get_config_list (notmuch_database_t *db, const char *prefix, notmuch_config_list_t **out);
+
+/**
+ * Is 'config_list' iterator valid (i.e. _key, _value, _move_to_next can be called).
+ */
+notmuch_bool_t
+notmuch_config_list_valid (notmuch_config_list_t *config_list);
+
+/**
+ * return key for current config pair
+ *
+ * return value is owned by the iterator, and will be destroyed by the
+ * next call to notmuch_config_list_key or notmuch_config_list_destroy.
+ */
+const char *
+notmuch_config_list_key (notmuch_config_list_t *config_list);
+
+/**
+ * return 'value' for current config pair
+ *
+ * return value is owned by the iterator, and will be destroyed by the
+ * next call to notmuch_config_list_value or notmuch config_list_destroy
+ */
+const char *
+notmuch_config_list_value (notmuch_config_list_t *config_list);
+
+
+/**
+ * move 'config_list' iterator to the next pair
+ */
+void
+notmuch_config_list_move_to_next (notmuch_config_list_t *config_list);
+
+/**
+ * free any resources held by 'config_list'
+ */
+void
+notmuch_config_list_destroy (notmuch_config_list_t *config_list);
+
+/**
* interrogate the library for compile time features
*/
notmuch_bool_t