summaryrefslogtreecommitdiff
path: root/ltable.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-01-25 15:40:10 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-01-25 15:40:10 -0200
commit57ffc3f0094978fd2eb7ec2883cf6fca28145e90 (patch)
tree9d1cdd44c071d9ead18cd4849e9d309682efe1ae /ltable.h
parent4a13f513f8070003019eec0afc566608e436212b (diff)
downloadlua-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.
Diffstat (limited to 'ltable.h')
-rw-r--r--ltable.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltable.h b/ltable.h
index e03f9d5c..766bda16 100644
--- a/ltable.h
+++ b/ltable.h
@@ -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
20Hash *luaH_new (int nhash); 21Hash *luaH_new (int nhash);
21void luaH_free (Hash *frees); 22void luaH_free (Hash *frees);
22Node *luaH_present (Hash *t, TObject *ref); 23Node *luaH_present (Hash *t, TObject *key);
23TObject *luaH_set (Hash *t, TObject *ref); 24void luaH_set (Hash *t, TObject *ref, TObject *val);
24Node *luaH_next (Hash *t, TObject *r); 25Node *luaH_next (Hash *t, TObject *r);
25void luaH_setint (Hash *t, int ref, TObject *val); 26void luaH_setint (Hash *t, int ref, TObject *val);
26TObject *luaH_getint (Hash *t, int ref); 27TObject *luaH_getint (Hash *t, int ref);
27void luaH_move (Hash *t, int from, int to);
28 28
29 29
30#endif 30#endif