Main Page Modules Data Structures File List Data Fields Globals Related Pages

# popt/popt.c File Reference

More...

`#include "system.h"`
`#include <math.h>`
`#include "findme.h"`
`#include "poptint.h"`

Go to the source code of this file.

## Defines

#define | _ABS(a) ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a))

## Functions

char * | strerror (int errno)
void | poptSetExecPath (poptContext con, const char *path, int allowAbsolute)
void | invokeCallbacksPRE (poptContext con, const struct poptOption *opt)
void | invokeCallbacksPOST (poptContext con, const struct poptOption *opt)
void | invokeCallbacksOPTION (poptContext con, const struct poptOption *opt, const struct poptOption *myOpt, const void *myData, int shorty)
poptContext | poptGetContext (const char *name, int argc, const char **argv, const struct poptOption *options, int flags)
void | cleanOSE (struct optionStackEntry *os)
void | poptResetContext (poptContext con)
int | handleExec (poptContext con, const char *longName, char shortName)
int | handleAlias (poptContext con, const char *longName, char shortName, const char *nextCharArg)
int | execCommand (poptContext con)
const struct poptOption * | findOption (const struct poptOption *opt, const char *longName, char shortName, poptCallbackType *callback, const void **callbackData, int singleDash)
const char * | findNextArg (poptContext con, unsigned argx, int delete_arg)
const char * | expandNextArg (poptContext con, const char *s)
void | poptStripArg (poptContext con, int which)
int | poptSaveLong (long *arg, int argInfo, long aLong)
int | poptSaveInt (int *arg, int argInfo, long aLong)
int | poptGetNextOpt (poptContext con)
const char * | poptGetOptArg (poptContext con)
const char * | poptGetArg (poptContext con)
const char * | poptPeekArg (poptContext con)
const char ** | poptGetArgs (poptContext con)
poptContext | poptFreeContext (poptContext con)
int | poptAddAlias (poptContext con, struct poptAlias alias, int flags)
int | poptAddItem (poptContext con, poptItem newItem, int flags)
const char * | poptBadOption (poptContext con, int flags)
const char *const | poptStrerror (const int error)
int | poptStuffArgs (poptContext con, const char **argv)
const char * | poptGetInvocationName (poptContext con)
int | poptStrippedArgv (poptContext con, int argc, char **argv)

## Detailed Description

Definition in file popt.c.

## Define Documentation

#define _ABS | ( | a |  | ) | ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a))

## Function Documentation

void cleanOSE | ( | struct optionStackEntry * | os | ) | `[static]`

| Definition at line 200 of file popt.c. References _free, and PBM_FREE. Referenced by poptGetNextOpt, and poptResetContext.

int execCommand | ( | poptContext | con | ) | `[static]`

| Definition at line 362 of file popt.c. References alloca, and findProgramPath. Referenced by poptGetNextOpt.

const char* expandNextArg | ( | poptContext | con,
|  | const char * | s
| ) | `[static]`

| Definition at line 559 of file popt.c. References findNextArg. Referenced by poptGetNextOpt.

const char* findNextArg | ( | poptContext | con,
|  | unsigned | argx,
|  | int | delete_arg
| ) | `[static]`

| Definition at line 520 of file popt.c. References optionStackEntry::argb, optionStackEntry::argc, optionStackEntry::argv, optionStackEntry::next, PBM_ALLOC, PBM_ISSET, and PBM_SET. Referenced by expandNextArg.

const struct poptOption* findOption | ( | const struct poptOption * | opt,
|  | const char * | longName,
|  | char | shortName,
|  | poptCallbackType * | callback,
|  | const void ** | callbackData,
|  | int | singleDash
| ) | `[static]`

| Definition at line 453 of file popt.c. References callback, findOption, POPT_ARG_CALLBACK, POPT_ARG_INCLUDE_TABLE, POPT_ARG_MASK, and POPT_ARGFLAG_ONEDASH. Referenced by findOption, and poptGetNextOpt.

int handleAlias | ( | poptContext | con,
|  | const char * | longName,
|  | char | shortName,
|  | const char * | nextCharArg
| ) | `[static]`

| Definition at line 307 of file popt.c. References POPT_OPTION_DEPTH, and poptDupArgv. Referenced by poptGetNextOpt.

int handleExec | ( | poptContext | con,
|  | const char * | longName,
|  | char | shortName
| ) | `[static]`

| Definition at line 247 of file popt.c. Referenced by poptGetNextOpt.

void invokeCallbacksOPTION | ( | poptContext | con,
|  | const struct poptOption * | opt,
|  | const struct poptOption * | myOpt,
|  | const void * | myData,
|  | int | shorty
| ) | `[static]`

| Definition at line 108 of file popt.c. References POPT_ARG_CALLBACK, POPT_ARG_INCLUDE_TABLE, and POPT_ARG_MASK. Referenced by poptGetNextOpt.

void invokeCallbacksPOST | ( | poptContext | con,
|  | const struct poptOption * | opt
| ) | `[static]`

| Definition at line 85 of file popt.c. References POPT_ARG_CALLBACK, POPT_ARG_INCLUDE_TABLE, and POPT_ARG_MASK. Referenced by poptGetNextOpt.

void invokeCallbacksPRE | ( | poptContext | con,
|  | const struct poptOption * | opt
| ) | `[static]`

