mirror of https://github.com/rusefi/lua.git
fallback table now has number of parameters and results of each
fallback. This information is used by opcode.c, when calling a fallback.
This commit is contained in:
parent
7e01348658
commit
1bb3fb73cc
21
fallback.c
21
fallback.c
|
@ -3,7 +3,7 @@
|
||||||
** TecCGraf - PUC-Rio
|
** TecCGraf - PUC-Rio
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *rcs_fallback="$Id: fallback.c,v 1.13 1995/10/02 17:03:33 roberto Exp roberto $";
|
char *rcs_fallback="$Id: fallback.c,v 1.14 1995/10/04 14:20:26 roberto Exp roberto $";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -28,15 +28,16 @@ static void funcFB (void);
|
||||||
** Warning: This list must be in the same order as the #define's
|
** Warning: This list must be in the same order as the #define's
|
||||||
*/
|
*/
|
||||||
struct FB luaI_fallBacks[] = {
|
struct FB luaI_fallBacks[] = {
|
||||||
{"error", {LUA_T_CFUNCTION, {errorFB}}},
|
{"error", {LUA_T_CFUNCTION, {errorFB}}, 1, 0},
|
||||||
{"index", {LUA_T_CFUNCTION, {indexFB}}},
|
{"index", {LUA_T_CFUNCTION, {indexFB}}, 2, 1},
|
||||||
{"gettable", {LUA_T_CFUNCTION, {gettableFB}}},
|
{"gettable", {LUA_T_CFUNCTION, {gettableFB}}, 2, 1},
|
||||||
{"arith", {LUA_T_CFUNCTION, {arithFB}}},
|
{"arith", {LUA_T_CFUNCTION, {arithFB}}, 3, 1},
|
||||||
{"order", {LUA_T_CFUNCTION, {orderFB}}},
|
{"order", {LUA_T_CFUNCTION, {orderFB}}, 3, 1},
|
||||||
{"concat", {LUA_T_CFUNCTION, {concatFB}}},
|
{"concat", {LUA_T_CFUNCTION, {concatFB}}, 2, 1},
|
||||||
{"settable", {LUA_T_CFUNCTION, {gettableFB}}},
|
{"settable", {LUA_T_CFUNCTION, {gettableFB}}, 3, 0},
|
||||||
{"gc", {LUA_T_CFUNCTION, {GDFB}}},
|
{"gc", {LUA_T_CFUNCTION, {GDFB}}, 1, 0},
|
||||||
{"function", {LUA_T_CFUNCTION, {funcFB}}}
|
{"function", {LUA_T_CFUNCTION, {funcFB}}, -1, -1}
|
||||||
|
/* no fixed number of params or results */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB))
|
#define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: fallback.h,v 1.7 1994/11/21 18:22:58 roberto Stab roberto $
|
** $Id: fallback.h,v 1.8 1995/10/04 14:20:26 roberto Exp roberto $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef fallback_h
|
#ifndef fallback_h
|
||||||
|
@ -10,6 +10,8 @@
|
||||||
extern struct FB {
|
extern struct FB {
|
||||||
char *kind;
|
char *kind;
|
||||||
Object function;
|
Object function;
|
||||||
|
int nParams;
|
||||||
|
int nResults;
|
||||||
} luaI_fallBacks[];
|
} luaI_fallBacks[];
|
||||||
|
|
||||||
#define FB_ERROR 0
|
#define FB_ERROR 0
|
||||||
|
|
Loading…
Reference in New Issue