/*
*
* 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"
#include "fields.h" /* Config file output line fields */
#if defined(SMI_FBCONFIG)
#include "fbc_line_er.h" /* External Representation of config lines */
#endif
static
{
{ENDSECTION, "endsection"},
{IDENTIFIER, "identifier"},
{VENDOR, "vendorname"},
{BOARD, "boardname"},
{CHIPSET, "chipset"},
{RAMDAC, "ramdac"},
{DACSPEED, "dacspeed"},
{CLOCKS, "clocks"},
{OPTION, "option"},
{VIDEORAM, "videoram"},
{BIOSBASE, "biosbase"},
{MEMBASE, "membase"},
{IOBASE, "iobase"},
{CLOCKCHIP, "clockchip"},
{CHIPID, "chipid"},
{CHIPREV, "chiprev"},
{CARD, "card"},
{DRIVER, "driver"},
{BUSID, "busid"},
{TEXTCLOCKFRQ, "textclockfreq"},
{IRQ, "irq"},
{SCREEN, "screen"},
{-1, ""},
};
xf86parseDeviceSection (void)
{
int i;
int token;
#if defined(SMI_FBCONFIG)
#endif
/* Zero is a valid value for these */
for (;;)
{
#if defined(SMI_FBCONFIG)
/*
* Get a ptr to the External Representation of this config line
*/
#endif
if (token == ENDSECTION)
{
break;
}
switch (token)
{
case COMMENT:
break;
case IDENTIFIER:
break;
case VENDOR:
break;
case BOARD:
break;
case CHIPSET:
break;
case CARD:
break;
case DRIVER:
break;
case RAMDAC:
break;
case DACSPEED:
for (i = 0; i < CONF_MAXDACSPEEDS; i++)
ptr->dev_dacSpeeds[i] = 0;
{
}
else
{
for (i = 1; i < CONF_MAXDACSPEEDS; i++)
{
ptr->dev_dacSpeeds[i] = (int)
else
{
break;
}
}
}
break;
case VIDEORAM:
break;
case BIOSBASE:
break;
case MEMBASE:
break;
case IOBASE:
break;
case CLOCKCHIP:
break;
case CHIPID:
break;
case CHIPREV:
break;
case CLOCKS:
for( i = ptr->dev_clocks;
}
ptr->dev_clocks = i;
break;
case TEXTCLOCKFRQ:
break;
case OPTION:
break;
case BUSID:
break;
case IRQ:
break;
case SCREEN:
break;
case EOF_TOKEN:
break;
default:
break;
}
}
#if defined(SMI_FBCONFIG)
/*
* Link Internal & External Representations of the EndSection line
*/
(void *)ptr,
#endif
if (!has_ident)
#ifdef DEBUG
printf ("Device section parsed\n");
#endif
return ptr;
}
/*
* xf86printDeviceSectionSection()
*
* Write the Device section Section line to the configuration file.
*/
void
{
}
}
/*
* xf86printDeviceSectionIdentifier()
*
* Write the Device section Identifier line to the configuration
* file.
*/
void
{
}
/*
* xf86printDeviceSectionDriver()
*
* Write the Device section Driver line to the configuration file.
*/
void
{
}
/*
* xf86printDeviceSectionVendorName()
*
* Write the Device section VendorName line to the configuration
* file.
*/
void
{
}
/*
* xf86printDeviceSectionBoardName()
*
* Write the Device section BoardName line to the configuration file.
*/
void
{
}
/*
* xf86printDeviceSectionEndSection()
*
* Write the Device section EndSection line to the configuration
* file.
*/
void
{
}
/*
* xf86printDeviceSection()
*
* Write a Device section to the configuration file.
*/
void
{
int i;
while (ptr)
{
}
}
}
}
if (ptr->dev_chipset)
if (ptr->dev_ramdac)
if (ptr->dev_dacSpeeds[0] > 0 ) {
for (i = 0; i < CONF_MAXDACSPEEDS
&& ptr->dev_dacSpeeds[i] > 0; i++ )
}
if (ptr->dev_videoram)
if (ptr->dev_bios_base)
if (ptr->dev_mem_base)
if (ptr->dev_io_base)
if (ptr->dev_clockchip)
if (ptr->dev_clocks > 0 ) {
for (i = 0; i < ptr->dev_clocks; i++ )
}
if (ptr->dev_textclockfreq) {
}
if (ptr->dev_screen > 0)
}
}
void
{
while (ptr)
{
xf86conffree (prev);
}
}
int
{
#if !defined(SMI_FBCONFIG) /* Missing section will be constructed */
if (!device) {
xf86validationError ("At least one Device section is required.");
return (FALSE);
}
#endif
while (device) {
if (!device->dev_driver) {
return (FALSE);
}
}
return (TRUE);
}
{
while (p)
{
if (xf86nameCompare (ident, p->dev_identifier) == 0)
return (p);
}
return (NULL);
}
char *
xf86configStrdup (const char *s)
{
char *tmp;
if (!s) return NULL;
if (tmp)
return (tmp);
}