Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137979283
D14421.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14421.diff
View Options
Index: head/stand/common/interp_lua.c
===================================================================
--- head/stand/common/interp_lua.c
+++ head/stand/common/interp_lua.c
@@ -85,6 +85,8 @@
// {LUA_MATHLIBNAME, luaopen_math},
// {LUA_UTF8LIBNAME, luaopen_utf8},
// {LUA_DBLIBNAME, luaopen_debug},
+ {"io", luaopen_io},
+ {"loader", luaopen_loader},
{NULL, NULL}
};
@@ -105,7 +107,6 @@
abort();
}
softc->luap = luap;
- register_utils(luap);
/* "require" functions from 'loadedlibs' and set results to global table */
for (lib = loadedlibs; lib->func; lib++) {
Index: head/stand/liblua/lutils.h
===================================================================
--- head/stand/liblua/lutils.h
+++ head/stand/liblua/lutils.h
@@ -28,4 +28,5 @@
#include <lua.h>
-void register_utils(lua_State *);
+int luaopen_loader(lua_State *);
+int luaopen_io(lua_State *);
Index: head/stand/liblua/lutils.c
===================================================================
--- head/stand/liblua/lutils.c
+++ head/stand/liblua/lutils.c
@@ -233,11 +233,15 @@
};
#undef REG_SIMPLE
-void
-register_utils(lua_State *L)
+int
+luaopen_loader(lua_State *L)
{
luaL_newlib(L, loaderlib);
- lua_setglobal(L, "loader");
- luaL_newlib(L, iolib);
- lua_setglobal(L, "io");
+ return 1;
}
+
+int
+luaopen_io(lua_State *L)
+{
+ luaL_newlib(L, iolib);
+ return 1;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 8:51 PM (10 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26268768
Default Alt Text
D14421.diff (1 KB)
Attached To
Mode
D14421: interp_lua: Register io/loader with regular Lua module system
Attached
Detach File
Event Timeline
Log In to Comment