• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ signal_add函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: noui_init

void noui_init(void)
{
	static struct poptOption options[] = {
		POPT_AUTOHELP
		{ "load", 'l', POPT_ARG_STRING, &autoload_module, 0, "Module to load (default = bot)", "MODULE" },
		{ NULL, '\0', 0, NULL }
	};

	autoload_module = NULL;
	args_register(options);

	irssi_gui = IRSSI_GUI_NONE;
	core_init();
	irc_init();

	signal_add("reload", (SIGNAL_FUNC) sig_reload);
	signal_add("gui exit", (SIGNAL_FUNC) sig_exit);

#ifdef HAVE_STATIC_PERL
        perl_core_init();
#endif
	signal_emit("irssi init finished", 0);
}
开发者ID:svn2github,项目名称:irssi,代码行数:23,代码来源:irssi.c


示例2: keyboard_init

void keyboard_init(void)
{
	keys = g_hash_table_new((GHashFunc) g_str_hash,
				(GCompareFunc) g_str_equal);
	default_keys = g_hash_table_new((GHashFunc) g_str_hash,
					(GCompareFunc) g_str_equal);
	keyinfos = NULL;
	key_states = g_tree_new((GCompareFunc) strcmp);
        key_config_frozen = 0;
	memset(used_keys, 0, sizeof(used_keys));

	key_bind("command", "Run any IRC command", NULL, NULL, (SIGNAL_FUNC) sig_command);
	key_bind("key", "Specify name for key binding", NULL, NULL, (SIGNAL_FUNC) sig_key);
	key_bind("multi", "Run multiple commands", NULL, NULL, (SIGNAL_FUNC) sig_multi);

	/* read the keyboard config when all key binds are known */
	signal_add("irssi init read settings", (SIGNAL_FUNC) read_keyboard_config);
	signal_add("setup reread", (SIGNAL_FUNC) read_keyboard_config);
	signal_add("complete command bind", (SIGNAL_FUNC) sig_complete_bind);

	command_bind("bind", NULL, (SIGNAL_FUNC) cmd_bind);
	command_set_options("bind", "delete");
}
开发者ID:svn2github,项目名称:irssi,代码行数:23,代码来源:keyboard.c


示例3: themes_init

void themes_init(void)
{
	settings_add_str("lookandfeel", "theme", "default");

	default_formats = g_hash_table_new((GHashFunc) g_str_hash,
					   (GCompareFunc) g_str_equal);
	internal_theme = read_internal_theme();

        init_finished = FALSE;
        init_errors = NULL;

	themes_reload();

	command_bind("format", NULL, (SIGNAL_FUNC) cmd_format);
	command_bind("save", NULL, (SIGNAL_FUNC) cmd_save);
	signal_add("complete command format", (SIGNAL_FUNC) sig_complete_format);
	signal_add("irssi init finished", (SIGNAL_FUNC) sig_print_errors);
        signal_add("setup changed", (SIGNAL_FUNC) read_settings);
	signal_add("setup reread", (SIGNAL_FUNC) themes_reload);

	command_set_options("format", "delete reset");
	command_set_options("save", "formats");
}
开发者ID:x3ro,项目名称:macirssi-irrsi,代码行数:23,代码来源:themes.c


示例4: chat_commands_init

void chat_commands_init(void)
{
	settings_add_str("misc", "quit_message", "leaving");

	command_bind("server", NULL, (SIGNAL_FUNC) cmd_server);
	command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect);
	command_bind("connect", NULL, (SIGNAL_FUNC) cmd_connect);
	command_bind("disconnect", NULL, (SIGNAL_FUNC) cmd_disconnect);
	command_bind("quit", NULL, (SIGNAL_FUNC) cmd_quit);
	command_bind("join", NULL, (SIGNAL_FUNC) cmd_join);
	command_bind("msg", NULL, (SIGNAL_FUNC) cmd_msg);
	command_bind("foreach", NULL, (SIGNAL_FUNC) cmd_foreach);
	command_bind("foreach server", NULL, (SIGNAL_FUNC) cmd_foreach_server);
	command_bind("foreach channel", NULL, (SIGNAL_FUNC) cmd_foreach_channel);
	command_bind("foreach query", NULL, (SIGNAL_FUNC) cmd_foreach_query);

	signal_add("default command server", (SIGNAL_FUNC) sig_default_command_server);
	signal_add("server sendmsg", (SIGNAL_FUNC) sig_server_sendmsg);

	command_set_options("connect", "4 6 !! -network ssl +ssl_cert +ssl_pkey ssl_verify +ssl_cafile +ssl_capath +host noproxy -rawlog");
	command_set_options("join", "invite");
	command_set_options("msg", "channel nick");
}
开发者ID:FabrizioFabbe,项目名称:silc,代码行数:23,代码来源:chat-commands.c


