public void LoadLua() { if (L != IntPtr.Zero) { Melua.lua_close(L); } L = Melua.luaL_newstate(); Melua.melua_openlib(L, LuaLib.BaseSafe); Melua.melua_register(L, "loadxmlfile", loadxmlfile); Melua.melua_register(L, "setattributes", setattributes); Melua.melua_register(L, "addelement", addelement); Melua.melua_register(L, "removeelements", removeelements); Melua.melua_register(L, "replacefile", replacefile); Melua.melua_register(L, "replace", replace); Melua.melua_register(L, "include", include); Melua.melua_register(L, "require", require); }