Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

sfghash.h File Reference

#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "sfhashfcn.h"

Go to the source code of this file.

Defines

#define SFGHASH_NOMEM   -2
#define SFGHASH_ERR   -1
#define SFGHASH_OK   0
#define SFGHASH_INTABLE   1
#define GH_COPYKEYS   0
#define GH_USERKEYS   1

Typedefs

typedef _sfghash_node SFGHASH_NODE
typedef _sfghash SFGHASH
typedef _sfghash SFDICT

Functions

SFGHASHsfghash_new (int nrows, int keysize, int userkeys, void(*userfree)(void *p))
void sfghash_delete (SFGHASH *h)
int sfghash_add (SFGHASH *h, void *key, void *data)
int sfghash_remove (SFGHASH *h, void *key)
int sfghash_count (SFGHASH *h)
void * sfghash_find (SFGHASH *h, void *key)
SFGHASH_NODEsfghash_findfirst (SFGHASH *h)
SFGHASH_NODEsfghash_findnext (SFGHASH *h)
int sfatom_setsize (int n)
int sfatom_init ()
int sfatom_reset ()
int sfatom_add (char *str, void *data)
int sfatom_remove (char *str)
int sfatom_count ()
void * sfatom_find (char *str)
SFGHASH_NODEsfatom_findfirst ()
SFGHASH_NODEsfatom_findnext ()


Define Documentation

#define GH_COPYKEYS   0
 

Definition at line 31 of file sfghash.h.

Referenced by sfatom_init(), and sfdict_new().

#define GH_USERKEYS   1
 

Definition at line 32 of file sfghash.h.

#define SFGHASH_ERR   -1
 

Definition at line 24 of file sfghash.h.

Referenced by sfatom_add(), sfatom_init(), sfatom_reset(), and sfghash_remove().

#define SFGHASH_INTABLE   1
 

Definition at line 26 of file sfghash.h.

Referenced by sfghash_add().

#define SFGHASH_NOMEM   -2
 

Definition at line 23 of file sfghash.h.

Referenced by sfghash_add().

#define SFGHASH_OK   0
 

Definition at line 25 of file sfghash.h.

Referenced by sfatom_add(), sfatom_init(), sfatom_reset(), sfghash_add(), and sfghash_free_node().


Typedef Documentation

typedef struct _sfghash SFDICT
 

typedef struct _sfghash SFGHASH
 

typedef struct _sfghash_node SFGHASH_NODE
 


Function Documentation

int sfatom_add char *  str,
void *  data
 

Definition at line 700 of file sfghash.c.

References sfatom_init(), sfghash_add(), SFGHASH_ERR, and SFGHASH_OK.

int sfatom_count  ) 
 

Definition at line 736 of file sfghash.c.

References _sfghash::count.

void* sfatom_find char *  str  ) 
 

Definition at line 729 of file sfghash.c.

References sfghash_find().

SFGHASH_NODE* sfatom_findfirst  ) 
 

Definition at line 743 of file sfghash.c.

References NULL, and sfghash_findfirst().

SFGHASH_NODE* sfatom_findnext  ) 
 

Definition at line 754 of file sfghash.c.

References NULL, and sfghash_findnext().

int sfatom_init  ) 
 

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

int sfatom_remove char *  str  ) 
 

Definition at line 722 of file sfghash.c.

References sfghash_remove().

int sfatom_reset  ) 
 

Definition at line 684 of file sfghash.c.

References sfatom_init(), sfghash_delete(), SFGHASH_ERR, and SFGHASH_OK.

int sfatom_setsize int  n  ) 
 

Definition at line 657 of file sfghash.c.

int sfghash_add SFGHASH h,
void *  key,
void *  data
 

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

int sfghash_count SFGHASH h  ) 
 

Definition at line 225 of file sfghash.c.

References _sfghash::count.

void sfghash_delete SFGHASH h  ) 
 

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

void* sfghash_find SFGHASH h,
void *  key
 

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

SFGHASH_NODE* sfghash_findfirst SFGHASH h  ) 
 

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

SFGHASH_NODE* sfghash_findnext SFGHASH h  ) 
 

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

SFGHASH* sfghash_new int  nrows,
int  keysize,
int  userkeys,
void(*)(void *p)  userfree
 

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

int sfghash_remove SFGHASH h,
void *  key
 

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


Generated on Sun May 14 14:51:26 2006 by  doxygen 1.4.2