lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm not sure if you can do something like that in C. In C, aren't data structures like structs defined at compile time? You could make a data structure and then populate it based on a Lua method or something but it feels like it'd be better to do it from C instead if it's just going to stay in C (alternatively, if it's needed in Lua, provide a method to push a table populated with the config to Lua).

On Fri, Oct 27, 2017 at 3:02 AM Miha Cooper <mihakuper@gmail.com> wrote:
What about C/C++ bindings over Lua API like Sol2 or LuaBridge? Is it necessary to generate structures to parse configs?

On 27 October 2017 at 09:59, Russell Haley <russ.haley@gmail.com> wrote:
Hi,

I was hoping someone had already written something that can use Lua
tables as templates for generating C structures? The idea was to
generate the structures to be used to read config files in C.

Yes, very light on requirements.

Thanks,
Russ




--
With best regards,
Kupriyanov Mikhail.
--
--
Ryan | Charles <vandor2012@gmail.com>
Software Developer / System Administrator
https://hashbang.sh