Displaying 3 results from an estimated 3 matches for "sl_filedata".
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:
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
...> correctly.
>
> It was the "for completeness" 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 (inte...