00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _XTRANS_H_
00022 #define _XTRANS_H_
00023
00024 #include <X11/Xfuncproto.h>
00025 #include <X11/Xos.h>
00026
00027
00028
00029
00030
00031
00032 #ifdef X11_t
00033 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00034 #define TRANS(func) _X11Trans##func
00035 #else
00036 #define TRANS(func) _X11Transfunc
00037 #endif
00038 #endif
00039
00040 #ifdef XSERV_t
00041 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00042 #define TRANS(func) _XSERVTrans##func
00043 #else
00044 #define TRANS(func) _XSERVTransfunc
00045 #endif
00046 #define X11_t
00047 #endif
00048
00049 #ifdef XIM_t
00050 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00051 #define TRANS(func) _XimdXTrans##func
00052 #else
00053 #define TRANS(func) _XimdXTransfunc
00054 #endif
00055 #endif
00056
00057 #ifdef FS_t
00058 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00059 #define TRANS(func) _FSTrans##func
00060 #else
00061 #define TRANS(func) _FSTransfunc
00062 #endif
00063 #endif
00064
00065 #ifdef FONT_t
00066 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00067 #define TRANS(func) _FontTrans##func
00068 #else
00069 #define TRANS(func) _FontTransfunc
00070 #endif
00071 #endif
00072
00073 #ifdef ICE_t
00074 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00075 #define TRANS(func) _IceTrans##func
00076 #else
00077 #define TRANS(func) _IceTransfunc
00078 #endif
00079 #endif
00080
00081 #ifdef TEST_t
00082 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00083 #define TRANS(func) _TESTTrans##func
00084 #else
00085 #define TRANS(func) _TESTTransfunc
00086 #endif
00087 #endif
00088
00089 #if !defined(TRANS)
00090 #if (__STDC__ && !defined(UNIXCPP)) || defined(ANSICPP)
00091 #define TRANS(func) _XTrans##func
00092 #else
00093 #define TRANS(func) _XTransfunc
00094 #endif
00095 #endif
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #define XTRANS_MAX_ADDR_LEN 128
00108
00109 typedef struct {
00110 unsigned char addr[XTRANS_MAX_ADDR_LEN];
00111 } Xtransaddr;
00112
00113
00114 #ifdef LONG64
00115 typedef int BytesReadable_t;
00116 #else
00117 typedef long BytesReadable_t;
00118 #endif
00119
00120
00121 #if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__))
00122
00123
00124
00125
00126
00127
00128
00129 struct iovec {
00130 caddr_t iov_base;
00131 int iov_len;
00132 };
00133
00134 #else
00135 #include <sys/uio.h>
00136 #endif
00137
00138 typedef struct _XtransConnInfo *XtransConnInfo;
00139
00140
00141
00142
00143
00144
00145 #define TRANS_NONBLOCKING 1
00146 #define TRANS_CLOSEONEXEC 2
00147
00148
00149
00150
00151
00152
00153 #define TRANS_CONNECT_FAILED -1
00154 #define TRANS_TRY_CONNECT_AGAIN -2
00155
00156
00157
00158
00159
00160
00161 #define TRANS_ACCEPT_BAD_MALLOC -1
00162 #define TRANS_ACCEPT_FAILED -2
00163 #define TRANS_ACCEPT_MISC_ERROR -3
00164
00165
00166
00167
00168
00169
00170 #define TRANS_RESET_NOOP 1
00171 #define TRANS_RESET_NEW_FD 2
00172 #define TRANS_RESET_FAILURE 3
00173
00174
00175
00176
00177
00178
00179 #ifdef TRANS_CLIENT
00180
00181 XtransConnInfo TRANS(OpenCOTSClient)(
00182 #if NeedFunctionPrototypes
00183 char *
00184 #endif
00185 );
00186
00187 #endif
00188
00189 #ifdef TRANS_SERVER
00190
00191 XtransConnInfo TRANS(OpenCOTSServer)(
00192 #if NeedFunctionPrototypes
00193 char *
00194 #endif
00195 );
00196
00197 #endif
00198
00199 #ifdef TRANS_CLIENT
00200
00201 XtransConnInfo TRANS(OpenCLTSClient)(
00202 #if NeedFunctionPrototypes
00203 char *
00204 #endif
00205 );
00206
00207 #endif
00208
00209 #ifdef TRANS_SERVER
00210
00211 XtransConnInfo TRANS(OpenCLTSServer)(
00212 #if NeedFunctionPrototypes
00213 char *
00214 #endif
00215 );
00216
00217 #endif
00218
00219 #ifdef TRANS_REOPEN
00220
00221 XtransConnInfo TRANS(ReopenCOTSServer)(
00222 #if NeedFunctionPrototypes
00223 int,
00224 int,
00225 char *
00226 #endif
00227 );
00228
00229 XtransConnInfo TRANS(ReopenCLTSServer)(
00230 #if NeedFunctionPrototypes
00231 int,
00232 int,
00233 char *
00234 #endif
00235 );
00236
00237 int TRANS(GetReopenInfo)(
00238 #if NeedFunctionPrototypes
00239 XtransConnInfo,
00240 int *,
00241 int *,
00242 char **
00243 #endif
00244 );
00245
00246 #endif
00247
00248
00249 int TRANS(SetOption)(
00250 #if NeedFunctionPrototypes
00251 XtransConnInfo,
00252 int,
00253 int
00254 #endif
00255 );
00256
00257 #ifdef TRANS_SERVER
00258
00259 int TRANS(CreateListener)(
00260 #if NeedFunctionPrototypes
00261 XtransConnInfo,
00262 char *
00263 #endif
00264 );
00265
00266 int TRANS(ResetListener)(
00267 #if NeedFunctionPrototypes
00268 XtransConnInfo
00269 #endif
00270 );
00271
00272 XtransConnInfo TRANS(Accept)(
00273 #if NeedFunctionPrototypes
00274 XtransConnInfo,
00275 int *
00276 #endif
00277 );
00278
00279 #endif
00280
00281 #ifdef TRANS_CLIENT
00282
00283 int TRANS(Connect)(
00284 #if NeedFunctionPrototypes
00285 XtransConnInfo,
00286 char *
00287 #endif
00288 );
00289
00290 #endif
00291
00292 int TRANS(BytesReadable)(
00293 #if NeedFunctionPrototypes
00294 XtransConnInfo,
00295 BytesReadable_t *
00296 #endif
00297 );
00298
00299 int TRANS(Read)(
00300 #if NeedFunctionPrototypes
00301 XtransConnInfo,
00302 char *,
00303 int
00304 #endif
00305 );
00306
00307 int TRANS(Write)(
00308 #if NeedFunctionPrototypes
00309 XtransConnInfo,
00310 char *,
00311 int
00312 #endif
00313 );
00314
00315 int TRANS(Readv)(
00316 #if NeedFunctionPrototypes
00317 XtransConnInfo,
00318 struct iovec *,
00319 int
00320 #endif
00321 );
00322
00323 int TRANS(Writev)(
00324 #if NeedFunctionPrototypes
00325 XtransConnInfo,
00326 struct iovec *,
00327 int
00328 #endif
00329 );
00330
00331 int TRANS(Disconnect)(
00332 #if NeedFunctionPrototypes
00333 XtransConnInfo
00334 #endif
00335 );
00336
00337 int TRANS(Close)(
00338 #if NeedFunctionPrototypes
00339 XtransConnInfo
00340 #endif
00341 );
00342
00343 int TRANS(CloseForCloning)(
00344 #if NeedFunctionPrototypes
00345 XtransConnInfo
00346 #endif
00347 );
00348
00349 int TRANS(IsLocal)(
00350 #if NeedFunctionPrototypes
00351 XtransConnInfo
00352 #endif
00353 );
00354
00355 int TRANS(GetMyAddr)(
00356 #if NeedFunctionPrototypes
00357 XtransConnInfo,
00358 int *,
00359 int *,
00360 Xtransaddr **
00361 #endif
00362 );
00363
00364 int TRANS(GetPeerAddr)(
00365 #if NeedFunctionPrototypes
00366 XtransConnInfo,
00367 int *,
00368 int *,
00369 Xtransaddr **
00370 #endif
00371 );
00372
00373 int TRANS(GetConnectionNumber)(
00374 #if NeedFunctionPrototypes
00375 XtransConnInfo
00376 #endif
00377 );
00378
00379 #ifdef TRANS_SERVER
00380
00381 int TRANS(MakeAllCOTSServerListeners)(
00382 #if NeedFunctionPrototypes
00383 char *,
00384 int *,
00385 int *,
00386 XtransConnInfo **
00387 #endif
00388 );
00389
00390 int TRANS(MakeAllCLTSServerListeners)(
00391 #if NeedFunctionPrototypes
00392 char *,
00393 int *,
00394 int *,
00395 XtransConnInfo **
00396 #endif
00397 );
00398
00399 #endif
00400
00401
00402
00403
00404
00405
00406 #ifdef X11_t
00407
00408 int TRANS(ConvertAddress)(
00409 #if NeedFunctionPrototypes
00410 int *,
00411 int *,
00412 Xtransaddr *
00413 #endif
00414 );
00415
00416 #endif
00417
00418 #ifdef ICE_t
00419
00420 char *
00421 TRANS(GetMyNetworkId)(
00422 #if NeedFunctionPrototypes
00423 XtransConnInfo
00424 #endif
00425 );
00426
00427 char *
00428 TRANS(GetPeerNetworkId)(
00429 #if NeedFunctionPrototypes
00430 XtransConnInfo
00431 #endif
00432 );
00433
00434 #endif
00435
00436 #endif