diff options
| author | The Lua team <lua@tecgraf.puc-rio.br> | 1993-07-28 10:18:00 -0300 |
|---|---|---|
| committer | The Lua team <lua@tecgraf.puc-rio.br> | 1993-07-28 10:18:00 -0300 |
| commit | cd05d9c5cb69020c069f037ba7f243f705d0a48a (patch) | |
| tree | cb7f08c0684c10970a528984741047fb3babadd3 /hash.h | |
| download | lua-cd05d9c5cb69020c069f037ba7f243f705d0a48a.tar.gz lua-cd05d9c5cb69020c069f037ba7f243f705d0a48a.tar.bz2 lua-cd05d9c5cb69020c069f037ba7f243f705d0a48a.zip | |
oldest known commit
Diffstat (limited to 'hash.h')
| -rw-r--r-- | hash.h | 35 |
1 files changed, 35 insertions, 0 deletions
| @@ -0,0 +1,35 @@ | |||
| 1 | /* | ||
| 2 | ** hash.h | ||
| 3 | ** hash manager for lua | ||
| 4 | ** Luiz Henrique de Figueiredo - 17 Aug 90 | ||
| 5 | ** Modified by Waldemar Celes Filho | ||
| 6 | ** 26 Apr 93 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef hash_h | ||
| 10 | #define hash_h | ||
| 11 | |||
| 12 | typedef struct node | ||
| 13 | { | ||
| 14 | Object ref; | ||
| 15 | Object val; | ||
| 16 | struct node *next; | ||
| 17 | } Node; | ||
| 18 | |||
| 19 | typedef struct Hash | ||
| 20 | { | ||
| 21 | char mark; | ||
| 22 | unsigned int nhash; | ||
| 23 | Node **list; | ||
| 24 | } Hash; | ||
| 25 | |||
| 26 | #define markarray(t) ((t)->mark) | ||
| 27 | |||
| 28 | Hash *lua_hashcreate (unsigned int nhash); | ||
| 29 | void lua_hashdelete (Hash *h); | ||
| 30 | Object *lua_hashdefine (Hash *t, Object *ref); | ||
| 31 | void lua_hashmark (Hash *h); | ||
| 32 | |||
| 33 | void lua_next (void); | ||
| 34 | |||
| 35 | #endif | ||
