BRL-CAD
hash.h File Reference
#include "common.h"
#include "bu/defines.h"
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bu_hash_entry
 
struct  bu_hash_tbl
 
struct  bu_hash_record
 

Macros

#define BU_HASH_ENTRY_NULL   ((struct bu_hash_entry *)0)
 
#define BU_CK_HASH_ENTRY(_ep)   BU_CKMAG(_ep, BU_HASH_ENTRY_MAGIC, "bu_hash_entry")
 
#define BU_HASH_ENTRY_INIT(_h)
 
#define BU_HASH_ENTRY_INIT_ZERO   { BU_HASH_ENTRY_MAGIC, NULL, NULL, 0, NULL }
 
#define BU_HASH_ENTRY_IS_INITIALIZED(_h)   (((struct bu_hash_entry *)(_h) != BU_HASH_ENTRY_NULL) && LIKELY((_h)->magic == BU_HASH_ENTRY_MAGIC))
 
#define BU_HASH_TBL_NULL   ((struct bu_hash_tbl *)0)
 
#define BU_CK_HASH_TBL(_hp)   BU_CKMAG(_hp, BU_HASH_TBL_MAGIC, "bu_hash_tbl")
 
#define BU_HASH_TBL_INIT(_h)
 
#define BU_HASH_TBL_INIT_ZERO   { BU_HASH_TBL_MAGIC, 0, 0, 0, NULL }
 
#define BU_HASH_TBL_IS_INITIALIZED(_h)   (((struct bu_hash_tbl *)(_h) != BU_HASH_TBL_NULL) && LIKELY((_h)->magic == BU_HASH_TBL_MAGIC))
 
#define BU_HASH_RECORD_NULL   ((struct bu_hash_record *)0)
 
#define BU_CK_HASH_RECORD(_rp)   BU_CKMAG(_rp, BU_HASH_RECORD_MAGIC, "bu_hash_record")
 
#define BU_HASH_RECORD_INIT(_h)
 
#define BU_HASH_RECORD_INIT_ZERO   { BU_HASH_RECORD_MAGIC, NULL, 0, NULL }
 
#define BU_HASH_RECORD_IS_INITIALIZED(_h)   (((struct bu_hash_record *)(_h) != BU_HASH_RECORD_NULL) && LIKELY((_h)->magic == BU_HASH_RECORD_MAGIC))
 

Typedefs

typedef struct bu_hash_entry bu_hash_entry_t
 
typedef struct bu_hash_tbl bu_hash_tbl_t
 
typedef struct bu_hash_record bu_hash_record_t
 

Functions

unsigned long bu_hash (const unsigned char *str, int len)
 
struct bu_hash_tblbu_hash_tbl_create (unsigned long tbl_size)
 
struct bu_hash_entrybu_hash_tbl_find (const struct bu_hash_tbl *hsh_tbl, const unsigned char *key, int key_len, struct bu_hash_entry **prev, unsigned long *idx)
 
void bu_set_hash_value (struct bu_hash_entry *hsh_entry, unsigned char *value)
 
unsigned char * bu_get_hash_value (const struct bu_hash_entry *hsh_entry)
 
unsigned char * bu_get_hash_key (const struct bu_hash_entry *hsh_entry)
 
struct bu_hash_entrybu_hash_tbl_add (struct bu_hash_tbl *hsh_tbl, const unsigned char *key, int key_len, int *new_entry)
 
void bu_hash_tbl_print (const struct bu_hash_tbl *hsh_tbl, const char *str)
 
void bu_hash_tbl_free (struct bu_hash_tbl *hsh_tbl)
 
struct bu_hash_entrybu_hash_tbl_first (const struct bu_hash_tbl *hsh_tbl, struct bu_hash_record *rec)
 
struct bu_hash_entrybu_hash_tbl_next (struct bu_hash_record *rec)
 
struct bu_hash_entrybu_hash_tbl_traverse (struct bu_hash_tbl *hsh_tbl, int(*func)(struct bu_hash_entry *, void *), void *func_arg)