annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/X11/ICE/ICElib.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /******************************************************************************
jpayne@69 2
jpayne@69 3
jpayne@69 4 Copyright 1993, 1998 The Open Group
jpayne@69 5
jpayne@69 6 Permission to use, copy, modify, distribute, and sell this software and its
jpayne@69 7 documentation for any purpose is hereby granted without fee, provided that
jpayne@69 8 the above copyright notice appear in all copies and that both that
jpayne@69 9 copyright notice and this permission notice appear in supporting
jpayne@69 10 documentation.
jpayne@69 11
jpayne@69 12 The above copyright notice and this permission notice shall be included in
jpayne@69 13 all copies or substantial portions of the Software.
jpayne@69 14
jpayne@69 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jpayne@69 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jpayne@69 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jpayne@69 18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
jpayne@69 19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
jpayne@69 20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
jpayne@69 21
jpayne@69 22 Except as contained in this notice, the name of The Open Group shall not be
jpayne@69 23 used in advertising or otherwise to promote the sale, use or other dealings
jpayne@69 24 in this Software without prior written authorization from The Open Group.
jpayne@69 25
jpayne@69 26 Author: Ralph Mor, X Consortium
jpayne@69 27 ******************************************************************************/
jpayne@69 28
jpayne@69 29 #ifndef _ICELIB_H_
jpayne@69 30 #define _ICELIB_H_
jpayne@69 31
jpayne@69 32 #include <X11/ICE/ICE.h>
jpayne@69 33 #include <X11/Xfuncproto.h>
jpayne@69 34
jpayne@69 35 #define Bool int
jpayne@69 36 #define Status int
jpayne@69 37 #define True 1
jpayne@69 38 #define False 0
jpayne@69 39
jpayne@69 40 typedef void *IcePointer;
jpayne@69 41
jpayne@69 42 typedef enum {
jpayne@69 43 IcePoAuthHaveReply,
jpayne@69 44 IcePoAuthRejected,
jpayne@69 45 IcePoAuthFailed,
jpayne@69 46 IcePoAuthDoneCleanup
jpayne@69 47 } IcePoAuthStatus;
jpayne@69 48
jpayne@69 49 typedef enum {
jpayne@69 50 IcePaAuthContinue,
jpayne@69 51 IcePaAuthAccepted,
jpayne@69 52 IcePaAuthRejected,
jpayne@69 53 IcePaAuthFailed
jpayne@69 54 } IcePaAuthStatus;
jpayne@69 55
jpayne@69 56 typedef enum {
jpayne@69 57 IceConnectPending,
jpayne@69 58 IceConnectAccepted,
jpayne@69 59 IceConnectRejected,
jpayne@69 60 IceConnectIOError
jpayne@69 61 } IceConnectStatus;
jpayne@69 62
jpayne@69 63 typedef enum {
jpayne@69 64 IceProtocolSetupSuccess,
jpayne@69 65 IceProtocolSetupFailure,
jpayne@69 66 IceProtocolSetupIOError,
jpayne@69 67 IceProtocolAlreadyActive
jpayne@69 68 } IceProtocolSetupStatus;
jpayne@69 69
jpayne@69 70 typedef enum {
jpayne@69 71 IceAcceptSuccess,
jpayne@69 72 IceAcceptFailure,
jpayne@69 73 IceAcceptBadMalloc
jpayne@69 74 } IceAcceptStatus;
jpayne@69 75
jpayne@69 76 typedef enum {
jpayne@69 77 IceClosedNow,
jpayne@69 78 IceClosedASAP,
jpayne@69 79 IceConnectionInUse,
jpayne@69 80 IceStartedShutdownNegotiation
jpayne@69 81 } IceCloseStatus;
jpayne@69 82
jpayne@69 83 typedef enum {
jpayne@69 84 IceProcessMessagesSuccess,
jpayne@69 85 IceProcessMessagesIOError,
jpayne@69 86 IceProcessMessagesConnectionClosed
jpayne@69 87 } IceProcessMessagesStatus;
jpayne@69 88
jpayne@69 89 typedef struct {
jpayne@69 90 unsigned long sequence_of_request;
jpayne@69 91 int major_opcode_of_request;
jpayne@69 92 int minor_opcode_of_request;
jpayne@69 93 IcePointer reply;
jpayne@69 94 } IceReplyWaitInfo;
jpayne@69 95
jpayne@69 96 typedef struct _IceConn *IceConn;
jpayne@69 97 typedef struct _IceListenObj *IceListenObj;
jpayne@69 98
jpayne@69 99 typedef void (*IceWatchProc) (
jpayne@69 100 IceConn /* iceConn */,
jpayne@69 101 IcePointer /* clientData */,
jpayne@69 102 Bool /* opening */,
jpayne@69 103 IcePointer * /* watchData */
jpayne@69 104 );
jpayne@69 105
jpayne@69 106 typedef void (*IcePoProcessMsgProc) (
jpayne@69 107 IceConn /* iceConn */,
jpayne@69 108 IcePointer /* clientData */,
jpayne@69 109 int /* opcode */,
jpayne@69 110 unsigned long /* length */,
jpayne@69 111 Bool /* swap */,
jpayne@69 112 IceReplyWaitInfo * /* replyWait */,
jpayne@69 113 Bool * /* replyReadyRet */
jpayne@69 114 );
jpayne@69 115
jpayne@69 116 typedef void (*IcePaProcessMsgProc) (
jpayne@69 117 IceConn /* iceConn */,
jpayne@69 118 IcePointer /* clientData */,
jpayne@69 119 int /* opcode */,
jpayne@69 120 unsigned long /* length */,
jpayne@69 121 Bool /* swap */
jpayne@69 122 );
jpayne@69 123
jpayne@69 124 typedef struct {
jpayne@69 125 int major_version;
jpayne@69 126 int minor_version;
jpayne@69 127 IcePoProcessMsgProc process_msg_proc;
jpayne@69 128 } IcePoVersionRec;
jpayne@69 129
jpayne@69 130 typedef struct {
jpayne@69 131 int major_version;
jpayne@69 132 int minor_version;
jpayne@69 133 IcePaProcessMsgProc process_msg_proc;
jpayne@69 134 } IcePaVersionRec;
jpayne@69 135
jpayne@69 136 typedef IcePoAuthStatus (*IcePoAuthProc) (
jpayne@69 137 IceConn /* iceConn */,
jpayne@69 138 IcePointer * /* authStatePtr */,
jpayne@69 139 Bool /* cleanUp */,
jpayne@69 140 Bool /* swap */,
jpayne@69 141 int /* authDataLen */,
jpayne@69 142 IcePointer /* authData */,
jpayne@69 143 int * /* replyDataLenRet */,
jpayne@69 144 IcePointer * /* replyDataRet */,
jpayne@69 145 char ** /* errorStringRet */
jpayne@69 146 );
jpayne@69 147
jpayne@69 148 typedef IcePaAuthStatus (*IcePaAuthProc) (
jpayne@69 149 IceConn /* iceConn */,
jpayne@69 150 IcePointer * /* authStatePtr */,
jpayne@69 151 Bool /* swap */,
jpayne@69 152 int /* authDataLen */,
jpayne@69 153 IcePointer /* authData */,
jpayne@69 154 int * /* replyDataLenRet */,
jpayne@69 155 IcePointer * /* replyDataRet */,
jpayne@69 156 char ** /* errorStringRet */
jpayne@69 157 );
jpayne@69 158
jpayne@69 159 typedef Bool (*IceHostBasedAuthProc) (
jpayne@69 160 char * /* hostName */
jpayne@69 161 );
jpayne@69 162
jpayne@69 163 typedef Status (*IceProtocolSetupProc) (
jpayne@69 164 IceConn /* iceConn */,
jpayne@69 165 int /* majorVersion */,
jpayne@69 166 int /* minorVersion */,
jpayne@69 167 char * /* vendor */,
jpayne@69 168 char * /* release */,
jpayne@69 169 IcePointer * /* clientDataRet */,
jpayne@69 170 char ** /* failureReasonRet */
jpayne@69 171 );
jpayne@69 172
jpayne@69 173 typedef void (*IceProtocolActivateProc) (
jpayne@69 174 IceConn /* iceConn */,
jpayne@69 175 IcePointer /* clientData */
jpayne@69 176 );
jpayne@69 177
jpayne@69 178 typedef void (*IceIOErrorProc) (
jpayne@69 179 IceConn /* iceConn */
jpayne@69 180 );
jpayne@69 181
jpayne@69 182 typedef void (*IcePingReplyProc) (
jpayne@69 183 IceConn /* iceConn */,
jpayne@69 184 IcePointer /* clientData */
jpayne@69 185 );
jpayne@69 186
jpayne@69 187 typedef void (*IceErrorHandler) (
jpayne@69 188 IceConn /* iceConn */,
jpayne@69 189 Bool /* swap */,
jpayne@69 190 int /* offendingMinorOpcode */,
jpayne@69 191 unsigned long /* offendingSequence */,
jpayne@69 192 int /* errorClass */,
jpayne@69 193 int /* severity */,
jpayne@69 194 IcePointer /* values */
jpayne@69 195 );
jpayne@69 196
jpayne@69 197 typedef void (*IceIOErrorHandler) (
jpayne@69 198 IceConn /* iceConn */
jpayne@69 199 );
jpayne@69 200
jpayne@69 201
jpayne@69 202 /*
jpayne@69 203 * Function prototypes
jpayne@69 204 */
jpayne@69 205
jpayne@69 206 _XFUNCPROTOBEGIN
jpayne@69 207
jpayne@69 208 extern int IceRegisterForProtocolSetup (
jpayne@69 209 const char * /* protocolName */,
jpayne@69 210 const char * /* vendor */,
jpayne@69 211 const char * /* release */,
jpayne@69 212 int /* versionCount */,
jpayne@69 213 IcePoVersionRec * /* versionRecs */,
jpayne@69 214 int /* authCount */,
jpayne@69 215 const char ** /* authNames */,
jpayne@69 216 IcePoAuthProc * /* authProcs */,
jpayne@69 217 IceIOErrorProc /* IOErrorProc */
jpayne@69 218 );
jpayne@69 219
jpayne@69 220 extern int IceRegisterForProtocolReply (
jpayne@69 221 const char * /* protocolName */,
jpayne@69 222 const char * /* vendor */,
jpayne@69 223 const char * /* release */,
jpayne@69 224 int /* versionCount */,
jpayne@69 225 IcePaVersionRec * /* versionRecs */,
jpayne@69 226 int /* authCount */,
jpayne@69 227 const char ** /* authNames */,
jpayne@69 228 IcePaAuthProc * /* authProcs */,
jpayne@69 229 IceHostBasedAuthProc /* hostBasedAuthProc */,
jpayne@69 230 IceProtocolSetupProc /* protocolSetupProc */,
jpayne@69 231 IceProtocolActivateProc /* protocolActivateProc */,
jpayne@69 232 IceIOErrorProc /* IOErrorProc */
jpayne@69 233 );
jpayne@69 234
jpayne@69 235 extern IceConn IceOpenConnection (
jpayne@69 236 char * /* networkIdsList */,
jpayne@69 237 IcePointer /* context */,
jpayne@69 238 Bool /* mustAuthenticate */,
jpayne@69 239 int /* majorOpcodeCheck */,
jpayne@69 240 int /* errorLength */,
jpayne@69 241 char * /* errorStringRet */
jpayne@69 242 );
jpayne@69 243
jpayne@69 244 extern IcePointer IceGetConnectionContext (
jpayne@69 245 IceConn /* iceConn */
jpayne@69 246 );
jpayne@69 247
jpayne@69 248 extern Status IceListenForConnections (
jpayne@69 249 int * /* countRet */,
jpayne@69 250 IceListenObj ** /* listenObjsRet */,
jpayne@69 251 int /* errorLength */,
jpayne@69 252 char * /* errorStringRet */
jpayne@69 253 );
jpayne@69 254
jpayne@69 255 extern Status IceListenForWellKnownConnections (
jpayne@69 256 char * /* port */,
jpayne@69 257 int * /* countRet */,
jpayne@69 258 IceListenObj ** /* listenObjsRet */,
jpayne@69 259 int /* errorLength */,
jpayne@69 260 char * /* errorStringRet */
jpayne@69 261 );
jpayne@69 262
jpayne@69 263 extern int IceGetListenConnectionNumber (
jpayne@69 264 IceListenObj /* listenObj */
jpayne@69 265 );
jpayne@69 266
jpayne@69 267 extern char *IceGetListenConnectionString (
jpayne@69 268 IceListenObj /* listenObj */
jpayne@69 269 );
jpayne@69 270
jpayne@69 271 extern char *IceComposeNetworkIdList (
jpayne@69 272 int /* count */,
jpayne@69 273 IceListenObj * /* listenObjs */
jpayne@69 274 );
jpayne@69 275
jpayne@69 276 extern void IceFreeListenObjs (
jpayne@69 277 int /* count */,
jpayne@69 278 IceListenObj * /* listenObjs */
jpayne@69 279 );
jpayne@69 280
jpayne@69 281 extern void IceSetHostBasedAuthProc (
jpayne@69 282 IceListenObj /* listenObj */,
jpayne@69 283 IceHostBasedAuthProc /* hostBasedAuthProc */
jpayne@69 284 );
jpayne@69 285
jpayne@69 286 extern IceConn IceAcceptConnection (
jpayne@69 287 IceListenObj /* listenObj */,
jpayne@69 288 IceAcceptStatus * /* statusRet */
jpayne@69 289 );
jpayne@69 290
jpayne@69 291 extern void IceSetShutdownNegotiation (
jpayne@69 292 IceConn /* iceConn */,
jpayne@69 293 Bool /* negotiate */
jpayne@69 294 );
jpayne@69 295
jpayne@69 296 extern Bool IceCheckShutdownNegotiation (
jpayne@69 297 IceConn /* iceConn */
jpayne@69 298 );
jpayne@69 299
jpayne@69 300 extern IceCloseStatus IceCloseConnection (
jpayne@69 301 IceConn /* iceConn */
jpayne@69 302 );
jpayne@69 303
jpayne@69 304 extern Status IceAddConnectionWatch (
jpayne@69 305 IceWatchProc /* watchProc */,
jpayne@69 306 IcePointer /* clientData */
jpayne@69 307 );
jpayne@69 308
jpayne@69 309 extern void IceRemoveConnectionWatch (
jpayne@69 310 IceWatchProc /* watchProc */,
jpayne@69 311 IcePointer /* clientData */
jpayne@69 312 );
jpayne@69 313
jpayne@69 314 extern IceProtocolSetupStatus IceProtocolSetup (
jpayne@69 315 IceConn /* iceConn */,
jpayne@69 316 int /* myOpcode */,
jpayne@69 317 IcePointer /* clientData */,
jpayne@69 318 Bool /* mustAuthenticate */,
jpayne@69 319 int * /* majorVersionRet */,
jpayne@69 320 int * /* minorVersionRet */,
jpayne@69 321 char ** /* vendorRet */,
jpayne@69 322 char ** /* releaseRet */,
jpayne@69 323 int /* errorLength */,
jpayne@69 324 char * /* errorStringRet */
jpayne@69 325 );
jpayne@69 326
jpayne@69 327 extern Status IceProtocolShutdown (
jpayne@69 328 IceConn /* iceConn */,
jpayne@69 329 int /* majorOpcode */
jpayne@69 330 );
jpayne@69 331
jpayne@69 332 extern IceProcessMessagesStatus IceProcessMessages (
jpayne@69 333 IceConn /* iceConn */,
jpayne@69 334 IceReplyWaitInfo * /* replyWait */,
jpayne@69 335 Bool * /* replyReadyRet */
jpayne@69 336 );
jpayne@69 337
jpayne@69 338 extern Status IcePing (
jpayne@69 339 IceConn /* iceConn */,
jpayne@69 340 IcePingReplyProc /* pingReplyProc */,
jpayne@69 341 IcePointer /* clientData */
jpayne@69 342 );
jpayne@69 343
jpayne@69 344 extern char *IceAllocScratch (
jpayne@69 345 IceConn /* iceConn */,
jpayne@69 346 unsigned long /* size */
jpayne@69 347 );
jpayne@69 348
jpayne@69 349 extern int IceFlush (
jpayne@69 350 IceConn /* iceConn */
jpayne@69 351 );
jpayne@69 352
jpayne@69 353 extern int IceGetOutBufSize (
jpayne@69 354 IceConn /* iceConn */
jpayne@69 355 );
jpayne@69 356
jpayne@69 357 extern int IceGetInBufSize (
jpayne@69 358 IceConn /* iceConn */
jpayne@69 359 );
jpayne@69 360
jpayne@69 361 extern IceConnectStatus IceConnectionStatus (
jpayne@69 362 IceConn /* iceConn */
jpayne@69 363 );
jpayne@69 364
jpayne@69 365 extern char *IceVendor (
jpayne@69 366 IceConn /* iceConn */
jpayne@69 367 );
jpayne@69 368
jpayne@69 369 extern char *IceRelease (
jpayne@69 370 IceConn /* iceConn */
jpayne@69 371 );
jpayne@69 372
jpayne@69 373 extern int IceProtocolVersion (
jpayne@69 374 IceConn /* iceConn */
jpayne@69 375 );
jpayne@69 376
jpayne@69 377 extern int IceProtocolRevision (
jpayne@69 378 IceConn /* iceConn */
jpayne@69 379 );
jpayne@69 380
jpayne@69 381 extern int IceConnectionNumber (
jpayne@69 382 IceConn /* iceConn */
jpayne@69 383 );
jpayne@69 384
jpayne@69 385 extern char *IceConnectionString (
jpayne@69 386 IceConn /* iceConn */
jpayne@69 387 );
jpayne@69 388
jpayne@69 389 extern unsigned long IceLastSentSequenceNumber (
jpayne@69 390 IceConn /* iceConn */
jpayne@69 391 );
jpayne@69 392
jpayne@69 393 extern unsigned long IceLastReceivedSequenceNumber (
jpayne@69 394 IceConn /* iceConn */
jpayne@69 395 );
jpayne@69 396
jpayne@69 397 extern Bool IceSwapping (
jpayne@69 398 IceConn /* iceConn */
jpayne@69 399 );
jpayne@69 400
jpayne@69 401 extern IceErrorHandler IceSetErrorHandler (
jpayne@69 402 IceErrorHandler /* handler */
jpayne@69 403 );
jpayne@69 404
jpayne@69 405 extern IceIOErrorHandler IceSetIOErrorHandler (
jpayne@69 406 IceIOErrorHandler /* handler */
jpayne@69 407 );
jpayne@69 408
jpayne@69 409 extern char *IceGetPeerName (
jpayne@69 410 IceConn /* iceConn */
jpayne@69 411 );
jpayne@69 412
jpayne@69 413 /*
jpayne@69 414 * Multithread Routines
jpayne@69 415 */
jpayne@69 416
jpayne@69 417 extern Status IceInitThreads (
jpayne@69 418 void
jpayne@69 419 );
jpayne@69 420
jpayne@69 421 extern void IceAppLockConn (
jpayne@69 422 IceConn /* iceConn */
jpayne@69 423 );
jpayne@69 424
jpayne@69 425 extern void IceAppUnlockConn (
jpayne@69 426 IceConn /* iceConn */
jpayne@69 427 );
jpayne@69 428
jpayne@69 429 _XFUNCPROTOEND
jpayne@69 430
jpayne@69 431 #endif /* _ICELIB_H_ */