MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / parse_options

Function parse_options

ffmpeg-single-cmd/src/main/cpp/cmdutils.c:383–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
384 void (*parse_arg_function)(void *, const char*))
385{
386 const char *opt;
387 int optindex, handleoptions = 1, ret;
388
389 /* perform system-dependent conversions for arguments list */
390 prepare_app_arguments(&argc, &argv);
391
392 /* parse options */
393 optindex = 1;
394 while (optindex < argc) {
395 opt = argv[optindex++];
396
397 if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
398 if (opt[1] == '-' && opt[2] == '\0') {
399 handleoptions = 0;
400 continue;
401 }
402 opt++;
403
404 if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0)
405 exit_program(1);
406 optindex += ret;
407 } else {
408 if (parse_arg_function)
409 parse_arg_function(optctx, opt);
410 }
411 }
412}
413
414int parse_optgroup(void *optctx, OptionGroup *g)
415{

Callers

nothing calls this directly

Calls 3

prepare_app_argumentsFunction · 0.85
parse_optionFunction · 0.85
exit_programFunction · 0.85

Tested by

no test coverage detected