diff options
Diffstat (limited to 'src/progs/ingen/cmdline.c')
-rw-r--r-- | src/progs/ingen/cmdline.c | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/src/progs/ingen/cmdline.c b/src/progs/ingen/cmdline.c index 462c6a3e..a293d127 100644 --- a/src/progs/ingen/cmdline.c +++ b/src/progs/ingen/cmdline.c @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt version 2.20 + File autogenerated by gengetopt generated with the following command: - gengetopt + gengetopt -g The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -36,8 +36,9 @@ const char *gengetopt_args_info_help[] = { " -g, --gui Launch the GTK graphical interface (default=on)", " -C, --client-port=INT Client OSC port", " -l, --load=STRING Load patch", - " -p, --path=STRING Target path for loaded patch", + " -L, --path=STRING Target path for loaded patch", " -r, --run=STRING Run script", + " -p, --parallelism=INT Number of concurrent process threads (default=`1')", 0 }; @@ -66,6 +67,7 @@ void clear_given (struct gengetopt_args_info *args_info) args_info->load_given = 0 ; args_info->path_given = 0 ; args_info->run_given = 0 ; + args_info->parallelism_given = 0 ; } static @@ -84,6 +86,8 @@ void clear_args (struct gengetopt_args_info *args_info) args_info->path_orig = NULL; args_info->run_arg = NULL; args_info->run_orig = NULL; + args_info->parallelism_arg = 1; + args_info->parallelism_orig = NULL; } @@ -100,6 +104,7 @@ void init_args_info(struct gengetopt_args_info *args_info) args_info->load_help = gengetopt_args_info_help[7] ; args_info->path_help = gengetopt_args_info_help[8] ; args_info->run_help = gengetopt_args_info_help[9] ; + args_info->parallelism_help = gengetopt_args_info_help[10] ; } @@ -189,6 +194,11 @@ cmdline_parser_release (struct gengetopt_args_info *args_info) free (args_info->run_orig); /* free previous argument */ args_info->run_orig = 0; } + if (args_info->parallelism_orig) + { + free (args_info->parallelism_orig); /* free previous argument */ + args_info->parallelism_orig = 0; + } clear_given (args_info); } @@ -261,6 +271,13 @@ cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_ fprintf(outfile, "%s\n", "run"); } } + if (args_info->parallelism_given) { + if (args_info->parallelism_orig) { + fprintf(outfile, "%s=\"%s\"\n", "parallelism", args_info->parallelism_orig); + } else { + fprintf(outfile, "%s\n", "parallelism"); + } + } fclose (outfile); @@ -351,13 +368,14 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf { "gui", 0, NULL, 'g' }, { "client-port", 1, NULL, 'C' }, { "load", 1, NULL, 'l' }, - { "path", 1, NULL, 'p' }, + { "path", 1, NULL, 'L' }, { "run", 1, NULL, 'r' }, + { "parallelism", 1, NULL, 'p' }, { NULL, 0, NULL, 0 } }; stop_char = 0; - c = getopt_long (argc, argv, "hVeE:c:gC:l:p:r:", long_options, &option_index); + c = getopt_long (argc, argv, "hVeE:c:gC:l:L:r:p:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -475,10 +493,10 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf args_info->load_orig = gengetopt_strdup (optarg); break; - case 'p': /* Target path for loaded patch. */ + case 'L': /* Target path for loaded patch. */ if (local_args_info.path_given) { - fprintf (stderr, "%s: `--path' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + fprintf (stderr, "%s: `--path' (`-L') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); goto failure; } if (args_info->path_given && ! override) @@ -511,6 +529,26 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf args_info->run_orig = gengetopt_strdup (optarg); break; + case 'p': /* Number of concurrent process threads. */ + if (local_args_info.parallelism_given) + { + fprintf (stderr, "%s: `--parallelism' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->parallelism_given && ! override) + continue; + local_args_info.parallelism_given = 1; + args_info->parallelism_given = 1; + args_info->parallelism_arg = strtol (optarg, &stop_char, 0); + if (!(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); + goto failure; + } + if (args_info->parallelism_orig) + free (args_info->parallelism_orig); /* free previous string */ + args_info->parallelism_orig = gengetopt_strdup (optarg); + break; + case 0: /* Long option with no short option */ case '?': /* Invalid option. */ |