diff options
| author | Floris Bruynooghe <flub@devork.be> | 2019-11-17 20:24:46 +0100 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2019-12-03 08:12:30 -0400 |
| commit | 1e072204cd1963fbf684cdc9c92092efb2d44924 (patch) | |
| tree | 5b962bdaeb80882b8ecf58d8f93df177f28f852e /bindings/python-cffi/notmuch2/_build.py | |
| parent | e2df30f7a98f91543d0b3561dbb366eb4b3d812c (diff) | |
Move from _add_message to _index_file API
This moves away from the deprecated notmuch_database_add_message API
and instead uses the notmuch_database_index_file API. This means
instroducing a class to manage the index options and bumping the
library version requirement to 5.1.
Diffstat (limited to 'bindings/python-cffi/notmuch2/_build.py')
| -rw-r--r-- | bindings/python-cffi/notmuch2/_build.py | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/bindings/python-cffi/notmuch2/_build.py b/bindings/python-cffi/notmuch2/_build.py index 3ba3e558..5e1fcac1 100644 --- a/bindings/python-cffi/notmuch2/_build.py +++ b/bindings/python-cffi/notmuch2/_build.py @@ -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'], @@ -68,6 +71,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 +90,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 +128,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 +305,15 @@ 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); """ ) |
