File: equivalents.h

package info (click to toggle)
texlive-bin 2018.20181218.49446-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 186,920 kB
  • sloc: ansic: 873,264; cpp: 311,278; perl: 82,918; sh: 23,243; makefile: 8,590; lex: 4,939; python: 4,462; pascal: 3,813; java: 3,569; yacc: 2,901; tcl: 2,379; exp: 2,031; xml: 844; ruby: 678; lisp: 398; sed: 331; asm: 140; csh: 46; awk: 30
file content (899 lines) | stat: -rw-r--r-- 54,863 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
/* equivalents.h

   Copyright 2009 Taco Hoekwater <taco@luatex.org>

   This file is part of LuaTeX.

   LuaTeX is free software; you can redistribute it and/or modify it under
   the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 2 of the License, or (at your
   option) any later version.

   LuaTeX is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
   License for more details.

   You should have received a copy of the GNU General Public License along
   with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
*/

#ifndef EQUIVALENTS_H
#  define EQUIVALENTS_H

/*

Like the preceding parameters, the following quantities can be changed at compile
time to extend or reduce \TeX's capacity. But if they are changed, it is
necessary to rerun the initialization program \.{INITEX} @.INITEX@> to generate
new tables for the production \TeX\ program. One can't simply make helter-skelter
changes to the following constants, since certain rather complex initialization
numbers are computed from them. They are defined here using \.{WEB} macros,
instead of being put into \PASCAL's |const| list, in order to emphasize this
distinction.

*/

#  define font_base                    0  /* smallest internal font number; must not be less than |min_quarterword| */
#  define biggest_reg              65535  /* the largest allowed register number; must be |< max_quarterword| */
#  define number_regs              65536  /* |biggest_reg+1| */
#  define number_attrs             65536  /* total numbeer of attributes */
#  define biggest_char           1114111  /* the largest allowed character number; must be |< max_halfword| */
#  define too_big_char           1114112  /* |biggest_char+1| */
#  define special_char           1114113  /* |biggest_char+2| */
#  define number_chars           1114112  /* |biggest_char+1| */
#  define number_fonts (5535-font_base+1)
#  define biggest_lang             32767
#  define too_big_lang             32768
#  define text_size                    0  /* size code for the largest size in a family */
#  define script_size                  1  /* size code for the medium size in a family */
#  define script_script_size           2  /* size code for the smallest size in a family */

/*

Each entry in |eqtb| is a |memory_word|. Most of these words are of type
|two_halves|, and subdivided into three fields:

\yskip\hangg 1) The |eq_level| (a quarterword) is the level of grouping at which
this equivalent was defined. If the level is |level_zero|, the equivalent has
never been defined; |level_one| refers to the outer level (outside of all
groups), and this level is also used for global definitions that never go away.
Higher levels are for equivalents that will disappear at the end of their group.
@^global definitions@>

\yskip\hangg 2) The |eq_type| (another quarterword) specifies what kind of entry
this is. There are many types, since each \TeX\ primitive like \.{\\hbox},
\.{\\def}, etc., has its own special code. The list of command codes above
includes all possible settings of the |eq_type| field.

\yskip\hangg 3) The |equiv| (a halfword) is the current equivalent value. This
may be a font number, a pointer into |mem|, or a variety of other things.

Many locations in |eqtb| have symbolic names. The purpose of the next paragraphs
is to define these names, and to set up the initial values of the equivalents.

In the first region we have a single entry for the `null csname' of length zero.
In luatex, the active characters and and single-letter control sequence names are
part of the next region.

Then comes region~2, which corresponds to the hash table that we will define
later. The maximum address in this region is used for a dummy control sequence
that is perpetually undefined. There also are several locations for control
sequences that are perpetually defined (since they are used in error recovery).

@ Region 3 of |eqtb| contains the |number_regs| \.{\\skip} registers, as well as
the glue parameters defined here. It is important that the ``muskip'' parameters
have larger numbers than the others.

@ Region 4 of |eqtb| contains the local quantities defined here. The bulk of this
region is taken up by five tables that are indexed by eight-bit characters; these
tables are important to both the syntactic and semantic portions of \TeX. There
are also a bunch of special things like font and token parameters, as well as the
tables of \.{\\toks} and \.{\\box} registers.

@ Region 5 of |eqtb| contains the integer parameters and registers defined here,
as well as the |del_code| table. The latter table differs from the
|cat_code..math_code| tables that precede it, since delimiter codes are fullword
integers while the other kinds of codes occupy at most a halfword. This is what
makes region~5 different from region~4. We will store the |eq_level| information
in an auxiliary array of quarterwords that will be defined later.

@ The integer parameters should really be initialized by a macro package; the
following initialization does the minimum to keep \TeX\ from complete failure.

@^null delimiter@>

@ The final region of |eqtb| contains the dimension parameters defined here, and
the |number_regs| \.{\\dimen} registers.

*/

#  define null_cs 1                                                     /* equivalent of \.{\\csname\\endcsname} */
#  define hash_base (null_cs+1)                                         /* beginning of region 2, for the hash table */
#  define frozen_control_sequence (hash_base+hash_size)                 /* for error recovery */
#  define frozen_protection (frozen_control_sequence)                   /* inaccessible but definable */
#  define frozen_cr (frozen_control_sequence+1)                         /* permanent `\.{\\cr}' */
#  define frozen_end_group (frozen_control_sequence+2)                  /* permanent `\.{\\endgroup}' */
#  define frozen_right (frozen_control_sequence+3)                      /* permanent `\.{\\right}' */
#  define frozen_fi (frozen_control_sequence+4)                         /* permanent `\.{\\fi}' */
#  define frozen_end_template (frozen_control_sequence+5)               /* permanent `\.{\\endtemplate}' */
#  define frozen_endv (frozen_control_sequence+6)                       /* second permanent `\.{\\endtemplate}' */
#  define frozen_relax (frozen_control_sequence+7)                      /* permanent `\.{\\relax}' */
#  define end_write (frozen_control_sequence+8)                         /* permanent `\.{\\endwrite}' */
#  define frozen_dont_expand (frozen_control_sequence+9 )               /* permanent `\.{\\notexpanded:}' */
#  define frozen_primitive (frozen_control_sequence+11 )                /* permanent `\.{\\primitive}' */
#  define frozen_special (frozen_control_sequence+12 )                  /* permanent `\.{\\special}' */
#  define frozen_null_font (frozen_control_sequence+13 )                /* permanent `\.{\\nullfont}' */
#  define font_id_base (frozen_null_font-font_base )                    /* begins table of |number_fonts| permanent font identifiers */
#  define undefined_control_sequence (frozen_null_font+number_fonts)
#  define glue_base (undefined_control_sequence+1)                      /* beginning of region 3 */

