Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void lua_init (const char *file) {
- if (!file) { return; }
- have_file = 1;
- luaState = luaL_newstate();
- luaL_openlibs (luaState);
- int i = 0;
- while (functions[i].name) {
- my_lua_register (luaState, functions[i].name, universal_from_lua);
- i ++;
- }
- lua_register (luaState, "postpone", postpone_from_lua);
- lua_register (luaState, "safe_quit", safe_quit_from_lua);
- lua_register (luaState, "register_interface_function", register_interface_from_lua);
- print_start ();
- int r = luaL_dofile (luaState, file);
- print_end ();
- if (r) {
- logprintf ("lua: %s\n", lua_tostring (luaState, -1));
- exit (1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment