diff options
Diffstat (limited to 'lstring.h')
-rw-r--r-- | lstring.h | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -25,15 +25,18 @@ | |||
25 | /* | 25 | /* |
26 | ** test whether a string is a reserved word | 26 | ** test whether a string is a reserved word |
27 | */ | 27 | */ |
28 | #define isreserved(s) ((s)->tsv.extra > 0) | 28 | #define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0) |
29 | 29 | ||
30 | 30 | ||
31 | /* | 31 | /* |
32 | ** equality for strings, which are always internalized | 32 | ** equality for short strings, which are always internalized |
33 | */ | 33 | */ |
34 | #define luaS_eqstr(a,b) ((a) == (b)) | 34 | #define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b)) |
35 | 35 | ||
36 | 36 | ||
37 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l); | ||
38 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); | ||
39 | LUAI_FUNC int luaS_eqstr (TString *a, TString *b); | ||
37 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); | 40 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); |
38 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); | 41 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); |
39 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); | 42 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); |