| Definition at line 62 of file popt.c. References POPT_ARG_CALLBACK, POPT_ARG_INCLUDE_TABLE, and POPT_ARG_MASK. Referenced by poptGetContext.

int poptAddAlias | ( | poptContext | con,
|  | struct poptAlias | alias,
|  | int | flags
| ) |

| Definition at line 1080 of file popt.c. References alloca, and poptAddItem.

int poptAddItem | ( | poptContext | con,
|  | poptItem | newItem,
|  | int | flags
| ) |

| Definition at line 1099 of file popt.c. References xstrdup. Referenced by configLine, and poptAddAlias.

const char* poptBadOption | ( | poptContext | con,
|  | int | flags
| ) |

| Definition at line 1144 of file popt.c. References optionStackEntry::argv, and optionStackEntry::next. Referenced by doSetupMacro, main, parseDescription, parseFiles, parseScript, and rpmcliInit.

poptContext poptFreeContext | ( | poptContext | con | ) |

| Definition at line 1036 of file popt.c. References _free, PBM_FREE, and poptResetContext. Referenced by doSetupMacro, main, parseDescription, parseFiles, parseScript, and rpmcliFini.

const char* poptGetArg | ( | poptContext | con | ) |

| Definition at line 1004 of file popt.c. Referenced by main, parseDescription, parseFiles, and parseScript.

const char** poptGetArgs | ( | poptContext | con | ) |

| Definition at line 1021 of file popt.c. Referenced by main.

poptContext poptGetContext | ( | const char * | name,
|  | int | argc,
|  | const char ** | argv,
|  | const struct poptOption * | options,
|  | int | flags
| ) |

| Definition at line 153 of file popt.c. References getenv, and invokeCallbacksPRE. Referenced by doSetupMacro, main, parseDescription, parseFiles, parseScript, and rpmcliInit.

const char* poptGetInvocationName | ( | poptContext | con | ) |

| Definition at line 1207 of file popt.c.

int poptGetNextOpt | ( | poptContext | con | ) |

Definition at line 682 of file popt.c.

References _free, alloca, cleanOSE, errno, execCommand, EXIT_FAILURE, expandNextArg, findOption, handleAlias, handleExec, invokeCallbacksOPTION, invokeCallbacksPOST, PBM_ISSET, POPT_, POPT_ARG_DOUBLE, POPT_ARG_FLOAT, POPT_ARG_INT, POPT_ARG_LONG, POPT_ARG_MASK, POPT_ARG_NONE, POPT_ARG_STRING, POPT_ARG_VAL, POPT_ARGFLAG_ONEDASH, poptSaveInt, poptSaveLong, poptStripArg, and xstrdup.

Referenced by doSetupMacro, main, parseDescription, parseFiles, parseScript, and rpmcliInit.

const char* poptGetOptArg | ( | poptContext | con | ) |

| Definition at line 992 of file popt.c. Referenced by doSetupMacro, main, and rpmcliInit.

const char* poptPeekArg | ( | poptContext | con | ) |

| Definition at line 1012 of file popt.c. Referenced by main, parseDescription, parseFiles, and parseScript.

void poptResetContext | ( | poptContext | con | ) |

| Definition at line 211 of file popt.c. References _free, cleanOSE, and PBM_FREE. Referenced by poptFreeContext.

int poptSaveInt | ( | int * | arg,
|  | int | argInfo,
|  | long | aLong
| ) |

| Definition at line 652 of file popt.c. Referenced by poptGetNextOpt.

int poptSaveLong | ( | long * | arg,
|  | int | argInfo,
|  | long | aLong
| ) |

| Definition at line 624 of file popt.c. Referenced by poptGetNextOpt.

void poptSetExecPath | ( | poptContext | con,
|  | const char * | path,
|  | int | allowAbsolute
| ) |

| Definition at line 52 of file popt.c. References _free, and xstrdup. Referenced by main, and rpmcliInit.

const char* const poptStrerror | ( | const int | error | ) |

| Definition at line 1156 of file popt.c. References errno, POPT_, and strerror. Referenced by doSetupMacro, main, parseDescription, parseFiles, parseScript, and rpmcliInit.

void poptStripArg | ( | poptContext | con,
|  | int | which
| ) | `[static]`

| Definition at line 608 of file popt.c. References PBM_ALLOC, and PBM_SET. Referenced by poptGetNextOpt.

int poptStrippedArgv | ( | poptContext | con,
|  | int | argc,
|  | char ** | argv
| ) |

| Definition at line 1213 of file popt.c. References PBM_ISSET.

int poptStuffArgs | ( | poptContext | con,
|  | const char ** | argv
| ) |

| Definition at line 1184 of file popt.c. References POPT_OPTION_DEPTH, and poptDupArgv. Referenced by queryArgCallback.

char* strerror | ( | int | errno | ) | `[static]`

| Definition at line 27 of file popt.c. References errno, and POPT_. Referenced by checkOwners, checkPassPhrase, dbiOpen, doScript, getFilesystemList, getOutputFrom, makeGPGSignature, makePGPSignature, opendevice, packageBinaries, poptStrerror, processSourceFiles, rpmdbRebuild, rpmGetFilesystemUsage, rpmProblemString, and rpmQueryVerify.