Skip to content

File SolidSyslogBuffer.h

FileList > Core > Interface > SolidSyslogBuffer.h

Go to the source code of this file

The buffer role: producer Write / consumer Read that decouples SolidSyslog_Log from Service. More...

  • #include "ExternC.h"
  • #include <stdbool.h>
  • #include <stddef.h>

Public Functions

Type Name
bool SolidSyslogBuffer_Read (struct SolidSyslogBuffer * buffer, void * data, size_t maxSize, size_t * bytesRead)
Consumer side, called by SolidSyslog_Service to drain the buffer.
void SolidSyslogBuffer_Write (struct SolidSyslogBuffer * buffer, const void * data, size_t size)
Producer side: hand one formatted record to the buffer.

Detailed Description

These calls dispatch to the injected buffer's vtable, so behaviour — notably whether Write blocks or returns at once — is that buffer's.

Public Functions Documentation

function SolidSyslogBuffer_Read

Consumer side, called by SolidSyslog_Service to drain the buffer.

bool SolidSyslogBuffer_Read (
    struct SolidSyslogBuffer * buffer,
    void * data,
    size_t maxSize,
    size_t * bytesRead
) 

Returns true with one record copied into data (up to maxSize) and its length in bytesRead; returns false when nothing was delivered, which the drain loop reads as "empty, stop". bytesRead is always set (0 on false). false does not distinguish empty from a record too large for maxSize left un-dequeued; there is no separate error channel.


function SolidSyslogBuffer_Write

Producer side: hand one formatted record to the buffer.

void SolidSyslogBuffer_Write (
    struct SolidSyslogBuffer * buffer,
    const void * data,
    size_t size
) 

data is copied as needed and need not outlive the call. There is no back-pressure signal: whether this blocks (PassthroughBuffer sends inline) or returns at once (CircularBuffer enqueues) is the buffer's choice, and a record that does not fit is dropped silently.



The documentation for this class was generated from the following file Core/Interface/SolidSyslogBuffer.h