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)Index 0 is the head: the oldest entry and the next one to be delivered.
Parameters
| Name | Description |
|---|---|
endpoint | Endpoint with an Equipment spool. |
index | Zero-based queue index. |
info | Caller storage with struct_size set; cleared first and filled on success. |
body | Receives 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
*bodywith pdcomm_secs_destroy().