poptparse.c File Reference

#include "system.h"
Include dependency graph for poptparse.c:

Go to the source code of this file.

Defines

#define POPT_ARGV_ARRAY_GROW_DELTA   5

Functions

int poptDupArgv (int argc, const char **argv, int *argcPtr, const char ***argvPtr)
 Duplicate an argument array.
int poptParseArgvString (const char *s, int *argcPtr, const char ***argvPtr)
 Parse a string into an argument array.
int poptConfigFileToString (FILE *fp, char **argstrp, UNUSED(int flags))

Define Documentation

#define POPT_ARGV_ARRAY_GROW_DELTA   5

Definition at line 11 of file poptparse.c.

Referenced by poptParseArgvString().


Function Documentation

int poptConfigFileToString ( FILE *  fp,
char **  argstrp,
UNUSED(int flags)   
)

< opt->arg should not be NULL

< memory allocation failed

< number too large or too small

< memory allocation failed

< memory allocation failed

Definition at line 131 of file poptparse.c.

References _isspaceptr, POPT_ERROR_MALLOC, POPT_ERROR_NULLARG, and POPT_ERROR_OVERFLOW.

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

Duplicate an argument array.

Note:
: The argument array is malloc'd as a single area, so only argv must be free'd.
Parameters:
argc no. of arguments
argv argument array
Return values:
argcPtr address of returned no. of arguments
argvPtr address of returned argument array
Returns:
0 on success, POPT_ERROR_NOARG on failure

< missing argument

< missing argument

< memory allocation failed

Definition at line 13 of file poptparse.c.

References POPT_ERROR_MALLOC, POPT_ERROR_NOARG, and stpcpy().

Referenced by handleAlias(), poptParseArgvString(), and poptStuffArgs().

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

Parse a string into an argument array.

The parse allows ', ", and \ quoting, but ' is treated the same as " and both may include \ quotes.

Note:
: The argument array is malloc'd as a single area, so only argv must be free'd.
Parameters:
s string to parse
Return values:
argcPtr address of returned no. of arguments
argvPtr address of returned argument array

< memory allocation failed

< error in paramter quoting

< error in paramter quoting

Definition at line 54 of file poptparse.c.

References _isspaceptr, POPT_ARGV_ARRAY_GROW_DELTA, POPT_ERROR_BADQUOTE, POPT_ERROR_MALLOC, and poptDupArgv().

Referenced by configLine().


Generated for popt by  doxygen 1.6.1