rlm@1: /* rlm@1: ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ rlm@1: ** String table (keep all strings handled by Lua) rlm@1: ** See Copyright Notice in lua.h rlm@1: */ rlm@1: rlm@1: #ifndef lstring_h rlm@1: #define lstring_h rlm@1: rlm@1: rlm@1: #include "lgc.h" rlm@1: #include "lobject.h" rlm@1: #include "lstate.h" rlm@1: rlm@1: rlm@1: #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) rlm@1: rlm@1: #define sizeudata(u) (sizeof(union Udata)+(u)->len) rlm@1: rlm@1: #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) rlm@1: #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ rlm@1: (sizeof(s)/sizeof(char))-1)) rlm@1: rlm@1: #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) rlm@1: rlm@1: LUAI_FUNC void luaS_resize (lua_State *L, int newsize); rlm@1: LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); rlm@1: LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); rlm@1: rlm@1: rlm@1: #endif