/
x11.replacements
87 lines (80 loc) · 3.7 KB
/
x11.replacements
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
convert c: #define XtSetArg(arg, n, d) ((void)( (arg).name = (n), (arg).value = (XtArgVal)(d) ))
to c: #define XtSetArg(arg, n, d) ( ( (arg).name = (n), (arg).value = (XtArgVal)(d) ))
convert c: #define XtOffset(p_type,field) ((Cardinal) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
to fb: #define XtOffset(p_type, field) cast(Cardinal, cptr(byte ptr, @cast(p_type, NULL)->field) - cptr(byte ptr, NULL))
convert c: #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
to fb: #define XtOffsetOf(s_type, field) XtOffset(s_type ptr, field)
convert c:
#define IceGetHeader(_iceConn, _major, _minor, _headerSize, _msgType, _pMsg) \
if ((_iceConn->outbufptr + _headerSize) > _iceConn->outbufmax) \
IceFlush (_iceConn); \
_pMsg = (_msgType *) _iceConn->outbufptr; \
_pMsg->majorOpcode = _major; \
_pMsg->minorOpcode = _minor; \
_pMsg->length = (_headerSize - SIZEOF (iceMsg)) >> 3; \
_iceConn->outbufptr += _headerSize; \
_iceConn->send_sequence++
to c:
#define IceGetHeader(_iceConn, _major, _minor, _headerSize, _msgType, _pMsg) { \
if ((_iceConn->outbufptr + _headerSize) > _iceConn->outbufmax) \
IceFlush (_iceConn); \
_pMsg = (_msgType *) _iceConn->outbufptr; \
_pMsg->majorOpcode = _major; \
_pMsg->minorOpcode = _minor; \
_pMsg->length = (_headerSize - SIZEOF (iceMsg)) >> 3; \
_iceConn->outbufptr += _headerSize; \
_iceConn->send_sequence += 1; \
}
convert c:
#define IceGetHeaderExtra(_iceConn, _major, _minor, _headerSize, _extra, _msgType, _pMsg, _pData) \
if ((_iceConn->outbufptr + _headerSize + ((_extra) << 3)) > _iceConn->outbufmax) \
IceFlush (_iceConn); \
_pMsg = (_msgType *) _iceConn->outbufptr; \
if ((_iceConn->outbufptr + _headerSize + ((_extra) << 3)) <= _iceConn->outbufmax) \
_pData = (char *) _pMsg + _headerSize; \
else \
_pData = NULL; \
_pMsg->majorOpcode = _major; \
_pMsg->minorOpcode = _minor; \
_pMsg->length = ((_headerSize - SIZEOF (iceMsg)) >> 3) + (_extra); \
_iceConn->outbufptr += (_headerSize + ((_extra) << 3)); \
_iceConn->send_sequence++
to c:
#define IceGetHeaderExtra(_iceConn, _major, _minor, _headerSize, _extra, _msgType, _pMsg, _pData) { \
if ((_iceConn->outbufptr + _headerSize + ((_extra) << 3)) > _iceConn->outbufmax) \
IceFlush (_iceConn); \
_pMsg = (_msgType *) _iceConn->outbufptr; \
if ((_iceConn->outbufptr + _headerSize + ((_extra) << 3)) <= _iceConn->outbufmax) \
_pData = (void *) _pMsg + _headerSize; \
else \
_pData = NULL; \
_pMsg->majorOpcode = _major; \
_pMsg->minorOpcode = _minor; \
_pMsg->length = ((_headerSize - SIZEOF (iceMsg)) >> 3) + (_extra); \
_iceConn->outbufptr += (_headerSize + ((_extra) << 3)); \
_iceConn->send_sequence += 1; \
}
convert c:
#define IceWritePad(_iceConn, _bytes) { \
if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) { \
char _dummy[7] = { 0 }; \
IceFlush (_iceConn); \
_IceWrite (_iceConn, (unsigned long) (_bytes), _dummy); \
} else { \
_iceConn->outbufptr += (_bytes); \
} \
}
to c:
#define IceWritePad(_iceConn, _bytes) { \
if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) { \
signed char _dummy[7]; \
IceFlush (_iceConn); \
_IceWrite (_iceConn, (unsigned long) (_bytes), &_dummy(0)); \
} else { \
_iceConn->outbufptr += (_bytes); \
} \
}
convert c: #define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) _pMsg = (_msgType *) (_iceConn->inbuf);
to c: #define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) _pMsg = (_msgType *) (_iceConn->inbuf)
convert c: #define IceReadData(_iceConn, _bytes, _pData) _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData);
to c: #define IceReadData(_iceConn, _bytes, _pData) _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData)