The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lstring.h
Go to the documentation of this file.
1 /*
2 ** String table (keep all strings handled by Lua)
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef lstring_h
7 #define lstring_h
8 
9 #include "lgc.h"
10 #include "lobject.h"
11 #include "lstate.h"
12 
13 
14 #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
15 
16 #define sizeudata(u) (sizeof(union Udata)+(u)->len)
17 
18 #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
19  (sizeof(s)/sizeof(char))-1))
20 
21 #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
22 
23 
24 /*
25 ** test whether a string is a reserved word
26 */
27 #define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0)
28 
29 
30 /*
31 ** equality for short strings, which are always internalized
32 */
33 #define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b))
34 
35 
36 LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed);
39 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
41 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
42 LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
43 
44 
45 #endif
LUAI_FUNC unsigned int luaS_hash(const char *str, size_t l, unsigned int seed)
Definition: lstring.cpp:50
LUAI_FUNC int luaS_eqstr(TString *a, TString *b)
Definition: lstring.cpp:44
Definition: lobject.h:559
#define LUAI_FUNC
Definition: luaconf.h:187
Definition: lobject.h:430
LUAI_FUNC TString * luaS_new(lua_State *L, const char *str)
Definition: lstring.cpp:169
LUAI_FUNC Udata * luaS_newudata(lua_State *L, size_t s, Table *e)
Definition: lstring.cpp:174
LUAI_FUNC TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
Definition: lstring.cpp:155
GLdouble l
Definition: glew.h:6966
GLdouble GLdouble GLdouble b
Definition: glew.h:6966
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:7319
LUAI_FUNC void luaS_resize(lua_State *L, int newsize)
Definition: lstring.cpp:63
LUAI_FUNC int luaS_eqlngstr(TString *a, TString *b)
Definition: lstring.cpp:32
#define e
GLdouble s
Definition: glew.h:1358