new auxiliar function `luaH_setstr'
This commit is contained in:
10
ltable.c
10
ltable.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltable.c,v 1.43 2000/05/24 13:54:49 roberto Exp roberto $
|
||||
** $Id: ltable.c,v 1.44 2000/06/05 20:07:53 roberto Exp roberto $
|
||||
** Lua tables (hash)
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -278,6 +278,14 @@ void luaH_setint (lua_State *L, Hash *t, int key, const TObject *val) {
|
||||
}
|
||||
|
||||
|
||||
void luaH_setstr (lua_State *L, Hash *t, TString *key, const TObject *val) {
|
||||
TObject index;
|
||||
ttype(&index) = TAG_STRING;
|
||||
tsvalue(&index) = key;
|
||||
luaH_set(L, t, &index, val);
|
||||
}
|
||||
|
||||
|
||||
const TObject *luaH_getglobal (lua_State *L, const char *name) {
|
||||
return luaH_getstr(L->gt, luaS_new(L, name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user