aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-04-25 16:24:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-04-25 16:24:10 -0300
commit8718fda9b24fa148ffe1a06fb36a7aa2ed628bdc (patch)
tree4ad0b914b84005b706fb6c9af302132d789b133a
parent8c3c3e769195facf6b8c061f4fab1d86e6606be8 (diff)
downloadlua-8718fda9b24fa148ffe1a06fb36a7aa2ed628bdc.tar.gz
lua-8718fda9b24fa148ffe1a06fb36a7aa2ed628bdc.tar.bz2
lua-8718fda9b24fa148ffe1a06fb36a7aa2ed628bdc.zip
added LUAI_FUNC to functions not in the API
-rw-r--r--lapi.h4
-rw-r--r--lcode.h62
-rw-r--r--ldebug.h21
-rw-r--r--ldo.h28
-rw-r--r--lfunc.h24
-rw-r--r--lgc.h20
-rw-r--r--llex.h17
-rw-r--r--lmem.h17
-rw-r--r--lobject.h21
-rw-r--r--lparser.h5
-rw-r--r--lstate.h6
-rw-r--r--lstring.h8
-rw-r--r--ltable.h26
-rw-r--r--ltm.h11
-rw-r--r--luaconf.h16
-rw-r--r--lundump.h12
-rw-r--r--lvm.h20
-rw-r--r--lzio.h21
18 files changed, 179 insertions, 160 deletions
diff --git a/lapi.h b/lapi.h
index 618448a6..bb522de5 100644
--- a/lapi.h
+++ b/lapi.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.h,v 1.21 2002/03/04 21:29:41 roberto Exp roberto $ 2** $Id: lapi.h,v 2.1 2003/12/10 12:13:36 roberto Exp roberto $
3** Auxiliary functions from Lua API 3** Auxiliary functions from Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -11,6 +11,6 @@
11#include "lobject.h" 11#include "lobject.h"
12 12
13 13
14void luaA_pushobject (lua_State *L, const TValue *o); 14LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
15 15
16#endif 16#endif
diff --git a/lcode.h b/lcode.h
index c1fae300..d32e3503 100644
--- a/lcode.h
+++ b/lcode.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.h,v 1.41 2005/03/08 18:00:16 roberto Exp roberto $ 2** $Id: lcode.h,v 1.42 2005/03/16 16:59:21 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -43,36 +43,36 @@ typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_SIZE, OPR_NOUNOPR } UnOpr;
43 43
44#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) 44#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
45 45
46int luaK_code (FuncState *fs, Instruction i, int line); 46LUAI_FUNC int luaK_code (FuncState *fs, Instruction i, int line);
47int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); 47LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
48int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); 48LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
49void luaK_fixline (FuncState *fs, int line); 49LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
50void luaK_nil (FuncState *fs, int from, int n); 50LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
51void luaK_reserveregs (FuncState *fs, int n); 51LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
52void luaK_checkstack (FuncState *fs, int n); 52LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
53int luaK_stringK (FuncState *fs, TString *s); 53LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
54int luaK_numberK (FuncState *fs, lua_Number r); 54LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
55void luaK_dischargevars (FuncState *fs, expdesc *e); 55LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
56int luaK_exp2anyreg (FuncState *fs, expdesc *e); 56LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
57void luaK_exp2nextreg (FuncState *fs, expdesc *e); 57LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
58void luaK_exp2val (FuncState *fs, expdesc *e); 58LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
59int luaK_exp2RK (FuncState *fs, expdesc *e); 59LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
60void luaK_self (FuncState *fs, expdesc *e, expdesc *key); 60LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
61void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); 61LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
62void luaK_goiftrue (FuncState *fs, expdesc *e); 62LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
63void luaK_goiffalse (FuncState *fs, expdesc *e); 63LUAI_FUNC void luaK_goiffalse (FuncState *fs, expdesc *e);
64void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); 64LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
65void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); 65LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
66void luaK_setoneret (FuncState *fs, expdesc *e); 66LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
67int luaK_jump (FuncState *fs); 67LUAI_FUNC int luaK_jump (FuncState *fs);
68void luaK_patchlist (FuncState *fs, int list, int target); 68LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
69void luaK_patchtohere (FuncState *fs, int list); 69LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
70void luaK_concat (FuncState *fs, int *l1, int l2); 70LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
71int luaK_getlabel (FuncState *fs); 71LUAI_FUNC int luaK_getlabel (FuncState *fs);
72void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); 72LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
73void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); 73LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
74void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); 74LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
75void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); 75LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
76 76
77 77
78#endif 78#endif
diff --git a/ldebug.h b/ldebug.h
index 8f087b52..fcb0b901 100644
--- a/ldebug.h
+++ b/ldebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.h,v 2.1 2003/12/10 12:13:36 roberto Exp roberto $ 2** $Id: ldebug.h,v 2.2 2004/06/02 19:07:55 roberto Exp roberto $
3** Auxiliary functions from Debug Interface module 3** Auxiliary functions from Debug Interface module
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -18,13 +18,16 @@
18#define resethookcount(L) (L->hookcount = L->basehookcount) 18#define resethookcount(L) (L->hookcount = L->basehookcount)
19 19
20 20
21void luaG_typeerror (lua_State *L, const TValue *o, const char *opname); 21LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
22void luaG_concaterror (lua_State *L, StkId p1, StkId p2); 22 const char *opname);
23void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2); 23LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
24int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2); 24LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
25void luaG_runerror (lua_State *L, const char *fmt, ...); 25 const TValue *p2);
26void luaG_errormsg (lua_State *L); 26LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
27int luaG_checkcode (const Proto *pt); 27 const TValue *p2);
28int luaG_checkopenop (Instruction i); 28LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
29LUAI_FUNC void luaG_errormsg (lua_State *L);
30LUAI_FUNC int luaG_checkcode (const Proto *pt);
31LUAI_FUNC int luaG_checkopenop (Instruction i);
29 32
30#endif 33#endif
diff --git a/ldo.h b/ldo.h
index 665934bd..e16e53c6 100644
--- a/ldo.h
+++ b/ldo.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.h,v 2.2 2004/05/14 19:25:09 roberto Exp roberto $ 2** $Id: ldo.h,v 2.3 2004/09/08 14:23:09 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -47,20 +47,20 @@
47/* type of protected functions, to be ran by `runprotected' */ 47/* type of protected functions, to be ran by `runprotected' */
48typedef void (*Pfunc) (lua_State *L, void *ud); 48typedef void (*Pfunc) (lua_State *L, void *ud);
49 49
50void luaD_resetprotection (lua_State *L); 50LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
51int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); 51LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
52void luaD_callhook (lua_State *L, int event, int line); 52LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
53int luaD_precall (lua_State *L, StkId func, int nresults); 53LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
54void luaD_call (lua_State *L, StkId func, int nResults); 54LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
55int luaD_pcall (lua_State *L, Pfunc func, void *u, 55 ptrdiff_t oldtop, ptrdiff_t ef);
56 ptrdiff_t oldtop, ptrdiff_t ef); 56LUAI_FUNC void luaD_poscall (lua_State *L, int wanted, StkId firstResult);
57void luaD_poscall (lua_State *L, int wanted, StkId firstResult); 57LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
58void luaD_reallocCI (lua_State *L, int newsize); 58LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
59void luaD_reallocstack (lua_State *L, int newsize); 59LUAI_FUNC void luaD_growstack (lua_State *L, int n);
60void luaD_growstack (lua_State *L, int n);
61 60
62void luaD_throw (lua_State *L, int errcode); 61LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
63int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); 62LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
64 63
65 64
66#endif 65#endif
66
diff --git a/lfunc.h b/lfunc.h
index a69b5327..6f19e2fa 100644
--- a/lfunc.h
+++ b/lfunc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lfunc.h,v 2.2 2005/01/18 17:18:09 roberto Exp roberto $ 2** $Id: lfunc.h,v 2.3 2005/02/18 12:40:02 roberto Exp roberto $
3** Auxiliary functions to manipulate prototypes and closures 3** Auxiliary functions to manipulate prototypes and closures
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -18,17 +18,17 @@
18 cast(int, sizeof(TValue *)*((n)-1))) 18 cast(int, sizeof(TValue *)*((n)-1)))
19 19
20 20
21Proto *luaF_newproto (lua_State *L); 21LUAI_FUNC Proto *luaF_newproto (lua_State *L);
22Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); 22LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
23Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); 23LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
24UpVal *luaF_newupval (lua_State *L); 24LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
25UpVal *luaF_findupval (lua_State *L, StkId level); 25LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
26void luaF_close (lua_State *L, StkId level); 26LUAI_FUNC void luaF_close (lua_State *L, StkId level);
27void luaF_freeproto (lua_State *L, Proto *f); 27LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
28void luaF_freeclosure (lua_State *L, Closure *c); 28LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
29void luaF_freeupval (lua_State *L, UpVal *uv); 29LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
30 30LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
31const char *luaF_getlocalname (const Proto *func, int local_number, int pc); 31 int pc);
32 32
33 33
34#endif 34#endif
diff --git a/lgc.h b/lgc.h
index be7aa039..6c628a23 100644
--- a/lgc.h
+++ b/lgc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.h,v 2.11 2005/02/10 13:25:02 roberto Exp roberto $ 2** $Id: lgc.h,v 2.12 2005/02/23 17:30:22 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -95,15 +95,15 @@
95 { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ 95 { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
96 luaC_barrierback(L,obj2gco(p)); } 96 luaC_barrierback(L,obj2gco(p)); }
97 97
98size_t luaC_separateudata (lua_State *L, int all); 98LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
99void luaC_callGCTM (lua_State *L); 99LUAI_FUNC void luaC_callGCTM (lua_State *L);
100void luaC_freeall (lua_State *L); 100LUAI_FUNC void luaC_freeall (lua_State *L);
101void luaC_step (lua_State *L); 101LUAI_FUNC void luaC_step (lua_State *L);
102void luaC_fullgc (lua_State *L); 102LUAI_FUNC void luaC_fullgc (lua_State *L);
103void luaC_link (lua_State *L, GCObject *o, lu_byte tt); 103LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
104void luaC_linkupval (lua_State *L, UpVal *uv); 104LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
105void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); 105LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
106void luaC_barrierback (lua_State *L, GCObject *o); 106LUAI_FUNC void luaC_barrierback (lua_State *L, GCObject *o);
107 107
108 108
109#endif 109#endif
diff --git a/llex.h b/llex.h
index 25582643..835a6879 100644
--- a/llex.h
+++ b/llex.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.h,v 1.52 2004/12/03 20:54:12 roberto Exp roberto $ 2** $Id: llex.h,v 1.53 2005/04/07 13:09:07 roberto Exp roberto $
3** Lexical Analyzer 3** Lexical Analyzer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -66,13 +66,14 @@ typedef struct LexState {
66} LexState; 66} LexState;
67 67
68 68
69void luaX_init (lua_State *L); 69LUAI_FUNC void luaX_init (lua_State *L);
70void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source); 70LUAI_FUNC void luaX_setinput (lua_State *L, LexState *LS, ZIO *z,
71TString *luaX_newstring (LexState *LS, const char *str, size_t l); 71 TString *source);
72int luaX_lex (LexState *LS, SemInfo *seminfo); 72LUAI_FUNC TString *luaX_newstring (LexState *LS, const char *str, size_t l);
73void luaX_lexerror (LexState *ls, const char *msg, int token); 73LUAI_FUNC int luaX_lex (LexState *LS, SemInfo *seminfo);
74void luaX_syntaxerror (LexState *ls, const char *s); 74LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
75const char *luaX_token2str (LexState *ls, int token); 75LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
76LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
76 77
77 78
78#endif 79#endif
diff --git a/lmem.h b/lmem.h
index 13377d00..d6bbdd9f 100644
--- a/lmem.h
+++ b/lmem.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmem.h,v 1.29 2004/12/01 15:46:18 roberto Exp roberto $ 2** $Id: lmem.h,v 1.30 2005/03/18 16:38:02 roberto Exp roberto $
3** Interface to Memory Manager 3** Interface to Memory Manager
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -16,19 +16,11 @@
16#define MEMERRMSG "not enough memory" 16#define MEMERRMSG "not enough memory"
17 17
18 18
19void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, size_t size);
20
21void *luaM_toobig (lua_State *L);
22
23#define luaM_reallocv(L,b,on,n,e) \ 19#define luaM_reallocv(L,b,on,n,e) \
24 ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ 20 ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
25 luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ 21 luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
26 luaM_toobig(L)) 22 luaM_toobig(L))
27 23
28
29void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elem,
30 int limit, const char *errormsg);
31
32#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) 24#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
33#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) 25#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
34#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) 26#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t))
@@ -46,5 +38,12 @@ void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elem,
46 ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) 38 ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
47 39
48 40
41LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
42 size_t size);
43LUAI_FUNC void *luaM_toobig (lua_State *L);
44LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
45 size_t size_elem, int limit,
46 const char *errormsg);
47
49#endif 48#endif
50 49
diff --git a/lobject.h b/lobject.h
index ab0ddee7..25ce9705 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.10 2005/01/18 17:18:09 roberto Exp roberto $ 2** $Id: lobject.h,v 2.11 2005/02/18 12:40:02 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -360,16 +360,15 @@ extern const TValue luaO_nilobject;
360 360
361#define ceillog2(x) (luaO_log2((x)-1) + 1) 361#define ceillog2(x) (luaO_log2((x)-1) + 1)
362 362
363int luaO_log2 (unsigned int x); 363LUAI_FUNC int luaO_log2 (unsigned int x);
364int luaO_int2fb (unsigned int x); 364LUAI_FUNC int luaO_int2fb (unsigned int x);
365int luaO_fb2int (int x); 365LUAI_FUNC int luaO_fb2int (int x);
366 366LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
367int luaO_rawequalObj (const TValue *t1, const TValue *t2); 367LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
368int luaO_str2d (const char *s, lua_Number *result); 368LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
369 369 va_list argp);
370const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp); 370LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
371const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); 371LUAI_FUNC void luaO_chunkid (char *out, const char *source, int len);
372void luaO_chunkid (char *out, const char *source, int len);
373 372
374 373
375#endif 374#endif
diff --git a/lparser.h b/lparser.h
index ffcfca3c..44729492 100644
--- a/lparser.h
+++ b/lparser.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.h,v 1.53 2005/03/08 20:10:05 roberto Exp roberto $ 2** $Id: lparser.h,v 1.54 2005/03/09 16:28:07 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -72,7 +72,8 @@ typedef struct FuncState {
72} FuncState; 72} FuncState;
73 73
74 74
75Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name); 75LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
76 const char *name);
76 77
77 78
78#endif 79#endif
diff --git a/lstate.h b/lstate.h
index 6292d5e7..908abf70 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 2.18 2005/03/22 16:04:29 roberto Exp roberto $ 2** $Id: lstate.h,v 2.19 2005/04/05 13:41:29 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -160,8 +160,8 @@ union GCObject {
160#define obj2gco(v) (cast(GCObject *, (v))) 160#define obj2gco(v) (cast(GCObject *, (v)))
161 161
162 162
163lua_State *luaE_newthread (lua_State *L); 163LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
164void luaE_freethread (lua_State *L, lua_State *L1); 164LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
165 165
166#endif 166#endif
167 167
diff --git a/lstring.h b/lstring.h
index 78bc7e99..29bdcb9d 100644
--- a/lstring.h
+++ b/lstring.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.h,v 1.41 2005/02/18 12:40:02 roberto Exp roberto $ 2** $Id: lstring.h,v 1.42 2005/02/23 17:30:22 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*/
@@ -23,9 +23,9 @@
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
26void luaS_resize (lua_State *L, int newsize); 26LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
27Udata *luaS_newudata (lua_State *L, size_t s, Table *e); 27LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
28TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 28LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
29 29
30 30
31#endif 31#endif
diff --git a/ltable.h b/ltable.h
index 0036198f..05b554f6 100644
--- a/ltable.h
+++ b/ltable.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.h,v 2.5 2005/01/05 18:20:51 roberto Exp roberto $ 2** $Id: ltable.h,v 2.6 2005/03/16 16:58:41 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -20,20 +20,20 @@
20 20
21extern const Node luaH_dummynode; 21extern const Node luaH_dummynode;
22 22
23const TValue *luaH_getnum (Table *t, int key); 23LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
24TValue *luaH_setnum (lua_State *L, Table *t, int key); 24LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
25const TValue *luaH_getstr (Table *t, TString *key); 25LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
26TValue *luaH_setstr (lua_State *L, Table *t, TString *key); 26LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
27const TValue *luaH_get (Table *t, const TValue *key); 27LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
28TValue *luaH_set (lua_State *L, Table *t, const TValue *key); 28LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
29Table *luaH_new (lua_State *L, int narray, int lnhash); 29LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
30void luaH_resizearray (lua_State *L, Table *t, int nasize); 30LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
31void luaH_free (lua_State *L, Table *t); 31LUAI_FUNC void luaH_free (lua_State *L, Table *t);
32int luaH_next (lua_State *L, Table *t, StkId key); 32LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
33int luaH_getn (Table *t); 33LUAI_FUNC int luaH_getn (Table *t);
34 34
35/* exported only for debugging */ 35/* exported only for debugging */
36Node *luaH_mainposition (const Table *t, const TValue *key); 36LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
37 37
38 38
39#endif 39#endif
diff --git a/ltm.h b/ltm.h
index 21eff396..bd007ee8 100644
--- a/ltm.h
+++ b/ltm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.h,v 2.1 2003/12/10 12:13:36 roberto Exp roberto $ 2** $Id: ltm.h,v 2.2 2005/03/08 18:00:16 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -42,11 +42,12 @@ typedef enum {
42 42
43#define fasttm(l,et,e) gfasttm(G(l), et, e) 43#define fasttm(l,et,e) gfasttm(G(l), et, e)
44 44
45extern const char *const luaT_typenames[];
45 46
46const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
47const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event);
48void luaT_init (lua_State *L);
49 47
50extern const char *const luaT_typenames[]; 48LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
49LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
50 TMS event);
51LUAI_FUNC void luaT_init (lua_State *L);
51 52
52#endif 53#endif
diff --git a/luaconf.h b/luaconf.h
index 6a571cbc..f7a6c0ec 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.42 2005/04/07 13:09:07 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.43 2005/04/07 13:52:45 roberto Exp roberto $
3** Configuration file for Lua 3** Configuration file for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -118,6 +118,20 @@
118 118
119 119
120/* 120/*
121@@ LUAI_FUNC is a mark for all extern functions that are not to be
122@* exported to outside modules.
123** CHANGE it if you need to mark them in some special way. Gcc mark
124** them as "hidden" to optimize their call when Lua is compiled as a
125** shared library.
126*/
127#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302)
128#define LUAI_FUNC __attribute__((visibility("hidden")))
129#else
130#define LUAI_FUNC extern
131#endif
132
133
134/*
121@@ lua_assert describes the internal assertions in Lua. 135@@ lua_assert describes the internal assertions in Lua.
122** CHANGE that only if you need to debug Lua. 136** CHANGE that only if you need to debug Lua.
123*/ 137*/
diff --git a/lundump.h b/lundump.h
index b3f9b6d2..7af3d636 100644
--- a/lundump.h
+++ b/lundump.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lundump.h,v 1.33 2003/08/15 13:48:53 roberto Exp roberto $ 2** $Id: lundump.h,v 1.34 2003/08/25 19:51:54 roberto Exp roberto $
3** load pre-compiled Lua chunks 3** load pre-compiled Lua chunks
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -11,16 +11,18 @@
11#include "lzio.h" 11#include "lzio.h"
12 12
13/* load one chunk; from lundump.c */ 13/* load one chunk; from lundump.c */
14Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char *name); 14LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff,
15 const char *name);
15 16
16/* find byte order; from lundump.c */ 17/* find byte order; from lundump.c */
17int luaU_endianness (void); 18LUAI_FUNC int luaU_endianness (void);
18 19
19/* dump one chunk; from ldump.c */ 20/* dump one chunk; from ldump.c */
20int luaU_dump (lua_State* L, const Proto* Main, lua_Chunkwriter w, void* data, int strip); 21LUAI_FUNC int luaU_dump (lua_State* L, const Proto* Main, lua_Chunkwriter w,
22 void* data, int strip);
21 23
22/* print one chunk; from print.c */ 24/* print one chunk; from print.c */
23void luaU_print (const Proto* Main); 25LUAI_FUNC void luaU_print (const Proto* Main);
24 26
25/* definitions for headers of binary files */ 27/* definitions for headers of binary files */
26#define VERSION 0x50 /* last format change was in 5.0 */ 28#define VERSION 0x50 /* last format change was in 5.0 */
diff --git a/lvm.h b/lvm.h
index 0e096c96..b120286c 100644
--- a/lvm.h
+++ b/lvm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.h,v 2.2 2004/05/14 19:25:09 roberto Exp roberto $ 2** $Id: lvm.h,v 2.3 2005/04/04 18:12:51 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -22,13 +22,15 @@
22 (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) 22 (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
23 23
24 24
25int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); 25LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
26int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); 26LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
27const TValue *luaV_tonumber (const TValue *obj, TValue *n); 27LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
28int luaV_tostring (lua_State *L, StkId obj); 28LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
29void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val); 29LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
30void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val); 30 StkId val);
31StkId luaV_execute (lua_State *L, int nexeccalls); 31LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
32void luaV_concat (lua_State *L, int total, int last); 32 StkId val);
33LUAI_FUNC StkId luaV_execute (lua_State *L, int nexeccalls);
34LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
33 35
34#endif 36#endif
diff --git a/lzio.h b/lzio.h
index c9703d3f..e18b9fbb 100644
--- a/lzio.h
+++ b/lzio.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lzio.h,v 1.18 2003/08/28 14:38:46 roberto Exp roberto $ 2** $Id: lzio.h,v 1.19 2003/10/03 16:05:34 roberto Exp roberto $
3** Buffered streams 3** Buffered streams
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -17,26 +17,16 @@
17 17
18typedef struct Zio ZIO; 18typedef struct Zio ZIO;
19 19
20
21#define char2int(c) cast(int, cast(unsigned char, (c))) 20#define char2int(c) cast(int, cast(unsigned char, (c)))
22 21
23#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) 22#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
24 23
25void luaZ_init (lua_State *L, ZIO *z, lua_Chunkreader reader, void *data);
26size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
27int luaZ_lookahead (ZIO *z);
28
29
30
31typedef struct Mbuffer { 24typedef struct Mbuffer {
32 char *buffer; 25 char *buffer;
33 size_t n; 26 size_t n;
34 size_t buffsize; 27 size_t buffsize;
35} Mbuffer; 28} Mbuffer;
36 29
37
38char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
39
40#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 30#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
41 31
42#define luaZ_buffer(buff) ((buff)->buffer) 32#define luaZ_buffer(buff) ((buff)->buffer)
@@ -53,6 +43,13 @@ char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
53#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 43#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
54 44
55 45
46LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
47LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Chunkreader reader,
48 void *data);
49LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
50LUAI_FUNC int luaZ_lookahead (ZIO *z);
51
52
56 53
57/* --------- Private Part ------------------ */ 54/* --------- Private Part ------------------ */
58 55
@@ -65,6 +62,6 @@ struct Zio {
65}; 62};
66 63
67 64
68int luaZ_fill (ZIO *z); 65LUAI_FUNC int luaZ_fill (ZIO *z);
69 66
70#endif 67#endif