Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Bdd/Targets/Common/BddTargetFreeRtosPipeline.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "SolidSyslogConfig.h"
#include "SolidSyslogCrc16Policy.h"
#include "SolidSyslogEndpoint.h"
#include "SolidSyslogEndpointHost.h"
#include "SolidSyslogError.h"
#include "SolidSyslogFileBlockDevice.h"
#include "SolidSyslogFormatter.h"
#include "SolidSyslogHeaderField.h"
#include "SolidSyslogFreeRtosMutex.h"
#include "SolidSyslogFreeRtosSysUpTime.h"
Expand Down Expand Up @@ -240,7 +240,7 @@ static void GetTimeQuality(struct SolidSyslogTimeQuality* timeQuality)

void BddTargetFreeRtosPipeline_GetEndpoint(struct SolidSyslogEndpoint* endpoint)
{
SolidSyslogFormatter_BoundedString(endpoint->Host, host, strlen(host));
SolidSyslogEndpointHost_String(endpoint->Host, host, strlen(host));
endpoint->Port = port;
}

Expand Down
4 changes: 2 additions & 2 deletions Bdd/Targets/Common/BddTargetMtlsConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stddef.h>
#include <stdint.h>

#include "SolidSyslogFormatter.h"
#include "SolidSyslogEndpointHost.h"
#include "SolidSyslogEndpoint.h"

enum
Expand Down Expand Up @@ -69,7 +69,7 @@ const char* BddTargetMtlsConfig_GetClientKeyPath(void)

void BddTargetMtlsConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint)
{
SolidSyslogFormatter_BoundedString(endpoint->Host, BddTargetMtlsConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
SolidSyslogEndpointHost_String(endpoint->Host, BddTargetMtlsConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
endpoint->Port = BddTargetMtlsConfig_GetPort();
}

Expand Down
4 changes: 2 additions & 2 deletions Bdd/Targets/Common/BddTargetTlsConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stddef.h>
#include <stdint.h>

#include "SolidSyslogFormatter.h"
#include "SolidSyslogEndpointHost.h"
#include "SolidSyslogTransport.h"
#include "SolidSyslogEndpoint.h"

Expand Down Expand Up @@ -52,7 +52,7 @@ const char* BddTargetTlsConfig_GetServerName(void)

void BddTargetTlsConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint)
{
SolidSyslogFormatter_BoundedString(endpoint->Host, BddTargetTlsConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
SolidSyslogEndpointHost_String(endpoint->Host, BddTargetTlsConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
endpoint->Port = BddTargetTlsConfig_GetPort();
}

Expand Down
4 changes: 2 additions & 2 deletions Bdd/Targets/Linux/BddTargetTcpConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <stdint.h>

#include "SolidSyslogFormatter.h"
#include "SolidSyslogEndpointHost.h"
#include "SolidSyslogEndpoint.h"

/* Unprivileged port used by the BDD syslog-ng container — library default is
Expand All @@ -24,7 +24,7 @@ uint16_t BddTargetTcpConfig_GetPort(void)

void BddTargetTcpConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint)
{
SolidSyslogFormatter_BoundedString(endpoint->Host, BddTargetTcpConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
SolidSyslogEndpointHost_String(endpoint->Host, BddTargetTcpConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
endpoint->Port = BddTargetTcpConfig_GetPort();
}

Expand Down
4 changes: 2 additions & 2 deletions Bdd/Targets/Linux/BddTargetUdpConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <stdint.h>

#include "SolidSyslogFormatter.h"
#include "SolidSyslogEndpointHost.h"
#include "SolidSyslogEndpoint.h"

/* Unprivileged mirror of SOLIDSYSLOG_UDP_DEFAULT_PORT (514) for BDD containers */
Expand All @@ -23,7 +23,7 @@ uint16_t BddTargetUdpConfig_GetPort(void)

void BddTargetUdpConfig_GetEndpoint(struct SolidSyslogEndpoint* endpoint)
{
SolidSyslogFormatter_BoundedString(endpoint->Host, BddTargetUdpConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
SolidSyslogEndpointHost_String(endpoint->Host, BddTargetUdpConfig_GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
endpoint->Port = BddTargetUdpConfig_GetPort();
}

Expand Down
4 changes: 2 additions & 2 deletions Bdd/Targets/Windows/BddTargetWindows.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "SolidSyslogFileBlockDevice.h"
#include "SolidSyslogNullSecurityPolicy.h"
#include "SolidSyslogOpenSslHmacSha256Policy.h"
#include "SolidSyslogFormatter.h"
#include "SolidSyslogEndpointHost.h"
#include "SolidSyslogMetaSd.h"
#include "SolidSyslogNullStore.h"
#include "SolidSyslogOriginSd.h"
Expand Down Expand Up @@ -109,7 +109,7 @@ static int GetPort(void)

static void GetEndpoint(struct SolidSyslogEndpoint* endpoint)
{
SolidSyslogFormatter_BoundedString(endpoint->Host, GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
SolidSyslogEndpointHost_String(endpoint->Host, GetHost(), SOLIDSYSLOG_MAX_HOST_SIZE);
endpoint->Port = (uint16_t) GetPort();
}

Expand Down
18 changes: 11 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,12 @@ live under `Core/Interface/`; platform-specific helpers (the `SolidSyslogPosix*`
| `SolidSyslogError.h` | Any code installing a handler to react to library-internal errors (NULL guards, send failures); also the library-internal call site for emitting them | `struct SolidSyslogErrorEvent` (`Severity`, `Source`, `uint16_t Category`, `int32_t Detail`), `SolidSyslogErrorHandler` typedef (`void(void* context, const struct SolidSyslogErrorEvent* event)`), `SolidSyslog_SetErrorHandler(handler, context)`, `SolidSyslog_Error(severity, source, category, detail)`. The handler reads three orthogonal axes off the event: `Source` (extensible identity, pointer-identity match), `Category` (portable reaction axis — see `SolidSyslogErrorCategory.h`), `Detail` (per-class `enum SolidSyslog<Class>Errors` value today, native `errno`/`X509_V_ERR_*` later). Default handler is a silent no-op; setting `handler = NULL` restores the default. Single global slot — intended for setup-time configuration, not synchronised with concurrent `Error` calls. |
| `SolidSyslogErrorCategory.h` | Any handler switching on the portable category axis; any emit site picking a category | Universal lifecycle category macros (`SOLIDSYSLOG_CAT_BAD_CONFIG` / `_BAD_ARGUMENT` / `_POOL_EXHAUSTED` / `_UNKNOWN_DESTROY`, all `uint16_t`) + per-role base ranges (`SOLIDSYSLOG_CAT_<ROLE>_BASE`, errno-domain style; a role occupies `[BASE, BASE + 0xFF]`, `0xC000+` reserved for integrator-defined roles). Category constants are `uint16_t` macros carrying their own cast so emit sites stay clean; the wire type is `uint16_t` (not an enum) so integrator classes can supply their own categories without being boxed into a library enum. Role-specific categories live in `SolidSyslog<Role>Categories.h` beside each `*Definition.h` (`SolidSyslogSenderCategories.h` → `_SENDER_DELIVERY_FAILED` / `_SENDER_DELIVERY_RESTORED`, shared by `StreamSender` + `UdpSender`; `SolidSyslogResolverCategories.h` → `_RESOLVER_RESOLVE_FAILED`; `SolidSyslogTlsStreamCategories.h` → `_TLSSTREAM_INIT_FAILED` / `_HANDSHAKE_FAILED`; `SolidSyslogSecurityPolicyCategories.h` → `_SECURITYPOLICY_KEY_UNAVAILABLE` / `_SEAL_FAILED` / `_OPEN_FAILED`; `SolidSyslogBufferCategories.h` → `_BUFFER_BACKEND_FAILED`). A category is defined only once a live emit site raises it. |
| `SolidSyslogConfigLock.h` | Setup code on systems where library-internal config-time critical sections (E11 pool `_Create`/`_Destroy` slot walks) may race across tasks or cores. Single-task setup needs nothing — defaults are no-ops. | `SolidSyslogConfigLockFunction` typedef (zero-arg `void(void)`), `SolidSyslog_SetConfigLock(lockFn, unlockFn)`, `SolidSyslog_LockConfig()`, `SolidSyslog_UnlockConfig()`. Pair API: both handlers installed together. `NULL` on either side restores that side's no-op default. Single global slot — intended for setup-time configuration, not synchronised with concurrent installs. Integrators wire `taskENTER_CRITICAL`/`taskEXIT_CRITICAL` (FreeRTOS), `pthread_mutex_lock`/`unlock` on a static `pthread_mutex_t` (POSIX), `EnterCriticalSection`/`LeaveCriticalSection` on a static `CRITICAL_SECTION` (Windows), or a spinlock pair. This is the only synchronisation primitive available to the Mutex and AtomicCounter pools for their own pool walks — chicken-and-egg eliminates their own injectables. |
| `SolidSyslogStringFunction.h` | Any code needing the string-callback typedef | `SolidSyslogStringFunction` (callback writes into a `SolidSyslogFormatter*`) — used by `SolidSyslogConfig` (hostname/appName/processId), `SolidSyslogMetaSdConfig` (language), `SolidSyslogOriginSdConfig` |
| `SolidSyslogFormatter.h` | Any code that formats into a bounded buffer | `SolidSyslogFormatter`, `SolidSyslogFormatterStorage`, `SOLIDSYSLOG_FORMATTER_STORAGE_SIZE`, `_Create`, `_FromStorage`, `_AsciiCharacter`, `_Bom`, `_BoundedString`, `_EscapedString`, `_PrintUsAsciiString`, `_Uint32`, `_TwoDigit`, `_FourDigit`, `_SixDigit`, `_AsFormattedBuffer`, `_Length` |
| `SolidSyslogHeaderField.h` | Any code writing an RFC 5424 header field (HOSTNAME / APP-NAME / PROCID) into the field sink it is handed | Opaque `struct SolidSyslogHeaderField` value sink + `_PrintUsAscii`, `_Uint32` — appends PRINTUSASCII content (any other byte, space included, substituted) bounded to the field width. The library owns the charset; a callback cannot reach the raw formatter or break the header framing. Stack-transient, no pool (D.002). |
| `SolidSyslogHeaderFieldFunction.h` | Any code needing the header-field callback typedef | `SolidSyslogHeaderFieldFunction` (callback writes into a `SolidSyslogHeaderField*` + `void* context`) — used by `SolidSyslogConfig` for hostname/appName/processId. Replaces the retired `SolidSyslogStringFunction`. |
| `SolidSyslogPrival.h` | Any code that needs facility/severity enums | `SolidSyslogFacility`, `SolidSyslogSeverity` |
| `SolidSyslogTimestamp.h` | Any code that needs the timestamp struct | `SolidSyslogTimestamp`, `SolidSyslogClockFunction` |
| `SolidSyslogEndpoint.h` | System setup code that supplies destination host/port (and version on changes) | `SolidSyslogEndpoint`, `SolidSyslogEndpointFunction`, `SolidSyslogEndpointVersionFunction`, `SOLIDSYSLOG_MAX_HOST_SIZE` |
| `SolidSyslogEndpoint.h` | System setup code that supplies destination host/port (and version on changes) | `SolidSyslogEndpoint` (its `Host` member is an opaque `SolidSyslogEndpointHost*` sink, not a formatter), `SolidSyslogEndpointFunction`, `SolidSyslogEndpointVersionFunction`, `SOLIDSYSLOG_MAX_HOST_SIZE` |
| `SolidSyslogEndpointHost.h` | Any code writing the destination host inside a `SolidSyslogEndpointFunction` | Opaque `struct SolidSyslogEndpointHost` value sink + `_String` — appends the host verbatim (no PRINTUSASCII substitution; a DNS name / IP literal must reach the resolver intact) bounded to the host-field width. The callback cannot reach the raw formatter. Stack-transient, no pool (D.002). |
| `SolidSyslogSender.h` | Any code holding a sender handle | `SolidSyslogSender_Send`, `SolidSyslogSender_Disconnect` |
| `SolidSyslogSenderDefinition.h` | Sender implementors (extension point) | `SolidSyslogSender` vtable struct (`Send`, `Disconnect`) |
| `SolidSyslogNullSender.h` | Any code installing a no-op sender slot (Send returns `true` to drop on the floor — keeps Store from filling with undeliverables; Disconnect is a no-op) | `SolidSyslogNullSender_Get` |
Expand Down Expand Up @@ -435,10 +436,13 @@ live under `Core/Interface/`; platform-specific helpers (the `SolidSyslogPosix*`
| `SolidSyslogFreeRtosSysUpTime.h` | SysUpTime callback implementor using `xTaskGetTickCount` on FreeRTOS targets | `SolidSyslogFreeRtosSysUpTime_Get` (returns `uint32_t` hundredths since boot, wraps per RFC 3418 `TimeTicks`; uint64 intermediate so the result is correct at any `configTICK_RATE_HZ`) |
| `SolidSyslogWindowsSleep.h` | System setup code wiring a `SolidSyslogSleepFunction` on Windows targets | `SolidSyslogWindowsSleep` (wraps `Sleep`) |
| `SolidSyslogSleep.h` | Any code passing or implementing a sleep callback | `SolidSyslogSleepFunction` typedef (used by `SolidSyslogTlsStreamConfig.sleep` for the bounded handshake retry) |
| `SolidSyslogStructuredData.h` | Library internals (SD dispatch) | `SolidSyslogStructuredData_Format` (writes into `SolidSyslogFormatter*`) |
| `SolidSyslogStructuredDataDefinition.h` | SD implementors (extension point) | `SolidSyslogStructuredData` vtable struct (Format takes `SolidSyslogFormatter*`) |
| `SolidSyslogStructuredData.h` | Library internals (SD dispatch) | `SolidSyslogStructuredData_Format` (writes into a `SolidSyslogSdElement*`) |
| `SolidSyslogStructuredDataDefinition.h` | SD implementors (extension point) | `SolidSyslogStructuredData` vtable struct (Format takes a `SolidSyslogSdElement*`, not a formatter) |
| `SolidSyslogSdElement.h` | SD implementors framing one `[SD-ID PARAM="value"…]` element | Opaque `struct SolidSyslogSdElement` + `_Begin(name, enterpriseNumber)`, `_Param(name) → SolidSyslogSdValue*`, `_End`. Owns the brackets, `@`-enterprise SD-ID suffix, and SD-NAME validation (NULL name → element/param skipped); a producer cannot break the framing. |
| `SolidSyslogSdValue.h` | SD implementors writing a PARAM value | Opaque `struct SolidSyslogSdValue` + `_String`, `_BoundedString`, `_Uint32` — appends a PARAM-VALUE with RFC 5424 `"`/`\`/`]` escaping applied by the library, streaming across calls. |
| `SolidSyslogSdValueFunction.h` | Any code needing the SD-value callback typedef | `SolidSyslogSdValueFunction` (callback writes into a `SolidSyslogSdValue*` + `void* context`) — used by `SolidSyslogMetaSdConfig` (language) and `SolidSyslogOriginSdConfig`. |
| `SolidSyslogNullSd.h` | Any code installing a no-op Structured Data slot in `SolidSyslogConfig.Sd[]` | `SolidSyslogNullSd_Get` |
| `SolidSyslogMetaSd.h` | System setup code using meta SD (sequenceId, sysUpTime, language) | `SolidSyslogMetaSdConfig` (counter, getSysUpTime, getLanguage — each independently optional via NULL), `SolidSyslogSysUpTimeFunction`, `SolidSyslogMetaSd_Create(config)`, `_Destroy(sd)`. Instance struct lives in a library-internal static pool (E11). Bad-config and pool exhaustion both resolve to the shared `SolidSyslogNullSd`. |
| `SolidSyslogMetaSd.h` | System setup code using meta SD (sequenceId, sysUpTime, language) | `SolidSyslogMetaSdConfig` (counter, getSysUpTime, getLanguage — each independently optional via NULL; `getLanguage` is a `SolidSyslogSdValueFunction`), `SolidSyslogSysUpTimeFunction`, `SolidSyslogMetaSd_Create(config)`, `_Destroy(sd)`. Instance struct lives in a library-internal static pool (E11). Bad-config and pool exhaustion both resolve to the shared `SolidSyslogNullSd`. |
| `SolidSyslogMetaSdErrors.h` | Any code installing an error handler that wants to react to MetaSd-specific events (pointer-identity match on `MetaSdErrorSource`, switch on `enum SolidSyslogMetaSdErrors`) | `enum SolidSyslogMetaSdErrors` (`METASD_ERROR_*` codes + `METASD_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource MetaSdErrorSource`. Integrators ignore if not handling errors per source. |
| `SolidSyslogAtomicCounter.h` | Any code holding a counter handle | `SolidSyslogAtomicCounter_Increment(base)` — public vtable-dispatched call. Wrap-aware in [1, 2³¹ - 1] per RFC 5424 §7.3.1, never returns 0. |
| `SolidSyslogAtomicCounterDefinition.h` | AtomicCounter implementors (extension point) | `SolidSyslogAtomicCounter` vtable struct (`Increment` function pointer) |
Expand All @@ -450,7 +454,7 @@ live under `Core/Interface/`; platform-specific helpers (the `SolidSyslogPosix*`
| `SolidSyslogTimeQuality.h` | Any code providing time quality data | `SolidSyslogTimeQuality`, `SolidSyslogTimeQualityFunction`, `SOLIDSYSLOG_SYNC_ACCURACY_OMIT` |
| `SolidSyslogTimeQualitySd.h` | System setup code using timeQuality SD | `SolidSyslogTimeQualitySd_Create(getTimeQuality)`, `_Destroy(sd)`. Instance struct lives in a library-internal static pool (E11). Pool exhaustion resolves to the shared `SolidSyslogNullSd`. |
| `SolidSyslogTimeQualitySdErrors.h` | Any code installing an error handler that wants to react to TimeQualitySd-specific events (pointer-identity match on `TimeQualitySdErrorSource`, switch on `enum SolidSyslogTimeQualitySdErrors`) | `enum SolidSyslogTimeQualitySdErrors` (`TIMEQUALITYSD_ERROR_*` codes + `TIMEQUALITYSD_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource TimeQualitySdErrorSource`. Integrators ignore if not handling errors per source. |
| `SolidSyslogOriginSd.h` | System setup code using origin SD (software, swVersion, enterpriseId, ip) | `SolidSyslogOriginSdConfig` (software, swVersion, enterpriseId, getIpCount, getIpAt — each independently optional via NULL), `SolidSyslogOriginIpCountFunction`, `SolidSyslogOriginIpAtFunction`, `SolidSyslogOriginSd_Create(config)`, `_Destroy(sd)`. Instance struct lives in a library-internal static pool (E11); each slot carries the pre-formatted static-prefix Formatter storage. Pool exhaustion resolves to the shared `SolidSyslogNullSd`. |
| `SolidSyslogOriginSd.h` | System setup code using origin SD (software, swVersion, enterpriseId, ip) | `SolidSyslogOriginSdConfig` (software, swVersion, enterpriseId, getIpCount, getIpAt — each independently optional via NULL), `SolidSyslogOriginIpCountFunction`, `SolidSyslogOriginIpAtFunction`, `SolidSyslogOriginSd_Create(config)`, `_Destroy(sd)`. `getIpAt` is a `SolidSyslogOriginIpAtFunction` writing each address into an `SolidSyslogSdValue*`. Instance struct lives in a library-internal static pool (E11); each slot borrows its config strings and emits the whole element at Format time (no pre-formatted scratch storage). Pool exhaustion resolves to the shared `SolidSyslogNullSd`. |
| `SolidSyslogOriginSdErrors.h` | Any code installing an error handler that wants to react to OriginSd-specific events (pointer-identity match on `OriginSdErrorSource`, switch on `enum SolidSyslogOriginSdErrors`) | `enum SolidSyslogOriginSdErrors` (`ORIGINSD_ERROR_*` codes + `ORIGINSD_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource OriginSdErrorSource`. Integrators ignore if not handling errors per source. |

Most application code only needs `SolidSyslog.h` — it never sees allocators, senders, buffers, or config structs.
Expand Down
3 changes: 1 addition & 2 deletions Core/Interface/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
# defaults must be visible to the preprocessor (`#if`-checked floors) and
# usable as array-size const-expressions in dependent headers. Replacing
# with `static const` or `constexpr` loses both properties. The same idiom
# appears in SolidSyslogFormatter.h (worst-case output sizing macros),
# SolidSyslogCircularBuffer.h (ring-bytes helper) and ExternC.h
# appears in SolidSyslogCircularBuffer.h (ring-bytes helper) and ExternC.h
# (extern "C" linkage block). The rule fires on every entry, the
# rationale is uniform, so disable tier-wide here rather than carry the
# same NOLINT comment on dozens of macro definitions.
Expand Down
4 changes: 3 additions & 1 deletion Core/Interface/SolidSyslogEndpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ EXTERN_C_BEGIN
SOLIDSYSLOG_MAX_HOST_SIZE = 256
};

struct SolidSyslogEndpointHost;

struct SolidSyslogEndpoint
{
struct SolidSyslogFormatter* Host; /* library-provided; user writes destination host into it */
struct SolidSyslogEndpointHost* Host; /* library-provided sink; user writes destination host into it */
uint16_t Port; /* user assigns destination port */
};

Expand Down
26 changes: 26 additions & 0 deletions Core/Interface/SolidSyslogEndpointHost.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef SOLIDSYSLOGENDPOINTHOST_H
#define SOLIDSYSLOGENDPOINTHOST_H

#include "ExternC.h"

#include <stddef.h>

EXTERN_C_BEGIN

/* The value sink for a destination host (the SolidSyslogEndpoint a sender
* hands its endpoint callback). A callback is given only a
* SolidSyslogEndpointHost* — it can append the host string bounded to the
* host-field width, but cannot reach the raw formatter. Unlike a header
* field, the bytes are copied verbatim: a DNS name or IP literal headed to
* the resolver must not be silently substituted. Stack-transient, no pool
* (D.002). */
struct SolidSyslogEndpointHost;

/* Appends up to maxLength bytes of source (stopping at a NUL terminator)
* verbatim into the host sink, further bounded by the host-field width the
* sink was created with. */
void SolidSyslogEndpointHost_String(struct SolidSyslogEndpointHost * host, const char* source, size_t maxLength);

EXTERN_C_END

#endif /* SOLIDSYSLOGENDPOINTHOST_H */
1 change: 1 addition & 0 deletions Core/Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(SOURCES
SolidSyslogSdValue.c
SolidSyslogSdElement.c
SolidSyslogHeaderField.c
SolidSyslogEndpointHost.c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

File inserted in incorrect alphabetical position.

SolidSyslogEndpointHost.c (line 38) appears after SolidSyslogHeaderField.c (line 37), but alphabetically "EndpointHost" should precede "HeaderField". The SOURCES list appears to maintain alphabetical order.

📋 Suggested fix

Move SolidSyslogEndpointHost.c to precede SolidSyslogHeaderField.c:

    SolidSyslogSdValue.c
    SolidSyslogSdElement.c
+   SolidSyslogEndpointHost.c
    SolidSyslogHeaderField.c
-   SolidSyslogEndpointHost.c
    SolidSyslogTimeQualitySd.c
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Core/Source/CMakeLists.txt` at line 38, The SOURCES list in CMakeLists.txt is
out of alphabetical order: move the entry SolidSyslogEndpointHost.c so it
appears before SolidSyslogHeaderField.c within the SOURCES list to restore
alphabetical ordering (adjust the CMakeLists.txt SOURCES block accordingly).

SolidSyslogTimeQualitySd.c
SolidSyslogTimeQualitySdStatic.c
SolidSyslogOriginSd.c
Expand Down
13 changes: 13 additions & 0 deletions Core/Source/SolidSyslogEndpointHost.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "SolidSyslogEndpointHostPrivate.h"

#include "SolidSyslogFormatter.h"

void SolidSyslogEndpointHost_FromFormatter(struct SolidSyslogEndpointHost* host, struct SolidSyslogFormatter* formatter)
{
host->Formatter = formatter;
}

void SolidSyslogEndpointHost_String(struct SolidSyslogEndpointHost* host, const char* source, size_t maxLength)
{
SolidSyslogFormatter_BoundedString(host->Formatter, source, maxLength);
}
Loading
Loading