Skip to main content

mathtex_portable_engine_generated/
profiles.rs

1//! Generated engine import-profile metadata.
2//! Generated by `cargo run -p mathtex-web2c-import --bin patch_engine`.
3//!
4//! Data form of the import-profile specs: which source chain and pool produced
5//! each profile, its capability set, and the host boundaries the importer is
6//! permitted to cross. The runtime capability booleans live on
7//! [`crate::runtime::EngineProfile`]; these constants record import provenance.
8
9#![allow(dead_code)]
10
11/// Engine kind an import profile targets.
12#[derive(Clone, Copy, Debug, PartialEq, Eq)]
13pub enum ImportProfileKind {
14    Tex,
15    Etex,
16    Xetex,
17}
18
19/// Capabilities a profile turns on over the shared TeX core.
20#[derive(Clone, Copy, Debug, PartialEq, Eq)]
21pub struct ImportCapabilities {
22    pub etex: bool,
23    pub unicode_scalars: bool,
24    pub unicode_math: bool,
25    pub native_fonts: bool,
26    pub output: bool,
27}
28
29/// Inclusive runtime `mem` array bounds for a profile.
30#[derive(Clone, Copy, Debug, PartialEq, Eq)]
31pub struct ImportStateBounds {
32    pub mem_min: i32,
33    pub mem_top: i32,
34}
35
36/// One formalized engine import profile, as generated import metadata.
37#[derive(Clone, Copy, Debug, PartialEq, Eq)]
38pub struct ImportProfile {
39    /// Stable profile id (`"tex"` / `"etex"` / `"xetex"`).
40    pub id: &'static str,
41    /// Engine kind this profile imports.
42    pub kind: ImportProfileKind,
43    /// Ordered source chain: shared WEB source first, then change files.
44    pub source_chain: &'static [&'static str],
45    /// String pool file linked for this profile.
46    pub pool_file: &'static str,
47    /// Inclusive `mem` array bounds used at runtime.
48    pub state_bounds: ImportStateBounds,
49    /// Capabilities enabled over the shared core.
50    pub capabilities: ImportCapabilities,
51    /// Host-boundary identifiers this profile is permitted to cross.
52    pub allowed_boundaries: &'static [&'static str],
53}
54
55/// All formalized engine import profiles, in `tex`/`etex`/`xetex` order.
56pub static IMPORT_PROFILES: &[ImportProfile] = &[
57    ImportProfile {
58        id: "tex",
59        kind: ImportProfileKind::Tex,
60        source_chain: &[
61            "tex.web",
62            "tex.ch",
63            "tex-binpool.ch",
64        ],
65        pool_file: "generated/web2c/tex/tex.pool",
66        state_bounds: ImportStateBounds { mem_min: 0, mem_top: 19999999 },
67        capabilities: ImportCapabilities { etex: false, unicode_scalars: false, unicode_math: false, native_fonts: false, output: true },
68        allowed_boundaries: &[
69        ],
70    },
71    ImportProfile {
72        id: "etex",
73        kind: ImportProfileKind::Etex,
74        source_chain: &[
75            "tex.web",
76            "tex.ch",
77            "tex-binpool.ch",
78        ],
79        pool_file: "generated/web2c/tex/tex.pool",
80        state_bounds: ImportStateBounds { mem_min: 0, mem_top: 19999999 },
81        capabilities: ImportCapabilities { etex: true, unicode_scalars: false, unicode_math: false, native_fonts: false, output: true },
82        allowed_boundaries: &[
83        ],
84    },
85    ImportProfile {
86        id: "xetex",
87        kind: ImportProfileKind::Xetex,
88        source_chain: &[
89            "tex.web",
90            "tex.ch",
91            "tex-binpool.ch",
92            "xetexdir/tex.ch0",
93            "tracingstacklevels.ch",
94            "partoken-102.ch",
95            "partoken.ch",
96            "locnull-optimize.ch",
97            "unbalanced-braces.ch",
98            "showstream.ch",
99            "xetexdir/xetex.ch",
100            "xetexdir/char-warning-xetex.ch",
101        ],
102        pool_file: "generated/web2c/xetex/xetex.pool",
103        state_bounds: ImportStateBounds { mem_min: 0, mem_top: 19999999 },
104        capabilities: ImportCapabilities { etex: true, unicode_scalars: true, unicode_math: true, native_fonts: false, output: true },
105        allowed_boundaries: &[
106            "CFDictionaryRef",
107            "GlyphAssembly",
108            "UFILE",
109            "aatfontget",
110            "aatfontget1",
111            "aatfontget2",
112            "aatfontgetnamed",
113            "aatfontgetnamed1",
114            "aatprintfontname",
115            "applymapping",
116            "applytfmfontmapping",
117            "checkfortfmfontmapping",
118            "countpdffilepages",
119            "free",
120            "free_ot_assembly",
121            "fputs",
122            "get_native_glyph_italic_correction",
123            "get_native_italic_correction",
124            "getcreationdate",
125            "getfiledump",
126            "getfilemoddate",
127            "getfilesize",
128            "getfontcharrange",
129            "getglyphbounds",
130            "getmd5sum",
131            "getnativecharheightdepth",
132            "getnativecharht",
133            "getnativecharic",
134            "getnativecharsidebearings",
135            "getnativecharwd",
136            "grfontgetnamed",
137            "grfontgetnamed1",
138            "grprintfontname",
139            "initstarttime",
140            "loadtfmfontmapping",
141            "otfontget",
142            "otfontget1",
143            "otfontget2",
144            "otfontget3",
145            "printglyphname",
146            "set_cp_code",
147            "setinputfileencoding",
148            "u_close_file_or_pipe",
149            "usingGraphite",
150            "xmalloc",
151            "xrealloc",
152            "zbuildopentypeassembly",
153            "znotaatfonterror",
154            "znotaatgrfonterror",
155        ],
156    },
157];