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
//! Ported subsystems — every submodule here is a faithful 1:1 port of
//! a corresponding upstream zsh C source file under `src/zsh/Src/`.
//!
//! Companion / opposite of `src/extensions/`. See `docs/PORT.md` for the
//! full ruleset. `tests/port_purity.rs` enforces:
//! - Every `.rs` file under this directory has a matching `.c` file
//! under `src/zsh/Src/` (byte-for-byte identical stem).
//! - Every top-level `fn` carries a doc comment matching the PORT.md
//! template: `/// Port of NAME() from Src/STEM.c:NNNN`.
//! - No file may carry the `WARNING: THIS IS ADHOC IMPLEMENTATION`
//! marker.
//!
//! The crate root re-exports every submodule (`pub use ported::*;` in
//! `src/lib.rs`) so historical call sites that reference
//! `crate::exec::`, `crate::subst::`, `crate::zle::`, etc. continue
//! to resolve unchanged.
// Most of `Src/exec.c` is realised by the fusevm wordcode VM at the
// crate root (`src/vm_helper`) rather than in `src/ported/`. The
// genuinely faithful free-function ports from `Src/exec.c` — `gethere`,
// `getoutput`, `loadautofn`, `getfpfunc`, plus the file-static globals
// `trap_state` / `trap_return` / `forklevel` — live in `src/ported/exec.rs`.
// `crate::ported::vm_helper` stays as an alias for the runtime state
// struct + impl methods that hang off it.
pub use cratevm_helper;