Mixes for Privacy and Anonymity in the Internet
Classes | Macros | Typedefs | Enumerations | Functions | Variables
popt.h File Reference

Classes

struct  poptOption
 
struct  poptAlias
 

Macros

#define POPT_OPTION_DEPTH   10
 
#define POPT_ARG_NONE   0
 
#define POPT_ARG_STRING   1
 
#define POPT_ARG_INT   2
 
#define POPT_ARG_LONG   3
 
#define POPT_ARG_INCLUDE_TABLE   4 /* arg points to table */
 
#define POPT_ARG_CALLBACK
 
#define POPT_ARG_INTL_DOMAIN
 
#define POPT_ARG_VAL   7 /* arg should take value val */
 
#define POPT_ARG_MASK   0x0000FFFF
 
#define POPT_ARGFLAG_ONEDASH   0x80000000 /* allow -longoption */
 
#define POPT_ARGFLAG_DOC_HIDDEN   0x40000000 /* don't show in help/usage */
 
#define POPT_ARGFLAG_STRIP   0x20000000 /* strip this arg from argv (only applies to long args) */
 
#define POPT_CBFLAG_PRE   0x80000000 /* call the callback before parse */
 
#define POPT_CBFLAG_POST   0x40000000 /* call the callback after parse */
 
#define POPT_CBFLAG_INC_DATA
 
#define POPT_ERROR_NOARG   -10
 
#define POPT_ERROR_BADOPT   -11
 
#define POPT_ERROR_OPTSTOODEEP   -13
 
#define POPT_ERROR_BADQUOTE   -15 /* only from poptParseArgString() */
 
#define POPT_ERROR_ERRNO   -16 /* only from poptParseArgString() */
 
#define POPT_ERROR_BADNUMBER   -17
 
#define POPT_ERROR_OVERFLOW   -18
 
#define POPT_BADOPTION_NOALIAS   (1 << 0) /* don't go into an alias */
 
#define POPT_CONTEXT_NO_EXEC   (1 << 0) /* ignore exec expansions */
 
#define POPT_CONTEXT_KEEP_FIRST   (1 << 1) /* pay attention to argv[0] */
 
#define POPT_CONTEXT_POSIXMEHARDER   (1 << 2) /* options can't follow args */
 
#define POPT_AUTOHELP
 

Typedefs

typedef struct poptContext_spoptContext
 
typedef struct poptOptionpoptOption
 
typedef void(* poptCallbackType) (poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, const void *data)
 

Enumerations

enum  poptCallbackReason { POPT_CALLBACK_REASON_PRE , POPT_CALLBACK_REASON_POST , POPT_CALLBACK_REASON_OPTION }
 

Functions

poptContext poptGetContext (const char *name, int argc, const char **argv, const struct poptOption *options, int flags)
 
void poptResetContext (poptContext con)
 
int poptGetNextOpt (poptContext con)
 
const char * poptGetOptArg (poptContext con)
 
const char * poptGetArg (poptContext con)
 
const char * poptPeekArg (poptContext con)
 
const char ** poptGetArgs (poptContext con)
 
const char * poptBadOption (poptContext con, int flags)
 
void poptFreeContext (poptContext con)
 
int poptStuffArgs (poptContext con, const char **argv)
 
int poptAddAlias (poptContext con, struct poptAlias alias, int flags)
 
int poptReadConfigFile (poptContext con, const char *fn)
 
int poptReadDefaultConfig (poptContext con, int useEnv)
 
int poptDupArgv (int argc, const char **argv, int *argcPtr, const char ***argvPtr)
 
int poptParseArgvString (const char *s, int *argcPtr, const char ***argvPtr)
 
const char * poptStrerror (const int error)
 
void poptSetExecPath (poptContext con, const char *path, int allowAbsolute)
 
void poptPrintHelp (poptContext con, FILE *f, int flags)
 
void poptPrintUsage (poptContext con, FILE *f, int flags)
 
void poptSetOtherOptionHelp (poptContext con, const char *text)
 
const char * poptGetInvocationName (poptContext con)
 
int poptStrippedArgv (poptContext con, int argc, char **argv)
 

Variables

struct poptOption poptHelpOptions []
 

Macro Definition Documentation

◆ POPT_ARG_CALLBACK

#define POPT_ARG_CALLBACK
Value:
5 /* table-wide callback... must be
set first in table; arg points
to callback, descrip points to
callback data to pass */

◆ POPT_ARG_INCLUDE_TABLE

#define POPT_ARG_INCLUDE_TABLE   4 /* arg points to table */

◆ POPT_ARG_INT

#define POPT_ARG_INT   2

◆ POPT_ARG_INTL_DOMAIN

#define POPT_ARG_INTL_DOMAIN
Value:
6 /* set the translation domain
for this table and any
included tables; arg points
to the domain string */

◆ POPT_ARG_LONG

#define POPT_ARG_LONG   3

◆ POPT_ARG_MASK

#define POPT_ARG_MASK   0x0000FFFF

◆ POPT_ARG_NONE

#define POPT_ARG_NONE   0

◆ POPT_ARG_STRING

#define POPT_ARG_STRING   1

◆ POPT_ARG_VAL

#define POPT_ARG_VAL   7 /* arg should take value val */

