diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-07-28 12:51:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-07-28 12:51:59 -0300 |
commit | d447945685986f0b1a7bd5d7ed7746bf4ebd5914 (patch) | |
tree | f6439228bedf7b967cb7ff8dc26946732e96d8b5 /loadlib.c | |
parent | 78f9635111ec647719bb1b1622b1cb6f47ef1be1 (diff) | |
download | lua-d447945685986f0b1a7bd5d7ed7746bf4ebd5914.tar.gz lua-d447945685986f0b1a7bd5d7ed7746bf4ebd5914.tar.bz2 lua-d447945685986f0b1a7bd5d7ed7746bf4ebd5914.zip |
'module'/'luaL_register' and associates are deprecated
Diffstat (limited to 'loadlib.c')
-rw-r--r-- | loadlib.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loadlib.c,v 1.87 2010/07/02 11:38:13 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.88 2010/07/25 15:03:37 roberto Exp roberto $ |
3 | ** Dynamic library loader for Lua | 3 | ** Dynamic library loader for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | ** | 5 | ** |
@@ -495,11 +495,10 @@ static int ll_require (lua_State *L) { | |||
495 | ** 'module' function | 495 | ** 'module' function |
496 | ** ======================================================= | 496 | ** ======================================================= |
497 | */ | 497 | */ |
498 | 498 | #if defined(LUA_COMPAT_MODULE) | |
499 | 499 | ||
500 | /* | 500 | /* |
501 | ** FOR COMPATIBILITY ONLY: changes the _ENV variable of | 501 | ** changes the _ENV variable of calling function |
502 | ** calling function | ||
503 | */ | 502 | */ |
504 | static void set_env (lua_State *L) { | 503 | static void set_env (lua_State *L) { |
505 | lua_Debug ar; | 504 | lua_Debug ar; |
@@ -570,6 +569,17 @@ static int ll_seeall (lua_State *L) { | |||
570 | } | 569 | } |
571 | 570 | ||
572 | 571 | ||
572 | #else | ||
573 | |||
574 | static int ll_seeall (lua_State *L) { | ||
575 | return luaL_error(L, "deprecated function"); | ||
576 | } | ||
577 | |||
578 | static int ll_module (lua_State *L) { | ||
579 | return luaL_error(L, "deprecated function"); | ||
580 | } | ||
581 | |||
582 | #endif | ||
573 | /* }====================================================== */ | 583 | /* }====================================================== */ |
574 | 584 | ||
575 | 585 | ||
@@ -648,7 +658,7 @@ LUAMOD_API int luaopen_package (lua_State *L) { | |||
648 | lua_setfield(L, -2, "preload"); | 658 | lua_setfield(L, -2, "preload"); |
649 | lua_pushglobaltable(L); | 659 | lua_pushglobaltable(L); |
650 | lua_pushvalue(L, -2); /* set 'package' as upvalue for next lib */ | 660 | lua_pushvalue(L, -2); /* set 'package' as upvalue for next lib */ |
651 | luaL_openlib(L, NULL, ll_funcs, 1); /* open lib into global table */ | 661 | luaL_setfuncs(L, ll_funcs, 1); /* open lib into global table */ |
652 | lua_pop(L, 1); /* pop global table */ | 662 | lua_pop(L, 1); /* pop global table */ |
653 | return 1; /* return 'package' table */ | 663 | return 1; /* return 'package' table */ |
654 | } | 664 | } |