[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 9b / e807c2fefdfe5e98d27837219592e5232a3804
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 6A86A431FAF\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 05:08:38 -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 PFGXd7cHklpB for <notmuch@notmuchmail.org>;\r
16         Sun, 22 Apr 2012 05:08:37 -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 7065E431FAE\r
21         for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 05:08:37 -0700 (PDT)\r
22 Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [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 B44545836F9\r
26         for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 14:08:35 +0200 (CEST)\r
27 Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
28         id B6513DF2A0; Sun, 22 Apr 2012 14:08:34 +0200 (CEST)\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 30E82DF2A0;\r
33         Sun, 22 Apr 2012 14:08:27 +0200 (CEST)\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 1SLvac-0007As-EL; Sun, 22 Apr 2012 14:08:26 +0200\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: Sun, 22 Apr 2012 14:07:51 +0200\r
41 Message-Id:\r
42  <1335096477-27537-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
43 X-Mailer: git-send-email 1.7.10\r
44 In-Reply-To: <20120422120620.26225.40778@thinkbox.jade-hamburg.de>\r
45 References: <20120422120620.26225.40778@thinkbox.jade-hamburg.de>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Sun, 22 Apr 2012 12:08:38 -0000\r
59 \r
60 Formerly notmuch_database_close closed the xapian database and\r
61 destroyed the talloc structure associated with the notmuch database\r
62 object. Split notmuch_database_close into notmuch_database_close and\r
63 notmuch_database_destroy.\r
64 \r
65 This makes it possible for long running programs to close the xapian\r
66 database and thus release the lock associated with it without\r
67 destroying the data structures obtained from it.\r
68 \r
69 This also makes the api more consistent since every other data\r
70 structure has a destructor function.\r
71 \r
72 Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
73 ---\r
74  lib/database.cc |   14 ++++++++++++--\r
75  lib/notmuch.h   |   15 +++++++++++----\r
76  2 files changed, 23 insertions(+), 6 deletions(-)\r
77 \r
78 diff --git a/lib/database.cc b/lib/database.cc\r
79 index 16c4354..2fefcad 100644\r
80 --- a/lib/database.cc\r
81 +++ b/lib/database.cc\r
82 @@ -642,7 +642,7 @@ notmuch_database_open (const char *path,\r
83                          "       read-write mode.\n",\r
84                          notmuch_path, version, NOTMUCH_DATABASE_VERSION);\r
85                 notmuch->mode = NOTMUCH_DATABASE_MODE_READ_ONLY;\r
86 -               notmuch_database_close (notmuch);\r
87 +               notmuch_database_destroy (notmuch);\r
88                 notmuch = NULL;\r
89                 goto DONE;\r
90             }\r
91 @@ -702,7 +702,7 @@ notmuch_database_open (const char *path,\r
92      } catch (const Xapian::Error &error) {\r
93         fprintf (stderr, "A Xapian exception occurred opening database: %s\n",\r
94                  error.get_msg().c_str());\r
95 -       notmuch_database_close (notmuch);\r
96 +       notmuch_database_destroy (notmuch);\r
97         notmuch = NULL;\r
98      }\r
99  \r
100 @@ -738,9 +738,19 @@ notmuch_database_close (notmuch_database_t *notmuch)\r
101      }\r
102  \r
103      delete notmuch->term_gen;\r
104 +    notmuch->term_gen = NULL;\r
105      delete notmuch->query_parser;\r
106 +    notmuch->query_parser = NULL;\r
107      delete notmuch->xapian_db;\r
108 +    notmuch->xapian_db = NULL;\r
109      delete notmuch->value_range_processor;\r
110 +    notmuch->value_range_processor = NULL;\r
111 +}\r
112 +\r
113 +void\r
114 +notmuch_database_destroy (notmuch_database_t *notmuch)\r
115 +{\r
116 +    notmuch_database_close (notmuch);\r
117      talloc_free (notmuch);\r
118  }\r
119  \r
120 diff --git a/lib/notmuch.h b/lib/notmuch.h\r
121 index 673c423..84c9265 100644\r
122 --- a/lib/notmuch.h\r
123 +++ b/lib/notmuch.h\r
124 @@ -133,7 +133,7 @@ typedef struct _notmuch_filenames notmuch_filenames_t;\r
125   *\r
126   * After a successful call to notmuch_database_create, the returned\r
127   * database will be open so the caller should call\r
128 - * notmuch_database_close when finished with it.\r
129 + * notmuch_database_destroy when finished with it.\r
130   *\r
131   * The database will not yet have any data in it\r
132   * (notmuch_database_create itself is a very cheap function). Messages\r
133 @@ -165,7 +165,7 @@ typedef enum {\r
134   * An existing notmuch database can be identified by the presence of a\r
135   * directory named ".notmuch" below 'path'.\r
136   *\r
137 - * The caller should call notmuch_database_close when finished with\r
138 + * The caller should call notmuch_database_destroy when finished with\r
139   * this database.\r
140   *\r
141   * In case of any failure, this function returns NULL, (after printing\r
142 @@ -175,11 +175,18 @@ notmuch_database_t *\r
143  notmuch_database_open (const char *path,\r
144                        notmuch_database_mode_t mode);\r
145  \r
146 -/* Close the given notmuch database, freeing all associated\r
147 - * resources. See notmuch_database_open. */\r
148 +/* Close the given notmuch database.\r
149 + *\r
150 + * This function is called by notmuch_database_destroy and can be\r
151 + * called multiple times. */\r
152  void\r
153  notmuch_database_close (notmuch_database_t *database);\r
154  \r
155 +/* Destroy the notmuch database freeing all associated\r
156 + * resources */\r
157 +void\r
158 +notmuch_database_destroy (notmuch_database_t *database);\r
159 +\r
160  /* Return the database path of the given database.\r
161   *\r
162   * The return value is a string owned by notmuch so should not be\r
163 -- \r
164 1.7.10\r
165 \r