aboutsummaryrefslogtreecommitdiff
path: root/lstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.h')
-rw-r--r--lstring.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/lstring.h b/lstring.h
index ad6cca52..130b3a81 100644
--- a/lstring.h
+++ b/lstring.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.h,v 1.30 2001/02/20 18:15:33 roberto Exp roberto $ 2** $Id: lstring.h,v 1.31 2001/02/23 17:17:25 roberto Exp roberto $
3** String table (keep all strings handled by Lua) 3** String table (keep all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -14,6 +14,16 @@
14 14
15 15
16/* 16/*
17** type equivalent to Udata, but with maximum alignment requirements
18*/
19union L_UUdata {
20 Udata u;
21 union L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */
22};
23
24
25
26/*
17** any TString with mark>=FIXMARK is never collected. 27** any TString with mark>=FIXMARK is never collected.
18** Marks>=RESERVEDMARK are used to identify reserved words. 28** Marks>=RESERVEDMARK are used to identify reserved words.
19*/ 29*/
@@ -24,16 +34,14 @@
24#define sizestring(l) ((lu_mem)sizeof(union L_UTString)+ \ 34#define sizestring(l) ((lu_mem)sizeof(union L_UTString)+ \
25 ((lu_mem)(l)+1)*sizeof(l_char)) 35 ((lu_mem)(l)+1)*sizeof(l_char))
26 36
27#define sizeudata(l) ((lu_mem)sizeof(union L_UTString)+(l)) 37#define sizeudata(l) ((lu_mem)sizeof(union L_UUdata)+(l))
28 38
29#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) 39#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
30#define luaS_newliteral(L, s) (luaS_newlstr(L, l_s("") s, \ 40#define luaS_newliteral(L, s) (luaS_newlstr(L, l_s("") s, \
31 (sizeof(s)/sizeof(l_char))-1)) 41 (sizeof(s)/sizeof(l_char))-1))
32 42
33void luaS_init (lua_State *L); 43void luaS_resize (lua_State *L, int newsize);
34void luaS_resize (lua_State *L, stringtable *tb, int newsize); 44Udata *luaS_newudata (lua_State *L, size_t s);
35TString *luaS_newudata (lua_State *L, size_t s, void *udata);
36int luaS_createudata (lua_State *L, void *udata, TObject *o);
37void luaS_freeall (lua_State *L); 45void luaS_freeall (lua_State *L);
38TString *luaS_newlstr (lua_State *L, const l_char *str, size_t l); 46TString *luaS_newlstr (lua_State *L, const l_char *str, size_t l);
39 47