ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
common.h File Reference

Shared structures and macros for registry implementation. More...

Go to the source code of this file.

Data Structures

struct  registry_entry_t
 Registry entry - stores option definition with mode bitmask and metadata. More...
 
struct  category_builder_t
 Category builder structure - maps categories to their entry arrays. More...
 

Macros

#define REGISTRY_TERMINATOR()
 Initialize a terminator entry (sentinel value for array end) Uses designated initializers to properly initialize all fields to zero/NULL.
 

Typedefs

typedef const void *(* mode_default_getter_fn) (asciichat_mode_t mode)
 Mode-aware default value getter function type.
 

Detailed Description

Shared structures and macros for registry implementation.

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

Definition in file options/registry/common.h.

Macro Definition Documentation

◆ REGISTRY_TERMINATOR

#define REGISTRY_TERMINATOR ( )
Value:
{.long_name = NULL, \
.short_name = '\0', \
.type = OPTION_TYPE_BOOL, \
.offset = 0, \
.default_value = NULL, \
.mode_default_getter = NULL, \
.default_value_size = 0, \
.help_text = NULL, \
.group = NULL, \
.arg_placeholder = NULL, \
.required = false, \
.env_var_name = NULL, \
.validate_fn = NULL, \
.parse_fn = NULL, \
.owns_memory = false, \
.optional_arg = false, \
.mode_bitmask = OPTION_MODE_NONE, \
.metadata = {0}}
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value)
Definition builder.h:162
@ OPTION_MODE_NONE
No modes (invalid)

Initialize a terminator entry (sentinel value for array end) Uses designated initializers to properly initialize all fields to zero/NULL.

Definition at line 65 of file options/registry/common.h.

66 {.long_name = NULL, \
67 .short_name = '\0', \
68 .type = OPTION_TYPE_BOOL, \
69 .offset = 0, \
70 .default_value = NULL, \
71 .mode_default_getter = NULL, \
72 .default_value_size = 0, \
73 .help_text = NULL, \
74 .group = NULL, \
75 .arg_placeholder = NULL, \
76 .required = false, \
77 .env_var_name = NULL, \
78 .validate_fn = NULL, \
79 .parse_fn = NULL, \
80 .owns_memory = false, \
81 .optional_arg = false, \
82 .mode_bitmask = OPTION_MODE_NONE, \
83 .metadata = {0}}

Typedef Documentation

◆ mode_default_getter_fn

typedef const void *(* mode_default_getter_fn) (asciichat_mode_t mode)

Mode-aware default value getter function type.

Returns the default value for an option based on the current mode. Used for options that have different defaults per mode (e.g., log-file, port, websocket-port).

Parameters
modeThe mode to get the default for
Returns
Pointer to the default value for this mode (must remain valid)

Definition at line 26 of file options/registry/common.h.