search for: lualib_api

Displaying 5 results from an estimated 5 matches for "lualib_api".

2013 Oct 03
0
Automatic boot menu?
...return _file_info_ (L, STAT_FUNC); +} + + +static const struct luaL_Reg fslib[] = { + {"attributes", file_info}, + {"chdir", change_dir}, + {"currentdir", get_dir}, + {"dir", dir_iter_factory}, + {NULL, NULL}, +}; + +LUALIB_API int luaopen_lfs (lua_State *L) { + dir_create_meta (L); + luaL_openlib (L, LFS_LIBNAME, fslib, 0); + return 1; +} diff --git a/com32/lua/src/linit.c b/com32/lua/src/linit.c index 6e97873..e50589e 100644 --- a/com32/lua/src/linit.c +++ b/com32/lua/src/linit.c @@ -35,6 +35,7 @@ static const luaL_R...
2013 Aug 30
2
Automatic boot menu?
"H. Peter Anvin" <hpa at zytor.com> writes: > On 08/29/2013 04:14 AM, Ferenc Wagner wrote: > >> "H. Peter Anvin" <hpa at zytor.com> writes: >> >>> On 08/22/2013 10:20 AM, Ferenc Wagner wrote: >>> >>>> Now that Syslinux has ls.c32 and lua.c32, it should be possible to build >>>> a customizable boot menu in
2011 Oct 04
1
Added DHCPINFO Tables to the lua.c32 Implementation - syslinux-4.04
...kie[2], dhcp->cookie[3]); + lua_pushstring(L, "magic.cookie"); + lua_pushstring(L, dhcp_arg); + lua_settable(L,-3); + + return 1; +} + +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); + return 1; +} diff -up syslinux-4.04/com32/lua/src/dhcp.h.orig syslinux-4.04/com32/lua/src/dhcp.h --- syslinux-4.04/com32/lua/src/dhcp.h.orig 2011-09-28 13:09:36.000000000 -0700 +++ syslinux-4.04/com32/lua/src/d...
2013 Oct 15
23
[PATCH 00/21] Upgrade to Lua 5.2.2, add filesystem module and get_key binding
Hi, This series targets automatic boot menu generation, but most of it is the Lua upgrade, because I got tired reading deprecated API docs. It's mostly a straightforward forward port of the earlier Syslinux specific changes to Lua 5.1, except that: * I chose the add a stub getenv() implementation to the COM32 API instead of #ifdefing out all the references in Lua, and * I kept oslib
2014 Nov 28
2
[PATCH] Add ldisk.c32 Lua module
...uot;host_bus", info.edd_params.host_bus_type); + SET_TABLE_STRING_STRING(L, "interface", info.edd_params.interface_type); + lua_settable(L, -3); + i++; + } + return 1; +} + +static const luaL_Reg disklib[] = { + {"get_disks", get_disks}, + {NULL, NULL} +}; + + +LUALIB_API int luaopen_ldisk(lua_State* L) { + luaL_newlib(L, disklib); + return 1; +} + diff --git a/com32/lua/test/detect_disks.lua b/com32/lua/test/detect_disks.lua new file mode 100644 index 0000000..add81be --- /dev/null +++ b/com32/lua/test/detect_disks.lua @@ -0,0 +1,33 @@ +local disk = require &...