1 Return-Path: <amdragon@mit.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 E5DC7431E64
\r
6 for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 07:07:40 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 yGP-6M15We7i for <notmuch@notmuchmail.org>;
\r
16 Mon, 30 Jan 2012 07:07:40 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 528DD431FBC
\r
20 for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 07:07:40 -0800 (PST)
\r
21 X-AuditID: 12074423-b7f9c6d0000008c3-90-4f26b23bd67f
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 1A.FC.02243.C32B62F4; Mon, 30 Jan 2012 10:07:40 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q0UF7dfH001398;
\r
27 Mon, 30 Jan 2012 10:07:39 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0UF7ZEo021512
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Mon, 30 Jan 2012 10:07:38 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1Rrsof-0001u3-Mx; Mon, 30 Jan 2012 10:06:45 -0500
\r
37 Date: Mon, 30 Jan 2012 10:06:45 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Tomi Ollila <tomi.ollila@iki.fi>
\r
40 Subject: Re: [PATCH] moved _config_(get|set)_list () functions earlyer in the
\r
42 Message-ID: <20120130150645.GR17991@mit.edu>
\r
43 References: <4F22EA91.4020006@cs.rpi.edu>
\r
44 <1327919485-15027-1-git-send-email-tomi.ollila@iki.fi>
\r
46 Content-Type: text/plain; charset=us-ascii
\r
47 Content-Disposition: inline
\r
48 In-Reply-To: <1327919485-15027-1-git-send-email-tomi.ollila@iki.fi>
\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IRYrdT17XZpOZvMOcMq8X1mzOZLd6snMfq
\r
52 wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGVsP/SMuWCKXMX+T78ZGxiniXcxcnJICJhI
\r
53 rL4zhRXCFpO4cG89WxcjF4eQwD5GiYtPp7KBJIQENjBKPDuZD5E4ySRxeukZqKoljBInH/Yw
\r
54 dTFycLAIqAIV8YI0sAloSGzbv5wRxBYRUJF40LYebAOzgLTEt9/NYOXCAiESLy/IgoR5BXQk
\r
55 Vj+8xwSxK0li1oNjTBBxQYmTM5+wQLRqSdz49xKsFWTM8n8cIGFOAWeJ1tlt7CC2KNCmKSe3
\r
56 sU1gFJqFpHsWku5ZCN0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Zrp5WaW6KWmlG5iBIe0
\r
57 i/IOxj8HlQ4xCnAwKvHwBv1T9RdiTSwrrsw9xCjJwaQkyhu9Uc1fiC8pP6UyI7E4I76oNCe1
\r
58 +BCjBAezkgjvm9VAOd6UxMqq1KJ8mJQ0B4uSOK+G1js/IYH0xJLU7NTUgtQimKwMB4eSBG86
\r
59 yFDBotT01Iq0zJwShDQTByfIcB6g4TNBaniLCxJzizPTIfKnGBWlxHlLQRICIImM0jy4XljK
\r
60 ecUoDvSKMO9skCoeYLqC634FNJgJaPBzBlWQwSWJCCmpBkaj0ouaPm9+PTYQ0f1y3Lb9xxvL
\r
61 plROHctsCUWXi+VJ3q4ZbPdjxG9lrlIRsm3kCZjqbrC0bLb+1zPVyow2VXPrX6bd2nD0v0jC
\r
62 95q3F7bv31h6Kt/T42WAhqn9PI9j/b9trv3qtahMOzk/RU3gtM15Bya1F35/GxcxG7EHPlzR
\r
63 G/Z5coK2nhJLcUaioRZzUXEiAL3j45cUAwAA
\r
64 Cc: notmuch@notmuchmail.org
\r
65 X-BeenThere: notmuch@notmuchmail.org
\r
66 X-Mailman-Version: 2.1.13
\r
68 List-Id: "Use and development of the notmuch mail system."
\r
69 <notmuch.notmuchmail.org>
\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
73 List-Post: <mailto:notmuch@notmuchmail.org>
\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
76 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
77 X-List-Received-Date: Mon, 30 Jan 2012 15:07:41 -0000
\r
79 s/earlyer/earlier/, but unless someone feels strongly about that, I
\r
80 don't think we need another version of this trivial patch.
\r
82 Quoth Tomi Ollila on Jan 30 at 12:31 pm:
\r
83 > Moved static functions _config_get_list () and _config_set_list ()
\r
84 > closer to the beginning of file so that their definition is known
\r
85 > (without adding forward declarations) in upcoming changes.
\r
88 > This addresses Ethan's comments. Thanks.
\r
90 > s/_notmuch_/_config_/ and changed 'in further work' to 'in upcoming
\r
91 > changes' -- 'changes' being more generic that 'patches'.
\r
92 > notmuch-config.c | 84 +++++++++++++++++++++++++++---------------------------
\r
93 > 1 files changed, 42 insertions(+), 42 deletions(-)
\r
95 > diff --git a/notmuch-config.c b/notmuch-config.c
\r
96 > index 0ded6d7..a124e34 100644
\r
97 > --- a/notmuch-config.c
\r
98 > +++ b/notmuch-config.c
\r
99 > @@ -467,6 +467,48 @@ notmuch_config_save (notmuch_config_t *config)
\r
103 > +static const char **
\r
104 > +_config_get_list (notmuch_config_t *config,
\r
105 > + const char *section, const char *key,
\r
106 > + const char ***outlist, size_t *list_length, size_t *ret_length)
\r
108 > + assert(outlist);
\r
110 > + if (*outlist == NULL) {
\r
112 > + char **inlist = g_key_file_get_string_list (config->key_file,
\r
113 > + section, key, list_length, NULL);
\r
115 > + unsigned int i;
\r
117 > + *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
119 > + for (i = 0; i < *list_length; i++)
\r
120 > + (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
122 > + (*outlist)[i] = NULL;
\r
124 > + g_strfreev (inlist);
\r
128 > + if (ret_length)
\r
129 > + *ret_length = *list_length;
\r
131 > + return *outlist;
\r
135 > +_config_set_list (notmuch_config_t *config,
\r
136 > + const char *group, const char *name,
\r
137 > + const char *list[],
\r
138 > + size_t length, const char ***config_var )
\r
140 > + g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
141 > + talloc_free (*config_var);
\r
142 > + *config_var = NULL;
\r
146 > notmuch_config_get_database_path (notmuch_config_t *config)
\r
148 > @@ -551,37 +593,6 @@ notmuch_config_set_user_primary_email (notmuch_config_t *config,
\r
149 > config->user_primary_email = NULL;
\r
152 > -static const char **
\r
153 > -_config_get_list (notmuch_config_t *config,
\r
154 > - const char *section, const char *key,
\r
155 > - const char ***outlist, size_t *list_length, size_t *ret_length)
\r
157 > - assert(outlist);
\r
159 > - if (*outlist == NULL) {
\r
161 > - char **inlist = g_key_file_get_string_list (config->key_file,
\r
162 > - section, key, list_length, NULL);
\r
164 > - unsigned int i;
\r
166 > - *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
168 > - for (i = 0; i < *list_length; i++)
\r
169 > - (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
171 > - (*outlist)[i] = NULL;
\r
173 > - g_strfreev (inlist);
\r
177 > - if (ret_length)
\r
178 > - *ret_length = *list_length;
\r
180 > - return *outlist;
\r
184 > notmuch_config_get_user_other_email (notmuch_config_t *config, size_t *length)
\r
186 > @@ -598,17 +609,6 @@ notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)
\r
187 > &(config->new_tags_length), length);
\r
191 > -_config_set_list (notmuch_config_t *config,
\r
192 > - const char *group, const char *name,
\r
193 > - const char *list[],
\r
194 > - size_t length, const char ***config_var )
\r
196 > - g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
197 > - talloc_free (*config_var);
\r
198 > - *config_var = NULL;
\r
202 > notmuch_config_set_user_other_email (notmuch_config_t *config,
\r
203 > const char *list[],
\r