The qDecoder Project

_Q_HASHTBL Struct Reference

Structure for hash-table data structure. More...


Data Fields

Q_LOCK_T qlock
int max
int num
int threshold
int resizeat
int * count
int * hash
Q_NOBJ_Tobj
void(* lock )(Q_HASHTBL *tbl)
void(* unlock )(Q_HASHTBL *tbl)
bool(* put )(Q_HASHTBL *tbl, const char *name, const void *data, size_t size)
bool(* putStr )(Q_HASHTBL *tbl, const char *name, const char *str)
bool(* putInt )(Q_HASHTBL *tbl, const char *name, int num)
void *(* get )(Q_HASHTBL *tbl, const char *name, size_t *size, bool newmem)
char *(* getStr )(Q_HASHTBL *tbl, const char *name, bool newmem)
int(* getInt )(Q_HASHTBL *tbl, const char *name)
bool(* getNext )(Q_HASHTBL *tbl, Q_NOBJ_T *obj, int *idx, bool newmem)
bool(* remove )(Q_HASHTBL *tbl, const char *name)
int(* getNum )(Q_HASHTBL *tbl)
int(* getMax )(Q_HASHTBL *tbl)
bool(* resize )(Q_HASHTBL *tbl, int max)
bool(* truncate )(Q_HASHTBL *tbl)
bool(* print )(Q_HASHTBL *tbl, FILE *out, bool print_data)
bool(* free )(Q_HASHTBL *tbl)


Detailed Description

Structure for hash-table data structure.


Field Documentation

Q_LOCK_T _Q_HASHTBL::qlock

only used if compiled with --enable-threadsafe option

int _Q_HASHTBL::max

maximum hashtable size

int _Q_HASHTBL::num

used slot counter

int _Q_HASHTBL::threshold

if the percent of used slot counter exceeds this threshold percent, new larger table(max * _Q_HASHTBL_RESIZE_MAG) is allocated

int _Q_HASHTBL::resizeat

calculated used amount = (max * threshold) / 100

int* _Q_HASHTBL::count

hash collision counter. 0 indicate empty slot, -1 is used for moved slot due to hash collision

int* _Q_HASHTBL::hash

key hash. we use qHashFnv32() to generate hash integer


The documentation for this struct was generated from the following file:

Copyright (c) 2008 The qDecoder Project