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

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

#include <types/CAENMapTypes.h>
#include <CAENUtility.h>
#include <stdint.h>
Include dependency graph for CAENMap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define c_map_init(m, nreserved)   (((m) != NULL) ? _map_init(&(m)->base, (nreserved)) : c_Utility_ErrorCode_Map)
 
#define c_map_init_default(m)   c_map_init((m), 0)
 
#define c_map_deinit(m)   do { if ((m) != NULL) _map_deinit(&(m)->base); } while (0)
 
#define c_map_get(m, key)   (((m) != NULL) ? (m)->ref = _map_get(&(m)->base, (key)) : NULL)
 
#define c_map_set(m, key, value)   (((m) != NULL) ? ((m)->tmp = (value), _map_set(&(m)->base, (key), &(m)->tmp, sizeof((m)->tmp))) : c_Utility_ErrorCode_Map)
 
#define c_map_remove(m, key)   do { if ((m) != NULL) _map_remove(&(m)->base, (key)); } while (0)
 
#define c_map_size(m)   (((m) != NULL) ? _map_size(&(m)->base) : 0)
 
#define c_map_iter()   _map_iter()
 
#define c_map_next(m, iter)   (((m) != NULL) ? _map_next(&(m)->base, (iter)) : NULL)
 

Functions

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.h.

Function Documentation

◆ _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.