mathtex-portable-engine-generated 0.2.0

Machine generated portable TeX engine core for mathtex, translated from the TeX, eTeX and XeTeX sources
Documentation
//! XeTeX engine functions, group `r`.
//! Generated by `cargo run -p mathtex-web2c-import --bin patch_engine`.

#![allow(dead_code, non_camel_case_types, non_snake_case, unused_assignments, unused_mut, unused_variables)]

use crate::runtime::*;

impl<'resources> PortableTexEngine<'resources> {

    pub(crate) unsafe fn reportillegalcase(&mut self) -> EngineFlow<()> {
        (&mut *(self as *mut PortableTexEngine<'_>)).youcant();
        self.state.helpptr = 4 as eightbits;
        self.state.helpline[3 as i32 as usize] = 66455 as i64 as strnumber;
        self.state.helpline[2 as i32 as usize] = 66456 as i64 as strnumber;
        self.state.helpline[1 as i32 as usize] = 66457 as i64 as strnumber;
        self.state.helpline[0 as i32 as usize] = 66458 as i64 as strnumber;
        (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
        Ok(())
    }
    pub(crate) unsafe fn resumeafterdisplay(&mut self) -> EngineFlow<()> {
        let eqtb = self.state.zeqtb.as_mut_ptr();
        if self.state.curgroup as i32 != 15 as i32 {
            match (&mut *(self as *mut PortableTexEngine<'_>))
                .zconfusion(66607 as i64 as strnumber)?
            {};
        }
        (&mut *(self as *mut PortableTexEngine<'_>)).unsave()?;
        self.state.curlist.pgfield = (self.state.curlist.pgfield as i32 + 3 as i32)
            as integer;
        (&mut *(self as *mut PortableTexEngine<'_>)).pushnest()?;
        self.state.curlist.modefield = 105 as i16;
        self.state.curlist.auxfield.hh.v.LH = 1000 as i32 as halfword;
        if (*eqtb.offset(7892314 as i64 as isize)).u.CINT <= 0 as i32 {
            self.state.curlang = 0 as eightbits;
        } else if (*eqtb.offset(7892314 as i64 as isize)).u.CINT > 255 as i32 {
            self.state.curlang = 0 as eightbits;
        } else {
            self.state.curlang = (*eqtb.offset(7892314 as i64 as isize)).u.CINT
                as eightbits;
        }
        self.state.curlist.auxfield.hh.v.RH = self.state.curlang as halfword;
        self.state.curlist.pgfield = (((&mut *(self as *mut PortableTexEngine<'_>))
            .znormmin((*eqtb.offset(7892315 as i64 as isize)).u.CINT) as i32 * 64 as i32
            + (&mut *(self as *mut PortableTexEngine<'_>))
                .znormmin((*eqtb.offset(7892316 as i64 as isize)).u.CINT) as i32) as i64
            * 65536 as i64 + self.state.curlang as i64) as integer;
        (&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
        if self.state.curcmd as i32 != 10 as i32 {
            (&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
        }
        Ok(
            if self.state.nestptr == 1 as i32 {
                Self::boundary_build_page(self as *mut PortableTexEngine<'_>);
            },
        )
    }
    pub(crate) unsafe fn runaway(&mut self) {
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let mut p: halfword = 0;
        if self.state.scannerstatus as i32 > 1 as i32 {
            match self.state.scannerstatus as i32 {
                2 => {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintnl(65896 as i64 as strnumber);
                    p = self.state.defref;
                }
                3 => {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintnl(65897 as i64 as strnumber);
                    p = (self.state.memtop as i32 - 3 as i32) as halfword;
                }
                4 => {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintnl(65898 as i64 as strnumber);
                    p = (self.state.memtop as i32 - 4 as i32) as halfword;
                }
                5 => {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintnl(65899 as i64 as strnumber);
                    p = self.state.defref;
                }
                _ => {}
            }
            (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(63 as i32);
            (&mut *(self as *mut PortableTexEngine<'_>)).println();
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zshowtokenlist(
                    (*mem.offset(p as isize)).hh.v.RH,
                    -(268435455 as i64) as integer,
                    self.state.errorline as i32 - 10 as i32,
                );
        }
    }
}