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
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

htable.h File Reference
#include "general.h"
#include <stdint.h>
Include dependency graph for htable.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HT_PTR_TO_INT(P)   ((int)(intptr_t)(P))
 
#define HT_INT_TO_PTR(P)   ((void*)(intptr_t)(P))
 
#define HT_PTR_TO_UINT(P)   ((unsigned int)(uintptr_t)(P))
 
#define HT_UINT_TO_PTR(P)   ((void*)(uintptr_t)(P))
 

Typedefs

typedef struct sHashTable hashTable
 
typedef unsigned int(* hashTableHashFunc) (const void *const key)
 
typedef bool(* hashTableEqualFunc) (const void *a, const void *b)
 
typedef void(* hashTableFreeFunc) (void *ptr)
 
typedef bool(* hashTableForeachFunc) (const void *key, void *value, void *user_data)
 

Functions

unsigned int hashPtrhash (const void *x)
 
bool hashPtreq (const void *a, const void *constb)
 
unsigned int hashCstrhash (const void *x)
 
bool hashCstreq (const void *a, const void *b)
 
unsigned int hashCstrcasehash (const void *x)
 
bool hashCstrcaseeq (const void *a, const void *b)
 
unsigned int hashInthash (const void *x)
 
bool hashInteq (const void *a, const void *b)
 
hashTablehashTableNew (unsigned int size, hashTableHashFunc hashfn, hashTableEqualFunc equalfn, hashTableFreeFunc keyfreefn, hashTableFreeFunc valfreefn)
 
void hashTableDelete (hashTable *htable)
 
void hashTableClear (hashTable *htable)
 
void hashTablePutItem (hashTable *htable, void *key, void *value)
 
void * hashTableGetItem (hashTable *htable, const void *key)
 
bool hashTableHasItem (hashTable *htable, const void *key)
 
bool hashTableDeleteItem (hashTable *htable, const void *key)
 
bool hashTableForeachItem (hashTable *htable, hashTableForeachFunc proc, void *user_data)
 
bool hashTableForeachItemOnChain (hashTable *htable, const void *key, hashTableForeachFunc proc, void *user_data)
 
int hashTableCountItem (hashTable *htable)
 
hashTablehashTableIntNew (unsigned int size, hashTableHashFunc hashfn, hashTableEqualFunc equalfn, hashTableFreeFunc keyfreefn)
 

Macro Definition Documentation

◆ HT_INT_TO_PTR

#define HT_INT_TO_PTR (   P)    ((void*)(intptr_t)(P))

Definition at line 84 of file htable.h.

◆ HT_PTR_TO_INT

#define HT_PTR_TO_INT (   P)    ((int)(intptr_t)(P))

Definition at line 83 of file htable.h.

◆ HT_PTR_TO_UINT

#define HT_PTR_TO_UINT (   P)    ((unsigned int)(uintptr_t)(P))

Definition at line 85 of file htable.h.

◆ HT_UINT_TO_PTR

#define HT_UINT_TO_PTR (   P)    ((void*)(uintptr_t)(P))

Definition at line 86 of file htable.h.

Typedef Documentation

◆ hashTable

typedef struct sHashTable hashTable

Definition at line 30 of file htable.h.

◆ hashTableEqualFunc

typedef bool(* hashTableEqualFunc) (const void *a, const void *b)

Definition at line 32 of file htable.h.

◆ hashTableForeachFunc

typedef bool(* hashTableForeachFunc) (const void *key, void *value, void *user_data)

Definition at line 37 of file htable.h.

◆ hashTableFreeFunc

typedef void(* hashTableFreeFunc) (void *ptr)

Definition at line 33 of file htable.h.

◆ hashTableHashFunc

typedef unsigned int(* hashTableHashFunc) (const void *const key)

Definition at line 31 of file htable.h.

Function Documentation

◆ hashCstrcaseeq()

bool hashCstrcaseeq ( const void *  a,
const void *  b 
)

Definition at line 354 of file htable.c.

References strcasecmp.

Referenced by initializeParsing().

◆ hashCstrcasehash()

unsigned int hashCstrcasehash ( const void *  x)

Definition at line 348 of file htable.c.

References casedjb2().

Referenced by initializeParsing().

◆ hashCstreq()

bool hashCstreq ( const void *  a,
const void *  b 
)

Definition at line 322 of file htable.c.

◆ hashCstrhash()

unsigned int hashCstrhash ( const void *  x)

Definition at line 316 of file htable.c.

References djb2().

◆ hashInteq()

bool hashInteq ( const void *  a,
const void *  b 
)

Definition at line 339 of file htable.c.

◆ hashInthash()

unsigned int hashInthash ( const void *  x)

Definition at line 327 of file htable.c.

◆ hashPtreq()

bool hashPtreq ( const void *  a,
const void *  constb 
)

Definition at line 280 of file htable.c.

◆ hashPtrhash()

unsigned int hashPtrhash ( const void *  x)

Definition at line 268 of file htable.c.

References ptr.

◆ hashTableClear()

void hashTableClear ( hashTable htable)

◆ hashTableCountItem()

int hashTableCountItem ( hashTable htable)

Definition at line 261 of file htable.c.

References count(), and hashTableForeachItem().

◆ hashTableDelete()

void hashTableDelete ( hashTable htable)

Definition at line 159 of file htable.c.

References eFree(), hashTableClear(), and sHashTable::table.

Referenced by initializeParsing().

◆ hashTableDeleteItem()

bool hashTableDeleteItem ( hashTable htable,
const void *  key 
)

◆ hashTableForeachItem()

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

◆ hashTableForeachItemOnChain()

bool hashTableForeachItemOnChain ( hashTable htable,
const void *  key,
hashTableForeachFunc  proc,
void *  user_data 
)

◆ hashTableGetItem()

void * hashTableGetItem ( hashTable htable,
const void *  key 
)

◆ hashTableHasItem()

bool hashTableHasItem ( hashTable htable,
const void *  key 
)

Definition at line 211 of file htable.c.

References hashTableGetItem().

◆ hashTableIntNew()

hashTable * hashTableIntNew ( unsigned int  size,
hashTableHashFunc  hashfn,
hashTableEqualFunc  equalfn,
hashTableFreeFunc  keyfreefn 
)

Definition at line 151 of file htable.c.

References hashTableNew(), and NULL.

◆ hashTableNew()

hashTable * hashTableNew ( unsigned int  size,
hashTableHashFunc  hashfn,
hashTableEqualFunc  equalfn,
hashTableFreeFunc  keyfreefn,
hashTableFreeFunc  valfreefn 
)

◆ hashTablePutItem()

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