1 module derelict.notmuch.dynload;
2 
3 version (Derelict_Static) {
4 } else version (DerelictNotMuch_Static) {
5 } else {
6 	version = DerelictNotMuch_Dynamic;
7 }
8 version (DerelictNotMuch_Dynamic)  :  //
9 
10 private {
11 	import derelict.util.loader;
12 	import derelict.util.exception;
13 	import derelict.util.system;
14 
15 	static if (Derelict_OS_Windows) {
16 		enum libNames = "libnotmuch.dll";
17 	} else static if (Derelict_OS_Posix) {
18 		enum libNames = "libnotmuch.so,/usr/local/lib/libnotmuch.so";
19 	} else {
20 		static assert(0, "Need to implement libnotmuch libNames for this operating system.");
21 	}
22 }
23 
24 extern (C) @nogc nothrow {
25 	import core.stdc.time;
26 	import derelict.notmuch.types;
27 
28 	/**
29 	* Get a string representation of a notmuch_status_t value.
30 	*
31 	* The result is read-only.
32 	*/
33 	alias da_notmuch_status_to_string = const(char)* function(notmuch_status_t status);
34 
35 	/**
36 	* Create a new, empty notmuch database located at 'path'.
37 	*
38 	* The path should be a top-level directory to a collection of
39 	* plain-text email messages (one message per file). This call will
40 	* create a new ".notmuch" directory within 'path' where notmuch will
41 	* store its data.
42 	*
43 	* After a successful call to notmuch_database_create, the returned
44 	* database will be open so the caller should call
45 	* notmuch_database_destroy when finished with it.
46 	*
47 	* The database will not yet have any data in it
48 	* (notmuch_database_create itself is a very cheap function). Messages
49 	* contained within 'path' can be added to the database by calling
50 	* notmuch_database_add_message.
51 	*
52 	* In case of any failure, this function returns an error status and
53 	* sets *database to NULL (after printing an error message on stderr).
54 	*
55 	* Return value:
56 	*
57 	* NOTMUCH_STATUS_SUCCESS: Successfully created the database.
58 	*
59 	* NOTMUCH_STATUS_NULL_POINTER: The given 'path' argument is NULL.
60 	*
61 	* NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory.
62 	*
63 	* NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to create the
64 	*	database file (such as permission denied, or file not found,
65 	*	etc.), or the database already exists.
66 	*
67 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred.
68 	*/
69 	alias da_notmuch_database_create = notmuch_status_t function(const(char)* path, notmuch_database_t** database);
70 
71 	/**
72 	* Like notmuch_database_create, except optionally return an error
73 	* message. This message is allocated by malloc and should be freed by
74 	* the caller.
75 	*/
76 	alias da_notmuch_database_create_verbose = notmuch_status_t function(const(char)* path,
77 			notmuch_database_t** database, char** error_message);
78 	/**
79 	* Open an existing notmuch database located at 'path'.
80 	*
81 	* The database should have been created at some time in the past,
82 	* (not necessarily by this process), by calling
83 	* notmuch_database_create with 'path'. By default the database should be
84 	* opened for reading only. In order to write to the database you need to
85 	* pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
86 	*
87 	* An existing notmuch database can be identified by the presence of a
88 	* directory named ".notmuch" below 'path'.
89 	*
90 	* The caller should call notmuch_database_destroy when finished with
91 	* this database.
92 	*
93 	* In case of any failure, this function returns an error status and
94 	* sets *database to NULL (after printing an error message on stderr).
95 	*
96 	* Return value:
97 	*
98 	* NOTMUCH_STATUS_SUCCESS: Successfully opened the database.
99 	*
100 	* NOTMUCH_STATUS_NULL_POINTER: The given 'path' argument is NULL.
101 	*
102 	* NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory.
103 	*
104 	* NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to open the
105 	*	database file (such as permission denied, or file not found,
106 	*	etc.), or the database version is unknown.
107 	*
108 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred.
109 	*/
110 	alias da_notmuch_database_open = notmuch_status_t function(const(char)* path, notmuch_database_mode_t mode,
111 			notmuch_database_t** database);
112 
113 	/**
114 	* Like notmuch_database_open, except optionally return an error
115 	* message. This message is allocated by malloc and should be freed by
116 	* the caller.
117 	*/
118 
119 	alias da_notmuch_database_open_verbose = notmuch_status_t function(const(char)* path, notmuch_database_mode_t mode,
120 			notmuch_database_t** database, char** error_message);
121 
122 	/**
123 	* Retrieve last status string for given database.
124 	*
125 	*/
126 	alias da_notmuch_database_status_string = const(char)* function(const notmuch_database_t* notmuch);
127 
128 	/**
129 	* Commit changes and close the given notmuch database.
130 	*
131 	* After notmuch_database_close has been called, calls to other
132 	* functions on objects derived from this database may either behave
133 	* as if the database had not been closed (e.g., if the required data
134 	* has been cached) or may fail with a
135 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION. The only further operation
136 	* permitted on the database itself is to call
137 	* notmuch_database_destroy.
138 	*
139 	* notmuch_database_close can be called multiple times.  Later calls
140 	* have no effect.
141 	*
142 	* For writable databases, notmuch_database_close commits all changes
143 	* to disk before closing the database.  If the caller is currently in
144 	* an atomic section (there was a notmuch_database_begin_atomic
145 	* without a matching notmuch_database_end_atomic), this will discard
146 	* changes made in that atomic section (but still commit changes made
147 	* prior to entering the atomic section).
148 	*
149 	* Return value:
150 	*
151 	* NOTMUCH_STATUS_SUCCESS: Successfully closed the database.
152 	*
153 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred; the
154 	*	database has been closed but there are no guarantees the
155 	*	changes to the database, if any, have been flushed to disk.
156 	*/
157 	alias da_notmuch_database_close = notmuch_status_t function(notmuch_database_t* database);
158 
159 	/**
160 	* Compact a notmuch database, backing up the original database to the
161 	* given path.
162 	*
163 	* The database will be opened with NOTMUCH_DATABASE_MODE_READ_WRITE
164 	* during the compaction process to ensure no writes are made.
165 	*
166 	* If the optional callback function 'status_cb' is non-NULL, it will
167 	* be called with diagnostic and informational messages. The argument
168 	* 'closure' is passed verbatim to any callback invoked.
169 	*/
170 	alias da_notmuch_database_compact = notmuch_status_t function(const(char)* path, const(char)* backup_path,
171 			notmuch_compact_status_cb_t status_cb, void* closure);
172 
173 	/**
174 	* Destroy the notmuch database, closing it if necessary and freeing
175 	* all associated resources.
176 	*
177 	* Return value as in notmuch_database_close if the database was open;
178 	* notmuch_database_destroy itself has no failure modes.
179 	*/
180 	alias da_notmuch_database_destroy = notmuch_status_t function(notmuch_database_t* database);
181 
182 	/**
183 	* Return the database path of the given database.
184 	*
185 	* The return value is a string owned by notmuch so should not be
186 	* modified nor freed by the caller.
187 	*/
188 	alias da_notmuch_database_get_path = const(char)* function(notmuch_database_t* database);
189 
190 	/**
191 	* Return the database format version of the given database.
192 	*/
193 	alias da_notmuch_database_get_version = uint function(notmuch_database_t* database);
194 
195 	/**
196 	* Can the database be upgraded to a newer database version?
197 	*
198 	* If this function returns TRUE, then the caller may call
199 	* notmuch_database_upgrade to upgrade the database.  If the caller
200 	* does not upgrade an out-of-date database, then some functions may
201 	* fail with NOTMUCH_STATUS_UPGRADE_REQUIRED.  This always returns
202 	* FALSE for a read-only database because there's no way to upgrade a
203 	* read-only database.
204 	*/
205 	alias da_notmuch_database_needs_upgrade = notmuch_bool_t function(notmuch_database_t* database);
206 
207 	/**
208 	* Upgrade the current database to the latest supported version.
209 	*
210 	* This ensures that all current notmuch functionality will be
211 	* available on the database.  After opening a database in read-write
212 	* mode, it is recommended that clients check if an upgrade is needed
213 	* (notmuch_database_needs_upgrade) and if so, upgrade with this
214 	* function before making any modifications.  If
215 	* notmuch_database_needs_upgrade returns FALSE, this will be a no-op.
216 	*
217 	* The optional progress_notify callback can be used by the caller to
218 	* provide progress indication to the user. If non-NULL it will be
219 	* called periodically with 'progress' as a floating-point value in
220 	* the range of [0.0 .. 1.0] indicating the progress made so far in
221 	* the upgrade process.  The argument 'closure' is passed verbatim to
222 	* any callback invoked.
223 	*/
224 	alias da_notmuch_database_upgrade = notmuch_status_t function(notmuch_database_t* database,
225 			void function(void* closure, double progress) progress_notify, void* closure);
226 
227 	/**
228 	* Begin an atomic database operation.
229 	*
230 	* Any modifications performed between a successful begin and a
231 	* notmuch_database_end_atomic will be applied to the database
232 	* atomically.  Note that, unlike a typical database transaction, this
233 	* only ensures atomicity, not durability; neither begin nor end
234 	* necessarily flush modifications to disk.
235 	*
236 	* Atomic sections may be nested.  begin_atomic and end_atomic must
237 	* always be called in pairs.
238 	*
239 	* Return value:
240 	*
241 	* NOTMUCH_STATUS_SUCCESS: Successfully entered atomic section.
242 	*
243 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred;
244 	*	atomic section not entered.
245 	*/
246 	alias da_notmuch_database_begin_atomic = notmuch_status_t function(notmuch_database_t* notmuch);
247 
248 	/**
249 	* Indicate the end of an atomic database operation.
250 	*
251 	* Return value:
252 	*
253 	* NOTMUCH_STATUS_SUCCESS: Successfully completed atomic section.
254 	*
255 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred;
256 	*	atomic section not ended.
257 	*
258 	* NOTMUCH_STATUS_UNBALANCED_ATOMIC: The database is not currently in
259 	*	an atomic section.
260 	*/
261 	alias da_notmuch_database_end_atomic = notmuch_status_t function(notmuch_database_t* notmuch);
262 
263 	/**
264 	* Return the committed database revision and UUID.
265 	*
266 	* The database revision number increases monotonically with each
267 	* commit to the database.  Hence, all messages and message changes
268 	* committed to the database (that is, visible to readers) have a last
269 	* modification revision <= the committed database revision.  Any
270 	* messages committed in the future will be assigned a modification
271 	* revision > the committed database revision.
272 	*
273 	* The UUID is a NUL-terminated opaque string that uniquely identifies
274 	* this database.  Two revision numbers are only comparable if they
275 	* have the same database UUID.
276 	*/
277 	alias da_notmuch_database_get_revision = ulong function(notmuch_database_t* notmuch, const(char)** uuid);
278 
279 	/**
280 	* Retrieve a directory object from the database for 'path'.
281 	*
282 	* Here, 'path' should be a path relative to the path of 'database'
283 	* (see notmuch_database_get_path), or else should be an absolute path
284 	* with initial components that match the path of 'database'.
285 	*
286 	* If this directory object does not exist in the database, this
287 	* returns NOTMUCH_STATUS_SUCCESS and sets *directory to NULL.
288 	*
289 	* Otherwise the returned directory object is owned by the database
290 	* and as such, will only be valid until notmuch_database_destroy is
291 	* called.
292 	*
293 	* Return value:
294 	*
295 	* NOTMUCH_STATUS_SUCCESS: Successfully retrieved directory.
296 	*
297 	* NOTMUCH_STATUS_NULL_POINTER: The given 'directory' argument is NULL.
298 	*
299 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred;
300 	*	directory not retrieved.
301 	*
302 	* NOTMUCH_STATUS_UPGRADE_REQUIRED: The caller must upgrade the
303 	* 	database to use this function.
304 	*/
305 	alias da_notmuch_database_get_directory = notmuch_status_t function(notmuch_database_t* database, const(char)* path,
306 			notmuch_directory_t** directory);
307 
308 	/**
309 	* Add a new message to the given notmuch database or associate an
310 	* additional filename with an existing message.
311 	*
312 	* Here, 'filename' should be a path relative to the path of
313 	* 'database' (see notmuch_database_get_path), or else should be an
314 	* absolute filename with initial components that match the path of
315 	* 'database'.
316 	*
317 	* The file should be a single mail message (not a multi-message mbox)
318 	* that is expected to remain at its current location, (since the
319 	* notmuch database will reference the filename, and will not copy the
320 	* entire contents of the file.
321 	*
322 	* If another message with the same message ID already exists in the
323 	* database, rather than creating a new message, this adds 'filename'
324 	* to the list of the filenames for the existing message.
325 	*
326 	* If 'message' is not NULL, then, on successful return
327 	* (NOTMUCH_STATUS_SUCCESS or NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) '*message'
328 	* will be initialized to a message object that can be used for things
329 	* such as adding tags to the just-added message. The user should call
330 	* notmuch_message_destroy when done with the message. On any failure
331 	* '*message' will be set to NULL.
332 	*
333 	* Return value:
334 	*
335 	* NOTMUCH_STATUS_SUCCESS: Message successfully added to database.
336 	*
337 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
338 	*	message not added.
339 	*
340 	* NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: Message has the same message
341 	*	ID as another message already in the database. The new
342 	*	filename was successfully added to the message in the database
343 	*	(if not already present) and the existing message is returned.
344 	*
345 	* NOTMUCH_STATUS_FILE_ERROR: an error occurred trying to open the
346 	*	file, (such as permission denied, or file not found,
347 	*	etc.). Nothing added to the database.
348 	*
349 	* NOTMUCH_STATUS_FILE_NOT_EMAIL: the contents of filename don't look
350 	*	like an email message. Nothing added to the database.
351 	*
352 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
353 	*	mode so no message can be added.
354 	*
355 	* NOTMUCH_STATUS_UPGRADE_REQUIRED: The caller must upgrade the
356 	* 	database to use this function.
357 	*/
358 	alias da_notmuch_database_add_message = notmuch_status_t function(notmuch_database_t* database,
359 			const(char)* filename, notmuch_message_t** message);
360 
361 	/**
362 	* Remove a message filename from the given notmuch database. If the
363 	* message has no more filenames, remove the message.
364 	*
365 	* If the same message (as determined by the message ID) is still
366 	* available via other filenames, then the message will persist in the
367 	* database for those filenames. When the last filename is removed for
368 	* a particular message, the database content for that message will be
369 	* entirely removed.
370 	*
371 	* Return value:
372 	*
373 	* NOTMUCH_STATUS_SUCCESS: The last filename was removed and the
374 	*	message was removed from the database.
375 	*
376 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
377 	*	message not removed.
378 	*
379 	* NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but
380 	*	the message persists in the database with at least one other
381 	*	filename.
382 	*
383 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
384 	*	mode so no message can be removed.
385 	*
386 	* NOTMUCH_STATUS_UPGRADE_REQUIRED: The caller must upgrade the
387 	* 	database to use this function.
388 	*/
389 	alias da_notmuch_database_remove_message = notmuch_status_t function(notmuch_database_t* database, const(char)* filename);
390 
391 	/**
392 	* Find a message with the given message_id.
393 	*
394 	* If a message with the given message_id is found then, on successful return
395 	* (NOTMUCH_STATUS_SUCCESS) '*message' will be initialized to a message
396 	* object.  The caller should call notmuch_message_destroy when done with the
397 	* message.
398 	*
399 	* On any failure or when the message is not found, this function initializes
400 	* '*message' to NULL. This means, when NOTMUCH_STATUS_SUCCESS is returned, the
401 	* caller is supposed to check '*message' for NULL to find out whether the
402 	* message with the given message_id was found.
403 	*
404 	* Return value:
405 	*
406 	* NOTMUCH_STATUS_SUCCESS: Successful return, check '*message'.
407 	*
408 	* NOTMUCH_STATUS_NULL_POINTER: The given 'message' argument is NULL
409 	*
410 	* NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory, creating message object
411 	*
412 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred
413 	*/
414 	alias da_notmuch_database_find_message = notmuch_status_t function(notmuch_database_t* database,
415 			const(char)* message_id, notmuch_message_t** message);
416 
417 	/**
418 	* Find a message with the given filename.
419 	*
420 	* If the database contains a message with the given filename then, on
421 	* successful return (NOTMUCH_STATUS_SUCCESS) '*message' will be initialized to
422 	* a message object. The caller should call notmuch_message_destroy when done
423 	* with the message.
424 	*
425 	* On any failure or when the message is not found, this function initializes
426 	* '*message' to NULL. This means, when NOTMUCH_STATUS_SUCCESS is returned, the
427 	* caller is supposed to check '*message' for NULL to find out whether the
428 	* message with the given filename is found.
429 	*
430 	* Return value:
431 	*
432 	* NOTMUCH_STATUS_SUCCESS: Successful return, check '*message'
433 	*
434 	* NOTMUCH_STATUS_NULL_POINTER: The given 'message' argument is NULL
435 	*
436 	* NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory, creating the message object
437 	*
438 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred
439 	*
440 	* NOTMUCH_STATUS_UPGRADE_REQUIRED: The caller must upgrade the
441 	* 	database to use this function.
442 	*/
443 	alias da_notmuch_database_find_message_by_filename = notmuch_status_t function(notmuch_database_t* notmuch,
444 			const(char)* filename, notmuch_message_t** message);
445 
446 	/**
447 	* Return a list of all tags found in the database.
448 	*
449 	* This function creates a list of all tags found in the database. The
450 	* resulting list contains all tags from all messages found in the database.
451 	*
452 	* On error this function returns NULL.
453 	*/
454 	alias da_notmuch_database_get_all_tags = notmuch_tags_t* function(notmuch_database_t* db);
455 
456 	/**
457 	* Create a new query for 'database'.
458 	*
459 	* Here, 'database' should be an open database, (see
460 	* notmuch_database_open and notmuch_database_create).
461 	*
462 	* For the query string, we'll document the syntax here more
463 	* completely in the future, but it's likely to be a specialized
464 	* version of the general Xapian query syntax:
465 	*
466 	* https://xapian.org/docs/queryparser.html
467 	*
468 	* As a special case, passing either a length-zero string, (that is ""),
469 	* or a string consisting of a single asterisk (that is "*"), will
470 	* result in a query that returns all messages in the database.
471 	*
472 	* See notmuch_query_set_sort for controlling the order of results.
473 	* See notmuch_query_search_messages and notmuch_query_search_threads
474 	* to actually execute the query.
475 	*
476 	* User should call notmuch_query_destroy when finished with this
477 	* query.
478 	*
479 	* Will return NULL if insufficient memory is available.
480 	*/
481 	alias da_notmuch_query_create = notmuch_query_t* function(notmuch_database_t* database, const(char)* query_string);
482 
483 	/**
484 	* Return the query_string of this query. See notmuch_query_create.
485 	*/
486 	alias da_notmuch_query_get_query_string = const(char)* function(const notmuch_query_t* query);
487 
488 	/**
489 	* Return the notmuch database of this query. See notmuch_query_create.
490 	*/
491 	alias da_notmuch_query_get_database = notmuch_database_t* function(const notmuch_query_t* query);
492 
493 	/**
494 	* Specify whether to omit excluded results or simply flag them.  By
495 	* default, this is set to TRUE.
496 	*
497 	* If set to TRUE or ALL, notmuch_query_search_messages will omit excluded
498 	* messages from the results, and notmuch_query_search_threads will omit
499 	* threads that match only in excluded messages.  If set to TRUE,
500 	* notmuch_query_search_threads will include all messages in threads that
501 	* match in at least one non-excluded message.  Otherwise, if set to ALL,
502 	* notmuch_query_search_threads will omit excluded messages from all threads.
503 	*
504 	* If set to FALSE or FLAG then both notmuch_query_search_messages and
505 	* notmuch_query_search_threads will return all matching
506 	* messages/threads regardless of exclude status. If set to FLAG then
507 	* the exclude flag will be set for any excluded message that is
508 	* returned by notmuch_query_search_messages, and the thread counts
509 	* for threads returned by notmuch_query_search_threads will be the
510 	* number of non-excluded messages/matches. Otherwise, if set to
511 	* FALSE, then the exclude status is completely ignored.
512 	*
513 	* The performance difference when calling
514 	* notmuch_query_search_messages should be relatively small (and both
515 	* should be very fast).  However, in some cases,
516 	* notmuch_query_search_threads is very much faster when omitting
517 	* excluded messages as it does not need to construct the threads that
518 	* only match in excluded messages.
519 	*/
520 	alias da_notmuch_query_set_omit_excluded = void function(notmuch_query_t* query, notmuch_exclude_t omit_excluded);
521 
522 	/**
523 	* Specify the sorting desired for this query.
524 	*/
525 	alias da_notmuch_query_set_sort = void function(notmuch_query_t* query, notmuch_sort_t sort);
526 
527 	/**
528 	* Return the sort specified for this query. See
529 	* notmuch_query_set_sort.
530 	*/
531 	alias da_notmuch_query_get_sort = notmuch_sort_t function(const notmuch_query_t* query);
532 
533 	/**
534 	* Add a tag that will be excluded from the query results by default.
535 	* This exclusion will be overridden if this tag appears explicitly in
536 	* the query.
537 	*/
538 	alias da_notmuch_query_add_tag_exclude = void function(notmuch_query_t* query, const(char)* tag);
539 
540 	/**
541 	* Execute a query for threads, returning a notmuch_threads_t object
542 	* which can be used to iterate over the results. The returned threads
543 	* object is owned by the query and as such, will only be valid until
544 	* notmuch_query_destroy.
545 	*
546 	* Typical usage might be:
547 	*
548 	*     notmuch_query_t *query;
549 	*     notmuch_threads_t *threads;
550 	*     notmuch_thread_t *thread;
551 	*
552 	*     query = notmuch_query_create (database, query_string);
553 	*
554 	*     for (threads = notmuch_query_search_threads (query);
555 	*          notmuch_threads_valid (threads);
556 	*          notmuch_threads_move_to_next (threads))
557 	*     {
558 	*         thread = notmuch_threads_get (threads);
559 	*         ....
560 	*         notmuch_thread_destroy (thread);
561 	*     }
562 	*
563 	*     notmuch_query_destroy (query);
564 	*
565 	* Note: If you are finished with a thread before its containing
566 	* query, you can call notmuch_thread_destroy to clean up some memory
567 	* sooner (as in the above example). Otherwise, if your thread objects
568 	* are long-lived, then you don't need to call notmuch_thread_destroy
569 	* and all the memory will still be reclaimed when the query is
570 	* destroyed.
571 	*
572 	* Note that there's no explicit destructor needed for the
573 	* notmuch_threads_t object. (For consistency, we do provide a
574 	* notmuch_threads_destroy function, but there's no good reason
575 	* to call it if the query is about to be destroyed).
576 	*
577 	* @since libnotmuch 4.2 (notmuch 0.20)
578 	*/
579 	alias da_notmuch_query_search_threads_st = notmuch_status_t function(notmuch_query_t* query, notmuch_threads_t** out_);
580 
581 	/**
582 	* Like notmuch_query_search_threads_st, but without a status return.
583 	*
584 	* If a Xapian exception occurs this function will return NULL.
585 	*
586 	* @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please
587 	* use notmuch_query_search_threads_st instead.
588 	*
589 	*/
590 	deprecated("function deprecated as of libnotmuch 4.3") alias da_notmuch_query_search_threads = notmuch_threads_t* function(
591 			notmuch_query_t* query);
592 
593 	/**
594 	* Execute a query for messages, returning a notmuch_messages_t object
595 	* which can be used to iterate over the results. The returned
596 	* messages object is owned by the query and as such, will only be
597 	* valid until notmuch_query_destroy.
598 	*
599 	* Typical usage might be:
600 	*
601 	*     notmuch_query_t *query;
602 	*     notmuch_messages_t *messages;
603 	*     notmuch_message_t *message;
604 	*
605 	*     query = notmuch_query_create (database, query_string);
606 	*
607 	*     for (messages = notmuch_query_search_messages (query);
608 	*          notmuch_messages_valid (messages);
609 	*          notmuch_messages_move_to_next (messages))
610 	*     {
611 	*         message = notmuch_messages_get (messages);
612 	*         ....
613 	*         notmuch_message_destroy (message);
614 	*     }
615 	*
616 	*     notmuch_query_destroy (query);
617 	*
618 	* Note: If you are finished with a message before its containing
619 	* query, you can call notmuch_message_destroy to clean up some memory
620 	* sooner (as in the above example). Otherwise, if your message
621 	* objects are long-lived, then you don't need to call
622 	* notmuch_message_destroy and all the memory will still be reclaimed
623 	* when the query is destroyed.
624 	*
625 	* Note that there's no explicit destructor needed for the
626 	* notmuch_messages_t object. (For consistency, we do provide a
627 	* notmuch_messages_destroy function, but there's no good
628 	* reason to call it if the query is about to be destroyed).
629 	*
630 	* If a Xapian exception occurs this function will return NULL.
631 	*
632 	* @since libnotmuch 4.2 (notmuch 0.20)
633 	*/
634 	alias da_notmuch_query_search_messages_st = notmuch_status_t function(notmuch_query_t* query, notmuch_messages_t** out_);
635 	/**
636 	* Like notmuch_query_search_messages, but without a status return.
637 	*
638 	* If a Xapian exception occurs this function will return NULL.
639 	*
640 	* @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please use
641 	* notmuch_query_search_messages_st instead.
642 	*
643 	*/
644 	deprecated("function deprecated as of libnotmuch 4.3") alias da_notmuch_query_search_messages = notmuch_messages_t* function(
645 			notmuch_query_t* query);
646 
647 	/**
648 	* Destroy a notmuch_query_t along with any associated resources.
649 	*
650 	* This will in turn destroy any notmuch_threads_t and
651 	* notmuch_messages_t objects generated by this query, (and in
652 	* turn any notmuch_thread_t and notmuch_message_t objects generated
653 	* from those results, etc.), if such objects haven't already been
654 	* destroyed.
655 	*/
656 	alias da_notmuch_query_destroy = void function(notmuch_query_t* query);
657 
658 	/**
659 	* Is the given 'threads' iterator pointing at a valid thread.
660 	*
661 	* When this function returns TRUE, notmuch_threads_get will return a
662 	* valid object. Whereas when this function returns FALSE,
663 	* notmuch_threads_get will return NULL.
664 	*
665 	* If passed a NULL pointer, this function returns FALSE
666 	*
667 	* See the documentation of notmuch_query_search_threads for example
668 	* code showing how to iterate over a notmuch_threads_t object.
669 	*/
670 	alias da_notmuch_threads_valid = notmuch_bool_t function(notmuch_threads_t* threads);
671 
672 	/**
673 	* Get the current thread from 'threads' as a notmuch_thread_t.
674 	*
675 	* Note: The returned thread belongs to 'threads' and has a lifetime
676 	* identical to it (and the query to which it belongs).
677 	*
678 	* See the documentation of notmuch_query_search_threads for example
679 	* code showing how to iterate over a notmuch_threads_t object.
680 	*
681 	* If an out-of-memory situation occurs, this function will return
682 	* NULL.
683 	*/
684 	alias da_notmuch_threads_get = notmuch_thread_t* function(notmuch_threads_t* threads);
685 
686 	/**
687 	* Move the 'threads' iterator to the next thread.
688 	*
689 	* If 'threads' is already pointing at the last thread then the
690 	* iterator will be moved to a point just beyond that last thread,
691 	* (where notmuch_threads_valid will return FALSE and
692 	* notmuch_threads_get will return NULL).
693 	*
694 	* See the documentation of notmuch_query_search_threads for example
695 	* code showing how to iterate over a notmuch_threads_t object.
696 	*/
697 	alias da_notmuch_threads_move_to_next = void function(notmuch_threads_t* threads);
698 
699 	/**
700 	* Destroy a notmuch_threads_t object.
701 	*
702 	* It's not strictly necessary to call this function. All memory from
703 	* the notmuch_threads_t object will be reclaimed when the
704 	* containing query object is destroyed.
705 	*/
706 	alias da_notmuch_threads_destroy = void function(notmuch_threads_t* threads);
707 
708 	/**
709 	* Return the number of messages matching a search.
710 	*
711 	* This function performs a search and returns the number of matching
712 	* messages.
713 	*
714 	* @returns
715 	*
716 	* NOTMUCH_STATUS_SUCCESS: query completed successfully.
717 	*
718 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: a Xapian exception occured. The
719 	*      value of *count is not defined.
720 	*
721 	* @since libnotmuch 4.3 (notmuch 0.21)
722 	*/
723 	alias da_notmuch_query_count_messages_st = notmuch_status_t function(notmuch_query_t* query, uint* count);
724 
725 	/**
726 	* like notmuch_query_count_messages_st, but without a status return.
727 	*
728 	* May return 0 in the case of errors.
729 	*
730 	* @deprecated Deprecated since libnotmuch 4.3 (notmuch 0.21). Please
731 	* use notmuch_query_count_messages_st instead.
732 	*/
733 	deprecated("function deprecated as of libnotmuch 4.3") alias da_notmuch_query_count_messages = uint function(notmuch_query_t* query);
734 
735 	/**
736 	* Return the number of threads matching a search.
737 	*
738 	* This function performs a search and returns the number of unique thread IDs
739 	* in the matching messages. This is the same as number of threads matching a
740 	* search.
741 	*
742 	* Note that this is a significantly heavier operation than
743 	* notmuch_query_count_messages{_st}().
744 	*
745 	* @returns
746 	*
747 	* NOTMUCH_STATUS_OUT_OF_MEMORY: Memory allocation failed. The value
748 	*      of *count is not defined
749 
750 	* NOTMUCH_STATUS_SUCCESS: query completed successfully.
751 	*
752 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: a Xapian exception occured. The
753 	*      value of *count is not defined.
754 	*
755 	* @since libnotmuch 4.3 (notmuch 0.21)
756 	*/
757 	alias da_notmuch_query_count_threads_st = notmuch_status_t function(notmuch_query_t* query, uint* count);
758 
759 	/**
760 	* like notmuch_query_count_threads, but without a status return.
761 	*
762 	* May return 0 in case of errors.
763 	*
764 	* @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please
765 	* use notmuch_query_count_threads_st instead.
766 	*/
767 	deprecated("function deprecated as of libnotmuch 4.3") alias da_notmuch_query_count_threads = uint function(notmuch_query_t* query);
768 
769 	/**
770 	* Get the thread ID of 'thread'.
771 	*
772 	* The returned string belongs to 'thread' and as such, should not be
773 	* modified by the caller and will only be valid for as long as the
774 	* thread is valid, (which is until notmuch_thread_destroy or until
775 	* the query from which it derived is destroyed).
776 	*/
777 	alias da_notmuch_thread_get_thread_id = const(char)* function(notmuch_thread_t* thread);
778 
779 	/**
780 	* Get the total number of messages in 'thread'.
781 	*
782 	* This count consists of all messages in the database belonging to
783 	* this thread. Contrast with notmuch_thread_get_matched_messages() .
784 	*/
785 	alias da_notmuch_thread_get_total_messages = int function(notmuch_thread_t* thread);
786 
787 	/**
788 	* Get a notmuch_messages_t iterator for the top-level messages in
789 	* 'thread' in oldest-first order.
790 	*
791 	* This iterator will not necessarily iterate over all of the messages
792 	* in the thread. It will only iterate over the messages in the thread
793 	* which are not replies to other messages in the thread.
794 	*
795 	* The returned list will be destroyed when the thread is destroyed.
796 	*/
797 	alias da_notmuch_thread_get_toplevel_messages = notmuch_messages_t* function(notmuch_thread_t* thread);
798 
799 	/**
800 	* Get a notmuch_thread_t iterator for all messages in 'thread' in
801 	* oldest-first order.
802 	*
803 	* The returned list will be destroyed when the thread is destroyed.
804 	*/
805 	alias da_notmuch_thread_get_messages = notmuch_messages_t* function(notmuch_thread_t* thread);
806 
807 	/**
808 	* Get the number of messages in 'thread' that matched the search.
809 	*
810 	* This count includes only the messages in this thread that were
811 	* matched by the search from which the thread was created and were
812 	* not excluded by any exclude tags passed in with the query (see
813 	* notmuch_query_add_tag_exclude). Contrast with
814 	* notmuch_thread_get_total_messages() .
815 	*/
816 	alias da_notmuch_thread_get_matched_messages = int function(notmuch_thread_t* thread);
817 
818 	/**
819 	* Get the authors of 'thread' as a UTF-8 string.
820 	*
821 	* The returned string is a comma-separated list of the names of the
822 	* authors of mail messages in the query results that belong to this
823 	* thread.
824 	*
825 	* The string contains authors of messages matching the query first, then
826 	* non-matched authors (with the two groups separated by '|'). Within
827 	* each group, authors are ordered by date.
828 	*
829 	* The returned string belongs to 'thread' and as such, should not be
830 	* modified by the caller and will only be valid for as long as the
831 	* thread is valid, (which is until notmuch_thread_destroy or until
832 	* the query from which it derived is destroyed).
833 	*/
834 	alias da_notmuch_thread_get_authors = const(char)* function(notmuch_thread_t* thread);
835 
836 	/**
837 	* Get the subject of 'thread' as a UTF-8 string.
838 	*
839 	* The subject is taken from the first message (according to the query
840 	* order---see notmuch_query_set_sort) in the query results that
841 	* belongs to this thread.
842 	*
843 	* The returned string belongs to 'thread' and as such, should not be
844 	* modified by the caller and will only be valid for as long as the
845 	* thread is valid, (which is until notmuch_thread_destroy or until
846 	* the query from which it derived is destroyed).
847 	*/
848 	alias da_notmuch_thread_get_subject = const(char)* function(notmuch_thread_t* thread);
849 
850 	/**
851 	* Get the date of the oldest message in 'thread' as a time_t value.
852 	*/
853 	alias da_notmuch_thread_get_oldest_date = time_t function(notmuch_thread_t* thread);
854 
855 	/**
856 	* Get the date of the newest message in 'thread' as a time_t value.
857 	*/
858 	alias da_notmuch_thread_get_newest_date = time_t function(notmuch_thread_t* thread);
859 
860 	/**
861 	* Get the tags for 'thread', returning a notmuch_tags_t object which
862 	* can be used to iterate over all tags.
863 	*
864 	* Note: In the Notmuch database, tags are stored on individual
865 	* messages, not on threads. So the tags returned here will be all
866 	* tags of the messages which matched the search and which belong to
867 	* this thread.
868 	*
869 	* The tags object is owned by the thread and as such, will only be
870 	* valid for as long as the thread is valid, (for example, until
871 	* notmuch_thread_destroy or until the query from which it derived is
872 	* destroyed).
873 	*
874 	* Typical usage might be:
875 	*
876 	*     notmuch_thread_t *thread;
877 	*     notmuch_tags_t *tags;
878 	*     const char *tag;
879 	*
880 	*     thread = notmuch_threads_get (threads);
881 	*
882 	*     for (tags = notmuch_thread_get_tags (thread);
883 	*          notmuch_tags_valid (tags);
884 	*          notmuch_tags_move_to_next (tags))
885 	*     {
886 	*         tag = notmuch_tags_get (tags);
887 	*         ....
888 	*     }
889 	*
890 	*     notmuch_thread_destroy (thread);
891 	*
892 	* Note that there's no explicit destructor needed for the
893 	* notmuch_tags_t object. (For consistency, we do provide a
894 	* notmuch_tags_destroy function, but there's no good reason to call
895 	* it if the message is about to be destroyed).
896 	*/
897 	alias da_notmuch_thread_get_tags = notmuch_tags_t* function(notmuch_thread_t* thread);
898 
899 	/**
900 	* Destroy a notmuch_thread_t object.
901 	*/
902 	alias da_notmuch_thread_destroy = void function(notmuch_thread_t* thread);
903 
904 	/**
905 	* Is the given 'messages' iterator pointing at a valid message.
906 	*
907 	* When this function returns TRUE, notmuch_messages_get will return a
908 	* valid object. Whereas when this function returns FALSE,
909 	* notmuch_messages_get will return NULL.
910 	*
911 	* See the documentation of notmuch_query_search_messages for example
912 	* code showing how to iterate over a notmuch_messages_t object.
913 	*/
914 	alias da_notmuch_messages_valid = notmuch_bool_t function(notmuch_messages_t* messages);
915 
916 	/**
917 	* Get the current message from 'messages' as a notmuch_message_t.
918 	*
919 	* Note: The returned message belongs to 'messages' and has a lifetime
920 	* identical to it (and the query to which it belongs).
921 	*
922 	* See the documentation of notmuch_query_search_messages for example
923 	* code showing how to iterate over a notmuch_messages_t object.
924 	*
925 	* If an out-of-memory situation occurs, this function will return
926 	* NULL.
927 	*/
928 	alias da_notmuch_messages_get = notmuch_message_t* function(notmuch_messages_t* messages);
929 
930 	/**
931 	* Move the 'messages' iterator to the next message.
932 	*
933 	* If 'messages' is already pointing at the last message then the
934 	* iterator will be moved to a point just beyond that last message,
935 	* (where notmuch_messages_valid will return FALSE and
936 	* notmuch_messages_get will return NULL).
937 	*
938 	* See the documentation of notmuch_query_search_messages for example
939 	* code showing how to iterate over a notmuch_messages_t object.
940 	*/
941 	alias da_notmuch_messages_move_to_next = void function(notmuch_messages_t* messages);
942 
943 	/**
944 	* Destroy a notmuch_messages_t object.
945 	*
946 	* It's not strictly necessary to call this function. All memory from
947 	* the notmuch_messages_t object will be reclaimed when the containing
948 	* query object is destroyed.
949 	*/
950 	alias da_notmuch_messages_destroy = void function(notmuch_messages_t* messages);
951 
952 	/**
953 	* Return a list of tags from all messages.
954 	*
955 	* The resulting list is guaranteed not to contain duplicated tags.
956 	*
957 	* WARNING: You can no longer iterate over messages after calling this
958 	* function, because the iterator will point at the end of the list.
959 	* We do not have a function to reset the iterator yet and the only
960 	* way how you can iterate over the list again is to recreate the
961 	* message list.
962 	*
963 	* The function returns NULL on error.
964 	*/
965 	alias da_notmuch_messages_collect_tags = notmuch_tags_t* function(notmuch_messages_t* messages);
966 
967 	/**
968 	* Get the message ID of 'message'.
969 	*
970 	* The returned string belongs to 'message' and as such, should not be
971 	* modified by the caller and will only be valid for as long as the
972 	* message is valid, (which is until the query from which it derived
973 	* is destroyed).
974 	*
975 	* This function will not return NULL since Notmuch ensures that every
976 	* message has a unique message ID, (Notmuch will generate an ID for a
977 	* message if the original file does not contain one).
978 	*/
979 	alias da_notmuch_message_get_message_id = const(char)* function(notmuch_message_t* message);
980 
981 	/**
982 	* Get the thread ID of 'message'.
983 	*
984 	* The returned string belongs to 'message' and as such, should not be
985 	* modified by the caller and will only be valid for as long as the
986 	* message is valid, (for example, until the user calls
987 	* notmuch_message_destroy on 'message' or until a query from which it
988 	* derived is destroyed).
989 	*
990 	* This function will not return NULL since Notmuch ensures that every
991 	* message belongs to a single thread.
992 	*/
993 	alias da_notmuch_message_get_thread_id = const(char)* function(notmuch_message_t* message);
994 
995 	/**
996 	* Get a notmuch_messages_t iterator for all of the replies to
997 	* 'message'.
998 	*
999 	* Note: This call only makes sense if 'message' was ultimately
1000 	* obtained from a notmuch_thread_t object, (such as by coming
1001 	* directly from the result of calling notmuch_thread_get_
1002 	* toplevel_messages or by any number of subsequent
1003 	* calls to notmuch_message_get_replies).
1004 	*
1005 	* If 'message' was obtained through some non-thread means, (such as
1006 	* by a call to notmuch_query_search_messages), then this function
1007 	* will return NULL.
1008 	*
1009 	* If there are no replies to 'message', this function will return
1010 	* NULL. (Note that notmuch_messages_valid will accept that NULL
1011 	* value as legitimate, and simply return FALSE for it.)
1012 	*/
1013 	alias da_notmuch_message_get_replies = notmuch_messages_t* function(notmuch_message_t* message);
1014 
1015 	/**
1016 	* Get a filename for the email corresponding to 'message'.
1017 	*
1018 	* The returned filename is an absolute filename, (the initial
1019 	* component will match notmuch_database_get_path() ).
1020 	*
1021 	* The returned string belongs to the message so should not be
1022 	* modified or freed by the caller (nor should it be referenced after
1023 	* the message is destroyed).
1024 	*
1025 	* Note: If this message corresponds to multiple files in the mail
1026 	* store, (that is, multiple files contain identical message IDs),
1027 	* this function will arbitrarily return a single one of those
1028 	* filenames. See notmuch_message_get_filenames for returning the
1029 	* complete list of filenames.
1030 	*/
1031 	alias da_notmuch_message_get_filename = const(char)* function(notmuch_message_t* message);
1032 
1033 	/**
1034 	* Get all filenames for the email corresponding to 'message'.
1035 	*
1036 	* Returns a notmuch_filenames_t iterator listing all the filenames
1037 	* associated with 'message'. These files may not have identical
1038 	* content, but each will have the identical Message-ID.
1039 	*
1040 	* Each filename in the iterator is an absolute filename, (the initial
1041 	* component will match notmuch_database_get_path() ).
1042 	*/
1043 	alias da_notmuch_message_get_filenames = notmuch_filenames_t* function(notmuch_message_t* message);
1044 
1045 	/**
1046 	* Get a value of a flag for the email corresponding to 'message'.
1047 	*/
1048 	alias da_notmuch_message_get_flag = notmuch_bool_t function(notmuch_message_t* message, notmuch_message_flag_t flag);
1049 
1050 	/**
1051 	* Set a value of a flag for the email corresponding to 'message'.
1052 	*/
1053 	alias da_notmuch_message_set_flag = void function(notmuch_message_t* message, notmuch_message_flag_t flag, notmuch_bool_t value);
1054 
1055 	/**
1056 	* Get the date of 'message' as a time_t value.
1057 	*
1058 	* For the original textual representation of the Date header from the
1059 	* message call notmuch_message_get_header() with a header value of
1060 	* "date".
1061 	*/
1062 	alias da_notmuch_message_get_date = time_t function(notmuch_message_t* message);
1063 
1064 	/**
1065 	* Get the value of the specified header from 'message' as a UTF-8 string.
1066 	*
1067 	* Common headers are stored in the database when the message is
1068 	* indexed and will be returned from the database.  Other headers will
1069 	* be read from the actual message file.
1070 	*
1071 	* The header name is case insensitive.
1072 	*
1073 	* The returned string belongs to the message so should not be
1074 	* modified or freed by the caller (nor should it be referenced after
1075 	* the message is destroyed).
1076 	*
1077 	* Returns an empty string ("") if the message does not contain a
1078 	* header line matching 'header'. Returns NULL if any error occurs.
1079 	*/
1080 	alias da_notmuch_message_get_header = const(char)* function(notmuch_message_t* message, const(char)* header);
1081 
1082 	/**
1083 	* Get the tags for 'message', returning a notmuch_tags_t object which
1084 	* can be used to iterate over all tags.
1085 	*
1086 	* The tags object is owned by the message and as such, will only be
1087 	* valid for as long as the message is valid, (which is until the
1088 	* query from which it derived is destroyed).
1089 	*
1090 	* Typical usage might be:
1091 	*
1092 	*     notmuch_message_t *message;
1093 	*     notmuch_tags_t *tags;
1094 	*     const char *tag;
1095 	*
1096 	*     message = notmuch_database_find_message (database, message_id);
1097 	*
1098 	*     for (tags = notmuch_message_get_tags (message);
1099 	*          notmuch_tags_valid (tags);
1100 	*          notmuch_tags_move_to_next (tags))
1101 	*     {
1102 	*         tag = notmuch_tags_get (tags);
1103 	*         ....
1104 	*     }
1105 	*
1106 	*     notmuch_message_destroy (message);
1107 	*
1108 	* Note that there's no explicit destructor needed for the
1109 	* notmuch_tags_t object. (For consistency, we do provide a
1110 	* notmuch_tags_destroy function, but there's no good reason to call
1111 	* it if the message is about to be destroyed).
1112 	*/
1113 	alias da_notmuch_message_get_tags = notmuch_tags_t* function(notmuch_message_t* message);
1114 
1115 	/**
1116 	* Add a tag to the given message.
1117 	*
1118 	* Return value:
1119 	*
1120 	* NOTMUCH_STATUS_SUCCESS: Tag successfully added to message
1121 	*
1122 	* NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL
1123 	*
1124 	* NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long
1125 	*	(exceeds NOTMUCH_TAG_MAX)
1126 	*
1127 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
1128 	*	mode so message cannot be modified.
1129 	*/
1130 	alias da_notmuch_message_add_tag = notmuch_status_t function(notmuch_message_t* message, const(char)* tag);
1131 
1132 	/**
1133 	* Remove a tag from the given message.
1134 	*
1135 	* Return value:
1136 	*
1137 	* NOTMUCH_STATUS_SUCCESS: Tag successfully removed from message
1138 	*
1139 	* NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL
1140 	*
1141 	* NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long
1142 	*	(exceeds NOTMUCH_TAG_MAX)
1143 	*
1144 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
1145 	*	mode so message cannot be modified.
1146 	*/
1147 	alias da_notmuch_message_remove_tag = notmuch_status_t function(notmuch_message_t* message, const(char)* tag);
1148 
1149 	/**
1150 	* Remove all tags from the given message.
1151 	*
1152 	* See notmuch_message_freeze for an example showing how to safely
1153 	* replace tag values.
1154 	*
1155 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
1156 	*	mode so message cannot be modified.
1157 	*/
1158 	alias da_notmuch_message_remove_all_tags = notmuch_status_t function(notmuch_message_t* message);
1159 
1160 	/**
1161 	* Add/remove tags according to maildir flags in the message filename(s).
1162 	*
1163 	* This function examines the filenames of 'message' for maildir
1164 	* flags, and adds or removes tags on 'message' as follows when these
1165 	* flags are present:
1166 	*
1167 	*	Flag	Action if present
1168 	*	----	-----------------
1169 	*	'D'	Adds the "draft" tag to the message
1170 	*	'F'	Adds the "flagged" tag to the message
1171 	*	'P'	Adds the "passed" tag to the message
1172 	*	'R'	Adds the "replied" tag to the message
1173 	*	'S'	Removes the "unread" tag from the message
1174 	*
1175 	* For each flag that is not present, the opposite action (add/remove)
1176 	* is performed for the corresponding tags.
1177 	*
1178 	* Flags are identified as trailing components of the filename after a
1179 	* sequence of ":2,".
1180 	*
1181 	* If there are multiple filenames associated with this message, the
1182 	* flag is considered present if it appears in one or more
1183 	* filenames. (That is, the flags from the multiple filenames are
1184 	* combined with the logical OR operator.)
1185 	*
1186 	* A client can ensure that notmuch database tags remain synchronized
1187 	* with maildir flags by calling this function after each call to
1188 	* notmuch_database_add_message. See also
1189 	* notmuch_message_tags_to_maildir_flags for synchronizing tag changes
1190 	* back to maildir flags.
1191 	*/
1192 	alias da_notmuch_message_maildir_flags_to_tags = notmuch_status_t function(notmuch_message_t* message);
1193 
1194 	/**
1195 	* Rename message filename(s) to encode tags as maildir flags.
1196 	*
1197 	* Specifically, for each filename corresponding to this message:
1198 	*
1199 	* If the filename is not in a maildir directory, do nothing.  (A
1200 	* maildir directory is determined as a directory named "new" or
1201 	* "cur".) Similarly, if the filename has invalid maildir info,
1202 	* (repeated or outof-ASCII-order flag characters after ":2,"), then
1203 	* do nothing.
1204 	*
1205 	* If the filename is in a maildir directory, rename the file so that
1206 	* its filename ends with the sequence ":2," followed by zero or more
1207 	* of the following single-character flags (in ASCII order):
1208 	*
1209 	*   'D' iff the message has the "draft" tag
1210 	*   'F' iff the message has the "flagged" tag
1211 	*   'P' iff the message has the "passed" tag
1212 	*   'R' iff the message has the "replied" tag
1213 	*   'S' iff the message does not have the "unread" tag
1214 	*
1215 	* Any existing flags unmentioned in the list above will be preserved
1216 	* in the renaming.
1217 	*
1218 	* Also, if this filename is in a directory named "new", rename it to
1219 	* be within the neighboring directory named "cur".
1220 	*
1221 	* A client can ensure that maildir filename flags remain synchronized
1222 	* with notmuch database tags by calling this function after changing
1223 	* tags, (after calls to notmuch_message_add_tag,
1224 	* notmuch_message_remove_tag, or notmuch_message_freeze/
1225 	* notmuch_message_thaw). See also notmuch_message_maildir_flags_to_tags
1226 	* for synchronizing maildir flag changes back to tags.
1227 	*/
1228 	alias da_notmuch_message_tags_to_maildir_flags = notmuch_status_t function(notmuch_message_t* message);
1229 
1230 	/**
1231 	* Freeze the current state of 'message' within the database.
1232 	*
1233 	* This means that changes to the message state, (via
1234 	* notmuch_message_add_tag, notmuch_message_remove_tag, and
1235 	* notmuch_message_remove_all_tags), will not be committed to the
1236 	* database until the message is thawed with notmuch_message_thaw.
1237 	*
1238 	* Multiple calls to freeze/thaw are valid and these calls will
1239 	* "stack". That is there must be as many calls to thaw as to freeze
1240 	* before a message is actually thawed.
1241 	*
1242 	* The ability to do freeze/thaw allows for safe transactions to
1243 	* change tag values. For example, explicitly setting a message to
1244 	* have a given set of tags might look like this:
1245 	*
1246 	*    notmuch_message_freeze (message);
1247 	*
1248 	*    notmuch_message_remove_all_tags (message);
1249 	*
1250 	*    for (i = 0; i < NUM_TAGS; i++)
1251 	*        notmuch_message_add_tag (message, tags[i]);
1252 	*
1253 	*    notmuch_message_thaw (message);
1254 	*
1255 	* With freeze/thaw used like this, the message in the database is
1256 	* guaranteed to have either the full set of original tag values, or
1257 	* the full set of new tag values, but nothing in between.
1258 	*
1259 	* Imagine the example above without freeze/thaw and the operation
1260 	* somehow getting interrupted. This could result in the message being
1261 	* left with no tags if the interruption happened after
1262 	* notmuch_message_remove_all_tags but before notmuch_message_add_tag.
1263 	*
1264 	* Return value:
1265 	*
1266 	* NOTMUCH_STATUS_SUCCESS: Message successfully frozen.
1267 	*
1268 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
1269 	*	mode so message cannot be modified.
1270 	*/
1271 	alias da_notmuch_message_freeze = notmuch_status_t function(notmuch_message_t* message);
1272 
1273 	/**
1274 	* Thaw the current 'message', synchronizing any changes that may have
1275 	* occurred while 'message' was frozen into the notmuch database.
1276 	*
1277 	* See notmuch_message_freeze for an example of how to use this
1278 	* function to safely provide tag changes.
1279 	*
1280 	* Multiple calls to freeze/thaw are valid and these calls with
1281 	* "stack". That is there must be as many calls to thaw as to freeze
1282 	* before a message is actually thawed.
1283 	*
1284 	* Return value:
1285 	*
1286 	* NOTMUCH_STATUS_SUCCESS: Message successfully thawed, (or at least
1287 	*	its frozen count has successfully been reduced by 1).
1288 	*
1289 	* NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: An attempt was made to thaw
1290 	*	an unfrozen message. That is, there have been an unbalanced
1291 	*	number of calls to notmuch_message_freeze and
1292 	*	notmuch_message_thaw.
1293 	*/
1294 	alias da_notmuch_message_thaw = notmuch_status_t function(notmuch_message_t* message);
1295 
1296 	/**
1297 	* Destroy a notmuch_message_t object.
1298 	*
1299 	* It can be useful to call this function in the case of a single
1300 	* query object with many messages in the result, (such as iterating
1301 	* over the entire database). Otherwise, it's fine to never call this
1302 	* function and there will still be no memory leaks. (The memory from
1303 	* the messages get reclaimed when the containing query is destroyed.)
1304 	*/
1305 	alias da_notmuch_message_destroy = void function(notmuch_message_t* message);
1306 
1307 	/**
1308 	* @name Message Properties
1309 	*
1310 	* This interface provides the ability to attach arbitrary (key,value)
1311 	* string pairs to a message, to remove such pairs, and to iterate
1312 	* over them.  The caller should take some care as to what keys they
1313 	* add or delete values for, as other subsystems or extensions may
1314 	* depend on these properties.
1315 	*
1316 	*/
1317 	/**@{*/
1318 	/**
1319 	* Retrieve the value for a single property key
1320 	*
1321 	* *value* is set to a string owned by the message or NULL if there is
1322 	* no such key. In the case of multiple values for the given key, the
1323 	* first one is retrieved.
1324 	*
1325 	* @returns
1326 	* - NOTMUCH_STATUS_NULL_POINTER: *value* may not be NULL.
1327 	* - NOTMUCH_STATUS_SUCCESS: No error occured.
1328 	* @since libnotmuch 4.4 (notmuch 0.23)
1329 	*/
1330 	alias da_notmuch_message_get_property = notmuch_status_t function(notmuch_message_t* message, const(char)* key, const(char)** value);
1331 
1332 	/**
1333 	* Add a (key,value) pair to a message
1334 	*
1335 	* @returns
1336 	* - NOTMUCH_STATUS_ILLEGAL_ARGUMENT: *key* may not contain an '=' character.
1337 	* - NOTMUCH_STATUS_NULL_POINTER: Neither *key* nor *value* may be NULL.
1338 	* - NOTMUCH_STATUS_SUCCESS: No error occured.
1339 	* @since libnotmuch 4.4 (notmuch 0.23)
1340 	*/
1341 	alias da_notmuch_message_add_property = notmuch_status_t function(notmuch_message_t* message, const(char)* key, const(char)* value);
1342 
1343 	/**
1344 	* Remove a (key,value) pair from a message.
1345 	*
1346 	* It is not an error to remove a non-existant (key,value) pair
1347 	*
1348 	* @returns
1349 	* - NOTMUCH_STATUS_ILLEGAL_ARGUMENT: *key* may not contain an '=' character.
1350 	* - NOTMUCH_STATUS_NULL_POINTER: Neither *key* nor *value* may be NULL.
1351 	* - NOTMUCH_STATUS_SUCCESS: No error occured.
1352 	* @since libnotmuch 4.4 (notmuch 0.23)
1353 	*/
1354 	alias da_notmuch_message_remove_property = notmuch_status_t function(notmuch_message_t* message, const(char)* key, const(char)* value);
1355 
1356 	/**
1357 	* Remove all (key,value) pairs from the given message.
1358 	*
1359 	* @param[in,out] message  message to operate on.
1360 	* @param[in]     key      key to delete properties for. If NULL, delete
1361 	*			   properties for all keys
1362 	* @returns
1363 	* - NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in
1364 	*   read-only mode so message cannot be modified.
1365 	* - NOTMUCH_STATUS_SUCCESS: No error occured.
1366 	*
1367 	* @since libnotmuch 4.4 (notmuch 0.23)
1368 	*/
1369 	alias da_notmuch_message_remove_all_properties = notmuch_status_t function(notmuch_message_t* message, const(char)* key);
1370 
1371 	/**
1372 	* Get the properties for *message*, returning a
1373 	* notmuch_message_properties_t object which can be used to iterate
1374 	* over all properties.
1375 	*
1376 	* The notmuch_message_properties_t object is owned by the message and
1377 	* as such, will only be valid for as long as the message is valid,
1378 	* (which is until the query from which it derived is destroyed).
1379 	*
1380 	* @param[in] message  The message to examine
1381 	* @param[in] key      key or key prefix
1382 	* @param[in] exact    if TRUE, require exact match with key. Otherwise
1383 	*		       treat as prefix.
1384 	*
1385 	* Typical usage might be:
1386 	*
1387 	*     notmuch_message_properties_t *list;
1388 	*
1389 	*     for (list = notmuch_message_get_properties (message, "testkey1", TRUE);
1390 	*          notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) {
1391 	*        printf("%s\n", notmuch_message_properties_value(list));
1392 	*     }
1393 	*
1394 	*     notmuch_message_properties_destroy (list);
1395 	*
1396 	* Note that there's no explicit destructor needed for the
1397 	* notmuch_message_properties_t object. (For consistency, we do
1398 	* provide a notmuch_message_properities_destroy function, but there's
1399 	* no good reason to call it if the message is about to be destroyed).
1400 	*
1401 	* @since libnotmuch 4.4 (notmuch 0.23)
1402 	*/
1403 	alias da_notmuch_message_get_properties = notmuch_message_properties_t* function(notmuch_message_t* message,
1404 			const(char)* key, notmuch_bool_t exact);
1405 
1406 	/**
1407 	* Is the given *properties* iterator pointing at a valid (key,value)
1408 	* pair.
1409 	*
1410 	* When this function returns TRUE,
1411 	* notmuch_message_properties_{key,value} will return a valid string,
1412 	* and notmuch_message_properties_move_to_next will do what it
1413 	* says. Whereas when this function returns FALSE, calling any of
1414 	* these functions results in undefined behaviour.
1415 	*
1416 	* See the documentation of notmuch_message_properties_get for example
1417 	* code showing how to iterate over a notmuch_message_properties_t
1418 	* object.
1419 	*
1420 	* @since libnotmuch 4.4 (notmuch 0.23)
1421 	*/
1422 	alias da_notmuch_message_properties_valid = notmuch_bool_t function(notmuch_message_properties_t* properties);
1423 
1424 	/**
1425 	* Move the *properties* iterator to the next (key,value) pair
1426 	*
1427 	* If *properties* is already pointing at the last pair then the iterator
1428 	* will be moved to a point just beyond that last pair, (where
1429 	* notmuch_message_properties_valid will return FALSE).
1430 	*
1431 	* See the documentation of notmuch_message_get_properties for example
1432 	* code showing how to iterate over a notmuch_message_properties_t object.
1433 	*
1434 	* @since libnotmuch 4.4 (notmuch 0.23)
1435 	*/
1436 	alias da_notmuch_message_properties_move_to_next = void function(notmuch_message_properties_t* properties);
1437 
1438 	/**
1439 	* Return the key from the current (key,value) pair.
1440 	*
1441 	* this could be useful if iterating for a prefix
1442 	*
1443 	* @since libnotmuch 4.4 (notmuch 0.23)
1444 	*/
1445 	alias da_notmuch_message_properties_key = const(char)* function(notmuch_message_properties_t* properties);
1446 
1447 	/**
1448 	* Return the value from the current (key,value) pair.
1449 	*
1450 	* This could be useful if iterating for a prefix.
1451 	*
1452 	* @since libnotmuch 4.4 (notmuch 0.23)
1453 	*/
1454 	alias da_notmuch_message_properties_value = const(char)* function(notmuch_message_properties_t* properties);
1455 
1456 	/**
1457 	* Destroy a notmuch_message_properties_t object.
1458 	*
1459 	* It's not strictly necessary to call this function. All memory from
1460 	* the notmuch_message_properties_t object will be reclaimed when the
1461 	* containing message object is destroyed.
1462 	*
1463 	* @since libnotmuch 4.4 (notmuch 0.23)
1464 	*/
1465 	alias da_notmuch_message_properties_destroy = void function(notmuch_message_properties_t* properties);
1466 
1467 	/**@}*/
1468 
1469 	/**
1470 	* Is the given 'tags' iterator pointing at a valid tag.
1471 	*
1472 	* When this function returns TRUE, notmuch_tags_get will return a
1473 	* valid string. Whereas when this function returns FALSE,
1474 	* notmuch_tags_get will return NULL.
1475 	*
1476 	* See the documentation of notmuch_message_get_tags for example code
1477 	* showing how to iterate over a notmuch_tags_t object.
1478 	*/
1479 	alias da_notmuch_tags_valid = notmuch_bool_t function(notmuch_tags_t* tags);
1480 
1481 	/**
1482 	* Get the current tag from 'tags' as a string.
1483 	*
1484 	* Note: The returned string belongs to 'tags' and has a lifetime
1485 	* identical to it (and the query to which it ultimately belongs).
1486 	*
1487 	* See the documentation of notmuch_message_get_tags for example code
1488 	* showing how to iterate over a notmuch_tags_t object.
1489 	*/
1490 	alias da_notmuch_tags_get = const(char)* function(notmuch_tags_t* tags);
1491 
1492 	/**
1493 	* Move the 'tags' iterator to the next tag.
1494 	*
1495 	* If 'tags' is already pointing at the last tag then the iterator
1496 	* will be moved to a point just beyond that last tag, (where
1497 	* notmuch_tags_valid will return FALSE and notmuch_tags_get will
1498 	* return NULL).
1499 	*
1500 	* See the documentation of notmuch_message_get_tags for example code
1501 	* showing how to iterate over a notmuch_tags_t object.
1502 	*/
1503 	alias da_notmuch_tags_move_to_next = void function(notmuch_tags_t* tags);
1504 
1505 	/**
1506 	* Destroy a notmuch_tags_t object.
1507 	*
1508 	* It's not strictly necessary to call this function. All memory from
1509 	* the notmuch_tags_t object will be reclaimed when the containing
1510 	* message or query objects are destroyed.
1511 	*/
1512 	alias da_notmuch_tags_destroy = void function(notmuch_tags_t* tags);
1513 
1514 	/**
1515 	* Store an mtime within the database for 'directory'.
1516 	*
1517 	* The 'directory' should be an object retrieved from the database
1518 	* with notmuch_database_get_directory for a particular path.
1519 	*
1520 	* The intention is for the caller to use the mtime to allow efficient
1521 	* identification of new messages to be added to the database. The
1522 	* recommended usage is as follows:
1523 	*
1524 	*   o Read the mtime of a directory from the filesystem
1525 	*
1526 	*   o Call add_message for all mail files in the directory
1527 	*
1528 	*   o Call notmuch_directory_set_mtime with the mtime read from the
1529 	*     filesystem.
1530 	*
1531 	* Then, when wanting to check for updates to the directory in the
1532 	* future, the client can call notmuch_directory_get_mtime and know
1533 	* that it only needs to add files if the mtime of the directory and
1534 	* files are newer than the stored timestamp.
1535 	*
1536 	* Note: The notmuch_directory_get_mtime function does not allow the
1537 	* caller to distinguish a timestamp of 0 from a non-existent
1538 	* timestamp. So don't store a timestamp of 0 unless you are
1539 	* comfortable with that.
1540 	*
1541 	* Return value:
1542 	*
1543 	* NOTMUCH_STATUS_SUCCESS: mtime successfully stored in database.
1544 	*
1545 	* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception
1546 	*	occurred, mtime not stored.
1547 	*
1548 	* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
1549 	*	mode so directory mtime cannot be modified.
1550 	*/
1551 	alias da_notmuch_directory_set_mtime = notmuch_status_t function(notmuch_directory_t* directory, time_t mtime);
1552 
1553 	/**
1554 	* Get the mtime of a directory, (as previously stored with
1555 	* notmuch_directory_set_mtime).
1556 	*
1557 	* Returns 0 if no mtime has previously been stored for this
1558 	* directory.
1559 	*/
1560 	alias da_notmuch_directory_get_mtime = time_t function(notmuch_directory_t* directory);
1561 
1562 	/**
1563 	* Get a notmuch_filenames_t iterator listing all the filenames of
1564 	* messages in the database within the given directory.
1565 	*
1566 	* The returned filenames will be the basename-entries only (not
1567 	* complete paths).
1568 	*/
1569 	alias da_notmuch_directory_get_child_files = notmuch_filenames_t* function(notmuch_directory_t* directory);
1570 
1571 	/**
1572 	* Get a notmuch_filenames_t iterator listing all the filenames of
1573 	* sub-directories in the database within the given directory.
1574 	*
1575 	* The returned filenames will be the basename-entries only (not
1576 	* complete paths).
1577 	*/
1578 	alias da_notmuch_directory_get_child_directories = notmuch_filenames_t* function(notmuch_directory_t* directory);
1579 
1580 	/**
1581 	* Delete directory document from the database, and destroy the
1582 	* notmuch_directory_t object. Assumes any child directories and files
1583 	* have been deleted by the caller.
1584 	*
1585 	* @since libnotmuch 4.3 (notmuch 0.21)
1586 	*/
1587 	alias da_notmuch_directory_delete = notmuch_status_t function(notmuch_directory_t* directory);
1588 
1589 	/**
1590 	* Destroy a notmuch_directory_t object.
1591 	*/
1592 	alias da_notmuch_directory_destroy = void function(notmuch_directory_t* directory);
1593 
1594 	/**
1595 	* Is the given 'filenames' iterator pointing at a valid filename.
1596 	*
1597 	* When this function returns TRUE, notmuch_filenames_get will return
1598 	* a valid string. Whereas when this function returns FALSE,
1599 	* notmuch_filenames_get will return NULL.
1600 	*
1601 	* It is acceptable to pass NULL for 'filenames', in which case this
1602 	* function will always return FALSE.
1603 	*/
1604 	alias da_notmuch_filenames_valid = notmuch_bool_t function(notmuch_filenames_t* filenames);
1605 
1606 	/**
1607 	* Get the current filename from 'filenames' as a string.
1608 	*
1609 	* Note: The returned string belongs to 'filenames' and has a lifetime
1610 	* identical to it (and the directory to which it ultimately belongs).
1611 	*
1612 	* It is acceptable to pass NULL for 'filenames', in which case this
1613 	* function will always return NULL.
1614 	*/
1615 	alias da_notmuch_filenames_get = const(char)* function(notmuch_filenames_t* filenames);
1616 
1617 	/**
1618 	* Move the 'filenames' iterator to the next filename.
1619 	*
1620 	* If 'filenames' is already pointing at the last filename then the
1621 	* iterator will be moved to a point just beyond that last filename,
1622 	* (where notmuch_filenames_valid will return FALSE and
1623 	* notmuch_filenames_get will return NULL).
1624 	*
1625 	* It is acceptable to pass NULL for 'filenames', in which case this
1626 	* function will do nothing.
1627 	*/
1628 	alias da_notmuch_filenames_move_to_next = void function(notmuch_filenames_t* filenames);
1629 
1630 	/**
1631 	* Destroy a notmuch_filenames_t object.
1632 	*
1633 	* It's not strictly necessary to call this function. All memory from
1634 	* the notmuch_filenames_t object will be reclaimed when the
1635 	* containing directory object is destroyed.
1636 	*
1637 	* It is acceptable to pass NULL for 'filenames', in which case this
1638 	* function will do nothing.
1639 	*/
1640 	alias da_notmuch_filenames_destroy = void function(notmuch_filenames_t* filenames);
1641 
1642 	/**
1643 	* set config 'key' to 'value'
1644 	*
1645 	* @since libnotmuch 4.4 (notmuch 0.23)
1646 	*/
1647 	alias da_notmuch_database_set_config = notmuch_status_t function(notmuch_database_t* db, const(char)* key, const(char)* value);
1648 
1649 	/**
1650 	* retrieve config item 'key', assign to  'value'
1651 	*
1652 	* keys which have not been previously set with n_d_set_config will
1653 	* return an empty string.
1654 	*
1655 	* return value is allocated by malloc and should be freed by the
1656 	* caller.
1657 	*
1658 	* @since libnotmuch 4.4 (notmuch 0.23)
1659 	*/
1660 	alias da_notmuch_database_get_config = notmuch_status_t function(notmuch_database_t* db, const(char)* key, char** value);
1661 
1662 	/**
1663 	* Create an iterator for all config items with keys matching a given prefix
1664 	*
1665 	* @since libnotmuch 4.4 (notmuch 0.23)
1666 	*/
1667 	alias da_notmuch_database_get_config_list = notmuch_status_t function(notmuch_database_t* db, const(char)* prefix,
1668 			notmuch_config_list_t** out_);
1669 
1670 	/**
1671 	* Is 'config_list' iterator valid (i.e. _key, _value, _move_to_next can be called).
1672 	*
1673 	* @since libnotmuch 4.4 (notmuch 0.23)
1674 	*/
1675 	alias da_notmuch_config_list_valid = notmuch_bool_t function(notmuch_config_list_t* config_list);
1676 
1677 	/**
1678 	* return key for current config pair
1679 	*
1680 	* return value is owned by the iterator, and will be destroyed by the
1681 	* next call to notmuch_config_list_key or notmuch_config_list_destroy.
1682 	*
1683 	* @since libnotmuch 4.4 (notmuch 0.23)
1684 	*/
1685 	alias da_notmuch_config_list_key = const(char)* function(notmuch_config_list_t* config_list);
1686 
1687 	/**
1688 	* return 'value' for current config pair
1689 	*
1690 	* return value is owned by the iterator, and will be destroyed by the
1691 	* next call to notmuch_config_list_value or notmuch config_list_destroy
1692 	*
1693 	* @since libnotmuch 4.4 (notmuch 0.23)
1694 	*/
1695 	alias da_notmuch_config_list_value = const(char)* function(notmuch_config_list_t* config_list);
1696 
1697 	/**
1698 	* move 'config_list' iterator to the next pair
1699 	*
1700 	* @since libnotmuch 4.4 (notmuch 0.23)
1701 	*/
1702 	alias da_notmuch_config_list_move_to_next = void function(notmuch_config_list_t* config_list);
1703 
1704 	/**
1705 	* free any resources held by 'config_list'
1706 	*
1707 	* @since libnotmuch 4.4 (notmuch 0.23)
1708 	*/
1709 	alias da_notmuch_config_list_destroy = void function(notmuch_config_list_t* config_list);
1710 
1711 	/**
1712 	* interrogate the library for compile time features
1713 	*
1714 	* @since libnotmuch 4.4 (notmuch 0.23)
1715 	*/
1716 	alias da_notmuch_built_with = notmuch_bool_t function(const(char)* name);
1717 }
1718 __gshared {
1719 	da_notmuch_status_to_string notmuch_status_to_string;
1720 	da_notmuch_database_create notmuch_database_create;
1721 	da_notmuch_database_create_verbose notmuch_database_create_verbose;
1722 	da_notmuch_database_open notmuch_database_open;
1723 	da_notmuch_database_open_verbose notmuch_database_open_verbose;
1724 	da_notmuch_database_status_string notmuch_database_status_string;
1725 	da_notmuch_database_close notmuch_database_close;
1726 	da_notmuch_database_compact notmuch_database_compact;
1727 	da_notmuch_database_destroy notmuch_database_destroy;
1728 	da_notmuch_database_get_path notmuch_database_get_path;
1729 	da_notmuch_database_get_version notmuch_database_get_version;
1730 	da_notmuch_database_needs_upgrade notmuch_database_needs_upgrade;
1731 	da_notmuch_database_upgrade notmuch_database_upgrade;
1732 	da_notmuch_database_begin_atomic notmuch_database_begin_atomic;
1733 	da_notmuch_database_end_atomic notmuch_database_end_atomic;
1734 	da_notmuch_database_get_revision notmuch_database_get_revision;
1735 	da_notmuch_database_get_directory notmuch_database_get_directory;
1736 	da_notmuch_database_add_message notmuch_database_add_message;
1737 	da_notmuch_database_remove_message notmuch_database_remove_message;
1738 	da_notmuch_database_find_message notmuch_database_find_message;
1739 	da_notmuch_database_find_message_by_filename notmuch_database_find_message_by_filename;
1740 	da_notmuch_database_get_all_tags notmuch_database_get_all_tags;
1741 	da_notmuch_query_create notmuch_query_create;
1742 	da_notmuch_query_get_query_string notmuch_query_get_query_string;
1743 	da_notmuch_query_get_database notmuch_query_get_database;
1744 	da_notmuch_query_set_omit_excluded notmuch_query_set_omit_excluded;
1745 	da_notmuch_query_set_sort notmuch_query_set_sort;
1746 	da_notmuch_query_get_sort notmuch_query_get_sort;
1747 	da_notmuch_query_add_tag_exclude notmuch_query_add_tag_exclude;
1748 	da_notmuch_query_search_threads_st notmuch_query_search_threads_st;
1749 	deprecated("function deprecated as of libnotmuch 4.3") da_notmuch_query_search_threads notmuch_query_search_threads;
1750 	da_notmuch_query_search_messages_st notmuch_query_search_messages_st;
1751 	deprecated("function deprecated as of libnotmuch 4.3") da_notmuch_query_search_messages notmuch_query_search_messages;
1752 	da_notmuch_query_destroy notmuch_query_destroy;
1753 	da_notmuch_threads_valid notmuch_threads_valid;
1754 	da_notmuch_threads_get notmuch_threads_get;
1755 	da_notmuch_threads_move_to_next notmuch_threads_move_to_next;
1756 	da_notmuch_threads_destroy notmuch_threads_destroy;
1757 	da_notmuch_query_count_messages_st notmuch_query_count_messages_st;
1758 	deprecated("function deprecated as of libnotmuch 4.3") da_notmuch_query_count_messages notmuch_query_count_messages;
1759 	da_notmuch_query_count_threads_st notmuch_query_count_threads_st;
1760 	deprecated("function deprecated as of libnotmuch 4.3") da_notmuch_query_count_threads notmuch_query_count_threads;
1761 	da_notmuch_thread_get_thread_id notmuch_thread_get_thread_id;
1762 	da_notmuch_thread_get_total_messages notmuch_thread_get_total_messages;
1763 	da_notmuch_thread_get_toplevel_messages notmuch_thread_get_toplevel_messages;
1764 	da_notmuch_thread_get_messages notmuch_thread_get_messages;
1765 	da_notmuch_thread_get_matched_messages notmuch_thread_get_matched_messages;
1766 	da_notmuch_thread_get_authors notmuch_thread_get_authors;
1767 	da_notmuch_thread_get_subject notmuch_thread_get_subject;
1768 	da_notmuch_thread_get_oldest_date notmuch_thread_get_oldest_date;
1769 	da_notmuch_thread_get_newest_date notmuch_thread_get_newest_date;
1770 	da_notmuch_thread_get_tags notmuch_thread_get_tags;
1771 	da_notmuch_thread_destroy notmuch_thread_destroy;
1772 	da_notmuch_messages_valid notmuch_messages_valid;
1773 	da_notmuch_messages_get notmuch_messages_get;
1774 	da_notmuch_messages_move_to_next notmuch_messages_move_to_next;
1775 	da_notmuch_messages_destroy notmuch_messages_destroy;
1776 	da_notmuch_messages_collect_tags notmuch_messages_collect_tags;
1777 	da_notmuch_message_get_message_id notmuch_message_get_message_id;
1778 	da_notmuch_message_get_thread_id notmuch_message_get_thread_id;
1779 	da_notmuch_message_get_replies notmuch_message_get_replies;
1780 	da_notmuch_message_get_filename notmuch_message_get_filename;
1781 	da_notmuch_message_get_filenames notmuch_message_get_filenames;
1782 	da_notmuch_message_get_flag notmuch_message_get_flag;
1783 	da_notmuch_message_set_flag notmuch_message_set_flag;
1784 	da_notmuch_message_get_date notmuch_message_get_date;
1785 	da_notmuch_message_get_header notmuch_message_get_header;
1786 	da_notmuch_message_get_tags notmuch_message_get_tags;
1787 	da_notmuch_message_add_tag notmuch_message_add_tag;
1788 	da_notmuch_message_remove_tag notmuch_message_remove_tag;
1789 	da_notmuch_message_remove_all_tags notmuch_message_remove_all_tags;
1790 	da_notmuch_message_maildir_flags_to_tags notmuch_message_maildir_flags_to_tags;
1791 	da_notmuch_message_tags_to_maildir_flags notmuch_message_tags_to_maildir_flags;
1792 	da_notmuch_message_freeze notmuch_message_freeze;
1793 	da_notmuch_message_thaw notmuch_message_thaw;
1794 	da_notmuch_message_destroy notmuch_message_destroy;
1795 	da_notmuch_message_get_property notmuch_message_get_property;
1796 	da_notmuch_message_add_property notmuch_message_add_property;
1797 	da_notmuch_message_remove_property notmuch_message_remove_property;
1798 	da_notmuch_message_remove_all_properties notmuch_message_remove_all_properties;
1799 	da_notmuch_message_get_properties notmuch_message_get_properties;
1800 	da_notmuch_message_properties_valid notmuch_message_properties_valid;
1801 	da_notmuch_message_properties_move_to_next notmuch_message_properties_move_to_next;
1802 	da_notmuch_message_properties_key notmuch_message_properties_key;
1803 	da_notmuch_message_properties_value notmuch_message_properties_value;
1804 	da_notmuch_message_properties_destroy notmuch_message_properties_destroy;
1805 	da_notmuch_tags_valid notmuch_tags_valid;
1806 	da_notmuch_tags_get notmuch_tags_get;
1807 	da_notmuch_tags_move_to_next notmuch_tags_move_to_next;
1808 	da_notmuch_tags_destroy notmuch_tags_destroy;
1809 	da_notmuch_directory_set_mtime notmuch_directory_set_mtime;
1810 	da_notmuch_directory_get_mtime notmuch_directory_get_mtime;
1811 	da_notmuch_directory_get_child_files notmuch_directory_get_child_files;
1812 	da_notmuch_directory_get_child_directories notmuch_directory_get_child_directories;
1813 	da_notmuch_directory_delete notmuch_directory_delete;
1814 	da_notmuch_directory_destroy notmuch_directory_destroy;
1815 	da_notmuch_filenames_valid notmuch_filenames_valid;
1816 	da_notmuch_filenames_get notmuch_filenames_get;
1817 	da_notmuch_filenames_move_to_next notmuch_filenames_move_to_next;
1818 	da_notmuch_filenames_destroy notmuch_filenames_destroy;
1819 	da_notmuch_database_set_config notmuch_database_set_config;
1820 	da_notmuch_database_get_config notmuch_database_get_config;
1821 	da_notmuch_database_get_config_list notmuch_database_get_config_list;
1822 	da_notmuch_config_list_valid notmuch_config_list_valid;
1823 	da_notmuch_config_list_key notmuch_config_list_key;
1824 	da_notmuch_config_list_value notmuch_config_list_value;
1825 	da_notmuch_config_list_move_to_next notmuch_config_list_move_to_next;
1826 	da_notmuch_config_list_destroy notmuch_config_list_destroy;
1827 	da_notmuch_built_with notmuch_built_with;
1828 }
1829 
1830 class DerelictNotMuchLoader : SharedLibLoader {
1831 public:
1832 	this() {
1833 		super(libNames);
1834 	}
1835 
1836 protected:
1837 	override void loadSymbols() {
1838 		bindFunc(cast(void**)&notmuch_status_to_string, "notmuch_status_to_string");
1839 		bindFunc(cast(void**)&notmuch_database_create, "notmuch_database_create");
1840 		bindFunc(cast(void**)&notmuch_database_create_verbose, "notmuch_database_create_verbose");
1841 		bindFunc(cast(void**)&notmuch_database_open, "notmuch_database_open");
1842 		bindFunc(cast(void**)&notmuch_database_open_verbose, "notmuch_database_open_verbose");
1843 		bindFunc(cast(void**)&notmuch_database_status_string, "notmuch_database_status_string");
1844 		bindFunc(cast(void**)&notmuch_database_close, "notmuch_database_close");
1845 		bindFunc(cast(void**)&notmuch_database_compact, "notmuch_database_compact");
1846 		bindFunc(cast(void**)&notmuch_database_destroy, "notmuch_database_destroy");
1847 		bindFunc(cast(void**)&notmuch_database_get_path, "notmuch_database_get_path");
1848 		bindFunc(cast(void**)&notmuch_database_get_version, "notmuch_database_get_version");
1849 		bindFunc(cast(void**)&notmuch_database_needs_upgrade, "notmuch_database_needs_upgrade");
1850 		bindFunc(cast(void**)&notmuch_database_upgrade, "notmuch_database_upgrade");
1851 		bindFunc(cast(void**)&notmuch_database_begin_atomic, "notmuch_database_begin_atomic");
1852 		bindFunc(cast(void**)&notmuch_database_end_atomic, "notmuch_database_end_atomic");
1853 		bindFunc(cast(void**)&notmuch_database_get_revision, "notmuch_database_get_revision");
1854 		bindFunc(cast(void**)&notmuch_database_get_directory, "notmuch_database_get_directory");
1855 		bindFunc(cast(void**)&notmuch_database_add_message, "notmuch_database_add_message");
1856 		bindFunc(cast(void**)&notmuch_database_remove_message, "notmuch_database_remove_message");
1857 		bindFunc(cast(void**)&notmuch_database_find_message, "notmuch_database_find_message");
1858 		bindFunc(cast(void**)&notmuch_database_find_message_by_filename, "notmuch_database_find_message_by_filename");
1859 		bindFunc(cast(void**)&notmuch_database_get_all_tags, "notmuch_database_get_all_tags");
1860 		bindFunc(cast(void**)&notmuch_query_create, "notmuch_query_create");
1861 		bindFunc(cast(void**)&notmuch_query_get_query_string, "notmuch_query_get_query_string");
1862 		bindFunc(cast(void**)&notmuch_query_get_database, "notmuch_query_get_database");
1863 		bindFunc(cast(void**)&notmuch_query_set_omit_excluded, "notmuch_query_set_omit_excluded");
1864 		bindFunc(cast(void**)&notmuch_query_set_sort, "notmuch_query_set_sort");
1865 		bindFunc(cast(void**)&notmuch_query_get_sort, "notmuch_query_get_sort");
1866 		bindFunc(cast(void**)&notmuch_query_add_tag_exclude, "notmuch_query_add_tag_exclude");
1867 		bindFunc(cast(void**)&notmuch_query_search_threads_st, "notmuch_query_search_threads_st");
1868 		bindFunc(cast(void**)&notmuch_query_search_threads, "notmuch_query_search_threads");
1869 		bindFunc(cast(void**)&notmuch_query_search_messages_st, "notmuch_query_search_messages_st");
1870 		bindFunc(cast(void**)&notmuch_query_search_messages, "notmuch_query_search_messages");
1871 		bindFunc(cast(void**)&notmuch_query_destroy, "notmuch_query_destroy");
1872 		bindFunc(cast(void**)&notmuch_threads_valid, "notmuch_threads_valid");
1873 		bindFunc(cast(void**)&notmuch_threads_get, "notmuch_threads_get");
1874 		bindFunc(cast(void**)&notmuch_threads_move_to_next, "notmuch_threads_move_to_next");
1875 		bindFunc(cast(void**)&notmuch_threads_destroy, "notmuch_threads_destroy");
1876 		bindFunc(cast(void**)&notmuch_query_count_messages_st, "notmuch_query_count_messages_st");
1877 		bindFunc(cast(void**)&notmuch_query_count_messages, "notmuch_query_count_messages");
1878 		bindFunc(cast(void**)&notmuch_query_count_threads_st, "notmuch_query_count_threads_st");
1879 		bindFunc(cast(void**)&notmuch_query_count_threads, "notmuch_query_count_threads");
1880 		bindFunc(cast(void**)&notmuch_thread_get_thread_id, "notmuch_thread_get_thread_id");
1881 		bindFunc(cast(void**)&notmuch_thread_get_total_messages, "notmuch_thread_get_total_messages");
1882 		bindFunc(cast(void**)&notmuch_thread_get_toplevel_messages, "notmuch_thread_get_toplevel_messages");
1883 		bindFunc(cast(void**)&notmuch_thread_get_messages, "notmuch_thread_get_messages");
1884 		bindFunc(cast(void**)&notmuch_thread_get_matched_messages, "notmuch_thread_get_matched_messages");
1885 		bindFunc(cast(void**)&notmuch_thread_get_authors, "notmuch_thread_get_authors");
1886 		bindFunc(cast(void**)&notmuch_thread_get_subject, "notmuch_thread_get_subject");
1887 		bindFunc(cast(void**)&notmuch_thread_get_oldest_date, "notmuch_thread_get_oldest_date");
1888 		bindFunc(cast(void**)&notmuch_thread_get_newest_date, "notmuch_thread_get_newest_date");
1889 		bindFunc(cast(void**)&notmuch_thread_get_tags, "notmuch_thread_get_tags");
1890 		bindFunc(cast(void**)&notmuch_thread_destroy, "notmuch_thread_destroy");
1891 		bindFunc(cast(void**)&notmuch_messages_valid, "notmuch_messages_valid");
1892 		bindFunc(cast(void**)&notmuch_messages_get, "notmuch_messages_get");
1893 		bindFunc(cast(void**)&notmuch_messages_move_to_next, "notmuch_messages_move_to_next");
1894 		bindFunc(cast(void**)&notmuch_messages_destroy, "notmuch_messages_destroy");
1895 		bindFunc(cast(void**)&notmuch_messages_collect_tags, "notmuch_messages_collect_tags");
1896 		bindFunc(cast(void**)&notmuch_message_get_message_id, "notmuch_message_get_message_id");
1897 		bindFunc(cast(void**)&notmuch_message_get_thread_id, "notmuch_message_get_thread_id");
1898 		bindFunc(cast(void**)&notmuch_message_get_replies, "notmuch_message_get_replies");
1899 		bindFunc(cast(void**)&notmuch_message_get_filename, "notmuch_message_get_filename");
1900 		bindFunc(cast(void**)&notmuch_message_get_filenames, "notmuch_message_get_filenames");
1901 		bindFunc(cast(void**)&notmuch_message_get_flag, "notmuch_message_get_flag");
1902 		bindFunc(cast(void**)&notmuch_message_set_flag, "notmuch_message_set_flag");
1903 		bindFunc(cast(void**)&notmuch_message_get_date, "notmuch_message_get_date");
1904 		bindFunc(cast(void**)&notmuch_message_get_header, "notmuch_message_get_header");
1905 		bindFunc(cast(void**)&notmuch_message_get_tags, "notmuch_message_get_tags");
1906 		bindFunc(cast(void**)&notmuch_message_add_tag, "notmuch_message_add_tag");
1907 		bindFunc(cast(void**)&notmuch_message_remove_tag, "notmuch_message_remove_tag");
1908 		bindFunc(cast(void**)&notmuch_message_remove_all_tags, "notmuch_message_remove_all_tags");
1909 		bindFunc(cast(void**)&notmuch_message_maildir_flags_to_tags, "notmuch_message_maildir_flags_to_tags");
1910 		bindFunc(cast(void**)&notmuch_message_tags_to_maildir_flags, "notmuch_message_tags_to_maildir_flags");
1911 		bindFunc(cast(void**)&notmuch_message_freeze, "notmuch_message_freeze");
1912 		bindFunc(cast(void**)&notmuch_message_thaw, "notmuch_message_thaw");
1913 		bindFunc(cast(void**)&notmuch_message_destroy, "notmuch_message_destroy");
1914 		bindFunc(cast(void**)&notmuch_message_get_property, "notmuch_message_get_property");
1915 		bindFunc(cast(void**)&notmuch_message_add_property, "notmuch_message_add_property");
1916 		bindFunc(cast(void**)&notmuch_message_remove_property, "notmuch_message_remove_property");
1917 		bindFunc(cast(void**)&notmuch_message_remove_all_properties, "notmuch_message_remove_all_properties");
1918 		bindFunc(cast(void**)&notmuch_message_get_properties, "notmuch_message_get_properties");
1919 		bindFunc(cast(void**)&notmuch_message_properties_valid, "notmuch_message_properties_valid");
1920 		bindFunc(cast(void**)&notmuch_message_properties_move_to_next, "notmuch_message_properties_move_to_next");
1921 		bindFunc(cast(void**)&notmuch_message_properties_key, "notmuch_message_properties_key");
1922 		bindFunc(cast(void**)&notmuch_message_properties_value, "notmuch_message_properties_value");
1923 		bindFunc(cast(void**)&notmuch_message_properties_destroy, "notmuch_message_properties_destroy");
1924 		bindFunc(cast(void**)&notmuch_tags_valid, "notmuch_tags_valid");
1925 		bindFunc(cast(void**)&notmuch_tags_get, "notmuch_tags_get");
1926 		bindFunc(cast(void**)&notmuch_tags_move_to_next, "notmuch_tags_move_to_next");
1927 		bindFunc(cast(void**)&notmuch_tags_destroy, "notmuch_tags_destroy");
1928 		bindFunc(cast(void**)&notmuch_directory_set_mtime, "notmuch_directory_set_mtime");
1929 		bindFunc(cast(void**)&notmuch_directory_get_mtime, "notmuch_directory_get_mtime");
1930 		bindFunc(cast(void**)&notmuch_directory_get_child_files, "notmuch_directory_get_child_files");
1931 		bindFunc(cast(void**)&notmuch_directory_get_child_directories, "notmuch_directory_get_child_directories");
1932 		bindFunc(cast(void**)&notmuch_directory_delete, "notmuch_directory_delete");
1933 		bindFunc(cast(void**)&notmuch_directory_destroy, "notmuch_directory_destroy");
1934 		bindFunc(cast(void**)&notmuch_filenames_valid, "notmuch_filenames_valid");
1935 		bindFunc(cast(void**)&notmuch_filenames_get, "notmuch_filenames_get");
1936 		bindFunc(cast(void**)&notmuch_filenames_move_to_next, "notmuch_filenames_move_to_next");
1937 		bindFunc(cast(void**)&notmuch_filenames_destroy, "notmuch_filenames_destroy");
1938 		bindFunc(cast(void**)&notmuch_database_set_config, "notmuch_database_set_config");
1939 		bindFunc(cast(void**)&notmuch_database_get_config, "notmuch_database_get_config");
1940 		bindFunc(cast(void**)&notmuch_database_get_config_list, "notmuch_database_get_config_list");
1941 		bindFunc(cast(void**)&notmuch_config_list_valid, "notmuch_config_list_valid");
1942 		bindFunc(cast(void**)&notmuch_config_list_key, "notmuch_config_list_key");
1943 		bindFunc(cast(void**)&notmuch_config_list_value, "notmuch_config_list_value");
1944 		bindFunc(cast(void**)&notmuch_config_list_move_to_next, "notmuch_config_list_move_to_next");
1945 		bindFunc(cast(void**)&notmuch_config_list_destroy, "notmuch_config_list_destroy");
1946 		bindFunc(cast(void**)&notmuch_built_with, "notmuch_built_with");
1947 	}
1948 }
1949 
1950 __gshared DerelictNotMuchLoader DerelictNotMuch;
1951 
1952 shared static this() {
1953 	DerelictNotMuch = new DerelictNotMuchLoader;
1954 }