IDZEBRA  2.1.2
Data Structures | Functions
strmap.c File Reference
#include <stddef.h>
#include <string.h>
#include <zebra_strmap.h>
#include <yaz/nmem.h>
#include <yaz/xmalloc.h>

Go to the source code of this file.

Data Structures

struct  strmap_entry
 
struct  zebra_strmap
 
struct  zebra_strmap_it_s
 

Functions

zebra_strmap_t zebra_strmap_create (void)
 
void zebra_strmap_destroy (zebra_strmap_t st)
 
static struct strmap_entry ** hash (zebra_strmap_t st, const char *name)
 
void zebra_strmap_add (zebra_strmap_t st, const char *name, void *data_buf, size_t data_len)
 
void * zebra_strmap_lookup (zebra_strmap_t st, const char *name, int no, size_t *data_len)
 
int zebra_strmap_remove (zebra_strmap_t st, const char *name)
 
int zebra_strmap_get_size (zebra_strmap_t st)
 
zebra_strmap_it zebra_strmap_it_create (zebra_strmap_t st)
 
void zebra_strmap_it_destroy (zebra_strmap_it it)
 
const char * zebra_strmap_it_next (zebra_strmap_it it, void **data_buf, size_t *data_len)
 

Function Documentation

static struct strmap_entry** hash ( zebra_strmap_t  st,
const char *  name 
)
static
void zebra_strmap_add ( zebra_strmap_t  st,
const char *  name,
void *  data_buf,
size_t  data_len 
)
zebra_strmap_t zebra_strmap_create ( void  )
void zebra_strmap_destroy ( zebra_strmap_t  st)

Definition at line 61 of file strmap.c.

References zebra_strmap::nmem_ent, and zebra_strmap::nmem_str.

Referenced by perform_facet(), test1(), and test2().

int zebra_strmap_get_size ( zebra_strmap_t  st)

Definition at line 136 of file strmap.c.

References zebra_strmap::size.

zebra_strmap_it zebra_strmap_it_create ( zebra_strmap_t  st)

Definition at line 148 of file strmap.c.

References zebra_strmap_it_s::ent, zebra_strmap_it_s::hno, and zebra_strmap_it_s::st.

Referenced by term_collect_create(), and test1().

void zebra_strmap_it_destroy ( zebra_strmap_it  it)

Definition at line 157 of file strmap.c.

Referenced by term_collect_create(), and test1().

const char* zebra_strmap_it_next ( zebra_strmap_it  it,
void **  data_buf,
size_t *  data_len 
)
void* zebra_strmap_lookup ( zebra_strmap_t  st,
const char *  name,
int  no,
size_t *  data_len 
)
int zebra_strmap_remove ( zebra_strmap_t  st,
const char *  name 
)

Definition at line 118 of file strmap.c.

References zebra_strmap::free_entries, hash(), strmap_entry::next, and zebra_strmap::size.

Referenced by test1().