~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to include/iprt/getopt.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 * @{
38
38
 */
39
39
 
40
 
/** @name RTGETOPTDEF::fFlags
 
40
/** @name Values for RTGETOPTDEF::fFlags and the fFlags parameter of
 
41
 *        RTGetOptFetchValue.
41
42
 *
42
43
 * @remarks When neither of the RTGETOPT_FLAG_HEX, RTGETOPT_FLAG_OCT and RTGETOPT_FLAG_DEC
43
44
 *          flags are specified with a integer value format, RTGetOpt will default to
223
224
 *                      options are understood by the program.
224
225
 * @param   cOptions    Number of array items passed in with paOptions.
225
226
 * @param   iFirst      The argument to start with (in argv).
226
 
 * @param   fFlags      The flags. MBZ for now.
 
227
 * @param   fFlags      The flags, see RTGETOPTINIT_FLAGS_XXX.
227
228
 */
228
229
RTDECL(int) RTGetOptInit(PRTGETOPTSTATE pState, int argc, char **argv,
229
230
                         PCRTGETOPTDEF paOptions, size_t cOptions,
245
246
 * argument formats, if desired.
246
247
 *
247
248
 * This is to be called in a loop until it returns 0 (meaning that all options
248
 
 * were parsed) or a negative value (meaning that an error occured). How non-option
 
249
 * were parsed) or a negative value (meaning that an error occurred). How non-option
249
250
 * arguments are dealt with depends on the flags passed to RTGetOptInit. The default
250
251
 * (fFlags = 0) is to return VINF_GETOPT_NOT_OPTION with pValueUnion->psz pointing to
251
252
 * the argument string.
261
262
 * @code
262
263
int main(int argc, char **argv)
263
264
{
264
 
     RTR3Init();
 
265
     int rc = RTR3Init();
 
266
     if (RT_FAILURE(rc))
 
267
         return RTMsgInitFailure(rc);
265
268
 
266
269
     static const RTGETOPTDEF s_aOptions[] =
267
270
     {
300
303
         }
301
304
     }
302
305
 
303
 
     return 0;
 
306
     return RTEXITCODE_SUCCESS;
304
307
}
305
308
   @endcode
306
309
 *
346
349
 *                      points to erroneous parameter; otherwise, for options
347
350
 *                      that require an argument, this contains the value of
348
351
 *                      that argument, depending on the type that is required.
349
 
 * @param   fFlags      The flags.
 
352
 * @param   fFlags      What to get, that is RTGETOPT_REQ_XXX.
350
353
 */
351
354
RTDECL(int) RTGetOptFetchValue(PRTGETOPTSTATE pState, PRTGETOPTUNION pValueUnion, uint32_t fFlags);
352
355