示例5: muc_init

void
muc_init(void)
{
	CHAT_PROTOCOL_REC *chat;

	if ((chat = chat_protocol_find(XMPP_PROTOCOL_NAME)) != NULL)
		chat->channel_create = (CHANNEL_REC *(*)
		    (SERVER_REC *, const char *, const char *, int))muc_create;

	disco_add_feature(XMLNS_MUC);
	muc_commands_init();
	muc_events_init();
	muc_nicklist_init();
	muc_reconnect_init();

	signal_add("xmpp features", sig_features);
	signal_add("channel created", sig_channel_created);
	signal_add("channel destroyed", sig_channel_destroyed);
	signal_add("server connected", sig_connected);
	signal_add("xmpp set presence", sig_set_presence);

	settings_add_int("xmpp_lookandfeel", "xmpp_history_maxstanzas", 30);
}
开发者ID:jahrome,项目名称:irssi-xmpp-android,代码行数:23,代码来源:muc.c


示例6: channel_rejoin_init

void channel_rejoin_init(void)
{
	settings_add_bool("servers", "channels_rejoin_unavailable", TRUE);

	rejoin_tag = g_timeout_add(REJOIN_TIMEOUT,
				   (GSourceFunc) sig_rejoin, NULL);

	command_bind_irc("rmrejoins", NULL, (SIGNAL_FUNC) cmd_rmrejoins);
	signal_add_first("event 407", (SIGNAL_FUNC) event_duplicate_channel);
	signal_add_first("event 437", (SIGNAL_FUNC) event_target_unavailable);
	signal_add_first("channel joined", (SIGNAL_FUNC) sig_remove_rejoin);
	signal_add_first("channel destroyed", (SIGNAL_FUNC) sig_remove_rejoin);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected);
}
开发者ID:Liaf,项目名称:irssi,代码行数:14,代码来源:channel-rejoin.c


示例7: fe_server_init

void fe_server_init(void)
{
	command_bind("server", NULL, (SIGNAL_FUNC) cmd_server);
	command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect);
	command_bind("server add", NULL, (SIGNAL_FUNC) cmd_server_add);
	command_bind("server remove", NULL, (SIGNAL_FUNC) cmd_server_remove);
	command_bind_first("server", NULL, (SIGNAL_FUNC) server_command);
	command_bind_first("disconnect", NULL, (SIGNAL_FUNC) server_command);
	command_set_options("server add", "4 6 ssl +ssl_cert +ssl_pkey ssl_verify +ssl_cafile +ssl_capath auto noauto proxy noproxy -host -port");

	signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
	signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting);
	signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
	signal_add("server connect failed", (SIGNAL_FUNC) sig_connect_failed);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
	signal_add("server quit", (SIGNAL_FUNC) sig_server_quit);

	signal_add("server lag disconnect", (SIGNAL_FUNC) sig_server_lag_disconnected);
	signal_add("server reconnect remove", (SIGNAL_FUNC) sig_server_reconnect_removed);
	signal_add("server reconnect not found", (SIGNAL_FUNC) sig_server_reconnect_not_found);

	signal_add("chat protocol unknown", (SIGNAL_FUNC) sig_chat_protocol_unknown);
}
开发者ID:easeip,项目名称:osx-irssi,代码行数:23,代码来源:fe-server.c


示例8: setup_signals

/** Register all necessary signal handlers. */
void setup_signals(void)
{
  struct sigaction act;

  act.sa_handler = SIG_IGN;
  act.sa_flags = 0;
  sigemptyset(&act.sa_mask);
  sigaddset(&act.sa_mask, SIGPIPE);
  sigaddset(&act.sa_mask, SIGALRM);
#ifdef  SIGWINCH
  sigaddset(&act.sa_mask, SIGWINCH);
  sigaction(SIGWINCH, &act, 0);
#endif
  sigaction(SIGPIPE, &act, 0);

  act.sa_handler = sigalrm_handler;
  sigaction(SIGALRM, &act, 0);

  signal_add(&sig_hup, sighup_callback, 0, SIGHUP);
  signal_add(&sig_int, sigint_callback, 0, SIGINT);
  signal_add(&sig_term, sigterm_callback, 0, SIGTERM);
  signal_add(&sig_chld, sigchld_callback, 0, SIGCHLD);
}
开发者ID:jast,项目名称:ircu-now,代码行数:24,代码来源:ircd_signal.c


