File indexing completed on 2025-01-30 10:26:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #ifndef _XTRANS_H_
0051 #define _XTRANS_H_
0052
0053 #include <X11/Xfuncproto.h>
0054 #include <X11/Xos.h>
0055 #include <X11/Xmd.h>
0056
0057 #ifndef WIN32
0058 #include <sys/socket.h>
0059 #endif
0060
0061 #ifdef __clang__
0062
0063 #pragma clang diagnostic push
0064 #pragma clang diagnostic ignored "-Wunused-function"
0065 #endif
0066
0067
0068
0069
0070
0071 #ifdef X11_t
0072 #define TRANS(func) _X11Trans##func
0073 #ifdef XTRANSDEBUG
0074 static const char *__xtransname = "_X11Trans";
0075 #endif
0076 #endif
0077
0078 #ifdef XSERV_t
0079 #define TRANS(func) _XSERVTrans##func
0080 #ifdef XTRANSDEBUG
0081 static const char *__xtransname = "_XSERVTrans";
0082 #endif
0083 #define X11_t
0084 #endif
0085
0086 #ifdef XIM_t
0087 #define TRANS(func) _XimXTrans##func
0088 #ifdef XTRANSDEBUG
0089 static const char *__xtransname = "_XimTrans";
0090 #endif
0091 #endif
0092
0093 #ifdef FS_t
0094 #define TRANS(func) _FSTrans##func
0095 #ifdef XTRANSDEBUG
0096 static const char *__xtransname = "_FSTrans";
0097 #endif
0098 #endif
0099
0100 #ifdef FONT_t
0101 #define TRANS(func) _FontTrans##func
0102 #ifdef XTRANSDEBUG
0103 static const char *__xtransname = "_FontTrans";
0104 #endif
0105 #endif
0106
0107 #ifdef ICE_t
0108 #define TRANS(func) _IceTrans##func
0109 #ifdef XTRANSDEBUG
0110 static const char *__xtransname = "_IceTrans";
0111 #endif
0112 #endif
0113
0114 #if !defined(TRANS)
0115 #define TRANS(func) _XTrans##func
0116 #ifdef XTRANSDEBUG
0117 static const char *__xtransname = "_XTrans";
0118 #endif
0119 #endif
0120
0121 #ifdef __clang__
0122 #pragma clang diagnostic pop
0123 #endif
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134 #if defined(IPv6) && defined(AF_INET6)
0135 typedef struct sockaddr_storage Xtransaddr;
0136 #else
0137 #define XTRANS_MAX_ADDR_LEN 128
0138
0139 typedef struct {
0140 unsigned char addr[XTRANS_MAX_ADDR_LEN];
0141 } Xtransaddr;
0142 #endif
0143
0144 #ifdef LONG64
0145 typedef int BytesReadable_t;
0146 #else
0147 typedef long BytesReadable_t;
0148 #endif
0149
0150
0151 #if defined(WIN32)
0152
0153
0154
0155
0156
0157
0158
0159 struct iovec {
0160 caddr_t iov_base;
0161 int iov_len;
0162 };
0163
0164 #else
0165 #include <sys/uio.h>
0166 #endif
0167
0168 typedef struct _XtransConnInfo *XtransConnInfo;
0169
0170
0171
0172
0173
0174
0175 #define TRANS_NONBLOCKING 1
0176 #define TRANS_CLOSEONEXEC 2
0177
0178
0179
0180
0181
0182
0183 #define TRANS_CONNECT_FAILED -1
0184 #define TRANS_TRY_CONNECT_AGAIN -2
0185 #define TRANS_IN_PROGRESS -3
0186
0187
0188
0189
0190
0191
0192 #define TRANS_CREATE_LISTENER_FAILED -1
0193 #define TRANS_ADDR_IN_USE -2
0194
0195
0196
0197
0198
0199
0200 #define TRANS_ACCEPT_BAD_MALLOC -1
0201 #define TRANS_ACCEPT_FAILED -2
0202 #define TRANS_ACCEPT_MISC_ERROR -3
0203
0204
0205
0206
0207
0208
0209 #define TRANS_RESET_NOOP 1
0210 #define TRANS_RESET_NEW_FD 2
0211 #define TRANS_RESET_FAILURE 3
0212
0213
0214
0215
0216
0217
0218 void TRANS(FreeConnInfo) (
0219 XtransConnInfo
0220 );
0221
0222 #ifdef TRANS_CLIENT
0223
0224 XtransConnInfo TRANS(OpenCOTSClient)(
0225 const char *
0226 );
0227
0228 #endif
0229
0230 #ifdef TRANS_SERVER
0231
0232 XtransConnInfo TRANS(OpenCOTSServer)(
0233 const char *
0234 );
0235
0236 #endif
0237
0238 #ifdef TRANS_REOPEN
0239
0240 XtransConnInfo TRANS(ReopenCOTSServer)(
0241 int,
0242 int,
0243 const char *
0244 );
0245
0246 int TRANS(GetReopenInfo)(
0247 XtransConnInfo,
0248 int *,
0249 int *,
0250 char **
0251 );
0252
0253 #endif
0254
0255
0256 int TRANS(SetOption)(
0257 XtransConnInfo,
0258 int,
0259 int
0260 );
0261
0262 #ifdef TRANS_SERVER
0263
0264 int TRANS(CreateListener)(
0265 XtransConnInfo,
0266 const char *,
0267 unsigned int
0268 );
0269
0270 int TRANS(Received) (
0271 const char*
0272 );
0273
0274 int TRANS(NoListen) (
0275 const char*
0276 );
0277
0278 int TRANS(Listen) (
0279 const char*
0280 );
0281
0282 int TRANS(IsListening) (
0283 const char*
0284 );
0285
0286 int TRANS(ResetListener)(
0287 XtransConnInfo
0288 );
0289
0290 XtransConnInfo TRANS(Accept)(
0291 XtransConnInfo,
0292 int *
0293 );
0294
0295 #endif
0296
0297 #ifdef TRANS_CLIENT
0298
0299 int TRANS(Connect)(
0300 XtransConnInfo,
0301 const char *
0302 );
0303
0304 #endif
0305
0306 int TRANS(BytesReadable)(
0307 XtransConnInfo,
0308 BytesReadable_t *
0309 );
0310
0311 int TRANS(Read)(
0312 XtransConnInfo,
0313 char *,
0314 int
0315 );
0316
0317 int TRANS(Write)(
0318 XtransConnInfo,
0319 char *,
0320 int
0321 );
0322
0323 int TRANS(Readv)(
0324 XtransConnInfo,
0325 struct iovec *,
0326 int
0327 );
0328
0329 int TRANS(Writev)(
0330 XtransConnInfo,
0331 struct iovec *,
0332 int
0333 );
0334
0335 int TRANS(SendFd) (XtransConnInfo ciptr, int fd, int do_close);
0336
0337 int TRANS(RecvFd) (XtransConnInfo ciptr);
0338
0339 int TRANS(Disconnect)(
0340 XtransConnInfo
0341 );
0342
0343 int TRANS(Close)(
0344 XtransConnInfo
0345 );
0346
0347 int TRANS(CloseForCloning)(
0348 XtransConnInfo
0349 );
0350
0351 int TRANS(IsLocal)(
0352 XtransConnInfo
0353 );
0354
0355 int TRANS(GetPeerAddr)(
0356 XtransConnInfo,
0357 int *,
0358 int *,
0359 Xtransaddr **
0360 );
0361
0362 int TRANS(GetConnectionNumber)(
0363 XtransConnInfo
0364 );
0365
0366 #ifdef TRANS_SERVER
0367
0368 int TRANS(MakeAllCOTSServerListeners)(
0369 const char *,
0370 int *,
0371 int *,
0372 XtransConnInfo **
0373 );
0374
0375 #endif
0376
0377
0378
0379
0380
0381
0382 #ifdef X11_t
0383
0384 int TRANS(ConvertAddress)(
0385 int *,
0386 int *,
0387 Xtransaddr **
0388 );
0389
0390 #endif
0391
0392 #ifdef ICE_t
0393
0394 char *
0395 TRANS(GetMyNetworkId)(
0396 XtransConnInfo
0397 );
0398
0399 char *
0400 TRANS(GetPeerNetworkId)(
0401 XtransConnInfo
0402 );
0403
0404 #endif
0405
0406 int
0407 TRANS(GetHostname) (
0408 char * ,
0409 int
0410 );
0411
0412 #if defined(WIN32) && defined(TCPCONN)
0413 int TRANS(WSAStartup)();
0414 #endif
0415
0416 #endif