[syslinux] Added functions config_file(), ipappend_strs(), and reboot() to Lua.c32.

Geert Stappers stappers at stappers.nl
Sun Sep 23 12:54:49 PDT 2012


On Sun, Sep 23, 2012 at 08:35:58PM +0200, Geert Stappers wrote:
> On Sun, Sep 23, 2012 at 06:42:57PM +0200, Hung-chi Lihn wrote:
> 
> It was me, stappers,  who wrote the _reformatted_ patch.
  It was me, stappers,  who posted the _reformatted_ patch.
> 
> > From: Hung-chi Lihn <hlihn at google.com>
> 
> Is the original author of the [PATCH] that
>   Added functions config_file(), ipappend_strs(), and reboot() to Lua.c32.
> 
> 
  <snip/>
> 
> make[2]: Entering directory `/usr/src/syslinux/com32/lua/src'
> gcc -std=gnu99 -m32 -fno-stack-protector -fwrapv -freg-struct-return -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 -fno-exceptions -fno-asynchronous-unwind-tables -fPIE -falign-functions=0 -falign-jumps=0 -falign-labels=0 -falign-loops=0 -mpreferred-stack-boundary=2 -W -Wall -march=i386 -fomit-frame-pointer -D__COM32__ -DDYNAMIC_MODULE -nostdinc -iwithprefix include -I../../../com32/libutil/include -I../../../com32/include -I../../../com32/gplinclude -I../../../core/include -DSYSLINUX -DLUA_ANSI -c -o syslinux.o syslinux.c
> syslinux.c: In function 'sl_ipappend_strs':
> syslinux.c:431:55: warning: initialization from incompatible pointer type [enabled by default]
> syslinux.c:431:81: error: expected ',' or ';' before 'lua_createtable'
> make[2]: *** [syslinux.o] Error 1
> make[2]: Leaving directory `/usr/src/syslinux/com32/lua/src'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/usr/src/syslinux/com32'
> make: *** [all] Error 2
> 
> 
> So where I did my best to help,
> seems it now that more help is needed to get an ipappend function in Lua.

In the hdt tree is the correct function, it is

static int sl_ipappend_strs(lua_State * L)
{
    int i;
    const struct syslinux_ipappend_strings *ip_strs = syslinux_ipappend_strings;
    lua_newtable(L);
    for (i = 0; i < ip_strs->count; i++) {
        lua_pushinteger(L, i + 1);
        lua_pushstring(L, ip_strs->ptr[i]);
        lua_settable(L,-3);
    }
    return 1;
}


Now only a warning:

make[1]: Entering directory `/usr/src/syslinux/com32/lua/src'
gcc -std=gnu99 -m32 -fno-stack-protector -fwrapv -freg-struct-return -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREG
PARM=3 -fno-exceptions -fno-asynchronous-unwind-tables -fPIE -falign-functions=0 -falign-jumps=0 -falign-labels=0 -falign-l
oops=0 -mpreferred-stack-boundary=2 -W -Wall -march=i386 -fomit-frame-pointer -D__COM32__ -DDYNAMIC_MODULE -nostdinc -iwith
prefix include -I../../../com32/libutil/include -I../../../com32/include -I../../../com32/gplinclude -I../../../core/includ
e -DSYSLINUX -DLUA_ANSI -c -o syslinux.o syslinux.c
syslinux.c: In function 'sl_ipappend_strs':
syslinux.c:431:55: warning: initialization from incompatible pointer type [enabled by default]
ld -shared -m elf_i386 -shared --hash-style=gnu -T ../../../com32/lib/elf32.ld --as-needed -o liblua.c32 lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lvm.o lzio.o lundump.o syslinux.o lauxlib.o lbaselib.o ldblib.o ltablib.o lstrlib.o loadlib.o linit.o liolib.o dmi.o cpu.o pci.o vesa.o dhcp.o
ld -m elf_i386 -shared --hash-style=gnu -T ../../../com32/lib/elf32.ld --as-needed -o lua.c32 lua.o liblua.c32 ../../../com32/libutil/libutil_com.c32 ../../../com32/gpllib/libcom32gpl.c32 ../../../com32/lib/libcom32.c32
make[1]: Leaving directory `/usr/src/syslinux/com32/lua/src'


Groeten
Geert Stappers
-- 
> And is there a policy on top-posting vs. bottom-posting?
Yes.



More information about the Syslinux mailing list