core: fix some styles

v2.8-utf8proc
Sébastien Helleu 2018-01-07 09:11:45 +01:00
parent 91f792416b
commit 7ee88fb46c
58 changed files with 283 additions and 282 deletions

View File

@ -646,8 +646,8 @@ arraylist_clear (struct t_arraylist *arraylist)
arraylist->size_alloc = 0;
if (arraylist->size_alloc_min > 0)
{
arraylist->data = calloc(arraylist->size_alloc_min,
sizeof (*arraylist->data));
arraylist->data = calloc (arraylist->size_alloc_min,
sizeof (*arraylist->data));
if (!arraylist->data)
return 0;
arraylist->size_alloc = arraylist->size_alloc_min;

View File

@ -999,7 +999,7 @@ COMMAND_CALLBACK(buffer)
/* close buffer */
if (string_strcasecmp (argv[1], "close") == 0)
{
weechat_buffer = gui_buffer_search_main();
weechat_buffer = gui_buffer_search_main ();
if (argc < 3)
{
@ -5599,7 +5599,7 @@ command_set_display_option_list (const char *message, const char *search,
* if we are displaying only changed options, skip options plugins.*
* because they are all "changed" (default value is always empty string)
*/
if (display_only_changed && strcmp(ptr_config->name, "plugins") == 0)
if (display_only_changed && (strcmp (ptr_config->name, "plugins") == 0))
continue;
for (ptr_section = ptr_config->sections; ptr_section;
ptr_section = ptr_section->next_section)
@ -6266,7 +6266,7 @@ COMMAND_CALLBACK(uptime)
if ((argc >= 2) && (string_strcasecmp (argv[1], "-o") == 0))
{
snprintf (str_first_start, sizeof(str_first_start),
snprintf (str_first_start, sizeof (str_first_start),
"%s", ctime (&weechat_first_start_time));
if (str_first_start[0])
str_first_start[strlen (str_first_start) - 1] = '\0';
@ -6342,20 +6342,20 @@ command_version_display (struct t_gui_buffer *buffer,
if (send_to_buffer_as_input && !translated_string)
{
snprintf (str_first_start, sizeof(str_first_start),
snprintf (str_first_start, sizeof (str_first_start),
"%s", ctime (&weechat_first_start_time));
if (str_first_start[0])
str_first_start[strlen (str_first_start) - 1] = '\0';
snprintf (str_last_start, sizeof(str_last_start),
snprintf (str_last_start, sizeof (str_last_start),
"%s", ctime (&weechat_last_start_time));
if (str_last_start[0])
str_last_start[strlen (str_last_start) - 1] = '\0';
}
else
{
snprintf (str_first_start, sizeof(str_first_start),
snprintf (str_first_start, sizeof (str_first_start),
"%s", util_get_time_string (&weechat_first_start_time));
snprintf (str_last_start, sizeof(str_last_start),
snprintf (str_last_start, sizeof (str_last_start),
"%s", util_get_time_string (&weechat_last_start_time));
}
}
@ -8291,9 +8291,9 @@ command_startup (int plugins_loaded)
{
if (plugins_loaded)
{
command_exec_list(CONFIG_STRING(config_startup_command_after_plugins));
command_exec_list(weechat_startup_commands);
command_exec_list (CONFIG_STRING(config_startup_command_after_plugins));
command_exec_list (weechat_startup_commands);
}
else
command_exec_list(CONFIG_STRING(config_startup_command_before_plugins));
command_exec_list (CONFIG_STRING(config_startup_command_before_plugins));
}

View File

@ -616,7 +616,7 @@ completion_list_add_commands_cb (const void *pointer, void *data,
{
if (pos)
{
snprintf (str_command, sizeof(str_command),
snprintf (str_command, sizeof (str_command),
"%s%s",
pos,
HOOK_COMMAND(ptr_hook, command));
@ -1000,7 +1000,7 @@ completion_list_add_plugins_commands_cb (const void *pointer, void *data,
{
if (pos)
{
snprintf (str_command, sizeof(str_command),
snprintf (str_command, sizeof (str_command),
"%s%s",
pos,
HOOK_COMMAND(ptr_hook, command));
@ -1017,7 +1017,7 @@ completion_list_add_plugins_commands_cb (const void *pointer, void *data,
}
}
string_free_split(argv);
string_free_split (argv);
return WEECHAT_RC_OK;
}
@ -1281,7 +1281,7 @@ completion_list_add_weechat_commands_cb (const void *pointer, void *data,
{
if (pos)
{
snprintf (str_command, sizeof(str_command),
snprintf (str_command, sizeof (str_command),
"%s%s",
pos,
HOOK_COMMAND(ptr_hook, command));

View File

@ -1947,7 +1947,7 @@ int config_file_option_has_changed (struct t_config_option *option)
case CONFIG_OPTION_TYPE_INTEGER:
return CONFIG_INTEGER(option) != CONFIG_INTEGER_DEFAULT(option);
case CONFIG_OPTION_TYPE_STRING:
return strcmp(CONFIG_STRING(option), CONFIG_STRING_DEFAULT(option)) != 0;
return strcmp (CONFIG_STRING(option), CONFIG_STRING_DEFAULT(option)) != 0;
case CONFIG_OPTION_TYPE_COLOR:
return CONFIG_COLOR(option) != CONFIG_COLOR_DEFAULT(option);
case CONFIG_NUM_OPTION_TYPES:
@ -2668,7 +2668,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
{
undefined_value = 0;
/* remove simple or double quotes and spaces at the end */
if (strlen(pos) > 1)
if (strlen (pos) > 1)
{
pos2 = pos + strlen (pos) - 1;
while ((pos2 > pos) && (pos2[0] == ' '))
@ -3203,11 +3203,11 @@ config_file_hdata_config_option_cb (const void *pointer, void *data,
*/
int
config_file_add_option_to_infolist(struct t_infolist *infolist,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option,
const char *option_name)
config_file_add_option_to_infolist (struct t_infolist *infolist,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option,
const char *option_name)
{
char *option_full_name, *value, *string_values;
struct t_config_option *ptr_parent_option;

View File

@ -557,7 +557,7 @@ hdata_move (struct t_hdata *hdata, void *pointer, int count)
return NULL;
ptr_var = (count < 0) ? hdata->var_prev : hdata->var_next;
abs_count = abs(count);
abs_count = abs (count);
for (i = 0; i < abs_count; i++)
{

View File

@ -1062,9 +1062,9 @@ hook_timer_init (struct t_hook *hook)
gettimeofday (&HOOK_TIMER(hook, last_exec), NULL);
time_now = time (NULL);
local_time = localtime(&time_now);
local_time = localtime (&time_now);
local_hour = local_time->tm_hour;
gm_time = gmtime(&time_now);
gm_time = gmtime (&time_now);
gm_hour = gm_time->tm_hour;
if ((local_time->tm_year > gm_time->tm_year)
|| (local_time->tm_mon > gm_time->tm_mon)
@ -3680,7 +3680,7 @@ hook_set (struct t_hook *hook, const char *property, const char *value)
if (string_strcasecmp (property, "subplugin") == 0)
{
if (hook->subplugin)
free(hook->subplugin);
free (hook->subplugin);
hook->subplugin = strdup (value);
}
else if (string_strcasecmp (property, "stdin") == 0)

View File

@ -273,7 +273,7 @@ log_crash_rename ()
local_time->tm_year + 1900,
local_time->tm_mon + 1,
local_time->tm_mday,
getpid());
getpid ());
if (rename (old_name, new_name) == 0)
{
string_fprintf (stderr, "*** Full crash dump was saved to %s file.\n",

View File

@ -160,7 +160,7 @@ network_end ()
if (!weechat_no_gnutls)
{
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
gnutls_global_deinit ();
}
#endif /* HAVE_GNUTLS */
network_init_gnutls_ok = 0;
@ -321,7 +321,7 @@ network_resolve (const char *hostname, char *ip, int *version)
if (!res)
return 0;
if (getnameinfo (res->ai_addr, res->ai_addrlen, ipbuffer, sizeof(ipbuffer),
if (getnameinfo (res->ai_addr, res->ai_addrlen, ipbuffer, sizeof (ipbuffer),
NULL, 0, NI_NUMERICHOST) != 0)
{
freeaddrinfo (res);
@ -494,9 +494,9 @@ network_pass_socks5proxy (struct t_proxy *proxy, int sock, const char *address,
}
/* authentication successful then giving address/port to connect */
addr_len = strlen(address);
addr_len = strlen (address);
addr_buffer_len = 4 + 1 + addr_len + 2;
addr_buffer = malloc (addr_buffer_len * sizeof(*addr_buffer));
addr_buffer = malloc (addr_buffer_len * sizeof (*addr_buffer));
if (!addr_buffer)
return 0;
addr_buffer[0] = 5; /* version 5 */
@ -984,7 +984,7 @@ network_connect_child (struct t_hook *hook_connect)
if (tmp_num_groups >= retry)
{
/* shuffle while adding */
rand_num = tmp_host + (rand() % ((i + 1) - tmp_host));
rand_num = tmp_host + (rand () % ((i + 1) - tmp_host));
if (rand_num == i)
res_reorder[i++] = ptr_res;
else
@ -1015,7 +1015,7 @@ network_connect_child (struct t_hook *hook_connect)
if (tmp_num_groups < retry)
{
/* shuffle while adding */
rand_num = tmp_host + (rand() % ((i + 1) - tmp_host));
rand_num = tmp_host + (rand () % ((i + 1) - tmp_host));
if (rand_num == i)
res_reorder[i++] = ptr_res;
else
@ -1208,7 +1208,7 @@ network_connect_child (struct t_hook *hook_connect)
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof (sock));
memcpy(CMSG_DATA(cmsg), &sock, sizeof (sock));
memcpy (CMSG_DATA(cmsg), &sock, sizeof (sock));
msg.msg_controllen = cmsg->cmsg_len;
num_written = sendmsg (HOOK_CONNECT(hook_connect, child_send), &msg, 0);
(void) num_written;
@ -1470,7 +1470,7 @@ network_connect_child_read_cb (const void *pointer, void *data, int fd)
&& cmsg->cmsg_type == SCM_RIGHTS
&& cmsg->cmsg_len >= sizeof (sock))
{
memcpy(&sock, CMSG_DATA(cmsg), sizeof (sock));
memcpy (&sock, CMSG_DATA(cmsg), sizeof (sock));
}
}
}

View File

@ -2175,7 +2175,7 @@ string_split_command (const char *command, char separator)
nb_substr = 1;
ptr = command;
while ((p = strchr(ptr, separator)) != NULL)
while ((p = strchr (ptr, separator)) != NULL)
{
nb_substr++;
ptr = ++p;
@ -2185,7 +2185,7 @@ string_split_command (const char *command, char separator)
if (!array)
return NULL;
buffer = malloc (strlen(command) + 1);
buffer = malloc (strlen (command) + 1);
if (!buffer)
{
free (array);
@ -2195,7 +2195,7 @@ string_split_command (const char *command, char separator)
ptr = command;
str_idx = 0;
arr_idx = 0;
while(*ptr != '\0')
while (*ptr != '\0')
{
type = 0;
if (*ptr == separator)
@ -2235,7 +2235,7 @@ string_split_command (const char *command, char separator)
free (buffer);
array2 = realloc (array, (arr_idx + 1) * sizeof(array[0]));
array2 = realloc (array, (arr_idx + 1) * sizeof (array[0]));
if (!array2)
{
if (array)
@ -2288,7 +2288,7 @@ string_iconv (int from_utf8, const char *from_code, const char *to_code,
#ifdef HAVE_ICONV
if (from_code && from_code[0] && to_code && to_code[0]
&& (string_strcasecmp(from_code, to_code) != 0))
&& (string_strcasecmp (from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))

View File

@ -871,7 +871,7 @@ weeurl_get_mask_value (struct t_url_constant *constants,
{
for (i = 0; i < num_items; i++)
{
item = string_remove_quotes(items[i], "'\"");
item = string_remove_quotes (items[i], "'\"");
if (item)
{
index = weeurl_search_constant (constants, item);
@ -1115,7 +1115,7 @@ weeurl_download (const char *url, struct t_hashtable *options)
goto end;
}
curl = curl_easy_init();
curl = curl_easy_init ();
if (!curl)
{
rc = 3;

View File

@ -138,7 +138,7 @@ utf8_is_valid (const char *string, int length, char **error)
{
goto invalid;
}
code_point = utf8_char_int(string);
code_point = utf8_char_int (string);
if ((code_point < 0x10000) || (code_point > 0x1FFFFF))
goto invalid;
string += 4;
@ -433,7 +433,7 @@ utf8_char_size (const char *string)
/*
* Gets length of an UTF-8 string in number of chars (not bytes).
* Result is <= strlen(string).
* Result is <= strlen (string).
*
* Returns length of string (>= 0).
*/

View File

@ -359,7 +359,7 @@ util_catch_signal (int signum, void (*handler)(int))
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
act.sa_handler = handler;
sigaction(signum, &act, NULL);
sigaction (signum, &act, NULL);
}
/*
@ -562,7 +562,7 @@ util_search_full_lib_name_ext (const char *filename, const char *extension,
{
length = strlen (extra_libdir) + strlen (name_with_ext) +
strlen (plugins_dir) + 16;
final_name = malloc(length);
final_name = malloc (length);
if (!final_name)
{
free (name_with_ext);
@ -719,7 +719,7 @@ util_file_get_content (const char *filename)
if (!buffer2)
goto error;
buffer = buffer2;
count = fread (&buffer[fp], sizeof(char), 1024, f);
count = fread (&buffer[fp], sizeof (char), 1024, f);
if (count <= 0)
goto error;
fp += count;
@ -739,7 +739,7 @@ error:
if (buffer)
free (buffer);
if (f)
fclose(f);
fclose (f);
return NULL;
}

View File

@ -159,7 +159,7 @@ weechat_display_usage ()
"(see /help upgrade in WeeChat)\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin (see man weechat)\n"));
string_fprintf(stdout, "\n");
string_fprintf (stdout, "\n");
}
/*
@ -594,7 +594,7 @@ weechat_shutdown (int return_code, int crash)
free (weechat_local_charset);
if (crash)
abort();
abort ();
else if (return_code >= 0)
exit (return_code);
}

View File

@ -1497,7 +1497,7 @@ gui_color_init_weechat ()
void
gui_color_alloc ()
{
if (has_colors())
if (has_colors ())
{
start_color ();
use_default_colors ();

View File

@ -265,13 +265,13 @@ gui_main_handle_quit_signals ()
switch (weechat_quit_signal)
{
case SIGHUP:
snprintf (str_signal, sizeof(str_signal), "SIGHUP");
snprintf (str_signal, sizeof (str_signal), "SIGHUP");
break;
case SIGQUIT:
snprintf (str_signal, sizeof(str_signal), "SIGQUIT");
snprintf (str_signal, sizeof (str_signal), "SIGQUIT");
break;
case SIGTERM:
snprintf (str_signal, sizeof(str_signal), "SIGTERM");
snprintf (str_signal, sizeof (str_signal), "SIGTERM");
break;
default:
str_signal[0] = '\0';
@ -280,9 +280,9 @@ gui_main_handle_quit_signals ()
if (str_signal[0])
{
snprintf (str_weechat_signal, sizeof(str_weechat_signal),
snprintf (str_weechat_signal, sizeof (str_weechat_signal),
"signal_%s", str_signal);
string_tolower(str_weechat_signal);
string_tolower (str_weechat_signal);
rc = hook_signal_send (str_weechat_signal,
WEECHAT_HOOK_SIGNAL_STRING, NULL);
if ((rc != WEECHAT_RC_OK_EAT) && !weechat_quit)

View File

@ -2565,7 +2565,7 @@ gui_window_term_display_infos ()
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Terminal infos:"));
gui_chat_printf (NULL, _(" TERM='%s', size: %dx%d"),
getenv("TERM"), gui_term_cols, gui_term_lines);
getenv ("TERM"), gui_term_cols, gui_term_lines);
}
/*

View File

@ -828,7 +828,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
total_items = 0;
max_length = 1;
max_length_screen = 1;
split_items = malloc(bar_window->items_count * sizeof(*split_items));
split_items = malloc (bar_window->items_count * sizeof (*split_items));
for (i = 0; i < bar_window->items_count; i++)
{
if (bar_window->items_subcount[i] > 0)

View File

@ -116,9 +116,9 @@ gui_chat_prefix_build ()
ptr_prefix = CONFIG_STRING(config_look_prefix[i]);
pos_color = strstr (ptr_prefix, "${");
snprintf(prefix, sizeof (prefix), "%s%s\t",
(ptr_prefix[0] && (!pos_color || (pos_color > ptr_prefix))) ? GUI_COLOR(prefix_color[i]) : "",
ptr_prefix);
snprintf (prefix, sizeof (prefix), "%s%s\t",
(ptr_prefix[0] && (!pos_color || (pos_color > ptr_prefix))) ? GUI_COLOR(prefix_color[i]) : "",
ptr_prefix);
if (pos_color)
gui_chat_prefix[i] = eval_expression (prefix, NULL, NULL, NULL);

View File

@ -364,7 +364,7 @@ gui_input_clipboard_copy (const char *buffer, int size)
if (gui_input_clipboard != NULL)
free (gui_input_clipboard);
gui_input_clipboard = malloc((size + 1) * sizeof(*gui_input_clipboard));
gui_input_clipboard = malloc ((size + 1) * sizeof (*gui_input_clipboard));
if (gui_input_clipboard)
{

View File

@ -1920,22 +1920,22 @@ gui_key_hdata_key_cb (const void *pointer, void *data,
"gui_keys%s%s",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]);
hdata_new_list(hdata, str_list, &gui_keys[i], 0);
hdata_new_list (hdata, str_list, &gui_keys[i], 0);
snprintf (str_list, sizeof (str_list),
"last_gui_key%s%s",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]);
hdata_new_list(hdata, str_list, &last_gui_key[i], 0);
hdata_new_list (hdata, str_list, &last_gui_key[i], 0);
snprintf (str_list, sizeof (str_list),
"gui_default_keys%s%s",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]);
hdata_new_list(hdata, str_list, &gui_default_keys[i], 0);
hdata_new_list (hdata, str_list, &gui_default_keys[i], 0);
snprintf (str_list, sizeof (str_list),
"last_gui_default_key%s%s",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]);
hdata_new_list(hdata, str_list, &last_gui_default_key[i], 0);
hdata_new_list (hdata, str_list, &last_gui_default_key[i], 0);
}
}
return hdata;

View File

@ -219,7 +219,7 @@ gui_nicklist_search_group_internal (struct t_gui_buffer *buffer,
while (ptr_group)
{
ptr_name = (skip_digits) ?
gui_nicklist_get_group_start(ptr_group->name) : ptr_group->name;
gui_nicklist_get_group_start (ptr_group->name) : ptr_group->name;
if (strcmp (ptr_name, name) == 0)
return ptr_group;
ptr_group = ptr_group->next_group;

View File

@ -312,7 +312,7 @@ alias_run_command (struct t_gui_buffer **buffer, const char *command)
struct t_gui_buffer *old_current_buffer, *new_current_buffer;
/* save current buffer pointer */
old_current_buffer = weechat_current_buffer();
old_current_buffer = weechat_current_buffer ();
/* execute command */
string = weechat_buffer_string_replace_local_var (*buffer, command);
@ -322,7 +322,7 @@ alias_run_command (struct t_gui_buffer **buffer, const char *command)
free (string);
/* get new current buffer */
new_current_buffer = weechat_current_buffer();
new_current_buffer = weechat_current_buffer ();
/*
* if current buffer was changed by command, then we'll use this one for
@ -415,7 +415,7 @@ alias_cb (const void *pointer, void *data,
}
else
{
alias_command = malloc (1 + strlen((args_replaced) ? args_replaced : *ptr_cmd) + 1);
alias_command = malloc (1 + strlen ((args_replaced) ? args_replaced : *ptr_cmd) + 1);
if (alias_command)
{
strcpy (alias_command, "/");

View File

@ -158,7 +158,7 @@ weechat_aspell_command_speller_list_dicts ()
enchant_broker_list_dicts (broker, weechat_aspell_enchant_dict_describe_cb,
NULL);
#else
config = new_aspell_config();
config = new_aspell_config ();
list = get_aspell_dict_info_list (config);
elements = aspell_dict_info_list_elements (list);

View File

@ -161,7 +161,7 @@ weechat_aspell_speller_new (const char *lang)
}
#else
/* create a speller instance for the newly created cell */
config = new_aspell_config();
config = new_aspell_config ();
aspell_config_replace (config, "lang", lang);
#endif /* USE_ENCHANT */

View File

@ -331,8 +331,8 @@ buflist_mouse_init ()
&buflist_focus_cb, NULL, NULL);
}
weechat_hook_hsignal(BUFLIST_MOUSE_HSIGNAL,
&buflist_hsignal_cb, NULL, NULL);
weechat_hook_hsignal (BUFLIST_MOUSE_HSIGNAL,
&buflist_hsignal_cb, NULL, NULL);
return 1;
}

View File

@ -71,8 +71,8 @@ buflist_add_bar ()
*/
void
buflist_buffer_get_irc_pointers(struct t_gui_buffer *buffer,
void **irc_server, void **irc_channel)
buflist_buffer_get_irc_pointers (struct t_gui_buffer *buffer,
void **irc_server, void **irc_channel)
{
const char *ptr_server_name, *ptr_channel_name, *ptr_name;
struct t_hdata *hdata_irc_server, *hdata_irc_channel;

View File

@ -35,8 +35,9 @@ extern struct t_hdata *buflist_hdata_bar_item;
extern struct t_hdata *buflist_hdata_bar_window;
extern void buflist_add_bar ();
extern void buflist_buffer_get_irc_pointers(struct t_gui_buffer *buffer,
void **irc_server, void **irc_channel);
extern void buflist_buffer_get_irc_pointers (struct t_gui_buffer *buffer,
void **irc_server,
void **irc_channel);
extern struct t_arraylist *buflist_sort_buffers ();
#endif /* WEECHAT_PLUGIN_BUFLIST_H */

View File

@ -50,7 +50,7 @@ fifo_config_change_file_enabled (const void *pointer, void *data,
fifo_remove ();
if (weechat_config_boolean (fifo_config_file_enabled))
fifo_create();
fifo_create ();
}
/*

View File

@ -324,8 +324,8 @@ fset_mouse_init ()
weechat_hook_focus ("chat", &fset_mouse_focus_cb, NULL, NULL);
weechat_hook_hsignal(FSET_MOUSE_HSIGNAL,
&fset_mouse_hsignal_cb, NULL, NULL);
weechat_hook_hsignal (FSET_MOUSE_HSIGNAL,
&fset_mouse_hsignal_cb, NULL, NULL);
weechat_hashtable_set (
keys,

View File

@ -280,7 +280,7 @@ irc_bar_item_buffer_modes (const void *pointer, void *data,
modes_without_args = NULL;
if (!irc_config_display_channel_modes_arguments (channel->modes))
{
pos_space = strchr(channel->modes, ' ');
pos_space = strchr (channel->modes, ' ');
if (pos_space)
{
modes_without_args = weechat_strndup (

View File

@ -356,7 +356,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
}
/* set highlights settings on channel buffer */
weechat_buffer_set(
weechat_buffer_set (
ptr_buffer,
"highlight_words_add",
(channel_type == IRC_CHANNEL_TYPE_CHANNEL) ?
@ -711,8 +711,8 @@ irc_channel_check_whox (struct t_irc_server *server,
}
else
{
irc_channel_remove_account(server, channel);
irc_channel_remove_away(server, channel);
irc_channel_remove_account (server, channel);
irc_channel_remove_away (server, channel);
}
}
}

View File

@ -2954,7 +2954,7 @@ IRC_COMMAND_CALLBACK(list)
REG_EXTENDED | REG_ICASE | REG_NOSUB)) != 0)
{
regerror (ret, ptr_server->cmd_list_regexp,
buf, sizeof(buf));
buf, sizeof (buf));
weechat_printf (
ptr_server->buffer,
_("%s%s: \"%s\" is not a valid regular expression "

View File

@ -224,7 +224,7 @@ irc_config_compute_nick_colors ()
}
/* if colors are displayed for nicks in nicklist, refresh them */
if (weechat_config_boolean(irc_config_look_color_nicks_in_nicklist))
if (weechat_config_boolean (irc_config_look_color_nicks_in_nicklist))
irc_nick_nicklist_set_color_all ();
}

View File

@ -320,7 +320,7 @@ irc_nick_get_color_for_nicklist (struct t_irc_server *server,
if (nick->away)
return nick_color_away;
if (weechat_config_boolean(irc_config_look_color_nicks_in_nicklist))
if (weechat_config_boolean (irc_config_look_color_nicks_in_nicklist))
{
if (irc_server_strcasecmp (server, nick->name, server->nick) == 0)
return nick_color_self;

View File

@ -508,7 +508,7 @@ IRC_PROTOCOL_CALLBACK(cap)
snprintf (str_msg_auth, sizeof (str_msg_auth),
"AUTHENTICATE %s",
irc_sasl_mechanism_string[sasl_mechanism]);
weechat_string_toupper(str_msg_auth);
weechat_string_toupper (str_msg_auth);
irc_server_sendf (server, 0, NULL, str_msg_auth);
if (server->hook_timer_sasl)
weechat_unhook (server->hook_timer_sasl);
@ -1348,7 +1348,7 @@ IRC_PROTOCOL_CALLBACK(nick)
address),
_("%s%s%s%s is now known as %s%s%s"),
weechat_prefix ("network"),
weechat_config_boolean(irc_config_look_color_nicks_in_server_messages) ?
weechat_config_boolean (irc_config_look_color_nicks_in_server_messages) ?
old_color : IRC_COLOR_CHAT_NICK,
nick,
IRC_COLOR_RESET,
@ -4502,7 +4502,7 @@ IRC_PROTOCOL_CALLBACK(354)
date,
irc_protocol_tags (command, "irc_numeric", NULL, NULL),
"%s%s[%s%s%s] %s%s %s%s%s%s%s%s(%s%s@%s%s)%s %s%s%s%s(%s)",
weechat_prefix("network"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_CHAT_CHANNEL,
argv[3],

View File

@ -686,7 +686,7 @@ irc_redirect_message_add (struct t_irc_redirect *redirect, const char *message,
/* add message to output */
if (redirect->output)
{
redirect->output_size += strlen("\n") + strlen (message);
redirect->output_size += strlen ("\n") + strlen (message);
output2 = realloc (redirect->output, redirect->output_size);
if (!output2)
{

View File

@ -493,7 +493,7 @@ irc_sasl_mechanism_dh_blowfish (const char *data_base64,
length_answer = 2 + length_key + length_username + length_password;
answer = malloc (length_answer);
ptr_answer = answer;
*((unsigned int *)ptr_answer) = htons(length_key);
*((unsigned int *)ptr_answer) = htons (length_key);
ptr_answer += 2;
memcpy (ptr_answer, public_bin, length_key);
ptr_answer += length_key;
@ -554,7 +554,7 @@ irc_sasl_mechanism_dh_aes (const char *data_base64,
secret_bin = NULL;
public_bin = NULL;
if (irc_sasl_dh(data_base64, &public_bin, &secret_bin, &length_key) == 0)
if (irc_sasl_dh (data_base64, &public_bin, &secret_bin, &length_key) == 0)
goto aesend;
/* Select cipher algorithm: key length * 8 = cipher bit size */
@ -596,7 +596,7 @@ irc_sasl_mechanism_dh_aes (const char *data_base64,
goto aesend;
if (gcry_cipher_setkey (gcrypt_handle, secret_bin, length_key) != 0)
goto aesend;
if (gcry_cipher_setiv (gcrypt_handle, iv, sizeof(iv)) != 0)
if (gcry_cipher_setiv (gcrypt_handle, iv, sizeof (iv)) != 0)
goto aesend;
if (gcry_cipher_encrypt (gcrypt_handle,
userpass_crypted, length_userpass,
@ -615,7 +615,7 @@ irc_sasl_mechanism_dh_aes (const char *data_base64,
length_answer = 2 + length_key + sizeof (iv) + length_userpass;
answer = malloc (length_answer);
ptr_answer = answer;
*((unsigned int *)ptr_answer) = htons(length_key);
*((unsigned int *)ptr_answer) = htons (length_key);
ptr_answer += 2;
memcpy (ptr_answer, public_bin, length_key);
ptr_answer += length_key;

View File

@ -27,21 +27,21 @@
class WeechatJsV8
{
public:
WeechatJsV8(void);
~WeechatJsV8(void);
WeechatJsV8 (void);
~WeechatJsV8 (void);
bool load(v8::Handle<v8::String>);
bool load(const char *);
bool load (v8::Handle<v8::String>);
bool load (const char *);
bool execScript(void);
bool functionExists(const char *);
v8::Handle<v8::Value> execFunction(const char *,
int argc, v8::Handle<v8::Value> *);
bool execScript (void);
bool functionExists (const char *);
v8::Handle<v8::Value> execFunction (const char *,
int argc, v8::Handle<v8::Value> *);
void addGlobal(v8::Handle<v8::String>, v8::Handle<v8::Template>);
void addGlobal(const char *, v8::Handle<v8::Template>);
void addGlobal (v8::Handle<v8::String>, v8::Handle<v8::Template>);
void addGlobal (const char *, v8::Handle<v8::Template>);
void loadLibs(void);
void loadLibs (void);
private:
v8::HandleScope handle_scope;

View File

@ -773,15 +773,15 @@ logger_list ()
}
weechat_printf (NULL,
" %s[%s%d%s]%s (%s) %s%s%s: %s%s%s%s",
weechat_color("chat_delimiters"),
weechat_color("chat"),
weechat_color ("chat_delimiters"),
weechat_color ("chat"),
weechat_infolist_integer (ptr_infolist, "number"),
weechat_color("chat_delimiters"),
weechat_color("chat"),
weechat_color ("chat_delimiters"),
weechat_color ("chat"),
weechat_infolist_string (ptr_infolist, "plugin_name"),
weechat_color("chat_buffer"),
weechat_color ("chat_buffer"),
weechat_infolist_string (ptr_infolist, "name"),
weechat_color("chat"),
weechat_color ("chat"),
status,
(ptr_logger_buffer) ? " (" : "",
(ptr_logger_buffer) ?

View File

@ -405,7 +405,7 @@ weechat_lua_add_constant (lua_State *L, struct t_lua_const *ptr_const)
#else
lua_pushnumber (L, ptr_const->int_value);
#endif /* LUA_VERSION_NUM >= 503 */
lua_settable(L, -3);
lua_settable (L, -3);
}
/*
@ -415,7 +415,7 @@ weechat_lua_add_constant (lua_State *L, struct t_lua_const *ptr_const)
int
weechat_lua_newindex (lua_State *L)
{
luaL_error(L, "Error: read-only constant");
luaL_error (L, "Error: read-only constant");
return 0;
}
@ -514,7 +514,7 @@ weechat_lua_load (const char *filename, const char *code)
lua_current_script = NULL;
lua_registered_script = NULL;
lua_current_interpreter = luaL_newstate();
lua_current_interpreter = luaL_newstate ();
if (lua_current_interpreter == NULL)
{

View File

@ -55,8 +55,8 @@ extern void *weechat_lua_exec (struct t_plugin_script *script,
int ret_type,
const char *function,
const char *format, void **argv);
extern void weechat_lua_register_lib(lua_State *L, const char *libname,
const luaL_Reg *lua_api_funcs,
struct t_lua_const lua_api_consts[]);
extern void weechat_lua_register_lib (lua_State *L, const char *libname,
const luaL_Reg *lua_api_funcs,
struct t_lua_const lua_api_consts[]);
#endif /* WEECHAT_PLUGIN_LUA_H */

View File

@ -351,14 +351,14 @@ weechat_perl_exec (struct t_plugin_script *script,
switch (format[i])
{
case 's': /* string */
XPUSHs(sv_2mortal(newSVpv((char *)argv[i], 0)));
XPUSHs (sv_2mortal(newSVpv((char *)argv[i], 0)));
break;
case 'i': /* integer */
XPUSHs(sv_2mortal(newSViv(*((int *)argv[i]))));
XPUSHs (sv_2mortal(newSViv(*((int *)argv[i]))));
break;
case 'h': /* hash */
hash = weechat_perl_hashtable_to_hash (argv[i]);
XPUSHs(sv_2mortal(newRV_inc((SV *)hash)));
XPUSHs (sv_2mortal(newRV_inc((SV *)hash)));
break;
}
}
@ -400,7 +400,7 @@ weechat_perl_exec (struct t_plugin_script *script,
{
if (ret_type == WEECHAT_SCRIPT_EXEC_STRING)
{
ret_s = newSVsv(POPs);
ret_s = newSVsv (POPs);
ret_value = strdup (SvPV_nolen (ret_s));
SvREFCNT_dec (ret_s);
}
@ -520,7 +520,7 @@ weechat_perl_load (const char *filename, const char *code)
perl_registered_script = NULL;
#ifdef MULTIPLICITY
perl_current_interpreter = perl_alloc();
perl_current_interpreter = perl_alloc ();
if (!perl_current_interpreter)
{
@ -584,7 +584,7 @@ weechat_perl_load (const char *filename, const char *code)
weechat_printf (NULL,
weechat_gettext ("%s%s: error: %s"),
weechat_prefix ("error"), PERL_PLUGIN_NAME,
SvPV_nolen(ERRSV));
SvPV_nolen (ERRSV));
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
perl_free (perl_current_interpreter);

View File

@ -549,8 +549,8 @@ weechat_php_exec (struct t_plugin_script *script, int ret_type,
/* Invoke func */
ret_value = NULL;
memset(&fci, 0, sizeof (zend_fcall_info));
memset(&fci_cache, 0, sizeof (zend_fcall_info_cache));
memset (&fci, 0, sizeof (zend_fcall_info));
memset (&fci_cache, 0, sizeof (zend_fcall_info_cache));
zfunc = weechat_php_func_map_get (function);
if (zfunc && zend_fcall_info_init (zfunc, 0, &fci, &fci_cache, NULL, NULL) == SUCCESS)

View File

@ -423,7 +423,7 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
gui_chat_printf (NULL,
_("%sError: unable to load plugin \"%s\": %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
filename, dlerror());
filename, dlerror ());
gui_chat_printf (NULL,
_("%sIf you're trying to load a script and not a C "
"plugin, try command to load scripts (/perl, "

View File

@ -2255,7 +2255,7 @@ weechat_python_api_hook_fd_cb (const void *pointer, void *data, int fd)
if (ptr_function && ptr_function[0])
{
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = PyLong_FromLong((long)fd);
func_argv[1] = PyLong_FromLong ((long)fd);
rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
@ -2347,7 +2347,7 @@ weechat_python_api_hook_process_cb (const void *pointer, void *data,
{
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = PyLong_FromLong((long)return_code);
func_argv[2] = PyLong_FromLong ((long)return_code);
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
@ -2453,9 +2453,9 @@ weechat_python_api_hook_connect_cb (const void *pointer, void *data,
if (ptr_function && ptr_function[0])
{
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = PyLong_FromLong((long)status);
func_argv[2] = PyLong_FromLong((long)gnutls_rc);
func_argv[3] = PyLong_FromLong((long)sock);
func_argv[1] = PyLong_FromLong ((long)status);
func_argv[2] = PyLong_FromLong ((long)gnutls_rc);
func_argv[3] = PyLong_FromLong ((long)sock);
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
@ -2559,8 +2559,8 @@ weechat_python_api_hook_print_cb (const void *pointer, void *data,
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = PyLong_FromLong((long)displayed);
func_argv[5] = PyLong_FromLong((long)highlight);
func_argv[4] = PyLong_FromLong ((long)displayed);
func_argv[5] = PyLong_FromLong ((long)highlight);
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;

View File

@ -491,7 +491,7 @@ weechat_python_exec (struct t_plugin_script *script,
if (rc == NULL)
rc = PyLong_FromLong ((long)0);
if (PyErr_Occurred())
if (PyErr_Occurred ())
{
PyErr_Print ();
Py_XDECREF(rc);
@ -591,53 +591,53 @@ void weechat_python_init_module_weechat ()
}
/* define some constants */
weechat_dict = PyModule_GetDict(weechat_module);
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK", PyLong_FromLong((long) WEECHAT_RC_OK));
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK_EAT", PyLong_FromLong((long) WEECHAT_RC_OK_EAT));
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_ERROR", PyLong_FromLong((long) WEECHAT_RC_ERROR));
weechat_dict = PyModule_GetDict (weechat_module);
PyDict_SetItemString (weechat_dict, "WEECHAT_RC_OK", PyLong_FromLong ((long)WEECHAT_RC_OK));
PyDict_SetItemString (weechat_dict, "WEECHAT_RC_OK_EAT", PyLong_FromLong ((long)WEECHAT_RC_OK_EAT));
PyDict_SetItemString (weechat_dict, "WEECHAT_RC_ERROR", PyLong_FromLong ((long)WEECHAT_RC_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_READ_OK", PyLong_FromLong((long) WEECHAT_CONFIG_READ_OK));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_READ_MEMORY_ERROR", PyLong_FromLong((long) WEECHAT_CONFIG_READ_MEMORY_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_READ_FILE_NOT_FOUND", PyLong_FromLong((long) WEECHAT_CONFIG_READ_FILE_NOT_FOUND));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_WRITE_OK", PyLong_FromLong((long) WEECHAT_CONFIG_WRITE_OK));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_WRITE_ERROR", PyLong_FromLong((long) WEECHAT_CONFIG_WRITE_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_WRITE_MEMORY_ERROR", PyLong_FromLong((long) WEECHAT_CONFIG_WRITE_MEMORY_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_SET_OK_CHANGED", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_SET_OK_CHANGED));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_SET_ERROR", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_SET_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_OK_RESET", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_UNSET_OK_RESET));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED));
PyDict_SetItemString(weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_ERROR", PyLong_FromLong((long) WEECHAT_CONFIG_OPTION_UNSET_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_READ_OK", PyLong_FromLong ((long)WEECHAT_CONFIG_READ_OK));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_READ_MEMORY_ERROR", PyLong_FromLong ((long)WEECHAT_CONFIG_READ_MEMORY_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_READ_FILE_NOT_FOUND", PyLong_FromLong ((long)WEECHAT_CONFIG_READ_FILE_NOT_FOUND));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_WRITE_OK", PyLong_FromLong ((long)WEECHAT_CONFIG_WRITE_OK));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_WRITE_ERROR", PyLong_FromLong ((long)WEECHAT_CONFIG_WRITE_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_WRITE_MEMORY_ERROR", PyLong_FromLong ((long)WEECHAT_CONFIG_WRITE_MEMORY_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_SET_OK_CHANGED", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_SET_OK_CHANGED));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_SET_ERROR", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_SET_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_OK_RESET", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_UNSET_OK_RESET));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED));
PyDict_SetItemString (weechat_dict, "WEECHAT_CONFIG_OPTION_UNSET_ERROR", PyLong_FromLong ((long)WEECHAT_CONFIG_OPTION_UNSET_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_LIST_POS_SORT", PyUnicode_FromString(WEECHAT_LIST_POS_SORT));
PyDict_SetItemString(weechat_dict, "WEECHAT_LIST_POS_BEGINNING", PyUnicode_FromString(WEECHAT_LIST_POS_BEGINNING));
PyDict_SetItemString(weechat_dict, "WEECHAT_LIST_POS_END", PyUnicode_FromString(WEECHAT_LIST_POS_END));
PyDict_SetItemString (weechat_dict, "WEECHAT_LIST_POS_SORT", PyUnicode_FromString (WEECHAT_LIST_POS_SORT));
PyDict_SetItemString (weechat_dict, "WEECHAT_LIST_POS_BEGINNING", PyUnicode_FromString (WEECHAT_LIST_POS_BEGINNING));
PyDict_SetItemString (weechat_dict, "WEECHAT_LIST_POS_END", PyUnicode_FromString (WEECHAT_LIST_POS_END));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOTLIST_LOW", PyUnicode_FromString(WEECHAT_HOTLIST_LOW));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOTLIST_MESSAGE", PyUnicode_FromString(WEECHAT_HOTLIST_MESSAGE));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOTLIST_PRIVATE", PyUnicode_FromString(WEECHAT_HOTLIST_PRIVATE));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOTLIST_HIGHLIGHT", PyUnicode_FromString(WEECHAT_HOTLIST_HIGHLIGHT));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOTLIST_LOW", PyUnicode_FromString (WEECHAT_HOTLIST_LOW));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOTLIST_MESSAGE", PyUnicode_FromString (WEECHAT_HOTLIST_MESSAGE));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOTLIST_PRIVATE", PyUnicode_FromString (WEECHAT_HOTLIST_PRIVATE));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOTLIST_HIGHLIGHT", PyUnicode_FromString (WEECHAT_HOTLIST_HIGHLIGHT));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_PROCESS_RUNNING", PyLong_FromLong((long) WEECHAT_HOOK_PROCESS_RUNNING));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_PROCESS_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_PROCESS_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_PROCESS_RUNNING", PyLong_FromLong ((long)WEECHAT_HOOK_PROCESS_RUNNING));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_PROCESS_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_PROCESS_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_OK", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_OK));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_PROXY_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_PROXY_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_TIMEOUT", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_TIMEOUT));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_SOCKET_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_SOCKET_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_OK", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_OK));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_PROXY_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_PROXY_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_TIMEOUT", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_TIMEOUT));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_CONNECT_SOCKET_ERROR", PyLong_FromLong ((long)WEECHAT_HOOK_CONNECT_SOCKET_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_SIGNAL_STRING", PyUnicode_FromString(WEECHAT_HOOK_SIGNAL_STRING));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_SIGNAL_INT", PyUnicode_FromString(WEECHAT_HOOK_SIGNAL_INT));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_SIGNAL_POINTER", PyUnicode_FromString(WEECHAT_HOOK_SIGNAL_POINTER));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_SIGNAL_STRING", PyUnicode_FromString (WEECHAT_HOOK_SIGNAL_STRING));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_SIGNAL_INT", PyUnicode_FromString (WEECHAT_HOOK_SIGNAL_INT));
PyDict_SetItemString (weechat_dict, "WEECHAT_HOOK_SIGNAL_POINTER", PyUnicode_FromString (WEECHAT_HOOK_SIGNAL_POINTER));
#if PY_MAJOR_VERSION >= 3
return weechat_module;
@ -658,19 +658,19 @@ weechat_python_set_output ()
weechat_outputs = PyModule_Create (&moduleDefOutputs);
#else
/* python <= 2.x */
weechat_outputs = Py_InitModule("weechatOutputs",
weechat_python_output_funcs);
weechat_outputs = Py_InitModule ("weechatOutputs",
weechat_python_output_funcs);
#endif /* PY_MAJOR_VERSION >= 3 */
if (weechat_outputs)
{
if (PySys_SetObject("stdout", weechat_outputs) == -1)
if (PySys_SetObject ("stdout", weechat_outputs) == -1)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stdout"),
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
}
if (PySys_SetObject("stderr", weechat_outputs) == -1)
if (PySys_SetObject ("stderr", weechat_outputs) == -1)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stderr"),
@ -746,13 +746,13 @@ weechat_python_load (const char *filename, const char *code)
free (wargv[0]);
wargv[0] = NULL;
}
PySys_SetArgv(1, wargv);
PySys_SetArgv (1, wargv);
if (wargv[0])
free (wargv[0]);
}
#else
/* python <= 2.x */
PySys_SetArgv(1, argv);
PySys_SetArgv (1, argv);
#endif /* PY_MAJOR_VERSION >= 3 */
if (!python_current_interpreter)
@ -781,7 +781,7 @@ weechat_python_load (const char *filename, const char *code)
snprintf (str_home, len, "%s/python", weechat_home);
#if PY_MAJOR_VERSION >= 3
/* python >= 3.x */
path = PyUnicode_FromString(str_home);
path = PyUnicode_FromString (str_home);
#else
/* python <= 2.x */
path = PyBytes_FromString (str_home);
@ -1500,8 +1500,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
NULL,
&weechat_python_info_python2_bin_cb, NULL, NULL);
PyImport_AppendInittab("weechat",
&weechat_python_init_module_weechat);
PyImport_AppendInittab ("weechat",
&weechat_python_init_module_weechat);
Py_Initialize ();
if (Py_IsInitialized () == 0)

View File

@ -1499,7 +1499,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
"weechat-relay-irc, running version %s",
RELAY_IRC_DATA(client, address),
RELAY_IRC_DATA(client, nick),
weechat_info_get("version", NULL));
weechat_info_get ("version", NULL));
snprintf (str_time, sizeof (str_time), "%s",
ctime (&client->listen_start_time));
if (str_time[0])
@ -1514,7 +1514,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
RELAY_IRC_DATA(client, address),
RELAY_IRC_DATA(client, nick),
RELAY_IRC_DATA(client, address),
weechat_info_get("version", NULL));
weechat_info_get ("version", NULL));
infolist_server = weechat_infolist_get ("irc_server", NULL,
client->protocol_args);
if (infolist_server)

View File

@ -56,9 +56,9 @@ relay_buffer_refresh (const char *hotlist)
client_selected = relay_client_search_by_number (relay_buffer_selected_line);
weechat_printf_y (relay_buffer, 0,
"%s%s%s%s%s%s%s",
weechat_color("green"),
weechat_color ("green"),
_("Actions (letter+enter):"),
weechat_color("lightgreen"),
weechat_color ("lightgreen"),
/* disconnect */
(client_selected
&& !RELAY_CLIENT_HAS_ENDED(client_selected)) ?
@ -119,9 +119,9 @@ relay_buffer_refresh (const char *hotlist)
/* first line with status, description and bytes recv/sent */
weechat_printf_y (relay_buffer, (line * 2) + 2,
_("%s%s[%s%s%s%s] %s, received: %s, sent: %s"),
weechat_color(str_color),
weechat_color (str_color),
(line == relay_buffer_selected_line) ? "*** " : " ",
weechat_color(weechat_config_string (relay_config_color_status[ptr_client->status])),
weechat_color (weechat_config_string (relay_config_color_status[ptr_client->status])),
str_status,
weechat_color ("reset"),
weechat_color (str_color),
@ -132,7 +132,7 @@ relay_buffer_refresh (const char *hotlist)
/* second line with start/end time */
weechat_printf_y (relay_buffer, (line * 2) + 3,
_("%s%-26s started on: %s, ended on: %s"),
weechat_color(str_color),
weechat_color (str_color),
" ",
str_date_start,
str_date_end);

View File

@ -47,7 +47,7 @@ relay_completion_protocol_name_cb (const void *pointer, void *data,
(void) buffer;
(void) completion_item;
infolist = weechat_infolist_get("irc_server", NULL, NULL);
infolist = weechat_infolist_get ("irc_server", NULL, NULL);
if (infolist)
{
while (weechat_infolist_next (infolist))

View File

@ -904,9 +904,9 @@ relay_weechat_msg_add_nicklist_buffer (struct t_relay_weechat_msg *msg,
relay_weechat_msg_add_pointer (msg, ptr_nick);
relay_weechat_msg_add_char (msg, 0); /* group */
relay_weechat_msg_add_char (msg,
(char)weechat_hdata_integer(ptr_hdata_nick,
ptr_nick,
"visible"));
(char)weechat_hdata_integer (ptr_hdata_nick,
ptr_nick,
"visible"));
relay_weechat_msg_add_int (msg, 0); /* level */
relay_weechat_msg_add_string (msg,
weechat_hdata_string (ptr_hdata_nick,
@ -932,9 +932,9 @@ relay_weechat_msg_add_nicklist_buffer (struct t_relay_weechat_msg *msg,
relay_weechat_msg_add_pointer (msg, ptr_group);
relay_weechat_msg_add_char (msg, 1); /* group */
relay_weechat_msg_add_char (msg,
(char)weechat_hdata_integer(ptr_hdata_group,
ptr_group,
"visible"));
(char)weechat_hdata_integer (ptr_hdata_group,
ptr_group,
"visible"));
relay_weechat_msg_add_int (msg,
weechat_hdata_integer (ptr_hdata_group,
ptr_group,

View File

@ -6149,52 +6149,52 @@ weechat_ruby_api_upgrade_close (VALUE class, VALUE upgrade_file)
void
weechat_ruby_api_init (VALUE ruby_mWeechat)
{
rb_define_const(ruby_mWeechat, "WEECHAT_RC_OK", INT2NUM(WEECHAT_RC_OK));
rb_define_const(ruby_mWeechat, "WEECHAT_RC_OK_EAT", INT2NUM(WEECHAT_RC_OK_EAT));
rb_define_const(ruby_mWeechat, "WEECHAT_RC_ERROR", INT2NUM(WEECHAT_RC_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_RC_OK", INT2NUM(WEECHAT_RC_OK));
rb_define_const (ruby_mWeechat, "WEECHAT_RC_OK_EAT", INT2NUM(WEECHAT_RC_OK_EAT));
rb_define_const (ruby_mWeechat, "WEECHAT_RC_ERROR", INT2NUM(WEECHAT_RC_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_READ_OK", INT2NUM(WEECHAT_CONFIG_READ_OK));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_READ_MEMORY_ERROR", INT2NUM(WEECHAT_CONFIG_READ_MEMORY_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_READ_FILE_NOT_FOUND", INT2NUM(WEECHAT_CONFIG_READ_FILE_NOT_FOUND));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_WRITE_OK", INT2NUM(WEECHAT_CONFIG_WRITE_OK));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_WRITE_ERROR", INT2NUM(WEECHAT_CONFIG_WRITE_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_WRITE_MEMORY_ERROR", INT2NUM(WEECHAT_CONFIG_WRITE_MEMORY_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_OK_CHANGED", INT2NUM(WEECHAT_CONFIG_OPTION_SET_OK_CHANGED));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE", INT2NUM(WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_ERROR", INT2NUM(WEECHAT_CONFIG_OPTION_SET_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND", INT2NUM(WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_OK_RESET", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_OK_RESET));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED));
rb_define_const(ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_ERROR", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_READ_OK", INT2NUM(WEECHAT_CONFIG_READ_OK));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_READ_MEMORY_ERROR", INT2NUM(WEECHAT_CONFIG_READ_MEMORY_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_READ_FILE_NOT_FOUND", INT2NUM(WEECHAT_CONFIG_READ_FILE_NOT_FOUND));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_WRITE_OK", INT2NUM(WEECHAT_CONFIG_WRITE_OK));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_WRITE_ERROR", INT2NUM(WEECHAT_CONFIG_WRITE_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_WRITE_MEMORY_ERROR", INT2NUM(WEECHAT_CONFIG_WRITE_MEMORY_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_OK_CHANGED", INT2NUM(WEECHAT_CONFIG_OPTION_SET_OK_CHANGED));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE", INT2NUM(WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_ERROR", INT2NUM(WEECHAT_CONFIG_OPTION_SET_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND", INT2NUM(WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_OK_RESET", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_OK_RESET));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED));
rb_define_const (ruby_mWeechat, "WEECHAT_CONFIG_OPTION_UNSET_ERROR", INT2NUM(WEECHAT_CONFIG_OPTION_UNSET_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_LIST_POS_SORT", rb_str_new2(WEECHAT_LIST_POS_SORT));
rb_define_const(ruby_mWeechat, "WEECHAT_LIST_POS_BEGINNING", rb_str_new2(WEECHAT_LIST_POS_BEGINNING));
rb_define_const(ruby_mWeechat, "WEECHAT_LIST_POS_END", rb_str_new2(WEECHAT_LIST_POS_END));
rb_define_const (ruby_mWeechat, "WEECHAT_LIST_POS_SORT", rb_str_new2 (WEECHAT_LIST_POS_SORT));
rb_define_const (ruby_mWeechat, "WEECHAT_LIST_POS_BEGINNING", rb_str_new2 (WEECHAT_LIST_POS_BEGINNING));
rb_define_const (ruby_mWeechat, "WEECHAT_LIST_POS_END", rb_str_new2 (WEECHAT_LIST_POS_END));
rb_define_const(ruby_mWeechat, "WEECHAT_HOTLIST_LOW", rb_str_new2(WEECHAT_HOTLIST_LOW));
rb_define_const(ruby_mWeechat, "WEECHAT_HOTLIST_MESSAGE", rb_str_new2(WEECHAT_HOTLIST_MESSAGE));
rb_define_const(ruby_mWeechat, "WEECHAT_HOTLIST_PRIVATE", rb_str_new2(WEECHAT_HOTLIST_PRIVATE));
rb_define_const(ruby_mWeechat, "WEECHAT_HOTLIST_HIGHLIGHT", rb_str_new2(WEECHAT_HOTLIST_HIGHLIGHT));
rb_define_const (ruby_mWeechat, "WEECHAT_HOTLIST_LOW", rb_str_new2 (WEECHAT_HOTLIST_LOW));
rb_define_const (ruby_mWeechat, "WEECHAT_HOTLIST_MESSAGE", rb_str_new2 (WEECHAT_HOTLIST_MESSAGE));
rb_define_const (ruby_mWeechat, "WEECHAT_HOTLIST_PRIVATE", rb_str_new2 (WEECHAT_HOTLIST_PRIVATE));
rb_define_const (ruby_mWeechat, "WEECHAT_HOTLIST_HIGHLIGHT", rb_str_new2 (WEECHAT_HOTLIST_HIGHLIGHT));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_PROCESS_RUNNING", INT2NUM(WEECHAT_HOOK_PROCESS_RUNNING));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_PROCESS_ERROR", INT2NUM(WEECHAT_HOOK_PROCESS_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_PROCESS_RUNNING", INT2NUM(WEECHAT_HOOK_PROCESS_RUNNING));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_PROCESS_ERROR", INT2NUM(WEECHAT_HOOK_PROCESS_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_OK", INT2NUM(WEECHAT_HOOK_CONNECT_OK));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND", INT2NUM(WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND", INT2NUM(WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED", INT2NUM(WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_PROXY_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_PROXY_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_TIMEOUT", INT2NUM(WEECHAT_HOOK_CONNECT_TIMEOUT));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_SOCKET_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_SOCKET_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_OK", INT2NUM(WEECHAT_HOOK_CONNECT_OK));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND", INT2NUM(WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND", INT2NUM(WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED", INT2NUM(WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_PROXY_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_PROXY_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_TIMEOUT", INT2NUM(WEECHAT_HOOK_CONNECT_TIMEOUT));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_CONNECT_SOCKET_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_SOCKET_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_STRING", rb_str_new2(WEECHAT_HOOK_SIGNAL_STRING));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_INT", rb_str_new2(WEECHAT_HOOK_SIGNAL_INT));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_POINTER", rb_str_new2(WEECHAT_HOOK_SIGNAL_POINTER));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_STRING", rb_str_new2 (WEECHAT_HOOK_SIGNAL_STRING));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_INT", rb_str_new2 (WEECHAT_HOOK_SIGNAL_INT));
rb_define_const (ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_POINTER", rb_str_new2 (WEECHAT_HOOK_SIGNAL_POINTER));
API_DEF_FUNC(register, 7);
API_DEF_FUNC(plugin_get_name, 1);

View File

@ -186,16 +186,16 @@ weechat_ruby_hash_foreach_cb (VALUE key, VALUE value, void *arg)
type_values = weechat_hashtable_get_string (hashtable, "type_values");
if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)
{
weechat_hashtable_set (hashtable, StringValuePtr(key),
StringValuePtr(value));
weechat_hashtable_set (hashtable, StringValuePtr (key),
StringValuePtr (value));
}
else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)
{
weechat_hashtable_set (hashtable, StringValuePtr(key),
weechat_hashtable_set (hashtable, StringValuePtr (key),
plugin_script_str2ptr (
weechat_ruby_plugin,
NULL, NULL,
StringValuePtr(value)));
StringValuePtr (value)));
}
}
@ -269,30 +269,30 @@ weechat_ruby_print_exception (VALUE err)
char* err_msg;
char* err_class;
backtrace = rb_protect_funcall (err, rb_intern("backtrace"),
backtrace = rb_protect_funcall (err, rb_intern ("backtrace"),
&ruby_error, 0, NULL);
tmp1 = rb_protect_funcall(err, rb_intern("message"), &ruby_error, 0, NULL);
err_msg = StringValueCStr(tmp1);
tmp1 = rb_protect_funcall(err, rb_intern ("message"), &ruby_error, 0, NULL);
err_msg = StringValueCStr (tmp1);
tmp2 = rb_protect_funcall(rb_protect_funcall(err, rb_intern("class"),
&ruby_error, 0, NULL),
rb_intern("name"), &ruby_error, 0, NULL);
err_class = StringValuePtr(tmp2);
tmp2 = rb_protect_funcall (rb_protect_funcall (err, rb_intern ("class"),
&ruby_error, 0, NULL),
rb_intern ("name"), &ruby_error, 0, NULL);
err_class = StringValuePtr (tmp2);
if (strcmp (err_class, "SyntaxError") == 0)
{
tmp3 = rb_inspect(err);
tmp3 = rb_inspect (err);
weechat_printf (NULL,
weechat_gettext ("%s%s: error: %s"),
weechat_prefix ("error"), RUBY_PLUGIN_NAME,
StringValuePtr(tmp3));
StringValuePtr (tmp3));
}
else
{
for (i = 0; i < RARRAY_LEN(backtrace); i++)
{
line = StringValuePtr(RARRAY_PTR(backtrace)[i]);
line = StringValuePtr (RARRAY_PTR(backtrace)[i]);
cline = NULL;
if (i == 0)
{
@ -311,8 +311,8 @@ weechat_ruby_print_exception (VALUE err)
}
else
{
cline = (char *)calloc(strlen (line) + strlen (" from ") + 1,
sizeof (char));
cline = (char *)calloc (strlen (line) + strlen (" from ") + 1,
sizeof (char));
if (cline)
{
strcat (cline, " from ");
@ -487,13 +487,13 @@ weechat_ruby_exec (struct t_plugin_script *script,
if (argc > 0)
{
rc = rb_protect_funcall ((VALUE) script->interpreter,
rb_intern(function),
rb_intern (function),
&ruby_error, argc, argv2);
}
else
{
rc = rb_protect_funcall ((VALUE) script->interpreter,
rb_intern(function),
rb_intern (function),
&ruby_error, 0, NULL);
}
@ -505,8 +505,8 @@ weechat_ruby_exec (struct t_plugin_script *script,
weechat_gettext ("%s%s: unable to run function \"%s\""),
weechat_prefix ("error"), RUBY_PLUGIN_NAME, function);
err = rb_gv_get("$!");
weechat_ruby_print_exception(err);
err = rb_gv_get ("$!");
weechat_ruby_print_exception (err);
return NULL;
}
@ -595,7 +595,7 @@ weechat_ruby_load (const char *filename, const char *code)
ruby_current_script = NULL;
ruby_registered_script = NULL;
snprintf (modname, sizeof(modname), "%s%d", MOD_NAME_PREFIX, ruby_num);
snprintf (modname, sizeof (modname), "%s%d", MOD_NAME_PREFIX, ruby_num);
ruby_num++;
ruby_current_module = rb_define_module (modname);
@ -610,8 +610,8 @@ weechat_ruby_load (const char *filename, const char *code)
if (ruby_retcode == Qnil)
{
err = rb_gv_get("$!");
weechat_ruby_print_exception(err);
err = rb_gv_get ("$!");
weechat_ruby_print_exception (err);
return NULL;
}
@ -662,8 +662,8 @@ weechat_ruby_load (const char *filename, const char *code)
"\"weechat_init\" in file \"%s\""),
weechat_prefix ("error"), RUBY_PLUGIN_NAME, filename);
err = rb_gv_get("$!");
weechat_ruby_print_exception(err);
err = rb_gv_get ("$!");
weechat_ruby_print_exception (err);
if (ruby_current_script)
{

View File

@ -1039,7 +1039,7 @@ script_repo_file_exists ()
int rc;
struct stat st;
filename = script_config_get_xml_filename();
filename = script_config_get_xml_filename ();
if (!filename)
return 0;

View File

@ -159,7 +159,7 @@ weechat_tcl_dict_to_hashtable (Tcl_Interp *interp, Tcl_Obj *dict,
if (Tcl_DictObjFirst (interp, dict, &search, &key, &value, &done) == TCL_OK)
{
for (; !done ; Tcl_DictObjNext(&search, &key, &value, &done))
for (; !done ; Tcl_DictObjNext (&search, &key, &value, &done))
{
if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)
{
@ -449,7 +449,7 @@ weechat_tcl_unload (struct t_plugin_script *script)
plugin_script_remove (weechat_tcl_plugin, &tcl_scripts, &last_tcl_script, script);
Tcl_DeleteInterp(interp);
Tcl_DeleteInterp (interp);
(void) weechat_hook_signal_send ("tcl_script_unloaded",
WEECHAT_HOOK_SIGNAL_STRING, filename);

View File

@ -57,9 +57,9 @@ xfer_buffer_refresh (const char *hotlist)
xfer_selected = xfer_search_by_number (xfer_buffer_selected_line);
weechat_printf_y (xfer_buffer, 0,
"%s%s%s%s%s%s%s%s",
weechat_color("green"),
weechat_color ("green"),
_("Actions (letter+enter):"),
weechat_color("lightgreen"),
weechat_color ("lightgreen"),
/* accept */
(xfer_selected && XFER_IS_RECV(xfer_selected->type)
&& (xfer_selected->status == XFER_STATUS_WAITING)) ?
@ -116,7 +116,7 @@ xfer_buffer_refresh (const char *hotlist)
/* display first line with remote nick, filename and plugin name/id */
weechat_printf_y (xfer_buffer, (line * 2) + 2,
"%s%s%-24s %s%s%s%s (%s.%s)%s%s",
weechat_color(str_color),
weechat_color (str_color),
(line == xfer_buffer_selected_line) ?
"*** " : " ",
ptr_xfer->remote_nick,
@ -154,12 +154,12 @@ xfer_buffer_refresh (const char *hotlist)
}
weechat_printf_y (xfer_buffer, (line * 2) + 3,
"%s%s%s %s%s%s%s%s",
weechat_color(str_color),
weechat_color (str_color),
(line == xfer_buffer_selected_line) ?
"*** " : " ",
(XFER_IS_SEND(ptr_xfer->type)) ?
"<<--" : "-->>",
weechat_color(weechat_config_string (xfer_config_color_status[ptr_xfer->status])),
weechat_color (weechat_config_string (xfer_config_color_status[ptr_xfer->status])),
status,
weechat_color ("reset"),
weechat_color (str_color),
@ -228,10 +228,10 @@ xfer_buffer_refresh (const char *hotlist)
/* display second line for file with status, progress bar and estimated time */
weechat_printf_y (xfer_buffer, (line * 2) + 3,
"%s%s%s %s%s%s%s%3llu%% %s / %s (%s%s/s)",
weechat_color(str_color),
weechat_color (str_color),
(line == xfer_buffer_selected_line) ? "*** " : " ",
(XFER_IS_SEND(ptr_xfer->type)) ? "<<--" : "-->>",
weechat_color(weechat_config_string (xfer_config_color_status[ptr_xfer->status])),
weechat_color (weechat_config_string (xfer_config_color_status[ptr_xfer->status])),
status,
weechat_color (str_color),
(progress_bar) ? progress_bar : "",

View File

@ -147,8 +147,8 @@ xfer_command_xfer_list (int full)
ptr_xfer->remote_nick,
ptr_xfer->local_nick,
date,
weechat_color(
weechat_config_string(
weechat_color (
weechat_config_string (
xfer_config_color_status[ptr_xfer->status])),
_(xfer_status_string[ptr_xfer->status]));
}

View File

@ -103,7 +103,7 @@ xfer_file_find_filename (struct t_xfer *xfer)
}
strcpy (xfer->local_filename, path);
dir_separator = weechat_info_get("dir_separator", "");
dir_separator = weechat_info_get ("dir_separator", "");
if (dir_separator
&& (xfer->local_filename[strlen (xfer->local_filename) - 1] != dir_separator[0]))
strcat (xfer->local_filename, dir_separator);

View File

@ -688,11 +688,11 @@ xfer_new (const char *plugin_name, const char *plugin_id,
if (XFER_IS_RECV(type))
{
new_xfer->local_address_str = strdup ("");
xfer_set_remote_address(new_xfer, address, address_length, str_address);
xfer_set_remote_address (new_xfer, address, address_length, str_address);
}
else
{
xfer_set_local_address(new_xfer, address, address_length, str_address);
xfer_set_local_address (new_xfer, address, address_length, str_address);
new_xfer->remote_address_str = strdup ("");
}
@ -1184,7 +1184,7 @@ xfer_add_cb (const void *pointer, void *data,
}
else
{
memset(&bind_addr, 0, sizeof(bind_addr));
memset (&bind_addr, 0, sizeof (bind_addr));
/* determine bind_addr family from either own_ip or default */
if (weechat_config_string (xfer_config_network_own_ip)