search for: lua_settable

Displaying 4 results from an estimated 4 matches for "lua_settable".

2012 Sep 19
1
[PATCH 1/1] lua: Cleaned up the dmi table structure in Lua.c32 and added all missing DMI subtables
...-9,13 +9,13 @@ #include"lualib.h" #include"cpuid.h" -static void add_string_item(lua_State *L, const char *item, const char *value_str) { +void add_string_item(lua_State *L, const char *item, const char *value_str) { lua_pushstring(L,item); lua_pushstring(L,value_str); lua_settable(L,-3); } -static void add_int_item(lua_State *L, const char *item, int value_int) { +void add_int_item(lua_State *L, const char *item, int value_int) { lua_pushstring(L,item); lua_pushnumber(L,value_int); lua_settable(L,-3); diff --git a/com32/lua/src/dmi.c b/com32/lua/src/dmi.c index c8329...
2011 Oct 04
1
Added DHCPINFO Tables to the lua.c32 Implementation - syslinux-4.04
...static char op_value[255]; + int loop; + + loop = len/4; + + if ( loop == 1) { + sprintf(op_name, "%u", option); + lua_pushstring(L, op_name); + sprintf(op_value, "%u.%u.%u.%u", value[0], value[1], value[2], value[3]); + lua_pushstring(L, op_value); + lua_settable(L,-3); + } else { + for (int done = 0; done < loop; done++){ + sprintf(op_name, "%u.%d", option, done+1); + lua_pushstring(L, op_name); + sprintf(op_value, "%u.%u.%u.%u", value[0+(done*4)], value[1+(done*4)], value[2+(done*4)], value[3+(done*4)]); + lua_push...
2014 Nov 28
2
[PATCH] Add ldisk.c32 Lua module
...ion.h> +#include <disk/swsusp.h> +#include <disk/read.h> + +#include "lua.h" +#include "lauxlib.h" +#include "lualib.h" + +#define SET_TABLE_STRING_INT(state, key, value) do {\ + lua_pushstring((state), (key));\ + lua_pushinteger((state), (value));\ + lua_settable((state), -3);\ +} while(0); + +#define SET_TABLE_STRING_STRING(state, key, value) do {\ + lua_pushstring((state), (key));\ + lua_pushstring((state), (const char*) (value));\ + lua_settable((state), -3);\ +} while(0); + +static int get_disks(lua_State* L) { + lua_newtable(L); + int i = 1; + for (...
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