OSDN Git Service

pdf_set_rule.
[putex/putex.git] / src / texsourc / texmfmem.h
1 /* Copyright 1992 Karl Berry
2    Copyright 2007 TeX Users Group
3    Copyright 2014 Clerk Ma
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18    02110-1301 USA.  */
19
20 /*
21   meaning      structure                      TeX                 Y&Y TeX
22                ----------------------------------------------------------------------
23   integer      |            int            || 4: long           | 8: long long      |   min_quarterword 0
24                ---------------------------------------------------------------------- max_quarterword FFFF
25   scaled       |            sc             || 4: long           | 8: long long      |   min_halfword
26                ----------------------------------------------------------------------
27   glue_ratio   |            gr             || 4: float          | 8: double         |
28                ----------------------------------------------------------------------
29   halfword     |     lh      |     rh      || 2: unsigned short | 4: unsigned long  |
30                ----------------------------------------------------------------------
31   half+quarter |  b0  |  b1  |     rh      ||                                       |
32                ----------------------------------------------------------------------
33   quarter      |  b0  |  b1  |  b2  |  b3  || 1: unsigned char  | 2: unsigned short |
34                ----------------------------------------------------------------------
35 */
36
37 typedef struct
38 {
39 #ifdef WORDS_BIGENDIAN
40   halfword rh;
41
42   union
43   {
44     halfword lh;
45
46     struct
47     {
48       quarterword b0, b1;
49     };
50   };
51 #endif
52 } two_halves;
53
54 typedef struct
55 {
56 #ifdef WORDS_BIGENDIAN
57   quarterword b0, b1, b2, b3;
58 #else
59   quarterword b3, b2, b1, b0;
60 #endif
61 } four_quarters;
62
63 typedef union
64 {
65   glue_ratio gr;
66   two_halves hh;
67   integer cint;
68   four_quarters qqqq;
69 } memory_word;
70
71 #ifndef WORDS_BIGENDIAN
72 #define cint u.CINT
73 #define qqqq v.QQQQ
74 #endif