80 goto err_parse_options;
84 goto err_parse_setting;
90 printf (
"Could not find \"%s\": %s\n",
98 printf (
"%s = ", name_buf );
160 char **args,
char **
value ) ) {
168 goto err_parse_options;
173 goto err_parse_setting;
187 printf (
"Could not store \"%s\": %s\n",
211 char **args,
char **
value ) {
310 "<setting> [<increment>]" );
322 unsigned int increment = 1;
328 goto err_parse_options;
332 goto err_parse_setting;
335 if ( ( (
optind + 1 ) < argc ) &&
337 goto err_parse_increment;
355 printf (
"Could not store \"%s\": %s\n",
#define NULL
NULL pointer (VOID *).
struct arbelprm_rc_send_wqe rc
pseudo_bit_t value[0x00020]
static union @024010030001061367220137227263210031030210157031 opts
"cert<xxx>" option list
#define COMMAND(name, exec)
char * concat_args(char **args)
Concatenate arguments.
int optind
Current option index.
Parse command-line options.
@ required_argument
Option requires an argument.
@ no_argument
Option does not take an argument.
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOMEM
Not enough space.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
static union @042366366224015251152162264074251001343161101060 set_core_opts
"set", "clear", and "read" option list
struct option_descriptor set[0]
struct option_descriptor clear[0]
static int read_exec(int argc, char **argv)
"read" command
static int read_value(struct named_setting *setting, struct set_core_options *opts, char **args __unused, char **value)
Get setting value for "read" command.
struct option_descriptor read[1]
static struct command_descriptor set_cmd
"set" command descriptor
static int set_core_exec(int argc, char **argv, struct command_descriptor *cmd, int(*get_value)(struct named_setting *setting, struct set_core_options *opts, char **args, char **value))
"set", "clear", and "read" command
static struct option_descriptor inc_opts[]
"inc" option list
static int clear_exec(int argc, char **argv)
"clear" command
static int clear_value(struct named_setting *setting __unused, struct set_core_options *opts __unused, char **args __unused, char **value)
Get setting value for "clear" command.
static struct command_descriptor clear_cmd
"clear" command descriptor
static int set_value(struct named_setting *setting __unused, struct set_core_options *opts __unused, char **args, char **value)
Get setting value for "set" command.
static struct command_descriptor read_cmd
"read" command descriptor
static struct option_descriptor show_opts[]
"show" option list
static int set_exec(int argc, char **argv)
"set" command
static struct command_descriptor show_cmd
"show" command descriptor
static int inc_exec(int argc, char **argv)
"inc" command
static int show_exec(int argc, char **argv)
"show" command
static struct command_descriptor inc_cmd
"inc" command descriptor
int parse_flag(char *text __unused, int *flag)
Parse flag.
int parse_existing_setting(char *text, struct named_setting *setting)
Parse existing setting name.
int parse_autovivified_setting(char *text, struct named_setting *setting)
Parse and autovivify setting name.
int parse_integer(char *text, unsigned int *value)
Parse integer value.
int parse_timeout(char *text, unsigned long *value)
Parse timeout value (in ms).
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
Command line option parsing.
#define MAX_ARGUMENTS
No maximum number of arguments.
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
static void(* free)(struct refcnt *refcnt))
int setting_name(struct settings *settings, const struct setting *setting, char *buf, size_t len)
Return full setting name.
int fetchn_setting(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, unsigned long *value)
Fetch numeric value of setting.
int fetchf_setting_copy(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, char **value)
Fetch copy of formatted value of setting.
int storef_setting(struct settings *settings, const struct setting *setting, const char *value)
Store formatted value of setting.
int storen_setting(struct settings *settings, const struct setting *setting, unsigned long value)
Store numeric value of setting.
char * strerror(int errno)
Retrieve string representation of error number.
A command-line option descriptor.
A readline history buffer.
"set", "clear", and "read" options
unsigned long timeout
Timeout.
const struct setting_type * type
Setting type.
int quiet
Do not display setting type, only value.
int printf(const char *fmt,...)
Write a formatted string to the console.