|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
🚨 Custom error code system with formatted messages, thread-local storage, and errno mapping More...
Go to the source code of this file.
Macros | |
| #define | MAX_THREAD_ERRORS 64 |
Functions | |
| void | log_labeled (const char *label, log_color_t color, const char *message,...) |
| void | asciichat_set_errno (asciichat_error_t code, const char *file, int line, const char *function, const char *context_message) |
| void | asciichat_set_errno_with_message (asciichat_error_t code, const char *file, int line, const char *function, const char *format,...) |
| void | asciichat_set_errno_with_system_error (asciichat_error_t code, const char *file, int line, const char *function, int sys_errno) |
| void | asciichat_set_errno_with_system_error_and_message (asciichat_error_t code, const char *file, int line, const char *function, int sys_errno, const char *format,...) |
| void | asciichat_set_errno_with_wsa_error (asciichat_error_t code, const char *file, int line, const char *function, int wsa_error) |
| bool | asciichat_has_wsa_error (void) |
| bool | asciichat_has_errno (asciichat_error_context_t *context) |
| void | asciichat_clear_errno (void) |
| asciichat_error_t | asciichat_get_errno (void) |
| void | asciichat_fatal_with_context (asciichat_error_t code, const char *file, int line, const char *function, const char *format,...) |
| void | asciichat_print_error_context (const asciichat_error_context_t *context) |
| void | asciichat_error_stats_init (void) |
| void | asciichat_error_stats_record (asciichat_error_t code) |
| void | asciichat_error_stats_print (void) |
| void | asciichat_error_stats_reset (void) |
| asciichat_error_stats_t | asciichat_error_stats_get (void) |
| asciichat_error_t | asciichat_get_thread_error (int thread_id) |
| void | asciichat_set_thread_error (int thread_id, asciichat_error_t code) |
| void | asciichat_clear_thread_error (int thread_id) |
| void | asciichat_errno_suppress (bool suppress) |
| void | asciichat_errno_destroy (void) |
Variables | |
| __thread asciichat_error_context_t | asciichat_errno_context |
| __thread asciichat_error_t | asciichat_errno = ASCIICHAT_OK |
🚨 Custom error code system with formatted messages, thread-local storage, and errno mapping
Definition in file asciichat_errno.c.
| #define MAX_THREAD_ERRORS 64 |
Definition at line 62 of file asciichat_errno.c.
| void asciichat_clear_errno | ( | void | ) |
Definition at line 236 of file asciichat_errno.c.
References asciichat_errno_context, platform_backtrace_symbols_destroy(), and platform_clear_error_state().
| void asciichat_clear_thread_error | ( | int | thread_id | ) |
Definition at line 484 of file asciichat_errno.c.
References MAX_THREAD_ERRORS, thread_id, and valid.
| void asciichat_errno_destroy | ( | void | ) |
Definition at line 502 of file asciichat_errno.c.
References asciichat_errno_context, and platform_backtrace_symbols_destroy().
Referenced by asciichat_shared_destroy(), client_audio_render_thread(), client_receive_thread(), client_send_thread_func(), client_video_render_thread(), server_main(), and stats_logger_thread().
| void asciichat_errno_suppress | ( | bool | suppress | ) |
Definition at line 498 of file asciichat_errno.c.
| asciichat_error_stats_t asciichat_error_stats_get | ( | void | ) |
Definition at line 436 of file asciichat_errno.c.
| void asciichat_error_stats_init | ( | void | ) |
Definition at line 365 of file asciichat_errno.c.
| void asciichat_error_stats_print | ( | void | ) |
Definition at line 394 of file asciichat_errno.c.
References platform_localtime().
Referenced by server_main(), and stats_logger_thread().
| void asciichat_error_stats_record | ( | asciichat_error_t | code | ) |
Definition at line 376 of file asciichat_errno.c.
References time_get_realtime_ns().
Referenced by asciichat_set_errno().
| void asciichat_error_stats_reset | ( | void | ) |
Definition at line 430 of file asciichat_errno.c.
| void asciichat_fatal_with_context | ( | asciichat_error_t | code, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 267 of file asciichat_errno.c.
References args, asciichat_errno_context, asciichat_print_error_context(), extract_project_relative_path(), format_message(), log_labeled(), platform_backtrace(), platform_backtrace_symbols(), platform_backtrace_symbols_destroy(), platform_print_backtrace_symbols(), and safe_fprintf().
| asciichat_error_t asciichat_get_errno | ( | void | ) |
Definition at line 258 of file asciichat_errno.c.
References asciichat_errno_context.
| asciichat_error_t asciichat_get_thread_error | ( | int | thread_id | ) |
Definition at line 455 of file asciichat_errno.c.
References MAX_THREAD_ERRORS, thread_id, and valid.
| bool asciichat_has_errno | ( | asciichat_error_context_t * | context | ) |
Definition at line 224 of file asciichat_errno.c.
References asciichat_errno_context.
| bool asciichat_has_wsa_error | ( | void | ) |
Definition at line 215 of file asciichat_errno.c.
References asciichat_errno_context.
| void asciichat_print_error_context | ( | const asciichat_error_context_t * | context | ) |
Definition at line 319 of file asciichat_errno.c.
References colored_string(), extract_project_relative_path(), platform_localtime(), platform_print_backtrace_symbols(), and safe_fprintf().
Referenced by asciichat_fatal_with_context().
| void asciichat_set_errno | ( | asciichat_error_t | code, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| const char * | context_message | ||
| ) |
Definition at line 112 of file asciichat_errno.c.
References asciichat_errno, asciichat_errno_context, asciichat_error_stats_record(), platform_backtrace_symbols_destroy(), and time_get_realtime_ns().
Referenced by asciichat_set_errno_with_message(), asciichat_set_errno_with_system_error(), asciichat_set_errno_with_system_error_and_message(), and asciichat_set_errno_with_wsa_error().
| void asciichat_set_errno_with_message | ( | asciichat_error_t | code, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 169 of file asciichat_errno.c.
References args, asciichat_set_errno(), and format_message().
| void asciichat_set_errno_with_system_error | ( | asciichat_error_t | code, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| int | sys_errno | ||
| ) |
Definition at line 184 of file asciichat_errno.c.
References asciichat_errno_context, and asciichat_set_errno().
| void asciichat_set_errno_with_system_error_and_message | ( | asciichat_error_t | code, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| int | sys_errno, | ||
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 191 of file asciichat_errno.c.
References args, asciichat_errno_context, asciichat_set_errno(), and format_message().
| void asciichat_set_errno_with_wsa_error | ( | asciichat_error_t | code, |
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| int | wsa_error | ||
| ) |
Definition at line 208 of file asciichat_errno.c.
References asciichat_errno_context, and asciichat_set_errno().
| void asciichat_set_thread_error | ( | int | thread_id, |
| asciichat_error_t | code | ||
| ) |
Definition at line 464 of file asciichat_errno.c.
References MAX_THREAD_ERRORS, thread_id, and valid.
| void log_labeled | ( | const char * | label, |
| log_color_t | color, | ||
| const char * | message, | ||
| ... | |||
| ) |
Definition at line 94 of file asciichat_errno.c.
References args, colored_string(), format_message(), and safe_fprintf().
Referenced by asciichat_fatal_with_context().
| __thread asciichat_error_t asciichat_errno = ASCIICHAT_OK |
Definition at line 43 of file asciichat_errno.c.
Referenced by accept_with_timeout(), and asciichat_set_errno().
| __thread asciichat_error_context_t asciichat_errno_context |
Definition at line 31 of file asciichat_errno.c.
Referenced by accept_with_timeout(), asciichat_clear_errno(), asciichat_errno_destroy(), asciichat_fatal_with_context(), asciichat_get_errno(), asciichat_has_errno(), asciichat_has_wsa_error(), asciichat_set_errno(), asciichat_set_errno_with_system_error(), asciichat_set_errno_with_system_error_and_message(), and asciichat_set_errno_with_wsa_error().
| asciichat_error_t error_code |
Definition at line 65 of file asciichat_errno.c.
Referenced by accept_with_timeout(), acip_send_error(), acip_server_send_error(), connect_with_timeout(), packet_send_error(), send_error_packet(), send_error_packet_message(), and webcam_print_init_error_help().
| int thread_id |
Definition at line 64 of file asciichat_errno.c.
Referenced by asciichat_clear_thread_error(), asciichat_get_thread_error(), asciichat_set_thread_error(), and ascii_query::LLDBController::selectThread().
| bool valid |
Definition at line 66 of file asciichat_errno.c.
Referenced by asciichat_clear_thread_error(), asciichat_get_thread_error(), asciichat_set_thread_error(), and database_session_verify_key().