diff options
author | Ben Straub <bs@github.com> | 2013-09-16 16:12:31 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-09-16 16:12:31 -0700 |
commit | 549931679a77b280eb1f36afeda8930eb31d70f7 (patch) | |
tree | 2744e3e198ad146bae72f35369bbeb4f8028c8c3 /src/strmap.c | |
parent | 1a68c168a6cdbe0db6e44fb582a7026a7d536c9d (diff) | |
parent | 8821c9aa5baf31e21c21825e8c91c765e6631e7f (diff) | |
download | libgit2-549931679a77b280eb1f36afeda8930eb31d70f7.tar.gz |
Merge branch 'development' into blame_rebased
Conflicts:
include/git2.h
Diffstat (limited to 'src/strmap.c')
-rw-r--r-- | src/strmap.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/strmap.c b/src/strmap.c new file mode 100644 index 000000000..b26a13d1f --- /dev/null +++ b/src/strmap.c @@ -0,0 +1,32 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#include "strmap.h" + +int git_strmap_next( + void **data, + git_strmap_iter* iter, + git_strmap *map) +{ + if (!map) + return GIT_ERROR; + + while (*iter != git_strmap_end(map)) { + if (!(git_strmap_has_data(map, *iter))) { + ++(*iter); + continue; + } + + *data = git_strmap_value_at(map, *iter); + + ++(*iter); + + return GIT_OK; + } + + return GIT_ITEROVER; +} |