diff options
| author | Lua Team <team@lua.org> | 2010-11-17 12:00:00 +0000 |
|---|---|---|
| committer | repogen <> | 2010-11-17 12:00:00 +0000 |
| commit | 850a3d8f8d2ef75c2e7579f31e3b301a72c279cd (patch) | |
| tree | 579a35a77bca170f4a8fcb90442a7b226436b099 /src/lauxlib.h | |
| parent | ccd28dfe034d5dfd130e5378a147e3e9fe7f6807 (diff) | |
| download | lua-github-850a3d8f8d2ef75c2e7579f31e3b301a72c279cd.tar.gz | |
Lua 5.2.0-alpha-rc25.2.0-alpha-rc2
Diffstat (limited to 'src/lauxlib.h')
| -rw-r--r-- | src/lauxlib.h | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/lauxlib.h b/src/lauxlib.h index f4e31bc8..39506456 100644 --- a/src/lauxlib.h +++ b/src/lauxlib.h @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.111 2010/11/10 18:05:36 roberto Exp $ +** $Id: lauxlib.h,v 1.113 2010/11/16 19:20:01 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -62,6 +62,10 @@ LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, const char *const lst[]); +/* pre-defined references */ +#define LUA_NOREF (-2) +#define LUA_REFNIL (-1) + LUALIB_API int (luaL_ref) (lua_State *L, int t); LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); @@ -120,8 +124,6 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) -#define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0)) - /* ** {====================================================== @@ -158,27 +160,14 @@ LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz); /* }====================================================== */ +/* compatibility with old module system */ + LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname, int sizehint); LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, const luaL_Reg *l, int nup); - -/* compatibility with ref system */ - -/* pre-defined references */ -#define LUA_NOREF (-2) -#define LUA_REFNIL (-1) - -#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ - (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) - -#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) - -#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) - - -#define luaL_reg luaL_Reg +#define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0)) #endif |
