MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / parse_options

Function parse_options

fftools/cmdutils.c:420–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420int parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
421 int (*parse_arg_function)(void *, const char*))
422{
423 const char *opt;
424 int optindex, handleoptions = 1, ret;
425
426 /* perform system-dependent conversions for arguments list */
427 prepare_app_arguments(&argc, &argv);
428
429 /* parse options */
430 optindex = 1;
431 while (optindex < argc) {
432 opt = argv[optindex++];
433
434 if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
435 if (opt[1] == '-' && opt[2] == '\0') {
436 handleoptions = 0;
437 continue;
438 }
439 opt++;
440
441 if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0)
442 return ret;
443 optindex += ret;
444 } else {
445 if (parse_arg_function) {
446 ret = parse_arg_function(optctx, opt);
447 if (ret < 0)
448 return ret;
449 }
450 }
451 }
452
453 return 0;
454}
455
456int parse_optgroup(void *optctx, OptionGroup *g, const OptionDef *defs)
457{

Callers 2

mainFunction · 0.70
mainFunction · 0.70

Calls 2

prepare_app_argumentsFunction · 0.85
parse_optionFunction · 0.85

Tested by

no test coverage detected