summaryrefslogtreecommitdiff
path: root/src/util/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/util.h')
-rw-r--r--src/util/util.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/util.h b/src/util/util.h
index 231bcc9..6092d11 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -3,7 +3,24 @@
#include <lua.h>
+
+struct honey_tbl_t {
+ const char *key;
+ int type;
+ union {
+ lua_Integer integer;
+ lua_CFunction function;
+ } value;
+};
+
+#define H_INT(k, v) { .key=k, .type=LUA_TNUMBER, .value.integer=v }
+#define H_ENUM(v) { .key=#v, .type=LUA_TNUMBER, .value.integer=v }
+#define H_FUNC(k, v) { .key=k, .type=LUA_TFUNCTION, .value.function=v }
+#define H_END { .key=NULL, .type=LUA_TNIL, .value.integer=0 }
+
+
void setup_util(lua_State *L, int honey_tbl);
+void create_table(lua_State *L, struct honey_tbl_t *tbl);
void append_table(lua_State *L, int tbl_a, int tbl_b);
#endif