[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 29 / 8403638b7ee0ab2fd56d8a027b009bbaec249c
1 Return-Path: <teythoon@jade-hamburg.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 olra.theworths.org (Postfix) with ESMTP id 298D5429E2F\r
6         for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 17:55:43 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id UfLuSSTHAivk for <notmuch@notmuchmail.org>;\r
16         Tue, 20 Mar 2012 17:55:40 -0700 (PDT)\r
17 Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])\r
18         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 92FAA431FD7\r
21         for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 17:55:36 -0700 (PDT)\r
22 Received: from mail.jade-hamburg.de (unknown [85.183.11.228])\r
23         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
24         (No client certificate requested)\r
25         by mail.cryptobitch.de (Postfix) with ESMTPSA id 2232457678E\r
26         for <notmuch@notmuchmail.org>; Wed, 21 Mar 2012 01:55:35 +0100 (CET)\r
27 Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
28         id 941C5DF2A2; Wed, 21 Mar 2012 01:55:34 +0100 (CET)\r
29 Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.153])\r
30         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
31         (No client certificate requested) (Authenticated sender: teythoon)\r
32         by mail.jade-hamburg.de (Postfix) with ESMTPSA id 16847DF2A1;\r
33         Wed, 21 Mar 2012 01:55:26 +0100 (CET)\r
34 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77)\r
35         (envelope-from <teythoon@thinkbox.jade-hamburg.de>)\r
36         id 1SA9pk-0007v7-8t; Wed, 21 Mar 2012 01:55:24 +0100\r
37 From: Justus Winter <4winter@informatik.uni-hamburg.de>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 1/7] Split notmuch_database_close into two functions\r
40 Date: Wed, 21 Mar 2012 01:55:05 +0100\r
41 Message-Id:\r
42  <1332291311-28954-2-git-send-email-4winter@informatik.uni-hamburg.de>\r
43 X-Mailer: git-send-email 1.7.9.1\r
44 In-Reply-To:\r
45  <1332291311-28954-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
46 References:\r
47  <1332291311-28954-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Wed, 21 Mar 2012 00:55:43 -0000\r
61 \r
62 Formerly notmuch_database_close closed the xapian database and\r
63 destroyed the talloc structure associated with the notmuch database\r
64 object. Split notmuch_database_close into notmuch_database_close and\r
65 notmuch_database_destroy.\r
66 \r
67 This makes it possible for long running programs to close the xapian\r
68 database and thus release the lock associated with it without\r
69 destroying the data structures obtained from it.\r
70 \r
71 This also makes the api more consistent since every other data\r
72 structure has a destructor function.\r
73 \r
74 Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
75 ---\r
76  lib/database.cc |   14 ++++++++++++--\r
77  lib/notmuch.h   |   15 +++++++++++----\r
78  2 files changed, 23 insertions(+), 6 deletions(-)\r
79 \r
80 diff --git a/lib/database.cc b/lib/database.cc\r
81 index 16c4354..2fefcad 100644\r
82 --- a/lib/database.cc\r
83 +++ b/lib/database.cc\r
84 @@ -642,7 +642,7 @@ notmuch_database_open (const char *path,\r
85                          "       read-write mode.\n",\r
86                          notmuch_path, version, NOTMUCH_DATABASE_VERSION);\r
87                 notmuch->mode = NOTMUCH_DATABASE_MODE_READ_ONLY;\r
88 -               notmuch_database_close (notmuch);\r
89 +               notmuch_database_destroy (notmuch);\r
90                 notmuch = NULL;\r
91                 goto DONE;\r
92             }\r
93 @@ -702,7 +702,7 @@ notmuch_database_open (const char *path,\r
94      } catch (const Xapian::Error &error) {\r
95         fprintf (stderr, "A Xapian exception occurred opening database: %s\n",\r
96                  error.get_msg().c_str());\r
97 -       notmuch_database_close (notmuch);\r
98 +       notmuch_database_destroy (notmuch);\r
99         notmuch = NULL;\r
100      }\r
101  \r
102 @@ -738,9 +738,19 @@ notmuch_database_close (notmuch_database_t *notmuch)\r
103      }\r
104  \r
105      delete notmuch->term_gen;\r
106 +    notmuch->term_gen = NULL;\r
107      delete notmuch->query_parser;\r
108 +    notmuch->query_parser = NULL;\r
109      delete notmuch->xapian_db;\r
110 +    notmuch->xapian_db = NULL;\r
111      delete notmuch->value_range_processor;\r
112 +    notmuch->value_range_processor = NULL;\r
113 +}\r
114 +\r
115 +void\r
116 +notmuch_database_destroy (notmuch_database_t *notmuch)\r
117 +{\r
118 +    notmuch_database_close (notmuch);\r
119      talloc_free (notmuch);\r
120  }\r
121  \r
122 diff --git a/lib/notmuch.h b/lib/notmuch.h\r
123 index babd208..6114f36 100644\r
124 --- a/lib/notmuch.h\r
125 +++ b/lib/notmuch.h\r
126 @@ -133,7 +133,7 @@ typedef struct _notmuch_filenames notmuch_filenames_t;\r
127   *\r
128   * After a successful call to notmuch_database_create, the returned\r
129   * database will be open so the caller should call\r
130 - * notmuch_database_close when finished with it.\r
131 + * notmuch_database_destroy when finished with it.\r
132   *\r
133   * The database will not yet have any data in it\r
134   * (notmuch_database_create itself is a very cheap function). Messages\r
135 @@ -165,7 +165,7 @@ typedef enum {\r
136   * An existing notmuch database can be identified by the presence of a\r
137   * directory named ".notmuch" below 'path'.\r
138   *\r
139 - * The caller should call notmuch_database_close when finished with\r
140 + * The caller should call notmuch_database_destroy when finished with\r
141   * this database.\r
142   *\r
143   * In case of any failure, this function returns NULL, (after printing\r
144 @@ -175,11 +175,18 @@ notmuch_database_t *\r
145  notmuch_database_open (const char *path,\r
146                        notmuch_database_mode_t mode);\r
147  \r
148 -/* Close the given notmuch database, freeing all associated\r
149 - * resources. See notmuch_database_open. */\r
150 +/* Close the given notmuch database.\r
151 + *\r
152 + * This function is called by notmuch_database_destroyed and can be\r
153 + * called multiple times. */\r
154  void\r
155  notmuch_database_close (notmuch_database_t *database);\r
156  \r
157 +/* Destroy the notmuch database freeing all associated\r
158 + * resources */\r
159 +void\r
160 +notmuch_database_destroy (notmuch_database_t *database);\r
161 +\r
162  /* Return the database path of the given database.\r
163   *\r
164   * The return value is a string owned by notmuch so should not be\r
165 -- \r
166 1.7.9.1\r
167 \r