111 #ifndef SYS_ENV_ARG_CAPACITY 112 #define SYS_ENV_ARG_CAPACITY 16 359 char *
value,
size_t cap);
Argument flag expects an integer value.
const char * value
Default value, or the matched value after a successful parse.
Termination request from the environment.
bool sys_env_arg_parse_float32(sys_env_arg_t *args, const char *name, float *value)
Look up a parsed flag's value as a 32-bit single-precision floating-point number. ...
size_t sys_env_arg_count(sys_env_arg_t *args)
Return the number of positional arguments.
Argument flag expects a string value.
Argument flag expects a floating-point value.
Quit request from the environment.
Argument flag expects an unsigned integer value.
bool sys_env_arg_parse_uint32(sys_env_arg_t *args, const char *name, uint32_t *value)
Look up a parsed flag's value as a 32-bit unsigned integer.
const char * sys_env_version(void)
Return the version of the current environment.
sys_env_arg_type_t
Argument flag value types.
struct sys_env_arg_flag_t sys_env_arg_flag_t
Describes a single command-line argument flag.
const char * long_name
Name of the argument flag.
Opaque byte streams for reading, writing, seeking, and readiness notification.
struct sys_iostream_t sys_iostream_t
An opaque byte stream.
const char * sys_env_serial(void)
Return a unique identifier for the current environment.
const char * sys_env_name(void)
Return the name of the current environment.
bool sys_env_arg_parse_bool(sys_env_arg_t *args, const char *name, bool *value)
Look up a parsed flag's value as a boolean.
size_t sys_env_arg_parse_string(sys_env_arg_t *args, const char *name, char *value, size_t cap)
Look up a parsed flag's value as a string.
bool sys_env_signalhandler(sys_env_signal_t mask, sys_env_signal_callback_t callback)
Set a handler for environment signals.
bool sys_env_arg_parse_uint64(sys_env_arg_t *args, const char *name, uint64_t *value)
Look up a parsed flag's value as a 64-bit unsigned integer.
const char * sys_env_arg_string(sys_env_arg_t *args, size_t index)
Return the value of a positional argument by index.
bool sys_env_arg_parse_int64(sys_env_arg_t *args, const char *name, int64_t *value)
Look up a parsed flag's value as a 64-bit signed integer.
void sys_env_set_args(int argc, char *argv[])
Replace the argc/argv that sys_env_arg_parse() reads.
sys_env_signal_t
Environment signal types.
bool sys_env_arg_parse_int32(sys_env_arg_t *args, const char *name, int32_t *value)
Look up a parsed flag's value as a 32-bit signed integer.
sys_env_arg_t * sys_env_arg_parse(sys_env_arg_flag_t *flags)
Parse the process's command-line arguments against a set of flags.
sys_env_arg_type_t type
Expected value type for the argument flag.
bool sys_env_arg_parse_float64(sys_env_arg_t *args, const char *name, double *value)
Look up a parsed flag's value as a 64-bit double-precision floating-point number. ...
Argument flag expects a boolean value.
Interrupt request from the environment.
const char * sys_env_system(void)
Return the system identifier for the current environment.
Describes a single command-line argument flag.
bool sys_env_arg_usage(sys_env_arg_flag_t *flags, sys_iostream_t *stream)
Print the usage information for the command-line flags.
struct sys_env_arg_t sys_env_arg_t
The result of a successful sys_env_arg_parse() call.
const char * short_name
Short name or single-character alias for the argument flag.
void(* sys_env_signal_callback_t)(sys_env_signal_t signal)
Callback function type for handling environment signals.