dpkg 1.21.11
Data Structures | Macros | Typedefs | Functions | Variables
Collaboration diagram for Option parsing:

Data Structures

struct  cmdinfo
 

Macros

#define MAX_CONFIG_LINE   1024
 
#define ACTION(longopt, shortopt, code, func)    { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, func }
 
#define ACTION_MUX(longopt, shortopt, code, func, strvar)    { longopt, shortopt, 2, NULL, strvar, setaction, code, NULL, func }
 
#define OBSOLETE(longopt, shortopt)    { longopt, shortopt, 0, NULL, NULL, setobsolete, 0, NULL, NULL }
 

Typedefs

typedef int action_func(const char *const *argv)
 

Functions

void badusage (const char *fmt,...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1)
 
void dpkg_options_load (const char *prog, const struct cmdinfo *cmdinfos)
 
void dpkg_options_parse (const char *const **argvp, const struct cmdinfo *cmdinfos, const char *help_str)
 
long dpkg_options_parse_arg_int (const struct cmdinfo *cmd, const char *str)
 
struct pkginfodpkg_options_parse_pkgname (const struct cmdinfo *cmd, const char *name)
 Parse an argument as a package name. More...
 
void setaction (const struct cmdinfo *cip, const char *value)
 
void setobsolete (const struct cmdinfo *cip, const char *value)
 
void set_instdir (const struct cmdinfo *cip, const char *value)
 
void set_admindir (const struct cmdinfo *cip, const char *value)
 
void set_root (const struct cmdinfo *cip, const char *value)
 

Variables

const struct cmdinfocipaction
 Current cmdinfo action. More...
 

Detailed Description

Macro Definition Documentation

◆ ACTION

#define ACTION (   longopt,
  shortopt,
  code,
  func 
)     { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, func }

◆ ACTION_MUX

#define ACTION_MUX (   longopt,
  shortopt,
  code,
  func,
  strvar 
)     { longopt, shortopt, 2, NULL, strvar, setaction, code, NULL, func }

◆ MAX_CONFIG_LINE

#define MAX_CONFIG_LINE   1024

◆ OBSOLETE

#define OBSOLETE (   longopt,
  shortopt 
)     { longopt, shortopt, 0, NULL, NULL, setobsolete, 0, NULL, NULL }

Typedef Documentation

◆ action_func

typedef int action_func(const char *const *argv)

Function Documentation

◆ badusage()

void badusage ( const char *  fmt,
  ... 
)

References args, m_vasprintf(), and ohshit().

Referenced by clearselections(), cmpversions(), commandfd(), do_build(), do_contents(), do_control(), do_ctrltarfile(), do_extract(), do_fsystarfile(), do_info(), do_raw_extract(), do_split(), dpkg_options_parse_arg_int(), dpkg_options_parse_pkgname(), forgetold(), packages(), predeppackage(), print_foreign_arches(), printarch(), setaction(), setselections(), unpackchk(), updateavailable(), validate_archname(), validate_pkgname(), and validate_trigname().

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

◆ dpkg_options_load()

void dpkg_options_load ( const char *  prog,
const struct cmdinfo cmdinfos 
)

Referenced by main().

Here is the caller graph for this function:

◆ dpkg_options_parse()

void dpkg_options_parse ( const char *const **  argvp,
const struct cmdinfo cmdinfos,
const char *  help_str 
)

Referenced by main().

Here is the caller graph for this function:

◆ dpkg_options_parse_arg_int()

long dpkg_options_parse_arg_int ( const struct cmdinfo cmd,
const char *  str 
)

References _, badusage(), cmdinfo::olong, and cmdinfo::oshort.

Referenced by commandfd().

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

◆ dpkg_options_parse_pkgname()

struct pkginfo * dpkg_options_parse_pkgname ( const struct cmdinfo cmd,
const char *  name 
)

Parse an argument as a package name.

The string is parsed as a singleton package name, and a pkginfo instance is returned.

Parameters
cmdThe command information structure currently parsed.
nameThe package name argument
Returns
A package instance.

References _, badusage(), cmdinfo::olong, pkg_spec_parse_pkg(), and dpkg_error::str.

Here is the call graph for this function:

◆ set_admindir()

void set_admindir ( const struct cmdinfo cip,
const char *  value 
)

References dpkg_db_set_dir().

Here is the call graph for this function:

◆ set_instdir()

void set_instdir ( const struct cmdinfo cip,
const char *  value 
)

References dpkg_db_get_dir(), and dpkg_fsys_set_dir().

Here is the call graph for this function:

◆ set_root()

void set_root ( const struct cmdinfo cip,
const char *  value 
)

◆ setaction()

void setaction ( const struct cmdinfo cip,
const char *  value 
)

References _, badusage(), and cipaction.

Here is the call graph for this function:

◆ setobsolete()

void setobsolete ( const struct cmdinfo cip,
const char *  value 
)

References _, cmdinfo::olong, and warning().

Here is the call graph for this function:

Variable Documentation

◆ cipaction

const struct cmdinfo* cipaction
extern