From 8a0521fa529ce5091877683bc6f235ff8de7185b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 10 Nov 1994 15:36:54 -0200 Subject: fallback for garbage collection --- fallback.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'fallback.c') diff --git a/fallback.c b/fallback.c index eee16c28..b9584032 100644 --- a/fallback.c +++ b/fallback.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_fallback="$Id: fallback.c,v 1.3 1994/11/09 18:12:42 roberto Exp roberto $"; +char *rcs_fallback="$Id: fallback.c,v 1.4 1994/11/10 17:11:52 roberto Exp roberto $"; #include #include @@ -14,18 +14,28 @@ char *rcs_fallback="$Id: fallback.c,v 1.3 1994/11/09 18:12:42 roberto Exp robert #include "lua.h" +static void errorFB (void); +static void indexFB (void); +static void gettableFB (void); +static void arithFB (void); +static void concatFB (void); +static void orderFB (void); +static void GDFB (void); + + /* ** Warning: This list must be in the same order as the #define's */ struct FB luaI_fallBacks[] = { -{"error", {LUA_T_CFUNCTION, luaI_errorFB}}, -{"index", {LUA_T_CFUNCTION, luaI_indexFB}}, -{"gettable", {LUA_T_CFUNCTION, luaI_gettableFB}}, -{"arith", {LUA_T_CFUNCTION, luaI_arithFB}}, -{"order", {LUA_T_CFUNCTION, luaI_orderFB}}, -{"concat", {LUA_T_CFUNCTION, luaI_concatFB}}, -{"unminus", {LUA_T_CFUNCTION, luaI_arithFB}}, -{"settable", {LUA_T_CFUNCTION, luaI_gettableFB}} +{"error", {LUA_T_CFUNCTION, errorFB}}, +{"index", {LUA_T_CFUNCTION, indexFB}}, +{"gettable", {LUA_T_CFUNCTION, gettableFB}}, +{"arith", {LUA_T_CFUNCTION, arithFB}}, +{"order", {LUA_T_CFUNCTION, orderFB}}, +{"concat", {LUA_T_CFUNCTION, concatFB}}, +{"unminus", {LUA_T_CFUNCTION, arithFB}}, +{"settable", {LUA_T_CFUNCTION, gettableFB}}, +{"gc", {LUA_T_CFUNCTION, GDFB}} }; #define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB)) @@ -54,7 +64,7 @@ void luaI_setfallback (void) } -void luaI_errorFB (void) +static void errorFB (void) { lua_Object o = lua_getparam(1); if (lua_isstring(o)) @@ -64,34 +74,36 @@ void luaI_errorFB (void) } -void luaI_indexFB (void) +static void indexFB (void) { lua_pushnil(); } -void luaI_gettableFB (void) +static void gettableFB (void) { lua_reportbug("indexed expression not a table"); } -void luaI_arithFB (void) +static void arithFB (void) { lua_reportbug("unexpected type at conversion to number"); } -void luaI_concatFB (void) +static void concatFB (void) { lua_reportbug("unexpected type at conversion to string"); } -void luaI_orderFB (void) +static void orderFB (void) { lua_reportbug("unexpected type at comparison"); } +static void GDFB (void) { } + /* ** Lock routines -- cgit v1.2.3-55-g6feb