#include "lua_cj_api.h" #include #include #include int hello() { printf("hellow\n"); return 0; } int main() { redirectfuncs re; re.io_input = &hello; re.io_output = &hello; void *lua_run = init_lua_runner("path",NULL,hello,hello); if(lua_run == NULL) { printf("%d",errno); } if(run(lua_run,"test.lua","path")==-1) printf("%d",errno); lua_runner *runner = (lua_runner*)lua_run; printf("%s",runner->result); cleanup(lua_run); free_lua(lua_run); }