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 1316E431FBD
\r
6 for <notmuch@notmuchmail.org>; Tue, 13 May 2014 02:44:23 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 YSm-KTIDJNZC for <notmuch@notmuchmail.org>;
\r
16 Tue, 13 May 2014 02:44:12 -0700 (PDT)
\r
17 Received: from smtp3.cs.Stanford.EDU (smtp3.cs.Stanford.EDU [171.64.64.27])
\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 BC161431FAF
\r
21 for <notmuch@notmuchmail.org>; Tue, 13 May 2014 02:44:12 -0700 (PDT)
\r
22 Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]
\r
24 by smtp3.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 1Wk9Fq-0002Wj-Tt; Tue, 13 May 2014 02:44:12 -0700
\r
27 From: Charles Celerier <cceleri@cs.stanford.edu>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH v2] lib: Start all function names in notmuch-private.h with
\r
30 Date: Tue, 13 May 2014 05:44:05 -0400
\r
31 Message-Id: <1399974245-77744-1-git-send-email-cceleri@cs.stanford.edu>
\r
32 X-Mailer: git-send-email 1.8.5.2 (Apple Git-48)
\r
33 In-Reply-To: <1399402716-13714-1-git-send-email-cceleri@cs.stanford.edu>
\r
34 References: <1399402716-13714-1-git-send-email-cceleri@cs.stanford.edu>
\r
35 X-Scan-Signature: d419784c47c095b08cbe302b66275b1c
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.13
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Tue, 13 May 2014 09:44:23 -0000
\r
50 As noted in devel/STYLE, every private library function should start
\r
51 with _notmuch. This patch corrects function naming that did not adhere
\r
52 to this style in lib/notmuch-private.h. In particular, the old function
\r
53 names that now begin with _notmuch are
\r
55 notmuch_sha1_of_file
\r
56 notmuch_sha1_of_string
\r
57 notmuch_message_file_close
\r
58 notmuch_message_file_get_header
\r
59 notmuch_message_file_open
\r
60 notmuch_message_get_author
\r
61 notmuch_message_set_author
\r
63 Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>
\r
65 lib/database.cc | 24 ++++++++++++------------
\r
66 lib/message-file.c | 8 ++++----
\r
67 lib/message.cc | 8 ++++----
\r
68 lib/notmuch-private.h | 14 +++++++-------
\r
70 lib/thread.cc | 4 ++--
\r
71 6 files changed, 31 insertions(+), 31 deletions(-)
\r
73 diff --git a/lib/database.cc b/lib/database.cc
\r
74 index 1efb14d..d9a01b7 100644
\r
75 --- a/lib/database.cc
\r
76 +++ b/lib/database.cc
\r
77 @@ -356,7 +356,7 @@ _message_id_compressed (void *ctx, const char *message_id)
\r
79 char *sha1, *compressed;
\r
81 - sha1 = notmuch_sha1_of_string (message_id);
\r
82 + sha1 = _notmuch_sha1_of_string (message_id);
\r
84 compressed = talloc_asprintf (ctx, "notmuch-sha1-%s", sha1);
\r
86 @@ -1356,7 +1356,7 @@ _notmuch_database_get_directory_db_path (const char *path)
\r
87 int term_len = strlen (_find_prefix ("directory")) + strlen (path);
\r
89 if (term_len > NOTMUCH_TERM_MAX)
\r
90 - return notmuch_sha1_of_string (path);
\r
91 + return _notmuch_sha1_of_string (path);
\r
95 @@ -1758,12 +1758,12 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch,
\r
96 _my_talloc_free_for_g_hash, NULL);
\r
97 this_message_id = notmuch_message_get_message_id (message);
\r
99 - refs = notmuch_message_file_get_header (message_file, "references");
\r
100 + refs = _notmuch_message_file_get_header (message_file, "references");
\r
101 last_ref_message_id = parse_references (message,
\r
105 - in_reply_to = notmuch_message_file_get_header (message_file, "in-reply-to");
\r
106 + in_reply_to = _notmuch_message_file_get_header (message_file, "in-reply-to");
\r
107 in_reply_to_message_id = parse_references (message,
\r
109 parents, in_reply_to);
\r
110 @@ -1961,7 +1961,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
114 - message_file = notmuch_message_file_open (filename);
\r
115 + message_file = _notmuch_message_file_open (filename);
\r
116 if (message_file == NULL)
\r
117 return NOTMUCH_STATUS_FILE_ERROR;
\r
119 @@ -1982,9 +1982,9 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
120 * let's make sure that what we're looking at looks like an
\r
121 * actual email message.
\r
123 - from = notmuch_message_file_get_header (message_file, "from");
\r
124 - subject = notmuch_message_file_get_header (message_file, "subject");
\r
125 - to = notmuch_message_file_get_header (message_file, "to");
\r
126 + from = _notmuch_message_file_get_header (message_file, "from");
\r
127 + subject = _notmuch_message_file_get_header (message_file, "subject");
\r
128 + to = _notmuch_message_file_get_header (message_file, "to");
\r
130 if ((from == NULL || *from == '\0') &&
\r
131 (subject == NULL || *subject == '\0') &&
\r
132 @@ -1997,7 +1997,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
133 /* Now that we're sure it's mail, the first order of business
\r
134 * is to find a message ID (or else create one ourselves). */
\r
136 - header = notmuch_message_file_get_header (message_file, "message-id");
\r
137 + header = _notmuch_message_file_get_header (message_file, "message-id");
\r
138 if (header && *header != '\0') {
\r
139 message_id = _parse_message_id (message_file, header, NULL);
\r
141 @@ -2018,7 +2018,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
142 if (message_id == NULL ) {
\r
143 /* No message-id at all, let's generate one by taking a
\r
144 * hash over the file's contents. */
\r
145 - char *sha1 = notmuch_sha1_of_file (filename);
\r
146 + char *sha1 = _notmuch_sha1_of_file (filename);
\r
148 /* If that failed too, something is really wrong. Give up. */
\r
149 if (sha1 == NULL) {
\r
150 @@ -2058,7 +2058,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
154 - date = notmuch_message_file_get_header (message_file, "date");
\r
155 + date = _notmuch_message_file_get_header (message_file, "date");
\r
156 _notmuch_message_set_header_values (message, date, from, subject);
\r
158 ret = _notmuch_message_index_file (message, message_file);
\r
159 @@ -2087,7 +2087,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
163 - notmuch_message_file_close (message_file);
\r
164 + _notmuch_message_file_close (message_file);
\r
166 ret2 = notmuch_database_end_atomic (notmuch);
\r
167 if ((ret == NOTMUCH_STATUS_SUCCESS ||
\r
168 diff --git a/lib/message-file.c b/lib/message-file.c
\r
169 index 6782882..f702eb5 100644
\r
170 --- a/lib/message-file.c
\r
171 +++ b/lib/message-file.c
\r
172 @@ -99,19 +99,19 @@ _notmuch_message_file_open_ctx (void *ctx, const char *filename)
\r
175 fprintf (stderr, "Error opening %s: %s\n", filename, strerror (errno));
\r
176 - notmuch_message_file_close (message);
\r
177 + _notmuch_message_file_close (message);
\r
182 notmuch_message_file_t *
\r
183 -notmuch_message_file_open (const char *filename)
\r
184 +_notmuch_message_file_open (const char *filename)
\r
186 return _notmuch_message_file_open_ctx (NULL, filename);
\r
190 -notmuch_message_file_close (notmuch_message_file_t *message)
\r
191 +_notmuch_message_file_close (notmuch_message_file_t *message)
\r
193 talloc_free (message);
\r
195 @@ -277,7 +277,7 @@ _notmuch_message_file_get_combined_header (notmuch_message_file_t *message,
\r
199 -notmuch_message_file_get_header (notmuch_message_file_t *message,
\r
200 +_notmuch_message_file_get_header (notmuch_message_file_t *message,
\r
201 const char *header)
\r
204 diff --git a/lib/message.cc b/lib/message.cc
\r
205 index 9243b76..eec8428 100644
\r
206 --- a/lib/message.cc
\r
207 +++ b/lib/message.cc
\r
208 @@ -439,7 +439,7 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)
\r
209 if (message->message_file == NULL)
\r
212 - return notmuch_message_file_get_header (message->message_file, header);
\r
213 + return _notmuch_message_file_get_header (message->message_file, header);
\r
216 /* Return the message ID from the In-Reply-To header of 'message'.
\r
217 @@ -898,13 +898,13 @@ notmuch_message_get_tags (notmuch_message_t *message)
\r
221 -notmuch_message_get_author (notmuch_message_t *message)
\r
222 +_notmuch_message_get_author (notmuch_message_t *message)
\r
224 return message->author;
\r
228 -notmuch_message_set_author (notmuch_message_t *message,
\r
229 +_notmuch_message_set_author (notmuch_message_t *message,
\r
230 const char *author)
\r
232 if (message->author)
\r
233 @@ -971,7 +971,7 @@ void
\r
234 _notmuch_message_close (notmuch_message_t *message)
\r
236 if (message->message_file) {
\r
237 - notmuch_message_file_close (message->message_file);
\r
238 + _notmuch_message_file_close (message->message_file);
\r
239 message->message_file = NULL;
\r
242 diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
\r
243 index 703ae7b..17f3061 100644
\r
244 --- a/lib/notmuch-private.h
\r
245 +++ b/lib/notmuch-private.h
\r
246 @@ -316,11 +316,11 @@ _notmuch_message_clear_data (notmuch_message_t *message);
\r
247 /* Set the author member of 'message' - this is the representation used
\r
248 * when displaying the message */
\r
250 -notmuch_message_set_author (notmuch_message_t *message, const char *author);
\r
251 +_notmuch_message_set_author (notmuch_message_t *message, const char *author);
\r
253 /* Get the author member of 'message' */
\r
255 -notmuch_message_get_author (notmuch_message_t *message);
\r
256 +_notmuch_message_get_author (notmuch_message_t *message);
\r
258 /* message-file.c */
\r
260 @@ -337,7 +337,7 @@ typedef struct _notmuch_message_file notmuch_message_file_t;
\r
261 * Returns NULL if any error occurs.
\r
263 notmuch_message_file_t *
\r
264 -notmuch_message_file_open (const char *filename);
\r
265 +_notmuch_message_file_open (const char *filename);
\r
267 /* Like notmuch_message_file_open but with 'ctx' as the talloc owner. */
\r
268 notmuch_message_file_t *
\r
269 @@ -345,7 +345,7 @@ _notmuch_message_file_open_ctx (void *ctx, const char *filename);
\r
271 /* Close a notmuch message previously opened with notmuch_message_open. */
\r
273 -notmuch_message_file_close (notmuch_message_file_t *message);
\r
274 +_notmuch_message_file_close (notmuch_message_file_t *message);
\r
276 /* Parse the message.
\r
278 @@ -386,7 +386,7 @@ _notmuch_message_file_get_mime_message (notmuch_message_file_t *message,
\r
279 * contain a header line matching 'header'.
\r
282 -notmuch_message_file_get_header (notmuch_message_file_t *message,
\r
283 +_notmuch_message_file_get_header (notmuch_message_file_t *message,
\r
284 const char *header);
\r
287 @@ -455,10 +455,10 @@ _notmuch_message_add_reply (notmuch_message_t *message,
\r
291 -notmuch_sha1_of_string (const char *str);
\r
292 +_notmuch_sha1_of_string (const char *str);
\r
295 -notmuch_sha1_of_file (const char *filename);
\r
296 +_notmuch_sha1_of_file (const char *filename);
\r
298 /* string-list.c */
\r
300 diff --git a/lib/sha1.c b/lib/sha1.c
\r
301 index cc48108..94060d5 100644
\r
304 @@ -50,7 +50,7 @@ _hex_of_sha1_digest (const unsigned char digest[SHA1_DIGEST_SIZE])
\r
305 * should free() when finished.
\r
308 -notmuch_sha1_of_string (const char *str)
\r
309 +_notmuch_sha1_of_string (const char *str)
\r
312 unsigned char digest[SHA1_DIGEST_SIZE];
\r
313 @@ -74,7 +74,7 @@ notmuch_sha1_of_string (const char *str)
\r
314 * file not found, etc.), this function returns NULL.
\r
317 -notmuch_sha1_of_file (const char *filename)
\r
318 +_notmuch_sha1_of_file (const char *filename)
\r
321 #define BLOCK_SIZE 4096
\r
322 diff --git a/lib/thread.cc b/lib/thread.cc
\r
323 index 8f53e12..8922403 100644
\r
324 --- a/lib/thread.cc
\r
325 +++ b/lib/thread.cc
\r
326 @@ -284,7 +284,7 @@ _thread_add_message (notmuch_thread_t *thread,
\r
328 clean_author = _thread_cleanup_author (thread, author, from);
\r
329 _thread_add_author (thread, clean_author);
\r
330 - notmuch_message_set_author (message, clean_author);
\r
331 + _notmuch_message_set_author (message, clean_author);
\r
333 g_object_unref (G_OBJECT (list));
\r
335 @@ -373,7 +373,7 @@ _thread_add_matched_message (notmuch_thread_t *thread,
\r
336 NOTMUCH_MESSAGE_FLAG_MATCH, 1);
\r
339 - _thread_add_matched_author (thread, notmuch_message_get_author (hashed_message));
\r
340 + _thread_add_matched_author (thread, _notmuch_message_get_author (hashed_message));
\r
345 1.8.5.2 (Apple Git-48)
\r