From d4724009ceca465f4895e3838e083a913c8e3ee4 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 9 Feb 2024 18:00:36 +0100 Subject: [PATCH] xfree86: parser: move private defs from xf86Parser.h to xf86Parser_priv.h public server module API headers shouldn't be clobbered with non-exported definitions, so move them out to private header file. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- hw/xfree86/common/xf86AutoConfig.c | 2 +- hw/xfree86/common/xf86Config.c | 2 +- hw/xfree86/common/xf86Configure.c | 1 + hw/xfree86/parser/Layout.c | 2 +- hw/xfree86/parser/read.c | 2 +- hw/xfree86/parser/scan.c | 1 + hw/xfree86/parser/write.c | 2 +- hw/xfree86/parser/xf86Parser.h | 15 --------------- hw/xfree86/parser/xf86Parser_priv.h | 26 ++++++++++++++++++++++++++ 9 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 hw/xfree86/parser/xf86Parser_priv.h diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index d49f59085..fc549f34a 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -34,7 +34,7 @@ #endif #include "xf86.h" -#include "xf86Parser.h" +#include "xf86Parser_priv.h" #include "xf86tokens.h" #include "xf86Config.h" #include "xf86MatchDrivers.h" diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index e26399cc7..b042d2a60 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -54,7 +54,7 @@ #include "xf86.h" #include "xf86Modes.h" -#include "xf86Parser.h" +#include "xf86Parser_priv.h" #include "xf86tokens.h" #include "xf86Config.h" #include "xf86Priv.h" diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index c59e926de..ea1ddcfb3 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -46,6 +46,7 @@ #endif #include "misc.h" #include "loaderProcs.h" +#include "xf86Parser_priv.h" typedef struct _DevToConfig { GDevRec GDev; diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c index 532f318f3..1c2e8f6e0 100644 --- a/hw/xfree86/parser/Layout.c +++ b/hw/xfree86/parser/Layout.c @@ -56,7 +56,7 @@ #include #endif -#include "xf86Parser.h" +#include "xf86Parser_priv.h" #include "xf86tokens.h" #include "Configint.h" #include diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c index a4600bc06..1ee49ac90 100644 --- a/hw/xfree86/parser/read.c +++ b/hw/xfree86/parser/read.c @@ -57,7 +57,7 @@ #endif #include "xf86Config.h" -#include "xf86Parser.h" +#include "xf86Parser_priv.h" #include "xf86tokens.h" #include "Configint.h" diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 3655eb777..471e3adb3 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -66,6 +66,7 @@ #include #include #include +#include "xf86Parser_priv.h" #if !defined(MAXHOSTNAMELEN) #define MAXHOSTNAMELEN 32 diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index 1c8e33dd0..98f0d42b3 100644 --- a/hw/xfree86/parser/write.c +++ b/hw/xfree86/parser/write.c @@ -56,7 +56,7 @@ #endif #include "os.h" -#include "xf86Parser.h" +#include "xf86Parser_priv.h" #include "xf86tokens.h" #include "Configint.h" diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 6762edbe1..b9240af12 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -442,17 +442,6 @@ typedef struct { /* * prototypes for public functions */ -extern void xf86initConfigFiles(void); -extern char *xf86openConfigFile(const char *path, const char *cmdline, - const char *projroot); -extern char *xf86openConfigDirFiles(const char *path, const char *cmdline, - const char *projroot); -extern void xf86setBuiltinConfig(const char *config[]); -extern XF86ConfigPtr xf86readConfigFile(void); -extern void xf86closeConfigFile(void); -extern XF86ConfigPtr xf86allocateConfig(void); -extern void xf86freeConfig(XF86ConfigPtr p); -extern int xf86writeConfigFile(const char *, XF86ConfigPtr); extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p); extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name, @@ -472,14 +461,10 @@ extern _X_EXPORT XF86ConfInputPtr xf86findInputByDriver(const char *driver, extern _X_EXPORT XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident, XF86ConfVideoAdaptorPtr p); -extern int xf86layoutAddInputDevices(XF86ConfigPtr config, - XF86ConfLayoutPtr layout); - extern _X_EXPORT GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new); extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2); - extern _X_EXPORT int xf86pathIsAbsolute(const char *path); extern _X_EXPORT int xf86pathIsSafe(const char *path); extern _X_EXPORT char *xf86addComment(char *cur, const char *add); diff --git a/hw/xfree86/parser/xf86Parser_priv.h b/hw/xfree86/parser/xf86Parser_priv.h new file mode 100644 index 000000000..455c00c6a --- /dev/null +++ b/hw/xfree86/parser/xf86Parser_priv.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + * Copyright © 1997 Metro Link Incorporated + */ +#ifndef _XSERVER_XF86_PARSER_PRIV +#define _XSERVER_XF86_PARSER_PRIV + +#include "xf86Parser.h" + +void xf86initConfigFiles(void); +char *xf86openConfigFile(const char *path, + const char *cmdline, + const char *projroot); +char *xf86openConfigDirFiles(const char *path, + const char *cmdline, + const char *projroot); +void xf86setBuiltinConfig(const char *config[]); +XF86ConfigPtr xf86readConfigFile(void); +void xf86closeConfigFile(void); +XF86ConfigPtr xf86allocateConfig(void); +void xf86freeConfig(XF86ConfigPtr p); +int xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr); +int xf86layoutAddInputDevices(XF86ConfigPtr config, XF86ConfLayoutPtr layout); + +#endif /* _XSERVER_XF86_PARSER_PRIV */