Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 | both |
#define _XOPEN_SOURCE_EXTENDED 1
#include <xti.h>
int t_free(char *ptr, int struct_type);
Frees memory previously allocated by t_alloc(). This function frees memory for the specified structure, and also frees memory for buffers referenced by the structure.
T_BIND struct t_bind
T_CALL struct t_call
T_OPTMGMT struct t_optmgmt
T_DIS struct t_discon
T_UNITDATA struct t_unitdata
T_UDERROR struct t_uderr
T_INFO struct t_info
where each of these structures
is used as an argument to one or more transport functions.t_free() checks the addr, opt and udata fields of the given structure (as appropriate) and frees the buffers pointed to by the buf field of the netbuf structure. If buf is a NULL pointer, t_free() does not attempt to free memory. After all buffers are freed, t_free() frees the memory associated with the structure pointed to by ptr.
Undefined results occur if ptr or any of the buf pointers points to a block of memory that was not previously allocated by t_alloc().
Valid states: All - except for T_UNINIT
If successful, t_free() returns 0.