lib: Add a user data pointer to the argument parsing functions

It can be useful to have one of those to carry state between the handler
parsing the options and the rest of the test. Right now the only thing
we can do is to use global variables for that.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
Damien Lespiau
2015-05-14 14:19:01 +01:00
parent 7a5e1c6f0a
commit fd6846c99f
9 changed files with 39 additions and 27 deletions
+2 -2
View File
@@ -434,7 +434,7 @@ static void background_run_once(void)
sleep(3);
}
static int parse_options(int opt, int opt_index)
static int parse_options(int opt, int opt_index, void *data)
{
switch(opt) {
case 'b':
@@ -504,7 +504,7 @@ int main(int argc, char **argv)
options.buffers = 10;
igt_simple_init_parse_opts(&argc, argv, "n:bvt:dp:ri:", long_options,
help, parse_options);
help, parse_options, NULL);
card_index = drm_get_card();