示例9: luaH_object_add_signal

/* Add a signal to an object.
 * `oud` is the object index on the stack.
 * `name` is the name of the signal.
 * `ud` is the index of function to call when signal is emitted. */
void
luaH_object_add_signal(lua_State *L, gint oud,
        const gchar *name, gint ud) {
    luaH_checkfunction(L, ud);
    lua_object_t *obj = lua_touserdata(L, oud);

    gchar *origin = luaH_callerinfo(L);
    debug("add " ANSI_COLOR_BLUE "\"%s\"" ANSI_COLOR_RESET
            " on %p from " ANSI_COLOR_GREEN "%s" ANSI_COLOR_RESET,
            name, obj, origin);
    g_free(origin);

    signal_add(obj->signals, name, luaH_object_ref_item(L, oud, ud));
}
开发者ID:aidanholm,项目名称:luakit,代码行数:18,代码来源:luaobject.c


示例10: channels_query_init

void channels_query_init(void)
{
	settings_add_bool("misc", "channel_sync", TRUE);
	settings_add_int("misc", "channel_max_who_sync", 1000);

	signal_add("server connected", (SIGNAL_FUNC) sig_connected);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected);
	signal_add("channel joined", (SIGNAL_FUNC) sig_channel_joined);
	signal_add("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);

	signal_add("chanquery mode", (SIGNAL_FUNC) event_channel_mode);
	signal_add("chanquery who end", (SIGNAL_FUNC) event_end_of_who);

	signal_add("chanquery ban end", (SIGNAL_FUNC) event_end_of_banlist);
	signal_add("chanquery abort", (SIGNAL_FUNC) query_current_error);
}
开发者ID:svn2github,项目名称:irssi,代码行数:16,代码来源:channels-query.c


示例11: main

int main(int argc,char **argv)
{
    if(argc<3)
        {
            printf("usage:server [SERVER_IP] [SERVER_PORT]\n");
            exit(0);
        }
    int port=atoi(argv[2]);
    char *ip=argv[1];
    struct sockaddr_in ser;
    ser.sin_addr.s_addr=inet_addr(ip);
    ser.sin_family=AF_INET;
    ser.sin_port=htons(port);
    int sockfd;
    sockfd=socket(AF_INET,SOCK_STREAM,0);
    int i=bind(sockfd,(struct sockaddr*)&ser,sizeof(ser));
    if(i!=0)
        {
            printf("#BIND PORT ERROR#\n");
            exit(0);
        }
    signal_add(SIGCHLD);
    set_non_block(sockfd);
    server_static_init(sockfd);
    listen(sockfd,5);
    int t;
    for(i=0;i<PROCESS_NUM;i++)
        {
            t=fork();
            if(t==0)
                {
                    process();
                    exit(0);
                }
            else if(t<0)
                {
                    printf("#fork error#");
                    exit(0);
                }
            else
                {
                    fork_mark[fork_id]=t;
                    fork_id++;
                }
        }
    while(1)
        {
            server_running_update();
        }
}
开发者ID:yestab123,项目名称:simple_http_server,代码行数:50,代码来源:server.c


示例12: rawlog_init

void rawlog_init(void)
{
	signal_rawlog = signal_get_uniq_id("rawlog");

	settings_add_int("history", "rawlog_lines", 200);
	read_settings();

	signal_add("setup changed", (SIGNAL_FUNC) read_settings);

	command_bind("rawlog", NULL, (SIGNAL_FUNC) cmd_rawlog);
	command_bind("rawlog save", NULL, (SIGNAL_FUNC) cmd_rawlog_save);
	command_bind("rawlog open", NULL, (SIGNAL_FUNC) cmd_rawlog_open);
	command_bind("rawlog close", NULL, (SIGNAL_FUNC) cmd_rawlog_close);
}
开发者ID:Liaf,项目名称:irssi,代码行数:14,代码来源:rawlog.c


示例13: fe_ctcp_init

void fe_ctcp_init(void)
{
	signal_add("default ctcp msg", (SIGNAL_FUNC) ctcp_default_msg);
	signal_add("ctcp msg ping", (SIGNAL_FUNC) ctcp_ping_msg);
	signal_add("ctcp msg version", (SIGNAL_FUNC) ctcp_version_msg);
	signal_add("ctcp msg time", (SIGNAL_FUNC) ctcp_time_msg);
	signal_add("default ctcp reply", (SIGNAL_FUNC) ctcp_default_reply);
	signal_add("ctcp reply ping", (SIGNAL_FUNC) ctcp_ping_reply);
}
开发者ID:svn2github,项目名称:irssi,代码行数:9,代码来源:fe-ctcp.c


