diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-18 18:20:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-18 18:20:45 -0300 |
commit | eca17b24ea9853ff6c2d7101419e190c861983f0 (patch) | |
tree | 4f4520b87a5824191f8c307d72505c88184d89c9 | |
parent | 6b61582e47b8dc9c2f9ebce4593f8b7a5e6aaf94 (diff) | |
download | lua-eca17b24ea9853ff6c2d7101419e190c861983f0.tar.gz lua-eca17b24ea9853ff6c2d7101419e190c861983f0.tar.bz2 lua-eca17b24ea9853ff6c2d7101419e190c861983f0.zip |
#if wraps compatibility issue
-rw-r--r-- | lua.h | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -2,14 +2,14 @@ | |||
2 | ** LUA - An Extensible Extension Language | 2 | ** LUA - An Extensible Extension Language |
3 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 3 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
4 | ** e-mail: lua@tecgraf.puc-rio.br | 4 | ** e-mail: lua@tecgraf.puc-rio.br |
5 | ** $Id: lua.h,v 4.7 1997/06/12 18:27:29 roberto Exp roberto $ | 5 | ** $Id: lua.h,v 4.8 1997/06/16 19:48:18 roberto Exp roberto $ |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 8 | ||
9 | #ifndef lua_h | 9 | #ifndef lua_h |
10 | #define lua_h | 10 | #define lua_h |
11 | 11 | ||
12 | #define LUA_VERSION "Lua 3.0 (alpha)" | 12 | #define LUA_VERSION "Lua 3.0" |
13 | #define LUA_COPYRIGHT "Copyright (C) 1994-1997 TeCGraf" | 13 | #define LUA_COPYRIGHT "Copyright (C) 1994-1997 TeCGraf" |
14 | #define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" | 14 | #define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" |
15 | 15 | ||
@@ -52,6 +52,8 @@ int lua_isfunction (lua_Object object); | |||
52 | float lua_getnumber (lua_Object object); | 52 | float lua_getnumber (lua_Object object); |
53 | char *lua_getstring (lua_Object object); | 53 | char *lua_getstring (lua_Object object); |
54 | lua_CFunction lua_getcfunction (lua_Object object); | 54 | lua_CFunction lua_getcfunction (lua_Object object); |
55 | void *lua_getuserdata (lua_Object object); | ||
56 | |||
55 | 57 | ||
56 | void lua_pushnil (void); | 58 | void lua_pushnil (void); |
57 | void lua_pushnumber (float n); | 59 | void lua_pushnumber (float n); |
@@ -98,6 +100,13 @@ long lua_collectgarbage (long limit); | |||
98 | #define lua_pushuserdata(u) lua_pushusertag(u, 0) | 100 | #define lua_pushuserdata(u) lua_pushusertag(u, 0) |
99 | 101 | ||
100 | 102 | ||
103 | |||
104 | |||
105 | /* If your program has no compatibility problems, you can change | ||
106 | ** this to 0 | ||
107 | */ | ||
108 | #if 1 | ||
109 | |||
101 | /* =============================================================== */ | 110 | /* =============================================================== */ |
102 | /* for compatibility with old versions. Avoid using these macros/functions */ | 111 | /* for compatibility with old versions. Avoid using these macros/functions */ |
103 | 112 | ||
@@ -106,8 +115,6 @@ lua_Object lua_setfallback (char *event, lua_CFunction fallback); | |||
106 | #define lua_storeglobal lua_setglobal | 115 | #define lua_storeglobal lua_setglobal |
107 | #define lua_type lua_tag | 116 | #define lua_type lua_tag |
108 | 117 | ||
109 | void *lua_getuserdata (lua_Object object); | ||
110 | |||
111 | #define lua_lockobject(o) lua_refobject(o,1) | 118 | #define lua_lockobject(o) lua_refobject(o,1) |
112 | #define lua_lock() lua_ref(1) | 119 | #define lua_lock() lua_ref(1) |
113 | #define lua_getlocked lua_getref | 120 | #define lua_getlocked lua_getref |
@@ -117,7 +124,7 @@ void *lua_getuserdata (lua_Object object); | |||
117 | #define lua_pushliteral(o) lua_pushstring(o) | 124 | #define lua_pushliteral(o) lua_pushstring(o) |
118 | 125 | ||
119 | #define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_gettable()) | 126 | #define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_gettable()) |
120 | #define lua_getfield(o,f) (lua_pushobject(o), lua_pushliteral(f), lua_gettable()) | 127 | #define lua_getfield(o,f) (lua_pushobject(o), lua_pushstring(f), lua_gettable()) |
121 | 128 | ||
122 | #define lua_copystring(o) (strdup(lua_getstring(o))) | 129 | #define lua_copystring(o) (strdup(lua_getstring(o))) |
123 | 130 | ||
@@ -125,3 +132,5 @@ void *lua_getuserdata (lua_Object object); | |||
125 | #define lua_storesubscript lua_settable | 132 | #define lua_storesubscript lua_settable |
126 | 133 | ||
127 | #endif | 134 | #endif |
135 | |||
136 | #endif | ||