summaryrefslogtreecommitdiff
path: root/core/src/xmake/engine.c
diff options
context:
space:
mode:
authorruki <[email protected]>2024-10-25 00:44:03 +0800
committerruki <[email protected]>2024-10-25 00:44:03 +0800
commitc92b5d009f2421ee3cda1933c5cac519659785f1 (patch)
treee4563b150e4453727d531ca865b9f531a8c6a668 /core/src/xmake/engine.c
parentdeb55641c247a86ed0321075977d9a067f73b00d (diff)
add native bin2c
Diffstat (limited to 'core/src/xmake/engine.c')
-rw-r--r--core/src/xmake/engine.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 5fab7e7c1..8753607d4 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -316,6 +316,9 @@ tb_int_t xm_tty_term_mode(lua_State* lua);
// the package functions
tb_int_t xm_package_loadxmi(lua_State* lua);
+// the utils functions
+tb_int_t xm_utils_bin2c(lua_State* lua);
+
#ifdef XM_CONFIG_API_HAVE_CURSES
// register curses functions
tb_int_t xm_lua_curses_register(lua_State* lua, tb_char_t const* module);
@@ -600,6 +603,13 @@ static luaL_Reg const g_package_functions[] =
, { tb_null, tb_null }
};
+// the utils functions
+static luaL_Reg const g_utils_functions[] =
+{
+ { "bin2c", xm_utils_bin2c }
+, { tb_null, tb_null }
+};
+
// the lua global instance for signal handler
static lua_State* g_lua = tb_null;
@@ -1364,6 +1374,9 @@ xm_engine_ref_t xm_engine_init(tb_char_t const* name, xm_engine_lni_initalizer_c
// bind package functions
xm_lua_register(engine->lua, "package", g_package_functions);
+ // bind utils functions
+ xm_lua_register(engine->lua, "utils", g_utils_functions);
+
#ifdef XM_CONFIG_API_HAVE_CURSES
// bind curses
xm_lua_curses_register(engine->lua, "curses");