lua-api Questions
2
Solved
There are heaps of examples of how to clone a Lua table in Lua, however I wasn't able to find any example of how to do it with the native Lua C API. I tried to do it by hand twice, but ended up wit...
2
My C program probably has a silly bug. There is a certain point where the Lua stack doesn't contain the values that I think it should.
In order to debug it, I want to print the contents of the Lu...
5
Solved
I've been looking for first-hand information on the World of Warcraft addon API. There are a couple wikis that are pretty good, but their reference links only point internally. Surely there is some...
Revengeful asked 31/8, 2012 at 16:27
3
Solved
I'm currently learning how to use the Lua C API and while I've had success binding functions between C/C++ and Lua, I have a few questions:
Is it a good idea to load multiple scripts into a singl...
Conjunctiva asked 1/4, 2016 at 12:34
4
Solved
If I understand this correctly, Lua by default will call the debug library "debug.traceback" when an error occurs.
However, when embedding Lua into C code like done in the example here:
Simple Lua...
Anderton asked 4/9, 2012 at 3:33
1
Solved
I'm trying to iterate over a table of tables in Lua and output:
The key of each table.
The key / value pair of each entry in each table.
Here is the code:
void print_table(lua_State *L)
{
lua...
3
Solved
I want to create a table like
myTable = {
[0] = { ["a"] = 4, ["b"] = 2 },
[1] = { ["a"] = 13, ["b"] = 37 }
}
using the C API?
My current approach is
lua_createtable(L, 0, 2);
int c = lua_get...
1
Solved
In Lua 5.3 table related functions in the C API receive and return lua_Integer.
void lua_rawgeti (lua_State *L, int idx, lua_Integer n);
void lua_rawseti (lua_State *L, int idx, lua_Integer n);
lu...
2
Solved
test.exe call addTest.lua and set the lua_testobj to the table, and addTest.lua call testobj.dll,
but testobj.dll can not get the "lua_testobj"
error msg is
addTest.lua:9 attempt to index loca...
Automat asked 17/12, 2014 at 2:38
1
Solved
1
Solved
I am writing in C a userdata type for use in Lua. It has some array-type properties and various methods aswell. Right now if u is of this type, I use u:set(k,v) resp. u:get(k) to access data and e....
Brassy asked 17/11, 2014 at 10:15
2
Solved
1
Solved
I'm trying to pass a Lua table to my C program but I don´t know how to do it.
My Lua code:
local stages = {}
stages[1] = stage1
stages[2] = stage2
stages[3] = stage3
lstage.buildpollingtable(sta...
2
Solved
Is it possible to get all the errors in the lua stack from C/C++? here is what I've tried
c++
int main()
{
lua_State* L = luaL_newstate();
luaL_openlibs(L);
if (luaL_loadfile(L, "LuaBridgeScr...
1
Solved
I am attempting to create a GC finalizer for a function value by storing it in a weak table using the C API.
I started off by writing a prototype in pure Lua 5.2:
local function myfinalizer()
p...
Cryptogenic asked 6/6, 2014 at 17:51
1
Solved
3
Solved
I want to execute an untrusted .lua file in its own environment by calling lua_setfenv() so that it cannot affect any of my code.
The documentation for that function though only explains how to ca...
3
Solved
I'm working on a small project trying to integrate lua with c++.
My problem however is as follows:
I have multiple lua scripts, lets call them s1.lua s2.lua and s3.lua. Each of these has the follo...
1
Solved
luaL_loadfile(mState, path.c_str());
lua_pcall(mState, 0, 0, 0);
Is there a way to put an execution time limit (say 10-20 seconds) for those two C++ statements, that load and then execute a lua f...
1
© 2022 - 2024 — McMap. All rights reserved.