diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-01-25 19:05:40 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-01-25 19:05:40 -0200 |
commit | a4b96ce9a3305ae3585c0bb143fa7342c140f20b (patch) | |
tree | fbb635282c4b72dde25e5c9ffb2bc6d314419d05 /lstring.h | |
parent | 291f564485d8968fc7b0d043dda5ff91a7ce604b (diff) | |
download | lua-a4b96ce9a3305ae3585c0bb143fa7342c140f20b.tar.gz lua-a4b96ce9a3305ae3585c0bb143fa7342c140f20b.tar.bz2 lua-a4b96ce9a3305ae3585c0bb143fa7342c140f20b.zip |
first implementation of long strings
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); |