Back to home page

Enduro/X

 
 

    


0001 TPFREE(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tpfree - Free up XATMI buffer
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 void tpfree(char *'ptr');
0016 
0017 
0018 For XATMI client link with '-latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm'
0019 
0020 For XATMI server link with '-latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf 
0021 -lnstd -lpthread -lrt -lm'
0022 
0023 DESCRIPTION
0024 -----------
0025 Free up the XATMI buffer allocated by *tpalloc()* or *tprealloc()*. The pointer 
0026 shall not be used to any other calls afterwards, as it points to invalid memory 
0027 after call. *tpfree()* must not be used for auto-allocated buffers, i.e. ones 
0028 received into to service routine, as auto buffers will be cleaned up in following 
0029 *tpreturn()* or *tpforward()* calls.
0030 
0031 Function will not free any other resources e.g. allocated by *malloc()* or *calloc()*.
0032 
0033 *tpfree()* is not needed to be called on buffers which are automatically allocated
0034 by incoming service call. Also *tpfree()* is not needed to called on buffers
0035 which are returned to *tpreturn(3)* or *tpforward(3)*. At service ending,
0036 tpreturn or tpforward makes free auto-allocated buffer and return buffer (if it
0037 is different than auto-alloc buffer).
0038 
0039 tpfree() traverses any embedded *BFLD_UBF* or *BFLD_PTR* fields in case if doing
0040 free on *UBF* buffer. It collects any XATMI buffer pointers and performs on the tpfree().
0041 If some of the *BFLD_PTR* fields shall be left in the system after the free 
0042 (or free of automatic buffer), the value shall be set to NULL ptr prior the tpfree()
0043 takes place.
0044 
0045 RETURN VALUE
0046 ------------
0047 Function is void and no error is returned.
0048 
0049 ERRORS
0050 ------
0051 Function is void and no error is returned.
0052 
0053 EXAMPLE
0054 -------
0055 See *atmitest/test026_typedjson/atmiclt26.c* for sample code.
0056 
0057 BUGS
0058 ----
0059 Report bugs to support@mavimax.com
0060 
0061 SEE ALSO
0062 --------
0063 *tpacall(3)* *tpgetrply(3)*
0064 
0065 COPYING
0066 -------
0067 (C) Mavimax, Ltd
0068