46 static bool allocated =
false;
68 entry = table [hashedValue];
76 unsigned int h = 5381;
81 for (p = (
const signed char *)
string; *p !=
'\0'; p++)
82 h = (h << 5) + h + tolower (*p);
125 strcmp (
string,
entry->string) == 0)
149 ((caseSensitive && strcmp (
string,
entry->string) == 0) ||
152 result =
entry->value;
198static unsigned int printBucket (
const unsigned int i)
202 unsigned int measure = 1;
219 measure = 2 * measure;
224extern void printKeywordTable (
void)
226 unsigned long emptyBucketCount = 0;
227 unsigned long measure = 0;
232 const unsigned int pass = printBucket (i);
239 printf (
"spread measure = %ld\n", measure);
240 printf (
"%ld empty buckets\n", emptyBucketCount);
263 for (
int i = 0; groupdef->
keywords[i]; i++)
#define strcasecmp(s1, s2)
struct sHashEntry hashEntry
static hashEntry ** getHashTable(void)
int lookupCaseKeyword(const char *const string, langType language)
void addKeyword(const char *const string, langType language, int value)
static hashEntry * getHashTableEntry(unsigned long hashedValue)
static unsigned int hashValue(const char *const string, langType language)
static hashEntry ** HashTable
static int lookupKeywordFull(const char *const string, bool caseSensitive, langType language)
void addKeywordGroup(const struct keywordGroup *const groupdef, langType language)
static const unsigned int TableSize
static hashEntry * newEntry(const char *const string, langType language, int value)
int lookupKeyword(const char *const string, langType language)
void freeKeywordTable(void)
void dumpKeywordTable(FILE *fp)
const char * getLanguageName(const langType language)
void eFree(void *const ptr)
bool addingUnlessExisting