VirtualBox

Changeset 17094 in vbox


Ignore:
Timestamp:
Feb 24, 2009 8:08:18 PM (16 years ago)
Author:
vboxsync
Message:

RTGetOpt docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/getopt.h

    r17092 r17094  
    197197                         int iFirst, uint32_t fFlags);
    198198
    199 /*
     199/**
    200200 * Command line argument parser, handling both long and short options and checking
    201201 * argument formats, if desired.
    202202 *
    203203 * This is to be called in a loop until it returns 0 (meaning that all options
    204  * were parsed) or a negative value (meaning that an error occured). The passed in
    205  * argument vector is sorted into options and non-option arguments, such that when
    206  * returning 0 the *piThis is the index of the first non-option argument.
     204 * were parsed) or a negative value (meaning that an error occured). How non-option
     205 * arguments are dealt with depends on the flags passed to RTGetOptInit. The default
     206 * (fFlags = 0) is to return VINF_GETOPT_NOT_OPTION with pValueUnion->psz pointing to
     207 * the argument string.
    207208 *
    208209 * For example, for a program which takes the following options:
     
    265266 * @endcode
    266267 *
    267  * @param pState        The state previously initialized with RTGetOptInit.
    268  * @param pValueUnion   Union with value; in the event of an error, psz member
     268 * @returns 0 when done parsing.
     269 * @returns IPRT error status on parse error.
     270 * @returns VINF_GETOPT_NOT_OPTION when encountering a non-option argument and
     271 *          RTGETOPT_FLAG_SORT was not specified. pValueUnion->psz points to the
     272 *          argument string.
     273 * @returns VERR_GETOPT_UNKNOWN_OPTION when encountering an unknown option.
     274 *          pValueUnion->psz points to the option string.
     275 * @returns VERR_GETOPT_REQUIRED_ARGUMENT_MISSING and pValueUnion->pDef if
     276 *          a required argument (aka value) was missing for an option.
     277 * @returns VERR_GETOPT_INVALID_ARGUMENT_FORMAT and pValueUnion->pDef if
     278 *          argument (aka value) convertion failed.
     279 *
     280 * @param   pState      The state previously initialized with RTGetOptInit.
     281 * @param   pValueUnion Union with value; in the event of an error, psz member
    269282 *                      points to erroneous parameter; otherwise, for options
    270283 *                      that require an argument, this contains the value of
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette