CAEN Utility  2.0.2
Utilities for CAEN projects
CAENMap.c File Reference

Hash table. Implementation from rxi's "map" project. More...

#include <CAENMap.h>
#include <stdlib.h>
#include <string.h>
#include <CAENMultiplatform.h>
Include dependency graph for CAENMap.c:

Go to the source code of this file.

Data Structures

struct  c_map_node_t
 

Functions

static uint32_t djb2a (const char *str)
 
static c_map_node_tmap_newnode (const char *key, const void *value, size_t vsize)
 
static void map_deletenode (c_map_node_t *node)
 
static size_t map_bucketidx (const c_map_base_t *m, uint32_t hash)
 
static void map_addnode (c_map_base_t *m, c_map_node_t *node)
 
static int32_t map_resize (c_map_base_t *m, size_t nbuckets)
 
static c_map_node_t ** map_getref (const c_map_base_t *m, const char *key)
 
int32_t _map_init (c_map_base_t *m, size_t nreserved)
 
void _map_deinit (c_map_base_t *m)
 
void * _map_get (const c_map_base_t *m, const char *key)
 
int32_t _map_set (c_map_base_t *m, const char *key, const void *value, size_t vsize)
 
void _map_remove (c_map_base_t *m, const char *key)
 
size_t _map_size (const c_map_base_t *m)
 
c_map_iter_t _map_iter (void)
 
const char * _map_next (const c_map_base_t *m, c_map_iter_t *iter)
 

Detailed Description

Hash table. Implementation from rxi's "map" project.

Author
Giovanni Cerretani, rxi

Definition in file CAENMap.c.

Function Documentation

◆ djb2a()

static uint32_t djb2a ( const char *  str)
static

Definition at line 41 of file CAENMap.c.

Here is the caller graph for this function:

◆ map_newnode()

static c_map_node_t* map_newnode ( const char *  key,
const void *  value,
size_t  vsize 
)
static

Definition at line 50 of file CAENMap.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_deletenode()

static void map_deletenode ( c_map_node_t node)
static

Definition at line 78 of file CAENMap.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_bucketidx()

static size_t map_bucketidx ( const c_map_base_t m,
uint32_t  hash 
)
static

Definition at line 87 of file CAENMap.c.

Here is the caller graph for this function:

◆ map_addnode()

static void map_addnode ( c_map_base_t m,
c_map_node_t node 
)
static

Definition at line 94 of file CAENMap.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_resize()

static int32_t map_resize ( c_map_base_t m,
size_t  nbuckets 
)
static

Definition at line 101 of file CAENMap.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_getref()

static c_map_node_t** map_getref ( const c_map_base_t m,
const char *  key 
)
static

Definition at line 134 of file CAENMap.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _map_init()

int32_t _map_init ( c_map_base_t m,
size_t  nreserved 
)

Definition at line 149 of file CAENMap.c.

Here is the call graph for this function:

◆ _map_deinit()

void _map_deinit ( c_map_base_t m)

Definition at line 165 of file CAENMap.c.

Here is the call graph for this function:

◆ _map_get()

void* _map_get ( const c_map_base_t m,
const char *  key 
)

Definition at line 184 of file CAENMap.c.

Here is the call graph for this function:

◆ _map_set()

int32_t _map_set ( c_map_base_t m,
const char *  key,
const void *  value,
size_t  vsize 
)

Definition at line 195 of file CAENMap.c.

Here is the call graph for this function:

◆ _map_remove()

void _map_remove ( c_map_base_t m,
const char *  key 
)

Definition at line 226 of file CAENMap.c.

Here is the call graph for this function:

◆ _map_size()

size_t _map_size ( const c_map_base_t m)

Definition at line 241 of file CAENMap.c.

◆ _map_iter()

c_map_iter_t _map_iter ( void  )

Definition at line 247 of file CAENMap.c.

◆ _map_next()

const char* _map_next ( const c_map_base_t m,
c_map_iter_t iter 
)

Definition at line 256 of file CAENMap.c.