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 Omega, 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
/* Omega is sufficiently different to separate the definition. */
66
#if !defined(Omega) && !defined(eOmega) && !defined(Aleph) && !defined(luaTeX)
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;
115
#ifdef WORDS_BIGENDIAN
126
#else /* not WORDS_BIGENDIAN */
136
#if defined (TeX) && !defined (SMALLTeX) || defined (MF) && !defined (SMALLMF) || defined (MP) && !defined (SMALLMP)
138
#endif /* big {TeX,MF,MP} */
146
#if defined (TeX) && !defined (SMALLTeX) || defined (MF) && !defined (SMALLMF) || defined (MP) && !defined (SMALLMP)
148
#endif /* big {TeX,MF,MP} */
152
#endif /* not WORDS_BIGENDIAN */
156
/* fmemory_word for font_list; needs to be only four bytes. This saves
157
significant space in the .fmt files. */
161
#ifdef WORDS_BIGENDIAN
171
#else /* not WORDS_BIGENDIAN */
189
#endif /* not WORDS_BIGENDIAN */
192
/* To keep the original structure accesses working, we must go through
193
the extra names C forced us to introduce. */
204
#define cint1 x.CINT1
206
#ifndef WORDS_BIGENDIAN
211
#ifndef WORDS_BIGENDIAN
215
#else /* Omega || eOmega || Aleph */
221
#ifdef WORDS_BIGENDIAN
229
{ /* Make B0,B1 overlap the most significant bytes of LH. */
230
#ifdef WORDS_BIGENDIAN
233
#else /* not WORDS_BIGENDIAN */
234
/* If 32-bit memory words, have to do something. */
235
#if defined (SMALLTeX) || defined (SMALLMF) || defined (SMALLMP)
239
#endif /* big memory words */
240
#endif /* LittleEndian */
248
#ifdef WORDS_BIGENDIAN
249
quarterword B0, B1, B2, B3;
251
quarterword B3, B2, B1, B0;
258
#ifdef WORDS_BIGENDIAN
259
integer CINT0, CINT1;
261
integer CINT1, CINT0;
286
#define cint ii.CINT0
287
#define cint1 ii.CINT1
291
#endif /* Omega || eOmega || Aleph */
294
#define memory_word memoryword
295
#define two_halves twohalves
296
#define four_quarters fourquarters
298
#define strnumber str_number
299
#define poolpointer pool_pointer
300
#define packedASCIIcode packed_ASCII_code
301
#define internalfontnumber internal_font_number