示例14: gui_context_nick_init

void gui_context_nick_init(void)
{
        signal_add("gui window context word", (SIGNAL_FUNC) sig_window_word);
        signal_add("gui window context enter", (SIGNAL_FUNC) sig_window_enter);
        signal_add("gui window context leave", (SIGNAL_FUNC) sig_window_leave);
	signal_add("gui window context press", (SIGNAL_FUNC) sig_window_press);
	signal_add("gui nicklist enter", (SIGNAL_FUNC) sig_nicklist_enter);
	signal_add("gui nicklist leave", (SIGNAL_FUNC) sig_nicklist_leave);
}
开发者ID:irssi-import,项目名称:xirssi,代码行数:9,代码来源:gui-context-nick.c


示例15: fe_server_init

void fe_server_init(void)
{
	signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
	signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting);
	signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
	signal_add("server connect failed", (SIGNAL_FUNC) sig_connect_failed);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
	signal_add("server quit", (SIGNAL_FUNC) sig_server_quit);
}
开发者ID:svn2github,项目名称:irssi,代码行数:9,代码来源:fe-server.c


示例16: term_common_init

void term_common_init(void)
{
	const char *dummy;
#ifdef SIGWINCH
	struct sigaction act;
#endif
	settings_add_bool("lookandfeel", "colors", TRUE);
	settings_add_bool("lookandfeel", "term_force_colors", FALSE);
        settings_add_bool("lookandfeel", "mirc_blink_fix", FALSE);

	force_colors = FALSE;
	term_use_colors = term_has_colors() && settings_get_bool("colors");
#ifdef TERM_TRUECOLOR
	settings_add_bool("lookandfeel", "colors_ansi_24bit", FALSE);
	term_use_colors24 = term_has_colors() && settings_get_bool("colors_ansi_24bit");
#else
	term_use_colors24 = FALSE;
#endif
        read_settings();

	if (g_get_charset(&dummy)) {
		term_type = TERM_TYPE_UTF8;
		term_set_input_type(TERM_TYPE_UTF8);
	}

	signal_add("beep", (SIGNAL_FUNC) term_beep);
	signal_add("setup changed", (SIGNAL_FUNC) read_settings);
	command_bind("resize", NULL, (SIGNAL_FUNC) cmd_resize);
	command_bind("redraw", NULL, (SIGNAL_FUNC) cmd_redraw);

#ifdef SIGWINCH
	sigemptyset (&act.sa_mask);
	act.sa_flags = 0;
	act.sa_handler = sig_winch;
	sigaction(SIGWINCH, &act, NULL);
#endif
}
开发者ID:ailin-nemui,项目名称:irssi,代码行数:37,代码来源:term.c


示例17: key_bind

/* Bind a key for function */
void key_bind(gchar *id, gchar *data, gchar *description, gchar *key_default, SIGNAL_FUNC func)
{
    KEYINFO_REC *info;
    KEY_REC *rec;

    g_return_if_fail(id != NULL);
    g_return_if_fail(func != NULL);

    /* create key info record */
    info = key_info_find(id);
    if (info == NULL)
    {
	g_return_if_fail(description != NULL);
	info = g_new0(KEYINFO_REC, 1);
	info->id = g_strdup(id);
	info->description = g_strdup(description);
	keyinfos = g_slist_append(keyinfos, info);

	/* add the signal */
	id = g_strconcat("key ", id, NULL);
	signal_add(id, func);
	g_free(id);

	signal_emit("keyinfo created", 1, info);
    }

    if (key_default == NULL || *key_default == '\0')
    {
	/* just create a possible key command, don't bind it to any key yet */
	return;
    }

    /* create/replace key record */
    rec = g_hash_table_lookup(keys, key_default);
    if (rec != NULL)
    {
	if (rec->data != NULL)
	    g_free(rec->data);
    }
    else
    {
	rec = g_new0(KEY_REC, 1);
	info->keys = g_slist_append(info->keys, rec);
	rec->key = g_strdup(key_default);
	g_hash_table_insert(keys, rec->key, rec);
    }
    rec->info = info;
    rec->data = data == NULL ? NULL : g_strdup(data);
}
开发者ID:svn2github,项目名称:irssi,代码行数:50,代码来源:keyboard.c


示例18: proxy_listen_init

