rpm
4.5
|
00001 /* 00002 ** $Id: lstring.h,v 1.1 2004/03/16 21:58:30 niemeyer Exp $ 00003 ** String table (keep all strings handled by Lua) 00004 ** See Copyright Notice in lua.h 00005 */ 00006 00007 #ifndef lstring_h 00008 #define lstring_h 00009 00010 00011 #include "lobject.h" 00012 #include "lstate.h" 00013 00014 00015 00016 #define sizestring(l) (cast(lu_mem, sizeof(union TString))+ \ 00017 (cast(lu_mem, l)+1)*sizeof(char)) 00018 00019 #define sizeudata(l) (cast(lu_mem, sizeof(union Udata))+(l)) 00020 00021 #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) 00022 #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 00023 (sizeof(s)/sizeof(char))-1)) 00024 00025 #define luaS_fix(s) ((s)->tsv.marked |= (1<<4)) 00026 00027 void luaS_resize (lua_State *L, int newsize) 00028 /*@modifies L @*/; 00029 /*@null@*/ 00030 Udata *luaS_newudata (lua_State *L, size_t s) 00031 /*@modifies L @*/; 00032 void luaS_freeall (lua_State *L) 00033 /*@modifies L @*/; 00034 /*@null@*/ 00035 TString *luaS_newlstr (lua_State *L, /*@null@*/ const char *str, size_t l) 00036 /*@modifies L @*/; 00037 00038 00039 #endif