module to implement default fallbacks and lock mechanisms

This commit is contained in:
Roberto Ierusalimschy 1994-11-07 13:20:56 -02:00
parent 62ec3797d5
commit 63d300167e
2 changed files with 67 additions and 0 deletions

51
fallback.c Normal file
View File

@ -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");
}

16
fallback.h Normal file
View File

@ -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