ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
public_api.c File Reference

Public API functions for the options registry. More...

Go to the source code of this file.

Functions

asciichat_error_t registry_add_all_to_flags_builder (flags_schema_builder_t *builder, option_mode_bitmask_t mode_mask)
asciichat_error_t options_registry_add_all_to_builder (options_builder_t *builder)
 Add all options from registry to builder.
const option_descriptor_t * options_registry_get_for_mode (asciichat_mode_t mode, size_t *num_options)
 Get all options for a specific mode.
const option_descriptor_t * options_registry_get_for_display (asciichat_mode_t mode, bool for_binary_help, size_t *num_options)
 Get options for help/completions display with unified filtering.
const registry_entry_t * registry_get_raw (void)
 Get raw access to registry for completions filtering.
size_t registry_get_count (void)
 Get total number of registry entries.
const option_metadata_t * options_registry_get_metadata (const char *long_name)
 Get complete metadata for an option.
const char ** options_registry_get_enum_values (const char *option_name, const char ***descriptions, size_t *count)
 Get enum values for an option.
bool options_registry_get_numeric_range (const char *option_name, int *min_out, int *max_out, int *step_out)
 Get numeric range for an option.
const char ** options_registry_get_examples (const char *option_name, size_t *count)
 Get example values for an option.
option_input_type_t options_registry_get_input_type (const char *option_name)
 Get input type for an option.

Detailed Description

Public API functions for the options registry.

This file contains all the public-facing functions that external code uses to interact with the options registry. These functions are declared in registry.h.

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

Definition in file public_api.c.

Function Documentation

◆ options_registry_add_all_to_builder()

asciichat_error_t options_registry_add_all_to_builder ( options_builder_t * builder)

Add all options from registry to builder.

Iterates through the central options registry and adds each option to the provided builder with its mode bitmask set.

Parameters
builderOptions builder to add options to
Returns
ASCIICHAT_OK on success, error code on failure

Definition at line 168 of file public_api.c.

168 {
169 if (!builder)
170 return SET_ERRNO(ERROR_INVALID_PARAM, "Builder is NULL");
172 for (size_t i = 0; i < g_registry_size; ++i) {
173 if (g_options_registry[i].long_name) {
175 options_builder_add_descriptor(builder, &descriptor);
176 }
177 }
178 return ASCIICHAT_OK;
179}
#define SET_ERRNO(code,...)
void options_builder_add_descriptor(options_builder_t *builder, const option_descriptor_t *descriptor)
Add full option descriptor (advanced).
option_descriptor_t registry_entry_to_descriptor(const registry_entry_t *entry)
Definition core.c:157
void registry_init_size(void)
Initialize registry size and metadata.
Definition core.c:107
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INVALID_PARAM
registry_entry_t g_options_registry[2048]
Definition registry.c:41
size_t g_registry_size
Definition registry.c:43
The complete registry entry for one command-line/configuration option.
Definition builder.h:251

References ASCIICHAT_OK, ERROR_INVALID_PARAM, g_options_registry, g_registry_size, options_builder_add_descriptor(), registry_entry_to_descriptor(), registry_init_size(), and SET_ERRNO.

Referenced by options_preset_unified().

◆ options_registry_get_enum_values()

const char ** options_registry_get_enum_values ( const char * option_name,
const char *** descriptions,
size_t * count )

Get enum values for an option.

Retrieves enum values and descriptions for an option that has OPTION_INPUT_ENUM type in its metadata.

Parameters
option_nameLong name of option
descriptionsOUTPUT: Pointer to descriptions array (or NULL if not needed)
countOUTPUT: Number of values/descriptions
Returns
Array of enum value strings, or NULL if not found or not an enum type

Example:

const char **values;
const char **descs;
size_t count;
values = options_registry_get_enum_values("color-mode", &descs, &count);
if (values) {
for (size_t i = 0; i < count; i++) {
printf("%s: %s\n", values[i], descs[i]);
}
}
const char ** options_registry_get_enum_values(const char *option_name, const char ***descriptions, size_t *count)
Get enum values for an option.
Definition public_api.c:272

Definition at line 272 of file public_api.c.

