Blame src/offmap.h

Packit Service 20376f
/*
Packit Service 20376f
 * Copyright (C) 2012 the libgit2 contributors
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_offmap_h__
Packit Service 20376f
#define INCLUDE_offmap_h__
Packit Service 20376f
Packit Service 20376f
#include "common.h"
Packit Service 20376f
#include "git2/types.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(off, git_off_t, void *)
Packit Service 20376f
typedef khash_t(off) git_offmap;
Packit Service 20376f
Packit Service 20376f
git_offmap *git_offmap_alloc(void);
Packit Service 20376f
void git_offmap_free(git_offmap *map);
Packit Service 20376f
void git_offmap_clear(git_offmap *map);
Packit Service 20376f
Packit Service 20376f
size_t git_offmap_num_entries(git_offmap *map);
Packit Service 20376f
Packit Service 20376f
size_t git_offmap_lookup_index(git_offmap *map, const git_off_t key);
Packit Service 20376f
int git_offmap_valid_index(git_offmap *map, size_t idx);
Packit Service 20376f
Packit Service 20376f
int git_offmap_exists(git_offmap *map, const git_off_t key);
Packit Service 20376f
Packit Service 20376f
void *git_offmap_value_at(git_offmap *map, size_t idx);
Packit Service 20376f
void git_offmap_set_value_at(git_offmap *map, size_t idx, void *value);
Packit Service 20376f
void git_offmap_delete_at(git_offmap *map, size_t idx);
Packit Service 20376f
Packit Service 20376f
int git_offmap_put(git_offmap *map, const git_off_t key, int *err);
Packit Service 20376f
void git_offmap_insert(git_offmap *map, const git_off_t key, void *value, int *rval);
Packit Service 20376f
void git_offmap_delete(git_offmap *map, const git_off_t key);
Packit Service 20376f
Packit Service 20376f
#define git_offmap_foreach		kh_foreach
Packit Service 20376f
#define git_offmap_foreach_value	kh_foreach_value
Packit Service 20376f
Packit Service 20376f
#endif