texmathcodes.h /size: 2516 b    last modification: 2024-01-16 10:22
1/*
2    See license.txt in the root of this project.
3*/
4
5# ifndef LMT_MATHCODES_H
6# define LMT_MATHCODES_H
7
8/*tex
9    We keep this special value which is used in |0x8000| so we have no real problem with 8 being
10    some other class as well. The 8 here is not really a class.
11*/
12
13# define active_math_class_value 8
14
15typedef enum mathcode_codes {
16    no_mathcode,
17    tex_mathcode,
18    umath_mathcode,
19 /* umathnum_mathcode, */
20    mathspec_mathcode
21} mathcode_codes;
22
23typedef struct mathcodeval {
24    short class_value;
25    short family_value;
26    int   character_value;
27} mathcodeval;
28
29typedef struct mathdictval {
30    unsigned short properties; // 1=char 2=open 4=close 8=middle 16=middle==class 
31    unsigned short group;
32    unsigned int   index;
33} mathdictval;
34
35# undef small /* defined in some microsoft library */
36
37/*tex
38    Until we drop 8 bit font support we keep the small and large distinction but it might
39    go away some day as it wastes memory.
40*/
41
42typedef struct delcodeval {
43    mathcodeval small;
44    mathcodeval large;
45} delcodeval;
46
47typedef struct mathspecval {
48    mathcodeval code;
49    mathdictval dict;
50} mathspecval;
51
52extern void        tex_set_math_code              (int n, mathcodeval v, int gl);
53extern mathcodeval tex_get_math_code              (int n);
54extern int         tex_get_math_code_number       (int n);
55extern mathcodeval tex_no_math_code               (void);
56
57extern void        tex_set_del_code               (int n, delcodeval v, int gl);
58extern delcodeval  tex_get_del_code               (int n);
59extern int         tex_get_del_code_number        (int n);
60extern int         tex_has_del_code               (delcodeval v);
61extern delcodeval  tex_no_del_code                (void);
62
63extern mathcodeval tex_scan_mathchar              (int extcode);
64extern mathdictval tex_scan_mathdict              (void);
65extern mathcodeval tex_scan_delimiter_as_mathchar (int extcode);
66extern mathcodeval tex_mathchar_from_integer      (int value, int extcode);
67extern mathcodeval tex_mathchar_from_spec         (int value);
68
69extern void        tex_show_mathcode_value        (mathcodeval d, int extcode);
70extern void        tex_unsave_math_codes          (int grouplevel);
71extern void        tex_initialize_math_codes      (void);
72extern void        tex_dump_math_codes            (dumpstream f);
73extern void        tex_undump_math_codes          (dumpstream f);
74
75extern void        tex_free_math_codes            (void);
76
77extern mathdictval tex_no_dict_code               (void);
78
79# endif
80