#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include "sfghash.h"Go to the source code of this file.
Functions | |
| static void * | s_malloc (int n) |
| static void | s_free (void *p) |
| static int | isPrime (int num) |
| static int | calcNextPrime (int num) |
| SFGHASH * | sfghash_new (int nrows, int keysize, int userkeys, void(*userfree)(void *p)) |
| void | sfghash_splaymode (SFGHASH *t, int n) |
| SFDICT * | sfdict_new (int nitems) |
| void | sfdict_delete (SFDICT *h) |
| void | sfghash_delete (SFGHASH *h) |
| int | sfghash_count (SFGHASH *t) |
| int | sfdict_count (SFDICT *t) |
| int | sfghash_add (SFGHASH *t, void *key, void *data) |
| int | sfdict_add (SFGHASH *t, char *key, void *data) |
| static void | movetofront (SFGHASH *t, int index, SFGHASH_NODE *n) |
| static SFGHASH_NODE * | sfghash_find_node (SFGHASH *t, void *key) |
| void * | sfghash_find (SFGHASH *t, void *key) |
| static int | sfghash_free_node (SFGHASH *t, unsigned index, SFGHASH_NODE *hnode) |
| int | sfghash_remove (SFGHASH *t, void *key) |
| int | sfdict_remove (SFGHASH *t, char *key) |
| SFGHASH_NODE * | sfghash_findfirst1 (SFGHASH *t) |
| SFGHASH_NODE * | sfghash_findnext1 (SFGHASH *t) |
| static void | sfghash_next (SFGHASH *t) |
| SFGHASH_NODE * | sfghash_findfirst (SFGHASH *t) |
| SFGHASH_NODE * | sfghash_findnext (SFGHASH *t) |
| int | sfatom_setsize (int n) |
| int | sfatom_init () |
| int | sfatom_reset () |
| int | sfatom_add (char *str, void *data) |
| int | sfatom_remove (char *str) |
| void * | sfatom_find (char *str) |
| int | sfatom_count () |
| SFGHASH_NODE * | sfatom_findfirst () |
| SFGHASH_NODE * | sfatom_findnext () |
Variables | |
| static SFGHASH * | g_atom = 0 |
| static int | atom_first = 1 |
| static int | natoms = 1000 |
|
|
Definition at line 89 of file sfghash.c. References isPrime(). Referenced by sfghash_new(), sfhashfcn_new(), and sfxhash_new(). |
|
|
Definition at line 75 of file sfghash.c. Referenced by calcNextPrime(). |
|
||||||||||||||||
|
Definition at line 362 of file sfghash.c. References _sfghash_node::next, _sfghash_node::prev, and _sfghash::table. Referenced by sfghash_find_node(), and sfxhash_find_node_row(). |
|
|
|
|
|
|
|
||||||||||||
|
Definition at line 700 of file sfghash.c. References sfatom_init(), sfghash_add(), SFGHASH_ERR, and SFGHASH_OK. |
|
|
Definition at line 736 of file sfghash.c. References _sfghash::count. |
|
|
Definition at line 729 of file sfghash.c. References sfghash_find(). |
|
|
Definition at line 743 of file sfghash.c. References NULL, and sfghash_findfirst(). |
|
|
Definition at line 754 of file sfghash.c. References NULL, and sfghash_findnext(). |
|
|
Definition at line 665 of file sfghash.c. References GH_COPYKEYS, NULL, SFGHASH_ERR, sfghash_new(), and SFGHASH_OK. Referenced by sfatom_add(), and sfatom_reset(). |
|
|
Definition at line 722 of file sfghash.c. References sfghash_remove(). |
|
|
Definition at line 684 of file sfghash.c. References sfatom_init(), sfghash_delete(), SFGHASH_ERR, and SFGHASH_OK. |
|
|
|
|
||||||||||||||||
|
Definition at line 355 of file sfghash.c. References sfghash_add(). |
|
|
Definition at line 230 of file sfghash.c. References _sfghash::count. |
|
|
Definition at line 178 of file sfghash.c. References sfghash_delete(). |
|
|
Definition at line 173 of file sfghash.c. References GH_COPYKEYS, NULL, and sfghash_new(). |
|
||||||||||||
|
Definition at line 519 of file sfghash.c. References sfghash_remove(). |
|
||||||||||||||||
|
Definition at line 257 of file sfghash.c. References _sfghash::cnode, _sfghash::count, _sfghash_node::data, _SFHASHFCN::hash_fcn, index, _sfghash_node::key, _SFHASHFCN::keycmp_fcn, _sfghash::keysize, memcpy, _sfghash_node::next, _sfghash::nrows, _sfghash_node::prev, s_malloc(), SFGHASH_INTABLE, SFGHASH_NOMEM, SFGHASH_OK, _sfghash::sfhashfcn, _sfghash::table, and _sfghash::userkey. Referenced by FlowBitsParse(), sfatom_add(), sfdict_add(), and sfthd_create_threshold_local(). |
|
|
Definition at line 225 of file sfghash.c. References _sfghash::count. |
|
|
Definition at line 188 of file sfghash.c. References _sfghash_node::data, _sfghash_node::key, _sfghash_node::next, _sfghash::nrows, s_free(), _sfghash::sfhashfcn, sfhashfcn_free(), _sfghash::table, _sfghash::userfree, and _sfghash::userkey. Referenced by sfatom_reset(), and sfdict_delete(). |
|
||||||||||||
|
Definition at line 429 of file sfghash.c. References _sfghash_node::data, NULL, and sfghash_find_node(). Referenced by FlowBitsParse(), sfatom_find(), sfthd_create_threshold_local(), and sfthd_test_threshold(). |
|
||||||||||||
|
Definition at line 380 of file sfghash.c. References _SFHASHFCN::hash_fcn, index, _sfghash_node::key, _SFHASHFCN::keycmp_fcn, _sfghash::keysize, movetofront(), _sfghash_node::next, _sfghash::nrows, NULL, _sfghash::sfhashfcn, _sfghash::splay, and _sfghash::table. Referenced by sfghash_find(). |
|
|
Definition at line 595 of file sfghash.c. References _sfghash::cnode, _sfghash::crow, _sfghash::nrows, NULL, sfghash_next(), and _sfghash::table. Referenced by FlowBitsVerify(), print_thd_local(), sfatom_findfirst(), and sfthd_show_objects(). |
|
|
Definition at line 527 of file sfghash.c. References _sfghash::cnode, _sfghash::crow, _sfghash::nrows, NULL, and _sfghash::table. |
|
|
Definition at line 620 of file sfghash.c. References _sfghash::cnode, NULL, and sfghash_next(). Referenced by FlowBitsVerify(), print_thd_local(), sfatom_findnext(), and sfthd_show_objects(). |
|
|
Definition at line 543 of file sfghash.c. References _sfghash::cnode, _sfghash::crow, _sfghash_node::next, _sfghash::nrows, NULL, and _sfghash::table. |
|
||||||||||||||||
|
Definition at line 443 of file sfghash.c. References _sfghash::count, _sfghash_node::data, _sfghash_node::key, _sfghash_node::next, _sfghash_node::prev, s_free(), SFGHASH_OK, _sfghash::table, _sfghash::userfree, and _sfghash::userkey. Referenced by sfghash_remove(). |
|
||||||||||||||||||||
|
Definition at line 116 of file sfghash.c. References calcNextPrime(), _sfghash::cnode, _sfghash::count, _sfghash::crow, _sfghash::keysize, memset, _sfghash::nrows, s_malloc(), _sfghash::sfhashfcn, sfhashfcn_new(), _sfghash::table, _sfghash::userfree, and _sfghash::userkey. Referenced by SetupFlowBits(), sfatom_init(), sfdict_new(), and sfthd_create_threshold_local(). |
|
|
Definition at line 569 of file sfghash.c. References _sfghash::cnode, _sfghash::crow, _sfghash_node::next, _sfghash::nrows, and _sfghash::table. Referenced by sfghash_findfirst(), and sfghash_findnext(). |
|
||||||||||||
|
Definition at line 476 of file sfghash.c. References _SFHASHFCN::hash_fcn, index, _sfghash_node::key, _SFHASHFCN::keycmp_fcn, _sfghash::keysize, _sfghash_node::next, _sfghash::nrows, SFGHASH_ERR, sfghash_free_node(), _sfghash::sfhashfcn, and _sfghash::table. Referenced by sfatom_remove(), and sfdict_remove(). |
|
||||||||||||
|
Definition at line 167 of file sfghash.c. References _sfghash::splay. |
|
|
|
|
|
|
|
|
|
1.4.2