tprealloc − Reallocated previously allocated XATMI buffer
#include <atmi.h>
char *tprealloc(char *ptr, long size);
For XATMI client link with −latmiclt −latmi −lubf −lnstd −lpthread −lrt −lm
For XATMI server link with −latmisrv|−latmisrvnomain|−latmisrvinteg −latmi −lubf −lnstd −lpthread −lrt −lm
Reallocate (change the buffer size) of previously allocated resources by tpalloc(). The XATMI buffer is passed in with ptr parameters and new size is provided in size parameter. It is allowed to resize auto−allocated buffers (i.e. buffer that is passed into TPSVCINFO.data field.)
In case of success, function returns possibly new pointer of re−allocated memory. The pointer could be the same, for example if size is not changed of the buffer. In case of failure, function returns NULL and tperrno returns the error code.
Note that tpstrerror() returns generic error message plus custom message with debug info from last function call.
TPEINVAL Invalid ptr pointer passed in. Either buffer not allocated by tpalloc() or ptr is NULL.
TPEOS System failure occurred during serving. See logs i.e. user log, or debugs for more info.
See atmitest/test001_basiccall/atmiclt1.c for sample code.
Report bugs to support@mavimax.com
© Mavimax, Ltd