- Main Page
- Classes
- Files

# lstring.h

Go to the documentation of this file.

    00001 /*
    00002 ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 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
    00011 #include "lgc.h"
    00012 #include "lobject.h"
    00013 #include "lstate.h"
    00014
    00015
    00016 #define sizestring(s)   (sizeof(union TString)+((s)->len+1)*sizeof(char))
    00017
    00018 #define sizeudata(u)    (sizeof(union Udata)+(u)->len)
    00019
    00020 #define luaS_new(L, s)  (luaS_newlstr(L, s, strlen(s)))
    00021 #define luaS_newliteral(L, s)   (luaS_newlstr(L, "" s, \
    00022                                  (sizeof(s)/sizeof(char))-1))
    00023
    00024 #define luaS_fix(s)     l_setbit((s)->tsv.marked, FIXEDBIT)
    00025
    00026 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
    00027 LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
    00028 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
    00029
    00030
    00031 #endif