perflab added

This commit is contained in:
2025-04-12 10:18:45 +08:00
parent a04c35be04
commit 4ea99d81a7
51 changed files with 350295 additions and 0 deletions

28
profile/options.h Normal file
View File

@ -0,0 +1,28 @@
/*
* Code to process options from
* command line arguments. Arguments can be integers,
* floats, or strings. Allow prefix of argument name, as long as
* unambigous. Also support printing of usage information.
*/
#include <stdio.h>
void add_int_option(char *name, int *var);
void add_double_option(char *name, double *var);
void add_string_option(char *name, char **var);
/* Print usage information and exit */
void usage(char *prog);
/*
* Parse option from arguments. Print error message & exit if any problems
* If otherargs nonnull, fill it with any nonoption arguments.
* Return number of such arguments.
*/
int parse_options(int argc, char *argv[], char *otherargs[]);
/* Parse options from file */
void parse_option_file(char *prog, FILE *option_file);
/* Show which options are in effect */
void show_options(FILE *outfile);