VirtualBox

Ignore:
Timestamp:
Feb 24, 2009 7:55:23 PM (16 years ago)
Author:
vboxsync
Message:

RTGetOpt interface changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r13837 r17091  
    5353     * Parse args
    5454     */
    55     static const RTOPTIONDEF g_aOptions[] =
     55    static const RTGETOPTDEF g_aOptions[] =
    5656    {
    5757        { "--interations",      'i', RTGETOPT_REQ_INT32 },
     
    6565    bool fSpin = false;
    6666    int ch;
    67     int iArg = 1;
    68     RTOPTIONUNION ValueUnion;
    69     while ((ch = RTGetOpt(argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), &iArg, &ValueUnion)))
     67    RTGETOPTUNION ValueUnion;
     68    RTGETOPTSTATE GetState;
     69    RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /* fFlags */);
     70    while ((ch = RTGetOpt(&GetState, &ValueUnion)))
    7071    {
    7172        switch (ch)
     
    8788                break;
    8889
     90            case VINF_GETOPT_NOT_OPTION:
     91                RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz);
     92                return 1;
     93
    8994            default:
    9095                if (ch < 0)
     
    9499                return 1;
    95100        }
    96     }
    97     if (iArg < argc)
    98     {
    99         RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz);
    100         return 1;
    101101    }
    102102
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