/*
*
* 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_open_device - Open the frame buffer device
*/
#include <errno.h> /* errno */
#include <fcntl.h>
#include <string.h> /* strerror() */
#include <unistd.h> /* ioctl() */
#include "fbc.h" /* Common fbconf_xorg(1M) definitions */
#include "fbc_dev.h" /* Identify the graphics device (-dev opt) */
#include "fbc_error.h" /* Error reporting */
#include "fbc_open_device.h" /* Open the frame buffer device */
/*
* fbc_open_device()
*
* Verify that the frame buffer device pathname specifies an
* existing, character special device. Open the existing graphics
* device and get the VISUAL environment identifier name (e.g.
* "SUNWkfb"). Return the identifier name and the file descriptor
* number upon success. Return an FBC_ERR_XXXXX code otherwise.
*/
int
{
/*
* Make sure this is a character special file
*/
fbc_errormsg("Unable to get status, %s, %s\n",
return (FBC_ERR_STAT);
}
fbc_errormsg("Not a character special file, %s\n",
return (FBC_ERR_STAT);
}
/*
* Open the existing device file
*/
if (fd == -1) {
fbc_errormsg("Unable to open device, %s, %s\n",
return (FBC_ERR_OPEN);
}
/*
* Get the VISUAL environment device identifier name
*/
fbc_errormsg("Unable to get device identifier, %s, %s\n",
return (FBC_ERR_IOCTL);
}
/*
???"the" * Find out whether this is the default device
*
* This would determine whether or not the Screen section for
* this device is potentially the active Screen section, and,
* if the section is missing, where in the configuration it
* should be inserted.
*/
device->is_default =
return (FBC_SUCCESS);
} /* fbc_open_device() */
/* End of fbc_open_device.c */