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)
 
int option_parse (int argc, char **argv, options_all *opt_all)
 

Function Documentation

◆ option_parse()

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

Definition at line 223 of file option.c.

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

Referenced by airoi_parse_options().

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 217 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 138 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 192 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 101 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 145 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().

Here is the caller graph for this function: