#ifndef _ICELIB_H_
#define _ICELIB_H_
#include <X11/ICE/ICE.h>
#include <X11/Xfuncproto.h>
#define Bool int
#define Status int
#define True 1
#define False 0
typedef void *IcePointer;
typedef enum {
IcePoAuthHaveReply,
IcePoAuthRejected,
IcePoAuthFailed,
IcePoAuthDoneCleanup
} IcePoAuthStatus;
typedef enum {
IcePaAuthContinue,
IcePaAuthAccepted,
IcePaAuthRejected,
IcePaAuthFailed
} IcePaAuthStatus;
typedef enum {
IceConnectPending,
IceConnectAccepted,
IceConnectRejected,
IceConnectIOError
} IceConnectStatus;
typedef enum {
IceProtocolSetupSuccess,
IceProtocolSetupFailure,
IceProtocolSetupIOError,
IceProtocolAlreadyActive
} IceProtocolSetupStatus;
typedef enum {
IceAcceptSuccess,
IceAcceptFailure,
IceAcceptBadMalloc
} IceAcceptStatus;
typedef enum {
IceClosedNow,
IceClosedASAP,
IceConnectionInUse,
IceStartedShutdownNegotiation
} IceCloseStatus;
typedef enum {
IceProcessMessagesSuccess,
IceProcessMessagesIOError,
IceProcessMessagesConnectionClosed
} IceProcessMessagesStatus;
typedef struct {
unsigned long sequence_of_request;
int major_opcode_of_request;
int minor_opcode_of_request;
IcePointer reply;
} IceReplyWaitInfo;
typedef struct _IceConn *IceConn;
typedef struct _IceListenObj *IceListenObj;
typedef void (*IceWatchProc) (
IceConn ,
IcePointer ,
Bool ,
IcePointer *
);
typedef void (*IcePoProcessMsgProc) (
IceConn ,
IcePointer ,
int ,
unsigned long ,
Bool ,
IceReplyWaitInfo * ,
Bool *
);
typedef void (*IcePaProcessMsgProc) (
IceConn ,
IcePointer ,
int ,
unsigned long ,
Bool
);
typedef struct {
int major_version;
int minor_version;
IcePoProcessMsgProc process_msg_proc;
} IcePoVersionRec;
typedef struct {
int major_version;
int minor_version;
IcePaProcessMsgProc process_msg_proc;
} IcePaVersionRec;
typedef IcePoAuthStatus (*IcePoAuthProc) (
IceConn ,
IcePointer * ,
Bool ,
Bool ,
int ,
IcePointer ,
int * ,
IcePointer * ,
char **
);
typedef IcePaAuthStatus (*IcePaAuthProc) (
IceConn ,
IcePointer * ,
Bool ,
int ,
IcePointer ,
int * ,
IcePointer * ,
char **
);
typedef Bool (*IceHostBasedAuthProc) (
char *
);
typedef Status (*IceProtocolSetupProc) (
IceConn ,
int ,
int ,
char * ,
char * ,
IcePointer * ,
char **
);
typedef void (*IceProtocolActivateProc) (
IceConn ,
IcePointer
);
typedef void (*IceIOErrorProc) (
IceConn
);
typedef void (*IcePingReplyProc) (
IceConn ,
IcePointer
);
typedef void (*IceErrorHandler) (
IceConn ,
Bool ,
int ,
unsigned long ,
int ,
int ,
IcePointer
);
typedef void (*IceIOErrorHandler) (
IceConn
);
_XFUNCPROTOBEGIN
extern int IceRegisterForProtocolSetup (
char * ,
char * ,
char * ,
int ,
IcePoVersionRec * ,
int ,
const char ** ,
IcePoAuthProc * ,
IceIOErrorProc
);
extern int IceRegisterForProtocolReply (
char * ,
char * ,
char * ,
int ,
IcePaVersionRec * ,
int ,
const char ** ,
IcePaAuthProc * ,
IceHostBasedAuthProc ,
IceProtocolSetupProc ,
IceProtocolActivateProc ,
IceIOErrorProc
);
extern IceConn IceOpenConnection (
char * ,
IcePointer ,
Bool ,
int ,
int ,
char *
);
extern IcePointer IceGetConnectionContext (
IceConn
);
extern Status IceListenForConnections (
int * ,
IceListenObj ** ,
int ,
char *
);
extern Status IceListenForWellKnownConnections (
char * ,
int * ,
IceListenObj ** ,
int ,
char *
);
extern int IceGetListenConnectionNumber (
IceListenObj
);
extern char *IceGetListenConnectionString (
IceListenObj
);
extern char *IceComposeNetworkIdList (
int ,
IceListenObj *
);
extern void IceFreeListenObjs (
int ,
IceListenObj *
);
extern void IceSetHostBasedAuthProc (
IceListenObj ,
IceHostBasedAuthProc
);
extern IceConn IceAcceptConnection (
IceListenObj ,
IceAcceptStatus *
);
extern void IceSetShutdownNegotiation (
IceConn ,
Bool
);
extern Bool IceCheckShutdownNegotiation (
IceConn
);
extern IceCloseStatus IceCloseConnection (
IceConn
);
extern Status IceAddConnectionWatch (
IceWatchProc ,
IcePointer
);
extern void IceRemoveConnectionWatch (
IceWatchProc ,
IcePointer
);
extern IceProtocolSetupStatus IceProtocolSetup (
IceConn ,
int ,
IcePointer ,
Bool ,
int * ,
int * ,
char ** ,
char ** ,
int ,
char *
);
extern Status IceProtocolShutdown (
IceConn ,
int
);
extern IceProcessMessagesStatus IceProcessMessages (
IceConn ,
IceReplyWaitInfo * ,
Bool *
);
extern Status IcePing (
IceConn ,
IcePingReplyProc ,
IcePointer
);
extern char *IceAllocScratch (
IceConn ,
unsigned long
);
extern int IceFlush (
IceConn
);
extern int IceGetOutBufSize (
IceConn
);
extern int IceGetInBufSize (
IceConn
);
extern IceConnectStatus IceConnectionStatus (
IceConn
);
extern char *IceVendor (
IceConn
);
extern char *IceRelease (
IceConn
);
extern int IceProtocolVersion (
IceConn
);
extern int IceProtocolRevision (
IceConn
);
extern int IceConnectionNumber (
IceConn
);
extern char *IceConnectionString (
IceConn
);
extern unsigned long IceLastSentSequenceNumber (
IceConn
);
extern unsigned long IceLastReceivedSequenceNumber (
IceConn
);
extern Bool IceSwapping (
IceConn
);
extern IceErrorHandler IceSetErrorHandler (
IceErrorHandler
);
extern IceIOErrorHandler IceSetIOErrorHandler (
IceIOErrorHandler
);
extern char *IceGetPeerName (
IceConn
);
extern Status IceInitThreads (
void
);
extern void IceAppLockConn (
IceConn
);
extern void IceAppUnlockConn (
IceConn
);
_XFUNCPROTOEND
#endif