diff options
Diffstat (limited to 'core/src/xmake/machine.c')
| -rw-r--r-- | core/src/xmake/machine.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index b9977d92a..8eca36a8b 100644 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -103,6 +103,11 @@ tb_int_t xm_process_close(lua_State* lua); // the sandbox functions tb_int_t xm_sandbox_interactive(lua_State* lua); +#ifdef XM_CONFIG_API_HAVE_READLINE +// the readline functions +tb_int_t xm_readline_readline(lua_State* lua); +#endif + /* ////////////////////////////////////////////////////////////////////////////////////// * globals */ @@ -173,6 +178,15 @@ static luaL_Reg const g_sandbox_functions[] = , { tb_null, tb_null } }; +#ifdef XM_CONFIG_API_HAVE_READLINE +// the readline functions +static luaL_Reg const g_readline_functions[] = +{ + { "readline", xm_readline_readline } +, { tb_null, tb_null } +}; +#endif + /* ////////////////////////////////////////////////////////////////////////////////////// * private implementation */ @@ -379,6 +393,11 @@ xm_machine_ref_t xm_machine_init() // bind sandbox functions luaL_register(impl->lua, "sandbox", g_sandbox_functions); +#ifdef XM_CONFIG_API_HAVE_READLINE + // bind readline functions + luaL_register(impl->lua, "readline", g_readline_functions); +#endif + // init host #if defined(TB_CONFIG_OS_WINDOWS) lua_pushstring(impl->lua, "windows"); |