#  define line_skip_code 0                                              /* interline glue if |baseline_skip| is infeasible */
#  define baseline_skip_code 1                                          /* desired glue between baselines */
#  define par_skip_code 2                                               /* extra glue just above a paragraph */
#  define above_display_skip_code 3                                     /* extra glue just above displayed math */
#  define below_display_skip_code 4                                     /* extra glue just below displayed math */
#  define above_display_short_skip_code 5                               /* glue above displayed math following short lines */
#  define below_display_short_skip_code 6                               /* glue below displayed math following short lines */
#  define left_skip_code 7                                              /* glue at left of justified lines */
#  define right_skip_code 8                                             /* glue at right of justified lines */
#  define top_skip_code 9                                               /* glue at top of main pages */
#  define split_top_skip_code 10                                        /* glue at top of split pages */
#  define tab_skip_code 11                                              /* glue between aligned entries */
#  define space_skip_code 12                                            /* glue between words (if not |zero_glue|) */
#  define xspace_skip_code 13                                           /* glue after sentences (if not |zero_glue|) */
#  define par_fill_skip_code 14                                         /* glue on last line of paragraph */
#  define math_skip_code 15
#  define thin_mu_skip_code 16                                          /* thin space in math formula */
#  define med_mu_skip_code 17                                           /* medium space in math formula */
#  define thick_mu_skip_code 18                                         /* thick space in math formula */
#  define glue_pars 19                                                  /* total number of glue parameters */

#  define skip_base (glue_base+glue_pars)                               /* table of |number_regs| ``skip'' registers */
#  define mu_skip_base (skip_base+number_regs)                          /* table of |number_regs| ``muskip'' registers */
#  define local_base (mu_skip_base+number_regs)                         /* beginning of region 4 */

#  define par_shape_loc (local_base)                                    /* specifies paragraph shape */
#  define output_routine_loc (local_base+1)                             /* points to token list for \.{\\output} */
#  define every_par_loc (local_base+2)                                  /* points to token list for \.{\\everypar} */
#  define every_math_loc (local_base+3)                                 /* points to token list for \.{\\everymath} */
#  define every_display_loc (local_base+4)                              /* points to token list for \.{\\everydisplay} */
#  define every_hbox_loc (local_base+5)                                 /* points to token list for \.{\\everyhbox} */
#  define every_vbox_loc (local_base+6)                                 /* points to token list for \.{\\everyvbox} */
#  define every_job_loc (local_base+7)                                  /* points to token list for \.{\\everyjob} */
#  define every_cr_loc (local_base+8)                                   /* points to token list for \.{\\everycr} */
#  define err_help_loc (local_base+9)                                   /* points to token list for \.{\\errhelp} */
#  define every_eof_loc (local_base+10)                                 /* points to token list for \.{\\everyeof} */

#  define backend_toks_base (local_base+11)
#  define backend_toks_last (local_base+20)

#  define toks_base (local_base+21)                                     /* table of |number_regs| token list registers */

#  define etex_pen_base (toks_base+number_regs)                         /* start of table of \eTeX's penalties */
#  define inter_line_penalties_loc (etex_pen_base)                      /* additional penalties between lines */
#  define club_penalties_loc (etex_pen_base+1)                          /* penalties for creating club lines */
#  define widow_penalties_loc (etex_pen_base+2)                         /* penalties for creating widow lines */
#  define display_widow_penalties_loc (etex_pen_base+3)                 /* ditto, just before a display */
#  define etex_pens (etex_pen_base+4)                                   /* end of table of \eTeX's penalties */
#  define local_left_box_base (etex_pens)
#  define local_right_box_base (local_left_box_base+1)
#  define box_base (local_right_box_base+1)                             /* table of |number_regs| box registers */
#  define cur_font_loc (box_base+number_regs)                           /* internal font number outside math mode */
#  define internal_math_param_base (cur_font_loc+1 )                    /* current math parameter data index  */
#  define cat_code_base (internal_math_param_base+1)                    /* current category code data index  */
#  define lc_code_base (cat_code_base+1)                                /* table of |number_chars| lowercase mappings */
#  define uc_code_base (lc_code_base+1)                                 /* table of |number_chars| uppercase mappings */
#  define sf_code_base (uc_code_base+1)                                 /* table of |number_chars| spacefactor mappings */
#  define math_code_base (sf_code_base+1)                               /* table of |number_chars| math mode mappings */
#  define int_base (math_code_base+1)                                   /* beginning of region 5 */

