Displaying 20 results from an estimated 49 matches for "lua_state".
2012 Sep 19
1
[PATCH 1/1] lua: Enabling io.read() in Lua.c32 with some restrictions
...1
+ #define NO_TEST_EOF 1
+ #define NO_CLEAR_ERR 1
+ #define NO_F_SEEK 1
+ #define NO_F_SETVBUF 1
+#endif
#define IO_INPUT 1
#define IO_OUTPUT 2
-
static const char *const fnames[] = {"input", "output"};
@@ -180,7 +186,7 @@ static int io_popen (lua_State *L) {
}
-#ifndef SYSLINUX
+#ifndef NO_TMP_FILE
static int io_tmpfile (lua_State *L) {
FILE **pf = newfile(L);
*pf = tmpfile();
@@ -271,7 +277,7 @@ static int io_lines (lua_State *L) {
** =======================================================
*/
-#ifndef SYSLINUX
+#ifndef NO_READ_NUMBE...
2012 Sep 19
1
[PATCH 1/1] lua: Cleaned up the dmi table structure in Lua.c32 and added all missing DMI subtables
...2 files changed, 420 insertions(+), 208 deletions(-)
diff --git a/com32/lua/src/cpu.c b/com32/lua/src/cpu.c
index 8a246e3..6ef4e5a 100644
--- a/com32/lua/src/cpu.c
+++ b/com32/lua/src/cpu.c
@@ -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_i...
2013 Oct 03
0
Automatic boot menu?
...f->st_mode=S_IFDIR;
+ buf->st_size=0;
+ return 0;
+ }
+ if (fstat (fd, buf) == -1) {
+ int err = errno;
+ close (fd);
+ errno = err;
+ return -1;
+ }
+ close (fd);
+ return 0;
+}
+
+/*
+** This function changes the working (current) directory
+*/
+static int change_dir (lua_State *L) {
+ const char *path = luaL_checkstring(L, 1);
+ if (chdir(path)) {
+ lua_pushnil (L);
+ lua_pushfstring (L,"Unable to change working directory to '%s'\n%s\n",
+ path, chdir_error);
+ ret...
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
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
2017 Sep 25
5
Errors linking with LLVM 5.0 - dump() missing
...lly built with
versions 3.5 to 4.0 is now failing to link because of missing
implementation for dump(). Errors I get are:
Undefined symbols for architecture x86_64:
"llvm::Type::dump() const", referenced from:
ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
"llvm::Value::dump() const", referenced from:
dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
"llvm::Module::dump() const", referenced from:
This appears to be a change that is not documented in the release
notes of 5.0. Please can someone...
2018 Jan 22
2
[PATCH] lua, perl: Use thread-safe strerror_r instead of strerror (RHBZ#1536763).
...a.ml
index dd6aedbe9..7cfceb152 100644
--- a/generator/lua.ml
+++ b/generator/lua.ml
@@ -63,6 +63,8 @@ let generate_lua_c () =
#endif
#endif
+#include \"ignore-value.h\"
+
#include <guestfs.h>
#include \"guestfs-utils.h\"
@@ -142,6 +144,7 @@ guestfs_int_lua_create (lua_State *L)
guestfs_h *g;
struct userdata *u;
unsigned flags = 0;
+ char err[128];
if (lua_gettop (L) == 1) {
OPTARG_IF_SET (1, \"environment\",
@@ -157,9 +160,10 @@ guestfs_int_lua_create (lua_State *L)
return luaL_error (L, \"Guestfs.create: too many arguments\&quo...
2012 Nov 23
1
[PATCH] lua: fix build error due to LUA_GLOBALSINDEX usage
...ing <olaf at aepfle.de>
---
Fix is only compile tested.
generator/lua.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/generator/lua.ml b/generator/lua.ml
index 88748ae..7461cbd 100644
--- a/generator/lua.ml
+++ b/generator/lua.ml
@@ -723,7 +723,7 @@ push_int64_array (lua_State *L, const int64_t *array, size_t len)
static void
print_any (lua_State *L, int index, FILE *out)
{
- lua_getfield (L, LUA_GLOBALSINDEX, \"tostring\");
+ lua_getglobal(L, \"tostring\");
lua_pushvalue (L, index >= 0 ? index : index-1);
lua_call (L, 1, 1);
fprintf...
2017 Sep 25
0
Errors linking with LLVM 5.0 - dump() missing
....0 is now failing to link because of missing
> implementation for dump(). Errors I get are:
>
> Undefined symbols for architecture x86_64:
>
> "llvm::Type::dump() const", referenced from:
> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
> "llvm::Value::dump() const", referenced from:
> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
> "llvm::Module::dump() const", referenced from:
>
> This appears to be a change that is not documented in the release
> notes...
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:
2014 Apr 29
2
[PATCH][git-pull] lua: make kernel and initrd progress output match in sl_boot_linux
...inux
com32/lua/src/syslinux.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/com32/lua/src/syslinux.c b/com32/lua/src/syslinux.c
index ea702fa..5e57db0 100644
--- a/com32/lua/src/syslinux.c
+++ b/com32/lua/src/syslinux.c
@@ -219,7 +219,7 @@ static int sl_boot_linux(lua_State * L)
msleep(1000);
*/
- printf("Loading kernel %s...\n", kernel);
+ printf("Loading kernel %s... ", kernel);
if (loadfile(kernel, &kernel_data, &kernel_len))
printf("failed!\n");
else
@@ -237,10 +237,10 @@ static int sl_boot_li...
2017 Sep 25
0
Errors linking with LLVM 5.0 - dump() missing
...lly built with versions 3.5 to 4.0 is now failing to link because of missing implementation for dump(). Errors I get are:
Undefined symbols for architecture x86_64:
"llvm::Type::dump() const", referenced from:
ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
"llvm::Value::dump() const", referenced from:
dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
"llvm::Module::dump() const", referenced from:
This appears to be a change that is not documented in the release notes of 5.0. Please can someone...
2017 Sep 25
2
Errors linking with LLVM 5.0 - dump() missing
...to 4.0 is now failing to link because of missing implementation for dump(). Errors I get are:
>
> Undefined symbols for architecture x86_64:
>
> "llvm::Type::dump() const", referenced from:
> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
> "llvm::Value::dump() const", referenced from:
> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
> "llvm::Module::dump() const", referenced from:
>
> This appears to be a change that is not documented in the release notes of...
2017 Sep 25
2
Errors linking with LLVM 5.0 - dump() missing
...because of missing
>> implementation for dump(). Errors I get are:
>>
>> Undefined symbols for architecture x86_64:
>>
>> "llvm::Type::dump() const", referenced from:
>> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
>> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
>> "llvm::Value::dump() const", referenced from:
>> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
>> "llvm::Module::dump() const", referenced from:
>>
>> This appears to be a change that is not documented in the...
2011 Oct 04
1
Added DHCPINFO Tables to the lua.c32 Implementation - syslinux-4.04
...end
+ */
+
+#include <stdio.h>
+#include "dhcp.h"
+#include "lua.h"
+#include "lauxlib.h"
+#include "lualib.h"
+#include <syslinux/pxe.h>
+
+#define STR_BUF_SIZE 129 /* Sized to accomdate File field in BOOTP
message */
+
+void
+ip_address_list(lua_State *L, uint8_t* value, uint8_t len, uint8_t option )
+{
+ static char op_name[64];
+ 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...
2014 Aug 07
2
[PATCH] lua: always return luaL_error in actions
...the null check followed by luaL_error.
---
generator/lua.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generator/lua.ml b/generator/lua.ml
index 9bd4006..5d5619c 100644
--- a/generator/lua.ml
+++ b/generator/lua.ml
@@ -482,8 +482,8 @@ guestfs_lua_delete_event_callback (lua_State *L)
pr "\n";
pr " if (g == NULL)\n";
- pr " luaL_error (L, \"Guestfs.%%s: handle is closed\",\n";
- pr " \"%s\");\n" name;
+ pr " return luaL_error (L, \"Guestfs.%%s: handle is...
2017 Sep 25
0
Errors linking with LLVM 5.0 - dump() missing
...to 4.0 is now failing to link because of missing implementation for dump(). Errors I get are:
>
> Undefined symbols for architecture x86_64:
>
> "llvm::Type::dump() const", referenced from:
> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
> "llvm::Value::dump() const", referenced from:
> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
> "llvm::Module::dump() const", referenced from:
>
> This appears to be a change that is not documented in the release notes of...
2017 Sep 25
2
Errors linking with LLVM 5.0 - dump() missing
...link because of missing implementation for dump(). Errors I get are:
>>
>> Undefined symbols for architecture x86_64:
>>
>> "llvm::Type::dump() const", referenced from:
>> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o
>> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
>> "llvm::Value::dump() const", referenced from:
>> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o
>> "llvm::Module::dump() const", referenced from:
>>
>> This appears to be a change that is not documented in...
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,...
2014 May 14
0
[PATCH][git-pull] lua: make kernel and initrd progress output match in sl_boot_linux
...8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/com32/lua/src/syslinux.c b/com32/lua/src/syslinux.c
> index ea702fa..5e57db0 100644
> --- a/com32/lua/src/syslinux.c
> +++ b/com32/lua/src/syslinux.c
> @@ -219,7 +219,7 @@ static int sl_boot_linux(lua_State * L)
> msleep(1000);
> */
>
> - printf("Loading kernel %s...\n", kernel);
> + printf("Loading kernel %s... ", kernel);
> if (loadfile(kernel, &kernel_data, &kernel_len))
> printf("failed!\n");
> else
>...