From 70748de03539eec10aafb9cb78178c275d6e9b47 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 3 Apr 2024 23:50:20 +0800 Subject: improve loadxmi --- core/src/xmake/engine.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/src/xmake/engine.c') diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 827d46d2e..b63dcf42b 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -294,6 +294,9 @@ tb_int_t xm_libc_setbyte(lua_State* lua); // the tty functions tb_int_t xm_tty_term_mode(lua_State* lua); +// the package functions +tb_int_t xm_package_loadxmi(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); @@ -571,6 +574,13 @@ static luaL_Reg const g_tty_functions[] = , { tb_null, tb_null } }; +// the package functions +static luaL_Reg const g_package_functions[] = +{ + { "loadxmi", xm_package_loadxmi } +, { tb_null, tb_null } +}; + // the lua global instance for signal handler static lua_State* g_lua = tb_null; @@ -1158,6 +1168,9 @@ xm_engine_ref_t xm_engine_init(tb_char_t const* name, xm_engine_lni_initalizer_c // bind tty functions xm_lua_register(engine->lua, "tty", g_tty_functions); + // bind package functions + xm_lua_register(engine->lua, "package", g_package_functions); + #ifdef XM_CONFIG_API_HAVE_CURSES // bind curses xm_lua_curses_register(engine->lua, "curses"); -- cgit v1.3.1