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)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
| Name | Description |
|---|---|
endpoint | Stopped endpoint with a program store. |
id | PPID item: nonempty ASCII or Binary. |
body | PPBODY item in one of the supported program body formats. |
mode | #PDCOMM_GEM_PROGRAM_CREATE, #PDCOMM_GEM_PROGRAM_REPLACE, or #PDCOMM_GEM_PROGRAM_UPSERT. |
info | Receives 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.