Add verify hook to options
This allows us to individually verify options, instead of having
a big function that attempts to fix things up.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c
index 1b38db5..5043374 100644
--- a/parse.c
+++ b/parse.c
@@ -428,6 +428,12 @@
ret = 1;
}
+ if (ret)
+ return ret;
+
+ if (o->verify)
+ ret = o->verify(o, data);
+
return ret;
}
diff --git a/parse.h b/parse.h
index 0cdc089..677b62b 100644
--- a/parse.h
+++ b/parse.h
@@ -48,6 +48,7 @@
const char *def; /* default setting */
const struct value_pair posval[PARSE_MAX_VP];/* possible values */
const char *parent; /* parent option */
+ int (*verify)(struct fio_option *, void *);
};
typedef int (str_cb_fn)(void *, char *);