2 (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 See the copyright notice in the ACK home directory, in the file "Copyright".
8 #include <byte_order.h>
11 #define Xchar(ch) (ch)
13 #define Xchar(ch) ((ch) & 0377)
16 #define BYTES_REVERSED (MSB_AT_LOW_ADDRESS != FL_MSB_AT_LOW_ADDRESS)
17 #define WORDS_REVERSED (MSW_AT_LOW_ADDRESS != FL_MSW_AT_LOW_ADDRESS)
18 #define LONGS_REVERSED (FL_MSL_AT_LOW_ADDRESS)
21 #define uget2(c) (Xchar((c)[1]) | ((unsigned) Xchar((c)[0]) << 8))
22 #define Xput2(i, c) (((c)[1] = (i)), ((c)[0] = (i) >> 8))
23 #define put2(i, c) { register int j = (i); Xput2(j, c); }
25 #define uget2(c) (* ((unsigned short *) (c)))
26 #define Xput2(i, c) (* ((short *) (c)) = (i))
27 #define put2(i, c) Xput2(i, c)
30 #define get2(c) ((short) uget2(c))
32 #if WORDS_REVERSED || BYTES_REVERSED
33 #define get4(c) (uget2((c)+2) | ((long) uget2(c) << 16))
34 #define put4(l, c) { register long x=(l); \
35 Xput2((int)x,(c)+2); \
36 Xput2((int)(x>>16),(c)); \
39 #define get4(c) (* ((long *) (c)))
40 #define put4(l, c) (* ((long *) (c)) = (l))