7 function_ptr_luafun
lua_print("print", [](lua_State
* LS
, const std::string
& fname
) -> int {
9 while(!lua_isnone(LS
, stacksize
+ 1))
13 for(int i
= 0; i
< stacksize
; i
++) {
15 const char* tmp
= NULL
;
16 if(lua_isnil(LS
, i
+ 1)) {
19 } else if(lua_isboolean(LS
, i
+ 1) && lua_toboolean(LS
, i
+ 1)) {
22 } else if(lua_isboolean(LS
, i
+ 1) && !lua_toboolean(LS
, i
+ 1)) {
26 tmp
= lua_tolstring(LS
, i
+ 1, &len
);
28 tmp
= "(unprintable)";
32 std::string
localmsg(tmp
, tmp
+ len
);
36 toprint
= toprint
+ "\t" + localmsg
;
39 window::message(toprint
);
43 function_ptr_luafun
lua_exec("exec", [](lua_State
* LS
, const std::string
& fname
) -> int {
44 std::string text
= get_string_argument(LS
, 1, fname
.c_str());
45 command::invokeC(text
);