diff options
Diffstat (limited to 'src/lua/libraries/luax/luax.h')
-rw-r--r-- | src/lua/libraries/luax/luax.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lua/libraries/luax/luax.h b/src/lua/libraries/luax/luax.h index b6b3e80..1c83912 100644 --- a/src/lua/libraries/luax/luax.h +++ b/src/lua/libraries/luax/luax.h @@ -401,6 +401,20 @@ inline void luax_setfieldstrings(lua_State* L, const luax_Str* strs) } } +typedef struct luax_Num +{ + const char* name; + float number; +}; + +inline void luax_setfieldnumbers(lua_State* L, const luax_Num* strs) +{ + for (int i = 0; strs[i].name != 0; ++i) + { + luax_setfieldnumber(L, strs[i].name, strs[i].number); + } +} + typedef luaL_Reg luax_Ref; #endif // #if LUA_VERSION_NUM == 501 |