📄 t_free.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>t_free</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4>NAME</h4><blockquote>t_free - free a library structure</blockquote><h4>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="xti.h.html">xti.h</a>>int t_free( void *ptr, int struct_type)</code></pre></blockquote><h4>DESCRIPTION</h4><blockquote><pre><P><table bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Parameters</b><th align=center><b>Before call</b><th align=center><b>After call</b><tr valign=top><td align=left>ptr<td align=center>x<td align=center>/<tr valign=top><td align=left>struct_type<td align=center>x<td align=center>/</table></pre><p>The<i>t_free()</i>function frees memory previously allocated by<i><a href="t_alloc.html">t_alloc()</a></i>.This function will free memory for the specified structure, andwill also free memory for buffers referenced by the structure.<p>The argument<I>ptr</I>points to one of the seven structure types described for<i><a href="t_alloc.html">t_alloc()</a></i>,and<I>struct_type</I>identifies the type of that structure which must be oneof the following:<pre><code>T_BIND struct t_bindT_CALL struct t_callT_OPTMGMT struct t_optmgmtT_DIS struct t_disconT_UNITDATA struct t_unitdataT_UDERROR struct t_uderrT_INFO struct t_info</code></pre><p>where each of these structures is used as an argument to one ormore transport functions.<p>The function<i>t_free()</i>will check the<I>addr</I>,<I>opt</I>and<I>udata</I>fields of the given structure (as appropriate) and free thebuffers pointed to by the<I>buf</I>field of the<B>netbuf</B>structure.If<I>buf</I>is a null pointer,<i>t_free()</i>will not attempt to free memory. After all buffers are freed,<i>t_free()</i>will free the memory associated with the structure pointed to by<I>ptr</I>.<p>Undefined results will occur if<I>ptr</I>or any of the<I>buf</I>pointers points to a block of memory that was not previously allocated by<i><a href="t_alloc.html">t_alloc()</a></i>.</blockquote><h4>VALID STATES</h4><blockquote>ALL - apart from T_UNINIT</blockquote><h4>ERRORS</h4><blockquote>On failure,<I>t_errno</I>is set to the following:<dl compact><dt>[TNOSTRUCTYPE]<dd>Unsupported <I>struct_type</I> requested.<dt>[TPROTO]<dd>This error indicates that a communication problem has been detected betweenXTI and the transport provider for which there is no other suitable XTIerror<I>(t_errno)</I>.<dt>[TSYSERR]<dd>A system error has occurred during execution of this function.</dl></blockquote><h4>RETURN VALUE</h4><blockquote>Upon successful completion, a value of 0 is returned. Otherwise,a value of -1 is returned and<I>t_errno</I>is set to indicate an error.</blockquote><h4>SEE ALSO</h4><blockquote><i><a href="t_alloc.html">t_alloc()</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -