mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 13:23:02 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user