no need to define functions for macros...

This commit is contained in:
Roberto Ierusalimschy 1999-01-26 13:38:01 -02:00
parent 2431534f10
commit fd25d4ad85
3 changed files with 5 additions and 36 deletions

25
lapi.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 1.30 1998/12/30 17:26:49 roberto Exp roberto $
** $Id: lapi.c,v 1.31 1999/01/15 13:11:22 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@ -622,29 +622,6 @@ lua_Object lua_getref (int ref)
/* }====================================================== */
/*
** {======================================================
** Derived functions
** =======================================================
*/
int (lua_call) (char *name) { return lua_call(name); }
void (lua_pushref) (int ref) { lua_pushref(ref); }
int (lua_refobject) (lua_Object o, int l) { return lua_refobject(o, l); }
void (lua_register) (char *n, lua_CFunction f) { lua_register(n, f); }
void (lua_pushuserdata) (void *u) { lua_pushuserdata(u); }
void (lua_pushcfunction) (lua_CFunction f) { lua_pushcfunction(f); }
int (lua_clonetag) (int t) { return lua_clonetag(t); }
/* }====================================================== */
#ifdef LUA_COMPAT2_5
/*

View File

@ -1,5 +1,5 @@
/*
** $Id: lbuiltin.c,v 1.46 1999/01/22 18:46:11 roberto Exp roberto $
** $Id: lbuiltin.c,v 1.47 1999/01/25 12:30:11 roberto Exp roberto $
** Built-in functions
** See Copyright Notice in lua.h
*/
@ -650,7 +650,7 @@ static void testC (void) {
case '=': lua_setglobal(getname(s)); break;
case 's': lua_pushstring(getname(s)); break;
case 'o': lua_pushobject(reg[getnum(s)]); break;
case 'f': (lua_call)(getname(s)); break;
case 'f': lua_call(getname(s)); break;
case 'i': reg[getnum(s)] = lua_gettable(); break;
case 'I': reg[getnum(s)] = lua_rawgettable(); break;
case 't': lua_settable(); break;

12
lua.h
View File

@ -1,5 +1,5 @@
/*
** $Id: lua.h,v 1.24 1998/08/21 17:43:44 roberto Exp roberto $
** $Id: lua.h,v 1.25 1998/12/15 14:59:43 roberto Exp roberto $
** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: lua@tecgraf.puc-rio.br
@ -100,30 +100,22 @@ long lua_collectgarbage (long limit);
/* =============================================================== */
/* some useful macros/derived functions */
/* some useful macros/functions */
int (lua_call) (char *name);
#define lua_call(name) lua_callfunction(lua_getglobal(name))
void (lua_pushref) (int ref);
#define lua_pushref(ref) lua_pushobject(lua_getref(ref))
int (lua_refobject) (lua_Object o, int l);
#define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l))
void (lua_register) (char *n, lua_CFunction f);
#define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n))
void (lua_pushuserdata) (void *u);
#define lua_pushuserdata(u) lua_pushusertag(u, 0)
void (lua_pushcfunction) (lua_CFunction f);
#define lua_pushcfunction(f) lua_pushcclosure(f, 0)
int (lua_clonetag) (int t);
#define lua_clonetag(t) lua_copytagmethods(lua_newtag(), (t))
lua_Object lua_seterrormethod (void); /* In: new method */
/* ==========================================================================