#  define pretolerance_code 0                                           /* badness tolerance before hyphenation */
#  define tolerance_code 1                                              /* badness tolerance after hyphenation */
#  define line_penalty_code 2                                           /* added to the badness of every line */
#  define hyphen_penalty_code 3                                         /* penalty for break after discretionary hyphen */
#  define ex_hyphen_penalty_code 4                                      /* penalty for break after explicit hyphen */
#  define club_penalty_code 5                                           /* penalty for creating a club line */
#  define widow_penalty_code 6                                          /* penalty for creating a widow line */
#  define display_widow_penalty_code 7                                  /* ditto, just before a display */
#  define broken_penalty_code 8                                         /* penalty for breaking a page at a broken line */
#  define bin_op_penalty_code 9                                         /* penalty for breaking after a binary operation */
#  define rel_penalty_code 10                                           /* penalty for breaking after a relation */
#  define pre_display_penalty_code 11                                   /* penalty for breaking just before a displayed formula */
#  define post_display_penalty_code 12                                  /* penalty for breaking just after a displayed formula */
#  define inter_line_penalty_code 13                                    /* additional penalty between lines */
#  define double_hyphen_demerits_code 14                                /* demerits for double hyphen break */
#  define final_hyphen_demerits_code 15                                 /* demerits for final hyphen break */
#  define adj_demerits_code 16                                          /* demerits for adjacent incompatible lines */
#  define mag_code 17                                                   /* magnification ratio */
#  define delimiter_factor_code 18                                      /* ratio for variable-size delimiters */
#  define looseness_code 19                                             /* change in number of lines for a paragraph */
#  define time_code 20                                                  /* current time of day */
#  define day_code 21                                                   /* current day of the month */
#  define month_code 22                                                 /* current month of the year */
#  define year_code 23                                                  /* current year of our Lord */
#  define show_box_breadth_code 24                                      /* nodes per level in |show_box| */
#  define show_box_depth_code 25                                        /* maximum level in |show_box| */
#  define hbadness_code 26                                              /* hboxes exceeding this badness will be shown by |hpack| */
#  define vbadness_code 27                                              /* vboxes exceeding this badness will be shown by |vpack| */
#  define pausing_code 28                                               /* pause after each line is read from a file */
#  define tracing_online_code 29                                        /* show diagnostic output on terminal */
#  define tracing_macros_code 30                                        /* show macros as they are being expanded */
#  define tracing_stats_code 31                                         /* show memory usage if \TeX\ knows it */
#  define tracing_paragraphs_code 32                                    /* show line-break calculations */
#  define tracing_pages_code 33                                         /* show page-break calculations */
#  define tracing_output_code 34                                        /* show boxes when they are shipped out */
#  define tracing_lost_chars_code 35                                    /* show characters that aren't in the font */
#  define tracing_commands_code 36                                      /* show command codes at |big_switch| */
#  define tracing_restores_code 37                                      /* show equivalents when they are restored */
#  define uc_hyph_code 38                                               /* hyphenate words beginning with a capital letter */
#  define output_penalty_code 39                                        /* penalty found at current page break */
#  define max_dead_cycles_code 40                                       /* bound on consecutive dead cycles of output */
#  define hang_after_code 41                                            /* hanging indentation changes after this many lines */
#  define floating_penalty_code 42                                      /* penalty for insertions heldover after a split */
#  define global_defs_code 43                                           /* override \.{\\global} specifications */
#  define cur_fam_code 44                                               /* current family */
#  define escape_char_code 45                                           /* escape character for token output */
#  define default_hyphen_char_code 46                                   /* value of \.{\\hyphenchar} when a font is loaded */
#  define default_skew_char_code 47                                     /* value of \.{\\skewchar} when a font is loaded */
#  define end_line_char_code 48                                         /* character placed at the right end of the buffer */
#  define new_line_char_code 49                                         /* character that prints as |print_ln| */
#  define language_code 50                                              /* current hyphenation table */
#  define left_hyphen_min_code 51                                       /* minimum left hyphenation fragment size */
#  define right_hyphen_min_code 52                                      /* minimum right hyphenation fragment size */
#  define holding_inserts_code 53                                       /* do not remove insertion nodes from \.{\\box255} */
#  define error_context_lines_code 54                                   /* maximum intermediate line pairs shown */
#  define local_inter_line_penalty_code 55                              /* local \.{\\interlinepenalty} */
#  define local_broken_penalty_code 56                                  /* local \.{\\brokenpenalty} */
#  define no_local_whatsits_code 57                                     /* counts local whatsits */
#  define no_local_dirs_code 58

#  define disable_lig_code 60
#  define disable_kern_code 61
#  define disable_space_code 62
#  define cat_code_table_code 63
#  define output_box_code 64
#  define cur_lang_code 65                                              /* current language id */
#  define ex_hyphen_char_code 66
#  define hyphenation_min_code 67                                       /* minimum word length */
#  define adjust_spacing_code 68                                        /* level of spacing adjusting */
#  define protrude_chars_code 69                                        /* protrude chars at left/right edge of paragraphs */
#  define output_mode_code 70                                           /* switch on PDF output if positive */
#  define draft_mode_code 71
#  define tracing_fonts_code 72
#  define tracing_assigns_code 73                                       /* show assignments */
#  define tracing_groups_code 74                                        /* show save/restore groups */
#  define tracing_ifs_code 75                                           /* show conditionals */
#  define tracing_scan_tokens_code 76                                   /* show pseudo file open and close */
#  define tracing_nesting_code 77                                       /* show incomplete groups and ifs within files */
#  define pre_display_direction_code 78                                 /* text direction preceding a display */
#  define last_line_fit_code 79                                         /* adjustment for last line of paragraph */
#  define saving_vdiscards_code 80                                      /* save items discarded from vlists */
#  define saving_hyph_codes_code 81                                     /* save hyphenation codes for languages */
#  define suppress_fontnotfound_error_code 82                           /* suppress errors for missing fonts */
#  define suppress_long_error_code 83                                   /* suppress errors for missing fonts */
#  define suppress_ifcsname_error_code 84                               /* suppress errors for failed \.{\\ifcsname} */
#  define suppress_outer_error_code 85                                  /* suppress errors for \.{\\outer} */
#  define suppress_mathpar_error_code 86                                /* suppress errors for \.{\\par}} in math */
#  define math_eqno_gap_step_code 87                                    /* factor/1000 used for distance between eq and eqno */
#  define math_display_skip_mode_code 88
#  define math_scripts_mode_code 89
#  define math_nolimits_mode_code 90
#  define math_rules_mode_code 91
#  define math_rules_fam_code 92
#  define math_italics_mode_code 93
#  define synctex_code 94                                               /* is synctex file generation enabled ?  */
#  define shape_mode_code 95
#  define first_valid_language_code 96
#  define hyphenation_bounds_code 97
#  define math_skip_mode_code 98
#  define math_pre_display_gap_factor_code 99
#  define hyphen_penalty_mode_code 100
#  define automatic_hyphen_penalty_code 101
#  define explicit_hyphen_penalty_code 102
#  define automatic_hyphen_mode_code 103
#  define break_after_dir_mode_code 104

