Imported from ../lua-5.0.3.tar.gz.
[lua.git] / src / lstring.h
blobbe5a1e3767a01c88dc30aec47099fba2724fd93a
1 /*
2 ** $Id: lstring.h,v 1.37 2002/08/16 14:45:55 roberto Exp $
3 ** String table (keep all strings handled by Lua)
4 ** See Copyright Notice in lua.h
5 */
7 #ifndef lstring_h
8 #define lstring_h
11 #include "lobject.h"
12 #include "lstate.h"
16 #define sizestring(l) (cast(lu_mem, sizeof(union TString))+ \
17 (cast(lu_mem, l)+1)*sizeof(char))
19 #define sizeudata(l) (cast(lu_mem, sizeof(union Udata))+(l))
21 #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
22 #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
23 (sizeof(s)/sizeof(char))-1))
25 #define luaS_fix(s) ((s)->tsv.marked |= (1<<4))
27 void luaS_resize (lua_State *L, int newsize);
28 Udata *luaS_newudata (lua_State *L, size_t s);
29 void luaS_freeall (lua_State *L);
30 TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
33 #endif