The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

popt.h (3)
  • >> popt.h (3) ( Linux man: Библиотечные вызовы )
  •  

    NAME

    popt.h - 
     
    

    SYNOPSIS


    #include <stdio.h>

     

    Classes


    struct poptOption

    struct poptAlias

    struct poptItem_s
     

    Arg type identifiers


    #define POPT_ARG_NONE 0      /*!< no arg */

    #define POPT_ARG_STRING 1    /*!< arg will be saved as string */

    #define POPT_ARG_INT 2       /*!< arg will be converted to int */

    #define POPT_ARG_LONG 3      /*!< arg will be converted to long */

    #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_FLOAT 8     /*!< arg will be converted to float */

    #define POPT_ARG_DOUBLE 9    /*!< arg will be converted to double */

    #define POPT_ARG_MASK 0x0000FFFF
     

    Arg modifiers



    #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_ARGFLAG_OPTIONAL 0x10000000 /*!< arg may be missing */

    #define POPT_ARGFLAG_OR 0x08000000 /*!< arg will be or'ed */

    #define POPT_ARGFLAG_NOR 0x09000000 /*!< arg will be nor'ed */

    #define POPT_ARGFLAG_AND 0x04000000 /*!< arg will be and'ed */

    #define POPT_ARGFLAG_NAND 0x05000000 /*!< arg will be nand'ed */

    #define POPT_ARGFLAG_XOR 0x02000000 /*!< arg will be xor'ed */

    #define POPT_ARGFLAG_NOT 0x01000000 /*!< arg will be negated */

    #define POPT_ARGFLAG_LOGICALOPS (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR)

    #define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR)

    #define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND)

    #define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000 /*!< show default value in --help */
     

    Callback modifiers


    #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_CBFLAG_SKIPOPTION 0x10000000 /*!< don't callback with option */

    #define POPT_CBFLAG_CONTINUE 0x08000000 /*!< continue callbacks with option */
     

    Error return values


    #define POPT_ERROR_NOARG -10 /*!< missing argument */

    #define POPT_ERROR_BADOPT -11        /*!< unknown option */

    #define POPT_ERROR_OPTSTOODEEP -13   /*!< aliases nested too deeply */

    #define POPT_ERROR_BADQUOTE -15      /*!< error in paramter quoting */

    #define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */

    #define POPT_ERROR_BADNUMBER -17     /*!< invalid numeric value */

    #define POPT_ERROR_OVERFLOW -18      /*!< number too large or too small */

    #define POPT_ERROR_BADOPERATION -19  /*!< mutually exclusive logical operations requested */

    #define POPT_ERROR_NULLARG -20       /*!< opt->arg should not be NULL */

    #define POPT_ERROR_MALLOC -21        /*!< memory allocation failed */

    #define POPT_ERROR_NOCONTEXT -22     /*!< no context */
     

    poptBadOption() flags



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

    poptGetContext() flags


    #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_CONTEXT_ARG_OPTS (1 << 4) /*!< return args as options with value 0 */
     

    Auto-generated help/usage


    #define POPT_AUTOALIAS

    #define POPT_AUTOHELP

    #define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL }

    poptOption poptAliasOptions []
    Empty table marker to enable displaying popt alias/exec options.
    poptOption poptHelpOptions []
    Auto help table options.  

    Defines


    #define POPT_OPTION_DEPTH 10
     

    Typedefs


    typedef poptItem_s * poptItem

    typedef poptContext_s * poptContext

    typedef 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)

    poptContext poptFreeContext (poptContext con)

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

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

    int poptAddItem (poptContext con, poptItem newItem, 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 *const poptStrerror (const int error)

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

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

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

    void poptSetOtherOptionHelp (poptContext con, const char *text)

    const char * poptGetInvocationName (poptContext con)

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

    Define Documentation

     

    #define POPT_ARG_CALLBACK

    Value:.nf 5 table-wide callback... must be set first in table; arg points to callback, descrip points to callback data to pass

    Definition at line 30 of file popt.h.  

    #define POPT_ARG_DOUBLE 9/*!< arg will be converted to double */

    arg will be converted to double Definition at line 44 of file popt.h.
     

    #define POPT_ARG_FLOAT 8/*!< arg will be converted to float */

    arg will be converted to float Definition at line 42 of file popt.h.
     

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

    arg points to table Definition at line 28 of file popt.h.
     

    #define POPT_ARG_INT 2  /*!< arg will be converted to int */

    arg will be converted to int Definition at line 24 of file popt.h.
     

    #define POPT_ARG_INTL_DOMAIN

    Value:.nf 6 set the translation domain for this table and any included tables; arg points to the domain string

    Definition at line 35 of file popt.h.  

    #define POPT_ARG_LONG 3/*!< arg will be converted to long */

    arg will be converted to long Definition at line 26 of file popt.h.
     

    #define POPT_ARG_MASK 0x0000FFFF

    Definition at line 47 of file popt.h.  

    #define POPT_ARG_NONE 0       /*!< no arg */

    no arg Definition at line 20 of file popt.h.
     

    #define POPT_ARG_STRING 1/*!< arg will be saved as string */

    arg will be saved as string Definition at line 22 of file popt.h.
     

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

    arg should take value val Definition at line 40 of file popt.h.
     

    #define POPT_ARGFLAG_AND 0x04000000 /*!< arg will be and'ed */

    arg will be and'ed Definition at line 67 of file popt.h.  

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

    don't show in help/usage Definition at line 56 of file popt.h.  

    #define POPT_ARGFLAG_LOGICALOPS (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR)

    Definition at line 75 of file popt.h.  

    #define POPT_ARGFLAG_NAND 0x05000000 /*!< arg will be nand'ed */

    arg will be nand'ed Definition at line 69 of file popt.h.  

    #define POPT_ARGFLAG_NOR 0x09000000 /*!< arg will be nor'ed */

    arg will be nor'ed Definition at line 65 of file popt.h.  

    #define POPT_ARGFLAG_NOT 0x01000000 /*!< arg will be negated */

    arg will be negated Definition at line 73 of file popt.h.  

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

    allow -longoption Definition at line 54 of file popt.h.  

    #define POPT_ARGFLAG_OPTIONAL 0x10000000 /*!< arg may be missing */

    arg may be missing Definition at line 60 of file popt.h.  

    #define POPT_ARGFLAG_OR 0x08000000 /*!< arg will be or'ed */

    arg will be or'ed Definition at line 63 of file popt.h.  

    #define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000 /*!< show default value in --help */

    show default value in --help Definition at line 83 of file popt.h.  

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

    strip this arg from argv(only applies to long args) Definition at line 58 of file popt.h.  

    #define POPT_ARGFLAG_XOR 0x02000000 /*!< arg will be xor'ed */

    arg will be xor'ed Definition at line 71 of file popt.h.  

    #define POPT_AUTOALIAS

    Value:.nf { NULL, ' ', POPT_ARG_INCLUDE_TABLE, poptAliasOptions,
                            0, 'Options implemented via popt alias/exec:', NULL },

    Definition at line 196 of file popt.h.  

    #define POPT_AUTOHELP

    Value:.nf { NULL, ' ', POPT_ARG_INCLUDE_TABLE, poptHelpOptions,
                            0, 'Help options:', NULL },

    Definition at line 204 of file popt.h.  

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

    don't go into an alias Definition at line 137 of file popt.h.  

    #define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND)

    clear arg bit(s) Definition at line 80 of file popt.h.  

    #define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR)

    set arg bit(s) Definition at line 78 of file popt.h.  

    #define POPT_CBFLAG_CONTINUE 0x08000000 /*!< continue callbacks with option */

    continue callbacks with option Definition at line 101 of file popt.h.  

    #define POPT_CBFLAG_INC_DATA

    Value:.nf 0x20000000 use data from the include line, not the subtable

    Definition at line 96 of file popt.h.  

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

    call the callback after parse Definition at line 94 of file popt.h.  

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

    call the callback before parse Definition at line 92 of file popt.h.  

    #define POPT_CBFLAG_SKIPOPTION 0x10000000 /*!< don't callback with option */

    don't callback with option Definition at line 99 of file popt.h.  

    #define POPT_CONTEXT_ARG_OPTS (1 << 4) /*!< return args as options with value 0 */

    return args as options with value 0 Definition at line 151 of file popt.h.  

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

    pay attention to argv[0] Definition at line 147 of file popt.h.

    Referenced by poptGetContext().  

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

    ignore exec expansions Definition at line 145 of file popt.h.  

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

    options can't follow args Definition at line 149 of file popt.h.

    Referenced by poptGetContext().  

    #define POPT_ERROR_BADNUMBER -17/*!< invalid numeric value */

    invalid numeric value Definition at line 119 of file popt.h.

    Referenced by poptStrerror().  

    #define POPT_ERROR_BADOPERATION -19/*!< mutually exclusive logical operations requested */

    mutually exclusive logical operations requested Definition at line 123 of file popt.h.
     

    #define POPT_ERROR_BADOPT -11 /*!< unknown option */

    unknown option Definition at line 111 of file popt.h.
     

    #define POPT_ERROR_BADQUOTE -15/*!< error in paramter quoting */

    error in paramter quoting Definition at line 115 of file popt.h.

    Referenced by poptParseArgvString(), and poptStrerror().  

    #define POPT_ERROR_ERRNO -16/*!< errno set, use strerror(errno) */

    errno set, use strerror(errno) Definition at line 117 of file popt.h.

    Referenced by poptReadConfigFile(), and poptStrerror().  

    #define POPT_ERROR_MALLOC -21/*!< memory allocation failed */

    memory allocation failed Definition at line 127 of file popt.h.

    Referenced by poptDupArgv(), poptParseArgvString(), and poptStrerror().  

    #define POPT_ERROR_NOARG -10        /*!< missing argument */

    missing argument Definition at line 109 of file popt.h.

    Referenced by poptDupArgv().  

    #define POPT_ERROR_NOCONTEXT -22  /*!< no context */

    no context Definition at line 129 of file popt.h.

    Referenced by poptReadConfigFile(), and poptStrerror().  

    #define POPT_ERROR_NULLARG -20/*!< opt->arg should not be NULL */

    opt->arg should not be NULL Definition at line 125 of file popt.h.
     

    #define POPT_ERROR_OPTSTOODEEP -13/*!< aliases nested too deeply */

    aliases nested too deeply Definition at line 113 of file popt.h.
     

    #define POPT_ERROR_OVERFLOW -18/*!< number too large or too small */

    number too large or too small Definition at line 121 of file popt.h.

    Referenced by poptStrerror().  

    #define POPT_OPTION_DEPTH 10

    Definition at line 14 of file popt.h.  

    #define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL }

    Definition at line 207 of file popt.h.  

    Typedef Documentation

     

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

    Table callback prototype.

    Parameters:

    con context
    reason reason for callback
    opt option that triggered callback
    arg

    Todo

    Document.

    Document.

    Parameters:

    data .RE

    Definition at line 239 of file popt.h.

     

    typedef struct poptContext_s* poptContext

    Definition at line 212 of file popt.h.

    Referenced by poptGetArgs(), poptReadConfigFile(), poptReadDefaultConfig(), and poptSetExecPath().  

    typedef struct poptItem_s * poptItem

    A popt alias or exec argument for poptAddItem(). Referenced by poptGetArgs().  

    typedef struct poptOption* poptOption

    Definition at line 218 of file popt.h.  

    Enumeration Type Documentation

     

    enum poptCallbackReason

    Enumeration values:

    POPT_CALLBACK_REASON_PRE
    POPT_CALLBACK_REASON_POST
    POPT_CALLBACK_REASON_OPTION

    Definition at line 222 of file popt.h.  

    Function Documentation

     

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

    Add alias to context.

    Todo

    Pass alias by reference, not value.

    Deprecated

    Use poptAddItem instead.

    Parameters:

    con context
    alias alias to add
    flags (unused)

    Returns:

    0 on success

    < don't show in help/usage Definition at line 1084 of file popt.c.  

    int poptAddItem (poptContext con, poptItem newItem, int flags)

    Add alias/exec item to context.

    Parameters:

    con context
    item alias/exec item to add
    flags 0 for alias, 1 for exec

    Returns:

    0 on success

    Definition at line 1104 of file popt.c.  

    const char* poptBadOption (poptContext con, int flags)

    Return the option which caused the most recent error.

    Parameters:

    con context

    Returns:

    offending option

    < don't go into an alias Definition at line 1150 of file popt.c.  

    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, xfree, and xmalloc.

    Referenced by poptParseArgvString().  

    poptContext poptFreeContext (poptContext con)

    Destroy context.

    Parameters:

    con context

    Returns:

    NULL always

    Definition at line 1040 of file popt.c.  

    const char* poptGetArg (poptContext con)

    Return current option's argument.

    Parameters:

    con context

    Returns:

    option argument, NULL if no more options are available

    Definition at line 1010 of file popt.c.  

    const char** poptGetArgs (poptContext con)

    Return remaining arguments.

    Parameters:

    con context

    Returns:

    argument array, terminated with NULL

    Definition at line 1026 of file popt.c.

    References poptContext_s::aliases, optionStackEntry::argb, poptContext_s::numAliases, poptContext_s::os, poptContext, poptItem, and poptResetContext().  

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

    Initialize popt context.

    Parameters:

    name
    argc no. of arguments
    argv argument array
    options address of popt option table
    flags or'd POPT_CONTEXT_* bits

    Returns:

    initialized popt context

    < pay attention to argv[0]

    < options can't follow args Definition at line 158 of file popt.c.

    References POPT_CONTEXT_KEEP_FIRST, and POPT_CONTEXT_POSIXMEHARDER.  

    const char* poptGetInvocationName (poptContext con)

    Return argv[0] from context.

    Parameters:

    con context

    Returns:

    argv[0]

    Definition at line 1222 of file popt.c.

    References poptContext_s::arg_strip, and PBM_ISSET.  

    int poptGetNextOpt (poptContext con)

    Return value of next option found.

    Parameters:

    con context

    Returns:

    next option val, -1 on last item, POPT_ERROR_* on error

    < unknown option

    < options can't follow args

    < return args as options with value 0

    < unknown option

    < unknown option

    < strip this arg from argv(only applies to long args)

    < unknown option

    < unknown option

    < no arg

    < mutually exclusive logical operations requested

    < arg should take value val

    < mutually exclusive logical operations requested

    < no arg

    < arg may be missing

    < missing argument

    < strip this arg from argv(only applies to long args)

    < arg will be saved as string

    < arg will be converted to int

    < arg will be converted to long

    < invalid numeric value

    < arg will be converted to long

    < number too large or too small

    < mutually exclusive logical operations requested

    < number too large or too small

    < mutually exclusive logical operations requested

    < arg will be converted to float

    < arg will be converted to double

    < number too large or too small

    < invalid numeric value

    < arg will be converted to double

    < number too large or too small

    < number too large or too small

    < arg should take value val

    < allow -longoption

    < no arg

    < arg should take value val

    < no arg Definition at line 688 of file popt.c.

    References poptContext_s::os.  

    const char* poptGetOptArg (poptContext con)

    Return next option argument (if any).

    Parameters:

    con context

    Returns:

    option argument, NULL if no more options are available

    Definition at line 998 of file popt.c.

    References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.  

    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 alloca(), POPT_ARGV_ARRAY_GROW_DELTA, POPT_ERROR_BADQUOTE, POPT_ERROR_MALLOC, poptDupArgv(), xmalloc, and xrealloc.  

    const char* poptPeekArg (poptContext con)

    Peek at current option's argument.

    Parameters:

    con context

    Returns:

    option argument

    Definition at line 1018 of file popt.c.  

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

    Print detailed description of options.

    Parameters:

    con context
    fp ouput file handle
    flags (unused)

    Definition at line 481 of file popthelp.c.  

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

    Print terse description of options.

    Parameters:

    con context
    fp ouput file handle
    flags (unused)

    Definition at line 648 of file popthelp.c.

    References poptContext_s::otherHelp.  

    int poptReadConfigFile (poptContext con, const char * fn)

    Read configuration file.

    Parameters:

    con context
    fn file name to read

    Returns:

    0 on success, POPT_ERROR_ERRNO on failure

    < no context

    < errno set, use strerror(errno)

    < errno set, use strerror(errno)

    < errno set, use strerror(errno)

    < errno set, use strerror(errno) Definition at line 94 of file poptconfig.c.

    References alloca(), POPT_ERROR_ERRNO, POPT_ERROR_NOCONTEXT, and poptContext.

    Referenced by poptReadDefaultConfig().  

    int poptReadDefaultConfig (poptContext con, int useEnv)

    Read default configuration from /etc/popt and $HOME/.popt.

    Parameters:

    con context
    useEnv (unused)

    Returns:

    0 on success, POPT_ERROR_ERRNO on failure

    Definition at line 165 of file poptconfig.c.

    References alloca(), poptContext_s::appName, poptContext, and poptReadConfigFile().  

    void poptResetContext (poptContext con)

    Reinitialize popt context.

    Parameters:

    con context

    Definition at line 218 of file popt.c.

    References poptContext_s::finalArgv, and poptContext_s::finalArgvCount.

    Referenced by poptGetArgs().  

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

    Limit search for executables.

    Parameters:

    con context
    path single path to search for executables
    allowAbsolute absolute paths only?

    Definition at line 47 of file popt.c.

    References poptContext_s::execAbsolute, poptContext_s::execPath, poptContext, and xstrdup.  

    void poptSetOtherOptionHelp (poptContext con, const char * text)

    Provide text to replace default '[OPTION...]' in help/usage output.

    Parameters:

    con context
    text replacement text

    Definition at line 669 of file popthelp.c.  

    const char* const poptStrerror (const int error)

    Return formatted error string for popt failure.

    Parameters:

    error popt error

    Returns:

    error string

    < missing argument

    < unknown option

    < mutually exclusive logical operations requested

    < opt->arg should not be NULL

    < aliases nested too deeply

    < error in paramter quoting

    < invalid numeric value

    < number too large or too small

    < memory allocation failed

    < no context

    < errno set, use strerror(errno) Definition at line 1167 of file popt.c.

    References POPT_ERROR_BADNUMBER, POPT_ERROR_BADQUOTE, POPT_ERROR_ERRNO, POPT_ERROR_MALLOC, POPT_ERROR_NOCONTEXT, and POPT_ERROR_OVERFLOW.  

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

    Shuffle argv pointers to remove stripped args, returns new argc.

    Parameters:

    con context
    argc no. of args
    argv arg vector

    Returns:

    new argc

    Definition at line 1227 of file popt.c.

    References poptContext_s::arg_strip, and PBM_ISSET.  

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

    Add arguments to context.

    Parameters:

    con context
    argv argument array, NULL terminated

    Returns:

    0 on success, POPT_ERROR_OPTSTOODEEP on failure

    < no context

    < aliases nested too deeply Definition at line 1197 of file popt.c.  

    Variable Documentation

     

    struct poptOption poptAliasOptions[]

    Empty table marker to enable displaying popt alias/exec options. Definition at line 195 of file popt.h.  

    struct poptOption poptHelpOptions[]

    Auto help table options. Definition at line 203 of file popt.h.  

    Author

    Generated automatically by Doxygen for popt from the source code.


     

    Index

    NAME
    SYNOPSIS
    Classes
    Arg type identifiers
    Arg modifiers
    Callback modifiers
    Error return values
    poptBadOption() flags
    poptGetContext() flags
    Auto-generated help/usage
    Defines
    Typedefs
    Enumerations
    Functions
    Define Documentation
    #define POPT_ARG_CALLBACK
    #define POPT_ARG_DOUBLE 9    /*!< arg will be converted to double */
    #define POPT_ARG_FLOAT 8     /*!< arg will be converted to float */
    #define POPT_ARG_INCLUDE_TABLE 4     /*!< arg points to table */
    #define POPT_ARG_INT 2       /*!< arg will be converted to int */
    #define POPT_ARG_INTL_DOMAIN
    #define POPT_ARG_LONG 3      /*!< arg will be converted to long */
    #define POPT_ARG_MASK 0x0000FFFF
    #define POPT_ARG_NONE 0      /*!< no arg */
    #define POPT_ARG_STRING 1    /*!< arg will be saved as string */
    #define POPT_ARG_VAL 7       /*!< arg should take value val */
    #define POPT_ARGFLAG_AND 0x04000000 /*!< arg will be and'ed */
    #define POPT_ARGFLAG_DOC_HIDDEN 0x40000000 /*!< don't show in help/usage */
    #define POPT_ARGFLAG_LOGICALOPS (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR)
    #define POPT_ARGFLAG_NAND 0x05000000 /*!< arg will be nand'ed */
    #define POPT_ARGFLAG_NOR 0x09000000 /*!< arg will be nor'ed */
    #define POPT_ARGFLAG_NOT 0x01000000 /*!< arg will be negated */
    #define POPT_ARGFLAG_ONEDASH 0x80000000 /*!< allow -longoption */
    #define POPT_ARGFLAG_OPTIONAL 0x10000000 /*!< arg may be missing */
    #define POPT_ARGFLAG_OR 0x08000000 /*!< arg will be or'ed */
    #define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000 /*!< show default value in --help */
    #define POPT_ARGFLAG_STRIP 0x20000000 /*!< strip this arg from argv(only applies to long args) */
    #define POPT_ARGFLAG_XOR 0x02000000 /*!< arg will be xor'ed */
    #define POPT_AUTOALIAS
    #define POPT_AUTOHELP
    #define POPT_BADOPTION_NOALIAS (1 << 0) /*!< don't go into an alias */
    #define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND)
    #define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR)
    #define POPT_CBFLAG_CONTINUE 0x08000000 /*!< continue callbacks with option */
    #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_CBFLAG_SKIPOPTION 0x10000000 /*!< don't callback with option */
    #define POPT_CONTEXT_ARG_OPTS (1 << 4) /*!< return args as options with value 0 */
    #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_BADNUMBER -17     /*!< invalid numeric value */
    #define POPT_ERROR_BADOPERATION -19  /*!< mutually exclusive logical operations requested */
    #define POPT_ERROR_BADOPT -11        /*!< unknown option */
    #define POPT_ERROR_BADQUOTE -15      /*!< error in paramter quoting */
    #define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */
    #define POPT_ERROR_MALLOC -21        /*!< memory allocation failed */
    #define POPT_ERROR_NOARG -10 /*!< missing argument */
    #define POPT_ERROR_NOCONTEXT -22     /*!< no context */
    #define POPT_ERROR_NULLARG -20       /*!< opt->arg should not be NULL */
    #define POPT_ERROR_OPTSTOODEEP -13   /*!< aliases nested too deeply */
    #define POPT_ERROR_OVERFLOW -18      /*!< number too large or too small */
    #define POPT_OPTION_DEPTH 10
    #define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL }
    Typedef Documentation
    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 poptItem_s * poptItem
    typedef struct poptOption* poptOption
    Enumeration Type Documentation
    enum poptCallbackReason
    Function Documentation
    int poptAddAlias (poptContext con, struct poptAlias alias, int flags)
    int poptAddItem (poptContext con, poptItem newItem, int flags)
    const char* poptBadOption (poptContext con, int flags)
    int poptDupArgv (int argc, const char ** argv, int * argcPtr, const char *** argvPtr)
    poptContext poptFreeContext (poptContext con)
    const char* poptGetArg (poptContext con)
    const char** poptGetArgs (poptContext con)
    poptContext poptGetContext (const char * name, int argc, const char ** argv, const struct poptOption * options, int flags)
    const char* poptGetInvocationName (poptContext con)
    int poptGetNextOpt (poptContext con)
    const char* poptGetOptArg (poptContext con)
    int poptParseArgvString (const char * s, int * argcPtr, const char *** argvPtr)
    const char* poptPeekArg (poptContext con)
    void poptPrintHelp (poptContext con, FILE * fp, int flags)
    void poptPrintUsage (poptContext con, FILE * fp, int flags)
    int poptReadConfigFile (poptContext con, const char * fn)
    int poptReadDefaultConfig (poptContext con, int useEnv)
    void poptResetContext (poptContext con)
    void poptSetExecPath (poptContext con, const char * path, int allowAbsolute)
    void poptSetOtherOptionHelp (poptContext con, const char * text)
    const char* const poptStrerror (const int error)
    int poptStrippedArgv (poptContext con, int argc, char ** argv)
    int poptStuffArgs (poptContext con, const char ** argv)
    Variable Documentation
    struct poptOption poptAliasOptions[]
    struct poptOption poptHelpOptions[]
    Author


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру