aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-10-05 09:14:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-10-05 09:14:08 -0300
commit001f2bdd0e2f8803889c1b5164b57a51e44aef5b (patch)
treed200cf4d708be3c61e64640c45b47050c9c6a375 /lua.h
parentcd2ddaded97f7f2b2af02cecfd165cf70e6f83f4 (diff)
downloadlua-001f2bdd0e2f8803889c1b5164b57a51e44aef5b.tar.gz
lua-001f2bdd0e2f8803889c1b5164b57a51e44aef5b.tar.bz2
lua-001f2bdd0e2f8803889c1b5164b57a51e44aef5b.zip
new definition for types-tags
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/lua.h b/lua.h
index 5257ecc9..0855c45a 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.71 2000/10/02 14:47:43 roberto Exp roberto $ 2** $Id: lua.h,v 1.72 2000/10/02 20:10:55 roberto Exp roberto $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
5** e-mail: lua@tecgraf.puc-rio.br 5** e-mail: lua@tecgraf.puc-rio.br
@@ -47,11 +47,17 @@ typedef struct lua_State lua_State;
47 47
48typedef int (*lua_CFunction) (lua_State *L); 48typedef int (*lua_CFunction) (lua_State *L);
49 49
50/*
51** types returned by `lua_type'
52*/
53#define LUA_TNONE (-1)
50 54
51typedef enum lua_Type { 55#define LUA_TUSERDATA 0
52 LUA_NOVALUE, LUA_TUSERDATA, LUA_TNUMBER, LUA_TSTRING, 56#define LUA_TNIL 1
53 LUA_TTABLE, LUA_TFUNCTION, LUA_TNIL 57#define LUA_TNUMBER 2
54} lua_Type; 58#define LUA_TSTRING 3
59#define LUA_TTABLE 4
60#define LUA_TFUNCTION 5
55 61
56 62
57 63
@@ -77,8 +83,8 @@ int lua_stackspace (lua_State *L);
77** access functions (stack -> C) 83** access functions (stack -> C)
78*/ 84*/
79 85
80lua_Type lua_type (lua_State *L, int index); 86int lua_type (lua_State *L, int index);
81const char *lua_typename (lua_State *L, lua_Type t); 87const char *lua_typename (lua_State *L, int t);
82int lua_isnumber (lua_State *L, int index); 88int lua_isnumber (lua_State *L, int index);
83int lua_isstring (lua_State *L, int index); 89int lua_isstring (lua_State *L, int index);
84int lua_iscfunction (lua_State *L, int index); 90int lua_iscfunction (lua_State *L, int index);
@@ -184,7 +190,7 @@ void lua_concat (lua_State *L, int n);
184#define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE) 190#define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE)
185#define lua_isuserdata(L,n) (lua_type(L,n) == LUA_TUSERDATA) 191#define lua_isuserdata(L,n) (lua_type(L,n) == LUA_TUSERDATA)
186#define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL) 192#define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL)
187#define lua_isnull(L,n) (lua_type(L,n) == LUA_NOVALUE) 193#define lua_isnull(L,n) (lua_type(L,n) == LUA_TNONE)
188 194
189#endif 195#endif
190 196
@@ -224,3 +230,4 @@ void lua_concat (lua_State *L, int n);
224* 230*
225* This implementation contains no third-party code. 231* This implementation contains no third-party code.
226******************************************************************************/ 232******************************************************************************/
233