Expand file tree
/
Copy pathlstring.h
More file actions
Latest commit
57 lines (42 loc) · 1.57 KB
/
Copy pathlstring.h
File metadata and controls
57 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
** $Id: lstring.h $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
#ifndeflstring_h
#definelstring_h
#include"lgc.h"
#include"lobject.h"
#include"lstate.h"
/*
** Memory-allocation error message must be preallocated (it cannot
** be created after memory is exhausted)
*/
#defineMEMERRMSG "not enough memory"
/*
** Size of a TString: Size of the header plus space for the string
** itself (including final '\0').
*/
#definesizelstring(l) (offsetof(TString, contents) + ((l) + 1) * sizeof(char))
#defineluaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
/*
** test whether a string is a reserved word
*/
#defineisreserved(s) ((s)->tt == LUA_VSHRSTR && (s)->extra > 0)
/*
** equality for short strings, which are always internalized
*/
#defineeqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b))
LUAI_FUNC unsignedintluaS_hash (constchar*str, size_tl, unsigned intseed);
LUAI_FUNC unsignedintluaS_hashlongstr (TString*ts);
LUAI_FUNCintluaS_eqlngstr (TString*a, TString*b);
LUAI_FUNCvoidluaS_resize (lua_State*L, intnewsize);
LUAI_FUNCvoidluaS_clearcache (global_State*g);
LUAI_FUNCvoidluaS_init (lua_State*L);
LUAI_FUNCvoidluaS_remove (lua_State*L, TString*ts);
LUAI_FUNCUdata*luaS_newudata (lua_State*L, size_ts, intnuvalue);
LUAI_FUNCTString*luaS_newlstr (lua_State*L, constchar*str, size_tl);
LUAI_FUNCTString*luaS_new (lua_State*L, constchar*str);
LUAI_FUNCTString*luaS_createlngstrobj (lua_State*L, size_tl);
#endif