예제 #1
0
static
XS (XS_Xchat_Embed_plugingui_remove)
{
	void *gui_entry;
	dXSARGS;
	if (items != 1) {
		xchat_print (ph, "Usage: Xchat::Embed::plugingui_remove(handle)");
	} else {
		gui_entry = INT2PTR (void *, SvUV (ST (0)));
		xchat_plugingui_remove (ph, gui_entry);
	}
	XSRETURN_EMPTY;
}
예제 #2
0
파일: lua.c 프로젝트: JordanKinsley/hexchat
void lxc_unload_script(struct lxc_States *state)
{
	struct lxc_hooks *hooks, *h;
	struct lxc_cbdata *cb;
	struct lxc_userdata *ud, *u;
	lua_State *L = state->state;

	lua_pushstring(L, "xchat_unload");
	lua_gettable(L, LUA_GLOBALSINDEX);
	if (lua_type(L, -1) == LUA_TFUNCTION) {
		if (lua_pcall(L, 0, 0, 0)) {
			xchat_printf(ph, "Lua plugin: error while unloading script %s", 	
								lua_tostring(L, -1));
			lua_pop(L, 1);
		}
	}

	if (state->gui)
		xchat_plugingui_remove(ph, state->gui);
	state->gui = NULL;

	hooks = state->hooks;
	while (hooks) {
		h     = hooks;
		hooks = hooks->next;

		cb    = xchat_unhook(ph, h->hook);
		if (cb) {
			ud    = cb->data;
			while (ud) {
				u  = ud;
				ud = ud->next;
				free(u);
			}
			free(cb);
		}

		free(h);
	}
	lua_close(state->state);
}