ioengines: don't call zbd_put_io_u() for engines not implementing commit
[fio.git] / options.h
... / ...
CommitLineData
1#ifndef FIO_OPTION_H
2#define FIO_OPTION_H
3
4#define FIO_MAX_OPTS 512
5
6#include <string.h>
7#include <inttypes.h>
8#include "parse.h"
9#include "lib/types.h"
10
11int add_option(const struct fio_option *);
12void invalidate_profile_options(const char *);
13extern char *exec_profile;
14
15void add_opt_posval(const char *, const char *, const char *);
16void del_opt_posval(const char *, const char *);
17struct thread_data;
18void fio_options_free(struct thread_data *);
19void fio_dump_options_free(struct thread_data *);
20char *get_next_str(char **ptr);
21int get_max_str_idx(char *input);
22char* get_name_by_idx(char *input, int index);
23int set_name_idx(char *, size_t, char *, int, bool);
24
25extern char client_sockaddr_str[]; /* used with --client option */
26
27extern struct fio_option fio_options[FIO_MAX_OPTS];
28
29extern bool __fio_option_is_set(struct thread_options *, unsigned int off);
30
31#define fio_option_is_set(__td, name) \
32({ \
33 const unsigned int off = offsetof(struct thread_options, name); \
34 bool __r = __fio_option_is_set((__td), off); \
35 __r; \
36})
37
38extern void fio_option_mark_set(struct thread_options *,
39 const struct fio_option *);
40
41static inline bool o_match(const struct fio_option *o, const char *opt)
42{
43 if (!strcmp(o->name, opt))
44 return true;
45 else if (o->alias && !strcmp(o->alias, opt))
46 return true;
47
48 return false;
49}
50
51extern struct fio_option *find_option(struct fio_option *, const char *);
52extern const struct fio_option *
53find_option_c(const struct fio_option *, const char *);
54extern struct fio_option *fio_option_find(const char *);
55extern unsigned int fio_get_kb_base(void *);
56
57#endif