Commit a1d41e31 authored by Daniel Stone's avatar Daniel Stone Committed by Keith Packard

Move extension initialisation prototypes into extinit.h

Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to
hold all our extension initialisation prototypes, rather than
duplicating them everywhere.
Signed-off-by: Daniel Stone's avatarDaniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent b86aa74c
......@@ -38,9 +38,7 @@ from The Open Group.
#include "extnsionst.h"
#include <X11/extensions/bigreqsproto.h>
#include "opaque.h"
#include "modinit.h"
void BigReqExtensionInit(void);
#include "extinit.h"
static int
ProcBigReqDispatch(ClientPtr client)
......
......@@ -39,7 +39,7 @@ Equipment Corporation.
#include "opaque.h"
#include <X11/extensions/dpmsproto.h>
#include "dpmsproc.h"
#include "modinit.h"
#include "extinit.h"
static int
ProcDPMSGetVersion(ClientPtr client)
......
......@@ -32,6 +32,7 @@
#include "geint.h"
#include "geext.h"
#include "protocol-versions.h"
#include "extinit.h"
DevPrivateKeyRec GEClientPrivateKeyRec;
......
......@@ -78,6 +78,4 @@ extern _X_EXPORT void GERegisterExtension(int extension,
extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension);
extern _X_EXPORT void GEExtensionInit(void);
#endif /* _GEEXT_H_ */
......@@ -59,7 +59,7 @@ Equipment Corporation.
#ifdef COMPOSITE
#include "compint.h"
#endif
#include "modinit.h"
#include "extinit.h"
#include "protocol-versions.h"
#ifdef GLXPROXY
......
......@@ -58,7 +58,7 @@ in this Software without prior written authorization from the X Consortium.
#include <stdio.h>
#include "modinit.h"
#include "extinit.h"
static int ScreenSaverEventBase = 0;
......
......@@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group.
#include "xacestr.h"
#include "securitysrv.h"
#include <X11/extensions/securproto.h>
#include "modinit.h"
#include "extinit.h"
#include "protocol-versions.h"
/* Extension stuff */
......
......@@ -44,7 +44,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/extensions/shapeproto.h>
#include "regionstr.h"
#include "gcstruct.h"
#include "modinit.h"
#include "extinit.h"
#include "protocol-versions.h"
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */
......
......@@ -87,7 +87,7 @@ in this Software without prior written authorization from The Open Group.
#include "panoramiXsrv.h"
#endif
#include "modinit.h"
#include "extinit.h"
typedef struct _ShmDesc {
struct _ShmDesc *next;
......
......@@ -76,7 +76,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include <sys/time.h>
#endif
#include "modinit.h"
#include "extinit.h"
/*
* Local Global Variables
......
......@@ -134,8 +134,6 @@ extern void SyncChangeCounter(SyncCounter *pCounter,
extern void SyncDestroySystemCounter(pointer pCounter);
extern void SyncExtensionInit(void);
extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev);
extern void SyncRemoveDeviceIdleTime(SyncCounter *counter);
#endif /* _SYNCSRV_H_ */
......@@ -38,7 +38,7 @@ from The Open Group.
#include "extnsionst.h"
#include "swaprep.h"
#include <X11/extensions/xcmiscproto.h>
#include "modinit.h"
#include "extinit.h"
#include <stdint.h>
......
......@@ -71,6 +71,7 @@
#include "gcstruct.h"
#include "dixfontstr.h"
#include "extnsionst.h"
#include "extinit.h"
#include "protocol-versions.h"
#include <X11/extensions/xf86bigfproto.h>
......
......@@ -27,7 +27,6 @@
#include <X11/fonts/font.h>
extern void XFree86BigfontExtensionInit(void);
extern void XF86BigfontFreeFontShm(FontPtr);
extern void XF86BigfontCleanup(void);
......
......@@ -21,7 +21,7 @@
#include "pixmapstr.h"
#include "windowstr.h"
#include "gcstruct.h"
#include "modinit.h"
#include "extinit.h"
#include "protocol-versions.h"
#include "client.h"
#include "list.h"
......
......@@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "windowstr.h"
#include "propertyst.h"
#include "extnsionst.h"
#include "modinit.h"
#include "extinit.h"
#include "xselinuxint.h"
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)
......
......@@ -55,7 +55,7 @@
#include "eventstr.h"
#include "inpututils.h"
#include "modinit.h"
#include "extinit.h"
extern int DeviceValuator;
......
......@@ -235,7 +235,6 @@ typedef struct {
extern _X_EXPORT int ProcXvDispatch(ClientPtr);
extern _X_EXPORT int SProcXvDispatch(ClientPtr);
extern _X_EXPORT void XvExtensionInit(void);
extern _X_EXPORT int XvScreenInit(ScreenPtr);
extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
extern _X_EXPORT unsigned long XvGetRTPort(void);
......
......@@ -88,6 +88,7 @@ SOFTWARE.
#include "pixmapstr.h"
#include "gc.h"
#include "extnsionst.h"
#include "extinit.h"
#include "dixstruct.h"
#include "resource.h"
#include "opaque.h"
......
......@@ -13,6 +13,7 @@
#include "resource.h"
#include "scrnintstr.h"
#include "extnsionst.h"
#include "extinit.h"
#include "servermd.h"
#include <X11/Xfuncproto.h>
#include "xvdix.h"
......
......@@ -85,8 +85,6 @@ typedef struct {
} XvMCAdaptorRec, *XvMCAdaptorPtr;
#ifndef XorgLoader
extern _X_EXPORT void XvMCExtensionInit(void);
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
int num, XvMCAdaptorPtr adapt);
......
......@@ -48,6 +48,7 @@
#include "compint.h"
#include "xace.h"
#include "protocol-versions.h"
#include "extinit.h"
static CARD8 CompositeReqCode;
static DevPrivateKeyRec CompositeClientPrivateKeyRec;
......
......@@ -228,13 +228,6 @@ Bool
compReallocPixmap(WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, int bw);
/*
* compext.c
*/
void
CompositeExtensionInit(void);
/*
* compinit.c
*/
......
......@@ -4,5 +4,4 @@ AM_CFLAGS = $(DIX_CFLAGS)
libdamageext_la_SOURCES = \
damageext.c \
damageext.h \
damageextint.h
......@@ -26,6 +26,7 @@
#include "damageextint.h"
#include "protocol-versions.h"
#include "extinit.h"
static unsigned char DamageReqCode;
static int DamageEventBase;
......
......@@ -37,7 +37,6 @@
#include "windowstr.h"
#include "selection.h"
#include "scrnintstr.h"
#include "damageext.h"
#include "damage.h"
#include "xfixes.h"
......
......@@ -42,6 +42,7 @@
#include <X11/Xproto.h>
#include "scrnintstr.h"
#include "extnsionst.h"
#include "extinit.h"
#include "gcstruct.h"
#include "dixstruct.h"
#define NEED_DBE_PROTOCOL
......
......@@ -83,8 +83,6 @@ typedef struct {
/* Marker for free elements in the buffer ID array. */
#define DBE_FREE_ID_ELEMENT 0
extern _X_EXPORT void DbeExtensionInit(void);
/* TYPEDEFS */
/* Record used to pass swap information between DIX and DDX swapping
......
......@@ -39,6 +39,7 @@
#include <registry.h>
#include "privates.h"
#include <os.h>
#include "extinit.h"
#include "unpack.h"
#include "glxutil.h"
#include "glxext.h"
......@@ -338,6 +339,9 @@ GlxExtensionInit(void)
if (!__glXContextRes || !__glXDrawableRes)
return;
if (serverGeneration == 1)
GlxPushProvider(&__glXDRISWRastProvider);
if (!dixRegisterPrivateKey
(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
return;
......
......@@ -76,8 +76,6 @@ extern __GLXclientState *glxGetClient(ClientPtr pClient);
/************************************************************************/
void GlxExtensionInit(void);
void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates);
void __glXScreenInitVisuals(__GLXscreen * screen);
......
......@@ -52,6 +52,7 @@
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "extinit.h"
#include "opaque.h"
#include "dmxextension.h"
......@@ -65,8 +66,6 @@ extern unsigned long XRT_WINDOW;
extern int PanoramiXNumScreens;
#endif
extern void DMXExtensionInit(void);
static unsigned char DMXCode;
static int
......
......@@ -44,6 +44,7 @@
#include "glxvisuals.h"
#include "micmap.h"
#include "glxswap.h"
#include "extinit.h"
/*
** Forward declarations.
......
......@@ -64,8 +64,6 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *);
extern int __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc);
extern int __glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc);
extern void GlxExtensionInit(void);
extern Bool __glXCoreType(void);
#endif /* _glxext_h_ */
......@@ -45,7 +45,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
xf86Option.c xf86Init.c \
xf86VidMode.c xf86fbman.c xf86cmap.c \
xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
xf86Mode.c xorgHelper.c \
xf86Mode.c xorgHelper.c xf86Extensions.h \
$(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la
......
......@@ -39,7 +39,7 @@ typedef union {
float f;
} vidMonitorValue;
extern _X_EXPORT void XFree86VidModeExtensionInit(void);
extern Bool VidModeExtensionInit(ScreenPtr pScreen);
extern _X_EXPORT Bool VidModeAvailable(int scrnIndex);
extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode,
......
......@@ -449,11 +449,6 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
Bool resetMode);
#endif
/* xf86VidModeExtentionInit.c */
extern _X_EXPORT Bool
VidModeExtensionInit(ScreenPtr pScreen);
/* convert ScreenPtr to ScrnInfoPtr */
extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
/* convert ScrnInfoPtr to ScreenPtr */
......
/*
* Copyright © 2011 Daniel Stone
*
* 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 (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.
*
* Author: Daniel Stone <daniel@fooishbar.org>
*/
#ifndef XF86EXTENSIONS_H
#define XF86EXTENSIONS_H
#include "extnsionst.h"
#ifdef XF86DRI
extern Bool noXFree86DRIExtension;
extern void XFree86DRIExtensionInit(void);
#endif
#ifdef DRI2
#include <X11/extensions/dri2proto.h>
extern void DRI2ExtensionInit(void);
#endif
#ifdef XF86VIDMODE
#include <X11/extensions/xf86vmproto.h>
extern Bool noXFree86VidModeExtension;
extern void XFree86VidModeExtensionInit(void);
#endif
#ifdef XFreeXDGA
#include <X11/extensions/xf86dgaproto.h>
extern Bool noXFree86DGAExtension;
extern void XFree86DGAExtensionInit(void);
extern void XFree86DGARegister(void);
#endif
#endif
......@@ -4,11 +4,10 @@
#include "xf86Module.h"
#include "globals.h"
#include "extinit.h"
static MODULESETUPPROTO(dbeSetup);
extern void DbeExtensionInit(void);
static ExtensionModule dbeExt = {
DbeExtensionInit,
"DOUBLE-BUFFER",
......
......@@ -23,7 +23,6 @@ INCLUDES = @XORG_INCS@ \
libextmod_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
libextmod_la_SOURCES = modinit.c \
modinit.h \
$(DGA_SRCS) \
$(XF86VMODE_SRCS) \
$(XV_SRCS)
......
......@@ -29,7 +29,8 @@
#include <X11/Xproto.h>
#include "modinit.h"
#include "extinit.h"
#include "xf86Extensions.h"
#include "globals.h"
static MODULESETUPPROTO(extmodSetup);
......
......@@ -17,6 +17,7 @@
#include "dixevents.h"
#include "pixmapstr.h"
#include "extnsionst.h"
#include "xf86Extensions.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "scrnintstr.h"
......@@ -28,7 +29,7 @@
#include <string.h>
#include "modinit.h"
#include "extinit.h"
#define DGA_PROTOCOL_OLD_SUPPORT 1
......
......@@ -39,6 +39,7 @@ from Kaleb S. KEITHLEY
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "xf86Extensions.h"
#include "scrnintstr.h"
#include "servermd.h"
#include <X11/extensions/xf86vmproto.h>
......
......@@ -42,6 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "micmap.h"
#include "globals.h"
#include "glxserver.h"
#include "extinit.h"
static MODULESETUPPROTO(glxSetup);
......
......@@ -3,13 +3,12 @@
#endif
#include "xf86Module.h"
#include "extinit.h"
extern Bool noTestExtensions;
static MODULESETUPPROTO(recordSetup);
extern void RecordExtensionInit(void);
static ExtensionModule recordExt = {
RecordExtensionInit,
"RECORD",
......
......@@ -51,6 +51,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "extinit.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "scrnintstr.h"
......@@ -68,6 +69,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86_OSproc.h"
#include "inputstr.h"
#include "xf86VGAarbiter.h"
#include "xf86Extensions.h"
static int DRIEntPrivIndex = -1;
static DevPrivateKeyRec DRIScreenPrivKeyRec;
......
......@@ -37,6 +37,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#include "xf86Module.h"
#include "xf86Extensions.h"
#include "globals.h"
#include "xf86drm.h"
......@@ -57,7 +58,6 @@ static XF86ModuleVersionInfo VersRec = {
{0, 0, 0, 0}
};
extern void XFree86DRIExtensionInit(void);
#define _XF86DRI_SERVER_
#include <X11/dri/xf86driproto.h>
......
......@@ -47,6 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "extinit.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "scrnintstr.h"
......@@ -60,17 +61,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dristruct.h"
#include "xf86drm.h"
#include "protocol-versions.h"
#include "xf86Extensions.h"
static int DRIErrorBase;
static void XF86DRIResetProc(ExtensionEntry * extEntry);
static void XF86DRIResetProc(ExtensionEntry *extEntry);
static unsigned char DRIReqCode = 0;
extern void XFree86DRIExtensionInit(void);
/*ARGSUSED*/ static void
XF86DRIResetProc(ExtensionEntry * extEntry)
/*ARGSUSED*/
static void
XF86DRIResetProc(ExtensionEntry *extEntry)
{
DRIReset();
}
......
......@@ -279,7 +279,6 @@ cat > sdksyms.c << EOF
#include "dixstruct.h"
#include "exevents.h"
#include "extension.h"
#include "extinit.h"
#include "extnsionst.h"
#include "gc.h"
#include "gcstruct.h"
......
......@@ -40,6 +40,7 @@
#include "darwin.h"
#include "pseudoramiX.h"
#include "extnsionst.h"
#include "extinit.h"
#include "dixstruct.h"
#include "window.h"
#include <X11/extensions/panoramiXproto.h>
......
......@@ -6,6 +6,5 @@ extern int noPseudoramiXExtension;
void
PseudoramiXAddScreen(int x, int y, int w, int h);
void PseudoramiXExtensionInit(int argc, char *argv[]);
void
PseudoramiXResetScreens(void);
......@@ -55,6 +55,7 @@
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "extinit.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "scrnintstr.h"
......
......@@ -72,9 +72,6 @@ DRIFinishScreenInit(ScreenPtr pScreen);
extern void
DRICloseScreen(ScreenPtr pScreen);
extern Bool
DRIExtensionInit(void);
extern void
DRIReset(void);
......
......@@ -23,8 +23,29 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/********************************************************************
* Interface of extinit.c
/*
* Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
*
* 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
* NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XFREE86 PROJECT 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 XFree86 Project 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 XFree86 Project.
*/
#ifndef EXTINIT_H
......@@ -32,14 +53,135 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "extnsionst.h"
extern void
XInputExtensionInit(void
);
#ifdef COMPOSITE
extern Bool noCompositeExtension;
extern void CompositeExtensionInit(void);
#endif
extern _X_EXPORT void
AssignTypeAndName(DeviceIntPtr /* dev */ ,
Atom /* type */ ,
const char * /* name */
);
#ifdef DAMAGE
extern Bool noDamageExtension;
extern void DamageExtensionInit(void);
#endif
#endif /* EXTINIT_H */
#if defined(DBE) && !defined(XorgLoader)
extern Bool noDbeExtension;
extern void DbeExtensionInit(void);
#endif
#ifdef DMXEXT
extern void DMXExtensionInit(void);
#endif
#if defined(DPMSExtension) && !defined(XorgLoader)
#include <X11/extensions/dpmsconst.h>
extern Bool noDPMSExtension;
extern void DPMSExtensionInit(void);
#endif
extern Bool noGEExtension;
extern void GEExtensionInit(void);
#ifdef GLXEXT
extern _X_EXPORT Bool noGlxExtension;
extern void GlxExtensionInit(void);
#endif
#ifdef PANORAMIX
#include <X11/extensions/panoramiXproto.h>
extern Bool noPanoramiXExtension;
extern void PanoramiXExtensionInit(void);
#endif
#ifdef RANDR
extern Bool noRRExtension;
extern void RRExtensionInit(void);
#endif
#if defined(XRECORD) && !defined(XorgLoader)
extern void RecordExtensionInit(void);
#endif
extern Bool noRenderExtension;
extern void RenderExtensionInit(void);
#if defined(RES) && !defined(XorgLoader)
#include <X11/extensions/XResproto.h>
extern Bool noResExtension;
extern void ResExtensionInit(void);
#endif
#if defined(SCREENSAVER) && !defined(XorgLoader)
#include <X11/extensions/saver.h>
extern Bool noScreenSaverExtension;
extern void ScreenSaverExtensionInit(void);
#endif
#include <X11/extensions/shapeproto.h>
extern void ShapeExtensionInit(void);
#ifdef MITSHM
#include <X11/extensions/shm.h>
#include <X11/extensions/shmproto.h>
extern Bool noMITShmExtension;
extern void ShmExtensionInit(void);
#endif
extern void SyncExtensionInit(void);
extern void XCMiscExtensionInit(void);
#ifdef XCSECURITY
#include <X11/extensions/secur.h>
#include "securitysrv.h"
extern Bool noSecurityExtension;
extern void SecurityExtensionInit(void);
#endif
#ifdef XF86BIGFONT
#include <X11/extensions/xf86bigfproto.h>
extern Bool noXFree86BigfontExtension;
extern void XFree86BigfontExtensionInit(void);
#endif
extern void BigReqExtensionInit(void);
#ifdef XFIXES
extern Bool noXFixesExtension;
extern void XFixesExtensionInit(void);
#endif
extern void XInputExtensionInit(void);
extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev,