Move the job of converting provided coeffects to ambient coeffects from callee to...
[hiphop-php.git] / hphp / neo / neo_hash.h
blobf5fc0a23bc0adf1bfe215b29b72db4fe0954d8ca
1 /*
2 * Copyright 2001-2004 Brandon Long
3 * All Rights Reserved.
5 * ClearSilver Templating System
7 * This code is made available under the terms of the ClearSilver License.
8 * http://www.clearsilver.net/license.hdf
12 #ifndef incl_HPHP_NEO_HASH_H_
13 #define incl_HPHP_NEO_HASH_H_ 1
15 __BEGIN_DECLS
17 #include <stdlib.h>
18 #include "hphp/neo/neo_misc.h"
20 typedef UINT32 (*NE_HASH_FUNC)(const void *);
21 typedef int (*NE_COMP_FUNC)(const void *, const void *);
23 typedef struct _NE_HASHNODE
25 void *key;
26 void *value;
27 UINT32 hashv;
28 struct _NE_HASHNODE *next;
29 } NE_HASHNODE;
31 typedef struct _HASH
33 UINT32 size;
34 UINT32 num;
36 NE_HASHNODE **nodes;
37 NE_HASH_FUNC hash_func;
38 NE_COMP_FUNC comp_func;
39 } NE_HASH;
41 NEOERR *ne_hash_init (NE_HASH **hash, NE_HASH_FUNC hash_func, NE_COMP_FUNC comp_func);
42 void ne_hash_destroy (NE_HASH **hash);
43 NEOERR *ne_hash_insert(NE_HASH *hash, void *key, void *value);
44 void *ne_hash_lookup(NE_HASH *hash, void *key);
45 void *ne_hash_remove(NE_HASH *hash, void *key);
47 __END_DECLS
49 #endif /* incl_HPHP_NEO_HASH_H_ */