doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
hash.c File Reference
#include "setup.h"
#include <string.h>
#include <stdlib.h>
#include "hash.h"
#include "llist.h"

Go to the source code of this file.

Macros

#define find_slot(__h, __k, __k_len)   (hash_str(__k, __k_len) % (__h)->slots)
 
#define FETCH_LIST(x, y, z)   x->table[find_slot(x, y, z)]
 

Functions

int Curl_hash_init (curl_hash *h, int slots, curl_hash_dtor dtor)
 
curl_hashCurl_hash_alloc (int slots, curl_hash_dtor dtor)
 
voidCurl_hash_add (curl_hash *h, char *key, size_t key_len, void *p)
 
voidCurl_hash_pick (curl_hash *h, char *key, size_t key_len)
 
void Curl_hash_clean (curl_hash *h)
 
void Curl_hash_clean_with_criterium (curl_hash *h, void *user, int(*comp)(void *, void *))
 
void Curl_hash_destroy (curl_hash *h)
 

Macro Definition Documentation

#define FETCH_LIST (   x,
  y,
  z 
)    x->table[find_slot(x, y, z)]

Definition at line 139 of file hash.c.

#define find_slot (   __h,
  __k,
  __k_len 
)    (hash_str(__k, __k_len) % (__h)->slots)

Definition at line 137 of file hash.c.

Function Documentation

void* Curl_hash_add ( curl_hash h,
char *  key,
size_t  key_len,
void p 
)

Definition at line 144 of file hash.c.

curl_hash* Curl_hash_alloc ( int  slots,
curl_hash_dtor  dtor 
)

Definition at line 95 of file hash.c.

void Curl_hash_clean ( curl_hash h)

Definition at line 233 of file hash.c.

void Curl_hash_clean_with_criterium ( curl_hash h,
void user,
int(*)(void *, void *)  comp 
)

Definition at line 245 of file hash.c.

void Curl_hash_destroy ( curl_hash h)

Definition at line 278 of file hash.c.

int Curl_hash_init ( curl_hash h,
int  slots,
curl_hash_dtor  dtor 
)

Definition at line 69 of file hash.c.

void* Curl_hash_pick ( curl_hash h,
char *  key,
size_t  key_len 
)

Definition at line 195 of file hash.c.