ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
/home/runner/work/ascii-chat/ascii-chat/include/ascii-chat/options/explicit.h

Check if an option was explicitly set by the user.

Check if an option was explicitly set by the userReturns true if the given option was explicitly provided via command-line, false if it's using a default value.

Only a subset of high-importance options track explicit status in options_t to avoid bloating the struct. Check the options struct definition for which options have ${name}_explicit fields.

Parameters
option_nameName of the option (e.g., "splash_screen", "status_screen")
optsPointer to options_t struct (typically GET_OPTION convenience)
Returns
true if option was explicitly set, false otherwise
Note
This is a simple macro accessing a field in options_t
Only works for options that have an ${name}_explicit field defined
Thread-safe: reads via RCU-published options_t
const options_t *opts = options_get();
if (IS_OPTION_EXPLICIT("splash_screen", opts)) {
// User explicitly set splash_screen
}
#define IS_OPTION_EXPLICIT(name, opts)
Definition explicit.h:57
struct options_state options_t
Immutable, RCU-published snapshot of the application's runtime configuration.
const options_t * options_get(void)
Get pointer to current options struct (lock-free, thread-safe).
Definition rcu.c:511
#pragma once
#include <stdbool.h>
#define IS_OPTION_EXPLICIT(name, opts) ((opts) && (opts)->name##_explicit)