#include #include #include "util/util.h" #include "setup.h" #define X(str, mt) const char *glfw_ ## mt ## _tname = str; H_GLFW_METATABLES #undef X void setup_glfw(lua_State *L, int honey_tbl) { /* create metatables */ #define X(str, mt) luaL_newmetatable(L, glfw_ ## mt ## _tname); lua_pop(L, 1); H_GLFW_METATABLES #undef X struct honey_tbl_t tbl[] = { #define X(name, val) H_INT(name, val), H_GLFW_ENUM #undef X #define X(name, func) H_FUNC(name, func), H_GLFW_FUNCTIONS #undef X H_END }; create_table(L, tbl); lua_setfield(L, honey_tbl, "glfw"); }