Re: notmuch.el: controlling what does and doesn't get expanded in searches
[notmuch-archives.git] / 26 / 966a715a958fb276b9067619dee7c55bba5431
1 Return-Path: <cceleri@cs.stanford.edu>\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 0DCB1431FC2\r
6         for <notmuch@notmuchmail.org>; Tue,  6 May 2014 11:58:50 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 BR1npQAm0JHh for <notmuch@notmuchmail.org>;\r
16         Tue,  6 May 2014 11:58:41 -0700 (PDT)\r
17 Received: from smtp1.cs.Stanford.EDU (smtp1.cs.Stanford.EDU [171.64.64.25])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 5E516431FAF\r
21         for <notmuch@notmuchmail.org>; Tue,  6 May 2014 11:58:41 -0700 (PDT)\r
22 Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]\r
23         helo=jane.lan)\r
24         by smtp1.cs.Stanford.EDU with esmtpsa (TLSv1:DHE-RSA-SEED-SHA:128)\r
25         (Exim 4.80.1) (envelope-from <cceleri@cs.stanford.edu>)\r
26         id 1WhkZb-0004tB-Jj; Tue, 06 May 2014 11:58:40 -0700\r
27 From: Charles Celerier <cceleri@cs.stanford.edu>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [PATCH] lib: Precede all function names in notmuch-private.h with an\r
30         underscore.\r
31 Date: Tue,  6 May 2014 14:58:36 -0400\r
32 Message-Id: <1399402716-13714-1-git-send-email-cceleri@cs.stanford.edu>\r
33 X-Mailer: git-send-email 1.8.5.2 (Apple Git-48)\r
34 X-Scan-Signature: 7030b7a26f924acffcd1b682d2211542\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.13\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Tue, 06 May 2014 18:58:50 -0000\r
48 \r
49 An underscore should precede every function name in\r
50 lib/notmuch-private.h. This was not true and was noted by the failure of\r
51 test T360-symbol-hiding on Mac OS/X. This patch inserts an underscore\r
52 before each function name in lib/notmuch-private.h where the underscore\r
53 was missing and renames functions appropriately where they are used.\r
54 \r
55 Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>\r
56 ---\r
57  lib/database.cc       | 24 ++++++++++++------------\r
58  lib/message-file.c    |  8 ++++----\r
59  lib/message.cc        |  8 ++++----\r
60  lib/notmuch-private.h | 14 +++++++-------\r
61  lib/sha1.c            |  4 ++--\r
62  lib/thread.cc         |  4 ++--\r
63  6 files changed, 31 insertions(+), 31 deletions(-)\r
64 \r
65 diff --git a/lib/database.cc b/lib/database.cc\r
66 index 1efb14d..d9a01b7 100644\r
67 --- a/lib/database.cc\r
68 +++ b/lib/database.cc\r
69 @@ -356,7 +356,7 @@ _message_id_compressed (void *ctx, const char *message_id)\r
70  {\r
71      char *sha1, *compressed;\r
72  \r
73 -    sha1 = notmuch_sha1_of_string (message_id);\r
74 +    sha1 = _notmuch_sha1_of_string (message_id);\r
75  \r
76      compressed = talloc_asprintf (ctx, "notmuch-sha1-%s", sha1);\r
77      free (sha1);\r
78 @@ -1356,7 +1356,7 @@ _notmuch_database_get_directory_db_path (const char *path)\r
79      int term_len = strlen (_find_prefix ("directory")) + strlen (path);\r
80  \r
81      if (term_len > NOTMUCH_TERM_MAX)\r
82 -       return notmuch_sha1_of_string (path);\r
83 +       return _notmuch_sha1_of_string (path);\r
84      else\r
85         return path;\r
86  }\r
87 @@ -1758,12 +1758,12 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch,\r
88                                      _my_talloc_free_for_g_hash, NULL);\r
89      this_message_id = notmuch_message_get_message_id (message);\r
90  \r
91 -    refs = notmuch_message_file_get_header (message_file, "references");\r
92 +    refs = _notmuch_message_file_get_header (message_file, "references");\r
93      last_ref_message_id = parse_references (message,\r
94                                             this_message_id,\r
95                                             parents, refs);\r
96  \r
97 -    in_reply_to = notmuch_message_file_get_header (message_file, "in-reply-to");\r
98 +    in_reply_to = _notmuch_message_file_get_header (message_file, "in-reply-to");\r
99      in_reply_to_message_id = parse_references (message,\r
100                                                this_message_id,\r
101                                                parents, in_reply_to);\r
102 @@ -1961,7 +1961,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
103      if (ret)\r
104         return ret;\r
105  \r
106 -    message_file = notmuch_message_file_open (filename);\r
107 +    message_file = _notmuch_message_file_open (filename);\r
108      if (message_file == NULL)\r
109         return NOTMUCH_STATUS_FILE_ERROR;\r
110  \r
111 @@ -1982,9 +1982,9 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
112          * let's make sure that what we're looking at looks like an\r
113          * actual email message.\r
114          */\r
115 -       from = notmuch_message_file_get_header (message_file, "from");\r
116 -       subject = notmuch_message_file_get_header (message_file, "subject");\r
117 -       to = notmuch_message_file_get_header (message_file, "to");\r
118 +       from = _notmuch_message_file_get_header (message_file, "from");\r
119 +       subject = _notmuch_message_file_get_header (message_file, "subject");\r
120 +       to = _notmuch_message_file_get_header (message_file, "to");\r
121  \r
122         if ((from == NULL || *from == '\0') &&\r
123             (subject == NULL || *subject == '\0') &&\r
124 @@ -1997,7 +1997,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
125         /* Now that we're sure it's mail, the first order of business\r
126          * is to find a message ID (or else create one ourselves). */\r
127  \r
128 -       header = notmuch_message_file_get_header (message_file, "message-id");\r
129 +       header = _notmuch_message_file_get_header (message_file, "message-id");\r
130         if (header && *header != '\0') {\r
131             message_id = _parse_message_id (message_file, header, NULL);\r
132  \r
133 @@ -2018,7 +2018,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
134         if (message_id == NULL ) {\r
135             /* No message-id at all, let's generate one by taking a\r
136              * hash over the file's contents. */\r
137 -           char *sha1 = notmuch_sha1_of_file (filename);\r
138 +           char *sha1 = _notmuch_sha1_of_file (filename);\r
139  \r
140             /* If that failed too, something is really wrong. Give up. */\r
141             if (sha1 == NULL) {\r
142 @@ -2058,7 +2058,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
143             if (ret)\r
144                 goto DONE;\r
145  \r
146 -           date = notmuch_message_file_get_header (message_file, "date");\r
147 +           date = _notmuch_message_file_get_header (message_file, "date");\r
148             _notmuch_message_set_header_values (message, date, from, subject);\r
149  \r
150             ret = _notmuch_message_index_file (message, message_file);\r
151 @@ -2087,7 +2087,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
152      }\r
153  \r
154      if (message_file)\r
155 -       notmuch_message_file_close (message_file);\r
156 +       _notmuch_message_file_close (message_file);\r
157  \r
158      ret2 = notmuch_database_end_atomic (notmuch);\r
159      if ((ret == NOTMUCH_STATUS_SUCCESS ||\r
160 diff --git a/lib/message-file.c b/lib/message-file.c\r
161 index 6782882..f702eb5 100644\r
162 --- a/lib/message-file.c\r
163 +++ b/lib/message-file.c\r
164 @@ -99,19 +99,19 @@ _notmuch_message_file_open_ctx (void *ctx, const char *filename)\r
165  \r
166    FAIL:\r
167      fprintf (stderr, "Error opening %s: %s\n", filename, strerror (errno));\r
168 -    notmuch_message_file_close (message);\r
169 +    _notmuch_message_file_close (message);\r
170  \r
171      return NULL;\r
172  }\r
173  \r
174  notmuch_message_file_t *\r
175 -notmuch_message_file_open (const char *filename)\r
176 +_notmuch_message_file_open (const char *filename)\r
177  {\r
178      return _notmuch_message_file_open_ctx (NULL, filename);\r
179  }\r
180  \r
181  void\r
182 -notmuch_message_file_close (notmuch_message_file_t *message)\r
183 +_notmuch_message_file_close (notmuch_message_file_t *message)\r
184  {\r
185      talloc_free (message);\r
186  }\r
187 @@ -277,7 +277,7 @@ _notmuch_message_file_get_combined_header (notmuch_message_file_t *message,\r
188  }\r
189  \r
190  const char *\r
191 -notmuch_message_file_get_header (notmuch_message_file_t *message,\r
192 +_notmuch_message_file_get_header (notmuch_message_file_t *message,\r
193                                  const char *header)\r
194  {\r
195      const char *value;\r
196 diff --git a/lib/message.cc b/lib/message.cc\r
197 index 9243b76..eec8428 100644\r
198 --- a/lib/message.cc\r
199 +++ b/lib/message.cc\r
200 @@ -439,7 +439,7 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)\r
201      if (message->message_file == NULL)\r
202         return NULL;\r
203  \r
204 -    return notmuch_message_file_get_header (message->message_file, header);\r
205 +    return _notmuch_message_file_get_header (message->message_file, header);\r
206  }\r
207  \r
208  /* Return the message ID from the In-Reply-To header of 'message'.\r
209 @@ -898,13 +898,13 @@ notmuch_message_get_tags (notmuch_message_t *message)\r
210  }\r
211  \r
212  const char *\r
213 -notmuch_message_get_author (notmuch_message_t *message)\r
214 +_notmuch_message_get_author (notmuch_message_t *message)\r
215  {\r
216      return message->author;\r
217  }\r
218  \r
219  void\r
220 -notmuch_message_set_author (notmuch_message_t *message,\r
221 +_notmuch_message_set_author (notmuch_message_t *message,\r
222                             const char *author)\r
223  {\r
224      if (message->author)\r
225 @@ -971,7 +971,7 @@ void\r
226  _notmuch_message_close (notmuch_message_t *message)\r
227  {\r
228      if (message->message_file) {\r
229 -       notmuch_message_file_close (message->message_file);\r
230 +       _notmuch_message_file_close (message->message_file);\r
231         message->message_file = NULL;\r
232      }\r
233  }\r
234 diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
235 index 703ae7b..17f3061 100644\r
236 --- a/lib/notmuch-private.h\r
237 +++ b/lib/notmuch-private.h\r
238 @@ -316,11 +316,11 @@ _notmuch_message_clear_data (notmuch_message_t *message);\r
239  /* Set the author member of 'message' - this is the representation used\r
240   * when displaying the message */\r
241  void\r
242 -notmuch_message_set_author (notmuch_message_t *message, const char *author);\r
243 +_notmuch_message_set_author (notmuch_message_t *message, const char *author);\r
244  \r
245  /* Get the author member of 'message' */\r
246  const char *\r
247 -notmuch_message_get_author (notmuch_message_t *message);\r
248 +_notmuch_message_get_author (notmuch_message_t *message);\r
249  \r
250  /* message-file.c */\r
251  \r
252 @@ -337,7 +337,7 @@ typedef struct _notmuch_message_file notmuch_message_file_t;\r
253   * Returns NULL if any error occurs.\r
254   */\r
255  notmuch_message_file_t *\r
256 -notmuch_message_file_open (const char *filename);\r
257 +_notmuch_message_file_open (const char *filename);\r
258  \r
259  /* Like notmuch_message_file_open but with 'ctx' as the talloc owner. */\r
260  notmuch_message_file_t *\r
261 @@ -345,7 +345,7 @@ _notmuch_message_file_open_ctx (void *ctx, const char *filename);\r
262  \r
263  /* Close a notmuch message previously opened with notmuch_message_open. */\r
264  void\r
265 -notmuch_message_file_close (notmuch_message_file_t *message);\r
266 +_notmuch_message_file_close (notmuch_message_file_t *message);\r
267  \r
268  /* Parse the message.\r
269   *\r
270 @@ -386,7 +386,7 @@ _notmuch_message_file_get_mime_message (notmuch_message_file_t *message,\r
271   * contain a header line matching 'header'.\r
272   */\r
273  const char *\r
274 -notmuch_message_file_get_header (notmuch_message_file_t *message,\r
275 +_notmuch_message_file_get_header (notmuch_message_file_t *message,\r
276                                  const char *header);\r
277  \r
278  /* index.cc */\r
279 @@ -455,10 +455,10 @@ _notmuch_message_add_reply (notmuch_message_t *message,\r
280  /* sha1.c */\r
281  \r
282  char *\r
283 -notmuch_sha1_of_string (const char *str);\r
284 +_notmuch_sha1_of_string (const char *str);\r
285  \r
286  char *\r
287 -notmuch_sha1_of_file (const char *filename);\r
288 +_notmuch_sha1_of_file (const char *filename);\r
289  \r
290  /* string-list.c */\r
291  \r
292 diff --git a/lib/sha1.c b/lib/sha1.c\r
293 index cc48108..94060d5 100644\r
294 --- a/lib/sha1.c\r
295 +++ b/lib/sha1.c\r
296 @@ -50,7 +50,7 @@ _hex_of_sha1_digest (const unsigned char digest[SHA1_DIGEST_SIZE])\r
297   * should free() when finished.\r
298   */\r
299  char *\r
300 -notmuch_sha1_of_string (const char *str)\r
301 +_notmuch_sha1_of_string (const char *str)\r
302  {\r
303      sha1_ctx sha1;\r
304      unsigned char digest[SHA1_DIGEST_SIZE];\r
305 @@ -74,7 +74,7 @@ notmuch_sha1_of_string (const char *str)\r
306   * file not found, etc.), this function returns NULL.\r
307   */\r
308  char *\r
309 -notmuch_sha1_of_file (const char *filename)\r
310 +_notmuch_sha1_of_file (const char *filename)\r
311  {\r
312      FILE *file;\r
313  #define BLOCK_SIZE 4096\r
314 diff --git a/lib/thread.cc b/lib/thread.cc\r
315 index 8f53e12..8922403 100644\r
316 --- a/lib/thread.cc\r
317 +++ b/lib/thread.cc\r
318 @@ -284,7 +284,7 @@ _thread_add_message (notmuch_thread_t *thread,\r
319             }\r
320             clean_author = _thread_cleanup_author (thread, author, from);\r
321             _thread_add_author (thread, clean_author);\r
322 -           notmuch_message_set_author (message, clean_author);\r
323 +           _notmuch_message_set_author (message, clean_author);\r
324         }\r
325         g_object_unref (G_OBJECT (list));\r
326      }\r
327 @@ -373,7 +373,7 @@ _thread_add_matched_message (notmuch_thread_t *thread,\r
328                                   NOTMUCH_MESSAGE_FLAG_MATCH, 1);\r
329      }\r
330  \r
331 -    _thread_add_matched_author (thread, notmuch_message_get_author (hashed_message));\r
332 +    _thread_add_matched_author (thread, _notmuch_message_get_author (hashed_message));\r
333  }\r
334  \r
335  static void\r
336 -- \r
337 1.8.5.2 (Apple Git-48)\r
338 \r