#  define pre_bin_op_penalty_code 105
#  define pre_rel_penalty_code 106
#  define math_penalties_mode_code 107
#  define math_delimiters_mode_code 108
#  define math_script_box_mode_code 109

#  define suppress_primitive_error_code 110

#  define math_option_code (suppress_primitive_error_code+1)

#  define mathoption_int_base_code (math_option_code+1)                 /* one reserve */
#  define mathoption_int_last_code (mathoption_int_base_code+8)

#  define backend_int_base_code (mathoption_int_last_code+1)
#  define backend_int_last_code (backend_int_base_code+32)              /* we need some 25 but take some slack */

#  define tex_int_pars (backend_int_last_code+1)                        /* total number of integer parameters */

#  define mathoption_int_base (int_base+mathoption_int_base_code)
#  define mathoption_int_last (int_base+mathoption_int_last_code)

#  define backend_int_base (int_base+backend_int_base_code)
#  define backend_int_last (int_base+backend_int_last_code)

#  define page_direction_code (tex_int_pars)
#  define body_direction_code (tex_int_pars+1)
#  define par_direction_code  (tex_int_pars+2)
#  define text_direction_code (tex_int_pars+3)
#  define math_direction_code (tex_int_pars+4)
#  define line_direction_code (tex_int_pars+5)                          /* gets remapped so is no real register */

#  define int_pars (tex_int_pars+5)                                     /* total number of integer parameters */

#  define dir_base (int_base+tex_int_pars)
#  define count_base (int_base+int_pars)                                /* |number_regs| user \.{\\count} registers */
#  define attribute_base (count_base+number_regs)                       /* |number_attrs| user \.{\\attribute} registers */
#  define del_code_base (attribute_base+number_attrs)                   /* |number_chars| delimiter code mappings */
#  define dimen_base (del_code_base+1)                                  /* beginning of region 6 */

#  define par_indent_code 0                                             /* indentation of paragraphs */
#  define math_surround_code 1                                          /* space around math in text */
#  define line_skip_limit_code 2                                        /* threshold for |line_skip| instead of |baseline_skip| */
#  define hsize_code 3                                                  /* line width in horizontal mode */
#  define vsize_code 4                                                  /* page height in vertical mode */
#  define max_depth_code 5                                              /* maximum depth of boxes on main pages */
#  define split_max_depth_code 6                                        /* maximum depth of boxes on split pages */
#  define box_max_depth_code 7                                          /* maximum depth of explicit vboxes */
#  define hfuzz_code 8                                                  /* tolerance for overfull hbox messages */
#  define vfuzz_code 9                                                  /* tolerance for overfull vbox messages */
#  define delimiter_shortfall_code 10                                   /* maximum amount uncovered by variable delimiters */
#  define null_delimiter_space_code 11                                  /* blank space in null delimiters */
#  define script_space_code 12                                          /* extra space after subscript or superscript */
#  define pre_display_size_code 13                                      /* length of text preceding a display */
#  define display_width_code 14                                         /* length of line for displayed equation */
#  define display_indent_code 15                                        /* indentation of line for displayed equation */
#  define overfull_rule_code 16                                         /* width of rule that identifies overfull hboxes */
#  define hang_indent_code 17                                           /* amount of hanging indentation */
#  define h_offset_code 18                                              /* amount of horizontal offset when shipping pages out */
#  define v_offset_code 19                                              /* amount of vertical offset when shipping pages out */
#  define emergency_stretch_code 20                                     /* reduces badnesses on final pass of line-breaking */
#  define page_left_offset_code 21
#  define page_top_offset_code 22
#  define page_right_offset_code 23
#  define page_bottom_offset_code 24
#  define px_dimen_code 25
#  define page_width_code 26                                            /* page width of the output */
#  define page_height_code 27                                           /* page height of the output */

#  define backend_dimen_base (dimen_base+28)
#  define backend_dimen_last (dimen_base+37)

#  define dimen_pars (38)                                               /* total number of dimension parameters */

#  define scaled_base (dimen_base+dimen_pars)                           /* table of |number_regs| user-defined \.{\\dimen} registers */
#  define eqtb_size (scaled_base+biggest_reg)                           /* largest subscript of |eqtb| */

extern memory_word *eqtb;

extern halfword eqtb_top;                                               /* maximum of the |eqtb| */

extern quarterword xeq_level[(eqtb_size + 1)];
extern void initialize_equivalents(void);

#  define eq_level_field(A) (A).hh.b1
#  define eq_type_field(A) (A).hh.b0
#  define equiv_field(A) (A).hh.rh

#  define eq_level(A) eq_level_field(eqtb[(A)])                         /* level of definition */
#  define eq_type(A) eq_type_field(eqtb[(A)])                           /* command code for equivalent */
#  define equiv(A) equiv_field(eqtb[(A)])                               /* equivalent value */

#  define set_eq_level(A,B) eq_level((A)) = (B)
#  define set_eq_type(A,B) eq_type((A)) = (B)
#  define set_equiv(A,B) equiv((A)) = (B)

typedef struct save_record_ {
    quarterword type_;
    quarterword level_;
    memory_word word_;
} save_record;

extern save_record *save_stack;
extern int save_ptr;                                                    /* first unused entry on |save_stack| */
extern int max_save_stack;                                              /* maximum usage of save stack */
extern quarterword cur_level;                                           /* current nesting level for groups */
extern group_code cur_group;                                            /* current group type */
extern int cur_boundary;                                                /* where the current level begins */

