From a1abe66aca3625eec1cabb2e93cf8df0be1b63f0 Mon Sep 17 00:00:00 2001 From: yorah Date: Mon, 10 Sep 2012 12:11:02 +0200 Subject: Add config level support in the config API Added `struct git_config_entry`: a git_config_entry contains the key, the value, and the config file level from which a config element was found. Added `git_config_open_level`: build a single-level focused config object from a multi-level one. We are now storing `git_config_entry`s in the khash of the config_file --- src/config_file.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/config_file.h') diff --git a/src/config_file.h b/src/config_file.h index bf687b516..b500dd64f 100644 --- a/src/config_file.h +++ b/src/config_file.h @@ -9,9 +9,9 @@ #include "git2/config.h" -GIT_INLINE(int) git_config_file_open(git_config_file *cfg) +GIT_INLINE(int) git_config_file_open(git_config_file *cfg, unsigned int level) { - return cfg->open(cfg); + return cfg->open(cfg, level); } GIT_INLINE(void) git_config_file_free(git_config_file *cfg) @@ -20,7 +20,7 @@ GIT_INLINE(void) git_config_file_free(git_config_file *cfg) } GIT_INLINE(int) git_config_file_get_string( - const char **out, git_config_file *cfg, const char *name) + const git_config_entry **out, git_config_file *cfg, const char *name) { return cfg->get(cfg, name, out); } @@ -39,7 +39,7 @@ GIT_INLINE(int) git_config_file_delete( GIT_INLINE(int) git_config_file_foreach( git_config_file *cfg, - int (*fn)(const char *key, const char *value, void *data), + int (*fn)(const git_config_entry *entry, void *data), void *data) { return cfg->foreach(cfg, NULL, fn, data); @@ -48,7 +48,7 @@ GIT_INLINE(int) git_config_file_foreach( GIT_INLINE(int) git_config_file_foreach_match( git_config_file *cfg, const char *regexp, - int (*fn)(const char *key, const char *value, void *data), + int (*fn)(const git_config_entry *entry, void *data), void *data) { return cfg->foreach(cfg, regexp, fn, data); -- cgit v1.2.3