2003-11-14 17:48:57 +01:00
|
|
|
/*
|
2003-11-25 20:29:01 +01:00
|
|
|
* Copyright (c) 1998-2003 by The XFree86 Project, Inc.
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
2003-11-25 20:29:01 +01:00
|
|
|
* 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,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* 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.
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
2003-11-25 20:29:01 +01:00
|
|
|
* 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).
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Author: David Dawes <dawes@xfree86.org>
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
|
|
|
* This file includes public option handling functions.
|
|
|
|
*/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <ctype.h>
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "os.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86Xinput.h"
|
|
|
|
#include "xf86Optrec.h"
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
|
|
|
|
Bool markUsed);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86CollectOptions collects the options from each of the config file
|
|
|
|
* sections used by the screen and puts the combined list in pScrn->options.
|
|
|
|
* This function requires that the following have been initialised:
|
|
|
|
*
|
|
|
|
* pScrn->confScreen
|
|
|
|
* pScrn->Entities[i]->device
|
|
|
|
* pScrn->display
|
|
|
|
* pScrn->monitor
|
|
|
|
*
|
|
|
|
* The extraOpts parameter may optionally contain a list of additional options
|
|
|
|
* to include.
|
|
|
|
*
|
|
|
|
* The order of precedence for options is:
|
|
|
|
*
|
|
|
|
* extraOpts, display, confScreen, monitor, device
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts)
|
|
|
|
{
|
|
|
|
XF86OptionPtr tmp;
|
|
|
|
XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
|
|
|
|
GDevPtr device;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
pScrn->options = NULL;
|
|
|
|
|
|
|
|
for (i=pScrn->numEntities - 1; i >= 0; i--) {
|
|
|
|
device = xf86GetDevFromEntity(pScrn->entityList[i],
|
|
|
|
pScrn->entityInstanceList[i]);
|
|
|
|
if (device && device->options) {
|
|
|
|
tmp = xf86optionListDup(device->options);
|
|
|
|
if (pScrn->options)
|
|
|
|
xf86optionListMerge(pScrn->options,tmp);
|
|
|
|
else
|
|
|
|
pScrn->options = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pScrn->monitor->options) {
|
|
|
|
tmp = xf86optionListDup(pScrn->monitor->options);
|
|
|
|
if (pScrn->options)
|
|
|
|
pScrn->options = xf86optionListMerge(pScrn->options, tmp);
|
|
|
|
else
|
|
|
|
pScrn->options = tmp;
|
|
|
|
}
|
|
|
|
if (pScrn->confScreen->options) {
|
|
|
|
tmp = xf86optionListDup(pScrn->confScreen->options);
|
|
|
|
if (pScrn->options)
|
|
|
|
pScrn->options = xf86optionListMerge(pScrn->options, tmp);
|
|
|
|
else
|
|
|
|
pScrn->options = tmp;
|
|
|
|
}
|
|
|
|
if (pScrn->display->options) {
|
|
|
|
tmp = xf86optionListDup(pScrn->display->options);
|
|
|
|
if (pScrn->options)
|
|
|
|
pScrn->options = xf86optionListMerge(pScrn->options, tmp);
|
|
|
|
else
|
|
|
|
pScrn->options = tmp;
|
|
|
|
}
|
|
|
|
if (extras) {
|
|
|
|
tmp = xf86optionListDup(extras);
|
|
|
|
if (pScrn->options)
|
|
|
|
pScrn->options = xf86optionListMerge(pScrn->options, tmp);
|
|
|
|
else
|
|
|
|
pScrn->options = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86CollectInputOptions collects the options for an InputDevice.
|
|
|
|
* This function requires that the following has been initialised:
|
|
|
|
*
|
|
|
|
* pInfo->conf_idev
|
|
|
|
*
|
|
|
|
* The extraOpts parameter may optionally contain a list of additional options
|
|
|
|
* to include.
|
|
|
|
*
|
|
|
|
* The order of precedence for options is:
|
|
|
|
*
|
|
|
|
* extraOpts, pInfo->conf_idev->extraOptions,
|
|
|
|
* pInfo->conf_idev->commonOptions, defaultOpts
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
|
|
|
|
pointer extraOpts)
|
|
|
|
{
|
|
|
|
XF86OptionPtr tmp;
|
|
|
|
XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
|
|
|
|
|
|
|
|
pInfo->options = NULL;
|
|
|
|
if (defaultOpts) {
|
|
|
|
pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0);
|
|
|
|
}
|
2006-10-23 01:57:00 +02:00
|
|
|
if (pInfo->conf_idev && pInfo->conf_idev->commonOptions) {
|
2003-11-14 17:48:57 +01:00
|
|
|
tmp = xf86optionListDup(pInfo->conf_idev->commonOptions);
|
|
|
|
if (pInfo->options)
|
|
|
|
pInfo->options = xf86optionListMerge(pInfo->options, tmp);
|
|
|
|
else
|
|
|
|
pInfo->options = tmp;
|
|
|
|
}
|
2006-10-23 01:57:00 +02:00
|
|
|
if (pInfo->conf_idev && pInfo->conf_idev->extraOptions) {
|
2003-11-14 17:48:57 +01:00
|
|
|
tmp = xf86optionListDup(pInfo->conf_idev->extraOptions);
|
|
|
|
if (pInfo->options)
|
|
|
|
pInfo->options = xf86optionListMerge(pInfo->options, tmp);
|
|
|
|
else
|
|
|
|
pInfo->options = tmp;
|
|
|
|
}
|
|
|
|
if (extras) {
|
|
|
|
tmp = xf86optionListDup(extras);
|
|
|
|
if (pInfo->options)
|
|
|
|
pInfo->options = xf86optionListMerge(pInfo->options, tmp);
|
|
|
|
else
|
|
|
|
pInfo->options = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Created for new XInput stuff -- essentially extensions to the parser */
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static int
|
|
|
|
LookupIntOption(pointer optlist, const char *name, int deflt, Bool markUsed)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
OptionInfoRec o;
|
|
|
|
|
|
|
|
o.name = name;
|
|
|
|
o.type = OPTV_INTEGER;
|
2003-11-25 20:29:01 +01:00
|
|
|
if (ParseOptionValue(-1, optlist, &o, markUsed))
|
2003-11-14 17:48:57 +01:00
|
|
|
deflt = o.value.num;
|
|
|
|
return deflt;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static double
|
|
|
|
LookupRealOption(pointer optlist, const char *name, double deflt,
|
|
|
|
Bool markUsed)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
OptionInfoRec o;
|
|
|
|
|
|
|
|
o.name = name;
|
|
|
|
o.type = OPTV_REAL;
|
2003-11-25 20:29:01 +01:00
|
|
|
if (ParseOptionValue(-1, optlist, &o, markUsed))
|
2003-11-14 17:48:57 +01:00
|
|
|
deflt = o.value.realnum;
|
|
|
|
return deflt;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static char *
|
|
|
|
LookupStrOption(pointer optlist, const char *name, char *deflt, Bool markUsed)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
OptionInfoRec o;
|
|
|
|
|
|
|
|
o.name = name;
|
|
|
|
o.type = OPTV_STRING;
|
2003-11-25 20:29:01 +01:00
|
|
|
if (ParseOptionValue(-1, optlist, &o, markUsed))
|
2003-11-14 17:48:57 +01:00
|
|
|
deflt = o.value.str;
|
|
|
|
if (deflt)
|
|
|
|
return xstrdup(deflt);
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static int
|
|
|
|
LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
OptionInfoRec o;
|
|
|
|
|
|
|
|
o.name = name;
|
|
|
|
o.type = OPTV_BOOLEAN;
|
2003-11-25 20:29:01 +01:00
|
|
|
if (ParseOptionValue(-1, optlist, &o, markUsed))
|
2003-11-14 17:48:57 +01:00
|
|
|
deflt = o.value.bool;
|
|
|
|
return deflt;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
/* These xf86Set* functions are intended for use by non-screen specific code */
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86SetIntOption(pointer optlist, const char *name, int deflt)
|
|
|
|
{
|
|
|
|
return LookupIntOption(optlist, name, deflt, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
double
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86SetRealOption(pointer optlist, const char *name, double deflt)
|
|
|
|
{
|
|
|
|
return LookupRealOption(optlist, name, deflt, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86SetStrOption(pointer optlist, const char *name, char *deflt)
|
|
|
|
{
|
|
|
|
return LookupStrOption(optlist, name, deflt, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86SetBoolOption(pointer optlist, const char *name, int deflt)
|
|
|
|
{
|
|
|
|
return LookupBoolOption(optlist, name, deflt, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are like the Set*Option functions, but they don't mark the options
|
|
|
|
* as used.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86CheckIntOption(pointer optlist, const char *name, int deflt)
|
|
|
|
{
|
|
|
|
return LookupIntOption(optlist, name, deflt, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
double
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86CheckRealOption(pointer optlist, const char *name, double deflt)
|
|
|
|
{
|
|
|
|
return LookupRealOption(optlist, name, deflt, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86CheckStrOption(pointer optlist, const char *name, char *deflt)
|
|
|
|
{
|
|
|
|
return LookupStrOption(optlist, name, deflt, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86CheckBoolOption(pointer optlist, const char *name, int deflt)
|
|
|
|
{
|
|
|
|
return LookupBoolOption(optlist, name, deflt, FALSE);
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
/*
|
|
|
|
* addNewOption() has the required property of replacing the option value
|
2003-11-25 20:29:01 +01:00
|
|
|
* if the option is already present.
|
2003-11-14 17:48:57 +01:00
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2007-04-10 22:48:00 +02:00
|
|
|
char tmp[16];
|
2003-11-14 17:48:57 +01:00
|
|
|
sprintf(tmp,"%i",val);
|
|
|
|
return xf86AddNewOption(optlist,name,tmp);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
|
|
|
|
{
|
2007-04-10 22:48:00 +02:00
|
|
|
char tmp[32];
|
2003-11-25 20:29:01 +01:00
|
|
|
snprintf(tmp,32,"%f",val);
|
|
|
|
return xf86AddNewOption(optlist,name,tmp);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2003-11-25 20:29:01 +01:00
|
|
|
return xf86AddNewOption(optlist,name,val?"True":"False");
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86ReplaceStrOption(pointer optlist, const char *name, const char* val)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
return xf86AddNewOption(optlist,name,val);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-25 20:29:01 +01:00
|
|
|
xf86AddNewOption(pointer head, const char *name, const char *val)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2003-11-25 20:29:01 +01:00
|
|
|
/* XXX These should actually be allocated in the parser library. */
|
2003-11-14 17:48:57 +01:00
|
|
|
char *tmp = strdup(val);
|
|
|
|
char *tmp_name = strdup(name);
|
|
|
|
|
|
|
|
return xf86addNewOption(head, tmp_name, tmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86NewOption(char *name, char *value)
|
|
|
|
{
|
|
|
|
return xf86newOption(name, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86NextOption(pointer list)
|
|
|
|
{
|
|
|
|
return xf86nextOption(list);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86OptionListCreate(const char **options, int count, int used)
|
|
|
|
{
|
|
|
|
return xf86optionListCreate(options, count, used);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86OptionListMerge(pointer head, pointer tail)
|
|
|
|
{
|
|
|
|
return xf86optionListMerge(head, tail);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86OptionListFree(pointer opt)
|
|
|
|
{
|
|
|
|
xf86optionListFree(opt);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86OptionName(pointer opt)
|
|
|
|
{
|
|
|
|
return xf86optionName(opt);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86OptionValue(pointer opt)
|
|
|
|
{
|
|
|
|
return xf86optionValue(opt);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86OptionListReport(pointer parm)
|
|
|
|
{
|
|
|
|
XF86OptionPtr opts = parm;
|
|
|
|
|
|
|
|
while(opts) {
|
|
|
|
if (xf86optionValue(opts))
|
|
|
|
xf86ErrorFVerb(5, "\tOption \"%s\" \"%s\"\n",
|
|
|
|
xf86optionName(opts), xf86optionValue(opts));
|
|
|
|
else
|
|
|
|
xf86ErrorFVerb( 5, "\tOption \"%s\"\n", xf86optionName(opts));
|
|
|
|
opts = xf86nextOption(opts);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End of XInput-caused section */
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
pointer
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86FindOption(pointer options, const char *name)
|
|
|
|
{
|
|
|
|
return xf86findOption(options, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86FindOptionValue(pointer options, const char *name)
|
|
|
|
{
|
|
|
|
return xf86findOptionValue(options, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86MarkOptionUsed(pointer option)
|
|
|
|
{
|
|
|
|
if (option != NULL)
|
|
|
|
((XF86OptionPtr)option)->opt_used = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86MarkOptionUsedByName(pointer options, const char *name)
|
|
|
|
{
|
|
|
|
XF86OptionPtr opt;
|
|
|
|
|
|
|
|
opt = xf86findOption(options, name);
|
|
|
|
if (opt != NULL)
|
|
|
|
opt->opt_used = TRUE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86CheckIfOptionUsed(pointer option)
|
|
|
|
{
|
|
|
|
if (option != NULL)
|
|
|
|
return ((XF86OptionPtr)option)->opt_used;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86CheckIfOptionUsedByName(pointer options, const char *name)
|
|
|
|
{
|
|
|
|
XF86OptionPtr opt;
|
|
|
|
|
|
|
|
opt = xf86findOption(options, name);
|
|
|
|
if (opt != NULL)
|
|
|
|
return opt->opt_used;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86ShowUnusedOptions(int scrnIndex, pointer options)
|
|
|
|
{
|
|
|
|
XF86OptionPtr opt = options;
|
|
|
|
|
|
|
|
while (opt) {
|
|
|
|
if (opt->opt_name && !opt->opt_used) {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" is not used\n",
|
|
|
|
opt->opt_name);
|
|
|
|
}
|
|
|
|
opt = opt->list.next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
GetBoolValue(OptionInfoPtr p, const char *s)
|
|
|
|
{
|
|
|
|
if (*s == '\0') {
|
|
|
|
p->value.bool = TRUE;
|
|
|
|
} else {
|
|
|
|
if (xf86NameCmp(s, "1") == 0)
|
|
|
|
p->value.bool = TRUE;
|
|
|
|
else if (xf86NameCmp(s, "on") == 0)
|
|
|
|
p->value.bool = TRUE;
|
|
|
|
else if (xf86NameCmp(s, "true") == 0)
|
|
|
|
p->value.bool = TRUE;
|
|
|
|
else if (xf86NameCmp(s, "yes") == 0)
|
|
|
|
p->value.bool = TRUE;
|
|
|
|
else if (xf86NameCmp(s, "0") == 0)
|
|
|
|
p->value.bool = FALSE;
|
|
|
|
else if (xf86NameCmp(s, "off") == 0)
|
|
|
|
p->value.bool = FALSE;
|
|
|
|
else if (xf86NameCmp(s, "false") == 0)
|
|
|
|
p->value.bool = FALSE;
|
|
|
|
else if (xf86NameCmp(s, "no") == 0)
|
|
|
|
p->value.bool = FALSE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2003-11-25 20:29:01 +01:00
|
|
|
ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
|
|
|
|
Bool markUsed)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
char *s, *end;
|
2003-11-25 20:29:01 +01:00
|
|
|
Bool wasUsed = FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if ((s = xf86findOptionValue(options, p->name)) != NULL) {
|
2003-11-25 20:29:01 +01:00
|
|
|
if (markUsed) {
|
|
|
|
wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
|
|
|
|
xf86MarkOptionUsedByName(options, p->name);
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
switch (p->type) {
|
|
|
|
case OPTV_INTEGER:
|
|
|
|
if (*s == '\0') {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires an integer value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
} else {
|
|
|
|
p->value.num = strtoul(s, &end, 0);
|
|
|
|
if (*end == '\0') {
|
|
|
|
p->found = TRUE;
|
|
|
|
} else {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires an integer value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case OPTV_STRING:
|
|
|
|
if (*s == '\0') {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires an string value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
} else {
|
|
|
|
p->value.str = s;
|
|
|
|
p->found = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case OPTV_ANYSTR:
|
|
|
|
p->value.str = s;
|
|
|
|
p->found = TRUE;
|
|
|
|
break;
|
|
|
|
case OPTV_REAL:
|
|
|
|
if (*s == '\0') {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a floating point value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
} else {
|
|
|
|
p->value.realnum = strtod(s, &end);
|
|
|
|
if (*end == '\0') {
|
|
|
|
p->found = TRUE;
|
|
|
|
} else {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a floating point value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case OPTV_BOOLEAN:
|
|
|
|
if (GetBoolValue(p, s)) {
|
|
|
|
p->found = TRUE;
|
|
|
|
} else {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a boolean value\n", p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case OPTV_FREQ:
|
|
|
|
if (*s == '\0') {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a frequency value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
} else {
|
|
|
|
double freq = strtod(s, &end);
|
|
|
|
int units = 0;
|
|
|
|
|
|
|
|
if (end != s) {
|
|
|
|
p->found = TRUE;
|
|
|
|
if (!xf86NameCmp(end, "Hz"))
|
|
|
|
units = 1;
|
|
|
|
else if (!xf86NameCmp(end, "kHz") ||
|
|
|
|
!xf86NameCmp(end, "k"))
|
|
|
|
units = 1000;
|
|
|
|
else if (!xf86NameCmp(end, "MHz") ||
|
|
|
|
!xf86NameCmp(end, "M"))
|
|
|
|
units = 1000000;
|
|
|
|
else {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a frequency value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
if (p->found)
|
|
|
|
freq *= (double)units;
|
|
|
|
} else {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a frequency value\n",
|
|
|
|
p->name);
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
if (p->found) {
|
|
|
|
p->value.freq.freq = freq;
|
|
|
|
p->value.freq.units = units;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case OPTV_NONE:
|
|
|
|
/* Should never get here */
|
|
|
|
p->found = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2003-11-25 20:29:01 +01:00
|
|
|
if (p->found && markUsed) {
|
2003-11-14 17:48:57 +01:00
|
|
|
int verb = 2;
|
|
|
|
if (wasUsed)
|
|
|
|
verb = 4;
|
|
|
|
xf86DrvMsgVerb(scrnIndex, X_CONFIG, verb, "Option \"%s\"", p->name);
|
|
|
|
if (!(p->type == OPTV_BOOLEAN && *s == 0)) {
|
|
|
|
xf86ErrorFVerb(verb, " \"%s\"", s);
|
|
|
|
}
|
|
|
|
xf86ErrorFVerb(verb, "\n");
|
|
|
|
}
|
|
|
|
} else if (p->type == OPTV_BOOLEAN) {
|
|
|
|
/* Look for matches with options with or without a "No" prefix. */
|
|
|
|
char *n, *newn;
|
|
|
|
OptionInfoRec opt;
|
|
|
|
|
|
|
|
n = xf86NormalizeName(p->name);
|
|
|
|
if (!n) {
|
|
|
|
p->found = FALSE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (strncmp(n, "no", 2) == 0) {
|
|
|
|
newn = n + 2;
|
|
|
|
} else {
|
|
|
|
xfree(n);
|
|
|
|
n = xalloc(strlen(p->name) + 2 + 1);
|
|
|
|
if (!n) {
|
|
|
|
p->found = FALSE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
strcpy(n, "No");
|
|
|
|
strcat(n, p->name);
|
|
|
|
newn = n;
|
|
|
|
}
|
|
|
|
if ((s = xf86findOptionValue(options, newn)) != NULL) {
|
2003-11-25 20:29:01 +01:00
|
|
|
if (markUsed)
|
|
|
|
xf86MarkOptionUsedByName(options, newn);
|
2003-11-14 17:48:57 +01:00
|
|
|
if (GetBoolValue(&opt, s)) {
|
|
|
|
p->value.bool = !opt.value.bool;
|
|
|
|
p->found = TRUE;
|
|
|
|
} else {
|
|
|
|
xf86DrvMsg(scrnIndex, X_WARNING,
|
|
|
|
"Option \"%s\" requires a boolean value\n", newn);
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
2003-11-25 20:29:01 +01:00
|
|
|
if (p->found && markUsed) {
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
|
|
|
|
if (*s != 0) {
|
|
|
|
xf86ErrorFVerb(2, " \"%s\"", s);
|
|
|
|
}
|
|
|
|
xf86ErrorFVerb(2, "\n");
|
|
|
|
}
|
|
|
|
xfree(n);
|
|
|
|
} else {
|
|
|
|
p->found = FALSE;
|
|
|
|
}
|
|
|
|
return p->found;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
for (p = optinfo; p->name != NULL; p++) {
|
2003-11-25 20:29:01 +01:00
|
|
|
ParseOptionValue(scrnIndex, options, p, TRUE);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
OptionInfoPtr
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86TokenToOptinfo(const OptionInfoRec *table, int token)
|
|
|
|
{
|
2003-11-25 20:29:01 +01:00
|
|
|
const OptionInfoRec *p, *match = NULL, *set = NULL;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if (!table) {
|
|
|
|
ErrorF("xf86TokenToOptinfo: table is NULL\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
for (p = table; p->token >= 0; p++) {
|
|
|
|
if (p->token == token) {
|
|
|
|
match = p;
|
|
|
|
if (p->found)
|
|
|
|
set = p;
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
if (set)
|
|
|
|
return (OptionInfoPtr)set;
|
|
|
|
else if (match)
|
|
|
|
return (OptionInfoPtr)match;
|
2003-11-14 17:48:57 +01:00
|
|
|
else
|
2003-11-25 20:29:01 +01:00
|
|
|
return NULL;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
const char *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86TokenToOptName(const OptionInfoRec *table, int token)
|
|
|
|
{
|
|
|
|
const OptionInfoRec *p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
return p->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86IsOptionSet(const OptionInfoRec *table, int token)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
return (p && p->found);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetOptValString(const OptionInfoRec *table, int token)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found)
|
|
|
|
return p->value.str;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found) {
|
|
|
|
*value = p->value.num;
|
|
|
|
return TRUE;
|
|
|
|
} else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found) {
|
|
|
|
*value = p->value.num;
|
|
|
|
return TRUE;
|
|
|
|
} else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetOptValReal(const OptionInfoRec *table, int token, double *value)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found) {
|
|
|
|
*value = p->value.realnum;
|
|
|
|
return TRUE;
|
|
|
|
} else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetOptValFreq(const OptionInfoRec *table, int token,
|
|
|
|
OptFreqUnits expectedUnits, double *value)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found) {
|
|
|
|
if (p->value.freq.units > 0) {
|
|
|
|
/* Units give, so the scaling is known. */
|
|
|
|
switch (expectedUnits) {
|
|
|
|
case OPTUNITS_HZ:
|
|
|
|
*value = p->value.freq.freq;
|
|
|
|
break;
|
|
|
|
case OPTUNITS_KHZ:
|
|
|
|
*value = p->value.freq.freq / 1000.0;
|
|
|
|
break;
|
|
|
|
case OPTUNITS_MHZ:
|
|
|
|
*value = p->value.freq.freq / 1000000.0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* No units given, so try to guess the scaling. */
|
|
|
|
switch (expectedUnits) {
|
|
|
|
case OPTUNITS_HZ:
|
|
|
|
*value = p->value.freq.freq;
|
|
|
|
break;
|
|
|
|
case OPTUNITS_KHZ:
|
|
|
|
if (p->value.freq.freq > 1000.0)
|
|
|
|
*value = p->value.freq.freq / 1000.0;
|
|
|
|
else
|
|
|
|
*value = p->value.freq.freq;
|
|
|
|
break;
|
|
|
|
case OPTUNITS_MHZ:
|
|
|
|
if (p->value.freq.freq > 1000000.0)
|
|
|
|
*value = p->value.freq.freq / 1000000.0;
|
|
|
|
else if (p->value.freq.freq > 1000.0)
|
|
|
|
*value = p->value.freq.freq / 1000.0;
|
|
|
|
else
|
|
|
|
*value = p->value.freq.freq;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
} else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found) {
|
|
|
|
*value = p->value.bool;
|
|
|
|
return TRUE;
|
|
|
|
} else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)
|
|
|
|
{
|
|
|
|
OptionInfoPtr p;
|
|
|
|
|
|
|
|
p = xf86TokenToOptinfo(table, token);
|
|
|
|
if (p && p->found) {
|
|
|
|
return p->value.bool;
|
|
|
|
} else
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86NameCmp(const char *s1, const char *s2)
|
|
|
|
{
|
|
|
|
return xf86nameCompare(s1, s2);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
char *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86NormalizeName(const char *s)
|
|
|
|
{
|
|
|
|
char *ret, *q;
|
|
|
|
const char *p;
|
|
|
|
|
|
|
|
if (s == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
ret = xalloc(strlen(s) + 1);
|
|
|
|
for (p = s, q = ret; *p != 0; p++) {
|
|
|
|
switch (*p) {
|
|
|
|
case '_':
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
continue;
|
|
|
|
default:
|
|
|
|
if (isupper(*p))
|
|
|
|
*q++ = tolower(*p);
|
|
|
|
else
|
|
|
|
*q++ = *p;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*q = '\0';
|
|
|
|
return ret;
|
|
|
|
}
|