22 * Match a possible value string with the integer option.
25 const char *ival; /* string option */
26 unsigned int oval; /* output value */
27 const char *help; /* help text for sub option */
30 #define OPT_LEN_MAX 4096
31 #define PARSE_MAX_VP 16
37 const char *name; /* option name */
38 const char *alias; /* possible old allowed name */
39 enum fio_opt_type type; /* option type */
40 unsigned int off1; /* potential parameters */
44 void *roff1, *roff2, *roff3, *roff4;
45 unsigned int maxval; /* max and min value */
47 int neg; /* negate value stored */
49 void *cb; /* callback */
50 const char *help; /* help text for option */
51 const char *def; /* default setting */
52 const struct value_pair posval[PARSE_MAX_VP];/* possible values */
53 const char *parent; /* parent option */
54 int (*verify)(struct fio_option *, void *);
57 typedef int (str_cb_fn)(void *, char *);
59 extern int parse_option(const char *, struct fio_option *, struct flist_head *, void *);
60 extern void sort_options(char **, struct fio_option *, int);
61 extern int parse_cmd_option(const char *t, const char *l, struct fio_option *, struct flist_head *, void *);
62 extern int show_cmd_help(struct fio_option *, struct flist_head *, const char *);
63 extern void fill_default_options(void *, struct fio_option *);
64 extern void option_init(struct fio_option *);
65 extern void options_init(struct fio_option *);
67 extern void strip_blank_front(char **);
68 extern void strip_blank_end(char *);
69 extern int str_to_decimal(const char *, long long *, int, void *);
72 * Handlers for the options
74 typedef int (fio_opt_str_fn)(void *, const char *);
75 typedef int (fio_opt_str_val_fn)(void *, long long *);
76 typedef int (fio_opt_int_fn)(void *, int *);
77 typedef int (fio_opt_str_set_fn)(void *);
79 #define td_var(start, offset) ((void *) start + (offset))
82 #define min(a, b) ((a) < (b) ? (a) : (b))
85 #define max(a, b) ((a) > (b) ? (a) : (b))