]> git.proxmox.com Git - libgit2.git/blob - src/strmap.c
Merge pull request #1772 from libgit2/config-iter
[libgit2.git] / src / strmap.c
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7
8 #include "strmap.h"
9
10 int git_strmap_next(
11 void **data,
12 git_strmap_iter* iter,
13 git_strmap *map)
14 {
15 if (!map)
16 return GIT_ERROR;
17
18 while (*iter != git_strmap_end(map)) {
19 if (!(git_strmap_has_data(map, *iter))) {
20 ++(*iter);
21 continue;
22 }
23
24 *data = git_strmap_value_at(map, *iter);
25
26 ++(*iter);
27
28 return GIT_OK;
29 }
30
31 return GIT_ITEROVER;
32 }