dcop Library API Documentation

Xtrans.h

00001 /* $TOG: Xtrans.h /main/31 1998/02/06 15:55:22 kaleb $ */
00002 /*
00003 
00004 Copyright 1993, 1994, 1998  The Open Group
00005 
00006 All Rights Reserved.
00007 
00008 The above copyright notice and this permission notice shall be included
00009 in all copies or substantial portions of the Software.
00010 
00011 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00012 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00013 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00014 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
00015 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00016 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00017 OTHER DEALINGS IN THE SOFTWARE.
00018 
00019 Except as contained in this notice, the name of The Open Group shall
00020 not be used in advertising or otherwise to promote the sale, use or
00021 other dealings in this Software without prior written authorization
00022 from The Open Group.
00023 
00024 */
00025 /* $XFree86: xc/lib/xtrans/Xtrans.h,v 3.14 1999/12/13 02:52:54 robin Exp $ */
00026 
00027 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
00028  *
00029  * All Rights Reserved
00030  *
00031  * Permission to use, copy, modify, and distribute this software and its
00032  * documentation for any purpose and without fee is hereby granted, provided
00033  * that the above copyright notice appear in all copies and that both that
00034  * copyright notice and this permission notice appear in supporting
00035  * documentation, and that the name NCR not be used in advertising
00036  * or publicity pertaining to distribution of the software without specific,
00037  * written prior permission.  NCR makes no representations about the
00038  * suitability of this software for any purpose.  It is provided "as is"
00039  * without express or implied warranty.
00040  *
00041  * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00042  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
00043  * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00044  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
00045  * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
00046  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00047  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00048  */
00049 
00050 #ifndef _XTRANS_H_
00051 #define _XTRANS_H_
00052 
00053 #ifndef QWS
00054 #include <X11/Xfuncproto.h>
00055 #include <X11/Xos.h>
00056 #else
00057 #include <KDE-ICE/Xfuncproto.h>
00058 #include <fcntl.h>
00059 #endif
00060 
00061 /*
00062  * Set the functions names according to where this code is being compiled.
00063  */
00064 
00065 #ifdef X11_t
00066 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00067 #define TRANS(func) _X11Trans##func
00068 #else
00069 #define TRANS(func) _X11Transfunc
00070 #endif
00071 #ifdef XTRANSDEBUG
00072 static char* __xtransname = "_X11Trans";
00073 #endif
00074 #endif /* X11_t */
00075 
00076 #ifdef XSERV_t
00077 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00078 #define TRANS(func) _XSERVTrans##func
00079 #else
00080 #define TRANS(func) _XSERVTransfunc
00081 #endif
00082 #ifdef XTRANSDEBUG
00083 static char* __xtransname = "_XSERVTrans";
00084 #endif
00085 #define X11_t
00086 #endif /* X11_t */
00087 
00088 #ifdef XIM_t
00089 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00090 #define TRANS(func) _XimXTrans##func
00091 #else
00092 #define TRANS(func) _XimXTransfunc
00093 #endif
00094 #ifdef XTRANSDEBUG
00095 static char* __xtransname = "_XimTrans";
00096 #endif
00097 #endif /* XIM_t */
00098 
00099 #ifdef FS_t
00100 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00101 #define TRANS(func) _FSTrans##func
00102 #else
00103 #define TRANS(func) _FSTransfunc
00104 #endif
00105 #ifdef XTRANSDEBUG
00106 static char* __xtransname = "_FSTrans";
00107 #endif
00108 #endif /* FS_t */
00109 
00110 #ifdef FONT_t
00111 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00112 #define TRANS(func) _FontTrans##func
00113 #else
00114 #define TRANS(func) _FontTransfunc
00115 #endif
00116 #ifdef XTRANSDEBUG
00117 static char* __xtransname = "_FontTrans";
00118 #endif
00119 #endif /* FONT_t */
00120 
00121 #ifdef ICE_t
00122 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00123 #define TRANS(func) _KDE_IceTrans##func
00124 #else
00125 #define TRANS(func) _KDE_IceTransfunc
00126 #endif
00127 #ifdef XTRANSDEBUG
00128 static char* __xtransname = "_KDE_IceTrans";
00129 #endif
00130 #endif /* ICE_t */
00131 
00132 #ifdef TEST_t
00133 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00134 #define TRANS(func) _TESTTrans##func
00135 #else
00136 #define TRANS(func) _TESTTransfunc
00137 #endif
00138 #ifdef XTRANSDEBUG
00139 static char* __xtransname = "_TESTTrans";
00140 #endif
00141 #endif /* TEST_t */
00142 
00143 #ifdef LBXPROXY_t
00144 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00145 #define TRANS(func) _LBXPROXYTrans##func
00146 #else
00147 #define TRANS(func) _LBXPROXYTransfunc
00148 #endif
00149 #define X11_t       /* The server defines this - so should the LBX proxy */
00150 #ifdef XTRANSDEBUG
00151 static char* __xtransname = "_LBXPROXYTrans";
00152 #endif
00153 #endif /* LBXPROXY_t */
00154 
00155 #if !defined(TRANS)
00156 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
00157 #define TRANS(func) _XTrans##func
00158 #else
00159 #define TRANS(func) _XTransfunc
00160 #endif
00161 #ifdef XTRANSDEBUG
00162 static char* __xtransname = "_XTrans";
00163 #endif
00164 #endif /* !TRANS */
00165 
00166 
00167 /*
00168  * Create a single address structure that can be used wherever
00169  * an address structure is needed. struct sockaddr is not big enough
00170  * to hold a sockadd_un, so we create this definition to have a single
00171  * structure that is big enough for all the structures we might need.
00172  *
00173  * This structure needs to be independent of the socket/TLI interface used.
00174  */
00175 
00176 #define XTRANS_MAX_ADDR_LEN 128 /* large enough to hold sun_path */
00177 
00178 typedef struct {
00179     unsigned char   addr[XTRANS_MAX_ADDR_LEN];
00180 } Xtransaddr;
00181 
00182 
00183 #ifdef LONG64
00184 typedef int BytesReadable_t;
00185 #else
00186 typedef long BytesReadable_t;
00187 #endif
00188 
00189 
00190 #if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__)) || defined(MINIX)
00191 
00192 /*
00193  *      TRANS(Readv) and TRANS(Writev) use struct iovec, normally found
00194  *      in Berkeley systems in <sys/uio.h>.  See the readv(2) and writev(2)
00195  *      manual pages for details.
00196  */
00197 
00198 struct iovec {
00199     caddr_t iov_base;
00200     int iov_len;
00201 };
00202 
00203 #else
00204 #ifndef Lynx
00205 #include <sys/uio.h>
00206 #else
00207 #include <uio.h>
00208 #endif
00209 #endif
00210 
00211 typedef struct _XtransConnInfo *XtransConnInfo;
00212 
00213 
00214 /*
00215  * Transport Option definitions
00216  */
00217 
00218 #define TRANS_NONBLOCKING   1
00219 #define TRANS_CLOSEONEXEC   2
00220 
00221 
00222 /*
00223  * Return values of Connect (0 is success)
00224  */
00225 
00226 #define TRANS_CONNECT_FAILED    -1
00227 #define TRANS_TRY_CONNECT_AGAIN -2
00228 #define TRANS_IN_PROGRESS   -3
00229 
00230 
00231 /*
00232  * Return values of CreateListener (0 is success)
00233  */
00234 
00235 #define TRANS_CREATE_LISTENER_FAILED    -1
00236 #define TRANS_ADDR_IN_USE       -2
00237 
00238 
00239 /*
00240  * Return values of Accept (0 is success)
00241  */
00242 
00243 #define TRANS_ACCEPT_BAD_MALLOC         -1
00244 #define TRANS_ACCEPT_FAILED             -2
00245 #define TRANS_ACCEPT_MISC_ERROR         -3
00246 
00247 
00248 /*
00249  * ResetListener return values
00250  */
00251 
00252 #define TRANS_RESET_NOOP    1
00253 #define TRANS_RESET_NEW_FD  2
00254 #define TRANS_RESET_FAILURE 3
00255 
00256 
00257 /*
00258  * Function prototypes for the exposed interface
00259  */
00260 
00261 void TRANS(FreeConnInfo) (
00262     XtransConnInfo  /* ciptr */
00263 );
00264 
00265 #ifdef TRANS_CLIENT
00266 
00267 XtransConnInfo TRANS(OpenCOTSClient)(
00268     char *      /* address */
00269 );
00270 
00271 #endif /* TRANS_CLIENT */
00272 
00273 #ifdef TRANS_SERVER
00274 
00275 XtransConnInfo TRANS(OpenCOTSServer)(
00276     char *      /* address */
00277 );
00278 
00279 #endif /* TRANS_SERVER */
00280 
00281 #ifdef TRANS_CLIENT
00282 
00283 XtransConnInfo TRANS(OpenCLTSClient)(
00284     char *      /* address */
00285 );
00286 
00287 #endif /* TRANS_CLIENT */
00288 
00289 #ifdef TRANS_SERVER
00290 
00291 XtransConnInfo TRANS(OpenCLTSServer)(
00292     char *      /* address */
00293 );
00294 
00295 #endif /* TRANS_SERVER */
00296 
00297 #ifdef TRANS_REOPEN
00298 
00299 XtransConnInfo TRANS(ReopenCOTSServer)(
00300     int,        /* trans_id */
00301     int,        /* fd */
00302     char *      /* port */
00303 );
00304 
00305 XtransConnInfo TRANS(ReopenCLTSServer)(
00306     int,        /* trans_id */
00307     int,        /* fd */
00308     char *      /* port */
00309 );
00310 
00311 int TRANS(GetReopenInfo)(
00312     XtransConnInfo, /* ciptr */
00313     int *,      /* trans_id */
00314     int *,      /* fd */
00315     char **     /* port */
00316 );
00317 
00318 #endif /* TRANS_REOPEN */
00319 
00320 
00321 int TRANS(SetOption)(
00322     XtransConnInfo, /* ciptr */
00323     int,        /* option */
00324     int         /* arg */
00325 );
00326 
00327 #ifdef TRANS_SERVER
00328 
00329 int TRANS(CreateListener)(
00330     XtransConnInfo, /* ciptr */
00331     char *      /* port */
00332 );
00333 
00334 int TRANS(NoListen) (
00335     char*               /* protocol*/
00336 );
00337 
00338 int TRANS(ResetListener)(
00339     XtransConnInfo  /* ciptr */
00340 );
00341 
00342 XtransConnInfo TRANS(Accept)(
00343     XtransConnInfo, /* ciptr */
00344     int *       /* status */
00345 );
00346 
00347 #endif /* TRANS_SERVER */
00348 
00349 #ifdef TRANS_CLIENT
00350 
00351 int TRANS(Connect)(
00352     XtransConnInfo, /* ciptr */
00353     char *      /* address */
00354 );
00355 
00356 #endif /* TRANS_CLIENT */
00357 
00358 int TRANS(BytesReadable)(
00359     XtransConnInfo, /* ciptr */
00360     BytesReadable_t *   /* pend */
00361 );
00362 
00363 int TRANS(Read)(
00364     XtransConnInfo, /* ciptr */
00365     char *,     /* buf */
00366     int         /* size */
00367 );
00368 
00369 int TRANS(Write)(
00370     XtransConnInfo, /* ciptr */
00371     char *,     /* buf */
00372     int         /* size */
00373 );
00374 
00375 int TRANS(Readv)(
00376     XtransConnInfo, /* ciptr */
00377     struct iovec *, /* buf */
00378     int         /* size */
00379 );
00380 
00381 int TRANS(Writev)(
00382     XtransConnInfo, /* ciptr */
00383     struct iovec *, /* buf */
00384     int         /* size */
00385 );
00386 
00387 int TRANS(Disconnect)(
00388     XtransConnInfo  /* ciptr */
00389 );
00390 
00391 int TRANS(Close)(
00392     XtransConnInfo  /* ciptr */
00393 );
00394 
00395 int TRANS(CloseForCloning)(
00396     XtransConnInfo  /* ciptr */
00397 );
00398 
00399 int TRANS(IsLocal)(
00400     XtransConnInfo  /* ciptr */
00401 );
00402 
00403 int TRANS(GetMyAddr)(
00404     XtransConnInfo, /* ciptr */
00405     int *,      /* familyp */
00406     int *,      /* addrlenp */
00407     Xtransaddr **   /* addrp */
00408 );
00409 
00410 int TRANS(GetPeerAddr)(
00411     XtransConnInfo, /* ciptr */
00412     int *,      /* familyp */
00413     int *,      /* addrlenp */
00414     Xtransaddr **   /* addrp */
00415 );
00416 
00417 int TRANS(GetConnectionNumber)(
00418     XtransConnInfo  /* ciptr */
00419 );
00420 
00421 #ifdef TRANS_SERVER
00422 
00423 int TRANS(MakeAllCOTSServerListeners)(
00424     char *,     /* port */
00425     int *,      /* partial */
00426     int *,      /* count_ret */
00427     XtransConnInfo **   /* ciptrs_ret */
00428 );
00429 
00430 int TRANS(MakeAllCLTSServerListeners)(
00431     char *,     /* port */
00432     int *,      /* partial */
00433     int *,      /* count_ret */
00434     XtransConnInfo **   /* ciptrs_ret */
00435 );
00436 
00437 #endif /* TRANS_SERVER */
00438 
00439 
00440 /*
00441  * Function Prototypes for Utility Functions.
00442  */
00443 
00444 #ifdef X11_t
00445 
00446 int TRANS(ConvertAddress)(
00447     int *,      /* familyp */
00448     int *,      /* addrlenp */
00449     Xtransaddr **   /* addrp */
00450 );
00451 
00452 #endif /* X11_t */
00453 
00454 #if defined(ICE_t)
00455 
00456 char *
00457 TRANS(GetMyNetworkId)(
00458     XtransConnInfo  /* ciptr */
00459 );
00460 
00461 char *
00462 TRANS(GetPeerNetworkId)(
00463     XtransConnInfo  /* ciptr */
00464 );
00465 
00466 #endif /* ICE_t */
00467 
00468 int 
00469 TRANS(GetHostname) (
00470     char *  /* buf */,
00471     int     /* maxlen */
00472 );
00473 
00474 #if defined(WIN32) && (defined(TCPCONN) || defined(DNETCONN))
00475 int TRANS(WSAStartup)();
00476 #endif
00477 
00478 #endif /* _XTRANS_H_ */
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:20:26 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001