summaryrefslogtreecommitdiffstats
path: root/lua/lstring.h
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@mailme.dk>2012-07-15 01:06:01 +0200
committerEmil Renner Berthing <esmil@mailme.dk>2012-07-23 17:36:24 +0200
commit78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe (patch)
treed9e476dfee06bf8ba6dcf4499fb78ce1350728fe /lua/lstring.h
parent3a1c6f4e205c8c6d28abc641e568f2fa6362c654 (diff)
downloadlem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.tar.gz
lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.tar.xz
lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.zip
Lua 5.2.1
Diffstat (limited to 'lua/lstring.h')
-rw-r--r--lua/lstring.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/lua/lstring.h b/lua/lstring.h
index d708a1b..d312ff3 100644
--- a/lua/lstring.h
+++ b/lua/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);