hirc

IRC client
Log | Files | Refs

commit 6e0ddd6e2ef40abd26577c63440306f577065da7
parent 7e1be1edcb70984dc7d891b1e21f9c0b76b5b159
Author: hhvn <dev@hhvn.uk>
Date:   Sat,  1 Jan 2022 01:26:40 +0000

s/ui.c s/config.c s/hirc.h: function name in error funcs

Diffstat:
Msrc/config.c | 2+-
Msrc/hirc.h | 16++++++++--------
Msrc/ui.c | 24++++++++++++------------
3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/config.c b/src/config.c @@ -210,7 +210,7 @@ struct Config config[] = { .description = { "Format of topic at top of main window", NULL}}, {"format.ui.error", 1, Val_string, - .str = "%{c:28}%{b}${3} %{b}(at ${1}:${2})", + .str = "%{c:28}%{b}${4} %{b}(${3} at ${1}:${2})", .strhandle = config_redraws, .description = { "Format of SELF_ERROR messages", NULL}}, diff --git a/src/hirc.h b/src/hirc.h @@ -141,16 +141,16 @@ char * ui_rectrl(char *str); char * ui_unctrl(char *str); int ui_bind(char *binding, char *cmd); int ui_unbind(char *binding); -void ui_error_(char *file, int line, char *format, ...); -#define ui_error(format, ...) ui_error_(__FILE__, __LINE__, format, __VA_ARGS__) -void ui_perror_(char *file, int line, char *str); -#define ui_perror(str) ui_perror_(__FILE__, __LINE__, str) +void ui_error_(char *file, int line, const char *func, char *format, ...); +#define ui_error(format, ...) ui_error_(__FILE__, __LINE__, __func__, format, __VA_ARGS__) +void ui_perror_(char *file, int line, const char *func, char *str); +#define ui_perror(str) ui_perror_(__FILE__, __LINE__, __func__, str) #ifdef TLS #include <tls.h> -void ui_tls_config_error_(char *file, int line, struct tls_config *config, char *str); -#define ui_tls_config_error(config, str) ui_tls_config_error_(__FILE__, __LINE__, config, str) -void ui_tls_error_(char *file, int line, struct tls *ctx, char *str); -#define ui_tls_error(ctx, str) ui_tls_error_(__FILE__, __LINE__, ctx, str) +void ui_tls_config_error_(char *file, int line, const char *func, struct tls_config *config, char *str); +#define ui_tls_config_error(config, str) ui_tls_config_error_(__FILE__, __LINE__, __func__, config, str) +void ui_tls_error_(char *file, int line, const char *func, struct tls *ctx, char *str); +#define ui_tls_error(ctx, str) ui_tls_error_(__FILE__, __LINE__, __func__, ctx, str) #endif /* TLS */ /* commands.c */ diff --git a/src/ui.c b/src/ui.c @@ -262,7 +262,7 @@ struct Selected selected; struct Keybind *keybinds = NULL; void -ui_error_(char *file, int line, char *format, ...) { +ui_error_(char *file, int line, const char *func, char *format, ...) { char msg[1024]; va_list ap; @@ -271,30 +271,30 @@ ui_error_(char *file, int line, char *format, ...) { va_end(ap); hist_format(selected.history, Activity_error, HIST_SHOW|HIST_TMP|HIST_MAIN, - "SELF_ERROR %s %d :%s", - file, line, msg); + "SELF_ERROR %s %d %s :%s", + file, line, func, msg); } void -ui_perror_(char *file, int line, char *str) { +ui_perror_(char *file, int line, const char *func, char *str) { hist_format(selected.history, Activity_error, HIST_SHOW|HIST_TMP|HIST_MAIN, - "SELF_ERROR %s %d :%s: %s", - file, line, str, strerror(errno)); + "SELF_ERROR %s %d %s :%s: %s", + file, line, func, str, strerror(errno)); } #ifdef TLS void -ui_tls_config_error_(char *file, int line, struct tls_config *config, char *str) { +ui_tls_config_error_(char *file, int line, const char *func, struct tls_config *config, char *str) { hist_format(selected.history, Activity_error, HIST_SHOW|HIST_TMP|HIST_MAIN, - "SELF_ERROR %s %d :%s: %s", - file, line, str, tls_config_error(config)); + "SELF_ERROR %s %d %s :%s: %s", + file, line, func, str, tls_config_error(config)); } void -ui_tls_error_(char *file, int line, struct tls *ctx, char *str) { +ui_tls_error_(char *file, int line, const char *func, struct tls *ctx, char *str) { hist_format(selected.history, Activity_error, HIST_SHOW|HIST_TMP|HIST_MAIN, - "SELF_ERROR %s %d :%s: %s", - file, line, str, tls_error(ctx)); + "SELF_ERROR %s %d %s :%s: %s", + file, line, func, str, tls_error(ctx)); } #endif /* TLS */