IDZEBRA 2.2.11
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

◆ hash()

struct strmap_entry ** hash ( zebra_strmap_t st,
const char * name )
static

◆ zebra_strmap_add()

void zebra_strmap_add ( zebra_strmap_t st,
const char * name,
void * data_buf,
size_t data_len )

◆ zebra_strmap_create()

◆ zebra_strmap_destroy()

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().

◆ zebra_strmap_get_size()

int zebra_strmap_get_size ( zebra_strmap_t st)

Definition at line 136 of file strmap.c.

References zebra_strmap::size.

◆ zebra_strmap_it_create()

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().

◆ zebra_strmap_it_destroy()

void zebra_strmap_it_destroy ( zebra_strmap_it it)

Definition at line 157 of file strmap.c.

Referenced by term_collect_create(), and test1().

◆ zebra_strmap_it_next()

const char * zebra_strmap_it_next ( zebra_strmap_it it,
void ** data_buf,
size_t * data_len )

◆ zebra_strmap_lookup()

void * zebra_strmap_lookup ( zebra_strmap_t st,
const char * name,
int no,
size_t * data_len )

◆ zebra_strmap_remove()

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::name, strmap_entry::next, and zebra_strmap::size.

Referenced by test1().