]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: Remove circular header dependencies
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Apr 2025 20:08:04 +0000 (22:08 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 08:33:37 +0000 (10:33 +0200)
19 files changed:
src/journal/journald-audit.c
src/journal/journald-audit.h
src/journal/journald-client.c
src/journal/journald-client.h
src/journal/journald-console.h
src/journal/journald-context.c
src/journal/journald-context.h
src/journal/journald-kmsg.h
src/journal/journald-native.h
src/journal/journald-server.c
src/journal/journald-server.h
src/journal/journald-socket.c
src/journal/journald-socket.h
src/journal/journald-stream.c
src/journal/journald-stream.h
src/journal/journald-syslog.h
src/journal/journald-varlink.c
src/journal/journald-varlink.h
src/journal/journald-wall.h

index 55f8ce71402e6e22b6619e28cdbe66bd9654f31e..05c40a7885a849bd98414f0a051753dd074af892 100644 (file)
@@ -10,6 +10,7 @@
 #include "iovec-util.h"
 #include "journal-internal.h"
 #include "journald-audit.h"
+#include "journald-server.h"
 #include "missing_audit.h"
 #include "string-util.h"
 
index 79f3da90c1e93e76f24c67e9b4d2ffba5b25bf34..49223dbf4ac2105c84e68a9400cb43e7b9533f0f 100644 (file)
@@ -1,9 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
 #include "socket-util.h"
 
+typedef struct Server Server;
+
 void server_process_audit_message(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const union sockaddr_union *sa, socklen_t salen);
 
 void process_audit_string(Server *s, int type, const char *data, size_t size);
index fdba70c3d5022f9ff5ec97a2d108ddc22e3e6b99..771b51b9c17a92b623b2b113804a38a1d1711166 100644 (file)
@@ -3,6 +3,8 @@
 #include "cgroup-util.h"
 #include "errno-util.h"
 #include "journald-client.h"
+#include "journald-context.h"
+#include "log.h"
 #include "nulstr-util.h"
 #include "pcre2-util.h"
 #include "strv.h"
index 629cd41c7dec13cd3a7fb07c7d98865e020bb7d3..700b43db7d519c6e3c5b19a54dfcd3568c72c886 100644 (file)
@@ -1,7 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-context.h"
+#include <stddef.h>
+
+typedef struct ClientContext ClientContext;
 
 int client_context_read_log_filter_patterns(ClientContext *c, const char *cgroup);
 int client_context_check_keep_log(ClientContext *c, const char *message, size_t len);
index 0a26f9c876c38b5c03b5c027578ba064eeb05b47..a4894ce4a5a1f77a6b1b2dd428391d17f0a85538 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
+#include <sys/socket.h>
+
+typedef struct Server Server;
 
 void server_forward_console(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred);
index 1d5aca1d8774dae03c4b912ebf8341e0333a9299..79e52be2799535cb290dede900fd506e8176bed2 100644 (file)
@@ -16,6 +16,7 @@
 #include "journal-util.h"
 #include "journald-client.h"
 #include "journald-context.h"
+#include "journald-server.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
index 34637f85e4576aacf651fb3c4441ac62e3217b61..e908540eb4afa75190d0e96b6699e1a1b52b63ae 100644 (file)
@@ -4,6 +4,7 @@
 #include <inttypes.h>
 #include <sys/socket.h>
 #include <sys/types.h>
+#include <syslog.h>
 
 #include "sd-id128.h"
 
 #include "set.h"
 #include "time-util.h"
 
-typedef struct ClientContext ClientContext;
+typedef struct Server Server;
 
-#include "journald-server.h"
-
-struct ClientContext {
+typedef struct ClientContext {
         unsigned n_ref;
         unsigned lru_index;
         usec_t timestamp;
@@ -60,7 +59,7 @@ struct ClientContext {
 
         Set *log_filter_allowed_patterns;
         Set *log_filter_denied_patterns;
-};
+} ClientContext;
 
 int client_context_get(
                 Server *s,
index bd288c57a2de725a031ef4fb27924644444a4230..dcbe0b510c217d8e6a812b1b11dc80ffb272b9b0 100644 (file)
@@ -1,7 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
+#include <stddef.h>
+#include <sys/socket.h>
+
+typedef struct Server Server;
 
 int server_open_dev_kmsg(Server *s);
 int server_flush_dev_kmsg(Server *s);
index 10db26796692b9306db8ba470306281ea5d43673..3807b2ca9744bdeb1389de2e437bf2b91a2ef727 100644 (file)
@@ -1,7 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
+#include <stddef.h>
+#include <sys/socket.h>
+
+typedef struct Server Server;
 
 void server_process_native_message(
                 Server *s,
index 4397ef6e3f6b9dd08b7f04280cee86c80c6d87e3..6a8c8505403538f87aae06917d14fa6369be1e76 100644 (file)
@@ -23,6 +23,7 @@
 #include "event-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
+#include "fdset.h"
 #include "fileio.h"
 #include "format-util.h"
 #include "fs-util.h"
index ea3bf8b3f08a4927ecdf4c0148f8770ce79b268f..e565769779eb0017786599c355f4e51871124af1 100644 (file)
@@ -7,8 +7,6 @@
 #include "sd-event.h"
 #include "sd-varlink.h"
 
-typedef struct Server Server;
-
 #include "common-signal.h"
 #include "conf-parser.h"
 #include "hashmap.h"
@@ -68,7 +66,7 @@ typedef struct SeqnumData {
         uint64_t seqnum;
 } SeqnumData;
 
-struct Server {
+typedef struct Server {
         char *namespace;
 
         int syslog_fd;
@@ -185,7 +183,7 @@ struct Server {
         ClientContext *pid1_context; /* the context of PID 1 */
 
         sd_varlink_server *varlink_server;
-};
+} Server;
 
 #define SERVER_MACHINE_ID(s) ((s)->machine_id_field + STRLEN("_MACHINE_ID="))
 
index a079624f3c89d573498d6121f8f38641232056dc..9f419d393a7972a7da0e596cb80aa75e2f96d076 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "fd-util.h"
 #include "iovec-util.h"
+#include "journald-server.h"
 #include "journald-socket.h"
 #include "log.h"
 #include "macro.h"
index 23739538c84b33ee5468178d210cf34c94ff274d..3cddace1663e1dbc6800b4ed9ebf5c11532f2504 100644 (file)
@@ -1,7 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
-#include "socket-util.h"
+#include <sys/socket.h>
+
+#include "time-util.h"
+
+typedef struct Server Server;
 
 int server_forward_socket(Server *s, const struct iovec *iovec, size_t n, const dual_timestamp *ts, int priority);
index e45765df0c91153354336903e980daa0fdf1eb1b..71b0db639df00d642f40db3d37a0d5c7eef24389 100644 (file)
@@ -16,6 +16,7 @@
 #include "errno-util.h"
 #include "escape.h"
 #include "fd-util.h"
+#include "fdset.h"
 #include "fileio.h"
 #include "fs-util.h"
 #include "iovec-util.h"
index 71d3394ed9a5f54200b9cfffcd5ed7b16415bf7c..4bb4cbbe2fd1fd26844ccc16ba26ae04a0e3e2ca 100644 (file)
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-typedef struct StdoutStream StdoutStream;
-
 #include "fdset.h"
-#include "journald-server.h"
+
+typedef struct Server Server;
+typedef struct StdoutStream StdoutStream;
 
 int server_open_stdout_socket(Server *s, const char *stdout_socket);
 int server_restore_streams(Server *s, FDSet *fds);
index 3bc3ffddb88af482d679ddfab3f0cc2b952ae76e..ccb913d2ca3230561120259a6ef638e9b32e5312 100644 (file)
@@ -1,7 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
+#include <sys/socket.h>
+
+#include "macro.h"
+
+typedef struct Server Server;
 
 int syslog_fixup_facility(int priority) _const_;
 
index 5e98b5e5b8b6a204b5d09de73fc1f96bb3d0290d..d2ba34c74792325182be08acd0250477bdb0b363 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "journald-server.h"
 #include "journald-varlink.h"
 #include "varlink-io.systemd.Journal.h"
 #include "varlink-io.systemd.service.h"
index 55c7405af1c40528aac55e937102388342b7ec44..ab34e01117bfb3d33f483395b445baef95dc89fc 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "journald-server.h"
+typedef struct Server Server;
 
 int server_open_varlink(Server *s, const char *socket, int fd);
index 3f98c35bde1583671acd8c505294683f2f8c6925..8c19e496f46c88a8257a67432484b05b512021cf 100644 (file)
@@ -3,6 +3,6 @@
 
 #include <sys/socket.h>
 
-#include "journald-server.h"
+typedef struct Server Server;
 
 void server_forward_wall(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred);