1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 721B9429E5A
\r
6 for <notmuch@notmuchmail.org>; Wed, 6 Nov 2013 09:36:06 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id GSZQQZ3aS9HI for <notmuch@notmuchmail.org>;
\r
17 Wed, 6 Nov 2013 09:35:56 -0800 (PST)
\r
18 Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com
\r
19 [209.85.215.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id EB653429E59
\r
22 for <notmuch@notmuchmail.org>; Wed, 6 Nov 2013 09:35:55 -0800 (PST)
\r
23 Received: by mail-ea0-f172.google.com with SMTP id r16so5193815ead.3
\r
24 for <notmuch@notmuchmail.org>; Wed, 06 Nov 2013 09:35:54 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 :references:in-reply-to:references;
\r
29 bh=68ipSPoxz3N3pFDYbLOm80oyw/uUHFf7nzhKKiy4Vow=;
\r
30 b=PZEQPkVcj2QD0UIPJtR2qVL1LzIyuomwvOR2ZbGjgKPGT8Wk4+8C5L1qk2qri/d+Tr
\r
31 XfuAW84MmV5g1xsbbMV/wOmb+yUQP3IEPdatsG9d0Ym+Ojf8fF58Co0dDMiWZN506GyI
\r
32 HU/KDyZU4aUkm5UsxrHP9w+TZIlo3sp8ijUrZt+epm1oDf6hQpatyzLAM9HP3BG6uZ99
\r
33 Gwo7bpZEbdzvj1RU/OVTfNDwoPzViB2mPC7mor8pXutJwdBCp3FS4KhZczaRN9M9yaC9
\r
34 01LzNa8nOgKPNP0m+5ECDLKBdchgFatc4HC0iltDXfH7HnJ2EDy9FPJws3z0dYCJ/5fm
\r
37 ALoCoQn/8RM8dRLnkJqhAfShWMmamuIuanxzkeq86I/8a7MKreFSMSF94XbLidhnJvpwD+7uHZ68
\r
38 X-Received: by 10.15.64.1 with SMTP id n1mr4863750eex.15.1383759354839;
\r
39 Wed, 06 Nov 2013 09:35:54 -0800 (PST)
\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
42 by mx.google.com with ESMTPSA id w6sm76385237eeo.12.2013.11.06.09.35.52
\r
43 for <multiple recipients>
\r
44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
45 Wed, 06 Nov 2013 09:35:54 -0800 (PST)
\r
46 From: Jani Nikula <jani@nikula.org>
\r
47 To: notmuch@notmuchmail.org
\r
48 Subject: [RFC PATCH 2/2] lib: modify notmuch.h for automatic document
\r
50 Date: Wed, 6 Nov 2013 19:35:41 +0200
\r
52 <2835d28b1ddec0338f906b5165494f0fda5cb388.1383758666.git.jani@nikula.org>
\r
53 X-Mailer: git-send-email 1.8.4.rc3
\r
54 In-Reply-To: <cover.1383758666.git.jani@nikula.org>
\r
55 References: <cover.1383758666.git.jani@nikula.org>
\r
56 In-Reply-To: <cover.1383758666.git.jani@nikula.org>
\r
57 References: <cover.1383758666.git.jani@nikula.org>
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Wed, 06 Nov 2013 17:36:06 -0000
\r
72 Minimal changes to produce a sensible result.
\r
74 lib/notmuch.h | 426 +++++++++++++++++++++++++++++++++++++++-------------------
\r
75 1 file changed, 289 insertions(+), 137 deletions(-)
\r
77 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
78 index 9dab555..6d91b17 100644
\r
82 * Author: Carl Worth <cworth@cworth.org>
\r
86 + * @defgroup notmuch The notmuch API
\r
88 + * Not much of an email library, (just index and search)
\r
96 +#ifndef __DOXYGEN__
\r
99 # define NOTMUCH_BEGIN_DECLS extern "C" {
\r
100 # define NOTMUCH_END_DECLS }
\r
101 @@ -33,6 +43,8 @@ NOTMUCH_BEGIN_DECLS
\r
105 +#endif /* __DOXYGEN__ */
\r
110 @@ -41,72 +53,87 @@ NOTMUCH_BEGIN_DECLS
\r
115 + * Notmuch boolean type.
\r
117 typedef int notmuch_bool_t;
\r
119 -/* Status codes used for the return values of most functions.
\r
121 + * Status codes used for the return values of most functions.
\r
123 * A zero value (NOTMUCH_STATUS_SUCCESS) indicates that the function
\r
124 - * completed without error. Any other value indicates an error as
\r
127 - * NOTMUCH_STATUS_SUCCESS: No error occurred.
\r
129 - * NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory
\r
131 - * XXX: We don't really want to expose this lame XAPIAN_EXCEPTION
\r
132 - * value. Instead we should map to things like DATABASE_LOCKED or
\r
135 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: An attempt was made to write to
\r
136 - * a database opened in read-only mode.
\r
137 + * completed without error. Any other value indicates an error.
\r
139 - * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred
\r
141 - * NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to read or
\r
142 - * write to a file (this could be file not found, permission
\r
145 - * NOTMUCH_STATUS_FILE_NOT_EMAIL: A file was presented that doesn't
\r
146 - * appear to be an email message.
\r
148 - * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: A file contains a message ID
\r
149 - * that is identical to a message already in the database.
\r
151 - * NOTMUCH_STATUS_NULL_POINTER: The user erroneously passed a NULL
\r
152 - * pointer to a notmuch function.
\r
154 - * NOTMUCH_STATUS_TAG_TOO_LONG: A tag value is too long (exceeds
\r
155 - * NOTMUCH_TAG_MAX)
\r
157 - * NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: The notmuch_message_thaw
\r
158 - * function has been called more times than notmuch_message_freeze.
\r
160 - * NOTMUCH_STATUS_UNBALANCED_ATOMIC: notmuch_database_end_atomic has
\r
161 - * been called more times than notmuch_database_begin_atomic.
\r
165 - * NOTMUCH_STATUS_LAST_STATUS: Not an actual status value. Just a way
\r
166 - * to find out how many valid status values there are.
\r
168 typedef enum _notmuch_status {
\r
170 + * No error occurred.
\r
172 NOTMUCH_STATUS_SUCCESS = 0,
\r
176 NOTMUCH_STATUS_OUT_OF_MEMORY,
\r
178 + * An attempt was made to write to a database opened in read-only
\r
181 NOTMUCH_STATUS_READ_ONLY_DATABASE,
\r
183 + * A Xapian exception occurred.
\r
185 NOTMUCH_STATUS_XAPIAN_EXCEPTION,
\r
187 + * An error occurred trying to read or write to a file (this could
\r
188 + * be file not found, permission denied, etc.)
\r
190 + * @todo We don't really want to expose this lame XAPIAN_EXCEPTION
\r
191 + * value. Instead we should map to things like DATABASE_LOCKED or
\r
194 NOTMUCH_STATUS_FILE_ERROR,
\r
196 + * A file was presented that doesn't appear to be an email
\r
199 NOTMUCH_STATUS_FILE_NOT_EMAIL,
\r
201 + * A file contains a message ID that is identical to a message
\r
202 + * already in the database.
\r
204 NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID,
\r
206 + * The user erroneously passed a NULL pointer to a notmuch
\r
209 NOTMUCH_STATUS_NULL_POINTER,
\r
211 + * A tag value is too long (exceeds NOTMUCH_TAG_MAX).
\r
213 NOTMUCH_STATUS_TAG_TOO_LONG,
\r
215 + * The notmuch_message_thaw function has been called more times
\r
216 + * than notmuch_message_freeze.
\r
218 NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW,
\r
220 + * notmuch_database_end_atomic has been called more times than
\r
221 + * notmuch_database_begin_atomic.
\r
223 NOTMUCH_STATUS_UNBALANCED_ATOMIC,
\r
225 + * The operation is not supported.
\r
227 NOTMUCH_STATUS_UNSUPPORTED_OPERATION,
\r
230 + * Not an actual status value. Just a way to find out how many
\r
231 + * valid status values there are.
\r
233 NOTMUCH_STATUS_LAST_STATUS
\r
234 } notmuch_status_t;
\r
236 -/* Get a string representation of a notmuch_status_t value.
\r
238 + * Get a string representation of a notmuch_status_t value.
\r
240 * The result is read-only.
\r
242 @@ -125,7 +152,8 @@ typedef struct _notmuch_tags notmuch_tags_t;
\r
243 typedef struct _notmuch_directory notmuch_directory_t;
\r
244 typedef struct _notmuch_filenames notmuch_filenames_t;
\r
246 -/* Create a new, empty notmuch database located at 'path'.
\r
248 + * Create a new, empty notmuch database located at 'path'.
\r
250 * The path should be a top-level directory to a collection of
\r
251 * plain-text email messages (one message per file). This call will
\r
252 @@ -161,12 +189,22 @@ typedef struct _notmuch_filenames notmuch_filenames_t;
\r
254 notmuch_database_create (const char *path, notmuch_database_t **database);
\r
257 + * Database open mode for notmuch_database_open.
\r
261 + * Open database for reading only.
\r
263 NOTMUCH_DATABASE_MODE_READ_ONLY = 0,
\r
265 + * Open database for reading and writing.
\r
267 NOTMUCH_DATABASE_MODE_READ_WRITE
\r
268 } notmuch_database_mode_t;
\r
270 -/* Open an existing notmuch database located at 'path'.
\r
272 + * Open an existing notmuch database located at 'path'.
\r
274 * The database should have been created at some time in the past,
\r
275 * (not necessarily by this process), by calling
\r
276 @@ -202,7 +240,8 @@ notmuch_database_open (const char *path,
\r
277 notmuch_database_mode_t mode,
\r
278 notmuch_database_t **database);
\r
280 -/* Close the given notmuch database.
\r
282 + * Close the given notmuch database.
\r
284 * After notmuch_database_close has been called, calls to other
\r
285 * functions on objects derived from this database may either behave
\r
286 @@ -216,50 +255,59 @@ notmuch_database_open (const char *path,
\r
288 notmuch_database_close (notmuch_database_t *database);
\r
290 -/* A callback invoked by notmuch_database_compact to notify the user
\r
292 + * A callback invoked by notmuch_database_compact to notify the user
\r
293 * of the progress of the compaction process.
\r
295 typedef void (*notmuch_compact_status_cb_t)(const char*);
\r
297 -/* Compact a notmuch database, backing up the original database to the
\r
299 + * Compact a notmuch database, backing up the original database to the
\r
302 * The database will be opened with NOTMUCH_DATABASE_MODE_READ_WRITE
\r
303 * during the compaction process to ensure no writes are made.
\r
307 notmuch_database_compact (const char* path,
\r
308 const char* backup_path,
\r
309 notmuch_compact_status_cb_t status_cb);
\r
311 -/* Destroy the notmuch database, closing it if necessary and freeing
\r
313 + * Destroy the notmuch database, closing it if necessary and freeing
\r
314 * all associated resources.
\r
317 notmuch_database_destroy (notmuch_database_t *database);
\r
319 -/* Return the database path of the given database.
\r
321 + * Return the database path of the given database.
\r
323 * The return value is a string owned by notmuch so should not be
\r
324 - * modified nor freed by the caller. */
\r
325 + * modified nor freed by the caller.
\r
328 notmuch_database_get_path (notmuch_database_t *database);
\r
330 -/* Return the database format version of the given database. */
\r
332 + * Return the database format version of the given database.
\r
335 notmuch_database_get_version (notmuch_database_t *database);
\r
337 -/* Does this database need to be upgraded before writing to it?
\r
339 + * Does this database need to be upgraded before writing to it?
\r
341 * If this function returns TRUE then no functions that modify the
\r
342 * database (notmuch_database_add_message, notmuch_message_add_tag,
\r
343 * notmuch_directory_set_mtime, etc.) will work unless the function
\r
344 - * notmuch_database_upgrade is called successfully first. */
\r
345 + * notmuch_database_upgrade is called successfully first.
\r
348 notmuch_database_needs_upgrade (notmuch_database_t *database);
\r
350 -/* Upgrade the current database.
\r
352 + * Upgrade the current database.
\r
354 * After opening a database in read-write mode, the client should
\r
355 * check if an upgrade is needed (notmuch_database_needs_upgrade) and
\r
356 @@ -277,7 +325,8 @@ notmuch_database_upgrade (notmuch_database_t *database,
\r
360 -/* Begin an atomic database operation.
\r
362 + * Begin an atomic database operation.
\r
364 * Any modifications performed between a successful begin and a
\r
365 * notmuch_database_end_atomic will be applied to the database
\r
366 @@ -298,7 +347,8 @@ notmuch_database_upgrade (notmuch_database_t *database,
\r
368 notmuch_database_begin_atomic (notmuch_database_t *notmuch);
\r
370 -/* Indicate the end of an atomic database operation.
\r
372 + * Indicate the end of an atomic database operation.
\r
376 @@ -313,7 +363,8 @@ notmuch_database_begin_atomic (notmuch_database_t *notmuch);
\r
378 notmuch_database_end_atomic (notmuch_database_t *notmuch);
\r
380 -/* Retrieve a directory object from the database for 'path'.
\r
382 + * Retrieve a directory object from the database for 'path'.
\r
384 * Here, 'path' should be a path relative to the path of 'database'
\r
385 * (see notmuch_database_get_path), or else should be an absolute path
\r
386 @@ -336,7 +387,8 @@ notmuch_database_get_directory (notmuch_database_t *database,
\r
388 notmuch_directory_t **directory);
\r
390 -/* Add a new message to the given notmuch database or associate an
\r
392 + * Add a new message to the given notmuch database or associate an
\r
393 * additional filename with an existing message.
\r
395 * Here, 'filename' should be a path relative to the path of
\r
396 @@ -387,7 +439,8 @@ notmuch_database_add_message (notmuch_database_t *database,
\r
397 const char *filename,
\r
398 notmuch_message_t **message);
\r
400 -/* Remove a message filename from the given notmuch database. If the
\r
402 + * Remove a message filename from the given notmuch database. If the
\r
403 * message has no more filenames, remove the message.
\r
405 * If the same message (as determined by the message ID) is still
\r
406 @@ -415,7 +468,8 @@ notmuch_status_t
\r
407 notmuch_database_remove_message (notmuch_database_t *database,
\r
408 const char *filename);
\r
410 -/* Find a message with the given message_id.
\r
412 + * Find a message with the given message_id.
\r
414 * If a message with the given message_id is found then, on successful return
\r
415 * (NOTMUCH_STATUS_SUCCESS) '*message' will be initialized to a message
\r
416 @@ -442,7 +496,8 @@ notmuch_database_find_message (notmuch_database_t *database,
\r
417 const char *message_id,
\r
418 notmuch_message_t **message);
\r
420 -/* Find a message with the given filename.
\r
422 + * Find a message with the given filename.
\r
424 * If the database contains a message with the given filename then, on
\r
425 * successful return (NOTMUCH_STATUS_SUCCESS) '*message' will be initialized to
\r
426 @@ -469,7 +524,8 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch,
\r
427 const char *filename,
\r
428 notmuch_message_t **message);
\r
430 -/* Return a list of all tags found in the database.
\r
432 + * Return a list of all tags found in the database.
\r
434 * This function creates a list of all tags found in the database. The
\r
435 * resulting list contains all tags from all messages found in the database.
\r
436 @@ -479,7 +535,8 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch,
\r
438 notmuch_database_get_all_tags (notmuch_database_t *db);
\r
440 -/* Create a new query for 'database'.
\r
442 + * Create a new query for 'database'.
\r
444 * Here, 'database' should be an open database, (see
\r
445 * notmuch_database_open and notmuch_database_create).
\r
446 @@ -507,19 +564,36 @@ notmuch_query_t *
\r
447 notmuch_query_create (notmuch_database_t *database,
\r
448 const char *query_string);
\r
450 -/* Sort values for notmuch_query_set_sort */
\r
452 + * Sort values for notmuch_query_set_sort.
\r
458 NOTMUCH_SORT_OLDEST_FIRST,
\r
462 NOTMUCH_SORT_NEWEST_FIRST,
\r
464 + * Sort by message-id.
\r
466 NOTMUCH_SORT_MESSAGE_ID,
\r
470 NOTMUCH_SORT_UNSORTED
\r
473 -/* Return the query_string of this query. See notmuch_query_create. */
\r
475 + * Return the query_string of this query. See notmuch_query_create.
\r
478 notmuch_query_get_query_string (notmuch_query_t *query);
\r
480 -/* Exclude values for notmuch_query_set_omit_excluded. The strange
\r
482 + * Exclude values for notmuch_query_set_omit_excluded. The strange
\r
483 * order is to maintain backward compatibility: the old FALSE/TRUE
\r
484 * options correspond to the new
\r
485 * NOTMUCH_EXCLUDE_FLAG/NOTMUCH_EXCLUDE_TRUE options.
\r
486 @@ -531,7 +605,8 @@ typedef enum {
\r
487 NOTMUCH_EXCLUDE_ALL
\r
488 } notmuch_exclude_t;
\r
490 -/* Specify whether to omit excluded results or simply flag them. By
\r
492 + * Specify whether to omit excluded results or simply flag them. By
\r
493 * default, this is set to TRUE.
\r
495 * If set to TRUE or ALL, notmuch_query_search_messages will omit excluded
\r
496 @@ -561,21 +636,29 @@ void
\r
497 notmuch_query_set_omit_excluded (notmuch_query_t *query,
\r
498 notmuch_exclude_t omit_excluded);
\r
500 -/* Specify the sorting desired for this query. */
\r
502 + * Specify the sorting desired for this query.
\r
505 notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
\r
507 -/* Return the sort specified for this query. See notmuch_query_set_sort. */
\r
509 + * Return the sort specified for this query. See
\r
510 + * notmuch_query_set_sort.
\r
513 notmuch_query_get_sort (notmuch_query_t *query);
\r
515 -/* Add a tag that will be excluded from the query results by default.
\r
517 + * Add a tag that will be excluded from the query results by default.
\r
518 * This exclusion will be overridden if this tag appears explicitly in
\r
523 notmuch_query_add_tag_exclude (notmuch_query_t *query, const char *tag);
\r
525 -/* Execute a query for threads, returning a notmuch_threads_t object
\r
527 + * Execute a query for threads, returning a notmuch_threads_t object
\r
528 * which can be used to iterate over the results. The returned threads
\r
529 * object is owned by the query and as such, will only be valid until
\r
530 * notmuch_query_destroy.
\r
531 @@ -616,7 +699,8 @@ notmuch_query_add_tag_exclude (notmuch_query_t *query, const char *tag);
\r
532 notmuch_threads_t *
\r
533 notmuch_query_search_threads (notmuch_query_t *query);
\r
535 -/* Execute a query for messages, returning a notmuch_messages_t object
\r
537 + * Execute a query for messages, returning a notmuch_messages_t object
\r
538 * which can be used to iterate over the results. The returned
\r
539 * messages object is owned by the query and as such, will only be
\r
540 * valid until notmuch_query_destroy.
\r
541 @@ -657,7 +741,8 @@ notmuch_query_search_threads (notmuch_query_t *query);
\r
542 notmuch_messages_t *
\r
543 notmuch_query_search_messages (notmuch_query_t *query);
\r
545 -/* Destroy a notmuch_query_t along with any associated resources.
\r
547 + * Destroy a notmuch_query_t along with any associated resources.
\r
549 * This will in turn destroy any notmuch_threads_t and
\r
550 * notmuch_messages_t objects generated by this query, (and in
\r
551 @@ -668,7 +753,8 @@ notmuch_query_search_messages (notmuch_query_t *query);
\r
553 notmuch_query_destroy (notmuch_query_t *query);
\r
555 -/* Is the given 'threads' iterator pointing at a valid thread.
\r
557 + * Is the given 'threads' iterator pointing at a valid thread.
\r
559 * When this function returns TRUE, notmuch_threads_get will return a
\r
560 * valid object. Whereas when this function returns FALSE,
\r
561 @@ -680,7 +766,8 @@ notmuch_query_destroy (notmuch_query_t *query);
\r
563 notmuch_threads_valid (notmuch_threads_t *threads);
\r
565 -/* Get the current thread from 'threads' as a notmuch_thread_t.
\r
567 + * Get the current thread from 'threads' as a notmuch_thread_t.
\r
569 * Note: The returned thread belongs to 'threads' and has a lifetime
\r
570 * identical to it (and the query to which it belongs).
\r
571 @@ -694,7 +781,8 @@ notmuch_threads_valid (notmuch_threads_t *threads);
\r
573 notmuch_threads_get (notmuch_threads_t *threads);
\r
575 -/* Move the 'threads' iterator to the next thread.
\r
577 + * Move the 'threads' iterator to the next thread.
\r
579 * If 'threads' is already pointing at the last thread then the
\r
580 * iterator will be moved to a point just beyond that last thread,
\r
581 @@ -707,7 +795,8 @@ notmuch_threads_get (notmuch_threads_t *threads);
\r
583 notmuch_threads_move_to_next (notmuch_threads_t *threads);
\r
585 -/* Destroy a notmuch_threads_t object.
\r
587 + * Destroy a notmuch_threads_t object.
\r
589 * It's not strictly necessary to call this function. All memory from
\r
590 * the notmuch_threads_t object will be reclaimed when the
\r
591 @@ -716,7 +805,8 @@ notmuch_threads_move_to_next (notmuch_threads_t *threads);
\r
593 notmuch_threads_destroy (notmuch_threads_t *threads);
\r
595 -/* Return an estimate of the number of messages matching a search
\r
597 + * Return an estimate of the number of messages matching a search.
\r
599 * This function performs a search and returns Xapian's best
\r
600 * guess as to number of matching messages.
\r
601 @@ -726,8 +816,9 @@ notmuch_threads_destroy (notmuch_threads_t *threads);
\r
604 notmuch_query_count_messages (notmuch_query_t *query);
\r
606 -/* Return the number of threads matching a search.
\r
609 + * Return the number of threads matching a search.
\r
611 * This function performs a search and returns the number of unique thread IDs
\r
612 * in the matching messages. This is the same as number of threads matching a
\r
613 @@ -741,7 +832,8 @@ notmuch_query_count_messages (notmuch_query_t *query);
\r
615 notmuch_query_count_threads (notmuch_query_t *query);
\r
617 -/* Get the thread ID of 'thread'.
\r
619 + * Get the thread ID of 'thread'.
\r
621 * The returned string belongs to 'thread' and as such, should not be
\r
622 * modified by the caller and will only be valid for as long as the
\r
623 @@ -751,7 +843,8 @@ notmuch_query_count_threads (notmuch_query_t *query);
\r
625 notmuch_thread_get_thread_id (notmuch_thread_t *thread);
\r
627 -/* Get the total number of messages in 'thread'.
\r
629 + * Get the total number of messages in 'thread'.
\r
631 * This count consists of all messages in the database belonging to
\r
632 * this thread. Contrast with notmuch_thread_get_matched_messages() .
\r
633 @@ -759,7 +852,8 @@ notmuch_thread_get_thread_id (notmuch_thread_t *thread);
\r
635 notmuch_thread_get_total_messages (notmuch_thread_t *thread);
\r
637 -/* Get a notmuch_messages_t iterator for the top-level messages in
\r
639 + * Get a notmuch_messages_t iterator for the top-level messages in
\r
640 * 'thread' in oldest-first order.
\r
642 * This iterator will not necessarily iterate over all of the messages
\r
643 @@ -769,13 +863,15 @@ notmuch_thread_get_total_messages (notmuch_thread_t *thread);
\r
644 notmuch_messages_t *
\r
645 notmuch_thread_get_toplevel_messages (notmuch_thread_t *thread);
\r
647 -/* Get a notmuch_thread_t iterator for all messages in 'thread' in
\r
649 + * Get a notmuch_thread_t iterator for all messages in 'thread' in
\r
650 * oldest-first order.
\r
652 notmuch_messages_t *
\r
653 notmuch_thread_get_messages (notmuch_thread_t *thread);
\r
655 -/* Get the number of messages in 'thread' that matched the search.
\r
657 + * Get the number of messages in 'thread' that matched the search.
\r
659 * This count includes only the messages in this thread that were
\r
660 * matched by the search from which the thread was created and were
\r
661 @@ -786,7 +882,8 @@ notmuch_thread_get_messages (notmuch_thread_t *thread);
\r
663 notmuch_thread_get_matched_messages (notmuch_thread_t *thread);
\r
665 -/* Get the authors of 'thread' as a UTF-8 string.
\r
667 + * Get the authors of 'thread' as a UTF-8 string.
\r
669 * The returned string is a comma-separated list of the names of the
\r
670 * authors of mail messages in the query results that belong to this
\r
671 @@ -800,7 +897,8 @@ notmuch_thread_get_matched_messages (notmuch_thread_t *thread);
\r
673 notmuch_thread_get_authors (notmuch_thread_t *thread);
\r
675 -/* Get the subject of 'thread' as a UTF-8 string.
\r
677 + * Get the subject of 'thread' as a UTF-8 string.
\r
679 * The subject is taken from the first message (according to the query
\r
680 * order---see notmuch_query_set_sort) in the query results that
\r
681 @@ -814,17 +912,20 @@ notmuch_thread_get_authors (notmuch_thread_t *thread);
\r
683 notmuch_thread_get_subject (notmuch_thread_t *thread);
\r
685 -/* Get the date of the oldest message in 'thread' as a time_t value.
\r
687 + * Get the date of the oldest message in 'thread' as a time_t value.
\r
690 notmuch_thread_get_oldest_date (notmuch_thread_t *thread);
\r
692 -/* Get the date of the newest message in 'thread' as a time_t value.
\r
694 + * Get the date of the newest message in 'thread' as a time_t value.
\r
697 notmuch_thread_get_newest_date (notmuch_thread_t *thread);
\r
699 -/* Get the tags for 'thread', returning a notmuch_tags_t object which
\r
701 + * Get the tags for 'thread', returning a notmuch_tags_t object which
\r
702 * can be used to iterate over all tags.
\r
704 * Note: In the Notmuch database, tags are stored on individual
\r
705 @@ -863,11 +964,14 @@ notmuch_thread_get_newest_date (notmuch_thread_t *thread);
\r
707 notmuch_thread_get_tags (notmuch_thread_t *thread);
\r
709 -/* Destroy a notmuch_thread_t object. */
\r
711 + * Destroy a notmuch_thread_t object.
\r
714 notmuch_thread_destroy (notmuch_thread_t *thread);
\r
716 -/* Is the given 'messages' iterator pointing at a valid message.
\r
718 + * Is the given 'messages' iterator pointing at a valid message.
\r
720 * When this function returns TRUE, notmuch_messages_get will return a
\r
721 * valid object. Whereas when this function returns FALSE,
\r
722 @@ -879,7 +983,8 @@ notmuch_thread_destroy (notmuch_thread_t *thread);
\r
724 notmuch_messages_valid (notmuch_messages_t *messages);
\r
726 -/* Get the current message from 'messages' as a notmuch_message_t.
\r
728 + * Get the current message from 'messages' as a notmuch_message_t.
\r
730 * Note: The returned message belongs to 'messages' and has a lifetime
\r
731 * identical to it (and the query to which it belongs).
\r
732 @@ -893,7 +998,8 @@ notmuch_messages_valid (notmuch_messages_t *messages);
\r
733 notmuch_message_t *
\r
734 notmuch_messages_get (notmuch_messages_t *messages);
\r
736 -/* Move the 'messages' iterator to the next message.
\r
738 + * Move the 'messages' iterator to the next message.
\r
740 * If 'messages' is already pointing at the last message then the
\r
741 * iterator will be moved to a point just beyond that last message,
\r
742 @@ -906,7 +1012,8 @@ notmuch_messages_get (notmuch_messages_t *messages);
\r
744 notmuch_messages_move_to_next (notmuch_messages_t *messages);
\r
746 -/* Destroy a notmuch_messages_t object.
\r
748 + * Destroy a notmuch_messages_t object.
\r
750 * It's not strictly necessary to call this function. All memory from
\r
751 * the notmuch_messages_t object will be reclaimed when the containing
\r
752 @@ -915,7 +1022,8 @@ notmuch_messages_move_to_next (notmuch_messages_t *messages);
\r
754 notmuch_messages_destroy (notmuch_messages_t *messages);
\r
756 -/* Return a list of tags from all messages.
\r
758 + * Return a list of tags from all messages.
\r
760 * The resulting list is guaranteed not to contain duplicated tags.
\r
762 @@ -930,7 +1038,8 @@ notmuch_messages_destroy (notmuch_messages_t *messages);
\r
764 notmuch_messages_collect_tags (notmuch_messages_t *messages);
\r
766 -/* Get the message ID of 'message'.
\r
768 + * Get the message ID of 'message'.
\r
770 * The returned string belongs to 'message' and as such, should not be
\r
771 * modified by the caller and will only be valid for as long as the
\r
772 @@ -944,7 +1053,8 @@ notmuch_messages_collect_tags (notmuch_messages_t *messages);
\r
774 notmuch_message_get_message_id (notmuch_message_t *message);
\r
776 -/* Get the thread ID of 'message'.
\r
778 + * Get the thread ID of 'message'.
\r
780 * The returned string belongs to 'message' and as such, should not be
\r
781 * modified by the caller and will only be valid for as long as the
\r
782 @@ -958,7 +1068,8 @@ notmuch_message_get_message_id (notmuch_message_t *message);
\r
784 notmuch_message_get_thread_id (notmuch_message_t *message);
\r
786 -/* Get a notmuch_messages_t iterator for all of the replies to
\r
788 + * Get a notmuch_messages_t iterator for all of the replies to
\r
791 * Note: This call only makes sense if 'message' was ultimately
\r
792 @@ -978,7 +1089,8 @@ notmuch_message_get_thread_id (notmuch_message_t *message);
\r
793 notmuch_messages_t *
\r
794 notmuch_message_get_replies (notmuch_message_t *message);
\r
796 -/* Get a filename for the email corresponding to 'message'.
\r
798 + * Get a filename for the email corresponding to 'message'.
\r
800 * The returned filename is an absolute filename, (the initial
\r
801 * component will match notmuch_database_get_path() ).
\r
802 @@ -996,7 +1108,8 @@ notmuch_message_get_replies (notmuch_message_t *message);
\r
804 notmuch_message_get_filename (notmuch_message_t *message);
\r
806 -/* Get all filenames for the email corresponding to 'message'.
\r
808 + * Get all filenames for the email corresponding to 'message'.
\r
810 * Returns a notmuch_filenames_t iterator listing all the filenames
\r
811 * associated with 'message'. These files may not have identical
\r
812 @@ -1008,31 +1121,40 @@ notmuch_message_get_filename (notmuch_message_t *message);
\r
813 notmuch_filenames_t *
\r
814 notmuch_message_get_filenames (notmuch_message_t *message);
\r
816 -/* Message flags */
\r
820 typedef enum _notmuch_message_flag {
\r
821 NOTMUCH_MESSAGE_FLAG_MATCH,
\r
822 NOTMUCH_MESSAGE_FLAG_EXCLUDED
\r
823 } notmuch_message_flag_t;
\r
825 -/* Get a value of a flag for the email corresponding to 'message'. */
\r
827 + * Get a value of a flag for the email corresponding to 'message'.
\r
830 notmuch_message_get_flag (notmuch_message_t *message,
\r
831 notmuch_message_flag_t flag);
\r
833 -/* Set a value of a flag for the email corresponding to 'message'. */
\r
835 + * Set a value of a flag for the email corresponding to 'message'.
\r
838 notmuch_message_set_flag (notmuch_message_t *message,
\r
839 notmuch_message_flag_t flag, notmuch_bool_t value);
\r
841 -/* Get the date of 'message' as a time_t value.
\r
843 + * Get the date of 'message' as a time_t value.
\r
845 * For the original textual representation of the Date header from the
\r
846 * message call notmuch_message_get_header() with a header value of
\r
851 notmuch_message_get_date (notmuch_message_t *message);
\r
853 -/* Get the value of the specified header from 'message' as a UTF-8 string.
\r
855 + * Get the value of the specified header from 'message' as a UTF-8 string.
\r
857 * Common headers are stored in the database when the message is
\r
858 * indexed and will be returned from the database. Other headers will
\r
859 @@ -1050,7 +1172,8 @@ notmuch_message_get_date (notmuch_message_t *message);
\r
861 notmuch_message_get_header (notmuch_message_t *message, const char *header);
\r
863 -/* Get the tags for 'message', returning a notmuch_tags_t object which
\r
865 + * Get the tags for 'message', returning a notmuch_tags_t object which
\r
866 * can be used to iterate over all tags.
\r
868 * The tags object is owned by the message and as such, will only be
\r
869 @@ -1083,10 +1206,13 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header);
\r
871 notmuch_message_get_tags (notmuch_message_t *message);
\r
873 -/* The longest possible tag value. */
\r
875 + * The longest possible tag value.
\r
877 #define NOTMUCH_TAG_MAX 200
\r
879 -/* Add a tag to the given message.
\r
881 + * Add a tag to the given message.
\r
885 @@ -1103,7 +1229,8 @@ notmuch_message_get_tags (notmuch_message_t *message);
\r
887 notmuch_message_add_tag (notmuch_message_t *message, const char *tag);
\r
889 -/* Remove a tag from the given message.
\r
891 + * Remove a tag from the given message.
\r
895 @@ -1120,7 +1247,8 @@ notmuch_message_add_tag (notmuch_message_t *message, const char *tag);
\r
897 notmuch_message_remove_tag (notmuch_message_t *message, const char *tag);
\r
899 -/* Remove all tags from the given message.
\r
901 + * Remove all tags from the given message.
\r
903 * See notmuch_message_freeze for an example showing how to safely
\r
904 * replace tag values.
\r
905 @@ -1131,7 +1259,8 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag);
\r
907 notmuch_message_remove_all_tags (notmuch_message_t *message);
\r
909 -/* Add/remove tags according to maildir flags in the message filename(s)
\r
911 + * Add/remove tags according to maildir flags in the message filename(s).
\r
913 * This function examines the filenames of 'message' for maildir
\r
914 * flags, and adds or removes tags on 'message' as follows when these
\r
915 @@ -1165,7 +1294,8 @@ notmuch_message_remove_all_tags (notmuch_message_t *message);
\r
917 notmuch_message_maildir_flags_to_tags (notmuch_message_t *message);
\r
919 -/* Rename message filename(s) to encode tags as maildir flags
\r
921 + * Rename message filename(s) to encode tags as maildir flags.
\r
923 * Specifically, for each filename corresponding to this message:
\r
925 @@ -1201,7 +1331,8 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message);
\r
927 notmuch_message_tags_to_maildir_flags (notmuch_message_t *message);
\r
929 -/* Freeze the current state of 'message' within the database.
\r
931 + * Freeze the current state of 'message' within the database.
\r
933 * This means that changes to the message state, (via
\r
934 * notmuch_message_add_tag, notmuch_message_remove_tag, and
\r
935 @@ -1244,7 +1375,8 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message);
\r
937 notmuch_message_freeze (notmuch_message_t *message);
\r
939 -/* Thaw the current 'message', synchronizing any changes that may have
\r
941 + * Thaw the current 'message', synchronizing any changes that may have
\r
942 * occurred while 'message' was frozen into the notmuch database.
\r
944 * See notmuch_message_freeze for an example of how to use this
\r
945 @@ -1267,7 +1399,8 @@ notmuch_message_freeze (notmuch_message_t *message);
\r
947 notmuch_message_thaw (notmuch_message_t *message);
\r
949 -/* Destroy a notmuch_message_t object.
\r
951 + * Destroy a notmuch_message_t object.
\r
953 * It can be useful to call this function in the case of a single
\r
954 * query object with many messages in the result, (such as iterating
\r
955 @@ -1278,7 +1411,8 @@ notmuch_message_thaw (notmuch_message_t *message);
\r
957 notmuch_message_destroy (notmuch_message_t *message);
\r
959 -/* Is the given 'tags' iterator pointing at a valid tag.
\r
961 + * Is the given 'tags' iterator pointing at a valid tag.
\r
963 * When this function returns TRUE, notmuch_tags_get will return a
\r
964 * valid string. Whereas when this function returns FALSE,
\r
965 @@ -1290,7 +1424,8 @@ notmuch_message_destroy (notmuch_message_t *message);
\r
967 notmuch_tags_valid (notmuch_tags_t *tags);
\r
969 -/* Get the current tag from 'tags' as a string.
\r
971 + * Get the current tag from 'tags' as a string.
\r
973 * Note: The returned string belongs to 'tags' and has a lifetime
\r
974 * identical to it (and the query to which it ultimately belongs).
\r
975 @@ -1301,7 +1436,8 @@ notmuch_tags_valid (notmuch_tags_t *tags);
\r
977 notmuch_tags_get (notmuch_tags_t *tags);
\r
979 -/* Move the 'tags' iterator to the next tag.
\r
981 + * Move the 'tags' iterator to the next tag.
\r
983 * If 'tags' is already pointing at the last tag then the iterator
\r
984 * will be moved to a point just beyond that last tag, (where
\r
985 @@ -1314,7 +1450,8 @@ notmuch_tags_get (notmuch_tags_t *tags);
\r
987 notmuch_tags_move_to_next (notmuch_tags_t *tags);
\r
989 -/* Destroy a notmuch_tags_t object.
\r
991 + * Destroy a notmuch_tags_t object.
\r
993 * It's not strictly necessary to call this function. All memory from
\r
994 * the notmuch_tags_t object will be reclaimed when the containing
\r
995 @@ -1323,7 +1460,8 @@ notmuch_tags_move_to_next (notmuch_tags_t *tags);
\r
997 notmuch_tags_destroy (notmuch_tags_t *tags);
\r
999 -/* Store an mtime within the database for 'directory'.
\r
1001 + * Store an mtime within the database for 'directory'.
\r
1003 * The 'directory' should be an object retrieved from the database
\r
1004 * with notmuch_database_get_directory for a particular path.
\r
1005 @@ -1363,35 +1501,44 @@ notmuch_status_t
\r
1006 notmuch_directory_set_mtime (notmuch_directory_t *directory,
\r
1009 -/* Get the mtime of a directory, (as previously stored with
\r
1011 + * Get the mtime of a directory, (as previously stored with
\r
1012 * notmuch_directory_set_mtime).
\r
1014 * Returns 0 if no mtime has previously been stored for this
\r
1019 notmuch_directory_get_mtime (notmuch_directory_t *directory);
\r
1021 -/* Get a notmuch_filenames_t iterator listing all the filenames of
\r
1023 + * Get a notmuch_filenames_t iterator listing all the filenames of
\r
1024 * messages in the database within the given directory.
\r
1026 * The returned filenames will be the basename-entries only (not
\r
1027 - * complete paths). */
\r
1028 + * complete paths).
\r
1030 notmuch_filenames_t *
\r
1031 notmuch_directory_get_child_files (notmuch_directory_t *directory);
\r
1033 -/* Get a notmuch_filenams_t iterator listing all the filenames of
\r
1035 + * Get a notmuch_filenams_t iterator listing all the filenames of
\r
1036 * sub-directories in the database within the given directory.
\r
1038 * The returned filenames will be the basename-entries only (not
\r
1039 - * complete paths). */
\r
1040 + * complete paths).
\r
1042 notmuch_filenames_t *
\r
1043 notmuch_directory_get_child_directories (notmuch_directory_t *directory);
\r
1045 -/* Destroy a notmuch_directory_t object. */
\r
1047 + * Destroy a notmuch_directory_t object.
\r
1050 notmuch_directory_destroy (notmuch_directory_t *directory);
\r
1052 -/* Is the given 'filenames' iterator pointing at a valid filename.
\r
1054 + * Is the given 'filenames' iterator pointing at a valid filename.
\r
1056 * When this function returns TRUE, notmuch_filenames_get will return
\r
1057 * a valid string. Whereas when this function returns FALSE,
\r
1058 @@ -1403,7 +1550,8 @@ notmuch_directory_destroy (notmuch_directory_t *directory);
\r
1060 notmuch_filenames_valid (notmuch_filenames_t *filenames);
\r
1062 -/* Get the current filename from 'filenames' as a string.
\r
1064 + * Get the current filename from 'filenames' as a string.
\r
1066 * Note: The returned string belongs to 'filenames' and has a lifetime
\r
1067 * identical to it (and the directory to which it ultimately belongs).
\r
1068 @@ -1414,7 +1562,8 @@ notmuch_filenames_valid (notmuch_filenames_t *filenames);
\r
1070 notmuch_filenames_get (notmuch_filenames_t *filenames);
\r
1072 -/* Move the 'filenames' iterator to the next filename.
\r
1074 + * Move the 'filenames' iterator to the next filename.
\r
1076 * If 'filenames' is already pointing at the last filename then the
\r
1077 * iterator will be moved to a point just beyond that last filename,
\r
1078 @@ -1427,7 +1576,8 @@ notmuch_filenames_get (notmuch_filenames_t *filenames);
\r
1080 notmuch_filenames_move_to_next (notmuch_filenames_t *filenames);
\r
1082 -/* Destroy a notmuch_filenames_t object.
\r
1084 + * Destroy a notmuch_filenames_t object.
\r
1086 * It's not strictly necessary to call this function. All memory from
\r
1087 * the notmuch_filenames_t object will be reclaimed when the
\r
1088 @@ -1439,6 +1589,8 @@ notmuch_filenames_move_to_next (notmuch_filenames_t *filenames);
\r
1090 notmuch_filenames_destroy (notmuch_filenames_t *filenames);
\r