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

popt.c File Reference

#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 poptOptionfindOption (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)
 Save a long, performing logical operation with value.
int poptSaveInt (int *arg, int argInfo, long aLong)
 Save an integer, performing logical operation with value.
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) - 0.0) < DBL_EPSILON) ? -(a) : (a))
 

Referenced by poptGetNextOpt().


Function Documentation

void cleanOSE struct optionStackEntry os  )  [static]
 

Definition at line 217 of file popt.c.

References _free(), optionStackEntry::argb, optionStackEntry::argv, optionStackEntry::nextArg, and PBM_FREE.

Referenced by poptGetNextOpt(), and poptResetContext().

int execCommand poptContext  con  )  [static]
 

Definition at line 379 of file popt.c.

References alloca(), poptItem_s::argc, argv, poptItem_s::argv, poptContext_s::doExec, poptContext_s::execAbsolute, poptContext_s::execPath, poptContext_s::finalArgv, poptContext_s::finalArgvCount, findProgramPath(), poptContext_s::leftovers, poptContext_s::numLeftovers, poptContext, and poptItem.

Referenced by poptGetNextOpt().

const char* expandNextArg poptContext  con,
const char *  s
[static]
 

Definition at line 583 of file popt.c.

References findNextArg(), and poptContext.

Referenced by poptGetNextOpt().

const char* findNextArg poptContext  con,
unsigned  argx,
int  delete_arg
[static]
 

Definition at line 544 of file popt.c.

References optionStackEntry::argb, optionStackEntry::argc, optionStackEntry::argv, optionStackEntry::next, poptContext_s::optionStack, poptContext_s::os, PBM_ALLOC, PBM_ISSET, PBM_SET, and poptContext.

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 472 of file popt.c.

References poptOption::arg, poptOption::argInfo, poptOption::descrip, poptOption::longName, and poptOption::shortName.

Referenced by poptGetNextOpt().

int handleAlias poptContext  con,
const char *  longName,
char  shortName,
const char *  nextCharArg
[static]
 

Definition at line 324 of file popt.c.

References poptContext_s::aliases, optionStackEntry::argb, optionStackEntry::argc, poptItem_s::argc, optionStackEntry::argv, poptItem_s::argv, optionStackEntry::currAlias, poptOption::longName, optionStackEntry::next, optionStackEntry::nextArg, optionStackEntry::nextCharArg, poptContext_s::numAliases, poptItem_s::option, poptContext_s::optionStack, poptContext_s::os, poptContext, poptDupArgv(), poptItem, poptOption::shortName, and optionStackEntry::stuffed.

Referenced by poptGetNextOpt().

int handleExec poptContext  con,
const char *  longName,
char  shortName
[static]
 

Definition at line 264 of file popt.c.

References poptContext_s::doExec, poptContext_s::execs, poptContext_s::finalArgv, poptContext_s::finalArgvAlloced, poptContext_s::finalArgvCount, poptContext_s::flags, poptOption::longName, poptContext_s::numExecs, poptItem_s::option, poptContext, poptItem, and poptOption::shortName.

Referenced by poptGetNextOpt().

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

Definition at line 120 of file popt.c.

References poptOption::arg, poptOption::argInfo, poptOption::descrip, poptOption::longName, optionStackEntry::nextArg, poptContext_s::os, POPT_ARG_CALLBACK, POPT_CALLBACK_REASON_OPTION, poptCallbackType, poptContext, and poptOption::shortName.

Referenced by poptGetNextOpt().

void invokeCallbacksPOST poptContext  con,
const struct poptOption opt
[static]
 

Definition at line 92 of file popt.c.

References poptOption::arg, poptOption::argInfo, poptOption::descrip, poptOption::longName, POPT_ARG_CALLBACK, POPT_CALLBACK_REASON_POST, poptCallbackType, poptContext, and poptOption::shortName.

Referenced by poptGetNextOpt().

void invokeCallbacksPRE poptContext  con,
const struct poptOption opt
[static]
 

Definition at line 64 of file popt.c.

References poptOption::arg, poptOption::argInfo, poptOption::descrip, poptOption::longName, POPT_ARG_CALLBACK, POPT_CALLBACK_REASON_PRE, poptCallbackType, poptContext, and poptOption::shortName.

Referenced by poptGetContext().

int poptSaveInt int *  arg,
int  argInfo,
long  aLong
 

Save an integer, performing logical operation with value.

Warning:
Alignment check may be too strict on certain platorms.
Parameters:
arg integer pointer, aligned on int boundary.
argInfo logical operation (see POPT_ARGFLAG_*)
aLong value to use
Returns:
0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION

Definition at line 676 of file popt.c.

References POPT_ARGFLAG_AND, POPT_ARGFLAG_OR, and POPT_ARGFLAG_XOR.

Referenced by db3New(), and poptGetNextOpt().

int poptSaveLong long *  arg,
int  argInfo,
long  aLong
 

Save a long, performing logical operation with value.

Warning:
Alignment check may be too strict on certain platorms.
Parameters:
arg integer pointer, aligned on int boundary.
argInfo logical operation (see POPT_ARGFLAG_*)
aLong value to use
Returns:
0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION

Definition at line 648 of file popt.c.

References POPT_ARGFLAG_AND, POPT_ARGFLAG_OR, and POPT_ARGFLAG_XOR.

Referenced by db3New(), and poptGetNextOpt().

void poptStripArg poptContext  con,
int  which
[static]
 

Definition at line 632 of file popt.c.

References poptContext_s::arg_strip, optionStackEntry::argc, poptContext_s::optionStack, PBM_ALLOC, PBM_SET, and poptContext.

Referenced by poptGetNextOpt().

char* strerror int  errno  )  [static]
 

Definition at line 27 of file popt.c.

References errno, and POPT_.

Referenced by apprentice_compile(), apprentice_file(), apprentice_map(), checkOwners(), checkPassPhrase(), cpioStrerror(), dbiOpen(), doScript(), fdFgets(), fdWritable(), file_pipe2file(), fmagicD(), fmagicProcess(), Fstrerror(), getFdErrstr(), getFilesystemList(), getOutputFrom(), makeGPGSignature(), makePGPSignature(), packageBinaries(), poptStrerror(), processSourceFiles(), rpmdbRebuild(), rpmGetFilesystemUsage(), rpmProblemString(), rpmQueryVerify(), ufdRead(), ufdWrite(), uncompressbuf(), unwrap(), and urlStrerror().


Generated on Wed Aug 30 08:36:04 2006 for rpm by  doxygen 1.3.9.1