本文整理汇总了C++中signal_stop函数的典型用法代码示例。如果您正苦于以下问题:C++ signal_stop函数的具体用法?C++ signal_stop怎么用?C++ signal_stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了signal_stop函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: sig_message_invite
static void sig_message_invite(SERVER_REC *server, const char *channel,
const char *nick, const char *address)
{
if (*channel == '\0' ||
ignore_check(server, nick, address,
channel, NULL, MSGLEVEL_INVITES))
signal_stop();
}
开发者ID:Brijen,项目名称:MacIrssi,代码行数:8,代码来源:fe-ignore-messages.c
示例17: DH1080_received
void DH1080_received(SERVER_REC * server, char *msg, char *nick, char *address,
char *target)
{
int i;
char hisPubKey[300], contactName[CONTACT_SIZE] =
"", encryptedKey[KEYBUF_SIZE] = "";
if (ischannel(*target) || ischannel(*nick))
return; // no KeyXchange for channels...
i = strlen(msg);
if (i < 191 || i > 195)
return;
if (strncmp(msg, "DH1080_INIT ", 12) == 0) {
strcpy(hisPubKey, msg + 12);
if (strspn(hisPubKey, B64ABC) != strlen(hisPubKey))
return;
if (query_find(server, nick) == NULL) { // query window not found, lets create one
keyx_query_created = 1;
irc_query_create(server->tag, nick, TRUE);
keyx_query_created = 0;
}
printtext(server, nick, MSGLEVEL_CRAP,
"\002FiSH:\002 Received DH1080 public key from %s, sending mine...",
nick);
DH1080_gen(g_myPrivKey, g_myPubKey);
irc_send_cmdv((IRC_SERVER_REC *) server, "NOTICE %s :%s %s",
nick, "DH1080_FINISH", g_myPubKey);
} else if (strncmp(msg, "DH1080_FINISH ", 14) == 0)
strcpy(hisPubKey, msg + 14);
else
return;
if (DH1080_comp(g_myPrivKey, hisPubKey) == 0)
return;
signal_stop();
encrypt_key(hisPubKey, encryptedKey);
ZeroMemory(hisPubKey, sizeof(hisPubKey));
if (getIniSectionForContact(server, nick, contactName) == FALSE)
return;
if (setIniValue(contactName, "key", encryptedKey, iniPath) == -1) {
ZeroMemory(encryptedKey, KEYBUF_SIZE);
printtext(server, nick, MSGLEVEL_CRAP,
"\002FiSH ERROR:\002 Unable to write to blow.ini, probably out of space or permission denied.");
return;
}
ZeroMemory(encryptedKey, KEYBUF_SIZE);
printtext(server, nick, MSGLEVEL_CRAP,
"\002FiSH:\002 Key for %s successfully set!", nick);
}
开发者ID:kelek-,项目名称:FiSH-irssi,代码行数:58,代码来源:FiSH.c
示例18: sig_message_nick
static void sig_message_nick(SERVER_REC *server, const char *newnick,
const char *oldnick, const char *address)
{
if (ignore_check(server, oldnick, address,
NULL, NULL, MSGLEVEL_NICKS) ||
ignore_check(server, newnick, address,
NULL, NULL, MSGLEVEL_NICKS))
signal_stop();
}
开发者ID:Brijen,项目名称:MacIrssi,代码行数:9,代码来源:fe-ignore-messages.c
示例19: output_reconnect
static void output_reconnect(struct obs_output *output)
{
int ret;
if (!output->reconnecting) {
output->reconnect_retry_cur_sec = output->reconnect_retry_sec;
output->reconnect_retries = 0;
}
if (output->reconnect_retries >= output->reconnect_retry_max) {
output->reconnecting = false;
if (output->delay_active) {
output->delay_active = false;
obs_output_end_data_capture(output);
}
signal_stop(output, OBS_OUTPUT_DISCONNECTED);
return;
}
if (!output->reconnecting) {
output->reconnecting = true;
os_event_reset(output->reconnect_stop_event);
}
if (output->reconnect_retries) {
output->reconnect_retry_cur_sec *= 2;
}
output->reconnect_retries++;
ret = pthread_create(&output->reconnect_thread, NULL,
&reconnect_thread, output);
if (ret < 0) {
blog(LOG_WARNING, "Failed to create reconnect thread");
output->reconnecting = false;
signal_stop(output, OBS_OUTPUT_DISCONNECTED);
} else {
blog(LOG_INFO, "Output '%s': Reconnecting in %d seconds..",
output->context.name,
output->reconnect_retry_sec);
signal_reconnect(output);
}
}
开发者ID:ahmed1911,项目名称:obs-studio,代码行数:44,代码来源:obs-output.c
示例20: event_text
static void event_text(gchar *line, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
CHANNEL_REC *channel;
GList *comp;
gchar *str, *ptr;
g_return_if_fail(line != NULL);
if (!irc_item_check(item))
return;
/* FIXME: this really should go to fe-common/core. */
line = settings_get_bool("expand_escapes") ?
expand_escapes(line, server, item) : g_strdup(line);
/* check for nick completion */
if (!settings_get_bool("completion_auto") ||
*settings_get_str("completion_char") == '\0')
{
ptr = NULL;
comp = NULL;
}
else
{
ptr = strchr(line, *settings_get_str("completion_char"));
if (ptr != NULL) *ptr++ = '\0';
channel = irc_item_channel(item);
comp = ptr == NULL || channel == NULL ||
nicklist_find(channel, line) != NULL ? NULL :
completion_channel_nicks(channel, line, NULL);
}
/* message to channel */
if (ptr == NULL)
str = g_strdup_printf("%s %s", item->name, line);
else
{
str = g_strdup_printf("%s %s%s%s", item->name,
comp != NULL ? (gchar *) comp->data : line,
settings_get_str("completion_char"), ptr);
}
signal_emit("command msg", 3, str, server, item);
g_free(str);
g_free(line);
if (comp != NULL)
{
g_list_foreach(comp, (GFunc) g_free, NULL);
g_list_free(comp);
}
signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:56,代码来源:irc-completion.c
注:本文中的signal_stop函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论