Classes | Defines | Typedefs | Functions

plhash.h File Reference

#include <stdio.h>
#include "prtypes.h"
Include dependency graph for plhash.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  PLHashAllocOps
struct  PLHashEntry
struct  PLHashTable

Defines

#define PL_HASH_BITS   32
#define HT_ENUMERATE_NEXT   0
#define HT_ENUMERATE_STOP   1
#define HT_ENUMERATE_REMOVE   2
#define HT_ENUMERATE_UNHASH   4
#define HT_FREE_VALUE   0
#define HT_FREE_ENTRY   1

Typedefs

typedef struct PLHashEntry PLHashEntry
typedef struct PLHashTable PLHashTable
typedef PRUint32 PLHashNumber
typedef PLHashNumber(* PLHashFunction )(const void *key)
typedef PRIntn(* PLHashComparator )(const void *v1, const void *v2)
typedef PRIntn(* PLHashEnumerator )(PLHashEntry *he, PRIntn i, void *arg)
typedef struct PLHashAllocOps PLHashAllocOps

Functions

PLHashTablePL_NewHashTable (PRUint32 numBuckets, PLHashFunction keyHash, PLHashComparator keyCompare, PLHashComparator valueCompare, const PLHashAllocOps *allocOps, void *allocPriv)
void PL_HashTableDestroy (PLHashTable *ht)
PLHashEntryPL_HashTableAdd (PLHashTable *ht, const void *key, void *value)
PRBool PL_HashTableRemove (PLHashTable *ht, const void *key)
void * PL_HashTableLookup (PLHashTable *ht, const void *key)
void * PL_HashTableLookupConst (PLHashTable *ht, const void *key)
PRIntn PL_HashTableEnumerateEntries (PLHashTable *ht, PLHashEnumerator f, void *arg)
PLHashNumber PL_HashString (const void *key)
PRIntn PL_CompareStrings (const void *v1, const void *v2)
PRIntn PL_CompareValues (const void *v1, const void *v2)
PLHashEntry ** PL_HashTableRawLookup (PLHashTable *ht, PLHashNumber keyHash, const void *key)
PLHashEntry ** PL_HashTableRawLookupConst (PLHashTable *ht, PLHashNumber keyHash, const void *key)
PLHashEntryPL_HashTableRawAdd (PLHashTable *ht, PLHashEntry **hep, PLHashNumber keyHash, const void *key, void *value)
void PL_HashTableRawRemove (PLHashTable *ht, PLHashEntry **hep, PLHashEntry *he)
PRIntn PL_HashTableDump (PLHashTable *ht, PLHashEnumerator dump, FILE *fp)

Define Documentation

#define HT_ENUMERATE_NEXT   0
#define HT_ENUMERATE_REMOVE   2
#define HT_ENUMERATE_STOP   1
#define HT_ENUMERATE_UNHASH   4
#define HT_FREE_ENTRY   1
#define HT_FREE_VALUE   0
#define PL_HASH_BITS   32

Typedef Documentation

typedef PRIntn( * PLHashComparator)(const void *v1, const void *v2)
typedef struct PLHashEntry PLHashEntry
typedef PRIntn( * PLHashEnumerator)(PLHashEntry *he, PRIntn i, void *arg)
typedef PLHashNumber( * PLHashFunction)(const void *key)
typedef PRUint32 PLHashNumber
typedef struct PLHashTable PLHashTable

Function Documentation

PRIntn PL_CompareStrings ( const void *  v1,
const void *  v2 
)
PRIntn PL_CompareValues ( const void *  v1,
const void *  v2 
)
PLHashNumber PL_HashString ( const void *  key  ) 
PLHashEntry* PL_HashTableAdd ( PLHashTable ht,
const void *  key,
void *  value 
)
void PL_HashTableDestroy ( PLHashTable ht  ) 
PRIntn PL_HashTableDump ( PLHashTable ht,
PLHashEnumerator  dump,
FILE *  fp 
)
PRIntn PL_HashTableEnumerateEntries ( PLHashTable ht,
PLHashEnumerator  f,
void *  arg 
)
void* PL_HashTableLookup ( PLHashTable ht,
const void *  key 
)
void* PL_HashTableLookupConst ( PLHashTable ht,
const void *  key 
)
PLHashEntry* PL_HashTableRawAdd ( PLHashTable ht,
PLHashEntry **  hep,
PLHashNumber  keyHash,
const void *  key,
void *  value 
)
PLHashEntry** PL_HashTableRawLookup ( PLHashTable ht,
PLHashNumber  keyHash,
const void *  key 
)
PLHashEntry** PL_HashTableRawLookupConst ( PLHashTable ht,
PLHashNumber  keyHash,
const void *  key 
)
void PL_HashTableRawRemove ( PLHashTable ht,
PLHashEntry **  hep,
PLHashEntry he 
)
PRBool PL_HashTableRemove ( PLHashTable ht,
const void *  key 
)
PLHashTable* PL_NewHashTable ( PRUint32  numBuckets,
PLHashFunction  keyHash,
PLHashComparator  keyCompare,
PLHashComparator  valueCompare,
const PLHashAllocOps allocOps,
void *  allocPriv 
)