diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-17 18:37:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-17 18:37:37 -0300 |
commit | 1514e49d4321efc30d597e05a072266c7c4d697d (patch) | |
tree | affcab00868f3b34091b85519a0ee4da8728b032 /lauxlib.h | |
parent | 22ef84b6c8d980eb869f414610f8ff5f25568ca7 (diff) | |
download | lua-1514e49d4321efc30d597e05a072266c7c4d697d.tar.gz lua-1514e49d4321efc30d597e05a072266c7c4d697d.tar.bz2 lua-1514e49d4321efc30d597e05a072266c7c4d697d.zip |
avoid using function environments in C libraries (as it probably will
be deprecated)
Diffstat (limited to 'lauxlib.h')
-rw-r--r-- | lauxlib.h | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.h,v 1.99 2010/01/11 16:00:45 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.100 2010/01/21 16:49:21 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -29,8 +29,8 @@ typedef struct luaL_Reg { | |||
29 | LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver); | 29 | LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver); |
30 | #define luaL_checkversion(L) luaL_checkversion_(L, LUA_VERSION_NUM) | 30 | #define luaL_checkversion(L) luaL_checkversion_(L, LUA_VERSION_NUM) |
31 | 31 | ||
32 | LUALIB_API void (luaL_register) (lua_State *L, const char *libname, | 32 | LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, |
33 | const luaL_Reg *l); | 33 | const luaL_Reg *l, int nup); |
34 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); | 34 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); |
35 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); | 35 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); |
36 | LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len); | 36 | LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len); |
@@ -71,7 +71,7 @@ LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); | |||
71 | 71 | ||
72 | LUALIB_API lua_State *(luaL_newstate) (void); | 72 | LUALIB_API lua_State *(luaL_newstate) (void); |
73 | 73 | ||
74 | LUALIB_API int luaL_len (lua_State *L, int idx); | 74 | LUALIB_API int (luaL_len) (lua_State *L, int idx); |
75 | 75 | ||
76 | LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, | 76 | LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, |
77 | const char *r); | 77 | const char *r); |
@@ -79,11 +79,11 @@ LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, | |||
79 | LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, | 79 | LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, |
80 | const char *fname, int szhint); | 80 | const char *fname, int szhint); |
81 | 81 | ||
82 | LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, | 82 | LUALIB_API void (luaL_traceback) (lua_State *L, lua_State *L1, |
83 | const char *msg, int level); | 83 | const char *msg, int level); |
84 | 84 | ||
85 | LUALIB_API int luaL_cpcall (lua_State *L, lua_CFunction f, int nargs, | 85 | LUALIB_API int (luaL_cpcall) (lua_State *L, lua_CFunction f, int nargs, |
86 | int nresults); | 86 | int nresults); |
87 | 87 | ||
88 | 88 | ||
89 | /* | 89 | /* |
@@ -113,6 +113,9 @@ LUALIB_API int luaL_cpcall (lua_State *L, lua_CFunction f, int nargs, | |||
113 | 113 | ||
114 | #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) | 114 | #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) |
115 | 115 | ||
116 | #define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0)) | ||
117 | |||
118 | |||
116 | /* | 119 | /* |
117 | ** {====================================================== | 120 | ** {====================================================== |
118 | ** Generic Buffer manipulation | 121 | ** Generic Buffer manipulation |