tag system replaced by event tables
This commit is contained in:
36
lua.h
36
lua.h
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lua.h,v 1.107 2001/10/31 19:58:11 roberto Exp $
|
||||
** $Id: lua.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
|
||||
** Lua - An Extensible Extension Language
|
||||
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
|
||||
** e-mail: info@lua.org
|
||||
@@ -55,15 +55,11 @@ typedef struct lua_State lua_State;
|
||||
typedef int (*lua_CFunction) (lua_State *L);
|
||||
|
||||
|
||||
/*
|
||||
** an invalid `tag'
|
||||
*/
|
||||
#define LUA_NOTAG (-1)
|
||||
|
||||
/*
|
||||
** tags for basic types
|
||||
** basic types
|
||||
*/
|
||||
#define LUA_TNONE LUA_NOTAG
|
||||
#define LUA_TNONE (-1)
|
||||
|
||||
#define LUA_TUSERDATA 0
|
||||
#define LUA_TNIL 1
|
||||
@@ -120,12 +116,11 @@ LUA_API int lua_stackspace (lua_State *L);
|
||||
** access functions (stack -> C)
|
||||
*/
|
||||
|
||||
LUA_API const char *lua_type (lua_State *L, int index);
|
||||
LUA_API int lua_isnumber (lua_State *L, int index);
|
||||
LUA_API int lua_isstring (lua_State *L, int index);
|
||||
LUA_API int lua_iscfunction (lua_State *L, int index);
|
||||
LUA_API int lua_tag (lua_State *L, int index);
|
||||
LUA_API int lua_rawtag (lua_State *L, int index);
|
||||
LUA_API int lua_type (lua_State *L, int index);
|
||||
LUA_API const char *lua_typename (lua_State *L, int type);
|
||||
|
||||
LUA_API int lua_equal (lua_State *L, int index1, int index2);
|
||||
LUA_API int lua_lessthan (lua_State *L, int index1, int index2);
|
||||
@@ -155,9 +150,9 @@ LUA_API void lua_getglobal (lua_State *L, const char *name);
|
||||
LUA_API void lua_gettable (lua_State *L, int index);
|
||||
LUA_API void lua_rawget (lua_State *L, int index);
|
||||
LUA_API void lua_rawgeti (lua_State *L, int index, int n);
|
||||
LUA_API void lua_gettagmethod (lua_State *L, int tag, const char *event);
|
||||
LUA_API void lua_newtable (lua_State *L);
|
||||
LUA_API void lua_getweakregistry (lua_State *L);
|
||||
LUA_API void lua_geteventtable (lua_State *L, int objindex);
|
||||
|
||||
|
||||
/*
|
||||
@@ -168,7 +163,7 @@ LUA_API void lua_settable (lua_State *L, int index);
|
||||
LUA_API void lua_rawset (lua_State *L, int index);
|
||||
LUA_API void lua_rawseti (lua_State *L, int index, int n);
|
||||
LUA_API void lua_setglobals (lua_State *L);
|
||||
LUA_API void lua_settagmethod (lua_State *L, int tag, const char *event);
|
||||
LUA_API void lua_seteventtable (lua_State *L, int objindex);
|
||||
|
||||
|
||||
/*
|
||||
@@ -194,11 +189,6 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
|
||||
/*
|
||||
** miscellaneous functions
|
||||
*/
|
||||
LUA_API int lua_newtype (lua_State *L, const char *name, int basictype);
|
||||
LUA_API void lua_settag (lua_State *L, int tag);
|
||||
|
||||
LUA_API int lua_name2tag (lua_State *L, const char *name);
|
||||
LUA_API const char *lua_tag2name (lua_State *L, int tag);
|
||||
|
||||
LUA_API void lua_error (lua_State *L, const char *s);
|
||||
|
||||
@@ -228,11 +218,11 @@ LUA_API int lua_getweakmode (lua_State *L, int index);
|
||||
#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))
|
||||
#define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0)
|
||||
|
||||
#define lua_isfunction(L,n) (lua_rawtag(L,n) == LUA_TFUNCTION)
|
||||
#define lua_istable(L,n) (lua_rawtag(L,n) == LUA_TTABLE)
|
||||
#define lua_isuserdata(L,n) (lua_rawtag(L,n) == LUA_TUSERDATA)
|
||||
#define lua_isnil(L,n) (lua_rawtag(L,n) == LUA_TNIL)
|
||||
#define lua_isnull(L,n) (lua_rawtag(L,n) == LUA_TNONE)
|
||||
#define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION)
|
||||
#define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE)
|
||||
#define lua_isuserdata(L,n) (lua_type(L,n) == LUA_TUSERDATA)
|
||||
#define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL)
|
||||
#define lua_isnull(L,n) (lua_type(L,n) == LUA_TNONE)
|
||||
|
||||
#define lua_pushliteral(L, s) lua_pushlstring(L, "" s, \
|
||||
(sizeof(s)/sizeof(char))-1)
|
||||
@@ -245,8 +235,6 @@ LUA_API int lua_getweakmode (lua_State *L, int index);
|
||||
/*
|
||||
** compatibility macros and functions
|
||||
*/
|
||||
#define lua_newtag(L) lua_newtype(L, NULL, LUA_TNONE)
|
||||
#define lua_typename lua_tag2name
|
||||
|
||||
LUA_API void lua_pushupvalues (lua_State *L);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user