lua/lstring.h

Go to the documentation of this file.
00001 /*
00002 ** $Id: lstring.h,v 1.46 2010/04/05 16:26:37 roberto 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 #include "lgc.h"
00011 #include "lobject.h"
00012 #include "lstate.h"
00013 
00014 
00015 #define sizestring(s)   (sizeof(union TString)+((s)->len+1)*sizeof(char))
00016 
00017 #define sizeudata(u)    (sizeof(union Udata)+(u)->len)
00018 
00019 #define luaS_newliteral(L, s)   (luaS_newlstr(L, "" s, \
00020                                  (sizeof(s)/sizeof(char))-1))
00021 
00022 #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
00023 
00024 
00025 /*
00026 ** as all string are internalized, string equality becomes
00027 ** pointer equality
00028 */
00029 #define eqstr(a,b)  ((a) == (b))
00030 
00031 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
00032 LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
00033 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
00034 LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
00035 
00036 
00037 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:03:04 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs