diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-06 13:08:00 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-06 13:08:00 -0200 |
commit | 19f8c87375d7606fff12c0edf2eff39c1fcdca9b (patch) | |
tree | e0dcf7c5cef5f6f769b36770b155c173d60e7890 /lua.h | |
parent | 5bcfe0c700c1001b7e94e76214be12249bc051c7 (diff) | |
download | lua-19f8c87375d7606fff12c0edf2eff39c1fcdca9b.tar.gz lua-19f8c87375d7606fff12c0edf2eff39c1fcdca9b.tar.bz2 lua-19f8c87375d7606fff12c0edf2eff39c1fcdca9b.zip |
compatibility code moved to luaconf.h
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 32 |
1 files changed, 4 insertions, 28 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.258 2010/01/05 18:33:26 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.259 2010/01/06 14:42:35 roberto Exp roberto $ |
3 | ** Lua - A Scripting Language | 3 | ** Lua - A Scripting Language |
4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) |
5 | ** See Copyright Notice at the end of this file | 5 | ** See Copyright Notice at the end of this file |
@@ -297,6 +297,9 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); | |||
297 | 297 | ||
298 | #define lua_newtable(L) lua_createtable(L, 0, 0) | 298 | #define lua_newtable(L) lua_createtable(L, 0, 0) |
299 | 299 | ||
300 | #define lua_setglobal(L,s) lua_setfield(L, LUA_ENVIRONINDEX, (s)) | ||
301 | #define lua_getglobal(L,s) lua_getfield(L, LUA_ENVIRONINDEX, (s)) | ||
302 | |||
300 | #define lua_register(L,n,f) \ | 303 | #define lua_register(L,n,f) \ |
301 | (lua_pushcfunction(L, (f)), lua_setfield(L, LUA_ENVIRONINDEX, (n))) | 304 | (lua_pushcfunction(L, (f)), lua_setfield(L, LUA_ENVIRONINDEX, (n))) |
302 | 305 | ||
@@ -322,33 +325,6 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); | |||
322 | 325 | ||
323 | 326 | ||
324 | /* | 327 | /* |
325 | ** compatibility macros and functions | ||
326 | */ | ||
327 | #if defined(LUA_COMPAT_API) | ||
328 | |||
329 | #define lua_strlen(L,i) lua_rawlen(L, (i)) | ||
330 | |||
331 | #define lua_objlen(L,i) lua_rawlen(L, (i)) | ||
332 | |||
333 | #define lua_open() luaL_newstate() | ||
334 | |||
335 | #define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) | ||
336 | |||
337 | #define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) | ||
338 | |||
339 | #define lua_Chunkreader lua_Reader | ||
340 | #define lua_Chunkwriter lua_Writer | ||
341 | |||
342 | #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) | ||
343 | #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) | ||
344 | |||
345 | #define lua_setglobal(L,s) lua_setfield(L, LUA_ENVIRONINDEX, (s)) | ||
346 | #define lua_getglobal(L,s) lua_getfield(L, LUA_ENVIRONINDEX, (s)) | ||
347 | |||
348 | #endif | ||
349 | |||
350 | |||
351 | /* | ||
352 | ** {====================================================================== | 328 | ** {====================================================================== |
353 | ** Debug API | 329 | ** Debug API |
354 | ** ======================================================================= | 330 | ** ======================================================================= |