/*
*
* 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 (including the next
* paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
*/
/*
* fbc_Modes - Edit Modes sections
*/
#include <stdio.h> /* snprintf() */
#include <stdlib.h> /* exit() */
#include "xf86Parser.h" /* Public function, etc. declarations */
#include "Configint.h" /* xf86conffree(), xf86confmalloc() */
#include "fbc.h" /* Common fbconf_xorg(1M) definitions */
#include "fbc_Monitor.h" /* Edit Monitor sections */
#include "fbc_append_config.h" /* Append configuration file supplement */
#include "fbc_error.h" /* Error reporting */
/*
* fbc_append_Modes_sections()
*
* Given a Monitor section and the name of a frame buffer device
* type, try to provide the Monitor section with one or more Modes
* reading sections from canned files and appending them to the
* configuration.
*
* Modes sections and supplemental config file pathnames might be:
* "SunModes" /usr/lib/fbconfig/SunModes_xorg.conf
* "efbModes" /usr/lib/fbconfig/efbModes_xorg.conf
* "kfbModes" /usr/lib/fbconfig/kfbModes_xorg.conf
* ... ...
* Currently only SunModes is implemented. Device-specific Modes
* aren't felt to be necessary.
*/
int
const char *device_type) /* Device type name (e.g. "kfb") */
{
#if (0) /* This is used to handle a device-specific Modes section */
#endif
int done = 0;
/*
* Think of some well-known Modes sections that might be nice to have
*/
#if (0) /* This is how to implement a device-specific Modes section */
device_type) < sizeof (dev_mode_name_buf)) {
}
#endif /* That was how to implement a device-specific Modes section */
/*
* Search for each of the Modes section(s) named in our wish list
*/
for (modes_name = &modes_section_name[0];
modes_name += 1) {
/*
* Search the existing configuration for the Modes section
*
* A Modes section might already be present (e.g.
* "SunModes") because it's used with some other
* monitor.
*
* The section may be present because it too is
* contained by the supplemental config file read
* during a previous iteration of this loop.
* Putting more than one section into a supplemental
* config file could be made to work for certain
* purposes, but currently that's not our intent.
*/
if (modes_sectn_ptr == NULL)
{
/*
* Try a well-known file containing the Modes section
*/
FBC_SUCCESS) {
continue; /* No Modes supplement file */
}
/*
* Find the Modes section that was just appended
*/
if (modes_sectn_ptr == NULL) {
/*
* Something evil has been read into the config
*/
"Supplemental file does not contain Modes \"%s\" section\n",
}
}
/*
* Insert the UseModes entry into the Monitor section
*/
if (usemodes_sectn_ptr == NULL)
{
}
done = 1;
}
return (FBC_SUCCESS);
} /* fbc_append_Modes_sections() */
/*
* fbc_trim_Modes_sections()
*
* remove all the modes in the SunModes section except the one specified in -res
*
* return TRUE if the specified mode is defined in the SunModes section
* else return FALSE
*/
int
char *mode
)
{
if (modes_sectn_ptr == NULL)
return FALSE;
} else {
xf86conffree (ptr);
}
ptr = next_mode_ptr;
}
if (mode_ptr) {
}
return status;
}
/*
* fbc_remove_monitor_sunmodes_section_ER()
*
* removes the external representation of the device specific SunModes section
*/
void
)
{
if (modes_sectn_ptr == NULL)
return;
/*
* Remove the external representation of this mode section
*/
}
}
/*
* fbc_remove_monitor_usemodes_entry_ER()
*
* removes the device specific use SunModes entry from the external representation
*/
void
)
{
if (usemodes_ptr != NULL) {
}
}
/* End of fbc_Modes.c */