lua-users home
lua-l archive

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

Hello All,

I have not so many knowledge of Lua and Lua/C bindings packages
like tolua, Luna, LuaWarapper and so on. And the question is: how quick
and fast do the *direct* binding between Lua data and C structures to access
this data from C?

For example, I have "smart" Lua-based configuration file, like

 Faults = {
      [1000] = {title="message1", type=20},
      [2000] = {title="message2", type=30}

And I want to access this data directly from my C-code, like 

 struct faults {
   char *title;
   int type;
 } *Faults;
 lua_dofile("faults.lua"); // run config file to init the above Faults
 char *str = Faults[1000]->title; // and now get directly the field

I walked through tolua docs (and alternate bindings packages), but they are
pointed more on access C-data/functions from Lua, and I need vice versa 

Thanks in advance,

Ilja V.Levinson,        Yekaterinburg, Russia 
OS-9 Software
*        Great talkers are never great doers.