Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Hash_impl
diff PrivateHash.h @ 1:5900d90f5d71
Works -- fixed some minor bugs -- VMSHW_matrix_mult working
| author | Me |
|---|---|
| date | Wed, 28 Jul 2010 13:14:54 -0700 |
| parents | ee3ad252427e |
| children | 7c4d2bf121a9 |
line diff
1.1 --- a/PrivateHash.h Sat May 22 19:49:28 2010 -0700 1.2 +++ b/PrivateHash.h Wed Jul 28 13:14:54 2010 -0700 1.3 @@ -8,12 +8,13 @@ 1.4 #ifndef _PRIVATE_HASH_H 1.5 #define _PRIVATE_HASH_H 1.6 1.7 +#include "../VMS_primitive_data_types.h" 1.8 1.9 #define TRUE 1 1.10 #define FALSE 0 1.11 1.12 1.13 -#define HASHSIZE 101 1.14 +#define DEFAULT_HASHSIZE 1 << 10 1.15 1.16 typedef struct _HashEntry HashEntry; 1.17 1.18 @@ -34,27 +35,30 @@ 1.19 } 1.20 HashTable; 1.21 1.22 -//=========================================================================== 1.23 -// Internal functions 1.24 -void freeHashEntryUsing( HashEntry *entry, HashTable *table ); 1.25 -char* strdup_m(char *o); 1.26 -unsigned int hashThisKey( char *s, int hashSz ); 1.27 -void nullOutTablesArray( HashTable *table ); 1.28 -void *getEntryFromTable( char *key, HashTable *table ); 1.29 -void doubleTableSize( HashTable *table ); 1.30 -void addEntryToTable( HashEntry *entry, HashTable *table ); 1.31 1.32 //=========================================================================== 1.33 // Public functions 1.34 HashTable *makeHashTable( int numHashSlots, FreeEntryContentFnPtr freeFn ); 1.35 1.36 +int putEntryIntoTable( HashEntry *entry, HashTable *table); 1.37 +int addValueIntoTable( char* key, void *value, HashTable *table); 1.38 +HashEntry *getEntryFromTable( char *key, HashTable *table ); 1.39 void *getValueFromTable( char *key, HashTable *table ); 1.40 + 1.41 bool8 deleteEntryFromTable( char *key, HashTable *table ); 1.42 +bool8 deleteThisEntryFromTable( HashEntry *entry, HashTable *table ); 1.43 bool8 deleteEntrysValueInTable( char *key, HashTable *table ); 1.44 +bool8 deleteEntryFromTableAndFreeValue( char *key, HashTable *table ); 1.45 +void freeHashTable( HashTable *table ); 1.46 +//char *paramBagToString( ParamBag * bag ) 1.47 1.48 -int addToTable( char* key, void *content, HashTable *table ); 1.49 -void freeTable( HashTable *table ); 1.50 -//char *paramBagToString( ParamBag * bag ) 1.51 +//=========================================================================== 1.52 +// Internal functions 1.53 +void freeHashEntryUsing( HashEntry *entry, HashTable *table ); 1.54 +unsigned int hashThisKey( char *s, int hashSz ); 1.55 +void nullOutTablesArray( HashTable *table ); 1.56 +void doubleTableSize( HashTable *table ); 1.57 +void freeHashEntryButNotContent( HashEntry *entry ); 1.58 1.59 #endif /* _PRIVATE_HASH_H */ 1.60
