Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4680 | right-hear | 1 | /* |
2 | ** $Id: lstring.h,v 1.46 2010/04/05 16:26:37 roberto Exp $ |
||
3 | ** String table (keep all strings handled by Lua) |
||
4 | ** See Copyright Notice in lua.h |
||
5 | */ |
||
6 | |||
7 | #ifndef lstring_h |
||
8 | #define lstring_h |
||
9 | |||
10 | #include "lgc.h" |
||
11 | #include "lobject.h" |
||
12 | #include "lstate.h" |
||
13 | |||
14 | |||
15 | #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) |
||
16 | |||
17 | #define sizeudata(u) (sizeof(union Udata)+(u)->len) |
||
18 | |||
19 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ |
||
20 | (sizeof(s)/sizeof(char))-1)) |
||
21 | |||
22 | #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) |
||
23 | |||
24 | |||
25 | /* |
||
26 | ** as all string are internalized, string equality becomes |
||
27 | ** pointer equality |
||
28 | */ |
||
29 | #define eqstr(a,b) ((a) == (b)) |
||
30 | |||
31 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); |
||
32 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); |
||
33 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); |
||
34 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); |
||
35 | |||
36 | |||
37 | #endif |