textypes.c /size: 2461 b    last modification: 2025-02-21 11:03
1/*
2    See license.txt in the root of this project.
3*/
4
5# include "luametatex.h"
6
7// # ifdef __STDC_IEC_60559_DFP__
8//     static _Decimal32 foo = 12; /* just a test to see if we have it */
9// # endif 
10
11void tex_dump_constants(dumpstream f)
12{
13    dump_via_int(f, max_n_of_toks_registers);
14    dump_via_int(f, max_n_of_box_registers);
15    dump_via_int(f, max_n_of_integer_registers);
16    dump_via_int(f, max_n_of_dimension_registers);
17    dump_via_int(f, max_n_of_attribute_registers);
18    dump_via_int(f, max_n_of_posit_registers);
19    dump_via_int(f, max_n_of_glue_registers);
20    dump_via_int(f, max_n_of_muglue_registers);
21    dump_via_int(f, max_n_of_bytecodes);
22    dump_via_int(f, max_n_of_math_families);
23    dump_via_int(f, max_n_of_math_classes);
24    dump_via_int(f, max_n_of_catcode_tables);
25    dump_via_int(f, max_n_of_box_indices);
26    dump_via_int(f, max_n_of_marks);
27    dump_via_int(f, max_n_of_inserts);
28    dump_via_int(f, max_n_of_box_indices);
29    dump_via_int(f, max_n_of_bytecodes);
30    dump_via_int(f, max_n_of_math_families);
31    dump_via_int(f, max_n_of_math_classes);
32    /* */
33    dump_via_int(f, max_chain_size);
34}
35
36static void tex_aux_check_constant(dumpstream f, int c)
37{
38    int x;
39    undump_int(f, x);
40    if (x != c) {
41        tex_fatal_undump_error("inconsistent constant");
42    }
43}
44
45void tex_undump_constants(dumpstream f)
46{
47    tex_aux_check_constant(f, max_n_of_toks_registers);
48    tex_aux_check_constant(f, max_n_of_box_registers);
49    tex_aux_check_constant(f, max_n_of_integer_registers);
50    tex_aux_check_constant(f, max_n_of_dimension_registers);
51    tex_aux_check_constant(f, max_n_of_attribute_registers);
52    tex_aux_check_constant(f, max_n_of_posit_registers);
53    tex_aux_check_constant(f, max_n_of_glue_registers);
54    tex_aux_check_constant(f, max_n_of_muglue_registers);
55    tex_aux_check_constant(f, max_n_of_bytecodes);
56    tex_aux_check_constant(f, max_n_of_math_families);
57    tex_aux_check_constant(f, max_n_of_math_classes);
58    tex_aux_check_constant(f, max_n_of_catcode_tables);
59    tex_aux_check_constant(f, max_n_of_box_indices);
60    tex_aux_check_constant(f, max_n_of_marks);
61    tex_aux_check_constant(f, max_n_of_inserts);
62    tex_aux_check_constant(f, max_n_of_box_indices);
63    tex_aux_check_constant(f, max_n_of_bytecodes);
64    tex_aux_check_constant(f, max_n_of_math_families);
65    tex_aux_check_constant(f, max_n_of_math_classes);
66    /* */
67    tex_aux_check_constant(f, max_chain_size);
68}
69