272 {
273 if (!option_name || !count) {
274 SET_ERRNO(ERROR_INVALID_PARAM, "Option name is NULL or count is NULL");
275 if (count)
276 *count = 0;
277 return NULL;
278 }
279
280 const option_metadata_t *meta = options_registry_get_metadata(option_name);
281 if (!meta || meta->input_type != OPTION_INPUT_ENUM || !meta->enum_values || meta->enum_values[0] == NULL) {
282 SET_ERRNO(ERROR_NOT_FOUND, "Option '%s' not found", option_name);
283 *count = 0;
284 if (descriptions)
285 *descriptions = NULL;
286 return NULL;
287 }
288
289 // Count enum values (NULL-terminated array)
290 size_t enum_count = 0;
291 while (meta->enum_values[enum_count] != NULL) {
292 enum_count++;
293 }
294
295 *count = enum_count;
296 if (descriptions) {
297 *descriptions = meta->enum_descriptions;
298 }
299 return meta->enum_values;
300}
@ OPTION_INPUT_ENUM
Choose from fixed set of enum values.
Definition builder.h:187
@ ERROR_NOT_FOUND
const option_metadata_t * options_registry_get_metadata(const char *long_name)
Get complete metadata for an option.
Definition public_api.c:251
Completion metadata attached to one option descriptor.
Definition builder.h:201
const char ** enum_values
Enum value strings (null-terminated, e.g., {"auto", "none", "16", "256", "truecolor",...
Definition builder.h:203
option_input_type_t input_type
What kind of input this option expects.
Definition builder.h:221
const char ** enum_descriptions
Descriptions parallel to enum_values (null-terminated, e.g., "Auto-detect from terminal").
Definition builder.h:204

References option_metadata_t::enum_descriptions, option_metadata_t::enum_values, ERROR_INVALID_PARAM, ERROR_NOT_FOUND, option_metadata_t::input_type, OPTION_INPUT_ENUM, options_registry_get_metadata(), and SET_ERRNO.

Referenced by asciichat_suggest_enum_value(), options_get_enum_values(), and options_is_enum_option().

◆ options_registry_get_examples()

const char ** options_registry_get_examples ( const char * option_name,
size_t * count )

Get example values for an option.

Retrieves example values or command invocations for an option.

Parameters
option_nameLong name of option
countOUTPUT: Number of examples
Returns
Array of example strings, or NULL if no examples defined

Definition at line 322 of file public_api.c.

322 {
323 if (!option_name || !count) {
324 SET_ERRNO(ERROR_INVALID_PARAM, "Option name is NULL or count is NULL");
325 if (count)
326 *count = 0;
327 return NULL;
328 }
329
330 const option_metadata_t *meta = options_registry_get_metadata(option_name);
331 if (!meta || !meta->examples || meta->examples[0] == NULL) {
332 *count = 0;
333 return NULL;
334 }
335
336 // Count examples by finding NULL terminator
337 size_t example_count = 0;
338 for (size_t i = 0; meta->examples[i] != NULL; i++) {
339 example_count++;
340 }
341
342 *count = example_count;
343 return meta->examples;
344}
const char ** examples
Example values or command invocations (null-terminated array).
Definition builder.h:215

References ERROR_INVALID_PARAM, option_metadata_t::examples, options_registry_get_metadata(), and SET_ERRNO.

◆ options_registry_get_for_display()

const option_descriptor_t * options_registry_get_for_display ( asciichat_mode_t mode,
bool for_binary_help,
size_t * num_options )

Get options for help/completions display with unified filtering.

Returns options filtered using the same logic as the help system. This ensures help output and completions are always in sync.

Uses the same filtering rules as options_print_help_for_mode():

  • For binary-level help (mode == MODE_DISCOVERY): shows all options that apply to any mode
  • For mode-specific help: shows only options for that mode (binary options excluded unless also mode-specific)
  • Respects hide_from_binary_help and hide_from_mode_help flags
Parameters
modeMode to filter for (use MODE_DISCOVERY for binary-level help)
for_binary_helpIf true, use binary-help filtering; if false, use mode-specific filtering
num_optionsOUTPUT: Number of options returned
Returns
Array of option descriptors (caller must free), or NULL on error
Note
This is the AUTHORITATIVE filtering function for both help and completions. Always use this function to ensure consistency across the application.

Definition at line 204 of file public_api.c.

204 {
205 if (!num_options)
206 return NULL;
208 size_t count = 0;
209 for (size_t i = 0; i < g_registry_size; ++i)
210 count += registry_entry_applies_to_mode(&g_options_registry[i], mode, for_binary_help);
211 option_descriptor_t *result = count ? SAFE_MALLOC(count * sizeof(*result), option_descriptor_t *) : NULL;
212 if (!result) {
213 *num_options = 0;
214 return NULL;
215 }
216 size_t out = 0;
217 for (size_t i = 0; i < g_registry_size; ++i)
218 if (registry_entry_applies_to_mode(&g_options_registry[i], mode, for_binary_help))
220 *num_options = out;
221 return result;
222}
bool registry_entry_applies_to_mode(const registry_entry_t *entry, asciichat_mode_t mode, bool for_binary_help)
Definition core.c:182
#define SAFE_MALLOC(size, cast)
static bool size_t gotel_query_t * out
Definition queries.h:8

References g_options_registry, g_registry_size, out, registry_entry_applies_to_mode(), registry_entry_to_descriptor(), registry_init_size(), and SAFE_MALLOC.

Referenced by completions_generate_fish(), completions_generate_powershell(), and completions_generate_zsh().

◆ options_registry_get_for_mode()

const option_descriptor_t * options_registry_get_for_mode ( asciichat_mode_t mode,
size_t * num_options )

Get all options for a specific mode.

Returns an array of option descriptors that apply to the given mode. The array is allocated and must be freed by the caller.

Parameters
modeMode to filter by
num_optionsOUTPUT: Number of options returned
Returns
Array of option descriptors (caller must free), or NULL on error

Definition at line 181 of file public_api.c.

181 {
182 if (!num_options)
183 return NULL;
188 size_t count = 0;
189 for (size_t i = 0; i < g_registry_size; ++i)
190 count += (g_options_registry[i].mode_bitmask & mask) != 0;
191 option_descriptor_t *result = count ? SAFE_MALLOC(count * sizeof(*result), option_descriptor_t *) : NULL;
192 if (!result) {
193 *num_options = 0;
194 return NULL;
195 }
196 size_t out = 0;
197 for (size_t i = 0; i < g_registry_size; ++i)
198 if (g_options_registry[i].mode_bitmask & mask)
200 *num_options = out;
201 return result;
202}
option_mode_bitmask_t
Option mode bitmask.
Definition options.h:933
@ 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_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
@ OPTION_MODE_CLIENT
Client mode (bit 1).
Definition options.h:936
@ 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

References g_options_registry, g_registry_size, MODE_CLIENT, MODE_DISCOVERY, MODE_DISCOVERY_SERVICE, MODE_MCP_SERVER, MODE_MIRROR, MODE_SERVER, OPTION_MODE_CLIENT, OPTION_MODE_DISCOVERY, OPTION_MODE_DISCOVERY_SVC, OPTION_MODE_MCP_SERVER, OPTION_MODE_MIRROR, OPTION_MODE_NONE, OPTION_MODE_SERVER, out, registry_entry_to_descriptor(), registry_init_size(), and SAFE_MALLOC.

Referenced by completions_collect_all_modes_unique().

◆ options_registry_get_input_type()

option_input_type_t options_registry_get_input_type ( const char * option_name)

Get input type for an option.

Retrieves the input type (OPTION_INPUT_ENUM, OPTION_INPUT_NUMERIC, etc.) for the given option.

Parameters
option_nameLong name of option
Returns
Input type (OPTION_INPUT_NONE if not found)

Definition at line 346 of file public_api.c.

346 {
347 if (!option_name) {
348 SET_ERRNO(ERROR_INVALID_PARAM, "Option name is NULL");
349 return OPTION_INPUT_NONE;
350 }
351
352 const option_metadata_t *meta = options_registry_get_metadata(option_name);
353 if (!meta) {
354 SET_ERRNO(ERROR_NOT_FOUND, "Option '%s' not found", option_name);
355 return OPTION_INPUT_NONE;
356 }
357
358 return meta->input_type;
359}
@ OPTION_INPUT_NONE
No input (boolean flag).
Definition builder.h:186

References ERROR_INVALID_PARAM, ERROR_NOT_FOUND, option_metadata_t::input_type, OPTION_INPUT_NONE, options_registry_get_metadata(), and SET_ERRNO.

◆ options_registry_get_metadata()

const option_metadata_t * options_registry_get_metadata ( const char * long_name)

Get complete metadata for an option.

Retrieves all completion metadata for the given option, including enum values, numeric ranges, examples, input type, etc.

Parameters
long_nameLong name of option to look up
Returns
Pointer to metadata structure, or NULL if option not found
Note
The returned pointer points to data within the registry and should not be modified or freed.

Definition at line 251 of file public_api.c.

251 {
252 if (!long_name) {
253 SET_ERRNO(ERROR_INVALID_PARAM, "Long name is NULL");
254 return NULL;
255 }
256
257 // Look up option in registry and return its metadata
259 for (size_t i = 0; i < g_registry_size; i++) {
260 const registry_entry_t *entry = &g_options_registry[i];
261 if (entry->long_name && strcmp(entry->long_name, long_name) == 0) {
262 // Return the metadata from the registry entry
263 return &entry->metadata;
264 }
265 }
266
267 // If not found, return empty metadata
268 static option_metadata_t empty_metadata = {0};
269 return &empty_metadata;
270}
Registry entry - stores option definition with mode bitmask and metadata.
option_metadata_t metadata
Enum values, numeric ranges, examples.
const char * long_name

References ERROR_INVALID_PARAM, g_options_registry, g_registry_size, registry_entry_t::long_name, registry_entry_t::metadata, registry_init_size(), and SET_ERRNO.

Referenced by options_get_enum_entries(), options_registry_get_enum_values(), options_registry_get_examples(), options_registry_get_input_type(), and options_registry_get_numeric_range().

◆ options_registry_get_numeric_range()

bool options_registry_get_numeric_range ( const char * option_name,
int * min_out,
int * max_out,
int * step_out )

Get numeric range for an option.

Retrieves min/max/step values for an option that has OPTION_INPUT_NUMERIC type in its metadata.

Parameters
option_nameLong name of option
min_outOUTPUT: Minimum value (or 0 if no limit)
max_outOUTPUT: Maximum value (or 0 if no limit)
step_outOUTPUT: Step size (or 0 if continuous)
Returns
true if option found and has numeric range, false otherwise

Example:

int min, max, step;
if (options_registry_get_numeric_range("compression-level", &min, &max, &step)) {
printf("Range: %d-%d (step: %d)\n", min, max, step);
}
bool options_registry_get_numeric_range(const char *option_name, int *min_out, int *max_out, int *step_out)
Get numeric range for an option.
Definition public_api.c:302

Definition at line 302 of file public_api.c.

302 {
303 if (!option_name || !min_out || !max_out || !step_out) {
304 SET_ERRNO(ERROR_INVALID_PARAM, "Option name is NULL or min_out, max_out, or step_out is NULL");
305 return false;
306 }
307
308 const option_metadata_t *meta = options_registry_get_metadata(option_name);
309 if (!meta || meta->input_type != OPTION_INPUT_NUMERIC) {
310 *min_out = 0;
311 *max_out = 0;
312 *step_out = 0;
313 return false;
314 }
315
316 *min_out = meta->numeric_range.min;
317 *max_out = meta->numeric_range.max;
318 *step_out = meta->numeric_range.step;
319 return true;
320}
@ OPTION_INPUT_NUMERIC
Numeric value with optional min/max/step.
Definition builder.h:188
int max
Maximum value (or 0 if no limit).
Definition builder.h:210
int min
Minimum value (or 0 if no limit).
Definition builder.h:209
struct option_metadata_t::@061372117173071240020206164036331043262170062306 numeric_range
int step
Step size (0 = no step, continuous).
Definition builder.h:211

References ERROR_INVALID_PARAM, option_metadata_t::input_type, option_metadata_t::max, option_metadata_t::min, option_metadata_t::numeric_range, OPTION_INPUT_NUMERIC, options_registry_get_metadata(), SET_ERRNO, and option_metadata_t::step.

◆ registry_add_all_to_flags_builder()

asciichat_error_t registry_add_all_to_flags_builder ( flags_schema_builder_t * builder,
option_mode_bitmask_t mode_mask )

Populate a libflags schema builder from the application option registry.

Definition at line 84 of file public_api.c.

84 {
85 if (!builder)
86 return SET_ERRNO(ERROR_INVALID_PARAM, "Flags builder is NULL");
88 for (size_t i = 0; i < g_registry_size; ++i) {
89 const registry_entry_t *entry = &g_options_registry[i];
90 if (!entry->long_name || (entry->mode_bitmask != OPTION_MODE_NONE && !(entry->mode_bitmask & mode_mask) && !(entry->mode_bitmask & OPTION_MODE_BINARY)))
91 continue;
92 /* These binary commands are handled by ascii-chat's command dispatcher,
93 * not stored as values in options_t. */
94 if (entry->type == OPTION_TYPE_STRING && entry->default_value_size == 0 && entry->offset == 0)
95 continue;
96 flags_value_type_t type;
97 flags_option_behavior_t behavior = FLAGS_BEHAVIOR_VALUE;
98 switch (entry->type) {
100 type = FLAGS_TYPE_BOOL;
101 break;
102 case OPTION_TYPE_INT:
103 type = FLAGS_TYPE_INT64;
104 break;
106 type = FLAGS_TYPE_DOUBLE;
107 break;
109 type = FLAGS_TYPE_STRING;
110 break;
112 type = FLAGS_TYPE_CUSTOM;
113 behavior = FLAGS_BEHAVIOR_CALLBACK;
114 break;
116 type = FLAGS_TYPE_CUSTOM;
117 behavior = FLAGS_BEHAVIOR_ACTION;
118 break;
119 default:
120 continue;
121 }
122 flags_option_spec_t option = {.name = entry->long_name,
123 .short_name = entry->short_name,
124 .description = entry->help_text,
125 .group = entry->group,
126 .required = entry->required,
127 .metavar = entry->arg_placeholder,
128 .environment_name = entry->env_var_name,
129 .type = type,
130 .behavior = behavior,
131 .default_operation = entry->type == OPTION_TYPE_BOOL ? FLAGS_VALUE_TOGGLE : FLAGS_VALUE_ASSIGN,
132 .argument_requirement = entry->type == OPTION_TYPE_BOOL || entry->type == OPTION_TYPE_ACTION ? FLAGS_ARGUMENT_NONE
133 : entry->optional_arg ? FLAGS_ARGUMENT_OPTIONAL
134 : FLAGS_ARGUMENT_REQUIRED,
135 .storage_offset = entry->offset,
136 .storage_size = entry->type == OPTION_TYPE_STRING
137 ? (entry->owns_memory ? sizeof(char *) : (entry->default_value_size ? entry->default_value_size : OPTIONS_BUFF_SIZE))
138 : entry->type == OPTION_TYPE_DOUBLE ? (entry->default_value_size ? entry->default_value_size : sizeof(double))
139 : entry->type == OPTION_TYPE_BOOL ? (entry->default_value_size ? entry->default_value_size : sizeof(bool))
140 : (entry->default_value_size ? entry->default_value_size : sizeof(int)),
141 .default_value = entry->default_value,
142 .enum_values = entry->metadata.enum_values,
143 .enum_value_count = 0,
144 .dynamic_string = entry->owns_memory,
145 .parse = entry->type == OPTION_TYPE_CALLBACK ? registry_flags_parse : NULL,
146 .validate = entry->type == OPTION_TYPE_DOUBLE ? registry_flags_validate : NULL,
147 .validation_regex = entry->metadata.validation_pattern,
148 .on_change = entry->type == OPTION_TYPE_ACTION || (entry->type == OPTION_TYPE_STRING && entry->parse_fn) ? registry_flags_change : NULL,
149 .user_data = (void *)entry};
150 if (entry->type == OPTION_TYPE_CALLBACK || entry->type == OPTION_TYPE_ACTION)
151 option.storage_size = 0;
152 if (entry->metadata.enum_values) {
153 while (entry->metadata.enum_values[option.enum_value_count])
154 ++option.enum_value_count;
155 }
156 char config_key[256];
157 const char *config_field = entry->long_name;
158 if (entry->group && strcmp(entry->group, "OTEL") == 0 && strncmp(config_field, "otel-", 5) == 0)
159 config_field += 5;
160 if (entry->group && flags_config_make_toml_key(entry->group, config_field, config_key, sizeof(config_key)))
161 option.config_key = config_key;
162 if (!flags_schema_builder_add_option(builder, &option))
163 return SET_ERRNO(ERROR_MEMORY, "Failed to add %s to libflags schema", entry->long_name);
164 }
165 return ASCIICHAT_OK;
166}
@ OPTION_TYPE_INT
Integer value (–count 42).
Definition builder.h:172
@ OPTION_TYPE_DOUBLE
Floating point (–ratio 1.5).
Definition builder.h:174
@ OPTION_TYPE_STRING
String value (–name foo).
Definition builder.h:173
@ OPTION_TYPE_ACTION
Action that executes and may exit (–list-webcams, etc.).
Definition builder.h:176
@ OPTION_TYPE_CALLBACK
Custom parser function.
Definition builder.h:175
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value).
Definition builder.h:171
@ ERROR_MEMORY
Definition error_codes.h:55
#define OPTIONS_BUFF_SIZE
Buffer size for option string values.
Definition options.h:305
@ OPTION_MODE_BINARY
Binary-level options (parsed before mode detection).
Definition options.h:942
if(!queries||!out||index >=DATABASE_QUERY_COUNT) return false
option_type_t type
const char * group
bool optional_arg
bool required
bool owns_memory
size_t default_value_size
const char * help_text
option_mode_bitmask_t mode_bitmask
const char * arg_placeholder
Custom argument placeholder (e.g., "SHELL [FILE]" instead of "STR").
const char * env_var_name
char short_name
size_t offset

References registry_entry_t::arg_placeholder, ASCIICHAT_OK, registry_entry_t::default_value, registry_entry_t::default_value_size, option_metadata_t::enum_values, registry_entry_t::env_var_name, ERROR_INVALID_PARAM, ERROR_MEMORY, g_options_registry, g_registry_size, registry_entry_t::group, registry_entry_t::help_text, registry_entry_t::long_name, registry_entry_t::metadata, registry_entry_t::mode_bitmask, registry_entry_t::offset, OPTION_MODE_BINARY, OPTION_MODE_NONE, OPTION_TYPE_ACTION, OPTION_TYPE_BOOL, OPTION_TYPE_CALLBACK, OPTION_TYPE_DOUBLE, OPTION_TYPE_INT, OPTION_TYPE_STRING, registry_entry_t::optional_arg, OPTIONS_BUFF_SIZE, registry_entry_t::owns_memory, registry_entry_t::parse_fn, registry_init_size(), registry_entry_t::required, SET_ERRNO, registry_entry_t::short_name, registry_entry_t::type, and option_metadata_t::validation_pattern.

Referenced by action_completions(), options_config_build_flags_schema(), options_json_parse_value(), options_validate_libflags(), and usage().

◆ registry_get_count()

size_t registry_get_count ( void )

Get total number of registry entries.

Returns
Number of options in registry (not including NULL terminator)

Definition at line 242 of file public_api.c.

242 {
244 return g_registry_size;
245}

References g_registry_size, and registry_init_size().

◆ registry_get_raw()

const registry_entry_t * registry_get_raw ( void )

Get raw access to registry for completions filtering.

Returns a pointer to the internal registry array. The array is NULL-terminated (final entry has long_name == NULL). Used by completions generators.

Returns
Pointer to registry array (read-only), or NULL on error

Definition at line 232 of file public_api.c.

232 {
234 return g_options_registry;
235}

References g_options_registry, and registry_init_size().