From 126f08f7a2d02d43fea9c3652ec58e471a3ddc46 Mon Sep 17 00:00:00 2001 From: Christian Vogelgsang Date: Tue, 5 Apr 2016 11:53:49 +0200 Subject: [PATCH] added lua uae.exe command --- src/lualibuae.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lualibuae.cpp b/src/lualibuae.cpp index 09156d8c0..e3c19c654 100644 --- a/src/lualibuae.cpp +++ b/src/lualibuae.cpp @@ -21,6 +21,7 @@ extern "C" { #include "options.h" #include "identify.h" #include "debug.h" +#include "uaeexe.h" #ifdef WITH_LUA @@ -106,6 +107,14 @@ static int l_uae_log(lua_State *L) return 0; } +static int l_uae_exe(lua_State *L) +{ + const char *s = luaL_checkstring(L, 1); + int result = uaeexe(s); + lua_pushinteger(L, result); + return 1; +} + static const struct luaL_Reg uaelib[] = { {"log", l_uae_log}, {"read_u8", l_uae_read_u8}, @@ -115,6 +124,7 @@ static const struct luaL_Reg uaelib[] = { {"write_u16", l_uae_write_u16}, {"read_config", l_uae_read_config}, {"write_config", l_uae_write_config}, + {"exe", l_uae_exe}, {NULL, NULL} };