Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

OS_TLI.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   OS_TLI.h
00006  *
00007  *  $Id: OS_TLI.h,v 1.1.1.3 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Doug Schmidt <schmidt@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_OS_TLI_H
00015 #define ACE_OS_TLI_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 #include "ace/OS_Export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "ace/OS_Errno.h"
00026 
00027 # if !defined (ACE_HAS_TLI)
00028 // Dummies to help compilation.
00029 struct t_call { };
00030 struct t_bind { };
00031 struct t_info { };
00032 struct t_optmgmt { };
00033 struct t_discon { };
00034 struct t_unitdata { };
00035 struct t_uderr { };
00036 struct netbuf { };
00037 
00038 # else /* !ACE_WIN32 */
00039 
00040 #   if !defined (ACE_HAS_TLI_PROTOTYPES)
00041 
00042 // Define ACE_TLI headers for systems that don't prototype them....
00043 extern "C"
00044 {
00045   int t_accept(int fildes, int resfd, struct t_call *call);
00046   char *t_alloc(int fildes, int struct_type, int fields);
00047   int t_bind(int fildes, struct t_bind *req, struct t_bind *ret);
00048   int t_close(int fildes);
00049   int t_connect(int fildes, struct t_call *sndcall,
00050                 struct t_call *rcvcall);
00051   void t_error(const char *errmsg);
00052   int t_free(char *ptr, int struct_type);
00053   int t_getinfo(int fildes, struct t_info *info);
00054   int t_getname (int fildes, struct netbuf *namep, int type);
00055   int t_getstate(int fildes);
00056   int t_listen(int fildes, struct t_call *call);
00057   int t_look(int fildes);
00058   int t_open(char *path, int oflag, struct t_info *info);
00059   int t_optmgmt(int fildes, struct t_optmgmt *req,
00060                 struct t_optmgmt *ret);
00061   int t_rcv(int fildes, char *buf, unsigned int nbytes, int *flags);
00062   int t_rcvconnect(int fildes, struct t_call *call);
00063   int t_rcvdis(int fildes, struct t_discon *discon);
00064   int t_rcvrel(int fildes);
00065   int t_rcvudata(int fildes, struct t_unitdata *unitdata, int *flags);
00066   int t_rcvuderr(int fildes, struct t_uderr *uderr);
00067   int t_snd(int fildes, const char *buf, unsigned int nbytes, int flags);
00068   int t_snddis(int fildes, struct t_call *call);
00069   int t_sndrel(int fildes);
00070   int t_sndudata(int fildes, struct t_unitdata *unitdata);
00071   int t_sync(int fildes);
00072   int t_unbind(int fildes);
00073 }
00074 #   endif /* !ACE_HAS_TLI_PROTOTYPES */
00075 
00076 #   if defined (ACE_HAS_TIUSER_H) || defined (ACE_HAS_XTI) || defined (ACE_HAS_FORE_ATM_XTI)
00077 #     if defined (ACE_HAS_BROKEN_XTI_MACROS)
00078 #       undef TCP_NODELAY
00079 #       undef TCP_MAXSEG
00080 #     endif /* ACE_HAS_BROKEN_XTI_MACROS */
00081 #     if defined (ACE_HAS_TIUSER_H_BROKEN_EXTERN_C)
00082 extern "C" {
00083 #     endif /* ACE_HAS_TIUSER_H_BROKEN_EXTERN_C */
00084 #     if defined (ACE_HAS_FORE_ATM_XTI)
00085 #       include /**/ <fore_xti/xti_user_types.h>
00086 #       include /**/ <fore_xti/xti.h>
00087 #       include /**/ <fore_xti/xti_atm.h>
00088 #       include /**/ <fore_xti/netatm/atm.h>
00089 #       include /**/ <fore_xti/ans.h>
00090 #     elif defined (ACE_HAS_TIUSER_H)
00091 #       include /**/ <tiuser.h>
00092 #     elif defined (ACE_HAS_SYS_XTI_H)
00093 #         define class ace_xti_class
00094 #         include /**/ <sys/xti.h>
00095 #         undef class
00096 #     else
00097 #         include /**/ <xti.h>
00098 #     endif /* ACE_HAS_FORE_ATM_XTI */
00099 #     if defined (ACE_HAS_TIUSER_H_BROKEN_EXTERN_C)
00100 }
00101 #     endif /* ACE_HAS_TIUSER_H_BROKEN_EXTERN_C */
00102 #   endif /* ACE_HAS_TIUSER_H || ACE_HAS_XTI */
00103 
00104 // Apparently this particular prototype is missing in so many
00105 // platforms that is just better to declare it ourselves.
00106 extern "C" int t_getname (int, struct netbuf *, int);
00107 
00108 # endif /* ACE_WIN32 */
00109 
00110 // If the xti.h file redefines the function names, do it now, else
00111 // when the function definitions are encountered, they won't match the
00112 // declaration here.
00113 
00114 # if defined (ACE_REDEFINES_XTI_FUNCTIONS)
00115 #   include /**/ <xti.h>
00116 #   if defined (UNIXWARE_2_0)         /* They apparently forgot one... */
00117 extern "C" int _xti_error(char *);
00118 #   endif /* UNIXWARE */
00119 # endif /* ACE_REDEFINES_XTI_FUNCTIONS */
00120 
00121 /**
00122  * @class ACE_OS_TLI
00123  *
00124  * @brief This class is a wrapper for the TLI operations
00125  *
00126  */
00127 class ACE_OS_Export ACE_OS_TLI
00128 {
00129 public:
00130   // = A set of wrappers for TLI.
00131   static int t_accept (ACE_HANDLE fildes,
00132                        ACE_HANDLE resfd,
00133                        struct t_call
00134                        *call);
00135   static char *t_alloc (ACE_HANDLE fildes,
00136                         int struct_type,
00137                         int
00138                         fields);
00139   static int t_bind (ACE_HANDLE fildes,
00140                      struct t_bind *req,
00141                      struct
00142                      t_bind *ret);
00143   static int t_close (ACE_HANDLE fildes);
00144   static int t_connect (ACE_HANDLE fildes,
00145                         struct t_call *sndcall,
00146                         struct t_call *rcvcall);
00147   static void t_error (const char *errmsg);
00148   static int t_free (char *ptr,
00149                      int struct_type);
00150   static int t_getinfo (ACE_HANDLE fildes,
00151                         struct t_info *info);
00152   static int t_getname (ACE_HANDLE fildes,
00153                         struct netbuf *namep,
00154                         int type);
00155   static int t_getstate (ACE_HANDLE fildes);
00156   static int t_listen (ACE_HANDLE fildes,
00157                        struct t_call *call);
00158   static int t_look (ACE_HANDLE fildes);
00159   static ACE_HANDLE t_open (char *path,
00160                             int oflag,
00161                             struct t_info *info);
00162   static int t_optmgmt (ACE_HANDLE fildes,
00163                         struct t_optmgmt *req,
00164                         struct t_optmgmt *ret);
00165   static int t_rcv (ACE_HANDLE fildes,
00166                     char *buf,
00167                     unsigned int nbytes,
00168                     int *flags);
00169   static int t_rcvdis (ACE_HANDLE fildes,
00170                        struct t_discon *discon);
00171   static int t_rcvrel (ACE_HANDLE fildes);
00172   static int t_rcvudata (ACE_HANDLE fildes,
00173                          struct t_unitdata *unitdata,
00174                          int *flags);
00175   static int t_rcvuderr (ACE_HANDLE fildes,
00176                          struct t_uderr *uderr);
00177   static int t_snd (ACE_HANDLE fildes,
00178                     const char *buf,
00179                     unsigned int nbytes,
00180                     int flags);
00181   static int t_snddis (ACE_HANDLE fildes,
00182                        struct t_call *call);
00183   static int t_sndrel (ACE_HANDLE fildes);
00184   static int t_sync (ACE_HANDLE fildes);
00185   static int t_unbind (ACE_HANDLE fildes);
00186 };
00187 
00188 # if defined (ACE_HAS_INLINED_OSCALLS)
00189 #   if defined (ACE_INLINE)
00190 #     undef ACE_INLINE
00191 #   endif /* ACE_INLINE */
00192 #   define ACE_INLINE inline
00193 #   include "ace/OS_TLI.inl"
00194 # endif /* ACE_HAS_INLINED_OSCALLS */
00195 
00196 #include "ace/post.h"
00197 #endif /* ACE_OS_TLI_H */

Generated on Mon Jun 16 11:20:46 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002