1 /******************************************************************************
4 Copyright 1993, 1998 The Open Group
6 Permission to use, copy, modify, distribute, and sell this software and its
7 documentation for any purpose is hereby granted without fee, provided that
8 the above copyright notice appear in all copies and that both that
9 copyright notice and this permission notice appear in supporting
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of The Open Group shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from The Open Group.
26 Author: Ralph Mor, X Consortium
27 ******************************************************************************/
32 #include <X11/ICE/ICE.h>
33 #include <X11/Xfuncproto.h>
40 typedef void *IcePointer;
64 IceProtocolSetupSuccess,
65 IceProtocolSetupFailure,
66 IceProtocolSetupIOError,
67 IceProtocolAlreadyActive
68 } IceProtocolSetupStatus;
80 IceStartedShutdownNegotiation
84 IceProcessMessagesSuccess,
85 IceProcessMessagesIOError,
86 IceProcessMessagesConnectionClosed
87 } IceProcessMessagesStatus;
90 unsigned long sequence_of_request;
91 int major_opcode_of_request;
92 int minor_opcode_of_request;
96 typedef struct _IceConn *IceConn;
97 typedef struct _IceListenObj *IceListenObj;
99 typedef void (*IceWatchProc) (
100 IceConn /* iceConn */,
101 IcePointer /* clientData */,
103 IcePointer * /* watchData */
106 typedef void (*IcePoProcessMsgProc) (
107 IceConn /* iceConn */,
108 IcePointer /* clientData */,
110 unsigned long /* length */,
112 IceReplyWaitInfo * /* replyWait */,
113 Bool * /* replyReadyRet */
116 typedef void (*IcePaProcessMsgProc) (
117 IceConn /* iceConn */,
118 IcePointer /* clientData */,
120 unsigned long /* length */,
127 IcePoProcessMsgProc process_msg_proc;
133 IcePaProcessMsgProc process_msg_proc;
136 typedef IcePoAuthStatus (*IcePoAuthProc) (
137 IceConn /* iceConn */,
138 IcePointer * /* authStatePtr */,
141 int /* authDataLen */,
142 IcePointer /* authData */,
143 int * /* replyDataLenRet */,
144 IcePointer * /* replyDataRet */,
145 char ** /* errorStringRet */
148 typedef IcePaAuthStatus (*IcePaAuthProc) (
149 IceConn /* iceConn */,
150 IcePointer * /* authStatePtr */,
152 int /* authDataLen */,
153 IcePointer /* authData */,
154 int * /* replyDataLenRet */,
155 IcePointer * /* replyDataRet */,
156 char ** /* errorStringRet */
159 typedef Bool (*IceHostBasedAuthProc) (
160 char * /* hostName */
163 typedef Status (*IceProtocolSetupProc) (
164 IceConn /* iceConn */,
165 int /* majorVersion */,
166 int /* minorVersion */,
168 char * /* release */,
169 IcePointer * /* clientDataRet */,
170 char ** /* failureReasonRet */
173 typedef void (*IceProtocolActivateProc) (
174 IceConn /* iceConn */,
175 IcePointer /* clientData */
178 typedef void (*IceIOErrorProc) (
179 IceConn /* iceConn */
182 typedef void (*IcePingReplyProc) (
183 IceConn /* iceConn */,
184 IcePointer /* clientData */
187 typedef void (*IceErrorHandler) (
188 IceConn /* iceConn */,
190 int /* offendingMinorOpcode */,
191 unsigned long /* offendingSequence */,
192 int /* errorClass */,
194 IcePointer /* values */
197 typedef void (*IceIOErrorHandler) (
198 IceConn /* iceConn */
203 * Function prototypes
208 extern int IceRegisterForProtocolSetup (
209 const char * /* protocolName */,
210 const char * /* vendor */,
211 const char * /* release */,
212 int /* versionCount */,
213 IcePoVersionRec * /* versionRecs */,
215 const char ** /* authNames */,
216 IcePoAuthProc * /* authProcs */,
217 IceIOErrorProc /* IOErrorProc */
220 extern int IceRegisterForProtocolReply (
221 const char * /* protocolName */,
222 const char * /* vendor */,
223 const char * /* release */,
224 int /* versionCount */,
225 IcePaVersionRec * /* versionRecs */,
227 const char ** /* authNames */,
228 IcePaAuthProc * /* authProcs */,
229 IceHostBasedAuthProc /* hostBasedAuthProc */,
230 IceProtocolSetupProc /* protocolSetupProc */,
231 IceProtocolActivateProc /* protocolActivateProc */,
232 IceIOErrorProc /* IOErrorProc */
235 extern IceConn IceOpenConnection (
236 char * /* networkIdsList */,
237 IcePointer /* context */,
238 Bool /* mustAuthenticate */,
239 int /* majorOpcodeCheck */,
240 int /* errorLength */,
241 char * /* errorStringRet */
244 extern IcePointer IceGetConnectionContext (
245 IceConn /* iceConn */
248 extern Status IceListenForConnections (
249 int * /* countRet */,
250 IceListenObj ** /* listenObjsRet */,
251 int /* errorLength */,
252 char * /* errorStringRet */
255 extern Status IceListenForWellKnownConnections (
257 int * /* countRet */,
258 IceListenObj ** /* listenObjsRet */,
259 int /* errorLength */,
260 char * /* errorStringRet */
263 extern int IceGetListenConnectionNumber (
264 IceListenObj /* listenObj */
267 extern char *IceGetListenConnectionString (
268 IceListenObj /* listenObj */
271 extern char *IceComposeNetworkIdList (
273 IceListenObj * /* listenObjs */
276 extern void IceFreeListenObjs (
278 IceListenObj * /* listenObjs */
281 extern void IceSetHostBasedAuthProc (
282 IceListenObj /* listenObj */,
283 IceHostBasedAuthProc /* hostBasedAuthProc */
286 extern IceConn IceAcceptConnection (
287 IceListenObj /* listenObj */,
288 IceAcceptStatus * /* statusRet */
291 extern void IceSetShutdownNegotiation (
292 IceConn /* iceConn */,
296 extern Bool IceCheckShutdownNegotiation (
297 IceConn /* iceConn */
300 extern IceCloseStatus IceCloseConnection (
301 IceConn /* iceConn */
304 extern Status IceAddConnectionWatch (
305 IceWatchProc /* watchProc */,
306 IcePointer /* clientData */
309 extern void IceRemoveConnectionWatch (
310 IceWatchProc /* watchProc */,
311 IcePointer /* clientData */
314 extern IceProtocolSetupStatus IceProtocolSetup (
315 IceConn /* iceConn */,
317 IcePointer /* clientData */,
318 Bool /* mustAuthenticate */,
319 int * /* majorVersionRet */,
320 int * /* minorVersionRet */,
321 char ** /* vendorRet */,
322 char ** /* releaseRet */,
323 int /* errorLength */,
324 char * /* errorStringRet */
327 extern Status IceProtocolShutdown (
328 IceConn /* iceConn */,
329 int /* majorOpcode */
332 extern IceProcessMessagesStatus IceProcessMessages (
333 IceConn /* iceConn */,
334 IceReplyWaitInfo * /* replyWait */,
335 Bool * /* replyReadyRet */
338 extern Status IcePing (
339 IceConn /* iceConn */,
340 IcePingReplyProc /* pingReplyProc */,
341 IcePointer /* clientData */
344 extern char *IceAllocScratch (
345 IceConn /* iceConn */,
346 unsigned long /* size */
349 extern int IceFlush (
350 IceConn /* iceConn */
353 extern int IceGetOutBufSize (
354 IceConn /* iceConn */
357 extern int IceGetInBufSize (
358 IceConn /* iceConn */
361 extern IceConnectStatus IceConnectionStatus (
362 IceConn /* iceConn */
365 extern char *IceVendor (
366 IceConn /* iceConn */
369 extern char *IceRelease (
370 IceConn /* iceConn */
373 extern int IceProtocolVersion (
374 IceConn /* iceConn */
377 extern int IceProtocolRevision (
378 IceConn /* iceConn */
381 extern int IceConnectionNumber (
382 IceConn /* iceConn */
385 extern char *IceConnectionString (
386 IceConn /* iceConn */
389 extern unsigned long IceLastSentSequenceNumber (
390 IceConn /* iceConn */
393 extern unsigned long IceLastReceivedSequenceNumber (
394 IceConn /* iceConn */
397 extern Bool IceSwapping (
398 IceConn /* iceConn */
401 extern IceErrorHandler IceSetErrorHandler (
402 IceErrorHandler /* handler */
405 extern IceIOErrorHandler IceSetIOErrorHandler (
406 IceIOErrorHandler /* handler */
409 extern char *IceGetPeerName (
410 IceConn /* iceConn */
414 * Multithread Routines
417 extern Status IceInitThreads (
421 extern void IceAppLockConn (
422 IceConn /* iceConn */
425 extern void IceAppUnlockConn (
426 IceConn /* iceConn */
431 #endif /* _ICELIB_H_ */