Go to the source code of this file.
◆ free_map()
Definition at line 63 of file map.c.
63 {
66}
ANN void map_release(const Map map)
#define mp_free(p, name, a)
◆ map_clear()
ANN void map_clear |
( |
const Map | v | ) |
|
Definition at line 3 of file map.c.
3 {
7}
static ANEW void * xrealloc(void *p, const m_uint sz)
◆ map_commit()
ANN void map_commit |
( |
const restrict Map | map, |
|
|
const restrict Map | commit ) |
Definition at line 56 of file map.c.
56 {
59}
ANN void map_set(const Map map, const vtype key, const vtype ptr)
static ANN vtype map_size(const Map map)
◆ map_get()
Definition at line 20 of file map.c.
20 {
22 if (
VKEY(map, i - 1) == key)
return VVAL(map, i - 1);
23 return 0;
24}
◆ map_index()
Definition at line 26 of file map.c.
26 {
28 if (
VKEY(map, i - 1) == key)
return i - 1;
29 return -1;
30}
◆ map_init()
ANN void map_init |
( |
const Map | a | ) |
|
|
inline |
Definition at line 9 of file map.c.
9 {
12}
static ANEW void * xcalloc(const m_uint n, const m_uint sz)
◆ map_release()
ANN void map_release |
( |
const Map | map | ) |
|
Definition at line 61 of file map.c.
◆ map_remove()
Definition at line 44 of file map.c.
44 {
46 for (
vtype i = 0, j = 0; i < len; ++i) {
47 if (
VKEY(map, i) != key) {
50 ++j;
51 } else
53 }
54}
◆ map_set()
Definition at line 32 of file map.c.
32 {
34 if (
VKEY(map, i - 1) == key) {
35 VVAL(map, i - 1) = ptr;
36 return;
37 }
38 }
42}
static ANN void vector_realloc(const Vector v)
◆ new_map()
Definition at line 14 of file map.c.
14 {
17 return map;
18}
ANN void map_init(const Map a)
#define mp_calloc(p, name)