OS_TLI.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // OS_TLI.inl,v 4.13 2006/01/23 17:48:51 shuston Exp
00004 
00005 #include "ace/OS_NS_errno.h"
00006 
00007 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00008 
00009 namespace ACE_OS {
00010 
00011 ACE_INLINE int
00012 t_accept (ACE_HANDLE handle, ACE_HANDLE reshandle, struct t_call *call)
00013 {
00014 #if defined (ACE_HAS_TLI)
00015   ACE_OSCALL_RETURN (::t_accept (handle, reshandle, call), int, -1);
00016 #else
00017   ACE_UNUSED_ARG (call);
00018   ACE_UNUSED_ARG (reshandle);
00019   ACE_UNUSED_ARG (handle);
00020 
00021   ACE_NOTSUP_RETURN (-1);
00022 #endif /* ACE_HAS_TLI */
00023 }
00024 
00025 ACE_INLINE char *
00026 t_alloc (ACE_HANDLE handle, int struct_type, int fields)
00027 {
00028 #if defined (ACE_HAS_TLI)
00029 #  if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)
00030   // XPG5 changes t_alloc() return from char* to void*, so ACE_OSCALL_RETURN
00031   // doesn't compile correctly.
00032   char *result;
00033   ACE_OSCALL (::t_alloc (handle, struct_type, fields), char *, 0, result);
00034   return result;
00035 #  else
00036   ACE_OSCALL_RETURN (::t_alloc (handle, struct_type, fields),
00037                      char *, 0);
00038 #  endif /* XPG4 vs XPG5 */
00039 #else
00040   ACE_UNUSED_ARG (fields);
00041   ACE_UNUSED_ARG (struct_type);
00042   ACE_UNUSED_ARG (handle);
00043 
00044   ACE_NOTSUP_RETURN (0);
00045 #endif /* ACE_HAS_TLI */
00046 }
00047 
00048 ACE_INLINE int
00049 t_bind (ACE_HANDLE handle, struct t_bind *req, struct t_bind *ret)
00050 {
00051 #if defined (ACE_HAS_TLI)
00052   ACE_OSCALL_RETURN (::t_bind (handle, req, ret), int, -1);
00053 #else
00054   ACE_UNUSED_ARG (ret);
00055   ACE_UNUSED_ARG (req);
00056   ACE_UNUSED_ARG (handle);
00057 
00058   ACE_NOTSUP_RETURN (-1);
00059 #endif /* ACE_HAS_TLI */
00060 }
00061 
00062 ACE_INLINE int
00063 t_close (ACE_HANDLE handle)
00064 {
00065 #if defined (ACE_HAS_TLI)
00066   ACE_OSCALL_RETURN (::t_close (handle), int, -1);
00067 #else
00068   ACE_UNUSED_ARG (handle);
00069 
00070   ACE_NOTSUP_RETURN (-1);
00071 #endif /* ACE_HAS_TLI */
00072 }
00073 
00074 ACE_INLINE int
00075 t_connect(ACE_HANDLE fildes,
00076           struct t_call *sndcall,
00077           struct t_call *rcvcall)
00078 {
00079 #if defined (ACE_HAS_TLI)
00080   ACE_OSCALL_RETURN (::t_connect (fildes, sndcall, rcvcall), int, -1);
00081 #else
00082   ACE_UNUSED_ARG (fildes);
00083   ACE_UNUSED_ARG (sndcall);
00084   ACE_UNUSED_ARG (rcvcall);
00085 
00086   ACE_NOTSUP_RETURN (-1);
00087 #endif /* ACE_HAS_TLI */
00088 }
00089 
00090 ACE_INLINE void
00091 t_error (const char *errmsg)
00092 {
00093 #if defined (ACE_HAS_TLI)
00094 #if defined (ACE_HAS_BROKEN_T_ERROR)
00095   ::t_error (const_cast<char *> (errmsg));
00096 #else
00097   ::t_error (errmsg);
00098 #endif /* ACE_HAS_BROKEN_T_ERROR */
00099 #else
00100   ACE_UNUSED_ARG (errmsg);
00101 #endif /* ACE_HAS_TLI */
00102 }
00103 
00104 ACE_INLINE int
00105 t_free (char *ptr, int struct_type)
00106 {
00107 #if defined (ACE_HAS_TLI)
00108   if (ptr == 0)
00109     return 0;
00110   ACE_OSCALL_RETURN (::t_free (ptr, struct_type), int, -1);
00111 #else
00112   ACE_UNUSED_ARG (struct_type);
00113   ACE_UNUSED_ARG (ptr);
00114 
00115   ACE_NOTSUP_RETURN (-1);
00116 #endif /* ACE_HAS_TLI */
00117 }
00118 
00119 ACE_INLINE int
00120 t_getinfo (ACE_HANDLE handle, struct t_info *info)
00121 {
00122 #if defined (ACE_HAS_TLI)
00123   ACE_OSCALL_RETURN (::t_getinfo (handle, info), int, -1);
00124 #else
00125   ACE_UNUSED_ARG (info);
00126   ACE_UNUSED_ARG (handle);
00127 
00128   ACE_NOTSUP_RETURN (-1);
00129 #endif /* ACE_HAS_TLI */
00130 }
00131 
00132 ACE_INLINE int
00133 t_getname (ACE_HANDLE handle, struct netbuf *namep, int type)
00134 {
00135 #if defined (ACE_HAS_XTI)
00136   struct t_bind bound, peer;
00137   // Depending on which address the caller wants, fill caller's values
00138   // into one of the t_bind netbufs. The other is set up to ignore that
00139   // address.
00140   switch (type)
00141     {
00142     case LOCALNAME:
00143       bound.addr.buf = namep->buf;
00144       bound.addr.maxlen = namep->maxlen;
00145       bound.addr.len = 0;
00146       peer.addr.buf = 0;
00147       peer.addr.maxlen = 0;
00148       peer.addr.len = 0;
00149       break;
00150     case REMOTENAME:
00151       bound.addr.buf = 0;
00152       bound.addr.maxlen = 0;
00153       bound.addr.len = 0;
00154       peer.addr.buf = namep->buf;
00155       peer.addr.maxlen = namep->maxlen;
00156       peer.addr.len = 0;
00157       break;
00158     default:
00159       ACE_OS::last_error (EINVAL);
00160       return -1;
00161     }
00162   if (t_getprotaddr (handle, &bound, &peer) == -1)
00163     return -1;
00164   // Call succeeded; put the caller's desired address length in his netbuf.
00165   if (type == LOCALNAME)
00166     namep->len = bound.addr.len;
00167   else
00168     namep->len = peer.addr.len;
00169   return 0;
00170 
00171 #elif defined (ACE_HAS_SVR4_TLI)
00172   ACE_OSCALL_RETURN (::t_getname (handle, namep, type), int, -1);
00173 #else
00174   ACE_UNUSED_ARG (handle);
00175   ACE_UNUSED_ARG (namep);
00176   ACE_UNUSED_ARG (type);
00177 
00178   ACE_NOTSUP_RETURN (-1);
00179 #endif /* ACE_HAS_SVR4_TLI */
00180 }
00181 
00182 ACE_INLINE int
00183 t_getstate (ACE_HANDLE handle)
00184 {
00185 #if defined (ACE_HAS_TLI)
00186   ACE_OSCALL_RETURN (::t_getstate (handle), int, -1);
00187 #else
00188   ACE_UNUSED_ARG (handle);
00189 
00190   ACE_NOTSUP_RETURN (-1);
00191 #endif /* ACE_HAS_TLI */
00192 }
00193 
00194 ACE_INLINE int
00195 t_listen (ACE_HANDLE handle, struct t_call *call)
00196 {
00197 #if defined (ACE_HAS_TLI)
00198   ACE_OSCALL_RETURN (::t_listen (handle, call), int, -1);
00199 #else
00200   ACE_UNUSED_ARG (handle);
00201   ACE_UNUSED_ARG (call);
00202 
00203   ACE_NOTSUP_RETURN (-1);
00204 #endif /* ACE_HAS_TLI */
00205 }
00206 
00207 ACE_INLINE int
00208 t_look (ACE_HANDLE handle)
00209 {
00210 #if defined (ACE_HAS_TLI)
00211   ACE_OSCALL_RETURN (::t_look (handle), int, -1);
00212 #else
00213   ACE_UNUSED_ARG (handle);
00214 
00215   ACE_NOTSUP_RETURN (-1);
00216 #endif /* ACE_HAS_TLI */
00217 }
00218 
00219 ACE_INLINE ACE_HANDLE
00220 t_open (char *path, int oflag, struct t_info *info)
00221 {
00222 #if defined (ACE_HAS_TLI)
00223   ACE_OSCALL_RETURN (::t_open (path, oflag, info), ACE_HANDLE, ACE_INVALID_HANDLE);
00224 #else
00225   ACE_UNUSED_ARG (path);
00226   ACE_UNUSED_ARG (oflag);
00227   ACE_UNUSED_ARG (info);
00228 
00229   ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE);
00230 #endif /* ACE_HAS_TLI */
00231 }
00232 
00233 ACE_INLINE int
00234 t_optmgmt (ACE_HANDLE handle, ACE_TOPTMGMT *req, ACE_TOPTMGMT *ret)
00235 {
00236 #if defined (ACE_HAS_TLI)
00237   ACE_OSCALL_RETURN (::t_optmgmt (handle, req, ret), int, -1);
00238 #else
00239   ACE_UNUSED_ARG (handle);
00240   ACE_UNUSED_ARG (req);
00241   ACE_UNUSED_ARG (ret);
00242 
00243   ACE_NOTSUP_RETURN (-1);
00244 #endif /* ACE_HAS_TLI */
00245 }
00246 
00247 ACE_INLINE int
00248 t_rcv (ACE_HANDLE handle,
00249        char *buf,
00250        unsigned int nbytes,
00251        int *flags)
00252 {
00253 #if defined (ACE_HAS_TLI)
00254   ACE_OSCALL_RETURN (::t_rcv (handle, buf, nbytes, flags),
00255                      int, -1);
00256 #else
00257   ACE_UNUSED_ARG (handle);
00258   ACE_UNUSED_ARG (buf);
00259   ACE_UNUSED_ARG (nbytes);
00260   ACE_UNUSED_ARG (flags);
00261 
00262   ACE_NOTSUP_RETURN (-1);
00263 #endif /* ACE_HAS_TLI */
00264 }
00265 
00266 ACE_INLINE int
00267 t_rcvdis (ACE_HANDLE handle, struct t_discon *discon)
00268 {
00269 #if defined (ACE_HAS_TLI)
00270   ACE_OSCALL_RETURN (::t_rcvdis (handle, discon), int, -1);
00271 #else
00272   ACE_UNUSED_ARG (handle);
00273   ACE_UNUSED_ARG (discon);
00274 
00275   ACE_NOTSUP_RETURN (-1);
00276 #endif /* ACE_HAS_TLI */
00277 }
00278 
00279 ACE_INLINE int
00280 t_rcvrel (ACE_HANDLE handle)
00281 {
00282 #if defined (ACE_HAS_TLI)
00283   ACE_OSCALL_RETURN (::t_rcvrel (handle), int, -1);
00284 #else
00285   ACE_UNUSED_ARG (handle);
00286 
00287   ACE_NOTSUP_RETURN (-1);
00288 #endif /* ACE_HAS_TLI */
00289 }
00290 
00291 ACE_INLINE int
00292 t_rcvudata (ACE_HANDLE handle,
00293             struct t_unitdata *unitdata,
00294             int *flags)
00295 {
00296 #if defined (ACE_HAS_TLI)
00297   ACE_OSCALL_RETURN (::t_rcvudata (handle, unitdata, flags),
00298                      int, -1);
00299 #else
00300   ACE_UNUSED_ARG (handle);
00301   ACE_UNUSED_ARG (unitdata);
00302   ACE_UNUSED_ARG (flags);
00303 
00304   ACE_NOTSUP_RETURN (-1);
00305 #endif /* ACE_HAS_TLI */
00306 }
00307 
00308 ACE_INLINE int
00309 t_rcvuderr (ACE_HANDLE handle, struct t_uderr *uderr)
00310 {
00311 #if defined (ACE_HAS_TLI)
00312   ACE_OSCALL_RETURN (::t_rcvuderr (handle, uderr), int, -1);
00313 #else
00314   ACE_UNUSED_ARG (handle);
00315   ACE_UNUSED_ARG (uderr);
00316 
00317   ACE_NOTSUP_RETURN (-1);
00318 #endif /* ACE_HAS_TLI */
00319 }
00320 
00321 ACE_INLINE int
00322 t_snd (ACE_HANDLE handle,
00323        const char *buf,
00324        unsigned int nbytes,
00325        int flags)
00326 {
00327 #if defined (ACE_HAS_TLI)
00328   ACE_OSCALL_RETURN (::t_snd (handle, (char *) buf, nbytes, flags), int, -1);
00329 #else
00330   ACE_UNUSED_ARG (handle);
00331   ACE_UNUSED_ARG (buf);
00332   ACE_UNUSED_ARG (nbytes);
00333   ACE_UNUSED_ARG (flags);
00334 
00335   ACE_NOTSUP_RETURN (-1);
00336 #endif /* ACE_HAS_TLI */
00337 }
00338 
00339 ACE_INLINE int
00340 t_snddis (ACE_HANDLE handle, struct t_call *call)
00341 {
00342 #if defined (ACE_HAS_TLI)
00343   ACE_OSCALL_RETURN (::t_snddis (handle, call), int, -1);
00344 #else
00345   ACE_UNUSED_ARG (handle);
00346   ACE_UNUSED_ARG (call);
00347 
00348   ACE_NOTSUP_RETURN (-1);
00349 #endif /* ACE_HAS_TLI */
00350 }
00351 
00352 ACE_INLINE int
00353 t_sndrel (ACE_HANDLE handle)
00354 {
00355 #if defined (ACE_HAS_TLI)
00356   ACE_OSCALL_RETURN (::t_sndrel (handle), int, -1);
00357 #else
00358   ACE_UNUSED_ARG (handle);
00359 
00360   ACE_NOTSUP_RETURN (-1);
00361 #endif /* ACE_HAS_TLI */
00362 }
00363 
00364 ACE_INLINE int
00365 t_sync (ACE_HANDLE handle)
00366 {
00367 #if defined (ACE_HAS_TLI)
00368   ACE_OSCALL_RETURN (::t_sync (handle), int, -1);
00369 #else
00370   ACE_UNUSED_ARG (handle);
00371 
00372   ACE_NOTSUP_RETURN (-1);
00373 #endif /* ACE_HAS_TLI */
00374 }
00375 
00376 ACE_INLINE int
00377 t_unbind (ACE_HANDLE handle)
00378 {
00379 #if defined (ACE_HAS_TLI)
00380   ACE_OSCALL_RETURN (::t_unbind (handle), int, -1);
00381 #else
00382   ACE_UNUSED_ARG (handle);
00383 
00384   ACE_NOTSUP_RETURN (-1);
00385 #endif /* ACE_HAS_TLI */
00386 }
00387 
00388 }  /* end namespace ACE_OS */
00389 
00390 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:41:58 2006 for ACE by doxygen 1.3.6