rpm  4.5
lstring.h
Go to the documentation of this file.
1 /*
2 ** $Id: lstring.h,v 1.1 2004/03/16 21:58:30 niemeyer 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 
11 #include "lobject.h"
12 #include "lstate.h"
13 
14 
15 
16 #define sizestring(l) (cast(lu_mem, sizeof(union TString))+ \
17  (cast(lu_mem, l)+1)*sizeof(char))
18 
19 #define sizeudata(l) (cast(lu_mem, sizeof(union Udata))+(l))
20 
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))
24 
25 #define luaS_fix(s) ((s)->tsv.marked |= (1<<4))
26 
27 void luaS_resize (lua_State *L, int newsize)
28  /*@modifies L @*/;
29 /*@null@*/
30 Udata *luaS_newudata (lua_State *L, size_t s)
31  /*@modifies L @*/;
32 void luaS_freeall (lua_State *L)
33  /*@modifies L @*/;
34 /*@null@*/
35 TString *luaS_newlstr (lua_State *L, /*@null@*/ const char *str, size_t l)
36  /*@modifies L @*/;
37 
38 
39 #endif