tpgetcallinfo — Read the associated call headers
#include <atmi.h>
int tpgetcallinfo(const char *msg, UBFH **cibuf, long flags);
Link with -latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm
Function is used to retrieve any call header information associated with msg XATMI buffer. Both buffers msg and cibuf must be allocated by tpalloc(3) calls. The msg cannot be NULL buffer (null). cibuf most point to XATMI buffer or NULL. Once function called, any call infos are copied to cibuf (with type reallocation, if there is not enough space in cibuf or not a UBF buffer).
Valid flags
TPCI_NOEOFERR Do not generate TPESYSTEM error in case if no call info buffer is associated with the msg. Instead return 0. In case if buffer found, return value is 1.
Call information to XATMI buffer is set by tpsetcallinfo(3) call, and is associated with msg buffer through the call path, i.e. IPC between processes, such as tpcall(3). For more details see tpsetcallinfo(3) description.
If flag TPCI_NOEOFERR is not used: On success, tpgetcallinfo() returns zero; on error, -1 is returned, with tperrno set to indicate the error.
If flag TPCI_NOEOFERR is used: On success tpgetcallinfo() returns 1; If no call information is associated with the msg buffer, returns 0; on other error, -1 is returned, with tperrno set to indicate the error.
Note that tpstrerror() returns generic error message plus custom message with debug info from last function call.
TPEINVAL msg is NULL, msg is not XATMI buffer, flags is not 0. cibuf is NULL or not pointing to valid XATMI buffer.
TPESYSTEM No call infos are associated with msg buffer.
TPEOS System failure occurred during serving. See logs i.e. user log, or debugs for more info. Also used in cases in case of memory condition.