misc/liblua/lstring.h
changeset 10017 de822cd3df3a
parent 2812 0a24853de796
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    11 #include "lgc.h"
    11 #include "lgc.h"
    12 #include "lobject.h"
    12 #include "lobject.h"
    13 #include "lstate.h"
    13 #include "lstate.h"
    14 
    14 
    15 
    15 
    16 #define sizestring(s)	(sizeof(union TString)+((s)->len+1)*sizeof(char))
    16 #define sizestring(s)   (sizeof(union TString)+((s)->len+1)*sizeof(char))
    17 
    17 
    18 #define sizeudata(u)	(sizeof(union Udata)+(u)->len)
    18 #define sizeudata(u)    (sizeof(union Udata)+(u)->len)
    19 
    19 
    20 #define luaS_new(L, s)	(luaS_newlstr(L, s, strlen(s)))
    20 #define luaS_new(L, s)  (luaS_newlstr(L, s, strlen(s)))
    21 #define luaS_newliteral(L, s)	(luaS_newlstr(L, "" s, \
    21 #define luaS_newliteral(L, s)   (luaS_newlstr(L, "" s, \
    22                                  (sizeof(s)/sizeof(char))-1))
    22                                  (sizeof(s)/sizeof(char))-1))
    23 
    23 
    24 #define luaS_fix(s)	l_setbit((s)->tsv.marked, FIXEDBIT)
    24 #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
    25 
    25 
    26 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
    26 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
    27 LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
    27 LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
    28 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
    28 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
    29 
    29