Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/X11/ICE
File: ICEmsg.h
/******************************************************************************
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
Copyright 1993, 1998 The Open Group
[3] Fix | Delete
[4] Fix | Delete
Permission to use, copy, modify, distribute, and sell this software and its
[5] Fix | Delete
documentation for any purpose is hereby granted without fee, provided that
[6] Fix | Delete
the above copyright notice appear in all copies and that both that
[7] Fix | Delete
copyright notice and this permission notice appear in supporting
[8] Fix | Delete
documentation.
[9] Fix | Delete
[10] Fix | Delete
The above copyright notice and this permission notice shall be included in
[11] Fix | Delete
all copies or substantial portions of the Software.
[12] Fix | Delete
[13] Fix | Delete
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[14] Fix | Delete
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[15] Fix | Delete
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[16] Fix | Delete
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
[17] Fix | Delete
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
[18] Fix | Delete
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[19] Fix | Delete
[20] Fix | Delete
Except as contained in this notice, the name of The Open Group shall not be
[21] Fix | Delete
used in advertising or otherwise to promote the sale, use or other dealings
[22] Fix | Delete
in this Software without prior written authorization from The Open Group.
[23] Fix | Delete
[24] Fix | Delete
Author: Ralph Mor, X Consortium
[25] Fix | Delete
******************************************************************************/
[26] Fix | Delete
[27] Fix | Delete
#ifndef _ICEMSG_H_
[28] Fix | Delete
#define _ICEMSG_H_
[29] Fix | Delete
[30] Fix | Delete
#include <X11/Xfuncproto.h>
[31] Fix | Delete
[32] Fix | Delete
#include <X11/ICE/ICEconn.h>
[33] Fix | Delete
[34] Fix | Delete
_XFUNCPROTOBEGIN
[35] Fix | Delete
[36] Fix | Delete
/*
[37] Fix | Delete
* Function prototypes for internal ICElib functions
[38] Fix | Delete
*/
[39] Fix | Delete
[40] Fix | Delete
extern Status _IceRead (
[41] Fix | Delete
IceConn /* iceConn */,
[42] Fix | Delete
unsigned long /* nbytes */,
[43] Fix | Delete
char * /* ptr */
[44] Fix | Delete
);
[45] Fix | Delete
[46] Fix | Delete
extern void _IceReadSkip (
[47] Fix | Delete
IceConn /* iceConn */,
[48] Fix | Delete
unsigned long /* nbytes */
[49] Fix | Delete
);
[50] Fix | Delete
[51] Fix | Delete
extern void _IceWrite (
[52] Fix | Delete
IceConn /* iceConn */,
[53] Fix | Delete
unsigned long /* nbytes */,
[54] Fix | Delete
char * /* ptr */
[55] Fix | Delete
);
[56] Fix | Delete
[57] Fix | Delete
[58] Fix | Delete
extern void _IceErrorBadMinor (
[59] Fix | Delete
IceConn /* iceConn */,
[60] Fix | Delete
int /* majorOpcode */,
[61] Fix | Delete
int /* offendingMinor */,
[62] Fix | Delete
int /* severity */
[63] Fix | Delete
);
[64] Fix | Delete
[65] Fix | Delete
extern void _IceErrorBadState (
[66] Fix | Delete
IceConn /* iceConn */,
[67] Fix | Delete
int /* majorOpcode */,
[68] Fix | Delete
int /* offendingMinor */,
[69] Fix | Delete
int /* severity */
[70] Fix | Delete
);
[71] Fix | Delete
[72] Fix | Delete
extern void _IceErrorBadLength (
[73] Fix | Delete
IceConn /* iceConn */,
[74] Fix | Delete
int /* majorOpcode */,
[75] Fix | Delete
int /* offendingMinor */,
[76] Fix | Delete
int /* severity */
[77] Fix | Delete
);
[78] Fix | Delete
[79] Fix | Delete
extern void _IceErrorBadValue (
[80] Fix | Delete
IceConn /* iceConn */,
[81] Fix | Delete
int /* majorOpcode */,
[82] Fix | Delete
int /* offendingMinor */,
[83] Fix | Delete
int /* offset */,
[84] Fix | Delete
int /* length */,
[85] Fix | Delete
IcePointer /* value */
[86] Fix | Delete
);
[87] Fix | Delete
[88] Fix | Delete
extern IcePoAuthStatus _IcePoMagicCookie1Proc (
[89] Fix | Delete
IceConn /* iceConn */,
[90] Fix | Delete
IcePointer * /* authStatePtr */,
[91] Fix | Delete
Bool /* cleanUp */,
[92] Fix | Delete
Bool /* swap */,
[93] Fix | Delete
int /* authDataLen */,
[94] Fix | Delete
IcePointer /* authData */,
[95] Fix | Delete
int * /* replyDataLenRet */,
[96] Fix | Delete
IcePointer * /* replyDataRet */,
[97] Fix | Delete
char ** /* errorStringRet */
[98] Fix | Delete
);
[99] Fix | Delete
[100] Fix | Delete
extern IcePaAuthStatus _IcePaMagicCookie1Proc (
[101] Fix | Delete
IceConn /* iceConn */,
[102] Fix | Delete
IcePointer * /* authStatePtr */,
[103] Fix | Delete
Bool /* swap */,
[104] Fix | Delete
int /* authDataLen */,
[105] Fix | Delete
IcePointer /* authData */,
[106] Fix | Delete
int * /* replyDataLenRet */,
[107] Fix | Delete
IcePointer * /* replyDataRet */,
[108] Fix | Delete
char ** /* errorStringRet */
[109] Fix | Delete
);
[110] Fix | Delete
[111] Fix | Delete
[112] Fix | Delete
/*
[113] Fix | Delete
* Macro to check if IO operations are valid on an ICE connection.
[114] Fix | Delete
*/
[115] Fix | Delete
[116] Fix | Delete
#define IceValidIO(_iceConn) _iceConn->io_ok
[117] Fix | Delete
[118] Fix | Delete
[119] Fix | Delete
/*
[120] Fix | Delete
* Macros for writing messages.
[121] Fix | Delete
*/
[122] Fix | Delete
[123] Fix | Delete
#define IceGetHeader(_iceConn, _major, _minor, _headerSize, _msgType, _pMsg) \
[124] Fix | Delete
if ((_iceConn->outbufptr + _headerSize) > _iceConn->outbufmax) \
[125] Fix | Delete
IceFlush (_iceConn); \
[126] Fix | Delete
_pMsg = (_msgType *) _iceConn->outbufptr; \
[127] Fix | Delete
_pMsg->majorOpcode = _major; \
[128] Fix | Delete
_pMsg->minorOpcode = _minor; \
[129] Fix | Delete
_pMsg->length = (_headerSize - SIZEOF (iceMsg)) >> 3; \
[130] Fix | Delete
_iceConn->outbufptr += _headerSize; \
[131] Fix | Delete
_iceConn->send_sequence++
[132] Fix | Delete
[133] Fix | Delete
#define IceGetHeaderExtra(_iceConn, _major, _minor, _headerSize, _extra, _msgType, _pMsg, _pData) \
[134] Fix | Delete
if ((_iceConn->outbufptr + \
[135] Fix | Delete
_headerSize + ((_extra) << 3)) > _iceConn->outbufmax) \
[136] Fix | Delete
IceFlush (_iceConn); \
[137] Fix | Delete
_pMsg = (_msgType *) _iceConn->outbufptr; \
[138] Fix | Delete
if ((_iceConn->outbufptr + \
[139] Fix | Delete
_headerSize + ((_extra) << 3)) <= _iceConn->outbufmax) \
[140] Fix | Delete
_pData = (char *) _pMsg + _headerSize; \
[141] Fix | Delete
else \
[142] Fix | Delete
_pData = NULL; \
[143] Fix | Delete
_pMsg->majorOpcode = _major; \
[144] Fix | Delete
_pMsg->minorOpcode = _minor; \
[145] Fix | Delete
_pMsg->length = ((_headerSize - SIZEOF (iceMsg)) >> 3) + (_extra); \
[146] Fix | Delete
_iceConn->outbufptr += (_headerSize + ((_extra) << 3)); \
[147] Fix | Delete
_iceConn->send_sequence++
[148] Fix | Delete
[149] Fix | Delete
#define IceSimpleMessage(_iceConn, _major, _minor) \
[150] Fix | Delete
{ \
[151] Fix | Delete
iceMsg *_pMsg; \
[152] Fix | Delete
IceGetHeader (_iceConn, _major, _minor, SIZEOF (iceMsg), iceMsg, _pMsg); \
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
#define IceErrorHeader(_iceConn, _offendingMajorOpcode, _offendingMinorOpcode, _offendingSequenceNum, _severity, _errorClass, _dataLength) \
[156] Fix | Delete
{ \
[157] Fix | Delete
iceErrorMsg *_pMsg; \
[158] Fix | Delete
\
[159] Fix | Delete
IceGetHeader (_iceConn, _offendingMajorOpcode, ICE_Error, \
[160] Fix | Delete
SIZEOF (iceErrorMsg), iceErrorMsg, _pMsg); \
[161] Fix | Delete
_pMsg->length += (_dataLength); \
[162] Fix | Delete
_pMsg->offendingMinorOpcode = (CARD8) _offendingMinorOpcode; \
[163] Fix | Delete
_pMsg->severity = (CARD8) _severity; \
[164] Fix | Delete
_pMsg->offendingSequenceNum = (CARD32) _offendingSequenceNum; \
[165] Fix | Delete
_pMsg->errorClass = (CARD16) _errorClass; \
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
[169] Fix | Delete
/*
[170] Fix | Delete
* Write data into the ICE output buffer.
[171] Fix | Delete
*/
[172] Fix | Delete
[173] Fix | Delete
#define IceWriteData(_iceConn, _bytes, _data) \
[174] Fix | Delete
{ \
[175] Fix | Delete
if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \
[176] Fix | Delete
{ \
[177] Fix | Delete
IceFlush (_iceConn); \
[178] Fix | Delete
_IceWrite (_iceConn, (unsigned long) (_bytes), _data); \
[179] Fix | Delete
} \
[180] Fix | Delete
else \
[181] Fix | Delete
{ \
[182] Fix | Delete
memcpy (_iceConn->outbufptr, _data, _bytes); \
[183] Fix | Delete
_iceConn->outbufptr += (_bytes); \
[184] Fix | Delete
} \
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
#define IceWriteData16(_iceConn, _bytes, _data) \
[188] Fix | Delete
IceWriteData (_iceConn, _bytes, (char *) _data)
[189] Fix | Delete
[190] Fix | Delete
#define IceWriteData32(_iceConn, _bytes, _data) \
[191] Fix | Delete
IceWriteData (_iceConn, _bytes, (char *) _data)
[192] Fix | Delete
[193] Fix | Delete
[194] Fix | Delete
/*
[195] Fix | Delete
* The IceSendData macro bypasses copying the data to the
[196] Fix | Delete
* ICE connection buffer and sends the data directly. If necessary,
[197] Fix | Delete
* the ICE connection buffer is first flushed.
[198] Fix | Delete
*/
[199] Fix | Delete
[200] Fix | Delete
#define IceSendData(_iceConn, _bytes, _data) \
[201] Fix | Delete
{ \
[202] Fix | Delete
if (_iceConn->outbufptr > _iceConn->outbuf) \
[203] Fix | Delete
IceFlush (_iceConn); \
[204] Fix | Delete
_IceWrite (_iceConn, (unsigned long) (_bytes), _data); \
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
[208] Fix | Delete
/*
[209] Fix | Delete
* Write pad bytes. Used to force 32 or 64 bit alignment.
[210] Fix | Delete
* A maximum of 7 pad bytes can be specified.
[211] Fix | Delete
*/
[212] Fix | Delete
[213] Fix | Delete
#define IceWritePad(_iceConn, _bytes) \
[214] Fix | Delete
{ \
[215] Fix | Delete
if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \
[216] Fix | Delete
{ \
[217] Fix | Delete
char _dummy[7] = { 0 }; \
[218] Fix | Delete
IceFlush (_iceConn); \
[219] Fix | Delete
_IceWrite (_iceConn, (unsigned long) (_bytes), _dummy); \
[220] Fix | Delete
} \
[221] Fix | Delete
else \
[222] Fix | Delete
{ \
[223] Fix | Delete
_iceConn->outbufptr += (_bytes); \
[224] Fix | Delete
} \
[225] Fix | Delete
}
[226] Fix | Delete
[227] Fix | Delete
[228] Fix | Delete
/*
[229] Fix | Delete
* Macros for reading messages.
[230] Fix | Delete
*/
[231] Fix | Delete
[232] Fix | Delete
#define IceReadCompleteMessage(_iceConn, _headerSize, _msgType, _pMsg, _pData)\
[233] Fix | Delete
{ \
[234] Fix | Delete
unsigned long _bytes; \
[235] Fix | Delete
IceReadMessageHeader (_iceConn, _headerSize, _msgType, _pMsg); \
[236] Fix | Delete
_bytes = (_pMsg->length << 3) - (_headerSize - SIZEOF (iceMsg)); \
[237] Fix | Delete
if ((_iceConn->inbufmax - _iceConn->inbufptr) >= _bytes) \
[238] Fix | Delete
{ \
[239] Fix | Delete
_IceRead (_iceConn, _bytes, _iceConn->inbufptr); \
[240] Fix | Delete
_pData = _iceConn->inbufptr; \
[241] Fix | Delete
_iceConn->inbufptr += _bytes; \
[242] Fix | Delete
} \
[243] Fix | Delete
else \
[244] Fix | Delete
{ \
[245] Fix | Delete
_pData = malloc (_bytes); \
[246] Fix | Delete
if (_pData) \
[247] Fix | Delete
_IceRead (_iceConn, _bytes, _pData); \
[248] Fix | Delete
else \
[249] Fix | Delete
_IceReadSkip (_iceConn, _bytes); \
[250] Fix | Delete
} \
[251] Fix | Delete
}
[252] Fix | Delete
[253] Fix | Delete
#define IceDisposeCompleteMessage(_iceConn, _pData) \
[254] Fix | Delete
if ((char *) _pData < _iceConn->inbuf || \
[255] Fix | Delete
(char *) _pData >= _iceConn->inbufmax) \
[256] Fix | Delete
free (_pData);
[257] Fix | Delete
[258] Fix | Delete
[259] Fix | Delete
#define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) \
[260] Fix | Delete
_pMsg = (_msgType *) (_iceConn->inbuf);
[261] Fix | Delete
[262] Fix | Delete
#define IceReadMessageHeader(_iceConn, _headerSize, _msgType, _pMsg) \
[263] Fix | Delete
{ \
[264] Fix | Delete
_IceRead (_iceConn, \
[265] Fix | Delete
(unsigned long) (_headerSize - SIZEOF (iceMsg)), \
[266] Fix | Delete
_iceConn->inbufptr); \
[267] Fix | Delete
_pMsg = (_msgType *) (_iceConn->inbuf); \
[268] Fix | Delete
_iceConn->inbufptr += (_headerSize - SIZEOF (iceMsg)); \
[269] Fix | Delete
}
[270] Fix | Delete
[271] Fix | Delete
#define IceReadData(_iceConn, _bytes, _pData) \
[272] Fix | Delete
_IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \
[273] Fix | Delete
[274] Fix | Delete
#define IceReadData16(_iceConn, _swap, _bytes, _pData) \
[275] Fix | Delete
{ \
[276] Fix | Delete
_IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \
[277] Fix | Delete
}
[278] Fix | Delete
[279] Fix | Delete
#define IceReadData32(_iceConn, _swap, _bytes, _pData) \
[280] Fix | Delete
{ \
[281] Fix | Delete
_IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
[285] Fix | Delete
/*
[286] Fix | Delete
* Read pad bytes (for 32 or 64 bit alignment).
[287] Fix | Delete
* A maxium of 7 pad bytes can be specified.
[288] Fix | Delete
*/
[289] Fix | Delete
[290] Fix | Delete
#define IceReadPad(_iceConn, _bytes) \
[291] Fix | Delete
{ \
[292] Fix | Delete
char _dummy[7]; \
[293] Fix | Delete
_IceRead (_iceConn, (unsigned long) (_bytes), _dummy); \
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
_XFUNCPROTOEND
[297] Fix | Delete
[298] Fix | Delete
#endif /* _ICEMSG_H_ */
[299] Fix | Delete
[300] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function