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 114D9431FC0
\r
6 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 02:12:04 -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 iL4C7Z46cBaL for <notmuch@notmuchmail.org>;
\r
16 Thu, 26 Jan 2012 02:12:02 -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 93EF1431FAE
\r
19 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 02:12:02 -0800 (PST)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id CA9CF68056; Thu, 26 Jan 2012 12:12:00 +0200 (EET)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH 1/2] moved _notmuch_get_list () and _notmuch_set_list () up in
\r
26 Date: Thu, 26 Jan 2012 12:11:57 +0200
\r
27 Message-Id: <1327572718-13411-1-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 1.7.6.1
\r
29 In-Reply-To: <8762g0sj6f.fsf@praet.org>
\r
30 References: <8762g0sj6f.fsf@praet.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: Thu, 26 Jan 2012 10:12:04 -0000
\r
46 Moved _notmuch_get_list () and _notmuch_set_list () to a location
\r
47 in notmuch-config.c so that new functions that will be located
\r
48 before the old location of those functions can also use these.
\r
51 This patch is independent of the next one (just required by it)
\r
52 and can (should) be pushed early.
\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