Line data Source code
1 : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : */
4 :
5 : #ifndef SOLIDSYSLOGSHAREDSCRATCHPRIVATE_H
6 : #define SOLIDSYSLOGSHAREDSCRATCHPRIVATE_H
7 :
8 : #include <stdint.h>
9 :
10 : #include "SolidSyslogError.h"
11 : #include "SolidSyslogFormatter.h"
12 : #include "SolidSyslogPrival.h"
13 : #include "SolidSyslogScratch.h"
14 : #include "SolidSyslogSharedScratchErrors.h"
15 : #include "SolidSyslogTunables.h"
16 :
17 : struct SolidSyslogMutex;
18 :
19 : struct SolidSyslogSharedScratch
20 : {
21 : struct SolidSyslogScratch Base;
22 : struct SolidSyslogMutex* Mutex;
23 : SolidSyslogFormatterStorage Storage[SOLIDSYSLOG_FORMATTER_STORAGE_SIZE(SOLIDSYSLOG_MAX_MESSAGE_SIZE)];
24 : };
25 :
26 : void SolidSyslogSharedScratch_Initialise(struct SolidSyslogScratch* base, struct SolidSyslogMutex* mutex);
27 : void SolidSyslogSharedScratch_Cleanup(struct SolidSyslogScratch* base);
28 :
29 9 : static inline void SharedScratch_Report(
30 : enum SolidSyslogSeverity severity,
31 : uint16_t category,
32 : enum SolidSyslogSharedScratchErrors code
33 : )
34 : {
35 9 : SolidSyslog_Error(severity, &SolidSyslogSharedScratchErrorSource, category, (int32_t) code);
36 9 : }
37 :
38 : #endif /* SOLIDSYSLOGSHAREDSCRATCHPRIVATE_H */
|