ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
options.h
Go to the documentation of this file.
1
202
203#pragma once
204
206
207/* Storage capacities in elements; text buffers include the terminating NUL. */
208#define OPTIONS_YT_DLP_OPTIONS_BUFFER_SIZE 512
209#define OPTIONS_COLOR_SCHEME_NAME_BUFFER_SIZE 64
210#define OPTIONS_VIDEO_CODEC_BUFFER_SIZE 64
211#define OPTIONS_PALETTE_CUSTOM_BUFFER_SIZE 256
212
213#include <stdbool.h>
215#include <stdio.h>
216#include <libplatform/terminal.h>
219#include "../discovery/strings.h"
220#include "explicit.h"
221
223#define COLOR_MODE_AUTO TERM_COLOR_AUTO
224#define COLOR_MODE_NONE TERM_COLOR_NONE
225#define COLOR_MODE_16 TERM_COLOR_16
226#define COLOR_MODE_16_COLOR TERM_COLOR_16
227#define COLOR_MODE_256 TERM_COLOR_256
228#define COLOR_MODE_256_COLOR TERM_COLOR_256
229#define COLOR_MODE_TRUECOLOR TERM_COLOR_TRUECOLOR
230
252
271
289
292
297
305#define OPTIONS_BUFF_SIZE 256
306
307// ============================================================================
308// GENERAL CATEGORY - General-purpose options (from --help registry)
309// ============================================================================
310
312#define OPT_HELP_DEFAULT false
313
315#define OPT_VERSION_DEFAULT false
316
318#define OPT_SPLASH_DEFAULT true
319
321#define OPT_SPLASH_SCREEN_EXPLICITLY_SET_DEFAULT false
322
324#define OPT_STATUS_SCREEN_DEFAULT true
325
327#define OPT_STATUS_SCREEN_EXPLICITLY_SET_DEFAULT false
328
330#define OPT_ENABLE_KEEPAWAKE_DEFAULT false
331
333#define OPT_DISABLE_KEEPAWAKE_DEFAULT false
334
336#define OPT_NO_CHECK_UPDATE_DEFAULT false
337
338// ============================================================================
339// LOGGING CATEGORY - Binary-level logging and output control options
340// ============================================================================
341
343#define OPT_QUIET_DEFAULT false
344
346#ifdef CMAKE_BUILD_TYPE_DEBUG
347#define OPT_OTEL_ENDPOINT_DEFAULT "http://127.0.0.1:24318"
348#else
349#define OPT_OTEL_ENDPOINT_DEFAULT ""
350#endif
351
353#define OPT_VERBOSE_LEVEL_DEFAULT 0
354
356#define OPT_LOG_LEVEL_DEFAULT LOG_INFO
357
359#define OPT_GREP_PATTERN_DEFAULT ""
360
362#define OPT_JSON_DEFAULT false
363
365#define OPT_COLOR_SCHEME_NAME_DEFAULT "pastel"
366
368#define OPT_LOG_TEMPLATE_DEFAULT_RELEASE \
369 "[%color(*, %H):%color(*, %M):%color(*, %S).%color(*, %ms)] [%color(*, %level_aligned)] " \
370 "%colored_message"
371
373#define OPT_LOG_TEMPLATE_DEFAULT_DEBUG \
374 "[%color(*, %H):%color(*, %M):%color(*, %S).%color(*, %ms)] [%color(*, %level_aligned)] " \
375 "[thread/%color(GREY, %tname)] %color(DEBUG, %file_relative):%color(GREY, %line)@%color(DEV, %func)(): " \
376 "%colored_message"
377
383#ifdef NDEBUG
384#define OPT_LOG_TEMPLATE_DEFAULT OPT_LOG_TEMPLATE_DEFAULT_RELEASE
385#else
386#define OPT_LOG_TEMPLATE_DEFAULT OPT_LOG_TEMPLATE_DEFAULT_DEBUG
387#endif
388
390#define OPT_LOG_FORMAT_OUTPUT_DEFAULT LOG_OUTPUT_TEXT
391
393#define OPT_LOG_FORMAT_CONSOLE_DEFAULT false
394
395// ============================================================================
396// TERMINAL CATEGORY - Terminal display options
397// ============================================================================
398
408#define OPT_WIDTH_DEFAULT 110
409
419#define OPT_HEIGHT_DEFAULT 70
420
422#define OPT_AUTO_WIDTH_DEFAULT true
423
425#define OPT_AUTO_HEIGHT_DEFAULT true
426
428#define OPT_COLOR_MODE_DEFAULT COLOR_MODE_AUTO
429
431#define OPT_LIST_WEBCAMS_DEFAULT false
432
434#define OPT_LIST_MICROPHONES_DEFAULT false
435
437#define OPT_LIST_SPEAKERS_DEFAULT false
438
440#define OPT_SHOW_CAPABILITIES_DEFAULT false
441
443#define OPT_FORCE_UTF8_DEFAULT UTF8_SETTING_AUTO
444
446#define OPT_STRIP_ANSI_DEFAULT false
447
449#define OPT_COLOR_DEFAULT COLOR_SETTING_AUTO
450
451// ============================================================================
452// DISPLAY CATEGORY - Display and rendering options
453// ============================================================================
454
456#define OPT_COLOR_FILTER_DEFAULT COLOR_FILTER_NONE
457
459#define OPT_RENDER_MODE_DEFAULT RENDER_MODE_FOREGROUND
460
462#define OPT_PALETTE_TYPE_DEFAULT PALETTE_STANDARD
463
465#define OPT_PALETTE_CUSTOM_SET_DEFAULT false
466
468#define OPT_STRETCH_DEFAULT false
469
471#define OPT_FPS_DEFAULT 0
472
474#define OPT_SNAPSHOT_MODE_DEFAULT false
475
484#if defined(__APPLE__)
485#define OPT_SNAPSHOT_DELAY_DEFAULT 4.0f
486#else
487#define OPT_SNAPSHOT_DELAY_DEFAULT 3.0f
488#endif
489
491#define OPT_MATRIX_RAIN_DEFAULT false
492
494#define OPT_FPS_COUNTER_DEFAULT false
495
497#define OPT_FLIP_X_DEFAULT true
498
500#define OPT_FLIP_Y_DEFAULT false
501
502// ============================================================================
503// WEBCAM CATEGORY - Webcam and capture device options
504// ============================================================================
505
507#define OPT_WEBCAM_INDEX_DEFAULT 0
508
510#define OPT_TEST_PATTERN_DEFAULT false
511
513#define OPT_NO_AUDIO_MIXER_DEFAULT false
514
515// ============================================================================
516// MEDIA CATEGORY - Media file streaming and playback options
517// ============================================================================
518
520#define OPT_MEDIA_LOOP_DEFAULT false
521
523#define OPT_MEDIA_FROM_STDIN_DEFAULT false
524
526#define OPT_MEDIA_SEEK_TIMESTAMP_DEFAULT 0.0
527
529#define OPT_PAUSE_DEFAULT false
530
531// ============================================================================
532// NETWORK CATEGORY - Network connectivity and protocol options
533// ============================================================================
534
536#define OPT_ADDRESS_DEFAULT "localhost"
537
539#define OPT_ADDRESS6_DEFAULT "::1"
540
551#ifdef NDEBUG
552#include "../network/acip/acds.h"
553#define OPT_ENDPOINT_DISCOVERY_SERVICE ACDS_OFFICIAL_SERVER_HOSTNAME
554#else
555#define OPT_ENDPOINT_DISCOVERY_SERVICE "localhost"
556#endif
557
559#define OPT_PORT_DEFAULT "27224"
560
562#define OPT_PORT_INT_DEFAULT 27224
563
565#define OPT_WEBSOCKET_PORT_SERVER_DEFAULT 27226
566
567#ifdef __cplusplus
568extern "C" {
569#endif
570
572#define OPT_WEBSOCKET_PORT_ACDS_DEFAULT 27227
573
575#define OPT_MCP_PORT_DEFAULT 27228
576
578#define OPT_MAX_CLIENTS_DEFAULT 9
579
581#define OPT_RECONNECT_ATTEMPTS_DEFAULT (-1)
582
584#define OPT_COMPRESSION_LEVEL_DEFAULT 3
585
587#define OPT_NO_COMPRESS_DEFAULT false
588
590#define OPT_ACDS_DEFAULT false
591
593#define OPT_ACDS_PORT_INT_DEFAULT 27225
594
596#define OPT_ACDS_PORT_DEFAULT "27225"
597
599#define OPT_ACDS_EXPOSE_IP_DEFAULT false
600
602#define OPT_ACDS_INSECURE_DEFAULT false
603
605#define OPT_REQUIRE_SERVER_IDENTITY_DEFAULT false
606
608#define OPT_REQUIRE_CLIENT_IDENTITY_DEFAULT false
609
611#define OPT_LAN_DISCOVERY_DEFAULT false
612
614#define OPT_NO_MDNS_ADVERTISE_DEFAULT false
615
617#define OPT_ENABLE_UPNP_DEFAULT false
618
625
627#define OPT_ENDPOINT_STUN_PRIMARY "stun:stun.ascii-chat.com:3478"
628
630#define OPT_ENDPOINT_STUN_FALLBACK "stun:stun.l.google.com:19302"
631
633#define OPT_ENDPOINT_STUN_SERVERS_DEFAULT OPT_ENDPOINT_STUN_PRIMARY "," OPT_ENDPOINT_STUN_FALLBACK
634
636#define OPT_ENDPOINT_TURN_PRIMARY "turn:turn.ascii-chat.com:3478"
637
639#define OPT_ENDPOINT_TURN_SERVERS_DEFAULT OPT_ENDPOINT_TURN_PRIMARY
640
642#define OPT_STUN_SERVER_HOST_PRIMARY "stun.ascii-chat.com"
643
645#define OPT_STUN_SERVER_PORT_PRIMARY 3478
646
648#define OPT_STUN_SERVER_HOST_FALLBACK "stun.l.google.com"
649
651#define OPT_STUN_SERVER_PORT_FALLBACK 19302
652
654#define OPT_TURN_SERVER_HOST "turn.ascii-chat.com"
655
657#define OPT_TURN_SERVER_PORT 3478
658
660#define OPT_STUN_SERVERS_DEFAULT OPT_ENDPOINT_STUN_SERVERS_DEFAULT
661
663#define OPT_TURN_SERVERS_DEFAULT OPT_ENDPOINT_TURN_SERVERS_DEFAULT
664
666
668#define OPT_WEBRTC_DEFAULT true
669
671#define OPT_PREFER_WEBRTC_DEFAULT false
672
674#define OPT_NO_WEBRTC_DEFAULT false
675
677#define OPT_WEBRTC_SKIP_STUN_DEFAULT false
678
680#define OPT_WEBRTC_DISABLE_TURN_DEFAULT false
681
683#define OPT_WEBRTC_SKIP_HOST_DEFAULT false
684
686#define OPT_WEBRTC_ICE_TIMEOUT_MS_DEFAULT 10000
687
689#define OPT_WEBRTC_RECONNECT_ATTEMPTS_DEFAULT 3
690
692#define OPT_TURN_USERNAME_DEFAULT ""
693
695#define OPT_TURN_CREDENTIAL_DEFAULT ""
696
697// ============================================================================
698// AUDIO CATEGORY - Audio capture, playback and processing options
699// ============================================================================
700
702#define OPT_AUDIO_ENABLED_DEFAULT true
703
705#define OPT_AUDIO_SOURCE_DEFAULT AUDIO_SOURCE_ALL
707#define OPT_AUDIO_CAPTURE_SOURCE_DEFAULT AUDIO_CAPTURE_SOURCE_AUTO
708
710#define OPT_MICROPHONE_INDEX_DEFAULT (-1)
711
713#define OPT_SPEAKERS_INDEX_DEFAULT (-1)
714
716#define OPT_MICROPHONE_SENSITIVITY_DEFAULT 1.0
717
719#define OPT_SPEAKERS_VOLUME_DEFAULT 1.0
720
722#define OPT_AUDIO_ANALYSIS_ENABLED_DEFAULT false
723
725#define OPT_AUDIO_NO_PLAYBACK_DEFAULT false
726
728#define OPT_ENCODE_AUDIO_DEFAULT true
729
730// ============================================================================
731// SECURITY CATEGORY - Encryption and authentication options
732// ============================================================================
733
735#define OPT_ENCRYPT_ENABLED_DEFAULT false
736
738#define OPT_NO_ENCRYPT_DEFAULT false
739
741#define OPT_NO_AUTH_DEFAULT false
742
744#define OPT_REQUIRE_SERVER_VERIFY_DEFAULT false
745
747#define OPT_REQUIRE_CLIENT_VERIFY_DEFAULT false
748
749// ============================================================================
750// CONFIGURATION CATEGORY - Application configuration options
751// ============================================================================
752
753// (Configuration options are typically handled separately via --config etc.)
754
755// ============================================================================
756// DATABASE CATEGORY - Database and persistent storage options
757// ============================================================================
758
759// (Database options are typically handled separately via --database etc.)
760
761// ============================================================================
762// String Default Values
763// ============================================================================
764
766#define OPT_STRING_EMPTY_DEFAULT ""
767
768// ============================================================================
769// Render-to-file Options
770// ============================================================================
771#define OPT_RENDER_FILE_DEFAULT ""
772#define OPT_RENDER_THEME_DEFAULT 0 // 0=dark, 1=light, 2=auto
773#define OPT_RENDER_FONT_DEFAULT ""
774#define OPT_RENDER_FONT_SIZE_DEFAULT 0.0
775
776// ============================================================================
777// Static Default Value Variables
778// ============================================================================
779// These are referenced from the registry and provide const void * pointers
780// for non-string default values. Defined alongside OPT_*_DEFAULT for clarity.
781
782static const int default_log_level_value = OPT_LOG_LEVEL_DEFAULT;
783static const bool default_quiet_value = OPT_QUIET_DEFAULT;
784static const bool default_json_value = OPT_JSON_DEFAULT;
785static const bool default_enable_keepawake_value = OPT_ENABLE_KEEPAWAKE_DEFAULT;
786static const bool default_disable_keepawake_value = OPT_DISABLE_KEEPAWAKE_DEFAULT;
787static const int default_width_value = OPT_WIDTH_DEFAULT;
788static const int default_height_value = OPT_HEIGHT_DEFAULT;
789static const int default_port_value = OPT_PORT_INT_DEFAULT;
790static const int default_websocket_port_value = OPT_WEBSOCKET_PORT_SERVER_DEFAULT;
791static const int default_webcam_index_value = OPT_WEBCAM_INDEX_DEFAULT;
792static const bool default_flip_x_value = OPT_FLIP_X_DEFAULT;
793static const bool default_flip_y_value = OPT_FLIP_Y_DEFAULT;
794static const int default_color_value = OPT_COLOR_DEFAULT;
795static const int default_color_mode_value = OPT_COLOR_MODE_DEFAULT;
796static const int default_color_filter_value = OPT_COLOR_FILTER_DEFAULT;
797static const int default_render_mode_value = OPT_RENDER_MODE_DEFAULT;
798static const int default_palette_type_value = OPT_PALETTE_TYPE_DEFAULT;
799static const bool default_show_capabilities_value = OPT_SHOW_CAPABILITIES_DEFAULT;
800static const int default_force_utf8_value = OPT_FORCE_UTF8_DEFAULT;
801static const bool default_stretch_value = OPT_STRETCH_DEFAULT;
802static const bool default_strip_ansi_value = OPT_STRIP_ANSI_DEFAULT;
803static const bool default_snapshot_mode_value = OPT_SNAPSHOT_MODE_DEFAULT;
804static const double default_snapshot_delay_value = OPT_SNAPSHOT_DELAY_DEFAULT;
805static const bool default_matrix_rain_value = OPT_MATRIX_RAIN_DEFAULT;
806static const bool default_waveform_value = false;
807static const bool default_fft_value = false;
808static const bool default_fps_counter_value = OPT_FPS_COUNTER_DEFAULT;
809static const int default_fps_value = OPT_FPS_DEFAULT;
810static const int default_compression_level_value = OPT_COMPRESSION_LEVEL_DEFAULT;
811static const bool default_no_compress_value = OPT_NO_COMPRESS_DEFAULT;
812static const bool default_encrypt_enabled_value = OPT_ENCRYPT_ENABLED_DEFAULT;
813static const bool default_no_encrypt_value = OPT_NO_ENCRYPT_DEFAULT;
814static const bool default_no_auth_value = OPT_NO_AUTH_DEFAULT;
815static const int default_max_clients_value = OPT_MAX_CLIENTS_DEFAULT;
816static const int default_reconnect_attempts_value = OPT_RECONNECT_ATTEMPTS_DEFAULT;
817static const int default_discovery_port_value = OPT_ACDS_PORT_INT_DEFAULT;
818static const bool default_discovery_value = OPT_ACDS_DEFAULT;
819static const bool default_enable_upnp_value = OPT_ENABLE_UPNP_DEFAULT;
820static const bool default_lan_discovery_value = OPT_LAN_DISCOVERY_DEFAULT;
821static const bool default_prefer_webrtc_value = OPT_PREFER_WEBRTC_DEFAULT;
822static const bool default_no_webrtc_value = OPT_NO_WEBRTC_DEFAULT;
823static const bool default_webrtc_skip_stun_value = OPT_WEBRTC_SKIP_STUN_DEFAULT;
824static const bool default_webrtc_relay_only_value = false;
825static const bool default_webrtc_disable_turn_value = OPT_WEBRTC_DISABLE_TURN_DEFAULT;
826static const bool default_webrtc_skip_host_value = OPT_WEBRTC_SKIP_HOST_DEFAULT;
827
828static const int default_webrtc_ice_timeout_ms_value = OPT_WEBRTC_ICE_TIMEOUT_MS_DEFAULT;
829
830static const bool default_media_loop_value = OPT_MEDIA_LOOP_DEFAULT;
831static const bool default_pause_value = OPT_PAUSE_DEFAULT;
832static const double default_media_seek_value = OPT_MEDIA_SEEK_TIMESTAMP_DEFAULT;
833static const bool default_audio_enabled_value = OPT_AUDIO_ENABLED_DEFAULT;
834static const audio_source_t default_audio_source_value = OPT_AUDIO_SOURCE_DEFAULT;
835static const audio_capture_source_t default_audio_capture_source_value = OPT_AUDIO_CAPTURE_SOURCE_DEFAULT;
836static const int default_microphone_index_value = OPT_MICROPHONE_INDEX_DEFAULT;
837static const int default_speakers_index_value = OPT_SPEAKERS_INDEX_DEFAULT;
838static const double default_microphone_sensitivity_value = OPT_MICROPHONE_SENSITIVITY_DEFAULT;
839static const double default_speakers_volume_value = OPT_SPEAKERS_VOLUME_DEFAULT;
840static const bool default_audio_analysis_value = OPT_AUDIO_ANALYSIS_ENABLED_DEFAULT;
841static const bool default_no_audio_playback_value = OPT_AUDIO_NO_PLAYBACK_DEFAULT;
842static const bool default_encode_audio_value = OPT_ENCODE_AUDIO_DEFAULT;
843static const bool default_no_encode_audio_value = !OPT_ENCODE_AUDIO_DEFAULT;
844static const bool default_no_audio_mixer_value = OPT_NO_AUDIO_MIXER_DEFAULT;
845static const bool default_discovery_expose_ip_value = OPT_ACDS_EXPOSE_IP_DEFAULT;
846static const bool default_discovery_insecure_value = OPT_ACDS_INSECURE_DEFAULT;
847static const bool default_require_server_identity_value = OPT_REQUIRE_SERVER_IDENTITY_DEFAULT;
848static const bool default_require_client_identity_value = OPT_REQUIRE_CLIENT_IDENTITY_DEFAULT;
849static const bool default_splash_value = OPT_SPLASH_DEFAULT;
850static const bool default_splash_false = false; // For --no-splash-screen option
851static const bool default_status_screen_value = OPT_STATUS_SCREEN_DEFAULT;
852static const bool default_no_check_update_value = OPT_NO_CHECK_UPDATE_DEFAULT;
853static const bool default_log_format_console_only_value = OPT_LOG_FORMAT_CONSOLE_DEFAULT;
854
855static const double default_debug_errno_stacks_time_value = 0.0;
856static const double default_debug_sync_state_time_value = 0.0;
857static const bool default_debug_sync_state_time_explicit_value = false;
858static const double default_debug_backtrace_time_value = 0.0;
859static const bool default_debug_backtrace_time_explicit_value = false;
860static const double default_debug_memory_report_interval_value = 0.0;
861static const bool default_debug_memory_report_interval_explicit_value = false;
862
863static const int default_render_theme_value = OPT_RENDER_THEME_DEFAULT;
864static const double default_render_font_size_value = OPT_RENDER_FONT_SIZE_DEFAULT;
865
867
872
907int strtoint_safe(const char *str);
908
910
926
945
952#define OPTION_MODE_SERVER_LIKE (OPTION_MODE_SERVER | OPTION_MODE_DISCOVERY_SVC)
953#define OPTION_MODE_CLIENT_LIKE (OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY)
954#define OPTION_MODE_NETWORKED (OPTION_MODE_SERVER | OPTION_MODE_CLIENT | OPTION_MODE_DISCOVERY_SVC | OPTION_MODE_DISCOVERY)
955
962#define ASCII_RENDERER_DEFAULT ASCII_RENDERER_GLYPH
963
974typedef struct options_state {
975 // ============================================================================
976 // Mode Detection (auto-detected during options_init)
977 // ============================================================================
980
981 // ============================================================================
982 // Binary-Level Options (parsed first, before mode selection)
983 // ============================================================================
984 bool help;
985 bool version;
987
988 // ============================================================================
989 // Terminal Dimensions
990 // ============================================================================
991 int width;
992 int height;
995
996 // ============================================================================
997 // Network Options
998 // ============================================================================
999#ifndef __EMSCRIPTEN__
1001#endif
1004 int port;
1023
1024 // ============================================================================
1025 // Discovery Service Options (server only)
1026 // ============================================================================
1029 // MCP HTTP transport
1040
1041 // ============================================================================
1042 // LAN Discovery Options
1043 // ============================================================================
1046
1047 // ============================================================================
1048 // Network Performance Options
1049 // ============================================================================
1053
1054 // ============================================================================
1055 // Client Reconnection Options
1056 // ============================================================================
1058
1059 // ============================================================================
1060 // Webcam Options
1061 // ============================================================================
1066
1067 // ============================================================================
1068 // Media File Streaming Options
1069 // ============================================================================
1076 bool pause;
1079
1080 // ============================================================================
1081 // Display Options
1082 // ============================================================================
1083 int color;
1084 terminal_color_mode_t color_mode;
1085 color_filter_t color_filter;
1087 terminal_render_mode_t render_mode;
1091 int fps;
1095 bool flip_x;
1098 bool flip_y;
1099
1100 // ============================================================================
1101 // Audio Configuration
1102 // ============================================================================
1117 bool fft;
1118 char fft_scale[32];
1127
1128 // ============================================================================
1129 // Image Options
1130 // ============================================================================
1134 bool stretch;
1136
1137 // ============================================================================
1138 // Output Options
1139 // ============================================================================
1140 bool quiet;
1141 unsigned short int verbose_level;
1144 int zalgo;
1148
1149 // OpenTelemetry export configuration.
1162 bool json;
1167
1168 // ============================================================================
1169 // Encryption Options
1170 // ============================================================================
1176 bool no_auth;
1179
1180 // Multi-key support: When multiple --key flags are provided, all keys are stored here
1181 // encrypt_key is duplicated in identity_keys[0] for backward compatibility
1184
1185 // ============================================================================
1186 // Identity Verification Options (ACDS + Crypto Handshake)
1187 // ============================================================================
1194
1195 // ============================================================================
1196 // WebRTC Connection Strategy Options (client-side fallback control)
1197 // ============================================================================
1206
1207 // ============================================================================
1208 // WebRTC Connectivity Options (ACDS mode only)
1209 // ============================================================================
1216
1217 // ============================================================================
1218 // Palette Configuration
1219 // ============================================================================
1224
1225 // ============================================================================
1226 // Splash Screen Options
1227 // ============================================================================
1233
1234 // ============================================================================
1235 // Diagnostics options
1236 // ============================================================================
1245
1246 // ============================================================================
1247 // Render-to-file options
1248 // ============================================================================
1250#ifndef __EMSCRIPTEN__
1252#endif
1256
1257 // Note: Luminance weights (weight_red, weight_green, weight_blue) and
1258 // lookup tables (RED[], GREEN[], BLUE[], GRAY[]) are kept as globals
1259 // since they're precomputed constants, not user-configurable options.
1261
1262// ============================================================================
1263// RCU-based thread-safe options access
1264// ============================================================================
1265
1276const options_t *options_get(void);
1277
1278const terminal_options_t *options_terminal_settings_ptr(void);
1279
1280/*
1281 * Keep terminal settings out of the Windows DLL return-value ABI. The
1282 * terminal_options_t record is larger than the register return size, so
1283 * returning it by value across asciichat.dll/libplatform.dll requires a
1284 * hidden return-buffer argument. Expose a stable settings record instead,
1285 * and pass its address through the platform API.
1286 */
1287#define options_terminal_settings() options_terminal_settings_ptr()
1288
1327#ifdef __cplusplus
1328#define ASCIICHAT_OPTION_FIELD_TYPE(field) decltype(((options_t *)0)->field)
1329#else
1330#define ASCIICHAT_OPTION_FIELD_TYPE(field) typeof(((options_t *)0)->field)
1331#endif
1332
1333#if defined(_MSC_VER)
1334/* MSVC C has neither GNU statement expressions nor typeof. All production
1335 * callers use GET_OPTION after options_init(), so use the direct typed field
1336 * access that preserves the macro's zero-overhead behavior. */
1337#define GET_OPTION(field) (options_get()->field)
1338#else
1339#define GET_OPTION(field) \
1340 ({ \
1341 const options_t *_opts = options_get(); \
1342 if (!_opts) { \
1343 log_warn("GET_OPTION(" #field ") called but options not initialized"); \
1344 } \
1345 static ASCIICHAT_OPTION_FIELD_TYPE(field) _default = {0}; \
1346 (_opts ? (_opts->field) : _default); \
1347 })
1348#endif
1349
1378
1395asciichat_error_t options_set_int(const char *field_name, int value);
1396asciichat_error_t options_set_bool(const char *field_name, bool value);
1397asciichat_error_t options_set_string(const char *field_name, const char *value);
1398asciichat_error_t options_set_double(const char *field_name, double value);
1399
1424const char *options_get_help_text(asciichat_mode_t mode, const char *option_name);
1425
1432extern ASCIICHAT_API const float weight_red;
1433
1442extern ASCIICHAT_API const float weight_green;
1443
1452extern ASCIICHAT_API const float weight_blue;
1453
1468extern unsigned short int RED[];
1469
1476extern unsigned short int GREEN[];
1477
1484extern unsigned short int BLUE[];
1485
1493extern unsigned short int GRAY[];
1494
1496
1507bool has_action_flag(void);
1508
1513
1588
1614
1761asciichat_error_t options_init(int argc, char **argv);
1762
1805void usage(FILE *stream, asciichat_mode_t mode);
1806
1808
1813
1850
1887
1893extern ASCIICHAT_API uint64_t g_snapshot_first_frame_rendered_ns; // Timestamp when first frame was rendered (nanoseconds)
1894extern uint64_t g_snapshot_first_capture_ns; // Timestamp when first frame was captured (nanoseconds)
1895extern uint64_t g_snapshot_actual_duration_ms; // Actual wall-clock duration in ms when snapshot timeout reached
1896
1898
1900void options_resolve_flip_x(options_t *opts, bool explicitly_set);
1901
1903
1904#ifdef __cplusplus
1905}
1906#endif
ascii-chat Discovery Service (ACDS) Protocol Message Formats
Check if an option was explicitly set via command-line.
unsigned long long uint64_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
#define MAX_SESSION_KEYS
log_level_t
Logging levels enumeration.
Definition log/types.h:33
utf8_setting_t
UTF-8 support setting (–utf8 flag values).
Definition options.h:263
audio_capture_source_t
Definition options.h:291
#define OPT_STRIP_ANSI_DEFAULT
Default strip ANSI escape sequences flag.
Definition options.h:446
#define OPT_WEBRTC_SKIP_STUN_DEFAULT
Default WebRTC skip STUN flag (false = use STUN).
Definition options.h:677
#define OPT_ACDS_EXPOSE_IP_DEFAULT
Default ACDS expose IP flag (false = private by default).
Definition options.h:599
#define OPTIONS_PALETTE_CUSTOM_BUFFER_SIZE
Definition options.h:211
unsigned short int GRAY[256]
Grayscale lookup table.
const char * options_get_help_text(asciichat_mode_t mode, const char *option_name)
Get help text for an option in a specific mode.
Definition help_api.c:27
unsigned short int BLUE[256]
Blue channel lookup table.
#define OPT_COLOR_DEFAULT
Default color setting (COLOR_SETTING_AUTO = smart detection).
Definition options.h:449
#define OPT_NO_AUDIO_MIXER_DEFAULT
Default no audio mixer flag (false = enable mixer).
Definition options.h:513
#define OPT_FLIP_Y_DEFAULT
Default vertical flip state (false = no vertical flip).
Definition options.h:500
#define OPT_SHOW_CAPABILITIES_DEFAULT
Default show terminal capabilities flag.
Definition options.h:440
#define OPT_NO_ENCRYPT_DEFAULT
Default no encrypt flag (false = allow encryption).
Definition options.h:738
#define OPT_QUIET_DEFAULT
Default quiet mode flag (false = logging enabled).
Definition options.h:343
asciichat_mode_t
Mode type for options parsing.
Definition options.h:916
asciichat_error_t options_set_int(const char *field_name, int value)
Check if an option was explicitly set via command-line.
Definition rcu.c:964
#define OPT_MICROPHONE_INDEX_DEFAULT
Default microphone device index (-1 means system default).
Definition options.h:710
struct options_state options_t
Immutable, RCU-published snapshot of the application's runtime configuration.
#define OPT_ENCODE_AUDIO_DEFAULT
Default audio encoding state (true = Opus encoding enabled).
Definition options.h:728
#define OPT_COLOR_MODE_DEFAULT
Default color mode (auto-detect terminal capabilities).
Definition options.h:428
#define OPT_PALETTE_TYPE_DEFAULT
Default palette type (standard ASCII art).
Definition options.h:462
#define OPT_RECONNECT_ATTEMPTS_DEFAULT
Default reconnect attempts (-1 means auto/infinite).
Definition options.h:581
#define OPT_SPEAKERS_VOLUME_DEFAULT
Default speakers volume (1.0 = normal volume).
Definition options.h:719
int strtoint_safe(const char *str)
Safely parse string to integer with validation.
void update_dimensions_to_terminal_size(options_t *opts)
Update dimensions to match current terminal size.
#define OPT_NO_AUTH_DEFAULT
Default no auth flag (false = allow authentication).
Definition options.h:741
#define OPT_WEBRTC_ICE_TIMEOUT_MS_DEFAULT
Default WebRTC ICE gathering timeout in milliseconds (10 seconds).
Definition options.h:686
#define OPT_COMPRESSION_LEVEL_DEFAULT
Default compression level (1-9).
Definition options.h:584
#define OPT_ENCRYPT_ENABLED_DEFAULT
Default encrypt enabled flag (true = encryption required).
Definition options.h:735
#define OPT_REQUIRE_SERVER_IDENTITY_DEFAULT
Default require-server-identity setting for ACDS.
Definition options.h:605
#define OPT_ENABLE_KEEPAWAKE_DEFAULT
Default keep-awake (prevent system sleep) flag (false = normal system sleep).
Definition options.h:330
#define OPT_RENDER_MODE_DEFAULT
Default render mode (foreground characters only).
Definition options.h:459
#define OPT_ACDS_PORT_INT_DEFAULT
Default ACDS discovery service port (integer).
Definition options.h:593
#define OPT_AUDIO_ENABLED_DEFAULT
Default audio enabled flag (true = audio enabled by default).
Definition options.h:702
#define OPT_MATRIX_RAIN_DEFAULT
Default Matrix rain effect flag (false = disabled).
Definition options.h:491
#define OPT_FORCE_UTF8_DEFAULT
Default force UTF-8 support setting (auto-detect).
Definition options.h:443
const float weight_blue
Blue weight for luminance calculation.
#define OPTIONS_YT_DLP_OPTIONS_BUFFER_SIZE
Definition options.h:208
#define OPTIONS_COLOR_SCHEME_NAME_BUFFER_SIZE
Definition options.h:209
#define OPT_RENDER_FONT_SIZE_DEFAULT
Definition options.h:774
#define OPT_SPLASH_DEFAULT
Default splash screen flag (true = show splash, false = hide splash).
Definition options.h:318
#define OPT_RENDER_THEME_DEFAULT
Definition options.h:772
#define OPT_FPS_COUNTER_DEFAULT
Default FPS counter overlay flag (false = disabled).
Definition options.h:494
#define OPT_AUDIO_ANALYSIS_ENABLED_DEFAULT
Default audio analysis enabled flag.
Definition options.h:722
const terminal_options_t * options_terminal_settings_ptr(void)
Definition rcu.c:541
asciichat_error_t options_set_double(const char *field_name, double value)
Definition rcu.c:977
const options_t * options_get(void)
Get current options (lock-free read).
Definition rcu.c:513
const float weight_red
Red weight for luminance calculation.
#define OPT_ACDS_DEFAULT
Default ACDS registration flag (false = disabled).
Definition options.h:590
#define OPTIONS_BUFF_SIZE
Buffer size for option string values.
Definition options.h:305
#define OPT_NO_COMPRESS_DEFAULT
Default no compression flag (false = enable compression).
Definition options.h:587
asciichat_error_t options_init(int argc, char **argv)
Initialize options by parsing command-line arguments with unified mode detection.
Definition options.c:2541
audio_source_t
Audio source selected for visualization.
Definition options.h:277
option_mode_bitmask_t
Option mode bitmask.
Definition options.h:933
#define OPT_AUDIO_NO_PLAYBACK_DEFAULT
Default audio playback flag (false = enable playback).
Definition options.h:725
#define OPT_PAUSE_DEFAULT
Default pause media flag (false = play immediately).
Definition options.h:529
#define OPTIONS_VIDEO_CODEC_BUFFER_SIZE
Definition options.h:210
#define OPT_AUDIO_SOURCE_DEFAULT
Visualize all available sources by default.
Definition options.h:705
asciichat_error_t options_set_string(const char *field_name, const char *value)
Definition rcu.c:981
asciichat_error_t options_set_bool(const char *field_name, bool value)
Definition rcu.c:973
#define OPT_COLOR_FILTER_DEFAULT
Default color filter (none - no filtering).
Definition options.h:456
#define OPT_WEBCAM_INDEX_DEFAULT
Default webcam device index.
Definition options.h:507
void usage(FILE *stream, asciichat_mode_t mode)
Print usage information for a specific mode.
#define OPT_HEIGHT_DEFAULT
Default terminal height in characters.
Definition options.h:419
unsigned short int GREEN[256]
Green channel lookup table.
#define OPT_SNAPSHOT_MODE_DEFAULT
Default snapshot mode flag (false = continuous).
Definition options.h:474
#define OPT_MEDIA_LOOP_DEFAULT
Default loop media flag (false = play once).
Definition options.h:520
#define OPT_NO_CHECK_UPDATE_DEFAULT
Default no-check-update flag (false = check for updates enabled).
Definition options.h:336
#define OPT_STRETCH_DEFAULT
Default allow aspect ratio distortion flag.
Definition options.h:468
#define OPT_STATUS_SCREEN_DEFAULT
Default status screen flag (true = show status, false = hide status).
Definition options.h:324
#define OPT_LAN_DISCOVERY_DEFAULT
Default LAN discovery flag (false = discovery disabled).
Definition options.h:611
#define OPT_JSON_DEFAULT
Default JSON logging flag (false = text output).
Definition options.h:362
#define OPT_ACDS_INSECURE_DEFAULT
Default ACDS insecure mode flag (false = verify server).
Definition options.h:602
bool has_action_flag(void)
Check if an action flag was detected.
Definition options.c:280
#define OPT_FPS_DEFAULT
Default FPS (frames per second).
Definition options.h:471
#define OPT_REQUIRE_CLIENT_IDENTITY_DEFAULT
Default require-client-identity setting for ACDS.
Definition options.h:608
color_setting_t
For options state, this is the live record that ties detected_mode, mode_arg_index,...
Definition options.h:244
#define OPT_DISABLE_KEEPAWAKE_DEFAULT
Default disable keep-awake flag (false = allow system sleep prevention).
Definition options.h:333
#define OPT_ENABLE_UPNP_DEFAULT
Default enable UPnP flag (false = UPnP disabled).
Definition options.h:617
#define OPT_WEBRTC_SKIP_HOST_DEFAULT
Default WebRTC skip host candidates flag (false = use host candidates).
Definition options.h:683
#define OPT_LOG_FORMAT_CONSOLE_DEFAULT
Default log format console only flag (false = use default format everywhere).
Definition options.h:393
#define OPT_SNAPSHOT_DELAY_DEFAULT
Default snapshot delay in seconds.
Definition options.h:487
const float weight_green
Green weight for luminance calculation.
#define OPT_LOG_LEVEL_DEFAULT
Default log level (LOG_INFO).
Definition options.h:356
#define OPT_MICROPHONE_SENSITIVITY_DEFAULT
Default microphone sensitivity (1.0 = normal volume).
Definition options.h:716
#define OPT_FLIP_X_DEFAULT
Webcam input is mirrored unless an orientation is explicitly selected.
Definition options.h:497
#define OPT_PORT_INT_DEFAULT
Default TCP port for client/server communication (integer).
Definition options.h:562
unsigned short int RED[256]
Red channel lookup table.
#define OPT_MAX_CLIENTS_DEFAULT
Default maximum concurrent clients (server only).
Definition options.h:578
#define OPT_PREFER_WEBRTC_DEFAULT
Default prefer WebRTC flag (false = try direct TCP first).
Definition options.h:671
options_t options_t_new(void)
Initialize options by parsing command-line arguments.
Definition options.c:688
#define OPT_WEBRTC_DISABLE_TURN_DEFAULT
Default WebRTC disable TURN flag (false = use TURN).
Definition options.h:680
#define OPT_NO_WEBRTC_DEFAULT
Default no WebRTC flag (false = WebRTC enabled).
Definition options.h:674
#define OPT_AUDIO_CAPTURE_SOURCE_DEFAULT
Preserve automatic local audio capture selection by default.
Definition options.h:707
#define OPT_SPEAKERS_INDEX_DEFAULT
Default speakers device index (-1 means system default).
Definition options.h:713
void update_dimensions_for_full_height(options_t *opts)
Update dimensions to use full terminal height while maintaining aspect ratio.
#define OPT_WEBSOCKET_PORT_SERVER_DEFAULT
Default WebSocket port for server mode (integer).
Definition options.h:565
#define OPT_MEDIA_SEEK_TIMESTAMP_DEFAULT
Default media seek timestamp (start from beginning).
Definition options.h:526
#define OPT_WIDTH_DEFAULT
Default terminal width in characters.
Definition options.h:408
@ UTF8_SETTING_AUTO
Smart detection (default): UTF-8 if terminal supports it.
Definition options.h:265
@ UTF8_SETTING_FALSE
Force UTF-8 OFF: disable UTF-8 support.
Definition options.h:269
@ UTF8_SETTING_TRUE
Force UTF-8 ON: always use UTF-8 regardless of terminal capability.
Definition options.h:267
@ AUDIO_CAPTURE_SOURCE_BOTH
Definition options.h:291
@ AUDIO_CAPTURE_SOURCE_REMOTE
Definition options.h:291
@ AUDIO_CAPTURE_SOURCE_MEDIA
Definition options.h:291
@ AUDIO_CAPTURE_SOURCE_MIC
Definition options.h:291
@ AUDIO_CAPTURE_SOURCE_AUTO
Definition options.h:291
@ MODE_CLIENT
Client mode - network client options.
Definition options.h:918
@ MODE_MCP_SERVER
Model Context Protocol rendering server.
Definition options.h:922
@ MODE_DISCOVERY_SERVICE
Discovery server mode - session management and WebRTC signaling.
Definition options.h:920
@ MODE_API_SERVER
Image-to-ASCII HTTP API server.
Definition options.h:923
@ MODE_INVALID
Invalid mode.
Definition options.h:924
@ MODE_SERVER
Server mode - network server options.
Definition options.h:917
@ MODE_MIRROR
Mirror mode - local webcam viewing (no network).
Definition options.h:919
@ MODE_DISCOVERY
Discovery mode - participant that can dynamically become host.
Definition options.h:921
@ AUDIO_SOURCE_MIC
Definition options.h:283
@ AUDIO_SOURCE_CALL
Definition options.h:281
@ AUDIO_SOURCE_MEDIA
Definition options.h:285
@ AUDIO_SOURCE_ALL
Definition options.h:279
@ AUDIO_SOURCE_AUTO
Definition options.h:287
@ OPTION_MODE_ALL
All modes + binary.
Definition options.h:943
@ OPTION_MODE_BINARY
Binary-level options (parsed before mode detection).
Definition options.h:942
@ OPTION_MODE_CLIENT
Client mode (bit 1).
Definition options.h:936
@ OPTION_MODE_API_SERVER
Definition options.h:941
@ OPTION_MODE_DISCOVERY
Discovery mode (bit 4).
Definition options.h:939
@ OPTION_MODE_SERVER
Server mode (bit 0).
Definition options.h:935
@ OPTION_MODE_MIRROR
Mirror mode (bit 2).
Definition options.h:937
@ OPTION_MODE_NONE
No modes (invalid).
Definition options.h:934
@ OPTION_MODE_MCP_SERVER
Definition options.h:940
@ OPTION_MODE_DISCOVERY_SVC
Discovery server mode (bit 3).
Definition options.h:938
@ COLOR_SETTING_TRUE
Force colors ON: always colorize regardless of TTY/piping/CLAUDECODE.
Definition options.h:248
@ COLOR_SETTING_FALSE
Force colors OFF: disable all colors and logging colors.
Definition options.h:250
@ COLOR_SETTING_AUTO
Smart detection (default): colors if TTY and not CLAUDECODE and not piping.
Definition options.h:246
palette_type_t
Built-in palette type enumeration.
Definition palette.h:96
#define ASCIICHAT_API
Export symbols on Unix platforms (Linux, macOS).
Definition api.h:87
void options_resolve_flip_x(options_t *opts, bool explicitly_set)
Definition options.c:2692
asciichat_error_t options_validate_libflags(options_t *options)
Definition options.c:1762
ASCII Palette Management for Video-to-ASCII Conversion.
bool g_snapshot_first_frame_rendered
uint64_t g_snapshot_first_frame_rendered_ns
uint64_t g_snapshot_first_capture_ns
uint64_t g_snapshot_actual_duration_ms
#define SESSION_STRING_BUFFER_SIZE
Immutable, RCU-published snapshot of the application's runtime configuration.
Definition options.h:974
char otel_ca_file[256]
Definition options.h:1152
bool snapshot_mode
Snapshot mode (one frame and exit).
Definition options.h:1142
int otel_realtime_max_per_second
Definition options.h:1155
int zalgo
Combining-mark intensity (0 = disabled, 1-10 = enabled).
Definition options.h:1144
bool splash_screen_explicitly_set
True if splash screen was explicitly set by user.
Definition options.h:1229
float speakers_volume
Speaker volume multiplier (0.0-1.0, default 1.0).
Definition options.h:1124
int discovery_port
discovery server port (default: 27225)
Definition options.h:1035
char media_url[256]
Network URL (HTTP/HTTPS/YouTube/RTSP) - takes priority over media_file.
Definition options.h:1072
bool render_kitty
Display a snapshot with Kitty graphics.
Definition options.h:1251
double otel_realtime_sample_rate
Definition options.h:1154
bool flip_x_explicit
User selected an orientation for this process lifetime.
Definition options.h:1096
size_t num_identity_keys
Number of identity keys loaded (0 means single-key mode using encrypt_key).
Definition options.h:1183
bool audio_spectral_agc
Definition options.h:1105
char webtransport_path[256]
HTTP/3 CONNECT path.
Definition options.h:1011
int test_pattern_index
Synthetic pattern selector (0 or 1).
Definition options.h:1064
bool discovery_quic
Use QUIC for a disclosed discovery host endpoint.
Definition options.h:1016
audio_capture_source_t audio_capture_source
Local capture/media selection policy.
Definition options.h:1115
bool encrypt_enabled
Enable encryption.
Definition options.h:1171
int otel_metrics_interval
Definition options.h:1156
terminal_color_mode_t color_mode
Color mode (auto/none/16/256/truecolor).
Definition options.h:1084
bool audio_spectral_gate
Definition options.h:1108
char quic_bind_address[256]
Concrete local QUIC listener address; empty disables QUIC.
Definition options.h:1012
bool discovery_expose_ip
ACDS: explicitly allow public IP disclosure without verification (opt-in).
Definition options.h:1192
char turn_servers[256]
ACDS: Comma-separated list of TURN server URLs.
Definition options.h:1212
int force_utf8
UTF-8 support setting (auto/true/false).
Definition options.h:1089
int webrtc_ice_timeout_ms
–webrtc-ice-timeout: ICE gathering timeout in milliseconds (default: 10000)
Definition options.h:1205
bool debug_backtrace_time_explicit
True if –backtrace was explicitly provided.
Definition options.h:1242
bool discovery
Enable discovery session registration (default: false).
Definition options.h:1027
char render_font[256]
Font family name or .ttf path (empty = platform default).
Definition options.h:1254
bool audio_adaptive_eq
Definition options.h:1111
double debug_memory_report_interval
Interval in seconds for periodic memory reports.
Definition options.h:1243
bool webrtc_relay_only
–webrtc-relay-only: Require TURN relay candidates
Definition options.h:1202
bool disable_keepawake
Explicitly disable system sleep prevention (allow OS to sleep).
Definition options.h:1166
char mcp_downloads_url_prefix[256]
Public HTTP origin for download links.
Definition options.h:1032
int otel_queue_capacity
Definition options.h:1158
bool test_audio
Replace microphone capture with a repeating audible test signal.
Definition options.h:1104
int microphone_channel
First zero-based input channel; -1 downmixes all inputs.
Definition options.h:1120
bool debug_sync_state_time_explicit
True if –sync-state was explicitly provided.
Definition options.h:1240
char log_template[256]
Custom log format string (formerly –log-format).
Definition options.h:1163
float microphone_sensitivity
Microphone volume multiplier (0.0-1.0, default 1.0).
Definition options.h:1123
int microphone_channels
Selected microphone channels: 1 (speech) or 2 (stereo).
Definition options.h:1119
int compression_level
zstd compression level (1-9)
Definition options.h:1050
bool fps_explicitly_set
True if FPS was explicitly configured by the user.
Definition options.h:1092
bool fft
Replace the video image with a live audio frequency spectrogram.
Definition options.h:1117
media_playlist_t media_playlist
Ordered CLI artifacts shared with live media input.
Definition options.h:1070
bool enable_keepawake
Explicitly enable system sleep prevention.
Definition options.h:1165
double debug_sync_state_time
Time parameter for –sync-state.
Definition options.h:1239
char webrtc_bind_address[256]
Optional numeric local address for WebRTC ICE sockets.
Definition options.h:1200
char otel_endpoint[256]
Definition options.h:1151
bool show_capabilities
Show terminal capabilities and exit.
Definition options.h:1088
bool no_mdns_advertise
Disable mDNS service advertisement (server only).
Definition options.h:1045
bool fps_counter
Show FPS counter overlay in top-right corner.
Definition options.h:1146
char password[256]
Password string.
Definition options.h:1173
int microphone_index
Microphone device index (-1 = default).
Definition options.h:1121
char config_file[256]
Config file path (–config).
Definition options.h:986
asciichat_mode_t detected_mode
Mode detected from command-line arguments.
Definition options.h:978
bool strip_ansi
Strip ANSI escape sequences.
Definition options.h:1147
bool audio_analysis_enabled
Enable audio analysis (debug).
Definition options.h:1125
int websocket_port
WebSocket server port (server/discovery-service only).
Definition options.h:1005
bool audio_pitch_correct
Definition options.h:1103
bool palette_explicit
Palette explicitly selected.
Definition options.h:1223
bool pause
Start playback paused (toggle with spacebar).
Definition options.h:1076
audio_source_t audio_source
Visualization source (all/call/mic/media).
Definition options.h:1114
bool json
Enable JSON logging (–json flag).
Definition options.h:1162
char stun_servers[256]
ACDS: Comma-separated list of STUN server URLs.
Definition options.h:1211
int height
Terminal height in characters (int for OPTION_TYPE_INT compat).
Definition options.h:992
char webtransport_bind_address[256]
Browser HTTP/3 listener address.
Definition options.h:1009
bool enable_upnp
Opt-in TCP/WebSocket and WebRTC UDP mapping via –port-forwarding.
Definition options.h:1210
bool debug_errno_stacks_time_explicit
True if –errno-stacks was provided.
Definition options.h:1238
bool face_follow
Automatically frame and follow the selected face.
Definition options.h:1093
bool webrtc_skip_stun
–webrtc-skip-stun: Skip Stage 2 (STUN), go to TURN
Definition options.h:1201
bool debug_memory_report_interval_explicit
True if –memory-report was explicitly provided.
Definition options.h:1244
bool log_format_console_only
Apply log format only to console output.
Definition options.h:1164
bool lan_discovery
Enable LAN service discovery via mDNS (client only).
Definition options.h:1044
double debug_errno_stacks_time
Delay before the error report.
Definition options.h:1237
char session_string[(38+1)]
Definition options.h:1021
char identity_keys[32][256]
All identity keys (populated when –key is used multiple times).
Definition options.h:1182
int stats_interval
Periodic plain statistics on stdout; zero disables.
Definition options.h:1090
char tls_key[256]
Shared TLS private key file path for secure network listeners.
Definition options.h:1007
bool audio_enabled
Enable audio streaming.
Definition options.h:1113
char tls_ca_file[256]
Shared TLS client trust anchors; empty uses system trust.
Definition options.h:1013
bool no_encrypt
Disable encryption (opt-out).
Definition options.h:1175
bool no_webrtc
–no-webrtc: Disable WebRTC, use Direct TCP only
Definition options.h:1199
bool audio_multiband
Definition options.h:1110
bool matrix_rain
Matrix digital rain effect (false = disabled).
Definition options.h:1145
bool webrtc_disable_turn
–webrtc-disable-turn: Disable Stage 3 (TURN), use STUN only
Definition options.h:1203
char tls_key_password[256]
Shared TLS private key password.
Definition options.h:1008
int quic_fallback_port
TCP fallback port, or zero to disable fallback.
Definition options.h:1019
bool audio_no_playback
Disable speaker playback (debug).
Definition options.h:1126
bool face_follow_debug
Developer diagnostic face outline.
Definition options.h:1094
char mcp_transport[256]
MCP transport: stdio or http.
Definition options.h:1033
bool auto_height
Auto-detect height from terminal.
Definition options.h:994
log_level_t log_level
Log level threshold.
Definition options.h:1160
char render_file[256]
Output file path (e.g. output.mp4).
Definition options.h:1249
char turn_credential[256]
ACDS: Credential/password for TURN authentication.
Definition options.h:1214
bool require_server_identity
ACDS: require servers to provide signed Ed25519 identity.
Definition options.h:1188
int audio_fft_size
Definition options.h:1112
char palette_custom[256]
Custom palette characters.
Definition options.h:1221
bool status_screen
Show status screen (default: true = show, use –no-status-screen to hide).
Definition options.h:1230
char otel_log_level[256]
Definition options.h:1150
int max_clients
Maximum concurrent clients (server only).
Definition options.h:1020
bool palette_custom_set
True if custom palette was set.
Definition options.h:1222
bool no_auth
Disable authentication layer (–no-auth).
Definition options.h:1176
terminal_render_mode_t render_mode
Render mode (foreground/background/half-block).
Definition options.h:1087
bool splash_screen
Show splash screen (default: true = show, use –no-splash-screen to hide).
Definition options.h:1228
char discovery_database_path[256]
~/.ascii-chat/discovery.db)
Definition options.h:1038
char server_key[256]
Expected server public key (client).
Definition options.h:1177
bool media_input
Active input is a file/URL rather than the webcam.
Definition options.h:1097
bool no_audio_mixer
Disable audio mixer (debug).
Definition options.h:1065
bool audio_spectral_mixer
Explicit post-mix processing; disabled by default.
Definition options.h:1107
char encrypt_keyfile[256]
Alternative key file path.
Definition options.h:1174
char http_origin[256]
Allowed HTTP Origin.
Definition options.h:1034
bool webrtc_skip_host
–webrtc-skip-host: Skip host candidates, force STUN/TURN only
Definition options.h:1204
char tls_cert[256]
Shared TLS certificate file path for secure network listeners.
Definition options.h:1006
bool version
Show version information.
Definition options.h:985
int webcam_index
Webcam device index (0 = first).
Definition options.h:1062
bool status_screen_explicitly_set
True if status_screen was explicitly set by user.
Definition options.h:1231
bool mcp_server_restricted
Restrict MCP capabilities for cloud deployment.
Definition options.h:1030
bool stabilize
Reduce frame-to-frame character flicker.
Definition options.h:1131
bool no_compress
Disable compression entirely.
Definition options.h:1051
char address6[256]
IPv6 bind address (server only).
Definition options.h:1003
int speakers_index
Speakers device index (-1 = default).
Definition options.h:1122
int quic_port
QUIC UDP port, or zero to use the TCP server port.
Definition options.h:1018
color_filter_t color_filter
Monochromatic color filter (none/black/white/green/etc).
Definition options.h:1085
bool help
Show help message.
Definition options.h:984
bool prefer_webrtc
–prefer-webrtc: Try WebRTC before Direct TCP
Definition options.h:1198
bool quiet
Quiet mode (suppress logs).
Definition options.h:1140
double snapshot_delay
Snapshot delay in seconds.
Definition options.h:1143
char mcp_downloads_dir[256]
Hosted download directory override.
Definition options.h:1031
bool stabilize_explicit
Runtime preference was explicitly changed.
Definition options.h:1132
bool audio_spectral
Definition options.h:1106
int fps
Target framerate (0 = auto, 1-144).
Definition options.h:1091
bool stretch
Allow aspect ratio distortion.
Definition options.h:1134
bool address_explicit
Native client destination overrides automatic LAN discovery.
Definition options.h:1000
ascii_renderer_t renderer
Character selection algorithm.
Definition options.h:1133
bool waveform
Replace the video image with a live audio waveform.
Definition options.h:1116
bool quic_visual_datagrams
Prefer negotiated visual datagrams.
Definition options.h:1014
int reconnect_attempts
Number of reconnection attempts (-1=infinite, 0=none).
Definition options.h:1057
bool test_pattern
Use test pattern instead of webcam.
Definition options.h:1063
bool quic_audio_datagrams
Prefer negotiated QUIC datagrams for audio.
Definition options.h:1015
char fft_scale[32]
Amplitude scale for the FFT visualization.
Definition options.h:1118
int port
Server port number.
Definition options.h:1004
char video_codec[64]
Video codec (auto, hevc, h264, raw) - default: auto.
Definition options.h:1135
bool media_from_stdin
Reading from stdin (detected from "--file -").
Definition options.h:1074
char yt_dlp_options[512]
"--cookies-from-browser=chrome --embed-subs")
Definition options.h:1077
bool require_client_verify
Client: only connect to servers whose identity was verified by ACDS.
Definition options.h:1191
char discovery_server[256]
discovery server address (default: 127.0.0.1)
Definition options.h:1028
double debug_backtrace_time
Time parameter for –backtrace option.
Definition options.h:1241
int width
Terminal width in characters (int for OPTION_TYPE_INT compat).
Definition options.h:991
int mode_arg_index
Explicit mode token in original argv, or -1 for implicit discovery/session strings.
Definition options.h:979
bool require_server_verify
Server: only accept clients who verified via ACDS.
Definition options.h:1190
palette_type_t palette_type
Selected palette type.
Definition options.h:1220
bool flip_y
Flip video vertically (Y-axis).
Definition options.h:1098
char color_scheme_name[64]
Color scheme name (e.g., "pastel", "nord").
Definition options.h:1086
char turn_secret[256]
ACDS: Shared secret for dynamic TURN credential generation (HMAC-SHA1).
Definition options.h:1215
bool media_loop
Loop media file playback.
Definition options.h:1073
char discovery_service_key[256]
HTTPS URL).
Definition options.h:1036
bool require_client_identity
ACDS: require clients to provide signed Ed25519 identity.
Definition options.h:1189
char webtransport_public_url[256]
Public HTTPS WebTransport endpoint advertised through ACDS.
Definition options.h:1017
bool discovery_insecure
ACDS: skip server key verification (MITM-vulnerable, requires explicit opt-in).
Definition options.h:1193
bool no_check_update
Disable automatic update checks (default: false = checks enabled).
Definition options.h:1232
bool encode_audio
Enable Opus audio encoding.
Definition options.h:1052
int render_theme
0=dark 1=light 2=auto
Definition options.h:1253
char encrypt_key[256]
SSH/GPG key file path (first –key flag, kept for compatibility).
Definition options.h:1172
char media_file[256]
Media file path or "-" for stdin.
Definition options.h:1071
char otel_enabled_telemetry[256]
Definition options.h:1153
int color
Color setting (COLOR_SETTING_AUTO/TRUE/FALSE).
Definition options.h:1083
char turn_username[256]
ACDS: Username for TURN authentication.
Definition options.h:1213
char log_file[256]
Log file path.
Definition options.h:1159
unsigned short int verbose_level
Verbosity level (stackable -V).
Definition options.h:1141
char address[256]
Server address (client) or bind address (server).
Definition options.h:1002
char webtransport_origin[256]
Allowed browser origin.
Definition options.h:1010
bool reduce_noise
Apply neural microphone noise reduction in client-like modes.
Definition options.h:1109
bool flip_x
Effective horizontal orientation.
Definition options.h:1095
char grep_pattern[256]
PCRE2 regex for log filtering.
Definition options.h:1161
bool auto_width
Auto-detect width from terminal.
Definition options.h:993
char client_keys[256]
Allowed client keys (server).
Definition options.h:1178
double render_font_size
Font size in points (0 selects an automatic size).
Definition options.h:1255
double media_seek_timestamp
Seek to timestamp in seconds before playback.
Definition options.h:1075