This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
InfinitShoot/binding/lua/executor/executor.c

22 lines
412 B
C

#include "hazel/hazel.h"
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
int main() {
lua_State* L = luaL_newstate();
if (!L) {
printf("lua init failed\n");
return 1;
}
// luaL_openlibs(L);
if (luaL_loadfile(L, "main.lua") || lua_pcall(L, 0, 0, 0)) {
printf("main.lua load and execute failed\n");
return 1;
}
lua_close(L);
return 0;
}