journal: Remove circular header dependencies

This commit is contained in:
Daan De Meyer
2025-04-23 10:33:37 +02:00
parent f31e462ba7
commit d88dc9a5dd
19 changed files with 45 additions and 22 deletions
+1
View 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"
+2 -1
View 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);
+2
View 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"
+3 -1
View 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);
+3 -1
View 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);
+1
View 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"
+4 -5
View File
@@ -4,6 +4,7 @@
#include <inttypes.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <syslog.h>
#include "sd-id128.h"
@@ -11,11 +12,9 @@
#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,
+4 -1
View 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);
+4 -1
View 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,
+1
View 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"
+2 -4
View 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="))
+1
View 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"
+5 -2
View 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);
+1
View 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"
+3 -3
View 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);
+5 -1
View 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_;
+1
View 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"
+1 -1
View 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);
+1 -1
View 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);