;; generated with `guild compile-ffi ffi/notmuch.ffi' (define-module (ffi notmuch) #:use-module ((system foreign) #:prefix ffi:) #:use-module (system foreign-library) #:use-module (nyacc foreign cdata)) (define (foreign-pointer-search name) (let loop ((libs (list #f "libnotmuch"))) (cond ((null? libs) (error "no library for ~s" name)) ((false-if-exception (foreign-library-pointer (car libs) name))) (else (loop (cdr libs)))))) ;; typedef int notmuch_bool_t; (define-public notmuch_bool_t (name-ctype 'notmuch_bool_t (cbase 'int))) ;; typedef enum { ;; NOTMUCH_STATUS_SUCCESS = 0, ;; NOTMUCH_STATUS_OUT_OF_MEMORY, ;; NOTMUCH_STATUS_READ_ONLY_DATABASE, ;; NOTMUCH_STATUS_XAPIAN_EXCEPTION, ;; NOTMUCH_STATUS_FILE_ERROR, ;; NOTMUCH_STATUS_FILE_NOT_EMAIL, ;; NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID, ;; NOTMUCH_STATUS_NULL_POINTER, ;; NOTMUCH_STATUS_TAG_TOO_LONG, ;; NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW, ;; NOTMUCH_STATUS_UNBALANCED_ATOMIC, ;; NOTMUCH_STATUS_UNSUPPORTED_OPERATION, ;; NOTMUCH_STATUS_UPGRADE_REQUIRED, ;; NOTMUCH_STATUS_PATH_ERROR, ;; NOTMUCH_STATUS_IGNORED, ;; 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_NO_DATABASE, ;; NOTMUCH_STATUS_DATABASE_EXISTS, ;; NOTMUCH_STATUS_BAD_QUERY_SYNTAX, ;; NOTMUCH_STATUS_NO_MAIL_ROOT, ;; NOTMUCH_STATUS_CLOSED_DATABASE, ;; NOTMUCH_STATUS_LAST_STATUS, ;; } notmuch_status_t; (define-public notmuch_status_t (name-ctype 'notmuch_status_t (cenum '((NOTMUCH_STATUS_SUCCESS 0) (NOTMUCH_STATUS_OUT_OF_MEMORY 1) (NOTMUCH_STATUS_READ_ONLY_DATABASE 2) (NOTMUCH_STATUS_XAPIAN_EXCEPTION 3) (NOTMUCH_STATUS_FILE_ERROR 4) (NOTMUCH_STATUS_FILE_NOT_EMAIL 5) (NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID 6) (NOTMUCH_STATUS_NULL_POINTER 7) (NOTMUCH_STATUS_TAG_TOO_LONG 8) (NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW 9) (NOTMUCH_STATUS_UNBALANCED_ATOMIC 10) (NOTMUCH_STATUS_UNSUPPORTED_OPERATION 11) (NOTMUCH_STATUS_UPGRADE_REQUIRED 12) (NOTMUCH_STATUS_PATH_ERROR 13) (NOTMUCH_STATUS_IGNORED 14) (NOTMUCH_STATUS_ILLEGAL_ARGUMENT 15) (NOTMUCH_STATUS_MALFORMED_CRYPTO_PROTOCOL 16) (NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION 17) (NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL 18) (NOTMUCH_STATUS_NO_CONFIG 19) (NOTMUCH_STATUS_NO_DATABASE 20) (NOTMUCH_STATUS_DATABASE_EXISTS 21) (NOTMUCH_STATUS_BAD_QUERY_SYNTAX 22) (NOTMUCH_STATUS_NO_MAIL_ROOT 23) (NOTMUCH_STATUS_CLOSED_DATABASE 24) (NOTMUCH_STATUS_LAST_STATUS 25))))) (define-public unwrap-notmuch_status_t (let ((numf (cenum-numf (ctype-info notmuch_status_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_status_t (let ((symf (cenum-symf (ctype-info notmuch_status_t)))) (lambda (arg) (or (symf arg) arg)))) ;; const char *notmuch_status_to_string(notmuch_status_t status); (define-public notmuch_status_to_string (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_status_to_string") (list ffi:int))))) (lambda (status) (let ((status (unwrap~enum status))) ((force ~proc) status))))) ;; typedef struct _notmuch_database notmuch_database_t; (define-public notmuch_database_t* (name-ctype 'notmuch_database_t* (cpointer 'void))) ;; typedef struct _notmuch_query notmuch_query_t; (define-public notmuch_query_t* (name-ctype 'notmuch_query_t* (cpointer 'void))) ;; typedef struct _notmuch_threads notmuch_threads_t; (define-public notmuch_threads_t* (name-ctype 'notmuch_threads_t* (cpointer 'void))) ;; typedef struct _notmuch_thread notmuch_thread_t; (define-public notmuch_thread_t* (name-ctype 'notmuch_thread_t* (cpointer 'void))) ;; typedef struct _notmuch_messages notmuch_messages_t; (define-public notmuch_messages_t* (name-ctype 'notmuch_messages_t* (cpointer 'void))) ;; typedef struct _notmuch_message notmuch_message_t; (define-public notmuch_message_t* (name-ctype 'notmuch_message_t* (cpointer 'void))) ;; typedef struct _notmuch_tags notmuch_tags_t; (define-public notmuch_tags_t* (name-ctype 'notmuch_tags_t* (cpointer 'void))) ;; typedef struct _notmuch_directory notmuch_directory_t; (define-public notmuch_directory_t* (name-ctype 'notmuch_directory_t* (cpointer 'void))) ;; typedef struct _notmuch_filenames notmuch_filenames_t; (define-public notmuch_filenames_t* (name-ctype 'notmuch_filenames_t* (cpointer 'void))) ;; typedef struct _notmuch_config_list notmuch_config_list_t; (define-public notmuch_config_list_t* (name-ctype 'notmuch_config_list_t* (cpointer 'void))) ;; typedef struct _notmuch_config_values notmuch_config_values_t; (define-public notmuch_config_values_t* (name-ctype 'notmuch_config_values_t* (cpointer 'void))) ;; typedef struct _notmuch_config_pairs notmuch_config_pairs_t; (define-public notmuch_config_pairs_t* (name-ctype 'notmuch_config_pairs_t* (cpointer 'void))) ;; typedef struct _notmuch_indexopts notmuch_indexopts_t; (define-public notmuch_indexopts_t* (name-ctype 'notmuch_indexopts_t* (cpointer 'void))) ;; notmuch_status_t notmuch_database_create(const char *path, ;; notmuch_database_t **database); (define-public notmuch_database_create (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_create") (list '* '*))))) (lambda (path database) (let ((path (unwrap-pointer path)) (database (unwrap-pointer database))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) path database)))))) ;; notmuch_status_t notmuch_database_create_verbose(const char *path, ;; notmuch_database_t **database, char **error_message); (define-public notmuch_database_create_verbose (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_create_verbose") (list '* '* '*))))) (lambda (path database error_message) (let ((path (unwrap-pointer path)) (database (unwrap-pointer database)) (error_message (unwrap-pointer error_message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) path database error_message)))))) ;; typedef enum { ;; NOTMUCH_DATABASE_MODE_READ_ONLY = 0, ;; NOTMUCH_DATABASE_MODE_READ_WRITE, ;; } notmuch_database_mode_t; (define-public notmuch_database_mode_t (name-ctype 'notmuch_database_mode_t (cenum '((NOTMUCH_DATABASE_MODE_READ_ONLY 0) (NOTMUCH_DATABASE_MODE_READ_WRITE 1))))) (define-public unwrap-notmuch_database_mode_t (let ((numf (cenum-numf (ctype-info notmuch_database_mode_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_database_mode_t (let ((symf (cenum-symf (ctype-info notmuch_database_mode_t)))) (lambda (arg) (or (symf arg) arg)))) ;; notmuch_status_t notmuch_database_open(const char *path, ;; notmuch_database_mode_t mode, notmuch_database_t **database); (define-public notmuch_database_open (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_open") (list '* ffi:int '*))))) (lambda (path mode database) (let ((path (unwrap-pointer path)) (mode (unwrap~enum mode)) (database (unwrap-pointer database))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) path mode database)))))) ;; notmuch_status_t notmuch_database_open_verbose(const char *path, ;; notmuch_database_mode_t mode, notmuch_database_t **database, char ** ;; error_message); (define-public notmuch_database_open_verbose (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_open_verbose") (list '* ffi:int '* '*))))) (lambda (path mode database error_message) (let ((path (unwrap-pointer path)) (mode (unwrap~enum mode)) (database (unwrap-pointer database)) (error_message (unwrap-pointer error_message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) path mode database error_message)))))) ;; notmuch_status_t notmuch_database_open_with_config(const char *database_path ;; , notmuch_database_mode_t mode, const char *config_path, const char * ;; profile, notmuch_database_t **database, char **error_message); (define-public notmuch_database_open_with_config (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_open_with_config") (list '* ffi:int '* '* '* '*))))) (lambda (database_path mode config_path profile database error_message) (let ((database_path (unwrap-pointer database_path)) (mode (unwrap~enum mode)) (config_path (unwrap-pointer config_path)) (profile (unwrap-pointer profile)) (database (unwrap-pointer database)) (error_message (unwrap-pointer error_message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database_path mode config_path profile database error_message)))))) ;; notmuch_status_t notmuch_database_load_config(const char *database_path, ;; const char *config_path, const char *profile, notmuch_database_t ** ;; database, char **error_message); (define-public notmuch_database_load_config (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_load_config") (list '* '* '* '* '*))))) (lambda (database_path config_path profile database error_message) (let ((database_path (unwrap-pointer database_path)) (config_path (unwrap-pointer config_path)) (profile (unwrap-pointer profile)) (database (unwrap-pointer database)) (error_message (unwrap-pointer error_message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database_path config_path profile database error_message)))))) ;; notmuch_status_t notmuch_database_create_with_config(const char * ;; database_path, const char *config_path, const char *profile, ;; notmuch_database_t **database, char **error_message); (define-public notmuch_database_create_with_config (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_create_with_config") (list '* '* '* '* '*))))) (lambda (database_path config_path profile database error_message) (let ((database_path (unwrap-pointer database_path)) (config_path (unwrap-pointer config_path)) (profile (unwrap-pointer profile)) (database (unwrap-pointer database)) (error_message (unwrap-pointer error_message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database_path config_path profile database error_message)))))) ;; const char *notmuch_database_status_string(const notmuch_database_t *notmuch ;; ); (define-public notmuch_database_status_string (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_database_status_string") (list '*))))) (lambda (notmuch) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*))) ((force ~proc) notmuch))))) ;; notmuch_status_t notmuch_database_close(notmuch_database_t *database); (define-public notmuch_database_close (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_close") (list '*))))) (lambda (database) (let ((database (unwrap-pointer database notmuch_database_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database)))))) ;; typedef void (*notmuch_compact_status_cb_t)(const char *message, void * ;; closure); (define *notmuch_compact_status_cb_t (cfunction (lambda (~proc) (ffi:procedure->pointer ffi:void (lambda (message closure) (~proc message closure)) (list '* '*))) (lambda (~fptr) (let ((~proc (ffi:pointer->procedure ffi:void ~fptr (list '* '*)))) (lambda (message closure) (let ((message (unwrap-pointer message)) (closure (unwrap-pointer closure))) (~proc message closure))))))) (define-public notmuch_compact_status_cb_t (name-ctype 'notmuch_compact_status_cb_t (cpointer *notmuch_compact_status_cb_t))) ;; notmuch_status_t notmuch_database_compact(const char *path, const char * ;; backup_path, notmuch_compact_status_cb_t status_cb, void *closure); (define-public notmuch_database_compact (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_compact") (list '* '* '* '*))))) (lambda (path backup_path status_cb closure) (let ((path (unwrap-pointer path)) (backup_path (unwrap-pointer backup_path)) (status_cb (unwrap-pointer status_cb notmuch_compact_status_cb_t)) (closure (unwrap-pointer closure))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) path backup_path status_cb closure)))))) ;; notmuch_status_t notmuch_database_compact_db(notmuch_database_t *database, ;; const char *backup_path, notmuch_compact_status_cb_t status_cb, void * ;; closure); (define-public notmuch_database_compact_db (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_compact_db") (list '* '* '* '*))))) (lambda (database backup_path status_cb closure) (let ((database (unwrap-pointer database notmuch_database_t*)) (backup_path (unwrap-pointer backup_path)) (status_cb (unwrap-pointer status_cb notmuch_compact_status_cb_t)) (closure (unwrap-pointer closure))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database backup_path status_cb closure)))))) ;; notmuch_status_t notmuch_database_destroy(notmuch_database_t *database); (define-public notmuch_database_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_destroy") (list '*))))) (lambda (database) (let ((database (unwrap-pointer database notmuch_database_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database)))))) ;; const char *notmuch_database_get_path(notmuch_database_t *database); (define-public notmuch_database_get_path (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_database_get_path") (list '*))))) (lambda (database) (let ((database (unwrap-pointer database notmuch_database_t*))) ((force ~proc) database))))) ;; unsigned int notmuch_database_get_version(notmuch_database_t *database); (define-public notmuch_database_get_version (let ((~proc (delay (ffi:pointer->procedure ffi:unsigned-int (foreign-pointer-search "notmuch_database_get_version") (list '*))))) (lambda (database) (let ((database (unwrap-pointer database notmuch_database_t*))) ((force ~proc) database))))) ;; notmuch_bool_t notmuch_database_needs_upgrade(notmuch_database_t *database); ;; (define-public notmuch_database_needs_upgrade (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_needs_upgrade") (list '*))))) (lambda (database) (let ((database (unwrap-pointer database notmuch_database_t*))) ((force ~proc) database))))) ;; notmuch_status_t notmuch_database_upgrade(notmuch_database_t *database, void ;; (*progress_notify)(void *closure, double progress), void *closure); (define-public notmuch_database_upgrade (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_upgrade") (list '* '* '*))))) (lambda (database progress_notify closure) (let ((database (unwrap-pointer database notmuch_database_t*)) (progress_notify (unwrap-pointer progress_notify (cpointer (cfunction (lambda (~proc) (ffi:procedure->pointer ffi:void (lambda (closure progress) (~proc closure progress)) (list '* ffi:double))) (lambda (p) 'unused))))) (closure (unwrap-pointer closure))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database progress_notify closure)))))) ;; notmuch_status_t notmuch_database_begin_atomic(notmuch_database_t *notmuch); ;; (define-public notmuch_database_begin_atomic (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_begin_atomic") (list '*))))) (lambda (notmuch) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) notmuch)))))) ;; notmuch_status_t notmuch_database_end_atomic(notmuch_database_t *notmuch); (define-public notmuch_database_end_atomic (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_end_atomic") (list '*))))) (lambda (notmuch) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) notmuch)))))) ;; unsigned long notmuch_database_get_revision(notmuch_database_t *notmuch, ;; const char **uuid); (define-public notmuch_database_get_revision (let ((~proc (delay (ffi:pointer->procedure ffi:unsigned-long (foreign-pointer-search "notmuch_database_get_revision") (list '* '*))))) (lambda (notmuch uuid) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (uuid (unwrap-pointer uuid))) ((force ~proc) notmuch uuid))))) ;; notmuch_status_t notmuch_database_get_directory(notmuch_database_t *database ;; , const char *path, notmuch_directory_t **directory); (define-public notmuch_database_get_directory (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_get_directory") (list '* '* '*))))) (lambda (database path directory) (let ((database (unwrap-pointer database notmuch_database_t*)) (path (unwrap-pointer path)) (directory (unwrap-pointer directory))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database path directory)))))) ;; notmuch_status_t notmuch_database_index_file(notmuch_database_t *database, ;; const char *filename, notmuch_indexopts_t *indexopts, notmuch_message_t ;; **message); (define-public notmuch_database_index_file (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_index_file") (list '* '* '* '*))))) (lambda (database filename indexopts message) (let ((database (unwrap-pointer database notmuch_database_t*)) (filename (unwrap-pointer filename)) (indexopts (unwrap-pointer indexopts notmuch_indexopts_t*)) (message (unwrap-pointer message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database filename indexopts message)))))) ;; notmuch_status_t notmuch_database_add_message(notmuch_database_t *database, ;; const char *filename, notmuch_message_t **message); (define-public notmuch_database_add_message (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_add_message") (list '* '* '*))))) (lambda (database filename message) (let ((database (unwrap-pointer database notmuch_database_t*)) (filename (unwrap-pointer filename)) (message (unwrap-pointer message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database filename message)))))) ;; notmuch_status_t notmuch_database_remove_message(notmuch_database_t * ;; database, const char *filename); (define-public notmuch_database_remove_message (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_remove_message") (list '* '*))))) (lambda (database filename) (let ((database (unwrap-pointer database notmuch_database_t*)) (filename (unwrap-pointer filename))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database filename)))))) ;; notmuch_status_t notmuch_database_find_message(notmuch_database_t *database ;; , const char *message_id, notmuch_message_t **message); (define-public notmuch_database_find_message (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_find_message") (list '* '* '*))))) (lambda (database message_id message) (let ((database (unwrap-pointer database notmuch_database_t*)) (message_id (unwrap-pointer message_id)) (message (unwrap-pointer message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database message_id message)))))) ;; notmuch_status_t notmuch_database_find_message_by_filename( ;; notmuch_database_t *notmuch, const char *filename, notmuch_message_t ** ;; message); (define-public notmuch_database_find_message_by_filename (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_find_message_by_filename") (list '* '* '*))))) (lambda (notmuch filename message) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (filename (unwrap-pointer filename)) (message (unwrap-pointer message))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) notmuch filename message)))))) ;; notmuch_tags_t *notmuch_database_get_all_tags(notmuch_database_t *db); (define-public notmuch_database_get_all_tags (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_database_get_all_tags") (list '*))))) (lambda (db) (let ((db (unwrap-pointer db notmuch_database_t*))) ((lambda (~ret) (make-cdata notmuch_tags_t* ~ret)) ((force ~proc) db)))))) ;; notmuch_status_t notmuch_database_reopen(notmuch_database_t *db, ;; notmuch_database_mode_t mode); (define-public notmuch_database_reopen (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_reopen") (list '* ffi:int))))) (lambda (db mode) (let ((db (unwrap-pointer db notmuch_database_t*)) (mode (unwrap~enum mode))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) db mode)))))) ;; notmuch_query_t *notmuch_query_create(notmuch_database_t *database, const ;; char *query_string); (define-public notmuch_query_create (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_query_create") (list '* '*))))) (lambda (database query_string) (let ((database (unwrap-pointer database notmuch_database_t*)) (query_string (unwrap-pointer query_string))) ((lambda (~ret) (make-cdata notmuch_query_t* ~ret)) ((force ~proc) database query_string)))))) ;; typedef enum { ;; NOTMUCH_QUERY_SYNTAX_XAPIAN, ;; NOTMUCH_QUERY_SYNTAX_SEXP, ;; } notmuch_query_syntax_t; (define-public notmuch_query_syntax_t (name-ctype 'notmuch_query_syntax_t (cenum '((NOTMUCH_QUERY_SYNTAX_XAPIAN 0) (NOTMUCH_QUERY_SYNTAX_SEXP 1))))) (define-public unwrap-notmuch_query_syntax_t (let ((numf (cenum-numf (ctype-info notmuch_query_syntax_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_query_syntax_t (let ((symf (cenum-symf (ctype-info notmuch_query_syntax_t)))) (lambda (arg) (or (symf arg) arg)))) ;; notmuch_status_t notmuch_query_create_with_syntax(notmuch_database_t * ;; database, const char *query_string, notmuch_query_syntax_t syntax, ;; notmuch_query_t **output); (define-public notmuch_query_create_with_syntax (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_create_with_syntax") (list '* '* ffi:int '*))))) (lambda (database query_string syntax output) (let ((database (unwrap-pointer database notmuch_database_t*)) (query_string (unwrap-pointer query_string)) (syntax (unwrap~enum syntax)) (output (unwrap-pointer output))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) database query_string syntax output)))))) ;; typedef enum { ;; NOTMUCH_SORT_OLDEST_FIRST, ;; NOTMUCH_SORT_NEWEST_FIRST, ;; NOTMUCH_SORT_MESSAGE_ID, ;; NOTMUCH_SORT_UNSORTED, ;; } notmuch_sort_t; (define-public notmuch_sort_t (name-ctype 'notmuch_sort_t (cenum '((NOTMUCH_SORT_OLDEST_FIRST 0) (NOTMUCH_SORT_NEWEST_FIRST 1) (NOTMUCH_SORT_MESSAGE_ID 2) (NOTMUCH_SORT_UNSORTED 3))))) (define-public unwrap-notmuch_sort_t (let ((numf (cenum-numf (ctype-info notmuch_sort_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_sort_t (let ((symf (cenum-symf (ctype-info notmuch_sort_t)))) (lambda (arg) (or (symf arg) arg)))) ;; const char *notmuch_query_get_query_string(const notmuch_query_t *query); (define-public notmuch_query_get_query_string (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_query_get_query_string") (list '*))))) (lambda (query) (let ((query (unwrap-pointer query notmuch_query_t*))) ((force ~proc) query))))) ;; notmuch_database_t *notmuch_query_get_database(const notmuch_query_t *query) ;; ; (define-public notmuch_query_get_database (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_query_get_database") (list '*))))) (lambda (query) (let ((query (unwrap-pointer query notmuch_query_t*))) ((lambda (~ret) (make-cdata notmuch_database_t* ~ret)) ((force ~proc) query)))))) ;; typedef enum { ;; NOTMUCH_EXCLUDE_FLAG, ;; NOTMUCH_EXCLUDE_TRUE, ;; NOTMUCH_EXCLUDE_FALSE, ;; NOTMUCH_EXCLUDE_ALL, ;; } notmuch_exclude_t; (define-public notmuch_exclude_t (name-ctype 'notmuch_exclude_t (cenum '((NOTMUCH_EXCLUDE_FLAG 0) (NOTMUCH_EXCLUDE_TRUE 1) (NOTMUCH_EXCLUDE_FALSE 2) (NOTMUCH_EXCLUDE_ALL 3))))) (define-public unwrap-notmuch_exclude_t (let ((numf (cenum-numf (ctype-info notmuch_exclude_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_exclude_t (let ((symf (cenum-symf (ctype-info notmuch_exclude_t)))) (lambda (arg) (or (symf arg) arg)))) ;; void notmuch_query_set_omit_excluded(notmuch_query_t *query, ;; notmuch_exclude_t omit_excluded); (define-public notmuch_query_set_omit_excluded (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_query_set_omit_excluded") (list '* ffi:int))))) (lambda (query omit_excluded) (let ((query (unwrap-pointer query notmuch_query_t*)) (omit_excluded (unwrap~enum omit_excluded))) ((force ~proc) query omit_excluded))))) ;; void notmuch_query_set_sort(notmuch_query_t *query, notmuch_sort_t sort); (define-public notmuch_query_set_sort (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_query_set_sort") (list '* ffi:int))))) (lambda (query sort) (let ((query (unwrap-pointer query notmuch_query_t*)) (sort (unwrap~enum sort))) ((force ~proc) query sort))))) ;; notmuch_sort_t notmuch_query_get_sort(const notmuch_query_t *query); (define-public notmuch_query_get_sort (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_get_sort") (list '*))))) (lambda (query) (let ((query (unwrap-pointer query notmuch_query_t*))) ((lambda (~ret) (wrap-notmuch_sort_t ~ret)) ((force ~proc) query)))))) ;; notmuch_status_t notmuch_query_add_tag_exclude(notmuch_query_t *query, const ;; char *tag); (define-public notmuch_query_add_tag_exclude (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_add_tag_exclude") (list '* '*))))) (lambda (query tag) (let ((query (unwrap-pointer query notmuch_query_t*)) (tag (unwrap-pointer tag))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query tag)))))) ;; notmuch_status_t notmuch_query_search_threads(notmuch_query_t *query, ;; notmuch_threads_t **out); (define-public notmuch_query_search_threads (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_search_threads") (list '* '*))))) (lambda (query out) (let ((query (unwrap-pointer query notmuch_query_t*)) (out (unwrap-pointer out))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query out)))))) ;; notmuch_status_t notmuch_query_search_threads_st(notmuch_query_t *query, ;; notmuch_threads_t **out); (define-public notmuch_query_search_threads_st (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_search_threads_st") (list '* '*))))) (lambda (query out) (let ((query (unwrap-pointer query notmuch_query_t*)) (out (unwrap-pointer out))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query out)))))) ;; notmuch_status_t notmuch_query_search_messages(notmuch_query_t *query, ;; notmuch_messages_t **out); (define-public notmuch_query_search_messages (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_search_messages") (list '* '*))))) (lambda (query out) (let ((query (unwrap-pointer query notmuch_query_t*)) (out (unwrap-pointer out))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query out)))))) ;; notmuch_status_t notmuch_query_search_messages_st(notmuch_query_t *query, ;; notmuch_messages_t **out); (define-public notmuch_query_search_messages_st (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_search_messages_st") (list '* '*))))) (lambda (query out) (let ((query (unwrap-pointer query notmuch_query_t*)) (out (unwrap-pointer out))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query out)))))) ;; void notmuch_query_destroy(notmuch_query_t *query); (define-public notmuch_query_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_query_destroy") (list '*))))) (lambda (query) (let ((query (unwrap-pointer query notmuch_query_t*))) ((force ~proc) query))))) ;; notmuch_bool_t notmuch_threads_valid(notmuch_threads_t *threads); (define-public notmuch_threads_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_threads_valid") (list '*))))) (lambda (threads) (let ((threads (unwrap-pointer threads notmuch_threads_t*))) ((force ~proc) threads))))) ;; notmuch_thread_t *notmuch_threads_get(notmuch_threads_t *threads); (define-public notmuch_threads_get (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_threads_get") (list '*))))) (lambda (threads) (let ((threads (unwrap-pointer threads notmuch_threads_t*))) ((lambda (~ret) (make-cdata notmuch_thread_t* ~ret)) ((force ~proc) threads)))))) ;; void notmuch_threads_move_to_next(notmuch_threads_t *threads); (define-public notmuch_threads_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_threads_move_to_next") (list '*))))) (lambda (threads) (let ((threads (unwrap-pointer threads notmuch_threads_t*))) ((force ~proc) threads))))) ;; void notmuch_threads_destroy(notmuch_threads_t *threads); (define-public notmuch_threads_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_threads_destroy") (list '*))))) (lambda (threads) (let ((threads (unwrap-pointer threads notmuch_threads_t*))) ((force ~proc) threads))))) ;; notmuch_status_t notmuch_query_count_messages(notmuch_query_t *query, ;; unsigned int *count); (define-public notmuch_query_count_messages (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_count_messages") (list '* '*))))) (lambda (query count) (let ((query (unwrap-pointer query notmuch_query_t*)) (count (unwrap-pointer count))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query count)))))) ;; notmuch_status_t notmuch_query_count_messages_st(notmuch_query_t *query, ;; unsigned int *count); (define-public notmuch_query_count_messages_st (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_count_messages_st") (list '* '*))))) (lambda (query count) (let ((query (unwrap-pointer query notmuch_query_t*)) (count (unwrap-pointer count))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query count)))))) ;; notmuch_status_t notmuch_query_count_threads(notmuch_query_t *query, ;; unsigned *count); (define-public notmuch_query_count_threads (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_count_threads") (list '* '*))))) (lambda (query count) (let ((query (unwrap-pointer query notmuch_query_t*)) (count (unwrap-pointer count))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query count)))))) ;; notmuch_status_t notmuch_query_count_threads_st(notmuch_query_t *query, ;; unsigned *count); (define-public notmuch_query_count_threads_st (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_query_count_threads_st") (list '* '*))))) (lambda (query count) (let ((query (unwrap-pointer query notmuch_query_t*)) (count (unwrap-pointer count))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) query count)))))) ;; const char *notmuch_thread_get_thread_id(notmuch_thread_t *thread); (define-public notmuch_thread_get_thread_id (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_thread_get_thread_id") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; int notmuch_thread_get_total_messages(notmuch_thread_t *thread); (define-public notmuch_thread_get_total_messages (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_thread_get_total_messages") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; int notmuch_thread_get_total_files(notmuch_thread_t *thread); (define-public notmuch_thread_get_total_files (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_thread_get_total_files") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; notmuch_messages_t *notmuch_thread_get_toplevel_messages(notmuch_thread_t * ;; thread); (define-public notmuch_thread_get_toplevel_messages (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_thread_get_toplevel_messages") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((lambda (~ret) (make-cdata notmuch_messages_t* ~ret)) ((force ~proc) thread)))))) ;; notmuch_messages_t *notmuch_thread_get_messages(notmuch_thread_t *thread); (define-public notmuch_thread_get_messages (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_thread_get_messages") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((lambda (~ret) (make-cdata notmuch_messages_t* ~ret)) ((force ~proc) thread)))))) ;; int notmuch_thread_get_matched_messages(notmuch_thread_t *thread); (define-public notmuch_thread_get_matched_messages (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_thread_get_matched_messages") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; const char *notmuch_thread_get_authors(notmuch_thread_t *thread); (define-public notmuch_thread_get_authors (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_thread_get_authors") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; const char *notmuch_thread_get_subject(notmuch_thread_t *thread); (define-public notmuch_thread_get_subject (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_thread_get_subject") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; time_t notmuch_thread_get_oldest_date(notmuch_thread_t *thread); (define-public notmuch_thread_get_oldest_date (let ((~proc (delay (ffi:pointer->procedure ffi:long (foreign-pointer-search "notmuch_thread_get_oldest_date") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; time_t notmuch_thread_get_newest_date(notmuch_thread_t *thread); (define-public notmuch_thread_get_newest_date (let ((~proc (delay (ffi:pointer->procedure ffi:long (foreign-pointer-search "notmuch_thread_get_newest_date") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; notmuch_tags_t *notmuch_thread_get_tags(notmuch_thread_t *thread); (define-public notmuch_thread_get_tags (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_thread_get_tags") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((lambda (~ret) (make-cdata notmuch_tags_t* ~ret)) ((force ~proc) thread)))))) ;; void notmuch_thread_destroy(notmuch_thread_t *thread); (define-public notmuch_thread_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_thread_destroy") (list '*))))) (lambda (thread) (let ((thread (unwrap-pointer thread notmuch_thread_t*))) ((force ~proc) thread))))) ;; notmuch_bool_t notmuch_messages_valid(notmuch_messages_t *messages); (define-public notmuch_messages_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_messages_valid") (list '*))))) (lambda (messages) (let ((messages (unwrap-pointer messages notmuch_messages_t*))) ((force ~proc) messages))))) ;; notmuch_message_t *notmuch_messages_get(notmuch_messages_t *messages); (define-public notmuch_messages_get (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_messages_get") (list '*))))) (lambda (messages) (let ((messages (unwrap-pointer messages notmuch_messages_t*))) ((lambda (~ret) (make-cdata notmuch_message_t* ~ret)) ((force ~proc) messages)))))) ;; void notmuch_messages_move_to_next(notmuch_messages_t *messages); (define-public notmuch_messages_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_messages_move_to_next") (list '*))))) (lambda (messages) (let ((messages (unwrap-pointer messages notmuch_messages_t*))) ((force ~proc) messages))))) ;; void notmuch_messages_destroy(notmuch_messages_t *messages); (define-public notmuch_messages_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_messages_destroy") (list '*))))) (lambda (messages) (let ((messages (unwrap-pointer messages notmuch_messages_t*))) ((force ~proc) messages))))) ;; notmuch_tags_t *notmuch_messages_collect_tags(notmuch_messages_t *messages); ;; (define-public notmuch_messages_collect_tags (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_messages_collect_tags") (list '*))))) (lambda (messages) (let ((messages (unwrap-pointer messages notmuch_messages_t*))) ((lambda (~ret) (make-cdata notmuch_tags_t* ~ret)) ((force ~proc) messages)))))) ;; notmuch_database_t *notmuch_message_get_database(const notmuch_message_t * ;; message); (define-public notmuch_message_get_database (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_database") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (make-cdata notmuch_database_t* ~ret)) ((force ~proc) message)))))) ;; const char *notmuch_message_get_message_id(notmuch_message_t *message); (define-public notmuch_message_get_message_id (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_message_id") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((force ~proc) message))))) ;; const char *notmuch_message_get_thread_id(notmuch_message_t *message); (define-public notmuch_message_get_thread_id (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_thread_id") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((force ~proc) message))))) ;; notmuch_messages_t *notmuch_message_get_replies(notmuch_message_t *message); ;; (define-public notmuch_message_get_replies (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_replies") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (make-cdata notmuch_messages_t* ~ret)) ((force ~proc) message)))))) ;; int notmuch_message_count_files(notmuch_message_t *message); (define-public notmuch_message_count_files (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_count_files") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((force ~proc) message))))) ;; const char *notmuch_message_get_filename(notmuch_message_t *message); (define-public notmuch_message_get_filename (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_filename") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((force ~proc) message))))) ;; notmuch_filenames_t *notmuch_message_get_filenames(notmuch_message_t * ;; message); (define-public notmuch_message_get_filenames (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_filenames") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (make-cdata notmuch_filenames_t* ~ret)) ((force ~proc) message)))))) ;; notmuch_status_t notmuch_message_reindex(notmuch_message_t *message, ;; notmuch_indexopts_t *indexopts); (define-public notmuch_message_reindex (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_reindex") (list '* '*))))) (lambda (message indexopts) (let ((message (unwrap-pointer message notmuch_message_t*)) (indexopts (unwrap-pointer indexopts notmuch_indexopts_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message indexopts)))))) ;; typedef enum { ;; NOTMUCH_MESSAGE_FLAG_MATCH, ;; NOTMUCH_MESSAGE_FLAG_EXCLUDED, ;; NOTMUCH_MESSAGE_FLAG_GHOST, ;; } notmuch_message_flag_t; (define-public notmuch_message_flag_t (name-ctype 'notmuch_message_flag_t (cenum '((NOTMUCH_MESSAGE_FLAG_MATCH 0) (NOTMUCH_MESSAGE_FLAG_EXCLUDED 1) (NOTMUCH_MESSAGE_FLAG_GHOST 2))))) (define-public unwrap-notmuch_message_flag_t (let ((numf (cenum-numf (ctype-info notmuch_message_flag_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_message_flag_t (let ((symf (cenum-symf (ctype-info notmuch_message_flag_t)))) (lambda (arg) (or (symf arg) arg)))) ;; notmuch_bool_t notmuch_message_get_flag(notmuch_message_t *message, ;; notmuch_message_flag_t flag); (define-public notmuch_message_get_flag (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_get_flag") (list '* ffi:int))))) (lambda (message flag) (let ((message (unwrap-pointer message notmuch_message_t*)) (flag (unwrap~enum flag))) ((force ~proc) message flag))))) ;; notmuch_status_t notmuch_message_get_flag_st(notmuch_message_t *message, ;; notmuch_message_flag_t flag, notmuch_bool_t *is_set); (define-public notmuch_message_get_flag_st (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_get_flag_st") (list '* ffi:int '*))))) (lambda (message flag is_set) (let ((message (unwrap-pointer message notmuch_message_t*)) (flag (unwrap~enum flag)) (is_set (unwrap-pointer is_set))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message flag is_set)))))) ;; void notmuch_message_set_flag(notmuch_message_t *message, ;; notmuch_message_flag_t flag, notmuch_bool_t value); (define-public notmuch_message_set_flag (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_message_set_flag") (list '* ffi:int ffi:int))))) (lambda (message flag value) (let ((message (unwrap-pointer message notmuch_message_t*)) (flag (unwrap~enum flag)) (value (unwrap-number value))) ((force ~proc) message flag value))))) ;; time_t notmuch_message_get_date(notmuch_message_t *message); (define-public notmuch_message_get_date (let ((~proc (delay (ffi:pointer->procedure ffi:long (foreign-pointer-search "notmuch_message_get_date") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((force ~proc) message))))) ;; const char *notmuch_message_get_header(notmuch_message_t *message, const ;; char *header); (define-public notmuch_message_get_header (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_header") (list '* '*))))) (lambda (message header) (let ((message (unwrap-pointer message notmuch_message_t*)) (header (unwrap-pointer header))) ((force ~proc) message header))))) ;; notmuch_tags_t *notmuch_message_get_tags(notmuch_message_t *message); (define-public notmuch_message_get_tags (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_tags") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (make-cdata notmuch_tags_t* ~ret)) ((force ~proc) message)))))) ;; notmuch_status_t notmuch_message_add_tag(notmuch_message_t *message, const ;; char *tag); (define-public notmuch_message_add_tag (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_add_tag") (list '* '*))))) (lambda (message tag) (let ((message (unwrap-pointer message notmuch_message_t*)) (tag (unwrap-pointer tag))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message tag)))))) ;; notmuch_status_t notmuch_message_remove_tag(notmuch_message_t *message, ;; const char *tag); (define-public notmuch_message_remove_tag (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_remove_tag") (list '* '*))))) (lambda (message tag) (let ((message (unwrap-pointer message notmuch_message_t*)) (tag (unwrap-pointer tag))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message tag)))))) ;; notmuch_status_t notmuch_message_remove_all_tags(notmuch_message_t *message) ;; ; (define-public notmuch_message_remove_all_tags (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_remove_all_tags") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message)))))) ;; notmuch_status_t notmuch_message_maildir_flags_to_tags(notmuch_message_t * ;; message); (define-public notmuch_message_maildir_flags_to_tags (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_maildir_flags_to_tags") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message)))))) ;; notmuch_bool_t notmuch_message_has_maildir_flag(notmuch_message_t *message, ;; char flag); (define-public notmuch_message_has_maildir_flag (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_has_maildir_flag") (list '* ffi:int8))))) (lambda (message flag) (let ((message (unwrap-pointer message notmuch_message_t*)) (flag (unwrap-number flag))) ((force ~proc) message flag))))) ;; notmuch_status_t notmuch_message_has_maildir_flag_st(notmuch_message_t * ;; message, char flag, notmuch_bool_t *is_set); (define-public notmuch_message_has_maildir_flag_st (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_has_maildir_flag_st") (list '* ffi:int8 '*))))) (lambda (message flag is_set) (let ((message (unwrap-pointer message notmuch_message_t*)) (flag (unwrap-number flag)) (is_set (unwrap-pointer is_set))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message flag is_set)))))) ;; notmuch_status_t notmuch_message_tags_to_maildir_flags(notmuch_message_t * ;; message); (define-public notmuch_message_tags_to_maildir_flags (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_tags_to_maildir_flags") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message)))))) ;; notmuch_status_t notmuch_message_freeze(notmuch_message_t *message); (define-public notmuch_message_freeze (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_freeze") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message)))))) ;; notmuch_status_t notmuch_message_thaw(notmuch_message_t *message); (define-public notmuch_message_thaw (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_thaw") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message)))))) ;; void notmuch_message_destroy(notmuch_message_t *message); (define-public notmuch_message_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_message_destroy") (list '*))))) (lambda (message) (let ((message (unwrap-pointer message notmuch_message_t*))) ((force ~proc) message))))) ;; notmuch_status_t notmuch_message_get_property(notmuch_message_t *message, ;; const char *key, const char **value); (define-public notmuch_message_get_property (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_get_property") (list '* '* '*))))) (lambda (message key value) (let ((message (unwrap-pointer message notmuch_message_t*)) (key (unwrap-pointer key)) (value (unwrap-pointer value))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message key value)))))) ;; notmuch_status_t notmuch_message_add_property(notmuch_message_t *message, ;; const char *key, const char *value); (define-public notmuch_message_add_property (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_add_property") (list '* '* '*))))) (lambda (message key value) (let ((message (unwrap-pointer message notmuch_message_t*)) (key (unwrap-pointer key)) (value (unwrap-pointer value))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message key value)))))) ;; notmuch_status_t notmuch_message_remove_property(notmuch_message_t *message ;; , const char *key, const char *value); (define-public notmuch_message_remove_property (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_remove_property") (list '* '* '*))))) (lambda (message key value) (let ((message (unwrap-pointer message notmuch_message_t*)) (key (unwrap-pointer key)) (value (unwrap-pointer value))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message key value)))))) ;; notmuch_status_t notmuch_message_remove_all_properties(notmuch_message_t * ;; message, const char *key); (define-public notmuch_message_remove_all_properties (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_remove_all_properties") (list '* '*))))) (lambda (message key) (let ((message (unwrap-pointer message notmuch_message_t*)) (key (unwrap-pointer key))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message key)))))) ;; notmuch_status_t notmuch_message_remove_all_properties_with_prefix( ;; notmuch_message_t *message, const char *prefix); (define-public notmuch_message_remove_all_properties_with_prefix (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_remove_all_properties_with_prefix") (list '* '*))))) (lambda (message prefix) (let ((message (unwrap-pointer message notmuch_message_t*)) (prefix (unwrap-pointer prefix))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message prefix)))))) ;; typedef struct _notmuch_string_map_iterator notmuch_message_properties_t; (define-public notmuch_message_properties_t* (name-ctype 'notmuch_message_properties_t* (cpointer 'void))) ;; notmuch_message_properties_t *notmuch_message_get_properties( ;; notmuch_message_t *message, const char *key, notmuch_bool_t exact); (define-public notmuch_message_get_properties (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_get_properties") (list '* '* ffi:int))))) (lambda (message key exact) (let ((message (unwrap-pointer message notmuch_message_t*)) (key (unwrap-pointer key)) (exact (unwrap-number exact))) ((lambda (~ret) (make-cdata notmuch_message_properties_t* ~ret)) ((force ~proc) message key exact)))))) ;; notmuch_status_t notmuch_message_count_properties(notmuch_message_t *message ;; , const char *key, unsigned int *count); (define-public notmuch_message_count_properties (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_count_properties") (list '* '* '*))))) (lambda (message key count) (let ((message (unwrap-pointer message notmuch_message_t*)) (key (unwrap-pointer key)) (count (unwrap-pointer count))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) message key count)))))) ;; notmuch_bool_t notmuch_message_properties_valid(notmuch_message_properties_t ;; *properties); (define-public notmuch_message_properties_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_message_properties_valid") (list '*))))) (lambda (properties) (let ((properties (unwrap-pointer properties notmuch_message_properties_t*))) ((force ~proc) properties))))) ;; void notmuch_message_properties_move_to_next(notmuch_message_properties_t * ;; properties); (define-public notmuch_message_properties_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_message_properties_move_to_next") (list '*))))) (lambda (properties) (let ((properties (unwrap-pointer properties notmuch_message_properties_t*))) ((force ~proc) properties))))) ;; const char *notmuch_message_properties_key(notmuch_message_properties_t * ;; properties); (define-public notmuch_message_properties_key (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_properties_key") (list '*))))) (lambda (properties) (let ((properties (unwrap-pointer properties notmuch_message_properties_t*))) ((force ~proc) properties))))) ;; const char *notmuch_message_properties_value(notmuch_message_properties_t * ;; properties); (define-public notmuch_message_properties_value (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_message_properties_value") (list '*))))) (lambda (properties) (let ((properties (unwrap-pointer properties notmuch_message_properties_t*))) ((force ~proc) properties))))) ;; void notmuch_message_properties_destroy(notmuch_message_properties_t * ;; properties); (define-public notmuch_message_properties_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_message_properties_destroy") (list '*))))) (lambda (properties) (let ((properties (unwrap-pointer properties notmuch_message_properties_t*))) ((force ~proc) properties))))) ;; notmuch_bool_t notmuch_tags_valid(notmuch_tags_t *tags); (define-public notmuch_tags_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_tags_valid") (list '*))))) (lambda (tags) (let ((tags (unwrap-pointer tags notmuch_tags_t*))) ((force ~proc) tags))))) ;; const char *notmuch_tags_get(notmuch_tags_t *tags); (define-public notmuch_tags_get (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_tags_get") (list '*))))) (lambda (tags) (let ((tags (unwrap-pointer tags notmuch_tags_t*))) ((force ~proc) tags))))) ;; void notmuch_tags_move_to_next(notmuch_tags_t *tags); (define-public notmuch_tags_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_tags_move_to_next") (list '*))))) (lambda (tags) (let ((tags (unwrap-pointer tags notmuch_tags_t*))) ((force ~proc) tags))))) ;; void notmuch_tags_destroy(notmuch_tags_t *tags); (define-public notmuch_tags_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_tags_destroy") (list '*))))) (lambda (tags) (let ((tags (unwrap-pointer tags notmuch_tags_t*))) ((force ~proc) tags))))) ;; notmuch_status_t notmuch_directory_set_mtime(notmuch_directory_t *directory ;; , time_t mtime); (define-public notmuch_directory_set_mtime (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_directory_set_mtime") (list '* ffi:long))))) (lambda (directory mtime) (let ((directory (unwrap-pointer directory notmuch_directory_t*)) (mtime (unwrap-number mtime))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) directory mtime)))))) ;; time_t notmuch_directory_get_mtime(notmuch_directory_t *directory); (define-public notmuch_directory_get_mtime (let ((~proc (delay (ffi:pointer->procedure ffi:long (foreign-pointer-search "notmuch_directory_get_mtime") (list '*))))) (lambda (directory) (let ((directory (unwrap-pointer directory notmuch_directory_t*))) ((force ~proc) directory))))) ;; notmuch_filenames_t *notmuch_directory_get_child_files(notmuch_directory_t * ;; directory); (define-public notmuch_directory_get_child_files (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_directory_get_child_files") (list '*))))) (lambda (directory) (let ((directory (unwrap-pointer directory notmuch_directory_t*))) ((lambda (~ret) (make-cdata notmuch_filenames_t* ~ret)) ((force ~proc) directory)))))) ;; notmuch_filenames_t *notmuch_directory_get_child_directories( ;; notmuch_directory_t *directory); (define-public notmuch_directory_get_child_directories (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_directory_get_child_directories") (list '*))))) (lambda (directory) (let ((directory (unwrap-pointer directory notmuch_directory_t*))) ((lambda (~ret) (make-cdata notmuch_filenames_t* ~ret)) ((force ~proc) directory)))))) ;; notmuch_status_t notmuch_directory_delete(notmuch_directory_t *directory); (define-public notmuch_directory_delete (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_directory_delete") (list '*))))) (lambda (directory) (let ((directory (unwrap-pointer directory notmuch_directory_t*))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) directory)))))) ;; void notmuch_directory_destroy(notmuch_directory_t *directory); (define-public notmuch_directory_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_directory_destroy") (list '*))))) (lambda (directory) (let ((directory (unwrap-pointer directory notmuch_directory_t*))) ((force ~proc) directory))))) ;; notmuch_bool_t notmuch_filenames_valid(notmuch_filenames_t *filenames); (define-public notmuch_filenames_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_filenames_valid") (list '*))))) (lambda (filenames) (let ((filenames (unwrap-pointer filenames notmuch_filenames_t*))) ((force ~proc) filenames))))) ;; const char *notmuch_filenames_get(notmuch_filenames_t *filenames); (define-public notmuch_filenames_get (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_filenames_get") (list '*))))) (lambda (filenames) (let ((filenames (unwrap-pointer filenames notmuch_filenames_t*))) ((force ~proc) filenames))))) ;; void notmuch_filenames_move_to_next(notmuch_filenames_t *filenames); (define-public notmuch_filenames_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_filenames_move_to_next") (list '*))))) (lambda (filenames) (let ((filenames (unwrap-pointer filenames notmuch_filenames_t*))) ((force ~proc) filenames))))) ;; void notmuch_filenames_destroy(notmuch_filenames_t *filenames); (define-public notmuch_filenames_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_filenames_destroy") (list '*))))) (lambda (filenames) (let ((filenames (unwrap-pointer filenames notmuch_filenames_t*))) ((force ~proc) filenames))))) ;; notmuch_status_t notmuch_database_set_config(notmuch_database_t *db, const ;; char *key, const char *value); (define-public notmuch_database_set_config (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_set_config") (list '* '* '*))))) (lambda (db key value) (let ((db (unwrap-pointer db notmuch_database_t*)) (key (unwrap-pointer key)) (value (unwrap-pointer value))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) db key value)))))) ;; notmuch_status_t notmuch_database_get_config(notmuch_database_t *db, const ;; char *key, char **value); (define-public notmuch_database_get_config (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_get_config") (list '* '* '*))))) (lambda (db key value) (let ((db (unwrap-pointer db notmuch_database_t*)) (key (unwrap-pointer key)) (value (unwrap-pointer value))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) db key value)))))) ;; notmuch_status_t notmuch_database_get_config_list(notmuch_database_t *db, ;; const char *prefix, notmuch_config_list_t **out); (define-public notmuch_database_get_config_list (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_database_get_config_list") (list '* '* '*))))) (lambda (db prefix out) (let ((db (unwrap-pointer db notmuch_database_t*)) (prefix (unwrap-pointer prefix)) (out (unwrap-pointer out))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) db prefix out)))))) ;; notmuch_bool_t notmuch_config_list_valid(notmuch_config_list_t *config_list) ;; ; (define-public notmuch_config_list_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_config_list_valid") (list '*))))) (lambda (config_list) (let ((config_list (unwrap-pointer config_list notmuch_config_list_t*))) ((force ~proc) config_list))))) ;; const char *notmuch_config_list_key(notmuch_config_list_t *config_list); (define-public notmuch_config_list_key (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_list_key") (list '*))))) (lambda (config_list) (let ((config_list (unwrap-pointer config_list notmuch_config_list_t*))) ((force ~proc) config_list))))) ;; const char *notmuch_config_list_value(notmuch_config_list_t *config_list); (define-public notmuch_config_list_value (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_list_value") (list '*))))) (lambda (config_list) (let ((config_list (unwrap-pointer config_list notmuch_config_list_t*))) ((force ~proc) config_list))))) ;; void notmuch_config_list_move_to_next(notmuch_config_list_t *config_list); (define-public notmuch_config_list_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_list_move_to_next") (list '*))))) (lambda (config_list) (let ((config_list (unwrap-pointer config_list notmuch_config_list_t*))) ((force ~proc) config_list))))) ;; void notmuch_config_list_destroy(notmuch_config_list_t *config_list); (define-public notmuch_config_list_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_list_destroy") (list '*))))) (lambda (config_list) (let ((config_list (unwrap-pointer config_list notmuch_config_list_t*))) ((force ~proc) config_list))))) ;; typedef enum { ;; NOTMUCH_CONFIG_FIRST, ;; NOTMUCH_CONFIG_DATABASE_PATH = NOTMUCH_CONFIG_FIRST, ;; NOTMUCH_CONFIG_MAIL_ROOT, ;; NOTMUCH_CONFIG_HOOK_DIR, ;; NOTMUCH_CONFIG_BACKUP_DIR, ;; NOTMUCH_CONFIG_EXCLUDE_TAGS, ;; NOTMUCH_CONFIG_NEW_TAGS, ;; NOTMUCH_CONFIG_NEW_IGNORE, ;; NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS, ;; NOTMUCH_CONFIG_PRIMARY_EMAIL, ;; NOTMUCH_CONFIG_OTHER_EMAIL, ;; NOTMUCH_CONFIG_USER_NAME, ;; NOTMUCH_CONFIG_AUTOCOMMIT, ;; NOTMUCH_CONFIG_EXTRA_HEADERS, ;; NOTMUCH_CONFIG_INDEX_AS_TEXT, ;; NOTMUCH_CONFIG_LAST, ;; } notmuch_config_key_t; (define-public notmuch_config_key_t (name-ctype 'notmuch_config_key_t (cenum '((NOTMUCH_CONFIG_FIRST 0) (NOTMUCH_CONFIG_DATABASE_PATH 0) (NOTMUCH_CONFIG_MAIL_ROOT 1) (NOTMUCH_CONFIG_HOOK_DIR 2) (NOTMUCH_CONFIG_BACKUP_DIR 3) (NOTMUCH_CONFIG_EXCLUDE_TAGS 4) (NOTMUCH_CONFIG_NEW_TAGS 5) (NOTMUCH_CONFIG_NEW_IGNORE 6) (NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS 7) (NOTMUCH_CONFIG_PRIMARY_EMAIL 8) (NOTMUCH_CONFIG_OTHER_EMAIL 9) (NOTMUCH_CONFIG_USER_NAME 10) (NOTMUCH_CONFIG_AUTOCOMMIT 11) (NOTMUCH_CONFIG_EXTRA_HEADERS 12) (NOTMUCH_CONFIG_INDEX_AS_TEXT 13) (NOTMUCH_CONFIG_LAST 14))))) (define-public unwrap-notmuch_config_key_t (let ((numf (cenum-numf (ctype-info notmuch_config_key_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_config_key_t (let ((symf (cenum-symf (ctype-info notmuch_config_key_t)))) (lambda (arg) (or (symf arg) arg)))) ;; const char *notmuch_config_get(notmuch_database_t *notmuch, ;; notmuch_config_key_t key); (define-public notmuch_config_get (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_get") (list '* ffi:int))))) (lambda (notmuch key) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (key (unwrap~enum key))) ((force ~proc) notmuch key))))) ;; notmuch_status_t notmuch_config_set(notmuch_database_t *notmuch, ;; notmuch_config_key_t key, const char *val); (define-public notmuch_config_set (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_config_set") (list '* ffi:int '*))))) (lambda (notmuch key val) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (key (unwrap~enum key)) (val (unwrap-pointer val))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) notmuch key val)))))) ;; notmuch_config_values_t *notmuch_config_get_values(notmuch_database_t * ;; notmuch, notmuch_config_key_t key); (define-public notmuch_config_get_values (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_get_values") (list '* ffi:int))))) (lambda (notmuch key) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (key (unwrap~enum key))) ((lambda (~ret) (make-cdata notmuch_config_values_t* ~ret)) ((force ~proc) notmuch key)))))) ;; notmuch_config_values_t *notmuch_config_get_values_string(notmuch_database_t ;; *notmuch, const char *key); (define-public notmuch_config_get_values_string (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_get_values_string") (list '* '*))))) (lambda (notmuch key) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (key (unwrap-pointer key))) ((lambda (~ret) (make-cdata notmuch_config_values_t* ~ret)) ((force ~proc) notmuch key)))))) ;; notmuch_bool_t notmuch_config_values_valid(notmuch_config_values_t *values); ;; (define-public notmuch_config_values_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_config_values_valid") (list '*))))) (lambda (values) (let ((values (unwrap-pointer values notmuch_config_values_t*))) ((force ~proc) values))))) ;; const char *notmuch_config_values_get(notmuch_config_values_t *values); (define-public notmuch_config_values_get (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_values_get") (list '*))))) (lambda (values) (let ((values (unwrap-pointer values notmuch_config_values_t*))) ((force ~proc) values))))) ;; void notmuch_config_values_move_to_next(notmuch_config_values_t *values); (define-public notmuch_config_values_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_values_move_to_next") (list '*))))) (lambda (values) (let ((values (unwrap-pointer values notmuch_config_values_t*))) ((force ~proc) values))))) ;; void notmuch_config_values_start(notmuch_config_values_t *values); (define-public notmuch_config_values_start (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_values_start") (list '*))))) (lambda (values) (let ((values (unwrap-pointer values notmuch_config_values_t*))) ((force ~proc) values))))) ;; void notmuch_config_values_destroy(notmuch_config_values_t *values); (define-public notmuch_config_values_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_values_destroy") (list '*))))) (lambda (values) (let ((values (unwrap-pointer values notmuch_config_values_t*))) ((force ~proc) values))))) ;; notmuch_config_pairs_t *notmuch_config_get_pairs(notmuch_database_t *notmuch ;; , const char *prefix); (define-public notmuch_config_get_pairs (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_get_pairs") (list '* '*))))) (lambda (notmuch prefix) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (prefix (unwrap-pointer prefix))) ((lambda (~ret) (make-cdata notmuch_config_pairs_t* ~ret)) ((force ~proc) notmuch prefix)))))) ;; notmuch_bool_t notmuch_config_pairs_valid(notmuch_config_pairs_t *pairs); (define-public notmuch_config_pairs_valid (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_config_pairs_valid") (list '*))))) (lambda (pairs) (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) ((force ~proc) pairs))))) ;; void notmuch_config_pairs_move_to_next(notmuch_config_pairs_t *pairs); (define-public notmuch_config_pairs_move_to_next (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_pairs_move_to_next") (list '*))))) (lambda (pairs) (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) ((force ~proc) pairs))))) ;; const char *notmuch_config_pairs_key(notmuch_config_pairs_t *pairs); (define-public notmuch_config_pairs_key (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_pairs_key") (list '*))))) (lambda (pairs) (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) ((force ~proc) pairs))))) ;; const char *notmuch_config_pairs_value(notmuch_config_pairs_t *pairs); (define-public notmuch_config_pairs_value (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_pairs_value") (list '*))))) (lambda (pairs) (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) ((force ~proc) pairs))))) ;; void notmuch_config_pairs_destroy(notmuch_config_pairs_t *pairs); (define-public notmuch_config_pairs_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_config_pairs_destroy") (list '*))))) (lambda (pairs) (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) ((force ~proc) pairs))))) ;; notmuch_status_t notmuch_config_get_bool(notmuch_database_t *notmuch, ;; notmuch_config_key_t key, notmuch_bool_t *val); (define-public notmuch_config_get_bool (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_config_get_bool") (list '* ffi:int '*))))) (lambda (notmuch key val) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*)) (key (unwrap~enum key)) (val (unwrap-pointer val))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) notmuch key val)))))) ;; const char *notmuch_config_path(notmuch_database_t *notmuch); (define-public notmuch_config_path (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_config_path") (list '*))))) (lambda (notmuch) (let ((notmuch (unwrap-pointer notmuch notmuch_database_t*))) ((force ~proc) notmuch))))) ;; notmuch_indexopts_t *notmuch_database_get_default_indexopts( ;; notmuch_database_t *db); (define-public notmuch_database_get_default_indexopts (let ((~proc (delay (ffi:pointer->procedure '* (foreign-pointer-search "notmuch_database_get_default_indexopts") (list '*))))) (lambda (db) (let ((db (unwrap-pointer db notmuch_database_t*))) ((lambda (~ret) (make-cdata notmuch_indexopts_t* ~ret)) ((force ~proc) db)))))) ;; typedef enum { ;; NOTMUCH_DECRYPT_FALSE, ;; NOTMUCH_DECRYPT_TRUE, ;; NOTMUCH_DECRYPT_AUTO, ;; NOTMUCH_DECRYPT_NOSTASH, ;; } notmuch_decryption_policy_t; (define-public notmuch_decryption_policy_t (name-ctype 'notmuch_decryption_policy_t (cenum '((NOTMUCH_DECRYPT_FALSE 0) (NOTMUCH_DECRYPT_TRUE 1) (NOTMUCH_DECRYPT_AUTO 2) (NOTMUCH_DECRYPT_NOSTASH 3))))) (define-public unwrap-notmuch_decryption_policy_t (let ((numf (cenum-numf (ctype-info notmuch_decryption_policy_t)))) (lambda (arg) (or (numf arg) arg)))) (define-public wrap-notmuch_decryption_policy_t (let ((symf (cenum-symf (ctype-info notmuch_decryption_policy_t)))) (lambda (arg) (or (symf arg) arg)))) ;; notmuch_status_t notmuch_indexopts_set_decrypt_policy(notmuch_indexopts_t * ;; indexopts, notmuch_decryption_policy_t decrypt_policy); (define-public notmuch_indexopts_set_decrypt_policy (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_indexopts_set_decrypt_policy") (list '* ffi:int))))) (lambda (indexopts decrypt_policy) (let ((indexopts (unwrap-pointer indexopts notmuch_indexopts_t*)) (decrypt_policy (unwrap~enum decrypt_policy))) ((lambda (~ret) (wrap-notmuch_status_t ~ret)) ((force ~proc) indexopts decrypt_policy)))))) ;; notmuch_decryption_policy_t notmuch_indexopts_get_decrypt_policy(const ;; notmuch_indexopts_t *indexopts); (define-public notmuch_indexopts_get_decrypt_policy (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_indexopts_get_decrypt_policy") (list '*))))) (lambda (indexopts) (let ((indexopts (unwrap-pointer indexopts notmuch_indexopts_t*))) ((lambda (~ret) (wrap-notmuch_decryption_policy_t ~ret)) ((force ~proc) indexopts)))))) ;; void notmuch_indexopts_destroy(notmuch_indexopts_t *options); (define-public notmuch_indexopts_destroy (let ((~proc (delay (ffi:pointer->procedure ffi:void (foreign-pointer-search "notmuch_indexopts_destroy") (list '*))))) (lambda (options) (let ((options (unwrap-pointer options notmuch_indexopts_t*))) ((force ~proc) options))))) ;; notmuch_bool_t notmuch_built_with(const char *name); (define-public notmuch_built_with (let ((~proc (delay (ffi:pointer->procedure ffi:int (foreign-pointer-search "notmuch_built_with") (list '*))))) (lambda (name) (let ((name (unwrap-pointer name))) ((force ~proc) name))))) ;; access to enum symbols and #define'd constants: (define ffi-notmuch-symbol-tab '((NOTMUCH_DECRYPT_NOSTASH . 3) (NOTMUCH_DECRYPT_AUTO . 2) (NOTMUCH_DECRYPT_TRUE . 1) (NOTMUCH_DECRYPT_FALSE . 0) (NOTMUCH_DECRYPT_NOSTASH . 3) (NOTMUCH_DECRYPT_AUTO . 2) (NOTMUCH_DECRYPT_TRUE . 1) (NOTMUCH_DECRYPT_FALSE . 0) (NOTMUCH_CONFIG_LAST . 14) (NOTMUCH_CONFIG_INDEX_AS_TEXT . 13) (NOTMUCH_CONFIG_EXTRA_HEADERS . 12) (NOTMUCH_CONFIG_AUTOCOMMIT . 11) (NOTMUCH_CONFIG_USER_NAME . 10) (NOTMUCH_CONFIG_OTHER_EMAIL . 9) (NOTMUCH_CONFIG_PRIMARY_EMAIL . 8) (NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS . 7) (NOTMUCH_CONFIG_NEW_IGNORE . 6) (NOTMUCH_CONFIG_NEW_TAGS . 5) (NOTMUCH_CONFIG_EXCLUDE_TAGS . 4) (NOTMUCH_CONFIG_BACKUP_DIR . 3) (NOTMUCH_CONFIG_HOOK_DIR . 2) (NOTMUCH_CONFIG_MAIL_ROOT . 1) (NOTMUCH_CONFIG_DATABASE_PATH . 0) (NOTMUCH_CONFIG_FIRST . 0) (NOTMUCH_CONFIG_LAST . 14) (NOTMUCH_CONFIG_INDEX_AS_TEXT . 13) (NOTMUCH_CONFIG_EXTRA_HEADERS . 12) (NOTMUCH_CONFIG_AUTOCOMMIT . 11) (NOTMUCH_CONFIG_USER_NAME . 10) (NOTMUCH_CONFIG_OTHER_EMAIL . 9) (NOTMUCH_CONFIG_PRIMARY_EMAIL . 8) (NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS . 7) (NOTMUCH_CONFIG_NEW_IGNORE . 6) (NOTMUCH_CONFIG_NEW_TAGS . 5) (NOTMUCH_CONFIG_EXCLUDE_TAGS . 4) (NOTMUCH_CONFIG_BACKUP_DIR . 3) (NOTMUCH_CONFIG_HOOK_DIR . 2) (NOTMUCH_CONFIG_MAIL_ROOT . 1) (NOTMUCH_CONFIG_DATABASE_PATH . 0) (NOTMUCH_CONFIG_FIRST . 0) (NOTMUCH_MESSAGE_FLAG_GHOST . 2) (NOTMUCH_MESSAGE_FLAG_EXCLUDED . 1) (NOTMUCH_MESSAGE_FLAG_MATCH . 0) (NOTMUCH_MESSAGE_FLAG_GHOST . 2) (NOTMUCH_MESSAGE_FLAG_EXCLUDED . 1) (NOTMUCH_MESSAGE_FLAG_MATCH . 0) (NOTMUCH_EXCLUDE_ALL . 3) (NOTMUCH_EXCLUDE_FALSE . 2) (NOTMUCH_EXCLUDE_TRUE . 1) (NOTMUCH_EXCLUDE_FLAG . 0) (NOTMUCH_EXCLUDE_ALL . 3) (NOTMUCH_EXCLUDE_FALSE . 2) (NOTMUCH_EXCLUDE_TRUE . 1) (NOTMUCH_EXCLUDE_FLAG . 0) (NOTMUCH_SORT_UNSORTED . 3) (NOTMUCH_SORT_MESSAGE_ID . 2) (NOTMUCH_SORT_NEWEST_FIRST . 1) (NOTMUCH_SORT_OLDEST_FIRST . 0) (NOTMUCH_SORT_UNSORTED . 3) (NOTMUCH_SORT_MESSAGE_ID . 2) (NOTMUCH_SORT_NEWEST_FIRST . 1) (NOTMUCH_SORT_OLDEST_FIRST . 0) (NOTMUCH_QUERY_SYNTAX_SEXP . 1) (NOTMUCH_QUERY_SYNTAX_XAPIAN . 0) (NOTMUCH_QUERY_SYNTAX_SEXP . 1) (NOTMUCH_QUERY_SYNTAX_XAPIAN . 0) (NOTMUCH_DATABASE_MODE_READ_WRITE . 1) (NOTMUCH_DATABASE_MODE_READ_ONLY . 0) (NOTMUCH_DATABASE_MODE_READ_WRITE . 1) (NOTMUCH_DATABASE_MODE_READ_ONLY . 0) (NOTMUCH_STATUS_LAST_STATUS . 25) (NOTMUCH_STATUS_CLOSED_DATABASE . 24) (NOTMUCH_STATUS_NO_MAIL_ROOT . 23) (NOTMUCH_STATUS_BAD_QUERY_SYNTAX . 22) (NOTMUCH_STATUS_DATABASE_EXISTS . 21) (NOTMUCH_STATUS_NO_DATABASE . 20) (NOTMUCH_STATUS_NO_CONFIG . 19) (NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL . 18) (NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION . 17) (NOTMUCH_STATUS_MALFORMED_CRYPTO_PROTOCOL . 16) (NOTMUCH_STATUS_ILLEGAL_ARGUMENT . 15) (NOTMUCH_STATUS_IGNORED . 14) (NOTMUCH_STATUS_PATH_ERROR . 13) (NOTMUCH_STATUS_UPGRADE_REQUIRED . 12) (NOTMUCH_STATUS_UNSUPPORTED_OPERATION . 11) (NOTMUCH_STATUS_UNBALANCED_ATOMIC . 10) (NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW . 9) (NOTMUCH_STATUS_TAG_TOO_LONG . 8) (NOTMUCH_STATUS_NULL_POINTER . 7) (NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID . 6) (NOTMUCH_STATUS_FILE_NOT_EMAIL . 5) (NOTMUCH_STATUS_FILE_ERROR . 4) (NOTMUCH_STATUS_XAPIAN_EXCEPTION . 3) (NOTMUCH_STATUS_READ_ONLY_DATABASE . 2) (NOTMUCH_STATUS_OUT_OF_MEMORY . 1) (NOTMUCH_STATUS_SUCCESS . 0) (NOTMUCH_STATUS_LAST_STATUS . 25) (NOTMUCH_STATUS_CLOSED_DATABASE . 24) (NOTMUCH_STATUS_NO_MAIL_ROOT . 23) (NOTMUCH_STATUS_BAD_QUERY_SYNTAX . 22) (NOTMUCH_STATUS_DATABASE_EXISTS . 21) (NOTMUCH_STATUS_NO_DATABASE . 20) (NOTMUCH_STATUS_NO_CONFIG . 19) (NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL . 18) (NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION . 17) (NOTMUCH_STATUS_MALFORMED_CRYPTO_PROTOCOL . 16) (NOTMUCH_STATUS_ILLEGAL_ARGUMENT . 15) (NOTMUCH_STATUS_IGNORED . 14) (NOTMUCH_STATUS_PATH_ERROR . 13) (NOTMUCH_STATUS_UPGRADE_REQUIRED . 12) (NOTMUCH_STATUS_UNSUPPORTED_OPERATION . 11) (NOTMUCH_STATUS_UNBALANCED_ATOMIC . 10) (NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW . 9) (NOTMUCH_STATUS_TAG_TOO_LONG . 8) (NOTMUCH_STATUS_NULL_POINTER . 7) (NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID . 6) (NOTMUCH_STATUS_FILE_NOT_EMAIL . 5) (NOTMUCH_STATUS_FILE_ERROR . 4) (NOTMUCH_STATUS_XAPIAN_EXCEPTION . 3) (NOTMUCH_STATUS_READ_ONLY_DATABASE . 2) (NOTMUCH_STATUS_OUT_OF_MEMORY . 1) (NOTMUCH_STATUS_SUCCESS . 0) (NOTMUCH_TAG_MAX . 200) (LIBNOTMUCH_MICRO_VERSION . 0) (LIBNOTMUCH_MINOR_VERSION . 6) (LIBNOTMUCH_MAJOR_VERSION . 5) (TRUE . 1) (FALSE . 0))) (define ffi-notmuch-symbol-val (lambda (k) (or (assq-ref ffi-notmuch-symbol-tab k)))) (export ffi-notmuch-symbol-val) (define (unwrap~enum arg) (cond ((number? arg) arg) ((symbol? arg) (ffi-notmuch-symbol-val arg)) ((cdata? arg) (cdata-ref arg)) (else (error "type mismatch")))) (define ffi-notmuch-types '("notmuch_status_t" (pointer . "notmuch_database_t") "notmuch_database_t" (pointer . "notmuch_query_t") "notmuch_query_t" (pointer . "notmuch_threads_t") "notmuch_threads_t" (pointer . "notmuch_thread_t") "notmuch_thread_t" (pointer . "notmuch_messages_t") "notmuch_messages_t" (pointer . "notmuch_message_t") "notmuch_message_t" (pointer . "notmuch_tags_t") "notmuch_tags_t" (pointer . "notmuch_directory_t") "notmuch_directory_t" (pointer . "notmuch_filenames_t") "notmuch_filenames_t" (pointer . "notmuch_config_list_t") "notmuch_config_list_t" (pointer . "notmuch_config_values_t") "notmuch_config_values_t" (pointer . "notmuch_config_pairs_t") "notmuch_config_pairs_t" (pointer . "notmuch_indexopts_t") "notmuch_indexopts_t" "notmuch_database_mode_t" "notmuch_compact_status_cb_t" "notmuch_query_syntax_t" "notmuch_sort_t" "notmuch_exclude_t" "notmuch_message_flag_t" (pointer . "notmuch_message_properties_t") "notmuch_message_properties_t" "notmuch_config_key_t" "notmuch_decryption_policy_t")) (export ffi-notmuch-types) ;; --- last line ---