Back to home page

Enduro/X

 
 

    


0001 _TMSTARTSERVER(3)
0002 =================
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 _tmstartserver - Start Enduro/X server process in compatibility mode
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 int _tmstartserver( int 'argc', char **'argv', struct tmsvrargs_t *'tmsvrargs');
0016 
0017 
0018 Link with '-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0019 
0020 DESCRIPTION
0021 -----------
0022 Function is used to start Enduro/X XATMI server process. The startup routine
0023 takes standard command line arguments and additions structure 'tmsvrargs' filled
0024 with *tpsvrinit(3)* and *tpsvrdone(3)* callbacks, it also contains the XA Switch
0025 object and array filled with services to be advertised after the user's *tpsvrinit(3)*
0026 is done. Any services which user have advertised by *tpadvertise(3)* and which 
0027 have also exported to 'tmsvrargs.svctab', will be ignored (i.e. *TPEMATCH* error
0028 will be ignored). The 'tmsvrargs.svctab' table must be terminated with row for
0029 which 'svcnm' is set to NULL.
0030 
0031 If starting XATMI server in mult-threaded, mode *_tmbuilt_with_thread_option* extern
0032 variable must be set to *1*.
0033 
0034 
0035 The *struct tmsvrargs_t* structure is following:
0036 
0037 --------------------------------------------------------------------------------
0038 
0039 struct tmsvrargs_t
0040 {
0041   struct xa_switch_t * xa_switch;   /**< XA Switch                            */
0042   struct tmdsptchtbl_t *svctab;     /**< Service dispatch table               */
0043   long flags;                       /**< Reserved for future use              */
0044   int (*p_tpsvrinit)(int, char **); /**< Server init function                 */
0045   void (*p_tpsvrdone)(void);        /**< callback to server done              */
0046   void * reserved0;                 /**< Reserved for future use              */
0047   void * reserved1;                 /**< Reserved for future use              */
0048   void * reserved2;                 /**< Reserved for future use              */
0049   void * reserved3;                 /**< Reserved for future use              */
0050   void * reserved4;                 /**< Reserved for future use              */
0051   int (*p_tpsvrthrinit)(int, char **); /**< thread init func                  */
0052   void (*p_tpsvrthrdone)(void);        /**< thread done func                  */
0053 };
0054 
0055 --------------------------------------------------------------------------------
0056 
0057 
0058 The *struct tmsvrargs_t* structure is following:
0059 
0060 --------------------------------------------------------------------------------
0061 
0062 struct tmdsptchtbl_t
0063 {
0064     char *svcnm;                    /**< Service name                         */
0065     char *funcnm;                   /**< Function name                        */
0066     void (*p_func)(TPSVCINFO *);    /**< Function to run on service invocation*/
0067     long rfu1;                      /**< Reserved 1                           */
0068     long rfu2;                      /**< Reserved 2                           */
0069 };
0070 
0071 --------------------------------------------------------------------------------
0072 
0073 RFU bits should be initialized to 0 or NULL.
0074 
0075 RETURN VALUE
0076 ------------
0077 On success, *_tmstartserver()* returns 0; on error, -1 is 
0078 returned, with *tperrno* set to indicate the error.
0079 
0080 ERRORS
0081 ------
0082 For error records see NDRX and/or ULOG records.
0083 
0084 BUGS
0085 ----
0086 Report bugs to support@mavimax.com
0087 
0088 EXAMPLE
0089 -------
0090 See *atmitest/test004_basicevent/atmisv4_1ST.c* for sample code.
0091 
0092 SEE ALSO
0093 --------
0094 *ndrx_main(3)* *ndrx_main_integra(3)* *tpsvrinit(3) *tpsvrdone(3)* 
0095 *tpthrsvrinit(3)* *tpthrsvdone(3)*
0096 
0097 COPYING
0098 -------
0099 (C) Mavimax, Ltd
0100