[PATCH 3/5] formatted comments for better godoc output
[notmuch-archives.git] / 4b / 329f03e9b14377f9cedca5be4cbf58b6ca31de
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
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 1.047\r
10 X-Spam-Level: *\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
25  +0200\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
43 Precedence: list\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
54 \r
55 before it looked like this\r
56 http://godoc.org/github.com/notmuch/notmuch/bindings/go/src/notmuch#Database.RemoveMessage\r
57 ---\r
58  bindings/go/src/notmuch/notmuch.go | 1325 +++++++++++++++++-------------------\r
59  1 file changed, 632 insertions(+), 693 deletions(-)\r
60 \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
66         return ""\r
67  }\r
68  \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
73  \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
77         return self, st\r
78  }\r
79  \r
80 -/* Open an existing notmuch database located at 'path'.\r
81 - *\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
87 - *\r
88 - * An existing notmuch database can be identified by the presence of a\r
89 - * directory named ".notmuch" below 'path'.\r
90 - *\r
91 - * The caller should call notmuch_database_destroy when finished with\r
92 - * this database.\r
93 - *\r
94 - * In case of any failure, this function returns NULL, (after printing\r
95 - * an error message on stderr).\r
96 - */\r
97 +// Open an existing notmuch database located at 'path'.\r
98 +//\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
104 +//\r
105 +// An existing notmuch database can be identified by the presence of a\r
106 +// directory named ".notmuch" below 'path'.\r
107 +//\r
108 +// The caller should call notmuch_database_destroy when finished with\r
109 +// this database.\r
110 +//\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
114  \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
117         return self, st\r
118  }\r
119  \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
126  }\r
127  \r
128 -/* Return the database path of the given database.\r
129 - */\r
130 +// Return the database path of the given database.\r
131  func (self *Database) GetPath() string {\r
132  \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
135         return ""\r
136  }\r
137  \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
142  }\r
143  \r
144 -/* Does this database need to be upgraded before writing to it?\r
145 - *\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
151 +//\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
160  \r
161  // TODO: notmuch_database_upgrade\r
162  \r
163 -/* Retrieve a directory object from the database for 'path'.\r
164 - *\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
168 - *\r
169 - * Can return NULL if a Xapian exception occurs.\r
170 - */\r
171 +// Retrieve a directory object from the database for 'path'.\r
172 +//\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
176 +//\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
183  }\r
184  \r
185 -/* Add a new message to the given notmuch database.\r
186 - *\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
190 - * 'database'.\r
191 - *\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
196 - *\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
202 - *\r
203 - * Return value:\r
204 - *\r
205 - * NOTMUCH_STATUS_SUCCESS: Message successfully added to database.\r
206 - *\r
207 - * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,\r
208 - *     message not added.\r
209 - *\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
214 - *\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
218 - *\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
221 - *\r
222 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only\r
223 - *     mode so no message can be added.\r
224 - */\r
225 +// Add a new message to the given notmuch database.\r
226 +//\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
230 +// 'database'.\r
231 +//\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
236 +//\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
242 +//\r
243 +// Return value:\r
244 +//\r
245 +// NOTMUCH_STATUS_SUCCESS: Message successfully added to database.\r
246 +//\r
247 +// NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,\r
248 +// message not added.\r
249 +//\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
254 +//\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
258 +//\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
261 +//\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
269  }\r
270  \r
271 -/* Remove a message from the given notmuch database.\r
272 - *\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
279 - *\r
280 - * Return value:\r
281 - *\r
282 - * NOTMUCH_STATUS_SUCCESS: The last filename was removed and the\r
283 - *     message was removed from the database.\r
284 - *\r
285 - * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,\r
286 - *     message not removed.\r
287 - *\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
290 - *     filename.\r
291 - *\r
292 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only\r
293 - *     mode so no message can be removed.\r
294 - */\r
295 +// Remove a message from the given notmuch database.\r
296 +//\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
303 +//\r
304 +// Return value:\r
305 +//\r
306 +// NOTMUCH_STATUS_SUCCESS: The last filename was removed and the\r
307 +// message was removed from the database.\r
308 +//\r
309 +// NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred,\r
310 +// message not removed.\r
311 +//\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
314 +// filename.\r
315 +//\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
319  \r
320         var c_fname *C.char = C.CString(fname)\r
321 @@ -298,18 +293,17 @@ func (self *Database) RemoveMessage(fname string) Status {\r
322         return Status(st)\r
323  }\r
324  \r
325 -/* Find a message with the given message_id.\r
326 - *\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
330 - *\r
331 - * This function returns NULL in the following situations:\r
332 - *\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
336 - */\r
337 +// Find a message with the given message_id.\r
338 +//\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
342 +//\r
343 +// This function returns NULL in the following situations:\r
344 +//\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
349  \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
352         return msg, st\r
353  }\r
354  \r
355 -/* Return a list of all tags found in the database.\r
356 - *\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
359 - *\r
360 - * On error this function returns NULL.\r
361 - */\r
362 +// Return a list of all tags found in the database.\r
363 +//\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
366 +//\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
370         if tags == nil {\r
371 @@ -342,30 +335,29 @@ func (self *Database) GetAllTags() *Tags {\r
372         return &Tags{tags: tags}\r
373  }\r
374  \r
375 -/* Create a new query for 'database'.\r
376 - *\r
377 - * Here, 'database' should be an open database, (see\r
378 - * notmuch_database_open and notmuch_database_create).\r
379 - *\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
383 - *\r
384 - * http://xapian.org/docs/queryparser.html\r
385 - *\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
389 - *\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
393 - *\r
394 - * User should call notmuch_query_destroy when finished with this\r
395 - * query.\r
396 - *\r
397 - * Will return NULL if insufficient memory is available.\r
398 - */\r
399 +// Create a new query for 'database'.\r
400 +//\r
401 +// Here, 'database' should be an open database, (see\r
402 +// notmuch_database_open and notmuch_database_create).\r
403 +//\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
407 +//\r
408 +// http://xapian.org/docs/queryparser.html\r
409 +//\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
413 +//\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
417 +//\r
418 +// User should call notmuch_query_destroy when finished with this\r
419 +// query.\r
420 +//\r
421 +// Will return NULL if insufficient memory is available.\r
422  func (self *Database) CreateQuery(query string) *Query {\r
423  \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
427  }\r
428  \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
432  \r
433  const (\r
434 @@ -392,7 +384,7 @@ const (\r
435         SORT_UNSORTED\r
436  )\r
437  \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
444         return ""\r
445  }\r
446  \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
451  }\r
452  \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
457  }\r
458  \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
463 - *\r
464 - * Typical usage might be:\r
465 - *\r
466 - *     notmuch_query_t *query;\r
467 - *     notmuch_threads_t *threads;\r
468 - *     notmuch_thread_t *thread;\r
469 - *\r
470 - *     query = notmuch_query_create (database, query_string);\r
471 - *\r
472 - *     for (threads = notmuch_query_search_threads (query);\r
473 - *          notmuch_threads_valid (threads);\r
474 - *          notmuch_threads_move_to_next (threads))\r
475 - *     {\r
476 - *         thread = notmuch_threads_get (threads);\r
477 - *         ....\r
478 - *         notmuch_thread_destroy (thread);\r
479 - *     }\r
480 - *\r
481 - *     notmuch_query_destroy (query);\r
482 - *\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
488 - * destroyed.\r
489 - *\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
494 - *\r
495 - * If a Xapian exception occurs this function will return NULL.\r
496 - */\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
501 +//\r
502 +// Typical usage might be:\r
503 +//\r
504 +//     notmuch_query_t *query;\r
505 +//     notmuch_threads_t *threads;\r
506 +//     notmuch_thread_t *thread;\r
507 +//\r
508 +//     query = notmuch_query_create (database, query_string);\r
509 +//\r
510 +//     for (threads = notmuch_query_search_threads (query);\r
511 +//          notmuch_threads_valid (threads);\r
512 +//          notmuch_threads_move_to_next (threads))\r
513 +//     {\r
514 +//         thread = notmuch_threads_get (threads);\r
515 +//         ....\r
516 +//         notmuch_thread_destroy (thread);\r
517 +//     }\r
518 +//\r
519 +//     notmuch_query_destroy (query);\r
520 +//\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
526 +// destroyed.\r
527 +//\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
532 +//\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
539  }\r
540  \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
545 - *\r
546 - * Typical usage might be:\r
547 - *\r
548 - *     notmuch_query_t *query;\r
549 - *     notmuch_messages_t *messages;\r
550 - *     notmuch_message_t *message;\r
551 - *\r
552 - *     query = notmuch_query_create (database, query_string);\r
553 - *\r
554 - *     for (messages = notmuch_query_search_messages (query);\r
555 - *          notmuch_messages_valid (messages);\r
556 - *          notmuch_messages_move_to_next (messages))\r
557 - *     {\r
558 - *         message = notmuch_messages_get (messages);\r
559 - *         ....\r
560 - *         notmuch_message_destroy (message);\r
561 - *     }\r
562 - *\r
563 - *     notmuch_query_destroy (query);\r
564 - *\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
571 - *\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
576 - *\r
577 - * If a Xapian exception occurs this function will return NULL.\r
578 - */\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
583 +//\r
584 +// Typical usage might be:\r
585 +//\r
586 +//     notmuch_query_t *query;\r
587 +//     notmuch_messages_t *messages;\r
588 +//     notmuch_message_t *message;\r
589 +//\r
590 +//     query = notmuch_query_create (database, query_string);\r
591 +//\r
592 +//     for (messages = notmuch_query_search_messages (query);\r
593 +//          notmuch_messages_valid (messages);\r
594 +//          notmuch_messages_move_to_next (messages))\r
595 +//     {\r
596 +//         message = notmuch_messages_get (messages);\r
597 +//         ....\r
598 +//         notmuch_message_destroy (message);\r
599 +//     }\r
600 +//\r
601 +//     notmuch_query_destroy (query);\r
602 +//\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
609 +//\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
614 +//\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
618         if msgs == nil {\r
619 @@ -508,41 +498,38 @@ func (self *Query) SearchMessages() *Messages {\r
620         return &Messages{messages: msgs}\r
621  }\r
622  \r
623 -/* Destroy a notmuch_query_t along with any associated resources.\r
624 - *\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
629 - * destroyed.\r
630 - */\r
631 +// Destroy a notmuch_query_t along with any associated resources.\r
632 +//\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
637 +// destroyed.\r
638  func (self *Query) Destroy() {\r
639         if self.query != nil {\r
640                 C.notmuch_query_destroy(self.query)\r
641         }\r
642  }\r
643  \r
644 -/* Return an estimate of the number of messages matching a search\r
645 - *\r
646 - * This function performs a search and returns Xapian's best\r
647 - * guess as to number of matching messages.\r
648 - *\r
649 - * If a Xapian exception occurs, this function may return 0 (after\r
650 - * printing a message).\r
651 - */\r
652 +// Return an estimate of the number of messages matching a search\r
653 +//\r
654 +// This function performs a search and returns Xapian's best\r
655 +// guess as to number of matching messages.\r
656 +//\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
661  }\r
662  \r
663 -/* Is the given 'threads' iterator pointing at a valid thread.\r
664 - *\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
668 - *\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
671 - */\r
672 +// Is the given 'threads' iterator pointing at a valid thread.\r
673 +//\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
677 +//\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
682                 return false\r
683 @@ -554,17 +541,16 @@ func (self *Threads) Valid() bool {\r
684         return true\r
685  }\r
686  \r
687 -/* Get the current thread from 'threads' as a notmuch_thread_t.\r
688 - *\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
691 - *\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
694 - *\r
695 - * If an out-of-memory situation occurs, this function will return\r
696 - * NULL.\r
697 - */\r
698 +// Get the current thread from 'threads' as a notmuch_thread_t.\r
699 +//\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
702 +//\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
705 +//\r
706 +// If an out-of-memory situation occurs, this function will return\r
707 +// NULL.\r
708  func (self *Threads) Get() *Thread {\r
709         if self.threads == nil {\r
710                 return nil\r
711 @@ -576,16 +562,15 @@ func (self *Threads) Get() *Thread {\r
712         return &Thread{thread}\r
713  }\r
714  \r
715 -/* Move the 'threads' iterator to the next thread.\r
716 - *\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
721 - *\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
724 - */\r
725 +// Move the 'threads' iterator to the next thread.\r
726 +//\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
731 +//\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
736                 return\r
737 @@ -593,26 +578,23 @@ func (self *Threads) MoveToNext() {\r
738         C.notmuch_threads_move_to_next(self.threads)\r
739  }\r
740  \r
741 -/* Destroy a notmuch_threads_t object.\r
742 - *\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
746 - */\r
747 +// Destroy a notmuch_threads_t object.\r
748 +//\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
755         }\r
756  }\r
757  \r
758 -/**\r
759 - * Get the thread ID of 'thread'.\r
760 - *\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
765 - */\r
766 +// Get the thread ID of 'thread'.\r
767 +//\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
774                 return ""\r
775 @@ -624,12 +606,10 @@ func (self *Thread) GetThreadId() string {\r
776         return C.GoString(id)\r
777  }\r
778  \r
779 -/**\r
780 - * Get the total number of messages in 'thread'.\r
781 - *\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
784 - */\r
785 +// Get the total number of messages in 'thread'.\r
786 +//\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
791                 return 0\r
792 @@ -637,16 +617,14 @@ func (self *Thread) GetTotalMessages() int {\r
793         return int(C.notmuch_thread_get_total_messages(self.thread))\r
794  }\r
795  \r
796 -/**\r
797 - * Get a notmuch_messages_t iterator for the top-level messages in\r
798 - * 'thread' in oldest-first order.\r
799 - *\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
803 - *\r
804 - * The returned list will be destroyed when the thread is destroyed.\r
805 - */\r
806 +// Get a notmuch_messages_t iterator for the top-level messages in\r
807 +// 'thread' in oldest-first order.\r
808 +//\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
812 +//\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
819  }\r
820  \r
821 -/**\r
822 - * Get a notmuch_thread_t iterator for all messages in 'thread' in\r
823 - * oldest-first order.\r
824 - *\r
825 - * The returned list will be destroyed when the thread is destroyed.\r
826 - */\r
827 +// Get a notmuch_thread_t iterator for all messages in 'thread' in\r
828 +// oldest-first order.\r
829 +//\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
836  }\r
837  \r
838 -/**\r
839 - * Get the number of messages in 'thread' that matched the search.\r
840 - *\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
846 - */\r
847 +// Get the number of messages in 'thread' that matched the search.\r
848 +//\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
856                 return 0\r
857 @@ -693,22 +667,20 @@ func (self *Thread) GetMatchedMessages() int {\r
858         return int(C.notmuch_thread_get_matched_messages(self.thread))\r
859  }\r
860  \r
861 -/**\r
862 - * Get the authors of 'thread' as a UTF-8 string.\r
863 - *\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
866 - * thread.\r
867 - *\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
871 - *\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
876 - */\r
877 +// Get the authors of 'thread' as a UTF-8 string.\r
878 +//\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
881 +// thread.\r
882 +//\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
886 +//\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
893                 return ""\r
894 @@ -720,18 +692,16 @@ func (self *Thread) GetAuthors() string {\r
895         return C.GoString(str)\r
896  }\r
897  \r
898 -/**\r
899 - * Get the subject of 'thread' as a UTF-8 string.\r
900 - *\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
904 - *\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
909 - */\r
910 +// Get the subject of 'thread' as a UTF-8 string.\r
911 +//\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
915 +//\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
922                 return ""\r
923 @@ -743,9 +713,7 @@ func (self *Thread) GetSubject() string {\r
924         return C.GoString(str)\r
925  }\r
926  \r
927 -/**\r
928 - * Get the date of the oldest message in 'thread' as a time_t value.\r
929 - */\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
933                 return 0\r
934 @@ -755,9 +723,7 @@ func (self *Thread) GetOldestDate() int64 {\r
935         return int64(date)\r
936  }\r
937  \r
938 -/**\r
939 - * Get the date of the newest message in 'thread' as a time_t value.\r
940 - */\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
944                 return 0\r
945 @@ -767,43 +733,41 @@ func (self *Thread) GetNewestDate() int64 {\r
946         return int64(date)\r
947  }\r
948  \r
949 -/**\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
952 - *\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
956 - * this thread.\r
957 - *\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
961 - * destroyed).\r
962 - *\r
963 - * Typical usage might be:\r
964 - *\r
965 - *     notmuch_thread_t *thread;\r
966 - *     notmuch_tags_t *tags;\r
967 - *     const char *tag;\r
968 - *\r
969 - *     thread = notmuch_threads_get (threads);\r
970 - *\r
971 - *     for (tags = notmuch_thread_get_tags (thread);\r
972 - *          notmuch_tags_valid (tags);\r
973 - *          notmuch_tags_move_to_next (tags))\r
974 - *     {\r
975 - *         tag = notmuch_tags_get (tags);\r
976 - *         ....\r
977 - *     }\r
978 - *\r
979 - *     notmuch_thread_destroy (thread);\r
980 - *\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
985 - */\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
988 +//\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
992 +// this thread.\r
993 +//\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
997 +// destroyed).\r
998 +//\r
999 +// Typical usage might be:\r
1000 +//\r
1001 +//     notmuch_thread_t *thread;\r
1002 +//     notmuch_tags_t *tags;\r
1003 +//     const char *tag;\r
1004 +//\r
1005 +//     thread = notmuch_threads_get (threads);\r
1006 +//\r
1007 +//     for (tags = notmuch_thread_get_tags (thread);\r
1008 +//          notmuch_tags_valid (tags);\r
1009 +//          notmuch_tags_move_to_next (tags))\r
1010 +//     {\r
1011 +//         tag = notmuch_tags_get (tags);\r
1012 +//         ....\r
1013 +//     }\r
1014 +//\r
1015 +//     notmuch_thread_destroy (thread);\r
1016 +//\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
1023                 return nil\r
1024 @@ -817,24 +781,21 @@ func (self *Thread) GetTags() *Tags {\r
1025         return &Tags{tags}\r
1026  }\r
1027  \r
1028 -/**\r
1029 - * Destroy a notmuch_thread_t object.\r
1030 - */\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
1035         }\r
1036  }\r
1037  \r
1038 -/* Is the given 'messages' iterator pointing at a valid message.\r
1039 - *\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
1043 - *\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
1046 - */\r
1047 +// Is the given 'messages' iterator pointing at a valid message.\r
1048 +//\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
1052 +//\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
1057                 return false\r
1058 @@ -846,17 +807,16 @@ func (self *Messages) Valid() bool {\r
1059         return true\r
1060  }\r
1061  \r
1062 -/* Get the current message from 'messages' as a notmuch_message_t.\r
1063 - *\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
1066 - *\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
1069 - *\r
1070 - * If an out-of-memory situation occurs, this function will return\r
1071 - * NULL.\r
1072 - */\r
1073 +// Get the current message from 'messages' as a notmuch_message_t.\r
1074 +//\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
1077 +//\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
1080 +//\r
1081 +// If an out-of-memory situation occurs, this function will return\r
1082 +// NULL.\r
1083  func (self *Messages) Get() *Message {\r
1084         if self.messages == nil {\r
1085                 return nil\r
1086 @@ -868,16 +828,15 @@ func (self *Messages) Get() *Message {\r
1087         return &Message{message: msg}\r
1088  }\r
1089  \r
1090 -/* Move the 'messages' iterator to the next message.\r
1091 - *\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
1096 - *\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
1099 - */\r
1100 +// Move the 'messages' iterator to the next message.\r
1101 +//\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
1106 +//\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
1111                 return\r
1112 @@ -885,30 +844,28 @@ func (self *Messages) MoveToNext() {\r
1113         C.notmuch_messages_move_to_next(self.messages)\r
1114  }\r
1115  \r
1116 -/* Destroy a notmuch_messages_t object.\r
1117 - *\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
1121 - */\r
1122 +// Destroy a notmuch_messages_t object.\r
1123 +//\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
1130         }\r
1131  }\r
1132  \r
1133 -/* Return a list of tags from all messages.\r
1134 - *\r
1135 - * The resulting list is guaranteed not to contain duplicated tags.\r
1136 - *\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
1141 - * message list.\r
1142 - *\r
1143 - * The function returns NULL on error.\r
1144 - */\r
1145 +// Return a list of tags from all messages.\r
1146 +//\r
1147 +// The resulting list is guaranteed not to contain duplicated tags.\r
1148 +//\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
1153 +// message list.\r
1154 +//\r
1155 +// The function returns NULL on error.\r
1156  func (self *Messages) CollectTags() *Tags {\r
1157         if self.messages == nil {\r
1158                 return nil\r
1159 @@ -920,17 +877,16 @@ func (self *Messages) CollectTags() *Tags {\r
1160         return &Tags{tags: tags}\r
1161  }\r
1162  \r
1163 -/* Get the message ID of 'message'.\r
1164 - *\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
1169 - *\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
1173 - */\r
1174 +// Get the message ID of 'message'.\r
1175 +//\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
1180 +//\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
1185  \r
1186         if self.message == nil {\r
1187 @@ -945,17 +901,16 @@ func (self *Message) GetMessageId() string {\r
1188         return C.GoString(id)\r
1189  }\r
1190  \r
1191 -/* Get the thread ID of 'message'.\r
1192 - *\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
1198 - *\r
1199 - * This function will not return NULL since Notmuch ensures that every\r
1200 - * message belongs to a single thread.\r
1201 - */\r
1202 +// Get the thread ID of 'message'.\r
1203 +//\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
1209 +//\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
1213  \r
1214         if self.message == nil {\r
1215 @@ -972,23 +927,22 @@ func (self *Message) GetThreadId() string {\r
1216         return C.GoString(id)\r
1217  }\r
1218  \r
1219 -/* Get a notmuch_messages_t iterator for all of the replies to\r
1220 - * 'message'.\r
1221 - *\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
1227 - *\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
1231 - *\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
1235 - */\r
1236 +// Get a notmuch_messages_t iterator for all of the replies to\r
1237 +// 'message'.\r
1238 +//\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
1244 +//\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
1248 +//\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
1254                 return nil\r
1255 @@ -1000,20 +954,19 @@ func (self *Message) GetReplies() *Messages {\r
1256         return &Messages{messages: msgs}\r
1257  }\r
1258  \r
1259 -/* Get a filename for the email corresponding to 'message'.\r
1260 - *\r
1261 - * The returned filename is an absolute filename, (the initial\r
1262 - * component will match notmuch_database_get_path() ).\r
1263 - *\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
1267 - *\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
1271 - * filenames.\r
1272 - */\r
1273 +// Get a filename for the email corresponding to 'message'.\r
1274 +//\r
1275 +// The returned filename is an absolute filename, (the initial\r
1276 +// component will match notmuch_database_get_path() ).\r
1277 +//\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
1281 +//\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
1285 +// filenames.\r
1286  func (self *Message) GetFileName() string {\r
1287         if self.message == nil {\r
1288                 return ""\r
1289 @@ -1035,7 +988,7 @@ const (\r
1290         MESSAGE_FLAG_MATCH Flag = 0\r
1291  )\r
1292  \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
1297                 return false\r
1298 @@ -1047,7 +1000,7 @@ func (self *Message) GetFlag(flag Flag) bool {\r
1299         return true\r
1300  }\r
1301  \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
1306                 return\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
1309  }\r
1310  \r
1311 -/* Get the timestamp (seconds since the epoch) of 'message'.\r
1312 - *\r
1313 - * Return status:\r
1314 - *\r
1315 - * NOTMUCH_STATUS_SUCCESS: Timestamp successfully retrieved\r
1316 - *\r
1317 - * NOTMUCH_STATUS_NULL_POINTER: The 'message' argument is NULL\r
1318 - *\r
1319 - */\r
1320 +// Get the timestamp (seconds since the epoch) of 'message'.\r
1321 +//\r
1322 +// Return status:\r
1323 +//\r
1324 +// NOTMUCH_STATUS_SUCCESS: Timestamp successfully retrieved\r
1325 +//\r
1326 +// NOTMUCH_STATUS_NULL_POINTER: The 'message' argument is NULL\r
1327 +//\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
1333  }\r
1334  \r
1335 -/* Get the value of the specified header from 'message'.\r
1336 - *\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
1339 - *\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
1343 - *\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
1346 - */\r
1347 +// Get the value of the specified header from 'message'.\r
1348 +//\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
1351 +//\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
1355 +//\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
1360                 return ""\r
1361 @@ -1105,36 +1056,35 @@ func (self *Message) GetHeader(header string) string {\r
1362         return C.GoString(value)\r
1363  }\r
1364  \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
1367 - *\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
1371 - *\r
1372 - * Typical usage might be:\r
1373 - *\r
1374 - *     notmuch_message_t *message;\r
1375 - *     notmuch_tags_t *tags;\r
1376 - *     const char *tag;\r
1377 - *\r
1378 - *     message = notmuch_database_find_message (database, message_id);\r
1379 - *\r
1380 - *     for (tags = notmuch_message_get_tags (message);\r
1381 - *          notmuch_tags_valid (tags);\r
1382 - *          notmuch_result_move_to_next (tags))\r
1383 - *     {\r
1384 - *         tag = notmuch_tags_get (tags);\r
1385 - *         ....\r
1386 - *     }\r
1387 - *\r
1388 - *     notmuch_message_destroy (message);\r
1389 - *\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
1394 - */\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
1397 +//\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
1401 +//\r
1402 +// Typical usage might be:\r
1403 +//\r
1404 +//     notmuch_message_t *message;\r
1405 +//     notmuch_tags_t *tags;\r
1406 +//     const char *tag;\r
1407 +//\r
1408 +//     message = notmuch_database_find_message (database, message_id);\r
1409 +//\r
1410 +//     for (tags = notmuch_message_get_tags (message);\r
1411 +//          notmuch_tags_valid (tags);\r
1412 +//          notmuch_result_move_to_next (tags))\r
1413 +//     {\r
1414 +//         tag = notmuch_tags_get (tags);\r
1415 +//         ....\r
1416 +//     }\r
1417 +//\r
1418 +//     notmuch_message_destroy (message);\r
1419 +//\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
1426                 return nil\r
1427 @@ -1146,23 +1096,22 @@ func (self *Message) GetTags() *Tags {\r
1428         return &Tags{tags: tags}\r
1429  }\r
1430  \r
1431 -/* The longest possible tag value. */\r
1432 +// The longest possible tag value.\r
1433  const TAG_MAX = 200\r
1434  \r
1435 -/* Add a tag to the given message.\r
1436 - *\r
1437 - * Return value:\r
1438 - *\r
1439 - * NOTMUCH_STATUS_SUCCESS: Tag successfully added to message\r
1440 - *\r
1441 - * NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL\r
1442 - *\r
1443 - * NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long\r
1444 - *     (exceeds NOTMUCH_TAG_MAX)\r
1445 - *\r
1446 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only\r
1447 - *     mode so message cannot be modified.\r
1448 - */\r
1449 +// Add a tag to the given message.\r
1450 +//\r
1451 +// Return value:\r
1452 +//\r
1453 +// NOTMUCH_STATUS_SUCCESS: Tag successfully added to message\r
1454 +//\r
1455 +// NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL\r
1456 +//\r
1457 +// NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long\r
1458 +// (exceeds NOTMUCH_TAG_MAX)\r
1459 +//\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
1467  }\r
1468  \r
1469 -/* Remove a tag from the given message.\r
1470 - *\r
1471 - * Return value:\r
1472 - *\r
1473 - * NOTMUCH_STATUS_SUCCESS: Tag successfully removed from message\r
1474 - *\r
1475 - * NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL\r
1476 - *\r
1477 - * NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long\r
1478 - *     (exceeds NOTMUCH_TAG_MAX)\r
1479 - *\r
1480 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only\r
1481 - *     mode so message cannot be modified.\r
1482 - */\r
1483 +// Remove a tag from the given message.\r
1484 +//\r
1485 +// Return value:\r
1486 +//\r
1487 +// NOTMUCH_STATUS_SUCCESS: Tag successfully removed from message\r
1488 +//\r
1489 +// NOTMUCH_STATUS_NULL_POINTER: The 'tag' argument is NULL\r
1490 +//\r
1491 +// NOTMUCH_STATUS_TAG_TOO_LONG: The length of 'tag' is too long\r
1492 +// (exceeds NOTMUCH_TAG_MAX)\r
1493 +//\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
1501  }\r
1502  \r
1503 -/* Remove all tags from the given message.\r
1504 - *\r
1505 - * See notmuch_message_freeze for an example showing how to safely\r
1506 - * replace tag values.\r
1507 - *\r
1508 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only\r
1509 - *     mode so message cannot be modified.\r
1510 - */\r
1511 +// Remove all tags from the given message.\r
1512 +//\r
1513 +// See notmuch_message_freeze for an example showing how to safely\r
1514 +// replace tag values.\r
1515 +//\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
1523  }\r
1524  \r
1525 -/* Freeze the current state of 'message' within the database.\r
1526 - *\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
1531 - *\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
1535 - *\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
1539 - *\r
1540 - *    notmuch_message_freeze (message);\r
1541 - *\r
1542 - *    notmuch_message_remove_all_tags (message);\r
1543 - *\r
1544 - *    for (i = 0; i < NUM_TAGS; i++)\r
1545 - *        notmuch_message_add_tag (message, tags[i]);\r
1546 - *\r
1547 - *    notmuch_message_thaw (message);\r
1548 - *\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
1552 - *\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
1557 - *\r
1558 - * Return value:\r
1559 - *\r
1560 - * NOTMUCH_STATUS_SUCCESS: Message successfully frozen.\r
1561 - *\r
1562 - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only\r
1563 - *     mode so message cannot be modified.\r
1564 - */\r
1565 +// Freeze the current state of 'message' within the database.\r
1566 +//\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
1571 +//\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
1575 +//\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
1579 +//\r
1580 +//    notmuch_message_freeze (message);\r
1581 +//\r
1582 +//    notmuch_message_remove_all_tags (message);\r
1583 +//\r
1584 +//    for (i = 0; i < NUM_TAGS; i++)\r
1585 +//        notmuch_message_add_tag (message, tags[i]);\r
1586 +//\r
1587 +//    notmuch_message_thaw (message);\r
1588 +//\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
1592 +//\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
1597 +//\r
1598 +// Return value:\r
1599 +//\r
1600 +// NOTMUCH_STATUS_SUCCESS: Message successfully frozen.\r
1601 +//\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
1609  }\r
1610  \r
1611 -/* Thaw the current 'message', synchronizing any changes that may have\r
1612 - * occurred while 'message' was frozen into the notmuch database.\r
1613 - *\r
1614 - * See notmuch_message_freeze for an example of how to use this\r
1615 - * function to safely provide tag changes.\r
1616 - *\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
1620 - *\r
1621 - * Return value:\r
1622 - *\r
1623 - * NOTMUCH_STATUS_SUCCESS: Message successfully thawed, (or at least\r
1624 - *     its frozen count has successfully been reduced by 1).\r
1625 - *\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
1630 - */\r
1631 +// Thaw the current 'message', synchronizing any changes that may have\r
1632 +// occurred while 'message' was frozen into the notmuch database.\r
1633 +//\r
1634 +// See notmuch_message_freeze for an example of how to use this\r
1635 +// function to safely provide tag changes.\r
1636 +//\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
1640 +//\r
1641 +// Return value:\r
1642 +//\r
1643 +// NOTMUCH_STATUS_SUCCESS: Message successfully thawed, (or at least\r
1644 +// its frozen count has successfully been reduced by 1).\r
1645 +//\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
1655  }\r
1656  \r
1657 -/* Destroy a notmuch_message_t object.\r
1658 - *\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
1664 - */\r
1665 +// Destroy a notmuch_message_t object.\r
1666 +//\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
1674                 return\r
1675 @@ -1302,15 +1246,14 @@ func (self *Message) Destroy() {\r
1676         C.notmuch_message_destroy(self.message)\r
1677  }\r
1678  \r
1679 -/* Is the given 'tags' iterator pointing at a valid tag.\r
1680 - *\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
1684 - *\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
1687 - */\r
1688 +// Is the given 'tags' iterator pointing at a valid tag.\r
1689 +//\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
1693 +//\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
1698                 return false\r
1699 @@ -1322,14 +1265,13 @@ func (self *Tags) Valid() bool {\r
1700         return true\r
1701  }\r
1702  \r
1703 -/* Get the current tag from 'tags' as a string.\r
1704 - *\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
1707 - *\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
1710 - */\r
1711 +// Get the current tag from 'tags' as a string.\r
1712 +//\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
1715 +//\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
1720                 return ""\r
1721 @@ -1343,16 +1285,15 @@ func (self *Tags) String() string {\r
1722         return self.Get()\r
1723  }\r
1724  \r
1725 -/* Move the 'tags' iterator to the next tag.\r
1726 - *\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
1730 - * return NULL).\r
1731 - *\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
1734 - */\r
1735 +// Move the 'tags' iterator to the next tag.\r
1736 +//\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
1740 +// return NULL).\r
1741 +//\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
1746                 return\r
1747 @@ -1360,12 +1301,11 @@ func (self *Tags) MoveToNext() {\r
1748         C.notmuch_tags_move_to_next(self.tags)\r
1749  }\r
1750  \r
1751 -/* Destroy a notmuch_tags_t object.\r
1752 - *\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
1756 - */\r
1757 +// Destroy a notmuch_tags_t object.\r
1758 +//\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
1764                 return\r
1765 @@ -1375,7 +1315,7 @@ func (self *Tags) Destroy() {\r
1766  \r
1767  // TODO: wrap notmuch_directory_<fct>\r
1768  \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
1773                 return\r
1774 @@ -1385,15 +1325,14 @@ func (self *Directory) Destroy() {\r
1775  \r
1776  // TODO: wrap notmuch_filenames_<fct>\r
1777  \r
1778 -/* Destroy a notmuch_filenames_t object.\r
1779 - *\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
1783 - *\r
1784 - * It is acceptable to pass NULL for 'filenames', in which case this\r
1785 - * function will do nothing.\r
1786 - */\r
1787 +// Destroy a notmuch_filenames_t object.\r
1788 +//\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
1792 +//\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
1797                 return\r
1798 @@ -1401,4 +1340,4 @@ func (self *Filenames) Destroy() {\r
1799         C.notmuch_filenames_destroy(self.fnames)\r
1800  }\r
1801  \r
1802 -/* EOF */\r
1803 +// EOF\r
1804 -- \r
1805 2.4.2\r
1806 \r