Skip to content

Commit a1d41e3

Browse files
fooishbarkeith-packard
authored andcommitted
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 <[email protected]> Reviewed-by: Peter Hutterer <[email protected]> Signed-off-by: Keith Packard <[email protected]>
1 parent b86aa74 commit a1d41e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+264
-274
lines changed

Xext/bigreq.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ from The Open Group.
3838
#include "extnsionst.h"
3939
#include <X11/extensions/bigreqsproto.h>
4040
#include "opaque.h"
41-
#include "modinit.h"
42-
43-
void BigReqExtensionInit(void);
41+
#include "extinit.h"
4442

4543
static int
4644
ProcBigReqDispatch(ClientPtr client)

Xext/dpms.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Equipment Corporation.
3939
#include "opaque.h"
4040
#include <X11/extensions/dpmsproto.h>
4141
#include "dpmsproc.h"
42-
#include "modinit.h"
42+
#include "extinit.h"
4343

4444
static int
4545
ProcDPMSGetVersion(ClientPtr client)

Xext/geext.c

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "geint.h"
3333
#include "geext.h"
3434
#include "protocol-versions.h"
35+
#include "extinit.h"
3536

3637
DevPrivateKeyRec GEClientPrivateKeyRec;
3738

Xext/geext.h

-2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,4 @@ extern _X_EXPORT void GERegisterExtension(int extension,
7878

7979
extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension);
8080

81-
extern _X_EXPORT void GEExtensionInit(void);
82-
8381
#endif /* _GEEXT_H_ */

Xext/panoramiX.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Equipment Corporation.
5959
#ifdef COMPOSITE
6060
#include "compint.h"
6161
#endif
62-
#include "modinit.h"
62+
#include "extinit.h"
6363
#include "protocol-versions.h"
6464

6565
#ifdef GLXPROXY

Xext/saver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ in this Software without prior written authorization from the X Consortium.
5858

5959
#include <stdio.h>
6060

61-
#include "modinit.h"
61+
#include "extinit.h"
6262

6363
static int ScreenSaverEventBase = 0;
6464

Xext/security.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group.
3838
#include "xacestr.h"
3939
#include "securitysrv.h"
4040
#include <X11/extensions/securproto.h>
41-
#include "modinit.h"
41+
#include "extinit.h"
4242
#include "protocol-versions.h"
4343

4444
/* Extension stuff */

Xext/shape.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ in this Software without prior written authorization from The Open Group.
4444
#include <X11/extensions/shapeproto.h>
4545
#include "regionstr.h"
4646
#include "gcstruct.h"
47-
#include "modinit.h"
47+
#include "extinit.h"
4848
#include "protocol-versions.h"
4949

5050
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */

Xext/shm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ in this Software without prior written authorization from The Open Group.
8787
#include "panoramiXsrv.h"
8888
#endif
8989

90-
#include "modinit.h"
90+
#include "extinit.h"
9191

9292
typedef struct _ShmDesc {
9393
struct _ShmDesc *next;

Xext/sync.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ PERFORMANCE OF THIS SOFTWARE.
7676
#include <sys/time.h>
7777
#endif
7878

79-
#include "modinit.h"
79+
#include "extinit.h"
8080

8181
/*
8282
* Local Global Variables

Xext/syncsrv.h

-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ extern void SyncChangeCounter(SyncCounter *pCounter,
134134

135135
extern void SyncDestroySystemCounter(pointer pCounter);
136136

137-
extern void SyncExtensionInit(void);
138-
139137
extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev);
140138
extern void SyncRemoveDeviceIdleTime(SyncCounter *counter);
141139
#endif /* _SYNCSRV_H_ */

Xext/xcmisc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ from The Open Group.
3838
#include "extnsionst.h"
3939
#include "swaprep.h"
4040
#include <X11/extensions/xcmiscproto.h>
41-
#include "modinit.h"
41+
#include "extinit.h"
4242

4343
#include <stdint.h>
4444

Xext/xf86bigfont.c

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include "gcstruct.h"
7272
#include "dixfontstr.h"
7373
#include "extnsionst.h"
74+
#include "extinit.h"
7475
#include "protocol-versions.h"
7576

7677
#include <X11/extensions/xf86bigfproto.h>

Xext/xf86bigfontsrv.h

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include <X11/fonts/font.h>
2929

30-
extern void XFree86BigfontExtensionInit(void);
3130
extern void XF86BigfontFreeFontShm(FontPtr);
3231
extern void XF86BigfontCleanup(void);
3332

Xext/xres.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "pixmapstr.h"
2222
#include "windowstr.h"
2323
#include "gcstruct.h"
24-
#include "modinit.h"
24+
#include "extinit.h"
2525
#include "protocol-versions.h"
2626
#include "client.h"
2727
#include "list.h"

Xext/xselinux_ext.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2626
#include "windowstr.h"
2727
#include "propertyst.h"
2828
#include "extnsionst.h"
29-
#include "modinit.h"
29+
#include "extinit.h"
3030
#include "xselinuxint.h"
3131

3232
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)

