VirtualBox

Changeset 23644 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Oct 9, 2009 12:28:56 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53343
Message:

Runtime: Added indexed options to RTGetOpt (eg: "--strwithindex14 value")

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r23625 r23644  
    11461146/** @name RTGetOpt status codes
    11471147 * @{ */
    1148 /** RTGetOpt: command line option not recognized. */
     1148/** RTGetOpt: Command line option not recognized. */
    11491149#define VERR_GETOPT_UNKNOWN_OPTION              (-825)
    1150 /** RTGetOpt: command line option needs argument. */
     1150/** RTGetOpt: Command line option needs argument. */
    11511151#define VERR_GETOPT_REQUIRED_ARGUMENT_MISSING   (-826)
    1152 /** RTGetOpt: command line option has argument with bad format. */
     1152/** RTGetOpt: Command line option has argument with bad format. */
    11531153#define VERR_GETOPT_INVALID_ARGUMENT_FORMAT     (-827)
    11541154/** RTGetOpt: Not an option. */
    11551155#define VINF_GETOPT_NOT_OPTION                  828
     1156/** RTGetOpt: Command line option needs an index. */
     1157#define VERR_GETOPT_INDEX_MISSING               (-829)
    11561158/** @} */
    11571159
  • trunk/include/iprt/getopt.h

    r20809 r23644  
    9292/** Treat the value as decimal - only applicable with the RTGETOPT_REQ_*INT*. */
    9393#define RTGETOPT_FLAG_DEC                       RT_BIT(18)
     94/** The index value is attached to the argument - only valid for long arguments. */
     95#define RTGETOPT_FLAG_INDEX                     RT_BIT(19)
    9496/** Mask of valid bits - for validation. */
    95 #define RTGETOPT_VALID_MASK                     ( RTGETOPT_REQ_MASK | RTGETOPT_FLAG_HEX | RTGETOPT_FLAG_OCT | RTGETOPT_FLAG_DEC )
     97#define RTGETOPT_VALID_MASK                     (  RTGETOPT_REQ_MASK \
     98                                                 | RTGETOPT_FLAG_HEX \
     99                                                 | RTGETOPT_FLAG_OCT \
     100                                                 | RTGETOPT_FLAG_DEC \
     101                                                 | RTGETOPT_FLAG_INDEX)
    96102/** @} */
    97103
     
    193199    /** The option definition which matched. NULL otherwise. */
    194200    PCRTGETOPTDEF   pDef;
     201    /** The index of an index option, otherwise UINT64_MAX. */
     202    uint64_t        uIndex;
    195203    /* More members will be added later for dealing with initial
    196204       call, optional sorting, '--' and so on. */
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