当前位置: 首页>>代码示例>>C++>>正文


C++ signal_stop函数代码示例

本文整理汇总了C++中signal_stop函数的典型用法代码示例。如果您正苦于以下问题:C++ signal_stop函数的具体用法?C++ signal_stop怎么用?C++ signal_stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了signal_stop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cmd_dcc

static void cmd_dcc(const char *data)
{
	if (*data == '\0') {
		cmd_dcc_list(data);
		signal_stop();
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:7,代码来源:fe-dcc.c

示例2: cmd_action

static void cmd_action(const char *data, IRC_SERVER_REC *server)
{
	CHAT_DCC_REC *dcc;
	char *target, *text, *str;
	void *free_arg;

	g_return_if_fail(data != NULL);

	if (*data != '=') {
		/* handle only DCC actions */
		return;
	}

	if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
			    &target, &text))
		return;
	if (*target == '\0' || *text == '\0')
		cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);

	dcc = dcc_chat_find_id(target+1);
	if (dcc != NULL) {
		str = g_strconcat("ACTION ", text, NULL);
		dcc_ctcp_message(server, dcc->nick, dcc, FALSE, str);
		g_free(str);
	}

	cmd_params_free(free_arg);
	signal_stop();
}
开发者ID:FauxFaux,项目名称:irssi,代码行数:29,代码来源:dcc-chat.c

示例3: sig_message_own_public

static void sig_message_own_public(SERVER_REC *server, const char *msg,
				   const char *target, const char *origtarget)
{
	const char *oldtarget;
	char *nickmode;

	if (!IS_IRC_SERVER(server))
		return;
	oldtarget = target;
	target = skip_target(IRC_SERVER(server), target);
	if (target != oldtarget) {
		/* Hybrid 6 / Bahamut feature, send msg to all
		   ops / ops+voices in channel */
		nickmode = channel_get_nickmode(channel_find(server, target),
						server->nick);

		printformat_module("fe-common/core", server, target,
				   MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT |
				   MSGLEVEL_NO_ACT,
				   TXT_OWN_MSG_CHANNEL,
				   server->nick, oldtarget, msg, nickmode);
		g_free(nickmode);
                signal_stop();
	}
	
}
开发者ID:ameidatou,项目名称:irssi,代码行数:26,代码来源:fe-irc-messages.c

示例4: signal_query_created_curwin

