diff options
| -rw-r--r-- | ltable.c | 12 | ||||
| -rw-r--r-- | ltable.h | 3 |
2 files changed, 13 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 1.15 1998/08/11 16:38:34 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.16 1998/12/30 13:14:46 roberto Exp $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -223,3 +223,13 @@ TObject *luaH_getint (Hash *t, int ref) { | |||
| 223 | return luaH_get(t, &index); | 223 | return luaH_get(t, &index); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | |||
| 227 | void luaH_move (Hash *t, int from, int to) { | ||
| 228 | TObject index; | ||
| 229 | TObject *toadd; | ||
| 230 | ttype(&index) = LUA_T_NUMBER; | ||
| 231 | nvalue(&index) = to; | ||
| 232 | toadd = luaH_set(t, &index); | ||
| 233 | nvalue(&index) = from; | ||
| 234 | *toadd = *luaH_get(t, &index); | ||
| 235 | } | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.h,v 1.6 1998/07/12 16:15:19 roberto Exp roberto $ | 2 | ** $Id: ltable.h,v 1.7 1998/12/30 13:14:46 roberto Exp $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -22,6 +22,7 @@ TObject *luaH_set (Hash *t, TObject *ref); | |||
| 22 | Node *luaH_next (Hash *t, TObject *r); | 22 | Node *luaH_next (Hash *t, TObject *r); |
| 23 | void luaH_setint (Hash *t, int ref, TObject *val); | 23 | void luaH_setint (Hash *t, int ref, TObject *val); |
| 24 | TObject *luaH_getint (Hash *t, int ref); | 24 | TObject *luaH_getint (Hash *t, int ref); |
| 25 | void luaH_move (Hash *t, int from, int to); | ||
| 25 | 26 | ||
| 26 | 27 | ||
| 27 | #endif | 28 | #endif |
