aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-10-09 10:14:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-10-09 10:14:29 -0300
commit1bb3fb73cc65d35df9cd737f4445ad9361f85775 (patch)
tree466c2cc19d40f11bbc7ad57e0b2335d3ff1a725a
parent7e0134865866951e522ad95034daf0e044fbedd2 (diff)
downloadlua-1bb3fb73cc65d35df9cd737f4445ad9361f85775.tar.gz
lua-1bb3fb73cc65d35df9cd737f4445ad9361f85775.tar.bz2
lua-1bb3fb73cc65d35df9cd737f4445ad9361f85775.zip
fallback table now has number of parameters and results of each
fallback. This information is used by opcode.c, when calling a fallback.
-rw-r--r--fallback.c21
-rw-r--r--fallback.h4
2 files changed, 14 insertions, 11 deletions
diff --git a/fallback.c b/fallback.c
index e4da2df1..c4b497b3 100644
--- a/fallback.c
+++ b/fallback.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_fallback="$Id: fallback.c,v 1.13 1995/10/02 17:03:33 roberto Exp roberto $"; 6char *rcs_fallback="$Id: fallback.c,v 1.14 1995/10/04 14:20:26 roberto Exp roberto $";
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <string.h> 9#include <string.h>
@@ -28,15 +28,16 @@ static void funcFB (void);
28** Warning: This list must be in the same order as the #define's 28** Warning: This list must be in the same order as the #define's
29*/ 29*/
30struct FB luaI_fallBacks[] = { 30struct FB luaI_fallBacks[] = {
31{"error", {LUA_T_CFUNCTION, {errorFB}}}, 31{"error", {LUA_T_CFUNCTION, {errorFB}}, 1, 0},
32{"index", {LUA_T_CFUNCTION, {indexFB}}}, 32{"index", {LUA_T_CFUNCTION, {indexFB}}, 2, 1},
33{"gettable", {LUA_T_CFUNCTION, {gettableFB}}}, 33{"gettable", {LUA_T_CFUNCTION, {gettableFB}}, 2, 1},
34{"arith", {LUA_T_CFUNCTION, {arithFB}}}, 34{"arith", {LUA_T_CFUNCTION, {arithFB}}, 3, 1},
35{"order", {LUA_T_CFUNCTION, {orderFB}}}, 35{"order", {LUA_T_CFUNCTION, {orderFB}}, 3, 1},
36{"concat", {LUA_T_CFUNCTION, {concatFB}}}, 36{"concat", {LUA_T_CFUNCTION, {concatFB}}, 2, 1},
37{"settable", {LUA_T_CFUNCTION, {gettableFB}}}, 37{"settable", {LUA_T_CFUNCTION, {gettableFB}}, 3, 0},
38{"gc", {LUA_T_CFUNCTION, {GDFB}}}, 38{"gc", {LUA_T_CFUNCTION, {GDFB}}, 1, 0},
39{"function", {LUA_T_CFUNCTION, {funcFB}}} 39{"function", {LUA_T_CFUNCTION, {funcFB}}, -1, -1}
40 /* no fixed number of params or results */
40}; 41};
41 42
42#define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB)) 43#define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB))
diff --git a/fallback.h b/fallback.h
index 97dcb484..f1997851 100644
--- a/fallback.h
+++ b/fallback.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: fallback.h,v 1.7 1994/11/21 18:22:58 roberto Stab roberto $ 2** $Id: fallback.h,v 1.8 1995/10/04 14:20:26 roberto Exp roberto $
3*/ 3*/
4 4
5#ifndef fallback_h 5#ifndef fallback_h
@@ -10,6 +10,8 @@
10extern struct FB { 10extern struct FB {
11 char *kind; 11 char *kind;
12 Object function; 12 Object function;
13 int nParams;
14 int nResults;
13} luaI_fallBacks[]; 15} luaI_fallBacks[];
14 16
15#define FB_ERROR 0 17#define FB_ERROR 0