Go to the documentation of this file.
14 #define POPT_OPTION_DEPTH 10
20 #define POPT_ARG_NONE 0U
21 #define POPT_ARG_STRING 1U
22 #define POPT_ARG_INT 2U
23 #define POPT_ARG_LONG 3U
24 #define POPT_ARG_INCLUDE_TABLE 4U
25 #define POPT_ARG_CALLBACK 5U
29 #define POPT_ARG_INTL_DOMAIN 6U
33 #define POPT_ARG_VAL 7U
34 #define POPT_ARG_FLOAT 8U
35 #define POPT_ARG_DOUBLE 9U
36 #define POPT_ARG_LONGLONG 10U
38 #define POPT_ARG_MAINCALL 16U+11U
39 #define POPT_ARG_ARGV 12U
40 #define POPT_ARG_SHORT 13U
41 #define POPT_ARG_BITSET 16U+14U
43 #define POPT_ARG_MASK 0x000000FFU
44 #define POPT_GROUP_MASK 0x0000FF00U
52 #define POPT_ARGFLAG_ONEDASH 0x80000000U
53 #define POPT_ARGFLAG_DOC_HIDDEN 0x40000000U
54 #define POPT_ARGFLAG_STRIP 0x20000000U
55 #define POPT_ARGFLAG_OPTIONAL 0x10000000U
57 #define POPT_ARGFLAG_OR 0x08000000U
58 #define POPT_ARGFLAG_NOR 0x09000000U
59 #define POPT_ARGFLAG_AND 0x04000000U
60 #define POPT_ARGFLAG_NAND 0x05000000U
61 #define POPT_ARGFLAG_XOR 0x02000000U
62 #define POPT_ARGFLAG_NOT 0x01000000U
63 #define POPT_ARGFLAG_LOGICALOPS \
64 (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR)
66 #define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR)
68 #define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND)
71 #define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000U
72 #define POPT_ARGFLAG_RANDOM 0x00400000U
73 #define POPT_ARGFLAG_TOGGLE 0x00200000U
81 #define POPT_CBFLAG_PRE 0x80000000U
82 #define POPT_CBFLAG_POST 0x40000000U
83 #define POPT_CBFLAG_INC_DATA 0x20000000U
85 #define POPT_CBFLAG_SKIPOPTION 0x10000000U
86 #define POPT_CBFLAG_CONTINUE 0x08000000U
93 #define POPT_ERROR_NOARG -10
94 #define POPT_ERROR_BADOPT -11
95 #define POPT_ERROR_OPTSTOODEEP -13
96 #define POPT_ERROR_BADQUOTE -15
97 #define POPT_ERROR_ERRNO -16
98 #define POPT_ERROR_BADNUMBER -17
99 #define POPT_ERROR_OVERFLOW -18
100 #define POPT_ERROR_BADOPERATION -19
101 #define POPT_ERROR_NULLARG -20
102 #define POPT_ERROR_MALLOC -21
103 #define POPT_ERROR_NOCONTEXT -22
104 #define POPT_ERROR_BADCONFIG -23
112 #define POPT_BADOPTION_NOALIAS (1U << 0)
119 #define POPT_CONTEXT_NO_EXEC (1U << 0)
120 #define POPT_CONTEXT_KEEP_FIRST (1U << 1)
121 #define POPT_CONTEXT_POSIXMEHARDER (1U << 2)
122 #define POPT_CONTEXT_ARG_OPTS (1U << 4)
177 #define POPT_AUTOALIAS { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptAliasOptions, \
178 0, "Options implemented via popt alias/exec:", NULL },
193 #define POPT_AUTOHELP { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptHelpOptions, \
194 0, "Help options:", NULL },
196 #define POPT_TABLEEND { NULL, '\0', 0, NULL, 0, NULL, NULL }
265 int argc,
const char ** argv,
292 const char * configPaths)
410 size_t * nbp,
int flags)
413 #define POPT_READFILE_TRIMNEWLINES 1
465 const char *** argvPtr)
480 int * argcPtr,
const char *** argvPtr)
691 #define _POPT_BITS_N 1024U
692 #define _POPT_BITS_M ((3U * _POPT_BITS_N) / 2U)
693 #define _POPT_BITS_K 16U
const char * poptBadOption(poptContext con, unsigned int flags)
int poptReadConfigFiles(poptContext con, const char *paths)
int poptBitsClr(poptBits bits)
int poptBitsIntersect(poptBits *ap, const poptBits b)
poptContext poptInit(int argc, const char **argv, const struct poptOption *options, const char *configPaths)
const char * poptGetInvocationName(poptContext con)
const char ** poptGetArgs(poptContext con)
@ POPT_CALLBACK_REASON_PRE
int poptAddAlias(poptContext con, struct poptAlias alias, int flags)
void poptPrintHelp(poptContext con, FILE *fp, int flags)
int poptStrippedArgv(poptContext con, int argc, char **argv)
struct poptOption * poptOption
poptContext poptFreeContext(poptContext con)
poptContext poptGetContext(const char *name, int argc, const char **argv, const struct poptOption *options, unsigned int flags)
void poptPrintUsage(poptContext con, FILE *fp, int flags)
void(* poptCallbackType)(poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, const void *data)
int poptReadFile(const char *fn, char **bp, size_t *nbp, int flags)
Read a file into a buffer.
int poptBitsUnion(poptBits *ap, const poptBits b)
int poptDupArgv(int argc, const char **argv, int *argcPtr, const char ***argvPtr)
char * poptGetOptArg(poptContext con)
@ POPT_CALLBACK_REASON_OPTION
int poptReadConfigFile(poptContext con, const char *fn)
int poptGetNextOpt(poptContext con)
@ POPT_CALLBACK_REASON_POST
const char * poptPeekArg(poptContext con)
void poptSetExecPath(poptContext con, const char *path, int allowAbsolute)
int poptBitsAdd(poptBits bits, const char *s)
void poptSetOtherOptionHelp(poptContext con, const char *text)
struct poptOption poptHelpOptions[]
Auto help table options.
poptContext poptFini(poptContext con)
int poptSaveLongLong(long long *arg, unsigned int argInfo, long long aLongLong)
Save a long long, performing logical operation with value.
int poptBitsDel(poptBits bits, const char *s)
struct poptBits_s * poptBits
int poptSaveBits(poptBits *bitsp, unsigned int argInfo, const char *s)
Save a string into a bit set (experimental).
int poptSaveInt(int *arg, unsigned int argInfo, long aLong)
Save an integer, performing logical operation with value.
int poptStuffArgs(poptContext con, const char **argv)
struct poptOption * poptHelpOptionsI18N
struct poptOption poptAliasOptions[]
Empty table marker to enable displaying popt alias/exec options.
int poptBitsArgs(poptContext con, poptBits *ap)
int poptParseArgvString(const char *s, int *argcPtr, const char ***argvPtr)
struct poptContext_s * poptContext
struct poptItem_s * poptItem
int poptConfigFileToString(FILE *fp, char **argstrp, int flags)
int poptAddItem(poptContext con, poptItem newItem, int flags)
int poptSaveShort(short *arg, unsigned int argInfo, long aLong)
Save a short integer, performing logical operation with value.
const char * poptStrerror(const int error)
int poptSaveLong(long *arg, unsigned int argInfo, long aLong)
Save a long, performing logical operation with value.
int poptSaveString(const char ***argvp, unsigned int argInfo, const char *val)
Add a string to an argv array.
const char * poptGetArg(poptContext con)
int poptSaneFile(const char *fn)
void poptResetContext(poptContext con)
int poptReadDefaultConfig(poptContext con, int useEnv)
int poptBitsChk(poptBits bits, const char *s)
Generated for popt by
1.8.17