/*
*
* 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
{
{ENDSUBSECTION, "endsubsection"},
{MODES, "modes"},
{VIEWPORT, "viewport"},
{VIRTUAL, "virtual"},
{VISUAL, "visual"},
{BLACK_TOK, "black"},
{WHITE_TOK, "white"},
{MONITOR, "monitor"},
{DEPTH, "depth"},
{BPP, "fbbpp"},
{WEIGHT, "weight"},
{OPTION, "option"},
{-1, ""},
};
/*
* xf86parseScrnMonitor()
*
* Parse the Monitor entry line of a Screen section. Return a
* pointer to the diagnostic message text in the event of an error.
*/
static
char *
{
/*
* Look for the optional monitor number token
*/
}
/*
* Look for the monitor name string token
*/
/* Monitor entry syntax error */
return (MONITOR_SYNTAX_MSG);
}
/*
* Don't allow:
* * Monitor numbers to be omitted when there are muliple
* Monitor entries
* * Duplicate Monitor numbers
* * Duplicate Monitor names
*/
if (!mon_entry.scrn_monitor_num_seen ||
/* Missing monitor number */
return (MONITOR_NUM_REQUIRED_MSG);
}
if (mon_entry.scrn_monitor_num ==
/* Duplicate monitor number */
return (MONITOR_DUP_NUM_MSG);
}
mon_ptr->scrn_monitor_name) == 0) {
/* Duplicate monitor name */
return (MONITOR_DUP_NAME_MSG);
}
}
/*
* Append the new Monitor entry element to the list
*/
/* Insufficient memory */
return (NO_MEMORY_MSG);
}
/*
* Return successfully
*/
return (NULL);
}
xf86parseDisplaySubSection (void)
{
int token;
#if defined(SMI_FBCONFIG)
#endif
for (;;)
{
#if defined(SMI_FBCONFIG)
/*
* Get a ptr to the External Representation of this config line
*/
#endif
if (token == ENDSUBSECTION)
{
break;
}
switch (token)
{
case COMMENT:
break;
case VIEWPORT:
break;
case VIRTUAL:
break;
case MONITOR:
if (ptr->disp_monitor_seen ||
}
break;
case DEPTH:
break;
case BPP:
break;
case VISUAL:
break;
case WEIGHT:
break;
case BLACK_TOK:
break;
case WHITE_TOK:
break;
case MODES:
{
{
}
}
#if defined(SMI_FBCONFIG)
/*
* Link Internal & External Representations of the line
*/
(void *)ptr,
#endif
break;
case OPTION:
break;
case EOF_TOKEN:
break;
default:
break;
}
}
#if defined(SMI_FBCONFIG)
/*
* Link Internal & External Representations of the EndSubSection line
*/
(void *)ptr,
#endif
#ifdef DEBUG
printf ("Display subsection parsed\n");
#endif
return ptr;
}
{
{ENDSECTION, "endsection"},
{IDENTIFIER, "identifier"},
{OBSDRIVER, "driver"},
{MDEVICE, "device"},
{MONITOR, "monitor"},
{VIDEOADAPTOR, "videoadaptor"},
{SCREENNO, "screenno"},
{SUBSECTION, "subsection"},
{DEFAULTDEPTH, "defaultcolordepth"},
{DEFAULTDEPTH, "defaultdepth"},
{DEFAULTBPP, "defaultbpp"},
{DEFAULTFBBPP, "defaultfbbpp"},
{OPTION, "option"},
{-1, ""},
};
xf86parseScreenSection (void)
{
int token;
#if defined(SMI_FBCONFIG)
#endif
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:
if (has_ident || has_driver)
break;
case OBSDRIVER:
if (has_ident || has_driver)
has_driver = TRUE;
break;
case DEFAULTDEPTH:
#if defined(SMI_FBCONFIG)
/*
* Link Internal & External Representations of the line
*/
(void *)ptr,
#endif
break;
case DEFAULTBPP:
break;
case DEFAULTFBBPP:
break;
case MDEVICE:
}
break;
case MONITOR:
{
char *error_msg;
}
}
break;
case VIDEOADAPTOR:
{
/* Don't allow duplicates */
break;
{
}
}
break;
case OPTION:
break;
case SUBSECTION:
{
}
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 && !has_driver)
#ifdef DEBUG
printf ("Screen section parsed\n");
#endif
return ptr;
}
/*
* xf86printDisplaySubsectionSubsection()
*
* Write the Display subsection Subsection line to the configuration
* file.
*/
void
const char *const whitespace[])
{
}
}
/*
* xf86printDisplaySubectionMonitor()
*
* Write a Display subsection Monitor entry line to the configuration
* file.
*/
void
const char *const whitespace[])
{
}
/*
* xf86printDisplaySubsectionModes()
*
* Write the Modes line of a Display subsection of a Screen section
* to the configuration file.
*/
void
const char *const whitespace[])
{
space = "";
{
space = " ";
}
}
/*
* xf86printDisplaySubsectionEndSubsection()
*
* Write the Display subsection EndSubsection line to the
* configuration file.
*/
void
const char *const whitespace[])
{
//??? xf86printFields(cf, whitespace, "EndSubsection\n", NULL);
}
/*
* xf86printScreenSectionSection()
*
* Write the Screen section Section line to the configuration file.
*/
void
{
}
}
/*
* xf86printScreenSectionIdentifier()
*
* Write the Screen section Identifier line to the configuration
* file.
*/
void
{
}
/*
* xf86printScreenSectionDevice()
*
* Write the Screen section Device entry line to the configuration
* file.
*/
void
{
}
/*
* xf86printScreenSectionMonitor()
*
* Write a Screen section Monitor entry line to the configuration
* file.
*/
void
const char *const whitespace[])
{
}
/*
* xf86printScreenSectionDefaultDepth()
*
* Write a Screen section DefaultDepth entry to the configuration
* file.
*/
void
{
}
/*
* xf86printScreenSectionEndSection()
*
* Write the Screen section EndSection line to the configuration
* file.
*/
void
{
}
/*
* xf86printScreenSection()
*
* Write a Screen section to the configuration file.
*/
void
{
while (ptr)
{
if (ptr->scrn_identifier) {
}
if (ptr->scrn_obso_driver)
if (ptr->scrn_device_str) {
}
}
if (ptr->scrn_defaultdepth)
if (ptr->scrn_defaultbpp)
if (ptr->scrn_defaultfbbpp)
{
}
/*
* Write each Display subsection to the configuration file
*/
{
if (dptr->disp_monitor_seen) {
}
{
}
{
}
if (dptr->disp_depth)
{
}
{
}
if (dptr->disp_visual)
{
}
{
}
{
}
{
}
{
}
}
}
}
/*
* xf86freeScrnMonitorList()
*
* Free the list of Monitor entries of a Screen section, and the
* contents of each entry (i.e. Monitor section name string).
*
* Note that xf86conffree() (aka free()) accepts NULL pointers.
*/
static
void
{
}
}
/*
* xf86freeScreenList()
*
* Free the list of Screen sections, and the contents of each
* section.
*/
void
{
while (ptr)
{
xf86conffree (prev);
}
}
void
{
while (ptr)
{
xf86conffree (prev);
}
}
void
{
while (ptr)
{
xf86conffree (prev);
}
}
void
{
while (ptr)
{
xf86conffree (prev);
}
}
/*
* xf86validateScreen()
*
* Validate each Screen section and its subordinate sections.
*/
int
{
#if !defined(SMI_FBCONFIG) /* Missing section will be constructed */
if (!screen)
{
xf86validationError ("At least one Screen section is required.");
return (FALSE);
}
#endif
while (screen)
{
/*
* Process each Monitor entry in this Screen section
*/
p->conf_monitor_lst);
return (FALSE);
}
if (!xf86validateMonitor(
return (FALSE);
}
}
/*
* Make sure the specified Device section can be found
*/
return (FALSE);
}
if (!device)
{
return (FALSE);
}
while (adaptor)
{
if (!adaptor->al_adaptor)
{
return (FALSE);
}
{
return (FALSE);
}
}
}
return (TRUE);
}
{
while (p)
{
if (xf86nameCompare (ident, p->scrn_identifier) == 0)
return (p);
}
return (NULL);
}