geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "general.h"
#include "htable.h"
#include <stdio.h>
#include "routines.h"
#include <string.h>
Go to the source code of this file.
Classes | |
struct | sHashEntry |
struct | sHashTable |
struct | chainTracker |
Typedefs | |
typedef struct sHashEntry | hentry |
Functions | |
static hentry * | entry_new (void *key, void *value, hentry *next) |
static hentry * | entry_destroy (hentry *entry, hashTableFreeFunc keyfreefn, hashTableFreeFunc valfreefn) |
static void | entry_reclaim (hentry *entry, hashTableFreeFunc keyfreefn, hashTableFreeFunc valfreefn) |
static void * | entry_find (hentry *entry, const void *const key, hashTableEqualFunc equalfn) |
static bool | entry_delete (hentry **entry, const void *key, hashTableEqualFunc equalfn, hashTableFreeFunc keyfreefn, hashTableFreeFunc valfreefn) |
static bool | entry_foreach (hentry *entry, hashTableForeachFunc proc, void *user_data) |
hashTable * | hashTableNew (unsigned int size, hashTableHashFunc hashfn, hashTableEqualFunc equalfn, hashTableFreeFunc keyfreefn, hashTableFreeFunc valfreefn) |
hashTable * | hashTableIntNew (unsigned int size, hashTableHashFunc hashfn, hashTableEqualFunc equalfn, hashTableFreeFunc keyfreefn) |
void | hashTableDelete (hashTable *htable) |
void | hashTableClear (hashTable *htable) |
void | hashTablePutItem (hashTable *htable, void *key, void *value) |
void * | hashTableGetItem (hashTable *htable, const void *key) |
bool | hashTableDeleteItem (hashTable *htable, const void *key) |
bool | hashTableHasItem (hashTable *htable, const void *key) |
bool | hashTableForeachItem (hashTable *htable, hashTableForeachFunc proc, void *user_data) |
static bool | track_chain (const void *const key, void *value, void *chain_data) |
bool | hashTableForeachItemOnChain (hashTable *htable, const void *key, hashTableForeachFunc proc, void *user_data) |
static bool | count (const void *const key, void *value, void *data) |
int | hashTableCountItem (hashTable *htable) |
unsigned int | hashPtrhash (const void *const x) |
bool | hashPtreq (const void *const a, const void *const b) |
static unsigned long | djb2 (const unsigned char *str) |
static unsigned long | casedjb2 (const unsigned char *str) |
unsigned int | hashCstrhash (const void *const x) |
bool | hashCstreq (const void *const a, const void *const b) |
unsigned int | hashInthash (const void *const x) |
bool | hashInteq (const void *const a, const void *const b) |
unsigned int | hashCstrcasehash (const void *const x) |
bool | hashCstrcaseeq (const void *const a, const void *const b) |
typedef struct sHashEntry hentry |
|
static |
Definition at line 300 of file htable.c.
Referenced by hashCstrcasehash().
|
static |
Definition at line 254 of file htable.c.
Referenced by hashTableCountItem().
|
static |
Definition at line 288 of file htable.c.
Referenced by hashCstrhash().
|
static |
Definition at line 105 of file htable.c.
References entry, and entry_destroy().
Referenced by hashTableDeleteItem().
|
static |
Definition at line 68 of file htable.c.
References eFree(), entry, and NULL.
Referenced by entry_delete(), and entry_reclaim().
|
static |
Definition at line 94 of file htable.c.
Referenced by hashTableGetItem().
|
static |
Definition at line 120 of file htable.c.
References entry.
Referenced by hashTableForeachItem(), and hashTableForeachItemOnChain().
Definition at line 57 of file htable.c.
References entry, and xMalloc.
Referenced by hashTablePutItem().
|
static |
Definition at line 86 of file htable.c.
References entry, and entry_destroy().
Referenced by hashTableClear().
bool hashCstrcaseeq | ( | const void *const | a, |
const void *const | b | ||
) |
unsigned int hashCstrcasehash | ( | const void *const | x | ) |
bool hashCstreq | ( | const void *const | a, |
const void *const | b | ||
) |
unsigned int hashCstrhash | ( | const void *const | x | ) |
bool hashInteq | ( | const void *const | a, |
const void *const | b | ||
) |
bool hashPtreq | ( | const void *const | a, |
const void *const | b | ||
) |
unsigned int hashPtrhash | ( | const void *const | x | ) |
void hashTableClear | ( | hashTable * | htable | ) |
Definition at line 170 of file htable.c.
References entry, entry_reclaim(), sHashTable::keyfreefn, NULL, sHashTable::size, sHashTable::table, and sHashTable::valfreefn.
Referenced by hashTableDelete().
int hashTableCountItem | ( | hashTable * | htable | ) |
Definition at line 261 of file htable.c.
References count(), and hashTableForeachItem().
void hashTableDelete | ( | hashTable * | htable | ) |
Definition at line 159 of file htable.c.
References eFree(), hashTableClear(), and sHashTable::table.
Referenced by initializeParsing().
bool hashTableDeleteItem | ( | hashTable * | htable, |
const void * | key | ||
) |
Definition at line 202 of file htable.c.
References entry_delete(), sHashTable::equalfn, sHashTable::hashfn, sHashTable::keyfreefn, sHashTable::size, sHashTable::table, and sHashTable::valfreefn.
bool hashTableForeachItem | ( | hashTable * | htable, |
hashTableForeachFunc | proc, | ||
void * | user_data | ||
) |
Definition at line 216 of file htable.c.
References entry_foreach(), sHashTable::size, and sHashTable::table.
Referenced by hashTableCountItem().
bool hashTableForeachItemOnChain | ( | hashTable * | htable, |
const void * | key, | ||
hashTableForeachFunc | proc, | ||
void * | user_data | ||
) |
Definition at line 238 of file htable.c.
References entry_foreach(), sHashTable::equalfn, sHashTable::hashfn, sHashTable::size, sHashTable::table, chainTracker::target_key, track_chain(), and chainTracker::user_data.
void * hashTableGetItem | ( | hashTable * | htable, |
const void * | key | ||
) |
Definition at line 194 of file htable.c.
References entry_find(), sHashTable::equalfn, sHashTable::hashfn, sHashTable::size, and sHashTable::table.
Referenced by getNamedLanguageFull(), and hashTableHasItem().
bool hashTableHasItem | ( | hashTable * | htable, |
const void * | key | ||
) |
Definition at line 211 of file htable.c.
References hashTableGetItem().
hashTable * hashTableIntNew | ( | unsigned int | size, |
hashTableHashFunc | hashfn, | ||
hashTableEqualFunc | equalfn, | ||
hashTableFreeFunc | keyfreefn | ||
) |
Definition at line 151 of file htable.c.
References hashTableNew(), and NULL.
hashTable * hashTableNew | ( | unsigned int | size, |
hashTableHashFunc | hashfn, | ||
hashTableEqualFunc | equalfn, | ||
hashTableFreeFunc | keyfreefn, | ||
hashTableFreeFunc | valfreefn | ||
) |
Definition at line 131 of file htable.c.
References sHashTable::equalfn, sHashTable::hashfn, sHashTable::keyfreefn, sHashTable::size, sHashTable::table, sHashTable::valfreefn, xCalloc, and xMalloc.
Referenced by hashTableIntNew(), and initializeParsing().
void hashTablePutItem | ( | hashTable * | htable, |
void * | key, | ||
void * | value | ||
) |
Definition at line 186 of file htable.c.
References entry_new(), sHashTable::hashfn, sHashTable::size, and sHashTable::table.
Referenced by initializeParsingCommon().
|
static |
Definition at line 226 of file htable.c.
References chainTracker::equalfn, chainTracker::target_key, chainTracker::user_data, and chainTracker::user_proc.
Referenced by hashTableForeachItemOnChain().