Skip to content
Start free evaluation

pdcomm_gem_program_put

Function

Stores a program locally.

PdcommStatus pdcomm_gem_program_put(PdcommTcpEndpoint *endpoint, const PdcommSecsItem *id, const PdcommSecsItem *body, uint32_t mode, PdcommGemProgramWriteInfo *info)

Declared in: #include <pdcomm_gem_programs.h>

Requires a stopped endpoint. No wire acknowledgement is involved. After #PDCOMM_PROGRAM_UNCONFIRMED the change is installed: inspect info and do not repeat the mutation as if it had been rolled back.

Parameters

NameDescription
endpointStopped endpoint with a program store.
idPPID item: nonempty ASCII or Binary.
bodyPPBODY item in one of the supported program body formats.
mode#PDCOMM_GEM_PROGRAM_CREATE, #PDCOMM_GEM_PROGRAM_REPLACE, or #PDCOMM_GEM_PROGRAM_UPSERT.
infoReceives the outcome. Must not be NULL.

Returns

#PDCOMM_OK or #PDCOMM_PROGRAM_UNCONFIRMED when installed; #PDCOMM_INVALID_ARGUMENT for a NULL or short argument, an unknown mode, an unsupported PPID or body format, an empty PPID, a body length that does not match its element width, CREATE of an existing PPID, or REPLACE of a missing PPID; #PDCOMM_LIMIT_EXCEEDED when a store limit or the PPID length limit is exceeded; #PDCOMM_INVALID_STATE when the endpoint is not stopped or has no program store; #PDCOMM_BACKPRESSURE when a staged TCP event is pending; a persistence error such as #PDCOMM_IO_ERROR (store unchanged); #PDCOMM_ALLOCATION_FAILED or #PDCOMM_POISONED.