ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
common.c File Reference

🔧 Core utilities: memory management, safe macros, and cross-platform helpers More...

Go to the source code of this file.

Functions

void shutdown_register_callback (shutdown_check_fn callback)
 Register application's shutdown check function.
 
bool shutdown_is_requested (void)
 Check if shutdown has been requested.
 
 __attribute__ ((constructor))
 Register fork handlers for common module.
 
asciichat_error_t asciichat_shared_init (const char *log_file, bool is_client, bool quiet_startup)
 Initialize common subsystems shared by client and server.
 
void asciichat_shared_destroy (void)
 Clean up all shared library subsystems.
 

Variables

int g_argc = 0
 Global argc for early argument inspection (e.g., –color flag detection) Set by main() for access from lib/platform/terminal.c during early execution.
 
char ** g_argv = NULL
 Global argv for early argument inspection (e.g., –color flag detection) Set by main() for access from lib/platform/terminal.c during early execution.
 
bool g_color_flag_passed = false
 Was –color explicitly passed in command-line arguments? Set by options_init() before RCU is initialized, used by terminal_should_color_output()
 
bool g_color_flag_value = false
 Value of –color flag (true if –color was in argv) Set by options_init() before RCU is initialized, used by terminal_should_color_output()
 

Detailed Description

🔧 Core utilities: memory management, safe macros, and cross-platform helpers

Definition in file common.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (constructor)  )

Register fork handlers for common module.

Definition at line 110 of file common.c.

110 {
111 pthread_atfork(NULL, NULL, asciichat_common_atfork_child);
112}