well I have a question, I was wondering if it is possible to count the settings that exist within a function lua_getglobal.
I have a file called define.lua he is as follows:
tbl {
macro_enable = true;
macro_value = 100;
time_expire = 60;
enable_mac = true;
};
What I'm trying to insert a message in my code to count the amount of existetes settings
code:
lua_getglobal(L, "tbl");
lua_getfield(L, -1, "macro_enable");
p->macro_enable = lua_toboolean(L, -1);
lua_getfield(L, -1, "macro_value");
p->macro_value = lua_tointeger(L, -1);
lua_getfield(L, -1, "time_expire");
p->time_expire = lua_tointeger(L, -1);
lua_getfield(L, -1, "enable_mac");
p->enable_mac = lua_toboolean(L, -1);
Want to add a message.
printf ("% d configurations have been read");
I tried to do a loop more without success