projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add example network io job file
[fio.git]
/
parse.h
diff --git
a/parse.h
b/parse.h
index 4ddb76a6335d6af7834e1209b8517fb125f01d6d..1a71864fa12157715cdb2fd03567a5f1eb0808bc 100644
(file)
--- a/
parse.h
+++ b/
parse.h
@@
-16,6
+16,16
@@
enum fio_opt_type {
FIO_OPT_STR_SET,
};
FIO_OPT_STR_SET,
};
+/*
+ * Match a possible value string with the integer option.
+ */
+struct value_pair {
+ const char *ival; /* string option */
+ unsigned int oval; /* output value */
+};
+
+#define PARSE_MAX_VP 16
+
/*
* Option define
*/
/*
* Option define
*/
@@
-29,10
+39,11
@@
struct fio_option {
unsigned int off4;
unsigned int maxval; /* max and min value */
int minval;
unsigned int off4;
unsigned int maxval; /* max and min value */
int minval;
+ int neg; /* negate value stored */
void *cb; /* callback */
const char *help; /* help text for option */
const char *def; /* default setting */
void *cb; /* callback */
const char *help; /* help text for option */
const char *def; /* default setting */
- const
char *posval[16];
/* possible values */
+ const
struct value_pair posval[PARSE_MAX_VP];
/* possible values */
};
typedef int (str_cb_fn)(void *, char *);
};
typedef int (str_cb_fn)(void *, char *);
@@
-56,4
+67,11
@@
typedef int (fio_opt_str_set_fn)(void *);
#define td_var(start, offset) ((void *) start + (offset))
#define td_var(start, offset) ((void *) start + (offset))
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
#endif
#endif