[PATCH] cli: factor out config handling code to get/set lists.

2012-01-12 Thread Pieter Praet
On Mon, 12 Dec 2011 14:26:21 -0400, David Bremner wrote: > On Sun, 11 Dec 2011 20:41:53 +0400, Dmitry Kurochkin gmail.com> wrote: > > Hi David. > > > > On Sun, 11 Dec 2011 12:07:51 -0400, David Bremner > > wrote: > > > From: David Bremner > > > > > > Two new internal routines are created

Re: [PATCH] cli: factor out config handling code to get/set lists.

2012-01-12 Thread Pieter Praet
On Mon, 12 Dec 2011 14:26:21 -0400, David Bremner da...@tethera.net wrote: On Sun, 11 Dec 2011 20:41:53 +0400, Dmitry Kurochkin dmitry.kuroch...@gmail.com wrote: Hi David. On Sun, 11 Dec 2011 12:07:51 -0400, David Bremner da...@tethera.net wrote: From: David Bremner brem...@debian.org

[PATCH] cli: factor out config handling code to get/set lists.

2011-12-12 Thread David Bremner
On Sun, 11 Dec 2011 20:41:53 +0400, Dmitry Kurochkin wrote: > Hi David. > > On Sun, 11 Dec 2011 12:07:51 -0400, David Bremner > wrote: > > From: David Bremner > > > > Two new internal routines are created _config_get_list and > > _config_set_list; the notmuch_config_get_* functions that deal

[PATCH] cli: factor out config handling code to get/set lists.

2011-12-11 Thread Dmitry Kurochkin
Hi David. On Sun, 11 Dec 2011 12:07:51 -0400, David Bremner wrote: > From: David Bremner > > Two new internal routines are created _config_get_list and > _config_set_list; the notmuch_config_get_* functions that deal with > lists are simply wrappers for these functions. Looks good to me.

[PATCH] cli: factor out config handling code to get/set lists.

2011-12-11 Thread David Bremner
From: David Bremner Two new internal routines are created _config_get_list and _config_set_list; the notmuch_config_get_* functions that deal with lists are simply wrappers for these functions. --- notmuch-config.c | 130 +++--

[PATCH] cli: factor out config handling code to get/set lists.

2011-12-11 Thread David Bremner
From: David Bremner brem...@debian.org Two new internal routines are created _config_get_list and _config_set_list; the notmuch_config_get_* functions that deal with lists are simply wrappers for these functions. --- notmuch-config.c | 130 +++--

Re: [PATCH] cli: factor out config handling code to get/set lists.

2011-12-11 Thread Dmitry Kurochkin
Hi David. On Sun, 11 Dec 2011 12:07:51 -0400, David Bremner da...@tethera.net wrote: From: David Bremner brem...@debian.org Two new internal routines are created _config_get_list and _config_set_list; the notmuch_config_get_* functions that deal with lists are simply wrappers for these

[RFC PATCH] cli: factor out config handling code to get/set lists.

2011-12-10 Thread David Bremner
On Sat, 10 Dec 2011 13:24:36 -0500, Austin Clements wrote: > What about something like > > const char ** > notmuch_config_get_user_other_email (notmuch_config_t *config, > size_t *length) > { > return _config_get_list (config, "user", "other_email", >

[RFC PATCH] cli: factor out config handling code to get/set lists.

2011-12-10 Thread David Bremner
From: David Bremner The code is already duplicated once, and I want to add a third configuration item that is also a list. --- Mainly I am curious if people think using macros to declare these "getters" and "setters" makes the code less maintainable. notmuch-config.c |

[RFC PATCH] cli: factor out config handling code to get/set lists.

2011-12-10 Thread Austin Clements
Deduplicating this code seems like a great idea, but I don't think macros are the way to do it; especially not one that expands to an important top-level construct like a function definition. What about something like const char ** notmuch_config_get_user_other_email (notmuch_config_t *config,

Re: [RFC PATCH] cli: factor out config handling code to get/set lists.

2011-12-10 Thread Austin Clements
Deduplicating this code seems like a great idea, but I don't think macros are the way to do it; especially not one that expands to an important top-level construct like a function definition. What about something like const char ** notmuch_config_get_user_other_email (notmuch_config_t *config,

Re: [RFC PATCH] cli: factor out config handling code to get/set lists.

2011-12-10 Thread David Bremner
On Sat, 10 Dec 2011 13:24:36 -0500, Austin Clements amdra...@mit.edu wrote: What about something like const char ** notmuch_config_get_user_other_email (notmuch_config_t *config, size_t *length) { return _config_get_list (config, user, other_email,