static void signal_query_created_curwin(QUERY_REC *query)
{
	g_return_if_fail(query != NULL);

	window_add_item(active_win, (WI_ITEM_REC *) query, FALSE);
	signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:7,代码来源:fe-query.c

示例5: event_duplicate_channel

static void event_duplicate_channel(IRC_SERVER_REC *server, const char *data)
{
	CHANNEL_REC *chanrec;
	char *params, *channel, *p;

	g_return_if_fail(data != NULL);

	params = event_get_params(data, 3, NULL, NULL, &channel);
	p = strchr(channel, ' ');
	if (p != NULL) *p = '\0';

	if (channel[0] == '!' && channel[1] != '!') {
		chanrec = channel_find(SERVER(server), channel);
		if (chanrec != NULL && !chanrec->names_got) {
			/* duplicate channel - this should only happen when
			   there's some sync problem with servers, rejoining
			   after a while should help.

			   note that this same 407 is sent when trying to
			   create !!channel that already exists so we don't
			   want to try rejoining then. */
			if (channel_rejoin(server, channel)) {
				signal_stop();
			}
		}
	}

	g_free(params);
}
开发者ID:Liaf,项目名称:irssi,代码行数:29,代码来源:channel-rejoin.c

示例6: msg_multi_mode

static void msg_multi_mode(IRC_CHANNEL_REC *channel, const char *sender,
			   const char *addr, const char *mode)
{
	MODE_REC *rec;

	if (modes == NULL)
		signal_add("print starting", (SIGNAL_FUNC) sig_print_starting);

	rec = mode_find_channel(channel);
	if (rec != NULL && strcmp(rec->mode, mode) != 0) {
		/* different mode than last time, show and remove the old */
		print_mode(rec);
		mode_destroy(rec);
		rec = NULL;
	}

	if (rec == NULL) {
                /* no previous mode, create new */
		rec = g_new0(MODE_REC, 1);
		modes = g_slist_append(modes, rec);

		rec->channel = channel;
		rec->mode = g_strdup(mode);
	}

	rec->nicks = g_slist_append(rec->nicks, g_strdup(sender));
	rec->last_mode = time(NULL);

	signal_stop();
}
开发者ID:Brijen,项目名称:MacIrssi,代码行数:30,代码来源:fe-modes.c

示例7: decrypt_notice

/*
 * Decrypt NOTICE messages (and forward DH1080 key-exchange)
 */
void decrypt_notice(SERVER_REC * server, char *msg, char *nick, char *address,
		    char *target)
{
	char *DH1024warn;

	if (strncmp(msg, "DH1024_", 7) == 0) {
		DH1024warn =
		    "\002FiSH:\002 Received \002old DH1024\002 public key from you! Please update to latest version: https://github.com/falsovsky/FiSH-irssi";
		signal_stop();
		irc_send_cmdv((IRC_SERVER_REC *) server, "NOTICE %s :%s\n",
			      nick, DH1024warn);
		signal_emit("message irc own_notice", 3, server, DH1024warn,
			    nick);
		return;
	}

	if (strncmp(msg, "DH1080_", 7) == 0) {
		DH1080_received(server, msg, nick, address, target);
		return;
	}
#ifdef FiSH_DECRYPT_ZNC_LOGS
	if (IsZNCtimestamp(msg))
		msg += 11;
#endif

	FiSH_decrypt(server, msg, msg, ischannel(*target) ? target : nick);
}
开发者ID:bcome,项目名称:FiSH-irssi,代码行数:30,代码来源:FiSH.c

示例8: sig_complete_stats

static void sig_complete_stats(GList **list, WINDOW_REC *window,
			       const char *word, const char *line,
			       int *want_space)
{
	*list = completion_get_servers(word);
	if (*list != NULL) signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:7,代码来源:irc-completion.c

示例9: cmd_ctcp

static void cmd_ctcp(const char *data, IRC_SERVER_REC *server)
{
	CHAT_DCC_REC *dcc;
	char *target, *ctcpcmd, *ctcpdata, *str;
	void *free_arg;

	g_return_if_fail(data != NULL);

	if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST,
			    &target, &ctcpcmd, &ctcpdata))
		return;
	if (*target == '\0' || *ctcpcmd == '\0')
		cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);

	if (*target != '=') {
		/* handle only DCC CTCPs */
		cmd_params_free(free_arg);
		return;
	}

	dcc = dcc_chat_find_id(target+1);
	if (dcc != NULL) {
		ascii_strup(ctcpcmd);

		str = g_strconcat(ctcpcmd, " ", ctcpdata, NULL);
		dcc_ctcp_message(server, dcc->nick, dcc, FALSE, str);
		g_free(str);
	}

	cmd_params_free(free_arg);
	signal_stop();
}
开发者ID:FauxFaux,项目名称:irssi,代码行数:32,代码来源:dcc-chat.c

示例10: cmd_msg

/* Send text to DCC chat */
static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
	CHAT_DCC_REC *dcc;
        GHashTable *optlist;
	char *text, *target;
	void *free_arg;

	g_return_if_fail(data != NULL);

	if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_UNKNOWN_OPTIONS |
			    PARAM_FLAG_OPTIONS | PARAM_FLAG_GETREST, "msg",
			    &optlist, &target, &text))
		return;

	/* handle only DCC messages */
	if (strcmp(target, "*") == 0)
		dcc = item_get_dcc(item);
	else if (*target == '=')
		dcc = dcc_chat_find_id(target+1);
	else
		dcc = NULL;

	if (dcc != NULL && dcc->sendbuf != NULL) {
		char *recoded;

		recoded = recode_out(server, text, dcc->nick);
		dcc_chat_send(dcc, recoded);
		g_free(recoded);
	}

	if (dcc != NULL || *target == '=')
		signal_stop();

	cmd_params_free(free_arg);
}
开发者ID:FauxFaux,项目名称:irssi,代码行数:36,代码来源:dcc-chat.c

