3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 #include "byte_order.h"
11 #define Xchar(ch) (ch)
13 #define Xchar(ch) ((ch) & 0377)
16 #if ! defined(BYTES_REVERSED)
17 #define BYTES_REVERSED 1
20 #if ! defined(WORDS_REVERSED)
21 #define WORDS_REVERSED 1
25 #define uget2(c) (Xchar((c)[0]) | ((unsigned) Xchar((c)[1]) << 8))
26 #define Xput2(i, c) (((c)[0] = (i)), ((c)[1] = (i) >> 8))
27 #define put2(i, c) { register int j = (i); Xput2(j, c); }
29 #define uget2(c) (* ((unsigned short *) (c)))
30 #define Xput2(i, c) (* ((short *) (c)) = (i))
31 #define put2(i, c) Xput2(i, c)
34 #define get2(c) ((short) uget2(c))
36 #if WORDS_REVERSED || BYTES_REVERSED
37 #define get4(c) (uget2(c) | ((long) uget2((c)+2) << 16))
38 #define put4(l, c) { register long x=(l); \
40 Xput2((int)(x>>16),(c)+2); \
43 #define get4(c) (* ((long *) (c)))
44 #define put4(l, c) (* ((long *) (c)) = (l))
47 #define SECTCNT 3 /* number of sections with own output buffer */
49 #define WBUFSIZ (8*BUFSIZ)
51 #define WBUFSIZ BUFSIZ
63 extern struct fil __parts
[];
66 #define PARTRELO (PARTEMIT+SECTCNT)
67 #define PARTNAME (PARTRELO+1)
68 #define PARTCHAR (PARTNAME+1)
70 #define PARTDBUG (PARTCHAR+1)
72 #define PARTDBUG (PARTCHAR+0)
74 #define NPARTS (PARTDBUG + 1)
76 #define getsect(s) (PARTEMIT+((s)>=(SECTCNT-1)?(SECTCNT-1):(s)))