Blame src/strmap.h

Packit Service 20376f
/*
Packit Service 20376f
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit Service 20376f
 *
Packit Service 20376f
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit Service 20376f
 * a Linking Exception. For full terms see the included COPYING file.
Packit Service 20376f
 */
Packit Service 20376f
#ifndef INCLUDE_strmap_h__
Packit Service 20376f
#define INCLUDE_strmap_h__
Packit Service 20376f
Packit Service 20376f
#include "common.h"
Packit Service 20376f
Packit Service 20376f
#define kmalloc git__malloc
Packit Service 20376f
#define kcalloc git__calloc
Packit Service 20376f
#define krealloc git__realloc
Packit Service 20376f
#define kreallocarray git__reallocarray
Packit Service 20376f
#define kfree git__free
Packit Service 20376f
#include "khash.h"
Packit Service 20376f
Packit Service 20376f
__KHASH_TYPE(str, const char *, void *)
Packit Service 20376f
typedef khash_t(str) git_strmap;
Packit Service 20376f
typedef khiter_t git_strmap_iter;
Packit Service 20376f
Packit Service 20376f
int git_strmap_alloc(git_strmap **map);
Packit Service 20376f
void git_strmap_free(git_strmap *map);
Packit Service 20376f
void git_strmap_clear(git_strmap *map);
Packit Service 20376f
Packit Service 20376f
size_t git_strmap_num_entries(git_strmap *map);
Packit Service 20376f
Packit Service 20376f
size_t git_strmap_lookup_index(git_strmap *map, const char *key);
Packit Service 20376f
int git_strmap_valid_index(git_strmap *map, size_t idx);
Packit Service 20376f
Packit Service 20376f
int git_strmap_exists(git_strmap *map, const char *key);
Packit Service 20376f
int git_strmap_has_data(git_strmap *map, size_t idx);
Packit Service 20376f
Packit Service 20376f
const char *git_strmap_key(git_strmap *map, size_t idx);
Packit Service 20376f
void git_strmap_set_key_at(git_strmap *map, size_t idx, char *key);
Packit Service 20376f
void *git_strmap_value_at(git_strmap *map, size_t idx);
Packit Service 20376f
void git_strmap_set_value_at(git_strmap *map, size_t idx, void *value);
Packit Service 20376f
void git_strmap_delete_at(git_strmap *map, size_t idx);
Packit Service 20376f
Packit Service 20376f
int git_strmap_put(git_strmap *map, const char *key, int *err);
Packit Service 20376f
void git_strmap_insert(git_strmap *map, const char *key, void *value, int *rval);
Packit Service 20376f
void git_strmap_delete(git_strmap *map, const char *key);
Packit Service 20376f
Packit Service 20376f
#define git_strmap_foreach		kh_foreach
Packit Service 20376f
#define git_strmap_foreach_value	kh_foreach_value
Packit Service 20376f
Packit Service 20376f
#define git_strmap_begin		kh_begin
Packit Service 20376f
#define git_strmap_end		kh_end
Packit Service 20376f
Packit Service 20376f
int git_strmap_next(
Packit Service 20376f
	void **data,
Packit Service 20376f
	git_strmap_iter* iter,
Packit Service 20376f
	git_strmap *map);
Packit Service 20376f
Packit Service 20376f
#endif