|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Go to the source code of this file.
Data Structures | |
| struct | dimensions_update_ctx |
Macros | |
| #define | MAX_DEFERRED_FREES 64 |
Functions | |
| asciichat_error_t | options_state_init (void) |
| Initialize RCU options system. | |
| asciichat_error_t | options_state_set (const options_t *opts) |
| Set options from a parsed options struct. | |
| void | options_state_shutdown (void) |
| Shutdown RCU options system. | |
| const options_t * | options_get (void) |
| Get current options (lock-free read) | |
| asciichat_error_t | options_update (void(*updater)(options_t *, void *), void *context) |
| Update options using copy-on-write (thread-safe) | |
| asciichat_error_t | options_set_dimensions (unsigned short int width, unsigned short int height) |
| Update terminal dimensions. | |
| asciichat_error_t | options_set_color_mode (terminal_color_mode_t mode) |
| Update color mode. | |
| asciichat_error_t | options_set_render_mode (render_mode_t mode) |
| Update render mode. | |
| asciichat_error_t | options_set_log_level (log_level_t level) |
| Update log level. | |
| #define MAX_DEFERRED_FREES 64 |
| asciichat_error_t options_state_init | ( | void | ) |
Initialize RCU options system.
Must be called once at program startup before any threads access options. Allocates initial options struct and sets up atomic pointer.
Definition at line 117 of file rcu.c.
References options_state::address, options_state::address6, ASCIICHAT_OK, options_state::color_mode, COLOR_MODE_AUTO, options_state::compression_level, ERROR_MEMORY, ERROR_THREAD, log_debug, log_warn, options_state::max_clients, options_state::microphone_index, mutex_destroy(), mutex_init(), OPT_ADDRESS6_DEFAULT, OPT_ADDRESS_DEFAULT, OPT_COMPRESSION_LEVEL_DEFAULT, OPT_MAX_CLIENTS_DEFAULT, OPT_MICROPHONE_INDEX_DEFAULT, OPT_PORT_DEFAULT, OPT_RECONNECT_ATTEMPTS_DEFAULT, OPT_SPEAKERS_INDEX_DEFAULT, OPT_WEBCAM_INDEX_DEFAULT, options_state::port, options_state::reconnect_attempts, SAFE_MALLOC, SAFE_STRNCPY, SET_ERRNO, options_state::snapshot_delay, SNAPSHOT_DELAY_DEFAULT, options_state::speakers_index, and options_state::webcam_index.
Referenced by __attribute__(), and options_init().
| asciichat_error_t options_state_set | ( | const options_t * | opts | ) |
Set options from a parsed options struct.
Called by options_init() after parsing to publish the options struct to RCU. This atomically replaces the current options with the provided struct.
| opts | Pointer to options struct to publish (will be copied) |
Definition at line 176 of file rcu.c.
References ASCIICHAT_OK, ERROR_INVALID_PARAM, ERROR_INVALID_STATE, log_debug, and SET_ERRNO.
Referenced by options_init().
| void options_state_shutdown | ( | void | ) |
Shutdown RCU options system.
Frees the current options struct and cleans up resources. Should be called at program shutdown after all threads have exited.
Definition at line 197 of file rcu.c.
References log_debug, mutex_destroy(), and SAFE_FREE.
Referenced by asciichat_shared_init(), and server_main().