diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-03 13:47:30 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-03 13:47:30 -0200 |
commit | 46de77b219e381ff8553fdba0f52b319c00ea1e1 (patch) | |
tree | 3b703e4df3dd2b69f0f768153fc75d2336d98bdb /ltable.h | |
parent | d356183402e214f4859cd6508964d4b5e781c598 (diff) | |
download | lua-46de77b219e381ff8553fdba0f52b319c00ea1e1.tar.gz lua-46de77b219e381ff8553fdba0f52b319c00ea1e1.tar.bz2 lua-46de77b219e381ff8553fdba0f52b319c00ea1e1.zip |
bug: despite its name, 'luaH_getstr' did not work for strings in
general, but only for short strings
Diffstat (limited to 'ltable.h')
-rw-r--r-- | ltable.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.h,v 2.19 2014/07/29 16:22:24 roberto Exp roberto $ | 2 | ** $Id: ltable.h,v 2.20 2014/09/04 18:15:29 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 | */ |
@@ -18,6 +18,10 @@ | |||
18 | /* 'const' to avoid wrong writings that can mess up field 'next' */ | 18 | /* 'const' to avoid wrong writings that can mess up field 'next' */ |
19 | #define gkey(n) cast(const TValue*, (&(n)->i_key.tvk)) | 19 | #define gkey(n) cast(const TValue*, (&(n)->i_key.tvk)) |
20 | 20 | ||
21 | /* | ||
22 | ** writable version of 'gkey'; allows updates to individual fields, | ||
23 | ** but not to the whole (which has incompatible type) | ||
24 | */ | ||
21 | #define wgkey(n) (&(n)->i_key.nk) | 25 | #define wgkey(n) (&(n)->i_key.nk) |
22 | 26 | ||
23 | #define invalidateTMcache(t) ((t)->flags = 0) | 27 | #define invalidateTMcache(t) ((t)->flags = 0) |
@@ -31,6 +35,7 @@ | |||
31 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); | 35 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); |
32 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, | 36 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, |
33 | TValue *value); | 37 | TValue *value); |
38 | LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); | ||
34 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); | 39 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); |
35 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); | 40 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); |
36 | LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); | 41 | LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); |