diff options
author | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-02-23 20:52:02 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-15 21:21:40 +0000 |
commit | 389b5282037a8d0d168ce8b23229b739b8b21632 (patch) | |
tree | 8b7c6351cb566e5a5ee269835d8025c085a4cb0d | |
parent | dae76bbaafdb3fe4993c9f5122d6c7e85f556ea3 (diff) |
os: unexport command line args handling functions
These functions shouldn't be called by drivers or extensions, thus
shouldn't be exported. Also moving it to separate header, so the
already huge ones aren't cluttered with even more things.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1334>
-rw-r--r-- | dix/main.c | 1 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrinit.c | 3 | ||||
-rw-r--r-- | hw/kdrive/src/kdrive.c | 1 | ||||
-rw-r--r-- | hw/kdrive/src/kinput.c | 2 | ||||
-rw-r--r-- | hw/vfb/InitOutput.c | 1 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Init.c | 1 | ||||
-rw-r--r-- | hw/xfree86/os-support/bsd/bsd_init.c | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_init.c | 3 | ||||
-rw-r--r-- | hw/xfree86/os-support/solaris/sun_init.c | 2 | ||||
-rw-r--r-- | hw/xwayland/xwayland.c | 1 | ||||
-rw-r--r-- | hw/xwin/winprocarg.c | 2 | ||||
-rw-r--r-- | include/os.h | 13 | ||||
-rw-r--r-- | os/cmdline.h | 20 | ||||
-rw-r--r-- | os/utils.c | 1 | ||||
-rw-r--r-- | xkb/xkbInit.c | 3 |
15 files changed, 42 insertions, 14 deletions
diff --git a/dix/main.c b/dix/main.c index ea81defba..ef322eaff 100644 --- a/dix/main.c +++ b/dix/main.c @@ -87,6 +87,7 @@ Equipment Corporation. #include "dix/dix_priv.h" #include "dix/registry_priv.h" #include "os/audit.h" +#include "os/cmdline.h" #include "scrnintstr.h" #include "misc.h" diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 09cd28cb3..6cae1ea7e 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -26,6 +26,9 @@ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif + +#include "os/cmdline.h" + #include "ephyr.h" #include "ephyrlog.h" #include "glx_extinit.h" diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index fce08afbc..247a6f4a2 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -25,6 +25,7 @@ #endif #include "dix/screenint_priv.h" +#include "os/cmdline.h" #include "kdrive.h" #include <mivalidate.h> diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 2eeec831d..5b33eeec0 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -51,6 +51,8 @@ #include "inpututils.h" #include "optionstr.h" +#include "os/cmdline.h" + #if defined(CONFIG_UDEV) || defined(CONFIG_HAL) #include <hotplug.h> #endif diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 9bc23906a..2d3f131af 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -39,6 +39,7 @@ from The Open Group. #include <X11/Xos.h> #include "dix/screenint_priv.h" +#include "os/cmdline.h" #include "scrnintstr.h" #include "servermd.h" diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 5a5f1fd0c..b96f46cfa 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -49,6 +49,7 @@ #include <X11/Xatom.h> #include "dix/screenint_priv.h" +#include "os/cmdline.h" #include "input.h" #include "servermd.h" diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c index 4c8dda644..e87f11d4d 100644 --- a/hw/xfree86/os-support/bsd/bsd_init.c +++ b/hw/xfree86/os-support/bsd/bsd_init.c @@ -29,6 +29,8 @@ #include <X11/X.h> +#include "os/cmdline.h" + #include "compiler.h" #include "xf86.h" diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index b3270c5b3..62e2b6862 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -31,9 +31,10 @@ #include <X11/X.h> #include <X11/Xmd.h> +#include "os/cmdline.h" + #include "compiler.h" #include "linux.h" - #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c index 415cdb1c8..c5ce9e068 100644 --- a/hw/xfree86/os-support/solaris/sun_init.c +++ b/hw/xfree86/os-support/solaris/sun_init.c @@ -28,6 +28,8 @@ #include <errno.h> +#include "../../../../os/cmdline.h" + #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 81b8a7ec0..6637c7cc3 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -36,6 +36,7 @@ #include "dix/dix_priv.h" #include "dix/screenint_priv.h" +#include "os/cmdline.h" #include <selection.h> #include <micmap.h> diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index ef7d06a99..bff378ce3 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -35,6 +35,8 @@ from The Open Group. #include <sys/utsname.h> #endif +#include "os/cmdline.h" + #include <../xfree86/common/xorgVersion.h> #include "win.h" #include "winconfig.h" diff --git a/include/os.h b/include/os.h index 94853d26c..0261d74b8 100644 --- a/include/os.h +++ b/include/os.h @@ -200,10 +200,6 @@ extern _X_EXPORT void FreeScreenSaverTimer(void); extern _X_EXPORT void GiveUp(int /*sig */ ); -extern _X_EXPORT void UseMsg(void); - -extern _X_EXPORT void ProcessCommandLine(int /*argc */ , char * /*argv */ []); - extern _X_EXPORT int set_font_authorizations(char **authorizations, int *authlen, void *client); @@ -329,8 +325,6 @@ extern _X_EXPORT Bool PrivsElevated(void); extern _X_EXPORT void -CheckUserParameters(int argc, char **argv, char **envp); -extern _X_EXPORT void CheckUserAuthorization(void); extern _X_EXPORT int @@ -484,13 +478,6 @@ GenerateAuthorization(unsigned int /* name_length */ , extern _X_EXPORT int ddxProcessArgument(int /*argc */ , char * /*argv */ [], int /*i */ ); -#define CHECK_FOR_REQUIRED_ARGUMENTS(num) \ - do if (((i + num) >= argc) || (!argv[i + num])) { \ - UseMsg(); \ - FatalError("Required argument to %s not specified\n", argv[i]); \ - } while (0) - - extern _X_EXPORT void ddxUseMsg(void); diff --git a/os/cmdline.h b/os/cmdline.h new file mode 100644 index 000000000..9a4a19467 --- /dev/null +++ b/os/cmdline.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net> + */ +#ifndef _XSERVER_OS_CMDLINE_H +#define _XSERVER_OS_CMDLINE_H + +#include "include/os.h" + +#define CHECK_FOR_REQUIRED_ARGUMENTS(num) \ + do if (((i + num) >= argc) || (!argv[i + num])) { \ + UseMsg(); \ + FatalError("Required argument to %s not specified\n", argv[i]); \ + } while (0) + +void UseMsg(void); +void ProcessCommandLine(int argc, char * argv[]); +void CheckUserParameters(int argc, char **argv, char **envp); + +#endif /* _XSERVER_OS_CMELINE_H */ diff --git a/os/utils.c b/os/utils.c index 7b5e75d38..52f64d777 100644 --- a/os/utils.c +++ b/os/utils.c @@ -107,6 +107,7 @@ __stdcall unsigned long GetTickCount(void); #endif #include "dix/dix_priv.h" +#include "os/cmdline.h" #include "dixstruct.h" #include "xkbsrv.h" diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index e1aefd144..c06ec09d4 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -39,6 +39,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <X11/Xproto.h> #include <X11/keysym.h> #include <X11/Xatom.h> + +#include "os/cmdline.h" + #include "misc.h" #include "inputstr.h" #include "opaque.h" |