From fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 2 Nov 1994 18:30:53 -0200 Subject: new way to call functions, plus several small changes. This is a temporary version! --- lua.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index a93ef30e..f9a0a500 100644 --- a/lua.h +++ b/lua.h @@ -2,13 +2,29 @@ ** LUA - Linguagem para Usuarios de Aplicacao ** Grupo de Tecnologia em Computacao Grafica ** TeCGraf - PUC-Rio -** $Id: lua.h,v 1.4 1994/08/24 15:29:02 celes Exp roberto $ +** $Id: lua.h,v 1.5 1994/11/01 17:54:31 roberto Exp $ */ #ifndef lua_h #define lua_h +/* Private Part */ + +typedef enum +{ + LUA_T_MARK, + LUA_T_NIL, + LUA_T_NUMBER, + LUA_T_STRING, + LUA_T_ARRAY, + LUA_T_FUNCTION, + LUA_T_CFUNCTION, + LUA_T_USERDATA +} Type; + + +/* Public Part */ typedef void (*lua_CFunction) (void); typedef struct Object *lua_Object; @@ -19,8 +35,7 @@ void lua_errorfunction (void (*fn) (char *s)); void lua_error (char *s); int lua_dofile (char *filename); int lua_dostring (char *string); -int lua_call (char *functionname, int nparam); -int lua_callfunction (lua_Object function, int nparam); +int lua_callfunction (lua_Object function); lua_Object lua_getparam (int number); float lua_getnumber (lua_Object object); @@ -33,8 +48,6 @@ lua_Object lua_getfield (lua_Object object, char *field); lua_Object lua_getindexed (lua_Object object, float index); lua_Object lua_getglobal (char *name); -lua_Object lua_pop (void); - int lua_pushnil (void); int lua_pushnumber (float n); int lua_pushstring (char *s); @@ -57,4 +70,10 @@ int lua_isfunction (lua_Object object); int lua_iscfunction (lua_Object object); int lua_isuserdata (lua_Object object); + +/* for lua 1.1 */ + +#define lua_call(f) lua_callfunction(lua_getglobal(f)) + + #endif -- cgit v1.2.3-55-g6feb