diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/command.c | 184 | ||||
-rw-r--r-- | src/common/completion.c | 8 | ||||
-rw-r--r-- | src/common/fifo.c | 4 | ||||
-rw-r--r-- | src/common/history.c | 4 | ||||
-rw-r--r-- | src/common/session.c | 28 | ||||
-rw-r--r-- | src/common/weechat.c | 48 | ||||
-rw-r--r-- | src/common/weeconfig.c | 42 |
7 files changed, 160 insertions, 158 deletions
diff --git a/src/common/command.c b/src/common/command.c index 311ac3868..98ffdcc28 100644 --- a/src/common/command.c +++ b/src/common/command.c @@ -679,7 +679,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string strcat (unknown_command, " :"); strcat (unknown_command, ptr_args); } - irc_cmd_send_quote (server, channel, unknown_command); + irc_send_cmd_quote (server, channel, unknown_command); free (unknown_command); } } @@ -725,7 +725,7 @@ user_message_display (t_irc_server *server, t_gui_buffer *buffer, char *text) } else { - ptr_nick = nick_search (CHANNEL(buffer), server->nick); + ptr_nick = irc_nick_search (CHANNEL(buffer), server->nick); if (ptr_nick) { irc_display_nick (buffer, ptr_nick, NULL, @@ -783,7 +783,7 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text) next = pos; } - server_sendf_queued (server, "PRIVMSG %s :%s", CHANNEL(buffer)->name, text); + irc_server_sendf_queued (server, "PRIVMSG %s :%s", CHANNEL(buffer)->name, text); user_message_display (server, buffer, text); if (next) @@ -854,7 +854,7 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o if (pos) pos[0] = '\0'; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); if (is_command (ptr_cmd)) { @@ -881,9 +881,9 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o } else { - dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat), - "%s\r\n", - (command_with_colors) ? command_with_colors : ptr_cmd); + irc_dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat), + "%s\r\n", + (command_with_colors) ? command_with_colors : ptr_cmd); user_message_display (server, buffer, (command_with_colors) ? command_with_colors : ptr_cmd); @@ -1090,7 +1090,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, char *error, *pos, **argv; int argc, target_buffer, count; - irc_find_context (server, channel, &window, &buffer); + gui_buffer_find_context (server, channel, &window, &buffer); argv = explode_string (arguments, " ", 0, &argc); @@ -1180,7 +1180,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, free_exploded_string (argv); return -1; } - server_disconnect (SERVER(buffer), 0); + irc_server_disconnect (SERVER(buffer), 0); ptr_server = SERVER(buffer); if (!buffer->all_servers) { @@ -1205,7 +1205,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, ptr_server = SERVER(buffer); ptr_channel = CHANNEL(buffer); gui_buffer_free (ptr_channel->buffer, 1); - channel_free (ptr_server, ptr_channel); + irc_channel_free (ptr_server, ptr_channel); gui_status_draw (gui_current_window->buffer, 1); gui_input_draw (gui_current_window->buffer, 1); } @@ -1221,7 +1221,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, if (pos) pos += 6; CHANNEL(buffer)->close = 1; - irc_cmd_send_part (SERVER(buffer), + irc_send_cmd_part (SERVER(buffer), CHANNEL(buffer), pos); } @@ -1231,7 +1231,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, ptr_server = SERVER(buffer); gui_buffer_free (buffer, 1); if (ptr_channel) - channel_free (ptr_server, ptr_channel); + irc_channel_free (ptr_server, ptr_channel); } } else @@ -1256,7 +1256,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, { gui_printf (NULL, " %s:%d", ptr_server->name, - server_get_default_notify_level (ptr_server)); + irc_server_get_default_notify_level (ptr_server)); count++; } } @@ -1315,8 +1315,8 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, } if (BUFFER_IS_SERVER(buffer)) { - server_set_default_notify_level (SERVER(buffer), - number); + irc_server_set_default_notify_level (SERVER(buffer), + number); irc_display_prefix (NULL, NULL, PREFIX_INFO); gui_printf (NULL, _("New default notify level for server %s%s%s: %s%d %s"), GUI_COLOR(COLOR_WIN_CHAT_SERVER), @@ -1328,9 +1328,9 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, } else { - channel_set_notify_level (SERVER(buffer), - CHANNEL(buffer), - number); + irc_channel_set_notify_level (SERVER(buffer), + CHANNEL(buffer), + number); irc_display_prefix (NULL, NULL, PREFIX_INFO); gui_printf (NULL, _("New notify level for %s%s%s: %s%d %s"), GUI_COLOR(COLOR_WIN_CHAT_CHANNEL), @@ -1418,7 +1418,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel, ptr_buffer = gui_buffer_search (argv[0], argv[1]); else { - if (string_is_channel (argv[0])) + if (irc_channel_is_channel (argv[0])) ptr_buffer = gui_buffer_search (NULL, argv[0]); else ptr_buffer = gui_buffer_search (argv[0], NULL); @@ -1512,7 +1512,7 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel, } else { - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); gui_buffer_clear (buffer); } @@ -1549,7 +1549,7 @@ weechat_cmd_connect_one_server (t_irc_server *server, t_gui_window *window) BUFFER_TYPE_STANDARD, 1)) return 0; } - if (server_connect (server)) + if (irc_server_connect (server)) { server->reconnect_start = 0; server->reconnect_join = (server->channels) ? 1 : 0; @@ -1573,7 +1573,7 @@ weechat_cmd_connect (t_irc_server *server, t_irc_channel *channel, t_irc_server *ptr_server; int i, connect_ok; - irc_find_context (server, channel, &window, &buffer); + gui_buffer_find_context (server, channel, &window, &buffer); if (argc == 0) connect_ok = weechat_cmd_connect_one_server (server, window); @@ -1597,7 +1597,7 @@ weechat_cmd_connect (t_irc_server *server, t_irc_channel *channel, { for (i = 0; i < argc; i++) { - ptr_server = server_search (argv[i]); + ptr_server = irc_server_search (argv[i]); if (ptr_server) { if (!weechat_cmd_connect_one_server (ptr_server, window)) @@ -1631,7 +1631,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel, t_gui_buffer *buffer; char *pos_nick, *pos_file; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); /* DCC SEND file */ if (strncasecmp (arguments, "send", 4) == 0) @@ -1662,7 +1662,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel, while (pos_file[0] == ' ') pos_file++; - dcc_send_request (server, DCC_FILE_SEND, pos_nick, pos_file); + irc_dcc_send_request (server, DCC_FILE_SEND, pos_nick, pos_file); } /* DCC CHAT */ else if (strncasecmp (arguments, "chat", 4) == 0) @@ -1679,7 +1679,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel, while (pos_nick[0] == ' ') pos_nick++; - dcc_send_request (server, DCC_CHAT_SEND, pos_nick, NULL); + irc_dcc_send_request (server, DCC_CHAT_SEND, pos_nick, NULL); } /* close DCC CHAT */ else if (ascii_strcasecmp (arguments, "close") == 0) @@ -1687,8 +1687,8 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel, if (BUFFER_IS_PRIVATE(buffer) && CHANNEL(buffer)->dcc_chat) { - dcc_close ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat), DCC_ABORTED); - dcc_redraw (1); + irc_dcc_close ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat), DCC_ABORTED); + irc_dcc_redraw (1); } } /* unknown DCC action */ @@ -1781,7 +1781,7 @@ weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel, for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { - server_outqueue_free_all (ptr_server); + irc_server_outqueue_free_all (ptr_server); } gui_printf_nolog (NULL, "\n"); gui_printf_nolog (NULL, "DEBUG: outqueue DELETED for all servers.\n"); @@ -1822,7 +1822,7 @@ weechat_cmd_disconnect_one_server (t_irc_server *server) _("Auto-reconnection is cancelled\n")); } irc_send_quit_server (server, NULL); - server_disconnect (server, 0); + irc_server_disconnect (server, 0); gui_status_draw (server->buffer, 1); /* disconnect ok */ @@ -1841,7 +1841,7 @@ weechat_cmd_disconnect (t_irc_server *server, t_irc_channel *channel, t_irc_server *ptr_server; int i, disconnect_ok; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); if (argc == 0) disconnect_ok = weechat_cmd_disconnect_one_server (server); @@ -1866,7 +1866,7 @@ weechat_cmd_disconnect (t_irc_server *server, t_irc_channel *channel, { for (i = 0; i < argc; i++) { - ptr_server = server_search (argv[i]); + ptr_server = irc_server_search (argv[i]); if (ptr_server) { if (!weechat_cmd_disconnect_one_server (ptr_server)) @@ -2072,7 +2072,7 @@ weechat_cmd_history (t_irc_server *server, t_irc_channel *channel, int n_total; int n_user; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); n_user = cfg_history_display_default; @@ -2148,7 +2148,7 @@ weechat_cmd_ignore (t_irc_server *server, t_irc_channel *channel, t_irc_ignore *ptr_ignore; int i; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); ptr_ignore = NULL; switch (argc) @@ -2180,22 +2180,22 @@ weechat_cmd_ignore (t_irc_server *server, t_irc_channel *channel, return 0; break; case 1: - ptr_ignore = ignore_add (argv[0], "*", "*", - (SERVER(buffer)) ? - SERVER(buffer)->name : "*"); + ptr_ignore = irc_ignore_add (argv[0], "*", "*", + (SERVER(buffer)) ? + SERVER(buffer)->name : "*"); break; case 2: - ptr_ignore = ignore_add (argv[0], argv[1], "*", - (SERVER(buffer)) ? - SERVER(buffer)->name : "*"); + ptr_ignore = irc_ignore_add (argv[0], argv[1], "*", + (SERVER(buffer)) ? + SERVER(buffer)->name : "*"); break; case 3: - ptr_ignore = ignore_add (argv[0], argv[1], argv[2], - (SERVER(buffer)) ? - SERVER(buffer)->name : "*"); + ptr_ignore = irc_ignore_add (argv[0], argv[1], argv[2], + (SERVER(buffer)) ? + SERVER(buffer)->name : "*"); break; case 4: - ptr_ignore = ignore_add (argv[0], argv[1], argv[2], argv[3]); + ptr_ignore = irc_ignore_add (argv[0], argv[1], argv[2], argv[3]); break; } if (ptr_ignore) @@ -2253,7 +2253,7 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel, t_gui_key *ptr_key; void (*ptr_function)(t_gui_window *, char *); - irc_find_context (server, channel, &window, &buffer); + gui_buffer_find_context (server, channel, &window, &buffer); if (arguments) { @@ -2756,8 +2756,8 @@ weechat_cmd_reconnect_one_server (t_irc_server *server) return 0; } irc_send_quit_server (server, NULL); - server_disconnect (server, 0); - if (server_connect (server)) + irc_server_disconnect (server, 0); + if (irc_server_connect (server)) { server->reconnect_start = 0; server->reconnect_join = (server->channels) ? 1 : 0; @@ -2780,7 +2780,7 @@ weechat_cmd_reconnect (t_irc_server *server, t_irc_channel *channel, t_irc_server *ptr_server; int i, reconnect_ok; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); if (argc == 0) reconnect_ok = weechat_cmd_reconnect_one_server (server); @@ -2804,7 +2804,7 @@ weechat_cmd_reconnect (t_irc_server *server, t_irc_channel *channel, { for (i = 0; i < argc; i++) { - ptr_server = server_search (argv[i]); + ptr_server = irc_server_search (argv[i]); if (ptr_server) { if (!weechat_cmd_reconnect_one_server (ptr_server)) @@ -2883,7 +2883,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, t_gui_buffer *ptr_buffer; char *server_name; - irc_find_context (server, channel, &window, &buffer); + gui_buffer_find_context (server, channel, &window, &buffer); if ((argc == 0) || (argc == 1)) { @@ -2906,7 +2906,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, } else { - ptr_server = server_search (argv[0]); + ptr_server = irc_server_search (argv[0]); if (ptr_server) irc_display_server (ptr_server); else @@ -2937,7 +2937,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, } /* look for server by name */ - server_found = server_search (argv[1]); + server_found = irc_server_search (argv[1]); if (!server_found) { irc_display_prefix (NULL, NULL, PREFIX_ERROR); @@ -2967,7 +2967,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, server_name = strdup (server_found->name); - server_free (server_found); + irc_server_free (server_found); irc_display_prefix (NULL, NULL, PREFIX_INFO); gui_printf (NULL, _("Server %s%s%s has been deleted\n"), @@ -2983,7 +2983,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, } /* init server struct */ - server_init (&server_tmp); + irc_server_init (&server_tmp); if (argc < 3) { @@ -2991,17 +2991,17 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing parameters for \"%s\" command\n"), WEECHAT_ERROR, "server"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } - if (server_name_already_exists (argv[0])) + if (irc_server_name_already_exists (argv[0])) { irc_display_prefix (NULL, NULL, PREFIX_ERROR); gui_printf (NULL, _("%s server \"%s\" already exists, can't create it!\n"), WEECHAT_ERROR, argv[0]); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } @@ -3030,7 +3030,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing password for \"%s\" parameter\n"), WEECHAT_ERROR, "-pwd"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } server_tmp.password = strdup (argv[++i]); @@ -3043,7 +3043,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing nick(s) for \"%s\" parameter\n"), WEECHAT_ERROR, "-nicks"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } server_tmp.nick1 = strdup (argv[++i]); @@ -3058,7 +3058,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing password for \"%s\" parameter\n"), WEECHAT_ERROR, "-username"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } server_tmp.username = strdup (argv[++i]); @@ -3071,7 +3071,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing password for \"%s\" parameter\n"), WEECHAT_ERROR, "-realname"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } server_tmp.realname = strdup (argv[++i]); @@ -3084,7 +3084,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing command for \"%s\" parameter\n"), WEECHAT_ERROR, "-command"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } server_tmp.command = strdup (argv[++i]); @@ -3097,7 +3097,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s missing password for \"%s\" parameter\n"), WEECHAT_ERROR, "-autojoin"); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } server_tmp.autojoin = strdup (argv[++i]); @@ -3106,16 +3106,16 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, } /* create new server */ - new_server = server_new (server_tmp.name, server_tmp.autoconnect, - server_tmp.autoreconnect, - server_tmp.autoreconnect_delay, - 0, server_tmp.address, server_tmp.port, - server_tmp.ipv6, server_tmp.ssl, - server_tmp.password, server_tmp.nick1, - server_tmp.nick2, server_tmp.nick3, - server_tmp.username, server_tmp.realname, - server_tmp.hostname, - server_tmp.command, 1, server_tmp.autojoin, 1, NULL); + new_server = irc_server_new (server_tmp.name, server_tmp.autoconnect, + server_tmp.autoreconnect, + server_tmp.autoreconnect_delay, + 0, server_tmp.address, server_tmp.port, + server_tmp.ipv6, server_tmp.ssl, + server_tmp.password, server_tmp.nick1, + server_tmp.nick2, server_tmp.nick3, + server_tmp.username, server_tmp.realname, + server_tmp.hostname, + server_tmp.command, 1, server_tmp.autojoin, 1, NULL); if (new_server) { irc_display_prefix (NULL, NULL, PREFIX_INFO); @@ -3130,7 +3130,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, gui_printf (NULL, _("%s unable to create server\n"), WEECHAT_ERROR); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); return -1; } @@ -3138,10 +3138,10 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel, { (void) gui_buffer_new (window, new_server, NULL, BUFFER_TYPE_STANDARD, 1); - server_connect (new_server); + irc_server_connect (new_server); } - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); } return 0; } @@ -3198,7 +3198,7 @@ weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *val { if (cfg_log_hide_nickserv_pwd) { - irc_hide_password (value2, 1); + irc_display_hide_password (value2, 1); if (strcmp (*((char **)value), value2) != 0) gui_printf (NULL, _("%s(password hidden) "), GUI_COLOR(COLOR_WIN_CHAT)); @@ -3294,7 +3294,7 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel, { /* server config option modification */ pos[0] = '\0'; - ptr_server = server_search (option); + ptr_server = irc_server_search (option); if (!ptr_server) { irc_display_prefix (NULL, NULL, PREFIX_ERROR); @@ -3754,7 +3754,7 @@ weechat_cmd_unignore (t_irc_server *server, t_irc_channel *channel, char *error; int number, ret; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); ret = 0; switch (argc) @@ -3768,24 +3768,24 @@ weechat_cmd_unignore (t_irc_server *server, t_irc_channel *channel, error = NULL; number = strtol (argv[0], &error, 10); if ((error) && (error[0] == '\0')) - ret = ignore_search_free_by_number (number); + ret = irc_ignore_search_free_by_number (number); else - ret = ignore_search_free (argv[0], "*", "*", - (SERVER(buffer)) ? - SERVER(buffer)->name : "*"); + ret = irc_ignore_search_free (argv[0], "*", "*", + (SERVER(buffer)) ? + SERVER(buffer)->name : "*"); break; case 2: - ret = ignore_search_free (argv[0], argv[1], "*", - (SERVER(buffer)) ? - SERVER(buffer)->name : "*"); + ret = irc_ignore_search_free (argv[0], argv[1], "*", + (SERVER(buffer)) ? + SERVER(buffer)->name : "*"); break; case 3: - ret = ignore_search_free (argv[0], argv[1], argv[2], - (SERVER(buffer)) ? - SERVER(buffer)->name : "*"); + ret = irc_ignore_search_free (argv[0], argv[1], argv[2], + (SERVER(buffer)) ? + SERVER(buffer)->name : "*"); break; case 4: - ret = ignore_search_free (argv[0], argv[1], argv[2], argv[3]); + ret = irc_ignore_search_free (argv[0], argv[1], argv[2], argv[3]); break; } @@ -3934,7 +3934,7 @@ weechat_cmd_uptime (t_irc_server *server, t_irc_channel *channel, int day, hour, min, sec; char string[256]; - irc_find_context (server, channel, NULL, &buffer); + gui_buffer_find_context (server, channel, NULL, &buffer); running_time = time (NULL) - weechat_start_time; day = running_time / (60 * 60 * 24); @@ -3998,7 +3998,7 @@ weechat_cmd_window (t_irc_server *server, t_irc_channel *channel, char *error; long number; - irc_find_context (server, channel, &window, &buffer); + gui_buffer_find_context (server, channel, &window, &buffer); if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0))) { diff --git a/src/common/completion.c b/src/common/completion.c index 91263bbbd..9910637ed 100644 --- a/src/common/completion.c +++ b/src/common/completion.c @@ -578,7 +578,8 @@ completion_list_add_channel_nicks (t_completion *completion) for (ptr_weelist = ((t_irc_channel *)(completion->channel))->nicks_speaking; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist) { - if (nick_search ((t_irc_channel *)(completion->channel), ptr_weelist->data)) + if (irc_nick_search ((t_irc_channel *)(completion->channel), + ptr_weelist->data)) completion_list_add (completion, ptr_weelist->data, 1, WEELIST_POS_BEGINNING); } @@ -1418,7 +1419,8 @@ completion_nick (t_completion *completion) for (ptr_weelist = ((t_irc_channel *)(completion->channel))->nicks_speaking; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist) { - if (nick_search ((t_irc_channel *)(completion->channel), ptr_weelist->data)) + if (irc_nick_search ((t_irc_channel *)(completion->channel), + ptr_weelist->data)) weelist_add (&(completion->completion_list), &(completion->last_completion), ptr_weelist->data, @@ -1516,7 +1518,7 @@ completion_auto (t_completion *completion) } /* channel completion */ - if (string_is_channel (completion->base_word)) + if (irc_channel_is_channel (completion->base_word)) { if (!completion->completion_list) completion_list_add_server_channels (completion); diff --git a/src/common/fifo.c b/src/common/fifo.c index 1fdf6eb44..8cb097653 100644 --- a/src/common/fifo.c +++ b/src/common/fifo.c @@ -147,7 +147,7 @@ fifo_exec (char *text) pos = strchr (text, ','); if (pos) pos[0] = '\0'; - ptr_server = server_search (text); + ptr_server = irc_server_search (text); if (!ptr_server || !ptr_server->buffer) { irc_display_prefix (NULL, NULL, PREFIX_ERROR); @@ -157,7 +157,7 @@ fifo_exec (char *text) } if (ptr_server && pos) { - ptr_channel = channel_search_any (ptr_server, pos + 1); + ptr_channel = irc_channel_search_any (ptr_server, pos + 1); if (!ptr_channel) { irc_display_prefix (NULL, NULL, PREFIX_ERROR); diff --git a/src/common/history.c b/src/common/history.c index 8e260b7d9..ab222332f 100644 --- a/src/common/history.c +++ b/src/common/history.c @@ -62,7 +62,7 @@ history_buffer_add (void *buffer, char *string) { new_history->text = strdup (string); if (cfg_log_hide_nickserv_pwd) - irc_hide_password (new_history->text, 1); + irc_display_hide_password (new_history->text, 1); if (((t_gui_buffer *)(buffer))->history) ((t_gui_buffer *)(buffer))->history->prev_history = new_history; @@ -112,7 +112,7 @@ history_global_add (char *string) { new_history->text = strdup (string); if (cfg_log_hide_nickserv_pwd) - irc_hide_password (new_history->text, 1); + irc_display_hide_password (new_history->text, 1); if (history_global) history_global->prev_history = new_history; diff --git a/src/common/session.c b/src/common/session.c index 2bc77af43..9236c9f19 100644 --- a/src/common/session.c +++ b/src/common/session.c @@ -839,20 +839,20 @@ session_load_server (FILE *file) /* use or allocate server */ weechat_log_printf (_("session: loading server \"%s\"\n"), server_name); - session_current_server = server_search (server_name); + session_current_server = irc_server_search (server_name); if (session_current_server) weechat_log_printf (_("server found, updating values\n")); else { weechat_log_printf (_("server not found, creating new one\n")); - session_current_server = server_alloc (); + session_current_server = irc_server_alloc (); if (!session_current_server) { free (server_name); session_crash (file, _("can't create new server")); return 0; } - server_init (session_current_server); + irc_server_init (session_current_server); session_current_server->name = strdup (server_name); } free (server_name); @@ -1069,9 +1069,9 @@ session_load_channel (FILE *file) /* allocate channel */ weechat_log_printf (_("session: loading channel \"%s\"\n"), channel_name); - session_current_channel = channel_new (session_current_server, - channel_type, - channel_name); + session_current_channel = irc_channel_new (session_current_server, + channel_type, + channel_name); free (channel_name); if (!session_current_channel) { @@ -1164,8 +1164,8 @@ session_load_nick (FILE *file) } /* allocate nick */ - nick = nick_new (session_current_server, session_current_channel, - nick_name, 0, 0, 0, 0, 0, 0); + nick = irc_nick_new (session_current_server, session_current_channel, + nick_name, 0, 0, 0, 0, 0, 0); free (nick_name); if (!nick) { @@ -1222,7 +1222,7 @@ session_load_dcc (FILE *file) t_irc_channel *ptr_channel; /* allocate DCC */ - dcc = dcc_alloc (); + dcc = irc_dcc_alloc (); if (!dcc) { session_crash (file, _("can't create new DCC")); @@ -1255,7 +1255,7 @@ session_load_dcc (FILE *file) return 0; if (string && string[0]) { - ptr_server = server_search (string); + ptr_server = irc_server_search (string); if (!ptr_server) { session_crash (file, _("server not found for DCC")); @@ -1276,7 +1276,7 @@ session_load_dcc (FILE *file) return 0; if (string && string[0]) { - ptr_channel = channel_search_any (ptr_server, string); + ptr_channel = irc_channel_search_any (ptr_server, string); if (!ptr_channel) { session_crash (file, _("channel not found for DCC")); @@ -1468,7 +1468,7 @@ session_load_buffer (FILE *file) ptr_channel = NULL; if (server_name) { - ptr_server = server_search (server_name); + ptr_server = irc_server_search (server_name); if (!ptr_server) { session_crash (file, _("server not found for buffer")); @@ -1478,7 +1478,7 @@ session_load_buffer (FILE *file) if (channel_name) { - ptr_channel = channel_search_any_without_buffer (ptr_server, channel_name); + ptr_channel = irc_channel_search_any_without_buffer (ptr_server, channel_name); if (!ptr_channel) { session_crash (file, _("channel not found for buffer")); @@ -1686,7 +1686,7 @@ session_load_hotlist (FILE *file) server_name = NULL; if (!session_read_str (file, &server_name)) return 0; - ptr_server = server_search (server_name); + ptr_server = irc_server_search (server_name); free (server_name); break; case SESSION_HOTL_BUFFER_NUMBER: diff --git a/src/common/weechat.c b/src/common/weechat.c index 828c2baa0..b8e5ba7bd 100644 --- a/src/common/weechat.c +++ b/src/common/weechat.c @@ -405,7 +405,7 @@ weechat_parse_args (int argc, char *argv[]) } else if ((ascii_strncasecmp (argv[i], "irc", 3) == 0)) { - if (server_init_with_url (argv[i], &server_tmp) < 0) + if (irc_server_init_with_url (argv[i], &server_tmp) < 0) { weechat_iconv_fprintf (stderr, _("%s invalid syntax for IRC server ('%s'), ignored\n"), @@ -413,19 +413,19 @@ weechat_parse_args (int argc, char *argv[]) } else { - if (!server_new (server_tmp.name, server_tmp.autoconnect, - server_tmp.autoreconnect, - server_tmp.autoreconnect_delay, - 1, server_tmp.address, server_tmp.port, - server_tmp.ipv6, server_tmp.ssl, - server_tmp.password, server_tmp.nick1, - server_tmp.nick2, server_tmp.nick3, - NULL, NULL, NULL, NULL, 0, - server_tmp.autojoin, 1, NULL)) + if (!irc_server_new (server_tmp.name, server_tmp.autoconnect, + server_tmp.autoreconnect, + server_tmp.autoreconnect_delay, + 1, server_tmp.address, server_tmp.port, + server_tmp.ipv6, server_tmp.ssl, + server_tmp.password, server_tmp.nick1, + server_tmp.nick2, server_tmp.nick3, + NULL, NULL, NULL, NULL, 0, + server_tmp.autojoin, 1, NULL)) weechat_iconv_fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"), WEECHAT_WARNING, argv[i]); - server_destroy (&server_tmp); + irc_server_destroy (&server_tmp); server_cmd_line = 1; } } @@ -584,7 +584,7 @@ weechat_config_read () exit (EXIT_FAILURE); break; default: /* other error (fatal) */ - server_free_all (); + irc_server_free_all (); exit (EXIT_FAILURE); } } @@ -705,25 +705,25 @@ weechat_dump (int crash) for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { weechat_log_printf ("\n"); - server_print_log (ptr_server); + irc_server_print_log (ptr_server); for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { weechat_log_printf ("\n"); - channel_print_log (ptr_channel); + irc_channel_print_log (ptr_channel); for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) { weechat_log_printf ("\n"); - nick_print_log (ptr_nick); + irc_nick_print_log (ptr_nick); } } } - dcc_print_log (); + irc_dcc_print_log (); gui_panel_print_log (); @@ -754,7 +754,7 @@ weechat_dump (int crash) } weechat_log_printf ("\n"); - ignore_print_log (); + irc_ignore_print_log (); weechat_log_printf ("\n"); weechat_log_printf ("****** End of dump ******\n"); @@ -769,8 +769,8 @@ void weechat_sigsegv () { weechat_dump (1); - dcc_end (); - server_free_all (); + irc_dcc_end (); + irc_server_free_all (); gui_main_end (); weechat_iconv_fprintf (stderr, "\n"); @@ -837,20 +837,20 @@ main (int argc, char *argv[]) plugin_init (auto_load_plugins); /* init plugin interface(s) */ #endif - server_auto_connect (auto_connect, /* auto-connect to servers */ - server_cmd_line); + irc_server_auto_connect (auto_connect, /* auto-connect to servers */ + server_cmd_line); gui_main_loop (); /* WeeChat main loop */ #ifdef PLUGINS plugin_end (); /* end plugin interface(s) */ #endif - server_disconnect_all (); /* disconnect from all servers */ + irc_server_disconnect_all (); /* disconnect from all servers */ if (cfg_look_save_on_exit) (void) config_write (NULL); /* save config file */ command_index_free (); /* free commands index */ - dcc_end (); /* remove all DCC */ - server_free_all (); /* free all servers */ + irc_dcc_end (); /* remove all DCC */ + irc_server_free_all (); /* free all servers */ gui_main_end (); /* shut down WeeChat GUI */ weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */ diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c index 2bbc98dec..99b465bc4 100644 --- a/src/common/weeconfig.c +++ b/src/common/weeconfig.c @@ -1222,7 +1222,7 @@ config_change_nicks_colors () ptr_nick = ptr_nick->next_nick) { if (ptr_nick->color != COLOR_WIN_NICK_SELF) - ptr_nick->color = nick_find_color (ptr_nick); + ptr_nick->color = irc_nick_find_color (ptr_nick); } } } @@ -1239,7 +1239,7 @@ config_change_away_check () if (cfg_irc_away_check == 0) { /* reset away flag for all nicks/chans/servers */ - server_remove_away (); + irc_server_remove_away (); } check_away = cfg_irc_away_check * 60; } @@ -1276,7 +1276,7 @@ config_change_notify_levels () { if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer)) ptr_buffer->notify_level = - channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer)); + irc_channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer)); } } @@ -1688,7 +1688,7 @@ config_option_search_option_value (char *option_name, t_config_option **option, if (pos) { pos[0] = '\0'; - ptr_server = server_search (option_name); + ptr_server = irc_server_search (option_name); if (ptr_server) { for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++) @@ -1763,40 +1763,40 @@ config_allocate_server (char *filename, int line_number) || !cfg_server.username || !cfg_server.realname) { - server_free_all (); + irc_server_free_all (); gui_printf (NULL, _("%s %s, line %d: new server, but previous was incomplete\n"), WEECHAT_WARNING, filename, line_number); return 0; } - if (server_name_already_exists (cfg_server.name)) + if (irc_server_name_already_exists (cfg_server.name)) { - server_free_all (); + irc_server_free_all (); gui_printf (NULL, _("%s %s, line %d: server '%s' already exists\n"), WEECHAT_WARNING, filename, line_number, cfg_server.name); return 0; } - if (!server_new (cfg_server.name, - cfg_server.autoconnect, cfg_server.autoreconnect, - cfg_server.autoreconnect_delay, 0, cfg_server.address, - cfg_server.port, cfg_server.ipv6, cfg_server.ssl, - cfg_server.password, cfg_server.nick1, cfg_server.nick2, - cfg_server.nick3, cfg_server.username, cfg_server.realname, - cfg_server.hostname, cfg_server.command, - cfg_server.command_delay, cfg_server.autojoin, - cfg_server.autorejoin, cfg_server.notify_levels)) + if (!irc_server_new (cfg_server.name, + cfg_server.autoconnect, cfg_server.autoreconnect, + cfg_server.autoreconnect_delay, 0, cfg_server.address, + cfg_server.port, cfg_server.ipv6, cfg_server.ssl, + cfg_server.password, cfg_server.nick1, cfg_server.nick2, + cfg_server.nick3, cfg_server.username, cfg_server.realname, + cfg_server.hostname, cfg_server.command, + cfg_server.command_delay, cfg_server.autojoin, + cfg_server.autorejoin, cfg_server.notify_levels)) { - server_free_all (); + irc_server_free_all (); gui_printf (NULL, _("%s %s, line %d: unable to create server\n"), WEECHAT_WARNING, filename, line_number); return 0; } - server_destroy (&cfg_server); - server_init (&cfg_server); + irc_server_destroy (&cfg_server); + irc_server_init (&cfg_server); return 1; } @@ -1886,7 +1886,7 @@ config_read () } config_default_values (); - server_init (&cfg_server); + irc_server_init (&cfg_server); /* read config file */ section = CONFIG_SECTION_NONE; @@ -2041,7 +2041,7 @@ config_read () WEECHAT_WARNING, filename, line_number, line); else { - if (!ignore_add_from_config (pos)) + if (!irc_ignore_add_from_config (pos)) gui_printf (NULL, _("%s %s, line %d: invalid ignore options \"%s\"\n"), WEECHAT_WARNING, filename, line_number, pos); |