[PATCH] Add full command line parameter support
[fio.git] / parse.h
CommitLineData
e1f36503
JA
1#ifndef FIO_PARSE_H
2#define FIO_PARSE_H
3
4/*
5 * Option types
6 */
7enum fio_opt_type {
8 FIO_OPT_STR = 0,
9 FIO_OPT_STR_VAL,
10 FIO_OPT_STR_VAL_TIME,
11 FIO_OPT_STR_STORE,
12 FIO_OPT_RANGE,
13 FIO_OPT_INT,
14 FIO_OPT_STR_SET,
15};
16
17/*
18 * Option define
19 */
20struct fio_option {
21 char *name;
22 enum fio_opt_type type;
23 unsigned int off1;
24 unsigned int off2;
25 unsigned int max_val;
26 void *cb;
27};
28
29typedef int (str_cb_fn)(void *, char *);
30
31extern int parse_option(const char *, struct fio_option *, void *);
b4692828 32extern int parse_cmd_option(const char *t, const char *l, struct fio_option *, void *);
e1f36503
JA
33
34extern void strip_blank_front(char **);
35extern void strip_blank_end(char *);
36
37/*
38 * Handlers for the options
39 */
b4692828 40typedef int (fio_opt_str_fn)(void *, const char *);
e1f36503
JA
41typedef int (fio_opt_str_val_fn)(void *, unsigned long long *);
42typedef int (fio_opt_int_fn)(void *, unsigned int *);
43typedef int (fio_opt_str_set_fn)(void *);
44
45#define td_var(start, offset) ((void *) start + (offset))
46
47#endif