1 Return-Path: <laochailan@web.de>
\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 arlo.cworth.org (Postfix) with ESMTP id 1CFBE6DE179E
\r
6 for <notmuch@notmuchmail.org>; Sun, 31 May 2015 05:23:01 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=1.047 tagged_above=-999 required=5 tests=[AWL=-1.613,
\r
12 FREEMAIL_FROM=0.001, RCVD_IN_SBL=2.596, RCVD_IN_SORBS_WEB=0.614,
\r
13 RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id gRHAhN6jkKiC for <notmuch@notmuchmail.org>;
\r
17 Sun, 31 May 2015 05:22:57 -0700 (PDT)
\r
18 X-Greylist: delayed 1205 seconds by postgrey-1.35 at arlo;
\r
19 Sun, 31 May 2015 05:22:57 PDT
\r
20 Received: from mout-xforward.web.de (mout-xforward.web.de [82.165.159.2])
\r
21 by arlo.cworth.org (Postfix) with ESMTPS id 18E6E6DE179D
\r
22 for <notmuch@notmuchmail.org>; Sun, 31 May 2015 05:22:56 -0700 (PDT)
\r
23 Received: from localhost ([92.204.48.23]) by smtp.web.de (mrweb003) with
\r
24 ESMTPSA (Nemesis) id 0Lb289-1ZNKCn1RcH-00kiHW; Sun, 31 May 2015 14:02:49
\r
26 From: laochailan <laochailan@web.de>
\r
27 To: notmuch@notmuchmail.org
\r
28 Subject: [PATCH 3/5] formatted comments for better godoc output
\r
29 Date: Sun, 31 May 2015 14:02:13 +0200
\r
30 Message-Id: <1433073735-7721-4-git-send-email-laochailan@web.de>
\r
31 X-Mailer: git-send-email 2.4.2
\r
32 In-Reply-To: <1433073735-7721-1-git-send-email-laochailan@web.de>
\r
33 References: <1433073735-7721-1-git-send-email-laochailan@web.de>
\r
34 X-Provags-ID: V03:K0:5DP/+TyWYqHgWlnUxz3vyH8oCHc/vg8TI/7ZTNFbHWrqf1aMYHr
\r
35 WRXyesRh43muG+tkaxcX88Ub+1bo54RfCo6auUtoHMvhKgTX0SdjCjwSx0HxG/kUt43txmT
\r
36 hR6ztazo9M1Y6Aee8fTMcCnpv7bFbgx5eIXsolRcdvLhAJn7Ka4qEzQldK5U1WS4hVPYDb1
\r
37 fxtqKSjyJQx174ya6IjMQ==
\r
38 X-UI-Out-Filterresults: junk:10;
\r
39 X-Mailman-Approved-At: Mon, 01 Jun 2015 09:14:44 -0700
\r
40 Cc: laochailan <laochailan@web.de>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.18
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Sun, 31 May 2015 12:23:01 -0000
\r
55 before it looked like this
\r
56 http://godoc.org/github.com/notmuch/notmuch/bindings/go/src/notmuch#Database.RemoveMessage
\r
58 bindings/go/src/notmuch/notmuch.go | 1325 +++++++++++++++++-------------------
\r
59 1 file changed, 632 insertions(+), 693 deletions(-)
\r
61 diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go
\r
62 index bffc120..741fabf 100644
\r
63 --- a/bindings/go/src/notmuch/notmuch.go
\r
64 +++ b/bindings/go/src/notmuch/notmuch.go
\r
65 @@ -44,8 +44,8 @@ func (self Status) String() string {
\r
69 -/* Various opaque data types. For each notmuch_<foo>_t see the various
\r
70 - * notmuch_<foo> functions below. */
\r
71 +// Various opaque data types. For each notmuch_<foo>_t see the various
\r
72 +// notmuch_<foo> functions below.
\r
74 type Database struct {
\r
75 db *C.notmuch_database_t
\r
76 @@ -108,23 +108,22 @@ func NewDatabase(path string) (*Database, Status) {
\r
80 -/* Open an existing notmuch database located at 'path'.
\r
82 - * The database should have been created at some time in the past,
\r
83 - * (not necessarily by this process), by calling
\r
84 - * notmuch_database_create with 'path'. By default the database should be
\r
85 - * opened for reading only. In order to write to the database you need to
\r
86 - * pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
\r
88 - * An existing notmuch database can be identified by the presence of a
\r
89 - * directory named ".notmuch" below 'path'.
\r
91 - * The caller should call notmuch_database_destroy when finished with
\r
94 - * In case of any failure, this function returns NULL, (after printing
\r
95 - * an error message on stderr).
\r
97 +// Open an existing notmuch database located at 'path'.
\r
99 +// The database should have been created at some time in the past,
\r
100 +// (not necessarily by this process), by calling
\r
101 +// notmuch_database_create with 'path'. By default the database should be
\r
102 +// opened for reading only. In order to write to the database you need to
\r
103 +// pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
\r
105 +// An existing notmuch database can be identified by the presence of a
\r
106 +// directory named ".notmuch" below 'path'.
\r
108 +// The caller should call notmuch_database_destroy when finished with
\r
111 +// In case of any failure, this function returns NULL, (after printing
\r
112 +// an error message on stderr).
\r
113 func OpenDatabase(path string, mode DatabaseMode) (*Database, Status) {
\r
115 var c_path *C.char = C.CString(path)
\r
116 @@ -142,14 +141,13 @@ func OpenDatabase(path string, mode DatabaseMode) (*Database, Status) {
\r
120 -/* Close the given notmuch database, freeing all associated
\r
121 - * resources. See notmuch_database_open. */
\r
122 +// Close the given notmuch database, freeing all associated
\r
123 +// resources. See notmuch_database_open.
\r
124 func (self *Database) Close() Status {
\r
125 return Status(C.notmuch_database_destroy(self.db))
\r
128 -/* Return the database path of the given database.
\r
130 +// Return the database path of the given database.
\r
131 func (self *Database) GetPath() string {
\r
133 /* The return value is a string owned by notmuch so should not be
\r
134 @@ -162,17 +160,17 @@ func (self *Database) GetPath() string {
\r
138 -/* Return the database format version of the given database. */
\r
139 +// Return the database format version of the given database.
\r
140 func (self *Database) GetVersion() uint {
\r
141 return uint(C.notmuch_database_get_version(self.db))
\r
144 -/* Does this database need to be upgraded before writing to it?
\r
146 - * If this function returns TRUE then no functions that modify the
\r
147 - * database (notmuch_database_add_message, notmuch_message_add_tag,
\r
148 - * notmuch_directory_set_mtime, etc.) will work unless the function
\r
149 - * notmuch_database_upgrade is called successfully first. */
\r
150 +// Does this database need to be upgraded before writing to it?
\r
152 +// If this function returns TRUE then no functions that modify the
\r
153 +// database (notmuch_database_add_message, notmuch_message_add_tag,
\r
154 +// notmuch_directory_set_mtime, etc.) will work unless the function
\r
155 +// notmuch_database_upgrade is called successfully first.
\r
156 func (self *Database) NeedsUpgrade() bool {
\r
157 do_upgrade := C.notmuch_database_needs_upgrade(self.db)
\r
158 if do_upgrade == 0 {
\r
159 @@ -183,14 +181,13 @@ func (self *Database) NeedsUpgrade() bool {
\r
161 // TODO: notmuch_database_upgrade
\r
163 -/* Retrieve a directory object from the database for 'path'.
\r
165 - * Here, 'path' should be a path relative to the path of 'database'
\r
166 - * (see notmuch_database_get_path), or else should be an absolute path
\r
167 - * with initial components that match the path of 'database'.
\r
169 - * Can return NULL if a Xapian exception occurs.
\r
171 +// Retrieve a directory object from the database for 'path'.
\r
173 +// Here, 'path' should be a path relative to the path of 'database'
\r
174 +// (see notmuch_database_get_path), or else should be an absolute path
\r
175 +// with initial components that match the path of 'database'.
\r
177 +// Can return NULL if a Xapian exception occurs.
\r
178 func (self *Database) GetDirectory(path string) (*Directory, Status) {
\r
179 var c_path *C.char = C.CString(path)
\r
180 defer C.free(unsafe.Pointer(c_path))
\r
181 @@ -207,46 +204,45 @@ func (self *Database) GetDirectory(path string) (*Directory, Status) {
\r
182 return &Directory{dir: c_dir}, st
\r
185 -/* Add a new message to the given notmuch database.
\r
187 - * Here,'filename' should be a path relative to the path of
\r
188 - * 'database' (see notmuch_database_get_path), or else should be an
\r
189 - * absolute filename with initial components that match the path of
\r
192 - * The file should be a single mail message (not a multi-message mbox)
\r
193 - * that is expected to remain at its current location, (since the
\r
194 - * notmuch database will reference the filename, and will not copy the
\r
195 - * entire contents of the file.
\r
197 - * If 'message' is not NULL, then, on successful return '*message'
\r
198 - * will be initialized to a message object that can be used for things
\r
199 - * such as adding tags to the just-added message. The user should call
\r
200 - * notmuch_message_destroy when done with the message. On any failure
\r
201 - * '*message' will be set to NULL.
\r
205 - * NOTMUCH_STATUS_SUCCESS: Message successfully added to database.
\r
207 - * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
\r
208 - * message not added.
\r
210 - * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: Message has the same message
\r
211 - * ID as another message already in the database. The new
\r
212 - * filename was successfully added to the message in the database
\r
213 - * (if not already present).
\r
215 - * NOTMUCH_STATUS_FILE_ERROR: an error occurred trying to open the
\r
216 - * file, (such as permission denied, or file not found,
\r
217 - * etc.). Nothing added to the database.
\r
219 - * NOTMUCH_STATUS_FILE_NOT_EMAIL: the contents of filename don't look
\r
220 - * like an email message. Nothing added to the database.
\r
222 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
223 - * mode so no message can be added.
\r
225 +// Add a new message to the given notmuch database.
\r
227 +// Here,'filename' should be a path relative to the path of
\r
228 +// 'database' (see notmuch_database_get_path), or else should be an
\r
229 +// absolute filename with initial components that match the path of
\r
232 +// The file should be a single mail message (not a multi-message mbox)
\r
233 +// that is expected to remain at its current location, (since the
\r
234 +// notmuch database will reference the filename, and will not copy the
\r
235 +// entire contents of the file.
\r
237 +// If 'message' is not NULL, then, on successful return '*message'
\r
238 +// will be initialized to a message object that can be used for things
\r
239 +// such as adding tags to the just-added message. The user should call
\r
240 +// notmuch_message_destroy when done with the message. On any failure
\r
241 +// '*message' will be set to NULL.
\r
245 +// NOTMUCH_STATUS_SUCCESS: Message successfully added to database.
\r
247 +// NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
\r
248 +// message not added.
\r
250 +// NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: Message has the same message
\r
251 +// ID as another message already in the database. The new
\r
252 +// filename was successfully added to the message in the database
\r
253 +// (if not already present).
\r
255 +// NOTMUCH_STATUS_FILE_ERROR: an error occurred trying to open the
\r
256 +// file, (such as permission denied, or file not found,
\r
257 +// etc.). Nothing added to the database.
\r
259 +// NOTMUCH_STATUS_FILE_NOT_EMAIL: the contents of filename don't look
\r
260 +// like an email message. Nothing added to the database.
\r
262 +// NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
263 +// mode so no message can be added.
\r
264 func (self *Database) AddMessage(fname string) (*Message, Status) {
\r
265 var c_fname *C.char = C.CString(fname)
\r
266 defer C.free(unsafe.Pointer(c_fname))
\r
267 @@ -261,30 +257,29 @@ func (self *Database) AddMessage(fname string) (*Message, Status) {
\r
268 return &Message{message: c_msg}, st
\r
271 -/* Remove a message from the given notmuch database.
\r
273 - * Note that only this particular filename association is removed from
\r
274 - * the database. If the same message (as determined by the message ID)
\r
275 - * is still available via other filenames, then the message will
\r
276 - * persist in the database for those filenames. When the last filename
\r
277 - * is removed for a particular message, the database content for that
\r
278 - * message will be entirely removed.
\r
282 - * NOTMUCH_STATUS_SUCCESS: The last filename was removed and the
\r
283 - * message was removed from the database.
\r
285 - * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
\r
286 - * message not removed.
\r
288 - * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but
\r
289 - * the message persists in the database with at least one other
\r
292 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
293 - * mode so no message can be removed.
\r
295 +// Remove a message from the given notmuch database.
\r
297 +// Note that only this particular filename association is removed from
\r
298 +// the database. If the same message (as determined by the message ID)
\r
299 +// is still available via other filenames, then the message will
\r
300 +// persist in the database for those filenames. When the last filename
\r
301 +// is removed for a particular message, the database content for that
\r
302 +// message will be entirely removed.
\r
306 +// NOTMUCH_STATUS_SUCCESS: The last filename was removed and the
\r
307 +// message was removed from the database.
\r
309 +// NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,
\r
310 +// message not removed.
\r
312 +// NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but
\r
313 +// the message persists in the database with at least one other
\r
316 +// NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
317 +// mode so no message can be removed.
\r
318 func (self *Database) RemoveMessage(fname string) Status {
\r
320 var c_fname *C.char = C.CString(fname)
\r
321 @@ -298,18 +293,17 @@ func (self *Database) RemoveMessage(fname string) Status {
\r
325 -/* Find a message with the given message_id.
\r
327 - * If the database contains a message with the given message_id, then
\r
328 - * a new notmuch_message_t object is returned. The caller should call
\r
329 - * notmuch_message_destroy when done with the message.
\r
331 - * This function returns NULL in the following situations:
\r
333 - * * No message is found with the given message_id
\r
334 - * * An out-of-memory situation occurs
\r
335 - * * A Xapian exception occurs
\r
337 +// Find a message with the given message_id.
\r
339 +// If the database contains a message with the given message_id, then
\r
340 +// a new notmuch_message_t object is returned. The caller should call
\r
341 +// notmuch_message_destroy when done with the message.
\r
343 +// This function returns NULL in the following situations:
\r
345 +// * No message is found with the given message_id
\r
346 +// * An out-of-memory situation occurs
\r
347 +// * A Xapian exception occurs
\r
348 func (self *Database) FindMessage(message_id string) (*Message, Status) {
\r
350 var c_msg_id *C.char = C.CString(message_id)
\r
351 @@ -327,13 +321,12 @@ func (self *Database) FindMessage(message_id string) (*Message, Status) {
\r
355 -/* Return a list of all tags found in the database.
\r
357 - * This function creates a list of all tags found in the database. The
\r
358 - * resulting list contains all tags from all messages found in the database.
\r
360 - * On error this function returns NULL.
\r
362 +// Return a list of all tags found in the database.
\r
364 +// This function creates a list of all tags found in the database. The
\r
365 +// resulting list contains all tags from all messages found in the database.
\r
367 +// On error this function returns NULL.
\r
368 func (self *Database) GetAllTags() *Tags {
\r
369 tags := C.notmuch_database_get_all_tags(self.db)
\r
371 @@ -342,30 +335,29 @@ func (self *Database) GetAllTags() *Tags {
\r
372 return &Tags{tags: tags}
\r
375 -/* Create a new query for 'database'.
\r
377 - * Here, 'database' should be an open database, (see
\r
378 - * notmuch_database_open and notmuch_database_create).
\r
380 - * For the query string, we'll document the syntax here more
\r
381 - * completely in the future, but it's likely to be a specialized
\r
382 - * version of the general Xapian query syntax:
\r
384 - * http://xapian.org/docs/queryparser.html
\r
386 - * As a special case, passing either a length-zero string, (that is ""),
\r
387 - * or a string consisting of a single asterisk (that is "*"), will
\r
388 - * result in a query that returns all messages in the database.
\r
390 - * See notmuch_query_set_sort for controlling the order of results.
\r
391 - * See notmuch_query_search_messages and notmuch_query_search_threads
\r
392 - * to actually execute the query.
\r
394 - * User should call notmuch_query_destroy when finished with this
\r
397 - * Will return NULL if insufficient memory is available.
\r
399 +// Create a new query for 'database'.
\r
401 +// Here, 'database' should be an open database, (see
\r
402 +// notmuch_database_open and notmuch_database_create).
\r
404 +// For the query string, we'll document the syntax here more
\r
405 +// completely in the future, but it's likely to be a specialized
\r
406 +// version of the general Xapian query syntax:
\r
408 +// http://xapian.org/docs/queryparser.html
\r
410 +// As a special case, passing either a length-zero string, (that is ""),
\r
411 +// or a string consisting of a single asterisk (that is "*"), will
\r
412 +// result in a query that returns all messages in the database.
\r
414 +// See notmuch_query_set_sort for controlling the order of results.
\r
415 +// See notmuch_query_search_messages and notmuch_query_search_threads
\r
416 +// to actually execute the query.
\r
418 +// User should call notmuch_query_destroy when finished with this
\r
421 +// Will return NULL if insufficient memory is available.
\r
422 func (self *Database) CreateQuery(query string) *Query {
\r
424 var c_query *C.char = C.CString(query)
\r
425 @@ -382,7 +374,7 @@ func (self *Database) CreateQuery(query string) *Query {
\r
426 return &Query{query: q}
\r
429 -/* Sort values for notmuch_query_set_sort */
\r
430 +// Sort values for notmuch_query_set_sort
\r
431 type Sort C.notmuch_sort_t
\r
434 @@ -392,7 +384,7 @@ const (
\r
438 -/* Return the query_string of this query. See notmuch_query_create. */
\r
439 +// Return the query_string of this query. See notmuch_query_create.
\r
440 func (self *Query) String() string {
\r
441 // FIXME: do we own 'q' or not ?
\r
442 q := C.notmuch_query_get_query_string(self.query)
\r
443 @@ -406,54 +398,53 @@ func (self *Query) String() string {
\r
447 -/* Specify the sorting desired for this query. */
\r
448 +// Specify the sorting desired for this query.
\r
449 func (self *Query) SetSort(sort Sort) {
\r
450 C.notmuch_query_set_sort(self.query, C.notmuch_sort_t(sort))
\r
453 -/* Return the sort specified for this query. See notmuch_query_set_sort. */
\r
454 +// Return the sort specified for this query. See notmuch_query_set_sort.
\r
455 func (self *Query) GetSort() Sort {
\r
456 return Sort(C.notmuch_query_get_sort(self.query))
\r
459 -/* Execute a query for threads, returning a notmuch_threads_t object
\r
460 - * which can be used to iterate over the results. The returned threads
\r
461 - * object is owned by the query and as such, will only be valid until
\r
462 - * notmuch_query_destroy.
\r
464 - * Typical usage might be:
\r
466 - * notmuch_query_t *query;
\r
467 - * notmuch_threads_t *threads;
\r
468 - * notmuch_thread_t *thread;
\r
470 - * query = notmuch_query_create (database, query_string);
\r
472 - * for (threads = notmuch_query_search_threads (query);
\r
473 - * notmuch_threads_valid (threads);
\r
474 - * notmuch_threads_move_to_next (threads))
\r
476 - * thread = notmuch_threads_get (threads);
\r
478 - * notmuch_thread_destroy (thread);
\r
481 - * notmuch_query_destroy (query);
\r
483 - * Note: If you are finished with a thread before its containing
\r
484 - * query, you can call notmuch_thread_destroy to clean up some memory
\r
485 - * sooner (as in the above example). Otherwise, if your thread objects
\r
486 - * are long-lived, then you don't need to call notmuch_thread_destroy
\r
487 - * and all the memory will still be reclaimed when the query is
\r
490 - * Note that there's no explicit destructor needed for the
\r
491 - * notmuch_threads_t object. (For consistency, we do provide a
\r
492 - * notmuch_threads_destroy function, but there's no good reason
\r
493 - * to call it if the query is about to be destroyed).
\r
495 - * If a Xapian exception occurs this function will return NULL.
\r
497 +// Execute a query for threads, returning a notmuch_threads_t object
\r
498 +// which can be used to iterate over the results. The returned threads
\r
499 +// object is owned by the query and as such, will only be valid until
\r
500 +// notmuch_query_destroy.
\r
502 +// Typical usage might be:
\r
504 +// notmuch_query_t *query;
\r
505 +// notmuch_threads_t *threads;
\r
506 +// notmuch_thread_t *thread;
\r
508 +// query = notmuch_query_create (database, query_string);
\r
510 +// for (threads = notmuch_query_search_threads (query);
\r
511 +// notmuch_threads_valid (threads);
\r
512 +// notmuch_threads_move_to_next (threads))
\r
514 +// thread = notmuch_threads_get (threads);
\r
516 +// notmuch_thread_destroy (thread);
\r
519 +// notmuch_query_destroy (query);
\r
521 +// Note: If you are finished with a thread before its containing
\r
522 +// query, you can call notmuch_thread_destroy to clean up some memory
\r
523 +// sooner (as in the above example). Otherwise, if your thread objects
\r
524 +// are long-lived, then you don't need to call notmuch_thread_destroy
\r
525 +// and all the memory will still be reclaimed when the query is
\r
528 +// Note that there's no explicit destructor needed for the
\r
529 +// notmuch_threads_t object. (For consistency, we do provide a
\r
530 +// notmuch_threads_destroy function, but there's no good reason
\r
531 +// to call it if the query is about to be destroyed).
\r
533 +// If a Xapian exception occurs this function will return NULL.
\r
534 func (self *Query) SearchThreads() *Threads {
\r
535 threads := C.notmuch_query_search_threads(self.query)
\r
536 if threads == nil {
\r
537 @@ -462,44 +453,43 @@ func (self *Query) SearchThreads() *Threads {
\r
538 return &Threads{threads: threads}
\r
541 -/* Execute a query for messages, returning a notmuch_messages_t object
\r
542 - * which can be used to iterate over the results. The returned
\r
543 - * messages object is owned by the query and as such, will only be
\r
544 - * valid until notmuch_query_destroy.
\r
546 - * Typical usage might be:
\r
548 - * notmuch_query_t *query;
\r
549 - * notmuch_messages_t *messages;
\r
550 - * notmuch_message_t *message;
\r
552 - * query = notmuch_query_create (database, query_string);
\r
554 - * for (messages = notmuch_query_search_messages (query);
\r
555 - * notmuch_messages_valid (messages);
\r
556 - * notmuch_messages_move_to_next (messages))
\r
558 - * message = notmuch_messages_get (messages);
\r
560 - * notmuch_message_destroy (message);
\r
563 - * notmuch_query_destroy (query);
\r
565 - * Note: If you are finished with a message before its containing
\r
566 - * query, you can call notmuch_message_destroy to clean up some memory
\r
567 - * sooner (as in the above example). Otherwise, if your message
\r
568 - * objects are long-lived, then you don't need to call
\r
569 - * notmuch_message_destroy and all the memory will still be reclaimed
\r
570 - * when the query is destroyed.
\r
572 - * Note that there's no explicit destructor needed for the
\r
573 - * notmuch_messages_t object. (For consistency, we do provide a
\r
574 - * notmuch_messages_destroy function, but there's no good
\r
575 - * reason to call it if the query is about to be destroyed).
\r
577 - * If a Xapian exception occurs this function will return NULL.
\r
579 +// Execute a query for messages, returning a notmuch_messages_t object
\r
580 +// which can be used to iterate over the results. The returned
\r
581 +// messages object is owned by the query and as such, will only be
\r
582 +// valid until notmuch_query_destroy.
\r
584 +// Typical usage might be:
\r
586 +// notmuch_query_t *query;
\r
587 +// notmuch_messages_t *messages;
\r
588 +// notmuch_message_t *message;
\r
590 +// query = notmuch_query_create (database, query_string);
\r
592 +// for (messages = notmuch_query_search_messages (query);
\r
593 +// notmuch_messages_valid (messages);
\r
594 +// notmuch_messages_move_to_next (messages))
\r
596 +// message = notmuch_messages_get (messages);
\r
598 +// notmuch_message_destroy (message);
\r
601 +// notmuch_query_destroy (query);
\r
603 +// Note: If you are finished with a message before its containing
\r
604 +// query, you can call notmuch_message_destroy to clean up some memory
\r
605 +// sooner (as in the above example). Otherwise, if your message
\r
606 +// objects are long-lived, then you don't need to call
\r
607 +// notmuch_message_destroy and all the memory will still be reclaimed
\r
608 +// when the query is destroyed.
\r
610 +// Note that there's no explicit destructor needed for the
\r
611 +// notmuch_messages_t object. (For consistency, we do provide a
\r
612 +// notmuch_messages_destroy function, but there's no good
\r
613 +// reason to call it if the query is about to be destroyed).
\r
615 +// If a Xapian exception occurs this function will return NULL.
\r
616 func (self *Query) SearchMessages() *Messages {
\r
617 msgs := C.notmuch_query_search_messages(self.query)
\r
619 @@ -508,41 +498,38 @@ func (self *Query) SearchMessages() *Messages {
\r
620 return &Messages{messages: msgs}
\r
623 -/* Destroy a notmuch_query_t along with any associated resources.
\r
625 - * This will in turn destroy any notmuch_threads_t and
\r
626 - * notmuch_messages_t objects generated by this query, (and in
\r
627 - * turn any notmuch_thread_t and notmuch_message_t objects generated
\r
628 - * from those results, etc.), if such objects haven't already been
\r
631 +// Destroy a notmuch_query_t along with any associated resources.
\r
633 +// This will in turn destroy any notmuch_threads_t and
\r
634 +// notmuch_messages_t objects generated by this query, (and in
\r
635 +// turn any notmuch_thread_t and notmuch_message_t objects generated
\r
636 +// from those results, etc.), if such objects haven't already been
\r
638 func (self *Query) Destroy() {
\r
639 if self.query != nil {
\r
640 C.notmuch_query_destroy(self.query)
\r
644 -/* Return an estimate of the number of messages matching a search
\r
646 - * This function performs a search and returns Xapian's best
\r
647 - * guess as to number of matching messages.
\r
649 - * If a Xapian exception occurs, this function may return 0 (after
\r
650 - * printing a message).
\r
652 +// Return an estimate of the number of messages matching a search
\r
654 +// This function performs a search and returns Xapian's best
\r
655 +// guess as to number of matching messages.
\r
657 +// If a Xapian exception occurs, this function may return 0 (after
\r
658 +// printing a message).
\r
659 func (self *Query) CountMessages() uint {
\r
660 return uint(C.notmuch_query_count_messages(self.query))
\r
663 -/* Is the given 'threads' iterator pointing at a valid thread.
\r
665 - * When this function returns TRUE, notmuch_threads_get will return a
\r
666 - * valid object. Whereas when this function returns FALSE,
\r
667 - * notmuch_threads_get will return NULL.
\r
669 - * See the documentation of notmuch_query_search_threads for example
\r
670 - * code showing how to iterate over a notmuch_threads_t object.
\r
672 +// Is the given 'threads' iterator pointing at a valid thread.
\r
674 +// When this function returns TRUE, notmuch_threads_get will return a
\r
675 +// valid object. Whereas when this function returns FALSE,
\r
676 +// notmuch_threads_get will return NULL.
\r
678 +// See the documentation of notmuch_query_search_threads for example
\r
679 +// code showing how to iterate over a notmuch_threads_t object.
\r
680 func (self *Threads) Valid() bool {
\r
681 if self.threads == nil {
\r
683 @@ -554,17 +541,16 @@ func (self *Threads) Valid() bool {
\r
687 -/* Get the current thread from 'threads' as a notmuch_thread_t.
\r
689 - * Note: The returned thread belongs to 'threads' and has a lifetime
\r
690 - * identical to it (and the query to which it belongs).
\r
692 - * See the documentation of notmuch_query_search_threads for example
\r
693 - * code showing how to iterate over a notmuch_threads_t object.
\r
695 - * If an out-of-memory situation occurs, this function will return
\r
698 +// Get the current thread from 'threads' as a notmuch_thread_t.
\r
700 +// Note: The returned thread belongs to 'threads' and has a lifetime
\r
701 +// identical to it (and the query to which it belongs).
\r
703 +// See the documentation of notmuch_query_search_threads for example
\r
704 +// code showing how to iterate over a notmuch_threads_t object.
\r
706 +// If an out-of-memory situation occurs, this function will return
\r
708 func (self *Threads) Get() *Thread {
\r
709 if self.threads == nil {
\r
711 @@ -576,16 +562,15 @@ func (self *Threads) Get() *Thread {
\r
712 return &Thread{thread}
\r
715 -/* Move the 'threads' iterator to the next thread.
\r
717 - * If 'threads' is already pointing at the last thread then the
\r
718 - * iterator will be moved to a point just beyond that last thread,
\r
719 - * (where notmuch_threads_valid will return FALSE and
\r
720 - * notmuch_threads_get will return NULL).
\r
722 - * See the documentation of notmuch_query_search_threads for example
\r
723 - * code showing how to iterate over a notmuch_threads_t object.
\r
725 +// Move the 'threads' iterator to the next thread.
\r
727 +// If 'threads' is already pointing at the last thread then the
\r
728 +// iterator will be moved to a point just beyond that last thread,
\r
729 +// (where notmuch_threads_valid will return FALSE and
\r
730 +// notmuch_threads_get will return NULL).
\r
732 +// See the documentation of notmuch_query_search_threads for example
\r
733 +// code showing how to iterate over a notmuch_threads_t object.
\r
734 func (self *Threads) MoveToNext() {
\r
735 if self.threads == nil {
\r
737 @@ -593,26 +578,23 @@ func (self *Threads) MoveToNext() {
\r
738 C.notmuch_threads_move_to_next(self.threads)
\r
741 -/* Destroy a notmuch_threads_t object.
\r
743 - * It's not strictly necessary to call this function. All memory from
\r
744 - * the notmuch_threads_t object will be reclaimed when the
\r
745 - * containg query object is destroyed.
\r
747 +// Destroy a notmuch_threads_t object.
\r
749 +// It's not strictly necessary to call this function. All memory from
\r
750 +// the notmuch_threads_t object will be reclaimed when the
\r
751 +// containg query object is destroyed.
\r
752 func (self *Threads) Destroy() {
\r
753 if self.threads != nil {
\r
754 C.notmuch_threads_destroy(self.threads)
\r
759 - * Get the thread ID of 'thread'.
\r
761 - * The returned string belongs to 'thread' and as such, should not be
\r
762 - * modified by the caller and will only be valid for as long as the
\r
763 - * thread is valid, (which is until notmuch_thread_destroy or until
\r
764 - * the query from which it derived is destroyed).
\r
766 +// Get the thread ID of 'thread'.
\r
768 +// The returned string belongs to 'thread' and as such, should not be
\r
769 +// modified by the caller and will only be valid for as long as the
\r
770 +// thread is valid, (which is until notmuch_thread_destroy or until
\r
771 +// the query from which it derived is destroyed).
\r
772 func (self *Thread) GetThreadId() string {
\r
773 if self.thread == nil {
\r
775 @@ -624,12 +606,10 @@ func (self *Thread) GetThreadId() string {
\r
776 return C.GoString(id)
\r
780 - * Get the total number of messages in 'thread'.
\r
782 - * This count consists of all messages in the database belonging to
\r
783 - * this thread. Contrast with notmuch_thread_get_matched_messages() .
\r
785 +// Get the total number of messages in 'thread'.
\r
787 +// This count consists of all messages in the database belonging to
\r
788 +// this thread. Contrast with notmuch_thread_get_matched_messages() .
\r
789 func (self *Thread) GetTotalMessages() int {
\r
790 if self.thread == nil {
\r
792 @@ -637,16 +617,14 @@ func (self *Thread) GetTotalMessages() int {
\r
793 return int(C.notmuch_thread_get_total_messages(self.thread))
\r
797 - * Get a notmuch_messages_t iterator for the top-level messages in
\r
798 - * 'thread' in oldest-first order.
\r
800 - * This iterator will not necessarily iterate over all of the messages
\r
801 - * in the thread. It will only iterate over the messages in the thread
\r
802 - * which are not replies to other messages in the thread.
\r
804 - * The returned list will be destroyed when the thread is destroyed.
\r
806 +// Get a notmuch_messages_t iterator for the top-level messages in
\r
807 +// 'thread' in oldest-first order.
\r
809 +// This iterator will not necessarily iterate over all of the messages
\r
810 +// in the thread. It will only iterate over the messages in the thread
\r
811 +// which are not replies to other messages in the thread.
\r
813 +// The returned list will be destroyed when the thread is destroyed.
\r
814 func (self *Thread) GetToplevelMessages() (*Messages, Status) {
\r
815 if self.thread == nil {
\r
816 return nil, STATUS_NULL_POINTER
\r
817 @@ -659,12 +637,10 @@ func (self *Thread) GetToplevelMessages() (*Messages, Status) {
\r
818 return &Messages{msgs}, STATUS_SUCCESS
\r
822 - * Get a notmuch_thread_t iterator for all messages in 'thread' in
\r
823 - * oldest-first order.
\r
825 - * The returned list will be destroyed when the thread is destroyed.
\r
827 +// Get a notmuch_thread_t iterator for all messages in 'thread' in
\r
828 +// oldest-first order.
\r
830 +// The returned list will be destroyed when the thread is destroyed.
\r
831 func (self *Thread) GetMessages() (*Messages, Status) {
\r
832 if self.thread == nil {
\r
833 return nil, STATUS_NULL_POINTER
\r
834 @@ -677,15 +653,13 @@ func (self *Thread) GetMessages() (*Messages, Status) {
\r
835 return &Messages{msgs}, STATUS_SUCCESS
\r
839 - * Get the number of messages in 'thread' that matched the search.
\r
841 - * This count includes only the messages in this thread that were
\r
842 - * matched by the search from which the thread was created and were
\r
843 - * not excluded by any exclude tags passed in with the query (see
\r
844 - * notmuch_query_add_tag_exclude). Contrast with
\r
845 - * notmuch_thread_get_total_messages() .
\r
847 +// Get the number of messages in 'thread' that matched the search.
\r
849 +// This count includes only the messages in this thread that were
\r
850 +// matched by the search from which the thread was created and were
\r
851 +// not excluded by any exclude tags passed in with the query (see
\r
852 +// notmuch_query_add_tag_exclude). Contrast with
\r
853 +// notmuch_thread_get_total_messages().
\r
854 func (self *Thread) GetMatchedMessages() int {
\r
855 if self.thread == nil {
\r
857 @@ -693,22 +667,20 @@ func (self *Thread) GetMatchedMessages() int {
\r
858 return int(C.notmuch_thread_get_matched_messages(self.thread))
\r
862 - * Get the authors of 'thread' as a UTF-8 string.
\r
864 - * The returned string is a comma-separated list of the names of the
\r
865 - * authors of mail messages in the query results that belong to this
\r
868 - * The string contains authors of messages matching the query first, then
\r
869 - * non-matched authors (with the two groups separated by '|'). Within
\r
870 - * each group, authors are ordered by date.
\r
872 - * The returned string belongs to 'thread' and as such, should not be
\r
873 - * modified by the caller and will only be valid for as long as the
\r
874 - * thread is valid, (which is until notmuch_thread_destroy or until
\r
875 - * the query from which it derived is destroyed).
\r
877 +// Get the authors of 'thread' as a UTF-8 string.
\r
879 +// The returned string is a comma-separated list of the names of the
\r
880 +// authors of mail messages in the query results that belong to this
\r
883 +// The string contains authors of messages matching the query first, then
\r
884 +// non-matched authors (with the two groups separated by '|'). Within
\r
885 +// each group, authors are ordered by date.
\r
887 +// The returned string belongs to 'thread' and as such, should not be
\r
888 +// modified by the caller and will only be valid for as long as the
\r
889 +// thread is valid, (which is until notmuch_thread_destroy or until
\r
890 +// the query from which it derived is destroyed).
\r
891 func (self *Thread) GetAuthors() string {
\r
892 if self.thread == nil {
\r
894 @@ -720,18 +692,16 @@ func (self *Thread) GetAuthors() string {
\r
895 return C.GoString(str)
\r
899 - * Get the subject of 'thread' as a UTF-8 string.
\r
901 - * The subject is taken from the first message (according to the query
\r
902 - * order---see notmuch_query_set_sort) in the query results that
\r
903 - * belongs to this thread.
\r
905 - * The returned string belongs to 'thread' and as such, should not be
\r
906 - * modified by the caller and will only be valid for as long as the
\r
907 - * thread is valid, (which is until notmuch_thread_destroy or until
\r
908 - * the query from which it derived is destroyed).
\r
910 +// Get the subject of 'thread' as a UTF-8 string.
\r
912 +// The subject is taken from the first message (according to the query
\r
913 +// order---see notmuch_query_set_sort) in the query results that
\r
914 +// belongs to this thread.
\r
916 +// The returned string belongs to 'thread' and as such, should not be
\r
917 +// modified by the caller and will only be valid for as long as the
\r
918 +// thread is valid, (which is until notmuch_thread_destroy or until
\r
919 +// the query from which it derived is destroyed).
\r
920 func (self *Thread) GetSubject() string {
\r
921 if self.thread == nil {
\r
923 @@ -743,9 +713,7 @@ func (self *Thread) GetSubject() string {
\r
924 return C.GoString(str)
\r
928 - * Get the date of the oldest message in 'thread' as a time_t value.
\r
930 +// Get the date of the oldest message in 'thread' as a time_t value.
\r
931 func (self *Thread) GetOldestDate() int64 {
\r
932 if self.thread == nil {
\r
934 @@ -755,9 +723,7 @@ func (self *Thread) GetOldestDate() int64 {
\r
939 - * Get the date of the newest message in 'thread' as a time_t value.
\r
941 +// Get the date of the newest message in 'thread' as a time_t value.
\r
942 func (self *Thread) GetNewestDate() int64 {
\r
943 if self.thread == nil {
\r
945 @@ -767,43 +733,41 @@ func (self *Thread) GetNewestDate() int64 {
\r
950 - * Get the tags for 'thread', returning a notmuch_tags_t object which
\r
951 - * can be used to iterate over all tags.
\r
953 - * Note: In the Notmuch database, tags are stored on individual
\r
954 - * messages, not on threads. So the tags returned here will be all
\r
955 - * tags of the messages which matched the search and which belong to
\r
958 - * The tags object is owned by the thread and as such, will only be
\r
959 - * valid for as long as the thread is valid, (for example, until
\r
960 - * notmuch_thread_destroy or until the query from which it derived is
\r
963 - * Typical usage might be:
\r
965 - * notmuch_thread_t *thread;
\r
966 - * notmuch_tags_t *tags;
\r
967 - * const char *tag;
\r
969 - * thread = notmuch_threads_get (threads);
\r
971 - * for (tags = notmuch_thread_get_tags (thread);
\r
972 - * notmuch_tags_valid (tags);
\r
973 - * notmuch_tags_move_to_next (tags))
\r
975 - * tag = notmuch_tags_get (tags);
\r
979 - * notmuch_thread_destroy (thread);
\r
981 - * Note that there's no explicit destructor needed for the
\r
982 - * notmuch_tags_t object. (For consistency, we do provide a
\r
983 - * notmuch_tags_destroy function, but there's no good reason to call
\r
984 - * it if the message is about to be destroyed).
\r
986 +// Get the tags for 'thread', returning a notmuch_tags_t object which
\r
987 +// can be used to iterate over all tags.
\r
989 +// Note: In the Notmuch database, tags are stored on individual
\r
990 +// messages, not on threads. So the tags returned here will be all
\r
991 +// tags of the messages which matched the search and which belong to
\r
994 +// The tags object is owned by the thread and as such, will only be
\r
995 +// valid for as long as the thread is valid, (for example, until
\r
996 +// notmuch_thread_destroy or until the query from which it derived is
\r
999 +// Typical usage might be:
\r
1001 +// notmuch_thread_t *thread;
\r
1002 +// notmuch_tags_t *tags;
\r
1003 +// const char *tag;
\r
1005 +// thread = notmuch_threads_get (threads);
\r
1007 +// for (tags = notmuch_thread_get_tags (thread);
\r
1008 +// notmuch_tags_valid (tags);
\r
1009 +// notmuch_tags_move_to_next (tags))
\r
1011 +// tag = notmuch_tags_get (tags);
\r
1015 +// notmuch_thread_destroy (thread);
\r
1017 +// Note that there's no explicit destructor needed for the
\r
1018 +// notmuch_tags_t object. (For consistency, we do provide a
\r
1019 +// notmuch_tags_destroy function, but there's no good reason to call
\r
1020 +// it if the message is about to be destroyed).
\r
1021 func (self *Thread) GetTags() *Tags {
\r
1022 if self.thread == nil {
\r
1024 @@ -817,24 +781,21 @@ func (self *Thread) GetTags() *Tags {
\r
1025 return &Tags{tags}
\r
1029 - * Destroy a notmuch_thread_t object.
\r
1031 +// Destroy a notmuch_thread_t object.
\r
1032 func (self *Thread) Destroy() {
\r
1033 if self.thread != nil {
\r
1034 C.notmuch_thread_destroy(self.thread)
\r
1038 -/* Is the given 'messages' iterator pointing at a valid message.
\r
1040 - * When this function returns TRUE, notmuch_messages_get will return a
\r
1041 - * valid object. Whereas when this function returns FALSE,
\r
1042 - * notmuch_messages_get will return NULL.
\r
1044 - * See the documentation of notmuch_query_search_messages for example
\r
1045 - * code showing how to iterate over a notmuch_messages_t object.
\r
1047 +// Is the given 'messages' iterator pointing at a valid message.
\r
1049 +// When this function returns TRUE, notmuch_messages_get will return a
\r
1050 +// valid object. Whereas when this function returns FALSE,
\r
1051 +// notmuch_messages_get will return NULL.
\r
1053 +// See the documentation of notmuch_query_search_messages for example
\r
1054 +// code showing how to iterate over a notmuch_messages_t object.
\r
1055 func (self *Messages) Valid() bool {
\r
1056 if self.messages == nil {
\r
1058 @@ -846,17 +807,16 @@ func (self *Messages) Valid() bool {
\r
1062 -/* Get the current message from 'messages' as a notmuch_message_t.
\r
1064 - * Note: The returned message belongs to 'messages' and has a lifetime
\r
1065 - * identical to it (and the query to which it belongs).
\r
1067 - * See the documentation of notmuch_query_search_messages for example
\r
1068 - * code showing how to iterate over a notmuch_messages_t object.
\r
1070 - * If an out-of-memory situation occurs, this function will return
\r
1073 +// Get the current message from 'messages' as a notmuch_message_t.
\r
1075 +// Note: The returned message belongs to 'messages' and has a lifetime
\r
1076 +// identical to it (and the query to which it belongs).
\r
1078 +// See the documentation of notmuch_query_search_messages for example
\r
1079 +// code showing how to iterate over a notmuch_messages_t object.
\r
1081 +// If an out-of-memory situation occurs, this function will return
\r
1083 func (self *Messages) Get() *Message {
\r
1084 if self.messages == nil {
\r
1086 @@ -868,16 +828,15 @@ func (self *Messages) Get() *Message {
\r
1087 return &Message{message: msg}
\r
1090 -/* Move the 'messages' iterator to the next message.
\r
1092 - * If 'messages' is already pointing at the last message then the
\r
1093 - * iterator will be moved to a point just beyond that last message,
\r
1094 - * (where notmuch_messages_valid will return FALSE and
\r
1095 - * notmuch_messages_get will return NULL).
\r
1097 - * See the documentation of notmuch_query_search_messages for example
\r
1098 - * code showing how to iterate over a notmuch_messages_t object.
\r
1100 +// Move the 'messages' iterator to the next message.
\r
1102 +// If 'messages' is already pointing at the last message then the
\r
1103 +// iterator will be moved to a point just beyond that last message,
\r
1104 +// (where notmuch_messages_valid will return FALSE and
\r
1105 +// notmuch_messages_get will return NULL).
\r
1107 +// See the documentation of notmuch_query_search_messages for example
\r
1108 +// code showing how to iterate over a notmuch_messages_t object.
\r
1109 func (self *Messages) MoveToNext() {
\r
1110 if self.messages == nil {
\r
1112 @@ -885,30 +844,28 @@ func (self *Messages) MoveToNext() {
\r
1113 C.notmuch_messages_move_to_next(self.messages)
\r
1116 -/* Destroy a notmuch_messages_t object.
\r
1118 - * It's not strictly necessary to call this function. All memory from
\r
1119 - * the notmuch_messages_t object will be reclaimed when the containing
\r
1120 - * query object is destroyed.
\r
1122 +// Destroy a notmuch_messages_t object.
\r
1124 +// It's not strictly necessary to call this function. All memory from
\r
1125 +// the notmuch_messages_t object will be reclaimed when the containing
\r
1126 +// query object is destroyed.
\r
1127 func (self *Messages) Destroy() {
\r
1128 if self.messages != nil {
\r
1129 C.notmuch_messages_destroy(self.messages)
\r
1133 -/* Return a list of tags from all messages.
\r
1135 - * The resulting list is guaranteed not to contain duplicated tags.
\r
1137 - * WARNING: You can no longer iterate over messages after calling this
\r
1138 - * function, because the iterator will point at the end of the list.
\r
1139 - * We do not have a function to reset the iterator yet and the only
\r
1140 - * way how you can iterate over the list again is to recreate the
\r
1143 - * The function returns NULL on error.
\r
1145 +// Return a list of tags from all messages.
\r
1147 +// The resulting list is guaranteed not to contain duplicated tags.
\r
1149 +// WARNING: You can no longer iterate over messages after calling this
\r
1150 +// function, because the iterator will point at the end of the list.
\r
1151 +// We do not have a function to reset the iterator yet and the only
\r
1152 +// way how you can iterate over the list again is to recreate the
\r
1155 +// The function returns NULL on error.
\r
1156 func (self *Messages) CollectTags() *Tags {
\r
1157 if self.messages == nil {
\r
1159 @@ -920,17 +877,16 @@ func (self *Messages) CollectTags() *Tags {
\r
1160 return &Tags{tags: tags}
\r
1163 -/* Get the message ID of 'message'.
\r
1165 - * The returned string belongs to 'message' and as such, should not be
\r
1166 - * modified by the caller and will only be valid for as long as the
\r
1167 - * message is valid, (which is until the query from which it derived
\r
1168 - * is destroyed).
\r
1170 - * This function will not return NULL since Notmuch ensures that every
\r
1171 - * message has a unique message ID, (Notmuch will generate an ID for a
\r
1172 - * message if the original file does not contain one).
\r
1174 +// Get the message ID of 'message'.
\r
1176 +// The returned string belongs to 'message' and as such, should not be
\r
1177 +// modified by the caller and will only be valid for as long as the
\r
1178 +// message is valid, (which is until the query from which it derived
\r
1179 +// is destroyed).
\r
1181 +// This function will not return NULL since Notmuch ensures that every
\r
1182 +// message has a unique message ID, (Notmuch will generate an ID for a
\r
1183 +// message if the original file does not contain one).
\r
1184 func (self *Message) GetMessageId() string {
\r
1186 if self.message == nil {
\r
1187 @@ -945,17 +901,16 @@ func (self *Message) GetMessageId() string {
\r
1188 return C.GoString(id)
\r
1191 -/* Get the thread ID of 'message'.
\r
1193 - * The returned string belongs to 'message' and as such, should not be
\r
1194 - * modified by the caller and will only be valid for as long as the
\r
1195 - * message is valid, (for example, until the user calls
\r
1196 - * notmuch_message_destroy on 'message' or until a query from which it
\r
1197 - * derived is destroyed).
\r
1199 - * This function will not return NULL since Notmuch ensures that every
\r
1200 - * message belongs to a single thread.
\r
1202 +// Get the thread ID of 'message'.
\r
1204 +// The returned string belongs to 'message' and as such, should not be
\r
1205 +// modified by the caller and will only be valid for as long as the
\r
1206 +// message is valid, (for example, until the user calls
\r
1207 +// notmuch_message_destroy on 'message' or until a query from which it
\r
1208 +// derived is destroyed).
\r
1210 +// This function will not return NULL since Notmuch ensures that every
\r
1211 +// message belongs to a single thread.
\r
1212 func (self *Message) GetThreadId() string {
\r
1214 if self.message == nil {
\r
1215 @@ -972,23 +927,22 @@ func (self *Message) GetThreadId() string {
\r
1216 return C.GoString(id)
\r
1219 -/* Get a notmuch_messages_t iterator for all of the replies to
\r
1222 - * Note: This call only makes sense if 'message' was ultimately
\r
1223 - * obtained from a notmuch_thread_t object, (such as by coming
\r
1224 - * directly from the result of calling notmuch_thread_get_
\r
1225 - * toplevel_messages or by any number of subsequent
\r
1226 - * calls to notmuch_message_get_replies).
\r
1228 - * If 'message' was obtained through some non-thread means, (such as
\r
1229 - * by a call to notmuch_query_search_messages), then this function
\r
1230 - * will return NULL.
\r
1232 - * If there are no replies to 'message', this function will return
\r
1233 - * NULL. (Note that notmuch_messages_valid will accept that NULL
\r
1234 - * value as legitimate, and simply return FALSE for it.)
\r
1236 +// Get a notmuch_messages_t iterator for all of the replies to
\r
1239 +// Note: This call only makes sense if 'message' was ultimately
\r
1240 +// obtained from a notmuch_thread_t object, (such as by coming
\r
1241 +// directly from the result of calling notmuch_thread_get_
\r
1242 +// toplevel_messages or by any number of subsequent
\r
1243 +// calls to notmuch_message_get_replies).
\r
1245 +// If 'message' was obtained through some non-thread means, (such as
\r
1246 +// by a call to notmuch_query_search_messages), then this function
\r
1247 +// will return NULL.
\r
1249 +// If there are no replies to 'message', this function will return
\r
1250 +// NULL. (Note that notmuch_messages_valid will accept that NULL
\r
1251 +// value as legitimate, and simply return FALSE for it.)
\r
1252 func (self *Message) GetReplies() *Messages {
\r
1253 if self.message == nil {
\r
1255 @@ -1000,20 +954,19 @@ func (self *Message) GetReplies() *Messages {
\r
1256 return &Messages{messages: msgs}
\r
1259 -/* Get a filename for the email corresponding to 'message'.
\r
1261 - * The returned filename is an absolute filename, (the initial
\r
1262 - * component will match notmuch_database_get_path() ).
\r
1264 - * The returned string belongs to the message so should not be
\r
1265 - * modified or freed by the caller (nor should it be referenced after
\r
1266 - * the message is destroyed).
\r
1268 - * Note: If this message corresponds to multiple files in the mail
\r
1269 - * store, (that is, multiple files contain identical message IDs),
\r
1270 - * this function will arbitrarily return a single one of those
\r
1273 +// Get a filename for the email corresponding to 'message'.
\r
1275 +// The returned filename is an absolute filename, (the initial
\r
1276 +// component will match notmuch_database_get_path() ).
\r
1278 +// The returned string belongs to the message so should not be
\r
1279 +// modified or freed by the caller (nor should it be referenced after
\r
1280 +// the message is destroyed).
\r
1282 +// Note: If this message corresponds to multiple files in the mail
\r
1283 +// store, (that is, multiple files contain identical message IDs),
\r
1284 +// this function will arbitrarily return a single one of those
\r
1286 func (self *Message) GetFileName() string {
\r
1287 if self.message == nil {
\r
1289 @@ -1035,7 +988,7 @@ const (
\r
1290 MESSAGE_FLAG_MATCH Flag = 0
\r
1293 -/* Get a value of a flag for the email corresponding to 'message'. */
\r
1294 +// Get a value of a flag for the email corresponding to 'message'.
\r
1295 func (self *Message) GetFlag(flag Flag) bool {
\r
1296 if self.message == nil {
\r
1298 @@ -1047,7 +1000,7 @@ func (self *Message) GetFlag(flag Flag) bool {
\r
1302 -/* Set a value of a flag for the email corresponding to 'message'. */
\r
1303 +// Set a value of a flag for the email corresponding to 'message'.
\r
1304 func (self *Message) SetFlag(flag Flag, value bool) {
\r
1305 if self.message == nil {
\r
1307 @@ -1059,15 +1012,14 @@ func (self *Message) SetFlag(flag Flag, value bool) {
\r
1308 C.notmuch_message_set_flag(self.message, C.notmuch_message_flag_t(flag), v)
\r
1311 -/* Get the timestamp (seconds since the epoch) of 'message'.
\r
1313 - * Return status:
\r
1315 - * NOTMUCH_STATUS_SUCCESS: Timestamp successfully retrieved
\r
1317 - * NOTMUCH_STATUS_NULL_POINTER: The 'message' argument is NULL
\r
1320 +// Get the timestamp (seconds since the epoch) of 'message'.
\r
1322 +// Return status:
\r
1324 +// NOTMUCH_STATUS_SUCCESS: Timestamp successfully retrieved
\r
1326 +// NOTMUCH_STATUS_NULL_POINTER: The 'message' argument is NULL
\r
1328 func (self *Message) GetDate() (int64, Status) {
\r
1329 if self.message == nil {
\r
1330 return -1, STATUS_NULL_POINTER
\r
1331 @@ -1076,18 +1028,17 @@ func (self *Message) GetDate() (int64, Status) {
\r
1332 return int64(timestamp), STATUS_SUCCESS
\r
1335 -/* Get the value of the specified header from 'message'.
\r
1337 - * The value will be read from the actual message file, not from the
\r
1338 - * notmuch database. The header name is case insensitive.
\r
1340 - * The returned string belongs to the message so should not be
\r
1341 - * modified or freed by the caller (nor should it be referenced after
\r
1342 - * the message is destroyed).
\r
1344 - * Returns an empty string ("") if the message does not contain a
\r
1345 - * header line matching 'header'. Returns NULL if any error occurs.
\r
1347 +// Get the value of the specified header from 'message'.
\r
1349 +// The value will be read from the actual message file, not from the
\r
1350 +// notmuch database. The header name is case insensitive.
\r
1352 +// The returned string belongs to the message so should not be
\r
1353 +// modified or freed by the caller (nor should it be referenced after
\r
1354 +// the message is destroyed).
\r
1356 +// Returns an empty string ("") if the message does not contain a
\r
1357 +// header line matching 'header'. Returns NULL if any error occurs.
\r
1358 func (self *Message) GetHeader(header string) string {
\r
1359 if self.message == nil {
\r
1361 @@ -1105,36 +1056,35 @@ func (self *Message) GetHeader(header string) string {
\r
1362 return C.GoString(value)
\r
1365 -/* Get the tags for 'message', returning a notmuch_tags_t object which
\r
1366 - * can be used to iterate over all tags.
\r
1368 - * The tags object is owned by the message and as such, will only be
\r
1369 - * valid for as long as the message is valid, (which is until the
\r
1370 - * query from which it derived is destroyed).
\r
1372 - * Typical usage might be:
\r
1374 - * notmuch_message_t *message;
\r
1375 - * notmuch_tags_t *tags;
\r
1376 - * const char *tag;
\r
1378 - * message = notmuch_database_find_message (database, message_id);
\r
1380 - * for (tags = notmuch_message_get_tags (message);
\r
1381 - * notmuch_tags_valid (tags);
\r
1382 - * notmuch_result_move_to_next (tags))
\r
1384 - * tag = notmuch_tags_get (tags);
\r
1388 - * notmuch_message_destroy (message);
\r
1390 - * Note that there's no explicit destructor needed for the
\r
1391 - * notmuch_tags_t object. (For consistency, we do provide a
\r
1392 - * notmuch_tags_destroy function, but there's no good reason to call
\r
1393 - * it if the message is about to be destroyed).
\r
1395 +// Get the tags for 'message', returning a notmuch_tags_t object which
\r
1396 +// can be used to iterate over all tags.
\r
1398 +// The tags object is owned by the message and as such, will only be
\r
1399 +// valid for as long as the message is valid, (which is until the
\r
1400 +// query from which it derived is destroyed).
\r
1402 +// Typical usage might be:
\r
1404 +// notmuch_message_t *message;
\r
1405 +// notmuch_tags_t *tags;
\r
1406 +// const char *tag;
\r
1408 +// message = notmuch_database_find_message (database, message_id);
\r
1410 +// for (tags = notmuch_message_get_tags (message);
\r
1411 +// notmuch_tags_valid (tags);
\r
1412 +// notmuch_result_move_to_next (tags))
\r
1414 +// tag = notmuch_tags_get (tags);
\r
1418 +// notmuch_message_destroy (message);
\r
1420 +// Note that there's no explicit destructor needed for the
\r
1421 +// notmuch_tags_t object. (For consistency, we do provide a
\r
1422 +// notmuch_tags_destroy function, but there's no good reason to call
\r
1423 +// it if the message is about to be destroyed).
\r
1424 func (self *Message) GetTags() *Tags {
\r
1425 if self.message == nil {
\r
1427 @@ -1146,23 +1096,22 @@ func (self *Message) GetTags() *Tags {
\r
1428 return &Tags{tags: tags}
\r
1431 -/* The longest possible tag value. */
\r
1432 +// The longest possible tag value.
\r
1433 const TAG_MAX = 200
\r
1435 -/* Add a tag to the given message.
\r
1439 - * NOTMUCH_STATUS_SUCCESS: Tag successfully added to message
\r
1441 - * NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL
\r
1443 - * NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long
\r
1444 - * (exceeds NOTMUCH_TAG_MAX)
\r
1446 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1447 - * mode so message cannot be modified.
\r
1449 +// Add a tag to the given message.
\r
1453 +// NOTMUCH_STATUS_SUCCESS: Tag successfully added to message
\r
1455 +// NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL
\r
1457 +// NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long
\r
1458 +// (exceeds NOTMUCH_TAG_MAX)
\r
1460 +// NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1461 +// mode so message cannot be modified.
\r
1462 func (self *Message) AddTag(tag string) Status {
\r
1463 if self.message == nil {
\r
1464 return STATUS_NULL_POINTER
\r
1465 @@ -1173,20 +1122,19 @@ func (self *Message) AddTag(tag string) Status {
\r
1466 return Status(C.notmuch_message_add_tag(self.message, c_tag))
\r
1469 -/* Remove a tag from the given message.
\r
1473 - * NOTMUCH_STATUS_SUCCESS: Tag successfully removed from message
\r
1475 - * NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL
\r
1477 - * NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long
\r
1478 - * (exceeds NOTMUCH_TAG_MAX)
\r
1480 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1481 - * mode so message cannot be modified.
\r
1483 +// Remove a tag from the given message.
\r
1487 +// NOTMUCH_STATUS_SUCCESS: Tag successfully removed from message
\r
1489 +// NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL
\r
1491 +// NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long
\r
1492 +// (exceeds NOTMUCH_TAG_MAX)
\r
1494 +// NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1495 +// mode so message cannot be modified.
\r
1496 func (self *Message) RemoveTag(tag string) Status {
\r
1497 if self.message == nil {
\r
1498 return STATUS_NULL_POINTER
\r
1499 @@ -1197,14 +1145,13 @@ func (self *Message) RemoveTag(tag string) Status {
\r
1500 return Status(C.notmuch_message_remove_tag(self.message, c_tag))
\r
1503 -/* Remove all tags from the given message.
\r
1505 - * See notmuch_message_freeze for an example showing how to safely
\r
1506 - * replace tag values.
\r
1508 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1509 - * mode so message cannot be modified.
\r
1511 +// Remove all tags from the given message.
\r
1513 +// See notmuch_message_freeze for an example showing how to safely
\r
1514 +// replace tag values.
\r
1516 +// NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1517 +// mode so message cannot be modified.
\r
1518 func (self *Message) RemoveAllTags() Status {
\r
1519 if self.message == nil {
\r
1520 return STATUS_NULL_POINTER
\r
1521 @@ -1212,46 +1159,45 @@ func (self *Message) RemoveAllTags() Status {
\r
1522 return Status(C.notmuch_message_remove_all_tags(self.message))
\r
1525 -/* Freeze the current state of 'message' within the database.
\r
1527 - * This means that changes to the message state, (via
\r
1528 - * notmuch_message_add_tag, notmuch_message_remove_tag, and
\r
1529 - * notmuch_message_remove_all_tags), will not be committed to the
\r
1530 - * database until the message is thawed with notmuch_message_thaw.
\r
1532 - * Multiple calls to freeze/thaw are valid and these calls will
\r
1533 - * "stack". That is there must be as many calls to thaw as to freeze
\r
1534 - * before a message is actually thawed.
\r
1536 - * The ability to do freeze/thaw allows for safe transactions to
\r
1537 - * change tag values. For example, explicitly setting a message to
\r
1538 - * have a given set of tags might look like this:
\r
1540 - * notmuch_message_freeze (message);
\r
1542 - * notmuch_message_remove_all_tags (message);
\r
1544 - * for (i = 0; i < NUM_TAGS; i++)
\r
1545 - * notmuch_message_add_tag (message, tags[i]);
\r
1547 - * notmuch_message_thaw (message);
\r
1549 - * With freeze/thaw used like this, the message in the database is
\r
1550 - * guaranteed to have either the full set of original tag values, or
\r
1551 - * the full set of new tag values, but nothing in between.
\r
1553 - * Imagine the example above without freeze/thaw and the operation
\r
1554 - * somehow getting interrupted. This could result in the message being
\r
1555 - * left with no tags if the interruption happened after
\r
1556 - * notmuch_message_remove_all_tags but before notmuch_message_add_tag.
\r
1560 - * NOTMUCH_STATUS_SUCCESS: Message successfully frozen.
\r
1562 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1563 - * mode so message cannot be modified.
\r
1565 +// Freeze the current state of 'message' within the database.
\r
1567 +// This means that changes to the message state, (via
\r
1568 +// notmuch_message_add_tag, notmuch_message_remove_tag, and
\r
1569 +// notmuch_message_remove_all_tags), will not be committed to the
\r
1570 +// database until the message is thawed with notmuch_message_thaw.
\r
1572 +// Multiple calls to freeze/thaw are valid and these calls will
\r
1573 +// "stack". That is there must be as many calls to thaw as to freeze
\r
1574 +// before a message is actually thawed.
\r
1576 +// The ability to do freeze/thaw allows for safe transactions to
\r
1577 +// change tag values. For example, explicitly setting a message to
\r
1578 +// have a given set of tags might look like this:
\r
1580 +// notmuch_message_freeze (message);
\r
1582 +// notmuch_message_remove_all_tags (message);
\r
1584 +// for (i = 0; i < NUM_TAGS; i++)
\r
1585 +// notmuch_message_add_tag (message, tags[i]);
\r
1587 +// notmuch_message_thaw (message);
\r
1589 +// With freeze/thaw used like this, the message in the database is
\r
1590 +// guaranteed to have either the full set of original tag values, or
\r
1591 +// the full set of new tag values, but nothing in between.
\r
1593 +// Imagine the example above without freeze/thaw and the operation
\r
1594 +// somehow getting interrupted. This could result in the message being
\r
1595 +// left with no tags if the interruption happened after
\r
1596 +// notmuch_message_remove_all_tags but before notmuch_message_add_tag.
\r
1600 +// NOTMUCH_STATUS_SUCCESS: Message successfully frozen.
\r
1602 +// NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
\r
1603 +// mode so message cannot be modified.
\r
1604 func (self *Message) Freeze() Status {
\r
1605 if self.message == nil {
\r
1606 return STATUS_NULL_POINTER
\r
1607 @@ -1259,26 +1205,25 @@ func (self *Message) Freeze() Status {
\r
1608 return Status(C.notmuch_message_freeze(self.message))
\r
1611 -/* Thaw the current 'message', synchronizing any changes that may have
\r
1612 - * occurred while 'message' was frozen into the notmuch database.
\r
1614 - * See notmuch_message_freeze for an example of how to use this
\r
1615 - * function to safely provide tag changes.
\r
1617 - * Multiple calls to freeze/thaw are valid and these calls with
\r
1618 - * "stack". That is there must be as many calls to thaw as to freeze
\r
1619 - * before a message is actually thawed.
\r
1623 - * NOTMUCH_STATUS_SUCCESS: Message successfully thawed, (or at least
\r
1624 - * its frozen count has successfully been reduced by 1).
\r
1626 - * NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: An attempt was made to thaw
\r
1627 - * an unfrozen message. That is, there have been an unbalanced
\r
1628 - * number of calls to notmuch_message_freeze and
\r
1629 - * notmuch_message_thaw.
\r
1631 +// Thaw the current 'message', synchronizing any changes that may have
\r
1632 +// occurred while 'message' was frozen into the notmuch database.
\r
1634 +// See notmuch_message_freeze for an example of how to use this
\r
1635 +// function to safely provide tag changes.
\r
1637 +// Multiple calls to freeze/thaw are valid and these calls with
\r
1638 +// "stack". That is there must be as many calls to thaw as to freeze
\r
1639 +// before a message is actually thawed.
\r
1643 +// NOTMUCH_STATUS_SUCCESS: Message successfully thawed, (or at least
\r
1644 +// its frozen count has successfully been reduced by 1).
\r
1646 +// NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: An attempt was made to thaw
\r
1647 +// an unfrozen message. That is, there have been an unbalanced
\r
1648 +// number of calls to notmuch_message_freeze and
\r
1649 +// notmuch_message_thaw.
\r
1650 func (self *Message) Thaw() Status {
\r
1651 if self.message == nil {
\r
1652 return STATUS_NULL_POINTER
\r
1653 @@ -1287,14 +1232,13 @@ func (self *Message) Thaw() Status {
\r
1654 return Status(C.notmuch_message_thaw(self.message))
\r
1657 -/* Destroy a notmuch_message_t object.
\r
1659 - * It can be useful to call this function in the case of a single
\r
1660 - * query object with many messages in the result, (such as iterating
\r
1661 - * over the entire database). Otherwise, it's fine to never call this
\r
1662 - * function and there will still be no memory leaks. (The memory from
\r
1663 - * the messages get reclaimed when the containing query is destroyed.)
\r
1665 +// Destroy a notmuch_message_t object.
\r
1667 +// It can be useful to call this function in the case of a single
\r
1668 +// query object with many messages in the result, (such as iterating
\r
1669 +// over the entire database). Otherwise, it's fine to never call this
\r
1670 +// function and there will still be no memory leaks. (The memory from
\r
1671 +// the messages get reclaimed when the containing query is destroyed.)
\r
1672 func (self *Message) Destroy() {
\r
1673 if self.message == nil {
\r
1675 @@ -1302,15 +1246,14 @@ func (self *Message) Destroy() {
\r
1676 C.notmuch_message_destroy(self.message)
\r
1679 -/* Is the given 'tags' iterator pointing at a valid tag.
\r
1681 - * When this function returns TRUE, notmuch_tags_get will return a
\r
1682 - * valid string. Whereas when this function returns FALSE,
\r
1683 - * notmuch_tags_get will return NULL.
\r
1685 - * See the documentation of notmuch_message_get_tags for example code
\r
1686 - * showing how to iterate over a notmuch_tags_t object.
\r
1688 +// Is the given 'tags' iterator pointing at a valid tag.
\r
1690 +// When this function returns TRUE, notmuch_tags_get will return a
\r
1691 +// valid string. Whereas when this function returns FALSE,
\r
1692 +// notmuch_tags_get will return NULL.
\r
1694 +// See the documentation of notmuch_message_get_tags for example code
\r
1695 +// showing how to iterate over a notmuch_tags_t object.
\r
1696 func (self *Tags) Valid() bool {
\r
1697 if self.tags == nil {
\r
1699 @@ -1322,14 +1265,13 @@ func (self *Tags) Valid() bool {
\r
1703 -/* Get the current tag from 'tags' as a string.
\r
1705 - * Note: The returned string belongs to 'tags' and has a lifetime
\r
1706 - * identical to it (and the query to which it ultimately belongs).
\r
1708 - * See the documentation of notmuch_message_get_tags for example code
\r
1709 - * showing how to iterate over a notmuch_tags_t object.
\r
1711 +// Get the current tag from 'tags' as a string.
\r
1713 +// Note: The returned string belongs to 'tags' and has a lifetime
\r
1714 +// identical to it (and the query to which it ultimately belongs).
\r
1716 +// See the documentation of notmuch_message_get_tags for example code
\r
1717 +// showing how to iterate over a notmuch_tags_t object.
\r
1718 func (self *Tags) Get() string {
\r
1719 if self.tags == nil {
\r
1721 @@ -1343,16 +1285,15 @@ func (self *Tags) String() string {
\r
1725 -/* Move the 'tags' iterator to the next tag.
\r
1727 - * If 'tags' is already pointing at the last tag then the iterator
\r
1728 - * will be moved to a point just beyond that last tag, (where
\r
1729 - * notmuch_tags_valid will return FALSE and notmuch_tags_get will
\r
1732 - * See the documentation of notmuch_message_get_tags for example code
\r
1733 - * showing how to iterate over a notmuch_tags_t object.
\r
1735 +// Move the 'tags' iterator to the next tag.
\r
1737 +// If 'tags' is already pointing at the last tag then the iterator
\r
1738 +// will be moved to a point just beyond that last tag, (where
\r
1739 +// notmuch_tags_valid will return FALSE and notmuch_tags_get will
\r
1742 +// See the documentation of notmuch_message_get_tags for example code
\r
1743 +// showing how to iterate over a notmuch_tags_t object.
\r
1744 func (self *Tags) MoveToNext() {
\r
1745 if self.tags == nil {
\r
1747 @@ -1360,12 +1301,11 @@ func (self *Tags) MoveToNext() {
\r
1748 C.notmuch_tags_move_to_next(self.tags)
\r
1751 -/* Destroy a notmuch_tags_t object.
\r
1753 - * It's not strictly necessary to call this function. All memory from
\r
1754 - * the notmuch_tags_t object will be reclaimed when the containing
\r
1755 - * message or query objects are destroyed.
\r
1757 +// Destroy a notmuch_tags_t object.
\r
1759 +// It's not strictly necessary to call this function. All memory from
\r
1760 +// the notmuch_tags_t object will be reclaimed when the containing
\r
1761 +// message or query objects are destroyed.
\r
1762 func (self *Tags) Destroy() {
\r
1763 if self.tags == nil {
\r
1765 @@ -1375,7 +1315,7 @@ func (self *Tags) Destroy() {
\r
1767 // TODO: wrap notmuch_directory_<fct>
\r
1769 -/* Destroy a notmuch_directory_t object. */
\r
1770 +// Destroy a notmuch_directory_t object.
\r
1771 func (self *Directory) Destroy() {
\r
1772 if self.dir == nil {
\r
1774 @@ -1385,15 +1325,14 @@ func (self *Directory) Destroy() {
\r
1776 // TODO: wrap notmuch_filenames_<fct>
\r
1778 -/* Destroy a notmuch_filenames_t object.
\r
1780 - * It's not strictly necessary to call this function. All memory from
\r
1781 - * the notmuch_filenames_t object will be reclaimed when the
\r
1782 - * containing directory object is destroyed.
\r
1784 - * It is acceptable to pass NULL for 'filenames', in which case this
\r
1785 - * function will do nothing.
\r
1787 +// Destroy a notmuch_filenames_t object.
\r
1789 +// It's not strictly necessary to call this function. All memory from
\r
1790 +// the notmuch_filenames_t object will be reclaimed when the
\r
1791 +// containing directory object is destroyed.
\r
1793 +// It is acceptable to pass NULL for 'filenames', in which case this
\r
1794 +// function will do nothing.
\r
1795 func (self *Filenames) Destroy() {
\r
1796 if self.fnames == nil {
\r
1798 @@ -1401,4 +1340,4 @@ func (self *Filenames) Destroy() {
\r
1799 C.notmuch_filenames_destroy(self.fnames)
\r