void proxy_listen_init(void)
{
	next_line = g_string_new(NULL);

	proxy_clients = NULL;
	proxy_listens = NULL;
	read_settings();

	signal_add("server incoming", (SIGNAL_FUNC) sig_incoming);
	signal_add("server event", (SIGNAL_FUNC) sig_server_event);
	signal_add("event connected", (SIGNAL_FUNC) event_connected);
	signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
	signal_add_first("event nick", (SIGNAL_FUNC) event_nick);
	signal_add("message own_public", (SIGNAL_FUNC) sig_message_own_public);
	signal_add("message own_private", (SIGNAL_FUNC) sig_message_own_private);
	signal_add("message irc own_action", (SIGNAL_FUNC) sig_message_own_action);
	signal_add("setup changed", (SIGNAL_FUNC) read_settings);

	signal_add("proxy client dump", (SIGNAL_FUNC) sig_dump);
}
开发者ID:kleopatra999,项目名称:irssi,代码行数:20,代码来源:listen.c


示例19: servers_setup_init

void servers_setup_init(void)
{
	settings_add_str("server", "hostname", "");

	settings_add_str("server", "nick", NULL);
	settings_add_str("server", "user_name", NULL);
	settings_add_str("server", "real_name", NULL);

	settings_add_bool("proxy", "use_proxy", FALSE);
	settings_add_str("proxy", "proxy_address", "");
	settings_add_int("proxy", "proxy_port", 6667);
	settings_add_str("proxy", "proxy_string", "CONNECT %s %d");
	settings_add_str("proxy", "proxy_string_after", "");
	settings_add_str("proxy", "proxy_password", "");

        setupservers = NULL;
	source_host_ip4 = source_host_ip6 = NULL;
        old_source_host = NULL;
	read_settings();

	signal_add("setup changed", (SIGNAL_FUNC) read_settings);
	signal_add("setup reread", (SIGNAL_FUNC) read_servers);
        signal_add("irssi init read settings", (SIGNAL_FUNC) read_servers);
}
开发者ID:x3ro,项目名称:macirssi-irrsi,代码行数:24,代码来源:servers-setup.c


示例20: fe_messages_init

void fe_messages_init(void)
{
	printnicks = g_hash_table_new((GHashFunc) g_direct_hash,
				      (GCompareFunc) g_direct_equal);

	settings_add_bool("lookandfeel", "hilight_nick_matches", TRUE);
	settings_add_bool("lookandfeel", "hilight_nick_matches_everywhere", FALSE);
	settings_add_bool("lookandfeel", "emphasis", TRUE);
	settings_add_bool("lookandfeel", "emphasis_replace", FALSE);
	settings_add_bool("lookandfeel", "emphasis_multiword", FALSE);
	settings_add_bool("lookandfeel", "emphasis_italics", FALSE);
	settings_add_bool("lookandfeel", "show_nickmode", TRUE);
	settings_add_bool("lookandfeel", "show_nickmode_empty", TRUE);
	settings_add_bool("lookandfeel", "print_active_channel", FALSE);
	settings_add_bool("lookandfeel", "show_quit_once", FALSE);
	settings_add_bool("lookandfeel", "show_own_nickchange_once", FALSE);

	signal_add_last("message public", (SIGNAL_FUNC) sig_message_public);
	signal_add_last("message private", (SIGNAL_FUNC) sig_message_private);
	signal_add_last("message own_public", (SIGNAL_FUNC) sig_message_own_public);
	signal_add_last("message own_private", (SIGNAL_FUNC) sig_message_own_private);
	signal_add_last("message join", (SIGNAL_FUNC) sig_message_join);
	signal_add_last("message part", (SIGNAL_FUNC) sig_message_part);
	signal_add_last("message quit", (SIGNAL_FUNC) sig_message_quit);
	signal_add_last("message kick", (SIGNAL_FUNC) sig_message_kick);
	signal_add_last("message nick", (SIGNAL_FUNC) sig_message_nick);
	signal_add_last("message own_nick", (SIGNAL_FUNC) sig_message_own_nick);
	signal_add_last("message invite", (SIGNAL_FUNC) sig_message_invite);
	signal_add_last("message topic", (SIGNAL_FUNC) sig_message_topic);

	signal_add("nicklist new", (SIGNAL_FUNC) sig_nicklist_new);
	signal_add("nicklist remove", (SIGNAL_FUNC) sig_nicklist_remove);
	signal_add("nicklist changed", (SIGNAL_FUNC) sig_nicklist_changed);
	signal_add("nicklist host changed", (SIGNAL_FUNC) sig_nicklist_new);
	signal_add("channel joined", (SIGNAL_FUNC) sig_channel_joined);
}
开发者ID:ailin-nemui,项目名称:irssi,代码行数:36,代码来源:fe-messages.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ signal_add_first函数代码示例发布时间:2022-05-30
下一篇:
C++ signalModifiedKey函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap