Skip to content

File SolidSyslogSdElement.h

FileList > Core > Interface > SolidSyslogSdElement.h

  • #include "SolidSyslogExternC.h"
  • #include <stdint.h>

Detailed Description

The SD authoring API for one [SD-ID PARAM="value"...] element: SolidSyslogSdElement_Begin / SolidSyslogSdElement_Param / SolidSyslogSdElement_End, which own the element and parameter framing so the author writes only names and values.

Escaping the value itself belongs to SolidSyslogSdValue, the sink Param hands back.

Public Functions Documentation

SolidSyslogSdElement_Begin

Opens an SD-ELEMENT: emits "[name" for an IANA-registered name ( enterpriseNumber 0) or "[name@enterpriseNumber" for a private one.

void SolidSyslogSdElement_Begin (
    struct SolidSyslogSdElement * element,
    const char * name,
    uint32_t enterpriseNumber
) 

A NULL name suppresses the whole element, so a conditional element needs no placeholder; the matching SolidSyslogSdElement_End is still required. name must be an SD-NAME: 1 to 32 printable US-ASCII characters, excluding '=', ']' and '"'. Over-long names are truncated and non-printable bytes and spaces substituted, but those three are emitted as given and ']' breaks the framing. RFC 5424 also requires an SD-ID to appear at most once in a message, which is likewise the author's.


SolidSyslogSdElement_End

Closes the SD-ELEMENT: closes any open param value's quote and emits ']' (nothing if SolidSyslogSdElement_Begin suppressed the element).

void SolidSyslogSdElement_End (
    struct SolidSyslogSdElement * element
) 


SolidSyslogSdElement_Param

Opens an SD-PARAM and returns the value sink to stream its value into.

struct SolidSyslogSdValue * SolidSyslogSdElement_Param (
    struct SolidSyslogSdElement * element,
    const char * name
) 

Always returns a usable sink, never NULL: a NULL name (or a suppressed element) skips the param but still absorbs the caller's value writes. The returned pointer belongs to the element and stays valid until the next SolidSyslogSdElement_Param or SolidSyslogSdElement_End. name is an SD-NAME on the same terms as SolidSyslogSdElement_Begin's.



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