commit 63d300167e9c31bd394fa1439d04cd3a3b995894
parent 62ec3797d518f55513c992fe1819dc5dbb072226
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 7 Nov 1994 13:20:37 -0200
module to implement default fallbacks and lock mechanisms
Diffstat:
A | fallback.c | | | 51 | +++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | fallback.h | | | 16 | ++++++++++++++++ |
2 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/fallback.c b/fallback.c
@@ -0,0 +1,51 @@
+/*
+** fallback.c
+** TecCGraf - PUC-Rio
+*/
+
+char *rcs_fallback="$Id: $";
+
+#include <stdio.h>
+
+#include "fallback.h"
+#include "lua.h"
+
+
+void luaI_errorFB (void)
+{
+ lua_Object o = lua_getparam(1);
+ if (lua_isstring(o))
+ fprintf (stderr, "lua: %s\n", lua_getstring(o));
+ else
+ fprintf(stderr, "lua: unknown error\n");
+}
+
+
+void luaI_indexFB (void)
+{
+ lua_pushnil();
+}
+
+
+void luaI_gettableFB (void)
+{
+ lua_error("indexed expression not a table");
+}
+
+
+void luaI_arithFB (void)
+{
+ lua_error("unexpected type at conversion to number");
+}
+
+void luaI_concatFB (void)
+{
+ lua_error("unexpected type at conversion to string");
+}
+
+
+void luaI_orderFB (void)
+{
+ lua_error("unexpected type at comparison");
+}
+
diff --git a/fallback.h b/fallback.h
@@ -0,0 +1,16 @@
+/*
+** $Id: $
+*/
+
+#ifndef fallback_h
+#define fallback_h
+
+void luaI_errorFB (void);
+void luaI_indexFB (void);
+void luaI_gettableFB (void);
+void luaI_arithFB (void);
+void luaI_concatFB (void);
+void luaI_orderFB (void);
+
+#endif
+