File indexing completed on 2025-12-16 10:33:47
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 #ifndef _ICELIB_H_
0030 #define _ICELIB_H_
0031
0032 #include <X11/ICE/ICE.h>
0033 #include <X11/Xfuncproto.h>
0034
0035 #define Bool int
0036 #define Status int
0037 #define True 1
0038 #define False 0
0039
0040 typedef void *IcePointer;
0041
0042 typedef enum {
0043 IcePoAuthHaveReply,
0044 IcePoAuthRejected,
0045 IcePoAuthFailed,
0046 IcePoAuthDoneCleanup
0047 } IcePoAuthStatus;
0048
0049 typedef enum {
0050 IcePaAuthContinue,
0051 IcePaAuthAccepted,
0052 IcePaAuthRejected,
0053 IcePaAuthFailed
0054 } IcePaAuthStatus;
0055
0056 typedef enum {
0057 IceConnectPending,
0058 IceConnectAccepted,
0059 IceConnectRejected,
0060 IceConnectIOError
0061 } IceConnectStatus;
0062
0063 typedef enum {
0064 IceProtocolSetupSuccess,
0065 IceProtocolSetupFailure,
0066 IceProtocolSetupIOError,
0067 IceProtocolAlreadyActive
0068 } IceProtocolSetupStatus;
0069
0070 typedef enum {
0071 IceAcceptSuccess,
0072 IceAcceptFailure,
0073 IceAcceptBadMalloc
0074 } IceAcceptStatus;
0075
0076 typedef enum {
0077 IceClosedNow,
0078 IceClosedASAP,
0079 IceConnectionInUse,
0080 IceStartedShutdownNegotiation
0081 } IceCloseStatus;
0082
0083 typedef enum {
0084 IceProcessMessagesSuccess,
0085 IceProcessMessagesIOError,
0086 IceProcessMessagesConnectionClosed
0087 } IceProcessMessagesStatus;
0088
0089 typedef struct {
0090 unsigned long sequence_of_request;
0091 int major_opcode_of_request;
0092 int minor_opcode_of_request;
0093 IcePointer reply;
0094 } IceReplyWaitInfo;
0095
0096 typedef struct _IceConn *IceConn;
0097 typedef struct _IceListenObj *IceListenObj;
0098
0099 typedef void (*IceWatchProc) (
0100 IceConn ,
0101 IcePointer ,
0102 Bool ,
0103 IcePointer *
0104 );
0105
0106 typedef void (*IcePoProcessMsgProc) (
0107 IceConn ,
0108 IcePointer ,
0109 int ,
0110 unsigned long ,
0111 Bool ,
0112 IceReplyWaitInfo * ,
0113 Bool *
0114 );
0115
0116 typedef void (*IcePaProcessMsgProc) (
0117 IceConn ,
0118 IcePointer ,
0119 int ,
0120 unsigned long ,
0121 Bool
0122 );
0123
0124 typedef struct {
0125 int major_version;
0126 int minor_version;
0127 IcePoProcessMsgProc process_msg_proc;
0128 } IcePoVersionRec;
0129
0130 typedef struct {
0131 int major_version;
0132 int minor_version;
0133 IcePaProcessMsgProc process_msg_proc;
0134 } IcePaVersionRec;
0135
0136 typedef IcePoAuthStatus (*IcePoAuthProc) (
0137 IceConn ,
0138 IcePointer * ,
0139 Bool ,
0140 Bool ,
0141 int ,
0142 IcePointer ,
0143 int * ,
0144 IcePointer * ,
0145 char **
0146 );
0147
0148 typedef IcePaAuthStatus (*IcePaAuthProc) (
0149 IceConn ,
0150 IcePointer * ,
0151 Bool ,
0152 int ,
0153 IcePointer ,
0154 int * ,
0155 IcePointer * ,
0156 char **
0157 );
0158
0159 typedef Bool (*IceHostBasedAuthProc) (
0160 char *
0161 );
0162
0163 typedef Status (*IceProtocolSetupProc) (
0164 IceConn ,
0165 int ,
0166 int ,
0167 char * ,
0168 char * ,
0169 IcePointer * ,
0170 char **
0171 );
0172
0173 typedef void (*IceProtocolActivateProc) (
0174 IceConn ,
0175 IcePointer
0176 );
0177
0178 typedef void (*IceIOErrorProc) (
0179 IceConn
0180 );
0181
0182 typedef void (*IcePingReplyProc) (
0183 IceConn ,
0184 IcePointer
0185 );
0186
0187 typedef void (*IceErrorHandler) (
0188 IceConn ,
0189 Bool ,
0190 int ,
0191 unsigned long ,
0192 int ,
0193 int ,
0194 IcePointer
0195 );
0196
0197 typedef void (*IceIOErrorHandler) (
0198 IceConn
0199 );
0200
0201
0202
0203
0204
0205
0206 _XFUNCPROTOBEGIN
0207
0208 extern int IceRegisterForProtocolSetup (
0209 const char * ,
0210 const char * ,
0211 const char * ,
0212 int ,
0213 IcePoVersionRec * ,
0214 int ,
0215 const char ** ,
0216 IcePoAuthProc * ,
0217 IceIOErrorProc
0218 );
0219
0220 extern int IceRegisterForProtocolReply (
0221 const char * ,
0222 const char * ,
0223 const char * ,
0224 int ,
0225 IcePaVersionRec * ,
0226 int ,
0227 const char ** ,
0228 IcePaAuthProc * ,
0229 IceHostBasedAuthProc ,
0230 IceProtocolSetupProc ,
0231 IceProtocolActivateProc ,
0232 IceIOErrorProc
0233 );
0234
0235 extern IceConn IceOpenConnection (
0236 char * ,
0237 IcePointer ,
0238 Bool ,
0239 int ,
0240 int ,
0241 char *
0242 );
0243
0244 extern IcePointer IceGetConnectionContext (
0245 IceConn
0246 );
0247
0248 extern Status IceListenForConnections (
0249 int * ,
0250 IceListenObj ** ,
0251 int ,
0252 char *
0253 );
0254
0255 extern Status IceListenForWellKnownConnections (
0256 char * ,
0257 int * ,
0258 IceListenObj ** ,
0259 int ,
0260 char *
0261 );
0262
0263 extern int IceGetListenConnectionNumber (
0264 IceListenObj
0265 );
0266
0267 extern char *IceGetListenConnectionString (
0268 IceListenObj
0269 );
0270
0271 extern char *IceComposeNetworkIdList (
0272 int ,
0273 IceListenObj *
0274 );
0275
0276 extern void IceFreeListenObjs (
0277 int ,
0278 IceListenObj *
0279 );
0280
0281 extern void IceSetHostBasedAuthProc (
0282 IceListenObj ,
0283 IceHostBasedAuthProc
0284 );
0285
0286 extern IceConn IceAcceptConnection (
0287 IceListenObj ,
0288 IceAcceptStatus *
0289 );
0290
0291 extern void IceSetShutdownNegotiation (
0292 IceConn ,
0293 Bool
0294 );
0295
0296 extern Bool IceCheckShutdownNegotiation (
0297 IceConn
0298 );
0299
0300 extern IceCloseStatus IceCloseConnection (
0301 IceConn
0302 );
0303
0304 extern Status IceAddConnectionWatch (
0305 IceWatchProc ,
0306 IcePointer
0307 );
0308
0309 extern void IceRemoveConnectionWatch (
0310 IceWatchProc ,
0311 IcePointer
0312 );
0313
0314 extern IceProtocolSetupStatus IceProtocolSetup (
0315 IceConn ,
0316 int ,
0317 IcePointer ,
0318 Bool ,
0319 int * ,
0320 int * ,
0321 char ** ,
0322 char ** ,
0323 int ,
0324 char *
0325 );
0326
0327 extern Status IceProtocolShutdown (
0328 IceConn ,
0329 int
0330 );
0331
0332 extern IceProcessMessagesStatus IceProcessMessages (
0333 IceConn ,
0334 IceReplyWaitInfo * ,
0335 Bool *
0336 );
0337
0338 extern Status IcePing (
0339 IceConn ,
0340 IcePingReplyProc ,
0341 IcePointer
0342 );
0343
0344 extern char *IceAllocScratch (
0345 IceConn ,
0346 unsigned long
0347 );
0348
0349 extern int IceFlush (
0350 IceConn
0351 );
0352
0353 extern int IceGetOutBufSize (
0354 IceConn
0355 );
0356
0357 extern int IceGetInBufSize (
0358 IceConn
0359 );
0360
0361 extern IceConnectStatus IceConnectionStatus (
0362 IceConn
0363 );
0364
0365 extern char *IceVendor (
0366 IceConn
0367 );
0368
0369 extern char *IceRelease (
0370 IceConn
0371 );
0372
0373 extern int IceProtocolVersion (
0374 IceConn
0375 );
0376
0377 extern int IceProtocolRevision (
0378 IceConn
0379 );
0380
0381 extern int IceConnectionNumber (
0382 IceConn
0383 );
0384
0385 extern char *IceConnectionString (
0386 IceConn
0387 );
0388
0389 extern unsigned long IceLastSentSequenceNumber (
0390 IceConn
0391 );
0392
0393 extern unsigned long IceLastReceivedSequenceNumber (
0394 IceConn
0395 );
0396
0397 extern Bool IceSwapping (
0398 IceConn
0399 );
0400
0401 extern IceErrorHandler IceSetErrorHandler (
0402 IceErrorHandler
0403 );
0404
0405 extern IceIOErrorHandler IceSetIOErrorHandler (
0406 IceIOErrorHandler
0407 );
0408
0409 extern char *IceGetPeerName (
0410 IceConn
0411 );
0412
0413
0414
0415
0416
0417 extern Status IceInitThreads (
0418 void
0419 );
0420
0421 extern void IceAppLockConn (
0422 IceConn
0423 );
0424
0425 extern void IceAppUnlockConn (
0426 IceConn
0427 );
0428
0429 _XFUNCPROTOEND
0430
0431 #endif