diff options
| -rw-r--r-- | lapi.h | 4 | ||||
| -rw-r--r-- | lcode.h | 62 | ||||
| -rw-r--r-- | ldebug.h | 21 | ||||
| -rw-r--r-- | ldo.h | 28 | ||||
| -rw-r--r-- | lfunc.h | 24 | ||||
| -rw-r--r-- | lgc.h | 20 | ||||
| -rw-r--r-- | llex.h | 17 | ||||
| -rw-r--r-- | lmem.h | 17 | ||||
| -rw-r--r-- | lobject.h | 21 | ||||
| -rw-r--r-- | lparser.h | 5 | ||||
| -rw-r--r-- | lstate.h | 6 | ||||
| -rw-r--r-- | lstring.h | 8 | ||||
| -rw-r--r-- | ltable.h | 26 | ||||
| -rw-r--r-- | ltm.h | 11 | ||||
| -rw-r--r-- | luaconf.h | 16 | ||||
| -rw-r--r-- | lundump.h | 12 | ||||
| -rw-r--r-- | lvm.h | 20 | ||||
| -rw-r--r-- | lzio.h | 21 |
18 files changed, 179 insertions, 160 deletions
| @@ -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 | ||
| 14 | void luaA_pushobject (lua_State *L, const TValue *o); | 14 | LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); |
| 15 | 15 | ||
| 16 | #endif | 16 | #endif |
| @@ -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 | ||
| 46 | int luaK_code (FuncState *fs, Instruction i, int line); | 46 | LUAI_FUNC int luaK_code (FuncState *fs, Instruction i, int line); |
| 47 | int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); | 47 | LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); |
| 48 | int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); | 48 | LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); |
| 49 | void luaK_fixline (FuncState *fs, int line); | 49 | LUAI_FUNC void luaK_fixline (FuncState *fs, int line); |
| 50 | void luaK_nil (FuncState *fs, int from, int n); | 50 | LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); |
| 51 | void luaK_reserveregs (FuncState *fs, int n); | 51 | LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); |
| 52 | void luaK_checkstack (FuncState *fs, int n); | 52 | LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); |
| 53 | int luaK_stringK (FuncState *fs, TString *s); | 53 | LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); |
| 54 | int luaK_numberK (FuncState *fs, lua_Number r); | 54 | LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); |
| 55 | void luaK_dischargevars (FuncState *fs, expdesc *e); | 55 | LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); |
| 56 | int luaK_exp2anyreg (FuncState *fs, expdesc *e); | 56 | LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); |
| 57 | void luaK_exp2nextreg (FuncState *fs, expdesc *e); | 57 | LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); |
| 58 | void luaK_exp2val (FuncState *fs, expdesc *e); | 58 | LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); |
| 59 | int luaK_exp2RK (FuncState *fs, expdesc *e); | 59 | LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); |
| 60 | void luaK_self (FuncState *fs, expdesc *e, expdesc *key); | 60 | LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); |
| 61 | void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); | 61 | LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); |
| 62 | void luaK_goiftrue (FuncState *fs, expdesc *e); | 62 | LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); |
| 63 | void luaK_goiffalse (FuncState *fs, expdesc *e); | 63 | LUAI_FUNC void luaK_goiffalse (FuncState *fs, expdesc *e); |
| 64 | void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); | 64 | LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); |
| 65 | void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); | 65 | LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); |
| 66 | void luaK_setoneret (FuncState *fs, expdesc *e); | 66 | LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); |
| 67 | int luaK_jump (FuncState *fs); | 67 | LUAI_FUNC int luaK_jump (FuncState *fs); |
| 68 | void luaK_patchlist (FuncState *fs, int list, int target); | 68 | LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); |
| 69 | void luaK_patchtohere (FuncState *fs, int list); | 69 | LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); |
| 70 | void luaK_concat (FuncState *fs, int *l1, int l2); | 70 | LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); |
| 71 | int luaK_getlabel (FuncState *fs); | 71 | LUAI_FUNC int luaK_getlabel (FuncState *fs); |
| 72 | void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); | 72 | LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); |
| 73 | void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); | 73 | LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); |
| 74 | void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); | 74 | LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); |
| 75 | void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); | 75 | LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | #endif | 78 | #endif |
| @@ -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 | ||
| 21 | void luaG_typeerror (lua_State *L, const TValue *o, const char *opname); | 21 | LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, |
| 22 | void luaG_concaterror (lua_State *L, StkId p1, StkId p2); | 22 | const char *opname); |
| 23 | void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2); | 23 | LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); |
| 24 | int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2); | 24 | LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, |
| 25 | void luaG_runerror (lua_State *L, const char *fmt, ...); | 25 | const TValue *p2); |
| 26 | void luaG_errormsg (lua_State *L); | 26 | LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, |
| 27 | int luaG_checkcode (const Proto *pt); | 27 | const TValue *p2); |
| 28 | int luaG_checkopenop (Instruction i); | 28 | LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); |
| 29 | LUAI_FUNC void luaG_errormsg (lua_State *L); | ||
| 30 | LUAI_FUNC int luaG_checkcode (const Proto *pt); | ||
| 31 | LUAI_FUNC int luaG_checkopenop (Instruction i); | ||
| 29 | 32 | ||
| 30 | #endif | 33 | #endif |
| @@ -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' */ |
| 48 | typedef void (*Pfunc) (lua_State *L, void *ud); | 48 | typedef void (*Pfunc) (lua_State *L, void *ud); |
| 49 | 49 | ||
| 50 | void luaD_resetprotection (lua_State *L); | 50 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); |
| 51 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); | 51 | LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line); |
| 52 | void luaD_callhook (lua_State *L, int event, int line); | 52 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); |
| 53 | int luaD_precall (lua_State *L, StkId func, int nresults); | 53 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); |
| 54 | void luaD_call (lua_State *L, StkId func, int nResults); | 54 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 55 | int luaD_pcall (lua_State *L, Pfunc func, void *u, | 55 | ptrdiff_t oldtop, ptrdiff_t ef); |
| 56 | ptrdiff_t oldtop, ptrdiff_t ef); | 56 | LUAI_FUNC void luaD_poscall (lua_State *L, int wanted, StkId firstResult); |
| 57 | void luaD_poscall (lua_State *L, int wanted, StkId firstResult); | 57 | LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); |
| 58 | void luaD_reallocCI (lua_State *L, int newsize); | 58 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); |
| 59 | void luaD_reallocstack (lua_State *L, int newsize); | 59 | LUAI_FUNC void luaD_growstack (lua_State *L, int n); |
| 60 | void luaD_growstack (lua_State *L, int n); | ||
| 61 | 60 | ||
| 62 | void luaD_throw (lua_State *L, int errcode); | 61 | LUAI_FUNC void luaD_throw (lua_State *L, int errcode); |
| 63 | int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); | 62 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); |
| 64 | 63 | ||
| 65 | 64 | ||
| 66 | #endif | 65 | #endif |
| 66 | |||
| @@ -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 | ||
| 21 | Proto *luaF_newproto (lua_State *L); | 21 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); |
| 22 | Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); | 22 | LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); |
| 23 | Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); | 23 | LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); |
| 24 | UpVal *luaF_newupval (lua_State *L); | 24 | LUAI_FUNC UpVal *luaF_newupval (lua_State *L); |
| 25 | UpVal *luaF_findupval (lua_State *L, StkId level); | 25 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); |
| 26 | void luaF_close (lua_State *L, StkId level); | 26 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); |
| 27 | void luaF_freeproto (lua_State *L, Proto *f); | 27 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); |
| 28 | void luaF_freeclosure (lua_State *L, Closure *c); | 28 | LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); |
| 29 | void luaF_freeupval (lua_State *L, UpVal *uv); | 29 | LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); |
| 30 | 30 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, | |
| 31 | const char *luaF_getlocalname (const Proto *func, int local_number, int pc); | 31 | int pc); |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | #endif | 34 | #endif |
| @@ -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 | ||
| 98 | size_t luaC_separateudata (lua_State *L, int all); | 98 | LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); |
| 99 | void luaC_callGCTM (lua_State *L); | 99 | LUAI_FUNC void luaC_callGCTM (lua_State *L); |
| 100 | void luaC_freeall (lua_State *L); | 100 | LUAI_FUNC void luaC_freeall (lua_State *L); |
| 101 | void luaC_step (lua_State *L); | 101 | LUAI_FUNC void luaC_step (lua_State *L); |
| 102 | void luaC_fullgc (lua_State *L); | 102 | LUAI_FUNC void luaC_fullgc (lua_State *L); |
| 103 | void luaC_link (lua_State *L, GCObject *o, lu_byte tt); | 103 | LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); |
| 104 | void luaC_linkupval (lua_State *L, UpVal *uv); | 104 | LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); |
| 105 | void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); | 105 | LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); |
| 106 | void luaC_barrierback (lua_State *L, GCObject *o); | 106 | LUAI_FUNC void luaC_barrierback (lua_State *L, GCObject *o); |
| 107 | 107 | ||
| 108 | 108 | ||
| 109 | #endif | 109 | #endif |
| @@ -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 | ||
| 69 | void luaX_init (lua_State *L); | 69 | LUAI_FUNC void luaX_init (lua_State *L); |
| 70 | void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source); | 70 | LUAI_FUNC void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, |
| 71 | TString *luaX_newstring (LexState *LS, const char *str, size_t l); | 71 | TString *source); |
| 72 | int luaX_lex (LexState *LS, SemInfo *seminfo); | 72 | LUAI_FUNC TString *luaX_newstring (LexState *LS, const char *str, size_t l); |
| 73 | void luaX_lexerror (LexState *ls, const char *msg, int token); | 73 | LUAI_FUNC int luaX_lex (LexState *LS, SemInfo *seminfo); |
| 74 | void luaX_syntaxerror (LexState *ls, const char *s); | 74 | LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); |
| 75 | const char *luaX_token2str (LexState *ls, int token); | 75 | LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); |
| 76 | LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); | ||
| 76 | 77 | ||
| 77 | 78 | ||
| 78 | #endif | 79 | #endif |
| @@ -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 | ||
| 19 | void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, size_t size); | ||
| 20 | |||
| 21 | void *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 | |||
| 29 | void *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 | ||
| 41 | LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, | ||
| 42 | size_t size); | ||
| 43 | LUAI_FUNC void *luaM_toobig (lua_State *L); | ||
| 44 | LUAI_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 | ||
| @@ -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 | ||
| 363 | int luaO_log2 (unsigned int x); | 363 | LUAI_FUNC int luaO_log2 (unsigned int x); |
| 364 | int luaO_int2fb (unsigned int x); | 364 | LUAI_FUNC int luaO_int2fb (unsigned int x); |
| 365 | int luaO_fb2int (int x); | 365 | LUAI_FUNC int luaO_fb2int (int x); |
| 366 | 366 | LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); | |
| 367 | int luaO_rawequalObj (const TValue *t1, const TValue *t2); | 367 | LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result); |
| 368 | int luaO_str2d (const char *s, lua_Number *result); | 368 | LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, |
| 369 | 369 | va_list argp); | |
| 370 | const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp); | 370 | LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); |
| 371 | const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); | 371 | LUAI_FUNC void luaO_chunkid (char *out, const char *source, int len); |
| 372 | void luaO_chunkid (char *out, const char *source, int len); | ||
| 373 | 372 | ||
| 374 | 373 | ||
| 375 | #endif | 374 | #endif |
| @@ -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 | ||
| 75 | Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name); | 75 | LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, |
| 76 | const char *name); | ||
| 76 | 77 | ||
| 77 | 78 | ||
| 78 | #endif | 79 | #endif |
| @@ -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 | ||
| 163 | lua_State *luaE_newthread (lua_State *L); | 163 | LUAI_FUNC lua_State *luaE_newthread (lua_State *L); |
| 164 | void luaE_freethread (lua_State *L, lua_State *L1); | 164 | LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); |
| 165 | 165 | ||
| 166 | #endif | 166 | #endif |
| 167 | 167 | ||
| @@ -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 | ||
| 26 | void luaS_resize (lua_State *L, int newsize); | 26 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); |
| 27 | 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 | 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 | ||
| 30 | 30 | ||
| 31 | #endif | 31 | #endif |
| @@ -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 | ||
| 21 | extern const Node luaH_dummynode; | 21 | extern const Node luaH_dummynode; |
| 22 | 22 | ||
| 23 | const TValue *luaH_getnum (Table *t, int key); | 23 | LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); |
| 24 | TValue *luaH_setnum (lua_State *L, Table *t, int key); | 24 | LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); |
| 25 | const TValue *luaH_getstr (Table *t, TString *key); | 25 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); |
| 26 | TValue *luaH_setstr (lua_State *L, Table *t, TString *key); | 26 | LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); |
| 27 | const TValue *luaH_get (Table *t, const TValue *key); | 27 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); |
| 28 | TValue *luaH_set (lua_State *L, Table *t, const TValue *key); | 28 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); |
| 29 | Table *luaH_new (lua_State *L, int narray, int lnhash); | 29 | LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); |
| 30 | void luaH_resizearray (lua_State *L, Table *t, int nasize); | 30 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); |
| 31 | void luaH_free (lua_State *L, Table *t); | 31 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); |
| 32 | int luaH_next (lua_State *L, Table *t, StkId key); | 32 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); |
| 33 | int luaH_getn (Table *t); | 33 | LUAI_FUNC int luaH_getn (Table *t); |
| 34 | 34 | ||
| 35 | /* exported only for debugging */ | 35 | /* exported only for debugging */ |
| 36 | Node *luaH_mainposition (const Table *t, const TValue *key); | 36 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | #endif | 39 | #endif |
| @@ -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 | ||
| 45 | extern const char *const luaT_typenames[]; | ||
| 45 | 46 | ||
| 46 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename); | ||
| 47 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event); | ||
| 48 | void luaT_init (lua_State *L); | ||
| 49 | 47 | ||
| 50 | extern const char *const luaT_typenames[]; | 48 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); |
| 49 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, | ||
| 50 | TMS event); | ||
| 51 | LUAI_FUNC void luaT_init (lua_State *L); | ||
| 51 | 52 | ||
| 52 | #endif | 53 | #endif |
| @@ -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 | */ |
| @@ -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 */ |
| 14 | Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char *name); | 14 | LUAI_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 */ |
| 17 | int luaU_endianness (void); | 18 | LUAI_FUNC int luaU_endianness (void); |
| 18 | 19 | ||
| 19 | /* dump one chunk; from ldump.c */ | 20 | /* dump one chunk; from ldump.c */ |
| 20 | int luaU_dump (lua_State* L, const Proto* Main, lua_Chunkwriter w, void* data, int strip); | 21 | LUAI_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 */ |
| 23 | void luaU_print (const Proto* Main); | 25 | LUAI_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 */ |
| @@ -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 | ||
| 25 | int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); | 25 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); |
| 26 | int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); | 26 | LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); |
| 27 | const TValue *luaV_tonumber (const TValue *obj, TValue *n); | 27 | LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); |
| 28 | int luaV_tostring (lua_State *L, StkId obj); | 28 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); |
| 29 | void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val); | 29 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, |
| 30 | void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val); | 30 | StkId val); |
| 31 | StkId luaV_execute (lua_State *L, int nexeccalls); | 31 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, |
| 32 | void luaV_concat (lua_State *L, int total, int last); | 32 | StkId val); |
| 33 | LUAI_FUNC StkId luaV_execute (lua_State *L, int nexeccalls); | ||
| 34 | LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); | ||
| 33 | 35 | ||
| 34 | #endif | 36 | #endif |
| @@ -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 | ||
| 18 | typedef struct Zio ZIO; | 18 | typedef 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 | ||
| 25 | void luaZ_init (lua_State *L, ZIO *z, lua_Chunkreader reader, void *data); | ||
| 26 | size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ | ||
| 27 | int luaZ_lookahead (ZIO *z); | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | typedef struct Mbuffer { | 24 | typedef 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 | |||
| 38 | char *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 | ||
| 46 | LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); | ||
| 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Chunkreader reader, | ||
| 48 | void *data); | ||
| 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ | ||
| 50 | LUAI_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 | ||
| 68 | int luaZ_fill (ZIO *z); | 65 | LUAI_FUNC int luaZ_fill (ZIO *z); |
| 69 | 66 | ||
| 70 | #endif | 67 | #endif |
