Skip to content

Commit 8718fda

Browse files
committed
added LUAI_FUNC to functions not in the API
1 parent 8c3c3e7 commit 8718fda

18 files changed

+179
-160
lines changed

Diff for: lapi.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Auxiliary functions from Lua API
44
** See Copyright Notice in lua.h
55
*/
@@ -11,6 +11,6 @@
1111
#include "lobject.h"
1212

1313

14-
void luaA_pushobject (lua_State *L, const TValue *o);
14+
LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
1515

1616
#endif

Diff for: lcode.h

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Code generator for Lua
44
** See Copyright Notice in lua.h
55
*/
@@ -43,36 +43,36 @@ typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_SIZE, OPR_NOUNOPR } UnOpr;
4343

4444
#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
4545

46-
int luaK_code (FuncState *fs, Instruction i, int line);
47-
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);
49-
void luaK_fixline (FuncState *fs, int line);
50-
void luaK_nil (FuncState *fs, int from, int n);
51-
void luaK_reserveregs (FuncState *fs, int n);
52-
void luaK_checkstack (FuncState *fs, int n);
53-
int luaK_stringK (FuncState *fs, TString *s);
54-
int luaK_numberK (FuncState *fs, lua_Number r);
55-
void luaK_dischargevars (FuncState *fs, expdesc *e);
56-
int luaK_exp2anyreg (FuncState *fs, expdesc *e);
57-
void luaK_exp2nextreg (FuncState *fs, expdesc *e);
58-
void luaK_exp2val (FuncState *fs, expdesc *e);
59-
int luaK_exp2RK (FuncState *fs, expdesc *e);
60-
void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
61-
void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
62-
void luaK_goiftrue (FuncState *fs, expdesc *e);
63-
void luaK_goiffalse (FuncState *fs, expdesc *e);
64-
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
65-
void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
66-
void luaK_setoneret (FuncState *fs, expdesc *e);
67-
int luaK_jump (FuncState *fs);
68-
void luaK_patchlist (FuncState *fs, int list, int target);
69-
void luaK_patchtohere (FuncState *fs, int list);
70-
void luaK_concat (FuncState *fs, int *l1, int l2);
71-
int luaK_getlabel (FuncState *fs);
72-
void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
73-
void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
74-
void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
75-
void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
46+
LUAI_FUNC int luaK_code (FuncState *fs, Instruction i, int line);
47+
LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
48+
LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
49+
LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
50+
LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
51+
LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
52+
LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
53+
LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
54+
LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
55+
LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
56+
LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
57+
LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
58+
LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
59+
LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
60+
LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
61+
LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
62+
LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
63+
LUAI_FUNC void luaK_goiffalse (FuncState *fs, expdesc *e);
64+
LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
65+
LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
66+
LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
67+
LUAI_FUNC int luaK_jump (FuncState *fs);
68+
LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
69+
LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
70+
LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
71+
LUAI_FUNC int luaK_getlabel (FuncState *fs);
72+
LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
73+
LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
74+
LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
75+
LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
7676

7777

7878
#endif

Diff for: ldebug.h

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Auxiliary functions from Debug Interface module
44
** See Copyright Notice in lua.h
55
*/
@@ -18,13 +18,16 @@
1818
#define resethookcount(L) (L->hookcount = L->basehookcount)
1919

2020

21-
void luaG_typeerror (lua_State *L, const TValue *o, const char *opname);
22-
void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
23-
void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2);
24-
int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2);
25-
void luaG_runerror (lua_State *L, const char *fmt, ...);
26-
void luaG_errormsg (lua_State *L);
27-
int luaG_checkcode (const Proto *pt);
28-
int luaG_checkopenop (Instruction i);
21+
LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
22+
const char *opname);
23+
LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
24+
LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
25+
const TValue *p2);
26+
LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
27+
const TValue *p2);
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);
2932

3033
#endif

Diff for: ldo.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Stack and Call structure of Lua
44
** See Copyright Notice in lua.h
55
*/
@@ -47,20 +47,20 @@
4747
/* type of protected functions, to be ran by `runprotected' */
4848
typedef void (*Pfunc) (lua_State *L, void *ud);
4949

50-
void luaD_resetprotection (lua_State *L);
51-
int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
52-
void luaD_callhook (lua_State *L, int event, int line);
53-
int luaD_precall (lua_State *L, StkId func, int nresults);
54-
void luaD_call (lua_State *L, StkId func, int nResults);
55-
int luaD_pcall (lua_State *L, Pfunc func, void *u,
56-
ptrdiff_t oldtop, ptrdiff_t ef);
57-
void luaD_poscall (lua_State *L, int wanted, StkId firstResult);
58-
void luaD_reallocCI (lua_State *L, int newsize);
59-
void luaD_reallocstack (lua_State *L, int newsize);
60-
void luaD_growstack (lua_State *L, int n);
50+
LUAI_FUNC 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+
LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
53+
LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
54+
LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
55+
ptrdiff_t oldtop, ptrdiff_t ef);
56+
LUAI_FUNC void luaD_poscall (lua_State *L, int wanted, StkId firstResult);
57+
LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
58+
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
59+
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
6160

62-
void luaD_throw (lua_State *L, int errcode);
63-
int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
61+
LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
62+
LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
6463

6564

6665
#endif
66+

Diff for: lfunc.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Auxiliary functions to manipulate prototypes and closures
44
** See Copyright Notice in lua.h
55
*/
@@ -18,17 +18,17 @@
1818
cast(int, sizeof(TValue *)*((n)-1)))
1919

2020

