Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../proc/self/root/usr/include
File: popt.h
/** \file popt/popt.h
[0] Fix | Delete
* \ingroup popt
[1] Fix | Delete
*/
[2] Fix | Delete
[3] Fix | Delete
/* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING
[4] Fix | Delete
file accompanying popt source distributions, available from
[5] Fix | Delete
ftp://ftp.rpm.org/pub/rpm/dist. */
[6] Fix | Delete
[7] Fix | Delete
#ifndef H_POPT
[8] Fix | Delete
#define H_POPT
[9] Fix | Delete
[10] Fix | Delete
#include <stdio.h> /* for FILE * */
[11] Fix | Delete
[12] Fix | Delete
#define POPT_OPTION_DEPTH 10
[13] Fix | Delete
[14] Fix | Delete
/** \ingroup popt
[15] Fix | Delete
* \name Arg type identifiers
[16] Fix | Delete
*/
[17] Fix | Delete
/*@{*/
[18] Fix | Delete
#define POPT_ARG_NONE 0U /*!< no arg */
[19] Fix | Delete
#define POPT_ARG_STRING 1U /*!< arg will be saved as string */
[20] Fix | Delete
#define POPT_ARG_INT 2U /*!< arg ==> int */
[21] Fix | Delete
#define POPT_ARG_LONG 3U /*!< arg ==> long */
[22] Fix | Delete
#define POPT_ARG_INCLUDE_TABLE 4U /*!< arg points to table */
[23] Fix | Delete
#define POPT_ARG_CALLBACK 5U /*!< table-wide callback... must be
[24] Fix | Delete
set first in table; arg points
[25] Fix | Delete
to callback, descrip points to
[26] Fix | Delete
callback data to pass */
[27] Fix | Delete
#define POPT_ARG_INTL_DOMAIN 6U /*!< set the translation domain
[28] Fix | Delete
for this table and any
[29] Fix | Delete
included tables; arg points
[30] Fix | Delete
to the domain string */
[31] Fix | Delete
#define POPT_ARG_VAL 7U /*!< arg should take value val */
[32] Fix | Delete
#define POPT_ARG_FLOAT 8U /*!< arg ==> float */
[33] Fix | Delete
#define POPT_ARG_DOUBLE 9U /*!< arg ==> double */
[34] Fix | Delete
#define POPT_ARG_LONGLONG 10U /*!< arg ==> long long */
[35] Fix | Delete
[36] Fix | Delete
#define POPT_ARG_MAINCALL (16U+11U) /*!< EXPERIMENTAL: return (*arg) (argc, argv) */
[37] Fix | Delete
#define POPT_ARG_ARGV 12U /*!< dupe'd arg appended to realloc'd argv array. */
[38] Fix | Delete
#define POPT_ARG_SHORT 13U /*!< arg ==> short */
[39] Fix | Delete
#define POPT_ARG_BITSET (16U+14U) /*!< arg ==> bit set */
[40] Fix | Delete
[41] Fix | Delete
#define POPT_ARG_MASK 0x000000FFU
[42] Fix | Delete
#define POPT_GROUP_MASK 0x0000FF00U
[43] Fix | Delete
[44] Fix | Delete
/*@}*/
[45] Fix | Delete
[46] Fix | Delete
/** \ingroup popt
[47] Fix | Delete
* \name Arg modifiers
[48] Fix | Delete
*/
[49] Fix | Delete
/*@{*/
[50] Fix | Delete
#define POPT_ARGFLAG_ONEDASH 0x80000000U /*!< allow -longoption */
[51] Fix | Delete
#define POPT_ARGFLAG_DOC_HIDDEN 0x40000000U /*!< don't show in help/usage */
[52] Fix | Delete
#define POPT_ARGFLAG_STRIP 0x20000000U /*!< strip this arg from argv(only applies to long args) */
[53] Fix | Delete
#define POPT_ARGFLAG_OPTIONAL 0x10000000U /*!< arg may be missing */
[54] Fix | Delete
[55] Fix | Delete
#define POPT_ARGFLAG_OR 0x08000000U /*!< arg will be or'ed */
[56] Fix | Delete
#define POPT_ARGFLAG_NOR 0x09000000U /*!< arg will be nor'ed */
[57] Fix | Delete
#define POPT_ARGFLAG_AND 0x04000000U /*!< arg will be and'ed */
[58] Fix | Delete
#define POPT_ARGFLAG_NAND 0x05000000U /*!< arg will be nand'ed */
[59] Fix | Delete
#define POPT_ARGFLAG_XOR 0x02000000U /*!< arg will be xor'ed */
[60] Fix | Delete
#define POPT_ARGFLAG_NOT 0x01000000U /*!< arg will be negated */
[61] Fix | Delete
#define POPT_ARGFLAG_LOGICALOPS \
[62] Fix | Delete
(POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR)
[63] Fix | Delete
[64] Fix | Delete
#define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR)
[65] Fix | Delete
/*!< set arg bit(s) */
[66] Fix | Delete
#define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND)
[67] Fix | Delete
/*!< clear arg bit(s) */
[68] Fix | Delete
[69] Fix | Delete
#define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000U /*!< show default value in --help */
[70] Fix | Delete
#define POPT_ARGFLAG_RANDOM 0x00400000U /*!< random value in [1,arg] */
[71] Fix | Delete
#define POPT_ARGFLAG_TOGGLE 0x00200000U /*!< permit --[no]opt prefix toggle */
[72] Fix | Delete
[73] Fix | Delete
/*@}*/
[74] Fix | Delete
[75] Fix | Delete
/** \ingroup popt
[76] Fix | Delete
* \name Callback modifiers
[77] Fix | Delete
*/
[78] Fix | Delete
/*@{*/
[79] Fix | Delete
#define POPT_CBFLAG_PRE 0x80000000U /*!< call the callback before parse */
[80] Fix | Delete
#define POPT_CBFLAG_POST 0x40000000U /*!< call the callback after parse */
[81] Fix | Delete
#define POPT_CBFLAG_INC_DATA 0x20000000U /*!< use data from the include line,
[82] Fix | Delete
not the subtable */
[83] Fix | Delete
#define POPT_CBFLAG_SKIPOPTION 0x10000000U /*!< don't callback with option */
[84] Fix | Delete
#define POPT_CBFLAG_CONTINUE 0x08000000U /*!< continue callbacks with option */
[85] Fix | Delete
/*@}*/
[86] Fix | Delete
[87] Fix | Delete
/** \ingroup popt
[88] Fix | Delete
* \name Error return values
[89] Fix | Delete
*/
[90] Fix | Delete
/*@{*/
[91] Fix | Delete
#define POPT_ERROR_NOARG -10 /*!< missing argument */
[92] Fix | Delete
#define POPT_ERROR_BADOPT -11 /*!< unknown option */
[93] Fix | Delete
#define POPT_ERROR_OPTSTOODEEP -13 /*!< aliases nested too deeply */
[94] Fix | Delete
#define POPT_ERROR_BADQUOTE -15 /*!< error in paramter quoting */
[95] Fix | Delete
#define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */
[96] Fix | Delete
#define POPT_ERROR_BADNUMBER -17 /*!< invalid numeric value */
[97] Fix | Delete
#define POPT_ERROR_OVERFLOW -18 /*!< number too large or too small */
[98] Fix | Delete
#define POPT_ERROR_BADOPERATION -19 /*!< mutually exclusive logical operations requested */
[99] Fix | Delete
#define POPT_ERROR_NULLARG -20 /*!< opt->arg should not be NULL */
[100] Fix | Delete
#define POPT_ERROR_MALLOC -21 /*!< memory allocation failed */
[101] Fix | Delete
#define POPT_ERROR_BADCONFIG -22 /*!< config file failed sanity test */
[102] Fix | Delete
/*@}*/
[103] Fix | Delete
[104] Fix | Delete
/** \ingroup popt
[105] Fix | Delete
* \name poptBadOption() flags
[106] Fix | Delete
*/
[107] Fix | Delete
/*@{*/
[108] Fix | Delete
#define POPT_BADOPTION_NOALIAS (1U << 0) /*!< don't go into an alias */
[109] Fix | Delete
/*@}*/
[110] Fix | Delete
[111] Fix | Delete
/** \ingroup popt
[112] Fix | Delete
* \name poptGetContext() flags
[113] Fix | Delete
*/
[114] Fix | Delete
/*@{*/
[115] Fix | Delete
#define POPT_CONTEXT_NO_EXEC (1U << 0) /*!< ignore exec expansions */
[116] Fix | Delete
#define POPT_CONTEXT_KEEP_FIRST (1U << 1) /*!< pay attention to argv[0] */
[117] Fix | Delete
#define POPT_CONTEXT_POSIXMEHARDER (1U << 2) /*!< options can't follow args */
[118] Fix | Delete
#define POPT_CONTEXT_ARG_OPTS (1U << 4) /*!< return args as options with value 0 */
[119] Fix | Delete
/*@}*/
[120] Fix | Delete
[121] Fix | Delete
/** \ingroup popt
[122] Fix | Delete
*/
[123] Fix | Delete
struct poptOption {
[124] Fix | Delete
const char * longName; /*!< may be NULL */
[125] Fix | Delete
char shortName; /*!< may be NUL */
[126] Fix | Delete
unsigned int argInfo;
[127] Fix | Delete
void * arg; /*!< depends on argInfo */
[128] Fix | Delete
int val; /*!< 0 means don't return, just update flag */
[129] Fix | Delete
const char * descrip; /*!< description for autohelp -- may be NULL */
[130] Fix | Delete
const char * argDescrip; /*!< argument description for autohelp */
[131] Fix | Delete
};
[132] Fix | Delete
[133] Fix | Delete
/** \ingroup popt
[134] Fix | Delete
* A popt alias argument for poptAddAlias().
[135] Fix | Delete
*/
[136] Fix | Delete
struct poptAlias {
[137] Fix | Delete
const char * longName; /*!< may be NULL */
[138] Fix | Delete
char shortName; /*!< may be NUL */
[139] Fix | Delete
int argc;
[140] Fix | Delete
const char ** argv; /*!< must be free()able */
[141] Fix | Delete
};
[142] Fix | Delete
[143] Fix | Delete
/** \ingroup popt
[144] Fix | Delete
* A popt alias or exec argument for poptAddItem().
[145] Fix | Delete
*/
[146] Fix | Delete
typedef struct poptItem_s {
[147] Fix | Delete
struct poptOption option; /*!< alias/exec name(s) and description. */
[148] Fix | Delete
int argc; /*!< (alias) no. of args. */
[149] Fix | Delete
const char ** argv; /*!< (alias) args, must be free()able. */
[150] Fix | Delete
} * poptItem;
[151] Fix | Delete
[152] Fix | Delete
/** \ingroup popt
[153] Fix | Delete
* \name Auto-generated help/usage
[154] Fix | Delete
*/
[155] Fix | Delete
/*@{*/
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* Empty table marker to enable displaying popt alias/exec options.
[159] Fix | Delete
*/
[160] Fix | Delete
extern struct poptOption poptAliasOptions[];
[161] Fix | Delete
#define POPT_AUTOALIAS { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptAliasOptions, \
[162] Fix | Delete
0, "Options implemented via popt alias/exec:", NULL },
[163] Fix | Delete
[164] Fix | Delete
/**
[165] Fix | Delete
* Auto help table options.
[166] Fix | Delete
*/
[167] Fix | Delete
extern struct poptOption poptHelpOptions[];
[168] Fix | Delete
[169] Fix | Delete
extern struct poptOption * poptHelpOptionsI18N;
[170] Fix | Delete
[171] Fix | Delete
#define POPT_AUTOHELP { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptHelpOptions, \
[172] Fix | Delete
0, "Help options:", NULL },
[173] Fix | Delete
[174] Fix | Delete
#define POPT_TABLEEND { NULL, '\0', 0, NULL, 0, NULL, NULL }
[175] Fix | Delete
/*@}*/
[176] Fix | Delete
[177] Fix | Delete
/** \ingroup popt
[178] Fix | Delete
*/
[179] Fix | Delete
typedef struct poptContext_s * poptContext;
[180] Fix | Delete
[181] Fix | Delete
/** \ingroup popt
[182] Fix | Delete
*/
[183] Fix | Delete
#ifndef __cplusplus
[184] Fix | Delete
typedef struct poptOption * poptOption;
[185] Fix | Delete
#endif
[186] Fix | Delete
[187] Fix | Delete
/** \ingroup popt
[188] Fix | Delete
*/
[189] Fix | Delete
enum poptCallbackReason {
[190] Fix | Delete
POPT_CALLBACK_REASON_PRE = 0,
[191] Fix | Delete
POPT_CALLBACK_REASON_POST = 1,
[192] Fix | Delete
POPT_CALLBACK_REASON_OPTION = 2
[193] Fix | Delete
};
[194] Fix | Delete
[195] Fix | Delete
#ifdef __cplusplus
[196] Fix | Delete
extern "C" {
[197] Fix | Delete
#endif
[198] Fix | Delete
[199] Fix | Delete
/** \ingroup popt
[200] Fix | Delete
* Table callback prototype.
[201] Fix | Delete
* @param con context
[202] Fix | Delete
* @param reason reason for callback
[203] Fix | Delete
* @param opt option that triggered callback
[204] Fix | Delete
* @param arg @todo Document.
[205] Fix | Delete
* @param data @todo Document.
[206] Fix | Delete
*/
[207] Fix | Delete
typedef void (*poptCallbackType) (poptContext con,
[208] Fix | Delete
enum poptCallbackReason reason,
[209] Fix | Delete
const struct poptOption * opt,
[210] Fix | Delete
const char * arg,
[211] Fix | Delete
const void * data);
[212] Fix | Delete
[213] Fix | Delete
/** \ingroup popt
[214] Fix | Delete
* Destroy context.
[215] Fix | Delete
* @param con context
[216] Fix | Delete
* @return NULL always
[217] Fix | Delete
*/
[218] Fix | Delete
poptContext poptFreeContext( poptContext con);
[219] Fix | Delete
[220] Fix | Delete
/** \ingroup popt
[221] Fix | Delete
* Initialize popt context.
[222] Fix | Delete
* @param name context name (usually argv[0] program name)
[223] Fix | Delete
* @param argc no. of arguments
[224] Fix | Delete
* @param argv argument array
[225] Fix | Delete
* @param options address of popt option table
[226] Fix | Delete
* @param flags or'd POPT_CONTEXT_* bits
[227] Fix | Delete
* @return initialized popt context
[228] Fix | Delete
*/
[229] Fix | Delete
poptContext poptGetContext(
[230] Fix | Delete
const char * name,
[231] Fix | Delete
int argc, const char ** argv,
[232] Fix | Delete
const struct poptOption * options,
[233] Fix | Delete
unsigned int flags);
[234] Fix | Delete
[235] Fix | Delete
/** \ingroup popt
[236] Fix | Delete
* Destroy context (alternative implementation).
[237] Fix | Delete
* @param con context
[238] Fix | Delete
* @return NULL always
[239] Fix | Delete
*/
[240] Fix | Delete
poptContext poptFini( poptContext con);
[241] Fix | Delete
[242] Fix | Delete
/** \ingroup popt
[243] Fix | Delete
* Initialize popt context (alternative implementation).
[244] Fix | Delete
* This routine does poptGetContext() and then poptReadConfigFiles().
[245] Fix | Delete
* @param argc no. of arguments
[246] Fix | Delete
* @param argv argument array
[247] Fix | Delete
* @param options address of popt option table
[248] Fix | Delete
* @param configPaths colon separated file path(s) to read.
[249] Fix | Delete
* @return initialized popt context (NULL on error).
[250] Fix | Delete
*/
[251] Fix | Delete
poptContext poptInit(int argc, const char ** argv,
[252] Fix | Delete
const struct poptOption * options,
[253] Fix | Delete
const char * configPaths);
[254] Fix | Delete
[255] Fix | Delete
/** \ingroup popt
[256] Fix | Delete
* Reinitialize popt context.
[257] Fix | Delete
* @param con context
[258] Fix | Delete
*/
[259] Fix | Delete
void poptResetContext(poptContext con);
[260] Fix | Delete
[261] Fix | Delete
/** \ingroup popt
[262] Fix | Delete
* Return value of next option found.
[263] Fix | Delete
* @param con context
[264] Fix | Delete
* @return next option val, -1 on last item, POPT_ERROR_* on error
[265] Fix | Delete
*/
[266] Fix | Delete
int poptGetNextOpt(poptContext con);
[267] Fix | Delete
[268] Fix | Delete
/** \ingroup popt
[269] Fix | Delete
* Return next option argument (if any).
[270] Fix | Delete
* @param con context
[271] Fix | Delete
* @return option argument, NULL if no argument is available
[272] Fix | Delete
*/
[273] Fix | Delete
char * poptGetOptArg(poptContext con);
[274] Fix | Delete
[275] Fix | Delete
/** \ingroup popt
[276] Fix | Delete
* Return next argument.
[277] Fix | Delete
* @param con context
[278] Fix | Delete
* @return next argument, NULL if no argument is available
[279] Fix | Delete
*/
[280] Fix | Delete
const char * poptGetArg(poptContext con);
[281] Fix | Delete
[282] Fix | Delete
/** \ingroup popt
[283] Fix | Delete
* Peek at current argument.
[284] Fix | Delete
* @param con context
[285] Fix | Delete
* @return current argument, NULL if no argument is available
[286] Fix | Delete
*/
[287] Fix | Delete
const char * poptPeekArg(poptContext con)
[288] Fix | Delete
/*@*/;
[289] Fix | Delete
[290] Fix | Delete
/** \ingroup popt
[291] Fix | Delete
* Return remaining arguments.
[292] Fix | Delete
* @param con context
[293] Fix | Delete
* @return argument array, NULL terminated
[294] Fix | Delete
*/
[295] Fix | Delete
const char ** poptGetArgs(poptContext con);
[296] Fix | Delete
[297] Fix | Delete
/** \ingroup popt
[298] Fix | Delete
* Return the option which caused the most recent error.
[299] Fix | Delete
* @param con context
[300] Fix | Delete
* @param flags
[301] Fix | Delete
* @return offending option
[302] Fix | Delete
*/
[303] Fix | Delete
const char * poptBadOption(poptContext con, unsigned int flags)
[304] Fix | Delete
/*@*/;
[305] Fix | Delete
[306] Fix | Delete
/** \ingroup popt
[307] Fix | Delete
* Add arguments to context.
[308] Fix | Delete
* @param con context
[309] Fix | Delete
* @param argv argument array, NULL terminated
[310] Fix | Delete
* @return 0 on success, POPT_ERROR_OPTSTOODEEP on failure
[311] Fix | Delete
*/
[312] Fix | Delete
int poptStuffArgs(poptContext con, const char ** argv);
[313] Fix | Delete
[314] Fix | Delete
/** \ingroup popt
[315] Fix | Delete
* Add alias to context.
[316] Fix | Delete
* @todo Pass alias by reference, not value.
[317] Fix | Delete
* @deprecated Use poptAddItem instead.
[318] Fix | Delete
* @param con context
[319] Fix | Delete
* @param alias alias to add
[320] Fix | Delete
* @param flags (unused)
[321] Fix | Delete
* @return 0 on success
[322] Fix | Delete
*/
[323] Fix | Delete
int poptAddAlias(poptContext con, struct poptAlias alias, int flags);
[324] Fix | Delete
[325] Fix | Delete
/** \ingroup popt
[326] Fix | Delete
* Add alias/exec item to context.
[327] Fix | Delete
* @param con context
[328] Fix | Delete
* @param newItem alias/exec item to add
[329] Fix | Delete
* @param flags 0 for alias, 1 for exec
[330] Fix | Delete
* @return 0 on success
[331] Fix | Delete
*/
[332] Fix | Delete
int poptAddItem(poptContext con, poptItem newItem, int flags);
[333] Fix | Delete
[334] Fix | Delete
/** \ingroup popt
[335] Fix | Delete
* Test path/file for config file sanity (regular file, permissions etc)
[336] Fix | Delete
* @param fn file name
[337] Fix | Delete
* @return 1 on OK, 0 on NOTOK.
[338] Fix | Delete
*/
[339] Fix | Delete
int poptSaneFile(const char * fn);
[340] Fix | Delete
[341] Fix | Delete
/**
[342] Fix | Delete
* Read a file into a buffer.
[343] Fix | Delete
* @param fn file name
[344] Fix | Delete
* @retval *bp buffer (malloc'd) (or NULL)
[345] Fix | Delete
* @retval *nbp no. of bytes in buffer (including final NUL) (or NULL)
[346] Fix | Delete
* @param flags 1 to trim escaped newlines
[347] Fix | Delete
* return 0 on success
[348] Fix | Delete
*/
[349] Fix | Delete
int poptReadFile(const char * fn, char ** bp,
[350] Fix | Delete
size_t * nbp, int flags);
[351] Fix | Delete
#define POPT_READFILE_TRIMNEWLINES 1
[352] Fix | Delete
[353] Fix | Delete
/** \ingroup popt
[354] Fix | Delete
* Read configuration file.
[355] Fix | Delete
* @param con context
[356] Fix | Delete
* @param fn file name to read
[357] Fix | Delete
* @return 0 on success, POPT_ERROR_ERRNO on failure
[358] Fix | Delete
*/
[359] Fix | Delete
int poptReadConfigFile(poptContext con, const char * fn);
[360] Fix | Delete
[361] Fix | Delete
/** \ingroup popt
[362] Fix | Delete
* Read configuration file(s).
[363] Fix | Delete
* Colon separated files to read, looping over poptReadConfigFile().
[364] Fix | Delete
* Note that an '@' character preceeding a path in the list will
[365] Fix | Delete
* also perform additional sanity checks on the file before reading.
[366] Fix | Delete
* @param con context
[367] Fix | Delete
* @param paths colon separated file name(s) to read
[368] Fix | Delete
* @return 0 on success, POPT_ERROR_BADCONFIG on failure
[369] Fix | Delete
*/
[370] Fix | Delete
int poptReadConfigFiles(poptContext con, const char * paths);
[371] Fix | Delete
[372] Fix | Delete
/** \ingroup popt
[373] Fix | Delete
* Read default configuration from /etc/popt and $HOME/.popt.
[374] Fix | Delete
* @param con context
[375] Fix | Delete
* @param useEnv (unused)
[376] Fix | Delete
* @return 0 on success, POPT_ERROR_ERRNO on failure
[377] Fix | Delete
*/
[378] Fix | Delete
int poptReadDefaultConfig(poptContext con, int useEnv);
[379] Fix | Delete
[380] Fix | Delete
/** \ingroup popt
[381] Fix | Delete
* Duplicate an argument array.
[382] Fix | Delete
* @note: The argument array is malloc'd as a single area, so only argv must
[383] Fix | Delete
* be free'd.
[384] Fix | Delete
*
[385] Fix | Delete
* @param argc no. of arguments
[386] Fix | Delete
* @param argv argument array
[387] Fix | Delete
* @retval argcPtr address of returned no. of arguments
[388] Fix | Delete
* @retval argvPtr address of returned argument array
[389] Fix | Delete
* @return 0 on success, POPT_ERROR_NOARG on failure
[390] Fix | Delete
*/
[391] Fix | Delete
int poptDupArgv(int argc, const char **argv,
[392] Fix | Delete
int * argcPtr,
[393] Fix | Delete
const char *** argvPtr);
[394] Fix | Delete
[395] Fix | Delete
/** \ingroup popt
[396] Fix | Delete
* Parse a string into an argument array.
[397] Fix | Delete
* The parse allows ', ", and \ quoting, but ' is treated the same as " and
[398] Fix | Delete
* both may include \ quotes.
[399] Fix | Delete
* @note: The argument array is malloc'd as a single area, so only argv must
[400] Fix | Delete
* be free'd.
[401] Fix | Delete
*
[402] Fix | Delete
* @param s string to parse
[403] Fix | Delete
* @retval argcPtr address of returned no. of arguments
[404] Fix | Delete
* @retval argvPtr address of returned argument array
[405] Fix | Delete
*/
[406] Fix | Delete
int poptParseArgvString(const char * s,
[407] Fix | Delete
int * argcPtr, const char *** argvPtr);
[408] Fix | Delete
[409] Fix | Delete
/** \ingroup popt
[410] Fix | Delete
* Parses an input configuration file and returns an string that is a
[411] Fix | Delete
* command line. For use with popt. You must free the return value when done.
[412] Fix | Delete
*
[413] Fix | Delete
* Given the file:
[414] Fix | Delete
\verbatim
[415] Fix | Delete
# this line is ignored
[416] Fix | Delete
# this one too
[417] Fix | Delete
aaa
[418] Fix | Delete
bbb
[419] Fix | Delete
ccc
[420] Fix | Delete
bla=bla
[421] Fix | Delete
[422] Fix | Delete
this_is = fdsafdas
[423] Fix | Delete
bad_line=
[424] Fix | Delete
reall bad line
[425] Fix | Delete
reall bad line = again
[426] Fix | Delete
5555= 55555
[427] Fix | Delete
test = with lots of spaces
[428] Fix | Delete
\endverbatim
[429] Fix | Delete
*
[430] Fix | Delete
* The result is:
[431] Fix | Delete
\verbatim
[432] Fix | Delete
--aaa --bbb --ccc --bla="bla" --this_is="fdsafdas" --5555="55555" --test="with lots of spaces"
[433] Fix | Delete
\endverbatim
[434] Fix | Delete
*
[435] Fix | Delete
* Passing this to poptParseArgvString() yields an argv of:
[436] Fix | Delete
\verbatim
[437] Fix | Delete
'--aaa'
[438] Fix | Delete
'--bbb'
[439] Fix | Delete
'--ccc'
[440] Fix | Delete
'--bla=bla'
[441] Fix | Delete
'--this_is=fdsafdas'
[442] Fix | Delete
'--5555=55555'
[443] Fix | Delete
'--test=with lots of spaces'
[444] Fix | Delete
\endverbatim
[445] Fix | Delete
*
[446] Fix | Delete
* @bug NULL is returned if file line is too long.
[447] Fix | Delete
* @bug Silently ignores invalid lines.
[448] Fix | Delete
*
[449] Fix | Delete
* @param fp file handle to read
[450] Fix | Delete
* @param *argstrp return string of options (malloc'd)
[451] Fix | Delete
* @param flags unused
[452] Fix | Delete
* @return 0 on success
[453] Fix | Delete
* @see poptParseArgvString
[454] Fix | Delete
*/
[455] Fix | Delete
int poptConfigFileToString(FILE *fp, char ** argstrp, int flags);
[456] Fix | Delete
[457] Fix | Delete
/** \ingroup popt
[458] Fix | Delete
* Return formatted error string for popt failure.
[459] Fix | Delete
* @param error popt error
[460] Fix | Delete
* @return error string
[461] Fix | Delete
*/
[462] Fix | Delete
const char * poptStrerror(const int error);
[463] Fix | Delete
[464] Fix | Delete
/** \ingroup popt
[465] Fix | Delete
* Limit search for executables.
[466] Fix | Delete
* @param con context
[467] Fix | Delete
* @param path single path to search for executables
[468] Fix | Delete
* @param allowAbsolute absolute paths only?
[469] Fix | Delete
*/
[470] Fix | Delete
void poptSetExecPath(poptContext con, const char * path, int allowAbsolute);
[471] Fix | Delete
[472] Fix | Delete
/** \ingroup popt
[473] Fix | Delete
* Print detailed description of options.
[474] Fix | Delete
* @param con context
[475] Fix | Delete
* @param fp ouput file handle
[476] Fix | Delete
* @param flags (unused)
[477] Fix | Delete
*/
[478] Fix | Delete
void poptPrintHelp(poptContext con, FILE * fp, int flags);
[479] Fix | Delete
[480] Fix | Delete
/** \ingroup popt
[481] Fix | Delete
* Print terse description of options.
[482] Fix | Delete
* @param con context
[483] Fix | Delete
* @param fp ouput file handle
[484] Fix | Delete
* @param flags (unused)
[485] Fix | Delete
*/
[486] Fix | Delete
void poptPrintUsage(poptContext con, FILE * fp, int flags);
[487] Fix | Delete
[488] Fix | Delete
/** \ingroup popt
[489] Fix | Delete
* Provide text to replace default "[OPTION...]" in help/usage output.
[490] Fix | Delete
* @param con context
[491] Fix | Delete
* @param text replacement text
[492] Fix | Delete
*/
[493] Fix | Delete
void poptSetOtherOptionHelp(poptContext con, const char * text);
[494] Fix | Delete
[495] Fix | Delete
/** \ingroup popt
[496] Fix | Delete
* Return argv[0] from context.
[497] Fix | Delete
* @param con context
[498] Fix | Delete
* @return argv[0]
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function