commit e02750ec60189e15b68fe5a6b9d9a9a802b47def
parent 0b56646bafa5e83a689c42313d9d1e598ad7e591
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 14 Apr 2000 14:46:15 -0300
new type for CFunction (for "pure" C)
Diffstat:
M | lua.h | | | 14 | ++++++++++---- |
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/lua.h b/lua.h
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.44 1999/12/30 18:29:46 roberto Exp roberto $
+** $Id: lua.h,v 1.45 2000/03/27 14:00:35 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
@@ -23,7 +23,7 @@
typedef struct lua_State lua_State;
-typedef void (*lua_CFunction) ( /* lua_State *L */ );
+typedef void (*lua_CFunction) (lua_State *L);
typedef struct TObject *lua_Object;
@@ -154,7 +154,7 @@ lua_Object lua_seterrormethod (lua_State *L); /* In: new method */
extern lua_State *lua_state;
-#define lua_open() ((void)(lua_state?0:(lua_state=lua_newstate(NULL))))
+#define lua_open() ((void)(lua_state?0:(lua_state=lua_newstate(0))))
#define lua_close() (lua_close)(lua_state)
#define lua_settagmethod(tag,event) (lua_settagmethod)(lua_state, tag,event)
@@ -188,7 +188,6 @@ extern lua_State *lua_state;
#define lua_pushnumber(n) (lua_pushnumber)(lua_state, n)
#define lua_pushlstring(s,len) (lua_pushlstring)(lua_state, s,len)
#define lua_pushstring(s) (lua_pushstring)(lua_state, s)
-#define lua_pushcclosure(fn,n) (lua_pushcclosure)(lua_state, fn,n)
#define lua_pushusertag(u,tag) (lua_pushusertag)(lua_state, u,tag)
#define lua_pushobject(obj) (lua_pushobject)(lua_state, obj)
#define lua_pop() (lua_pop)(lua_state)
@@ -209,6 +208,12 @@ extern lua_State *lua_state;
#define lua_createtable() (lua_createtable)(lua_state)
#define lua_collectgarbage(limit) (lua_collectgarbage)(lua_state, limit)
#define lua_seterrormethod() (lua_seterrormethod)(lua_state)
+/*
+** the following typecast is a little dirty, but we cannot find another
+** way to keep compatibility with old definition of `lua_CFunction'
+*/
+#define lua_pushcclosure(fn,n) \
+ (lua_pushcclosure)(lua_state, (lua_CFunction)(fn), n)
#endif
@@ -217,6 +222,7 @@ extern lua_State *lua_state;
+
/******************************************************************************
* Copyright (C) 1994-2000 TeCGraf, PUC-Rio. All rights reserved.
*