Commit | Line | Data |
---|---|---|
9f988e2e JA |
1 | #ifndef FIO_OPTION_H |
2 | #define FIO_OPTION_H | |
3 | ||
07b3232d JA |
4 | #define FIO_MAX_OPTS 512 |
5 | ||
f5b6bb85 | 6 | #include <string.h> |
72f39748 | 7 | #include <inttypes.h> |
9f988e2e | 8 | #include "parse.h" |
72f39748 | 9 | #include "lib/types.h" |
9f988e2e | 10 | |
9109883a | 11 | int add_option(const struct fio_option *); |
07b3232d JA |
12 | void invalidate_profile_options(const char *); |
13 | extern char *exec_profile; | |
9f988e2e | 14 | |
f5b6bb85 JA |
15 | void add_opt_posval(const char *, const char *, const char *); |
16 | void del_opt_posval(const char *, const char *); | |
7e356b2d JA |
17 | struct thread_data; |
18 | void fio_options_free(struct thread_data *); | |
8009f543 | 19 | void fio_dump_options_free(struct thread_data *); |
532eda7e DZ |
20 | char *get_next_str(char **ptr); |
21 | int get_max_str_idx(char *input); | |
c70c7f58 | 22 | char* get_name_by_idx(char *input, int index); |
922a5be8 | 23 | int set_name_idx(char *, size_t, char *, int, bool); |
f5b6bb85 | 24 | |
e13c3b50 | 25 | extern char client_sockaddr_str[]; /* used with --client option */ |
72a703da | 26 | |
9af4a244 JA |
27 | extern struct fio_option fio_options[FIO_MAX_OPTS]; |
28 | ||
72f39748 | 29 | extern bool __fio_option_is_set(struct thread_options *, unsigned int off); |
a8523a6a | 30 | |
2243dfc7 JA |
31 | #define fio_option_is_set(__td, name) \ |
32 | ({ \ | |
a609f12a | 33 | const unsigned int off = offsetof(struct thread_options, name); \ |
72f39748 | 34 | bool __r = __fio_option_is_set((__td), off); \ |
2243dfc7 JA |
35 | __r; \ |
36 | }) | |
a8523a6a | 37 | |
9109883a BVA |
38 | extern void fio_option_mark_set(struct thread_options *, |
39 | const struct fio_option *); | |
a8523a6a | 40 | |
9109883a | 41 | static inline bool o_match(const struct fio_option *o, const char *opt) |
f5b6bb85 JA |
42 | { |
43 | if (!strcmp(o->name, opt)) | |
72f39748 | 44 | return true; |
f5b6bb85 | 45 | else if (o->alias && !strcmp(o->alias, opt)) |
72f39748 | 46 | return true; |
f5b6bb85 | 47 | |
72f39748 | 48 | return false; |
f5b6bb85 JA |
49 | } |
50 | ||
75e6bcba | 51 | extern struct fio_option *find_option(struct fio_option *, const char *); |
9109883a BVA |
52 | extern const struct fio_option * |
53 | find_option_c(const struct fio_option *, const char *); | |
75e6bcba | 54 | extern struct fio_option *fio_option_find(const char *); |
3c3ed070 | 55 | extern unsigned int fio_get_kb_base(void *); |
9af4a244 | 56 | |
9f988e2e | 57 | #endif |