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