From 7b49f3e94f4d1d9a43e86056df8bce1f7040c2df Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 23 Feb 2024 21:13:58 +0100 Subject: [PATCH] os: unexport client connection handling functions from public module API These functions aren't used by any known driver and it doesn't make much sense calling them from there. So it's better to unexport them. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xace.c | 1 + Xext/xtest.c | 1 + damageext/damageext.c | 1 + dix/events.c | 1 + dri3/dri3_request.c | 1 + glx/glxext.c | 1 + hw/xfree86/dri2/dri2.c | 1 + hw/xwayland/xwayland-drm-lease.c | 2 ++ include/os.h | 36 -------------------------------- os/osdep.h | 26 +++++++++++++++++++++++ randr/rrlease.c | 1 + record/record.c | 1 + 12 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Xext/xace.c b/Xext/xace.c index 6fe1059fc..c030be37c 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -26,6 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "regionstr.h" #include "gcstruct.h" #include "xacestr.h" +#include "osdep.h" CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 }; diff --git a/Xext/xtest.c b/Xext/xtest.c index d3a2c4be7..001e21486 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -58,6 +58,7 @@ #include "xserver-properties.h" #include "eventstr.h" #include "inpututils.h" +#include "osdep.h" Bool noTestExtensions = FALSE; diff --git a/damageext/damageext.c b/damageext/damageext.c index 35465642b..f1d3485d5 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -30,6 +30,7 @@ #include "damagestr.h" #include "protocol-versions.h" #include "dixstruct_priv.h" +#include "osdep.h" #ifdef XINERAMA #include "panoramiX.h" diff --git a/dix/events.c b/dix/events.c index 3f3ede2e6..37e639017 100644 --- a/dix/events.c +++ b/dix/events.c @@ -153,6 +153,7 @@ Equipment Corporation. #include "eventstr.h" #include "enterleave.h" #include "mi.h" +#include "osdep.h" #define _XkbWantsDetectableAutoRepeat(c) \ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask) diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c index 8e84f6470..1a2830e11 100644 --- a/dri3/dri3_request.c +++ b/dri3/dri3_request.c @@ -33,6 +33,7 @@ #include #include "randrstr_priv.h" #include "dixstruct_priv.h" +#include "osdep.h" static Bool dri3_screen_can_one_point_four(ScreenPtr screen) diff --git a/glx/glxext.c b/glx/glxext.c index 416db4a85..faffaee40 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -43,6 +43,7 @@ #include "indirect_table.h" #include "indirect_util.h" #include "glxvndabi.h" +#include "osdep.h" /* ** X resources. diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 2ea3ebe05..f6a5ab9f6 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -46,6 +46,7 @@ #include "dri2int.h" #include "damage.h" #include "xf86.h" +#include "osdep.h" CARD8 dri2_major; /* version of DRI2 supported by DDX */ CARD8 dri2_minor; diff --git a/hw/xwayland/xwayland-drm-lease.c b/hw/xwayland/xwayland-drm-lease.c index 224ad4c73..a6c31468e 100644 --- a/hw/xwayland/xwayland-drm-lease.c +++ b/hw/xwayland/xwayland-drm-lease.c @@ -36,6 +36,8 @@ #include "xwayland-screen.h" #include "xwayland-output.h" +#include "osdep.h" + static void xwl_randr_lease_cleanup_outputs(RRLeasePtr rrLease) { diff --git a/include/os.h b/include/os.h index 80b9d5818..6093b383e 100644 --- a/include/os.h +++ b/include/os.h @@ -84,35 +84,9 @@ typedef struct _NewClientRec *NewClientPtr; #include #include -extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ ); - -extern _X_EXPORT int WriteFdToClient(ClientPtr client, int fd, Bool do_close); - -extern _X_EXPORT Bool InsertFakeRequest(ClientPtr /*client */ , - char * /*data */ , - int /*count */ ); - -extern _X_EXPORT void ResetCurrentRequest(ClientPtr /*client */ ); - -extern _X_EXPORT void FlushAllOutput(void); - -extern _X_EXPORT void FlushIfCriticalOutputPending(void); - -extern _X_EXPORT void SetCriticalOutputPending(void); - extern _X_EXPORT int WriteToClient(ClientPtr /*who */ , int /*count */ , const void * /*buf */ ); -extern _X_EXPORT void ResetOsBuffers(void); - -extern _X_EXPORT void NotifyParentProcess(void); - -extern _X_EXPORT void CreateWellKnownSockets(void); - -extern _X_EXPORT void ResetWellKnownSockets(void); - -extern _X_EXPORT void CloseWellKnownConnections(void); - extern _X_EXPORT XID AuthorizationIDOfClient(ClientPtr /*client */ ); extern _X_EXPORT const char *ClientAuthorized(ClientPtr /*client */ , @@ -139,10 +113,6 @@ extern _X_EXPORT void IgnoreClient(ClientPtr /*client */ ); extern _X_EXPORT void AttendClient(ClientPtr /*client */ ); -extern _X_EXPORT void ListenOnOpenFD(int /* fd */ , int /* noxauth */ ); - -extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ ); - extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); @@ -247,12 +217,6 @@ OsRegisterSigWrapper(OsSigWrapperPtr newWrap); extern _X_EXPORT Bool PrivsElevated(void); -extern _X_EXPORT int -GetClientFd(ClientPtr); - -extern _X_EXPORT Bool -ClientIsLocal(ClientPtr client); - /* stuff for ReplyCallback */ extern _X_EXPORT CallbackListPtr ReplyCallback; typedef struct { diff --git a/os/osdep.h b/os/osdep.h index ffc43834f..a0efe69c3 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -223,4 +223,30 @@ extern Bool AllowByteSwappedClients; int Ones(unsigned long mask); +Bool WaitForSomething(Bool clients_are_ready); +int ReadRequestFromClient(ClientPtr client); +int ReadFdFromClient(ClientPtr client); +int WriteFdToClient(ClientPtr client, int fd, Bool do_close); +Bool InsertFakeRequest(ClientPtr client, char *data, int count); +void FlushAllOutput(void); +void FlushIfCriticalOutputPending(void); +void SetCriticalOutputPending(void); +void ResetOsBuffers(void); +void NotifyParentProcess(void); +void CreateWellKnownSockets(void); +void ResetWellKnownSockets(void); +void CloseWellKnownConnections(void); +void CloseDownConnection(ClientPtr client); + +int OnlyListenToOneClient(ClientPtr client); +void MakeClientGrabImpervious(ClientPtr client); +void MakeClientGrabPervious(ClientPtr client); +void ListenOnOpenFD(int fd, int noxauth); +Bool AddClientOnOpenFD(int fd); +int GetClientFd(ClientPtr); +Bool ClientIsLocal(ClientPtr client); + +/* not used by external modules, but internal ones, thus need to be dl visible */ +extern _X_EXPORT void ResetCurrentRequest(ClientPtr client); + #endif /* _OSDEP_H_ */ diff --git a/randr/rrlease.c b/randr/rrlease.c index 4d92b4af9..fd14d4e10 100644 --- a/randr/rrlease.c +++ b/randr/rrlease.c @@ -22,6 +22,7 @@ #include #include +#include "osdep.h" #include "dix/dix_priv.h" #include "randr/randrstr_priv.h" diff --git a/record/record.c b/record/record.c index 014588d43..b22dee911 100644 --- a/record/record.c +++ b/record/record.c @@ -49,6 +49,7 @@ and Jim Haggerty of Metheus. #include "swaprep.h" #include "inputstr.h" #include "scrnintstr.h" +#include "osdep.h" #ifdef XINERAMA #include "globals.h"