◆ POPT_ARGFLAG_DOC_HIDDEN

#define POPT_ARGFLAG_DOC_HIDDEN   0x40000000 /* don't show in help/usage */

◆ POPT_ARGFLAG_ONEDASH

#define POPT_ARGFLAG_ONEDASH   0x80000000 /* allow -longoption */

◆ POPT_ARGFLAG_STRIP

#define POPT_ARGFLAG_STRIP   0x20000000 /* strip this arg from argv (only applies to long args) */

◆ POPT_AUTOHELP

#define POPT_AUTOHELP
Value:
0, "Help options", NULL },
struct poptOption poptHelpOptions[]
Definition: popthelp.cpp:21
#define POPT_ARG_INCLUDE_TABLE
Definition: popt.h:20

◆ POPT_BADOPTION_NOALIAS

#define POPT_BADOPTION_NOALIAS   (1 << 0) /* don't go into an alias */

◆ POPT_CBFLAG_INC_DATA

#define POPT_CBFLAG_INC_DATA
Value:
0x20000000 /* use data from the include line,
not the subtable */

◆ POPT_CBFLAG_POST

#define POPT_CBFLAG_POST   0x40000000 /* call the callback after parse */

◆ POPT_CBFLAG_PRE

#define POPT_CBFLAG_PRE   0x80000000 /* call the callback before parse */

◆ POPT_CONTEXT_KEEP_FIRST

#define POPT_CONTEXT_KEEP_FIRST   (1 << 1) /* pay attention to argv[0] */

◆ POPT_CONTEXT_NO_EXEC

#define POPT_CONTEXT_NO_EXEC   (1 << 0) /* ignore exec expansions */

◆ POPT_CONTEXT_POSIXMEHARDER

#define POPT_CONTEXT_POSIXMEHARDER   (1 << 2) /* options can't follow args */

◆ POPT_ERROR_BADNUMBER

#define POPT_ERROR_BADNUMBER   -17

◆ POPT_ERROR_BADOPT

#define POPT_ERROR_BADOPT   -11

◆ POPT_ERROR_BADQUOTE

#define POPT_ERROR_BADQUOTE   -15 /* only from poptParseArgString() */

◆ POPT_ERROR_ERRNO

#define POPT_ERROR_ERRNO   -16 /* only from poptParseArgString() */

◆ POPT_ERROR_NOARG

#define POPT_ERROR_NOARG   -10

◆ POPT_ERROR_OPTSTOODEEP

#define POPT_ERROR_OPTSTOODEEP   -13

◆ POPT_ERROR_OVERFLOW

#define POPT_ERROR_OVERFLOW   -18

◆ POPT_OPTION_DEPTH

#define POPT_OPTION_DEPTH   10

Typedef Documentation

◆ poptCallbackType

typedef void(* poptCallbackType) (poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, const void *data)

◆ poptContext

typedef struct poptContext_s* poptContext

◆ poptOption

typedef struct poptOption* poptOption

Enumeration Type Documentation

◆ poptCallbackReason

Enumerator
POPT_CALLBACK_REASON_PRE 
POPT_CALLBACK_REASON_POST 
POPT_CALLBACK_REASON_OPTION 

Function Documentation

◆ poptAddAlias()

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

◆ poptBadOption()

const char* poptBadOption ( poptContext  con,
int  flags 
)

◆ poptDupArgv()

int poptDupArgv ( int  argc,
const char **  argv,
int *  argcPtr,
const char ***  argvPtr 
)

◆ poptFreeContext()

void poptFreeContext ( poptContext  con)

◆ poptGetArg()

const char* poptGetArg ( poptContext  con)

◆ poptGetArgs()

const char** poptGetArgs ( poptContext  con)

◆ poptGetContext()

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

◆ poptGetInvocationName()

const char* poptGetInvocationName ( poptContext  con)

◆ poptGetNextOpt()

int poptGetNextOpt ( poptContext  con)

◆ poptGetOptArg()

const char* poptGetOptArg ( poptContext  con)

◆ poptParseArgvString()

int poptParseArgvString ( const char *  s,
int *  argcPtr,
const char ***  argvPtr 
)

◆ poptPeekArg()

const char* poptPeekArg ( poptContext  con)

◆ poptPrintHelp()

void poptPrintHelp ( poptContext  con,
FILE *  f,
int  flags 
)

◆ poptPrintUsage()

void poptPrintUsage ( poptContext  con,
FILE *  f,
int  flags 
)

◆ poptReadConfigFile()

int poptReadConfigFile ( poptContext  con,
const char *  fn 
)

◆ poptReadDefaultConfig()

int poptReadDefaultConfig ( poptContext  con,
int  useEnv 
)

◆ poptResetContext()

void poptResetContext ( poptContext  con)

◆ poptSetExecPath()

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

◆ poptSetOtherOptionHelp()

void poptSetOtherOptionHelp ( poptContext  con,
const char *  text 
)

◆ poptStrerror()

const char* poptStrerror ( const int  error)

◆ poptStrippedArgv()

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

◆ poptStuffArgs()

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

Variable Documentation

◆ poptHelpOptions

struct poptOption poptHelpOptions[]
extern

Referenced by getArgDescrip().