unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: Tomi Ollila <tomi.ollila@iki.fi>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] moved _config_(get|set)_list () functions earlyer in the file
Date: Mon, 30 Jan 2012 10:06:45 -0500	[thread overview]
Message-ID: <20120130150645.GR17991@mit.edu> (raw)
In-Reply-To: <1327919485-15027-1-git-send-email-tomi.ollila@iki.fi>

s/earlyer/earlier/, but unless someone feels strongly about that, I
don't think we need another version of this trivial patch.

Quoth Tomi Ollila on Jan 30 at 12:31 pm:
> Moved static functions _config_get_list () and _config_set_list ()
> closer to the beginning of file so that their definition is known
> (without adding forward declarations) in upcoming changes.
> ---
> 
> This addresses Ethan's comments. Thanks.
> 
> s/_notmuch_/_config_/ and changed 'in further work' to 'in upcoming
> changes' -- 'changes' being more generic that 'patches'.
>  notmuch-config.c |   84 +++++++++++++++++++++++++++---------------------------
>  1 files changed, 42 insertions(+), 42 deletions(-)
> 
> diff --git a/notmuch-config.c b/notmuch-config.c
> index 0ded6d7..a124e34 100644
> --- a/notmuch-config.c
> +++ b/notmuch-config.c
> @@ -467,6 +467,48 @@ notmuch_config_save (notmuch_config_t *config)
>      return 0;
>  }
>  
> +static const char **
> +_config_get_list (notmuch_config_t *config,
> +		  const char *section, const char *key,
> +		  const char ***outlist, size_t *list_length, size_t *ret_length)
> +{
> +    assert(outlist);
> +
> +    if (*outlist == NULL) {
> +
> +	char **inlist = g_key_file_get_string_list (config->key_file,
> +					     section, key, list_length, NULL);
> +	if (inlist) {
> +	    unsigned int i;
> +
> +	    *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
> +
> +	    for (i = 0; i < *list_length; i++)
> +		(*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
> +
> +	    (*outlist)[i] = NULL;
> +
> +	    g_strfreev (inlist);
> +	}
> +    }
> +
> +    if (ret_length)
> +	*ret_length = *list_length;
> +
> +    return *outlist;
> +}
> +
> +static void
> +_config_set_list (notmuch_config_t *config,
> +		  const char *group, const char *name,
> +		  const char *list[],
> +		  size_t length, const char ***config_var )
> +{
> +    g_key_file_set_string_list (config->key_file, group, name, list, length);
> +    talloc_free (*config_var);
> +    *config_var = NULL;
> +}
> +
>  const char *
>  notmuch_config_get_database_path (notmuch_config_t *config)
>  {
> @@ -551,37 +593,6 @@ notmuch_config_set_user_primary_email (notmuch_config_t *config,
>      config->user_primary_email = NULL;
>  }
>  
> -static const char **
> -_config_get_list (notmuch_config_t *config,
> -		  const char *section, const char *key,
> -		  const char ***outlist, size_t *list_length, size_t *ret_length)
> -{
> -    assert(outlist);
> -
> -    if (*outlist == NULL) {
> -
> -	char **inlist = g_key_file_get_string_list (config->key_file,
> -					     section, key, list_length, NULL);
> -	if (inlist) {
> -	    unsigned int i;
> -
> -	    *outlist = talloc_size (config, sizeof (char *) * (*list_length + 1));
> -
> -	    for (i = 0; i < *list_length; i++)
> -		(*outlist)[i] = talloc_strdup (*outlist, inlist[i]);
> -
> -	    (*outlist)[i] = NULL;
> -
> -	    g_strfreev (inlist);
> -	}
> -    }
> -
> -    if (ret_length)
> -	*ret_length = *list_length;
> -
> -    return *outlist;
> -}
> -
>  const char **
>  notmuch_config_get_user_other_email (notmuch_config_t *config,   size_t *length)
>  {
> @@ -598,17 +609,6 @@ notmuch_config_get_new_tags (notmuch_config_t *config,   size_t *length)
>  			     &(config->new_tags_length), length);
>  }
>  
> -static void
> -_config_set_list (notmuch_config_t *config,
> -		  const char *group, const char *name,
> -		  const char *list[],
> -		  size_t length, const char ***config_var )
> -{
> -    g_key_file_set_string_list (config->key_file, group, name, list, length);
> -    talloc_free (*config_var);
> -    *config_var = NULL;
> -}
> -
>  void
>  notmuch_config_set_user_other_email (notmuch_config_t *config,
>  				     const char *list[],

  reply	other threads:[~2012-01-30 15:07 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-13 21:32 [PATCH 0/3] Configuration file option to exclude files/directories tomi.ollila
2011-09-13 21:32 ` [PATCH 1/3] added function notmuch_talloc_g_key_file_get_string_list() tomi.ollila
2011-09-13 21:32 ` [PATCH 2/3] Made notmuch_config_get_new_tags() use notmuch_talloc_g_key_file_get_string_list() tomi.ollila
2011-09-13 21:32 ` [PATCH 3/3] added support for user-specified directories to exclude tomi.ollila
2011-12-07 23:51 ` [PATCH 0/3] Configuration file option to exclude files/directories David Bremner
2011-12-08  0:24   ` Tom Prince
2011-12-08  9:05   ` Tomi Ollila
2012-01-25  0:46     ` Pieter Praet
2012-01-26 10:11       ` [PATCH 1/2] moved _notmuch_get_list () and _notmuch_set_list () up in file Tomi Ollila
2012-01-26 10:11         ` [PATCH 2/2] added support for user-specified directories to exclude Tomi Ollila
2012-01-26 13:11           ` Jani Nikula
2012-01-27 10:41             ` Tomi Ollila
2012-01-27 22:14               ` Austin Clements
2012-01-28 14:16               ` Fabio Zanini
2012-01-27 22:50           ` Austin Clements
2012-01-26 13:03         ` [PATCH 1/2] moved _notmuch_get_list () and _notmuch_set_list () up in file Jani Nikula
2012-01-27 10:42           ` Tomi Ollila
2012-01-27 18:18             ` Ethan Glasser-Camp
2012-01-30 10:31               ` [PATCH] moved _config_(get|set)_list () functions earlyer in the file Tomi Ollila
2012-01-30 15:06                 ` Austin Clements [this message]
2012-01-31  3:28                 ` David Bremner
2012-01-27 10:59           ` [PATCH] moved _notmuch_(get|set)_list " Tomi Ollila
2012-01-27 22:15             ` Austin Clements
2012-01-25  6:28     ` [PATCH 0/3] Configuration file option to exclude files/directories David Edmondson
2012-02-01 14:12       ` [PATCH] test: add tests wrt ignoring user-specified files and directories Pieter Praet
2012-02-03 12:14         ` Tomi Ollila
2012-02-03 22:39           ` Austin Clements
2012-02-03 22:44         ` Austin Clements
2012-02-19 20:43           ` Pieter Praet
2012-01-31 16:28 ` [PATCH] added support for user-specified files & directories to ignore Tomi Ollila
2012-02-01 14:25   ` Pieter Praet
2012-02-01 14:49   ` Jani Nikula
2012-02-01 16:30   ` Austin Clements
2012-02-06  9:28 ` [PATCH v6 1/3] test: add tests wrt ignoring user-specified files and directories Tomi Ollila
2012-02-06  9:28   ` [PATCH v6 2/3] add support for user-specified files & directories to ignore Tomi Ollila
2012-02-06  9:50     ` Tomi Ollila
2012-02-06  9:28   ` [PATCH v6 3/3] NEWS: add news section for new.ignore Tomi Ollila
2012-02-14 19:18     ` Austin Clements
2012-02-13  8:20   ` [PATCH v6 1/3] test: add tests wrt ignoring user-specified files and directories Tomi Ollila
2012-02-14 19:20     ` Austin Clements
2012-02-14 19:18   ` Austin Clements
2012-02-15  9:17 ` [PATCH v7 0/3] NEWS and test comment adjustments Tomi Ollila
2012-02-15  9:17   ` [PATCH v7 1/3] test: add tests wrt ignoring user-specified files and directories Tomi Ollila
2012-02-15  9:17   ` [PATCH v7 2/3] add support for user-specified files & directories to ignore Tomi Ollila
2012-02-15  9:17   ` [PATCH v7 3/3] NEWS: add news section for new.ignore Tomi Ollila
2012-02-17 12:13   ` [PATCH v7 0/3] NEWS and test comment adjustments David Bremner
2012-02-19 20:47     ` Pieter Praet
2012-02-19 20:47       ` [PATCH 1/6] cli: update 'new.ignore' config file comment wrt file/directory matching Pieter Praet
2012-02-28  2:46         ` David Bremner
2012-02-19 20:47       ` [PATCH 2/6] NEWS: sync 'new.ignore' entry with its comment in notmuch-config.c Pieter Praet
2012-02-28  2:46         ` David Bremner
2012-02-19 20:47       ` [PATCH 3/6] cli: add '--debug' option to 'notmuch new' Pieter Praet
2012-02-19 20:47       ` [PATCH 4/6] cli: notmuch new: optionally output debug information when ignoring files/directories Pieter Praet
2012-02-19 20:47       ` [PATCH 5/6] test-lib.sh: pass 'NOTMUCH_NEW's args down to 'notmuch new' Pieter Praet
2012-02-19 20:47       ` [PATCH 6/6] test: another test wrt ignoring user-specified files and directories Pieter Praet
2012-08-31 21:13         ` David Bremner
2012-10-12 19:32           ` [PATCH] " Ethan Glasser-Camp
2012-10-20 20:42             ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120130150645.GR17991@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).