doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hash.h
Go to the documentation of this file.
1 #ifndef __HASH_H
2 #define __HASH_H
3 /***************************************************************************
4  * _ _ ____ _
5  * Project ___| | | | _ \| |
6  * / __| | | | |_) | |
7  * | (__| |_| | _ <| |___
8  * \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * $Id: hash.h,v 1.15 2004/01/07 09:19:35 bagder Exp $
24  ***************************************************************************/
25 
26 #include "setup.h"
27 
28 #include <stddef.h>
29 
30 #include "llist.h"
31 
32 typedef void (*curl_hash_dtor)(void *);
33 
34 typedef struct _curl_hash {
37  int slots;
38  size_t size;
39 } curl_hash;
40 
41 typedef struct _curl_hash_element {
42  void *ptr;
43  char *key;
44  size_t key_len;
46 
47 
50 void *Curl_hash_add(curl_hash *, char *, size_t, void *);
51 int Curl_hash_delete(curl_hash *h, char *key, size_t key_len);
52 void *Curl_hash_pick(curl_hash *, char *, size_t);
53 void Curl_hash_apply(curl_hash *h, void *user,
54  void (*cb)(void *user, void *ptr));
56 void Curl_hash_clean(curl_hash *h);
57 void Curl_hash_clean_with_criterium(curl_hash *h, void *user, int (*comp)(void *, void *));
59 
60 #endif
void Curl_hash_apply(curl_hash *h, void *user, void(*cb)(void *user, void *ptr))
size_t key_len
Definition: hash.h:44
void Curl_hash_destroy(curl_hash *h)
Definition: hash.c:278
int Curl_hash_delete(curl_hash *h, char *key, size_t key_len)
curl_llist ** table
Definition: hash.h:35
void Curl_hash_clean_with_criterium(curl_hash *h, void *user, int(*comp)(void *, void *))
Definition: hash.c:245
struct _curl_hash curl_hash
int Curl_hash_count(curl_hash *h)
void * ptr
Definition: hash.h:42
size_t size
Definition: hash.h:38
char * key
Definition: hash.h:43
void * Curl_hash_add(curl_hash *, char *, size_t, void *)
Definition: hash.c:144
void Curl_hash_clean(curl_hash *h)
Definition: hash.c:233
int Curl_hash_init(curl_hash *, int, curl_hash_dtor)
Definition: hash.c:69
curl_hash_dtor dtor
Definition: hash.h:36
struct _curl_hash_element curl_hash_element
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
curl_hash * Curl_hash_alloc(int, curl_hash_dtor)
Definition: hash.c:95
int slots
Definition: hash.h:37
void * Curl_hash_pick(curl_hash *, char *, size_t)
Definition: hash.c:195
void(* curl_hash_dtor)(void *)
Definition: hash.h:32