1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

Partial migration of Perl plugin to new API

This commit is contained in:
Sebastien Helleu
2008-01-09 18:26:17 +01:00
parent f94b679a4a
commit 9f2fc59569
51 changed files with 4548 additions and 3178 deletions
+9 -8
View File
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <string.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-channel.h"
#include "irc-config.h"
@@ -495,9 +496,9 @@ irc_channel_print_log (struct t_irc_channel *channel)
struct t_irc_nick *ptr_nick;
weechat_log_printf ("");
weechat_log_printf (" => channel %s (addr:0x%X)]", channel->name, channel);
weechat_log_printf (" => channel %s (addr:0x%x)]", channel->name, channel);
weechat_log_printf (" type . . . . . . . . : %d", channel->type);
weechat_log_printf (" dcc_chat . . . . . . : 0x%X", channel->dcc_chat);
weechat_log_printf (" dcc_chat . . . . . . : 0x%x", channel->dcc_chat);
weechat_log_printf (" topic. . . . . . . . : '%s'", channel->topic);
weechat_log_printf (" modes. . . . . . . . : '%s'", channel->modes);
weechat_log_printf (" limit. . . . . . . . : %d", channel->limit);
@@ -507,12 +508,12 @@ irc_channel_print_log (struct t_irc_channel *channel)
weechat_log_printf (" cycle. . . . . . . . : %d", channel->cycle);
weechat_log_printf (" close. . . . . . . . : %d", channel->close);
weechat_log_printf (" display_creation_date: %d", channel->display_creation_date);
weechat_log_printf (" nicks. . . . . . . . : 0x%X", channel->nicks);
weechat_log_printf (" last_nick. . . . . . : 0x%X", channel->last_nick);
weechat_log_printf (" buffer . . . . . . . : 0x%X", channel->buffer);
weechat_log_printf (" nicks_speaking . . . : 0x%X", channel->nicks_speaking);
weechat_log_printf (" prev_channel . . . . : 0x%X", channel->prev_channel);
weechat_log_printf (" next_channel . . . . : 0x%X", channel->next_channel);
weechat_log_printf (" nicks. . . . . . . . : 0x%x", channel->nicks);
weechat_log_printf (" last_nick. . . . . . : 0x%x", channel->last_nick);
weechat_log_printf (" buffer . . . . . . . : 0x%x", channel->buffer);
weechat_log_printf (" nicks_speaking . . . : 0x%x", channel->nicks_speaking);
weechat_log_printf (" prev_channel . . . . : 0x%x", channel->prev_channel);
weechat_log_printf (" next_channel . . . . : 0x%x", channel->next_channel);
if (channel->nicks_speaking)
{
weechat_log_printf ("");
+1
View File
@@ -27,6 +27,7 @@
#include <string.h>
#include <ctype.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-color.h"
+1
View File
@@ -30,6 +30,7 @@
#include <sys/time.h>
#include <time.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-command.h"
#include "irc-color.h"
+1
View File
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-completion.h"
#include "irc-config.h"
+1
View File
@@ -29,6 +29,7 @@
#include <limits.h>
#include <pwd.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-config.h"
#include "irc-dcc.h"
+6 -5
View File
@@ -39,6 +39,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-dcc.h"
#include "irc-config.h"
@@ -1899,9 +1900,9 @@ irc_dcc_print_log ()
for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
weechat_log_printf ("");
weechat_log_printf ("[DCC (addr:0x%X)]", ptr_dcc);
weechat_log_printf (" server. . . . . . . : 0x%X", ptr_dcc->server);
weechat_log_printf (" channel . . . . . . : 0x%X", ptr_dcc->channel);
weechat_log_printf ("[DCC (addr:0x%x)]", ptr_dcc);
weechat_log_printf (" server. . . . . . . : 0x%x", ptr_dcc->server);
weechat_log_printf (" channel . . . . . . : 0x%x", ptr_dcc->channel);
weechat_log_printf (" type. . . . . . . . : %d", ptr_dcc->type);
weechat_log_printf (" status. . . . . . . : %d", ptr_dcc->status);
weechat_log_printf (" start_time. . . . . : %ld", ptr_dcc->start_time);
@@ -1929,7 +1930,7 @@ irc_dcc_print_log ()
weechat_log_printf (" last_activity . . . : %ld", ptr_dcc->last_activity);
weechat_log_printf (" bytes_per_sec . . . : %lu", ptr_dcc->bytes_per_sec);
weechat_log_printf (" eta . . . . . . . . : %lu", ptr_dcc->eta);
weechat_log_printf (" prev_dcc. . . . . . : 0x%X", ptr_dcc->prev_dcc);
weechat_log_printf (" next_dcc. . . . . . : 0x%X", ptr_dcc->next_dcc);
weechat_log_printf (" prev_dcc. . . . . . : 0x%x", ptr_dcc->prev_dcc);
weechat_log_printf (" next_dcc. . . . . . : 0x%x", ptr_dcc->next_dcc);
}
}
+1
View File
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <string.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-channel.h"
#include "irc-command.h"
+1
View File
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-server.h"
#include "irc-channel.h"
+1
View File
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-mode.h"
#include "irc-server.h"
+4 -3
View File
@@ -28,6 +28,7 @@
#include <string.h>
#include <limits.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-nick.h"
#include "irc-config.h"
@@ -470,10 +471,10 @@ void
irc_nick_print_log (struct t_irc_nick *nick)
{
weechat_log_printf ("");
weechat_log_printf (" => nick %s (addr:0x%X):", nick->name, nick);
weechat_log_printf (" => nick %s (addr:0x%x):", nick->name, nick);
weechat_log_printf (" host . . . . . : %s", nick->host);
weechat_log_printf (" flags. . . . . : %d", nick->flags);
weechat_log_printf (" color. . . . . : '%s'", nick->color);
weechat_log_printf (" prev_nick. . . : 0x%X", nick->prev_nick);
weechat_log_printf (" next_nick. . . : 0x%X", nick->next_nick);
weechat_log_printf (" prev_nick. . . : 0x%x", nick->prev_nick);
weechat_log_printf (" next_nick. . . : 0x%x", nick->next_nick);
}
+1
View File
@@ -43,6 +43,7 @@
#include <sys/time.h>
#include <time.h>
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-protocol.h"
#include "irc-command.h"
+12 -10
View File
@@ -44,6 +44,7 @@
#include <gnutls/gnutls.h>
#endif
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-server.h"
#include "irc-channel.h"
@@ -2187,7 +2188,8 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
if (!server->buffer)
return 0;
weechat_buffer_set (server->buffer, "display", "1");
weechat_hook_signal_send ("logger_backlog", server->buffer);
weechat_hook_signal_send ("logger_backlog",
WEECHAT_HOOK_SIGNAL_POINTER, server->buffer);
}
#ifndef HAVE_GNUTLS
@@ -2733,7 +2735,7 @@ irc_server_print_log ()
ptr_server = ptr_server->next_server)
{
weechat_log_printf ("");
weechat_log_printf ("[server %s (addr:0x%X)]", ptr_server->name, ptr_server);
weechat_log_printf ("[server %s (addr:0x%x)]", ptr_server->name, ptr_server);
weechat_log_printf (" autoconnect . . . . : %d", ptr_server->autoconnect);
weechat_log_printf (" autoreconnect . . . : %d", ptr_server->autoreconnect);
weechat_log_printf (" autoreconnect_delay : %d", ptr_server->autoreconnect_delay);
@@ -2762,7 +2764,7 @@ irc_server_print_log ()
weechat_log_printf (" child_read . . . . : %d", ptr_server->child_read);
weechat_log_printf (" child_write . . . . : %d", ptr_server->child_write);
weechat_log_printf (" sock. . . . . . . . : %d", ptr_server->sock);
weechat_log_printf (" hook_fd . . . . . . : 0x%X", ptr_server->hook_fd);
weechat_log_printf (" hook_fd . . . . . . : 0x%x", ptr_server->hook_fd);
weechat_log_printf (" is_connected. . . . : %d", ptr_server->is_connected);
weechat_log_printf (" ssl_connected . . . : %d", ptr_server->ssl_connected);
weechat_log_printf (" unterminated_message: '%s'", ptr_server->unterminated_message);
@@ -2782,13 +2784,13 @@ irc_server_print_log ()
ptr_server->lag_check_time.tv_usec);
weechat_log_printf (" lag_next_check. . . : %ld", ptr_server->lag_next_check);
weechat_log_printf (" last_user_message . : %ld", ptr_server->last_user_message);
weechat_log_printf (" outqueue. . . . . . : 0x%X", ptr_server->outqueue);
weechat_log_printf (" last_outqueue . . . : 0x%X", ptr_server->last_outqueue);
weechat_log_printf (" buffer. . . . . . . : 0x%X", ptr_server->buffer);
weechat_log_printf (" channels. . . . . . : 0x%X", ptr_server->channels);
weechat_log_printf (" last_channel. . . . : 0x%X", ptr_server->last_channel);
weechat_log_printf (" prev_server . . . . : 0x%X", ptr_server->prev_server);
weechat_log_printf (" next_server . . . . : 0x%X", ptr_server->next_server);
weechat_log_printf (" outqueue. . . . . . : 0x%x", ptr_server->outqueue);
weechat_log_printf (" last_outqueue . . . : 0x%x", ptr_server->last_outqueue);
weechat_log_printf (" buffer. . . . . . . : 0x%x", ptr_server->buffer);
weechat_log_printf (" channels. . . . . . : 0x%x", ptr_server->channels);
weechat_log_printf (" last_channel. . . . : 0x%x", ptr_server->last_channel);
weechat_log_printf (" prev_server . . . . : 0x%x", ptr_server->prev_server);
weechat_log_printf (" next_server . . . . : 0x%x", ptr_server->next_server);
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
+19 -11
View File
@@ -24,11 +24,13 @@
#endif
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-command.h"
#include "irc-completion.h"
@@ -62,12 +64,13 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
*/
int
irc_dump_data_cb (void *data, char *signal, void *pointer)
irc_dump_data_cb (void *data, char *signal, char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
(void) signal;
(void) pointer;
(void) type_data;
(void) signal_data;
weechat_log_printf ("");
weechat_log_printf ("***** IRC plugin dump *****");
@@ -112,19 +115,21 @@ irc_create_directories ()
*/
int
irc_quit_cb (void *data, char *signal, void *pointer)
irc_quit_cb (void *data, char *signal, char *type_data, void *signal_data)
{
struct t_irc_server *ptr_server;
/* make C compiler happy */
(void) data;
(void) signal;
(void) pointer;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
irc_command_quit_server (ptr_server, (char *)pointer);
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
irc_command_quit_server (ptr_server, (char *)signal_data);
}
}
return WEECHAT_RC_OK;
@@ -135,14 +140,17 @@ irc_quit_cb (void *data, char *signal, void *pointer)
*/
int
irc_debug_cb (void *data, char *signal, void *pointer)
irc_debug_cb (void *data, char *signal, char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
(void) signal;
if (weechat_strcasecmp ((char *)pointer, "irc") == 0)
irc_debug ^= 1;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
if (weechat_strcasecmp ((char *)signal_data, "irc") == 0)
irc_debug ^= 1;
}
return WEECHAT_RC_OK;
}
-2
View File
@@ -24,8 +24,6 @@
#include <gnutls/gnutls.h>
#endif
#include "../weechat-plugin.h"
#define weechat_plugin weechat_irc_plugin
#define IRC_GET_SERVER(__buffer) \