Classes | Defines | Typedefs | Functions

jshash.h File Reference

#include <stddef.h>
#include <stdio.h>
#include "jstypes.h"
#include "jscompat.h"
Include dependency graph for jshash.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  JSHashAllocOps
struct  JSHashEntry
struct  JSHashTable

Defines

#define JS_HASH_BITS   32
#define JS_GOLDEN_RATIO   0x9E3779B9U
#define HT_ENUMERATE_NEXT   0
#define HT_ENUMERATE_STOP   1
#define HT_ENUMERATE_REMOVE   2
#define HT_FREE_VALUE   0
#define HT_FREE_ENTRY   1

Typedefs

typedef uint32 JSHashNumber
typedef struct JSHashEntry JSHashEntry
typedef struct JSHashTable JSHashTable
typedef JSHashNumber(* JSHashFunction )(const void *key)
typedef intN(* JSHashComparator )(const void *v1, const void *v2)
typedef intN(* JSHashEnumerator )(JSHashEntry *he, intN i, void *arg)
typedef struct JSHashAllocOps JSHashAllocOps

Functions

JSHashTableJS_NewHashTable (uint32 n, JSHashFunction keyHash, JSHashComparator keyCompare, JSHashComparator valueCompare, JSHashAllocOps *allocOps, void *allocPool)
void JS_HashTableDestroy (JSHashTable *ht)
JSHashEntry ** JS_HashTableRawLookup (JSHashTable *ht, JSHashNumber keyHash, const void *key)
void JS_HashTableRawRemove (JSHashTable *ht, JSHashEntry **hep, JSHashEntry *he)
JSHashEntryJS_HashTableAdd (JSHashTable *ht, const void *key, void *value)
JSBool JS_HashTableRemove (JSHashTable *ht, const void *key)
intN JS_HashTableEnumerateEntries (JSHashTable *ht, JSHashEnumerator f, void *arg)
void * JS_HashTableLookup (JSHashTable *ht, const void *key)
intN JS_HashTableDump (JSHashTable *ht, JSHashEnumerator dump, FILE *fp)
JSHashNumber JS_HashString (const void *key)
intN JS_CompareValues (const void *v1, const void *v2)

Define Documentation

#define HT_ENUMERATE_NEXT   0
#define HT_ENUMERATE_REMOVE   2
#define HT_ENUMERATE_STOP   1
#define HT_FREE_ENTRY   1
#define HT_FREE_VALUE   0
#define JS_GOLDEN_RATIO   0x9E3779B9U
#define JS_HASH_BITS   32

Typedef Documentation

typedef intN(* JSHashComparator)(const void *v1, const void *v2)
typedef struct JSHashEntry JSHashEntry
typedef intN(* JSHashEnumerator)(JSHashEntry *he, intN i, void *arg)
typedef JSHashNumber(* JSHashFunction)(const void *key)
typedef struct JSHashTable JSHashTable

Function Documentation

intN JS_CompareValues ( const void *  v1,
const void *  v2 
)
JSHashNumber JS_HashString ( const void *  key  ) 
JSHashEntry* JS_HashTableAdd ( JSHashTable ht,
const void *  key,
void *  value 
)
void JS_HashTableDestroy ( JSHashTable ht  ) 
intN JS_HashTableDump ( JSHashTable ht,
JSHashEnumerator  dump,
FILE *  fp 
)
intN JS_HashTableEnumerateEntries ( JSHashTable ht,
JSHashEnumerator  f,
void *  arg 
)
void* JS_HashTableLookup ( JSHashTable ht,
const void *  key 
)
JSHashEntry** JS_HashTableRawLookup ( JSHashTable ht,
JSHashNumber  keyHash,
const void *  key 
)
void JS_HashTableRawRemove ( JSHashTable ht,
JSHashEntry **  hep,
JSHashEntry he 
)
JSBool JS_HashTableRemove ( JSHashTable ht,
const void *  key 
)
JSHashTable* JS_NewHashTable ( uint32  n,
JSHashFunction  keyHash,
JSHashComparator  keyCompare,
JSHashComparator  valueCompare,
JSHashAllocOps allocOps,
void *  allocPool 
)