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 051D9431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 02:59:49 -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 9L9rJBu9UEr2 for <notmuch@notmuchmail.org>;
\r
16 Fri, 27 Jan 2012 02:59:48 -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 58A27431FAE
\r
19 for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 02:59:48 -0800 (PST)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id 3630868056; Fri, 27 Jan 2012 12:59:51 +0200 (EET)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH] moved _notmuch_(get|set)_list () functions earlyer in the
\r
26 Date: Fri, 27 Jan 2012 12:59:48 +0200
\r
27 Message-Id: <1327661988-18114-1-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 1.7.6.1
\r
29 In-Reply-To: <87sjj2ipjh.fsf@nikula.org>
\r
30 References: <87sjj2ipjh.fsf@nikula.org>
\r
31 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.13
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Fri, 27 Jan 2012 10:59:49 -0000
\r
46 Moved static functions _notmuch_get_list () and _notmuch_set_list ()
\r
47 closer to the beginning of file so that their definition is known
\r
48 (without adding forward declarations) in further work.
\r
50 No functional changes.
\r
52 notmuch-config.c | 84 +++++++++++++++++++++++++++---------------------------
\r
53 1 files changed, 42 insertions(+), 42 deletions(-)
\r
55 diff --git a/notmuch-config.c b/notmuch-config.c
\r
56 index 0ded6d7..a124e34 100644
\r
57 --- a/notmuch-config.c
\r
58 +++ b/notmuch-config.c
\r
59 @@ -467,6 +467,48 @@ notmuch_config_save (notmuch_config_t *config)
\r
63 +static const char **
\r
64 +_config_get_list (notmuch_config_t *config,
\r
65 + const char *section, const char *key,
\r
66 + const char ***outlist, size_t *list_length, size_t *ret_length)
\r
70 + if (*outlist == NULL) {
\r
72 + char **inlist = g_key_file_get_string_list (config->key_file,
\r
73 + section, key, list_length, NULL);
\r
77 + *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
79 + for (i = 0; i < *list_length; i++)
\r
80 + (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
82 + (*outlist)[i] = NULL;
\r
84 + g_strfreev (inlist);
\r
89 + *ret_length = *list_length;
\r
95 +_config_set_list (notmuch_config_t *config,
\r
96 + const char *group, const char *name,
\r
97 + const char *list[],
\r
98 + size_t length, const char ***config_var )
\r
100 + g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
101 + talloc_free (*config_var);
\r
102 + *config_var = NULL;
\r
106 notmuch_config_get_database_path (notmuch_config_t *config)
\r
108 @@ -551,37 +593,6 @@ notmuch_config_set_user_primary_email (notmuch_config_t *config,
\r
109 config->user_primary_email = NULL;
\r
112 -static const char **
\r
113 -_config_get_list (notmuch_config_t *config,
\r
114 - const char *section, const char *key,
\r
115 - const char ***outlist, size_t *list_length, size_t *ret_length)
\r
119 - if (*outlist == NULL) {
\r
121 - char **inlist = g_key_file_get_string_list (config->key_file,
\r
122 - section, key, list_length, NULL);
\r
126 - *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
\r
128 - for (i = 0; i < *list_length; i++)
\r
129 - (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
\r
131 - (*outlist)[i] = NULL;
\r
133 - g_strfreev (inlist);
\r
138 - *ret_length = *list_length;
\r
144 notmuch_config_get_user_other_email (notmuch_config_t *config, size_t *length)
\r
146 @@ -598,17 +609,6 @@ notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)
\r
147 &(config->new_tags_length), length);
\r
151 -_config_set_list (notmuch_config_t *config,
\r
152 - const char *group, const char *name,
\r
153 - const char *list[],
\r
154 - size_t length, const char ***config_var )
\r
156 - g_key_file_set_string_list (config->key_file, group, name, list, length);
\r
157 - talloc_free (*config_var);
\r
158 - *config_var = NULL;
\r
162 notmuch_config_set_user_other_email (notmuch_config_t *config,
\r
163 const char *list[],
\r