diff options
author | Oscar Najera <hi@oscarnajera.com> | 2025-05-16 07:32:47 +0200 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2025-05-16 07:32:47 +0200 |
commit | 790f89e9687a5e291cf26a5a85bff871a46e675e (patch) | |
tree | 4c4b98410056bd56d46dea2f7655766a39396f7f /lib/guile/ffi | |
parent | cb3ab9a4b8b59226bc36d1240de77ee20f1e0760 (diff) | |
download | dotfiles-790f89e9687a5e291cf26a5a85bff871a46e675e.tar.gz dotfiles-790f89e9687a5e291cf26a5a85bff871a46e675e.tar.bz2 dotfiles-790f89e9687a5e291cf26a5a85bff871a46e675e.zip |
Update guile notmuch to nyacc 2
Now using cdata and discarding bytestructures and ffi-help-rt.
New constructor for types and how to access pointers or create more.
Not so clearly from documentation, but trying and scanning nyacc
examples kind of worked.
Diffstat (limited to 'lib/guile/ffi')
-rw-r--r-- | lib/guile/ffi/notmuch.scm | 4010 |
1 files changed, 1749 insertions, 2261 deletions
diff --git a/lib/guile/ffi/notmuch.scm b/lib/guile/ffi/notmuch.scm index 5c6fb6e..0939ad5 100644 --- a/lib/guile/ffi/notmuch.scm +++ b/lib/guile/ffi/notmuch.scm @@ -1,16 +1,21 @@ ;; 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)) + #:use-module (system foreign-library) + #:use-module (nyacc foreign cdata)) -(define ffi-notmuch-llibs - (delay (list (dynamic-link "libnotmuch")))) +(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-desc int) +(define-public notmuch_bool_t + (name-ctype 'notmuch_bool_t (cbase 'int))) ;; typedef enum { ;; NOTMUCH_STATUS_SUCCESS = 0, @@ -40,852 +45,678 @@ ;; 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)) +(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 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))))) +(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-notmuch_status_t status))) - ((force ~notmuch_status_to_string) ~status))))) -(export notmuch_status_to_string) + (let ((status (unwrap~enum status))) + ((force ~proc) status))))) ;; 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*) +(define-public notmuch_database_t* + (name-ctype + 'notmuch_database_t* + (cpointer 'void))) ;; 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*) +(define-public notmuch_query_t* + (name-ctype 'notmuch_query_t* (cpointer 'void))) ;; 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*) +(define-public notmuch_threads_t* + (name-ctype 'notmuch_threads_t* (cpointer 'void))) ;; 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*) +(define-public notmuch_thread_t* + (name-ctype 'notmuch_thread_t* (cpointer 'void))) ;; 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*) +(define-public notmuch_messages_t* + (name-ctype + 'notmuch_messages_t* + (cpointer 'void))) ;; 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*) +(define-public notmuch_message_t* + (name-ctype 'notmuch_message_t* (cpointer 'void))) ;; 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*) +(define-public notmuch_tags_t* + (name-ctype 'notmuch_tags_t* (cpointer 'void))) ;; 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*) +(define-public notmuch_directory_t* + (name-ctype + 'notmuch_directory_t* + (cpointer 'void))) ;; 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*) +(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-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*) +(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-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*) +(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-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*) +(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-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*) +(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 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))))) +(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))) - (wrap-notmuch_status_t - ((force ~notmuch_database_create) - ~path - ~database)))))) -(export notmuch_database_create) + (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 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))))) +(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))) - (wrap-notmuch_status_t - ((force ~notmuch_database_create_verbose) - ~path - ~database - ~error_message)))))) -(export notmuch_database_create_verbose) + (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 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)) +(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 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))))) +(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-notmuch_database_mode_t mode)) - (~database (unwrap~pointer database))) - (wrap-notmuch_status_t - ((force ~notmuch_database_open) - ~path - ~mode - ~database)))))) -(export notmuch_database_open) + (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 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))))) +(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-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) + (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 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))))) +(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-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) + (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 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))))) +(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))) - (wrap-notmuch_status_t - ((force ~notmuch_database_load_config) - ~database_path - ~config_path - ~profile - ~database - ~error_message)))))) -(export notmuch_database_load_config) + (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 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))))) +(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))) - (wrap-notmuch_status_t - ((force ~notmuch_database_create_with_config) - ~database_path - ~config_path - ~profile - ~database - ~error_message)))))) -(export notmuch_database_create_with_config) + (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 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))))) +(define-public notmuch_database_status_string + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_database_status_string") + (list '*))))) (lambda (notmuch) - (let ((~notmuch - ((fht-unwrap notmuch_database_t*) notmuch))) - ((force ~notmuch_database_status_string) - ~notmuch))))) -(export notmuch_database_status_string) + (let ((notmuch + (unwrap-pointer notmuch notmuch_database_t*))) + ((force ~proc) notmuch))))) ;; 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))))) +(define-public notmuch_database_close + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search "notmuch_database_close") + (list '*))))) (lambda (database) - (let ((~database - ((fht-unwrap notmuch_database_t*) database))) - (wrap-notmuch_status_t - ((force ~notmuch_database_close) ~database)))))) -(export notmuch_database_close) + (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-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) +(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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 notmuch_database_destroy - (let ((~notmuch_database_destroy - (delay (fh-link-proc - ffi:int - "notmuch_database_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_database_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search + "notmuch_database_destroy") + (list '*))))) (lambda (database) - (let ((~database - ((fht-unwrap notmuch_database_t*) database))) - (wrap-notmuch_status_t - ((force ~notmuch_database_destroy) ~database)))))) -(export notmuch_database_destroy) + (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 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))))) +(define-public notmuch_database_get_path + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_database_get_path") + (list '*))))) (lambda (database) - (let ((~database - ((fht-unwrap notmuch_database_t*) database))) - ((force ~notmuch_database_get_path) ~database))))) -(export notmuch_database_get_path) + (let ((database + (unwrap-pointer database notmuch_database_t*))) + ((force ~proc) database))))) ;; 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))))) +(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 - ((fht-unwrap notmuch_database_t*) database))) - ((force ~notmuch_database_get_version) ~database))))) -(export notmuch_database_get_version) + (let ((database + (unwrap-pointer database notmuch_database_t*))) + ((force ~proc) database))))) ;; 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))))) +(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 - ((fht-unwrap notmuch_database_t*) database))) - ((force ~notmuch_database_needs_upgrade) - ~database))))) -(export notmuch_database_needs_upgrade) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch))) - (wrap-notmuch_status_t - ((force ~notmuch_database_begin_atomic) ~notmuch)))))) -(export notmuch_database_begin_atomic) + (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 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))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch))) - (wrap-notmuch_status_t - ((force ~notmuch_database_end_atomic) ~notmuch)))))) -(export notmuch_database_end_atomic) + (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 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))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~uuid (unwrap~pointer uuid))) - ((force ~notmuch_database_get_revision) - ~notmuch - ~uuid))))) -(export notmuch_database_get_revision) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 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))))) +(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 ((fht-unwrap notmuch_database_t*) db))) - ((fht-wrap notmuch_tags_t*) - ((force ~notmuch_database_get_all_tags) ~db)))))) -(export notmuch_database_get_all_tags) + (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 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))))) +(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 ((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) + (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 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))))) +(define-public notmuch_query_create + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search "notmuch_query_create") + (list '* '*))))) (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) + (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 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)) +(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 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))))) +(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 - ((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) + (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, @@ -893,52 +724,44 @@ ;; 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)) +(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 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))))) +(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 ((fht-unwrap notmuch_query_t*) query))) - ((force ~notmuch_query_get_query_string) ~query))))) -(export notmuch_query_get_query_string) + (let ((query (unwrap-pointer query notmuch_query_t*))) + ((force ~proc) query))))) ;; 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))))) +(define-public notmuch_query_get_database + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_query_get_database") + (list '*))))) (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) + (let ((query (unwrap-pointer query notmuch_query_t*))) + ((lambda (~ret) + (make-cdata notmuch_database_t* ~ret)) + ((force ~proc) query)))))) ;; typedef enum { ;; NOTMUCH_EXCLUDE_FLAG, @@ -946,1542 +769,1276 @@ ;; 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)) +(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 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))))) +(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 ((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) + (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 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))))) +(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 ((fht-unwrap notmuch_query_t*) query)) - (~sort (unwrap-notmuch_sort_t sort))) - ((force ~notmuch_query_set_sort) ~query ~sort))))) -(export notmuch_query_set_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 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))))) +(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 ((fht-unwrap notmuch_query_t*) query))) - (wrap-notmuch_sort_t - ((force ~notmuch_query_get_sort) ~query)))))) -(export notmuch_query_get_sort) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 notmuch_query_destroy - (let ((~notmuch_query_destroy - (delay (fh-link-proc - ffi:void - "notmuch_query_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_query_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search "notmuch_query_destroy") + (list '*))))) (lambda (query) - (let ((~query ((fht-unwrap notmuch_query_t*) query))) - ((force ~notmuch_query_destroy) ~query))))) -(export notmuch_query_destroy) + (let ((query (unwrap-pointer query notmuch_query_t*))) + ((force ~proc) query))))) ;; 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))))) +(define-public notmuch_threads_valid + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search "notmuch_threads_valid") + (list '*))))) (lambda (threads) - (let ((~threads - ((fht-unwrap notmuch_threads_t*) threads))) - ((force ~notmuch_threads_valid) ~threads))))) -(export notmuch_threads_valid) + (let ((threads + (unwrap-pointer threads notmuch_threads_t*))) + ((force ~proc) threads))))) ;; 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))))) +(define-public notmuch_threads_get + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search "notmuch_threads_get") + (list '*))))) (lambda (threads) - (let ((~threads - ((fht-unwrap notmuch_threads_t*) threads))) - ((fht-wrap notmuch_thread_t*) - ((force ~notmuch_threads_get) ~threads)))))) -(export notmuch_threads_get) + (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 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))))) +(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 - ((fht-unwrap notmuch_threads_t*) threads))) - ((force ~notmuch_threads_move_to_next) ~threads))))) -(export notmuch_threads_move_to_next) + (let ((threads + (unwrap-pointer threads notmuch_threads_t*))) + ((force ~proc) threads))))) ;; 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))))) +(define-public notmuch_threads_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search + "notmuch_threads_destroy") + (list '*))))) (lambda (threads) - (let ((~threads - ((fht-unwrap notmuch_threads_t*) threads))) - ((force ~notmuch_threads_destroy) ~threads))))) -(export notmuch_threads_destroy) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((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) + (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 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_thread_id) ~thread))))) -(export notmuch_thread_get_thread_id) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_total_messages) - ~thread))))) -(export notmuch_thread_get_total_messages) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_total_files) ~thread))))) -(export notmuch_thread_get_total_files) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((fht-wrap notmuch_messages_t*) - ((force ~notmuch_thread_get_toplevel_messages) - ~thread)))))) -(export notmuch_thread_get_toplevel_messages) + (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 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))))) +(define-public notmuch_thread_get_messages + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_thread_get_messages") + (list '*))))) (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) + (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 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_matched_messages) - ~thread))))) -(export notmuch_thread_get_matched_messages) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(define-public notmuch_thread_get_authors + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_thread_get_authors") + (list '*))))) (lambda (thread) - (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_authors) ~thread))))) -(export notmuch_thread_get_authors) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(define-public notmuch_thread_get_subject + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_thread_get_subject") + (list '*))))) (lambda (thread) - (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_subject) ~thread))))) -(export notmuch_thread_get_subject) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_oldest_date) ~thread))))) -(export notmuch_thread_get_oldest_date) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(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 ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_get_newest_date) ~thread))))) -(export notmuch_thread_get_newest_date) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(define-public notmuch_thread_get_tags + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_thread_get_tags") + (list '*))))) (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) + (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 notmuch_thread_destroy - (let ((~notmuch_thread_destroy - (delay (fh-link-proc - ffi:void - "notmuch_thread_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_thread_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search "notmuch_thread_destroy") + (list '*))))) (lambda (thread) - (let ((~thread ((fht-unwrap notmuch_thread_t*) thread))) - ((force ~notmuch_thread_destroy) ~thread))))) -(export notmuch_thread_destroy) + (let ((thread + (unwrap-pointer thread notmuch_thread_t*))) + ((force ~proc) thread))))) ;; 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))))) +(define-public notmuch_messages_valid + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search "notmuch_messages_valid") + (list '*))))) (lambda (messages) - (let ((~messages - ((fht-unwrap notmuch_messages_t*) messages))) - ((force ~notmuch_messages_valid) ~messages))))) -(export notmuch_messages_valid) + (let ((messages + (unwrap-pointer messages notmuch_messages_t*))) + ((force ~proc) messages))))) ;; 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))))) +(define-public notmuch_messages_get + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search "notmuch_messages_get") + (list '*))))) (lambda (messages) - (let ((~messages - ((fht-unwrap notmuch_messages_t*) messages))) - ((fht-wrap notmuch_message_t*) - ((force ~notmuch_messages_get) ~messages)))))) -(export notmuch_messages_get) + (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 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))))) +(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 - ((fht-unwrap notmuch_messages_t*) messages))) - ((force ~notmuch_messages_move_to_next) - ~messages))))) -(export notmuch_messages_move_to_next) + (let ((messages + (unwrap-pointer messages notmuch_messages_t*))) + ((force ~proc) messages))))) ;; 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))))) +(define-public notmuch_messages_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search + "notmuch_messages_destroy") + (list '*))))) (lambda (messages) - (let ((~messages - ((fht-unwrap notmuch_messages_t*) messages))) - ((force ~notmuch_messages_destroy) ~messages))))) -(export notmuch_messages_destroy) + (let ((messages + (unwrap-pointer messages notmuch_messages_t*))) + ((force ~proc) messages))))) ;; 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))))) +(define-public notmuch_messages_collect_tags + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_messages_collect_tags") + (list '*))))) (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) + (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 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))))) +(define-public notmuch_message_get_database + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_get_database") + (list '*))))) (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) + (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 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))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - ((force ~notmuch_message_get_message_id) - ~message))))) -(export notmuch_message_get_message_id) + (let ((message + (unwrap-pointer message notmuch_message_t*))) + ((force ~proc) message))))) ;; 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))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - ((force ~notmuch_message_get_thread_id) ~message))))) -(export notmuch_message_get_thread_id) + (let ((message + (unwrap-pointer message notmuch_message_t*))) + ((force ~proc) message))))) ;; 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))))) +(define-public notmuch_message_get_replies + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_get_replies") + (list '*))))) (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) + (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 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))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - ((force ~notmuch_message_count_files) ~message))))) -(export notmuch_message_count_files) + (let ((message + (unwrap-pointer message notmuch_message_t*))) + ((force ~proc) message))))) ;; 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))))) +(define-public notmuch_message_get_filename + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_get_filename") + (list '*))))) (lambda (message) - (let ((~message - ((fht-unwrap notmuch_message_t*) message))) - ((force ~notmuch_message_get_filename) ~message))))) -(export notmuch_message_get_filename) + (let ((message + (unwrap-pointer message notmuch_message_t*))) + ((force ~proc) message))))) ;; 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))))) +(define-public notmuch_message_get_filenames + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_get_filenames") + (list '*))))) (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) + (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 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))))) +(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 - ((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) + (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 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)) +(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 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))))) +(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 - ((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) + (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 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))))) +(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 - ((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) + (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 notmuch_message_set_flag - (let ((~notmuch_message_set_flag - (delay (fh-link-proc - ffi:void - "notmuch_message_set_flag" - (list ffi-void* ffi:int ffi:int) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~flag (unwrap-notmuch_message_flag_t flag)) - (~value (unwrap~fixed value))) - ((force ~notmuch_message_set_flag) - ~message - ~flag - ~value))))) -(export notmuch_message_set_flag) + (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 notmuch_message_get_date - (let ((~notmuch_message_get_date - (delay (fh-link-proc - ffi:long - "notmuch_message_get_date" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - ((force ~notmuch_message_get_date) ~message))))) -(export notmuch_message_get_date) + (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 notmuch_message_get_header - (let ((~notmuch_message_get_header - (delay (fh-link-proc - ffi-void* - "notmuch_message_get_header" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~header (unwrap~pointer header))) - ((force ~notmuch_message_get_header) - ~message - ~header))))) -(export notmuch_message_get_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 notmuch_message_get_tags - (let ((~notmuch_message_get_tags - (delay (fh-link-proc - ffi-void* - "notmuch_message_get_tags" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_message_get_tags + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_get_tags") + (list '*))))) (lambda (message) - (let ((~message - ((fht-unwrap notmuch_message_t*) message))) - ((fht-wrap notmuch_tags_t*) - ((force ~notmuch_message_get_tags) ~message)))))) -(export notmuch_message_get_tags) + (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 notmuch_message_add_tag - (let ((~notmuch_message_add_tag - (delay (fh-link-proc - ffi:int - "notmuch_message_add_tag" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~tag (unwrap~pointer tag))) - (wrap-notmuch_status_t - ((force ~notmuch_message_add_tag) ~message ~tag)))))) -(export notmuch_message_add_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 notmuch_message_remove_tag - (let ((~notmuch_message_remove_tag - (delay (fh-link-proc - ffi:int - "notmuch_message_remove_tag" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~tag (unwrap~pointer tag))) - (wrap-notmuch_status_t - ((force ~notmuch_message_remove_tag) - ~message - ~tag)))))) -(export notmuch_message_remove_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 notmuch_message_remove_all_tags - (let ((~notmuch_message_remove_all_tags - (delay (fh-link-proc - ffi:int - "notmuch_message_remove_all_tags" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - (wrap-notmuch_status_t - ((force ~notmuch_message_remove_all_tags) - ~message)))))) -(export notmuch_message_remove_all_tags) + (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 notmuch_message_maildir_flags_to_tags - (let ((~notmuch_message_maildir_flags_to_tags - (delay (fh-link-proc - ffi:int - "notmuch_message_maildir_flags_to_tags" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - (wrap-notmuch_status_t - ((force ~notmuch_message_maildir_flags_to_tags) - ~message)))))) -(export notmuch_message_maildir_flags_to_tags) + (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 notmuch_message_has_maildir_flag - (let ((~notmuch_message_has_maildir_flag - (delay (fh-link-proc - ffi:int - "notmuch_message_has_maildir_flag" - (list ffi-void* ffi:int8) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~flag (unwrap~fixed flag))) - ((force ~notmuch_message_has_maildir_flag) - ~message - ~flag))))) -(export notmuch_message_has_maildir_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 notmuch_message_has_maildir_flag_st - (let ((~notmuch_message_has_maildir_flag_st - (delay (fh-link-proc - ffi:int - "notmuch_message_has_maildir_flag_st" - (list ffi-void* ffi:int8 ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~flag (unwrap~fixed flag)) - (~is_set (unwrap~pointer is_set))) - (wrap-notmuch_status_t - ((force ~notmuch_message_has_maildir_flag_st) - ~message - ~flag - ~is_set)))))) -(export notmuch_message_has_maildir_flag_st) + (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 notmuch_message_tags_to_maildir_flags - (let ((~notmuch_message_tags_to_maildir_flags - (delay (fh-link-proc - ffi:int - "notmuch_message_tags_to_maildir_flags" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message))) - (wrap-notmuch_status_t - ((force ~notmuch_message_tags_to_maildir_flags) - ~message)))))) -(export notmuch_message_tags_to_maildir_flags) + (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 notmuch_message_freeze - (let ((~notmuch_message_freeze - (delay (fh-link-proc - ffi:int - "notmuch_message_freeze" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_message_freeze + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search "notmuch_message_freeze") + (list '*))))) (lambda (message) - (let ((~message - ((fht-unwrap notmuch_message_t*) message))) - (wrap-notmuch_status_t - ((force ~notmuch_message_freeze) ~message)))))) -(export notmuch_message_freeze) + (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 notmuch_message_thaw - (let ((~notmuch_message_thaw - (delay (fh-link-proc - ffi:int - "notmuch_message_thaw" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_message_thaw + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search "notmuch_message_thaw") + (list '*))))) (lambda (message) - (let ((~message - ((fht-unwrap notmuch_message_t*) message))) - (wrap-notmuch_status_t - ((force ~notmuch_message_thaw) ~message)))))) -(export notmuch_message_thaw) + (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 notmuch_message_destroy - (let ((~notmuch_message_destroy - (delay (fh-link-proc - ffi:void - "notmuch_message_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_message_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search + "notmuch_message_destroy") + (list '*))))) (lambda (message) - (let ((~message - ((fht-unwrap notmuch_message_t*) message))) - ((force ~notmuch_message_destroy) ~message))))) -(export notmuch_message_destroy) + (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 notmuch_message_get_property - (let ((~notmuch_message_get_property - (delay (fh-link-proc - ffi:int - "notmuch_message_get_property" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~key (unwrap~pointer key)) - (~value (unwrap~pointer value))) - (wrap-notmuch_status_t - ((force ~notmuch_message_get_property) - ~message - ~key - ~value)))))) -(export notmuch_message_get_property) + (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 notmuch_message_add_property - (let ((~notmuch_message_add_property - (delay (fh-link-proc - ffi:int - "notmuch_message_add_property" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~key (unwrap~pointer key)) - (~value (unwrap~pointer value))) - (wrap-notmuch_status_t - ((force ~notmuch_message_add_property) - ~message - ~key - ~value)))))) -(export notmuch_message_add_property) + (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 notmuch_message_remove_property - (let ((~notmuch_message_remove_property - (delay (fh-link-proc - ffi:int - "notmuch_message_remove_property" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~key (unwrap~pointer key)) - (~value (unwrap~pointer value))) - (wrap-notmuch_status_t - ((force ~notmuch_message_remove_property) - ~message - ~key - ~value)))))) -(export notmuch_message_remove_property) + (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 notmuch_message_remove_all_properties - (let ((~notmuch_message_remove_all_properties - (delay (fh-link-proc - ffi:int - "notmuch_message_remove_all_properties" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~key (unwrap~pointer key))) - (wrap-notmuch_status_t - ((force ~notmuch_message_remove_all_properties) - ~message - ~key)))))) -(export notmuch_message_remove_all_properties) + (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 notmuch_message_remove_all_properties_with_prefix - (let ((~notmuch_message_remove_all_properties_with_prefix - (delay (fh-link-proc - ffi:int - "notmuch_message_remove_all_properties_with_prefix" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~prefix (unwrap~pointer prefix))) - (wrap-notmuch_status_t - ((force ~notmuch_message_remove_all_properties_with_prefix) - ~message - ~prefix)))))) -(export notmuch_message_remove_all_properties_with_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-desc 'void) -(define-fh-type-alias notmuch_message_properties_t fh-void) -(define-public notmuch_message_properties_t? fh-void?) -(define-public make-notmuch_message_properties_t make-fh-void) -(define-public notmuch_message_properties_t*-desc (fh:pointer notmuch_message_properties_t-desc)) -(define-fh-pointer-type notmuch_message_properties_t* - notmuch_message_properties_t*-desc notmuch_message_properties_t*? - make-notmuch_message_properties_t*) -(export notmuch_message_properties_t* notmuch_message_properties_t*? - make-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 notmuch_message_get_properties - (let ((~notmuch_message_get_properties - (delay (fh-link-proc - ffi-void* - "notmuch_message_get_properties" - (list ffi-void* ffi-void* ffi:int) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~key (unwrap~pointer key)) - (~exact (unwrap~fixed exact))) - ((fht-wrap notmuch_message_properties_t*) - ((force ~notmuch_message_get_properties) - ~message - ~key - ~exact)))))) -(export notmuch_message_get_properties) + (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 notmuch_message_count_properties - (let ((~notmuch_message_count_properties - (delay (fh-link-proc - ffi:int - "notmuch_message_count_properties" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_t*) message)) - (~key (unwrap~pointer key)) - (~count (unwrap~pointer count))) - (wrap-notmuch_status_t - ((force ~notmuch_message_count_properties) - ~message - ~key - ~count)))))) -(export notmuch_message_count_properties) + (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 notmuch_message_properties_valid - (let ((~notmuch_message_properties_valid - (delay (fh-link-proc - ffi:int - "notmuch_message_properties_valid" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_properties_t*) - properties))) - ((force ~notmuch_message_properties_valid) - ~properties))))) -(export notmuch_message_properties_valid) + (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 notmuch_message_properties_move_to_next - (let ((~notmuch_message_properties_move_to_next - (delay (fh-link-proc - ffi:void - "notmuch_message_properties_move_to_next" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_properties_t*) - properties))) - ((force ~notmuch_message_properties_move_to_next) - ~properties))))) -(export notmuch_message_properties_move_to_next) + (let ((properties + (unwrap-pointer + properties + notmuch_message_properties_t*))) + ((force ~proc) properties))))) ;; const char *notmuch_message_properties_key(notmuch_message_properties_t * ;; properties); -(define notmuch_message_properties_key - (let ((~notmuch_message_properties_key - (delay (fh-link-proc - ffi-void* - "notmuch_message_properties_key" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_message_properties_key + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_properties_key") + (list '*))))) (lambda (properties) - (let ((~properties - ((fht-unwrap notmuch_message_properties_t*) - properties))) - ((force ~notmuch_message_properties_key) - ~properties))))) -(export notmuch_message_properties_key) + (let ((properties + (unwrap-pointer + properties + notmuch_message_properties_t*))) + ((force ~proc) properties))))) ;; const char *notmuch_message_properties_value(notmuch_message_properties_t * ;; properties); -(define notmuch_message_properties_value - (let ((~notmuch_message_properties_value - (delay (fh-link-proc - ffi-void* - "notmuch_message_properties_value" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_message_properties_value + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_message_properties_value") + (list '*))))) (lambda (properties) - (let ((~properties - ((fht-unwrap notmuch_message_properties_t*) - properties))) - ((force ~notmuch_message_properties_value) - ~properties))))) -(export notmuch_message_properties_value) + (let ((properties + (unwrap-pointer + properties + notmuch_message_properties_t*))) + ((force ~proc) properties))))) ;; void notmuch_message_properties_destroy(notmuch_message_properties_t * ;; properties); -(define notmuch_message_properties_destroy - (let ((~notmuch_message_properties_destroy - (delay (fh-link-proc - ffi:void - "notmuch_message_properties_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_message_properties_t*) - properties))) - ((force ~notmuch_message_properties_destroy) - ~properties))))) -(export notmuch_message_properties_destroy) + (let ((properties + (unwrap-pointer + properties + notmuch_message_properties_t*))) + ((force ~proc) properties))))) ;; notmuch_bool_t notmuch_tags_valid(notmuch_tags_t *tags); -(define notmuch_tags_valid - (let ((~notmuch_tags_valid - (delay (fh-link-proc - ffi:int - "notmuch_tags_valid" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_tags_valid + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search "notmuch_tags_valid") + (list '*))))) (lambda (tags) - (let ((~tags ((fht-unwrap notmuch_tags_t*) tags))) - ((force ~notmuch_tags_valid) ~tags))))) -(export notmuch_tags_valid) + (let ((tags (unwrap-pointer tags notmuch_tags_t*))) + ((force ~proc) tags))))) ;; const char *notmuch_tags_get(notmuch_tags_t *tags); -(define notmuch_tags_get - (let ((~notmuch_tags_get - (delay (fh-link-proc - ffi-void* - "notmuch_tags_get" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_tags_get + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search "notmuch_tags_get") + (list '*))))) (lambda (tags) - (let ((~tags ((fht-unwrap notmuch_tags_t*) tags))) - ((force ~notmuch_tags_get) ~tags))))) -(export notmuch_tags_get) + (let ((tags (unwrap-pointer tags notmuch_tags_t*))) + ((force ~proc) tags))))) ;; void notmuch_tags_move_to_next(notmuch_tags_t *tags); -(define notmuch_tags_move_to_next - (let ((~notmuch_tags_move_to_next - (delay (fh-link-proc - ffi:void - "notmuch_tags_move_to_next" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 ((fht-unwrap notmuch_tags_t*) tags))) - ((force ~notmuch_tags_move_to_next) ~tags))))) -(export notmuch_tags_move_to_next) + (let ((tags (unwrap-pointer tags notmuch_tags_t*))) + ((force ~proc) tags))))) ;; void notmuch_tags_destroy(notmuch_tags_t *tags); -(define notmuch_tags_destroy - (let ((~notmuch_tags_destroy - (delay (fh-link-proc - ffi:void - "notmuch_tags_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_tags_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search "notmuch_tags_destroy") + (list '*))))) (lambda (tags) - (let ((~tags ((fht-unwrap notmuch_tags_t*) tags))) - ((force ~notmuch_tags_destroy) ~tags))))) -(export notmuch_tags_destroy) + (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 notmuch_directory_set_mtime - (let ((~notmuch_directory_set_mtime - (delay (fh-link-proc - ffi:int - "notmuch_directory_set_mtime" - (list ffi-void* ffi:long) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_directory_t*) directory)) - (~mtime (unwrap~fixed mtime))) - (wrap-notmuch_status_t - ((force ~notmuch_directory_set_mtime) - ~directory - ~mtime)))))) -(export notmuch_directory_set_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 notmuch_directory_get_mtime - (let ((~notmuch_directory_get_mtime - (delay (fh-link-proc - ffi:long - "notmuch_directory_get_mtime" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_directory_t*) directory))) - ((force ~notmuch_directory_get_mtime) ~directory))))) -(export notmuch_directory_get_mtime) + (let ((directory + (unwrap-pointer directory notmuch_directory_t*))) + ((force ~proc) directory))))) ;; notmuch_filenames_t *notmuch_directory_get_child_files(notmuch_directory_t * ;; directory); -(define notmuch_directory_get_child_files - (let ((~notmuch_directory_get_child_files - (delay (fh-link-proc - ffi-void* - "notmuch_directory_get_child_files" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_directory_t*) directory))) - ((fht-wrap notmuch_filenames_t*) - ((force ~notmuch_directory_get_child_files) - ~directory)))))) -(export notmuch_directory_get_child_files) + (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 notmuch_directory_get_child_directories - (let ((~notmuch_directory_get_child_directories - (delay (fh-link-proc - ffi-void* - "notmuch_directory_get_child_directories" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_directory_t*) directory))) - ((fht-wrap notmuch_filenames_t*) - ((force ~notmuch_directory_get_child_directories) - ~directory)))))) -(export notmuch_directory_get_child_directories) + (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 notmuch_directory_delete - (let ((~notmuch_directory_delete - (delay (fh-link-proc - ffi:int - "notmuch_directory_delete" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_directory_delete + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search + "notmuch_directory_delete") + (list '*))))) (lambda (directory) - (let ((~directory - ((fht-unwrap notmuch_directory_t*) directory))) - (wrap-notmuch_status_t - ((force ~notmuch_directory_delete) ~directory)))))) -(export notmuch_directory_delete) + (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 notmuch_directory_destroy - (let ((~notmuch_directory_destroy - (delay (fh-link-proc - ffi:void - "notmuch_directory_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_directory_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search + "notmuch_directory_destroy") + (list '*))))) (lambda (directory) - (let ((~directory - ((fht-unwrap notmuch_directory_t*) directory))) - ((force ~notmuch_directory_destroy) ~directory))))) -(export notmuch_directory_destroy) + (let ((directory + (unwrap-pointer directory notmuch_directory_t*))) + ((force ~proc) directory))))) ;; notmuch_bool_t notmuch_filenames_valid(notmuch_filenames_t *filenames); -(define notmuch_filenames_valid - (let ((~notmuch_filenames_valid - (delay (fh-link-proc - ffi:int - "notmuch_filenames_valid" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_filenames_valid + (let ((~proc (delay (ffi:pointer->procedure + ffi:int + (foreign-pointer-search + "notmuch_filenames_valid") + (list '*))))) (lambda (filenames) - (let ((~filenames - ((fht-unwrap notmuch_filenames_t*) filenames))) - ((force ~notmuch_filenames_valid) ~filenames))))) -(export notmuch_filenames_valid) + (let ((filenames + (unwrap-pointer filenames notmuch_filenames_t*))) + ((force ~proc) filenames))))) ;; const char *notmuch_filenames_get(notmuch_filenames_t *filenames); -(define notmuch_filenames_get - (let ((~notmuch_filenames_get - (delay (fh-link-proc - ffi-void* - "notmuch_filenames_get" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_filenames_get + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search "notmuch_filenames_get") + (list '*))))) (lambda (filenames) - (let ((~filenames - ((fht-unwrap notmuch_filenames_t*) filenames))) - ((force ~notmuch_filenames_get) ~filenames))))) -(export notmuch_filenames_get) + (let ((filenames + (unwrap-pointer filenames notmuch_filenames_t*))) + ((force ~proc) filenames))))) ;; void notmuch_filenames_move_to_next(notmuch_filenames_t *filenames); -(define notmuch_filenames_move_to_next - (let ((~notmuch_filenames_move_to_next - (delay (fh-link-proc - ffi:void - "notmuch_filenames_move_to_next" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_filenames_t*) filenames))) - ((force ~notmuch_filenames_move_to_next) - ~filenames))))) -(export notmuch_filenames_move_to_next) + (let ((filenames + (unwrap-pointer filenames notmuch_filenames_t*))) + ((force ~proc) filenames))))) ;; void notmuch_filenames_destroy(notmuch_filenames_t *filenames); -(define notmuch_filenames_destroy - (let ((~notmuch_filenames_destroy - (delay (fh-link-proc - ffi:void - "notmuch_filenames_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_filenames_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search + "notmuch_filenames_destroy") + (list '*))))) (lambda (filenames) - (let ((~filenames - ((fht-unwrap notmuch_filenames_t*) filenames))) - ((force ~notmuch_filenames_destroy) ~filenames))))) -(export notmuch_filenames_destroy) + (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 notmuch_database_set_config - (let ((~notmuch_database_set_config - (delay (fh-link-proc - ffi:int - "notmuch_database_set_config" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 ((fht-unwrap notmuch_database_t*) db)) - (~key (unwrap~pointer key)) - (~value (unwrap~pointer value))) - (wrap-notmuch_status_t - ((force ~notmuch_database_set_config) - ~db - ~key - ~value)))))) -(export notmuch_database_set_config) + (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 notmuch_database_get_config - (let ((~notmuch_database_get_config - (delay (fh-link-proc - ffi:int - "notmuch_database_get_config" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 ((fht-unwrap notmuch_database_t*) db)) - (~key (unwrap~pointer key)) - (~value (unwrap~pointer value))) - (wrap-notmuch_status_t - ((force ~notmuch_database_get_config) - ~db - ~key - ~value)))))) -(export notmuch_database_get_config) + (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 notmuch_database_get_config_list - (let ((~notmuch_database_get_config_list - (delay (fh-link-proc - ffi:int - "notmuch_database_get_config_list" - (list ffi-void* ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 ((fht-unwrap notmuch_database_t*) db)) - (~prefix (unwrap~pointer prefix)) - (~out (unwrap~pointer out))) - (wrap-notmuch_status_t - ((force ~notmuch_database_get_config_list) - ~db - ~prefix - ~out)))))) -(export notmuch_database_get_config_list) + (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 notmuch_config_list_valid - (let ((~notmuch_config_list_valid - (delay (fh-link-proc - ffi:int - "notmuch_config_list_valid" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_list_t*) config_list))) - ((force ~notmuch_config_list_valid) ~config_list))))) -(export notmuch_config_list_valid) + (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 notmuch_config_list_key - (let ((~notmuch_config_list_key - (delay (fh-link-proc - ffi-void* - "notmuch_config_list_key" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_list_t*) config_list))) - ((force ~notmuch_config_list_key) ~config_list))))) -(export notmuch_config_list_key) + (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 notmuch_config_list_value - (let ((~notmuch_config_list_value - (delay (fh-link-proc - ffi-void* - "notmuch_config_list_value" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_list_t*) config_list))) - ((force ~notmuch_config_list_value) ~config_list))))) -(export notmuch_config_list_value) + (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 notmuch_config_list_move_to_next - (let ((~notmuch_config_list_move_to_next - (delay (fh-link-proc - ffi:void - "notmuch_config_list_move_to_next" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_list_t*) config_list))) - ((force ~notmuch_config_list_move_to_next) - ~config_list))))) -(export notmuch_config_list_move_to_next) + (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 notmuch_config_list_destroy - (let ((~notmuch_config_list_destroy - (delay (fh-link-proc - ffi:void - "notmuch_config_list_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_list_t*) config_list))) - ((force ~notmuch_config_list_destroy) - ~config_list))))) -(export notmuch_config_list_destroy) + (let ((config_list + (unwrap-pointer + config_list + notmuch_config_list_t*))) + ((force ~proc) config_list))))) ;; typedef enum { ;; NOTMUCH_CONFIG_FIRST, @@ -2501,321 +2058,264 @@ ;; NOTMUCH_CONFIG_INDEX_AS_TEXT, ;; NOTMUCH_CONFIG_LAST, ;; } notmuch_config_key_t; -(define notmuch_config_key_t-enum-nvl - '((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 notmuch_config_key_t-enum-vnl - (map (lambda (pair) (cons (cdr pair) (car pair))) - notmuch_config_key_t-enum-nvl)) -(define-public (unwrap-notmuch_config_key_t n) - (cond - ((symbol? n) - (or (assq-ref notmuch_config_key_t-enum-nvl n) - (throw 'ffi-help-error "bad arg: ~A" n))) - ((integer? n) n) - (else (error "bad arg")))) -(define-public (wrap-notmuch_config_key_t v) - (assq-ref notmuch_config_key_t-enum-vnl v)) +(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 notmuch_config_get - (let ((~notmuch_config_get - (delay (fh-link-proc - ffi-void* - "notmuch_config_get" - (list ffi-void* ffi:int) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~key (unwrap-notmuch_config_key_t key))) - ((force ~notmuch_config_get) ~notmuch ~key))))) -(export notmuch_config_get) + (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 notmuch_config_set - (let ((~notmuch_config_set - (delay (fh-link-proc - ffi:int - "notmuch_config_set" - (list ffi-void* ffi:int ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~key (unwrap-notmuch_config_key_t key)) - (~val (unwrap~pointer val))) - (wrap-notmuch_status_t - ((force ~notmuch_config_set) ~notmuch ~key ~val)))))) -(export notmuch_config_set) + (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 notmuch_config_get_values - (let ((~notmuch_config_get_values - (delay (fh-link-proc - ffi-void* - "notmuch_config_get_values" - (list ffi-void* ffi:int) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~key (unwrap-notmuch_config_key_t key))) - ((fht-wrap notmuch_config_values_t*) - ((force ~notmuch_config_get_values) - ~notmuch - ~key)))))) -(export notmuch_config_get_values) + (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 notmuch_config_get_values_string - (let ((~notmuch_config_get_values_string - (delay (fh-link-proc - ffi-void* - "notmuch_config_get_values_string" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~key (unwrap~pointer key))) - ((fht-wrap notmuch_config_values_t*) - ((force ~notmuch_config_get_values_string) - ~notmuch - ~key)))))) -(export notmuch_config_get_values_string) + (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 notmuch_config_values_valid - (let ((~notmuch_config_values_valid - (delay (fh-link-proc - ffi:int - "notmuch_config_values_valid" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_values_t*) values))) - ((force ~notmuch_config_values_valid) ~values))))) -(export notmuch_config_values_valid) + (let ((values + (unwrap-pointer values notmuch_config_values_t*))) + ((force ~proc) values))))) ;; const char *notmuch_config_values_get(notmuch_config_values_t *values); -(define notmuch_config_values_get - (let ((~notmuch_config_values_get - (delay (fh-link-proc - ffi-void* - "notmuch_config_values_get" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_config_values_get + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_config_values_get") + (list '*))))) (lambda (values) - (let ((~values - ((fht-unwrap notmuch_config_values_t*) values))) - ((force ~notmuch_config_values_get) ~values))))) -(export notmuch_config_values_get) + (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 notmuch_config_values_move_to_next - (let ((~notmuch_config_values_move_to_next - (delay (fh-link-proc - ffi:void - "notmuch_config_values_move_to_next" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_values_t*) values))) - ((force ~notmuch_config_values_move_to_next) - ~values))))) -(export notmuch_config_values_move_to_next) + (let ((values + (unwrap-pointer values notmuch_config_values_t*))) + ((force ~proc) values))))) ;; void notmuch_config_values_start(notmuch_config_values_t *values); -(define notmuch_config_values_start - (let ((~notmuch_config_values_start - (delay (fh-link-proc - ffi:void - "notmuch_config_values_start" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_values_t*) values))) - ((force ~notmuch_config_values_start) ~values))))) -(export notmuch_config_values_start) + (let ((values + (unwrap-pointer values notmuch_config_values_t*))) + ((force ~proc) values))))) ;; void notmuch_config_values_destroy(notmuch_config_values_t *values); -(define notmuch_config_values_destroy - (let ((~notmuch_config_values_destroy - (delay (fh-link-proc - ffi:void - "notmuch_config_values_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_values_t*) values))) - ((force ~notmuch_config_values_destroy) ~values))))) -(export notmuch_config_values_destroy) + (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 notmuch_config_get_pairs - (let ((~notmuch_config_get_pairs - (delay (fh-link-proc - ffi-void* - "notmuch_config_get_pairs" - (list ffi-void* ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~prefix (unwrap~pointer prefix))) - ((fht-wrap notmuch_config_pairs_t*) - ((force ~notmuch_config_get_pairs) - ~notmuch - ~prefix)))))) -(export notmuch_config_get_pairs) + (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 notmuch_config_pairs_valid - (let ((~notmuch_config_pairs_valid - (delay (fh-link-proc - ffi:int - "notmuch_config_pairs_valid" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_pairs_t*) pairs))) - ((force ~notmuch_config_pairs_valid) ~pairs))))) -(export notmuch_config_pairs_valid) + (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 notmuch_config_pairs_move_to_next - (let ((~notmuch_config_pairs_move_to_next - (delay (fh-link-proc - ffi:void - "notmuch_config_pairs_move_to_next" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_pairs_t*) pairs))) - ((force ~notmuch_config_pairs_move_to_next) - ~pairs))))) -(export notmuch_config_pairs_move_to_next) + (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) + ((force ~proc) pairs))))) ;; const char *notmuch_config_pairs_key(notmuch_config_pairs_t *pairs); -(define notmuch_config_pairs_key - (let ((~notmuch_config_pairs_key - (delay (fh-link-proc - ffi-void* - "notmuch_config_pairs_key" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_config_pairs_key + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_config_pairs_key") + (list '*))))) (lambda (pairs) - (let ((~pairs - ((fht-unwrap notmuch_config_pairs_t*) pairs))) - ((force ~notmuch_config_pairs_key) ~pairs))))) -(export notmuch_config_pairs_key) + (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) + ((force ~proc) pairs))))) ;; const char *notmuch_config_pairs_value(notmuch_config_pairs_t *pairs); -(define notmuch_config_pairs_value - (let ((~notmuch_config_pairs_value - (delay (fh-link-proc - ffi-void* - "notmuch_config_pairs_value" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_config_pairs_value + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search + "notmuch_config_pairs_value") + (list '*))))) (lambda (pairs) - (let ((~pairs - ((fht-unwrap notmuch_config_pairs_t*) pairs))) - ((force ~notmuch_config_pairs_value) ~pairs))))) -(export notmuch_config_pairs_value) + (let ((pairs (unwrap-pointer pairs notmuch_config_pairs_t*))) + ((force ~proc) pairs))))) ;; void notmuch_config_pairs_destroy(notmuch_config_pairs_t *pairs); -(define notmuch_config_pairs_destroy - (let ((~notmuch_config_pairs_destroy - (delay (fh-link-proc - ffi:void - "notmuch_config_pairs_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_config_pairs_t*) pairs))) - ((force ~notmuch_config_pairs_destroy) ~pairs))))) -(export notmuch_config_pairs_destroy) + (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 notmuch_config_get_bool - (let ((~notmuch_config_get_bool - (delay (fh-link-proc - ffi:int - "notmuch_config_get_bool" - (list ffi-void* ffi:int ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_database_t*) notmuch)) - (~key (unwrap-notmuch_config_key_t key)) - (~val (unwrap~pointer val))) - (wrap-notmuch_status_t - ((force ~notmuch_config_get_bool) - ~notmuch - ~key - ~val)))))) -(export notmuch_config_get_bool) + (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 notmuch_config_path - (let ((~notmuch_config_path - (delay (fh-link-proc - ffi-void* - "notmuch_config_path" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_config_path + (let ((~proc (delay (ffi:pointer->procedure + '* + (foreign-pointer-search "notmuch_config_path") + (list '*))))) (lambda (notmuch) - (let ((~notmuch - ((fht-unwrap notmuch_database_t*) notmuch))) - ((force ~notmuch_config_path) ~notmuch))))) -(export notmuch_config_path) + (let ((notmuch + (unwrap-pointer notmuch notmuch_database_t*))) + ((force ~proc) notmuch))))) ;; notmuch_indexopts_t *notmuch_database_get_default_indexopts( ;; notmuch_database_t *db); -(define notmuch_database_get_default_indexopts - (let ((~notmuch_database_get_default_indexopts - (delay (fh-link-proc - ffi-void* - "notmuch_database_get_default_indexopts" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 ((fht-unwrap notmuch_database_t*) db))) - ((fht-wrap notmuch_indexopts_t*) - ((force ~notmuch_database_get_default_indexopts) - ~db)))))) -(export notmuch_database_get_default_indexopts) + (let ((db (unwrap-pointer db notmuch_database_t*))) + ((lambda (~ret) + (make-cdata notmuch_indexopts_t* ~ret)) + ((force ~proc) db)))))) ;; typedef enum { ;; NOTMUCH_DECRYPT_FALSE, @@ -2823,89 +2323,73 @@ ;; NOTMUCH_DECRYPT_AUTO, ;; NOTMUCH_DECRYPT_NOSTASH, ;; } notmuch_decryption_policy_t; -(define notmuch_decryption_policy_t-enum-nvl - '((NOTMUCH_DECRYPT_FALSE . 0) - (NOTMUCH_DECRYPT_TRUE . 1) - (NOTMUCH_DECRYPT_AUTO . 2) - (NOTMUCH_DECRYPT_NOSTASH . 3)) - ) -(define notmuch_decryption_policy_t-enum-vnl - (map (lambda (pair) (cons (cdr pair) (car pair))) - notmuch_decryption_policy_t-enum-nvl)) -(define-public (unwrap-notmuch_decryption_policy_t n) - (cond - ((symbol? n) - (or (assq-ref notmuch_decryption_policy_t-enum-nvl n) - (throw 'ffi-help-error "bad arg: ~A" n))) - ((integer? n) n) - (else (error "bad arg")))) -(define-public (wrap-notmuch_decryption_policy_t v) - (assq-ref notmuch_decryption_policy_t-enum-vnl v)) +(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 notmuch_indexopts_set_decrypt_policy - (let ((~notmuch_indexopts_set_decrypt_policy - (delay (fh-link-proc - ffi:int - "notmuch_indexopts_set_decrypt_policy" - (list ffi-void* ffi:int) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_indexopts_t*) indexopts)) - (~decrypt_policy - (unwrap-notmuch_decryption_policy_t - decrypt_policy))) - (wrap-notmuch_status_t - ((force ~notmuch_indexopts_set_decrypt_policy) - ~indexopts - ~decrypt_policy)))))) -(export notmuch_indexopts_set_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 notmuch_indexopts_get_decrypt_policy - (let ((~notmuch_indexopts_get_decrypt_policy - (delay (fh-link-proc - ffi:int - "notmuch_indexopts_get_decrypt_policy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 - ((fht-unwrap notmuch_indexopts_t*) indexopts))) - (wrap-notmuch_decryption_policy_t - ((force ~notmuch_indexopts_get_decrypt_policy) - ~indexopts)))))) -(export notmuch_indexopts_get_decrypt_policy) + (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 notmuch_indexopts_destroy - (let ((~notmuch_indexopts_destroy - (delay (fh-link-proc - ffi:void - "notmuch_indexopts_destroy" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(define-public notmuch_indexopts_destroy + (let ((~proc (delay (ffi:pointer->procedure + ffi:void + (foreign-pointer-search + "notmuch_indexopts_destroy") + (list '*))))) (lambda (options) - (let ((~options - ((fht-unwrap notmuch_indexopts_t*) options))) - ((force ~notmuch_indexopts_destroy) ~options))))) -(export notmuch_indexopts_destroy) + (let ((options + (unwrap-pointer options notmuch_indexopts_t*))) + ((force ~proc) options))))) ;; notmuch_bool_t notmuch_built_with(const char *name); -(define notmuch_built_with - (let ((~notmuch_built_with - (delay (fh-link-proc - ffi:int - "notmuch_built_with" - (list ffi-void*) - (force ffi-notmuch-llibs))))) +(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 ~notmuch_built_with) ~name))))) -(export notmuch_built_with) + (let ((name (unwrap-pointer name))) + ((force ~proc) name))))) ;; access to enum symbols and #define'd constants: (define ffi-notmuch-symbol-tab @@ -3047,25 +2531,29 @@ (or (assq-ref ffi-notmuch-symbol-tab k)))) (export ffi-notmuch-symbol-val) -(define (unwrap-enum obj) - (cond ((number? obj) obj) - ((symbol? obj) (ffi-notmuch-symbol-val obj)) - ((fh-object? obj) (struct-ref obj 0)) +(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 - '((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_compact_status_cb_t" - (pointer . "notmuch_message_properties_t") "notmuch_message_properties_t")) + '("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 --- |