t_free(S) (TLI/XTI) 6 January 1993 t_free(S) Name t_free - free a library structure Syntax TLI syntax cc . . . -lnsls #include <sys/tiuser.h> int t_free (ptr, struct_type) char *ptr; int struct_type; XTI syntax cc . . . -lxti #include <xti.h> int t_free (ptr, struct_type) char *ptr; int struct_type; Description The tfree function frees memory previously allocated by talloc. This function frees memory for the specified structure and also frees memory for buffers referenced by the structure. ptr points to one of the six structure types described for talloc, and structtype identifies the type of that structure which can be one of the following, where each of these structures is used as an argument to one or more transport functions. TLI structtype XTI structtype Allocated Value Value Structure ___________________________________________________________________ TBIND TBINDSTR struct t_bind TCALL TCALLSTR struct t_call TDIS TDISSTR struct t_discon TINFO TINFOSTR struct t_info TOPTMGMT TOPTMGMTSTR struct t_optmgmt TUDERROR TUDERRORSTR struct t_uderr TUNITDATA TUNITDATASTR struct t_unitdata The tfree function 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 (see netbuf(FP)) structure. If buf is NULL, tfree does not attempt to free memory. After all buffers are freed, tfree 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 talloc. On failure, terrno may be set to the following: TNOSTRUCTYPE structtype is out of the range. This error code only occurs with XTI. [TSYSERR] A system error has occurred during execution of this func- tion. For TLI, this error code is also returned when structtype is out of range; when this error occurs, errno is set to EINVAL. Diagnostics The tfree function returns 0 on success and -1 on failure, and terrno is set to indicate the error. See also netbuf(FP), talloc(S) Standards conformance tfree is conformant with: AT&T SVID Issue 2; X/Open Portability Guide, Issue 3, 1989; and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2).