1 Return-Path: <too@guru.guru-group.fi>
\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 1377F431E64
\r
6 for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:31:27 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 0h68VCfmcbNo for <notmuch@notmuchmail.org>;
\r
16 Mon, 30 Jan 2012 02:31:26 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 04FA6431FBC
\r
19 for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:31:25 -0800 (PST)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id 698A068056; Mon, 30 Jan 2012 12:31:28 +0200 (EET)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH] moved _config_(get|set)_list () functions earlyer in the file
\r
25 Date: Mon, 30 Jan 2012 12:31:25 +0200
\r
26 Message-Id: <1327919485-15027-1-git-send-email-tomi.ollila@iki.fi>
\r
27 X-Mailer: git-send-email 1.7.6.1
\r
28 In-Reply-To: <4F22EA91.4020006@cs.rpi.edu>
\r
29 References: <4F22EA91.4020006@cs.rpi.edu>
\r
30 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
31 X-BeenThere: notmuch@notmuchmail.org
\r
32 X-Mailman-Version: 2.1.13
\r
34 List-Id: "Use and development of the notmuch mail system."
\r
35 <notmuch.notmuchmail.org>
\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
37 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
39 List-Post: <mailto:notmuch@notmuchmail.org>
\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
43 X-List-Received-Date: Mon, 30 Jan 2012 10:31:27 -0000
\r
45 Moved static functions _config_get_list () and _config_set_list ()
\r
46 closer to the beginning of file so that their definition is known
\r
47 (without adding forward declarations) in upcoming changes.
\r
50 This addresses Ethan's comments. Thanks.
\r
52 s/_notmuch_/_config_/ and changed 'in further work' to 'in upcoming
\r
53 changes' -- 'changes' being more generic that 'patches'.
\r
54 notmuch-config.c | 84 +++++++++++++++++++++++++++---------------------------
\r
55 1 files changed, 42 insertions(+), 42 deletions(-)
\r
57 diff --git a/notmuch-config.c b/notmuch-config.c
\r
58 index 0ded6d7..a124e34 100644
\r
59 --- a/notmuch-config.c
\r
60 +++ b/notmuch-config.c
\r
61 @@ -467,6 +467,48 @@ notmuch_config_save (notmuch_config_t *config)
\r
65 +static const char **
\r
66 +_config_get_list (notmuch_config_t *config,
\r
67 + const char *section, const char *key,
\r
68 + const char ***outlist, size_t *list_length, size_t *ret_length)
\r
72 + if (*outlist == NULL) {
\r
74 + char **inlist = g_key_file_get_string_list (config->key_file,
\r
75 + section, key, list_length, NULL);
\r
79 + *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
81 + for (i = 0; i < *list_length; i++)
\r
82 + (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
84 + (*outlist)[i] = NULL;
\r
86 + g_strfreev (inlist);
\r
91 + *ret_length = *list_length;
\r
97 +_config_set_list (notmuch_config_t *config,
\r
98 + const char *group, const char *name,
\r
99 + const char *list[],
\r
100 + size_t length, const char ***config_var )
\r
102 + g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
103 + talloc_free (*config_var);
\r
104 + *config_var = NULL;
\r
108 notmuch_config_get_database_path (notmuch_config_t *config)
\r
110 @@ -551,37 +593,6 @@ notmuch_config_set_user_primary_email (notmuch_config_t *config,
\r
111 config->user_primary_email = NULL;
\r
114 -static const char **
\r
115 -_config_get_list (notmuch_config_t *config,
\r
116 - const char *section, const char *key,
\r
117 - const char ***outlist, size_t *list_length, size_t *ret_length)
\r
121 - if (*outlist == NULL) {
\r
123 - char **inlist = g_key_file_get_string_list (config->key_file,
\r
124 - section, key, list_length, NULL);
\r
128 - *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
130 - for (i = 0; i < *list_length; i++)
\r
131 - (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
133 - (*outlist)[i] = NULL;
\r
135 - g_strfreev (inlist);
\r
140 - *ret_length = *list_length;
\r
146 notmuch_config_get_user_other_email (notmuch_config_t *config, size_t *length)
\r
148 @@ -598,17 +609,6 @@ notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)
\r
149 &(config->new_tags_length), length);
\r
153 -_config_set_list (notmuch_config_t *config,
\r
154 - const char *group, const char *name,
\r
155 - const char *list[],
\r
156 - size_t length, const char ***config_var )
\r
158 - g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
159 - talloc_free (*config_var);
\r
160 - *config_var = NULL;
\r
164 notmuch_config_set_user_other_email (notmuch_config_t *config,
\r
165 const char *list[],
\r