annotate src/lua/lstring.h @ 359:8c474d1d6956
script: got leomnades and TM13, shopping is complete.
author |
Robert McIntyre <rlm@mit.edu> |
date |
Mon, 09 Apr 2012 08:27:45 -0500 |
parents |
27763b933818 |
children |
|
rev |
line source |
rlm@1
|
1 /*
|
rlm@1
|
2 ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
|
rlm@1
|
3 ** String table (keep all strings handled by Lua)
|
rlm@1
|
4 ** See Copyright Notice in lua.h
|
rlm@1
|
5 */
|
rlm@1
|
6
|
rlm@1
|
7 #ifndef lstring_h
|
rlm@1
|
8 #define lstring_h
|
rlm@1
|
9
|
rlm@1
|
10
|
rlm@1
|
11 #include "lgc.h"
|
rlm@1
|
12 #include "lobject.h"
|
rlm@1
|
13 #include "lstate.h"
|
rlm@1
|
14
|
rlm@1
|
15
|
rlm@1
|
16 #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
|
rlm@1
|
17
|
rlm@1
|
18 #define sizeudata(u) (sizeof(union Udata)+(u)->len)
|
rlm@1
|
19
|
rlm@1
|
20 #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
|
rlm@1
|
21 #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
|
rlm@1
|
22 (sizeof(s)/sizeof(char))-1))
|
rlm@1
|
23
|
rlm@1
|
24 #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
|
rlm@1
|
25
|
rlm@1
|
26 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
|
rlm@1
|
27 LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
|
rlm@1
|
28 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
|
rlm@1
|
29
|
rlm@1
|
30
|
rlm@1
|
31 #endif
|