]> git.cworth.org Git - notmuch/blobdiff - bindings/python-cffi/notmuch2/_build.py
lib: add NOTMUCH_STATUS_DATABASE_EXISTS
[notmuch] / bindings / python-cffi / notmuch2 / _build.py
index 3ba3e558b9bba5282c2e8ca9610332ad7d14d24b..f67b4de61001946f66f633ac1c91b2facd733ba7 100644 (file)
@@ -12,6 +12,9 @@ ffibuilder.set_source(
     #if LIBNOTMUCH_MAJOR_VERSION < 5
         #error libnotmuch version not supported by notmuch2 python bindings
     #endif
+    #if LIBNOTMUCH_MINOR_VERSION < 1
+        #ERROR libnotmuch  version < 5.1 not supported
+    #endif
     """,
     include_dirs=['../../lib'],
     library_dirs=['../../lib'],
@@ -44,6 +47,11 @@ ffibuilder.cdef(
         NOTMUCH_STATUS_UPGRADE_REQUIRED,
         NOTMUCH_STATUS_PATH_ERROR,
         NOTMUCH_STATUS_ILLEGAL_ARGUMENT,
+        NOTMUCH_STATUS_MALFORMED_CRYPTO_PROTOCOL,
+        NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION,
+        NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL,
+        NOTMUCH_STATUS_NO_CONFIG,
+        NOTMUCH_STATUS_DATABASE_EXISTS,
         NOTMUCH_STATUS_LAST_STATUS
     } notmuch_status_t;
     typedef enum {
@@ -68,6 +76,12 @@ ffibuilder.cdef(
         NOTMUCH_EXCLUDE_FALSE,
         NOTMUCH_EXCLUDE_ALL
     } notmuch_exclude_t;
+    typedef enum {
+        NOTMUCH_DECRYPT_FALSE,
+        NOTMUCH_DECRYPT_TRUE,
+        NOTMUCH_DECRYPT_AUTO,
+        NOTMUCH_DECRYPT_NOSTASH,
+    } notmuch_decryption_policy_t;
 
     // These are fully opaque types for us, we only ever use pointers.
     typedef struct _notmuch_database notmuch_database_t;
@@ -81,6 +95,7 @@ ffibuilder.cdef(
     typedef struct _notmuch_directory notmuch_directory_t;
     typedef struct _notmuch_filenames notmuch_filenames_t;
     typedef struct _notmuch_config_list notmuch_config_list_t;
+    typedef struct _notmuch_indexopts notmuch_indexopts_t;
 
     const char *
     notmuch_status_to_string (notmuch_status_t status);
@@ -118,9 +133,10 @@ ffibuilder.cdef(
     notmuch_database_get_revision (notmuch_database_t *notmuch,
                                    const char **uuid);
     notmuch_status_t
-    notmuch_database_add_message (notmuch_database_t *database,
-                                  const char *filename,
-                                  notmuch_message_t **message);
+    notmuch_database_index_file (notmuch_database_t *database,
+                                 const char *filename,
+                                 notmuch_indexopts_t *indexopts,
+                                 notmuch_message_t **message);
     notmuch_status_t
     notmuch_database_remove_message (notmuch_database_t *database,
                                      const char *filename);
@@ -294,6 +310,32 @@ ffibuilder.cdef(
     notmuch_filenames_move_to_next (notmuch_filenames_t *filenames);
     void
     notmuch_filenames_destroy (notmuch_filenames_t *filenames);
+    notmuch_indexopts_t *
+    notmuch_database_get_default_indexopts (notmuch_database_t *db);
+    notmuch_status_t
+    notmuch_indexopts_set_decrypt_policy (notmuch_indexopts_t *indexopts,
+                                          notmuch_decryption_policy_t decrypt_policy);
+    notmuch_decryption_policy_t
+    notmuch_indexopts_get_decrypt_policy (const notmuch_indexopts_t *indexopts);
+    void
+    notmuch_indexopts_destroy (notmuch_indexopts_t *options);
+
+    notmuch_status_t
+    notmuch_database_set_config (notmuch_database_t *db, const char *key, const char *value);
+    notmuch_status_t
+    notmuch_database_get_config (notmuch_database_t *db, const char *key, char **value);
+    notmuch_status_t
+    notmuch_database_get_config_list (notmuch_database_t *db, const char *prefix, notmuch_config_list_t **out);
+    notmuch_bool_t
+    notmuch_config_list_valid (notmuch_config_list_t *config_list);
+    const char *
+    notmuch_config_list_key (notmuch_config_list_t *config_list);
+    const char *
+    notmuch_config_list_value (notmuch_config_list_t *config_list);
+    void
+    notmuch_config_list_move_to_next (notmuch_config_list_t *config_list);
+    void
+    notmuch_config_list_destroy (notmuch_config_list_t *config_list);
     """
 )