ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
option_descriptor_t Struct Reference

Option descriptor. More...

#include <lib/options/builder.h>

Data Fields

const char * long_name
 Long option name (e.g., "port")
 
char short_name
 Short option char (e.g., 'p', or '\0' if none)
 
option_type_t type
 Value type.
 
size_t offset
 offsetof(struct, field) - where to store value
 
const char * help_text
 Description for –help.
 
const char * group
 Group name for help sections (e.g., "NETWORK OPTIONS")
 
bool hide_from_mode_help
 If true, don't show in mode-specific help (binary-level only)
 
const void * default_value
 Pointer to default value (or NULL if required)
 
bool required
 If true, option must be provided.
 
const char * env_var_name
 Environment variable fallback (or NULL)
 
bool(* validate )(const void *options_struct, char **error_msg)
 
bool(* parse_fn )(const char *arg, void *dest, char **error_msg)
 
void(* action_fn )(void)
 Action to execute (may call exit)
 
bool owns_memory
 If true, strings are strdup'd and freed on cleanup.
 
bool optional_arg
 If true, argument is optional (for callbacks like –verbose)
 

Detailed Description

Option descriptor.

Describes a single command-line option with all its metadata.

Definition at line 70 of file builder.h.

Field Documentation

◆ action_fn

void(* option_descriptor_t::action_fn) (void)

Action to execute (may call exit)

Definition at line 96 of file builder.h.

◆ default_value

const void* option_descriptor_t::default_value

Pointer to default value (or NULL if required)

Definition at line 85 of file builder.h.

Referenced by options_config_print_usage(), and options_config_set_defaults().

◆ env_var_name

const char* option_descriptor_t::env_var_name

Environment variable fallback (or NULL)

Definition at line 87 of file builder.h.

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

◆ group

const char* option_descriptor_t::group

Group name for help sections (e.g., "NETWORK OPTIONS")

Definition at line 81 of file builder.h.

Referenced by options_config_print_usage().

◆ help_text

const char* option_descriptor_t::help_text

Description for –help.

Definition at line 80 of file builder.h.

Referenced by options_config_print_usage().

◆ hide_from_mode_help

bool option_descriptor_t::hide_from_mode_help

If true, don't show in mode-specific help (binary-level only)

Definition at line 82 of file builder.h.

Referenced by options_builder_mark_binary_only(), and options_config_print_usage().

◆ long_name

◆ offset

size_t option_descriptor_t::offset

offsetof(struct, field) - where to store value

Definition at line 77 of file builder.h.

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

◆ optional_arg

bool option_descriptor_t::optional_arg

If true, argument is optional (for callbacks like –verbose)

Definition at line 102 of file builder.h.

◆ owns_memory

bool option_descriptor_t::owns_memory

If true, strings are strdup'd and freed on cleanup.

Definition at line 99 of file builder.h.

Referenced by options_config_cleanup().

◆ parse_fn

bool(* option_descriptor_t::parse_fn) (const char *arg, void *dest, char **error_msg)

Definition at line 93 of file builder.h.

◆ required

bool option_descriptor_t::required

If true, option must be provided.

Definition at line 86 of file builder.h.

Referenced by options_config_print_usage(), and options_config_validate().

◆ short_name

char option_descriptor_t::short_name

Short option char (e.g., 'p', or '\0' if none)

Definition at line 73 of file builder.h.

Referenced by options_config_print_usage().

◆ type

option_type_t option_descriptor_t::type

◆ validate

bool(* option_descriptor_t::validate) (const void *options_struct, char **error_msg)

Definition at line 90 of file builder.h.

Referenced by options_config_validate().


The documentation for this struct was generated from the following file: