mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 03:03:12 +02:00
core: add pointer in some callbacks (closes #406)
This pointer is the first argument received by callbacks, and the existing argument "data" is now automatically freed by WeeChat when the object containing the callback is removed. With this new pointer, the linked list of callbacks in scripts has been removed. This will improve speed of scripts (using a lot of hooks), reduce memory used by scripts and reduce time to unload scripts. Following functions are affected in the C API: * exec_on_files * config_new * config_new_section * config_new_option * hook_command * hook_command_run * hook_timer * hook_fd * hook_process * hook_process_hashtable * hook_connect * hook_print * hook_signal * hook_hsignal * hook_config * hook_completion * hook_modifier * hook_info * hook_info_hashtable * hook_infolist * hook_hdata * hook_focus * unhook_all_plugin * buffer_new * bar_item_new * upgrade_new * upgrade_read
This commit is contained in:
@@ -38,7 +38,8 @@
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_buffer_plugin (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_buffer_plugin (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
@@ -50,6 +51,7 @@ irc_bar_item_buffer_plugin (void *data, struct t_gui_bar_item *item,
|
||||
struct t_irc_channel *channel;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -198,12 +200,14 @@ irc_bar_item_buffer_name_content (struct t_gui_buffer *buffer, int short_name)
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_buffer_name (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -218,12 +222,14 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_buffer_short_name (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_buffer_short_name (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -237,7 +243,8 @@ irc_bar_item_buffer_short_name (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_buffer_modes (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
@@ -249,6 +256,7 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item,
|
||||
struct t_irc_channel *channel;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -297,7 +305,8 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_channel (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window, struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
{
|
||||
@@ -308,6 +317,7 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
|
||||
struct t_irc_channel *channel;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -374,7 +384,8 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_lag (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window, struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
{
|
||||
@@ -382,6 +393,7 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
|
||||
struct t_irc_server *server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -413,7 +425,8 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_input_prompt (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
@@ -425,6 +438,7 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item,
|
||||
int length;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -494,7 +508,8 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item,
|
||||
irc_bar_item_nick_modes (const void *pointer, void *data,
|
||||
struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_hashtable *extra_info)
|
||||
@@ -504,6 +519,7 @@ irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item,
|
||||
int length;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) item;
|
||||
(void) window;
|
||||
@@ -533,7 +549,7 @@ irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item,
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
irc_bar_item_focus_buffer_nicklist (void *data,
|
||||
irc_bar_item_focus_buffer_nicklist (const void *pointer, void *data,
|
||||
struct t_hashtable *info)
|
||||
{
|
||||
long unsigned int value;
|
||||
@@ -555,6 +571,7 @@ irc_bar_item_focus_buffer_nicklist (void *data,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
if (ptr_server && ptr_channel)
|
||||
@@ -579,10 +596,12 @@ irc_bar_item_focus_buffer_nicklist (void *data,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_bar_item_buffer_switch (void *data, const char *signal,
|
||||
irc_bar_item_buffer_switch (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
@@ -619,16 +638,26 @@ irc_bar_item_update_channel ()
|
||||
void
|
||||
irc_bar_item_init ()
|
||||
{
|
||||
weechat_bar_item_new ("buffer_plugin", &irc_bar_item_buffer_plugin, NULL);
|
||||
weechat_bar_item_new ("buffer_name", &irc_bar_item_buffer_name, NULL);
|
||||
weechat_bar_item_new ("buffer_short_name", &irc_bar_item_buffer_short_name, NULL);
|
||||
weechat_bar_item_new ("buffer_modes", &irc_bar_item_buffer_modes, NULL);
|
||||
weechat_bar_item_new ("irc_channel", &irc_bar_item_channel, NULL);
|
||||
weechat_bar_item_new ("lag", &irc_bar_item_lag, NULL);
|
||||
weechat_bar_item_new ("input_prompt", &irc_bar_item_input_prompt, NULL);
|
||||
weechat_bar_item_new ("irc_nick_modes", &irc_bar_item_nick_modes, NULL);
|
||||
weechat_bar_item_new ("buffer_plugin",
|
||||
&irc_bar_item_buffer_plugin, NULL, NULL);
|
||||
weechat_bar_item_new ("buffer_name",
|
||||
&irc_bar_item_buffer_name, NULL, NULL);
|
||||
weechat_bar_item_new ("buffer_short_name",
|
||||
&irc_bar_item_buffer_short_name, NULL, NULL);
|
||||
weechat_bar_item_new ("buffer_modes",
|
||||
&irc_bar_item_buffer_modes, NULL, NULL);
|
||||
weechat_bar_item_new ("irc_channel",
|
||||
&irc_bar_item_channel, NULL, NULL);
|
||||
weechat_bar_item_new ("lag",
|
||||
&irc_bar_item_lag, NULL, NULL);
|
||||
weechat_bar_item_new ("input_prompt",
|
||||
&irc_bar_item_input_prompt, NULL, NULL);
|
||||
weechat_bar_item_new ("irc_nick_modes",
|
||||
&irc_bar_item_nick_modes, NULL, NULL);
|
||||
|
||||
weechat_hook_focus ("buffer_nicklist",
|
||||
&irc_bar_item_focus_buffer_nicklist, NULL);
|
||||
&irc_bar_item_focus_buffer_nicklist, NULL, NULL);
|
||||
|
||||
weechat_hook_signal ("buffer_switch",
|
||||
&irc_bar_item_buffer_switch, NULL);
|
||||
&irc_bar_item_buffer_switch, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -112,13 +112,15 @@ irc_buffer_build_name (const char *server, const char *channel)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
irc_buffer_close_cb (const void *pointer, void *data,
|
||||
struct t_gui_buffer *buffer)
|
||||
{
|
||||
struct t_irc_channel *next_channel;
|
||||
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
if (buffer == irc_raw_buffer)
|
||||
@@ -175,15 +177,18 @@ irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_buffer_nickcmp_cb (void *data,
|
||||
irc_buffer_nickcmp_cb (const void *pointer, void *data,
|
||||
struct t_gui_buffer *buffer,
|
||||
const char *nick1,
|
||||
const char *nick2)
|
||||
{
|
||||
struct t_irc_server *server;
|
||||
|
||||
if (data)
|
||||
server = (struct t_irc_server *)data;
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
if (pointer)
|
||||
server = (struct t_irc_server *)pointer;
|
||||
else
|
||||
irc_buffer_get_server_and_channel (buffer, &server, NULL);
|
||||
|
||||
|
||||
@@ -53,11 +53,11 @@ extern void irc_buffer_get_server_and_channel (struct t_gui_buffer *buffer,
|
||||
struct t_irc_channel **channel);
|
||||
extern const char *irc_buffer_build_name (const char *server,
|
||||
const char *channel);
|
||||
extern int irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer);
|
||||
extern int irc_buffer_nickcmp_cb (void *data,
|
||||
extern int irc_buffer_close_cb (const void *pointer, void *data,
|
||||
struct t_gui_buffer *buffer);
|
||||
extern int irc_buffer_nickcmp_cb (const void *pointer, void *data,
|
||||
struct t_gui_buffer *buffer,
|
||||
const char *nick1,
|
||||
const char *nick2);
|
||||
const char *nick1, const char *nick2);
|
||||
extern struct t_gui_buffer *irc_buffer_search_server_lowest_number ();
|
||||
extern struct t_gui_buffer *irc_buffer_search_private_lowest_number (struct t_irc_server *server);
|
||||
|
||||
|
||||
@@ -270,8 +270,8 @@ irc_channel_create_buffer (struct t_irc_server *server,
|
||||
weechat_current_buffer (), "number");
|
||||
|
||||
ptr_buffer = weechat_buffer_new (buffer_name,
|
||||
&irc_input_data_cb, NULL,
|
||||
&irc_buffer_close_cb, NULL);
|
||||
&irc_input_data_cb, NULL, NULL,
|
||||
&irc_buffer_close_cb, NULL, NULL);
|
||||
if (!ptr_buffer)
|
||||
return NULL;
|
||||
|
||||
@@ -351,7 +351,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
|
||||
weechat_buffer_set (ptr_buffer, "nicklist_display_groups", "0");
|
||||
weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback",
|
||||
&irc_buffer_nickcmp_cb);
|
||||
weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback_data",
|
||||
weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback_pointer",
|
||||
server);
|
||||
}
|
||||
|
||||
@@ -463,8 +463,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
|
||||
32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
new_channel->checking_whox = 0;
|
||||
new_channel->away_message = NULL;
|
||||
new_channel->has_quit_server = 0;
|
||||
@@ -1024,8 +1023,7 @@ irc_channel_join_smart_filtered_add (struct t_irc_channel *channel,
|
||||
64,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_TIME,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
}
|
||||
if (!channel->join_smart_filtered)
|
||||
return;
|
||||
@@ -1224,8 +1222,7 @@ irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channel,
|
||||
hashtable = weechat_hashtable_new (4,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (hashtable)
|
||||
{
|
||||
/* update tags in line (remove tag "irc_smart_filter") */
|
||||
@@ -1280,15 +1277,17 @@ irc_channel_rejoin (struct t_irc_server *server, struct t_irc_channel *channel)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_channel_autorejoin_cb (void *data, int remaining_calls)
|
||||
irc_channel_autorejoin_cb (const void *pointer, void *data,
|
||||
int remaining_calls)
|
||||
{
|
||||
struct t_irc_server *ptr_server, *ptr_server_found;
|
||||
struct t_irc_channel *ptr_channel_arg, *ptr_channel;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
ptr_channel_arg = (struct t_irc_channel *)data;
|
||||
ptr_channel_arg = (struct t_irc_channel *)pointer;
|
||||
|
||||
ptr_server_found = NULL;
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
@@ -1435,11 +1434,13 @@ irc_channel_free_all (struct t_irc_server *server)
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
|
||||
irc_channel_hdata_channel_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_channel", "next_channel",
|
||||
@@ -1481,11 +1482,13 @@ irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_channel_hdata_channel_speaking_cb (void *data, const char *hdata_name)
|
||||
irc_channel_hdata_channel_speaking_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
|
||||
|
||||
@@ -151,13 +151,16 @@ extern void irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channe
|
||||
const char *nick);
|
||||
extern void irc_channel_rejoin (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel);
|
||||
extern int irc_channel_autorejoin_cb (void *data, int remaining_calls);
|
||||
extern int irc_channel_autorejoin_cb (const void *pointer, void *data,
|
||||
int remaining_calls);
|
||||
extern void irc_channel_display_nick_back_in_pv (struct t_irc_server *server,
|
||||
struct t_irc_nick *nick,
|
||||
const char *nickname);
|
||||
extern struct t_hdata *irc_channel_hdata_channel_cb (void *data,
|
||||
extern struct t_hdata *irc_channel_hdata_channel_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern struct t_hdata *irc_channel_hdata_channel_speaking_cb (void *data,
|
||||
extern struct t_hdata *irc_channel_hdata_channel_speaking_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern int irc_channel_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_channel *channel);
|
||||
|
||||
@@ -767,12 +767,14 @@ irc_color_decode_ansi (const char *string, int keep_colors)
|
||||
*/
|
||||
|
||||
char *
|
||||
irc_color_modifier_cb (void *data, const char *modifier,
|
||||
const char *modifier_data, const char *string)
|
||||
irc_color_modifier_cb (const void *pointer, void *data,
|
||||
const char *modifier, const char *modifier_data,
|
||||
const char *string)
|
||||
{
|
||||
int keep_colors;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
keep_colors = (modifier_data && (strcmp (modifier_data, "1") == 0)) ? 1 : 0;
|
||||
|
||||
@@ -106,7 +106,8 @@ struct t_irc_color_ansi_state
|
||||
|
||||
extern char *irc_color_decode (const char *string, int keep_colors);
|
||||
extern char *irc_color_encode (const char *string, int keep_colors);
|
||||
extern char *irc_color_modifier_cb (void *data, const char *modifier,
|
||||
extern char *irc_color_modifier_cb (const void *pointer, void *data,
|
||||
const char *modifier,
|
||||
const char *modifier_data,
|
||||
const char *string);
|
||||
extern char *irc_color_for_tags (const char *color);
|
||||
|
||||
+229
-304
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,12 @@
|
||||
struct t_irc_server;
|
||||
struct t_irc_channel;
|
||||
|
||||
#define IRC_COMMAND_CALLBACK(__command) \
|
||||
int \
|
||||
irc_command_##__command (const void *pointer, void *data, \
|
||||
struct t_gui_buffer *buffer, \
|
||||
int argc, char **argv, char **argv_eol)
|
||||
|
||||
#define IRC_COMMAND_CHECK_SERVER(__command, __check_connection) \
|
||||
if (!ptr_server) \
|
||||
{ \
|
||||
|
||||
@@ -41,13 +41,15 @@
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_server_cb (void *data, const char *completion_item,
|
||||
irc_completion_server_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -65,13 +67,15 @@ irc_completion_server_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_server_nick_cb (void *data, const char *completion_item,
|
||||
irc_completion_server_nick_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -89,7 +93,8 @@ irc_completion_server_nick_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_server_channels_cb (void *data, const char *completion_item,
|
||||
irc_completion_server_channels_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -98,6 +103,7 @@ irc_completion_server_channels_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -129,7 +135,8 @@ irc_completion_server_channels_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_server_privates_cb (void *data, const char *completion_item,
|
||||
irc_completion_server_privates_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -138,6 +145,7 @@ irc_completion_server_privates_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -162,7 +170,8 @@ irc_completion_server_privates_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_server_nicks_cb (void *data, const char *completion_item,
|
||||
irc_completion_server_nicks_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -172,6 +181,7 @@ irc_completion_server_nicks_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -204,13 +214,15 @@ irc_completion_server_nicks_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_servers_cb (void *data, const char *completion_item,
|
||||
irc_completion_servers_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
@@ -230,13 +242,15 @@ irc_completion_servers_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_channel_cb (void *data, const char *completion_item,
|
||||
irc_completion_channel_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -285,7 +299,8 @@ irc_completion_channel_nicks_add_speakers (struct t_gui_completion *completion,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_channel_nicks_cb (void *data, const char *completion_item,
|
||||
irc_completion_channel_nicks_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -294,6 +309,7 @@ irc_completion_channel_nicks_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -350,7 +366,8 @@ irc_completion_channel_nicks_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item,
|
||||
irc_completion_channel_nicks_hosts_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -361,6 +378,7 @@ irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -407,7 +425,8 @@ irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_channel_topic_cb (void *data, const char *completion_item,
|
||||
irc_completion_channel_topic_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -417,6 +436,7 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -459,7 +479,8 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_channels_cb (void *data, const char *completion_item,
|
||||
irc_completion_channels_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -471,6 +492,7 @@ irc_completion_channels_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -530,7 +552,8 @@ irc_completion_channels_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_privates_cb (void *data, const char *completion_item,
|
||||
irc_completion_privates_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -538,6 +561,7 @@ irc_completion_privates_cb (void *data, const char *completion_item,
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
@@ -564,7 +588,8 @@ irc_completion_privates_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_msg_kick_cb (void *data, const char *completion_item,
|
||||
irc_completion_msg_kick_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -573,6 +598,7 @@ irc_completion_msg_kick_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -595,7 +621,8 @@ irc_completion_msg_kick_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_msg_part_cb (void *data, const char *completion_item,
|
||||
irc_completion_msg_part_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -604,6 +631,7 @@ irc_completion_msg_part_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -626,7 +654,8 @@ irc_completion_msg_part_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_ignores_numbers_cb (void *data, const char *completion_item,
|
||||
irc_completion_ignores_numbers_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -634,6 +663,7 @@ irc_completion_ignores_numbers_cb (void *data, const char *completion_item,
|
||||
char str_number[32];
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
@@ -654,7 +684,8 @@ irc_completion_ignores_numbers_cb (void *data, const char *completion_item,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_completion_notify_nicks_cb (void *data, const char *completion_item,
|
||||
irc_completion_notify_nicks_cb (const void *pointer, void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
@@ -663,6 +694,7 @@ irc_completion_notify_nicks_cb (void *data, const char *completion_item,
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
@@ -701,50 +733,50 @@ irc_completion_init ()
|
||||
{
|
||||
weechat_hook_completion ("irc_server",
|
||||
N_("current IRC server"),
|
||||
&irc_completion_server_cb, NULL);
|
||||
&irc_completion_server_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_server_nick",
|
||||
N_("nick on current IRC server"),
|
||||
&irc_completion_server_nick_cb, NULL);
|
||||
&irc_completion_server_nick_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_server_channels",
|
||||
N_("channels on current IRC server"),
|
||||
&irc_completion_server_channels_cb, NULL);
|
||||
&irc_completion_server_channels_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_server_privates",
|
||||
N_("privates on current IRC server"),
|
||||
&irc_completion_server_privates_cb, NULL);
|
||||
&irc_completion_server_privates_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_server_nicks",
|
||||
N_("nicks on all channels of current IRC server"),
|
||||
&irc_completion_server_nicks_cb, NULL);
|
||||
&irc_completion_server_nicks_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_servers",
|
||||
N_("IRC servers (internal names)"),
|
||||
&irc_completion_servers_cb, NULL);
|
||||
&irc_completion_servers_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_channel",
|
||||
N_("current IRC channel"),
|
||||
&irc_completion_channel_cb, NULL);
|
||||
&irc_completion_channel_cb, NULL, NULL);
|
||||
weechat_hook_completion ("nick",
|
||||
N_("nicks of current IRC channel"),
|
||||
&irc_completion_channel_nicks_cb, NULL);
|
||||
&irc_completion_channel_nicks_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_channel_nicks_hosts",
|
||||
N_("nicks and hostnames of current IRC channel"),
|
||||
&irc_completion_channel_nicks_hosts_cb, NULL);
|
||||
&irc_completion_channel_nicks_hosts_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_channel_topic",
|
||||
N_("topic of current IRC channel"),
|
||||
&irc_completion_channel_topic_cb, NULL);
|
||||
&irc_completion_channel_topic_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_channels",
|
||||
N_("channels on all IRC servers"),
|
||||
&irc_completion_channels_cb, NULL);
|
||||
&irc_completion_channels_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_privates",
|
||||
N_("privates on all IRC servers"),
|
||||
&irc_completion_privates_cb, NULL);
|
||||
&irc_completion_privates_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_msg_kick",
|
||||
N_("default kick message"),
|
||||
&irc_completion_msg_kick_cb, NULL);
|
||||
&irc_completion_msg_kick_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_msg_part",
|
||||
N_("default part message for IRC channel"),
|
||||
&irc_completion_msg_part_cb, NULL);
|
||||
&irc_completion_msg_part_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_ignores_numbers",
|
||||
N_("numbers for defined ignores"),
|
||||
&irc_completion_ignores_numbers_cb, NULL);
|
||||
&irc_completion_ignores_numbers_cb, NULL, NULL);
|
||||
weechat_hook_completion ("irc_notify_nicks",
|
||||
N_("nicks in notify list"),
|
||||
&irc_completion_notify_nicks_cb, NULL);
|
||||
&irc_completion_notify_nicks_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
+676
-379
File diff suppressed because it is too large
Load Diff
@@ -201,10 +201,10 @@ extern int irc_config_num_nicks_hide_password;
|
||||
|
||||
extern void irc_config_set_nick_colors ();
|
||||
extern int irc_config_display_channel_modes_arguments (const char *modes);
|
||||
extern int irc_config_server_check_value_cb (void *data,
|
||||
extern int irc_config_server_check_value_cb (const void *pointer, void *data,
|
||||
struct t_config_option *option,
|
||||
const char *value);
|
||||
extern void irc_config_server_change_cb (void *data,
|
||||
extern void irc_config_server_change_cb (const void *pointer, void *data,
|
||||
struct t_config_option *option);
|
||||
struct t_config_option *irc_config_server_new_option (struct t_config_file *config_file,
|
||||
struct t_config_section *section,
|
||||
@@ -213,12 +213,16 @@ struct t_config_option *irc_config_server_new_option (struct t_config_file *conf
|
||||
const char *default_value,
|
||||
const char *value,
|
||||
int null_value_allowed,
|
||||
int (*callback_check_value)(void *data,
|
||||
int (*callback_check_value)(const void *pointer,
|
||||
void *data,
|
||||
struct t_config_option *option,
|
||||
const char *value),
|
||||
const void *callback_check_value_pointer,
|
||||
void *callback_check_value_data,
|
||||
void (*callback_change)(void *data,
|
||||
void (*callback_change)(const void *pointer,
|
||||
void *data,
|
||||
struct t_config_option *option),
|
||||
const void *callback_change_pointer,
|
||||
void *callback_change_data);
|
||||
extern int irc_config_init ();
|
||||
extern int irc_config_read ();
|
||||
|
||||
@@ -35,10 +35,12 @@
|
||||
*/
|
||||
|
||||
int
|
||||
irc_debug_signal_debug_dump_cb (void *data, const char *signal,
|
||||
irc_debug_signal_debug_dump_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
@@ -69,5 +71,6 @@ irc_debug_signal_debug_dump_cb (void *data, const char *signal,
|
||||
void
|
||||
irc_debug_init ()
|
||||
{
|
||||
weechat_hook_signal ("debug_dump", &irc_debug_signal_debug_dump_cb, NULL);
|
||||
weechat_hook_signal ("debug_dump",
|
||||
&irc_debug_signal_debug_dump_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -308,11 +308,13 @@ irc_ignore_free_all ()
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_ignore_hdata_ignore_cb (void *data, const char *hdata_name)
|
||||
irc_ignore_hdata_ignore_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_ignore", "next_ignore",
|
||||
|
||||
@@ -51,7 +51,8 @@ extern int irc_ignore_check (struct t_irc_server *server,
|
||||
const char *host);
|
||||
extern void irc_ignore_free (struct t_irc_ignore *ignore);
|
||||
extern void irc_ignore_free_all ();
|
||||
extern struct t_hdata *irc_ignore_hdata_ignore_cb (void *data,
|
||||
extern struct t_hdata *irc_ignore_hdata_ignore_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern int irc_ignore_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_ignore *ignore);
|
||||
|
||||
+103
-70
@@ -64,7 +64,8 @@ irc_info_create_string_with_pointer (char **string, void *pointer)
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_is_channel_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_is_channel_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char *pos_comma, *server;
|
||||
@@ -73,6 +74,7 @@ irc_info_info_irc_is_channel_cb (void *data, const char *info_name,
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -99,12 +101,14 @@ irc_info_info_irc_is_channel_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_is_nick_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_is_nick_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
static char str_true[2] = "1";
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -118,12 +122,14 @@ irc_info_info_irc_is_nick_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_nick_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_nick_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -142,10 +148,12 @@ irc_info_info_irc_nick_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_nick_from_host_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_nick_from_host_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -158,10 +166,12 @@ irc_info_info_irc_nick_from_host_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_nick_color_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_nick_color_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -174,10 +184,12 @@ irc_info_info_irc_nick_color_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_nick_color_name_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_nick_color_name_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -190,7 +202,8 @@ irc_info_info_irc_nick_color_name_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_buffer_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_buffer_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char *pos_comma, *pos_comma2, *server, *channel, *host;
|
||||
@@ -199,6 +212,7 @@ irc_info_info_irc_buffer_cb (void *data, const char *info_name,
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -282,7 +296,8 @@ irc_info_info_irc_buffer_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_server_isupport_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_server_isupport_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char *pos_comma, *server;
|
||||
@@ -291,6 +306,7 @@ irc_info_info_irc_server_isupport_cb (void *data, const char *info_name,
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -317,7 +333,8 @@ irc_info_info_irc_server_isupport_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
const char *
|
||||
irc_info_info_irc_server_isupport_value_cb (void *data, const char *info_name,
|
||||
irc_info_info_irc_server_isupport_value_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
char *pos_comma, *server;
|
||||
@@ -325,6 +342,7 @@ irc_info_info_irc_server_isupport_value_cb (void *data, const char *info_name,
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -351,7 +369,7 @@ irc_info_info_irc_server_isupport_value_cb (void *data, const char *info_name,
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
irc_info_info_hashtable_irc_message_parse_cb (void *data,
|
||||
irc_info_info_hashtable_irc_message_parse_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
@@ -360,6 +378,7 @@ irc_info_info_hashtable_irc_message_parse_cb (void *data,
|
||||
struct t_hashtable *value;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -383,7 +402,7 @@ irc_info_info_hashtable_irc_message_parse_cb (void *data,
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
irc_info_info_hashtable_irc_message_split_cb (void *data,
|
||||
irc_info_info_hashtable_irc_message_split_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
@@ -392,6 +411,7 @@ irc_info_info_hashtable_irc_message_split_cb (void *data,
|
||||
struct t_hashtable *value;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) info_name;
|
||||
|
||||
@@ -415,27 +435,29 @@ irc_info_info_hashtable_irc_message_split_cb (void *data,
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
irc_info_infolist_irc_server_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
irc_info_infolist_irc_server_cb (const void *pointer, void *data,
|
||||
const char *infolist_name,
|
||||
void *obj_pointer, const char *arguments)
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) infolist_name;
|
||||
|
||||
if (pointer && !irc_server_valid (pointer))
|
||||
if (obj_pointer && !irc_server_valid (obj_pointer))
|
||||
return NULL;
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
if (pointer)
|
||||
if (obj_pointer)
|
||||
{
|
||||
/* build list with only one server */
|
||||
if (!irc_server_add_to_infolist (ptr_infolist, pointer))
|
||||
if (!irc_server_add_to_infolist (ptr_infolist, obj_pointer))
|
||||
{
|
||||
weechat_infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
@@ -469,8 +491,9 @@ irc_info_infolist_irc_server_cb (void *data, const char *infolist_name,
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
irc_info_infolist_irc_channel_cb (const void *pointer, void *data,
|
||||
const char *infolist_name,
|
||||
void *obj_pointer, const char *arguments)
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_irc_server *ptr_server;
|
||||
@@ -479,6 +502,7 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
|
||||
int argc;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) infolist_name;
|
||||
|
||||
@@ -499,10 +523,10 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
|
||||
weechat_string_free_split (argv);
|
||||
return NULL;
|
||||
}
|
||||
if (!pointer && (argc >= 2))
|
||||
if (!obj_pointer && (argc >= 2))
|
||||
{
|
||||
pointer = irc_channel_search (ptr_server, argv[1]);
|
||||
if (!pointer)
|
||||
obj_pointer = irc_channel_search (ptr_server, argv[1]);
|
||||
if (!obj_pointer)
|
||||
{
|
||||
weechat_string_free_split (argv);
|
||||
return NULL;
|
||||
@@ -514,17 +538,17 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
|
||||
if (!ptr_server)
|
||||
return NULL;
|
||||
|
||||
if (pointer && !irc_channel_valid (ptr_server, pointer))
|
||||
if (obj_pointer && !irc_channel_valid (ptr_server, obj_pointer))
|
||||
return NULL;
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
if (pointer)
|
||||
if (obj_pointer)
|
||||
{
|
||||
/* build list with only one channel */
|
||||
if (!irc_channel_add_to_infolist (ptr_infolist, pointer))
|
||||
if (!irc_channel_add_to_infolist (ptr_infolist, obj_pointer))
|
||||
{
|
||||
weechat_infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
@@ -554,8 +578,9 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
irc_info_infolist_irc_nick_cb (const void *pointer, void *data,
|
||||
const char *infolist_name,
|
||||
void *obj_pointer, const char *arguments)
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_irc_server *ptr_server;
|
||||
@@ -565,6 +590,7 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
|
||||
int argc;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) infolist_name;
|
||||
|
||||
@@ -591,11 +617,11 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
|
||||
weechat_string_free_split (argv);
|
||||
return NULL;
|
||||
}
|
||||
if (!pointer && (argc >= 3))
|
||||
if (!obj_pointer && (argc >= 3))
|
||||
{
|
||||
pointer = irc_nick_search (ptr_server, ptr_channel,
|
||||
obj_pointer = irc_nick_search (ptr_server, ptr_channel,
|
||||
argv[2]);
|
||||
if (!pointer)
|
||||
if (!obj_pointer)
|
||||
{
|
||||
weechat_string_free_split (argv);
|
||||
return NULL;
|
||||
@@ -607,18 +633,18 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
|
||||
if (!ptr_server || !ptr_channel)
|
||||
return NULL;
|
||||
|
||||
if (pointer && !irc_nick_valid (ptr_channel, pointer))
|
||||
if (obj_pointer && !irc_nick_valid (ptr_channel, obj_pointer))
|
||||
return NULL;
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
if (pointer)
|
||||
if (obj_pointer)
|
||||
{
|
||||
/* build list with only one nick */
|
||||
if (!irc_nick_add_to_infolist (ptr_infolist,
|
||||
pointer))
|
||||
obj_pointer))
|
||||
{
|
||||
weechat_infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
@@ -649,28 +675,30 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
irc_info_infolist_irc_ignore_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
irc_info_infolist_irc_ignore_cb (const void *pointer, void *data,
|
||||
const char *infolist_name,
|
||||
void *obj_pointer, const char *arguments)
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_irc_ignore *ptr_ignore;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) infolist_name;
|
||||
(void) arguments;
|
||||
|
||||
if (pointer && !irc_ignore_valid (pointer))
|
||||
if (obj_pointer && !irc_ignore_valid (obj_pointer))
|
||||
return NULL;
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
if (pointer)
|
||||
if (obj_pointer)
|
||||
{
|
||||
/* build list with only one ignore */
|
||||
if (!irc_ignore_add_to_infolist (ptr_infolist, pointer))
|
||||
if (!irc_ignore_add_to_infolist (ptr_infolist, obj_pointer))
|
||||
{
|
||||
weechat_infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
@@ -700,28 +728,30 @@ irc_info_infolist_irc_ignore_cb (void *data, const char *infolist_name,
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
irc_info_infolist_irc_notify_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
irc_info_infolist_irc_notify_cb (const void *pointer, void *data,
|
||||
const char *infolist_name,
|
||||
void *obj_pointer, const char *arguments)
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_irc_server *ptr_server;
|
||||
struct t_irc_notify *ptr_notify;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) infolist_name;
|
||||
|
||||
if (pointer && !irc_notify_valid (NULL, pointer))
|
||||
if (obj_pointer && !irc_notify_valid (NULL, obj_pointer))
|
||||
return NULL;
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (!ptr_infolist)
|
||||
return NULL;
|
||||
|
||||
if (pointer)
|
||||
if (obj_pointer)
|
||||
{
|
||||
/* build list with only one notify */
|
||||
if (!irc_notify_add_to_infolist (ptr_infolist, pointer))
|
||||
if (!irc_notify_add_to_infolist (ptr_infolist, obj_pointer))
|
||||
{
|
||||
weechat_infolist_free (ptr_infolist);
|
||||
return NULL;
|
||||
@@ -760,15 +790,18 @@ irc_info_infolist_irc_notify_cb (void *data, const char *infolist_name,
|
||||
*/
|
||||
|
||||
struct t_infolist *
|
||||
irc_info_infolist_irc_color_weechat_cb (void *data, const char *infolist_name,
|
||||
void *pointer, const char *arguments)
|
||||
irc_info_infolist_irc_color_weechat_cb (const void *pointer, void *data,
|
||||
const char *infolist_name,
|
||||
void *obj_pointer,
|
||||
const char *arguments)
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) infolist_name;
|
||||
(void) pointer;
|
||||
(void) obj_pointer;
|
||||
(void) arguments;
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
@@ -796,47 +829,47 @@ irc_info_init ()
|
||||
"irc_is_channel",
|
||||
N_("1 if string is a valid IRC channel name for server"),
|
||||
N_("server,channel (server is optional)"),
|
||||
&irc_info_info_irc_is_channel_cb, NULL);
|
||||
&irc_info_info_irc_is_channel_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_is_nick",
|
||||
N_("1 if string is a valid IRC nick name"),
|
||||
N_("nickname"),
|
||||
&irc_info_info_irc_is_nick_cb, NULL);
|
||||
&irc_info_info_irc_is_nick_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_nick",
|
||||
N_("get current nick on a server"),
|
||||
N_("server name"),
|
||||
&irc_info_info_irc_nick_cb, NULL);
|
||||
&irc_info_info_irc_nick_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_nick_from_host",
|
||||
N_("get nick from IRC host"),
|
||||
N_("IRC host (like `:nick!name@server.com`)"),
|
||||
&irc_info_info_irc_nick_from_host_cb, NULL);
|
||||
&irc_info_info_irc_nick_from_host_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_nick_color",
|
||||
N_("get nick color code"),
|
||||
N_("nickname"),
|
||||
&irc_info_info_irc_nick_color_cb, NULL);
|
||||
&irc_info_info_irc_nick_color_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_nick_color_name",
|
||||
N_("get nick color name"),
|
||||
N_("nickname"),
|
||||
&irc_info_info_irc_nick_color_name_cb, NULL);
|
||||
&irc_info_info_irc_nick_color_name_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_buffer",
|
||||
N_("get buffer pointer for an IRC server/channel/nick"),
|
||||
N_("server,channel,nick (channel and nicks are optional)"),
|
||||
&irc_info_info_irc_buffer_cb, NULL);
|
||||
&irc_info_info_irc_buffer_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_server_isupport",
|
||||
N_("1 if server supports this feature (from IRC message 005)"),
|
||||
N_("server,feature"),
|
||||
&irc_info_info_irc_server_isupport_cb, NULL);
|
||||
&irc_info_info_irc_server_isupport_cb, NULL, NULL);
|
||||
weechat_hook_info (
|
||||
"irc_server_isupport_value",
|
||||
N_("value of feature, if supported by server (from IRC message 005)"),
|
||||
N_("server,feature"),
|
||||
&irc_info_info_irc_server_isupport_value_cb, NULL);
|
||||
&irc_info_info_irc_server_isupport_value_cb, NULL, NULL);
|
||||
|
||||
/* info_hashtable hooks */
|
||||
weechat_hook_info_hashtable (
|
||||
@@ -860,7 +893,7 @@ irc_info_init ()
|
||||
"\"channel\" was not found), "
|
||||
"\"pos_text\": index of \"text\" message (\"-1\" if "
|
||||
"\"text\" was not found)"),
|
||||
&irc_info_info_hashtable_irc_message_parse_cb, NULL);
|
||||
&irc_info_info_hashtable_irc_message_parse_cb, NULL, NULL);
|
||||
weechat_hook_info_hashtable (
|
||||
"irc_message_split",
|
||||
N_("split an IRC message (to fit in 512 bytes)"),
|
||||
@@ -869,7 +902,7 @@ irc_info_init ()
|
||||
N_("\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), "
|
||||
"\"args1\" ... \"argsN\": arguments of messages, \"count\": number "
|
||||
"of messages"),
|
||||
&irc_info_info_hashtable_irc_message_split_cb, NULL);
|
||||
&irc_info_info_hashtable_irc_message_split_cb, NULL, NULL);
|
||||
|
||||
/* infolist hooks */
|
||||
weechat_hook_infolist (
|
||||
@@ -877,61 +910,61 @@ irc_info_init ()
|
||||
N_("list of IRC servers"),
|
||||
N_("server pointer (optional)"),
|
||||
N_("server name (wildcard \"*\" is allowed) (optional)"),
|
||||
&irc_info_infolist_irc_server_cb, NULL);
|
||||
&irc_info_infolist_irc_server_cb, NULL, NULL);
|
||||
weechat_hook_infolist (
|
||||
"irc_channel",
|
||||
N_("list of channels for an IRC server"),
|
||||
N_("channel pointer (optional)"),
|
||||
N_("server,channel (channel is optional)"),
|
||||
&irc_info_infolist_irc_channel_cb, NULL);
|
||||
&irc_info_infolist_irc_channel_cb, NULL, NULL);
|
||||
weechat_hook_infolist (
|
||||
"irc_nick",
|
||||
N_("list of nicks for an IRC channel"),
|
||||
N_("nick pointer (optional)"),
|
||||
N_("server,channel,nick (nick is optional)"),
|
||||
&irc_info_infolist_irc_nick_cb, NULL);
|
||||
&irc_info_infolist_irc_nick_cb, NULL, NULL);
|
||||
weechat_hook_infolist (
|
||||
"irc_ignore",
|
||||
N_("list of IRC ignores"),
|
||||
N_("ignore pointer (optional)"),
|
||||
NULL,
|
||||
&irc_info_infolist_irc_ignore_cb, NULL);
|
||||
&irc_info_infolist_irc_ignore_cb, NULL, NULL);
|
||||
weechat_hook_infolist (
|
||||
"irc_notify",
|
||||
N_("list of notify"),
|
||||
N_("notify pointer (optional)"),
|
||||
N_("server name (wildcard \"*\" is allowed) (optional)"),
|
||||
&irc_info_infolist_irc_notify_cb, NULL);
|
||||
&irc_info_infolist_irc_notify_cb, NULL, NULL);
|
||||
weechat_hook_infolist (
|
||||
"irc_color_weechat",
|
||||
N_("mapping between IRC color codes and WeeChat color names"),
|
||||
NULL,
|
||||
NULL,
|
||||
&irc_info_infolist_irc_color_weechat_cb, NULL);
|
||||
&irc_info_infolist_irc_color_weechat_cb, NULL, NULL);
|
||||
|
||||
/* hdata hooks */
|
||||
weechat_hook_hdata (
|
||||
"irc_nick", N_("irc nick"),
|
||||
&irc_nick_hdata_nick_cb, NULL);
|
||||
&irc_nick_hdata_nick_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_channel", N_("irc channel"),
|
||||
&irc_channel_hdata_channel_cb, NULL);
|
||||
&irc_channel_hdata_channel_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_channel_speaking", N_("irc channel_speaking"),
|
||||
&irc_channel_hdata_channel_speaking_cb, NULL);
|
||||
&irc_channel_hdata_channel_speaking_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_ignore", N_("irc ignore"),
|
||||
&irc_ignore_hdata_ignore_cb, NULL);
|
||||
&irc_ignore_hdata_ignore_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_notify", N_("irc notify"),
|
||||
&irc_notify_hdata_notify_cb, NULL);
|
||||
&irc_notify_hdata_notify_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_redirect_pattern", N_("pattern for irc redirect"),
|
||||
&irc_redirect_hdata_redirect_pattern_cb, NULL);
|
||||
&irc_redirect_hdata_redirect_pattern_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_redirect", N_("irc redirect"),
|
||||
&irc_redirect_hdata_redirect_cb, NULL);
|
||||
&irc_redirect_hdata_redirect_cb, NULL, NULL);
|
||||
weechat_hook_hdata (
|
||||
"irc_server", N_("irc server"),
|
||||
&irc_server_hdata_server_cb, NULL);
|
||||
&irc_server_hdata_server_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -259,10 +259,12 @@ irc_input_data (struct t_gui_buffer *buffer, const char *input_data, int flags,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
|
||||
irc_input_data_cb (const void *pointer, void *data,
|
||||
struct t_gui_buffer *buffer,
|
||||
const char *input_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
return irc_input_data (buffer, input_data,
|
||||
@@ -287,7 +289,8 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_input_send_cb (void *data, const char *signal,
|
||||
irc_input_send_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
const char *ptr_string, *ptr_message;
|
||||
@@ -299,6 +302,7 @@ irc_input_send_cb (void *data, const char *signal,
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
@@ -24,9 +24,11 @@ struct t_gui_buffer;
|
||||
|
||||
extern void irc_input_user_message_display (struct t_gui_buffer *buffer,
|
||||
int action, const char *text);
|
||||
extern int irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
|
||||
extern int irc_input_data_cb (const void *pointer, void *data,
|
||||
struct t_gui_buffer *buffer,
|
||||
const char *input_data);
|
||||
extern int irc_input_send_cb (void *data, const char *signal,
|
||||
const char *type_data, void *signal_data);
|
||||
extern int irc_input_send_cb (const void *pointer, void *data,
|
||||
const char *signal, const char *type_data,
|
||||
void *signal_data);
|
||||
|
||||
#endif /* WEECHAT_IRC_INPUT_H */
|
||||
|
||||
@@ -362,8 +362,7 @@ irc_message_parse_to_hashtable (struct t_irc_server *server,
|
||||
hashtable = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (!hashtable)
|
||||
return NULL;
|
||||
|
||||
@@ -1008,8 +1007,7 @@ irc_message_split (struct t_irc_server *server, const char *message)
|
||||
hashtable = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (!hashtable)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -1128,11 +1128,13 @@ irc_nick_default_ban_mask (struct t_irc_nick *nick)
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_nick_hdata_nick_cb (void *data, const char *hdata_name)
|
||||
irc_nick_hdata_nick_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
|
||||
|
||||
@@ -48,8 +48,6 @@ struct t_irc_nick
|
||||
extern int irc_nick_valid (struct t_irc_channel *channel,
|
||||
struct t_irc_nick *nick);
|
||||
extern int irc_nick_is_nick (const char *string);
|
||||
extern int irc_nick_config_colors_cb (void *data, const char *option,
|
||||
const char *value);
|
||||
extern const char *irc_nick_find_color (const char *nickname);
|
||||
extern const char *irc_nick_find_color_name (const char *nickname);
|
||||
extern int irc_nick_is_op (struct t_irc_server *server,
|
||||
@@ -104,7 +102,8 @@ extern const char *irc_nick_color_for_msg (struct t_irc_server *server,
|
||||
extern const char * irc_nick_color_for_pv (struct t_irc_channel *channel,
|
||||
const char *nickname);
|
||||
extern char *irc_nick_default_ban_mask (struct t_irc_nick *nick);
|
||||
extern struct t_hdata *irc_nick_hdata_nick_cb (void *data,
|
||||
extern struct t_hdata *irc_nick_hdata_nick_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern int irc_nick_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_nick *nick);
|
||||
|
||||
@@ -769,7 +769,7 @@ irc_notify_set_away_message (struct t_irc_notify *notify,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_notify_hsignal_cb (void *data, const char *signal,
|
||||
irc_notify_hsignal_cb (const void *pointer, void *data, const char *signal,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
const char *error, *server, *pattern, *command, *output;
|
||||
@@ -781,6 +781,7 @@ irc_notify_hsignal_cb (void *data, const char *signal,
|
||||
struct t_irc_notify *ptr_notify;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
@@ -962,7 +963,7 @@ irc_notify_hsignal_cb (void *data, const char *signal,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_notify_timer_ison_cb (void *data, int remaining_calls)
|
||||
irc_notify_timer_ison_cb (const void *pointer, void *data, int remaining_calls)
|
||||
{
|
||||
char *message, hash_key[32];
|
||||
const char *str_message;
|
||||
@@ -971,6 +972,7 @@ irc_notify_timer_ison_cb (void *data, int remaining_calls)
|
||||
struct t_hashtable *hashtable;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
@@ -1021,12 +1023,14 @@ irc_notify_timer_ison_cb (void *data, int remaining_calls)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_notify_timer_whois_cb (void *data, int remaining_calls)
|
||||
irc_notify_timer_whois_cb (const void *pointer, void *data,
|
||||
int remaining_calls)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
struct t_irc_notify *ptr_notify, *ptr_next_notify;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
@@ -1067,11 +1071,13 @@ irc_notify_timer_whois_cb (void *data, int remaining_calls)
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_notify_hdata_notify_cb (void *data, const char *hdata_name)
|
||||
irc_notify_hdata_notify_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_notify", "next_notify",
|
||||
@@ -1164,7 +1170,7 @@ irc_notify_hook_timer_ison ()
|
||||
|
||||
irc_notify_timer_ison = weechat_hook_timer (
|
||||
60 * 1000 * weechat_config_integer (irc_config_network_notify_check_ison),
|
||||
0, 0, &irc_notify_timer_ison_cb, NULL);
|
||||
0, 0, &irc_notify_timer_ison_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1179,7 +1185,7 @@ irc_notify_hook_timer_whois ()
|
||||
|
||||
irc_notify_timer_whois = weechat_hook_timer (
|
||||
60 * 1000 * weechat_config_integer (irc_config_network_notify_check_whois),
|
||||
0, 0, &irc_notify_timer_whois_cb, NULL);
|
||||
0, 0, &irc_notify_timer_whois_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1194,7 +1200,7 @@ irc_notify_init ()
|
||||
|
||||
irc_notify_hsignal = weechat_hook_hsignal ("irc_redirection_notify_*",
|
||||
&irc_notify_hsignal_cb,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -60,9 +60,12 @@ extern void irc_notify_set_is_on_server (struct t_irc_notify *notify,
|
||||
extern void irc_notify_free_all (struct t_irc_server *server);
|
||||
extern void irc_notify_display_list (struct t_irc_server *server);
|
||||
extern void irc_notify_send_monitor (struct t_irc_server *server);
|
||||
extern int irc_notify_timer_ison_cb (void *data, int remaining_calls);
|
||||
extern int irc_notify_timer_whois_cb (void *data, int remaining_calls);
|
||||
extern struct t_hdata *irc_notify_hdata_notify_cb (void *data,
|
||||
extern int irc_notify_timer_ison_cb (const void *pointer, void *data,
|
||||
int remaining_calls);
|
||||
extern int irc_notify_timer_whois_cb (const void *pointer, void *data,
|
||||
int remaining_calls);
|
||||
extern struct t_hdata *irc_notify_hdata_notify_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern int irc_notify_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_notify *notify);
|
||||
|
||||
@@ -518,7 +518,7 @@ IRC_PROTOCOL_CALLBACK(cap)
|
||||
timeout * 1000,
|
||||
0, 1,
|
||||
&irc_server_timer_sasl_cb,
|
||||
server);
|
||||
server, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ IRC_PROTOCOL_CALLBACK(kick)
|
||||
IRC_SERVER_OPTION_AUTOREJOIN_DELAY) * 1000,
|
||||
0, 1,
|
||||
&irc_channel_autorejoin_cb,
|
||||
ptr_channel);
|
||||
ptr_channel, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5531,8 +5531,7 @@ irc_protocol_get_message_tags (const char *tags)
|
||||
hashtable = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (!hashtable)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -72,9 +72,10 @@ irc_raw_open (int switch_to_buffer)
|
||||
IRC_RAW_BUFFER_NAME);
|
||||
if (!irc_raw_buffer)
|
||||
{
|
||||
irc_raw_buffer = weechat_buffer_new (IRC_RAW_BUFFER_NAME,
|
||||
&irc_input_data_cb, NULL,
|
||||
&irc_buffer_close_cb, NULL);
|
||||
irc_raw_buffer = weechat_buffer_new (
|
||||
IRC_RAW_BUFFER_NAME,
|
||||
&irc_input_data_cb, NULL, NULL,
|
||||
&irc_buffer_close_cb, NULL, NULL);
|
||||
|
||||
/* failed to create buffer ? then return */
|
||||
if (!irc_raw_buffer)
|
||||
|
||||
@@ -436,8 +436,7 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
|
||||
hash_cmd[i] = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_INTEGER,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
for (j = 0; j < num_items[i]; j++)
|
||||
{
|
||||
if (i < 3)
|
||||
@@ -732,8 +731,7 @@ irc_redirect_stop (struct t_irc_redirect *redirect, const char *error)
|
||||
hashtable = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
if (hashtable)
|
||||
{
|
||||
/* set error and output (main fields) */
|
||||
@@ -993,11 +991,13 @@ irc_redirect_free_all (struct t_irc_server *server)
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
|
||||
irc_redirect_hdata_redirect_pattern_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
|
||||
@@ -1023,11 +1023,13 @@ irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_redirect_hdata_redirect_cb (void *data, const char *hdata_name)
|
||||
irc_redirect_hdata_redirect_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
|
||||
@@ -1237,7 +1239,8 @@ irc_redirect_print_log (struct t_irc_server *server)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
|
||||
irc_redirect_pattern_hsignal_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
const char *pattern, *str_timeout, *cmd_start, *cmd_stop, *cmd_extra;
|
||||
@@ -1245,6 +1248,7 @@ irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
|
||||
int number, timeout;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
@@ -1301,7 +1305,8 @@ irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_redirect_command_hsignal_cb (void *data, const char *signal,
|
||||
irc_redirect_command_hsignal_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
const char *server, *pattern, *redirect_signal, *str_count, *string;
|
||||
@@ -1311,6 +1316,7 @@ irc_redirect_command_hsignal_cb (void *data, const char *signal,
|
||||
int number, count, timeout;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
|
||||
@@ -109,9 +109,11 @@ extern int irc_redirect_message (struct t_irc_server *server,
|
||||
const char *arguments);
|
||||
extern void irc_redirect_free (struct t_irc_redirect *redirect);
|
||||
extern void irc_redirect_free_all (struct t_irc_server *server);
|
||||
extern struct t_hdata *irc_redirect_hdata_redirect_pattern_cb (void *data,
|
||||
extern struct t_hdata *irc_redirect_hdata_redirect_pattern_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern struct t_hdata *irc_redirect_hdata_redirect_cb (void *data,
|
||||
extern struct t_hdata *irc_redirect_hdata_redirect_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern int irc_redirect_pattern_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_redirect_pattern *redirect_pattern);
|
||||
@@ -119,9 +121,11 @@ extern int irc_redirect_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_redirect *redirect);
|
||||
extern void irc_redirect_pattern_print_log ();
|
||||
extern void irc_redirect_print_log (struct t_irc_server *server);
|
||||
extern int irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
|
||||
extern int irc_redirect_pattern_hsignal_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
struct t_hashtable *hashtable);
|
||||
extern int irc_redirect_command_hsignal_cb (void *data, const char *signal,
|
||||
extern int irc_redirect_command_hsignal_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
struct t_hashtable *hashtable);
|
||||
extern void irc_redirect_init ();
|
||||
extern void irc_redirect_end ();
|
||||
|
||||
@@ -1056,21 +1056,21 @@ irc_server_alloc (const char *name)
|
||||
new_server->notify_list = NULL;
|
||||
new_server->last_notify = NULL;
|
||||
new_server->notify_count = 0;
|
||||
new_server->join_manual = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_TIME,
|
||||
NULL,
|
||||
NULL);
|
||||
new_server->join_channel_key = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
new_server->join_noswitch = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_TIME,
|
||||
NULL,
|
||||
NULL);
|
||||
new_server->join_manual = weechat_hashtable_new (
|
||||
32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_TIME,
|
||||
NULL, NULL);
|
||||
new_server->join_channel_key = weechat_hashtable_new (
|
||||
32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL, NULL);
|
||||
new_server->join_noswitch = weechat_hashtable_new (
|
||||
32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_TIME,
|
||||
NULL, NULL);
|
||||
new_server->buffer = NULL;
|
||||
new_server->buffer_as_string = NULL;
|
||||
new_server->channels = NULL;
|
||||
@@ -1100,9 +1100,11 @@ irc_server_alloc (const char *name)
|
||||
1,
|
||||
&irc_config_server_check_value_cb,
|
||||
irc_server_options[i][0],
|
||||
NULL,
|
||||
&irc_config_server_change_cb,
|
||||
irc_server_options[i][0]);
|
||||
irc_config_server_change_cb (irc_server_options[i][0],
|
||||
irc_server_options[i][0],
|
||||
NULL);
|
||||
irc_config_server_change_cb (irc_server_options[i][0], NULL,
|
||||
new_server->options[i]);
|
||||
free (option_name);
|
||||
}
|
||||
@@ -2289,8 +2291,7 @@ irc_server_sendf (struct t_irc_server *server, int flags, const char *tags,
|
||||
ret_hashtable = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL,
|
||||
NULL);
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
@@ -2762,16 +2763,17 @@ irc_server_msgq_flush ()
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_recv_cb (void *data, int fd)
|
||||
irc_server_recv_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_irc_server *server;
|
||||
static char buffer[4096 + 2];
|
||||
int num_read, msgq_flush, end_recv;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) fd;
|
||||
|
||||
server = (struct t_irc_server *)data;
|
||||
server = (struct t_irc_server *)pointer;
|
||||
if (!server)
|
||||
return WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2865,14 +2867,16 @@ irc_server_recv_cb (void *data, int fd)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_timer_connection_cb (void *data, int remaining_calls)
|
||||
irc_server_timer_connection_cb (const void *pointer, void *data,
|
||||
int remaining_calls)
|
||||
{
|
||||
struct t_irc_server *server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
server = (struct t_irc_server *)data;
|
||||
server = (struct t_irc_server *)pointer;
|
||||
|
||||
if (!server)
|
||||
return WEECHAT_RC_ERROR;
|
||||
@@ -2898,15 +2902,16 @@ irc_server_timer_connection_cb (void *data, int remaining_calls)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_timer_sasl_cb (void *data, int remaining_calls)
|
||||
irc_server_timer_sasl_cb (const void *pointer, void *data, int remaining_calls)
|
||||
{
|
||||
struct t_irc_server *server;
|
||||
int sasl_fail;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
server = (struct t_irc_server *)data;
|
||||
server = (struct t_irc_server *)pointer;
|
||||
|
||||
if (!server)
|
||||
return WEECHAT_RC_ERROR;
|
||||
@@ -2940,7 +2945,8 @@ irc_server_timer_sasl_cb (void *data, int remaining_calls)
|
||||
*/
|
||||
|
||||
void
|
||||
irc_server_check_join_manual_cb (void *data, struct t_hashtable *hashtable,
|
||||
irc_server_check_join_manual_cb (void *data,
|
||||
struct t_hashtable *hashtable,
|
||||
const void *key, const void *value)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
@@ -2956,7 +2962,8 @@ irc_server_check_join_manual_cb (void *data, struct t_hashtable *hashtable,
|
||||
*/
|
||||
|
||||
void
|
||||
irc_server_check_join_noswitch_cb (void *data, struct t_hashtable *hashtable,
|
||||
irc_server_check_join_noswitch_cb (void *data,
|
||||
struct t_hashtable *hashtable,
|
||||
const void *key, const void *value)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
@@ -2994,7 +3001,7 @@ irc_server_check_join_smart_filtered_cb (void *data,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_timer_cb (void *data, int remaining_calls)
|
||||
irc_server_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
@@ -3004,6 +3011,7 @@ irc_server_timer_cb (void *data, int remaining_calls)
|
||||
int away_check;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
@@ -3381,7 +3389,7 @@ irc_server_login (struct t_irc_server *server)
|
||||
IRC_SERVER_OPTION_INTEGER (server, IRC_SERVER_OPTION_CONNECTION_TIMEOUT) * 1000,
|
||||
0, 1,
|
||||
&irc_server_timer_connection_cb,
|
||||
server);
|
||||
server, NULL);
|
||||
|
||||
if (password)
|
||||
free (password);
|
||||
@@ -3431,13 +3439,17 @@ irc_server_switch_address (struct t_irc_server *server, int connection)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock,
|
||||
irc_server_connect_cb (const void *pointer, void *data,
|
||||
int status, int gnutls_rc, int sock,
|
||||
const char *error, const char *ip_address)
|
||||
{
|
||||
struct t_irc_server *server;
|
||||
const char *proxy;
|
||||
|
||||
server = (struct t_irc_server *)data;
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
server = (struct t_irc_server *)pointer;
|
||||
|
||||
proxy = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY);
|
||||
|
||||
@@ -3462,7 +3474,7 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock,
|
||||
server->hook_fd = weechat_hook_fd (server->sock,
|
||||
1, 0, 0,
|
||||
&irc_server_recv_cb,
|
||||
server);
|
||||
server, NULL);
|
||||
/* login to server */
|
||||
irc_server_login (server);
|
||||
break;
|
||||
@@ -3719,8 +3731,8 @@ irc_server_create_buffer (struct t_irc_server *server)
|
||||
snprintf (buffer_name, sizeof (buffer_name),
|
||||
"server.%s", server->name);
|
||||
server->buffer = weechat_buffer_new (buffer_name,
|
||||
&irc_input_data_cb, NULL,
|
||||
&irc_buffer_close_cb, NULL);
|
||||
&irc_input_data_cb, NULL, NULL,
|
||||
&irc_buffer_close_cb, NULL, NULL);
|
||||
if (!server->buffer)
|
||||
return NULL;
|
||||
|
||||
@@ -4549,7 +4561,8 @@ irc_server_connect (struct t_irc_server *server)
|
||||
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES),
|
||||
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
|
||||
&irc_server_connect_cb,
|
||||
server);
|
||||
server,
|
||||
NULL);
|
||||
#else
|
||||
server->hook_connect = weechat_hook_connect (
|
||||
proxy,
|
||||
@@ -4560,7 +4573,8 @@ irc_server_connect (struct t_irc_server *server)
|
||||
NULL, NULL, 0, NULL,
|
||||
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
|
||||
&irc_server_connect_cb,
|
||||
server);
|
||||
server,
|
||||
NULL);
|
||||
#endif /* HAVE_GNUTLS */
|
||||
|
||||
/* send signal "irc_server_connecting" with server name */
|
||||
@@ -4595,15 +4609,17 @@ irc_server_reconnect (struct t_irc_server *server)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_auto_connect_timer_cb (void *data, int remaining_calls)
|
||||
irc_server_auto_connect_timer_cb (const void *pointer, void *data,
|
||||
int remaining_calls)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
void *auto_connect;
|
||||
int auto_connect;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) remaining_calls;
|
||||
|
||||
auto_connect = data;
|
||||
auto_connect = (pointer) ? 1 : 0;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
@@ -4629,8 +4645,10 @@ irc_server_auto_connect_timer_cb (void *data, int remaining_calls)
|
||||
void
|
||||
irc_server_auto_connect (int auto_connect)
|
||||
{
|
||||
weechat_hook_timer (1, 0, 1, &irc_server_auto_connect_timer_cb,
|
||||
(auto_connect) ? (void *)1 : (void *)0);
|
||||
weechat_hook_timer (1, 0, 1,
|
||||
&irc_server_auto_connect_timer_cb,
|
||||
(auto_connect) ? (void *)1 : (void *)0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5026,7 +5044,8 @@ irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_xfer_send_ready_cb (void *data, const char *signal,
|
||||
irc_server_xfer_send_ready_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
struct t_infolist *infolist;
|
||||
@@ -5038,6 +5057,7 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
|
||||
int spaces_in_name, rc;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
@@ -5127,7 +5147,8 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_xfer_resume_ready_cb (void *data, const char *signal,
|
||||
irc_server_xfer_resume_ready_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
struct t_infolist *infolist;
|
||||
@@ -5136,6 +5157,7 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal,
|
||||
int spaces_in_name;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
@@ -5180,7 +5202,8 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
|
||||
irc_server_xfer_send_accept_resume_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
@@ -5190,6 +5213,7 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
|
||||
int spaces_in_name;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
@@ -5231,11 +5255,13 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
irc_server_hdata_server_cb (void *data, const char *hdata_name)
|
||||
irc_server_hdata_server_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_server", "next_server",
|
||||
|
||||
@@ -330,9 +330,11 @@ char *irc_server_fingerprint_str_sizes ();
|
||||
extern int irc_server_connect (struct t_irc_server *server);
|
||||
extern void irc_server_auto_connect (int auto_connect);
|
||||
extern void irc_server_autojoin_channels ();
|
||||
extern int irc_server_recv_cb (void *data, int fd);
|
||||
extern int irc_server_timer_sasl_cb (void *data, int remaining_calls);
|
||||
extern int irc_server_timer_cb (void *data, int remaining_calls);
|
||||
extern int irc_server_recv_cb (const void *pointer, void *data, int fd);
|
||||
extern int irc_server_timer_sasl_cb (const void *pointer, void *data,
|
||||
int remaining_calls);
|
||||
extern int irc_server_timer_cb (const void *pointer, void *data,
|
||||
int remaining_calls);
|
||||
extern void irc_server_outqueue_free_all (struct t_irc_server *server,
|
||||
int priority);
|
||||
extern int irc_server_get_channel_count (struct t_irc_server *server);
|
||||
@@ -347,14 +349,21 @@ extern void irc_server_disconnect (struct t_irc_server *server,
|
||||
int switch_address, int reconnect);
|
||||
extern void irc_server_disconnect_all ();
|
||||
extern void irc_server_free (struct t_irc_server *server);
|
||||
extern int irc_server_xfer_send_ready_cb (void *data, const char *signal,
|
||||
const char *type_data, void *signal_data);
|
||||
extern int irc_server_xfer_resume_ready_cb (void *data, const char *signal,
|
||||
const char *type_data, void *signal_data);
|
||||
extern int irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
|
||||
extern int irc_server_xfer_send_ready_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data,
|
||||
void *signal_data);
|
||||
extern int irc_server_xfer_resume_ready_cb (const void *pointer, void *data,
|
||||
const char *signal,
|
||||
const char *type_data,
|
||||
void *signal_data);
|
||||
extern int irc_server_xfer_send_accept_resume_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *signal,
|
||||
const char *type_data,
|
||||
void *signal_data);
|
||||
extern struct t_hdata *irc_server_hdata_server_cb (void *data,
|
||||
extern struct t_hdata *irc_server_hdata_server_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *hdata_name);
|
||||
extern int irc_server_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_server *server);
|
||||
|
||||
@@ -224,7 +224,8 @@ irc_upgrade_save ()
|
||||
int rc;
|
||||
struct t_upgrade_file *upgrade_file;
|
||||
|
||||
upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME, 1);
|
||||
upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME,
|
||||
NULL, NULL, NULL);
|
||||
if (!upgrade_file)
|
||||
return 0;
|
||||
|
||||
@@ -269,7 +270,7 @@ irc_upgrade_set_buffer_callbacks ()
|
||||
if (ptr_server)
|
||||
{
|
||||
weechat_buffer_set_pointer (ptr_buffer,
|
||||
"nickcmp_callback_data",
|
||||
"nickcmp_callback_pointer",
|
||||
ptr_server);
|
||||
}
|
||||
}
|
||||
@@ -289,7 +290,7 @@ irc_upgrade_set_buffer_callbacks ()
|
||||
*/
|
||||
|
||||
int
|
||||
irc_upgrade_read_cb (void *data,
|
||||
irc_upgrade_read_cb (const void *pointer, void *data,
|
||||
struct t_upgrade_file *upgrade_file,
|
||||
int object_id,
|
||||
struct t_infolist *infolist)
|
||||
@@ -306,6 +307,7 @@ irc_upgrade_read_cb (void *data,
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) upgrade_file;
|
||||
|
||||
@@ -354,10 +356,12 @@ irc_upgrade_read_cb (void *data,
|
||||
if (sock >= 0)
|
||||
{
|
||||
irc_upgrade_current_server->sock = sock;
|
||||
irc_upgrade_current_server->hook_fd = weechat_hook_fd (irc_upgrade_current_server->sock,
|
||||
1, 0, 0,
|
||||
&irc_server_recv_cb,
|
||||
irc_upgrade_current_server);
|
||||
irc_upgrade_current_server->hook_fd = weechat_hook_fd (
|
||||
irc_upgrade_current_server->sock,
|
||||
1, 0, 0,
|
||||
&irc_server_recv_cb,
|
||||
irc_upgrade_current_server,
|
||||
NULL);
|
||||
}
|
||||
irc_upgrade_current_server->is_connected = weechat_infolist_integer (infolist, "is_connected");
|
||||
irc_upgrade_current_server->ssl_connected = weechat_infolist_integer (infolist, "ssl_connected");
|
||||
@@ -734,10 +738,13 @@ irc_upgrade_load ()
|
||||
|
||||
irc_upgrade_set_buffer_callbacks ();
|
||||
|
||||
upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME, 0);
|
||||
upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME,
|
||||
&irc_upgrade_read_cb, NULL, NULL);
|
||||
if (!upgrade_file)
|
||||
return 0;
|
||||
rc = weechat_upgrade_read (upgrade_file, &irc_upgrade_read_cb, NULL);
|
||||
|
||||
rc = weechat_upgrade_read (upgrade_file);
|
||||
|
||||
weechat_upgrade_close (upgrade_file);
|
||||
|
||||
return rc;
|
||||
|
||||
+30
-14
@@ -64,12 +64,14 @@ int irc_signal_upgrade_received = 0; /* signal "upgrade" received ? */
|
||||
*/
|
||||
|
||||
int
|
||||
irc_signal_quit_cb (void *data, const char *signal, const char *type_data,
|
||||
irc_signal_quit_cb (const void *pointer, void *data,
|
||||
const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
@@ -92,13 +94,15 @@ irc_signal_quit_cb (void *data, const char *signal, const char *type_data,
|
||||
*/
|
||||
|
||||
int
|
||||
irc_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
|
||||
irc_signal_upgrade_cb (const void *pointer, void *data,
|
||||
const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
int quit, ssl_disconnected;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
@@ -179,21 +183,32 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
/* hook some signals */
|
||||
irc_debug_init ();
|
||||
weechat_hook_signal ("quit", &irc_signal_quit_cb, NULL);
|
||||
weechat_hook_signal ("upgrade", &irc_signal_upgrade_cb, NULL);
|
||||
weechat_hook_signal ("xfer_send_ready", &irc_server_xfer_send_ready_cb, NULL);
|
||||
weechat_hook_signal ("xfer_resume_ready", &irc_server_xfer_resume_ready_cb, NULL);
|
||||
weechat_hook_signal ("xfer_send_accept_resume", &irc_server_xfer_send_accept_resume_cb, NULL);
|
||||
weechat_hook_signal ("irc_input_send", &irc_input_send_cb, NULL);
|
||||
weechat_hook_signal ("quit",
|
||||
&irc_signal_quit_cb, NULL, NULL);
|
||||
weechat_hook_signal ("upgrade",
|
||||
&irc_signal_upgrade_cb, NULL, NULL);
|
||||
weechat_hook_signal ("xfer_send_ready",
|
||||
&irc_server_xfer_send_ready_cb, NULL, NULL);
|
||||
weechat_hook_signal ("xfer_resume_ready",
|
||||
&irc_server_xfer_resume_ready_cb, NULL, NULL);
|
||||
weechat_hook_signal ("xfer_send_accept_resume",
|
||||
&irc_server_xfer_send_accept_resume_cb, NULL, NULL);
|
||||
weechat_hook_signal ("irc_input_send",
|
||||
&irc_input_send_cb, NULL, NULL);
|
||||
|
||||
/* hook hsignals for redirection */
|
||||
weechat_hook_hsignal ("irc_redirect_pattern", &irc_redirect_pattern_hsignal_cb, NULL);
|
||||
weechat_hook_hsignal ("irc_redirect_command", &irc_redirect_command_hsignal_cb, NULL);
|
||||
weechat_hook_hsignal ("irc_redirect_pattern",
|
||||
&irc_redirect_pattern_hsignal_cb, NULL, NULL);
|
||||
weechat_hook_hsignal ("irc_redirect_command",
|
||||
&irc_redirect_command_hsignal_cb, NULL, NULL);
|
||||
|
||||
/* modifiers */
|
||||
weechat_hook_modifier ("irc_color_decode", &irc_color_modifier_cb, NULL);
|
||||
weechat_hook_modifier ("irc_color_encode", &irc_color_modifier_cb, NULL);
|
||||
weechat_hook_modifier ("irc_color_decode_ansi", &irc_color_modifier_cb, NULL);
|
||||
weechat_hook_modifier ("irc_color_decode",
|
||||
&irc_color_modifier_cb, NULL, NULL);
|
||||
weechat_hook_modifier ("irc_color_encode",
|
||||
&irc_color_modifier_cb, NULL, NULL);
|
||||
weechat_hook_modifier ("irc_color_decode_ansi",
|
||||
&irc_color_modifier_cb, NULL, NULL);
|
||||
|
||||
/* hook completions */
|
||||
irc_completion_init ();
|
||||
@@ -245,7 +260,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
}
|
||||
|
||||
irc_hook_timer = weechat_hook_timer (1 * 1000, 0, 0,
|
||||
&irc_server_timer_cb, NULL);
|
||||
&irc_server_timer_cb,
|
||||
NULL, NULL);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user