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

🔗 Global symbol stubs for test executables to satisfy linker dependencies More...

Go to the source code of this file.

Functions

 __attribute__ ((constructor))
 Test environment initialization (runs before main) Sets TESTING environment variable so libraries can detect test mode at runtime. This provides a fallback for when tests are run directly (not via ctest). CTest also sets TESTING=1 via set_tests_properties() in Tests.cmake. Also initializes the options RCU system so tests can use options_get().
 

Variables

atomic_t g_should_exit = {0}
 Global application exit flag (shared across all modes)
 

Detailed Description

🔗 Global symbol stubs for test executables to satisfy linker dependencies

Definition in file globals.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (constructor)  )

Test environment initialization (runs before main) Sets TESTING environment variable so libraries can detect test mode at runtime. This provides a fallback for when tests are run directly (not via ctest). CTest also sets TESTING=1 via set_tests_properties() in Tests.cmake. Also initializes the options RCU system so tests can use options_get().

Definition at line 21 of file globals.c.

21 {
22 platform_setenv("TESTING", "1");
23
24 // Initialize options RCU system with defaults for tests
25 // This must happen before any code calls options_get()
27}
int platform_setenv(const char *name, const char *value)
Set an environment variable.
Definition wasm/system.c:50
asciichat_error_t options_state_init(void)
Initialize RCU options system.
Definition rcu.c:370

References options_state_init(), and platform_setenv().

Variable Documentation

◆ g_should_exit

atomic_t g_should_exit = {0}

Global application exit flag (shared across all modes)

Global shutdown flag referenced by lib/logging.c and lib/debug/lock.c In production builds, this is defined in main.c and set during shutdown. For tests, we stub it out as false (tests don't perform shutdown).

Definition at line 34 of file globals.c.

34{0};

Referenced by client_audio_render_thread(), client_dispatch_thread(), client_receive_thread(), client_send_thread_func(), client_video_render_thread(), handle_image_frame_h265_packet(), handle_image_frame_packet(), server_main(), should_exit(), signal_exit(), stats_logger_thread(), and stop_client_render_threads().