1 /* texmfmem.h: the memory_word type, which is too hard to translate
2 automatically from Pascal. We have to make sure the byte-swapping
3 that the (un)dumping routines do suffices to put things in the right
6 A memory_word can be broken up into a `twohalves' or a
7 `fourquarters', and a `twohalves' can be further broken up. Here is
8 a picture. ..._M = most significant byte, ..._L = least significant
11 The halfword fields are four bytes if we are building a big TeX or MF;
12 this leads to further complications:
15 twohalves.v: RH_MM RH_ML RH_LM RH_LL LH_MM LH_ML LH_LM LH_LL
16 twohalves.u: ---------JUNK---------- B0 B1
17 fourquarters: B0 B1 B2 B3
20 twohalves.v: LH_LL LH_LM LH_ML LH_MM RH_LL RH_LM RH_ML RH_MM
22 fourquarters: ---------JUNK---------- B3 B2 B1 B0
24 I guess TeX and Metafont never refer to the B1 and B0 in the
25 fourquarters structure as the B1 and B0 in the twohalves.u structure.
27 The B0 and B1 fields are declared short instead of quarterword,
28 because they are used in character nodes to store a font number and a
29 character. If left as a quarterword (which is a single byte), we
30 couldn't support more than 256 fonts. (If shorts aren't two bytes,
33 In the old four-byte memory structure (something more needs to be
34 done to handle >256 fonts):
37 twohalves.v: RH_M RH_L LH_M LH_L
38 twohalves.u: JNK1 JNK2 B0 B1
39 fourquarters: B0 B1 B2 B3
42 twohalves.v: LH_L LH_M RH_L RH_M
43 twohalves.u: B1 B0 JNK1 JNK2
44 fourquarters: B3 B2 B1 B0
46 In Aleph, quarterwords are two octets, so the picture becomes simpler:
49 twohalves.v: RH_MM RH_ML RH_LM RH_LL LH_MM LH_ML LH_LM LH_LL
50 twohalves.u: ---------JUNK---------- ----B0----- ----B1-----
51 fourquarters: ----B0----- ----B1----- ----B2----- ----B3-----
52 twoints: ---------CINT0--------- ---------CINT1---------
55 twohalves.v: LH_LL LH_LM LH_ML LH_MM RH_LL RH_LM RH_ML RH_MM
56 twohalves.u: ----B1----- ----B0-----
57 fourquarters: ----B3----- ----B2----- ----B1----- ----B0-----
58 twoints: ---------CINT1--------- ---------CINT0---------
60 This file can't be part of texmf.h, because texmf.h gets included by
61 {tex,mf,mp}d.h before the `halfword' etc. types are defined. So we
62 include it from the change file instead.
65 /* Aleph is sufficiently different to separate the definition. */
66 #if !defined(Aleph) && !defined(epTeX) && !defined(eupTeX) && !defined(upTeX)
72 #ifdef WORDS_BIGENDIAN
80 { /* Make B0,B1 overlap the most significant bytes of LH. */
81 #ifdef WORDS_BIGENDIAN
84 #else /* not WORDS_BIGENDIAN */
85 /* If 32-bit memory words, have to do something. */
86 #if defined (SMALLTeX) || defined (SMALLMF) || defined (SMALLMP)
90 #endif /* big memory words */
91 #endif /* LittleEndian */
99 #ifdef WORDS_BIGENDIAN
100 quarterword B0
, B1
, B2
, B3
;
102 quarterword B3
, B2
, B1
, B0
;
118 #ifdef WORDS_BIGENDIAN
121 #else /* not WORDS_BIGENDIAN */
124 #if defined (TeX) && !defined (SMALLTeX) || defined (MF) && !defined (SMALLMF) || defined (MP) && !defined (SMALLMP)
126 #endif /* big {TeX,MF,MP} */
133 #if defined (TeX) && !defined (SMALLTeX) || defined (MF) && !defined (SMALLMF) || defined (MP) && !defined (SMALLMP)
135 #endif /* big {TeX,MF,MP} */
139 #endif /* not WORDS_BIGENDIAN */
143 /* fmemory_word for font_list; needs to be only four bytes. This saves
144 significant space in the .fmt files. (Not true in XeTeX, actually!) */
147 #ifdef WORDS_BIGENDIAN
150 #else /* not WORDS_BIGENDIAN */
154 halfword junk
; /* quarterword is really 16 bits in XeTeX, so integer does not fill the union */
163 #endif /* not WORDS_BIGENDIAN */
166 /* To keep the original structure accesses working, we must go through
167 the extra names C forced us to introduce. */
176 #ifndef WORDS_BIGENDIAN
180 #ifndef WORDS_BIGENDIAN
184 #else /* Aleph || epTeX || eupTeX || upTeX */
190 #ifdef WORDS_BIGENDIAN
198 { /* Make B0,B1 overlap the most significant bytes of LH. */
199 #ifdef WORDS_BIGENDIAN
202 #else /* not WORDS_BIGENDIAN */
203 /* If 32-bit memory words, have to do something. */
204 #if defined (SMALLTeX) || defined (SMALLMF) || defined (SMALLMP)
208 #endif /* big memory words */
209 #endif /* LittleEndian */
217 #ifdef WORDS_BIGENDIAN
218 quarterword B0
, B1
, B2
, B3
;
220 quarterword B3
, B2
, B1
, B0
;
227 #ifdef WORDS_BIGENDIAN
228 integer CINT0
, CINT1
;
230 integer CINT1
, CINT0
;
255 #define cint ii.CINT0
256 #define cint1 ii.CINT1
260 #endif /* Aleph || epTeX || eupTeX || upTeX */