LMMS
Loading...
Searching...
No Matches
hash.h
Go to the documentation of this file.
1/*
2 Copyright 2011-2015 David Robillard <http://drobilla.net>
3
4 Permission to use, copy, modify, and/or distribute this software for any
5 purpose with or without fee is hereby granted, provided that the above
6 copyright notice and this permission notice appear in all copies.
7
8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17#ifndef ZIX_HASH_H
18#define ZIX_HASH_H
19
20#include <stddef.h>
21#include <stdint.h>
22
23#include "zix/common.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
35
36typedef struct ZixHashImpl ZixHash;
37
41typedef uint32_t (*ZixHashFunc)(const void* value);
42
46typedef void (*ZixHashVisitFunc)(void* value,
47 void* user_data);
48
62ZIX_API ZixHash*
65 size_t value_size);
66
70ZIX_API void
72
76ZIX_API size_t
77zix_hash_size(const ZixHash* hash);
78
93ZIX_API ZixStatus
95 const void* value,
96 const void** inserted);
97
105ZIX_API ZixStatus
107 const void* value);
108
115ZIX_API const void*
116zix_hash_find(const ZixHash* hash,
117 const void* value);
118
126ZIX_API void
129 void* user_data);
130
135
136#ifdef __cplusplus
137} /* extern "C" */
138#endif
139
140#endif /* ZIX_HASH_H */
unsigned f
Definition inflate.c:1572
static PuglViewHint int value
Definition pugl.h:1708
ZIX_API void * zix_hash_find(const ZixHash *hash, const void *value)
Definition hash.c:146
ZIX_API ZixStatus zix_hash_insert(ZixHash *hash, const void *value, void **inserted)
Definition hash.c:155
ZIX_API void zix_hash_foreach(ZixHash *hash, ZixHashVisitFunc f, void *user_data)
Definition hash.c:222
uint32_t(* ZixHashFunc)(const void *value)
Definition hash.h:41
void(* ZixHashVisitFunc)(void *value, void *user_data)
Definition hash.h:46
bool(* ZixEqualFunc)(const void *a, const void *b)
Definition common.h:123
ZIX_API ZixStatus zix_hash_remove(ZixHash *hash, const void *value)
Definition hash.c:193
struct ZixHashImpl ZixHash
Definition hash.h:36
ZixStatus
Definition common.h:81
ZIX_API ZixHash * zix_hash_new(ZixHashFunc hash_func, ZixEqualFunc equal_func, size_t value_size)
Definition hash.c:55
ZIX_API void zix_hash_free(ZixHash *hash)
Definition hash.c:74
ZIX_PURE_API size_t zix_hash_size(const ZixHash *hash)
Definition hash.c:94
unsigned int uint32_t
Definition mid.cpp:100
Definition hash.c:39
size_t value_size
Definition hash.c:44
ZixEqualFunc equal_func
Definition hash.c:41
ZixHashFunc hash_func
Definition hash.c:40
#define void
Definition unzip.h:396