summaryrefslogtreecommitdiff
path: root/src/config_file.h
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2012-09-10 12:11:02 +0200
committeryorah <yoram.harmelin@gmail.com>2012-10-23 12:48:38 +0200
commita1abe66aca3625eec1cabb2e93cf8df0be1b63f0 (patch)
tree17de8c31afbdb3398a391e1fcede5010394dec85 /src/config_file.h
parentf8ede94808348ac12db1d5dd91e5f66624d8b40d (diff)
downloadlibgit2-a1abe66aca3625eec1cabb2e93cf8df0be1b63f0.tar.gz
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
Diffstat (limited to 'src/config_file.h')
-rw-r--r--src/config_file.h10
1 files changed, 5 insertions, 5 deletions
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);