diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-04 14:45:46 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-22 15:56:53 +1000 |
commit | 05284a03f9002b03a66ae355b34790ec02b726f0 (patch) | |
tree | fba09523738e384c129d455f9af9703dafbf98a2 /hw | |
parent | fcafe825751bef99f4c0b36250ca6f15f127502f (diff) |
input: make InputOption opaque, provide interface functions.
InputOptions is not switched to use struct list for a future patch to unify
it with the XF86OptionRec.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 83d5caedf..e25115c9a 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -879,35 +879,35 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, if (!pInfo) return BadAlloc; - for (option = options; option; option = option->next) { - if (strcasecmp(option->key, "driver") == 0) { + nt_list_for_each_entry(option, options, next) { + if (strcasecmp(input_option_get_key(option), "driver") == 0) { if (pInfo->driver) { rval = BadRequest; goto unwind; } - pInfo->driver = xstrdup(option->value); + pInfo->driver = xstrdup(input_option_get_value(option)); if (!pInfo->driver) { rval = BadAlloc; goto unwind; } } - if (strcasecmp(option->key, "name") == 0 || - strcasecmp(option->key, "identifier") == 0) { + if (strcasecmp(input_option_get_key(option), "name") == 0 || + strcasecmp(input_option_get_key(option), "identifier") == 0) { if (pInfo->name) { rval = BadRequest; goto unwind; } - pInfo->name = xstrdup(option->value); + pInfo->name = xstrdup(input_option_get_value(option)); if (!pInfo->name) { rval = BadAlloc; goto unwind; } } - if (strcmp(option->key, "_source") == 0 && - (strcmp(option->value, "server/hal") == 0 || - strcmp(option->value, "server/udev") == 0)) { + if (strcmp(input_option_get_key(option), "_source") == 0 && + (strcmp(input_option_get_value(option), "server/hal") == 0 || + strcmp(input_option_get_value(option), "server/udev") == 0)) { is_auto = 1; if (!xf86Info.autoAddDevices) { rval = BadMatch; @@ -916,13 +916,11 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, } } - for (option = options; option; option = option->next) { - /* Steal option key/value strings from the provided list. - * We need those strings, the InputOption list doesn't. */ - pInfo->options = xf86addNewOption(pInfo->options, - option->key, option->value); - option->key = NULL; - option->value = NULL; + nt_list_for_each_entry(option, options, next) { + /* Copy option key/value strings from the provided list */ + pInfo->options = xf86AddNewOption(pInfo->options, + input_option_get_key(option), + input_option_get_value(option)); } /* Apply InputClass settings */ |