aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-05 17:15:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-05 17:15:33 -0300
commit292c9530183a8e9939cff9a7d30fc50e85031698 (patch)
tree20dc1c90af03ef60396d6a8df737369fb8238f21 /ltable.c
parentc542aac0b935a65203244c130cdfa700113f0bc8 (diff)
downloadlua-292c9530183a8e9939cff9a7d30fc50e85031698.tar.gz
lua-292c9530183a8e9939cff9a7d30fc50e85031698.tar.bz2
lua-292c9530183a8e9939cff9a7d30fc50e85031698.zip
new auxiliar function `luaH_setstr'
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ltable.c b/ltable.c
index 9929146d..4ffd2f9d 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 1.43 2000/05/24 13:54:49 roberto Exp roberto $ 2** $Id: ltable.c,v 1.44 2000/06/05 20:07:53 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*/
@@ -278,6 +278,14 @@ void luaH_setint (lua_State *L, Hash *t, int key, const TObject *val) {
278} 278}
279 279
280 280
281void luaH_setstr (lua_State *L, Hash *t, TString *key, const TObject *val) {
282 TObject index;
283 ttype(&index) = TAG_STRING;
284 tsvalue(&index) = key;
285 luaH_set(L, t, &index, val);
286}
287
288
281const TObject *luaH_getglobal (lua_State *L, const char *name) { 289const TObject *luaH_getglobal (lua_State *L, const char *name) {
282 return luaH_getstr(L->gt, luaS_new(L, name)); 290 return luaH_getstr(L->gt, luaS_new(L, name));
283} 291}