Skip to content
Start free evaluation

pdcomm_gem_program_at

Function

Copies one stored program by position.

PdcommStatus pdcomm_gem_program_at(PdcommTcpEndpoint *endpoint, size_t index, PdcommSecsItem **out_id, PdcommSecsItem **out_body)

Declared in: #include <pdcomm_gem_programs.h>

Programs keep insertion order; replacing a program keeps its position.

Parameters

NameDescription
endpointEndpoint with a program store.
indexZero-based program index.
out_idReceives a new PPID item; set to NULL first. Must not be NULL.
out_bodyReceives a new PPBODY item; set to NULL first. Must not be NULL.

Returns

#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when an output or endpoint is NULL; #PDCOMM_INVALID_STATE when no program store is configured; #PDCOMM_OUT_OF_RANGE when index is past the end; #PDCOMM_BACKPRESSURE when a staged TCP event is pending; #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or #PDCOMM_POISONED.

Notes

  • Ownership: release both items with pdcomm_secs_destroy(). On failure neither output holds an item.