aboutsummaryrefslogtreecommitdiff
path: root/lstring.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-01-25 19:05:40 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-01-25 19:05:40 -0200
commita4b96ce9a3305ae3585c0bb143fa7342c140f20b (patch)
treefbb635282c4b72dde25e5c9ffb2bc6d314419d05 /lstring.h
parent291f564485d8968fc7b0d043dda5ff91a7ce604b (diff)
downloadlua-a4b96ce9a3305ae3585c0bb143fa7342c140f20b.tar.gz
lua-a4b96ce9a3305ae3585c0bb143fa7342c140f20b.tar.bz2
lua-a4b96ce9a3305ae3585c0bb143fa7342c140f20b.zip
first implementation of long strings
Diffstat (limited to 'lstring.h')
-rw-r--r--lstring.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lstring.h b/lstring.h
index 462bcc87..6cfcbfcc 100644
--- a/lstring.h
+++ b/lstring.h
@@ -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
37LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l);
38LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b);
39LUAI_FUNC int luaS_eqstr (TString *a, TString *b);
37LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 40LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
38LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); 41LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
39LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 42LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);