Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:33:47

0001 /******************************************************************************
0002 
0003 
0004 Copyright 1993, 1998  The Open Group
0005 
0006 Permission to use, copy, modify, distribute, and sell this software and its
0007 documentation for any purpose is hereby granted without fee, provided that
0008 the above copyright notice appear in all copies and that both that
0009 copyright notice and this permission notice appear in supporting
0010 documentation.
0011 
0012 The above copyright notice and this permission notice shall be included in
0013 all copies or substantial portions of the Software.
0014 
0015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0018 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0021 
0022 Except as contained in this notice, the name of The Open Group shall not be
0023 used in advertising or otherwise to promote the sale, use or other dealings
0024 in this Software without prior written authorization from The Open Group.
0025 
0026 Author: Ralph Mor, X Consortium
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     /* iceConn */,
0101     IcePointer      /* clientData */,
0102     Bool        /* opening */,
0103     IcePointer *    /* watchData */
0104 );
0105 
0106 typedef void (*IcePoProcessMsgProc) (
0107     IceConn         /* iceConn */,
0108     IcePointer      /* clientData */,
0109     int         /* opcode */,
0110     unsigned long   /* length */,
0111     Bool        /* swap */,
0112     IceReplyWaitInfo *  /* replyWait */,
0113     Bool *      /* replyReadyRet */
0114 );
0115 
0116 typedef void (*IcePaProcessMsgProc) (
0117     IceConn         /* iceConn */,
0118     IcePointer      /* clientData */,
0119     int         /* opcode */,
0120     unsigned long   /* length */,
0121     Bool        /* swap */
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     /* iceConn */,
0138     IcePointer *    /* authStatePtr */,
0139     Bool        /* cleanUp */,
0140     Bool        /* swap */,
0141     int         /* authDataLen */,
0142     IcePointer      /* authData */,
0143     int *       /* replyDataLenRet */,
0144     IcePointer *    /* replyDataRet */,
0145     char **     /* errorStringRet */
0146 );
0147 
0148 typedef IcePaAuthStatus (*IcePaAuthProc) (
0149     IceConn     /* iceConn */,
0150     IcePointer *    /* authStatePtr */,
0151     Bool        /* swap */,
0152     int         /* authDataLen */,
0153     IcePointer      /* authData */,
0154     int *       /* replyDataLenRet */,
0155     IcePointer *    /* replyDataRet */,
0156     char **     /* errorStringRet */
0157 );
0158 
0159 typedef Bool (*IceHostBasedAuthProc) (
0160     char *      /* hostName */
0161 );
0162 
0163 typedef Status (*IceProtocolSetupProc) (
0164     IceConn         /* iceConn */,
0165     int         /* majorVersion */,
0166     int         /* minorVersion */,
0167     char *      /* vendor */,
0168     char *      /* release */,
0169     IcePointer *    /* clientDataRet */,
0170     char **     /* failureReasonRet */
0171 );
0172 
0173 typedef void (*IceProtocolActivateProc) (
0174     IceConn         /* iceConn */,
0175     IcePointer      /* clientData */
0176 );
0177 
0178 typedef void (*IceIOErrorProc) (
0179     IceConn         /* iceConn */
0180 );
0181 
0182 typedef void (*IcePingReplyProc) (
0183     IceConn         /* iceConn */,
0184     IcePointer      /* clientData */
0185 );
0186 
0187 typedef void (*IceErrorHandler) (
0188     IceConn         /* iceConn */,
0189     Bool        /* swap */,
0190     int         /* offendingMinorOpcode */,
0191     unsigned long   /* offendingSequence */,
0192     int         /* errorClass */,
0193     int         /* severity */,
0194     IcePointer      /* values */
0195 );
0196 
0197 typedef void (*IceIOErrorHandler) (
0198     IceConn         /* iceConn */
0199 );
0200 
0201 
0202 /*
0203  * Function prototypes
0204  */
0205 
0206 _XFUNCPROTOBEGIN
0207 
0208 extern int IceRegisterForProtocolSetup (
0209     const char *        /* protocolName */,
0210     const char *        /* vendor */,
0211     const char *        /* release */,
0212     int             /* versionCount */,
0213     IcePoVersionRec *       /* versionRecs */,
0214     int             /* authCount */,
0215     const char **       /* authNames */,
0216     IcePoAuthProc *     /* authProcs */,
0217     IceIOErrorProc      /* IOErrorProc */
0218 );
0219 
0220 extern int IceRegisterForProtocolReply (
0221     const char *        /* protocolName */,
0222     const char *        /* vendor */,
0223     const char *        /* release */,
0224     int             /* versionCount */,
0225     IcePaVersionRec *       /* versionRecs */,
0226     int             /* authCount */,
0227     const char **       /* authNames */,
0228     IcePaAuthProc *     /* authProcs */,
0229     IceHostBasedAuthProc    /* hostBasedAuthProc */,
0230     IceProtocolSetupProc    /* protocolSetupProc */,
0231     IceProtocolActivateProc /* protocolActivateProc */,
0232     IceIOErrorProc      /* IOErrorProc */
0233 );
0234 
0235 extern IceConn IceOpenConnection (
0236     char *      /* networkIdsList */,
0237     IcePointer      /* context */,
0238     Bool        /* mustAuthenticate */,
0239     int         /* majorOpcodeCheck */,
0240     int         /* errorLength */,
0241     char *      /* errorStringRet */
0242 );
0243 
0244 extern IcePointer IceGetConnectionContext (
0245     IceConn     /* iceConn */
0246 );
0247 
0248 extern Status IceListenForConnections (
0249     int *       /* countRet */,
0250     IceListenObj ** /* listenObjsRet */,
0251     int         /* errorLength */,
0252     char *      /* errorStringRet */
0253 );
0254 
0255 extern Status IceListenForWellKnownConnections (
0256     char *      /* port */,
0257     int *       /* countRet */,
0258     IceListenObj ** /* listenObjsRet */,
0259     int         /* errorLength */,
0260     char *      /* errorStringRet */
0261 );
0262 
0263 extern int IceGetListenConnectionNumber (
0264     IceListenObj    /* listenObj */
0265 );
0266 
0267 extern char *IceGetListenConnectionString (
0268     IceListenObj    /* listenObj */
0269 );
0270 
0271 extern char *IceComposeNetworkIdList (
0272     int         /* count */,
0273     IceListenObj *  /* listenObjs */
0274 );
0275 
0276 extern void IceFreeListenObjs (
0277     int         /* count */,
0278     IceListenObj *  /* listenObjs */
0279 );
0280 
0281 extern void IceSetHostBasedAuthProc (
0282     IceListenObj        /* listenObj */,
0283     IceHostBasedAuthProc    /* hostBasedAuthProc */
0284 );
0285 
0286 extern IceConn IceAcceptConnection (
0287     IceListenObj    /* listenObj */,
0288     IceAcceptStatus *   /* statusRet */
0289 );
0290 
0291 extern void IceSetShutdownNegotiation (
0292     IceConn     /* iceConn */,
0293     Bool        /* negotiate */
0294 );
0295 
0296 extern Bool IceCheckShutdownNegotiation (
0297     IceConn     /* iceConn */
0298 );
0299 
0300 extern IceCloseStatus IceCloseConnection (
0301     IceConn     /* iceConn */
0302 );
0303 
0304 extern Status IceAddConnectionWatch (
0305     IceWatchProc        /* watchProc */,
0306     IcePointer          /* clientData */
0307 );
0308 
0309 extern void IceRemoveConnectionWatch (
0310     IceWatchProc        /* watchProc */,
0311     IcePointer          /* clientData */
0312 );
0313 
0314 extern IceProtocolSetupStatus IceProtocolSetup (
0315     IceConn     /* iceConn */,
0316     int         /* myOpcode */,
0317     IcePointer      /* clientData */,
0318     Bool        /* mustAuthenticate */,
0319     int *       /* majorVersionRet */,
0320     int *       /* minorVersionRet */,
0321     char **     /* vendorRet */,
0322     char **     /* releaseRet */,
0323     int         /* errorLength */,
0324     char *      /* errorStringRet */
0325 );
0326 
0327 extern Status IceProtocolShutdown (
0328     IceConn     /* iceConn */,
0329     int         /* majorOpcode */
0330 );
0331 
0332 extern IceProcessMessagesStatus IceProcessMessages (
0333     IceConn     /* iceConn */,
0334     IceReplyWaitInfo *  /* replyWait */,
0335     Bool *      /* replyReadyRet */
0336 );
0337 
0338 extern Status IcePing (
0339    IceConn      /* iceConn */,
0340    IcePingReplyProc /* pingReplyProc */,
0341    IcePointer       /* clientData */
0342 );
0343 
0344 extern char *IceAllocScratch (
0345    IceConn      /* iceConn */,
0346    unsigned long    /* size */
0347 );
0348 
0349 extern int IceFlush (
0350    IceConn      /* iceConn */
0351 );
0352 
0353 extern int IceGetOutBufSize (
0354    IceConn      /* iceConn */
0355 );
0356 
0357 extern int IceGetInBufSize (
0358    IceConn      /* iceConn */
0359 );
0360 
0361 extern IceConnectStatus IceConnectionStatus (
0362     IceConn     /* iceConn */
0363 );
0364 
0365 extern char *IceVendor (
0366     IceConn     /* iceConn */
0367 );
0368 
0369 extern char *IceRelease (
0370     IceConn     /* iceConn */
0371 );
0372 
0373 extern int IceProtocolVersion (
0374     IceConn     /* iceConn */
0375 );
0376 
0377 extern int IceProtocolRevision (
0378     IceConn     /* iceConn */
0379 );
0380 
0381 extern int IceConnectionNumber (
0382     IceConn     /* iceConn */
0383 );
0384 
0385 extern char *IceConnectionString (
0386     IceConn     /* iceConn */
0387 );
0388 
0389 extern unsigned long IceLastSentSequenceNumber (
0390     IceConn     /* iceConn */
0391 );
0392 
0393 extern unsigned long IceLastReceivedSequenceNumber (
0394     IceConn     /* iceConn */
0395 );
0396 
0397 extern Bool IceSwapping (
0398     IceConn     /* iceConn */
0399 );
0400 
0401 extern IceErrorHandler IceSetErrorHandler (
0402     IceErrorHandler     /* handler */
0403 );
0404 
0405 extern IceIOErrorHandler IceSetIOErrorHandler (
0406     IceIOErrorHandler   /* handler */
0407 );
0408 
0409 extern char *IceGetPeerName (
0410     IceConn     /* iceConn */
0411 );
0412 
0413 /*
0414  * Multithread Routines
0415  */
0416 
0417 extern Status IceInitThreads (
0418     void
0419 );
0420 
0421 extern void IceAppLockConn (
0422     IceConn     /* iceConn */
0423 );
0424 
0425 extern void IceAppUnlockConn (
0426     IceConn     /* iceConn */
0427 );
0428 
0429 _XFUNCPROTOEND
0430 
0431 #endif /* _ICELIB_H_ */