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

Type handler implementations for builder operations. More...

Go to the source code of this file.

Variables

const option_builder_handler_t g_builder_handlers []
 

Detailed Description

Type handler implementations for builder operations.

Implements handler functions for each option type (bool, int, string, etc.) that handle checking if set, applying environment variables, parsing CLI args, and formatting help placeholders.

Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
January 2026

Definition in file options/builder/handlers.c.

Variable Documentation

◆ g_builder_handlers

const option_builder_handler_t g_builder_handlers[]
Initial value:
= {
[OPTION_TYPE_BOOL] = {is_set_bool, apply_env_bool, apply_cli_bool, format_help_placeholder_bool},
[OPTION_TYPE_INT] = {is_set_int, apply_env_int, apply_cli_int, format_help_placeholder_int},
[OPTION_TYPE_STRING] = {is_set_string, apply_env_string, apply_cli_string, format_help_placeholder_string},
[OPTION_TYPE_DOUBLE] = {is_set_double, apply_env_double, apply_cli_double, format_help_placeholder_double},
[OPTION_TYPE_CALLBACK] = {is_set_callback, apply_env_callback, apply_cli_callback,
format_help_placeholder_callback},
[OPTION_TYPE_ACTION] = {is_set_action, apply_env_action, apply_cli_action, format_help_placeholder_action},
}
@ OPTION_TYPE_INT
Integer value (–count 42)
Definition builder.h:163
@ OPTION_TYPE_DOUBLE
Floating point (–ratio 1.5)
Definition builder.h:165
@ OPTION_TYPE_STRING
String value (–name foo)
Definition builder.h:164
@ OPTION_TYPE_ACTION
Action that executes and may exit (–list-webcams, etc.)
Definition builder.h:167
@ OPTION_TYPE_CALLBACK
Custom parser function.
Definition builder.h:166
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value)
Definition builder.h:162

Definition at line 54 of file options/builder/handlers.c.

54 {
55 [OPTION_TYPE_BOOL] = {is_set_bool, apply_env_bool, apply_cli_bool, format_help_placeholder_bool},
56 [OPTION_TYPE_INT] = {is_set_int, apply_env_int, apply_cli_int, format_help_placeholder_int},
57 [OPTION_TYPE_STRING] = {is_set_string, apply_env_string, apply_cli_string, format_help_placeholder_string},
58 [OPTION_TYPE_DOUBLE] = {is_set_double, apply_env_double, apply_cli_double, format_help_placeholder_double},
59 [OPTION_TYPE_CALLBACK] = {is_set_callback, apply_env_callback, apply_cli_callback,
60 format_help_placeholder_callback},
61 [OPTION_TYPE_ACTION] = {is_set_action, apply_env_action, apply_cli_action, format_help_placeholder_action},
62};

Referenced by is_option_set(), options_config_set_defaults(), and options_config_validate().