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).
parent 0b8f8b24
......@@ -62,6 +62,9 @@ endif
XINERAMA_SRCS = panoramiX.c panoramiX.h panoramiXh.h panoramiXsrv.h panoramiXprocs.c panoramiXSwap.c
if XINERAMA
BUILTIN_SRCS += $(XINERAMA_SRCS)
if XORG
sdk_HEADERS += panoramiXsrv.h panoramiX.h
endif
endif
# X-ACE extension: provides hooks for building security policy extensions
......
......@@ -39,16 +39,16 @@
#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
_X_EXPORT int GEEventBase;
_X_EXPORT int GEErrorBase;
int GEEventBase;
int GEErrorBase;
static int GEClientPrivateKeyIndex;
_X_EXPORT DevPrivateKey GEClientPrivateKey = &GEClientPrivateKeyIndex;
_X_EXPORT int GEEventType; /* The opcode for all GenericEvents will have. */
DevPrivateKey GEClientPrivateKey = &GEClientPrivateKeyIndex;
int GEEventType; /* The opcode for all GenericEvents will have. */
int RT_GECLIENT = 0;
_X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
GEExtension GEExtensions[MAXEXTENSIONS];
/* Major available requests */
static const int version_requests[] = {
......@@ -101,7 +101,7 @@ ProcGEQueryVersion(ClientPtr client)
return(client->noClientException);
}
_X_EXPORT int (*ProcGEVector[GENumberRequests])(ClientPtr) = {
int (*ProcGEVector[GENumberRequests])(ClientPtr) = {
/* Version 1.0 */
ProcGEQueryVersion
};
......@@ -122,7 +122,7 @@ SProcGEQueryVersion(ClientPtr client)
return(*ProcGEVector[stuff->ReqType])(client);
}
_X_EXPORT int (*SProcGEVector[GENumberRequests])(ClientPtr) = {
int (*SProcGEVector[GENumberRequests])(ClientPtr) = {
/* Version 1.0 */
SProcGEQueryVersion
};
......@@ -258,7 +258,7 @@ GEClientGone(WindowPtr pWin, XID id)
* Since other extensions may rely on XGE (XInput does already), it is a good
* idea to init XGE first, before any other extension.
*/
_X_EXPORT void
void
GEExtensionInit(void)
{
ExtensionEntry *extEntry;
......@@ -300,7 +300,7 @@ GEExtensionInit(void)
* @param ev_fill Called for an event before delivery. The extension now has
* the chance to fill in necessary fields for the event.
*/
_X_EXPORT void
void
GERegisterExtension(int extension,
void (*ev_swap)(xGenericEvent* from, xGenericEvent* to),
void (*ev_fill)(xGenericEvent* ev, DeviceIntPtr pDev,
......@@ -318,7 +318,7 @@ GERegisterExtension(int extension,
/* Sets type and extension field for a generic event. This is just an
* auxiliary function, extensions could do it manually too.
*/
_X_EXPORT void
void
GEInitEvent(xGenericEvent* ev, int extension)
{
ev->type = GenericEvent;
......@@ -356,7 +356,7 @@ GERecalculateWinMask(WindowPtr pWin)
}
/* Set generic event mask for given window. */
_X_EXPORT void
void
GEWindowSetMask(ClientPtr pClient, DeviceIntPtr pDev,
WindowPtr pWin, int extension, Mask mask)
{
......@@ -443,7 +443,7 @@ GEWindowSetMask(ClientPtr pClient, DeviceIntPtr pDev,
* @param extension Extension ID
* @param mask Event mask
*/
_X_EXPORT BOOL
BOOL
GEDeviceMaskIsSet(WindowPtr pWin, DeviceIntPtr pDev,
int extension, Mask mask)
{
......
......@@ -66,7 +66,7 @@ typedef struct _GEExtension {
/* All registered extensions and their handling functions. */
extern GEExtension GEExtensions[MAXEXTENSIONS];
extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
/* Returns the extension offset from the event */
#define GEEXT(ev) (((xGenericEvent*)(ev))->extension)
......@@ -95,20 +95,20 @@ extern GEExtension GEExtensions[MAXEXTENSIONS];
/* Interface for other extensions */
void GEWindowSetMask(ClientPtr pClient, DeviceIntPtr pDev,
extern _X_EXPORT void GEWindowSetMask(ClientPtr pClient, DeviceIntPtr pDev,
WindowPtr pWin, int extension, Mask mask);
void GERegisterExtension(
extern _X_EXPORT void GERegisterExtension(
int extension,
void (*ev_dispatch)(xGenericEvent* from, xGenericEvent* to),
void (*ev_fill)(xGenericEvent* ev, DeviceIntPtr pDev,
WindowPtr pWin, GrabPtr pGrab)
);
void GEInitEvent(xGenericEvent* ev, int extension);
BOOL GEDeviceMaskIsSet(WindowPtr pWin, DeviceIntPtr pDev,
extern _X_EXPORT void GEInitEvent(xGenericEvent* ev, int extension);
extern _X_EXPORT BOOL GEDeviceMaskIsSet(WindowPtr pWin, DeviceIntPtr pDev,
int extension, Mask mask);
void GEExtensionInit(void);
extern _X_EXPORT void GEExtensionInit(void);
#endif /* _GEEXT_H_ */
......@@ -38,10 +38,10 @@
#include "extnsionst.h"
#include <X11/extensions/geproto.h>
extern int GEEventType;
extern int GEEventBase;
extern int GEErrorBase;
extern DevPrivateKey GEClientPrivateKey;
extern _X_EXPORT int GEEventType;
extern _X_EXPORT int GEEventBase;
extern _X_EXPORT int GEErrorBase;
extern _X_EXPORT DevPrivateKey GEClientPrivateKey;
typedef struct _GEClientInfo {
CARD32 major_version;
......@@ -50,7 +50,7 @@ typedef struct _GEClientInfo {
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
extern int (*ProcGEVector[/*GENumRequests*/])(ClientPtr);
extern int (*SProcGEVector[/*GENumRequests*/])(ClientPtr);
extern _X_EXPORT int (*ProcGEVector[/*GENumRequests*/])(ClientPtr);
extern _X_EXPORT int (*SProcGEVector[/*GENumRequests*/])(ClientPtr);
#endif /* _GEINT_H_ */
......@@ -71,9 +71,9 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
int PanoramiXPixWidth = 0;
int PanoramiXPixHeight = 0;
_X_EXPORT int PanoramiXNumScreens = 0;
int PanoramiXNumScreens = 0;
_X_EXPORT PanoramiXData *panoramiXdataPtr = NULL;
PanoramiXData *panoramiXdataPtr = NULL;
static RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
static int PanoramiXNumDepths;
......@@ -81,14 +81,14 @@ static DepthPtr PanoramiXDepths;
static int PanoramiXNumVisuals;
static VisualPtr PanoramiXVisuals;
_X_EXPORT unsigned long XRC_DRAWABLE;
_X_EXPORT unsigned long XRT_WINDOW;
_X_EXPORT unsigned long XRT_PIXMAP;
_X_EXPORT unsigned long XRT_GC;
_X_EXPORT unsigned long XRT_COLORMAP;
unsigned long XRC_DRAWABLE;
unsigned long XRT_WINDOW;
unsigned long XRT_PIXMAP;
unsigned long XRT_GC;
unsigned long XRT_COLORMAP;
static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
_X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
/*
* Function prototypes
......@@ -328,7 +328,7 @@ XineramaDestroyClip(GCPtr pGC)
Xinerama_GC_FUNC_EPILOGUE (pGC);
}
_X_EXPORT int
int
XineramaDeleteResource(pointer data, XID id)
{
xfree(data);
......@@ -371,7 +371,7 @@ typedef struct _connect_callback_list {
static XineramaConnectionCallbackList *ConnectionCallbackList = NULL;
_X_EXPORT Bool
Bool
XineramaRegisterConnectionBlockCallback(void (*func)(void))
{
XineramaConnectionCallbackList *newlist;
......@@ -839,7 +839,7 @@ PanoramiXConsolidate(void)
AddResource(defmap->info[0].id, XRT_COLORMAP, defmap);
}
_X_EXPORT VisualID
VisualID
PanoramiXTranslateVisualID(int screen, VisualID orig)
{
ScreenPtr pOtherScreen = screenInfo.screens[screen];
......
......@@ -8,27 +8,27 @@
#include "panoramiX.h"
extern int PanoramiXNumScreens;
extern PanoramiXData *panoramiXdataPtr;
extern int PanoramiXPixWidth;
extern int PanoramiXPixHeight;
extern _X_EXPORT int PanoramiXNumScreens;
extern _X_EXPORT PanoramiXData *panoramiXdataPtr;
extern _X_EXPORT int PanoramiXPixWidth;
extern _X_EXPORT int PanoramiXPixHeight;
extern VisualID PanoramiXTranslateVisualID(int screen, VisualID orig);
extern void PanoramiXConsolidate(void);
extern Bool PanoramiXCreateConnectionBlock(void);
extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
extern int XineramaDeleteResource(pointer, XID);
extern _X_EXPORT VisualID PanoramiXTranslateVisualID(int screen, VisualID orig);
extern _X_EXPORT void PanoramiXConsolidate(void);
extern _X_EXPORT Bool PanoramiXCreateConnectionBlock(void);
extern _X_EXPORT PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
extern _X_EXPORT Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
extern void XineramaReinitData(ScreenPtr);
extern _X_EXPORT void XineramaReinitData(ScreenPtr);
extern RegionRec XineramaScreenRegions[MAXSCREENS];
extern _X_EXPORT RegionRec XineramaScreenRegions[MAXSCREENS];
extern unsigned long XRC_DRAWABLE;
extern unsigned long XRT_WINDOW;
extern unsigned long XRT_PIXMAP;
extern unsigned long XRT_GC;
extern unsigned long XRT_COLORMAP;
extern _X_EXPORT unsigned long XRC_DRAWABLE;
extern _X_EXPORT unsigned long XRT_WINDOW;
extern _X_EXPORT unsigned long XRT_PIXMAP;
extern _X_EXPORT unsigned long XRT_GC;
extern _X_EXPORT unsigned long XRT_COLORMAP;
/*
* Drivers are allowed to wrap this function. Each wrapper can decide that the
......@@ -38,9 +38,9 @@ extern unsigned long XRT_COLORMAP;
* screen 0.
*/
typedef Bool (*XineramaVisualsEqualProcPtr)(VisualPtr, ScreenPtr, VisualPtr);
extern XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
extern _X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
extern void XineramaGetImageData(
extern _X_EXPORT void XineramaGetImageData(
DrawablePtr *pDrawables,
int left,
int top,
......
......@@ -136,7 +136,7 @@ typedef struct _ShapeEvent {
*
****************/
_X_EXPORT void
void
ShapeExtensionInit(void)
{
ExtensionEntry *extEntry;
......@@ -238,7 +238,7 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
return Success;
}
_X_EXPORT RegionPtr
RegionPtr
CreateBoundingShape (pWin)
WindowPtr pWin;
{
......@@ -251,7 +251,7 @@ CreateBoundingShape (pWin)
return REGION_CREATE(pWin->drawable.pScreen, &extents, 1);
}
_X_EXPORT RegionPtr
RegionPtr
CreateClipShape (pWin)
WindowPtr pWin;
{
......@@ -895,7 +895,7 @@ ProcShapeSelectInput (client)
* deliver the event
*/
_X_EXPORT void
void
SendShapeNotify (pWin, which)
WindowPtr pWin;
int which;
......
......@@ -132,9 +132,9 @@ static DISPATCH_PROC(SProcShmPutImage);
static DISPATCH_PROC(SProcShmQueryVersion);
static unsigned char ShmReqCode;
_X_EXPORT int ShmCompletionCode;
_X_EXPORT int BadShmSegCode;
_X_EXPORT RESTYPE ShmSegType;
int ShmCompletionCode;
int BadShmSegCode;
RESTYPE ShmSegType;
static ShmDescPtr Shmsegs;
static Bool sharedPixmaps;
static ShmFuncsPtr shmFuncs[MAXSCREENS];
......@@ -271,7 +271,7 @@ ShmResetProc(ExtensionEntry *extEntry)
}
}
_X_EXPORT void
void
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
{
shmFuncs[pScreen->myNum] = funcs;
......@@ -298,7 +298,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
return ret;
}
_X_EXPORT void
void
ShmRegisterFbFuncs(ScreenPtr pScreen)
{
shmFuncs[pScreen->myNum] = &fbFuncs;
......
......@@ -30,10 +30,14 @@
#include "pixmap.h"
#include "gc.h"
void
extern _X_EXPORT void
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
void
extern _X_EXPORT void
ShmRegisterFbFuncs(ScreenPtr pScreen);
extern _X_EXPORT RESTYPE ShmSegType;
extern _X_EXPORT int ShmCompletionCode;
extern _X_EXPORT int BadShmSegCode;
#endif /* _SHMINT_H_ */
......@@ -77,7 +77,7 @@ static void SertafiedWakeupHandler(
pointer /* LastSelectMask */
);
_X_EXPORT int
int
ClientSleepUntil (client, revive, notifyFunc, closure)
ClientPtr client;
TimeStamp *revive;
......
......@@ -80,7 +80,7 @@ void XaceHookAuditEnd(ClientPtr ptr, int result)
/* Entry point for hook functions. Called by Xserver.
*/
_X_EXPORT int XaceHook(int hook, ...)
int XaceHook(int hook, ...)
{
pointer calldata; /* data passed to callback */
int *prv = NULL; /* points to return value from callback */
......
......@@ -59,8 +59,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
/* Entry point for hook functions. Called by Xserver.
* Required by libdbe and libextmod
*/
extern int XaceHook(
extern _X_EXPORT int XaceHook(
int /*hook*/,
... /*appropriate args for hook*/
);
......
......@@ -1349,7 +1349,7 @@ static int (*XvProcVector[xvNumRequests])(ClientPtr) = {
ProcXvShmPutImage,
};
_X_EXPORT int
int
ProcXvDispatch(ClientPtr client)
{
REQUEST(xReq);
......@@ -1673,7 +1673,7 @@ static int (*SXvProcVector[xvNumRequests])(ClientPtr) = {
SProcXvShmPutImage,
};
_X_EXPORT int
int
SProcXvDispatch(ClientPtr client)
{
REQUEST(xReq);
......
......@@ -55,20 +55,20 @@ SOFTWARE.
#include "scrnintstr.h"
#include <X11/extensions/Xvproto.h>
extern unsigned long XvExtensionGeneration;
extern unsigned long XvScreenGeneration;
extern unsigned long XvResourceGeneration;
extern _X_EXPORT unsigned long XvExtensionGeneration;
extern _X_EXPORT unsigned long XvScreenGeneration;
extern _X_EXPORT unsigned long XvResourceGeneration;
extern int XvReqCode;
extern int XvEventBase;
extern int XvErrorBase;
extern _X_EXPORT int XvReqCode;
extern _X_EXPORT int XvEventBase;
extern _X_EXPORT int XvErrorBase;
extern unsigned long XvRTPort;
extern unsigned long XvRTEncoding;
extern unsigned long XvRTGrab;
extern unsigned long XvRTVideoNotify;
extern unsigned long XvRTVideoNotifyList;
extern unsigned long XvRTPortNotify;
extern _X_EXPORT unsigned long XvRTPort;
extern _X_EXPORT unsigned long XvRTEncoding;
extern _X_EXPORT unsigned long XvRTGrab;
extern _X_EXPORT unsigned long XvRTVideoNotify;
extern _X_EXPORT unsigned long XvRTVideoNotifyList;
extern _X_EXPORT unsigned long XvRTPortNotify;
typedef struct {
int numerator;
......@@ -234,42 +234,42 @@ typedef struct {
#define _XvBadPort (XvBadPort+XvErrorBase)
#define _XvBadEncoding (XvBadEncoding+XvErrorBase)
extern int ProcXvDispatch(ClientPtr);
extern int SProcXvDispatch(ClientPtr);
extern _X_EXPORT int ProcXvDispatch(ClientPtr);
extern _X_EXPORT int SProcXvDispatch(ClientPtr);
extern void XvExtensionInit(void);
extern int XvScreenInit(ScreenPtr);
extern DevPrivateKey XvGetScreenKey(void);
extern unsigned long XvGetRTPort(void);
extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);