25 * Match a possible value string with the integer option.
28 const char *ival; /* string option */
29 unsigned int oval; /* output value */
30 const char *help; /* help text for sub option */
31 int or; /* OR value */
34 #define OPT_LEN_MAX 4096
35 #define PARSE_MAX_VP 16
41 const char *name; /* option name */
42 const char *alias; /* possible old allowed name */
43 enum fio_opt_type type; /* option type */
44 unsigned int off1; /* potential parameters */
48 void *roff1, *roff2, *roff3, *roff4;
49 unsigned int maxval; /* max and min value */
51 double maxfp; /* max and min floating value */
53 unsigned int maxlen; /* max length */
54 int neg; /* negate value stored */
56 void *cb; /* callback */
57 const char *help; /* help text for option */
58 const char *def; /* default setting */
59 struct value_pair posval[PARSE_MAX_VP];/* possible values */
60 const char *parent; /* parent option */
61 int (*verify)(struct fio_option *, void *);
62 const char *prof_name; /* only valid for specific profile */
65 typedef int (str_cb_fn)(void *, char *);
67 extern int parse_option(const char *, struct fio_option *, void *);
68 extern void sort_options(char **, struct fio_option *, int);
69 extern int parse_cmd_option(const char *t, const char *l, struct fio_option *, void *);
70 extern int show_cmd_help(struct fio_option *, const char *);
71 extern void fill_default_options(void *, struct fio_option *);
72 extern void option_init(struct fio_option *);
73 extern void options_init(struct fio_option *);
75 extern void strip_blank_front(char **);
76 extern void strip_blank_end(char *);
77 extern int str_to_decimal(const char *, long long *, int, void *);
80 * Handlers for the options
82 typedef int (fio_opt_str_fn)(void *, const char *);
83 typedef int (fio_opt_str_val_fn)(void *, long long *);
84 typedef int (fio_opt_int_fn)(void *, int *);
85 typedef int (fio_opt_str_set_fn)(void *);
87 #define td_var(start, offset) ((void *) start + (offset))
90 #define min(a, b) ((a) < (b) ? (a) : (b))
93 #define max(a, b) ((a) > (b) ? (a) : (b))
96 static inline int parse_is_percent(unsigned long long val)
98 return val <= -1ULL && val >= (-1ULL - 100ULL);