ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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>
218#include "../discovery/strings.h"
219#include "explicit.h"
220
222#define COLOR_MODE_AUTO TERM_COLOR_AUTO
223#define COLOR_MODE_NONE TERM_COLOR_NONE
224#define COLOR_MODE_16 TERM_COLOR_16
225#define COLOR_MODE_16_COLOR TERM_COLOR_16
226#define COLOR_MODE_256 TERM_COLOR_256
227#define COLOR_MODE_256_COLOR TERM_COLOR_256
228#define COLOR_MODE_TRUECOLOR TERM_COLOR_TRUECOLOR
229
251
270
288
297
302
310#define OPTIONS_BUFF_SIZE 256
311
312// ============================================================================
313// GENERAL CATEGORY - General-purpose options (from --help registry)
314// ============================================================================
315
317#define OPT_HELP_DEFAULT false
318
320#define OPT_VERSION_DEFAULT false
321
323#define OPT_SPLASH_DEFAULT true
324
326#define OPT_SPLASH_SCREEN_EXPLICITLY_SET_DEFAULT false
327
329#define OPT_STATUS_SCREEN_DEFAULT true
330
332#define OPT_STATUS_SCREEN_EXPLICITLY_SET_DEFAULT false
333
335#define OPT_ENABLE_KEEPAWAKE_DEFAULT false
336
338#define OPT_DISABLE_KEEPAWAKE_DEFAULT false
339
341#define OPT_NO_CHECK_UPDATE_DEFAULT false
342
343// ============================================================================
344// LOGGING CATEGORY - Binary-level logging and output control options
345// ============================================================================
346
348#define OPT_QUIET_DEFAULT false
349
351#ifdef CMAKE_BUILD_TYPE_DEBUG
352#define OPT_OTEL_ENDPOINT_DEFAULT "http://127.0.0.1:24318"
353#else
354#define OPT_OTEL_ENDPOINT_DEFAULT ""
355#endif
356
358#define OPT_VERBOSE_LEVEL_DEFAULT 0
359
361#define OPT_LOG_LEVEL_DEFAULT LOG_INFO
362
364#define OPT_GREP_PATTERN_DEFAULT ""
365
367#define OPT_JSON_DEFAULT false
368
370#define OPT_COLOR_SCHEME_NAME_DEFAULT "pastel"
371
373#define OPT_LOG_TEMPLATE_DEFAULT_RELEASE \
374 "[%color(*, %H):%color(*, %M):%color(*, %S).%color(*, %ms)] [%color(*, %level_aligned)] " \
375 "%colored_message"
376
378#define OPT_LOG_TEMPLATE_DEFAULT_DEBUG \
379 "[%color(*, %H):%color(*, %M):%color(*, %S).%color(*, %ms)] [%color(*, %level_aligned)] " \
380 "[thread/%color(GREY, %tname)] %color(DEBUG, %file_relative):%color(GREY, %line)@%color(DEV, %func)(): " \
381 "%colored_message"
382
388#ifdef NDEBUG
389#define OPT_LOG_TEMPLATE_DEFAULT OPT_LOG_TEMPLATE_DEFAULT_RELEASE
390#else
391#define OPT_LOG_TEMPLATE_DEFAULT OPT_LOG_TEMPLATE_DEFAULT_DEBUG
392#endif
393
395#define OPT_LOG_FORMAT_OUTPUT_DEFAULT LOG_OUTPUT_TEXT
396
398#define OPT_LOG_FORMAT_CONSOLE_DEFAULT false
399
400// ============================================================================
401// TERMINAL CATEGORY - Terminal display options
402// ============================================================================
403
413#define OPT_WIDTH_DEFAULT 110
414
424#define OPT_HEIGHT_DEFAULT 70
425
427#define OPT_AUTO_WIDTH_DEFAULT true
428
430#define OPT_AUTO_HEIGHT_DEFAULT true
431
433#define OPT_COLOR_MODE_DEFAULT COLOR_MODE_AUTO
434
436#define OPT_LIST_WEBCAMS_DEFAULT false
437
439#define OPT_LIST_MICROPHONES_DEFAULT false
440
442#define OPT_LIST_SPEAKERS_DEFAULT false
443
445#define OPT_SHOW_CAPABILITIES_DEFAULT false
446
448#define OPT_FORCE_UTF8_DEFAULT UTF8_SETTING_AUTO
449
451#define OPT_STRIP_ANSI_DEFAULT false
452
454#define OPT_COLOR_DEFAULT COLOR_SETTING_AUTO
455
456// ============================================================================
457// DISPLAY CATEGORY - Display and rendering options
458// ============================================================================
459
461#define OPT_COLOR_FILTER_DEFAULT COLOR_FILTER_NONE
462
464#define OPT_RENDER_MODE_DEFAULT RENDER_MODE_FOREGROUND
465
467#define OPT_PALETTE_TYPE_DEFAULT PALETTE_STANDARD
468
470#define OPT_PALETTE_CUSTOM_SET_DEFAULT false
471
473#define OPT_STRETCH_DEFAULT false
474
476#define OPT_FPS_DEFAULT 0
477
479#define OPT_SNAPSHOT_MODE_DEFAULT false
480
489#if defined(__APPLE__)
490#define OPT_SNAPSHOT_DELAY_DEFAULT 4.0f
491#else
492#define OPT_SNAPSHOT_DELAY_DEFAULT 3.0f
493#endif
494
496#define OPT_MATRIX_RAIN_DEFAULT false
497
499#define OPT_FPS_COUNTER_DEFAULT false
500
502#define OPT_FLIP_X_DEFAULT true
503
505#define OPT_FLIP_Y_DEFAULT false
506
507// ============================================================================
508// WEBCAM CATEGORY - Webcam and capture device options
509// ============================================================================
510
512#define OPT_WEBCAM_INDEX_DEFAULT 0
513
515#define OPT_TEST_PATTERN_DEFAULT false
516
518#define OPT_NO_AUDIO_MIXER_DEFAULT false
519
520// ============================================================================
521// MEDIA CATEGORY - Media file streaming and playback options
522// ============================================================================
523
525#define OPT_MEDIA_LOOP_DEFAULT false
526
528#define OPT_MEDIA_FROM_STDIN_DEFAULT false
529
531#define OPT_MEDIA_SEEK_TIMESTAMP_DEFAULT 0.0
532
534#define OPT_PAUSE_DEFAULT false
535
536// ============================================================================
537// NETWORK CATEGORY - Network connectivity and protocol options
538// ============================================================================
539
541#define OPT_ADDRESS_DEFAULT "localhost"
542
544#define OPT_ADDRESS6_DEFAULT "::1"
545
556#ifdef NDEBUG
557#include "../network/acip/acds.h"
558#define OPT_ENDPOINT_DISCOVERY_SERVICE ACDS_OFFICIAL_SERVER_HOSTNAME
559#else
560#define OPT_ENDPOINT_DISCOVERY_SERVICE "localhost"
561#endif
562
564#define OPT_PORT_DEFAULT "27224"
565
567#define OPT_PORT_INT_DEFAULT 27224
568
570#define OPT_WEBSOCKET_PORT_SERVER_DEFAULT 27226
571
573#define OPT_WEBSOCKET_PORT_ACDS_DEFAULT 27227
574
576#define OPT_MCP_PORT_DEFAULT 27228
577
579#define OPT_MAX_CLIENTS_DEFAULT 9
580
582#define OPT_RECONNECT_ATTEMPTS_DEFAULT (-1)
583
585#define OPT_COMPRESSION_LEVEL_DEFAULT 3
586
588#define OPT_NO_COMPRESS_DEFAULT false
589
591#define OPT_ACDS_DEFAULT false
592
594#define OPT_ACDS_PORT_INT_DEFAULT 27225
595
597#define OPT_ACDS_PORT_DEFAULT "27225"
598
600#define OPT_ACDS_EXPOSE_IP_DEFAULT false
601
603#define OPT_ACDS_INSECURE_DEFAULT false
604
606#define OPT_REQUIRE_SERVER_IDENTITY_DEFAULT false
607
609#define OPT_REQUIRE_CLIENT_IDENTITY_DEFAULT false
610
612#define OPT_LAN_DISCOVERY_DEFAULT false
613
615#define OPT_NO_MDNS_ADVERTISE_DEFAULT false
616
618#define OPT_ENABLE_UPNP_DEFAULT false
619
626
628#define OPT_ENDPOINT_STUN_PRIMARY "stun:stun.ascii-chat.com:3478"
629
631#define OPT_ENDPOINT_STUN_FALLBACK "stun:stun.l.google.com:19302"
632
634#define OPT_ENDPOINT_STUN_SERVERS_DEFAULT OPT_ENDPOINT_STUN_PRIMARY "," OPT_ENDPOINT_STUN_FALLBACK
635
637#define OPT_ENDPOINT_TURN_PRIMARY "turn:turn.ascii-chat.com:3478"
638
640#define OPT_ENDPOINT_TURN_SERVERS_DEFAULT OPT_ENDPOINT_TURN_PRIMARY
641
643#define OPT_STUN_SERVER_HOST_PRIMARY "stun.ascii-chat.com"
644
646#define OPT_STUN_SERVER_PORT_PRIMARY 3478
647
649#define OPT_STUN_SERVER_HOST_FALLBACK "stun.l.google.com"
650
652#define OPT_STUN_SERVER_PORT_FALLBACK 19302
653
655#define OPT_TURN_SERVER_HOST "turn.ascii-chat.com"
656
658#define OPT_TURN_SERVER_PORT 3478
659
661#define OPT_STUN_SERVERS_DEFAULT OPT_ENDPOINT_STUN_SERVERS_DEFAULT
662
664#define OPT_TURN_SERVERS_DEFAULT OPT_ENDPOINT_TURN_SERVERS_DEFAULT
665
667
669#define OPT_WEBRTC_DEFAULT true
670
672#define OPT_PREFER_WEBRTC_DEFAULT false
673
675#define OPT_NO_WEBRTC_DEFAULT false
676
678#define OPT_WEBRTC_SKIP_STUN_DEFAULT false
679
681#define OPT_WEBRTC_DISABLE_TURN_DEFAULT false
682
684#define OPT_WEBRTC_SKIP_HOST_DEFAULT false
685
687#define OPT_WEBRTC_ICE_TIMEOUT_MS_DEFAULT 10000
688
690#define OPT_WEBRTC_RECONNECT_ATTEMPTS_DEFAULT 3
691
693#define OPT_TURN_USERNAME_DEFAULT ""
694
696#define OPT_TURN_CREDENTIAL_DEFAULT ""
697
698// ============================================================================
699// AUDIO CATEGORY - Audio capture, playback and processing options
700// ============================================================================
701
703#define OPT_AUDIO_ENABLED_DEFAULT true
704
706#define OPT_AUDIO_SOURCE_DEFAULT AUDIO_SOURCE_ALL
708#define OPT_AUDIO_CAPTURE_SOURCE_DEFAULT AUDIO_CAPTURE_SOURCE_AUTO
709
711#define OPT_MICROPHONE_INDEX_DEFAULT (-1)
712
714#define OPT_SPEAKERS_INDEX_DEFAULT (-1)
715
717#define OPT_MICROPHONE_SENSITIVITY_DEFAULT 1.0
718
720#define OPT_SPEAKERS_VOLUME_DEFAULT 1.0
721
723#define OPT_AUDIO_ANALYSIS_ENABLED_DEFAULT false
724
726#define OPT_AUDIO_NO_PLAYBACK_DEFAULT false
727
729#define OPT_ENCODE_AUDIO_DEFAULT true
730
731// ============================================================================
732// SECURITY CATEGORY - Encryption and authentication options
733// ============================================================================
734
736#define OPT_ENCRYPT_ENABLED_DEFAULT false
737
739#define OPT_NO_ENCRYPT_DEFAULT false
740
742#define OPT_NO_AUTH_DEFAULT false
743
745#define OPT_REQUIRE_SERVER_VERIFY_DEFAULT false
746
748#define OPT_REQUIRE_CLIENT_VERIFY_DEFAULT false
749
750// ============================================================================
751// CONFIGURATION CATEGORY - Application configuration options
752// ============================================================================
753
754// (Configuration options are typically handled separately via --config etc.)
755
756// ============================================================================
757// DATABASE CATEGORY - Database and persistent storage options
758// ============================================================================
759
760// (Database options are typically handled separately via --database etc.)
761
762// ============================================================================
763// String Default Values
764// ============================================================================
765
767#define OPT_STRING_EMPTY_DEFAULT ""
768
769// ============================================================================
770// Render-to-file Options
771// ============================================================================
772#define OPT_RENDER_FILE_DEFAULT ""
773#define OPT_RENDER_THEME_DEFAULT 0 // 0=dark, 1=light, 2=auto
774#define OPT_RENDER_FONT_DEFAULT ""
775#define OPT_RENDER_FONT_SIZE_DEFAULT 0.0
776
777// ============================================================================
778// Static Default Value Variables
779// ============================================================================
780// These are referenced from the registry and provide const void * pointers
781// for non-string default values. Defined alongside OPT_*_DEFAULT for clarity.
782
783static const int default_log_level_value = OPT_LOG_LEVEL_DEFAULT;
784static const bool default_quiet_value = OPT_QUIET_DEFAULT;
785static const bool default_json_value = OPT_JSON_DEFAULT;
786static const bool default_enable_keepawake_value = OPT_ENABLE_KEEPAWAKE_DEFAULT;
787static const bool default_disable_keepawake_value = OPT_DISABLE_KEEPAWAKE_DEFAULT;
788static const int default_width_value = OPT_WIDTH_DEFAULT;
789static const int default_height_value = OPT_HEIGHT_DEFAULT;
790static const int default_port_value = OPT_PORT_INT_DEFAULT;
791static const int default_websocket_port_value = OPT_WEBSOCKET_PORT_SERVER_DEFAULT;
792static const int default_webcam_index_value = OPT_WEBCAM_INDEX_DEFAULT;
793static const bool default_flip_x_value = OPT_FLIP_X_DEFAULT;
794static const bool default_flip_y_value = OPT_FLIP_Y_DEFAULT;
795static const int default_color_value = OPT_COLOR_DEFAULT;
796static const int default_color_mode_value = OPT_COLOR_MODE_DEFAULT;
797static const int default_color_filter_value = OPT_COLOR_FILTER_DEFAULT;
798static const int default_render_mode_value = OPT_RENDER_MODE_DEFAULT;
799static const int default_palette_type_value = OPT_PALETTE_TYPE_DEFAULT;
800static const bool default_show_capabilities_value = OPT_SHOW_CAPABILITIES_DEFAULT;
801static const int default_force_utf8_value = OPT_FORCE_UTF8_DEFAULT;
802static const bool default_stretch_value = OPT_STRETCH_DEFAULT;
803static const bool default_strip_ansi_value = OPT_STRIP_ANSI_DEFAULT;
804static const bool default_snapshot_mode_value = OPT_SNAPSHOT_MODE_DEFAULT;
805static const double default_snapshot_delay_value = OPT_SNAPSHOT_DELAY_DEFAULT;
806static const bool default_matrix_rain_value = OPT_MATRIX_RAIN_DEFAULT;
807static const bool default_waveform_value = false;
808static const bool default_fft_value = false;
809static const bool default_fps_counter_value = OPT_FPS_COUNTER_DEFAULT;
810static const int default_fps_value = OPT_FPS_DEFAULT;
811static const int default_compression_level_value = OPT_COMPRESSION_LEVEL_DEFAULT;
812static const bool default_no_compress_value = OPT_NO_COMPRESS_DEFAULT;
813static const bool default_encrypt_enabled_value = OPT_ENCRYPT_ENABLED_DEFAULT;
814static const bool default_no_encrypt_value = OPT_NO_ENCRYPT_DEFAULT;
815static const bool default_no_auth_value = OPT_NO_AUTH_DEFAULT;
816static const int default_max_clients_value = OPT_MAX_CLIENTS_DEFAULT;
817static const int default_reconnect_attempts_value = OPT_RECONNECT_ATTEMPTS_DEFAULT;
818static const int default_discovery_port_value = OPT_ACDS_PORT_INT_DEFAULT;
819static const bool default_discovery_value = OPT_ACDS_DEFAULT;
820static const bool default_webrtc_value = OPT_WEBRTC_DEFAULT;
821static const bool default_enable_upnp_value = OPT_ENABLE_UPNP_DEFAULT;
822static const bool default_lan_discovery_value = OPT_LAN_DISCOVERY_DEFAULT;
823static const bool default_prefer_webrtc_value = OPT_PREFER_WEBRTC_DEFAULT;
824static const bool default_no_webrtc_value = OPT_NO_WEBRTC_DEFAULT;
825static const bool default_webrtc_skip_stun_value = OPT_WEBRTC_SKIP_STUN_DEFAULT;
826static const bool default_webrtc_relay_only_value = false;
827static const bool default_webrtc_disable_turn_value = OPT_WEBRTC_DISABLE_TURN_DEFAULT;
828static const bool default_webrtc_skip_host_value = OPT_WEBRTC_SKIP_HOST_DEFAULT;
829
830static const int default_webrtc_ice_timeout_ms_value = OPT_WEBRTC_ICE_TIMEOUT_MS_DEFAULT;
831
832static const int default_webrtc_reconnect_attempts_value = OPT_WEBRTC_RECONNECT_ATTEMPTS_DEFAULT;
833static const bool default_media_loop_value = OPT_MEDIA_LOOP_DEFAULT;
834static const bool default_pause_value = OPT_PAUSE_DEFAULT;
835static const double default_media_seek_value = OPT_MEDIA_SEEK_TIMESTAMP_DEFAULT;
836static const bool default_audio_enabled_value = OPT_AUDIO_ENABLED_DEFAULT;
837static const audio_source_t default_audio_source_value = OPT_AUDIO_SOURCE_DEFAULT;
838static const audio_capture_source_t default_audio_capture_source_value = OPT_AUDIO_CAPTURE_SOURCE_DEFAULT;
839static const int default_microphone_index_value = OPT_MICROPHONE_INDEX_DEFAULT;
840static const int default_speakers_index_value = OPT_SPEAKERS_INDEX_DEFAULT;
841static const double default_microphone_sensitivity_value = OPT_MICROPHONE_SENSITIVITY_DEFAULT;
842static const double default_speakers_volume_value = OPT_SPEAKERS_VOLUME_DEFAULT;
843static const bool default_audio_analysis_value = OPT_AUDIO_ANALYSIS_ENABLED_DEFAULT;
844static const bool default_no_audio_playback_value = OPT_AUDIO_NO_PLAYBACK_DEFAULT;
845static const bool default_encode_audio_value = OPT_ENCODE_AUDIO_DEFAULT;
846static const bool default_no_encode_audio_value = !OPT_ENCODE_AUDIO_DEFAULT;
847static const bool default_no_audio_mixer_value = OPT_NO_AUDIO_MIXER_DEFAULT;
848static const bool default_discovery_expose_ip_value = OPT_ACDS_EXPOSE_IP_DEFAULT;
849static const bool default_discovery_insecure_value = OPT_ACDS_INSECURE_DEFAULT;
850static const bool default_require_server_identity_value = OPT_REQUIRE_SERVER_IDENTITY_DEFAULT;
851static const bool default_require_client_identity_value = OPT_REQUIRE_CLIENT_IDENTITY_DEFAULT;
852static const bool default_splash_value = OPT_SPLASH_DEFAULT;
853static const bool default_splash_false = false; // For --no-splash-screen option
854static const bool default_status_screen_value = OPT_STATUS_SCREEN_DEFAULT;
855static const bool default_no_check_update_value = OPT_NO_CHECK_UPDATE_DEFAULT;
856static const bool default_log_format_console_only_value = OPT_LOG_FORMAT_CONSOLE_DEFAULT;
857
858static const double default_debug_errno_stacks_time_value = 0.0;
859static const double default_debug_sync_state_time_value = 0.0;
860static const bool default_debug_sync_state_time_explicit_value = false;
861static const double default_debug_backtrace_time_value = 0.0;
862static const bool default_debug_backtrace_time_explicit_value = false;
863static const double default_debug_memory_report_interval_value = 0.0;
864static const bool default_debug_memory_report_interval_explicit_value = false;
865
866static const int default_render_theme_value = OPT_RENDER_THEME_DEFAULT;
867static const double default_render_font_size_value = OPT_RENDER_FONT_SIZE_DEFAULT;
868
870
875
910int strtoint_safe(const char *str);
911
913
929
948
955#define OPTION_MODE_SERVER_LIKE (OPTION_MODE_SERVER | OPTION_MODE_DISCOVERY_SVC)
956#define OPTION_MODE_CLIENT_LIKE (OPTION_MODE_CLIENT | OPTION_MODE_MIRROR | OPTION_MODE_DISCOVERY)
957#define OPTION_MODE_NETWORKED \
958 (OPTION_MODE_SERVER | OPTION_MODE_CLIENT | OPTION_MODE_DISCOVERY_SVC | OPTION_MODE_DISCOVERY)
959
967#define ASCII_RENDERER_DEFAULT ASCII_RENDERER_GLYPH
968
979typedef struct options_state {
980 // ============================================================================
981 // Mode Detection (auto-detected during options_init)
982 // ============================================================================
985
986 // ============================================================================
987 // Binary-Level Options (parsed first, before mode selection)
988 // ============================================================================
989 bool help;
990 bool version;
992
993 // ============================================================================
994 // Terminal Dimensions
995 // ============================================================================
996 int width;
997 int height;
1000
1001 // ============================================================================
1002 // Network Options
1003 // ============================================================================
1004#ifndef __EMSCRIPTEN__
1006#endif
1009 int port;
1028
1029 // ============================================================================
1030 // Discovery Service Options (server only)
1031 // ============================================================================
1034 // MCP HTTP transport
1045 bool webrtc;
1048
1049 // ============================================================================
1050 // LAN Discovery Options
1051 // ============================================================================
1054
1055 // ============================================================================
1056 // Network Performance Options
1057 // ============================================================================
1061
1062 // ============================================================================
1063 // Client Reconnection Options
1064 // ============================================================================
1066
1067 // ============================================================================
1068 // Webcam Options
1069 // ============================================================================
1074
1075 // ============================================================================
1076 // Media File Streaming Options
1077 // ============================================================================
1084 bool pause;
1087
1088 // ============================================================================
1089 // Display Options
1090 // ============================================================================
1091 int color;
1092 terminal_color_mode_t color_mode;
1093 color_filter_t color_filter;
1095 terminal_render_mode_t render_mode;
1099 int fps;
1103 bool flip_x;
1106 bool flip_y;
1107
1108 // ============================================================================
1109 // Audio Configuration
1110 // ============================================================================
1124 bool fft;
1125 char fft_scale[32];
1134
1135 // ============================================================================
1136 // Image Options
1137 // ============================================================================
1141 bool stretch;
1143
1144 // ============================================================================
1145 // Output Options
1146 // ============================================================================
1147 bool quiet;
1148 unsigned short int verbose_level;
1151 int zalgo;
1155
1156 // OpenTelemetry export configuration.
1169 bool json;
1174
1175 // ============================================================================
1176 // Encryption Options
1177 // ============================================================================
1183 bool no_auth;
1186
1187 // Multi-key support: When multiple --key flags are provided, all keys are stored here
1188 // encrypt_key is duplicated in identity_keys[0] for backward compatibility
1192
1193 // ============================================================================
1194 // Identity Verification Options (ACDS + Crypto Handshake)
1195 // ============================================================================
1202
1203 // ============================================================================
1204 // WebRTC Connection Strategy Options (client-side fallback control)
1205 // ============================================================================
1215
1216 // ============================================================================
1217 // WebRTC Connectivity Options (ACDS mode only)
1218 // ============================================================================
1225
1226 // ============================================================================
1227 // Palette Configuration
1228 // ============================================================================
1233
1234 // ============================================================================
1235 // Splash Screen Options
1236 // ============================================================================
1242
1243 // ============================================================================
1244 // Diagnostics options
1245 // ============================================================================
1254
1255 // ============================================================================
1256 // Render-to-file options
1257 // ============================================================================
1259#ifndef __EMSCRIPTEN__
1261#endif
1265
1266 // Note: Luminance weights (weight_red, weight_green, weight_blue) and
1267 // lookup tables (RED[], GREEN[], BLUE[], GRAY[]) are kept as globals
1268 // since they're precomputed constants, not user-configurable options.
1270
1271// ============================================================================
1272// RCU-based thread-safe options access
1273// ============================================================================
1274
1285const options_t *options_get(void);
1286
1287const terminal_options_t *options_terminal_settings_ptr(void);
1288
1289/*
1290 * Keep terminal settings out of the Windows DLL return-value ABI. The
1291 * terminal_options_t record is larger than the register return size, so
1292 * returning it by value across asciichat.dll/libplatform.dll requires a
1293 * hidden return-buffer argument. Expose a stable settings record instead,
1294 * and pass its address through the platform API.
1295 */
1296#define options_terminal_settings() options_terminal_settings_ptr()
1297
1336#define GET_OPTION(field) \
1337 ({ \
1338 const options_t *_opts = options_get(); \
1339 if (!_opts) { \
1340 log_warn("GET_OPTION(" #field ") called but options not initialized"); \
1341 } \
1342 static typeof(((options_t *)0)->field) _default = {0}; \
1343 (_opts ? (_opts->field) : _default); \
1344 })
1345
1374
1391asciichat_error_t options_set_int(const char *field_name, int value);
1392asciichat_error_t options_set_bool(const char *field_name, bool value);
1393asciichat_error_t options_set_string(const char *field_name, const char *value);
1394asciichat_error_t options_set_double(const char *field_name, double value);
1395
1420const char *options_get_help_text(asciichat_mode_t mode, const char *option_name);
1421
1428extern const float weight_red;
1429
1438extern const float weight_green;
1439
1448extern const float weight_blue;
1449
1464extern unsigned short int RED[];
1465
1472extern unsigned short int GREEN[];
1473
1480extern unsigned short int BLUE[];
1481
1489extern unsigned short int GRAY[];
1490
1492
1503bool has_action_flag(void);
1504
1509
1584
1610
1757asciichat_error_t options_init(int argc, char **argv);
1758
1801void usage(FILE *stream, asciichat_mode_t mode);
1802
1804
1809
1846
1883
1889extern uint64_t g_snapshot_first_frame_rendered_ns; // Timestamp when first frame was rendered (nanoseconds)
1890extern uint64_t g_snapshot_first_capture_ns; // Timestamp when first frame was captured (nanoseconds)
1891extern uint64_t g_snapshot_actual_duration_ms; // Actual wall-clock duration in ms when snapshot timeout reached
1892
1894
ascii-chat Discovery Service (ACDS) Protocol Message Formats
Check if an option was explicitly set via command-line.
unsigned long long uint64_t
Definition common.h:63
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
#define MAX_SESSION_KEYS
log_level_t
Logging levels enumeration.
Definition types.h:29
utf8_setting_t
UTF-8 support setting (–utf8 flag values).
Definition options.h:262
audio_capture_source_t
Definition options.h:290
#define OPT_STRIP_ANSI_DEFAULT
Default strip ANSI escape sequences flag.
Definition options.h:451
#define OPT_WEBRTC_SKIP_STUN_DEFAULT
Default WebRTC skip STUN flag (false = use STUN).
Definition options.h:678
#define OPT_ACDS_EXPOSE_IP_DEFAULT
Default ACDS expose IP flag (false = private by default).
Definition options.h:600
#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:454
#define OPT_NO_AUDIO_MIXER_DEFAULT
Default no audio mixer flag (false = enable mixer).
Definition options.h:518
#define OPT_FLIP_Y_DEFAULT
Default vertical flip state (false = no vertical flip).
Definition options.h:505
#define OPT_SHOW_CAPABILITIES_DEFAULT
Default show terminal capabilities flag.
Definition options.h:445
#define OPT_NO_ENCRYPT_DEFAULT
Default no encrypt flag (false = allow encryption).
Definition options.h:739
#define OPT_QUIET_DEFAULT
Default quiet mode flag (false = logging enabled).
Definition options.h:348
asciichat_mode_t
Mode type for options parsing.
Definition options.h:919
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:894
#define OPT_MICROPHONE_INDEX_DEFAULT
Default microphone device index (-1 means system default).
Definition options.h:711
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:729
#define OPT_COLOR_MODE_DEFAULT
Default color mode (auto-detect terminal capabilities).
Definition options.h:433
#define OPT_PALETTE_TYPE_DEFAULT
Default palette type (standard ASCII art).
Definition options.h:467
#define OPT_RECONNECT_ATTEMPTS_DEFAULT
Default reconnect attempts (-1 means auto/infinite).
Definition options.h:582
#define OPT_SPEAKERS_VOLUME_DEFAULT
Default speakers volume (1.0 = normal volume).
Definition options.h:720
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:742
#define OPT_WEBRTC_ICE_TIMEOUT_MS_DEFAULT
Default WebRTC ICE gathering timeout in milliseconds (10 seconds).
Definition options.h:687
#define OPT_COMPRESSION_LEVEL_DEFAULT
Default compression level (1-9).
Definition options.h:585
#define OPT_ENCRYPT_ENABLED_DEFAULT
Default encrypt enabled flag (true = encryption required).
Definition options.h:736
#define OPT_REQUIRE_SERVER_IDENTITY_DEFAULT
Default require-server-identity setting for ACDS.
Definition options.h:606
#define OPT_ENABLE_KEEPAWAKE_DEFAULT
Default keep-awake (prevent system sleep) flag (false = normal system sleep).
Definition options.h:335
#define OPT_RENDER_MODE_DEFAULT
Default render mode (foreground characters only).
Definition options.h:464
#define OPT_ACDS_PORT_INT_DEFAULT
Default ACDS discovery service port (integer).
Definition options.h:594
#define OPT_AUDIO_ENABLED_DEFAULT
Default audio enabled flag (true = audio enabled by default).
Definition options.h:703
#define OPT_MATRIX_RAIN_DEFAULT
Default Matrix rain effect flag (false = disabled).
Definition options.h:496
#define OPT_FORCE_UTF8_DEFAULT
Default force UTF-8 support setting (auto-detect).
Definition options.h:448
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:775
#define OPT_WEBRTC_RECONNECT_ATTEMPTS_DEFAULT
Default WebRTC reconnection attempts (3 = try initial + 3 retries).
Definition options.h:690
#define OPT_SPLASH_DEFAULT
Default splash screen flag (true = show splash, false = hide splash).
Definition options.h:323
#define OPT_RENDER_THEME_DEFAULT
Definition options.h:773
#define OPT_FPS_COUNTER_DEFAULT
Default FPS counter overlay flag (false = disabled).
Definition options.h:499
#define OPT_AUDIO_ANALYSIS_ENABLED_DEFAULT
Default audio analysis enabled flag.
Definition options.h:723
ascii_renderer_t
Consolidated options structure.
Definition options.h:966
const terminal_options_t * options_terminal_settings_ptr(void)
Definition rcu.c:535
asciichat_error_t options_set_double(const char *field_name, double value)
Definition rcu.c:905
const options_t * options_get(void)
Get current options (lock-free read).
Definition rcu.c:511
const float weight_red
Red weight for luminance calculation.
#define OPT_ACDS_DEFAULT
Default ACDS registration flag (false = disabled).
Definition options.h:591
#define OPTIONS_BUFF_SIZE
Buffer size for option string values.
Definition options.h:310
#define OPT_NO_COMPRESS_DEFAULT
Default no compression flag (false = enable compression).
Definition options.h:588
asciichat_error_t options_init(int argc, char **argv)
Initialize options by parsing command-line arguments with unified mode detection.
Definition options.c:2417
audio_source_t
Audio source selected for visualization.
Definition options.h:276
option_mode_bitmask_t
Option mode bitmask.
Definition options.h:936
#define OPT_AUDIO_NO_PLAYBACK_DEFAULT
Default audio playback flag (false = enable playback).
Definition options.h:726
#define OPT_PAUSE_DEFAULT
Default pause media flag (false = play immediately).
Definition options.h:534
#define OPTIONS_VIDEO_CODEC_BUFFER_SIZE
Definition options.h:210
#define OPT_AUDIO_SOURCE_DEFAULT
Visualize all available sources by default.
Definition options.h:706
asciichat_error_t options_set_string(const char *field_name, const char *value)
Definition rcu.c:908
asciichat_error_t options_set_bool(const char *field_name, bool value)
Definition rcu.c:902
#define OPT_COLOR_FILTER_DEFAULT
Default color filter (none - no filtering).
Definition options.h:461
#define OPT_WEBCAM_INDEX_DEFAULT
Default webcam device index.
Definition options.h:512
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:424
unsigned short int GREEN[256]
Green channel lookup table.
#define OPT_SNAPSHOT_MODE_DEFAULT
Default snapshot mode flag (false = continuous).
Definition options.h:479
#define OPT_MEDIA_LOOP_DEFAULT
Default loop media flag (false = play once).
Definition options.h:525
#define OPT_NO_CHECK_UPDATE_DEFAULT
Default no-check-update flag (false = check for updates enabled).
Definition options.h:341
#define OPT_STRETCH_DEFAULT
Default allow aspect ratio distortion flag.
Definition options.h:473
#define OPT_STATUS_SCREEN_DEFAULT
Default status screen flag (true = show status, false = hide status).
Definition options.h:329
#define OPT_LAN_DISCOVERY_DEFAULT
Default LAN discovery flag (false = discovery disabled).
Definition options.h:612
#define OPT_JSON_DEFAULT
Default JSON logging flag (false = text output).
Definition options.h:367
#define OPT_ACDS_INSECURE_DEFAULT
Default ACDS insecure mode flag (false = verify server).
Definition options.h:603
bool has_action_flag(void)
Check if an action flag was detected.
Definition options.c:122
#define OPT_FPS_DEFAULT
Default FPS (frames per second).
Definition options.h:476
#define OPT_WEBRTC_DEFAULT
Default WebRTC mode flag (true = P2P WebRTC, false = direct TCP).
Definition options.h:669
#define OPT_REQUIRE_CLIENT_IDENTITY_DEFAULT
Default require-client-identity setting for ACDS.
Definition options.h:609
color_setting_t
For options state, this is the live record that ties detected_mode, mode_arg_index,...
Definition options.h:243
#define OPT_DISABLE_KEEPAWAKE_DEFAULT
Default disable keep-awake flag (false = allow system sleep prevention).
Definition options.h:338
#define OPT_ENABLE_UPNP_DEFAULT
Default enable UPnP flag (false = UPnP disabled).
Definition options.h:618
#define OPT_WEBRTC_SKIP_HOST_DEFAULT
Default WebRTC skip host candidates flag (false = use host candidates).
Definition options.h:684
#define OPT_LOG_FORMAT_CONSOLE_DEFAULT
Default log format console only flag (false = use default format everywhere).
Definition options.h:398
#define OPT_SNAPSHOT_DELAY_DEFAULT
Default snapshot delay in seconds.
Definition options.h:492
const float weight_green
Green weight for luminance calculation.
#define OPT_LOG_LEVEL_DEFAULT
Default log level (LOG_INFO).
Definition options.h:361
#define OPT_MICROPHONE_SENSITIVITY_DEFAULT
Default microphone sensitivity (1.0 = normal volume).
Definition options.h:717
#define OPT_FLIP_X_DEFAULT
Webcam input is mirrored unless an orientation is explicitly selected.
Definition options.h:502
#define OPT_PORT_INT_DEFAULT
Default TCP port for client/server communication (integer).
Definition options.h:567
unsigned short int RED[256]
Red channel lookup table.
#define OPT_MAX_CLIENTS_DEFAULT
Default maximum concurrent clients (server only).
Definition options.h:579
#define OPT_PREFER_WEBRTC_DEFAULT
Default prefer WebRTC flag (false = try direct TCP first).
Definition options.h:672
options_t options_t_new(void)
Initialize options by parsing command-line arguments.
Definition options.c:547
#define OPT_WEBRTC_DISABLE_TURN_DEFAULT
Default WebRTC disable TURN flag (false = use TURN).
Definition options.h:681
#define OPT_NO_WEBRTC_DEFAULT
Default no WebRTC flag (false = WebRTC enabled).
Definition options.h:675
#define OPT_AUDIO_CAPTURE_SOURCE_DEFAULT
Preserve automatic local audio capture selection by default.
Definition options.h:708
#define OPT_SPEAKERS_INDEX_DEFAULT
Default speakers device index (-1 means system default).
Definition options.h:714
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:570
#define OPT_MEDIA_SEEK_TIMESTAMP_DEFAULT
Default media seek timestamp (start from beginning).
Definition options.h:531
#define OPT_WIDTH_DEFAULT
Default terminal width in characters.
Definition options.h:413
@ UTF8_SETTING_AUTO
Smart detection (default): UTF-8 if terminal supports it.
Definition options.h:264
@ UTF8_SETTING_FALSE
Force UTF-8 OFF: disable UTF-8 support.
Definition options.h:268
@ UTF8_SETTING_TRUE
Force UTF-8 ON: always use UTF-8 regardless of terminal capability.
Definition options.h:266
@ AUDIO_CAPTURE_SOURCE_BOTH
Definition options.h:294
@ AUDIO_CAPTURE_SOURCE_REMOTE
Definition options.h:295
@ AUDIO_CAPTURE_SOURCE_MEDIA
Definition options.h:293
@ AUDIO_CAPTURE_SOURCE_MIC
Definition options.h:292
@ AUDIO_CAPTURE_SOURCE_AUTO
Definition options.h:291
@ MODE_CLIENT
Client mode - network client options.
Definition options.h:921
@ MODE_MCP_SERVER
Model Context Protocol rendering server.
Definition options.h:925
@ MODE_DISCOVERY_SERVICE
Discovery server mode - session management and WebRTC signaling.
Definition options.h:923
@ MODE_API_SERVER
Image-to-ASCII HTTP API server.
Definition options.h:926
@ MODE_INVALID
Invalid mode.
Definition options.h:927
@ MODE_SERVER
Server mode - network server options.
Definition options.h:920
@ MODE_MIRROR
Mirror mode - local webcam viewing (no network).
Definition options.h:922
@ MODE_DISCOVERY
Discovery mode - participant that can dynamically become host.
Definition options.h:924
@ ASCII_RENDERER_GLYPH
Definition options.h:966
@ ASCII_RENDERER_LUMINANCE
Definition options.h:966
@ AUDIO_SOURCE_MIC
Definition options.h:282
@ AUDIO_SOURCE_CALL
Definition options.h:280
@ AUDIO_SOURCE_MEDIA
Definition options.h:284
@ AUDIO_SOURCE_ALL
Definition options.h:278
@ AUDIO_SOURCE_AUTO
Definition options.h:286
@ OPTION_MODE_ALL
All modes + binary.
Definition options.h:946
@ OPTION_MODE_BINARY
Binary-level options (parsed before mode detection).
Definition options.h:945
@ OPTION_MODE_CLIENT
Client mode (bit 1).
Definition options.h:939
@ OPTION_MODE_API_SERVER
Definition options.h:944
@ OPTION_MODE_DISCOVERY
Discovery mode (bit 4).
Definition options.h:942
@ OPTION_MODE_SERVER
Server mode (bit 0).
Definition options.h:938
@ OPTION_MODE_MIRROR
Mirror mode (bit 2).
Definition options.h:940
@ OPTION_MODE_NONE
No modes (invalid).
Definition options.h:937
@ OPTION_MODE_MCP_SERVER
Definition options.h:943
@ OPTION_MODE_DISCOVERY_SVC
Discovery server mode (bit 3).
Definition options.h:941
@ COLOR_SETTING_TRUE
Force colors ON: always colorize regardless of TTY/piping/CLAUDECODE.
Definition options.h:247
@ COLOR_SETTING_FALSE
Force colors OFF: disable all colors and logging colors.
Definition options.h:249
@ COLOR_SETTING_AUTO
Smart detection (default): colors if TTY and not CLAUDECODE and not piping.
Definition options.h:245
palette_type_t
Built-in palette type enumeration.
Definition palette.h:90
void options_resolve_flip_x(options_t *opts)
Definition options.c:2575
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:979
char otel_ca_file[256]
Definition options.h:1159
bool snapshot_mode
Snapshot mode (one frame and exit).
Definition options.h:1149
int otel_realtime_max_per_second
Definition options.h:1162
int zalgo
Combining-mark intensity (0 = disabled, 1-10 = enabled).
Definition options.h:1151
bool splash_screen_explicitly_set
True if splash screen was explicitly set by user.
Definition options.h:1238
float speakers_volume
Speaker volume multiplier (0.0-1.0, default 1.0).
Definition options.h:1131
int discovery_port
discovery server port (default: 27225)
Definition options.h:1040
char media_url[256]
Network URL (HTTP/HTTPS/YouTube/RTSP) - takes priority over media_file.
Definition options.h:1080
bool render_kitty
Display a snapshot with Kitty graphics.
Definition options.h:1260
double otel_realtime_sample_rate
Definition options.h:1161
bool flip_x_explicit
User selected an orientation for this process lifetime.
Definition options.h:1104
size_t num_identity_keys
Number of identity keys loaded (0 means single-key mode using encrypt_key).
Definition options.h:1191
bool audio_spectral_agc
Definition options.h:1113
char webtransport_path[256]
HTTP/3 CONNECT path.
Definition options.h:1016
int test_pattern_index
Synthetic pattern selector (0 or 1).
Definition options.h:1072
bool webrtc
Enable WebRTC mode for discovery session (default: true, P2P WebRTC).
Definition options.h:1045
bool discovery_quic
Use QUIC for a disclosed discovery host endpoint.
Definition options.h:1021
audio_capture_source_t audio_capture_source
Local capture/media selection policy.
Definition options.h:1122
bool encrypt_enabled
Enable encryption.
Definition options.h:1178
int otel_metrics_interval
Definition options.h:1163
terminal_color_mode_t color_mode
Color mode (auto/none/16/256/truecolor).
Definition options.h:1092
bool audio_spectral_gate
Definition options.h:1116
char quic_bind_address[256]
Concrete local QUIC listener address; empty disables QUIC.
Definition options.h:1017
bool discovery_expose_ip
ACDS: explicitly allow public IP disclosure without verification (opt-in).
Definition options.h:1200
char turn_servers[256]
ACDS: Comma-separated list of TURN server URLs.
Definition options.h:1221
int force_utf8
UTF-8 support setting (auto/true/false).
Definition options.h:1097
int webrtc_ice_timeout_ms
–webrtc-ice-timeout: ICE gathering timeout in milliseconds (default: 10000)
Definition options.h:1213
bool debug_backtrace_time_explicit
True if –backtrace was explicitly provided.
Definition options.h:1251
bool discovery
Enable discovery session registration (default: false).
Definition options.h:1032
char render_font[256]
Font family name or .ttf path (empty = platform default).
Definition options.h:1263
bool audio_adaptive_eq
Definition options.h:1118
double debug_memory_report_interval
Interval in seconds for periodic memory reports.
Definition options.h:1252
char discovery_service_url[256]
exclusive with discovery_port)
Definition options.h:1041
bool webrtc_relay_only
–webrtc-relay-only: Require TURN relay candidates
Definition options.h:1210
bool disable_keepawake
Explicitly disable system sleep prevention (allow OS to sleep).
Definition options.h:1173
char mcp_downloads_url_prefix[256]
Public HTTP origin for download links.
Definition options.h:1037
int otel_queue_capacity
Definition options.h:1165
bool test_audio
Replace microphone capture with a repeating audible test signal.
Definition options.h:1112
int microphone_channel
First zero-based input channel; -1 downmixes all inputs.
Definition options.h:1127
bool debug_sync_state_time_explicit
True if –sync-state was explicitly provided.
Definition options.h:1249
char log_template[256]
Custom log format string (formerly –log-format).
Definition options.h:1170
float microphone_sensitivity
Microphone volume multiplier (0.0-1.0, default 1.0).
Definition options.h:1130
int microphone_channels
Selected microphone channels: 1 (speech) or 2 (stereo).
Definition options.h:1126
int compression_level
zstd compression level (1-9)
Definition options.h:1058
bool fps_explicitly_set
True if FPS was explicitly configured by the user.
Definition options.h:1100
bool fft
Replace the video image with a live audio frequency spectrogram.
Definition options.h:1124
media_playlist_t media_playlist
Ordered CLI artifacts shared with live media input.
Definition options.h:1078
bool enable_keepawake
Explicitly enable system sleep prevention.
Definition options.h:1172
double debug_sync_state_time
Time parameter for –sync-state.
Definition options.h:1248
char webrtc_bind_address[256]
Optional numeric local address for WebRTC ICE sockets.
Definition options.h:1208
char otel_endpoint[256]
Definition options.h:1158
bool show_capabilities
Show terminal capabilities and exit.
Definition options.h:1096
bool no_mdns_advertise
Disable mDNS service advertisement (server only).
Definition options.h:1053
bool fps_counter
Show FPS counter overlay in top-right corner.
Definition options.h:1153
char password[256]
Password string.
Definition options.h:1180
int microphone_index
Microphone device index (-1 = default).
Definition options.h:1128
char config_file[256]
Config file path (–config).
Definition options.h:991
asciichat_mode_t detected_mode
Mode detected from command-line arguments.
Definition options.h:983
bool strip_ansi
Strip ANSI escape sequences.
Definition options.h:1154
bool audio_analysis_enabled
Enable audio analysis (debug).
Definition options.h:1132
int websocket_port
WebSocket server port (server/discovery-service only).
Definition options.h:1010
bool audio_pitch_correct
Definition options.h:1111
bool palette_explicit
Palette explicitly selected.
Definition options.h:1232
bool pause
Start playback paused (toggle with spacebar).
Definition options.h:1084
audio_source_t audio_source
Visualization source (all/call/mic/media).
Definition options.h:1121
bool json
Enable JSON logging (–json flag).
Definition options.h:1169
char stun_servers[256]
ACDS: Comma-separated list of STUN server URLs.
Definition options.h:1220
int height
Terminal height in characters (int for OPTION_TYPE_INT compat).
Definition options.h:997
char webtransport_bind_address[256]
Browser HTTP/3 listener address.
Definition options.h:1014
bool enable_upnp
Opt-in TCP/WebSocket and WebRTC UDP mapping via –port-forwarding.
Definition options.h:1219
bool debug_errno_stacks_time_explicit
True if –errno-stacks was provided.
Definition options.h:1247
bool face_follow
Automatically frame and follow the selected face.
Definition options.h:1101
bool webrtc_skip_stun
–webrtc-skip-stun: Skip Stage 2 (STUN), go to TURN
Definition options.h:1209
bool debug_memory_report_interval_explicit
True if –memory-report was explicitly provided.
Definition options.h:1253
bool log_format_console_only
Apply log format only to console output.
Definition options.h:1171
bool lan_discovery
Enable LAN service discovery via mDNS (client only).
Definition options.h:1052
double debug_errno_stacks_time
Delay before the error report.
Definition options.h:1246
char session_string[(38+1)]
Definition options.h:1026
char identity_keys[32][256]
All identity keys (populated when –key is used multiple times).
Definition options.h:1190
int stats_interval
Periodic plain statistics on stdout; zero disables.
Definition options.h:1098
char tls_key[256]
Shared TLS private key file path for secure network listeners.
Definition options.h:1012
bool audio_enabled
Enable audio streaming.
Definition options.h:1120
char tls_ca_file[256]
Shared TLS client trust anchors; empty uses system trust.
Definition options.h:1018
bool no_encrypt
Disable encryption (opt-out).
Definition options.h:1182
bool no_webrtc
–no-webrtc: Disable WebRTC, use Direct TCP only
Definition options.h:1207
bool audio_multiband
Definition options.h:1117
bool matrix_rain
Matrix digital rain effect (false = disabled).
Definition options.h:1152
bool webrtc_disable_turn
–webrtc-disable-turn: Disable Stage 3 (TURN), use STUN only
Definition options.h:1211
char tls_key_password[256]
Shared TLS private key password.
Definition options.h:1013
int quic_fallback_port
TCP fallback port, or zero to disable fallback.
Definition options.h:1024
bool audio_no_playback
Disable speaker playback (debug).
Definition options.h:1133
bool face_follow_debug
Developer diagnostic face outline.
Definition options.h:1102
char mcp_transport[256]
MCP transport: stdio or http.
Definition options.h:1038
bool auto_height
Auto-detect height from terminal.
Definition options.h:999
log_level_t log_level
Log level threshold.
Definition options.h:1167
char render_file[256]
Output file path (e.g. output.mp4).
Definition options.h:1258
char turn_credential[256]
ACDS: Credential/password for TURN authentication.
Definition options.h:1223
bool require_server_identity
ACDS: require servers to provide signed Ed25519 identity.
Definition options.h:1196
int audio_fft_size
Definition options.h:1119
char palette_custom[256]
Custom palette characters.
Definition options.h:1230
bool status_screen
Show status screen (default: true = show, use –no-status-screen to hide).
Definition options.h:1239
char otel_log_level[256]
Definition options.h:1157
int max_clients
Maximum concurrent clients (server only).
Definition options.h:1025
bool palette_custom_set
True if custom palette was set.
Definition options.h:1231
bool no_auth
Disable authentication layer (–no-auth).
Definition options.h:1183
terminal_render_mode_t render_mode
Render mode (foreground/background/half-block).
Definition options.h:1095
bool splash_screen
Show splash screen (default: true = show, use –no-splash-screen to hide).
Definition options.h:1237
char discovery_database_path[256]
~/.ascii-chat/discovery.db)
Definition options.h:1046
char server_key[256]
Expected server public key (client).
Definition options.h:1184
bool media_input
Active input is a file/URL rather than the webcam.
Definition options.h:1105
bool no_audio_mixer
Disable audio mixer (debug).
Definition options.h:1073
bool audio_spectral_mixer
Explicit post-mix processing; disabled by default.
Definition options.h:1115
char encrypt_keyfile[256]
Alternative key file path.
Definition options.h:1181
char http_origin[256]
Allowed HTTP Origin.
Definition options.h:1039
bool webrtc_skip_host
–webrtc-skip-host: Skip host candidates, force STUN/TURN only
Definition options.h:1212
char tls_cert[256]
Shared TLS certificate file path for secure network listeners.
Definition options.h:1011
bool version
Show version information.
Definition options.h:990
int webcam_index
Webcam device index (0 = first).
Definition options.h:1070
bool status_screen_explicitly_set
True if status_screen was explicitly set by user.
Definition options.h:1240
bool mcp_server_restricted
Restrict MCP capabilities for cloud deployment.
Definition options.h:1035
bool stabilize
Reduce frame-to-frame character flicker.
Definition options.h:1138
bool no_compress
Disable compression entirely.
Definition options.h:1059
int webrtc_reconnect_attempts
–webrtc-reconnect-attempts: Number of retry attempts (default: 3)
Definition options.h:1214
char address6[256]
IPv6 bind address (server only).
Definition options.h:1008
int speakers_index
Speakers device index (-1 = default).
Definition options.h:1129
int quic_port
QUIC UDP port, or zero to use the TCP server port.
Definition options.h:1023
color_filter_t color_filter
Monochromatic color filter (none/black/white/green/etc).
Definition options.h:1093
bool help
Show help message.
Definition options.h:989
bool prefer_webrtc
–prefer-webrtc: Try WebRTC before Direct TCP
Definition options.h:1206
bool quiet
Quiet mode (suppress logs).
Definition options.h:1147
double snapshot_delay
Snapshot delay in seconds.
Definition options.h:1150
char mcp_downloads_dir[256]
Hosted download directory override.
Definition options.h:1036
bool stabilize_explicit
Runtime preference was explicitly changed.
Definition options.h:1139
bool audio_spectral
Definition options.h:1114
int fps
Target framerate (0 = auto, 1-144).
Definition options.h:1099
bool stretch
Allow aspect ratio distortion.
Definition options.h:1141
bool address_explicit
Native client destination overrides automatic LAN discovery.
Definition options.h:1005
ascii_renderer_t renderer
Character selection algorithm.
Definition options.h:1140
bool waveform
Replace the video image with a live audio waveform.
Definition options.h:1123
bool quic_visual_datagrams
Prefer negotiated visual datagrams.
Definition options.h:1019
int reconnect_attempts
Number of reconnection attempts (-1=infinite, 0=none).
Definition options.h:1065
bool test_pattern
Use test pattern instead of webcam.
Definition options.h:1071
bool quic_audio_datagrams
Prefer negotiated QUIC datagrams for audio.
Definition options.h:1020
char fft_scale[32]
Amplitude scale for the FFT visualization.
Definition options.h:1125
int port
Server port number.
Definition options.h:1009
char video_codec[64]
Video codec (auto, hevc, h264, raw) - default: auto.
Definition options.h:1142
bool media_from_stdin
Reading from stdin (detected from "--file -").
Definition options.h:1082
char yt_dlp_options[512]
"--cookies-from-browser=chrome --embed-subs")
Definition options.h:1085
bool require_client_verify
Client: only connect to servers whose identity was verified by ACDS.
Definition options.h:1199
char discovery_server[256]
discovery server address (default: 127.0.0.1)
Definition options.h:1033
double debug_backtrace_time
Time parameter for –backtrace option.
Definition options.h:1250
int width
Terminal width in characters (int for OPTION_TYPE_INT compat).
Definition options.h:996
int mode_arg_index
Explicit mode token in original argv, or -1 for implicit discovery/session strings.
Definition options.h:984
bool require_server_verify
Server: only accept clients who verified via ACDS.
Definition options.h:1198
palette_type_t palette_type
Selected palette type.
Definition options.h:1229
bool flip_y
Flip video vertically (Y-axis).
Definition options.h:1106
char color_scheme_name[64]
Color scheme name (e.g., "pastel", "nord").
Definition options.h:1094
char turn_secret[256]
ACDS: Shared secret for dynamic TURN credential generation (HMAC-SHA1).
Definition options.h:1224
bool media_loop
Loop media file playback.
Definition options.h:1081
char discovery_service_key[256]
HTTPS URL).
Definition options.h:1043
bool require_client_identity
ACDS: require clients to provide signed Ed25519 identity.
Definition options.h:1197
char webtransport_public_url[256]
Public HTTPS WebTransport endpoint advertised through ACDS.
Definition options.h:1022
bool discovery_insecure
ACDS: skip server key verification (MITM-vulnerable, requires explicit opt-in).
Definition options.h:1201
bool no_check_update
Disable automatic update checks (default: false = checks enabled).
Definition options.h:1241
bool encode_audio
Enable Opus audio encoding.
Definition options.h:1060
int render_theme
0=dark 1=light 2=auto
Definition options.h:1262
char encrypt_key[256]
SSH/GPG key file path (first –key flag, kept for compatibility).
Definition options.h:1179
char media_file[256]
Media file path or "-" for stdin.
Definition options.h:1079
char otel_enabled_telemetry[256]
Definition options.h:1160
int color
Color setting (COLOR_SETTING_AUTO/TRUE/FALSE).
Definition options.h:1091
char turn_username[256]
ACDS: Username for TURN authentication.
Definition options.h:1222
char log_file[256]
Log file path.
Definition options.h:1166
unsigned short int verbose_level
Verbosity level (stackable -V).
Definition options.h:1148
char address[256]
Server address (client) or bind address (server).
Definition options.h:1007
char webtransport_origin[256]
Allowed browser origin.
Definition options.h:1015
bool flip_x
Effective horizontal orientation.
Definition options.h:1103
char grep_pattern[256]
PCRE2 regex for log filtering.
Definition options.h:1168
bool auto_width
Auto-detect width from terminal.
Definition options.h:998
char client_keys[256]
Allowed client keys (server).
Definition options.h:1185
double render_font_size
Font size in points (0 selects an automatic size).
Definition options.h:1264
double media_seek_timestamp
Seek to timestamp in seconds before playback.
Definition options.h:1083