Xext/xtest.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#include "eventstr.h"
5656
#include "inpututils.h"
5757

58-
#include "modinit.h"
58+
#include "extinit.h"
5959

6060
extern int DeviceValuator;
6161

Xext/xvdix.h

-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ typedef struct {
235235
extern _X_EXPORT int ProcXvDispatch(ClientPtr);
236236
extern _X_EXPORT int SProcXvDispatch(ClientPtr);
237237

238-
extern _X_EXPORT void XvExtensionInit(void);
239238
extern _X_EXPORT int XvScreenInit(ScreenPtr);
240239
extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
241240
extern _X_EXPORT unsigned long XvGetRTPort(void);

Xext/xvmain.c

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ SOFTWARE.
8888
#include "pixmapstr.h"
8989
#include "gc.h"
9090
#include "extnsionst.h"
91+
#include "extinit.h"
9192
#include "dixstruct.h"
9293
#include "resource.h"
9394
#include "opaque.h"

Xext/xvmc.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "resource.h"
1414
#include "scrnintstr.h"
1515
#include "extnsionst.h"
16+
#include "extinit.h"
1617
#include "servermd.h"
1718
#include <X11/Xfuncproto.h>
1819
#include "xvdix.h"

Xext/xvmcext.h

-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ typedef struct {
8585
} XvMCAdaptorRec, *XvMCAdaptorPtr;
8686

8787
#ifndef XorgLoader
88-
extern _X_EXPORT void XvMCExtensionInit(void);
89-
9088
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
9189
int num, XvMCAdaptorPtr adapt);
9290

composite/compext.c

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "compint.h"
4949
#include "xace.h"
5050
#include "protocol-versions.h"
51+
#include "extinit.h"
5152

5253
static CARD8 CompositeReqCode;
5354
static DevPrivateKeyRec CompositeClientPrivateKeyRec;

composite/compint.h

-7
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,6 @@ Bool
228228
compReallocPixmap(WindowPtr pWin, int x, int y,
229229
unsigned int w, unsigned int h, int bw);
230230

231-
/*
232-
* compext.c
233-
*/
234-
235-
void
236-
CompositeExtensionInit(void);
237-
238231
/*
239232
* compinit.c
240233
*/

damageext/Makefile.am

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ AM_CFLAGS = $(DIX_CFLAGS)
44

55
libdamageext_la_SOURCES = \
66
damageext.c \
7-
damageext.h \
87
damageextint.h

damageext/damageext.c

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "damageextint.h"
2828
#include "protocol-versions.h"
29+
#include "extinit.h"
2930

3031
static unsigned char DamageReqCode;
3132
static int DamageEventBase;

damageext/damageextint.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "windowstr.h"
3838
#include "selection.h"
3939
#include "scrnintstr.h"
40-
#include "damageext.h"
4140
#include "damage.h"
4241
#include "xfixes.h"
4342

dbe/dbe.c

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <X11/Xproto.h>
4343
#include "scrnintstr.h"
4444
#include "extnsionst.h"
45+
#include "extinit.h"
4546
#include "gcstruct.h"
4647
#include "dixstruct.h"
4748
#define NEED_DBE_PROTOCOL

dbe/dbestruct.h

