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

Add "const" keyword for some "char *" function arguments (core and plugins API)

This commit is contained in:
Sebastien Helleu
2008-06-03 10:56:51 +02:00
parent 2b1d7df86c
commit 3a53257032
123 changed files with 1598 additions and 1487 deletions
+29 -19
View File
@@ -51,7 +51,7 @@ struct t_alias *last_alias = NULL;
*/
struct t_alias *
alias_search (char *alias_name)
alias_search (const char *alias_name)
{
struct t_alias *ptr_alias;
@@ -70,7 +70,7 @@ alias_search (char *alias_name)
*/
void
alias_add_word (char **alias, int *length, char *word)
alias_add_word (char **alias, int *length, const char *word)
{
int length_word;
@@ -99,9 +99,10 @@ alias_add_word (char **alias, int *length, char *word)
*/
char *
alias_replace_args (char *alias_args, char *user_args)
alias_replace_args (const char *alias_args, const char *user_args)
{
char **argv, *start, *pos, *res;
char **argv, *res, *word;
const char *start, *pos;
int argc, length_res, args_count;
argv = weechat_string_explode (user_args, " ", 0, 0, &argc);
@@ -115,10 +116,13 @@ alias_replace_args (char *alias_args, char *user_args)
{
if ((pos[0] == '\\') && (pos[1] == '$'))
{
pos[0] = '\0';
alias_add_word (&res, &length_res, start);
word = weechat_strndup (start, pos - start);
if (word)
{
alias_add_word (&res, &length_res, word);
free (word);
}
alias_add_word (&res, &length_res, "$");
pos[0] = '\\';
start = pos + 2;
pos = start;
}
@@ -129,10 +133,13 @@ alias_replace_args (char *alias_args, char *user_args)
if (pos[1] == '*')
{
args_count++;
pos[0] = '\0';
alias_add_word (&res, &length_res, start);
word = weechat_strndup (start, pos - start);
if (word)
{
alias_add_word (&res, &length_res, word);
free (word);
}
alias_add_word (&res, &length_res, user_args);
pos[0] = '$';
start = pos + 2;
pos = start;
}
@@ -141,11 +148,14 @@ alias_replace_args (char *alias_args, char *user_args)
if ((pos[1] >= '1') && (pos[1] <= '9'))
{
args_count++;
pos[0] = '\0';
alias_add_word (&res, &length_res, start);
word = weechat_strndup (start, pos - start);
if (word)
{
alias_add_word (&res, &length_res, start);
free (word);
}
if (pos[1] - '0' <= argc)
alias_add_word (&res, &length_res, argv[pos[1] - '1']);
pos[0] = '$';
start = pos + 2;
pos = start;
}
@@ -293,7 +303,7 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
*/
struct t_alias *
alias_find_pos (char *name)
alias_find_pos (const char *name)
{
struct t_alias *ptr_alias;
@@ -312,7 +322,7 @@ alias_find_pos (char *name)
*/
struct t_alias *
alias_new (char *name, char *command)
alias_new (const char *name, const char *command)
{
struct t_alias *new_alias, *ptr_alias, *pos_alias;
struct t_hook *new_hook;
@@ -524,7 +534,7 @@ alias_config_reload (void *data, struct t_config_file *config_file)
void
alias_config_write_default (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
/* make C compiler happy */
(void) data;
@@ -565,7 +575,7 @@ alias_config_write_default (void *data,
int
alias_config_create_option (void *data, struct t_config_file *config_file,
struct t_config_section *section,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_alias *ptr_alias;
int rc;
@@ -795,8 +805,8 @@ unalias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
*/
int
alias_completion_cb (void *data, char *completion, struct t_gui_buffer *buffer,
struct t_weelist *list)
alias_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer, struct t_weelist *list)
{
struct t_alias *ptr_alias;
+15 -14
View File
@@ -59,7 +59,8 @@ int charset_debug = 0;
*/
int
charset_debug_cb (void *data, char *signal, char *type_data, void *signal_data)
charset_debug_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -104,7 +105,7 @@ charset_config_reload (void *data, struct t_config_file *config_file)
int
charset_config_create_option (void *data, struct t_config_file *config_file,
struct t_config_section *section,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_config_option *ptr_option;
int rc;
@@ -256,7 +257,7 @@ charset_config_write ()
*/
int
charset_check (char *charset)
charset_check (const char *charset)
{
iconv_t cd;
@@ -278,7 +279,7 @@ charset_check (char *charset)
*/
char *
charset_get (struct t_config_section *section, char *name,
charset_get (struct t_config_section *section, const char *name,
struct t_config_option *default_charset)
{
char *option_name, *ptr_end;
@@ -326,12 +327,12 @@ charset_get (struct t_config_section *section, char *name,
}
/*
* charset_decode: decode a string with a charset to internal charset
* charset_decode_cb: decode a string with a charset to internal charset
*/
char *
charset_decode (void *data, char *modifier, char *modifier_data,
char *string)
charset_decode_cb (void *data, const char *modifier, const char *modifier_data,
const char *string)
{
char *charset;
@@ -355,12 +356,12 @@ charset_decode (void *data, char *modifier, char *modifier_data,
}
/*
* charset_encode: encode a string from internal charset to another one
* charset_encode_cb: encode a string from internal charset to another one
*/
char *
charset_encode (void *data, char *modifier, char *modifier_data,
char *string)
charset_encode_cb (void *data, const char *modifier, const char *modifier_data,
const char *string)
{
char *charset;
@@ -388,8 +389,8 @@ charset_encode (void *data, char *modifier, char *modifier_data,
*/
void
charset_set (struct t_config_section *section, char *type,
char *name, char *value)
charset_set (struct t_config_section *section, const char *type,
const char *name, const char *value)
{
if (charset_config_create_option (NULL,
charset_config_file,
@@ -552,8 +553,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
&charset_command_cb, NULL);
/* modifiers hooks */
weechat_hook_modifier ("charset_decode", &charset_decode, NULL);
weechat_hook_modifier ("charset_encode", &charset_encode, NULL);
weechat_hook_modifier ("charset_decode", &charset_decode_cb, NULL);
weechat_hook_modifier ("charset_encode", &charset_encode_cb, NULL);
/* callback for debug */
weechat_hook_signal ("debug", &charset_debug_cb, NULL);
+6 -5
View File
@@ -49,8 +49,8 @@ int demo_debug = 0;
*/
int
demo_debug_signal_debug_cb (void *data, char *signal, char *type_data,
void *signal_data)
demo_debug_signal_debug_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -132,7 +132,7 @@ demo_infobar_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
int
demo_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
char *input_data)
const char *input_data)
{
/* make C compiler happy */
(void) data;
@@ -223,7 +223,7 @@ demo_buffer_set_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
*/
void
demo_infolist_print (struct t_plugin_infolist *infolist, char *item_name)
demo_infolist_print (struct t_plugin_infolist *infolist, const char *item_name)
{
char *fields, **argv;
int i, j, argc;
@@ -357,7 +357,8 @@ demo_info_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
*/
int
demo_signal_cb (void *data, char *signal, char *type_data, void *signal_data)
demo_signal_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
(void) data;
+19 -11
View File
@@ -157,52 +157,57 @@ fifo_remove ()
*/
void
fifo_exec (char *text)
fifo_exec (const char *text)
{
char *pos_msg, *pos;
char *text2, *pos_msg, *pos;
struct t_gui_buffer *ptr_buffer;
text2 = strdup (text);
if (!text2)
return;
pos = NULL;
ptr_buffer = NULL;
/* look for category/name at beginning of text
text may be: "category,name *text" or "name *text" or "*text" */
if (text[0] == '*')
if (text2[0] == '*')
{
pos_msg = text + 1;
pos_msg = text2 + 1;
ptr_buffer = weechat_buffer_search (NULL, NULL);
if (!ptr_buffer)
ptr_buffer = weechat_current_buffer;
}
else
{
pos_msg = strstr (text, " *");
pos_msg = strstr (text2, " *");
if (!pos_msg)
{
weechat_printf (NULL,
_("%s%s: error, invalid text received on pipe"),
weechat_prefix ("error"), "fifo");
free (text2);
return;
}
pos_msg[0] = '\0';
pos = pos_msg - 1;
pos_msg += 2;
while ((pos >= text) && (pos[0] == ' '))
while ((pos >= text2) && (pos[0] == ' '))
{
pos[0] = '\0';
pos--;
}
if (text[0])
if (text2[0])
{
pos = strchr (text, ',');
pos = strchr (text2, ',');
if (pos)
{
pos[0] = '\0';
ptr_buffer = weechat_buffer_search (text, pos + 1);
ptr_buffer = weechat_buffer_search (text2, pos + 1);
}
else
ptr_buffer = weechat_buffer_search (NULL, text);
ptr_buffer = weechat_buffer_search (NULL, text2);
if (!ptr_buffer)
ptr_buffer = weechat_current_buffer;
}
@@ -213,10 +218,13 @@ fifo_exec (char *text)
weechat_printf (NULL,
_("%s%s: error, buffer not found for pipe data"),
weechat_prefix ("error"), "fifo");
free (text2);
return;
}
weechat_command (ptr_buffer, pos_msg);
free (text2);
}
/*
@@ -320,7 +328,7 @@ fifo_read ()
*/
int
fifo_config_cb (void *data, char *option, char *value)
fifo_config_cb (void *data, const char *option, const char *value)
{
/* make C compiler happy */
(void) data;
+7 -7
View File
@@ -40,7 +40,7 @@
struct t_irc_channel *
irc_channel_new (struct t_irc_server *server, int channel_type,
char *channel_name, int switch_to_channel)
const char *channel_name, int switch_to_channel)
{
struct t_irc_channel *new_channel;
struct t_gui_buffer *new_buffer;
@@ -188,7 +188,7 @@ irc_channel_free_all (struct t_irc_server *server)
*/
struct t_irc_channel *
irc_channel_search (struct t_irc_server *server, char *channel_name)
irc_channel_search (struct t_irc_server *server, const char *channel_name)
{
struct t_irc_channel *ptr_channel;
@@ -209,7 +209,7 @@ irc_channel_search (struct t_irc_server *server, char *channel_name)
*/
struct t_irc_channel *
irc_channel_search_any (struct t_irc_server *server, char *channel_name)
irc_channel_search_any (struct t_irc_server *server, const char *channel_name)
{
struct t_irc_channel *ptr_channel;
@@ -232,7 +232,7 @@ irc_channel_search_any (struct t_irc_server *server, char *channel_name)
struct t_irc_channel *
irc_channel_search_any_without_buffer (struct t_irc_server *server,
char *channel_name)
const char *channel_name)
{
struct t_irc_channel *ptr_channel;
@@ -254,7 +254,7 @@ irc_channel_search_any_without_buffer (struct t_irc_server *server,
*/
int
irc_channel_is_channel (char *string)
irc_channel_is_channel (const char *string)
{
char first_char[2];
@@ -311,7 +311,7 @@ irc_channel_check_away (struct t_irc_server *server,
*/
void
irc_channel_set_away (struct t_irc_channel *channel, char *nick, int is_away)
irc_channel_set_away (struct t_irc_channel *channel, const char *nick, int is_away)
{
(void) channel;
(void) nick;
@@ -404,7 +404,7 @@ irc_channel_set_notify_level (struct t_irc_server *server,
*/
void
irc_channel_add_nick_speaking (struct t_irc_channel *channel, char *nick)
irc_channel_add_nick_speaking (struct t_irc_channel *channel, const char *nick)
{
int size, to_remove, i;
+7 -7
View File
@@ -56,22 +56,22 @@ struct t_irc_channel
extern struct t_irc_channel *irc_channel_new (struct t_irc_server *server,
int channel_type,
char *channel_name,
const char *channel_name,
int switch_to_channel);
extern void irc_channel_free (struct t_irc_server *server,
struct t_irc_channel *channel);
extern void irc_channel_free_all (struct t_irc_server *server);
extern struct t_irc_channel *irc_channel_search (struct t_irc_server *server,
char *channel_name);
const char *channel_name);
extern struct t_irc_channel *irc_channel_search_any (struct t_irc_server *server,
char *channel_name);
const char *channel_name);
extern struct t_irc_channel *irc_channel_search_any_without_buffer (struct t_irc_server *server,
char *channel_name);
extern int irc_channel_is_channel (char *string);
const char *channel_name);
extern int irc_channel_is_channel (const char *string);
extern void irc_channel_remove_away (struct t_irc_channel *channel);
extern void irc_channel_check_away (struct t_irc_server *server,
struct t_irc_channel *channel, int force);
extern void irc_channel_set_away (struct t_irc_channel *channel, char *nick,
extern void irc_channel_set_away (struct t_irc_channel *channel, const char *nick,
int is_away);
extern int irc_channel_get_notify_level (struct t_irc_server *server,
struct t_irc_channel *channel);
@@ -79,7 +79,7 @@ extern void irc_channel_set_notify_level (struct t_irc_server *server,
struct t_irc_channel *channel,
int notify);
extern void irc_channel_add_nick_speaking (struct t_irc_channel *channel,
char *nick);
const char *nick);
extern void irc_channel_print_log (struct t_irc_channel *channel);
#endif /* irc-channel.h */
+3 -3
View File
@@ -58,7 +58,7 @@ char *irc_color_to_weechat[IRC_NUM_COLORS] =
*/
char *
irc_color_decode (char *string, int keep_colors)
irc_color_decode (const char *string, int keep_colors)
{
unsigned char *out, *ptr_string;
int out_length, length, out_pos;
@@ -184,7 +184,7 @@ irc_color_decode (char *string, int keep_colors)
*/
char *
irc_color_decode_for_user_entry (char *string)
irc_color_decode_for_user_entry (const char *string)
{
unsigned char *out, *ptr_string;
int out_length, out_pos, length;
@@ -252,7 +252,7 @@ irc_color_decode_for_user_entry (char *string)
*/
char *
irc_color_encode (char *string, int keep_colors)
irc_color_encode (const char *string, int keep_colors)
{
unsigned char *out, *ptr_string;
int out_length, out_pos, length;
+3 -3
View File
@@ -53,8 +53,8 @@
#define IRC_COLOR_UNDERLINE_CHAR '\x1F'
#define IRC_COLOR_UNDERLINE_STR "\x1F"
extern char *irc_color_decode (char *string, int keep_colors);
extern char *irc_color_decode_for_user_entry (char *string);
extern char *irc_color_encode (char *string, int keep_colors);
extern char *irc_color_decode (const char *string, int keep_colors);
extern char *irc_color_decode_for_user_entry (const char *string);
extern char *irc_color_encode (const char *string, int keep_colors);
#endif /* irc-color.h */
+15 -13
View File
@@ -71,7 +71,7 @@ irc_command_admin (void *data, struct t_gui_buffer *buffer, int argc,
void
irc_command_me_channel (struct t_irc_server *server,
struct t_irc_channel *channel,
char *arguments)
const char *arguments)
{
char *string;
@@ -97,7 +97,7 @@ irc_command_me_channel (struct t_irc_server *server,
*/
void
irc_command_me_all_channels (struct t_irc_server *server, char *arguments)
irc_command_me_all_channels (struct t_irc_server *server, const char *arguments)
{
struct t_irc_channel *ptr_channel;
@@ -114,8 +114,8 @@ irc_command_me_all_channels (struct t_irc_server *server, char *arguments)
*/
void
irc_command_mode_nicks (struct t_irc_server *server, char *channel,
char *set, char *mode, int argc, char **argv)
irc_command_mode_nicks (struct t_irc_server *server, const char *channel,
const char *set, const char *mode, int argc, char **argv)
{
int i, length;
char *command;
@@ -248,7 +248,7 @@ irc_command_amsg (void *data, struct t_gui_buffer *buffer, int argc,
*/
void
irc_command_away_server (struct t_irc_server *server, char *arguments)
irc_command_away_server (struct t_irc_server *server, const char *arguments)
{
char *string, buffer[4096];
time_t time_now, elapsed;
@@ -1098,9 +1098,10 @@ irc_command_die (void *data, struct t_gui_buffer *buffer, int argc,
*/
void
irc_command_quit_server (struct t_irc_server *server, char *arguments)
irc_command_quit_server (struct t_irc_server *server, const char *arguments)
{
char *ptr_arg, *buf, *version;
const char *ptr_arg;
char *buf, *version;
if (!server)
return;
@@ -1348,7 +1349,7 @@ irc_command_ison (void *data, struct t_gui_buffer *buffer, int argc,
*/
void
irc_command_join_server (struct t_irc_server *server, char *arguments)
irc_command_join_server (struct t_irc_server *server, const char *arguments)
{
if (irc_channel_is_channel (arguments))
irc_server_sendf (server, "JOIN %s", arguments);
@@ -1708,7 +1709,7 @@ irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
*/
void
irc_command_mode_server (struct t_irc_server *server, char *arguments)
irc_command_mode_server (struct t_irc_server *server, const char *arguments)
{
irc_server_sendf (server, "MODE %s", arguments);
}
@@ -1967,7 +1968,7 @@ irc_command_names (void *data, struct t_gui_buffer *buffer, int argc,
*/
void
irc_send_nick_server (struct t_irc_server *server, char *nickname)
irc_send_nick_server (struct t_irc_server *server, const char *nickname)
{
if (!server)
return;
@@ -2133,10 +2134,11 @@ irc_command_oper (void *data, struct t_gui_buffer *buffer, int argc,
*/
void
irc_command_part_channel (struct t_irc_server *server, char *channel_name,
char *part_message)
irc_command_part_channel (struct t_irc_server *server, const char *channel_name,
const char *part_message)
{
char *ptr_arg, *buf, *version;
const char *ptr_arg;
char *buf, *version;
ptr_arg = (part_message) ? part_message :
(weechat_config_string (irc_config_network_default_msg_part)
+6 -6
View File
@@ -30,16 +30,16 @@ struct t_irc_server;
extern void irc_command_away_server (struct t_irc_server *server,
char *arguments);
const char *arguments);
extern void irc_command_join_server (struct t_irc_server *server,
char *arguments);
const char *arguments);
extern void irc_command_mode_server (struct t_irc_server *server,
char *arguments);
const char *arguments);
extern void irc_command_part_channel (struct t_irc_server *server,
char *channel_name,
char *part_message);
const char *channel_name,
const char *part_message);
extern void irc_command_quit_server (struct t_irc_server *server,
char *arguments);
const char *arguments);
extern void irc_command_init ();
#endif /* irc-command.h */
+9 -9
View File
@@ -38,7 +38,7 @@
*/
int
irc_completion_server_cb (void *data, char *completion,
irc_completion_server_cb (void *data, const char *completion,
struct t_gui_buffer *buffer, struct t_weelist *list)
{
IRC_GET_SERVER(buffer);
@@ -59,7 +59,7 @@ irc_completion_server_cb (void *data, char *completion,
*/
int
irc_completion_server_nicks_cb (void *data, char *completion,
irc_completion_server_nicks_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -101,7 +101,7 @@ irc_completion_server_nicks_cb (void *data, char *completion,
*/
int
irc_completion_servers_cb (void *data, char *completion,
irc_completion_servers_cb (void *data, const char *completion,
struct t_gui_buffer *buffer, struct t_weelist *list)
{
struct t_irc_server *ptr_server;
@@ -125,7 +125,7 @@ irc_completion_servers_cb (void *data, char *completion,
*/
int
irc_completion_channel_cb (void *data, char *completion,
irc_completion_channel_cb (void *data, const char *completion,
struct t_gui_buffer *buffer, struct t_weelist *list)
{
IRC_GET_SERVER_CHANNEL(buffer);
@@ -146,7 +146,7 @@ irc_completion_channel_cb (void *data, char *completion,
*/
int
irc_completion_channel_nicks_cb (void *data, char *completion,
irc_completion_channel_nicks_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -206,7 +206,7 @@ irc_completion_channel_nicks_cb (void *data, char *completion,
*/
int
irc_completion_channel_nicks_hosts_cb (void *data, char *completion,
irc_completion_channel_nicks_hosts_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -259,7 +259,7 @@ irc_completion_channel_nicks_hosts_cb (void *data, char *completion,
*/
int
irc_completion_channel_topic_cb (void *data, char *completion,
irc_completion_channel_topic_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -289,7 +289,7 @@ irc_completion_channel_topic_cb (void *data, char *completion,
*/
int
irc_completion_channels_cb (void *data, char *completion,
irc_completion_channels_cb (void *data, const char *completion,
struct t_gui_buffer *buffer, struct t_weelist *list)
{
struct t_irc_server *ptr_server;
@@ -318,7 +318,7 @@ irc_completion_channels_cb (void *data, char *completion,
*/
int
irc_completion_msg_part_cb (void *data, char *completion,
irc_completion_msg_part_cb (void *data, const char *completion,
struct t_gui_buffer *buffer, struct t_weelist *list)
{
/* make C compiler happy */
+5 -5
View File
@@ -92,7 +92,7 @@ struct t_config_option *irc_config_server_default[IRC_CONFIG_NUM_SERVER_OPTIONS]
*/
int
irc_config_search_server_option (char *option_name)
irc_config_search_server_option (const char *option_name)
{
int i;
@@ -111,7 +111,7 @@ irc_config_search_server_option (char *option_name)
}
struct t_irc_server *
irc_config_get_server_from_option_name (char *name)
irc_config_get_server_from_option_name (const char *name)
{
struct t_irc_server *ptr_server;
char *pos_option, *server_name;
@@ -492,7 +492,7 @@ irc_config_reload (void *data, struct t_config_file *config_file)
void
irc_config_server_write_default (void *data, struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
/* make C compiler happy */
(void) data;
@@ -511,7 +511,7 @@ struct t_config_option *
irc_config_server_new_option (struct t_config_file *config_file,
struct t_config_section *section,
int index_option,
char *option_name, char *value,
const char *option_name, const char *value,
void *callback_change,
void *callback_change_data,
void *callback_delete,
@@ -688,7 +688,7 @@ irc_config_server_new_option (struct t_config_file *config_file,
int
irc_config_server_create_option (void *data, struct t_config_file *config_file,
struct t_config_section *section,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_config_option *ptr_option;
struct t_irc_server *ptr_server;
+5 -5
View File
@@ -54,7 +54,7 @@ irc_debug_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
void
irc_debug_printf (struct t_irc_server *server, int send, int modified,
char *message)
const char *message)
{
char *buf;
@@ -100,8 +100,8 @@ irc_debug_printf (struct t_irc_server *server, int send, int modified,
*/
int
irc_debug_signal_debug_cb (void *data, char *signal, char *type_data,
void *signal_data)
irc_debug_signal_debug_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -127,8 +127,8 @@ irc_debug_signal_debug_cb (void *data, char *signal, char *type_data,
*/
int
irc_debug_signal_debug_dump_cb (void *data, char *signal, char *type_data,
void *signal_data)
irc_debug_signal_debug_dump_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
+1 -1
View File
@@ -28,7 +28,7 @@
struct t_irc_server;
extern void irc_debug_printf (struct t_irc_server *server, int send,
int modified, char *message);
int modified, const char *message);
extern void irc_debug_init ();
#endif /* irc-debug.h */
+4 -3
View File
@@ -90,7 +90,7 @@ irc_display_hide_password (char *string, int look_for_nickserv)
*/
void
irc_display_away (struct t_irc_server *server, char *string1, char *string2)
irc_display_away (struct t_irc_server *server, const char *string1, const char *string2)
{
struct t_irc_channel *ptr_channel;
@@ -118,8 +118,9 @@ irc_display_away (struct t_irc_server *server, char *string1, char *string2)
void
irc_display_mode (struct t_gui_buffer *buffer,
char *channel_name, char *nick_name, char set_flag,
char *symbol, char *nick_host, char *message, char *param)
const char *channel_name, const char *nick_name,
char set_flag, const char *symbol, const char *nick_host,
const char *message, const char *param)
{
weechat_printf (buffer,
"%s[%s%s%s/%s%c%s%s] %s%s %s%s%s%s%s",
+10 -8
View File
@@ -22,14 +22,16 @@
extern void irc_display_hide_password (char *string, int look_for_nickserv);
extern void irc_display_nick (struct t_gui_buffer *buffer,
struct t_irc_nick *nick, char *nickname,
int type, int display_around, char *force_color,
int no_nickmode);
extern void irc_display_away (struct t_irc_server *server, char *string1,
char *string2);
extern void irc_display_mode (struct t_gui_buffer *buffer, char *channel_name,
char *nick_name, char set_flag, char *symbol,
char *nick_host, char *message, char *param);
struct t_irc_nick *nick, const char *nickname,
int type, int display_around,
const char *force_color, int no_nickmode);
extern void irc_display_away (struct t_irc_server *server, const char *string1,
const char *string2);
extern void irc_display_mode (struct t_gui_buffer *buffer,
const char *channel_name, const char *nick_name,
char set_flag, const char *symbol,
const char *nick_host, const char *message,
const char *param);
extern void irc_display_server (struct t_irc_server *server, int with_detail);
#endif /* irc-display.h */
+14 -7
View File
@@ -36,7 +36,7 @@
*/
void
irc_input_user_message_display (struct t_gui_buffer *buffer, char *text)
irc_input_user_message_display (struct t_gui_buffer *buffer, const char *text)
{
struct t_irc_nick *ptr_nick;
char *text_decoded;
@@ -84,13 +84,15 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, char *text)
/*
* irc_input_send_user_message: send a PRIVMSG message, and split it
* if > 512 bytes
* warning: this function makes temporarirly
* changes in "text"
*/
void
irc_input_send_user_message (struct t_gui_buffer *buffer, char *text)
{
int max_length;
char *pos, *pos_next, *pos_max, *next, saved_char, *last_space;
char *pos, *pos_max, *last_space, *pos_next, *next, saved_char;
IRC_GET_SERVER_CHANNEL(buffer);
@@ -151,9 +153,10 @@ irc_input_send_user_message (struct t_gui_buffer *buffer, char *text)
*/
int
irc_input_data_cb (void *data, struct t_gui_buffer *buffer, char *input_data)
irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
const char *input_data)
{
char *data_with_colors;
char *data_with_colors, *msg;
/* make C compiler happy */
(void) data;
@@ -164,9 +167,13 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer, char *input_data)
{
data_with_colors = irc_color_encode (input_data,
weechat_config_boolean (irc_config_network_colors_send));
irc_input_send_user_message (buffer,
(data_with_colors) ? data_with_colors : input_data);
msg = strdup ((data_with_colors) ? data_with_colors : input_data);
if (msg)
{
irc_input_send_user_message (buffer, msg);
free (msg);
}
if (data_with_colors)
free (data_with_colors);
+1 -1
View File
@@ -21,6 +21,6 @@
#define __WEECHAT_IRC_INPUT_H 1
extern int irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
char *input_data);
const char *input_data);
#endif /* irc-input.h */
+5 -5
View File
@@ -35,7 +35,7 @@
*/
void
irc_mode_channel_set_nick (struct t_irc_channel *channel, char *nick,
irc_mode_channel_set_nick (struct t_irc_channel *channel, const char *nick,
char set_flag, int flag)
{
struct t_irc_nick *ptr_nick;
@@ -53,13 +53,13 @@ irc_mode_channel_set_nick (struct t_irc_channel *channel, char *nick,
*/
char
irc_mode_channel_get_flag (char *str, char *pos)
irc_mode_channel_get_flag (const char *string, const char *pos)
{
char set_flag;
set_flag = '+';
pos--;
while (pos >= str)
while (pos >= string)
{
if (pos[0] == '-')
return '-';
@@ -76,7 +76,7 @@ irc_mode_channel_get_flag (char *str, char *pos)
void
irc_mode_channel_set (struct t_irc_server *server,
struct t_irc_channel *channel, char *modes)
struct t_irc_channel *channel, const char *modes)
{
char *pos_args, *str_modes, set_flag, **argv, *pos, *ptr_arg;
int argc, current_arg;
@@ -269,7 +269,7 @@ irc_mode_user_remove (struct t_irc_server *server, char mode)
*/
void
irc_mode_user_set (struct t_irc_server *server, char *modes)
irc_mode_user_set (struct t_irc_server *server, const char *modes)
{
char set_flag;
+3 -2
View File
@@ -24,8 +24,9 @@ struct t_irc_server;
struct t_irc_channel;
extern void irc_mode_channel_set (struct t_irc_server *server,
struct t_irc_channel *channel, char *modes);
extern void irc_mode_user_set (struct t_irc_server *server, char *modes);
struct t_irc_channel *channel,
const char *modes);
extern void irc_mode_user_set (struct t_irc_server *server, const char *modes);
extern int irc_mode_nick_prefix_allowed (struct t_irc_server *server,
char prefix);
+5 -4
View File
@@ -155,7 +155,7 @@ irc_nick_get_gui_infos (struct t_irc_nick *nick,
struct t_irc_nick *
irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel,
char *nick_name, int is_chanowner, int is_chanadmin,
const char *nick_name, int is_chanowner, int is_chanadmin,
int is_chanadmin2, int is_op, int is_halfop, int has_voice,
int is_chanuser)
{
@@ -251,7 +251,7 @@ irc_nick_new (struct t_irc_server *server, struct t_irc_channel *channel,
void
irc_nick_change (struct t_irc_server *server, struct t_irc_channel *channel,
struct t_irc_nick *nick, char *new_nick)
struct t_irc_nick *nick, const char *new_nick)
{
int nick_is_me, prefix_color;
struct t_gui_nick_group *ptr_group;
@@ -402,7 +402,7 @@ irc_nick_free_all (struct t_irc_channel *channel)
*/
struct t_irc_nick *
irc_nick_search (struct t_irc_channel *channel, char *nickname)
irc_nick_search (struct t_irc_channel *channel, const char *nickname)
{
struct t_irc_nick *ptr_nick;
@@ -500,7 +500,8 @@ irc_nick_set_away (struct t_irc_channel *channel, struct t_irc_nick *nick,
*/
char *
irc_nick_as_prefix (struct t_irc_nick *nick, char *nickname, char *force_color)
irc_nick_as_prefix (struct t_irc_nick *nick, const char *nickname,
const char *force_color)
{
static char result[256];
char prefix[2], str_prefix_color[64];
+5 -5
View File
@@ -58,27 +58,27 @@ struct t_irc_nick
extern struct t_irc_nick *irc_nick_new (struct t_irc_server *server,
struct t_irc_channel *channel,
char *nick_name, int is_chanowner,
const char *nick_name, int is_chanowner,
int is_chanadmin, int is_chanadmin2,
int is_op, int is_halfop,
int has_voice, int is_chanuser);
extern void irc_nick_change (struct t_irc_server *server,
struct t_irc_channel *channel,
struct t_irc_nick *nick, char *new_nick);
struct t_irc_nick *nick, const char *new_nick);
extern void irc_nick_set (struct t_irc_channel *channel,
struct t_irc_nick *nick, int set, int flag);
extern void irc_nick_free (struct t_irc_channel *channel,
struct t_irc_nick *nick);
extern void irc_nick_free_all (struct t_irc_channel *channel);
extern struct t_irc_nick *irc_nick_search (struct t_irc_channel *channel,
char *nickname);
const char *nickname);
extern void irc_nick_count (struct t_irc_channel *channel, int *total,
int *count_op, int *count_halfop, int *count_voice,
int *count_normal);
extern void irc_nick_set_away (struct t_irc_channel *channel,
struct t_irc_nick *nick, int is_away);
extern char *irc_nick_as_prefix (struct t_irc_nick *nick, char *nickname,
char *force_color);
extern char *irc_nick_as_prefix (struct t_irc_nick *nick, const char *nickname,
const char *force_color);
extern void irc_nick_print_log (struct t_irc_nick *nick);
#endif /* irc-nick.h */
+67 -65
View File
@@ -48,7 +48,7 @@
*/
char *
irc_protocol_get_nick_from_host (char *host)
irc_protocol_get_nick_from_host (const char *host)
{
static char nick[128];
char *pos;
@@ -75,7 +75,7 @@ irc_protocol_get_nick_from_host (char *host)
*/
char *
irc_protocol_get_address_from_host (char *host)
irc_protocol_get_address_from_host (const char *host)
{
static char address[256];
char *pos;
@@ -99,7 +99,7 @@ irc_protocol_get_address_from_host (char *host)
*/
char *
irc_protocol_tags (char *command, char *tags)
irc_protocol_tags (const char *command, const char *tags)
{
static char string[256];
@@ -132,7 +132,7 @@ irc_protocol_tags (char *command, char *tags)
char *
irc_protocol_replace_vars (struct t_irc_server *server,
struct t_irc_channel *channel, char *string)
struct t_irc_channel *channel, const char *string)
{
char *var_nick, *var_channel, *var_server;
char empty_string[1] = { '\0' };
@@ -171,7 +171,7 @@ irc_protocol_replace_vars (struct t_irc_server *server,
*/
int
irc_protocol_cmd_error (struct t_irc_server *server, char *command,
irc_protocol_cmd_error (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
int first_arg;
@@ -216,7 +216,7 @@ irc_protocol_cmd_error (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_invite (struct t_irc_server *server, char *command,
irc_protocol_cmd_invite (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* INVITE message looks like:
@@ -251,7 +251,7 @@ irc_protocol_cmd_invite (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_join (struct t_irc_server *server, char *command,
irc_protocol_cmd_join (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -325,7 +325,7 @@ irc_protocol_cmd_join (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_kick (struct t_irc_server *server, char *command,
irc_protocol_cmd_kick (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_comment;
@@ -414,7 +414,7 @@ irc_protocol_cmd_kick (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_kill (struct t_irc_server *server, char *command,
irc_protocol_cmd_kill (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_comment;
@@ -481,7 +481,7 @@ irc_protocol_cmd_kill (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_mode (struct t_irc_server *server, char *command,
irc_protocol_cmd_mode (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_modes;
@@ -543,7 +543,7 @@ irc_protocol_cmd_mode (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_nick (struct t_irc_server *server, char *command,
irc_protocol_cmd_nick (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -632,7 +632,7 @@ irc_protocol_cmd_nick (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_notice (struct t_irc_server *server, char *command,
irc_protocol_cmd_notice (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *nick, *host, *pos_args, *pos_end, *pos_usec;
@@ -820,7 +820,7 @@ irc_protocol_cmd_notice (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_part (struct t_irc_server *server, char *command,
irc_protocol_cmd_part (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *nick, *host, *pos_comment, *join_string;
@@ -929,7 +929,7 @@ irc_protocol_cmd_part (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_ping (struct t_irc_server *server, char *command,
irc_protocol_cmd_ping (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* PING message looks like:
@@ -952,7 +952,7 @@ irc_protocol_cmd_ping (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_pong (struct t_irc_server *server, char *command,
irc_protocol_cmd_pong (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct timeval tv;
@@ -990,8 +990,8 @@ irc_protocol_cmd_pong (struct t_irc_server *server, char *command,
void
irc_protocol_reply_version (struct t_irc_server *server,
struct t_irc_channel *channel, char *nick,
char *message, char *str_version)
struct t_irc_channel *channel, const char *nick,
const char *message, const char *str_version)
{
char *pos, *version, *date;
struct t_gui_buffer *ptr_buffer;
@@ -1043,7 +1043,7 @@ irc_protocol_reply_version (struct t_irc_server *server,
}
weechat_hook_signal_send ("irc_ctcp",
WEECHAT_HOOK_SIGNAL_STRING,
message);
(void *)message);
}
/*
@@ -1051,7 +1051,7 @@ irc_protocol_reply_version (struct t_irc_server *server,
*/
int
irc_protocol_cmd_privmsg (struct t_irc_server *server, char *command,
irc_protocol_cmd_privmsg (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *nick, *host, *pos_args, *pos_end_01, *pos, *pos_message;
@@ -1911,7 +1911,7 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_quit (struct t_irc_server *server, char *command,
irc_protocol_cmd_quit (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *nick, *host, *pos_comment;
@@ -1988,7 +1988,7 @@ irc_protocol_cmd_quit (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_server_mode_reason (struct t_irc_server *server, char *command,
irc_protocol_cmd_server_mode_reason (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_mode, *pos_args;
@@ -2022,7 +2022,7 @@ irc_protocol_cmd_server_mode_reason (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_numeric (struct t_irc_server *server, char *command,
irc_protocol_cmd_numeric (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_args;
@@ -2056,7 +2056,7 @@ irc_protocol_cmd_numeric (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_topic (struct t_irc_server *server, char *command,
irc_protocol_cmd_topic (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_topic, *topic_color;
@@ -2135,7 +2135,7 @@ irc_protocol_cmd_topic (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_wallops (struct t_irc_server *server, char *command,
irc_protocol_cmd_wallops (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* WALLOPS message looks like:
@@ -2165,7 +2165,7 @@ irc_protocol_cmd_wallops (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_001 (struct t_irc_server *server, char *command,
irc_protocol_cmd_001 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char **commands, **ptr_cmd, *vars_replaced;
@@ -2233,7 +2233,7 @@ irc_protocol_cmd_001 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_005 (struct t_irc_server *server, char *command,
irc_protocol_cmd_005 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos, *pos2;
@@ -2278,7 +2278,7 @@ irc_protocol_cmd_005 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_221 (struct t_irc_server *server, char *command,
irc_protocol_cmd_221 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 221 message looks like:
@@ -2309,7 +2309,7 @@ irc_protocol_cmd_221 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_301 (struct t_irc_server *server, char *command,
irc_protocol_cmd_301 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_away_msg;
@@ -2361,7 +2361,7 @@ irc_protocol_cmd_301 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_303 (struct t_irc_server *server, char *command,
irc_protocol_cmd_303 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 301 message looks like:
@@ -2388,7 +2388,7 @@ irc_protocol_cmd_303 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_305 (struct t_irc_server *server, char *command,
irc_protocol_cmd_305 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 305 message looks like:
@@ -2430,7 +2430,7 @@ irc_protocol_cmd_305 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_306 (struct t_irc_server *server, char *command,
irc_protocol_cmd_306 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 306 message looks like:
@@ -2478,7 +2478,7 @@ irc_protocol_cmd_306 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_whois_nick_msg (struct t_irc_server *server, char *command,
irc_protocol_cmd_whois_nick_msg (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* messages look like:
@@ -2506,7 +2506,7 @@ irc_protocol_cmd_whois_nick_msg (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_311 (struct t_irc_server *server, char *command,
irc_protocol_cmd_311 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 311 message looks like:
@@ -2538,7 +2538,7 @@ irc_protocol_cmd_311 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_312 (struct t_irc_server *server, char *command,
irc_protocol_cmd_312 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 312 message looks like:
@@ -2570,7 +2570,7 @@ irc_protocol_cmd_312 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_314 (struct t_irc_server *server, char *command,
irc_protocol_cmd_314 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 314 message looks like:
@@ -2601,7 +2601,7 @@ irc_protocol_cmd_314 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_315 (struct t_irc_server *server, char *command,
irc_protocol_cmd_315 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 315 message looks like:
@@ -2639,7 +2639,7 @@ irc_protocol_cmd_315 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_317 (struct t_irc_server *server, char *command,
irc_protocol_cmd_317 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
int idle_time, day, hour, min, sec;
@@ -2731,7 +2731,7 @@ irc_protocol_cmd_317 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_321 (struct t_irc_server *server, char *command,
irc_protocol_cmd_321 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_args;
@@ -2761,7 +2761,7 @@ irc_protocol_cmd_321 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_322 (struct t_irc_server *server, char *command,
irc_protocol_cmd_322 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_topic;
@@ -2801,7 +2801,7 @@ irc_protocol_cmd_322 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_323 (struct t_irc_server *server, char *command,
irc_protocol_cmd_323 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_args;
@@ -2832,7 +2832,7 @@ irc_protocol_cmd_323 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_324 (struct t_irc_server *server, char *command,
irc_protocol_cmd_324 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -2875,7 +2875,7 @@ irc_protocol_cmd_324 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_327 (struct t_irc_server *server, char *command,
irc_protocol_cmd_327 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_realname;
@@ -2930,7 +2930,7 @@ irc_protocol_cmd_327 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_329 (struct t_irc_server *server, char *command,
irc_protocol_cmd_329 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -2979,7 +2979,7 @@ irc_protocol_cmd_329 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_331 (struct t_irc_server *server, char *command,
irc_protocol_cmd_331 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -3010,7 +3010,7 @@ irc_protocol_cmd_331 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_332 (struct t_irc_server *server, char *command,
irc_protocol_cmd_332 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_topic;
@@ -3053,7 +3053,7 @@ irc_protocol_cmd_332 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_333 (struct t_irc_server *server, char *command,
irc_protocol_cmd_333 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -3102,7 +3102,7 @@ irc_protocol_cmd_333 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_338 (struct t_irc_server *server, char *command,
irc_protocol_cmd_338 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 338 message looks like:
@@ -3132,7 +3132,7 @@ irc_protocol_cmd_338 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_341 (struct t_irc_server *server, char *command,
irc_protocol_cmd_341 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 341 message looks like:
@@ -3165,7 +3165,7 @@ irc_protocol_cmd_341 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_344 (struct t_irc_server *server, char *command,
irc_protocol_cmd_344 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 344 message looks like:
@@ -3192,7 +3192,7 @@ irc_protocol_cmd_344 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_345 (struct t_irc_server *server, char *command,
irc_protocol_cmd_345 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 345 message looks like:
@@ -3218,7 +3218,7 @@ irc_protocol_cmd_345 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_348 (struct t_irc_server *server, char *command,
irc_protocol_cmd_348 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -3285,7 +3285,7 @@ irc_protocol_cmd_348 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_349 (struct t_irc_server *server, char *command,
irc_protocol_cmd_349 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_args;
@@ -3322,7 +3322,7 @@ irc_protocol_cmd_349 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_351 (struct t_irc_server *server, char *command,
irc_protocol_cmd_351 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 351 message looks like:
@@ -3359,7 +3359,7 @@ irc_protocol_cmd_351 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_352 (struct t_irc_server *server, char *command,
irc_protocol_cmd_352 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_attr, *pos_hopcount, *pos_realname;
@@ -3441,7 +3441,7 @@ irc_protocol_cmd_352 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_353 (struct t_irc_server *server, char *command,
irc_protocol_cmd_353 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_channel, *pos_nick, *color;
@@ -3568,7 +3568,7 @@ irc_protocol_cmd_353 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_366 (struct t_irc_server *server, char *command,
irc_protocol_cmd_366 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -3699,7 +3699,7 @@ irc_protocol_cmd_366 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_367 (struct t_irc_server *server, char *command,
irc_protocol_cmd_367 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
struct t_irc_channel *ptr_channel;
@@ -3771,7 +3771,7 @@ irc_protocol_cmd_367 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_368 (struct t_irc_server *server, char *command,
irc_protocol_cmd_368 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
char *pos_args;
@@ -3808,7 +3808,7 @@ irc_protocol_cmd_368 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_432 (struct t_irc_server *server, char *command,
irc_protocol_cmd_432 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
int i, nick_found, nick_to_use;
@@ -3864,7 +3864,7 @@ irc_protocol_cmd_432 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_433 (struct t_irc_server *server, char *command,
irc_protocol_cmd_433 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
int i, nick_found, nick_to_use;
@@ -3922,7 +3922,7 @@ irc_protocol_cmd_433 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_cmd_438 (struct t_irc_server *server, char *command,
irc_protocol_cmd_438 (struct t_irc_server *server, const char *command,
int argc, char **argv, char **argv_eol)
{
/* 438 message looks like:
@@ -3959,7 +3959,7 @@ irc_protocol_cmd_438 (struct t_irc_server *server, char *command,
*/
int
irc_protocol_is_numeric_command (char *str)
irc_protocol_is_numeric_command (const char *str)
{
while (str && str[0])
{
@@ -3979,14 +3979,16 @@ irc_protocol_is_numeric_command (char *str)
*/
void
irc_protocol_recv_command (struct t_irc_server *server, char *entire_line,
char *host, char *command, char *arguments)
irc_protocol_recv_command (struct t_irc_server *server, const char *entire_line,
const char *host, const char *command,
const char *arguments)
{
int i, cmd_found, return_code, argc, decode_color;
char *pos, *nick;
char *dup_entire_line, *dup_host, *dup_arguments, *irc_message;
t_irc_recv_func *cmd_recv_func;
char *cmd_name, **argv, **argv_eol;
const char *cmd_name;
char **argv, **argv_eol;
struct t_irc_protocol_msg irc_protocol_messages[] =
{ { "error", N_("error received from IRC server"), 1, &irc_protocol_cmd_error },
{ "invite", N_("invite a nick on a channel"), 1, &irc_protocol_cmd_invite },
+4 -3
View File
@@ -44,7 +44,7 @@
struct t_irc_server;
typedef int (t_irc_recv_func)(struct t_irc_server *server, char *comand,
typedef int (t_irc_recv_func)(struct t_irc_server *server, const char *comand,
int argc, char **argv, char **argv_eol);
struct t_irc_protocol_msg
@@ -56,7 +56,8 @@ struct t_irc_protocol_msg
};
extern void irc_protocol_recv_command (struct t_irc_server *server,
char *entire_line, char *host,
char *command, char *arguments);
const char *entire_line,
const char *host, const char *command,
const char *arguments);
#endif /* irc-protocol.h */
+54 -42
View File
@@ -53,7 +53,7 @@ struct t_irc_message *irc_msgq_last_msg = NULL;
*/
void
irc_server_set_addresses (struct t_irc_server *server, char *addresses)
irc_server_set_addresses (struct t_irc_server *server, const char *addresses)
{
int i;
char *pos, *error;
@@ -113,7 +113,7 @@ irc_server_set_addresses (struct t_irc_server *server, char *addresses)
*/
void
irc_server_set_nicks (struct t_irc_server *server, char *nicks)
irc_server_set_nicks (struct t_irc_server *server, const char *nicks)
{
/* free data */
if (server->nicks)
@@ -224,7 +224,7 @@ irc_server_set_with_option (struct t_irc_server *server,
*/
void
irc_server_set_nick (struct t_irc_server *server, char *nick)
irc_server_set_nick (struct t_irc_server *server, const char *nick)
{
struct t_irc_channel *ptr_channel;
@@ -323,7 +323,7 @@ irc_server_init (struct t_irc_server *server)
*/
struct t_irc_server *
irc_server_alloc (char *name)
irc_server_alloc (const char *name)
{
struct t_irc_server *new_server;
@@ -363,41 +363,51 @@ irc_server_alloc (char *name)
*/
int
irc_server_alloc_with_url (char *irc_url)
irc_server_alloc_with_url (const char *irc_url)
{
char *url, *pos_server, *pos_channel, *pos, *pos2;
char *irc_url2, *url, *pos_server, *pos_channel, *pos, *pos2;
char *password, *nick1, *nicks, *autojoin;
int ipv6, ssl, length;
struct t_irc_server *ptr_server;
irc_url2 = strdup (irc_url);
if (!irc_url2)
return 0;
ipv6 = 0;
ssl = 0;
password = NULL;
nick1 = NULL;
autojoin = NULL;
if (weechat_strncasecmp (irc_url, "irc6://", 7) == 0)
if (weechat_strncasecmp (irc_url2, "irc6://", 7) == 0)
{
pos = irc_url + 7;
pos = irc_url2 + 7;
ipv6 = 1;
}
else if (weechat_strncasecmp (irc_url, "ircs://", 7) == 0)
else if (weechat_strncasecmp (irc_url2, "ircs://", 7) == 0)
{
pos = irc_url + 7;
pos = irc_url2 + 7;
ssl = 1;
}
else if ((weechat_strncasecmp (irc_url, "irc6s://", 8) == 0)
|| (weechat_strncasecmp (irc_url, "ircs6://", 8) == 0))
else if ((weechat_strncasecmp (irc_url2, "irc6s://", 8) == 0)
|| (weechat_strncasecmp (irc_url2, "ircs6://", 8) == 0))
{
pos = irc_url + 8;
pos = irc_url2 + 8;
ipv6 = 1;
ssl = 1;
}
else if (weechat_strncasecmp (irc_url, "irc://", 6) == 0)
else if (weechat_strncasecmp (irc_url2, "irc://", 6) == 0)
{
pos = irc_url + 6;
pos = irc_url2 + 6;
}
else
{
free (irc_url2);
return 0;
}
free (irc_url2);
url = strdup (pos);
pos_server = strchr (url, '@');
@@ -487,8 +497,8 @@ irc_server_alloc_with_url (char *irc_url)
*/
void
irc_server_outqueue_add (struct t_irc_server *server, char *msg1, char *msg2,
int modified)
irc_server_outqueue_add (struct t_irc_server *server, const char *msg1,
const char *msg2, int modified)
{
struct t_irc_outqueue *new_outqueue;
@@ -657,12 +667,12 @@ irc_server_free_all ()
*/
struct t_irc_server *
irc_server_new (char *name, int autoconnect, int autoreconnect,
int autoreconnect_delay, int temp_server, char *addresses,
int ipv6, int ssl, char *password, char *nicks,
char *username, char *realname, char *local_hostname,
char *command, int command_delay, char *autojoin,
int autorejoin, char *notify_levels)
irc_server_new (const char *name, int autoconnect, int autoreconnect,
int autoreconnect_delay, int temp_server, const char *addresses,
int ipv6, int ssl, const char *password, const char *nicks,
const char *username, const char *realname, const char *local_hostname,
const char *command, int command_delay, const char *autojoin,
int autorejoin, const char *notify_levels)
{
struct t_irc_server *new_server;
@@ -725,7 +735,7 @@ irc_server_new (char *name, int autoconnect, int autoreconnect,
*/
struct t_irc_server *
irc_server_duplicate (struct t_irc_server *server, char *new_name)
irc_server_duplicate (struct t_irc_server *server, const char *new_name)
{
struct t_irc_server *new_server;
@@ -762,7 +772,7 @@ irc_server_duplicate (struct t_irc_server *server, char *new_name)
*/
int
irc_server_rename (struct t_irc_server *server, char *new_name)
irc_server_rename (struct t_irc_server *server, const char *new_name)
{
int length;
char *option_name, *name, *pos_option;
@@ -820,7 +830,7 @@ irc_server_rename (struct t_irc_server *server, char *new_name)
*/
int
irc_server_send (struct t_irc_server *server, char *buffer, int size_buf)
irc_server_send (struct t_irc_server *server, const char *buffer, int size_buf)
{
int rc;
@@ -912,10 +922,10 @@ irc_server_outqueue_send (struct t_irc_server *server)
*/
void
irc_server_parse_message (char *message, char **nick, char **host,
irc_server_parse_message (const char *message, char **nick, char **host,
char **command, char **channel, char **arguments)
{
char *pos, *pos2, *pos3, *pos4;
const char *pos, *pos2, *pos3, *pos4;
if (nick)
*nick = NULL;
@@ -1029,10 +1039,11 @@ irc_server_parse_message (char *message, char **nick, char **host,
*/
int
irc_server_send_one_msg (struct t_irc_server *server, char *message)
irc_server_send_one_msg (struct t_irc_server *server, const char *message)
{
static char buffer[4096];
char *new_msg, *ptr_msg, *pos, *nick, *command, *channel;
const char *ptr_msg;
char *new_msg, *pos, *nick, *command, *channel;
char *ptr_chan_nick, *msg_encoded;
char str_modifier[64], modifier_data[256];
int rc, queue, first_message;
@@ -1160,7 +1171,7 @@ irc_server_send_one_msg (struct t_irc_server *server, char *message)
*/
void
irc_server_sendf (struct t_irc_server *server, char *format, ...)
irc_server_sendf (struct t_irc_server *server, const char *format, ...)
{
va_list args;
static char buffer[4096];
@@ -1189,7 +1200,7 @@ irc_server_sendf (struct t_irc_server *server, char *format, ...)
*/
void
irc_server_msgq_add_msg (struct t_irc_server *server, char *msg)
irc_server_msgq_add_msg (struct t_irc_server *server, const char *msg)
{
struct t_irc_message *message;
@@ -1246,7 +1257,7 @@ irc_server_msgq_add_msg (struct t_irc_server *server, char *msg)
*/
void
irc_server_msgq_add_unterminated (struct t_irc_server *server, char *string)
irc_server_msgq_add_unterminated (struct t_irc_server *server, const char *string)
{
if (!string[0])
return;
@@ -1285,7 +1296,7 @@ irc_server_msgq_add_unterminated (struct t_irc_server *server, char *string)
*/
void
irc_server_msgq_add_buffer (struct t_irc_server *server, char *buffer)
irc_server_msgq_add_buffer (struct t_irc_server *server, const char *buffer)
{
char *pos_cr, *pos_lf;
@@ -2135,7 +2146,7 @@ irc_server_autojoin_channels (struct t_irc_server *server)
*/
struct t_irc_server *
irc_server_search (char *server_name)
irc_server_search (const char *server_name)
{
struct t_irc_server *ptr_server;
@@ -2286,7 +2297,7 @@ irc_server_check_away ()
*/
void
irc_server_set_away (struct t_irc_server *server, char *nick, int is_away)
irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away)
{
struct t_irc_channel *ptr_channel;
@@ -2364,8 +2375,8 @@ irc_server_set_default_notify_level (struct t_irc_server *server, int notify)
*/
int
irc_server_xfer_send_ready_cb (void *data, char *signal, char *type_data,
void *signal_data)
irc_server_xfer_send_ready_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
struct t_plugin_infolist *infolist;
struct t_irc_server *server, *ptr_server;
@@ -2437,8 +2448,8 @@ irc_server_xfer_send_ready_cb (void *data, char *signal, char *type_data,
*/
int
irc_server_xfer_resume_ready_cb (void *data, char *signal, char *type_data,
void *signal_data)
irc_server_xfer_resume_ready_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
struct t_plugin_infolist *infolist;
struct t_irc_server *server, *ptr_server;
@@ -2493,8 +2504,9 @@ irc_server_xfer_resume_ready_cb (void *data, char *signal, char *type_data,
*/
int
irc_server_xfer_send_accept_resume_cb (void *data, char *signal,
char *type_data, void *signal_data)
irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
const char *type_data,
void *signal_data)
{
struct t_plugin_infolist *infolist;
struct t_irc_server *server, *ptr_server;
+23 -23
View File
@@ -137,41 +137,41 @@ extern struct t_irc_message *irc_recv_msgq, *irc_msgq_last_msg;
extern void irc_server_set_addresses (struct t_irc_server *server,
char *addresses);
extern void irc_server_set_nicks (struct t_irc_server *server, char *nicks);
const char *addresses);
extern void irc_server_set_nicks (struct t_irc_server *server, const char *nicks);
extern void irc_server_set_with_option (struct t_irc_server *server,
int index_option,
struct t_config_option *option);
extern void irc_server_init (struct t_irc_server *server);
extern struct t_irc_server *irc_server_alloc (char *name);
extern int irc_server_alloc_with_url (char *irc_url);
extern struct t_irc_server *irc_server_new (char *name, int autoconnect,
extern struct t_irc_server *irc_server_alloc (const char *name);
extern int irc_server_alloc_with_url (const char *irc_url);
extern struct t_irc_server *irc_server_new (const char *name, int autoconnect,
int autoreconnect,
int autoreconnect_delay,
int temp_server, char *addresses,
int temp_server, const char *addresses,
int ipv6, int ssl,
char *password, char *nicks,
char *username, char *realname,
char *hostname, char *command,
int command_delay, char *autojoin,
const char *password, const char *nicks,
const char *username, const char *realname,
const char *hostname, const char *command,
int command_delay, const char *autojoin,
int autorejoin,
char *notify_levels);
const char *notify_levels);
extern struct t_irc_server *irc_server_duplicate (struct t_irc_server *server,
char *new_name);
extern int irc_server_rename (struct t_irc_server *server, char *new_name);
extern void irc_server_set_nick (struct t_irc_server *server, char *nick);
extern struct t_irc_server *irc_server_search (char *server_name);
const char *new_name);
extern int irc_server_rename (struct t_irc_server *server, const char *new_name);
extern void irc_server_set_nick (struct t_irc_server *server, const char *nick);
extern struct t_irc_server *irc_server_search (const char *server_name);
extern void irc_server_free_all ();
extern int irc_server_connect (struct t_irc_server *server,
int disable_autojoin);
extern void irc_server_auto_connect (int auto_connect, int temp_server);
extern void irc_server_autojoin_channels ();
extern int irc_server_timer_cb (void *data);
extern void irc_server_sendf (struct t_irc_server *server, char *format, ...);
extern void irc_server_sendf (struct t_irc_server *server, const char *format, ...);
extern void irc_server_outqueue_free_all (struct t_irc_server *server);
extern int irc_server_get_channel_count (struct t_irc_server *server);
extern int irc_server_get_pv_count (struct t_irc_server *server);
extern void irc_server_set_away (struct t_irc_server *server, char *nick,
extern void irc_server_set_away (struct t_irc_server *server, const char *nick,
int is_away);
extern void irc_server_remove_away ();
extern void irc_server_check_away ();
@@ -180,12 +180,12 @@ extern void irc_server_disconnect (struct t_irc_server *server, int reconnect);
extern void irc_server_disconnect_all ();
extern void irc_server_free (struct t_irc_server *server);
extern void irc_server_free_data (struct t_irc_server *server);
extern int irc_server_xfer_send_ready_cb (void *data, char *signal,
char *type_data, void *signal_data);
extern int irc_server_xfer_resume_ready_cb (void *data, char *signal,
char *type_data, void *signal_data);
extern int irc_server_xfer_send_accept_resume_cb (void *data, char *signal,
char *type_data,
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,
const char *type_data,
void *signal_data);
extern void irc_server_print_log ();
+1 -1
View File
@@ -51,7 +51,7 @@ struct t_hook *irc_hook_timer_check_away = NULL;
*/
int
irc_signal_quit_cb (void *data, char *signal, char *type_data,
irc_signal_quit_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_irc_server *ptr_server;
+1 -1
View File
@@ -39,7 +39,7 @@ struct t_logger_buffer *last_logger_buffer = NULL;
*/
struct t_logger_buffer *
logger_buffer_add (struct t_gui_buffer *buffer, char *log_filename)
logger_buffer_add (struct t_gui_buffer *buffer, const char *log_filename)
{
struct t_logger_buffer *new_logger_buffer;
+1 -1
View File
@@ -34,7 +34,7 @@ extern struct t_logger_buffer *logger_buffers;
extern struct t_logger_buffer *last_logger_buffer;
extern struct t_logger_buffer *logger_buffer_add (struct t_gui_buffer *,
char *log_filename);
const char *log_filename);
extern struct t_logger_buffer *logger_buffer_search (struct t_gui_buffer *buffer);
extern void logger_buffer_free (struct t_logger_buffer *logger_buffer);
extern void logger_buffer_free_all ();
+3 -3
View File
@@ -42,12 +42,12 @@
*/
char *
logger_tail_last_eol (char *string_start, char *string_ptr)
logger_tail_last_eol (const char *string_start, const char *string_ptr)
{
while (string_ptr >= string_start)
{
if ((string_ptr[0] == '\n') || (string_ptr[0] == '\r'))
return string_ptr;
return (char *)string_ptr;
string_ptr--;
}
@@ -60,7 +60,7 @@ logger_tail_last_eol (char *string_start, char *string_ptr)
*/
struct t_logger_line *
logger_tail_file (char *filename, int n_lines)
logger_tail_file (const char *filename, int n_lines)
{
int fd;
off_t file_length, file_pos;
+2 -1
View File
@@ -26,7 +26,8 @@ struct t_logger_line
struct t_logger_line *next_line; /* link to next line */
};
extern struct t_logger_line *logger_tail_file (char *filename, int n_lines);
extern struct t_logger_line *logger_tail_file (const char *filename,
int n_lines);
extern void logger_tail_free (struct t_logger_line *lines);
#endif /* logger-tail.h */
+13 -12
View File
@@ -280,7 +280,8 @@ logger_get_filename (struct t_gui_buffer *buffer)
*/
void
logger_write_line (struct t_logger_buffer *logger_buffer, char *format, ...)
logger_write_line (struct t_logger_buffer *logger_buffer,
const char *format, ...)
{
va_list argptr;
char *buf, *charset, *message;
@@ -460,8 +461,8 @@ logger_stop_all ()
*/
int
logger_buffer_open_signal_cb (void *data, char *signal, char *type_data,
void *signal_data)
logger_buffer_open_signal_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -478,8 +479,8 @@ logger_buffer_open_signal_cb (void *data, char *signal, char *type_data,
*/
int
logger_buffer_closing_signal_cb (void *data, char *signal, char *type_data,
void *signal_data)
logger_buffer_closing_signal_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -496,7 +497,7 @@ logger_buffer_closing_signal_cb (void *data, char *signal, char *type_data,
*/
void
logger_backlog (struct t_gui_buffer *buffer, char *filename, int lines)
logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
{
struct t_logger_line *last_lines, *ptr_lines;
char *pos_message, *error;
@@ -547,8 +548,8 @@ logger_backlog (struct t_gui_buffer *buffer, char *filename, int lines)
*/
int
logger_backlog_signal_cb (void *data, char *signal, char *type_data,
void *signal_data)
logger_backlog_signal_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
struct t_logger_buffer *ptr_logger_buffer;
@@ -581,7 +582,7 @@ logger_backlog_signal_cb (void *data, char *signal, char *type_data,
*/
int
logger_start_signal_cb (void *data, char *signal, char *type_data,
logger_start_signal_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
@@ -599,7 +600,7 @@ logger_start_signal_cb (void *data, char *signal, char *type_data,
*/
int
logger_stop_signal_cb (void *data, char *signal, char *type_data,
logger_stop_signal_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_logger_buffer *ptr_logger_buffer;
@@ -623,7 +624,7 @@ logger_stop_signal_cb (void *data, char *signal, char *type_data,
int
logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date,
int tags_count, char **tags,
char *prefix, char *message)
const char *prefix, const char *message)
{
struct t_logger_buffer *ptr_logger_buffer;
struct tm *date_tmp;
@@ -661,7 +662,7 @@ logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date,
*/
int
logger_config_cb (void *data, char *option, char *value)
logger_config_cb (void *data, const char *option, const char *value)
{
/* make C compiler happy */
(void) data;
+19 -19
View File
@@ -54,7 +54,7 @@
*/
void
plugin_api_charset_set (struct t_weechat_plugin *plugin, char *charset)
plugin_api_charset_set (struct t_weechat_plugin *plugin, const char *charset)
{
if (!plugin || !charset)
return;
@@ -70,7 +70,7 @@ plugin_api_charset_set (struct t_weechat_plugin *plugin, char *charset)
*/
char *
plugin_api_gettext (char *string)
plugin_api_gettext (const char *string)
{
return _(string);
}
@@ -80,7 +80,7 @@ plugin_api_gettext (char *string)
*/
char *
plugin_api_ngettext (char *single, char *plural, int count)
plugin_api_ngettext (const char *single, const char *plural, int count)
{
return NG_(single, plural, count);
}
@@ -91,7 +91,7 @@ plugin_api_ngettext (char *single, char *plural, int count)
*/
int
plugin_api_mkdir_home (char *directory, int mode)
plugin_api_mkdir_home (const char *directory, int mode)
{
char *dir_name;
int dir_length;
@@ -126,7 +126,7 @@ plugin_api_mkdir_home (char *directory, int mode)
*/
int
plugin_api_mkdir (char *directory, int mode)
plugin_api_mkdir (const char *directory, int mode)
{
if (!directory)
return 0;
@@ -145,7 +145,7 @@ plugin_api_mkdir (char *directory, int mode)
*/
struct t_config_option *
plugin_api_config_get (char *option_name)
plugin_api_config_get (const char *option_name)
{
struct t_config_option *ptr_option;
@@ -160,7 +160,7 @@ plugin_api_config_get (char *option_name)
char *
plugin_api_config_get_plugin (struct t_weechat_plugin *plugin,
char *option_name)
const char *option_name)
{
struct t_config_option *ptr_option;
@@ -181,7 +181,7 @@ plugin_api_config_get_plugin (struct t_weechat_plugin *plugin,
int
plugin_api_config_set_plugin (struct t_weechat_plugin *plugin,
char *option_name, char *value)
const char *option_name, const char *value)
{
if (!plugin || !option_name)
return 0;
@@ -197,7 +197,7 @@ plugin_api_config_set_plugin (struct t_weechat_plugin *plugin,
*/
char *
plugin_api_prefix (char *prefix)
plugin_api_prefix (const char *prefix)
{
if (!prefix)
return gui_chat_prefix_empty;
@@ -221,7 +221,7 @@ plugin_api_prefix (char *prefix)
*/
char *
plugin_api_color (char *color_name)
plugin_api_color (const char *color_name)
{
int num_color, fg, bg;
static char color[20][16];
@@ -328,7 +328,7 @@ plugin_api_color (char *color_name)
void
plugin_api_infobar_printf (struct t_weechat_plugin *plugin, int delay,
char *color_name, char *format, ...)
const char *color_name, const char *format, ...)
{
va_list argptr;
static char buf[1024];
@@ -385,7 +385,7 @@ plugin_api_infobar_remove (int how_many)
void
plugin_api_command (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer, char *command)
struct t_gui_buffer *buffer, const char *command)
{
char *command2;
@@ -405,7 +405,7 @@ plugin_api_command (struct t_weechat_plugin *plugin,
*/
char *
plugin_api_info_get (struct t_weechat_plugin *plugin, char *info)
plugin_api_info_get (struct t_weechat_plugin *plugin, const char *info)
{
time_t inactivity;
static char value[32];
@@ -730,7 +730,7 @@ plugin_api_infolist_get_add_window (struct t_plugin_infolist *infolist,
int
plugin_api_infolist_get_add_options (struct t_plugin_infolist *infolist,
char *option_name)
const char *option_name)
{
struct t_config_file *ptr_config;
struct t_config_section *ptr_section;
@@ -930,7 +930,7 @@ plugin_api_infolist_get_add_options (struct t_plugin_infolist *infolist,
*/
struct t_plugin_infolist *
plugin_api_infolist_get (char *name, void *pointer, char *arguments)
plugin_api_infolist_get (const char *name, void *pointer, const char *arguments)
{
struct t_plugin_infolist *ptr_infolist;
struct t_gui_buffer *ptr_buffer;
@@ -1140,7 +1140,7 @@ plugin_api_infolist_fields (struct t_plugin_infolist *infolist)
*/
int
plugin_api_infolist_integer (struct t_plugin_infolist *infolist, char *var)
plugin_api_infolist_integer (struct t_plugin_infolist *infolist, const char *var)
{
if (!infolist || !plugin_infolist_valid (infolist)
|| !((struct t_plugin_infolist *)infolist)->ptr_item)
@@ -1154,7 +1154,7 @@ plugin_api_infolist_integer (struct t_plugin_infolist *infolist, char *var)
*/
char *
plugin_api_infolist_string (struct t_plugin_infolist *infolist, char *var)
plugin_api_infolist_string (struct t_plugin_infolist *infolist, const char *var)
{
if (!infolist || !plugin_infolist_valid (infolist)
|| !((struct t_plugin_infolist *)infolist)->ptr_item)
@@ -1168,7 +1168,7 @@ plugin_api_infolist_string (struct t_plugin_infolist *infolist, char *var)
*/
void *
plugin_api_infolist_pointer (struct t_plugin_infolist *infolist, char *var)
plugin_api_infolist_pointer (struct t_plugin_infolist *infolist, const char *var)
{
if (!infolist || !plugin_infolist_valid (infolist)
|| !((struct t_plugin_infolist *)infolist)->ptr_item)
@@ -1182,7 +1182,7 @@ plugin_api_infolist_pointer (struct t_plugin_infolist *infolist, char *var)
*/
time_t
plugin_api_infolist_time (struct t_plugin_infolist *infolist, char *var)
plugin_api_infolist_time (struct t_plugin_infolist *infolist, const char *var)
{
if (!infolist || !plugin_infolist_valid (infolist)
|| !((struct t_plugin_infolist *)infolist)->ptr_item)
+21 -20
View File
@@ -22,51 +22,52 @@
/* strings */
extern void plugin_api_charset_set (struct t_weechat_plugin *plugin,
char *charset);
extern char *plugin_api_gettext (char *string);
extern char *plugin_api_ngettext (char *single, char *plural, int count);
const char *charset);
extern char *plugin_api_gettext (const char *string);
extern char *plugin_api_ngettext (const char *single, const char *plural,
int count);
/* directories */
extern int plugin_api_mkdir_home (char *directory, int mode);
extern int plugin_api_mkdir (char *directory, int mode);
extern int plugin_api_mkdir_home (const char *directory, int mode);
extern int plugin_api_mkdir (const char *directory, int mode);
/* config */
extern struct t_config_option *plugin_api_config_get (char *option_name);
extern struct t_config_option *plugin_api_config_get (const char *option_name);
extern char *plugin_api_config_get_plugin (struct t_weechat_plugin *plugin,
char *option_name);
const char *option_name);
extern int plugin_api_config_set_plugin (struct t_weechat_plugin *plugin,
char *option_name, char *value);
const char *option_name, const char *value);
/* display */
extern char *plugin_api_prefix (char *prefix);
extern char *plugin_api_color (char *color_name);
extern char *plugin_api_prefix (const char *prefix);
extern char *plugin_api_color (const char *color_name);
extern void plugin_api_infobar_printf (struct t_weechat_plugin *plugin,
int delay, char *color_name,
char *format, ...);
int delay, const char *color_name,
const char *format, ...);
extern void plugin_api_infobar_remove (int how_many);
/* command */
extern void plugin_api_command (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer, char *command);
struct t_gui_buffer *buffer, const char *command);
/* infos */
extern char *plugin_api_info_get (struct t_weechat_plugin *plugin, char *info);
extern char *plugin_api_info_get (struct t_weechat_plugin *plugin, const char *info);
/* infolists */
extern struct t_plugin_infolist *plugin_api_infolist_get (char *name,
extern struct t_plugin_infolist *plugin_api_infolist_get (const char *name,
void *pointer,
char *arguments);
const char *arguments);
extern int plugin_api_infolist_next (struct t_plugin_infolist *infolist);
extern int plugin_api_infolist_prev (struct t_plugin_infolist *infolist);
extern char *plugin_api_infolist_fields (struct t_plugin_infolist *infolist);
extern int plugin_api_infolist_integer (struct t_plugin_infolist *infolist,
char *var);
const char *var);
extern char *plugin_api_infolist_string (struct t_plugin_infolist *infolist,
char *var);
const char *var);
extern void *plugin_api_infolist_pointer (struct t_plugin_infolist *infolist,
char *var);
const char *var);
extern time_t plugin_api_infolist_time (struct t_plugin_infolist *infolist,
char *var);
const char *var);
extern void plugin_api_infolist_free (struct t_plugin_infolist *infolist);
#endif /* plugin-api.h */
+5 -4
View File
@@ -48,7 +48,7 @@ struct t_config_section *plugin_config_section_var = NULL;
*/
struct t_config_option *
plugin_config_search (char *plugin_name, char *option_name)
plugin_config_search (const char *plugin_name, const char *option_name)
{
int length;
char *option_full_name;
@@ -77,7 +77,7 @@ plugin_config_search (char *plugin_name, char *option_name)
*/
int
plugin_config_set_internal (char *option, char *value)
plugin_config_set_internal (const char *option, const char *value)
{
int rc;
struct t_config_option *ptr_option;
@@ -108,7 +108,8 @@ plugin_config_set_internal (char *option, char *value)
*/
int
plugin_config_set (char *plugin_name, char *option_name, char *value)
plugin_config_set (const char *plugin_name, const char *option_name,
const char *value)
{
int length, rc;
char *option_full_name;
@@ -153,7 +154,7 @@ plugin_config_reload (void *data, struct t_config_file *config_file)
int
plugin_config_create_option (void *data, struct t_config_file *config_file,
struct t_config_section *section,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_config_option *ptr_option;
+6 -6
View File
@@ -25,12 +25,12 @@
extern struct t_config_file *plugin_config;
extern struct t_config_option *plugin_options;
extern struct t_config_option *plugin_config_search_internal (char *option_name);
extern struct t_config_option *plugin_config_search (char *plugin_name,
char *option_name);
extern int plugin_config_set_internal (char *option, char *value);
extern int plugin_config_set (char *plugin_name, char *option_name,
char *value);
extern struct t_config_option *plugin_config_search_internal (const char *option_name);
extern struct t_config_option *plugin_config_search (const char *plugin_name,
const char *option_name);
extern int plugin_config_set_internal (const char *option, const char *value);
extern int plugin_config_set (const char *plugin_name, const char *option_name,
const char *value);
extern void plugin_config_init ();
extern int plugin_config_read ();
extern int plugin_config_reload ();
+8 -8
View File
@@ -98,7 +98,7 @@ plugin_infolist_new_item (struct t_plugin_infolist *list)
struct t_plugin_infolist_var *
plugin_infolist_new_var_integer (struct t_plugin_infolist_item *item,
char *name, int value)
const char *name, int value)
{
struct t_plugin_infolist_var *new_var;
@@ -132,7 +132,7 @@ plugin_infolist_new_var_integer (struct t_plugin_infolist_item *item,
struct t_plugin_infolist_var *
plugin_infolist_new_var_string (struct t_plugin_infolist_item *item,
char *name, char *value)
const char *name, const char *value)
{
struct t_plugin_infolist_var *new_var;
@@ -164,7 +164,7 @@ plugin_infolist_new_var_string (struct t_plugin_infolist_item *item,
struct t_plugin_infolist_var *
plugin_infolist_new_var_pointer (struct t_plugin_infolist_item *item,
char *name, void *pointer)
const char *name, void *pointer)
{
struct t_plugin_infolist_var *new_var;
@@ -196,7 +196,7 @@ plugin_infolist_new_var_pointer (struct t_plugin_infolist_item *item,
struct t_plugin_infolist_var *
plugin_infolist_new_var_time (struct t_plugin_infolist_item *item,
char *name, time_t time)
const char *name, time_t time)
{
struct t_plugin_infolist_var *new_var;
@@ -340,7 +340,7 @@ plugin_infolist_get_fields (struct t_plugin_infolist *list)
*/
int
plugin_infolist_get_integer (struct t_plugin_infolist *list, char *var)
plugin_infolist_get_integer (struct t_plugin_infolist *list, const char *var)
{
struct t_plugin_infolist_var *ptr_var;
@@ -367,7 +367,7 @@ plugin_infolist_get_integer (struct t_plugin_infolist *list, char *var)
*/
char *
plugin_infolist_get_string (struct t_plugin_infolist *list, char *var)
plugin_infolist_get_string (struct t_plugin_infolist *list, const char *var)
{
struct t_plugin_infolist_var *ptr_var;
@@ -394,7 +394,7 @@ plugin_infolist_get_string (struct t_plugin_infolist *list, char *var)
*/
void *
plugin_infolist_get_pointer (struct t_plugin_infolist *list, char *var)
plugin_infolist_get_pointer (struct t_plugin_infolist *list, const char *var)
{
struct t_plugin_infolist_var *ptr_var;
@@ -421,7 +421,7 @@ plugin_infolist_get_pointer (struct t_plugin_infolist *list, char *var)
*/
time_t
plugin_infolist_get_time (struct t_plugin_infolist *list, char *var)
plugin_infolist_get_time (struct t_plugin_infolist *list, const char *var)
{
struct t_plugin_infolist_var *ptr_var;
+9 -9
View File
@@ -68,29 +68,29 @@ extern struct t_plugin_infolist *last_plugin_infolist;
extern struct t_plugin_infolist *plugin_infolist_new ();
extern struct t_plugin_infolist_item *plugin_infolist_new_item (struct t_plugin_infolist *list);
extern struct t_plugin_infolist_var *plugin_infolist_new_var_integer (struct t_plugin_infolist_item *item,
char *name,
const char *name,
int value);
extern struct t_plugin_infolist_var *plugin_infolist_new_var_string (struct t_plugin_infolist_item *item,
char *name,
char *value);
const char *name,
const char *value);
extern struct t_plugin_infolist_var *plugin_infolist_new_var_pointer (struct t_plugin_infolist_item *item,
char *name,
const char *name,
void *pointer);
extern struct t_plugin_infolist_var *plugin_infolist_new_var_time (struct t_plugin_infolist_item *item,
char *name,
const char *name,
time_t time);
extern int plugin_infolist_valid (struct t_plugin_infolist *list);
extern struct t_plugin_infolist_item *plugin_infolist_next_item (struct t_plugin_infolist *list);
extern struct t_plugin_infolist_item *plugin_infolist_prev_item (struct t_plugin_infolist *list);
extern char *plugin_infolist_get_fields (struct t_plugin_infolist *list);
extern int plugin_infolist_get_integer (struct t_plugin_infolist *list,
char *var);
const char *var);
extern char *plugin_infolist_get_string (struct t_plugin_infolist *list,
char *var);
const char *var);
extern void *plugin_infolist_get_pointer (struct t_plugin_infolist *list,
char *var);
const char *var);
extern time_t plugin_infolist_get_time (struct t_plugin_infolist *list,
char *var);
const char *var);
extern void plugin_infolist_free (struct t_plugin_infolist *list);
extern void plugin_infolist_print_log ();
+5 -5
View File
@@ -65,7 +65,7 @@ char **plugin_argv; /* first time loading plugin) */
*/
struct t_weechat_plugin *
plugin_search (char *name)
plugin_search (const char *name)
{
struct t_weechat_plugin *ptr_plugin;
@@ -86,7 +86,7 @@ plugin_search (char *name)
*/
struct t_weechat_plugin *
plugin_load (char *filename)
plugin_load (const char *filename)
{
char *ptr_home, *full_name, *full_name2;
void *handle;
@@ -517,7 +517,7 @@ plugin_load (char *filename)
*/
int
plugin_auto_load_file (void *plugin, char *filename)
plugin_auto_load_file (void *plugin, const char *filename)
{
char *pos;
@@ -716,7 +716,7 @@ plugin_unload (struct t_weechat_plugin *plugin)
*/
void
plugin_unload_name (char *name)
plugin_unload_name (const char *name)
{
struct t_weechat_plugin *ptr_plugin;
@@ -750,7 +750,7 @@ plugin_unload_all ()
*/
void
plugin_reload_name (char *name)
plugin_reload_name (const char *name)
{
struct t_weechat_plugin *ptr_plugin;
char *filename;
+4 -4
View File
@@ -31,14 +31,14 @@ extern struct t_weechat_plugin *last_weechat_plugin;
//extern t_plugin_irc_color plugins_irc_colors[GUI_NUM_IRC_COLORS];
extern struct t_weechat_plugin *plugin_search (char *name);
extern struct t_weechat_plugin *plugin_load (char *filename);
extern struct t_weechat_plugin *plugin_search (const char *name);
extern struct t_weechat_plugin *plugin_load (const char *filename);
extern void plugin_auto_load ();
extern void plugin_remove (struct t_weechat_plugin *plugin);
extern void plugin_unload (struct t_weechat_plugin *plugin);
extern void plugin_unload_name (char *name);
extern void plugin_unload_name (const char *name);
extern void plugin_unload_all ();
extern void plugin_reload_name (char *name);
extern void plugin_reload_name (const char *name);
extern void plugin_init (int auto_load, int argc, char *argv[]);
extern void plugin_end ();
extern void plugin_print_log ();
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -43,7 +43,7 @@ struct t_weechat_plugin *weechat_lua_plugin;
struct t_plugin_script *lua_scripts = NULL;
struct t_plugin_script *lua_current_script = NULL;
char *lua_current_script_filename = NULL;
const char *lua_current_script_filename = NULL;
lua_State *lua_current_interpreter = NULL;
@@ -53,7 +53,7 @@ lua_State *lua_current_interpreter = NULL;
void *
weechat_lua_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv)
int ret_type, const char *function, char **argv)
{
void *ret_value;
int argc, *ret_i;
@@ -127,7 +127,7 @@ weechat_lua_exec (struct t_plugin_script *script,
}
int
weechat_lua_load (char *filename)
weechat_lua_load (const char *filename)
{
FILE *fp;
char *weechat_lua_code = {
@@ -247,7 +247,7 @@ weechat_lua_load (char *filename)
*/
int
weechat_lua_load_cb (void *data, char *filename)
weechat_lua_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
@@ -292,7 +292,7 @@ weechat_lua_unload (struct t_plugin_script *script)
*/
void
weechat_lua_unload_name (char *name)
weechat_lua_unload_name (const char *name)
{
struct t_plugin_script *ptr_script;
@@ -413,7 +413,7 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
weechat_lua_completion_cb (void *data, char *completion,
weechat_lua_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -432,7 +432,7 @@ weechat_lua_completion_cb (void *data, char *completion,
*/
int
weechat_lua_debug_dump_cb (void *data, char *signal, char *type_data,
weechat_lua_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
@@ -451,7 +451,7 @@ weechat_lua_debug_dump_cb (void *data, char *signal, char *type_data,
*/
int
weechat_lua_buffer_closed_cb (void *data, char *signal, char *type_data,
weechat_lua_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+4 -3
View File
@@ -26,10 +26,11 @@ extern struct t_weechat_plugin *weechat_lua_plugin;
extern struct t_plugin_script *lua_scripts;
extern struct t_plugin_script *lua_current_script;
extern char *lua_current_script_filename;
extern const char *lua_current_script_filename;
extern lua_State *lua_current_interpreter;
extern void * weechat_lua_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv);
extern void *weechat_lua_exec (struct t_plugin_script *script,
int ret_type, const char *function,
char **argv);
#endif /* weechat-lua.h */
+28 -28
View File
@@ -803,7 +803,7 @@ static XS (XS_weechat_config_new)
void
weechat_perl_api_config_section_read_cb (void *data,
struct t_config_file *config_file,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_script_callback *script_callback;
char *perl_argv[4];
@@ -814,8 +814,8 @@ weechat_perl_api_config_section_read_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
perl_argv[0] = script_ptr2str (config_file);
perl_argv[1] = option_name;
perl_argv[2] = value;
perl_argv[1] = (char *)option_name;
perl_argv[2] = (char *)value;
perl_argv[3] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
@@ -837,7 +837,7 @@ weechat_perl_api_config_section_read_cb (void *data,
void
weechat_perl_api_config_section_write_cb (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
struct t_script_callback *script_callback;
char *perl_argv[3];
@@ -848,7 +848,7 @@ weechat_perl_api_config_section_write_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
perl_argv[0] = script_ptr2str (config_file);
perl_argv[1] = section_name;
perl_argv[1] = (char *)section_name;
perl_argv[2] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
@@ -871,7 +871,7 @@ weechat_perl_api_config_section_write_cb (void *data,
void
weechat_perl_api_config_section_write_default_cb (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
struct t_script_callback *script_callback;
char *perl_argv[3];
@@ -882,7 +882,7 @@ weechat_perl_api_config_section_write_default_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
perl_argv[0] = script_ptr2str (config_file);
perl_argv[1] = section_name;
perl_argv[1] = (char *)section_name;
perl_argv[2] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
@@ -905,8 +905,8 @@ int
weechat_perl_api_config_section_create_option_cb (void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value)
const char *option_name,
const char *value)
{
struct t_script_callback *script_callback;
char *perl_argv[5];
@@ -918,8 +918,8 @@ weechat_perl_api_config_section_create_option_cb (void *data,
{
perl_argv[0] = script_ptr2str (config_file);
perl_argv[1] = script_ptr2str (section);
perl_argv[2] = option_name;
perl_argv[3] = value;
perl_argv[2] = (char *)option_name;
perl_argv[3] = (char *)value;
perl_argv[4] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
@@ -2101,7 +2101,7 @@ static XS (XS_weechat_hook_fd)
int
weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, char **tags,
char *prefix, char *message)
const char *prefix, const char *message)
{
struct t_script_callback *script_callback;
char *perl_argv[6];
@@ -2118,8 +2118,8 @@ weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
perl_argv[0] = script_ptr2str (buffer);
perl_argv[1] = timebuffer;
perl_argv[2] = weechat_string_build_with_exploded (tags, ",");
perl_argv[3] = prefix;
perl_argv[4] = message;
perl_argv[3] = (char *)prefix;
perl_argv[4] = (char *)message;
perl_argv[5] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
@@ -2187,7 +2187,7 @@ static XS (XS_weechat_hook_print)
*/
int
weechat_perl_api_hook_signal_cb (void *data, char *signal, char *type_data,
weechat_perl_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_script_callback *script_callback;
@@ -2197,7 +2197,7 @@ weechat_perl_api_hook_signal_cb (void *data, char *signal, char *type_data,
script_callback = (struct t_script_callback *)data;
perl_argv[0] = signal;
perl_argv[0] = (char *)signal;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
@@ -2329,7 +2329,7 @@ static XS (XS_weechat_hook_signal_send)
*/
int
weechat_perl_api_hook_config_cb (void *data, char *option, char *value)
weechat_perl_api_hook_config_cb (void *data, const char *option, const char *value)
{
struct t_script_callback *script_callback;
char *perl_argv[3];
@@ -2337,8 +2337,8 @@ weechat_perl_api_hook_config_cb (void *data, char *option, char *value)
script_callback = (struct t_script_callback *)data;
perl_argv[0] = option;
perl_argv[1] = value;
perl_argv[0] = (char *)option;
perl_argv[1] = (char *)value;
perl_argv[2] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
@@ -2397,7 +2397,7 @@ static XS (XS_weechat_hook_config)
*/
int
weechat_perl_api_hook_completion_cb (void *data, char *completion,
weechat_perl_api_hook_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -2407,7 +2407,7 @@ weechat_perl_api_hook_completion_cb (void *data, char *completion,
script_callback = (struct t_script_callback *)data;
perl_argv[0] = completion;
perl_argv[0] = (char *)completion;
perl_argv[1] = script_ptr2str (buffer);
perl_argv[2] = script_ptr2str (list);
perl_argv[3] = NULL;
@@ -2472,17 +2472,17 @@ static XS (XS_weechat_hook_completion)
*/
char *
weechat_perl_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
weechat_perl_api_hook_modifier_cb (void *data, const char *modifier,
const char *modifier_data, const char *string)
{
struct t_script_callback *script_callback;
char *perl_argv[4];
script_callback = (struct t_script_callback *)data;
perl_argv[0] = modifier;
perl_argv[1] = modifier_data;
perl_argv[2] = string;
perl_argv[0] = (char *)modifier;
perl_argv[1] = (char *)modifier_data;
perl_argv[2] = (char *)string;
perl_argv[3] = NULL;
return (char *)weechat_perl_exec (script_callback->script,
@@ -2617,7 +2617,7 @@ static XS (XS_weechat_unhook_all)
int
weechat_perl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
char *input_data)
const char *input_data)
{
struct t_script_callback *script_callback;
char *perl_argv[3];
@@ -2626,7 +2626,7 @@ weechat_perl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
script_callback = (struct t_script_callback *)data;
perl_argv[0] = script_ptr2str (buffer);
perl_argv[1] = input_data;
perl_argv[1] = (char *)input_data;
perl_argv[2] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
+11 -11
View File
@@ -41,7 +41,7 @@ struct t_weechat_plugin *weechat_perl_plugin = NULL;
struct t_plugin_script *perl_scripts = NULL;
struct t_plugin_script *perl_current_script = NULL;
char *perl_current_script_filename = NULL;
const char *perl_current_script_filename = NULL;
#ifdef NO_PERL_MULTIPLICITY
#undef MULTIPLICITY
@@ -106,9 +106,9 @@ char *perl_weechat_code =
void *
weechat_perl_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv)
int ret_type, const char *function, char **argv)
{
char *func;
const char *func;
unsigned int count;
void *ret_value;
int *ret_i, mem_err, length;
@@ -224,7 +224,7 @@ weechat_perl_exec (struct t_plugin_script *script,
*/
int
weechat_perl_load (char *filename)
weechat_perl_load (const char *filename)
{
STRLEN len;
struct t_plugin_script tempscript;
@@ -274,13 +274,13 @@ weechat_perl_load (char *filename)
NULL);
eval_pv (perl_weechat_code, TRUE);
perl_argv[0] = filename;
perl_argv[0] = (char *)filename;
perl_argv[1] = NULL;
#else
snprintf (pkgname, sizeof(pkgname), "%s%d", PKG_NAME_PREFIX, perl_num);
perl_num++;
tempscript.interpreter = "WeechatPerlScriptLoader";
perl_argv[0] = filename;
perl_argv[0] = (char *)filename;
perl_argv[1] = pkgname;
perl_argv[2] = NULL;
#endif
@@ -376,7 +376,7 @@ weechat_perl_load (char *filename)
*/
int
weechat_perl_load_cb (void *data, char *filename)
weechat_perl_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
@@ -433,7 +433,7 @@ weechat_perl_unload (struct t_plugin_script *script)
*/
void
weechat_perl_unload_name (char *name)
weechat_perl_unload_name (const char *name)
{
struct t_plugin_script *ptr_script;
@@ -554,7 +554,7 @@ weechat_perl_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
weechat_perl_completion_cb (void *data, char *completion,
weechat_perl_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -573,7 +573,7 @@ weechat_perl_completion_cb (void *data, char *completion,
*/
int
weechat_perl_debug_dump_cb (void *data, char *signal, char *type_data,
weechat_perl_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
@@ -592,7 +592,7 @@ weechat_perl_debug_dump_cb (void *data, char *signal, char *type_data,
*/
int
weechat_perl_buffer_closed_cb (void *data, char *signal, char *type_data,
weechat_perl_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+4 -3
View File
@@ -26,9 +26,10 @@ extern struct t_weechat_plugin *weechat_perl_plugin;
extern struct t_plugin_script *perl_scripts;
extern struct t_plugin_script *perl_current_script;
extern char *perl_current_script_filename;
extern const char *perl_current_script_filename;
extern void * weechat_perl_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv);
extern void *weechat_perl_exec (struct t_plugin_script *script,
int ret_type, const char *function,
char **argv);
#endif /* weechat-perl.h */
+28 -28
View File
@@ -847,7 +847,7 @@ weechat_python_api_config_new (PyObject *self, PyObject *args)
void
weechat_python_api_config_read_cb (void *data,
struct t_config_file *config_file,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_script_callback *script_callback;
char *python_argv[4];
@@ -858,8 +858,8 @@ weechat_python_api_config_read_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
python_argv[0] = script_ptr2str (config_file);
python_argv[1] = option_name;
python_argv[2] = value;
python_argv[1] = (char *)option_name;
python_argv[2] = (char *)value;
python_argv[3] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
@@ -881,7 +881,7 @@ weechat_python_api_config_read_cb (void *data,
void
weechat_python_api_config_section_write_cb (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
struct t_script_callback *script_callback;
char *python_argv[3];
@@ -892,7 +892,7 @@ weechat_python_api_config_section_write_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
python_argv[0] = script_ptr2str (config_file);
python_argv[1] = section_name;
python_argv[1] = (char *)section_name;
python_argv[2] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
@@ -915,7 +915,7 @@ weechat_python_api_config_section_write_cb (void *data,
void
weechat_python_api_config_section_write_default_cb (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
struct t_script_callback *script_callback;
char *python_argv[3];
@@ -926,7 +926,7 @@ weechat_python_api_config_section_write_default_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
python_argv[0] = script_ptr2str (config_file);
python_argv[1] = section_name;
python_argv[1] = (char *)section_name;
python_argv[2] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
@@ -949,8 +949,8 @@ int
weechat_python_api_config_section_create_option_cb (void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value)
const char *option_name,
const char *value)
{
struct t_script_callback *script_callback;
char *python_argv[5];
@@ -962,8 +962,8 @@ weechat_python_api_config_section_create_option_cb (void *data,
{
python_argv[0] = script_ptr2str (config_file);
python_argv[1] = script_ptr2str (section);
python_argv[2] = option_name;
python_argv[3] = value;
python_argv[2] = (char *)option_name;
python_argv[3] = (char *)value;
python_argv[4] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
@@ -2245,7 +2245,7 @@ weechat_python_api_hook_fd (PyObject *self, PyObject *args)
int
weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, char **tags,
char *prefix, char *message)
const char *prefix, const char *message)
{
struct t_script_callback *script_callback;
char *python_argv[6];
@@ -2262,8 +2262,8 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
python_argv[0] = script_ptr2str (buffer);
python_argv[1] = timebuffer;
python_argv[2] = weechat_string_build_with_exploded (tags, ",");
python_argv[3] = prefix;
python_argv[4] = message;
python_argv[3] = (char *)prefix;
python_argv[4] = (char *)message;
python_argv[5] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
@@ -2336,7 +2336,7 @@ weechat_python_api_hook_print (PyObject *self, PyObject *args)
*/
int
weechat_python_api_hook_signal_cb (void *data, char *signal, char *type_data,
weechat_python_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_script_callback *script_callback;
@@ -2346,7 +2346,7 @@ weechat_python_api_hook_signal_cb (void *data, char *signal, char *type_data,
script_callback = (struct t_script_callback *)data;
python_argv[0] = signal;
python_argv[0] = (char *)signal;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
@@ -2481,7 +2481,7 @@ weechat_python_api_hook_signal_send (PyObject *self, PyObject *args)
*/
int
weechat_python_api_hook_config_cb (void *data, char *option, char *value)
weechat_python_api_hook_config_cb (void *data, const char *option, const char *value)
{
struct t_script_callback *script_callback;
char *python_argv[3];
@@ -2489,8 +2489,8 @@ weechat_python_api_hook_config_cb (void *data, char *option, char *value)
script_callback = (struct t_script_callback *)data;
python_argv[0] = option;
python_argv[1] = value;
python_argv[0] = (char *)option;
python_argv[1] = (char *)value;
python_argv[2] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
@@ -2551,7 +2551,7 @@ weechat_python_api_hook_config (PyObject *self, PyObject *args)
*/
int
weechat_python_api_hook_completion_cb (void *data, char *completion,
weechat_python_api_hook_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -2561,7 +2561,7 @@ weechat_python_api_hook_completion_cb (void *data, char *completion,
script_callback = (struct t_script_callback *)data;
python_argv[0] = completion;
python_argv[0] = (char *)completion;
python_argv[1] = script_ptr2str (buffer);
python_argv[2] = script_ptr2str (list);
python_argv[3] = NULL;
@@ -2628,17 +2628,17 @@ weechat_python_api_hook_completion (PyObject *self, PyObject *args)
*/
char *
weechat_python_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
weechat_python_api_hook_modifier_cb (void *data, const char *modifier,
const char *modifier_data, const char *string)
{
struct t_script_callback *script_callback;
char *python_argv[4];
script_callback = (struct t_script_callback *)data;
python_argv[0] = modifier;
python_argv[1] = modifier_data;
python_argv[2] = string;
python_argv[0] = (char *)modifier;
python_argv[1] = (char *)modifier_data;
python_argv[2] = (char *)string;
python_argv[3] = NULL;
return (char *)weechat_python_exec (script_callback->script,
@@ -2779,7 +2779,7 @@ weechat_python_api_unhook_all (PyObject *self, PyObject *args)
int
weechat_python_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
char *input_data)
const char *input_data)
{
struct t_script_callback *script_callback;
char *python_argv[3];
@@ -2788,7 +2788,7 @@ weechat_python_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer
script_callback = (struct t_script_callback *)data;
python_argv[0] = script_ptr2str (buffer);
python_argv[1] = input_data;
python_argv[1] = (char *)input_data;
python_argv[2] = NULL;
r = (int *) weechat_python_exec (script_callback->script,
+8 -8
View File
@@ -39,7 +39,7 @@ struct t_weechat_plugin *weechat_python_plugin = NULL;
struct t_plugin_script *python_scripts = NULL;
struct t_plugin_script *python_current_script = NULL;
char *python_current_script_filename = NULL;
const char *python_current_script_filename = NULL;
PyThreadState *python_mainThreadState = NULL;
char python_buffer_output[128];
@@ -51,7 +51,7 @@ char python_buffer_output[128];
void *
weechat_python_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv)
int ret_type, const char *function, char **argv)
{
PyObject *evMain;
PyObject *evDict;
@@ -255,7 +255,7 @@ PyMethodDef weechat_python_output_funcs[] = {
*/
int
weechat_python_load (char *filename)
weechat_python_load (const char *filename)
{
char *argv[] = { "__weechat_plugin__" , NULL };
FILE *fp;
@@ -441,7 +441,7 @@ weechat_python_load (char *filename)
*/
int
weechat_python_load_cb (void *data, char *filename)
weechat_python_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
@@ -484,7 +484,7 @@ weechat_python_unload (struct t_plugin_script *script)
*/
void
weechat_python_unload_name (char *name)
weechat_python_unload_name (const char *name)
{
struct t_plugin_script *ptr_script;
@@ -605,7 +605,7 @@ weechat_python_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
weechat_python_completion_cb (void *data, char *completion,
weechat_python_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -624,7 +624,7 @@ weechat_python_completion_cb (void *data, char *completion,
*/
int
weechat_python_debug_dump_cb (void *data, char *signal, char *type_data,
weechat_python_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
@@ -643,7 +643,7 @@ weechat_python_debug_dump_cb (void *data, char *signal, char *type_data,
*/
int
weechat_python_buffer_closed_cb (void *data, char *signal, char *type_data,
weechat_python_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+4 -3
View File
@@ -26,9 +26,10 @@ extern struct t_weechat_plugin *weechat_python_plugin;
extern struct t_plugin_script *python_scripts;
extern struct t_plugin_script *python_current_script;
extern char *python_current_script_filename;
extern const char *python_current_script_filename;
extern void * weechat_python_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv);
extern void *weechat_python_exec (struct t_plugin_script *script,
int ret_type, const char *function,
char **argv);
#endif /* weechat-perl.h */
+28 -28
View File
@@ -966,7 +966,7 @@ weechat_ruby_api_config_new (VALUE class, VALUE name, VALUE function)
void
weechat_ruby_api_config_read_cb (void *data,
struct t_config_file *config_file,
char *option_name, char *value)
const char *option_name, const char *value)
{
struct t_script_callback *script_callback;
char *ruby_argv[4];
@@ -977,8 +977,8 @@ weechat_ruby_api_config_read_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
ruby_argv[0] = script_ptr2str (config_file);
ruby_argv[1] = option_name;
ruby_argv[2] = value;
ruby_argv[1] = (char *)option_name;
ruby_argv[2] = (char *)value;
ruby_argv[3] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
@@ -1000,7 +1000,7 @@ weechat_ruby_api_config_read_cb (void *data,
void
weechat_ruby_api_config_section_write_cb (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
struct t_script_callback *script_callback;
char *ruby_argv[3];
@@ -1011,7 +1011,7 @@ weechat_ruby_api_config_section_write_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
ruby_argv[0] = script_ptr2str (config_file);
ruby_argv[1] = section_name;
ruby_argv[1] = (char *)section_name;
ruby_argv[2] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
@@ -1034,7 +1034,7 @@ weechat_ruby_api_config_section_write_cb (void *data,
void
weechat_ruby_api_config_section_write_default_cb (void *data,
struct t_config_file *config_file,
char *section_name)
const char *section_name)
{
struct t_script_callback *script_callback;
char *ruby_argv[3];
@@ -1045,7 +1045,7 @@ weechat_ruby_api_config_section_write_default_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
ruby_argv[0] = script_ptr2str (config_file);
ruby_argv[1] = section_name;
ruby_argv[1] = (char *)section_name;
ruby_argv[2] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
@@ -1068,8 +1068,8 @@ int
weechat_ruby_api_config_section_create_option_cb (void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value)
const char *option_name,
const char *value)
{
struct t_script_callback *script_callback;
char *ruby_argv[5];
@@ -1081,8 +1081,8 @@ weechat_ruby_api_config_section_create_option_cb (void *data,
{
ruby_argv[0] = script_ptr2str (config_file);
ruby_argv[1] = script_ptr2str (section);
ruby_argv[2] = option_name;
ruby_argv[3] = value;
ruby_argv[2] = (char *)option_name;
ruby_argv[3] = (char *)value;
ruby_argv[4] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
@@ -2599,7 +2599,7 @@ weechat_ruby_api_hook_fd (VALUE class, VALUE fd, VALUE read, VALUE write,
int
weechat_ruby_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, char **tags,
char *prefix, char *message)
const char *prefix, const char *message)
{
struct t_script_callback *script_callback;
char *ruby_argv[6];
@@ -2616,8 +2616,8 @@ weechat_ruby_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
ruby_argv[0] = script_ptr2str (buffer);
ruby_argv[1] = timebuffer;
ruby_argv[2] = weechat_string_build_with_exploded (tags, ",");
ruby_argv[3] = prefix;
ruby_argv[4] = message;
ruby_argv[3] = (char *)prefix;
ruby_argv[4] = (char *)message;
ruby_argv[5] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
@@ -2703,7 +2703,7 @@ weechat_ruby_api_hook_print (VALUE class, VALUE buffer, VALUE tags,
*/
int
weechat_ruby_api_hook_signal_cb (void *data, char *signal, char *type_data,
weechat_ruby_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_script_callback *script_callback;
@@ -2713,7 +2713,7 @@ weechat_ruby_api_hook_signal_cb (void *data, char *signal, char *type_data,
script_callback = (struct t_script_callback *)data;
ruby_argv[0] = signal;
ruby_argv[0] = (char *)signal;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
@@ -2862,7 +2862,7 @@ weechat_ruby_api_hook_signal_send (VALUE class, VALUE signal, VALUE type_data,
*/
int
weechat_ruby_api_hook_config_cb (void *data, char *option, char *value)
weechat_ruby_api_hook_config_cb (void *data, const char *option, const char *value)
{
struct t_script_callback *script_callback;
char *ruby_argv[3];
@@ -2870,8 +2870,8 @@ weechat_ruby_api_hook_config_cb (void *data, char *option, char *value)
script_callback = (struct t_script_callback *)data;
ruby_argv[0] = option;
ruby_argv[1] = value;
ruby_argv[0] = (char *)option;
ruby_argv[1] = (char *)value;
ruby_argv[2] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
@@ -2938,7 +2938,7 @@ weechat_ruby_api_hook_config (VALUE class, VALUE option, VALUE function)
*/
int
weechat_ruby_api_hook_completion_cb (void *data, char *completion,
weechat_ruby_api_hook_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -2948,7 +2948,7 @@ weechat_ruby_api_hook_completion_cb (void *data, char *completion,
script_callback = (struct t_script_callback *)data;
ruby_argv[0] = completion;
ruby_argv[0] = (char *)completion;
ruby_argv[1] = script_ptr2str (buffer);
ruby_argv[2] = script_ptr2str (list);
ruby_argv[3] = NULL;
@@ -3022,17 +3022,17 @@ weechat_ruby_api_hook_completion (VALUE class, VALUE completion,
*/
char *
weechat_ruby_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
weechat_ruby_api_hook_modifier_cb (void *data, const char *modifier,
const char *modifier_data, const char *string)
{
struct t_script_callback *script_callback;
char *ruby_argv[4];
script_callback = (struct t_script_callback *)data;
ruby_argv[0] = modifier;
ruby_argv[1] = modifier_data;
ruby_argv[2] = string;
ruby_argv[0] = (char *)modifier;
ruby_argv[1] = (char *)modifier_data;
ruby_argv[2] = (char *)string;
ruby_argv[3] = NULL;
return (char *)weechat_ruby_exec (script_callback->script,
@@ -3191,7 +3191,7 @@ weechat_ruby_api_unhook_all (VALUE class)
int
weechat_ruby_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
char *input_data)
const char *input_data)
{
struct t_script_callback *script_callback;
char *ruby_argv[3];
@@ -3200,7 +3200,7 @@ weechat_ruby_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
script_callback = (struct t_script_callback *)data;
ruby_argv[0] = script_ptr2str (buffer);
ruby_argv[1] = input_data;
ruby_argv[1] = (char *)input_data;
ruby_argv[2] = NULL;
rc = (int *) weechat_ruby_exec (script_callback->script,
+8 -8
View File
@@ -42,7 +42,7 @@ struct t_weechat_plugin *weechat_ruby_plugin = NULL;
struct t_plugin_script *ruby_scripts = NULL;
struct t_plugin_script *ruby_current_script = NULL;
char *ruby_current_script_filename = NULL;
const char *ruby_current_script_filename = NULL;
VALUE ruby_mWeechat, ruby_mWeechatOutputs;
@@ -107,7 +107,7 @@ rb_protect_funcall (VALUE recv, ID mid, int *state, int argc, ...)
void *
weechat_ruby_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv)
int ret_type, const char *function, char **argv)
{
VALUE rc, err;
int ruby_error, *ret_i;
@@ -296,7 +296,7 @@ weechat_ruby_output_flush (VALUE self)
*/
int
weechat_ruby_load (char *filename)
weechat_ruby_load (const char *filename)
{
char modname[64];
VALUE curModule, ruby_retcode, err;
@@ -422,7 +422,7 @@ weechat_ruby_load (char *filename)
*/
int
weechat_ruby_load_cb (void *data, char *filename)
weechat_ruby_load_cb (void *data, const char *filename)
{
/* make C compiler happy */
(void) data;
@@ -468,7 +468,7 @@ weechat_ruby_unload (struct t_plugin_script *script)
*/
void
weechat_ruby_unload_name (char *name)
weechat_ruby_unload_name (const char *name)
{
struct t_plugin_script *ptr_script;
@@ -589,7 +589,7 @@ weechat_ruby_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
weechat_ruby_completion_cb (void *data, char *completion,
weechat_ruby_completion_cb (void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list)
{
@@ -608,7 +608,7 @@ weechat_ruby_completion_cb (void *data, char *completion,
*/
int
weechat_ruby_debug_dump_cb (void *data, char *signal, char *type_data,
weechat_ruby_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
@@ -627,7 +627,7 @@ weechat_ruby_debug_dump_cb (void *data, char *signal, char *type_data,
*/
int
weechat_ruby_buffer_closed_cb (void *data, char *signal, char *type_data,
weechat_ruby_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+4 -3
View File
@@ -26,9 +26,10 @@ extern struct t_weechat_plugin *weechat_ruby_plugin;
extern struct t_plugin_script *ruby_scripts;
extern struct t_plugin_script *ruby_current_script;
extern char *ruby_current_script_filename;
extern const char *ruby_current_script_filename;
extern void * weechat_ruby_exec (struct t_plugin_script *script,
int ret_type, char *function, char **argv);
extern void *weechat_ruby_exec (struct t_plugin_script *script,
int ret_type, const char *function,
char **argv);
#endif /* weechat-perl.h */
+60 -57
View File
@@ -35,7 +35,7 @@
void
script_api_charset_set (struct t_plugin_script *script,
char *charset)
const char *charset)
{
if (script->charset)
free (script->charset);
@@ -51,10 +51,10 @@ script_api_charset_set (struct t_plugin_script *script,
struct t_config_file *
script_api_config_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *name,
const char *name,
int (*callback_reload)(void *data,
struct t_config_file *config_file),
char *function)
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_config_file *new_config_file;
@@ -97,28 +97,28 @@ struct t_config_section *
script_api_config_new_section (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_config_file *config_file,
char *name,
const char *name,
int user_can_add_options,
int user_can_delete_options,
void (*callback_read)(void *data,
struct t_config_file *config_file,
char *option_name,
char *value),
const char *option_name,
const char *value),
char *function_read,
void (*callback_write)(void *data,
struct t_config_file *config_file,
char *section_name),
const char *section_name),
char *function_write,
void (*callback_write_default)(void *data,
struct t_config_file *config_file,
char *section_name),
const char *section_name),
char *function_write_default,
int (*callback_create_option)(void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value),
char *function_create_option)
const char *option_name,
const char *value),
const char *function_create_option)
{
struct t_script_callback *new_script_callback1, *new_script_callback2;
struct t_script_callback *new_script_callback3, *new_script_callback4;
@@ -288,19 +288,19 @@ script_api_config_new_option (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_config_file *config_file,
struct t_config_section *section,
char *name, char *type,
char *description, char *string_values,
int min, int max, char *default_value,
const char *name, const char *type,
const char *description, const char *string_values,
int min, int max, const char *default_value,
void (*callback_check_value)(void *data,
struct t_config_option *option,
char *value),
char *function_check_value,
const char *value),
const char *function_check_value,
void (*callback_change)(void *data,
struct t_config_option *option),
char *function_change,
const char *function_change,
void (*callback_delete)(void *data,
struct t_config_option *option),
char *function_delete)
const char *function_delete)
{
struct t_script_callback *new_script_callback1, *new_script_callback2;
struct t_script_callback *new_script_callback3;
@@ -451,7 +451,7 @@ script_api_config_free (struct t_weechat_plugin *weechat_plugin,
void
script_api_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer, char *format, ...)
struct t_gui_buffer *buffer, const char *format, ...)
{
va_list argptr;
char *buf, *buf2;
@@ -481,7 +481,8 @@ void
script_api_printf_date_tags (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
time_t date, char *tags, char *format, ...)
time_t date, const char *tags,
const char *format, ...)
{
va_list argptr;
char *buf, *buf2;
@@ -512,7 +513,7 @@ void
script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer, int y,
char *format, ...)
const char *format, ...)
{
va_list argptr;
char *buf, *buf2;
@@ -541,8 +542,8 @@ script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
void
script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int delay, char *color_name,
char *format, ...)
int delay, const char *color_name,
const char *format, ...)
{
va_list argptr;
char buf[1024];
@@ -566,7 +567,7 @@ script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin,
void
script_api_log_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *format, ...)
const char *format, ...)
{
va_list argptr;
char *buf, *buf2;
@@ -594,14 +595,14 @@ script_api_log_printf (struct t_weechat_plugin *weechat_plugin,
struct t_hook *
script_api_hook_command (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *command, char *description,
char *args, char *args_description,
char *completion,
const char *command, const char *description,
const char *args, const char *args_description,
const char *completion,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
char *function)
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -639,7 +640,7 @@ script_api_hook_timer (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int interval, int align_second, int max_calls,
int (*callback)(void *data),
char *function)
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -677,7 +678,7 @@ script_api_hook_fd (struct t_weechat_plugin *weechat_plugin,
int fd, int flag_read, int flag_write,
int flag_exception,
int (*callback)(void *data),
char *function)
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -713,13 +714,14 @@ struct t_hook *
script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
char *tags, char *message, int strip_colors,
const char *tags, const char *message, int strip_colors,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
time_t date,
int tags_count, char **tags,
char *prefix, char *message),
char *function)
const char *prefix,
const char *message),
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -754,11 +756,11 @@ script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
struct t_hook *
script_api_hook_signal (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *signal,
int (*callback)(void *data, char *signal,
char *type_data,
const char *signal,
int (*callback)(void *data, const char *signal,
const char *type_data,
void *signal_data),
char *function)
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -792,10 +794,10 @@ script_api_hook_signal (struct t_weechat_plugin *weechat_plugin,
struct t_hook *
script_api_hook_config (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *option,
int (*callback)(void *data, char *option,
char *value),
char *function)
const char *option,
int (*callback)(void *data, const char *option,
const char *value),
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -829,11 +831,11 @@ script_api_hook_config (struct t_weechat_plugin *weechat_plugin,
struct t_hook *
script_api_hook_completion (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *completion,
int (*callback)(void *data, char *completion,
const char *completion,
int (*callback)(void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list),
char *function)
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -867,10 +869,11 @@ script_api_hook_completion (struct t_weechat_plugin *weechat_plugin,
struct t_hook *
script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *modifier,
char *(*callback)(void *data, char *modifier,
char *modifier_data, char *string),
char *function)
const char *modifier,
char *(*callback)(void *data, const char *modifier,
const char *modifier_data,
const char *string),
const char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
@@ -951,14 +954,14 @@ script_api_unhook_all (struct t_plugin_script *script)
struct t_gui_buffer *
script_api_buffer_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *category, char *name,
const char *category, const char *name,
int (*input_callback)(void *data,
struct t_gui_buffer *buffer,
char *input_data),
char *function_input,
const char *input_data),
const char *function_input,
int (*close_callback)(void *data,
struct t_gui_buffer *buffer),
char *function_close)
const char *function_close)
{
struct t_script_callback *new_script_callback_input;
struct t_script_callback *new_script_callback_close;
@@ -1071,13 +1074,13 @@ script_api_buffer_close (struct t_weechat_plugin *weechat_plugin,
struct t_gui_bar_item *
script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *name,
const char *name,
char *(*build_callback)(void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
int max_width,
int max_height),
char *function_build)
const char *function_build)
{
struct t_script_callback *new_script_callback;
struct t_gui_bar_item *new_item;
@@ -1143,7 +1146,7 @@ script_api_bar_item_remove (struct t_weechat_plugin *weechat_plugin,
void
script_api_command (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer, char *command)
struct t_gui_buffer *buffer, const char *command)
{
char *command2;
@@ -1164,7 +1167,7 @@ script_api_command (struct t_weechat_plugin *weechat_plugin,
char *
script_api_config_get_plugin (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *option)
const char *option)
{
char *option_fullname, *return_value;
@@ -1191,7 +1194,7 @@ script_api_config_get_plugin (struct t_weechat_plugin *weechat_plugin,
int
script_api_config_set_plugin (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *option, char *value)
const char *option, const char *value)
{
char *option_fullname;
int return_code;
+63 -63
View File
@@ -20,179 +20,179 @@
#define __WEECHAT_SCRIPT_API_H 1
extern void script_api_charset_set (struct t_plugin_script *script,
char *charset);
const char *charset);
extern struct t_config_file *script_api_config_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *name,
const char *name,
int (*callback_reload)(void *data,
struct t_config_file *config_file),
char *function);
const char *function);
extern struct t_config_section *script_api_config_new_section (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_config_file *config_file,
char *name,
const char *name,
int user_can_add_options,
int user_can_delete_options,
void (*callback_read)(void *data,
struct t_config_file *config_file,
char *option_name,
char *value),
char *function_read,
const char *option_name,
const char *value),
const char *function_read,
void (*callback_write)(void *data,
struct t_config_file *config_file,
char *section_name),
char *function_write,
const char *section_name),
const char *function_write,
void (*callback_write_default)(void *data,
struct t_config_file *config_file,
char *section_name),
char *function_write_default,
const char *section_name),
const char *function_write_default,
int (*callback_create_option)(void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value),
char *function_create_option);
const char *option_name,
const char *value),
const char *function_create_option);
extern struct t_config_option *script_api_config_new_option (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_config_file *config_file,
struct t_config_section *section,
char *name,
char *type,
char *description,
char *string_values,
const char *name,
const char *type,
const char *description,
const char *string_values,
int min, int max,
char *default_value,
const char *default_value,
void (*callback_change)(void *data),
char *function);
const char *function);
extern void script_api_config_free (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_config_file *config_file);
extern void script_api_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
char *format, ...);
const char *format, ...);
extern void script_api_printf_date_tags (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
time_t date, char *tags,
char *format, ...);
time_t date, const char *tags,
const char *format, ...);
extern void script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
int y, char *format, ...);
int y, const char *format, ...);
extern void script_api_infobar_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int delay, char *color_name,
char *format, ...);
int delay, const char *color_name,
const char *format, ...);
extern void script_api_log_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *format, ...);
const char *format, ...);
extern struct t_hook *script_api_hook_command (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *command, char *description,
char *args, char *args_description,
char *completion,
const char *command, const char *description,
const char *args, const char *args_description,
const char *completion,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
char *function);
const char *function);
extern struct t_hook *script_api_hook_timer (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int interval, int align_second,
int max_calls,
int (*callback)(void *data),
char *function);
const char *function);
extern struct t_hook *script_api_hook_fd (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int fd, int flag_read,
int flag_write, int flag_exception,
int (*callback)(void *data),
char *function);
const char *function);
extern struct t_hook *script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
char *tags,
char *message,
const char *tags,
const char *message,
int strip_colors,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
time_t date,
int tags_count,
char **tags,
char *prefix,
char *message),
char *function);
const char *prefix,
const char *message),
const char *function);
extern struct t_hook *script_api_hook_signal (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *signal,
const char *signal,
int (*callback)(void *data,
char *signal,
char *type_data,
const char *signal,
const char *type_data,
void *signal_data),
char *function);
const char *function);
extern struct t_hook *script_api_hook_config (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *option,
const char *option,
int (*callback)(void *data,
char *option,
char *value),
char *function);
const char *option,
const char *value),
const char *function);
extern struct t_hook *script_api_hook_completion (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *completion,
const char *completion,
int (*callback)(void *data,
char *completion,
const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list),
char *function);
const char *function);
extern struct t_hook *script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *modifier,
const char *modifier,
char *(*callback)(void *data,
char *modifier,
char *modifier_data,
char *string),
char *function);
const char *modifier,
const char *modifier_data,
const char *string),
const char *function);
extern void script_api_unhook (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_hook *hook);
extern void script_api_unhook_all (struct t_plugin_script *script);
extern struct t_gui_buffer *script_api_buffer_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *category, char *name,
const char *category, const char *name,
int (*input_callback)(void *data,
struct t_gui_buffer *buffer,
char *input_data),
char *function_input,
const char *input_data),
const char *function_input,
int (*close_callback)(void *data,
struct t_gui_buffer *buffer),
char *function_close);
const char *function_close);
extern void script_api_buffer_close (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
int switch_to_another);
extern struct t_gui_bar_item *script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *name,
const char *name,
char *(*build_callback)(void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
int max_width,
int max_height),
char *function_build);
const char *function_build);
extern void script_api_bar_item_remove (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_bar_item *item);
extern void script_api_command (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
char *command);
const char *command);
extern char *script_api_config_get_plugin (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *option);
const char *option);
extern int script_api_config_set_plugin (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *option, char *value);
const char *option, const char *value);
#endif /* script-api.h */
+15 -15
View File
@@ -63,7 +63,7 @@ script_config_read (struct t_weechat_plugin *weechat_plugin)
*/
int
script_config_cb (void *data, char *option, char *value)
script_config_cb (void *data, const char *option, const char *value)
{
/* make C compiler happy */
(void) option;
@@ -84,16 +84,16 @@ script_init (struct t_weechat_plugin *weechat_plugin,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
int (*callback_completion)(void *data, char *completion,
int (*callback_completion)(void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list),
int (*callback_signal_debug_dump)(void *data, char *signal,
char *type_data,
int (*callback_signal_debug_dump)(void *data, const char *signal,
const char *type_data,
void *signal_data),
int (*callback_signal_buffer_closed)(void *data, char *signal,
char *type_data,
int (*callback_signal_buffer_closed)(void *data, const char *signal,
const char *type_data,
void *signal_data),
int (*callback_load_file)(void *data, char *filename))
int (*callback_load_file)(void *data, const char *filename))
{
char *string, *completion = "list|listfull|load|autoload|reload|unload %f";
int length;
@@ -190,7 +190,7 @@ script_ptr2str (void *pointer)
*/
void *
script_str2ptr (char *pointer_str)
script_str2ptr (const char *pointer_str)
{
unsigned int value;
@@ -208,7 +208,7 @@ script_str2ptr (char *pointer_str)
void
script_auto_load (struct t_weechat_plugin *weechat_plugin,
int (*callback)(void *data, char *filename))
int (*callback)(void *data, const char *filename))
{
char *dir_home, *dir_name;
int dir_length;
@@ -235,7 +235,7 @@ script_auto_load (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *
script_search (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts, char *name)
struct t_plugin_script *scripts, const char *name)
{
struct t_plugin_script *ptr_script;
@@ -256,7 +256,7 @@ script_search (struct t_weechat_plugin *weechat_plugin,
char *
script_search_full_name (struct t_weechat_plugin *weechat_plugin,
char *filename)
const char *filename)
{
char *final_name, *dir_home, *dir_system;
int length;
@@ -347,9 +347,9 @@ script_search_full_name (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *
script_add (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
char *filename, char *name, char *author, char *version,
char *license, char *description, char *shutdown_func,
char *charset)
const char *filename, const char *name, const char *author, const char *version,
const char *license, const char *description, const char *shutdown_func,
const char *charset)
{
struct t_plugin_script *new_script;
@@ -544,7 +544,7 @@ script_completion (struct t_weechat_plugin *weechat_plugin,
void
script_display_list (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
char *name, int full)
const char *name, int full)
{
struct t_plugin_script *ptr_script;
+15 -15
View File
@@ -61,33 +61,33 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
int (*callback_completion)(void *data, char *completion,
int (*callback_completion)(void *data, const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list),
int (*callback_signal_debug_dump)(void *data,
char *signal,
char *type_data,
const char *signal,
const char *type_data,
void *signal_data),
int (*callback_signal_buffer_closed)(void *data,
char *signal,
char *type_data,
const char *signal,
const char *type_data,
void *signal_data),
int (*callback_load_file)(void *data, char *filename));
int (*callback_load_file)(void *data, const char *filename));
extern char *script_ptr2str (void *pointer);
extern void *script_str2ptr (char *pointer_str);
extern void *script_str2ptr (const char *pointer_str);
extern void script_auto_load (struct t_weechat_plugin *weechat_plugin,
int (*callback)(void *data, char *filename));
int (*callback)(void *data, const char *filename));
extern struct t_plugin_script *script_search (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
char *name);
const char *name);
extern char *script_search_full_name (struct t_weechat_plugin *weechat_plugin,
char *filename);
const char *filename);
extern struct t_plugin_script *script_add (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
char *filename, char *name,
char *author, char *version,
char *license, char *description,
char *shutdown_func, char *charset);
const char *filename, const char *name,
const char *author, const char *version,
const char *license, const char *description,
const char *shutdown_func, const char *charset);
extern void script_remove_buffer_callbacks (struct t_plugin_script *scripts,
struct t_gui_buffer *buffer);
extern void script_remove (struct t_weechat_plugin *weechat_plugin,
@@ -98,7 +98,7 @@ extern void script_completion (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
extern void script_display_list (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
char *name, int full);
const char *name, int full);
extern void script_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
+138 -134
View File
@@ -118,53 +118,57 @@ struct t_weechat_plugin
existing plugins */
/* strings */
void (*charset_set) (struct t_weechat_plugin *plugin, char *charset);
char *(*iconv_to_internal) (char *charset, char *string);
char *(*iconv_from_internal) (char *charset, char *string);
char *(*gettext) (char *string);
char *(*ngettext) (char *single, char *plural, int count);
char *(*strndup) (char *string, int length);
void (*charset_set) (struct t_weechat_plugin *plugin, const char *charset);
char *(*iconv_to_internal) (const char *charset, const char *string);
char *(*iconv_from_internal) (const char *charset, const char *string);
char *(*gettext) (const char *string);
char *(*ngettext) (const char *single, const char *plural, int count);
char *(*strndup) (const char *string, int length);
void (*string_tolower) (char *string);
void (*string_toupper) (char *string);
int (*strcasecmp) (char *string1, char *string2);
int (*strncasecmp) (char *string1, char *string2, int max);
int (*strcmp_ignore_chars) (char *string1, char *string2,
char *chars_ignored, int case_sensitive);
char *(*strcasestr) (char *string1, char *string2);
int (*string_match) (char *string, char *mask, int case_sensitive);
char *(*string_replace) (char *string, char *search, char *replace);
char *(*string_remove_quotes) (char *string, char *quotes);
char *(*string_strip) (char *string, int left, int right, char *chars);
int (*string_has_highlight) (char *string, char *highlight_words);
char **(*string_explode) (char *string, char *separators, int keep_eol,
int num_items_max, int *num_items);
int (*strcasecmp) (const char *string1, const char *string2);
int (*strncasecmp) (const char *string1, const char *string2, int max);
int (*strcmp_ignore_chars) (const char *string1, const char *string2,
const char *chars_ignored, int case_sensitive);
char *(*strcasestr) (const char *string1, const char *string2);
int (*string_match) (const char *string, const char *mask,
int case_sensitive);
char *(*string_replace) (const char *string, const char *search,
const char *replace);
char *(*string_remove_quotes) (const char *string, const char *quotes);
char *(*string_strip) (const char *string, int left, int right,
const char *chars);
int (*string_has_highlight) (const char *string,
const char *highlight_words);
char **(*string_explode) (const char *string, const char *separators,
int keep_eol, int num_items_max, int *num_items);
void (*string_free_exploded) (char **exploded_string);
char *(*string_build_with_exploded) (char **exploded_string,
char *separator);
char **(*string_split_command) (char *command, char separator);
const char *separator);
char **(*string_split_command) (const char *command, char separator);
void (*string_free_splitted_command) (char **splitted_command);
/* UTF-8 strings */
int (*utf8_has_8bits) (char *string);
int (*utf8_is_valid) (char *string, char **error);
void (*utf8_normalize) (char *string, char replacement);
char *(*utf8_prev_char) (char *string_start, char *string);
char *(*utf8_next_char) (char *string);
int (*utf8_char_size) (char *string);
int (*utf8_strlen) (char *string);
int (*utf8_strnlen) (char *string, int bytes);
int (*utf8_strlen_screen) (char *string);
int (*utf8_charcasecmp) (char *string1, char *string2);
int (*utf8_char_size_screen) (char *string);
char *(*utf8_add_offset) (char *string, int offset);
int (*utf8_real_pos) (char *string, int pos);
int (*utf8_pos) (char *string, int real_pos);
int (*utf8_has_8bits) (const char *string);
int (*utf8_is_valid) (const char *string, char **error);
void (*utf8_normalize) (const char *string, char replacement);
char *(*utf8_prev_char) (const char *string_start, const char *string);
char *(*utf8_next_char) (const char *string);
int (*utf8_char_size) (const char *string);
int (*utf8_strlen) (const char *string);
int (*utf8_strnlen) (const char *string, int bytes);
int (*utf8_strlen_screen) (const char *string);
int (*utf8_charcasecmp) (const char *string1, const char *string2);
int (*utf8_char_size_screen) (const char *string);
char *(*utf8_add_offset) (const char *string, int offset);
int (*utf8_real_pos) (const char *string, int pos);
int (*utf8_pos) (const char *string, int real_pos);
/* directories */
int (*mkdir_home) (char *directory, int mode);
int (*mkdir) (char *directory, int mode);
void (*exec_on_files) (char *directory, void *data,
int (*callback)(void *data, char *filename));
int (*mkdir_home) (const char *directory, int mode);
int (*mkdir) (const char *directory, int mode);
void (*exec_on_files) (const char *directory, void *data,
int (*callback)(void *data, const char *filename));
/* util */
int (*timeval_cmp) (struct timeval *tv1, struct timeval *tv2);
@@ -173,15 +177,15 @@ struct t_weechat_plugin
/* sorted list */
struct t_weelist *(*list_new) ();
struct t_weelist_item *(*list_add) (struct t_weelist *weelist, char *data,
char *where);
struct t_weelist_item *(*list_add) (struct t_weelist *weelist, const char *data,
const char *where);
struct t_weelist_item *(*list_search) (struct t_weelist *weelist,
char *data);
const char *data);
struct t_weelist_item *(*list_casesearch) (struct t_weelist *weelist,
char *data);
const char *data);
struct t_weelist_item *(*list_get) (struct t_weelist *weelist,
int position);
void (*list_set) (struct t_weelist_item *item, char *value);
void (*list_set) (struct t_weelist_item *item, const char *value);
struct t_weelist_item *(*list_next) (struct t_weelist_item *item);
struct t_weelist_item *(*list_prev) (struct t_weelist_item *item);
char *(*list_string) (struct t_weelist_item *item);
@@ -193,46 +197,46 @@ struct t_weechat_plugin
/* config files */
struct t_config_file *(*config_new) (struct t_weechat_plugin *plugin,
char *name,
const char *name,
int (*callback_reload)(void *data,
struct t_config_file *config_file),
void *callback_reload_data);
struct t_config_section *(*config_new_section) (struct t_config_file *config_file,
char *name,
const char *name,
int user_can_add_options,
int user_can_delete_options,
int (*callback_read)(void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value),
const char *option_name,
const char *value),
void *callback_read_data,
void (*callback_write)(void *data,
struct t_config_file *config_file,
char *section_name),
const char *section_name),
void *callback_write_data,
void (*callback_write_default)(void *data,
struct t_config_file *config_file,
char *section_name),
const char *section_name),
void *callback_write_default_data,
int (*callback_create_option)(void *data,
struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
char *value),
const char *option_name,
const char *value),
void *callback_create_option_data);
struct t_config_section *(*config_search_section) (struct t_config_file *config_file,
char *section_name);
const char *section_name);
struct t_config_option *(*config_new_option) (struct t_config_file *config_file,
struct t_config_section *section,
char *name, char *type,
char *description,
char *string_values,
const char *name, const char *type,
const char *description,
const char *string_values,
int min, int max,
char *default_value,
const char *default_value,
int (*callback_check_value)(void *data,
struct t_config_option *option,
char *value),
const char *value),
void *callback_check_value_data,
void (*callback_change)(void *data,
struct t_config_option *option),
@@ -242,32 +246,32 @@ struct t_weechat_plugin
void *callback_delete_data);
struct t_config_option *(*config_search_option) (struct t_config_file *config_file,
struct t_config_section *section,
char *option_name);
const char *option_name);
void (*config_search_section_option) (struct t_config_file *config_file,
struct t_config_section *section,
char *option_name,
const char *option_name,
struct t_config_section **section_found,
struct t_config_option **option_found);
void (*config_search_with_string) (char *option_name,
void (*config_search_with_string) (const char *option_name,
struct t_config_file **config_file,
struct t_config_section **section,
struct t_config_option **option,
char **pos_option_name);
int (*config_string_to_boolean) (char *text);
int (*config_string_to_boolean) (const char *text);
int (*config_option_reset) (struct t_config_option *option,
int run_callback);
int (*config_option_set) (struct t_config_option *option, char *value,
int (*config_option_set) (struct t_config_option *option, const char *value,
int run_callback);
void (*config_option_rename) (struct t_config_option *option,
char *new_name);
const char *new_name);
void *(*config_option_get_pointer) (struct t_config_option *option,
char *property);
const char *property);
int (*config_boolean) (struct t_config_option *option);
int (*config_integer) (struct t_config_option *option);
char *(*config_string) (struct t_config_option *option);
int (*config_color) (struct t_config_option *option);
void (*config_write_line) (struct t_config_file *config_file,
char *option_name, char *value, ...);
const char *option_name, const char *value, ...);
int (*config_write) (struct t_config_file *config_file);
int (*config_read) (struct t_config_file *config_file);
int (*config_reload) (struct t_config_file *config_file);
@@ -276,29 +280,29 @@ struct t_weechat_plugin
void (*config_section_free) (struct t_config_file *config_file,
struct t_config_section *section);
void (*config_free) (struct t_config_file *config_file);
struct t_config_option *(*config_get) (char *option_name);
struct t_config_option *(*config_get) (const char *option_name);
char *(*config_get_plugin) (struct t_weechat_plugin *plugin,
char *option_name);
const char *option_name);
int (*config_set_plugin) (struct t_weechat_plugin *plugin,
char *option_name, char *value);
const char *option_name, const char *value);
/* display */
char *(*prefix) (char *prefix);
char *(*color) (char *color_name);
char *(*prefix) (const char *prefix);
char *(*color) (const char *color_name);
void (*printf_date_tags) (struct t_gui_buffer *buffer, time_t date,
char *tags, char *message, ...);
const char *tags, const char *message, ...);
void (*printf_y) (struct t_gui_buffer *buffer, int y,
char *message, ...);
const char *message, ...);
void (*infobar_printf) (struct t_weechat_plugin *plugin, int delay,
char *color_name, char *format, ...);
const char *color_name, const char *format, ...);
void (*infobar_remove) (int how_many);
void (*log_printf) (char *message, ...);
void (*log_printf) (const char *message, ...);
/* hooks */
struct t_hook *(*hook_command) (struct t_weechat_plugin *plugin,
char *command, char *description,
char *args, char *args_description,
char *completion,
const char *command, const char *description,
const char *args, const char *args_description,
const char *completion,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
@@ -315,89 +319,89 @@ struct t_weechat_plugin
int (*callback)(void *data),
void *callback_data);
struct t_hook *(*hook_connect) (struct t_weechat_plugin *plugin,
char *address, int port,
const char *address, int port,
int sock, int ipv6, void *gnutls_sess,
char *local_hostname,
const char *local_hostname,
int (*callback)(void *data, int status),
void *callback_data);
struct t_hook *(*hook_print) (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer,
char *tags, char *message,
const char *tags, const char *message,
int strip_colors,
int (*callback)(void *data,
struct t_gui_buffer *buffer,
time_t date,
int tags_count,
char **tags,
char *prefix, char *message),
const char *prefix, const char *message),
void *callback_data);
struct t_hook *(*hook_signal) (struct t_weechat_plugin *plugin,
char *signal,
int (*callback)(void *data, char *signal,
char *type_data,
const char *signal,
int (*callback)(void *data, const char *signal,
const char *type_data,
void *signal_data),
void *callback_data);
void (*hook_signal_send) (char *signal, char *type_data,
void (*hook_signal_send) (const char *signal, const char *type_data,
void *signal_data);
struct t_hook *(*hook_config) (struct t_weechat_plugin *plugin,
char *option,
int (*callback)(void *data, char *option,
char *value),
const char *option,
int (*callback)(void *data, const char *option,
const char *value),
void *callback_data);
struct t_hook *(*hook_completion) (struct t_weechat_plugin *plugin,
char *completion,
const char *completion,
int (*callback)(void *data,
char *completion,
const char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list),
void *callback_data);
struct t_hook *(*hook_modifier) (struct t_weechat_plugin *plugin,
char *modifier,
const char *modifier,
char *(*callback)(void *data,
char *modifier,
char *modifier_data,
char *string),
const char *modifier,
const char *modifier_data,
const char *string),
void *callback_data);
char *(*hook_modifier_exec) (struct t_weechat_plugin *plugin,
char *modifier, char *modifier_data,
char *string);
const char *modifier, const char *modifier_data,
const char *string);
void (*unhook) (struct t_hook *hook);
void (*unhook_all) (struct t_weechat_plugin *plugin);
/* buffers */
struct t_gui_buffer *(*buffer_new) (struct t_weechat_plugin *plugin,
char *category, char *name,
const char *category, const char *name,
int (*input_callback)(void *data,
struct t_gui_buffer *buffer,
char *input_data),
const char *input_data),
void *input_callback_data,
int (*close_callback)(void *data,
struct t_gui_buffer *buffer),
void *close_callback_data);
struct t_gui_buffer *(*buffer_search) (char *category, char *name);
struct t_gui_buffer *(*buffer_search) (const char *category, const char *name);
void (*buffer_clear) (struct t_gui_buffer *buffer);
void (*buffer_close) (struct t_gui_buffer *buffer, int switch_to_another);
char *(*buffer_get_string) (struct t_gui_buffer *buffer, char *property);
void *(*buffer_get_pointer) (struct t_gui_buffer *buffer, char *property);
void (*buffer_set) (struct t_gui_buffer *buffer, char *property,
char *value);
char *(*buffer_get_string) (struct t_gui_buffer *buffer, const char *property);
void *(*buffer_get_pointer) (struct t_gui_buffer *buffer, const char *property);
void (*buffer_set) (struct t_gui_buffer *buffer, const char *property,
const char *value);
/* nicklist */
struct t_gui_nick_group *(*nicklist_add_group) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *parent_group,
char *name, char *color,
const char *name, const char *color,
int visible);
struct t_gui_nick_group *(*nicklist_search_group) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *from_group,
char *name);
const char *name);
struct t_gui_nick *(*nicklist_add_nick) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *group,
char *name, char *color,
char prefix, char *prefix_color,
const char *name, const char *color,
char prefix, const char *prefix_color,
int visible);
struct t_gui_nick *(*nicklist_search_nick) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *from_group,
char *name);
const char *name);
void (*nicklist_remove_group) (struct t_gui_buffer *buffer,
struct t_gui_nick_group *group);
void (*nicklist_remove_nick) (struct t_gui_buffer *buffer,
@@ -405,62 +409,62 @@ struct t_weechat_plugin
void (*nicklist_remove_all) (struct t_gui_buffer *buffer);
/* bars */
struct t_gui_bar_item *(*bar_item_search) (char *name);
struct t_gui_bar_item *(*bar_item_search) (const char *name);
struct t_gui_bar_item *(*bar_item_new) (struct t_weechat_plugin *plugin,
char *name,
const char *name,
char *(*build_callback)(void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
int max_width, int max_height),
void *build_callback_data);
void (*bar_item_update) (char *name);
void (*bar_item_update) (const char *name);
void (*bar_item_remove) (struct t_gui_bar_item *item);
struct t_gui_bar *(*bar_search) (char *name);
struct t_gui_bar *(*bar_new) (struct t_weechat_plugin *plugin, char *name,
char *priority, char *type, char *condition,
char *position, char *filling, char *size,
char *size_max, char *color_fg,
char *color_bg, char *separator,
char *items);
int (*bar_set) (struct t_gui_bar *bar, char *property, char *value);
void (*bar_update) (char *name);
struct t_gui_bar *(*bar_search) (const char *name);
struct t_gui_bar *(*bar_new) (struct t_weechat_plugin *plugin, const char *name,
const char *priority, const char *type, const char *condition,
const char *position, const char *filling, const char *size,
const char *size_max, const char *color_fg,
const char *color_bg, const char *separator,
const char *items);
int (*bar_set) (struct t_gui_bar *bar, const char *property, const char *value);
void (*bar_update) (const char *name);
void (*bar_remove) (struct t_gui_bar *bar);
/* command */
void (*command) (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer, char *command);
struct t_gui_buffer *buffer, const char *command);
/* network */
int (*network_pass_proxy) (int sock, char *address, int port);
int (*network_pass_proxy) (int sock, const char *address, int port);
int (*network_connect_to) (int sock, unsigned long address, int port);
/* infos */
char *(*info_get) (struct t_weechat_plugin *plugin, char *info);
char *(*info_get) (struct t_weechat_plugin *plugin, const char *info);
/* infolists */
struct t_plugin_infolist *(*infolist_new) ();
struct t_plugin_infolist_item *(*infolist_new_item) (struct t_plugin_infolist *list);
struct t_plugin_infolist_var *(*infolist_new_var_integer) (struct t_plugin_infolist_item *item,
char *name,
const char *name,
int value);
struct t_plugin_infolist_var *(*infolist_new_var_string) (struct t_plugin_infolist_item *item,
char *name,
char *value);
const char *name,
const char *value);
struct t_plugin_infolist_var *(*infolist_new_var_pointer) (struct t_plugin_infolist_item *item,
char *name,
const char *name,
void *pointer);
struct t_plugin_infolist_var *(*infolist_new_var_time) (struct t_plugin_infolist_item *item,
char *name,
const char *name,
time_t time);
struct t_plugin_infolist *(*infolist_get) (char *name, void *pointer,
char *arguments);
struct t_plugin_infolist *(*infolist_get) (const char *name, void *pointer,
const char *arguments);
int (*infolist_next) (struct t_plugin_infolist *infolist);
int (*infolist_prev) (struct t_plugin_infolist *infolist);
char *(*infolist_fields) (struct t_plugin_infolist *infolist);
int (*infolist_integer) (struct t_plugin_infolist *infolist, char *var);
char *(*infolist_string) (struct t_plugin_infolist *infolist, char *var);
void *(*infolist_pointer) (struct t_plugin_infolist *infolist, char *var);
time_t (*infolist_time) (struct t_plugin_infolist *infolist, char *var);
int (*infolist_integer) (struct t_plugin_infolist *infolist, const char *var);
char *(*infolist_string) (struct t_plugin_infolist *infolist, const char *var);
void *(*infolist_pointer) (struct t_plugin_infolist *infolist, const char *var);
time_t (*infolist_time) (struct t_plugin_infolist *infolist, const char *var);
void (*infolist_free) (struct t_plugin_infolist *infolist);
/* WeeChat developers: ALWAYS add new functions at the end */
+2 -2
View File
@@ -39,7 +39,7 @@ int xfer_buffer_selected_line = 0;
*/
void
xfer_buffer_refresh (char *hotlist)
xfer_buffer_refresh (const char *hotlist)
{
struct t_xfer *ptr_xfer, *xfer_selected;
char str_color[256], suffix[32], status[64], date[128], *progress_bar;
@@ -256,7 +256,7 @@ xfer_buffer_refresh (char *hotlist)
int
xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
char *input_data)
const char *input_data)
{
struct t_xfer *xfer, *ptr_xfer, *next_xfer;
+1 -1
View File
@@ -23,7 +23,7 @@
extern struct t_gui_buffer *xfer_buffer;
extern int xfer_buffer_selected_line;
extern void xfer_buffer_refresh (char *hotlist);
extern void xfer_buffer_refresh (const char *hotlist);
extern void xfer_buffer_open ();
#endif /* xfer-buffer.h */
+3 -3
View File
@@ -37,7 +37,7 @@
*/
int
xfer_chat_send (struct t_xfer *xfer, char *buffer, int size_buf)
xfer_chat_send (struct t_xfer *xfer, const char *buffer, int size_buf)
{
if (!xfer)
return -1;
@@ -50,7 +50,7 @@ xfer_chat_send (struct t_xfer *xfer, char *buffer, int size_buf)
*/
void
xfer_chat_sendf (struct t_xfer *xfer, char *format, ...)
xfer_chat_sendf (struct t_xfer *xfer, const char *format, ...)
{
va_list args;
static char buffer[4096];
@@ -157,7 +157,7 @@ xfer_chat_recv_cb (void *arg_xfer)
int
xfer_chat_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
char *input_data)
const char *input_data)
{
struct t_xfer *xfer;
+1 -1
View File
@@ -42,7 +42,7 @@
*/
int
xfer_file_resume (struct t_xfer *xfer, char *filename)
xfer_file_resume (struct t_xfer *xfer, const char *filename)
{
struct stat st;
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef __WEECHAT_XFER_FILE_H
#define __WEECHAT_XFER_FILE_H 1
extern int xfer_file_resume (struct t_xfer *xfer, char *filename);
extern int xfer_file_resume (struct t_xfer *xfer, const char *filename);
extern void xfer_file_find_filename (struct t_xfer *xfer);
extern void xfer_file_calculate_speed (struct t_xfer *xfer, int ended);
+12 -12
View File
@@ -102,7 +102,7 @@ xfer_create_directories ()
*/
int
xfer_search_type (char *type)
xfer_search_type (const char *type)
{
int i;
@@ -122,7 +122,7 @@ xfer_search_type (char *type)
*/
int
xfer_search_protocol (char *protocol)
xfer_search_protocol (const char *protocol)
{
int i;
@@ -141,7 +141,7 @@ xfer_search_protocol (char *protocol)
*/
struct t_xfer *
xfer_search (char *plugin_name, char *plugin_id, enum t_xfer_type type,
xfer_search (const char *plugin_name, const char *plugin_id, enum t_xfer_type type,
enum t_xfer_status status, int port)
{
struct t_xfer *ptr_xfer;
@@ -294,7 +294,7 @@ xfer_port_in_use (int port)
*/
void
xfer_send_signal (struct t_xfer *xfer, char *signal)
xfer_send_signal (struct t_xfer *xfer, const char *signal)
{
struct t_plugin_infolist *infolist;
struct t_plugin_infolist_item *item;
@@ -408,11 +408,11 @@ xfer_alloc ()
*/
struct t_xfer *
xfer_new (char *plugin_name, char *plugin_id, enum t_xfer_type type,
enum t_xfer_protocol protocol, char *remote_nick, char *local_nick,
char *filename,
xfer_new (const char *plugin_name, const char *plugin_id, enum t_xfer_type type,
enum t_xfer_protocol protocol, const char *remote_nick, const char *local_nick,
const char *filename,
unsigned long size, unsigned long address, int port, int sock,
char *local_filename)
const char *local_filename)
{
struct t_xfer *new_xfer;
@@ -605,7 +605,7 @@ xfer_free (struct t_xfer *xfer)
*/
int
xfer_add_cb (void *data, char *signal, char *type_data, void *signal_data)
xfer_add_cb (void *data, const char *signal, const char *type_data, void *signal_data)
{
struct t_plugin_infolist *infolist;
char *plugin_name, *plugin_id, *str_type, *str_protocol;
@@ -953,7 +953,7 @@ xfer_add_cb (void *data, char *signal, char *type_data, void *signal_data)
*/
int
xfer_start_resume_cb (void *data, char *signal, char *type_data,
xfer_start_resume_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_plugin_infolist *infolist;
@@ -1030,7 +1030,7 @@ xfer_start_resume_cb (void *data, char *signal, char *type_data,
*/
int
xfer_accept_resume_cb (void *data, char *signal, char *type_data,
xfer_accept_resume_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
struct t_plugin_infolist *infolist;
@@ -1167,7 +1167,7 @@ xfer_print_log ()
*/
int
xfer_debug_dump_cb (void *data, char *signal, char *type_data,
xfer_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+1 -1
View File
@@ -156,7 +156,7 @@ extern int xfer_debug;
extern struct t_xfer *xfer_search_by_number (int number);
extern void xfer_close (struct t_xfer *xfer, enum t_xfer_status status);
extern void xfer_send_signal (struct t_xfer *xfer, char *signal);
extern void xfer_send_signal (struct t_xfer *xfer, const char *signal);
extern void xfer_free (struct t_xfer *xfer);
#endif /* xfer.h */