X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=parse.h;h=68a7338e32d34ed929cb5173c18df43273e2920f;hb=731e30a2551315c609c23ac107377b63c02d51fa;hp=c5a74171ae94e70cb45339b1b22fbd387579ccf5;hpb=833491908a1afd67d27ce79257de3a4d80143d9f;p=fio.git diff --git a/parse.h b/parse.h index c5a74171..68a7338e 100644 --- a/parse.h +++ b/parse.h @@ -29,11 +29,32 @@ struct value_pair { unsigned int oval; /* output value */ const char *help; /* help text for sub option */ int or; /* OR value */ + void *cb; /* sub-option callback */ }; #define OPT_LEN_MAX 4096 #define PARSE_MAX_VP 16 +enum opt_category { + FIO_OPT_G_DESC = 1UL << 0, + FIO_OPT_G_FILE = 1UL << 1, + FIO_OPT_G_MISC = 1UL << 2, + FIO_OPT_G_IO = 1UL << 3, + FIO_OPT_G_IO_DDIR = 1UL << 4, + FIO_OPT_G_IO_BUF = 1UL << 5, + FIO_OPT_G_RAND = 1UL << 6, + FIO_OPT_G_OS = 1UL << 7, + FIO_OPT_G_MEM = 1UL << 8, + FIO_OPT_G_VERIFY = 1UL << 9, + FIO_OPT_G_CPU = 1UL << 10, + FIO_OPT_G_LOG = 1UL << 11, + FIO_OPT_G_ZONE = 1UL << 12, + FIO_OPT_G_CACHE = 1UL << 13, + FIO_OPT_G_STAT = 1UL << 14, + FIO_OPT_G_ERR = 1UL << 15, + FIO_OPT_G_JOB = 1UL << 16, +}; + /* * Option define */ @@ -60,17 +81,19 @@ struct fio_option { const char *parent; /* parent option */ int (*verify)(struct fio_option *, void *); const char *prof_name; /* only valid for specific profile */ + unsigned int category; /* for type grouping */ }; typedef int (str_cb_fn)(void *, char *); -extern int parse_option(const char *, struct fio_option *, void *); +extern int parse_option(char *, const char *, struct fio_option *, struct fio_option **, void *); extern void sort_options(char **, struct fio_option *, int); extern int parse_cmd_option(const char *t, const char *l, struct fio_option *, void *); extern int show_cmd_help(struct fio_option *, const char *); extern void fill_default_options(void *, struct fio_option *); extern void option_init(struct fio_option *); extern void options_init(struct fio_option *); +extern void options_free(struct fio_option *, void *); extern void strip_blank_front(char **); extern void strip_blank_end(char *);