PageRenderTime 27ms CodeModel.GetById 13ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/visualizations/Goom/goom2k4-0/src/goomsl_hash.h

http://github.com/xbmc/xbmc
C++ Header | 40 lines | 30 code | 10 blank | 0 comment | 0 complexity | a9c6bf0ad095a7996c93545bd7fe5fb2 MD5 | raw file
 1#ifndef _GOOMSL_HASH_H
 2#define _GOOMSL_HASH_H
 3
 4typedef struct GOOM_HASH_ENTRY GoomHashEntry;
 5typedef struct GOOM_HASH GoomHash;
 6
 7typedef union {
 8    void *ptr;
 9    int   i;
10    float f;
11} HashValue;
12
13struct GOOM_HASH_ENTRY {
14	char          *key;
15  HashValue      value;
16	GoomHashEntry *lower;
17	GoomHashEntry *upper;
18};
19
20struct GOOM_HASH {
21	GoomHashEntry *root;
22  int number_of_puts;
23};
24
25GoomHash *goom_hash_new();
26void      goom_hash_free(GoomHash *gh);
27
28void goom_hash_put(GoomHash *gh, const char *key, HashValue value);
29HashValue *goom_hash_get(GoomHash *gh, const char *key);
30
31void goom_hash_put_int  (GoomHash *_this, const char *key, int i);
32void goom_hash_put_float(GoomHash *_this, const char *key, float f);
33void goom_hash_put_ptr  (GoomHash *_this, const char *key, void *ptr);
34
35typedef void (*GH_Func)(GoomHash *caller, const char *key, HashValue *value);
36
37void goom_hash_for_each(GoomHash *_this, GH_Func func);
38int goom_hash_number_of_puts(GoomHash *_this);
39
40#endif /* _GOOM_HASH_H */