24 * Match a possible value string with the integer option.
27 const char *ival; /* string option */
28 unsigned int oval; /* output value */
29 const char *help; /* help text for sub option */
30 int or; /* OR value */
33 #define OPT_LEN_MAX 4096
34 #define PARSE_MAX_VP 16
40 const char *name; /* option name */
41 const char *alias; /* possible old allowed name */
42 enum fio_opt_type type; /* option type */
43 unsigned int off1; /* potential parameters */
47 void *roff1, *roff2, *roff3, *roff4;
48 unsigned int maxval; /* max and min value */
50 int neg; /* negate value stored */
52 void *cb; /* callback */
53 const char *help; /* help text for option */
54 const char *def; /* default setting */
55 struct value_pair posval[PARSE_MAX_VP];/* possible values */
56 const char *parent; /* parent option */
57 int (*verify)(struct fio_option *, void *);
58 const char *prof_name; /* only valid for specific profile */
61 typedef int (str_cb_fn)(void *, char *);
63 extern int parse_option(const char *, struct fio_option *, void *);
64 extern void sort_options(char **, struct fio_option *, int);
65 extern int parse_cmd_option(const char *t, const char *l, struct fio_option *, void *);
66 extern int show_cmd_help(struct fio_option *, const char *);
67 extern void fill_default_options(void *, struct fio_option *);
68 extern void option_init(struct fio_option *);
69 extern void options_init(struct fio_option *);
71 extern void strip_blank_front(char **);
72 extern void strip_blank_end(char *);
73 extern int str_to_decimal(const char *, long long *, int, void *);
76 * Handlers for the options
78 typedef int (fio_opt_str_fn)(void *, const char *);
79 typedef int (fio_opt_str_val_fn)(void *, long long *);
80 typedef int (fio_opt_int_fn)(void *, int *);
81 typedef int (fio_opt_str_set_fn)(void *);
83 #define td_var(start, offset) ((void *) start + (offset))
86 #define min(a, b) ((a) < (b) ? (a) : (b))
89 #define max(a, b) ((a) > (b) ? (a) : (b))