Mixe for Privacy and Anonymity in the Internet
|
#include <stdio.h>
Go to the source code of this file.
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_s * | poptContext |
typedef struct poptOption * | poptOption |
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 [] |
#define POPT_ARG_CALLBACK |
#define POPT_ARG_INTL_DOMAIN |
#define POPT_ARGFLAG_DOC_HIDDEN 0x40000000 /* don't show in help/usage */ |
#define POPT_ARGFLAG_ONEDASH 0x80000000 /* allow -longoption */ |
#define POPT_ARGFLAG_STRIP 0x20000000 /* strip this arg from argv (only applies to long args) */ |
#define POPT_AUTOHELP |
#define POPT_BADOPTION_NOALIAS (1 << 0) /* don't go into an alias */ |
#define POPT_CBFLAG_INC_DATA |
#define POPT_CBFLAG_POST 0x40000000 /* call the callback after parse */ |
#define POPT_CBFLAG_PRE 0x80000000 /* call the callback before parse */ |
#define POPT_CONTEXT_KEEP_FIRST (1 << 1) /* pay attention to argv[0] */ |
#define POPT_CONTEXT_NO_EXEC (1 << 0) /* ignore exec expansions */ |
#define POPT_CONTEXT_POSIXMEHARDER (1 << 2) /* options can't follow args */ |
#define POPT_ERROR_BADQUOTE -15 /* only from poptParseArgString() */ |
#define POPT_ERROR_ERRNO -16 /* only from poptParseArgString() */ |
typedef void(* poptCallbackType) (poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, const void *data) |
typedef struct poptContext_s* poptContext |
typedef struct poptOption* poptOption |
enum poptCallbackReason |
int poptAddAlias | ( | poptContext | con, |
struct poptAlias | alias, | ||
int | flags | ||
) |
Definition at line 682 of file popt.cpp.
References poptContext_s::aliases, poptAlias::argc, poptAlias::argv, poptAlias::longName, poptContext_s::numAliases, and poptAlias::shortName.
const char* poptBadOption | ( | poptContext | con, |
int | flags | ||
) |
Definition at line 706 of file popt.cpp.
References optionStackEntry::argv, flags, optionStackEntry::next, poptContext_s::optionStack, poptContext_s::os, and POPT_BADOPTION_NOALIAS.
int poptDupArgv | ( | int | argc, |
const char ** | argv, | ||
int * | argcPtr, | ||
const char *** | argvPtr | ||
) |
Definition at line 10 of file poptparse.cpp.
References POPT_ERROR_NOARG.
Referenced by poptParseArgvString(), and poptStuffArgs().
void poptFreeContext | ( | poptContext | con | ) |
Definition at line 654 of file popt.cpp.
References poptContext_s::aliases, poptContext_s::appName, poptContext_s::arg_strip, optionStackEntry::argb, poptAlias::argv, poptContext_s::execPath, poptContext_s::execs, poptContext_s::finalArgv, poptContext_s::leftovers, poptAlias::longName, execEntry::longName, poptContext_s::numAliases, poptContext_s::numExecs, poptContext_s::os, poptContext_s::otherHelp, PBM_FREE, poptResetContext(), execEntry::script, and xfree.
Referenced by CACmdLnOptions::parse().
const char* poptGetArg | ( | poptContext | con | ) |
Definition at line 635 of file popt.cpp.
References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.
const char** poptGetArgs | ( | poptContext | con | ) |
Definition at line 645 of file popt.cpp.
References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.
poptContext poptGetContext | ( | const char * | name, |
int | argc, | ||
const char ** | argv, | ||
const struct poptOption * | options, | ||
int | flags | ||
) |
Definition at line 51 of file popt.cpp.
References poptContext_s::aliases, poptContext_s::appName, poptContext_s::arg_strip, optionStackEntry::argb, optionStackEntry::argc, optionStackEntry::argv, poptContext_s::execAbsolute, poptContext_s::execs, poptContext_s::finalArgv, poptContext_s::finalArgvAlloced, poptContext_s::flags, flags, poptContext_s::leftovers, optionStackEntry::next, poptContext_s::numAliases, poptContext_s::numExecs, poptContext_s::options, poptContext_s::optionStack, poptContext_s::os, POPT_CONTEXT_KEEP_FIRST, and POPT_CONTEXT_POSIXMEHARDER.
Referenced by CACmdLnOptions::parse().
const char* poptGetInvocationName | ( | poptContext | con | ) |
Definition at line 765 of file popt.cpp.
References optionStackEntry::argv, and poptContext_s::os.
int poptGetNextOpt | ( | poptContext | con | ) |
Definition at line 407 of file popt.cpp.
References optionStackEntry::argc, optionStackEntry::next, optionStackEntry::nextCharArg, poptContext_s::optionStack, and poptContext_s::os.
Referenced by CACmdLnOptions::parse().
const char* poptGetOptArg | ( | poptContext | con | ) |
Definition at line 629 of file popt.cpp.
References optionStackEntry::nextArg, and poptContext_s::os.
int poptParseArgvString | ( | const char * | s, |
int * | argcPtr, | ||
const char *** | argvPtr | ||
) |
Definition at line 39 of file poptparse.cpp.
References alloca(), POPT_ARGV_ARRAY_GROW_DELTA, POPT_ERROR_BADQUOTE, and poptDupArgv().
const char* poptPeekArg | ( | poptContext | con | ) |
Definition at line 640 of file popt.cpp.
References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.
void poptPrintHelp | ( | poptContext | con, |
FILE * | f, | ||
int | flags | ||
) |
Definition at line 186 of file popthelp.cpp.
void poptPrintUsage | ( | poptContext | con, |
FILE * | f, | ||
int | flags | ||
) |
Definition at line 283 of file popthelp.cpp.
int poptReadConfigFile | ( | poptContext | con, |
const char * | fn | ||
) |
int poptReadDefaultConfig | ( | poptContext | con, |
int | useEnv | ||
) |
void poptResetContext | ( | poptContext | con | ) |
Definition at line 104 of file popt.cpp.
References poptContext_s::optionStack, and poptContext_s::os.
Referenced by poptFreeContext().
void poptSetExecPath | ( | poptContext | con, |
const char * | path, | ||
int | allowAbsolute | ||
) |
Definition at line 25 of file popt.cpp.
References poptContext_s::execAbsolute, poptContext_s::execPath, xfree, and xstrdup().
void poptSetOtherOptionHelp | ( | poptContext | con, |
const char * | text | ||
) |
Definition at line 299 of file popthelp.cpp.
References poptContext_s::otherHelp, xfree, and xstrdup().
const char* poptStrerror | ( | const int | error | ) |
Definition at line 723 of file popt.cpp.
References POPT_, POPT_ERROR_BADNUMBER, POPT_ERROR_BADOPT, POPT_ERROR_BADQUOTE, POPT_ERROR_ERRNO, POPT_ERROR_NOARG, POPT_ERROR_OPTSTOODEEP, and POPT_ERROR_OVERFLOW.
int poptStrippedArgv | ( | poptContext | con, |
int | argc, | ||
char ** | argv | ||
) |
Definition at line 769 of file popt.cpp.
References poptContext_s::arg_strip, optionStackEntry::argc, optionStackEntry::argv, and PBM_ISSET.
int poptStuffArgs | ( | poptContext | con, |
const char ** | argv | ||
) |
Definition at line 744 of file popt.cpp.
References optionStackEntry::argb, optionStackEntry::argc, optionStackEntry::argv, optionStackEntry::currAlias, optionStackEntry::next, optionStackEntry::nextArg, optionStackEntry::nextCharArg, poptContext_s::optionStack, poptContext_s::os, POPT_ERROR_OPTSTOODEEP, POPT_OPTION_DEPTH, poptDupArgv(), and optionStackEntry::stuffed.
|
extern |
Definition at line 10 of file popthelp.cpp.