1997-09-16 16:25:59 -03:00
|
|
|
/*
|
2005-02-23 14:30:22 -03:00
|
|
|
** $Id: lstring.h,v 1.41 2005/02/18 12:40:02 roberto Exp roberto $
|
1997-09-16 16:25:59 -03:00
|
|
|
** String table (keep all strings handled by Lua)
|
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef lstring_h
|
|
|
|
#define lstring_h
|
|
|
|
|
|
|
|
|
2003-11-17 17:50:05 -02:00
|
|
|
#include "lgc.h"
|
1997-09-16 16:25:59 -03:00
|
|
|
#include "lobject.h"
|
1999-10-14 17:13:31 -02:00
|
|
|
#include "lstate.h"
|
1997-09-16 16:25:59 -03:00
|
|
|
|
1997-11-04 13:27:53 -02:00
|
|
|
|
2004-11-19 13:52:40 -02:00
|
|
|
#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
|
2000-05-10 13:33:20 -03:00
|
|
|
|
2004-11-19 13:52:40 -02:00
|
|
|
#define sizeudata(u) (sizeof(union Udata)+(u)->len)
|
2000-12-28 10:55:41 -02:00
|
|
|
|
2001-01-10 15:41:50 -02:00
|
|
|
#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
|
2001-11-28 18:13:13 -02:00
|
|
|
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
|
|
|
|
(sizeof(s)/sizeof(char))-1))
|
2000-05-10 13:33:20 -03:00
|
|
|
|
2005-02-23 14:30:22 -03:00
|
|
|
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
|
2002-04-30 10:01:48 -03:00
|
|
|
|
2001-06-06 15:00:19 -03:00
|
|
|
void luaS_resize (lua_State *L, int newsize);
|
2005-02-18 10:40:02 -02:00
|
|
|
Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
|
2001-11-28 18:13:13 -02:00
|
|
|
TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
|
1997-12-01 18:31:25 -02:00
|
|
|
|
1997-09-16 16:25:59 -03:00
|
|
|
|
|
|
|
#endif
|