diff options
author | Lua Team <team@lua.org> | 2012-03-21 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2012-03-21 12:00:00 +0000 |
commit | 1cb937cf2d4583482aadaff45b6628b39fdcd91e (patch) | |
tree | 614eba453350c41305e41d647e9e03d779314f89 /src/lstring.h | |
parent | 6ee889a587f9b600b564d5c0ba0350faab0387cd (diff) | |
download | lua-github-5.2.1-work1.tar.gz |
Lua 5.2.1-work15.2.1-work1
Diffstat (limited to 'src/lstring.h')
-rw-r--r-- | src/lstring.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lstring.h b/src/lstring.h index d708a1b0..d312ff3d 100644 --- a/src/lstring.h +++ b/src/lstring.h @@ -1,5 +1,5 @@ /* -** $Id: lstring.h,v 1.46 2010/04/05 16:26:37 roberto Exp $ +** $Id: lstring.h,v 1.49 2012/02/01 21:57:15 roberto Exp $ ** String table (keep all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -23,11 +23,20 @@ /* -** as all string are internalized, string equality becomes -** pointer equality +** test whether a string is a reserved word */ -#define eqstr(a,b) ((a) == (b)) +#define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0) + +/* +** equality for short strings, which are always internalized +*/ +#define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b)) + + +LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); +LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); +LUAI_FUNC int luaS_eqstr (TString *a, TString *b); LUAI_FUNC void luaS_resize (lua_State *L, int newsize); LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); |