#  define save_type(A) save_stack[(A)].type_                            /* classifies a |save_stack| entry */
#  define save_level(A) save_stack[(A)].level_                          /* saved level for regions 5 and 6, or group code */
#  define save_value(A) save_stack[(A)].word_.cint                      /* |eqtb| location or token or |save_stack| location */
#  define save_word(A) save_stack[(A)].word_                            /* |eqtb| entry */

/*

We use the notation |saved(k)| to stand for an item that appears in location
|save_ptr+k| of the save stack.

*/

#  define saved_type(A) save_stack[save_ptr+(A)].type_
#  define saved_level(A) save_stack[save_ptr+(A)].level_
#  define saved_value(A) save_stack[save_ptr+(A)].word_.cint

#  define set_saved_record(A,B,C,D) do {	\
        saved_type(A) = (quarterword)(B);   \
        saved_level(A) = (quarterword)(C);  \
        saved_value(A) = (D);               \
    } while (0)

#  define restore_old_value 0                                           /* |save_type| when a value should be restored later */
#  define restore_zero 1                                                /* |save_type| when an undefined entry should be restored */
#  define insert_token 2                                                /* |save_type| when a token is being saved for later use */
#  define level_boundary 3                                              /* |save_type| corresponding to beginning of group */
#  define saved_line 4
#  define saved_adjust 5
#  define saved_insert 6
#  define saved_disc 7
#  define saved_boxtype 8
#  define saved_textdir 9
#  define saved_eqno 10
#  define saved_choices 11
#  define saved_math 12
#  define saved_boxcontext 13
#  define saved_boxspec 14
#  define saved_boxdir 15
#  define saved_boxattr 16
#  define saved_boxpack 18
#  define saved_eqtb 19

extern void print_save_stack(void);

#  define int_par(A)   eqtb[int_base+(A)].cint
#  define dimen_par(A) eqtb[dimen_base+(A)].cint
#  define loc_par(A)   equiv(local_base+(A))
#  define glue_par(A)  equiv(glue_base+(A))

typedef enum {
    c_mathoption_old_code = 0,                  /* this one is stable */
    c_mathoption_no_italic_compensation_code,   /* just for tracing, can change */
    c_mathoption_no_char_italic_code,           /* just for tracing, can change */
    c_mathoption_use_old_fraction_scaling_code, /* just for tracing, can change */
    c_mathoption_umathcode_meaning_code,        /* this one is stable */
} math_option_codes ;

#  define mathoption_int_par(A) eqtb[mathoption_int_base+(A)].cint

/* if nonzero, this magnification should be used henceforth */

extern int mag_set;
extern void prepare_mag(void);

/*

@ Here are the group codes that are used to discriminate between different kinds
of groups. They allow \TeX\ to decide what special actions, if any, should be
performed when a group ends. \def\grp{\.{\char'173...\char'175}}

Some groups are not supposed to be ended by right braces. For example, the `\.\$'
that begins a math formula causes a |math_shift_group| to be started, and this
should be terminated by a matching `\.\$'. Similarly, a group that starts with
\.{\\left} should end with \.{\\right}, and one that starts with \.{\\begingroup}
should end with \.{\\endgroup}.

*/

typedef enum {
    bottom_level = 0,    /* group code for the outside world */
    simple_group,        /* group code for local structure only */
    hbox_group,          /* code for `\.{\\hbox}\grp' */
    adjusted_hbox_group, /* code for `\.{\\hbox}\grp' in vertical mode */
    vbox_group,          /* code for `\.{\\vbox}\grp' */
    vtop_group,          /* code for `\.{\\vtop}\grp' */
    align_group,         /* code for `\.{\\halign}\grp', `\.{\\valign}\grp' */
    no_align_group,      /* code for `\.{\\noalign}\grp' */
    output_group,        /* code for output routine */
    math_group,          /* code for, e.g., `\.{\char'136}\grp' */
    disc_group,          /* code for `\.{\\discretionary}\grp\grp\grp' */
    insert_group,        /* code for `\.{\\insert}\grp', `\.{\\vadjust}\grp' */
    vcenter_group,       /* code for `\.{\\vcenter}\grp' */
    math_choice_group,   /* code for `\.{\\mathchoice}\grp\grp\grp\grp' */
    semi_simple_group,   /* code for `\.{\\begingroup...\\endgroup}' */
    math_shift_group,    /* code for `\.{\$...\$}' */
    math_left_group,     /* code for `\.{\\left...\\right}' */
    local_box_group,     /* code for `\.{\\localleftbox...\\localrightbox}' */
    split_off_group,     /* box code for the top part of a \.{\\vsplit} */
    split_keep_group,    /* box code for the bottom part of a \.{\\vsplit} */
    preamble_group,      /* box code for the preamble processing  in an alignment */
    align_set_group,     /* box code for the final item pass in an alignment */
    fin_row_group        /* box code for a provisory line in an alignment */
} tex_group_codes;

typedef enum {
    new_graf_par_code = 0,
    local_box_par_code,
    hmode_par_par_code,
    penalty_par_code,
    math_par_code,
} tex_par_codes ;

typedef enum {
    display_style = 0,           /* |subtype| for \.{\\displaystyle} */
    cramped_display_style,       /* |subtype| for \.{\\crampeddisplaystyle} */
    text_style,                  /* |subtype| for \.{\\textstyle} */
    cramped_text_style,          /* |subtype| for \.{\\crampedtextstyle} */
    script_style,                /* |subtype| for \.{\\scriptstyle} */
    cramped_script_style,        /* |subtype| for \.{\\crampedscriptstyle} */
    script_script_style,         /* |subtype| for \.{\\scriptscriptstyle} */
    cramped_script_script_style, /* |subtype| for \.{\\crampedscriptscriptstyle} */
} math_style_subtypes;

