--- /dev/null
+Return-Path: <too@guru.guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1377F431E64\r
+ for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:31:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 0h68VCfmcbNo for <notmuch@notmuchmail.org>;\r
+ Mon, 30 Jan 2012 02:31:26 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+ by olra.theworths.org (Postfix) with ESMTP id 04FA6431FBC\r
+ for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:31:25 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 698A068056; Mon, 30 Jan 2012 12:31:28 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] moved _config_(get|set)_list () functions earlyer in the file\r
+Date: Mon, 30 Jan 2012 12:31:25 +0200\r
+Message-Id: <1327919485-15027-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.6.1\r
+In-Reply-To: <4F22EA91.4020006@cs.rpi.edu>\r
+References: <4F22EA91.4020006@cs.rpi.edu>\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 30 Jan 2012 10:31:27 -0000\r
+\r
+Moved static functions _config_get_list () and _config_set_list ()\r
+closer to the beginning of file so that their definition is known\r
+(without adding forward declarations) in upcoming changes.\r
+---\r
+\r
+This addresses Ethan's comments. Thanks.\r
+\r
+s/_notmuch_/_config_/ and changed 'in further work' to 'in upcoming\r
+changes' -- 'changes' being more generic that 'patches'.\r
+ notmuch-config.c | 84 +++++++++++++++++++++++++++---------------------------\r
+ 1 files changed, 42 insertions(+), 42 deletions(-)\r
+\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index 0ded6d7..a124e34 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -467,6 +467,48 @@ notmuch_config_save (notmuch_config_t *config)\r
+ return 0;\r
+ }\r
+ \r
++static const char **\r
++_config_get_list (notmuch_config_t *config,\r
++ const char *section, const char *key,\r
++ const char ***outlist, size_t *list_length, size_t *ret_length)\r
++{\r
++ assert(outlist);\r
++\r
++ if (*outlist == NULL) {\r
++\r
++ char **inlist = g_key_file_get_string_list (config->key_file,\r
++ section, key, list_length, NULL);\r
++ if (inlist) {\r
++ unsigned int i;\r
++\r
++ *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));\r
++\r
++ for (i = 0; i < *list_length; i++)\r
++ (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);\r
++\r
++ (*outlist)[i] = NULL;\r
++\r
++ g_strfreev (inlist);\r
++ }\r
++ }\r
++\r
++ if (ret_length)\r
++ *ret_length = *list_length;\r
++\r
++ return *outlist;\r
++}\r
++\r
++static void\r
++_config_set_list (notmuch_config_t *config,\r
++ const char *group, const char *name,\r
++ const char *list[],\r
++ size_t length, const char ***config_var )\r
++{\r
++ g_key_file_set_string_list (config->key_file, group, name, list, length);\r
++ talloc_free (*config_var);\r
++ *config_var = NULL;\r
++}\r
++\r
+ const char *\r
+ notmuch_config_get_database_path (notmuch_config_t *config)\r
+ {\r
+@@ -551,37 +593,6 @@ notmuch_config_set_user_primary_email (notmuch_config_t *config,\r
+ config->user_primary_email = NULL;\r
+ }\r
+ \r
+-static const char **\r
+-_config_get_list (notmuch_config_t *config,\r
+- const char *section, const char *key,\r
+- const char ***outlist, size_t *list_length, size_t *ret_length)\r
+-{\r
+- assert(outlist);\r
+-\r
+- if (*outlist == NULL) {\r
+-\r
+- char **inlist = g_key_file_get_string_list (config->key_file,\r
+- section, key, list_length, NULL);\r
+- if (inlist) {\r
+- unsigned int i;\r
+-\r
+- *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));\r
+-\r
+- for (i = 0; i < *list_length; i++)\r
+- (*outlist)[i] = talloc_strdup (*outlist, inlist[i]);\r
+-\r
+- (*outlist)[i] = NULL;\r
+-\r
+- g_strfreev (inlist);\r
+- }\r
+- }\r
+-\r
+- if (ret_length)\r
+- *ret_length = *list_length;\r
+-\r
+- return *outlist;\r
+-}\r
+-\r
+ const char **\r
+ notmuch_config_get_user_other_email (notmuch_config_t *config, size_t *length)\r
+ {\r
+@@ -598,17 +609,6 @@ notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)\r
+ &(config->new_tags_length), length);\r
+ }\r
+ \r
+-static void\r
+-_config_set_list (notmuch_config_t *config,\r
+- const char *group, const char *name,\r
+- const char *list[],\r
+- size_t length, const char ***config_var )\r
+-{\r
+- g_key_file_set_string_list (config->key_file, group, name, list, length);\r
+- talloc_free (*config_var);\r
+- *config_var = NULL;\r
+-}\r
+-\r
+ void\r
+ notmuch_config_set_user_other_email (notmuch_config_t *config,\r
+ const char *list[],\r
+-- \r
+1.7.8.2\r
+\r