;; generated with `guild compile-ffi ffi/notmuch.ffi' (define-module (ffi notmuch) #:use-module (system ffi-help-rt) #:use-module ((system foreign) #:prefix ffi:) #:use-module (bytestructures guile)) (define ffi-notmuch-llibs (delay (list (dynamic-link "libnotmuch")))) ;; typedef int notmuch_bool_t; (define-public notmuch_bool_t-desc 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 notmuch_status_t-enum-nvl '((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 notmuch_status_t-enum-vnl (map (lambda (pair) (cons (cdr pair) (car pair))) notmuch_status_t-enum-nvl)) (define-public (unwrap-notmuch_status_t n) (cond ((symbol? n) (or (assq-ref notmuch_status_t-enum-nvl n) (throw 'ffi-help-error "bad arg: ~A" n))) ((integer? n) n) (else (error "bad arg")))) (define-public (wrap-notmuch_status_t v) (assq-ref notmuch_status_t-enum-vnl v)) ;; const char *notmuch_status_to_string(notmuch_status_t status); (define notmuch_status_to_string (let ((~notmuch_status_to_string (delay (fh-link-proc ffi-void* "notmuch_status_to_string" (list ffi:int) (force ffi-notmuch-llibs))))) (lambda (status) (let ((~status (unwrap-notmuch_status_t status))) ((force ~notmuch_status_to_string) ~status))))) (export notmuch_status_to_string) ;; typedef struct _notmuch_database notmuch_database_t; (define-public notmuch_database_t-desc 'void) (define-fh-type-alias notmuch_database_t fh-void) (define-public notmuch_database_t? fh-void?) (define-public make-notmuch_database_t make-fh-void) (define-public notmuch_database_t*-desc (fh:pointer notmuch_database_t-desc)) (define-fh-pointer-type notmuch_database_t* notmuch_database_t*-desc notmuch_database_t*? make-notmuch_database_t*) (export notmuch_database_t* notmuch_database_t*? make-notmuch_database_t*) ;; typedef struct _notmuch_query notmuch_query_t; (define-public notmuch_query_t-desc 'void) (define-fh-type-alias notmuch_query_t fh-void) (define-public notmuch_query_t? fh-void?) (define-public make-notmuch_query_t make-fh-void) (define-public notmuch_query_t*-desc (fh:pointer notmuch_query_t-desc)) (define-fh-pointer-type notmuch_query_t* notmuch_query_t*-desc notmuch_query_t*? make-notmuch_query_t*) (export notmuch_query_t* notmuch_query_t*? make-notmuch_query_t*) ;; typedef struct _notmuch_threads notmuch_threads_t; (define-public notmuch_threads_t-desc 'void) (define-fh-type-alias notmuch_threads_t fh-void) (define-public notmuch_threads_t? fh-void?) (define-public make-notmuch_threads_t make-fh-void) (define-public notmuch_threads_t*-desc (fh:pointer notmuch_threads_t-desc)) (define-fh-pointer-type notmuch_threads_t* notmuch_threads_t*-desc notmuch_threads_t*? make-notmuch_threads_t*) (export notmuch_threads_t* notmuch_threads_t*? make-notmuch_threads_t*) ;; typedef struct _notmuch_thread notmuch_thread_t; (define-public notmuch_thread_t-desc 'void) (define-fh-type-alias notmuch_thread_t fh-void) (define-public notmuch_thread_t? fh-void?) (define-public make-notmuch_thread_t make-fh-void) (define-public notmuch_thread_t*-desc (fh:pointer notmuch_thread_t-desc)) (define-fh-pointer-type notmuch_thread_t* notmuch_thread_t*-desc notmuch_thread_t*? make-notmuch_thread_t*) (export notmuch_thread_t* notmuch_thread_t*? make-notmuch_thread_t*) ;; typedef struct _notmuch_messages notmuch_messages_t; (define-public notmuch_messages_t-desc 'void) (define-fh-type-alias notmuch_messages_t fh-void) (define-public notmuch_messages_t? fh-void?) (define-public make-notmuch_messages_t make-fh-void) (define-public notmuch_messages_t*-desc (fh:pointer notmuch_messages_t-desc)) (define-fh-pointer-type notmuch_messages_t* notmuch_messages_t*-desc notmuch_messages_t*? make-notmuch_messages_t*) (export notmuch_messages_t* notmuch_messages_t*? make-notmuch_messages_t*) ;; typedef struct _notmuch_message notmuch_message_t; (define-public notmuch_message_t-desc 'void) (define-fh-type-alias notmuch_message_t fh-void) (define-public notmuch_message_t? fh-void?) (define-public make-notmuch_message_t make-fh-void) (define-public notmuch_message_t*-desc (fh:pointer notmuch_message_t-desc)) (define-fh-pointer-type notmuch_message_t* notmuch_message_t*-desc notmuch_message_t*? make-notmuch_message_t*) (export notmuch_message_t* notmuch_message_t*? make-notmuch_message_t*) ;; typedef struct _notmuch_tags notmuch_tags_t; (define-public notmuch_tags_t-desc 'void) (define-fh-type-alias notmuch_tags_t fh-void) (define-public notmuch_tags_t? fh-void?) (define-public make-notmuch_tags_t make-fh-void) (define-public notmuch_tags_t*-desc (fh:pointer notmuch_tags_t-desc)) (define-fh-pointer-type notmuch_tags_t* notmuch_tags_t*-desc notmuch_tags_t*? make-notmuch_tags_t*) (export notmuch_tags_t* notmuch_tags_t*? make-notmuch_tags_t*) ;; typedef struct _notmuch_directory notmuch_directory_t; (define-public notmuch_directory_t-desc 'void) (define-fh-type-alias notmuch_directory_t fh-void) (define-public notmuch_directory_t? fh-void?) (define-public make-notmuch_directory_t make-fh-void) (define-public notmuch_directory_t*-desc (fh:pointer notmuch_directory_t-desc)) (define-fh-pointer-type notmuch_directory_t* notmuch_directory_t*-desc notmuch_directory_t*? make-notmuch_directory_t*) (export notmuch_directory_t* notmuch_directory_t*? make-notmuch_directory_t*) ;; typedef struct _notmuch_filenames notmuch_filenames_t; (define-public notmuch_filenames_t-desc 'void) (define-fh-type-alias notmuch_filenames_t fh-void) (define-public notmuch_filenames_t? fh-void?) (define-public make-notmuch_filenames_t make-fh-void) (define-public notmuch_filenames_t*-desc (fh:pointer notmuch_filenames_t-desc)) (define-fh-pointer-type notmuch_filenames_t* notmuch_filenames_t*-desc notmuch_filenames_t*? make-notmuch_filenames_t*) (export notmuch_filenames_t* notmuch_filenames_t*? make-notmuch_filenames_t*) ;; typedef struct _notmuch_config_list notmuch_config_list_t; (define-public notmuch_config_list_t-desc 'void) (define-fh-type-alias notmuch_config_list_t fh-void) (define-public notmuch_config_list_t? fh-void?) (define-public make-notmuch_config_list_t make-fh-void) (define-public notmuch_config_list_t*-desc (fh:pointer notmuch_config_list_t-desc)) (define-fh-pointer-type notmuch_config_list_t* notmuch_config_list_t*-desc notmuch_config_list_t*? make-notmuch_config_list_t*) (export notmuch_config_list_t* notmuch_config_list_t*? make-notmuch_config_list_t*) ;; typedef struct _notmuch_config_values notmuch_config_values_t; (define-public notmuch_config_values_t-desc 'void) (define-fh-type-alias notmuch_config_values_t fh-void) (define-public notmuch_config_values_t? fh-void?) (define-public make-notmuch_config_values_t make-fh-void) (define-public notmuch_config_values_t*-desc (fh:pointer notmuch_config_values_t-desc)) (define-fh-pointer-type notmuch_config_values_t* notmuch_config_values_t*-desc notmuch_config_values_t*? make-notmuch_config_values_t*) (export notmuch_config_values_t* notmuch_config_values_t*? make-notmuch_config_values_t*) ;; typedef struct _notmuch_config_pairs notmuch_config_pairs_t; (define-public notmuch_config_pairs_t-desc 'void) (define-fh-type-alias notmuch_config_pairs_t fh-void) (define-public notmuch_config_pairs_t? fh-void?) (define-public make-notmuch_config_pairs_t make-fh-void) (define-public notmuch_config_pairs_t*-desc (fh:pointer notmuch_config_pairs_t-desc)) (define-fh-pointer-type notmuch_config_pairs_t* notmuch_config_pairs_t*-desc notmuch_config_pairs_t*? make-notmuch_config_pairs_t*) (export notmuch_config_pairs_t* notmuch_config_pairs_t*? make-notmuch_config_pairs_t*) ;; typedef struct _notmuch_indexopts notmuch_indexopts_t; (define-public notmuch_indexopts_t-desc 'void) (define-fh-type-alias notmuch_indexopts_t fh-void) (define-public notmuch_indexopts_t? fh-void?) (define-public make-notmuch_indexopts_t make-fh-void) (define-public notmuch_indexopts_t*-desc (fh:pointer notmuch_indexopts_t-desc)) (define-fh-pointer-type notmuch_indexopts_t* notmuch_indexopts_t*-desc notmuch_indexopts_t*? make-notmuch_indexopts_t*) (export notmuch_indexopts_t* notmuch_indexopts_t*? make-notmuch_indexopts_t*) ;; notmuch_status_t notmuch_database_create(const char *path, ;; notmuch_database_t **database); (define notmuch_database_create (let ((~notmuch_database_create (delay (fh-link-proc ffi:int "notmuch_database_create" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (path database) (let ((~path (unwrap~pointer path)) (~database (unwrap~pointer database))) (wrap-notmuch_status_t ((force ~notmuch_database_create) ~path ~database)))))) (export notmuch_database_create) ;; notmuch_status_t notmuch_database_create_verbose(const char *path, ;; notmuch_database_t **database, char **error_message); (define notmuch_database_create_verbose (let ((~notmuch_database_create_verbose (delay (fh-link-proc ffi:int "notmuch_database_create_verbose" (list ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (path database error_message) (let ((~path (unwrap~pointer path)) (~database (unwrap~pointer database)) (~error_message (unwrap~pointer error_message))) (wrap-notmuch_status_t ((force ~notmuch_database_create_verbose) ~path ~database ~error_message)))))) (export notmuch_database_create_verbose) ;; typedef enum { ;; NOTMUCH_DATABASE_MODE_READ_ONLY = 0, ;; NOTMUCH_DATABASE_MODE_READ_WRITE, ;; } notmuch_database_mode_t; (define notmuch_database_mode_t-enum-nvl '((NOTMUCH_DATABASE_MODE_READ_ONLY . 0) (NOTMUCH_DATABASE_MODE_READ_WRITE . 1)) ) (define notmuch_database_mode_t-enum-vnl (map (lambda (pair) (cons (cdr pair) (car pair))) notmuch_database_mode_t-enum-nvl)) (define-public (unwrap-notmuch_database_mode_t n) (cond ((symbol? n) (or (assq-ref notmuch_database_mode_t-enum-nvl n) (throw 'ffi-help-error "bad arg: ~A" n))) ((integer? n) n) (else (error "bad arg")))) (define-public (wrap-notmuch_database_mode_t v) (assq-ref notmuch_database_mode_t-enum-vnl v)) ;; notmuch_status_t notmuch_database_open(const char *path, ;; notmuch_database_mode_t mode, notmuch_database_t **database); (define notmuch_database_open (let ((~notmuch_database_open (delay (fh-link-proc ffi:int "notmuch_database_open" (list ffi-void* ffi:int ffi-void*) (force ffi-notmuch-llibs))))) (lambda (path mode database) (let ((~path (unwrap~pointer path)) (~mode (unwrap-notmuch_database_mode_t mode)) (~database (unwrap~pointer database))) (wrap-notmuch_status_t ((force ~notmuch_database_open) ~path ~mode ~database)))))) (export notmuch_database_open) ;; notmuch_status_t notmuch_database_open_verbose(const char *path, ;; notmuch_database_mode_t mode, notmuch_database_t **database, char ** ;; error_message); (define notmuch_database_open_verbose (let ((~notmuch_database_open_verbose (delay (fh-link-proc ffi:int "notmuch_database_open_verbose" (list ffi-void* ffi:int ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (path mode database error_message) (let ((~path (unwrap~pointer path)) (~mode (unwrap-notmuch_database_mode_t mode)) (~database (unwrap~pointer database)) (~error_message (unwrap~pointer error_message))) (wrap-notmuch_status_t ((force ~notmuch_database_open_verbose) ~path ~mode ~database ~error_message)))))) (export notmuch_database_open_verbose) ;; 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 notmuch_database_open_with_config (let ((~notmuch_database_open_with_config (delay (fh-link-proc ffi:int "notmuch_database_open_with_config" (list ffi-void* ffi:int ffi-void* ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database_path mode config_path profile database error_message) (let ((~database_path (unwrap~pointer database_path)) (~mode (unwrap-notmuch_database_mode_t mode)) (~config_path (unwrap~pointer config_path)) (~profile (unwrap~pointer profile)) (~database (unwrap~pointer database)) (~error_message (unwrap~pointer error_message))) (wrap-notmuch_status_t ((force ~notmuch_database_open_with_config) ~database_path ~mode ~config_path ~profile ~database ~error_message)))))) (export notmuch_database_open_with_config) ;; 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 notmuch_database_load_config (let ((~notmuch_database_load_config (delay (fh-link-proc ffi:int "notmuch_database_load_config" (list ffi-void* ffi-void* ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (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))) (wrap-notmuch_status_t ((force ~notmuch_database_load_config) ~database_path ~config_path ~profile ~database ~error_message)))))) (export notmuch_database_load_config) ;; 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 notmuch_database_create_with_config (let ((~notmuch_database_create_with_config (delay (fh-link-proc ffi:int "notmuch_database_create_with_config" (list ffi-void* ffi-void* ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (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))) (wrap-notmuch_status_t ((force ~notmuch_database_create_with_config) ~database_path ~config_path ~profile ~database ~error_message)))))) (export notmuch_database_create_with_config) ;; const char *notmuch_database_status_string(const notmuch_database_t *notmuch ;; ); (define notmuch_database_status_string (let ((~notmuch_database_status_string (delay (fh-link-proc ffi-void* "notmuch_database_status_string" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (notmuch) (let ((~notmuch ((fht-unwrap notmuch_database_t*) notmuch))) ((force ~notmuch_database_status_string) ~notmuch))))) (export notmuch_database_status_string) ;; notmuch_status_t notmuch_database_close(notmuch_database_t *database); (define notmuch_database_close (let ((~notmuch_database_close (delay (fh-link-proc ffi:int "notmuch_database_close" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database) (let ((~database ((fht-unwrap notmuch_database_t*) database))) (wrap-notmuch_status_t ((force ~notmuch_database_close) ~database)))))) (export notmuch_database_close) ;; typedef void (*notmuch_compact_status_cb_t)(const char *message, void * ;; closure); (define-public notmuch_compact_status_cb_t-desc (fh:pointer (delay (fh:function 'void (list (fh:pointer int8) (fh:pointer 'void))))) ) (define-fh-function*-type notmuch_compact_status_cb_t notmuch_compact_status_cb_t-desc notmuch_compact_status_cb_t? make-notmuch_compact_status_cb_t) (export notmuch_compact_status_cb_t notmuch_compact_status_cb_t? make-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 notmuch_database_compact (let ((~notmuch_database_compact (delay (fh-link-proc ffi:int "notmuch_database_compact" (list ffi-void* ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (path backup_path status_cb closure) (let ((~path (unwrap~pointer path)) (~backup_path (unwrap~pointer backup_path)) (~status_cb ((fht-unwrap notmuch_compact_status_cb_t) status_cb)) (~closure (unwrap~pointer closure))) (wrap-notmuch_status_t ((force ~notmuch_database_compact) ~path ~backup_path ~status_cb ~closure)))))) (export notmuch_database_compact) ;; 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 notmuch_database_compact_db (let ((~notmuch_database_compact_db (delay (fh-link-proc ffi:int "notmuch_database_compact_db" (list ffi-void* ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database backup_path status_cb closure) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~backup_path (unwrap~pointer backup_path)) (~status_cb ((fht-unwrap notmuch_compact_status_cb_t) status_cb)) (~closure (unwrap~pointer closure))) (wrap-notmuch_status_t ((force ~notmuch_database_compact_db) ~database ~backup_path ~status_cb ~closure)))))) (export notmuch_database_compact_db) ;; notmuch_status_t notmuch_database_destroy(notmuch_database_t *database); (define notmuch_database_destroy (let ((~notmuch_database_destroy (delay (fh-link-proc ffi:int "notmuch_database_destroy" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database) (let ((~database ((fht-unwrap notmuch_database_t*) database))) (wrap-notmuch_status_t ((force ~notmuch_database_destroy) ~database)))))) (export notmuch_database_destroy) ;; const char *notmuch_database_get_path(notmuch_database_t *database); (define notmuch_database_get_path (let ((~notmuch_database_get_path (delay (fh-link-proc ffi-void* "notmuch_database_get_path" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database) (let ((~database ((fht-unwrap notmuch_database_t*) database))) ((force ~notmuch_database_get_path) ~database))))) (export notmuch_database_get_path) ;; unsigned int notmuch_database_get_version(notmuch_database_t *database); (define notmuch_database_get_version (let ((~notmuch_database_get_version (delay (fh-link-proc ffi:unsigned-int "notmuch_database_get_version" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database) (let ((~database ((fht-unwrap notmuch_database_t*) database))) ((force ~notmuch_database_get_version) ~database))))) (export notmuch_database_get_version) ;; notmuch_bool_t notmuch_database_needs_upgrade(notmuch_database_t *database); ;; (define notmuch_database_needs_upgrade (let ((~notmuch_database_needs_upgrade (delay (fh-link-proc ffi:int "notmuch_database_needs_upgrade" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database) (let ((~database ((fht-unwrap notmuch_database_t*) database))) ((force ~notmuch_database_needs_upgrade) ~database))))) (export notmuch_database_needs_upgrade) ;; notmuch_status_t notmuch_database_upgrade(notmuch_database_t *database, void ;; (*progress_notify)(void *closure, double progress), void *closure); (define notmuch_database_upgrade (let ((~notmuch_database_upgrade (delay (fh-link-proc ffi:int "notmuch_database_upgrade" (list ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database progress_notify closure) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~progress_notify ((make-fctn-param-unwrapper ffi:void (list ffi-void* ffi:double)) progress_notify)) (~closure (unwrap~pointer closure))) (wrap-notmuch_status_t ((force ~notmuch_database_upgrade) ~database ~progress_notify ~closure)))))) (export notmuch_database_upgrade) ;; notmuch_status_t notmuch_database_begin_atomic(notmuch_database_t *notmuch); ;; (define notmuch_database_begin_atomic (let ((~notmuch_database_begin_atomic (delay (fh-link-proc ffi:int "notmuch_database_begin_atomic" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (notmuch) (let ((~notmuch ((fht-unwrap notmuch_database_t*) notmuch))) (wrap-notmuch_status_t ((force ~notmuch_database_begin_atomic) ~notmuch)))))) (export notmuch_database_begin_atomic) ;; notmuch_status_t notmuch_database_end_atomic(notmuch_database_t *notmuch); (define notmuch_database_end_atomic (let ((~notmuch_database_end_atomic (delay (fh-link-proc ffi:int "notmuch_database_end_atomic" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (notmuch) (let ((~notmuch ((fht-unwrap notmuch_database_t*) notmuch))) (wrap-notmuch_status_t ((force ~notmuch_database_end_atomic) ~notmuch)))))) (export notmuch_database_end_atomic) ;; unsigned long notmuch_database_get_revision(notmuch_database_t *notmuch, ;; const char **uuid); (define notmuch_database_get_revision (let ((~notmuch_database_get_revision (delay (fh-link-proc ffi:unsigned-long "notmuch_database_get_revision" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (notmuch uuid) (let ((~notmuch ((fht-unwrap notmuch_database_t*) notmuch)) (~uuid (unwrap~pointer uuid))) ((force ~notmuch_database_get_revision) ~notmuch ~uuid))))) (export notmuch_database_get_revision) ;; notmuch_status_t notmuch_database_get_directory(notmuch_database_t *database ;; , const char *path, notmuch_directory_t **directory); (define notmuch_database_get_directory (let ((~notmuch_database_get_directory (delay (fh-link-proc ffi:int "notmuch_database_get_directory" (list ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database path directory) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~path (unwrap~pointer path)) (~directory (unwrap~pointer directory))) (wrap-notmuch_status_t ((force ~notmuch_database_get_directory) ~database ~path ~directory)))))) (export notmuch_database_get_directory) ;; notmuch_status_t notmuch_database_index_file(notmuch_database_t *database, ;; const char *filename, notmuch_indexopts_t *indexopts, notmuch_message_t ;; **message); (define notmuch_database_index_file (let ((~notmuch_database_index_file (delay (fh-link-proc ffi:int "notmuch_database_index_file" (list ffi-void* ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database filename indexopts message) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~filename (unwrap~pointer filename)) (~indexopts ((fht-unwrap notmuch_indexopts_t*) indexopts)) (~message (unwrap~pointer message))) (wrap-notmuch_status_t ((force ~notmuch_database_index_file) ~database ~filename ~indexopts ~message)))))) (export notmuch_database_index_file) ;; notmuch_status_t notmuch_database_add_message(notmuch_database_t *database, ;; const char *filename, notmuch_message_t **message); (define notmuch_database_add_message (let ((~notmuch_database_add_message (delay (fh-link-proc ffi:int "notmuch_database_add_message" (list ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database filename message) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~filename (unwrap~pointer filename)) (~message (unwrap~pointer message))) (wrap-notmuch_status_t ((force ~notmuch_database_add_message) ~database ~filename ~message)))))) (export notmuch_database_add_message) ;; notmuch_status_t notmuch_database_remove_message(notmuch_database_t * ;; database, const char *filename); (define notmuch_database_remove_message (let ((~notmuch_database_remove_message (delay (fh-link-proc ffi:int "notmuch_database_remove_message" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database filename) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~filename (unwrap~pointer filename))) (wrap-notmuch_status_t ((force ~notmuch_database_remove_message) ~database ~filename)))))) (export notmuch_database_remove_message) ;; notmuch_status_t notmuch_database_find_message(notmuch_database_t *database ;; , const char *message_id, notmuch_message_t **message); (define notmuch_database_find_message (let ((~notmuch_database_find_message (delay (fh-link-proc ffi:int "notmuch_database_find_message" (list ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database message_id message) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~message_id (unwrap~pointer message_id)) (~message (unwrap~pointer message))) (wrap-notmuch_status_t ((force ~notmuch_database_find_message) ~database ~message_id ~message)))))) (export notmuch_database_find_message) ;; notmuch_status_t notmuch_database_find_message_by_filename( ;; notmuch_database_t *notmuch, const char *filename, notmuch_message_t ** ;; message); (define notmuch_database_find_message_by_filename (let ((~notmuch_database_find_message_by_filename (delay (fh-link-proc ffi:int "notmuch_database_find_message_by_filename" (list ffi-void* ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (notmuch filename message) (let ((~notmuch ((fht-unwrap notmuch_database_t*) notmuch)) (~filename (unwrap~pointer filename)) (~message (unwrap~pointer message))) (wrap-notmuch_status_t ((force ~notmuch_database_find_message_by_filename) ~notmuch ~filename ~message)))))) (export notmuch_database_find_message_by_filename) ;; notmuch_tags_t *notmuch_database_get_all_tags(notmuch_database_t *db); (define notmuch_database_get_all_tags (let ((~notmuch_database_get_all_tags (delay (fh-link-proc ffi-void* "notmuch_database_get_all_tags" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (db) (let ((~db ((fht-unwrap notmuch_database_t*) db))) ((fht-wrap notmuch_tags_t*) ((force ~notmuch_database_get_all_tags) ~db)))))) (export notmuch_database_get_all_tags) ;; notmuch_status_t notmuch_database_reopen(notmuch_database_t *db, ;; notmuch_database_mode_t mode); (define notmuch_database_reopen (let ((~notmuch_database_reopen (delay (fh-link-proc ffi:int "notmuch_database_reopen" (list ffi-void* ffi:int) (force ffi-notmuch-llibs))))) (lambda (db mode) (let ((~db ((fht-unwrap notmuch_database_t*) db)) (~mode (unwrap-notmuch_database_mode_t mode))) (wrap-notmuch_status_t ((force ~notmuch_database_reopen) ~db ~mode)))))) (export notmuch_database_reopen) ;; notmuch_query_t *notmuch_query_create(notmuch_database_t *database, const ;; char *query_string); (define notmuch_query_create (let ((~notmuch_query_create (delay (fh-link-proc ffi-void* "notmuch_query_create" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database query_string) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~query_string (unwrap~pointer query_string))) ((fht-wrap notmuch_query_t*) ((force ~notmuch_query_create) ~database ~query_string)))))) (export notmuch_query_create) ;; typedef enum { ;; NOTMUCH_QUERY_SYNTAX_XAPIAN, ;; NOTMUCH_QUERY_SYNTAX_SEXP, ;; } notmuch_query_syntax_t; (define notmuch_query_syntax_t-enum-nvl '((NOTMUCH_QUERY_SYNTAX_XAPIAN . 0) (NOTMUCH_QUERY_SYNTAX_SEXP . 1)) ) (define notmuch_query_syntax_t-enum-vnl (map (lambda (pair) (cons (cdr pair) (car pair))) notmuch_query_syntax_t-enum-nvl)) (define-public (unwrap-notmuch_query_syntax_t n) (cond ((symbol? n) (or (assq-ref notmuch_query_syntax_t-enum-nvl n) (throw 'ffi-help-error "bad arg: ~A" n))) ((integer? n) n) (else (error "bad arg")))) (define-public (wrap-notmuch_query_syntax_t v) (assq-ref notmuch_query_syntax_t-enum-vnl v)) ;; 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 notmuch_query_create_with_syntax (let ((~notmuch_query_create_with_syntax (delay (fh-link-proc ffi:int "notmuch_query_create_with_syntax" (list ffi-void* ffi-void* ffi:int ffi-void*) (force ffi-notmuch-llibs))))) (lambda (database query_string syntax output) (let ((~database ((fht-unwrap notmuch_database_t*) database)) (~query_string (unwrap~pointer query_string)) (~syntax (unwrap-notmuch_query_syntax_t syntax)) (~output (unwrap~pointer output))) (wrap-notmuch_status_t ((force ~notmuch_query_create_with_syntax) ~database ~query_string ~syntax ~output)))))) (export notmuch_query_create_with_syntax) ;; typedef enum { ;; NOTMUCH_SORT_OLDEST_FIRST, ;; NOTMUCH_SORT_NEWEST_FIRST, ;; NOTMUCH_SORT_MESSAGE_ID, ;; NOTMUCH_SORT_UNSORTED, ;; } notmuch_sort_t; (define notmuch_sort_t-enum-nvl '((NOTMUCH_SORT_OLDEST_FIRST . 0) (NOTMUCH_SORT_NEWEST_FIRST . 1) (NOTMUCH_SORT_MESSAGE_ID . 2) (NOTMUCH_SORT_UNSORTED . 3)) ) (define notmuch_sort_t-enum-vnl (map (lambda (pair) (cons (cdr pair) (car pair))) notmuch_sort_t-enum-nvl)) (define-public (unwrap-notmuch_sort_t n) (cond ((symbol? n) (or (assq-ref notmuch_sort_t-enum-nvl n) (throw 'ffi-help-error "bad arg: ~A" n))) ((integer? n) n) (else (error "bad arg")))) (define-public (wrap-notmuch_sort_t v) (assq-ref notmuch_sort_t-enum-vnl v)) ;; const char *notmuch_query_get_query_string(const notmuch_query_t *query); (define notmuch_query_get_query_string (let ((~notmuch_query_get_query_string (delay (fh-link-proc ffi-void* "notmuch_query_get_query_string" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query) (let ((~query ((fht-unwrap notmuch_query_t*) query))) ((force ~notmuch_query_get_query_string) ~query))))) (export notmuch_query_get_query_string) ;; notmuch_database_t *notmuch_query_get_database(const notmuch_query_t *query) ;; ; (define notmuch_query_get_database (let ((~notmuch_query_get_database (delay (fh-link-proc ffi-void* "notmuch_query_get_database" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query) (let ((~query ((fht-unwrap notmuch_query_t*) query))) ((fht-wrap notmuch_database_t*) ((force ~notmuch_query_get_database) ~query)))))) (export notmuch_query_get_database) ;; typedef enum { ;; NOTMUCH_EXCLUDE_FLAG, ;; NOTMUCH_EXCLUDE_TRUE, ;; NOTMUCH_EXCLUDE_FALSE, ;; NOTMUCH_EXCLUDE_ALL, ;; } notmuch_exclude_t; (define notmuch_exclude_t-enum-nvl '((NOTMUCH_EXCLUDE_FLAG . 0) (NOTMUCH_EXCLUDE_TRUE . 1) (NOTMUCH_EXCLUDE_FALSE . 2) (NOTMUCH_EXCLUDE_ALL . 3)) ) (define notmuch_exclude_t-enum-vnl (map (lambda (pair) (cons (cdr pair) (car pair))) notmuch_exclude_t-enum-nvl)) (define-public (unwrap-notmuch_exclude_t n) (cond ((symbol? n) (or (assq-ref notmuch_exclude_t-enum-nvl n) (throw 'ffi-help-error "bad arg: ~A" n))) ((integer? n) n) (else (error "bad arg")))) (define-public (wrap-notmuch_exclude_t v) (assq-ref notmuch_exclude_t-enum-vnl v)) ;; void notmuch_query_set_omit_excluded(notmuch_query_t *query, ;; notmuch_exclude_t omit_excluded); (define notmuch_query_set_omit_excluded (let ((~notmuch_query_set_omit_excluded (delay (fh-link-proc ffi:void "notmuch_query_set_omit_excluded" (list ffi-void* ffi:int) (force ffi-notmuch-llibs))))) (lambda (query omit_excluded) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~omit_excluded (unwrap-notmuch_exclude_t omit_excluded))) ((force ~notmuch_query_set_omit_excluded) ~query ~omit_excluded))))) (export notmuch_query_set_omit_excluded) ;; void notmuch_query_set_sort(notmuch_query_t *query, notmuch_sort_t sort); (define notmuch_query_set_sort (let ((~notmuch_query_set_sort (delay (fh-link-proc ffi:void "notmuch_query_set_sort" (list ffi-void* ffi:int) (force ffi-notmuch-llibs))))) (lambda (query sort) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~sort (unwrap-notmuch_sort_t sort))) ((force ~notmuch_query_set_sort) ~query ~sort))))) (export notmuch_query_set_sort) ;; notmuch_sort_t notmuch_query_get_sort(const notmuch_query_t *query); (define notmuch_query_get_sort (let ((~notmuch_query_get_sort (delay (fh-link-proc ffi:int "notmuch_query_get_sort" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query) (let ((~query ((fht-unwrap notmuch_query_t*) query))) (wrap-notmuch_sort_t ((force ~notmuch_query_get_sort) ~query)))))) (export notmuch_query_get_sort) ;; notmuch_status_t notmuch_query_add_tag_exclude(notmuch_query_t *query, const ;; char *tag); (define notmuch_query_add_tag_exclude (let ((~notmuch_query_add_tag_exclude (delay (fh-link-proc ffi:int "notmuch_query_add_tag_exclude" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query tag) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~tag (unwrap~pointer tag))) (wrap-notmuch_status_t ((force ~notmuch_query_add_tag_exclude) ~query ~tag)))))) (export notmuch_query_add_tag_exclude) ;; notmuch_status_t notmuch_query_search_threads(notmuch_query_t *query, ;; notmuch_threads_t **out); (define notmuch_query_search_threads (let ((~notmuch_query_search_threads (delay (fh-link-proc ffi:int "notmuch_query_search_threads" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query out) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~out (unwrap~pointer out))) (wrap-notmuch_status_t ((force ~notmuch_query_search_threads) ~query ~out)))))) (export notmuch_query_search_threads) ;; notmuch_status_t notmuch_query_search_threads_st(notmuch_query_t *query, ;; notmuch_threads_t **out); (define notmuch_query_search_threads_st (let ((~notmuch_query_search_threads_st (delay (fh-link-proc ffi:int "notmuch_query_search_threads_st" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query out) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~out (unwrap~pointer out))) (wrap-notmuch_status_t ((force ~notmuch_query_search_threads_st) ~query ~out)))))) (export notmuch_query_search_threads_st) ;; notmuch_status_t notmuch_query_search_messages(notmuch_query_t *query, ;; notmuch_messages_t **out); (define notmuch_query_search_messages (let ((~notmuch_query_search_messages (delay (fh-link-proc ffi:int "notmuch_query_search_messages" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query out) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~out (unwrap~pointer out))) (wrap-notmuch_status_t ((force ~notmuch_query_search_messages) ~query ~out)))))) (export notmuch_query_search_messages) ;; notmuch_status_t notmuch_query_search_messages_st(notmuch_query_t *query, ;; notmuch_messages_t **out); (define notmuch_query_search_messages_st (let ((~notmuch_query_search_messages_st (delay (fh-link-proc ffi:int "notmuch_query_search_messages_st" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query out) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~out (unwrap~pointer out))) (wrap-notmuch_status_t ((force ~notmuch_query_search_messages_st) ~query ~out)))))) (export notmuch_query_search_messages_st) ;; void notmuch_query_destroy(notmuch_query_t *query); (define notmuch_query_destroy (let ((~notmuch_query_destroy (delay (fh-link-proc ffi:void "notmuch_query_destroy" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query) (let ((~query ((fht-unwrap notmuch_query_t*) query))) ((force ~notmuch_query_destroy) ~query))))) (export notmuch_query_destroy) ;; notmuch_bool_t notmuch_threads_valid(notmuch_threads_t *threads); (define notmuch_threads_valid (let ((~notmuch_threads_valid (delay (fh-link-proc ffi:int "notmuch_threads_valid" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (threads) (let ((~threads ((fht-unwrap notmuch_threads_t*) threads))) ((force ~notmuch_threads_valid) ~threads))))) (export notmuch_threads_valid) ;; notmuch_thread_t *notmuch_threads_get(notmuch_threads_t *threads); (define notmuch_threads_get (let ((~notmuch_threads_get (delay (fh-link-proc ffi-void* "notmuch_threads_get" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (threads) (let ((~threads ((fht-unwrap notmuch_threads_t*) threads))) ((fht-wrap notmuch_thread_t*) ((force ~notmuch_threads_get) ~threads)))))) (export notmuch_threads_get) ;; void notmuch_threads_move_to_next(notmuch_threads_t *threads); (define notmuch_threads_move_to_next (let ((~notmuch_threads_move_to_next (delay (fh-link-proc ffi:void "notmuch_threads_move_to_next" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (threads) (let ((~threads ((fht-unwrap notmuch_threads_t*) threads))) ((force ~notmuch_threads_move_to_next) ~threads))))) (export notmuch_threads_move_to_next) ;; void notmuch_threads_destroy(notmuch_threads_t *threads); (define notmuch_threads_destroy (let ((~notmuch_threads_destroy (delay (fh-link-proc ffi:void "notmuch_threads_destroy" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (threads) (let ((~threads ((fht-unwrap notmuch_threads_t*) threads))) ((force ~notmuch_threads_destroy) ~threads))))) (export notmuch_threads_destroy) ;; notmuch_status_t notmuch_query_count_messages(notmuch_query_t *query, ;; unsigned int *count); (define notmuch_query_count_messages (let ((~notmuch_query_count_messages (delay (fh-link-proc ffi:int "notmuch_query_count_messages" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query count) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~count (unwrap~pointer count))) (wrap-notmuch_status_t ((force ~notmuch_query_count_messages) ~query ~count)))))) (export notmuch_query_count_messages) ;; notmuch_status_t notmuch_query_count_messages_st(notmuch_query_t *query, ;; unsigned int *count); (define notmuch_query_count_messages_st (let ((~notmuch_query_count_messages_st (delay (fh-link-proc ffi:int "notmuch_query_count_messages_st" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query count) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~count (unwrap~pointer count))) (wrap-notmuch_status_t ((force ~notmuch_query_count_messages_st) ~query ~count)))))) (export notmuch_query_count_messages_st) ;; notmuch_status_t notmuch_query_count_threads(notmuch_query_t *query, ;; unsigned *count); (define notmuch_query_count_threads (let ((~notmuch_query_count_threads (delay (fh-link-proc ffi:int "notmuch_query_count_threads" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query count) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~count (unwrap~pointer count))) (wrap-notmuch_status_t ((force ~notmuch_query_count_threads) ~query ~count)))))) (export notmuch_query_count_threads) ;; notmuch_status_t notmuch_query_count_threads_st(notmuch_query_t *query, ;; unsigned *count); (define notmuch_query_count_threads_st (let ((~notmuch_query_count_threads_st (delay (fh-link-proc ffi:int "notmuch_query_count_threads_st" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (query count) (let ((~query ((fht-unwrap notmuch_query_t*) query)) (~count (unwrap~pointer count))) (wrap-notmuch_status_t ((force ~notmuch_query_count_threads_st) ~query ~count)))))) (export notmuch_query_count_threads_st) ;; const char *notmuch_thread_get_thread_id(notmuch_thread_t *thread); (define notmuch_thread_get_thread_id (let ((~notmuch_thread_get_thread_id (delay (fh-link-proc ffi-void* "notmuch_thread_get_thread_id" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_thread_id) ~thread))))) (export notmuch_thread_get_thread_id) ;; int notmuch_thread_get_total_messages(notmuch_thread_t *thread); (define notmuch_thread_get_total_messages (let ((~notmuch_thread_get_total_messages (delay (fh-link-proc ffi:int "notmuch_thread_get_total_messages" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_total_messages) ~thread))))) (export notmuch_thread_get_total_messages) ;; int notmuch_thread_get_total_files(notmuch_thread_t *thread); (define notmuch_thread_get_total_files (let ((~notmuch_thread_get_total_files (delay (fh-link-proc ffi:int "notmuch_thread_get_total_files" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_total_files) ~thread))))) (export notmuch_thread_get_total_files) ;; notmuch_messages_t *notmuch_thread_get_toplevel_messages(notmuch_thread_t * ;; thread); (define notmuch_thread_get_toplevel_messages (let ((~notmuch_thread_get_toplevel_messages (delay (fh-link-proc ffi-void* "notmuch_thread_get_toplevel_messages" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((fht-wrap notmuch_messages_t*) ((force ~notmuch_thread_get_toplevel_messages) ~thread)))))) (export notmuch_thread_get_toplevel_messages) ;; notmuch_messages_t *notmuch_thread_get_messages(notmuch_thread_t *thread); (define notmuch_thread_get_messages (let ((~notmuch_thread_get_messages (delay (fh-link-proc ffi-void* "notmuch_thread_get_messages" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((fht-wrap notmuch_messages_t*) ((force ~notmuch_thread_get_messages) ~thread)))))) (export notmuch_thread_get_messages) ;; int notmuch_thread_get_matched_messages(notmuch_thread_t *thread); (define notmuch_thread_get_matched_messages (let ((~notmuch_thread_get_matched_messages (delay (fh-link-proc ffi:int "notmuch_thread_get_matched_messages" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_matched_messages) ~thread))))) (export notmuch_thread_get_matched_messages) ;; const char *notmuch_thread_get_authors(notmuch_thread_t *thread); (define notmuch_thread_get_authors (let ((~notmuch_thread_get_authors (delay (fh-link-proc ffi-void* "notmuch_thread_get_authors" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_authors) ~thread))))) (export notmuch_thread_get_authors) ;; const char *notmuch_thread_get_subject(notmuch_thread_t *thread); (define notmuch_thread_get_subject (let ((~notmuch_thread_get_subject (delay (fh-link-proc ffi-void* "notmuch_thread_get_subject" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_subject) ~thread))))) (export notmuch_thread_get_subject) ;; time_t notmuch_thread_get_oldest_date(notmuch_thread_t *thread); (define notmuch_thread_get_oldest_date (let ((~notmuch_thread_get_oldest_date (delay (fh-link-proc ffi:long "notmuch_thread_get_oldest_date" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_oldest_date) ~thread))))) (export notmuch_thread_get_oldest_date) ;; time_t notmuch_thread_get_newest_date(notmuch_thread_t *thread); (define notmuch_thread_get_newest_date (let ((~notmuch_thread_get_newest_date (delay (fh-link-proc ffi:long "notmuch_thread_get_newest_date" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_get_newest_date) ~thread))))) (export notmuch_thread_get_newest_date) ;; notmuch_tags_t *notmuch_thread_get_tags(notmuch_thread_t *thread); (define notmuch_thread_get_tags (let ((~notmuch_thread_get_tags (delay (fh-link-proc ffi-void* "notmuch_thread_get_tags" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((fht-wrap notmuch_tags_t*) ((force ~notmuch_thread_get_tags) ~thread)))))) (export notmuch_thread_get_tags) ;; void notmuch_thread_destroy(notmuch_thread_t *thread); (define notmuch_thread_destroy (let ((~notmuch_thread_destroy (delay (fh-link-proc ffi:void "notmuch_thread_destroy" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (thread) (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) ((force ~notmuch_thread_destroy) ~thread))))) (export notmuch_thread_destroy) ;; notmuch_bool_t notmuch_messages_valid(notmuch_messages_t *messages); (define notmuch_messages_valid (let ((~notmuch_messages_valid (delay (fh-link-proc ffi:int "notmuch_messages_valid" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (messages) (let ((~messages ((fht-unwrap notmuch_messages_t*) messages))) ((force ~notmuch_messages_valid) ~messages))))) (export notmuch_messages_valid) ;; notmuch_message_t *notmuch_messages_get(notmuch_messages_t *messages); (define notmuch_messages_get (let ((~notmuch_messages_get (delay (fh-link-proc ffi-void* "notmuch_messages_get" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (messages) (let ((~messages ((fht-unwrap notmuch_messages_t*) messages))) ((fht-wrap notmuch_message_t*) ((force ~notmuch_messages_get) ~messages)))))) (export notmuch_messages_get) ;; void notmuch_messages_move_to_next(notmuch_messages_t *messages); (define notmuch_messages_move_to_next (let ((~notmuch_messages_move_to_next (delay (fh-link-proc ffi:void "notmuch_messages_move_to_next" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (messages) (let ((~messages ((fht-unwrap notmuch_messages_t*) messages))) ((force ~notmuch_messages_move_to_next) ~messages))))) (export notmuch_messages_move_to_next) ;; void notmuch_messages_destroy(notmuch_messages_t *messages); (define notmuch_messages_destroy (let ((~notmuch_messages_destroy (delay (fh-link-proc ffi:void "notmuch_messages_destroy" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (messages) (let ((~messages ((fht-unwrap notmuch_messages_t*) messages))) ((force ~notmuch_messages_destroy) ~messages))))) (export notmuch_messages_destroy) ;; notmuch_tags_t *notmuch_messages_collect_tags(notmuch_messages_t *messages); ;; (define notmuch_messages_collect_tags (let ((~notmuch_messages_collect_tags (delay (fh-link-proc ffi-void* "notmuch_messages_collect_tags" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (messages) (let ((~messages ((fht-unwrap notmuch_messages_t*) messages))) ((fht-wrap notmuch_tags_t*) ((force ~notmuch_messages_collect_tags) ~messages)))))) (export notmuch_messages_collect_tags) ;; notmuch_database_t *notmuch_message_get_database(const notmuch_message_t * ;; message); (define notmuch_message_get_database (let ((~notmuch_message_get_database (delay (fh-link-proc ffi-void* "notmuch_message_get_database" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((fht-wrap notmuch_database_t*) ((force ~notmuch_message_get_database) ~message)))))) (export notmuch_message_get_database) ;; const char *notmuch_message_get_message_id(notmuch_message_t *message); (define notmuch_message_get_message_id (let ((~notmuch_message_get_message_id (delay (fh-link-proc ffi-void* "notmuch_message_get_message_id" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((force ~notmuch_message_get_message_id) ~message))))) (export notmuch_message_get_message_id) ;; const char *notmuch_message_get_thread_id(notmuch_message_t *message); (define notmuch_message_get_thread_id (let ((~notmuch_message_get_thread_id (delay (fh-link-proc ffi-void* "notmuch_message_get_thread_id" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((force ~notmuch_message_get_thread_id) ~message))))) (export notmuch_message_get_thread_id) ;; notmuch_messages_t *notmuch_message_get_replies(notmuch_message_t *message); ;; (define notmuch_message_get_replies (let ((~notmuch_message_get_replies (delay (fh-link-proc ffi-void* "notmuch_message_get_replies" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((fht-wrap notmuch_messages_t*) ((force ~notmuch_message_get_replies) ~message)))))) (export notmuch_message_get_replies) ;; int notmuch_message_count_files(notmuch_message_t *message); (define notmuch_message_count_files (let ((~notmuch_message_count_files (delay (fh-link-proc ffi:int "notmuch_message_count_files" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((force ~notmuch_message_count_files) ~message))))) (export notmuch_message_count_files) ;; const char *notmuch_message_get_filename(notmuch_message_t *message); (define notmuch_message_get_filename (let ((~notmuch_message_get_filename (delay (fh-link-proc ffi-void* "notmuch_message_get_filename" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((force ~notmuch_message_get_filename) ~message))))) (export notmuch_message_get_filename) ;; notmuch_filenames_t *notmuch_message_get_filenames(notmuch_message_t * ;; message); (define notmuch_message_get_filenames (let ((~notmuch_message_get_filenames (delay (fh-link-proc ffi-void* "notmuch_message_get_filenames" (list ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message) (let ((~message ((fht-unwrap notmuch_message_t*) message))) ((fht-wrap notmuch_filenames_t*) ((force ~notmuch_message_get_filenames) ~message)))))) (export notmuch_message_get_filenames) ;; notmuch_status_t notmuch_message_reindex(notmuch_message_t *message, ;; notmuch_indexopts_t *indexopts); (define notmuch_message_reindex (let ((~notmuch_message_reindex (delay (fh-link-proc ffi:int "notmuch_message_reindex" (list ffi-void* ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message indexopts) (let ((~message ((fht-unwrap notmuch_message_t*) message)) (~indexopts ((fht-unwrap notmuch_indexopts_t*) indexopts))) (wrap-notmuch_status_t ((force ~notmuch_message_reindex) ~message ~indexopts)))))) (export notmuch_message_reindex) ;; typedef enum { ;; NOTMUCH_MESSAGE_FLAG_MATCH, ;; NOTMUCH_MESSAGE_FLAG_EXCLUDED, ;; NOTMUCH_MESSAGE_FLAG_GHOST, ;; } notmuch_message_flag_t; (define notmuch_message_flag_t-enum-nvl '((NOTMUCH_MESSAGE_FLAG_MATCH . 0) (NOTMUCH_MESSAGE_FLAG_EXCLUDED . 1) (NOTMUCH_MESSAGE_FLAG_GHOST . 2)) ) (define notmuch_message_flag_t-enum-vnl (map (lambda (pair) (cons (cdr pair) (car pair))) notmuch_message_flag_t-enum-nvl)) (define-public (unwrap-notmuch_message_flag_t n) (cond ((symbol? n) (or (assq-ref notmuch_message_flag_t-enum-nvl n) (throw 'ffi-help-error "bad arg: ~A" n))) ((integer? n) n) (else (error "bad arg")))) (define-public (wrap-notmuch_message_flag_t v) (assq-ref notmuch_message_flag_t-enum-vnl v)) ;; notmuch_bool_t notmuch_message_get_flag(notmuch_message_t *message, ;; notmuch_message_flag_t flag); (define notmuch_message_get_flag (let ((~notmuch_message_get_flag (delay (fh-link-proc ffi:int "notmuch_message_get_flag" (list ffi-void* ffi:int) (force ffi-notmuch-llibs))))) (lambda (message flag) (let ((~message ((fht-unwrap notmuch_message_t*) message)) (~flag (unwrap-notmuch_message_flag_t flag))) ((force ~notmuch_message_get_flag) ~message ~flag))))) (export notmuch_message_get_flag) ;; notmuch_status_t notmuch_message_get_flag_st(notmuch_message_t *message, ;; notmuch_message_flag_t flag, notmuch_bool_t *is_set); (define notmuch_message_get_flag_st (let ((~notmuch_message_get_flag_st (delay (fh-link-proc ffi:int "notmuch_message_get_flag_st" (list ffi-void* ffi:int ffi-void*) (force ffi-notmuch-llibs))))) (lambda (message flag is_set) (let ((~message ((fht-unwrap notmuch_message_t*) message)) (~flag (unwrap-notmuch_message_flag_t flag)) (~is_set (unwrap~pointer is_set))) (wrap-notmuch_status_t ((force ~notmuch_message_get_flag_st) ~message ~flag ~is_set)))))) (export notmuch_message_get_flag_st) ;; void notmuch_message_set_flag(notmuch_message_t *message, ;; notmuch_message_flag_t flag, notmuch_bool_t value); (define notmuch_message_set_flag (let ((~notmuch_message_set_flag (delay (fh-link-proc ffi:void "notmuch_message_set_flag"