typedef enum {
    dir_TLT = 0,
    dir_TRT,
    dir_LTL,
    dir_RTT,
} dir_codes;

#  define max_group_code local_box_group                        /* which is wrong, but is what the web says */

extern int cur_cmd;                                             /* current command set by |get_next| */
extern halfword cur_chr;                                        /* operand of current command */
extern halfword cur_cs;                                         /* control sequence found here, zero if none found */
extern halfword cur_tok;                                        /* packed representative of |cur_cmd| and |cur_chr| */

extern void show_cur_cmd_chr(void);

extern void new_save_level(group_code c);                       /* begin a new level of grouping */
extern void eq_destroy(memory_word w);                          /* gets ready to forget |w| */
extern void eq_save(halfword p, quarterword l);                 /* saves |eqtb[p]| */
extern void eq_define(halfword p, quarterword t, halfword e);   /* new data for |eqtb| */
extern void eq_word_define(halfword p, int w);
extern void geq_define(halfword p, quarterword t, halfword e);  /* global |eq_define| */
extern void geq_word_define(halfword p, int w);                 /* global |eq_word_define| */
extern void save_for_after(halfword t);
extern void unsave(void);                                       /* pops the top level off the save stack */
extern void show_save_groups(void);

#  define level_zero 0                                          /* level for undefined quantities */
#  define level_one 1                                           /* outermost level for defined quantities */

extern void show_eqtb(halfword n);

/* \csname \ifcsname */

extern halfword last_cs_name;

/*
    The *_par macros expand to the variables that are (in most cases) also accessible
    at the users end. Most are registers but some are in the (stack) lists.

    More *_par will move here : there is no real need for thse macros but because there
    were already a bunch and because they were defined all over the place we moved them
    here.

*/

#define space_skip_par                     glue_par(space_skip_code)
#define xspace_skip_par                    glue_par(xspace_skip_code)
#define math_skip_par                      glue_par(math_skip_code)
#define math_skip_mode                     int_par(math_skip_mode_code)

#define pre_display_size_par               dimen_par(pre_display_size_code)
#define display_width_par                  dimen_par(display_width_code)
#define display_indent_par                 dimen_par(display_indent_code)
#define math_surround_par                  dimen_par(math_surround_code)

#define display_skip_mode_par              int_par(math_display_skip_mode_code)
#define math_eqno_gap_step_par             int_par(math_eqno_gap_step_code)

#define body_direction_par                 int_par(body_direction_code)
#define page_direction_par                 int_par(page_direction_code)
#define par_direction_par                  int_par(par_direction_code)
#define text_direction_par                 int_par(text_direction_code)
#define math_direction_par                 int_par(math_direction_code)

#define shape_mode_par                     int_par(shape_mode_code)
#define hyphenation_bounds_par             int_par(hyphenation_bounds_code)
#define first_valid_language_par           int_par(first_valid_language_code)

#define hsize_par                          dimen_par(hsize_code)
#define vsize_par                          dimen_par(vsize_code)
#define hfuzz_par                          dimen_par(hfuzz_code)
#define vfuzz_par                          dimen_par(vfuzz_code)
#define hbadness_par                       int_par(hbadness_code)
#define vbadness_par                       int_par(vbadness_code)

#define baseline_skip_par                  glue_par(baseline_skip_code)
#define par_indent_par                     dimen_par(par_indent_code)
#define hang_indent_par                    dimen_par(hang_indent_code)
#define hang_after_par                     int_par(hang_after_code)
#define left_skip_par                      glue_par(left_skip_code)
#define right_skip_par                     glue_par(right_skip_code)

#define emergency_stretch_par              dimen_par(emergency_stretch_code)
#define pretolerance_par                   int_par(pretolerance_code)
#define tolerance_par                      int_par(tolerance_code)
#define looseness_par                      int_par(looseness_code)
#define adjust_spacing_par                 int_par(adjust_spacing_code)
#define adj_demerits_par                   int_par(adj_demerits_code)
#define protrude_chars_par                 int_par(protrude_chars_code)
#define line_penalty_par                   int_par(line_penalty_code)
#define last_line_fit_par                  int_par(last_line_fit_code)
#define double_hyphen_demerits_par         int_par(double_hyphen_demerits_code)
#define final_hyphen_demerits_par          int_par(final_hyphen_demerits_code)
#define inter_line_penalty_par             int_par(inter_line_penalty_code)
#define club_penalty_par                   int_par(club_penalty_code)
#define broken_penalty_par                 int_par(broken_penalty_code)
#define display_widow_penalty_par          int_par(display_widow_penalty_code)
#define widow_penalty_par                  int_par(widow_penalty_code)
#define line_skip_limit_par                dimen_par(line_skip_limit_code)

#define delimiter_shortfall_par            dimen_par(delimiter_shortfall_code)
#define null_delimiter_space_par           dimen_par(null_delimiter_space_code)
#define script_space_par                   dimen_par(script_space_code)
#define max_depth_par                      dimen_par(max_depth_code)
#define box_max_depth_par                  dimen_par(box_max_depth_code)
#define split_max_depth_par                dimen_par(split_max_depth_code)
#define overfull_rule_par                  dimen_par(overfull_rule_code)
#define box_max_depth_par                  dimen_par(box_max_depth_code)
#define top_skip_par                       glue_par(top_skip_code)
#define split_top_skip_par                 glue_par(split_top_skip_code)

#define cur_fam_par                        int_par(cur_fam_code)
#define pre_display_direction_par          int_par(pre_display_direction_code)
#define pre_display_penalty_par            int_par(pre_display_penalty_code)
#define post_display_penalty_par           int_par(post_display_penalty_code)

#define cur_fam_par_in_range               ((cur_fam_par>=0)&&(cur_fam_par<256))

#define local_inter_line_penalty_par       int_par(local_inter_line_penalty_code)
#define local_broken_penalty_par           int_par(local_broken_penalty_code)
#define local_left_box_par                 equiv(local_left_box_base)
#define local_right_box_par                equiv(local_right_box_base)

