diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-01-25 15:40:10 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-01-25 15:40:10 -0200 |
| commit | 57ffc3f0094978fd2eb7ec2883cf6fca28145e90 (patch) | |
| tree | 9d1cdd44c071d9ead18cd4849e9d309682efe1ae | |
| parent | 4a13f513f8070003019eec0afc566608e436212b (diff) | |
| download | lua-57ffc3f0094978fd2eb7ec2883cf6fca28145e90.tar.gz lua-57ffc3f0094978fd2eb7ec2883cf6fca28145e90.tar.bz2 lua-57ffc3f0094978fd2eb7ec2883cf6fca28145e90.zip | |
luaH_set does the set, and protects its value, so luaH_move can be a
macro.
| -rw-r--r-- | ltable.h | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.h,v 1.8 1999/01/04 12:54:33 roberto Exp roberto $ | 2 | ** $Id: ltable.h,v 1.9 1999/01/25 12:30:11 roberto Exp roberto $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -16,15 +16,15 @@ | |||
| 16 | #define nhash(t) ((t)->nhash) | 16 | #define nhash(t) ((t)->nhash) |
| 17 | 17 | ||
| 18 | #define luaH_get(t,ref) (val(luaH_present((t), (ref)))) | 18 | #define luaH_get(t,ref) (val(luaH_present((t), (ref)))) |
| 19 | #define luaH_move(t,from,to) (luaH_setint(t, to, luaH_getint(t, from))) | ||
| 19 | 20 | ||
| 20 | Hash *luaH_new (int nhash); | 21 | Hash *luaH_new (int nhash); |
| 21 | void luaH_free (Hash *frees); | 22 | void luaH_free (Hash *frees); |
| 22 | Node *luaH_present (Hash *t, TObject *ref); | 23 | Node *luaH_present (Hash *t, TObject *key); |
| 23 | TObject *luaH_set (Hash *t, TObject *ref); | 24 | void luaH_set (Hash *t, TObject *ref, TObject *val); |
| 24 | Node *luaH_next (Hash *t, TObject *r); | 25 | Node *luaH_next (Hash *t, TObject *r); |
| 25 | void luaH_setint (Hash *t, int ref, TObject *val); | 26 | void luaH_setint (Hash *t, int ref, TObject *val); |
| 26 | TObject *luaH_getint (Hash *t, int ref); | 27 | TObject *luaH_getint (Hash *t, int ref); |
| 27 | void luaH_move (Hash *t, int from, int to); | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | #endif | 30 | #endif |