-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ typedef struct {
8383
/* Marker for free elements in the buffer ID array. */
8484
#define DBE_FREE_ID_ELEMENT 0
8585

86-
extern _X_EXPORT void DbeExtensionInit(void);
87-
8886
/* TYPEDEFS */
8987

9088
/* Record used to pass swap information between DIX and DDX swapping

glx/glxext.c

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <registry.h>
4040
#include "privates.h"
4141
#include <os.h>
42+
#include "extinit.h"
4243
#include "unpack.h"
4344
#include "glxutil.h"
4445
#include "glxext.h"
@@ -338,6 +339,9 @@ GlxExtensionInit(void)
338339
if (!__glXContextRes || !__glXDrawableRes)
339340
return;
340341

342+
if (serverGeneration == 1)
343+
GlxPushProvider(&__glXDRISWRastProvider);
344+
341345
if (!dixRegisterPrivateKey
342346
(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
343347
return;

glx/glxserver.h

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ extern __GLXclientState *glxGetClient(ClientPtr pClient);
7676

7777
/************************************************************************/
7878

79-
void GlxExtensionInit(void);
80-
8179
void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates);
8280

8381
void __glXScreenInitVisuals(__GLXscreen * screen);

hw/dmx/dmx.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "os.h"
5353
#include "dixstruct.h"
5454
#include "extnsionst.h"
55+
#include "extinit.h"
5556
#include "opaque.h"
5657

5758
#include "dmxextension.h"
@@ -65,8 +66,6 @@ extern unsigned long XRT_WINDOW;
6566
extern int PanoramiXNumScreens;
6667
#endif
6768

68-
extern void DMXExtensionInit(void);
69-
7069
static unsigned char DMXCode;
7170

7271
static int

hw/dmx/glxProxy/glxext.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "glxvisuals.h"
4545
#include "micmap.h"
4646
#include "glxswap.h"
47+
#include "extinit.h"
4748

4849
/*
4950
** Forward declarations.

hw/dmx/glxProxy/glxext.h

-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *);
6464
extern int __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc);
6565
extern int __glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc);
6666

67-
extern void GlxExtensionInit(void);
68-
6967
extern Bool __glXCoreType(void);
7068

7169
#endif /* _glxext_h_ */

hw/xfree86/common/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
4545
xf86Option.c xf86Init.c \
4646
xf86VidMode.c xf86fbman.c xf86cmap.c \
4747
xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
48-
xf86Mode.c xorgHelper.c \
48+
xf86Mode.c xorgHelper.c xf86Extensions.h \
4949
$(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
5050
nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
5151
libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la

hw/xfree86/common/vidmodeproc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ typedef union {
3939
float f;
4040
} vidMonitorValue;
4141

42-
extern _X_EXPORT void XFree86VidModeExtensionInit(void);
42+
extern Bool VidModeExtensionInit(ScreenPtr pScreen);
4343

4444
extern _X_EXPORT Bool VidModeAvailable(int scrnIndex);
4545
extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode,

hw/xfree86/common/xf86.h

-5
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,6 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
449449
Bool resetMode);
450450
#endif
451451

452-
/* xf86VidModeExtentionInit.c */
453-
454-
extern _X_EXPORT Bool
455-
VidModeExtensionInit(ScreenPtr pScreen);
456-
457452
/* convert ScreenPtr to ScrnInfoPtr */
458453
extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
459454
/* convert ScrnInfoPtr to ScreenPtr */

hw/xfree86/common/xf86Extensions.h

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright © 2011 Daniel Stone
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice (including the next
12+
* paragraph) shall be included in all copies or substantial portions of the
13+
* Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21+
* DEALINGS IN THE SOFTWARE.
22+
*
23+
* Author: Daniel Stone <[email protected]>
24+
*/
25+
26+
#ifndef XF86EXTENSIONS_H
27+
#define XF86EXTENSIONS_H
28+
29+
#include "extnsionst.h"
30+
31+
#ifdef XF86DRI
32+
extern Bool noXFree86DRIExtension;
33+
extern void XFree86DRIExtensionInit(void);
34+
#endif
35+
36+
#ifdef DRI2
37+
#include <X11/extensions/dri2proto.h>
38+
extern void DRI2ExtensionInit(void);
39+
#endif
40+
41+
#ifdef XF86VIDMODE
42+
#include <X11/extensions/xf86vmproto.h>
43+
extern Bool noXFree86VidModeExtension;
44+
extern void XFree86VidModeExtensionInit(void);
45+
#endif
46+
47+
#ifdef XFreeXDGA
48+
#include <X11/extensions/xf86dgaproto.h>
49+
extern Bool noXFree86DGAExtension;
50+
extern void XFree86DGAExtensionInit(void);
51+
extern void XFree86DGARegister(void);
52+
#endif
53+
54+
#endif

0 commit comments

Comments
 (0)