| ICEmsg.h | | ICEmsg.h | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 160 | |
| IceGetHeader (_iceConn, _major, _minor, SIZEOF (iceMsg), iceMsg, _pMsg)
; \ | | IceGetHeader (_iceConn, _major, _minor, SIZEOF (iceMsg), iceMsg, _pMsg)
; \ | |
| } | | } | |
| | | | |
| #define IceErrorHeader(_iceConn, _offendingMajorOpcode, _offendingMinorOpco
de, _offendingSequenceNum, _severity, _errorClass, _dataLength) \ | | #define IceErrorHeader(_iceConn, _offendingMajorOpcode, _offendingMinorOpco
de, _offendingSequenceNum, _severity, _errorClass, _dataLength) \ | |
| { \ | | { \ | |
| iceErrorMsg *_pMsg; \ | | iceErrorMsg *_pMsg; \ | |
| \ | | \ | |
| IceGetHeader (_iceConn, _offendingMajorOpcode, ICE_Error, \ | | IceGetHeader (_iceConn, _offendingMajorOpcode, ICE_Error, \ | |
| SIZEOF (iceErrorMsg), iceErrorMsg, _pMsg); \ | | SIZEOF (iceErrorMsg), iceErrorMsg, _pMsg); \ | |
| _pMsg->length += (_dataLength); \ | | _pMsg->length += (_dataLength); \ | |
|
| _pMsg->offendingMinorOpcode = _offendingMinorOpcode; \ | | _pMsg->offendingMinorOpcode = (CARD8) _offendingMinorOpcode; \ | |
| _pMsg->severity = _severity; \ | | _pMsg->severity = (CARD8) _severity; \ | |
| _pMsg->offendingSequenceNum = _offendingSequenceNum; \ | | _pMsg->offendingSequenceNum = (CARD32) _offendingSequenceNum; \ | |
| _pMsg->errorClass = _errorClass; \ | | _pMsg->errorClass = (CARD16) _errorClass; \ | |
| } | | } | |
| | | | |
| /* | | /* | |
| * Write data into the ICE output buffer. | | * Write data into the ICE output buffer. | |
| */ | | */ | |
| | | | |
| #define IceWriteData(_iceConn, _bytes, _data) \ | | #define IceWriteData(_iceConn, _bytes, _data) \ | |
| { \ | | { \ | |
| if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \ | | if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \ | |
| { \ | | { \ | |
| IceFlush (_iceConn); \ | | IceFlush (_iceConn); \ | |
| _IceWrite (_iceConn, (unsigned long) (_bytes), _data); \ | | _IceWrite (_iceConn, (unsigned long) (_bytes), _data); \ | |
| } \ | | } \ | |
| else \ | | else \ | |
| { \ | | { \ | |
| memcpy (_iceConn->outbufptr, _data, _bytes); \ | | memcpy (_iceConn->outbufptr, _data, _bytes); \ | |
| _iceConn->outbufptr += (_bytes); \ | | _iceConn->outbufptr += (_bytes); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
|
| #ifndef WORD64 | | | |
| | | | |
| #define IceWriteData16(_iceConn, _bytes, _data) \ | | #define IceWriteData16(_iceConn, _bytes, _data) \ | |
| IceWriteData (_iceConn, _bytes, (char *) _data) | | IceWriteData (_iceConn, _bytes, (char *) _data) | |
| | | | |
| #define IceWriteData32(_iceConn, _bytes, _data) \ | | #define IceWriteData32(_iceConn, _bytes, _data) \ | |
| IceWriteData (_iceConn, _bytes, (char *) _data) | | IceWriteData (_iceConn, _bytes, (char *) _data) | |
| | | | |
|
| #else /* WORD64 */ | | | |
| | | | |
| /* IceWriteData16 and IceWriteData32 defined in misc.c for WORD64 */ | | | |
| | | | |
| #endif /* WORD64 */ | | | |
| | | | |
| /* | | /* | |
| * The IceSendData macro bypasses copying the data to the | | * The IceSendData macro bypasses copying the data to the | |
| * ICE connection buffer and sends the data directly. If necessary, | | * ICE connection buffer and sends the data directly. If necessary, | |
| * the ICE connection buffer is first flushed. | | * the ICE connection buffer is first flushed. | |
| */ | | */ | |
| | | | |
| #define IceSendData(_iceConn, _bytes, _data) \ | | #define IceSendData(_iceConn, _bytes, _data) \ | |
| { \ | | { \ | |
| if (_iceConn->outbufptr > _iceConn->outbuf) \ | | if (_iceConn->outbufptr > _iceConn->outbuf) \ | |
| IceFlush (_iceConn); \ | | IceFlush (_iceConn); \ | |
| | | | |
| skipping to change at line 247 | | skipping to change at line 239 | |
| IceReadMessageHeader (_iceConn, _headerSize, _msgType, _pMsg); \ | | IceReadMessageHeader (_iceConn, _headerSize, _msgType, _pMsg); \ | |
| _bytes = (_pMsg->length << 3) - (_headerSize - SIZEOF (iceMsg)); \ | | _bytes = (_pMsg->length << 3) - (_headerSize - SIZEOF (iceMsg)); \ | |
| if ((_iceConn->inbufmax - _iceConn->inbufptr) >= _bytes) \ | | if ((_iceConn->inbufmax - _iceConn->inbufptr) >= _bytes) \ | |
| { \ | | { \ | |
| _IceRead (_iceConn, _bytes, _iceConn->inbufptr); \ | | _IceRead (_iceConn, _bytes, _iceConn->inbufptr); \ | |
| _pData = _iceConn->inbufptr; \ | | _pData = _iceConn->inbufptr; \ | |
| _iceConn->inbufptr += _bytes; \ | | _iceConn->inbufptr += _bytes; \ | |
| } \ | | } \ | |
| else \ | | else \ | |
| { \ | | { \ | |
|
| _pData = (char *) malloc ((unsigned) _bytes); \ | | _pData = malloc (_bytes); \ | |
| if (_pData) \ | | if (_pData) \ | |
| _IceRead (_iceConn, _bytes, _pData); \ | | _IceRead (_iceConn, _bytes, _pData); \ | |
| else \ | | else \ | |
| _IceReadSkip (_iceConn, _bytes); \ | | _IceReadSkip (_iceConn, _bytes); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| #define IceDisposeCompleteMessage(_iceConn, _pData) \ | | #define IceDisposeCompleteMessage(_iceConn, _pData) \ | |
| if ((char *) _pData < _iceConn->inbuf || \ | | if ((char *) _pData < _iceConn->inbuf || \ | |
| (char *) _pData >= _iceConn->inbufmax) \ | | (char *) _pData >= _iceConn->inbufmax) \ | |
|
| free ((char *) _pData); | | free (_pData); | |
| | | | |
| #define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) \ | | #define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) \ | |
| _pMsg = (_msgType *) (_iceConn->inbuf); | | _pMsg = (_msgType *) (_iceConn->inbuf); | |
| | | | |
| #define IceReadMessageHeader(_iceConn, _headerSize, _msgType, _pMsg) \ | | #define IceReadMessageHeader(_iceConn, _headerSize, _msgType, _pMsg) \ | |
| { \ | | { \ | |
| _IceRead (_iceConn, \ | | _IceRead (_iceConn, \ | |
| (unsigned long) (_headerSize - SIZEOF (iceMsg)), \ | | (unsigned long) (_headerSize - SIZEOF (iceMsg)), \ | |
| _iceConn->inbufptr); \ | | _iceConn->inbufptr); \ | |
| _pMsg = (_msgType *) (_iceConn->inbuf); \ | | _pMsg = (_msgType *) (_iceConn->inbuf); \ | |
| _iceConn->inbufptr += (_headerSize - SIZEOF (iceMsg)); \ | | _iceConn->inbufptr += (_headerSize - SIZEOF (iceMsg)); \ | |
| } | | } | |
| | | | |
| #define IceReadData(_iceConn, _bytes, _pData) \ | | #define IceReadData(_iceConn, _bytes, _pData) \ | |
| _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ | | _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ | |
| | | | |
|
| #ifndef WORD64 | | | |
| | | | |
| #define IceReadData16(_iceConn, _swap, _bytes, _pData) \ | | #define IceReadData16(_iceConn, _swap, _bytes, _pData) \ | |
| { \ | | { \ | |
| _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ | | _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ | |
| } | | } | |
| | | | |
| #define IceReadData32(_iceConn, _swap, _bytes, _pData) \ | | #define IceReadData32(_iceConn, _swap, _bytes, _pData) \ | |
| { \ | | { \ | |
| _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ | | _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ | |
| } | | } | |
| | | | |
|
| #else /* WORD64 */ | | | |
| | | | |
| /* IceReadData16 and IceReadData32 defined in misc.c for WORD64 */ | | | |
| | | | |
| #endif /* WORD64 */ | | | |
| | | | |
| /* | | /* | |
| * Read pad bytes (for 32 or 64 bit alignment). | | * Read pad bytes (for 32 or 64 bit alignment). | |
| * A maxium of 7 pad bytes can be specified. | | * A maxium of 7 pad bytes can be specified. | |
| */ | | */ | |
| | | | |
| #define IceReadPad(_iceConn, _bytes) \ | | #define IceReadPad(_iceConn, _bytes) \ | |
| { \ | | { \ | |
| char _dummy[7]; \ | | char _dummy[7]; \ | |
| _IceRead (_iceConn, (unsigned long) (_bytes), _dummy); \ | | _IceRead (_iceConn, (unsigned long) (_bytes), _dummy); \ | |
| } | | } | |
| | | | |
End of changes. 7 change blocks. |
| 22 lines changed or deleted | | 6 lines changed or added | |
|