summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-02-22 17:32:26 +0100
committerEnrico Weigelt, metux IT consult <info@metux.net>2024-05-08 09:37:35 +0200
commite5c8b664d392afd626b03a0f06e7ad186beeaa5e (patch)
tree24678a9aabbaaf7588c344965aa582de8cbd7fb6
parent1fdf97f28d19fe070838e1bcdc8a2ba3e767bed4 (diff)
os: unexport ddx callbacks
The DDX callbacks (where core/DIX calls into DDX) aren't supposed to be called by drivers directly, so unexport them. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1332>
-rw-r--r--dix/dispatch.c1
-rw-r--r--dix/main.c1
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c1
-rw-r--r--hw/kdrive/src/kdrive.c2
-rw-r--r--hw/vfb/InitOutput.c1
-rw-r--r--hw/xfree86/common/xf86Configure.c1
-rw-r--r--hw/xfree86/common/xf86Init.c1
-rw-r--r--hw/xnest/Args.c2
-rw-r--r--hw/xnest/Init.c1
-rw-r--r--hw/xquartz/darwin.c1
-rw-r--r--hw/xwayland/xwayland.c1
-rw-r--r--hw/xwin/InitOutput.c8
-rw-r--r--hw/xwin/winprocarg.c1
-rw-r--r--include/os.h14
-rw-r--r--os/ddx_priv.h27
-rw-r--r--os/inputthread.c2
-rw-r--r--os/log.c4
-rw-r--r--os/utils.c2
18 files changed, 50 insertions, 21 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 4a7d0565f..fee0f171c 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -110,6 +110,7 @@ Equipment Corporation.
#include "dix/registry_priv.h"
#include "dix/screenint_priv.h"
#include "os/auth.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "windowstr.h"
diff --git a/dix/main.c b/dix/main.c
index 09341f34e..263bce602 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -90,6 +90,7 @@ Equipment Corporation.
#include "os/audit.h"
#include "os/auth.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 857e790fe..25c078bfb 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -29,6 +29,7 @@
#include "dix/dix_priv.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "ephyr.h"
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 2145f64cb..aeefa01fb 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -26,6 +26,7 @@
#include "dix/screenint_priv.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
@@ -33,6 +34,7 @@
#include <mivalidate.h>
#include <dixstruct.h>
#include "privates.h"
+
#ifdef RANDR
#include <randrstr.h>
#endif
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index e4b75a796..b052e52fe 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -40,6 +40,7 @@ from The Open Group.
#include "dix/screenint_priv.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index a29c5460e..afa1328a0 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -29,6 +29,7 @@
#include <errno.h>
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "xf86.h"
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 93f14318d..71e0a0a96 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -52,6 +52,7 @@
#include "config/dbus-core.h"
#include "dix/screenint_priv.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "input.h"
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c
index 76544eb2d..adea553d6 100644
--- a/hw/xnest/Args.c
+++ b/hw/xnest/Args.c
@@ -20,6 +20,8 @@ is" without express or implied warranty.
#include <X11/Xdefs.h>
#include <X11/Xproto.h>
+#include "os/ddx_priv.h"
+
#include "screenint.h"
#include "input.h"
#include "misc.h"
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index 194119ff8..cd555edbb 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -22,6 +22,7 @@ is" without express or implied warranty.
#include <X11/fonts/fontstruct.h>
#include "dix/screenint_priv.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "screenint.h"
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 56530ec30..1ec244b03 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -36,6 +36,7 @@
#include <X11/X.h>
#include <X11/Xproto.h>
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "os.h"
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 499c2cc1f..cbd2437d6 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -37,6 +37,7 @@
#include "dix/dix_priv.h"
#include "dix/screenint_priv.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include <selection.h>
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 47ec5ba77..4d0bbdfa3 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -32,10 +32,13 @@ from The Open Group.
#include <xwin-config.h>
#endif
+#include "win.h"
+
#include "dix/dix_priv.h"
+#include "dix/screenint_priv.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
-#include "win.h"
#include "winmsg.h"
#include "winconfig.h"
#include "winprefs.h"
@@ -60,9 +63,6 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
DWORD dwFlags, LPTSTR pszPath);
#endif
-#include "dix/screenint_priv.h"
-#include "os/osdep.h"
-
#include "winmonitors.h"
#include "nonsdk_extinit.h"
#include "extinit_priv.h"
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 9142cc5d0..4f753982f 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -37,6 +37,7 @@ from The Open Group.
#include "os/cmdline.h"
#include "os/osdep.h"
+#include "os/ddx_priv.h"
#include <../xfree86/common/xorgVersion.h>
#include "win.h"
diff --git a/include/os.h b/include/os.h
index a07aedf1a..7a4bc2351 100644
--- a/include/os.h
+++ b/include/os.h
@@ -86,10 +86,6 @@ typedef struct _NewClientRec *NewClientPtr;
#include <stdio.h>
#include <stdarg.h>
-#ifdef DDXBEFORERESET
-extern void ddxBeforeReset(void);
-#endif
-
extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready);
extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ );
@@ -273,12 +269,6 @@ GetClientFd(ClientPtr);
extern _X_EXPORT Bool
ClientIsLocal(ClientPtr client);
-extern _X_EXPORT int
-ddxProcessArgument(int /*argc */ , char * /*argv */ [], int /*i */ );
-
-extern _X_EXPORT void
-ddxUseMsg(void);
-
/* stuff for ReplyCallback */
extern _X_EXPORT CallbackListPtr ReplyCallback;
typedef struct {
@@ -300,10 +290,6 @@ enum ExitCode {
EXIT_ERR_DRIVERS = 3,
};
-extern _X_EXPORT void
-ddxGiveUp(enum ExitCode error);
-extern _X_EXPORT void
-ddxInputThreadInit(void);
extern _X_EXPORT int
TimeSinceLastInputEvent(void);
diff --git a/os/ddx_priv.h b/os/ddx_priv.h
new file mode 100644
index 000000000..5fd584c39
--- /dev/null
+++ b/os/ddx_priv.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: MIT OR X11
+ *
+ * Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
+ */
+#ifndef _XSERVER_OS_DDX_PRIV_H
+#define _XSERVER_OS_DDX_PRIV_H
+
+#include "os.h"
+
+/* callbacks of the DDX, which are called by DIX or OS layer.
+ DDX's need to implement these in order to handle DDX specific things.
+*/
+
+/* called before server reset */
+void ddxBeforeReset(void);
+
+/* called by ProcessCommandLine, so DDX can catch cmdline args */
+int ddxProcessArgument(int argc, char *argv[], int i);
+
+/* print DDX specific usage message */
+void ddxUseMsg(void);
+
+void ddxGiveUp(enum ExitCode error);
+
+void ddxInputThreadInit(void);
+
+#endif /* _XSERVER_OS_DDX_PRIV_H */
diff --git a/os/inputthread.c b/os/inputthread.c
index 3469cfc1c..07f192c40 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -35,6 +35,8 @@
#include <unistd.h>
#include <pthread.h>
+#include "os/ddx_priv.h"
+
#include "inputstr.h"
#include "opaque.h"
#include "osdep.h"
diff --git a/os/log.c b/os/log.c
index c6869bdbb..0f62f864e 100644
--- a/os/log.c
+++ b/os/log.c
@@ -87,10 +87,10 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <time.h>
#include <X11/Xos.h>
-#include "os/osdep.h"
-
#include "os/audit.h"
+#include "os/ddx_priv.h"
#include "os/fmt.h"
+#include "os/osdep.h"
#include "input.h"
#include "opaque.h"
diff --git a/os/utils.c b/os/utils.c
index 332d1f72e..cf579aa3e 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -97,7 +97,6 @@ __stdcall unsigned long GetTickCount(void);
#include <sys/stat.h>
#include <ctype.h> /* for isspace */
#include <stdarg.h>
-
#include <stdlib.h> /* for malloc() */
#if defined(TCPCONN)
@@ -109,6 +108,7 @@ __stdcall unsigned long GetTickCount(void);
#include "dix/dix_priv.h"
#include "os/auth.h"
#include "os/cmdline.h"
+#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "dixstruct.h"