ascii-chat 0.11.33
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
const options_t * options_get(void)
Get current options (lock-free read)
Definition rcu.c:496
Consolidated options structure.
#pragma once
#include <stdbool.h>
#define IS_OPTION_EXPLICIT(name, opts) \
((opts) && (opts)->name##_explicit)
ClangTool/LibTooling compatibility shim for stdbool.h.