/*************************************************************************\ * Copyright (c) 2002 The University of Chicago, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * EPICS BASE Versions 3.13.7 * and higher are distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* dbHash.h */ /* share/epicsH dbHash.h,v 1.6.2.1 2004/03/29 19:35:58 evans Exp */ /* Author: Marty Kraimer Date: 04-07-94 */ /**************** Modifications for dbHash ******************************/ /*----------------------------------------------------------------------------- Mod: (newest to oldest) 29-OCT-2004, DROGIND: Copied $EPICS_BASE/src/libCom/gphash/gpHash* to dbHash* Added include of freeList.h Changed GPHENTRY structure name to dbhEntry_ts removed void * pvtid from dbhEntry_ts struct Added: NENTRIES defines how many entries can be placed into hash table DBDICTSIZE defines the hash table size DD-MMM-YYYY, Your Name: More changes ... The ordering of the revision history should be such that the NEWEST changes are at the HEAD of the list. =============================================================================*/ /* dbh provides a general purpose directory accessed via a hash table*/ #ifndef INCdbHashh #define INCdbHashh 1 #define NENTRIES 1024 /* # of dbhash entries in hash table */ #define DBDICTSIZE 4096 /* tablesize - power of 2 - see below */ #include "shareLib.h" #include "ellLib.h" #include "freeList.h" typedef enum { /* enumeration of slc threads */ prim,primUnitSecn } dbhKind_te; typedef struct{ ELLNODE node; const char *name; /*address of name placed in directory*/ /*removed pvtid- private name for subsystem user*/ void *usrPvt; /*private for user*/ dbhKind_te kind_e; /*kind of hash entry (prim only, or PUS) */ } dbhEntry_ts; #ifdef __cplusplus extern "C" { #endif /*tableSize must be power of 2 in range 256 to 65536*/ void dbhInitPvt(void **pvt_pps,int tableSize); dbhEntry_ts * dbhFind(void *pvt_ps,const char *name_p, const size_t namelen); dbhEntry_ts * dbhAdd(void *pvt_ps,const char *name_p, const size_t namelen); void dbhDelete(void *pvt_ps,const char *name_p, const size_t namelen); void dbhFreeMem(void *pvt_ps); void dbhDump(void *pvt_ps); void dbhDumpFP(FILE *fp,void *pvt_ps); #ifdef __cplusplus } #endif #endif /*INCdbHashh*/