search for: lual_checkudata

Displaying 7 results from an estimated 7 matches for "lual_checkudata".

2016 Nov 04
4
[PATCH 0/2] improve Lua API for files and initramfs objects
From: Paul Emmerich <p.emmerich at first-colo.net> Hi, the new API for initramfs and files in master lacked the ability to build initramfs objects from files loaded via HTTP/TFTP in Lua. The documentation indicated that it should be possible (and I believe I did that in an older version). I implemented a few new functions to handle files/initramfs objects better. Changes: * NEW:
2011 Mar 29
0
[PATCH] Implementation for sl_initramfs_add_file() in lua.c32
...syslinux.orig/com32/lua/src/syslinux.c 2011-03-29 16:52:37.161106252 -0300 +++ syslinux/com32/lua/src/syslinux.c 2011-03-29 15:58:02.801113257 -0300 @@ -385,12 +385,10 @@ static int sl_initramfs_load_archive(lua static int sl_initramfs_add_file(lua_State * L) { struct initramfs *initramfs = luaL_checkudata(L, 1, SYSLINUX_FILE); - /* FIXME: This code is doing nothing */ - //const char *filename = luaL_checkstring(L, 2); - void *file_data = NULL; - size_t file_len = 0; - - return initramfs_add_file(initramfs, file_data, file_len, file_len, "/testfile1", 0, 0755); + struct sy...
2016 Nov 19
2
[PATCH 0/2] improve Lua API for files and initramfs objects
"H. Peter Anvin" <hpa at zytor.com> writes: > On 11/10/16 04:38, Paul Emmerich via Syslinux wrote: > >> Ferenc W?gner <wferi at niif.hu>: >> >>> for reading configuration files from disk. Does it not work with HTTP/ >>> TFTP for you? Using that, load_file could be implemented in Lua as: >> >> that does work, yes. It just
2016 Nov 20
2
[PATCH 0/2] improve Lua API for files and initramfs objects
...t; part that I wanted to know. > > Incidentally, why do we copy the data if it is in a Lua string (or are > we?) Seems pointless to me. Are you asking about the following hunk? (No, you probably don't, skip!) +static int sl_filedata(lua_State * L) +{ + const syslinux_file *file = luaL_checkudata(L, 1, SYSLINUX_FILE); + + lua_pushlstring(L, file->data, file->size); + + return 1; +} This indeed copies the data from the syslinux_file structure (which is an opaque SYSLINUX_FILE object on the Lua side) into an (interned) Lua string to make it available to the Lua string functions....
2013 Oct 03
0
Automatic boot menu?
...AX)) == NULL) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + return 2; + } + else { + lua_pushstring(L, path); + return 1; + } +} + + +/* +** Directory iterator +*/ +static int dir_iter (lua_State *L) { + struct dirent *entry; + dir_data *d = (dir_data *)luaL_checkudata (L, 1, DIR_METATABLE); + luaL_argcheck (L, d->closed == 0, 1, "closed directory"); + if ((entry = readdir (d->dir)) != NULL) { + lua_pushstring (L, entry->d_name); + return 1; + } else { + /* no more entries =>...
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
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