aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-07 13:20:56 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-07 13:20:56 -0200
commit63d300167e9c31bd394fa1439d04cd3a3b995894 (patch)
tree312bae817e06a0390f0db9a5e6e8a63a0ea01130
parent62ec3797d518f55513c992fe1819dc5dbb072226 (diff)
downloadlua-63d300167e9c31bd394fa1439d04cd3a3b995894.tar.gz
lua-63d300167e9c31bd394fa1439d04cd3a3b995894.tar.bz2
lua-63d300167e9c31bd394fa1439d04cd3a3b995894.zip
module to implement default fallbacks and lock mechanisms
-rw-r--r--fallback.c51
-rw-r--r--fallback.h16
2 files changed, 67 insertions, 0 deletions
diff --git a/fallback.c b/fallback.c
new file mode 100644
index 00000000..023d11c3
--- /dev/null
+++ b/fallback.c
@@ -0,0 +1,51 @@
1/*
2** fallback.c
3** TecCGraf - PUC-Rio
4*/
5
6char *rcs_fallback="$Id: $";
7
8#include <stdio.h>
9
10#include "fallback.h"
11#include "lua.h"
12
13
14void luaI_errorFB (void)
15{
16 lua_Object o = lua_getparam(1);
17 if (lua_isstring(o))
18 fprintf (stderr, "lua: %s\n", lua_getstring(o));
19 else
20 fprintf(stderr, "lua: unknown error\n");
21}
22
23
24void luaI_indexFB (void)
25{
26 lua_pushnil();
27}
28
29
30void luaI_gettableFB (void)
31{
32 lua_error("indexed expression not a table");
33}
34
35
36void luaI_arithFB (void)
37{
38 lua_error("unexpected type at conversion to number");
39}
40
41void luaI_concatFB (void)
42{
43 lua_error("unexpected type at conversion to string");
44}
45
46
47void luaI_orderFB (void)
48{
49 lua_error("unexpected type at comparison");
50}
51
diff --git a/fallback.h b/fallback.h
new file mode 100644
index 00000000..71080abd
--- /dev/null
+++ b/fallback.h
@@ -0,0 +1,16 @@
1/*
2** $Id: $
3*/
4
5#ifndef fallback_h
6#define fallback_h
7
8void luaI_errorFB (void);
9void luaI_indexFB (void);
10void luaI_gettableFB (void);
11void luaI_arithFB (void);
12void luaI_concatFB (void);
13void luaI_orderFB (void);
14
15#endif
16