aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Option.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-14 21:29:32 +0000
committermarha <marha@users.sourceforge.net>2010-11-14 21:29:32 +0000
commit3425b16d521b8846b95df2b7d32a548d93341f3b (patch)
treefa430e95285d90f990b2d5574dad1e409ba5980c /xorg-server/hw/xfree86/common/xf86Option.c
parent41c64098a90b4e974d5005a1619472f2e8a64ea1 (diff)
downloadvcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.tar.gz
vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.tar.bz2
vcxsrv-3425b16d521b8846b95df2b7d32a548d93341f3b.zip
xserver pixman libX11 libXext 14/11/2010
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Option.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Option.c61
1 files changed, 23 insertions, 38 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c
index 8dce3ad0f..97deb1436 100644
--- a/xorg-server/hw/xfree86/common/xf86Option.c
+++ b/xorg-server/hw/xfree86/common/xf86Option.c
@@ -118,58 +118,43 @@ xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts)
}
/*
- * xf86CollectInputOptions collects the options for an InputDevice.
- * This function requires that the following has been initialised:
- *
- * pInfo->conf_idev
- *
- * The extraOpts parameter may optionally contain a list of additional options
- * to include.
- *
- * The order of precedence for options is:
- *
- * extraOpts, pInfo->conf_idev->extraOptions,
- * pInfo->conf_idev->commonOptions, defaultOpts
+ * xf86CollectInputOptions collects extra options for an InputDevice (other
+ * than those added by the config backend).
+ * The options are merged into the existing ones and thus take precedence
+ * over the others.
*/
void
-xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts)
+xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts)
{
- XF86OptionPtr tmp;
- XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
-
- pInfo->options = NULL;
if (defaultOpts) {
- pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0);
- }
- if (pInfo->conf_idev && pInfo->conf_idev->commonOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->commonOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (pInfo->conf_idev && pInfo->conf_idev->extraOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->extraOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (extras) {
- tmp = xf86optionListDup(extras);
+ XF86OptionPtr tmp =xf86optionListCreate(defaultOpts, -1, 0);
if (pInfo->options)
pInfo->options = xf86optionListMerge(pInfo->options, tmp);
else
pInfo->options = tmp;
}
+}
- if (pInfo->conf_idev && pInfo->conf_idev->attrs) {
- pInfo->attrs = pInfo->conf_idev->attrs;
+/**
+ * Duplicate the option list passed in. The returned pointer will be a newly
+ * allocated option list and must be freed by the caller.
+ */
+pointer
+xf86OptionListDuplicate(pointer options)
+{
+ pointer o = NULL;
+
+ while (options)
+ {
+ o = xf86AddNewOption(o, xf86OptionName(options), xf86OptionValue(options));
+ options = xf86nextOption(options);
}
+
+ return o;
}
+
/* Created for new XInput stuff -- essentially extensions to the parser */
static int