summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-backtrace.c2
-rw-r--r--src/core/wee-command.c35
-rw-r--r--src/core/wee-config-file.c72
-rw-r--r--src/core/wee-config.c8
-rw-r--r--src/core/wee-debug.c17
-rw-r--r--src/core/wee-log.c28
-rw-r--r--src/core/wee-network.c8
-rw-r--r--src/core/wee-string.c2
-rw-r--r--src/core/wee-string.h2
-rw-r--r--src/core/weechat.c66
10 files changed, 121 insertions, 119 deletions
diff --git a/src/core/wee-backtrace.c b/src/core/wee-backtrace.c
index c5ea521a8..8441d3155 100644
--- a/src/core/wee-backtrace.c
+++ b/src/core/wee-backtrace.c
@@ -56,7 +56,7 @@ weechat_backtrace_printf (const char *message, ...)
weechat_va_format (message);
if (vbuffer)
{
- string_iconv_fprintf (stderr, "%s\n", vbuffer);
+ string_fprintf (stderr, "%s\n", vbuffer);
log_printf ("%s", vbuffer);
free (vbuffer);
}
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index ac6bd6ce6..d0bd4d982 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -239,8 +239,9 @@ COMMAND_CALLBACK(bar)
if (!str_type)
{
gui_chat_printf (NULL,
- _("%sNot enough memory"),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ _("%sNot enough memory (%s)"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ "/bar");
return WEECHAT_RC_OK;
}
type = gui_bar_search_type (str_type);
@@ -5081,8 +5082,9 @@ COMMAND_CALLBACK(repeat)
if (!repeat_args)
{
gui_chat_printf (NULL,
- _("%sNot enough memory"),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ _("%sNot enough memory (%s)"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ "/repeat");
return WEECHAT_RC_OK;
}
repeat_args[0] = strdup (buffer->full_name);
@@ -6040,8 +6042,9 @@ COMMAND_CALLBACK(upgrade)
if (!ptr_binary && !quit)
{
gui_chat_printf (NULL,
- _("%sNot enough memory"),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ _("%sNot enough memory (%s)"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ "/upgrade");
return WEECHAT_RC_OK;
}
@@ -6096,12 +6099,12 @@ COMMAND_CALLBACK(upgrade)
execvp (exec_args[0], exec_args);
/* this code should not be reached if execvp is OK */
- string_iconv_fprintf (stderr, "\n\n*****\n");
- string_iconv_fprintf (stderr,
- _("***** Error: exec failed (program: \"%s\"), "
- "exiting WeeChat"),
- exec_args[0]);
- string_iconv_fprintf (stderr, "\n*****\n\n");
+ string_fprintf (stderr, "\n\n*****\n");
+ string_fprintf (stderr,
+ _("***** Error: exec failed (program: \"%s\"), "
+ "exiting WeeChat"),
+ exec_args[0]);
+ string_fprintf (stderr, "\n*****\n\n");
free (exec_args[0]);
free (exec_args[3]);
@@ -6400,8 +6403,9 @@ COMMAND_CALLBACK(wait)
if (!timer_args)
{
gui_chat_printf (NULL,
- _("%sNot enough memory"),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ _("%sNot enough memory (%s)"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ "/wait");
return WEECHAT_RC_OK;
}
timer_args[0] = strdup (buffer->full_name);
@@ -7730,6 +7734,9 @@ command_init ()
"Without argument, this command displays secured data in a new "
"buffer.\n"
"\n"
+ "Keys on secure buffer:\n"
+ " alt+v toggle values\n"
+ "\n"
"When a passphrase is used (data encrypted), it is asked by WeeChat "
"on startup.\n"
"It is possible to set environment variable \"WEECHAT_PASSPHRASE\" "
diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c
index bcea8d2ac..7a6f3591f 100644
--- a/src/core/wee-config-file.c
+++ b/src/core/wee-config-file.c
@@ -2301,35 +2301,35 @@ config_file_write_option (struct t_config_file *config_file,
switch (option->type)
{
case CONFIG_OPTION_TYPE_BOOLEAN:
- rc = string_iconv_fprintf (config_file->file, "%s%s = %s\n",
- config_file_option_escape (option->name),
- option->name,
- (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) ?
- "on" : "off");
+ rc = string_fprintf (config_file->file, "%s%s = %s\n",
+ config_file_option_escape (option->name),
+ option->name,
+ (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) ?
+ "on" : "off");
break;
case CONFIG_OPTION_TYPE_INTEGER:
if (option->string_values)
- rc = string_iconv_fprintf (config_file->file, "%s%s = %s\n",
- config_file_option_escape (option->name),
- option->name,
- option->string_values[CONFIG_INTEGER(option)]);
+ rc = string_fprintf (config_file->file, "%s%s = %s\n",
+ config_file_option_escape (option->name),
+ option->name,
+ option->string_values[CONFIG_INTEGER(option)]);
else
- rc = string_iconv_fprintf (config_file->file, "%s%s = %d\n",
- config_file_option_escape (option->name),
- option->name,
- CONFIG_INTEGER(option));
+ rc = string_fprintf (config_file->file, "%s%s = %d\n",
+ config_file_option_escape (option->name),
+ option->name,
+ CONFIG_INTEGER(option));
break;
case CONFIG_OPTION_TYPE_STRING:
- rc = string_iconv_fprintf (config_file->file, "%s%s = \"%s\"\n",
- config_file_option_escape (option->name),
- option->name,
- (char *)option->value);
+ rc = string_fprintf (config_file->file, "%s%s = \"%s\"\n",
+ config_file_option_escape (option->name),
+ option->name,
+ (char *)option->value);
break;
case CONFIG_OPTION_TYPE_COLOR:
- rc = string_iconv_fprintf (config_file->file, "%s%s = %s\n",
- config_file_option_escape (option->name),
- option->name,
- gui_color_get_name (CONFIG_COLOR(option)));
+ rc = string_fprintf (config_file->file, "%s%s = %s\n",
+ config_file_option_escape (option->name),
+ option->name,
+ gui_color_get_name (CONFIG_COLOR(option)));
break;
case CONFIG_NUM_OPTION_TYPES:
break;
@@ -2337,9 +2337,9 @@ config_file_write_option (struct t_config_file *config_file,
}
else
{
- rc = string_iconv_fprintf (config_file->file, "%s%s\n",
- config_file_option_escape (option->name),
- option->name);
+ rc = string_fprintf (config_file->file, "%s%s\n",
+ config_file_option_escape (option->name),
+ option->name);
}
return rc;
@@ -2371,9 +2371,9 @@ config_file_write_line (struct t_config_file *config_file,
{
if (vbuffer[0])
{
- rc = string_iconv_fprintf (config_file->file, "%s%s = %s\n",
- config_file_option_escape (option_name),
- option_name, vbuffer);
+ rc = string_fprintf (config_file->file, "%s%s = %s\n",
+ config_file_option_escape (option_name),
+ option_name, vbuffer);
free (vbuffer);
return rc;
}
@@ -2381,8 +2381,8 @@ config_file_write_line (struct t_config_file *config_file,
}
}
- return (string_iconv_fprintf (config_file->file, "\n[%s]\n",
- option_name));
+ return (string_fprintf (config_file->file, "\n[%s]\n",
+ option_name));
}
/*
@@ -2459,12 +2459,12 @@ config_file_write_internal (struct t_config_file *config_file,
}
/* write header with name of config file and WeeChat version */
- if (!string_iconv_fprintf (config_file->file, "#\n"))
+ if (!string_fprintf (config_file->file, "#\n"))
goto error;
- if (!string_iconv_fprintf (config_file->file,
- "# %s -- %s\n#\n",
- version_get_name (),
- config_file->filename))
+ if (!string_fprintf (config_file->file,
+ "# %s -- %s\n#\n",
+ version_get_name (),
+ config_file->filename))
goto error;
/* write all sections */
@@ -2493,8 +2493,8 @@ config_file_write_internal (struct t_config_file *config_file,
else
{
/* write all options for section */
- if (!string_iconv_fprintf (config_file->file,
- "\n[%s]\n", ptr_section->name))
+ if (!string_fprintf (config_file->file,
+ "\n[%s]\n", ptr_section->name))
goto error;
for (ptr_option = ptr_section->options; ptr_option;
ptr_option = ptr_option->next_option)
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 44a38bf7e..4d86cda97 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -2845,7 +2845,7 @@ config_weechat_init_options ()
weechat_config_file, ptr_section,
"hotlist_short_names", "boolean",
N_("if set, uses short names to display buffer names in hotlist (start "
- "after first '.' in name)"),
+ "after first \".\" in name)"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL,
&config_change_buffer_content, NULL, NULL,
@@ -3462,7 +3462,7 @@ config_weechat_init_options ()
config_color_bar_more = config_file_new_option (
weechat_config_file, ptr_section,
"bar_more", "color",
- N_("text color for '+' when scrolling bars"),
+ N_("text color for \"+\" when scrolling bars"),
NULL, -1, 0, "lightmagenta", NULL, 0,
NULL, NULL, NULL,
&config_change_color, NULL, NULL,
@@ -3700,7 +3700,7 @@ config_weechat_init_options ()
config_color_chat_prefix_more = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_more", "color",
- N_("text color for '+' when prefix is too long"),
+ N_("text color for \"+\" when prefix is too long"),
NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", NULL, 0,
NULL, NULL, NULL,
&config_change_color, NULL, NULL,
@@ -4027,7 +4027,7 @@ config_weechat_init_options ()
N_("if enabled, the commands inside command line are completed (the "
"command at beginning of line has higher priority and is used "
"first); note: when this option is enabled, there is no more "
- "automatic completion of paths beginning with '/' (outside "
+ "automatic completion of paths beginning with \"/\" (outside "
"commands arguments)"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c
index 1aaa436a7..d6ab2118b 100644
--- a/src/core/wee-debug.c
+++ b/src/core/wee-debug.c
@@ -156,18 +156,17 @@ debug_sigsegv ()
unhook_all ();
gui_main_end (0);
- string_iconv_fprintf (
- stderr,
- "\n"
- "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
+ string_fprintf (stderr,
+ "\n*** Very bad! WeeChat is crashing (SIGSEGV received)"
+ "\n");
if (!log_crash_rename ())
{
- string_iconv_fprintf (
- stderr,
- "*** Full crash dump was saved to %s/weechat.log file.\n",
- weechat_home);
+ string_fprintf (stderr,
+ "*** Full crash dump was saved to %s/weechat.log file."
+ "\n",
+ weechat_home);
}
- string_iconv_fprintf (
+ string_fprintf (
stderr,
"***\n"
"*** Please help WeeChat developers to fix this bug:\n"
diff --git a/src/core/wee-log.c b/src/core/wee-log.c
index 4edf3e910..397ae911c 100644
--- a/src/core/wee-log.c
+++ b/src/core/wee-log.c
@@ -112,10 +112,10 @@ log_init ()
{
if (!log_open (NULL, "w"))
{
- string_iconv_fprintf (stderr,
- _("Error: unable to create/append to log file (weechat.log)\n"
- "If another WeeChat process is using this file, try to run WeeChat\n"
- "with another home using the \"--dir\" command line option.\n"));
+ string_fprintf (stderr,
+ _("Error: unable to create/append to log file (weechat.log)\n"
+ "If another WeeChat process is using this file, try to run WeeChat\n"
+ "with another home using the \"--dir\" command line option.\n"));
exit (1);
}
log_printf ("WeeChat %s (%s %s %s)",
@@ -159,18 +159,18 @@ log_printf (const char *message, ...)
date_tmp = localtime (&seconds);
if (date_tmp)
{
- string_iconv_fprintf (weechat_log_file,
- "[%04d-%02d-%02d %02d:%02d:%02d] %s\n",
- date_tmp->tm_year + 1900, date_tmp->tm_mon + 1,
- date_tmp->tm_mday, date_tmp->tm_hour,
- date_tmp->tm_min, date_tmp->tm_sec,
- vbuffer);
+ string_fprintf (weechat_log_file,
+ "[%04d-%02d-%02d %02d:%02d:%02d] %s\n",
+ date_tmp->tm_year + 1900, date_tmp->tm_mon + 1,
+ date_tmp->tm_mday, date_tmp->tm_hour,
+ date_tmp->tm_min, date_tmp->tm_sec,
+ vbuffer);
}
else
- string_iconv_fprintf (weechat_log_file, "%s\n", vbuffer);
+ string_fprintf (weechat_log_file, "%s\n", vbuffer);
}
else
- string_iconv_fprintf (weechat_log_file, "%s\n", vbuffer);
+ string_fprintf (weechat_log_file, "%s\n", vbuffer);
fflush (weechat_log_file);
@@ -276,8 +276,8 @@ log_crash_rename ()
getpid());
if (rename (old_name, new_name) == 0)
{
- string_iconv_fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
- new_name);
+ string_fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
+ new_name);
log_open (new_name, "a");
free (old_name);
free (new_name);
diff --git a/src/core/wee-network.c b/src/core/wee-network.c
index fd1474236..cb2fa52d2 100644
--- a/src/core/wee-network.c
+++ b/src/core/wee-network.c
@@ -1609,7 +1609,7 @@ network_connect_child_read_cb (const void *pointer, void *data, int fd)
(hook_connect->callback_pointer,
hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
- 0, sock, cb_error, cb_ip_address);
+ 0, sock, "child_read_cb", NULL);
unhook (hook_connect);
}
@@ -1695,7 +1695,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
(hook_connect->callback_pointer,
hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
- 0, -1, NULL, NULL);
+ 0, -1, "pipe", NULL);
unhook (hook_connect);
return;
}
@@ -1710,7 +1710,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
(hook_connect->callback_pointer,
hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
- 0, -1, NULL, NULL);
+ 0, -1, "socketpair", NULL);
unhook (hook_connect);
return;
}
@@ -1732,7 +1732,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
(hook_connect->callback_pointer,
hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
- 0, -1, NULL, NULL);
+ 0, -1, "fork", NULL);
unhook (hook_connect);
return;
/* child process */
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index af50fb2fd..1481e6361 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -2385,7 +2385,7 @@ string_iconv_from_internal (const char *charset, const char *string)
*/
int
-string_iconv_fprintf (FILE *file, const char *data, ...)
+string_fprintf (FILE *file, const char *data, ...)
{
char *buf2;
int rc, num_written;
diff --git a/src/core/wee-string.h b/src/core/wee-string.h
index f760b98d0..5db751df2 100644
--- a/src/core/wee-string.h
+++ b/src/core/wee-string.h
@@ -85,7 +85,7 @@ extern char *string_iconv (int from_utf8, const char *from_code,
extern char *string_iconv_to_internal (const char *charset, const char *string);
extern char *string_iconv_from_internal (const char *charset,
const char *string);
-extern int string_iconv_fprintf (FILE *file, const char *data, ...);
+extern int string_fprintf (FILE *file, const char *data, ...);
extern char *string_format_size (unsigned long long size);
extern void string_encode_base16 (const char *from, int length, char *to);
extern int string_decode_base16 (const char *from, char *to);
diff --git a/src/core/weechat.c b/src/core/weechat.c
index e011c2e94..f0b7d44e5 100644
--- a/src/core/weechat.c
+++ b/src/core/weechat.c
@@ -110,8 +110,8 @@ char *weechat_startup_commands = NULL; /* startup commands (-r flag) */
void
weechat_display_copyright ()
{
- string_iconv_fprintf (stdout, "\n");
- string_iconv_fprintf (
+ string_fprintf (stdout, "\n");
+ string_fprintf (
stdout,
/* TRANSLATORS: "%s %s" after "compiled on" is date and time */
_("WeeChat %s Copyright %s, compiled on %s %s\n"
@@ -122,7 +122,7 @@ weechat_display_copyright ()
version_get_compilation_date (),
version_get_compilation_time (),
WEECHAT_WEBSITE);
- string_iconv_fprintf (stdout, "\n");
+ string_fprintf (stdout, "\n");
}
/*
@@ -133,12 +133,12 @@ void
weechat_display_usage (char *exec_name)
{
weechat_display_copyright ();
- string_iconv_fprintf (stdout, "\n");
- string_iconv_fprintf (stdout,
- _("Usage: %s [option...] [plugin:option...]\n"),
- exec_name, exec_name);
- string_iconv_fprintf (stdout, "\n");
- string_iconv_fprintf (
+ string_fprintf (stdout, "\n");
+ string_fprintf (stdout,
+ _("Usage: %s [option...] [plugin:option...]\n"),
+ exec_name, exec_name);
+ string_fprintf (stdout, "\n");
+ string_fprintf (
stdout,
_(" -a, --no-connect disable auto-connect to servers at "
"startup\n"
@@ -158,7 +158,7 @@ weechat_display_usage (char *exec_name)
"(see /help upgrade in WeeChat)\n"
" -v, --version display WeeChat version\n"
" plugin:option option for plugin (see man weechat)\n"));
- string_iconv_fprintf(stdout, "\n");
+ string_fprintf(stdout, "\n");
}
/*
@@ -198,10 +198,9 @@ weechat_parse_args (int argc, char *argv[])
}
else
{
- string_iconv_fprintf (stderr,
- _("Error: missing argument for \"%s\" "
- "option\n"),
- argv[i]);
+ string_fprintf (stderr,
+ _("Error: missing argument for \"%s\" option\n"),
+ argv[i]);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
@@ -215,8 +214,8 @@ weechat_parse_args (int argc, char *argv[])
|| (strcmp (argv[i], "--license") == 0))
{
weechat_display_copyright ();
- string_iconv_fprintf (stdout, "\n");
- string_iconv_fprintf (stdout, "%s%s", WEECHAT_LICENSE_TEXT);
+ string_fprintf (stdout, "\n");
+ string_fprintf (stdout, "%s%s", WEECHAT_LICENSE_TEXT);
weechat_shutdown (EXIT_SUCCESS, 0);
}
else if (strcmp (argv[i], "--no-dlclose") == 0)
@@ -266,10 +265,9 @@ weechat_parse_args (int argc, char *argv[])
}
else
{
- string_iconv_fprintf (stderr,
- _("Error: missing argument for \"%s\" "
- "option\n"),
- argv[i]);
+ string_fprintf (stderr,
+ _("Error: missing argument for \"%s\" option\n"),
+ argv[i]);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
@@ -280,7 +278,7 @@ weechat_parse_args (int argc, char *argv[])
else if ((strcmp (argv[i], "-v") == 0)
|| (strcmp (argv[i], "--version") == 0))
{
- string_iconv_fprintf (stdout, version_get_version ());
+ string_fprintf (stdout, version_get_version ());
fprintf (stdout, "\n");
weechat_shutdown (EXIT_SUCCESS, 0);
}
@@ -303,8 +301,7 @@ weechat_set_home_path (char *home_path)
ptr_home = getenv ("HOME");
if (!ptr_home)
{
- string_iconv_fprintf (stderr,
- _("Error: unable to get HOME directory\n"));
+ string_fprintf (stderr, _("Error: unable to get HOME directory\n"));
weechat_shutdown (EXIT_FAILURE, 0);
/* make C static analyzer happy (never executed) */
return;
@@ -324,9 +321,8 @@ weechat_set_home_path (char *home_path)
if (!weechat_home)
{
- string_iconv_fprintf (stderr,
- _("Error: not enough memory for home "
- "directory\n"));
+ string_fprintf (stderr,
+ _("Error: not enough memory for home directory\n"));
weechat_shutdown (EXIT_FAILURE, 0);
/* make C static analyzer happy (never executed) */
return;
@@ -363,9 +359,9 @@ weechat_create_home_dir ()
config_weechat_home = WEECHAT_HOME;
if (!config_weechat_home[0])
{
- string_iconv_fprintf (stderr,
- _("Error: WEECHAT_HOME is undefined, check "
- "build options\n"));
+ string_fprintf (stderr,
+ _("Error: WEECHAT_HOME is undefined, check build "
+ "options\n"));
weechat_shutdown (EXIT_FAILURE, 0);
/* make C static analyzer happy (never executed) */
return;
@@ -378,9 +374,9 @@ weechat_create_home_dir ()
{
if (!S_ISDIR (statinfo.st_mode))
{
- string_iconv_fprintf (stderr,
- _("Error: home (%s) is not a directory\n"),
- weechat_home);
+ string_fprintf (stderr,
+ _("Error: home (%s) is not a directory\n"),
+ weechat_home);
weechat_shutdown (EXIT_FAILURE, 0);
/* make C static analyzer happy (never executed) */
return;
@@ -390,9 +386,9 @@ weechat_create_home_dir ()
/* create home directory; error is fatal */
if (!util_mkdir (weechat_home, 0755))
{
- string_iconv_fprintf (stderr,
- _("Error: cannot create directory \"%s\"\n"),
- weechat_home);
+ string_fprintf (stderr,
+ _("Error: cannot create directory \"%s\"\n"),
+ weechat_home);
weechat_shutdown (EXIT_FAILURE, 0);
/* make C static analyzer happy (never executed) */
return;