]> git.proxmox.com Git - libgit2.git/blob - src/idxmap.h
215a245217837a1ab7e415c6c3ddcbc13b7502e7
[libgit2.git] / src / idxmap.h
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 #ifndef INCLUDE_idxmap_h__
8 #define INCLUDE_idxmap_h__
9
10 #include "common.h"
11
12 #include "git2/index.h"
13
14 typedef struct kh_idx_s git_idxmap;
15 typedef struct kh_idxicase_s git_idxmap_icase;
16
17 int git_idxmap_alloc(git_idxmap **map);
18 int git_idxmap_icase_alloc(git_idxmap_icase **map);
19 void git_idxmap_insert(git_idxmap *map, const git_index_entry *key, void *value, int *rval);
20 void git_idxmap_icase_insert(git_idxmap_icase *map, const git_index_entry *key, void *value, int *rval);
21
22 size_t git_idxmap_lookup_index(git_idxmap *map, const git_index_entry *key);
23 size_t git_idxmap_icase_lookup_index(git_idxmap_icase *map, const git_index_entry *key);
24 void *git_idxmap_value_at(git_idxmap *map, size_t idx);
25 int git_idxmap_valid_index(git_idxmap *map, size_t idx);
26 int git_idxmap_has_data(git_idxmap *map, size_t idx);
27
28 void git_idxmap_resize(git_idxmap *map, size_t size);
29 void git_idxmap_icase_resize(git_idxmap_icase *map, size_t size);
30 void git_idxmap_free(git_idxmap *map);
31 void git_idxmap_icase_free(git_idxmap_icase *map);
32 void git_idxmap_clear(git_idxmap *map);
33 void git_idxmap_icase_clear(git_idxmap_icase *map);
34
35 void git_idxmap_delete_at(git_idxmap *map, size_t idx);
36 void git_idxmap_icase_delete_at(git_idxmap_icase *map, size_t idx);
37
38 void git_idxmap_delete(git_idxmap *map, const git_index_entry *key);
39 void git_idxmap_icase_delete(git_idxmap_icase *map, const git_index_entry *key);
40
41 #endif