3 Copyright 2009-2010 Taco Hoekwater <taco@luatex.org>
5 This file is part of LuaTeX.
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
21 /* This header file is extra special because it is read in from
22 within the pascal source */
27 /* texmfmem.h: the memory_word type, which is too hard to translate
28 automatically from Pascal. We have to make sure the byte-swapping
29 that the (un)dumping routines do suffices to put things in the right
32 A memory_word can be broken up into a `twohalves' or a
33 `fourquarters', and a `twohalves' can be further broken up. Here is
34 a picture. ..._M = most significant byte, ..._L = least significant
39 twohalves.v: RH_MM RH_ML RH_LM RH_LL LH_MM LH_ML LH_LM LH_LL
40 twohalves.u: ---------JUNK---------- ----B0----- ----B1-----
41 fourquarters: ----B0----- ----B1----- ----B2----- ----B3-----
42 twoints: ---------CINT0--------- ---------CINT1---------
45 twohalves.v: LH_LL LH_LM LH_ML LH_MM RH_LL RH_LM RH_ML RH_MM
46 twohalves.u: ----B1----- ----B0-----
47 fourquarters: ----B3----- ----B2----- ----B1----- ----B0-----
48 twoints: ---------CINT1--------- ---------CINT0---------
55 # ifdef WORDS_BIGENDIAN
62 struct { /* Make B0,B1 overlap the most significant bytes of LH. */
63 # ifdef WORDS_BIGENDIAN
66 # else /* not WORDS_BIGENDIAN */
67 /* If 32-bit memory words, have to do something. */
69 # endif /* LittleEndian */
75 # ifdef WORDS_BIGENDIAN
76 quarterword B0
, B1
, B2
, B3
;
78 quarterword B3
, B2
, B1
, B0
;
84 # ifdef WORDS_BIGENDIAN
108 # define lhfield v.LH
110 # define cint ii.CINT0
111 # define cint1 ii.CINT1
115 /* the next five defines are needed for the prototypes in web2c's coerce.h */
117 # define memoryword memory_word
118 # define strnumber str_number
119 # define packedASCIIcode packed_ASCII_code
120 # define poolpointer pool_pointer
122 typedef FILE *word_file
;
125 extern void print_word(memory_word w
);