#define end_line_char_par                  int_par(end_line_char_code)
#define new_line_char_par                  int_par(new_line_char_code)
#define escape_char_par                    int_par(escape_char_code)

#define end_line_char_inactive             ((end_line_char_par < 0) || (end_line_char_par > 127))

#define delimiter_factor_par               int_par(delimiter_factor_code)
#define bin_op_penalty_par                 int_par(bin_op_penalty_code)
#define rel_penalty_par                    int_par(rel_penalty_code)
#define pre_bin_op_penalty_par             int_par(pre_bin_op_penalty_code)
#define pre_rel_penalty_par                int_par(pre_rel_penalty_code)
#define math_penalties_mode_par            int_par(math_penalties_mode_code)
#define math_delimiters_mode_par           int_par(math_delimiters_mode_code)
#define math_script_box_mode_par           int_par(math_script_box_mode_code)
#define null_delimiter_space_par           dimen_par(null_delimiter_space_code)
#define disable_lig_par                    int_par(disable_lig_code)
#define disable_kern_par                   int_par(disable_kern_code)
#define disable_space_par                  int_par(disable_space_code)
#define math_scripts_mode_par              int_par(math_scripts_mode_code)
#define math_nolimits_mode_par             int_par(math_nolimits_mode_code)
#define math_italics_mode_par              int_par(math_italics_mode_code)
#define math_rules_mode_par                int_par(math_rules_mode_code)
#define math_rules_fam_par                 int_par(math_rules_fam_code)

#define thin_mu_skip_par                   glue_par(thin_mu_skip_code)
#define med_mu_skip_par                    glue_par(med_mu_skip_code)
#define thick_mu_skip_par                  glue_par(thick_mu_skip_code)

#define every_math_par                     equiv(every_math_loc)
#define every_display_par                  equiv(every_display_loc)
#define every_cr_par                       equiv(every_cr_loc)
#define every_hbox_par                     equiv(every_hbox_loc)
#define every_vbox_par                     equiv(every_vbox_loc)
#define every_eof_par                      equiv(every_eof_loc)
#define every_par_par                      equiv(every_par_loc)
#define err_help_par                       equiv(err_help_loc)

#define no_local_whatsits_par              int_par(no_local_whatsits_code)
#define no_local_dirs_par                  int_par(no_local_dirs_code)

#define prev_depth_par                     cur_list.prev_depth_field
#define prev_graf_par                      cur_list.pg_field
#define tail_par                           cur_list.tail_field
#define head_par                           cur_list.head_field
#define mode_par                           cur_list.mode_field
#define dirs_par                           cur_list.dirs_field
#define space_factor_par                   cur_list.space_factor_field
#define incompleat_noad_par                cur_list.incompleat_noad_field
#define mode_line_par                      cur_list.ml_field
#define aux_par                            cur_list.eTeX_aux_field
#define delim_par                          aux_par

#define par_shape_par_ptr                  equiv(par_shape_loc)
#define inter_line_penalties_par_ptr       equiv(inter_line_penalties_loc)
#define club_penalties_par_ptr             equiv(club_penalties_loc)
#define widow_penalties_par_ptr            equiv(widow_penalties_loc)
#define display_widow_penalties_par_ptr    equiv(display_widow_penalties_loc)

#define page_width_par                     dimen_par(page_width_code)
#define page_height_par                    dimen_par(page_height_code)
#define h_offset_par                       dimen_par(h_offset_code)
#define v_offset_par                       dimen_par(v_offset_code)
#define page_left_offset_par               dimen_par(page_left_offset_code)
#define page_top_offset_par                dimen_par(page_top_offset_code)
#define page_right_offset_par              dimen_par(page_right_offset_code)
#define page_bottom_offset_par             dimen_par(page_bottom_offset_code)
#define px_dimen_par                       dimen_par(px_dimen_code)

#define max_dead_cycles_par                int_par(max_dead_cycles_code)
#define output_box_par                     int_par(output_box_code)
#define holding_inserts_par                int_par(holding_inserts_code)
#define output_routine_par                 equiv(output_routine_loc)
#define floating_penalty_par               int_par(floating_penalty_code)

#define mag_par                            int_par(mag_code)

#define global_defs_par                    int_par(global_defs_code)
#define cat_code_table_par                 int_par(cat_code_table_code)
#define saving_vdiscards_par               int_par(saving_vdiscards_code)

#define tracing_output_par                 int_par(tracing_output_code)
#define tracing_stats_par                  int_par(tracing_stats_code)
#define tracing_online_par                 int_par(tracing_online_code)
#define tracing_paragraphs_par             int_par(tracing_paragraphs_code)
#define tracing_nesting_par                int_par(tracing_nesting_code)
#define tracing_lost_chars_par             int_par(tracing_lost_chars_code)
#define tracing_scan_tokens_par            int_par(tracing_scan_tokens_code)
#define tracing_ifs_par                    int_par(tracing_ifs_code)
#define tracing_commands_par               int_par(tracing_commands_code)
#define tracing_macros_par                 int_par(tracing_macros_code)
#define tracing_assigns_par                int_par(tracing_assigns_code)
#define tracing_fonts_par                  int_par(tracing_fonts_code)
#define tracing_pages_par                  int_par(tracing_pages_code)
#define tracing_restores_par               int_par(tracing_restores_code)
#define tracing_groups_par                 int_par(tracing_groups_code)

#define show_box_depth_par                 int_par(show_box_depth_code)
#define show_box_breadth_par               int_par(show_box_breadth_code)

#define pausing_par                        int_par(pausing_code)

#define suppress_outer_error_par           int_par(suppress_outer_error_code)
#define suppress_long_error_par            int_par(suppress_long_error_code)
#define suppress_mathpar_error_par         int_par(suppress_mathpar_error_code)
#define suppress_fontnotfound_error_par    int_par(suppress_fontnotfound_error_code)
#define suppress_ifcsname_error_par        int_par(suppress_ifcsname_error_code)
#define suppress_primitive_error_par       int_par(suppress_primitive_error_code)
#define error_context_lines_par            int_par(error_context_lines_code)

