


T_FREE(3N)              NETWORK FUNCTIONS              T_FREE(3N)



NAME
     t_free - free a library structure

SYNOPSIS
     #include <tiuser.h>

     int t_free(ptr, struct_type)
     char *ptr;
     int struct_type;

DESCRIPTION
     t_free() frees memory previously allocated  by  t_alloc(3N).
     This  function will free memory for the specified structure,
     and will also free memory  for  buffers  referenced  by  the
     structure.

     _p_t_r points to one of the six structure types  described  for
     t_alloc(3N),  and  _s_t_r_u_c_t__t_y_p_e  identifies  the type of that
     structure which can be one of the following:
          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 _a_d_d_r, _o_p_t, and _u_d_a_t_a fields of the given
     structure (as appropriate), and frees the buffers pointed to
     by the _b_u_f field of the  _n_e_t_b_u_f  (see  intro(3))  structure.
     The _m_a_x_l_e_n, _l_e_n, and _b_u_f members of the _n_e_t_b_u_f structure are
     described in t_accept(3N).  If _b_u_f is  NULL,  t_free()  will
     not  attempt  to  free memory.  After all buffers are freed,
     t_free() will free the memory associated with the  structure
     pointed to by _p_t_r.

     Undefined results will occur  if  _p_t_r  or  any  of  the  _b_u_f
     pointers points to a block of memory that was not previously
     allocated by t_alloc(3N).

RETURN VALUES
     t_free() returns:

     0    on success.

     -1   on failure and sets t_errno to indicate the error.

ERRORS
     TSYSERR        The function failed due to a system error and



Sun Release 4.1   Last change: 21 January 1990                  1






T_FREE(3N)              NETWORK FUNCTIONS              T_FREE(3N)



                    set

                    errno to indicate the error.

SEE ALSO
     intro(3), t_alloc(3N)

     _N_e_t_w_o_r_k _P_r_o_g_r_a_m_m_i_n_g















































Sun Release 4.1   Last change: 21 January 1990                  2



