VirtualBox

Ignore:
Timestamp:
Feb 24, 2009 7:55:23 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43321
Message:

RTGetOpt interface changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp

    r14303 r17091  
    263263     */
    264264    bool fVerbose = false;
    265     static const RTOPTIONDEF s_aOptions[] =
     265    static const RTGETOPTDEF s_aOptions[] =
    266266    {
    267267        { "--verbose", 'v', RTGETOPT_REQ_NOTHING }
    268268    };
    269     int iArg = 0;
    270269    int ch;
    271     RTOPTIONUNION Value;
    272     while ((ch = RTGetOpt(argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), &iArg, &Value)))
     270    RTGETOPTUNION Value;
     271    RTGETOPTSTATE GetState;
     272    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /* fFlags*/);
     273    while ((ch = RTGetOpt(&GetState, &Value)))
    273274        switch (ch)
    274275        {
    275             case 'v':   fVerbose = true;  break;
    276             default:    return supSvcDisplayGetOptError("delete", ch, argc, argv, iArg, &Value);
    277         }
    278     if (iArg != argc)
    279         return supSvcDisplayTooManyArgsError("delete", argc, argv, iArg);
     276            case 'v':
     277                fVerbose = true;
     278                break;
     279            case VINF_GETOPT_NOT_OPTION:
     280                return supSvcDisplayTooManyArgsError("delete", argc, argv, iArg);
     281            default:
     282                return supSvcDisplayGetOptError("delete", ch, argc, argv, iArg, &Value);
     283        }
    280284
    281285    /*
     
    328332    int iArg = 0;
    329333    int ch;
    330     RTOPTIONUNION Value;
     334    RTGETOPTUNION Value;
    331335    while ((ch = RTGetOpt(argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), &iArg, &Value)))
    332336        switch (ch)
     
    548552            int ch;
    549553            int rc = 0;
    550             RTOPTIONUNION Value;
     554            RTGETOPTUNION Value;
    551555            while (   !rc
    552556                   && (ch = RTGetOpt(cArgs, papszArgs, s_aOptions, RT_ELEMENTS(s_aOptions), &iArg, &Value)))
     
    646650    int iArg = 0;
    647651    int ch;
    648     RTOPTIONUNION Value;
     652    RTGETOPTUNION Value;
    649653    while ((ch = RTGetOpt(argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), &iArg, &Value)))
    650654        switch (ch)
     
    701705    int iArg = 0;
    702706    int ch;
    703     RTOPTIONUNION Value;
     707    RTGETOPTUNION Value;
    704708    while ((ch = RTGetOpt(argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), &iArg, &Value)))
    705709        switch (ch)
Note: See TracChangeset for help on using the changeset viewer.

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