示例11: irc_channel_find

static char *get_nicks(IRC_SERVER_REC *server, WI_ITEM_REC *item,
		       const char *data, int op, int voice,
		       IRC_CHANNEL_REC **ret_channel)
{
        IRC_CHANNEL_REC *channel;
        GString *str;
        GHashTable *optlist;
	char **matches, **match, *ret, *channame, *nicks;
	void *free_arg;
        int count, max_modes;

	if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
			    PARAM_FLAG_OPTIONS | PARAM_FLAG_OPTCHAN_NAME,
			    item, "op", &optlist, &channame, &nicks))
		return NULL;

	if (*nicks == '\0')
		return NULL;

	channel = irc_channel_find(server, channame);
	if (channel == NULL) {
		cmd_params_free(free_arg);
		return NULL;
	}

	str = g_string_new(NULL);
	matches = g_strsplit(nicks, " ", -1);
	for (match = matches; *match != NULL; match++) {
		if (strchr(*match, '*') == NULL &&
		    strchr(*match, '?') == NULL) {
			/* no wildcards */
                        g_string_sprintfa(str, "%s ", *match);
		} else {
			count = get_wildcard_nicks(str, *match, channel,
						   op, voice);
                        max_modes = settings_get_int("max_wildcard_modes");
			if (max_modes > 0 && count > max_modes &&
			    g_hash_table_lookup(optlist, "yes") == NULL) {
                                /* too many matches */
				g_string_free(str, TRUE);
				cmd_params_free(free_arg);

				signal_emit("error command", 1,
					    GINT_TO_POINTER(CMDERR_NOT_GOOD_IDEA));
				signal_stop();
                                return NULL;
			}
		}
	}

        if (str->len > 0) g_string_truncate(str, str->len-1);
	ret = str->str;
	g_string_free(str, FALSE);

	cmd_params_free(free_arg);

	*ret_channel = channel;
	return ret;
}
开发者ID:svn2github,项目名称:irssi,代码行数:59,代码来源:modes.c

示例12: cmd_join

static void cmd_join(const char *data, IRC_SERVER_REC *server)
{
	if ((*data == '\0' || g_strncasecmp(data, "-invite", 7) == 0) &&
	    server->last_invite == NULL) {
                printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NOT_INVITED);
		signal_stop();
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:8,代码来源:fe-irc-commands.c

示例13: sig_message_kick

static void sig_message_kick(SERVER_REC *server, const char *channel,
			     const char *nick, const char *kicker,
			     const char *address, const char *reason)
{
	if (ignore_check(server, kicker, address,
			 channel, reason, MSGLEVEL_KICKS))
		signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:8,代码来源:fe-ignore-messages.c

示例14: sig_message_topic

static void sig_message_topic(SERVER_REC *server, const char *channel,
			      const char *topic,
			      const char *nick, const char *address)
{
	if (ignore_check(server, nick, address,
			 channel, topic, MSGLEVEL_TOPICS))
		signal_stop();
}
开发者ID:Brijen,项目名称:MacIrssi,代码行数:8,代码来源:fe-ignore-messages.c

示例15: event_text

static void event_text(const char *data, SERVER_REC *server, EXEC_WI_REC *item)
{
	if (!IS_EXEC_WI(item)) return;

	net_sendbuffer_send(item->process->out, data, strlen(data));
	net_sendbuffer_send(item->process->out, "\n", 1);
        signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:8,代码来源:fe-exec.c


注:本文中的signal_stop函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。