Skip to content
Start free evaluation

pdcomm_gem_spool_entry_at

Function

Reads one spooled message by queue position.

PdcommStatus pdcomm_gem_spool_entry_at(PdcommTcpEndpoint *endpoint, size_t index, PdcommGemSpoolEntryInfo *info, PdcommSecsItem **body)

Declared in: #include <pdcomm_gem_spooling.h>

Index 0 is the head: the oldest entry and the next one to be delivered.

Parameters

NameDescription
endpointEndpoint with an Equipment spool.
indexZero-based queue index.
infoCaller storage with struct_size set; cleared first and filled on success.
bodyReceives a new item holding the message body, or NULL when the message has no body (distinct from an owned empty item). Set to NULL first. Must not be NULL.

Returns

#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when info or body is NULL, info is too small, or endpoint is NULL; #PDCOMM_INVALID_STATE when no Equipment spool is configured; #PDCOMM_OUT_OF_RANGE when index is past the end; #PDCOMM_INVALID_DATA when the stored body cannot be decoded; #PDCOMM_ALLOCATION_FAILED or #PDCOMM_POISONED.

Notes

  • Ownership: release a non-NULL *body with pdcomm_secs_destroy().