/*
*
* Copyright (c) 1997 Metro Link Incorporated
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Metro Link shall not be
* used in advertising or otherwise to promote the sale, use or other dealings
* in this Software without prior written authorization from Metro Link.
*
*/
/*
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "Configint.h"
{
{SECTION, "section"},
{-1, ""},
};
/*
* xf86parseConfigFile()
*
* Parse a configuration file, appending it to the current
* configuration data.
*/
static
{
{
switch (token)
{
case COMMENT:
break;
case SECTION:
{
return (NULL);
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
else
{
}
break;
default:
}
}
return (ptr);
}
/*
* xf86readConfigFile()
*
* Read and validate the (initial) configuration file.
*/
xf86readConfigFile(void)
{
{
return (NULL);
}
/*
* Read, parse, and validate the configuration
*/
if (!xf86validateConfig(ptr)) {
}
}
return (ptr);
}
#if defined(SMI_FBCONFIG)
/*
* xf86readNextConfigFile()
*
* Read an additional configuration file, appending it to the current
* configuration data.
*
* Note that we can't revalidate existing configuration data without
* the possibility of memory leaks involving Screen sections. For
* our purposes, additional configuration files are expected to
* contain only Modes sections, so revalidation isn't a big concern.
*/
{
if (!xf86validateDevice(ptr) ||
#if (0)
!xf86validateScreen(ptr) ||
#endif
!xf86validateInput(ptr) ||
!xf86validateLayout(ptr)) {
}
}
return (ptr);
}
#endif
/*
* This function resolves name references and reports errors if the named
* objects cannot be found.
*/
int
{
if (!xf86validateDevice (p))
return FALSE;
if (!xf86validateScreen (p))
return FALSE;
if (!xf86validateInput (p))
return FALSE;
if (!xf86validateLayout (p))
return FALSE;
return (TRUE);
}
/*
* adds an item to the end of the linked list. Any record whose first field
* is a GenericListRec can be cast to this type and used with this function.
* A pointer to the head of the list is returned to handle the addition of
* the first item.
*/
{
GenericListPtr p = head;
while (p)
{
last = p;
p = p->next;
}
if (last)
{
return (head);
}
else
return (new);
}
/*
* Test if one chained list contains the other.
* In this case both list have the same endpoint (provided they don't loop)
*/
int
{
GenericListPtr p = list_1;
while (p) {
last_1 = p;
p = p->next;
}
p = list_2;
while (p) {
last_2 = p;
p = p->next;
}
}
void
{
if (p == NULL)
return;
xf86freeFiles (p->conf_files);
xf86freeModules (p->conf_modules);
xf86freeFlags (p->conf_flags);
xf86freeDRI (p->conf_dri);
TestFree(p->conf_comment);
xf86conffree (p);
}