X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.h;h=c3b66d75be34216ff1f3df33b85db9d7779ef6c6;hp=7374c258ab95a339cff8853707a567df2ad68422;hb=64d04e4ee255be69b491907cdba183e6b09e9164;hpb=76a43db448f9fd5e9f1397428a433466d98e0d5d diff --git a/parse.h b/parse.h index 7374c258..c3b66d75 100644 --- a/parse.h +++ b/parse.h @@ -16,6 +16,17 @@ enum fio_opt_type { FIO_OPT_STR_SET, }; +/* + * Match a possible value string with the integer option. + */ +struct value_pair { + const char *ival; /* string option */ + unsigned int oval; /* output value */ + const char *help; /* help text for sub option */ +}; + +#define PARSE_MAX_VP 16 + /* * Option define */ @@ -33,7 +44,8 @@ struct fio_option { void *cb; /* callback */ const char *help; /* help text for option */ const char *def; /* default setting */ - const char *posval[16]; /* possible values */ + const struct value_pair posval[PARSE_MAX_VP];/* possible values */ + const char *parent; /* parent option */ }; typedef int (str_cb_fn)(void *, char *); @@ -57,4 +69,11 @@ typedef int (fio_opt_str_set_fn)(void *); #define td_var(start, offset) ((void *) start + (offset)) +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef max +#define max(a, b) ((a) > (b) ? (a) : (b)) +#endif + #endif