#define math_old_par                       mathoption_int_par(c_mathoption_old_code)
#define math_no_italic_compensation_par    mathoption_int_par(c_mathoption_no_italic_compensation_code)
#define math_no_char_italic_par            mathoption_int_par(c_mathoption_no_char_italic_code)
#define math_use_old_fraction_scaling_par  mathoption_int_par(c_mathoption_use_old_fraction_scaling_code)
#define math_umathcode_meaning_par         mathoption_int_par(c_mathoption_umathcode_meaning_code)

#define math_pre_display_gap_factor_par    int_par(math_pre_display_gap_factor_code)

#define time_par                           int_par(time_code)
#define day_par                            int_par(day_code)
#define month_par                          int_par(month_code)
#define year_par                           int_par(year_code)

#define output_mode_par                    int_par(output_mode_code)
#define draft_mode_par                     int_par(draft_mode_code)
#define synctex_par                        int_par(synctex_code)

#define language_par                       int_par(language_code)
#define uc_hyph_par                        int_par(uc_hyph_code)
#define left_hyphen_min_par                int_par(left_hyphen_min_code)
#define right_hyphen_min_par               int_par(right_hyphen_min_code)
#define ex_hyphen_char_par                 int_par(ex_hyphen_char_code)
#define hyphen_penalty_par                 int_par(hyphen_penalty_code)
#define ex_hyphen_penalty_par              int_par(ex_hyphen_penalty_code)
#define default_hyphen_char_par            int_par(default_hyphen_char_code)
#define default_skew_char_par              int_par(default_skew_char_code)
#define saving_hyph_codes_par              int_par(saving_hyph_codes_code)

#define hyphen_penalty_mode_par            int_par(hyphen_penalty_mode_code)
#define automatic_hyphen_penalty_par       int_par(automatic_hyphen_penalty_code)
#define explicit_hyphen_penalty_par        int_par(explicit_hyphen_penalty_code)
#define automatic_hyphen_mode_par          int_par(automatic_hyphen_mode_code)
#define break_after_dir_mode_par           int_par(break_after_dir_mode_code)

#define cur_lang_par                       int_par(cur_lang_code)
#define cur_font_par                       equiv(cur_font_loc)

/* */

#define math_use_current_family_code 7

/*
    #define box(A) equiv(box_base+(A))
    #define box(A) eqtb[box_base+(A)].hh.rh
*/

#define attribute(A) equiv(attribute_base+(A))
#define box(A)       equiv(box_base+(A))
#define count(A)     equiv(count_base+(A))
#define dimen(A)     equiv(scaled_base+(A))
#define mu_skip(A)   equiv(mu_skip_base+(A))
#define skip(A)      equiv(skip_base+(A))
#define toks(A)      equiv(toks_base+(A))

#define get_tex_attribute_register(j) attribute(j)
#define get_tex_box_register(j)       box(j)
#define get_tex_count_register(j)     count(j)
#define get_tex_dimen_register(j)     dimen(j)
#define get_tex_mu_skip_register(j)   mu_skip(j)
#define get_tex_skip_register(j)      skip(j)

#define font_id_text(A) cs_text(font_id_base+(A))

#define end_template_token  (cs_token_flag+frozen_end_template)
#define end_write_token     (cs_token_flag+end_write)

/* for now here */

#define xspace_skip_subtype (xspace_skip_code + 1)
#define space_skip_subtype  (space_skip_code + 1)

/*

hyphen_penalty_mode_par   automatic_disc (-)                explicit_disc (\-)
---------------------------------------------------------------------------------
0 (default)               ex_hyphen_penalty_par             ex_hyphen_penalty_par
1                         hyphen_penalty_par                hyphen_penalty_par
2                         ex_hyphen_penalty_par             hyphen_penalty_par
3                         hyphen_penalty_par                ex_hyphen_penalty_par
4                         automatic_hyphen_penalty_par      explicit_disc_penalty_par
5                         ex_hyphen_penalty_par             explicit_disc_penalty_par
6                         hyphen_penalty_par                explicit_disc_penalty_par
7                         automatic_hyphen_penalty_par      ex_hyphen_penalty_par
8                         automatic_hyphen_penalty_par      hyphen_penalty_par
*/

#define set_automatic_disc_penalty(n) \
    switch (hyphen_penalty_mode_par) { \
        case 0: \
        case 2: \
        case 5: \
            /* we take ex_hyphen_penalty */ \
            disc_penalty(n) = ex_hyphen_penalty_par; \
            break; \
        case 1: \
        case 3: \
        case 6: \
            /* we take hyphen_penalty */ \
            disc_penalty(n) = hyphen_penalty_par; \
            break; \
        case 4: \
        case 7: \
        case 8: \
            /* we take automatic_hyphen_penalty */ \
            disc_penalty(n) = automatic_hyphen_penalty_par; \
            break; \
        default: \
            /* what we've done since the beginning */ \
            disc_penalty(n) = ex_hyphen_penalty_par; \
            break; \
    }

#define set_explicit_disc_penalty(n) \
    switch (hyphen_penalty_mode_par) { \
        case 0: \
        case 3: \
        case 7: \
            /* we take ex_hyphen_penalty */ \
            disc_penalty(n) = ex_hyphen_penalty_par; \
            break; \
        case 1: \
        case 2: \
        case 8: \
            /* we take hyphen_penalty */ \
            disc_penalty(n) = hyphen_penalty_par; \
            break; \
        case 4: \
        case 5: \
        case 6: \
            /* we take automatic_hyphen_penalty */ \
            disc_penalty(n) = explicit_hyphen_penalty_par; \
            break; \
        default: \
            /* what we've done since the beginning */ \
            disc_penalty(n) = ex_hyphen_penalty_par; \
            break; \
    }

#endif