'luaI_travfallbacks' now can look for a fallback.

This commit is contained in:
Roberto Ierusalimschy 1995-10-17 09:52:38 -02:00
parent b17c76817d
commit 970995c3f2
2 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
char *rcs_fallback="$Id: fallback.c,v 1.14 1995/10/04 14:20:26 roberto Exp roberto $";
char *rcs_fallback="$Id: fallback.c,v 1.15 1995/10/09 13:14:29 roberto Exp roberto $";
#include <stdio.h>
#include <string.h>
@ -162,7 +162,7 @@ Object *luaI_getlocked (int ref)
}
void luaI_travlock (void (*fn)(Object *))
void luaI_travlock (int (*fn)(Object *))
{
Word i;
for (i=0; i<lockSize; i++)
@ -170,9 +170,11 @@ void luaI_travlock (void (*fn)(Object *))
}
void luaI_travfallbacks (void (*fn)(Object *))
char *luaI_travfallbacks (int (*fn)(Object *))
{
Word i;
for (i=0; i<N_FB; i++)
fn(&luaI_fallBacks[i].function);
if (fn(&luaI_fallBacks[i].function))
return luaI_fallBacks[i].kind;
return NULL;
}

View File

@ -1,5 +1,5 @@
/*
** $Id: fallback.h,v 1.8 1995/10/04 14:20:26 roberto Exp roberto $
** $Id: fallback.h,v 1.9 1995/10/09 13:14:29 roberto Exp roberto $
*/
#ifndef fallback_h
@ -27,8 +27,8 @@ extern struct FB {
void luaI_setfallback (void);
int luaI_lock (Object *object);
Object *luaI_getlocked (int ref);
void luaI_travlock (void (*fn)(Object *));
void luaI_travfallbacks (void (*fn)(Object *));
void luaI_travlock (int (*fn)(Object *));
char *luaI_travfallbacks (int (*fn)(Object *));
#endif