21-
Proto *luaF_newproto (lua_State *L);
22-
Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
23-
Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
24-
UpVal *luaF_newupval (lua_State *L);
25-
UpVal *luaF_findupval (lua_State *L, StkId level);
26-
void luaF_close (lua_State *L, StkId level);
27-
void luaF_freeproto (lua_State *L, Proto *f);
28-
void luaF_freeclosure (lua_State *L, Closure *c);
29-
void luaF_freeupval (lua_State *L, UpVal *uv);
30-
31-
const char *luaF_getlocalname (const Proto *func, int local_number, int pc);
21+
LUAI_FUNC Proto *luaF_newproto (lua_State *L);
22+
LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
23+
LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
24+
LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
25+
LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
26+
LUAI_FUNC void luaF_close (lua_State *L, StkId level);
27+
LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
28+
LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
29+
LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
30+
LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
31+
int pc);
3232

3333

3434
#endif

Diff for: lgc.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Garbage Collector
44
** See Copyright Notice in lua.h
55
*/
@@ -95,15 +95,15 @@
9595
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
9696
luaC_barrierback(L,obj2gco(p)); }
9797

98-
size_t luaC_separateudata (lua_State *L, int all);
99-
void luaC_callGCTM (lua_State *L);
100-
void luaC_freeall (lua_State *L);
101-
void luaC_step (lua_State *L);
102-
void luaC_fullgc (lua_State *L);
103-
void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
104-
void luaC_linkupval (lua_State *L, UpVal *uv);
105-
void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
106-
void luaC_barrierback (lua_State *L, GCObject *o);
98+
LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
99+
LUAI_FUNC void luaC_callGCTM (lua_State *L);
100+
LUAI_FUNC void luaC_freeall (lua_State *L);
101+
LUAI_FUNC void luaC_step (lua_State *L);
102+
LUAI_FUNC void luaC_fullgc (lua_State *L);
103+
LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
104+
LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
105+
LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
106+
LUAI_FUNC void luaC_barrierback (lua_State *L, GCObject *o);
107107

108108

109109
#endif

Diff for: llex.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Lexical Analyzer
44
** See Copyright Notice in lua.h
55
*/
@@ -66,13 +66,14 @@ typedef struct LexState {
6666
} LexState;
6767

6868

69-
void luaX_init (lua_State *L);
70-
void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source);
71-
TString *luaX_newstring (LexState *LS, const char *str, size_t l);
72-
int luaX_lex (LexState *LS, SemInfo *seminfo);
73-
void luaX_lexerror (LexState *ls, const char *msg, int token);
74-
void luaX_syntaxerror (LexState *ls, const char *s);
75-
const char *luaX_token2str (LexState *ls, int token);
69+
LUAI_FUNC void luaX_init (lua_State *L);
70+
LUAI_FUNC void luaX_setinput (lua_State *L, LexState *LS, ZIO *z,
71+
TString *source);
72+
LUAI_FUNC TString *luaX_newstring (LexState *LS, const char *str, size_t l);
73+
LUAI_FUNC int luaX_lex (LexState *LS, SemInfo *seminfo);
74+
LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
75+
LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
76+
LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
7677

7778

7879
#endif

Diff for: lmem.h

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Interface to Memory Manager
44
** See Copyright Notice in lua.h
55
*/
@@ -16,19 +16,11 @@
1616
#define MEMERRMSG "not enough memory"
1717

1818

19-
void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, size_t size);
20-
21-
void *luaM_toobig (lua_State *L);
22-
2319
#define luaM_reallocv(L,b,on,n,e) \
2420
((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
2521
luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
2622
luaM_toobig(L))
2723

28-
29-
void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elem,
30-
int limit, const char *errormsg);
31-
3224
#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
3325
#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
3426
#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,
4638
((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
4739

4840

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+
4948
#endif
5049

Diff for: lobject.h

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Type definitions for Lua objects
44
** See Copyright Notice in lua.h
55
*/
@@ -360,16 +360,15 @@ extern const TValue luaO_nilobject;
360360

361361
#define ceillog2(x) (luaO_log2((x)-1) + 1)
362362

363-
int luaO_log2 (unsigned int x);
364-
int luaO_int2fb (unsigned int x);
365-
int luaO_fb2int (int x);
366-
367-
int luaO_rawequalObj (const TValue *t1, const TValue *t2);
368-
int luaO_str2d (const char *s, lua_Number *result);
369-
370-
const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp);
371-
const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
372-
void luaO_chunkid (char *out, const char *source, int len);
363+
LUAI_FUNC int luaO_log2 (unsigned int x);
364+
LUAI_FUNC int luaO_int2fb (unsigned int x);
365+
LUAI_FUNC int luaO_fb2int (int x);
366+
LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
367+
LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
368+
LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
369+
va_list argp);
370+
LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
371+
LUAI_FUNC void luaO_chunkid (char *out, const char *source, int len);
373372

374373

375374
#endif

Diff for: lparser.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Lua Parser
44
** See Copyright Notice in lua.h
55
*/
@@ -72,7 +72,8 @@ typedef struct FuncState {
7272
} FuncState;
7373

7474

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);
7677

7778

7879
#endif

Diff for: lstate.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** Global State
44
** See Copyright Notice in lua.h
55
*/
@@ -160,8 +160,8 @@ union GCObject {
160160
#define obj2gco(v) (cast(GCObject *, (v)))
161161

162162

163-
lua_State *luaE_newthread (lua_State *L);
164-
void luaE_freethread (lua_State *L, lua_State *L1);
163+
LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
164+
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
165165

166166
#endif
167167

Diff for: lstring.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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 $
33
** String table (keep all strings handled by Lua)
44
** See Copyright Notice in lua.h
55
*/
@@ -23,9 +23,9 @@
2323

2424
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
2525

26-
void luaS_resize (lua_State *L, int newsize);
27-
Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
28-
TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
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);
28+
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
2929

3030

3131
#endif

0 commit comments

Comments
 (0)