ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
asciichat_error_context_t Struct Reference

Error context structure. More...

#include <lib/asciichat_errno.h>

Data Fields

asciichat_error_t code
 Error code (asciichat_error_t enum value)
 
const char * file
 Source file where error occurred (NULL in release builds)
 
int line
 Line number where error occurred (0 in release builds)
 
const char * function
 Function name where error occurred (NULL in release builds)
 
char * context_message
 Optional custom message (dynamically allocated, owned by system)
 
uint64_t timestamp
 Timestamp when error occurred (microseconds since epoch)
 
int system_errno
 System errno value (if applicable, 0 otherwise)
 
int wsa_error
 Windows socket error code (if applicable, 0 otherwise)
 
void * backtrace [32]
 Stack trace addresses (debug builds only)
 
char ** backtrace_symbols
 Stack trace symbol strings (debug builds only)
 
int stack_depth
 Number of stack frames captured (0 if not captured)
 
bool has_system_error
 True if system_errno is valid.
 
bool has_wsa_error
 True if wsa_error is valid.
 

Detailed Description

Error context structure.

Contains full error context information including error code, location, stack trace (debug builds), and optional context message. This structure is stored in thread-local storage for thread-safe error handling.

Note
Stack traces are only captured in debug builds (DEBUG or ENABLE_ERRNO_BACKTRACES).
Context message is dynamically allocated and must be freed by the system.
Thread-local storage ensures each thread has independent error state.

Definition at line 112 of file asciichat_errno.h.

Field Documentation

◆ backtrace

void* asciichat_error_context_t::backtrace[32]

Stack trace addresses (debug builds only)

Definition at line 121 of file asciichat_errno.h.

Referenced by asciichat_set_errno().

◆ backtrace_symbols

char** asciichat_error_context_t::backtrace_symbols

Stack trace symbol strings (debug builds only)

Definition at line 122 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), asciichat_errno_cleanup(), asciichat_print_error_context(), and asciichat_set_errno().

◆ code

◆ context_message

char* asciichat_error_context_t::context_message

Optional custom message (dynamically allocated, owned by system)

Definition at line 117 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), asciichat_errno_cleanup(), asciichat_print_error_context(), asciichat_set_errno(), client_receive_thread(), main(), and options_init().

◆ file

const char* asciichat_error_context_t::file

Source file where error occurred (NULL in release builds)

Definition at line 114 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ function

const char* asciichat_error_context_t::function

Function name where error occurred (NULL in release builds)

Definition at line 116 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ has_system_error

◆ has_wsa_error

bool asciichat_error_context_t::has_wsa_error

True if wsa_error is valid.

Definition at line 125 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), asciichat_has_wsa_error(), and asciichat_set_errno_with_wsa_error().

◆ line

int asciichat_error_context_t::line

Line number where error occurred (0 in release builds)

Definition at line 115 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ stack_depth

int asciichat_error_context_t::stack_depth

Number of stack frames captured (0 if not captured)

Definition at line 123 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ system_errno

int asciichat_error_context_t::system_errno

◆ timestamp

uint64_t asciichat_error_context_t::timestamp

Timestamp when error occurred (microseconds since epoch)

Definition at line 118 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ wsa_error

int asciichat_error_context_t::wsa_error

Windows socket error code (if applicable, 0 otherwise)

Definition at line 120 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), and asciichat_set_errno_with_wsa_error().


The documentation for this struct was generated from the following file: