IOR
Functions
option.c File Reference
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <option.h>
Include dependency graph for option.c:

Go to the source code of this file.

Functions

int64_t string_to_bytes (char *size_str)
 
static int print_value (option_help *o)
 
static void print_help_section (option_help *args, option_value_type type, char *name)
 
void option_print_help (option_help *args)
 
static int print_option_value (option_help *o)
 
static void print_current_option_section (option_help *args, option_value_type type)
 
void option_print_current (option_help *args)
 
static void option_parse_token (char **argv, int *flag_parsed_next, int *requiredArgsSeen, options_all_t *opt_all, int *error, int *print_help)
 
int option_parse_str (char *val, options_all_t *opt_all)
 
int option_parse_key_value (char *key, char *val, options_all_t *opt_all)
 
int option_parse (int argc, char **argv, options_all_t *opt_all)
 

Function Documentation

◆ option_parse()

int option_parse ( int  argc,
char **  argv,
options_all_t opt_all 
)

Definition at line 376 of file option.c.

References options_all_t::module_count, options_all_t::modules, NULL, o, option_parse_token(), option_print_help(), OPTION_REQUIRED_ARGUMENT, option_module::options, and option_module::prefix.

Referenced by mdtest_run(), and ParseCommandLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ option_parse_key_value()

int option_parse_key_value ( char *  key,
char *  val,
options_all_t opt_all 
)

Definition at line 364 of file option.c.

References NULL, and option_parse_token().

Referenced by DecodeDirective().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ option_parse_str()

int option_parse_str ( char *  val,
options_all_t opt_all 
)

Definition at line 354 of file option.c.

References NULL, and option_parse_token().

Here is the call graph for this function:

◆ option_parse_token()

static void option_parse_token ( char **  argv,
int *  flag_parsed_next,
int *  requiredArgsSeen,
options_all_t opt_all,
int *  error,
int *  print_help 
)
static

Definition at line 231 of file option.c.

References options_all_t::module_count, options_all_t::modules, NULL, o, OPTION_FLAG, OPTION_OPTIONAL_ARGUMENT, OPTION_REQUIRED_ARGUMENT, option_module::options, and string_to_bytes().

Referenced by option_parse(), option_parse_key_value(), and option_parse_str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ option_print_current()

void option_print_current ( option_help args)

Definition at line 225 of file option.c.

References OPTION_FLAG, OPTION_OPTIONAL_ARGUMENT, OPTION_REQUIRED_ARGUMENT, and print_current_option_section().

Here is the call graph for this function:

◆ option_print_help()

void option_print_help ( option_help args)

Definition at line 142 of file option.c.

References OPTION_FLAG, OPTION_OPTIONAL_ARGUMENT, OPTION_REQUIRED_ARGUMENT, and print_help_section().

Referenced by option_parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_current_option_section()

static void print_current_option_section ( option_help args,
option_value_type  type 
)
static

Definition at line 200 of file option.c.

References option_help::arg, option_help::longVar, o, OPTION_FLAG, print_option_value(), option_help::shortVar, and option_help::variable.

Referenced by option_print_current().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_help_section()

static void print_help_section ( option_help args,
option_value_type  type,
char *  name 
)
static

Definition at line 105 of file option.c.

References option_help::arg, option_help::help, option_help::longVar, NULL, o, print_value(), and option_help::shortVar.

Referenced by option_print_help().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_option_value()

static int print_option_value ( option_help o)
static

Definition at line 149 of file option.c.

References option_help::arg, NULL, OPTION_OPTIONAL_ARGUMENT, OPTION_REQUIRED_ARGUMENT, option_help::type, and option_help::variable.

Referenced by print_current_option_section().

Here is the caller graph for this function:

◆ print_value()

static int print_value ( option_help o)
static

Definition at line 53 of file option.c.

References option_help::arg, NULL, OPTION_FLAG, OPTION_OPTIONAL_ARGUMENT, OPTION_REQUIRED_ARGUMENT, option_help::type, and option_help::variable.

Referenced by print_help_section().

Here is the caller graph for this function:

◆ string_to_bytes()

int64_t string_to_bytes ( char *  size_str)

Definition at line 13 of file option.c.

References rc, and size.

Referenced by DecodeDirective(), NodeMemoryStringToBytes(), and option_parse_token().

Here is the caller graph for this function: