Minor cleanup/robustification to config parsing.
This commit is contained in:
parent
f6a983533b
commit
90eb22656c
|
@ -131,9 +131,9 @@ static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
|
||||||
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
|
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
|
||||||
static Bool addDefaultModes(MonPtr monitorp);
|
static Bool addDefaultModes(MonPtr monitorp);
|
||||||
#ifdef XF86DRI
|
#ifdef XF86DRI
|
||||||
static Bool configDRI(XF86ConfDRIPtr drip);
|
static void configDRI(XF86ConfDRIPtr drip);
|
||||||
#endif
|
#endif
|
||||||
static Bool configExtensions(XF86ConfExtensionsPtr conf_ext);
|
static void configExtensions(XF86ConfExtensionsPtr conf_ext);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xf86GetPathElem --
|
* xf86GetPathElem --
|
||||||
|
@ -598,7 +598,7 @@ xf86ConfigError(char *msg, ...)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static void
|
||||||
configFiles(XF86ConfFilesPtr fileconf)
|
configFiles(XF86ConfFilesPtr fileconf)
|
||||||
{
|
{
|
||||||
MessageType pathFrom = X_DEFAULT;
|
MessageType pathFrom = X_DEFAULT;
|
||||||
|
@ -2228,7 +2228,7 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XF86DRI
|
#ifdef XF86DRI
|
||||||
static Bool
|
static void
|
||||||
configDRI(XF86ConfDRIPtr drip)
|
configDRI(XF86ConfDRIPtr drip)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -2269,12 +2269,10 @@ configDRI(XF86ConfDRIPtr drip)
|
||||||
xf86ConfigDRI.bufs[i].flags = 0;
|
xf86ConfigDRI.bufs[i].flags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Bool
|
static void
|
||||||
configExtensions(XF86ConfExtensionsPtr conf_ext)
|
configExtensions(XF86ConfExtensionsPtr conf_ext)
|
||||||
{
|
{
|
||||||
XF86OptionPtr o;
|
XF86OptionPtr o;
|
||||||
|
@ -2309,11 +2307,9 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
|
||||||
xf86NameCmp(val, "false") == 0) {
|
xf86NameCmp(val, "false") == 0) {
|
||||||
enable = !enable;
|
enable = !enable;
|
||||||
} else {
|
} else {
|
||||||
xf86Msg(X_ERROR,
|
xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val);
|
||||||
"%s is not a valid value for the Extension option\n",
|
|
||||||
val);
|
|
||||||
xfree(n);
|
xfree(n);
|
||||||
return FALSE;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EnableDisableExtension(name, enable)) {
|
if (EnableDisableExtension(name, enable)) {
|
||||||
|
@ -2326,8 +2322,6 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
|
||||||
xfree(n);
|
xfree(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -2510,19 +2504,17 @@ xf86HandleConfigFile(Bool autoconfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now process everything else */
|
/* Now process everything else */
|
||||||
|
if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){
|
||||||
if (!configServerFlags(xf86configptr->conf_flags,
|
|
||||||
xf86ConfigLayout.options) ||
|
|
||||||
!configFiles(xf86configptr->conf_files) ||
|
|
||||||
!configExtensions(xf86configptr->conf_extensions)
|
|
||||||
#ifdef XF86DRI
|
|
||||||
|| !configDRI(xf86configptr->conf_dri)
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
ErrorF ("Problem when converting the config data structures\n");
|
ErrorF ("Problem when converting the config data structures\n");
|
||||||
return CONFIG_PARSE_ERROR;
|
return CONFIG_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configFiles(xf86configptr->conf_files);
|
||||||
|
configExtensions(xf86configptr->conf_extensions);
|
||||||
|
#ifdef XF86DRI
|
||||||
|
configDRI(xf86configptr->conf_dri);
|
||||||
|
#endif
|
||||||
|
|
||||||
checkInput(&xf86ConfigLayout);
|
checkInput(&xf86ConfigLayout);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user