1 Return-Path: <jani@nikula.org>
\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 09A42431FAE
\r
6 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:03:52 -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 NFuzuU1aQvQh for <notmuch@notmuchmail.org>;
\r
16 Thu, 26 Jan 2012 05:03:51 -0800 (PST)
\r
17 Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com
\r
18 [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id E23C3431FAF
\r
21 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:03:50 -0800 (PST)
\r
22 Received: by qabg24 with SMTP id g24so544708qab.5
\r
23 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:03:50 -0800 (PST)
\r
24 Received: by 10.224.59.65 with SMTP id k1mr2319822qah.54.1327583030365;
\r
25 Thu, 26 Jan 2012 05:03:50 -0800 (PST)
\r
26 Received: from localhost (nikula.org. [92.243.24.172])
\r
27 by mx.google.com with ESMTPS id gy6sm8465181qab.1.2012.01.26.05.03.48
\r
28 (version=SSLv3 cipher=OTHER); Thu, 26 Jan 2012 05:03:49 -0800 (PST)
\r
29 From: Jani Nikula <jani@nikula.org>
\r
30 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
\r
31 Subject: Re: [PATCH 1/2] moved _notmuch_get_list () and _notmuch_set_list ()
\r
33 In-Reply-To: <1327572718-13411-1-git-send-email-tomi.ollila@iki.fi>
\r
34 References: <8762g0sj6f.fsf@praet.org>
\r
35 <1327572718-13411-1-git-send-email-tomi.ollila@iki.fi>
\r
36 User-Agent: Notmuch/0.10.2+187~g43d4f26 (http://notmuchmail.org) Emacs/23.1.1
\r
38 Date: Thu, 26 Jan 2012 13:03:46 +0000
\r
39 Message-ID: <87sjj2ipjh.fsf@nikula.org>
\r
41 Content-Type: text/plain; charset=us-ascii
\r
42 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Thu, 26 Jan 2012 13:03:52 -0000
\r
57 On Thu, 26 Jan 2012 12:11:57 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
\r
58 > Moved _notmuch_get_list () and _notmuch_set_list () to a location
\r
59 > in notmuch-config.c so that new functions that will be located
\r
60 > before the old location of those functions can also use these.
\r
64 You mean something along the lines of: "Move _notmuch_get_list () and
\r
65 _notmuch_set_list () earlier in the file to avoid forward declarations
\r
66 in further work. No functional changes."
\r
68 I'm sure native speakers can bikeshed that further. ;)
\r
76 > This patch is independent of the next one (just required by it)
\r
77 > and can (should) be pushed early.
\r
79 > notmuch-config.c | 84 +++++++++++++++++++++++++++---------------------------
\r
80 > 1 files changed, 42 insertions(+), 42 deletions(-)
\r
82 > diff --git a/notmuch-config.c b/notmuch-config.c
\r
83 > index 0ded6d7..a124e34 100644
\r
84 > --- a/notmuch-config.c
\r
85 > +++ b/notmuch-config.c
\r
86 > @@ -467,6 +467,48 @@ notmuch_config_save (notmuch_config_t *config)
\r
90 > +static const char **
\r
91 > +_config_get_list (notmuch_config_t *config,
\r
92 > + const char *section, const char *key,
\r
93 > + const char ***outlist, size_t *list_length, size_t *ret_length)
\r
95 > + assert(outlist);
\r
97 > + if (*outlist == NULL) {
\r
99 > + char **inlist = g_key_file_get_string_list (config->key_file,
\r
100 > + section, key, list_length, NULL);
\r
102 > + unsigned int i;
\r
104 > + *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
106 > + for (i = 0; i < *list_length; i++)
\r
107 > + (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
109 > + (*outlist)[i] = NULL;
\r
111 > + g_strfreev (inlist);
\r
115 > + if (ret_length)
\r
116 > + *ret_length = *list_length;
\r
118 > + return *outlist;
\r
122 > +_config_set_list (notmuch_config_t *config,
\r
123 > + const char *group, const char *name,
\r
124 > + const char *list[],
\r
125 > + size_t length, const char ***config_var )
\r
127 > + g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
128 > + talloc_free (*config_var);
\r
129 > + *config_var = NULL;
\r
133 > notmuch_config_get_database_path (notmuch_config_t *config)
\r
135 > @@ -551,37 +593,6 @@ notmuch_config_set_user_primary_email (notmuch_config_t *config,
\r
136 > config->user_primary_email = NULL;
\r
139 > -static const char **
\r
140 > -_config_get_list (notmuch_config_t *config,
\r
141 > - const char *section, const char *key,
\r
142 > - const char ***outlist, size_t *list_length, size_t *ret_length)
\r
144 > - assert(outlist);
\r
146 > - if (*outlist == NULL) {
\r
148 > - char **inlist = g_key_file_get_string_list (config->key_file,
\r
149 > - section, key, list_length, NULL);
\r
151 > - unsigned int i;
\r
153 > - *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
155 > - for (i = 0; i < *list_length; i++)
\r
156 > - (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
158 > - (*outlist)[i] = NULL;
\r
160 > - g_strfreev (inlist);
\r
164 > - if (ret_length)
\r
165 > - *ret_length = *list_length;
\r
167 > - return *outlist;
\r
171 > notmuch_config_get_user_other_email (notmuch_config_t *config, size_t *length)
\r
173 > @@ -598,17 +609,6 @@ notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)
\r
174 > &(config->new_tags_length), length);
\r
178 > -_config_set_list (notmuch_config_t *config,
\r
179 > - const char *group, const char *name,
\r
180 > - const char *list[],
\r
181 > - size_t length, const char ***config_var )
\r
183 > - g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
184 > - talloc_free (*config_var);
\r
185 > - *config_var = NULL;
\r
189 > notmuch_config_set_user_other_email (notmuch_config_t *config,
\r
190 > const char *list[],
\r
194 > _______________________________________________
\r
195 > notmuch mailing list
\r
196 > notmuch@notmuchmail.org
\r
197 > http://notmuchmail.org/mailman/listinfo/notmuch
\r