Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-08 13:24:47 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-08 13:40:41 +0400
commit4d588d9713bb558e45a8bdf6c41d232bb592b814 (patch)
treee69c39a177bdc70e51984e5fbf96a36855919fc9 /src/config_file.c
parenta603c191578f7b33720e36e95421fcd58bc7abe4 (diff)
Don't typedef a pointer
Make the iterator structure opaque and make sure it compiles.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/config_file.c b/src/config_file.c
index ff8f8fc15..ea571e9f8 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -28,6 +28,8 @@ typedef struct cvar_t {
} cvar_t;
typedef struct git_config_file_iter {
+ git_config_backend *backend;
+ unsigned int flags;
git_strmap_iter iter;
cvar_t* next;
} git_config_file_iter;
@@ -254,7 +256,7 @@ static void backend_free(git_config_backend *_backend)
}
static int config_iterator_new(
- git_config_backend_iter *iter,
+ git_config_backend_iter **iter,
struct git_config_backend* backend)
{
diskfile_backend *b = (diskfile_backend *)backend;
@@ -266,6 +268,7 @@ static int config_iterator_new(
*it = git__calloc(1, sizeof(git_config_file_iter));
GITERR_CHECK_ALLOC(it);
+ (*it)->backend = backend;
(*it)->iter = git_strmap_begin(b->values);
(*it)->next = NULL;
@@ -273,18 +276,17 @@ static int config_iterator_new(
}
static void config_iterator_free(
- git_config_backend_iter iter)
+ git_config_backend_iter* iter)
{
git__free(iter);
}
-static int config_next(
- git_config_backend_iter *iter,
- git_config_entry* entry,
- struct git_config_backend* backend)
+static int config_iterator_next(
+ git_config_entry *entry,
+ git_config_backend_iter *iter)
{
- diskfile_backend *b = (diskfile_backend *)backend;
git_config_file_iter *it = *((git_config_file_iter**) iter);
+ diskfile_backend *b = (diskfile_backend *)it->backend;
int err;
cvar_t * var;
const char* key;
@@ -611,7 +613,7 @@ int git_config_file__ondisk(git_config_backend **out, const char *path)
backend->parent.del = config_delete;
backend->parent.iterator_new = config_iterator_new;
backend->parent.iterator_free = config_iterator_free;
- backend->parent.next = config_next;
+ backend->parent.next = config_iterator_next;
backend->parent.refresh = config_refresh;
backend->parent.free = backend_free;