0001 TPSERVICE(3)
0002 ============
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 tpservice - Template service function signature
0009
0010
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014
0015 void tpservice(TPSVCINFO *'svcinfo');
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 -lnstd -lpthread -lrt -lm'
0021
0022 DESCRIPTION
0023 -----------
0024 This is service function signature/template. *tpservice* is service function
0025 that must be passed to *tpadvertise()* in order to provide callable service to
0026 XATMI system. Services can be called by *tpcall()*, *tpacall()* or *tpforward()*.
0027 If server is conversational, then *tpconnect()* is used to establish the
0028 connection with service. When service is invoked, then parameter 'svcinfo' is
0029 initialised with following field:
0030
0031 ---------------------------------------------------------------------
0032
0033 typedef struct
0034 {
0035 char name[XATMI_SERVICE_NAME_LENGTH+1];
0036 char *data;
0037 long len;
0038 long flags;
0039 int cd;
0040 long appkey;
0041 CLIENTID cltid;
0042 char fname[XATMI_SERVICE_NAME_LENGTH+1];
0043 } TPSVCINFO;
0044
0045 ---------------------------------------------------------------------
0046
0047 'name' is service name which is invoked. 'data' is pointer XATMI buffer which
0048 is allocated by Enduro/X in current process scope. Note that is service was invoked
0049 with NULL buffer, then in this case 'data' will be NULL too. 'len' is XATMI buffer
0050 length. 'flags' these are flags which were passed to origin *tpcall()*.
0051 'appkey' is reserved for future use. 'cltid' is reserved for future use.
0052 'fname' is service function name which was invoked.
0053
0054 In case if using C++ compiler, function must be defined without name mangling,
0055 thus extern "C" prefix shall be used.
0056
0057 RETURN VALUE
0058 ------------
0059 The function does not return any value. But according to XATMI specification,
0060 the server function must terminate processing with *tpreturn()* or *tpforward()*,
0061 which effectively finish the service function processing and gives control
0062 back to client or next XATMI server. In case of success the server can pass
0063 *TPSUCCESS* or *TPFAIL* if doing *tpreturn()*. *TPFAIL* will automatically
0064 abort global transaction, if one in progress.
0065
0066
0067 ERRORS
0068 ------
0069 Not available.
0070
0071 BUGS
0072 ----
0073 Report bugs to support@mavimax.com
0074
0075 SEE ALSO
0076 --------
0077 *tpacall(3)* *tpgetrply(3)*
0078
0079 COPYING
0080 -------
0081 (C) Mavimax, Ltd
0082