[syslinux:master] lua: also reactivate the cpu, dhcp, dmi, pci and vesa extension modules
syslinux-bot for Ferenc Wágner
wferi at niif.hu
Sun Mar 2 13:48:25 PST 2014
Commit-ID: f4bbf85ee5224ab5f29ff7ca900c6f25437eed07
Gitweb: http://www.syslinux.org/commit/f4bbf85ee5224ab5f29ff7ca900c6f25437eed07
Author: Ferenc Wágner <wferi at niif.hu>
AuthorDate: Mon, 14 Oct 2013 19:45:25 +0200
Committer: Ferenc Wágner <wferi at niif.hu>
CommitDate: Sat, 1 Mar 2014 17:40:35 +0100
lua: also reactivate the cpu, dhcp, dmi, pci and vesa extension modules
And document the change in usage.
---
com32/lua/doc/syslinux.asc | 6 ++++++
com32/lua/src/Makefile | 5 +++++
com32/lua/src/cpu.c | 2 +-
com32/lua/src/dhcp.c | 4 ++--
com32/lua/src/dmi.c | 2 +-
com32/lua/src/pci.c | 4 ++--
com32/lua/src/vesa.c | 4 ++--
7 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/com32/lua/doc/syslinux.asc b/com32/lua/doc/syslinux.asc
index 64dc18c..424c51f 100644
--- a/com32/lua/doc/syslinux.asc
+++ b/com32/lua/doc/syslinux.asc
@@ -20,6 +20,12 @@ APPEND /testit.lua
Modules
-------
+Modules must be explicitly loaded into the namespace
+before use, for example:
+......................................................
+syslinux = require ("syslinux")
+......................................................
+
SYSLINUX
~~~~~~~~
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index e757396..20650ef 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -25,8 +25,13 @@ LNXLIBS =
CFLAGS += -DSYSLINUX
MODULES = lua.c32
+MODULES += cpu.c32
+MODULES += dhcp.c32
+MODULES += dmi.c32
MODULES += lfs.c32
+MODULES += pci.c32
MODULES += syslinux.c32
+MODULES += vesa.c32
TESTFILES =
OBJS = lua.o
diff --git a/com32/lua/src/cpu.c b/com32/lua/src/cpu.c
index 6ef4e5a..69914f7 100644
--- a/com32/lua/src/cpu.c
+++ b/com32/lua/src/cpu.c
@@ -152,7 +152,7 @@ static const luaL_Reg cpulib[] = {
LUALIB_API int luaopen_cpu(lua_State *L) {
- luaL_openlib(L, LUA_CPULIBNAME, cpulib, 0);
+ luaL_newlib(L, cpulib);
return 1;
}
diff --git a/com32/lua/src/dhcp.c b/com32/lua/src/dhcp.c
index af94813..14a3934 100644
--- a/com32/lua/src/dhcp.c
+++ b/com32/lua/src/dhcp.c
@@ -346,13 +346,13 @@ static int dhcp_gettable(lua_State *L)
return 1;
}
-static const luaL_reg dhcplib[] = {
+static const luaL_Reg dhcplib[] = {
{"gettable", dhcp_gettable},
{"getoptions", dhcp_getoptions},
{NULL, NULL}
};
LUALIB_API int luaopen_dhcp (lua_State *L) {
- luaL_openlib(L, LUA_DHCPLIBNAME, dhcplib, 0);
+ luaL_newlib(L, dhcplib);
return 1;
}
diff --git a/com32/lua/src/dmi.c b/com32/lua/src/dmi.c
index 984fb60..aa38df3 100644
--- a/com32/lua/src/dmi.c
+++ b/com32/lua/src/dmi.c
@@ -519,7 +519,7 @@ static const luaL_Reg dmilib[] = {
LUALIB_API int luaopen_dmi (lua_State *L) {
- luaL_openlib(L, LUA_DMILIBNAME, dmilib, 0);
+ luaL_newlib(L, dmilib);
return 1;
}
diff --git a/com32/lua/src/pci.c b/com32/lua/src/pci.c
index c367ba9..964020f 100644
--- a/com32/lua/src/pci.c
+++ b/com32/lua/src/pci.c
@@ -160,7 +160,7 @@ static int pci_getidlist(lua_State *L)
return(1);
}
-static const luaL_reg pcilib[] = {
+static const luaL_Reg pcilib[] = {
{"getinfo", pci_getinfo},
{"getidlist", pci_getidlist},
{NULL, NULL}
@@ -169,7 +169,7 @@ static const luaL_reg pcilib[] = {
/* This defines a function that opens up your library. */
LUALIB_API int luaopen_pci (lua_State *L) {
- luaL_openlib(L, LUA_PCILIBNAME, pcilib, 0);
+ luaL_newlib(L, pcilib);
return 1;
}
diff --git a/com32/lua/src/vesa.c b/com32/lua/src/vesa.c
index 19a1024..28e0124 100644
--- a/com32/lua/src/vesa.c
+++ b/com32/lua/src/vesa.c
@@ -123,7 +123,7 @@ static int vesa_load_background(lua_State *L)
return 0;
}
-static const luaL_reg vesalib[] = {
+static const luaL_Reg vesalib[] = {
{"getmodes", vesa_getmodes},
{"setmode", vesa_setmode},
{"load_background", vesa_load_background},
@@ -133,7 +133,7 @@ static const luaL_reg vesalib[] = {
/* This defines a function that opens up your library. */
LUALIB_API int luaopen_vesa (lua_State *L) {
- luaL_openlib(L, LUA_VESALIBNAME, vesalib, 0);
+ luaL_newlib(L, vesalib);
return 1;
}
More information about the Syslinux-commits
mailing list