# Polyglot Codebase Knowledge Graph

> Generated offline by **readmenator**. 589 files, 13027 symbols, 2248 imports. Supports C, C++, Python, Go, Rust, JS/TS, Java, C#, Shell, PHP, Dart, GDScript, Nim, ASM, Ruby, Swift, Kotlin, Scala, Lua, Elixir.
> No LLMs. No tokens. Pure static analysis. See more [here](https://github.com/grisuno/ReadMenator)

**Start here:** Statistics Dashboard for scope, God Nodes for blast radius, Architecture Reference for per-file API. Agents: prefer `readmenator-agent/INDEX.md` + `SYMBOLS.md`.

**Wiki:** prefer `readmenator-wiki/index.md` for progressive disclosure: one synthesis page per community, `connections.json` with EXTRACTED vs INFERRED confidence, `queries.md` log, `REPORT.md` audit.

**Confidence:** EXTRACTED = parsed from source, INFERRED = heuristic bridge, AMBIGUOUS = reported, never hidden. See `readmenator-wiki/REPORT.md`.

**Total Files Parsed:** 589 | **Total Symbols Extracted:** 13027 | **Total Imports:** 2248
 | **Resolved Imports:** 1394

<!-- ranking_model: v1.0 | weights: {ppr:0.45,auth:0.2,test:0.15,doc:0.1,fresh:0.1} | alpha:0.85 | commit:cd87980 | date:2026-07-18 -->


## Table of Contents

1. [Statistics Dashboard](#statistics-dashboard)
2. [Architectural Layers](#architectural-layers)
3. [Architecture Overview](#architecture-overview)
4. [Execution Flows](#execution-flows)
5. [Ranked Context](#ranked-context)
6. [God Nodes](#god-nodes)
7. [Community Analysis](#community-analysis)
8. [Surprising Connections](#surprising-connections)
9. [Suggested Questions](#suggested-questions)
10. [Force-Graph Explorer](#force-graph-explorer)
11. [Corpus Analytics](#corpus-analytics)
12. [Taint Propagation Map](#taint-propagation-map)
13. [Hotspot Analysis](#hotspot-analysis)
14. [Dependency Cycles](#dependency-cycles)
15. [Change Impact Analysis](#change-impact-analysis)
16. [Architecture Violations](#architecture-violations)
17. [Suggested Linting Rules](#suggested-linting-rules)
18. [Dataflow Analysis](#dataflow-analysis)
19. [Concept Graph](#concept-graph)
20. [Orphans](#orphans)
21. [Query Recipes](#query-recipes)
22. [Structural Knowledge Map](#structural-knowledge-map)
23. [UML Class Diagram](#uml-class-diagram)
24. [Code Property Graph](#code-property-graph)
25. [Architecture Reference](#architecture-reference)
    - [C (288 files)](#c-288-files)
    - [H (196 files)](#h-196-files)
    - [LUA (1 files)](#lua-1-files)
    - [PY (67 files)](#py-67-files)
    - [S (20 files)](#s-20-files)
    - [SH (17 files)](#sh-17-files)

---

## Statistics Dashboard

| Metric | Value |
|--------|-------|
| Total Files | 589 |
| Total Symbols | 13027 |
| Total Imports | 2248 |
| Call Edges | 6007 |
| Inheritance Edges | 27 |
| Languages | 7 |
| Avg Symbols/File | 22.1 |
| Avg Imports/File | 3.8 |
| Resolved Imports | 1394 |

### Top Files by Import Count (Fan-Out)

| File | Imports | Symbols | Language |
|------|---------|---------|----------|
| `d_main.c` | 42 | 29 | c |
| `g_game.c` | 36 | 54 | c |
| `shell.c` | 33 | 98 | c |
| `syscalls.c` | 33 | 263 | c |
| `m_menu.c` | 25 | 68 | c |
| `i_input.c` | 24 | 5 | c |
| `st_stuff.c` | 24 | 137 | c |
| `lxabi.c` | 22 | 61 | c |
| `i_system.c` | 21 | 21 | c |
| `sched.c` | 20 | 137 | c |

### Top Files by Imported-By Count (Fan-In)

| File | Imported By | Symbols | Language |
|------|-------------|---------|----------|
| `minios_abi.h` | 3 | 156 | h |
| `xhci.c` | 3 | 209 | c |
| `fsimg.c` | 2 | 5 | c |
| `file_assoc.h` | 2 | 17 | h |
| `ext4.c` | 1 | 38 | c |
| `fat32.c` | 1 | 31 | c |
| `ldso_parse.c` | 1 | 20 | c |
| `minios_png.h` | 1 | 21 | h |
| `pcache.c` | 1 | 16 | c |
| `usbblk.c` | 1 | 44 | c |

---

## Architectural Layers

Auto-detected from path patterns, naming conventions, and imported frameworks.

| Layer | Files |
|-------|-------|
| utility | 458 |
| testing | 82 |
| infrastructure | 39 |
| presentation | 6 |
| data_access | 4 |

### utility

- `ap_entry.S` (S, 9 symbols)
- `stage1.S` (S, 11 symbols)
- `stage2.S` (S, 40 symbols)
- `ctx_sw.S` (S, 9 symbols)
- `syscall_entry.S` (S, 4 symbols)
- `tlb_nmi.S` (S, 1 symbols)
- `bootloader.c` (c, 2 symbols)
- `ext4.c` (c, 38 symbols)
- `fat32.c` (c, 31 symbols)
- `fsimg.c` (c, 5 symbols)
- `kfile.c` (c, 31 symbols)
- `minifs.c` (c, 67 symbols)
- `pcache.c` (c, 16 symbols)
- `ramdisk.c` (c, 25 symbols)
- `vfs.c` (c, 44 symbols)
- *... and 443 more*

### testing

- `isr_stubs.S` (S, 24 symbols)
- `uefi_stub.c` (c, 50 symbols)
- `ap_stub.h` (h, 0 symbols)
- `test_minios_mcp.py` (py, 107 symbols)
- `p_spec.c` (c, 31 symbols)
- `p_spec.h` (h, 94 symbols)
- `SDL.h` (h, 10 symbols)
- `test.c` (c, 2 symbols)
- `test.lua` (lua, 20 symbols)
- `test.py` (py, 20 symbols)
- `test_all.sh` (sh, 0 symbols)
- `test_py.py` (py, 5 symbols)
- `host_aes.sh` (sh, 3 symbols)
- `host_codecs.sh` (sh, 5 symbols)
- `kernel.h` (h, 15 symbols)
- *... and 67 more*

### infrastructure

- `block.c` (c, 19 symbols)
- `driver.c` (c, 8 symbols)
- `ide.c` (c, 19 symbols)
- `kbd.c` (c, 35 symbols)
- `mouse.c` (c, 7 symbols)
- `nvme.c` (c, 50 symbols)
- `pcm2.c` (c, 43 symbols)
- `pcspk.c` (c, 18 symbols)
- `rtc.c` (c, 25 symbols)
- `sb16.c` (c, 64 symbols)
- `usbblk.c` (c, 44 symbols)
- `usbhid.c` (c, 26 symbols)
- `virtio_blk.c` (c, 39 symbols)
- `virtio_net.c` (c, 44 symbols)
- `xhci.c` (c, 209 symbols)
- *... and 24 more*

### presentation

- `httpd.h` (h, 10 symbols)
- `wm_layout.h` (h, 16 symbols)
- `wm_render.h` (h, 5 symbols)
- `http.s` (s, 3 symbols)
- `http.c` (c, 13 symbols)
- `wm_layout_sync.py` (py, 17 symbols)

### data_access

- `net_query.h` (h, 12 symbols)
- `r_data.c` (c, 17 symbols)
- `r_data.h` (h, 7 symbols)
- `gen_zip_fixtures.py` (py, 2 symbols)

---

## Architecture Overview

17 components stacked in 4 dependency tiers (weighted Eades-Lin-Smyth ordering: arrows point from dependent to dependency, top to bottom). Labels are import counts, thick arrows the top quartile; 4 transitively implied edges are omitted. Dashed red arrows are upward dependencies: the smallest set of imports that closes every cycle and breaks the layering. Cyan components hold entry points. Interactive version: `readmenator-apidocs/index.html#/flows`.

Upward dependencies to fix first: `progs/doomgeneric: p_spec` -> `progs/doomgeneric: d_englsh` (63 imports); `progs/doomgeneric: net_defs` -> `progs/doomgeneric: d_englsh` (12 imports); `progs/src` -> `progs/doomgeneric: d_englsh` (3 imports); `headers: kernel` -> `tools: tls_crypto` (2 imports); `headers: kernel` -> `headers: vga_fb` (2 imports); `tools: tls_crypto` -> `progs/doomgeneric: d_englsh` (2 imports); `progs/doomgeneric: net_defs` -> `progs/doomgeneric: p_spec` (2 imports); `progs/src` -> `headers: kernel` (1 imports); `progs/src` -> `progs/doomgeneric: p_spec` (1 imports)

```mermaid
flowchart TB
    classDef cycle fill:#1f1530,stroke:#f472b6,color:#fce7f3,stroke-width:2px;
    classDef default fill:#111827,stroke:#38bdf8,color:#e5e7eb;
    subgraph lane_0["Tier 1 - entry / orchestration"]
        direction LR
        n_c1["progs/doomgeneric: d_englsh<br/>98 files, 2045 symbols<br/>Core / utility"]:::cycle
        n_c4["tools: tls_crypto<br/>30 files, 583 symbols<br/>Core / utility"]:::cycle
        n_c5["headers: vga_fb<br/>15 files, 384 symbols<br/>Core / utility"]:::cycle
        n_d_tools["tools<br/>35 files, 233 symbols<br/>Core / utility"]:::default
        n_d_progs["progs<br/>50 files, 813 symbols<br/>Core / utility"]:::default
        n_d_mcp["mcp<br/>2 files, 1 symbols<br/>Core / utility"]:::default
        n_d_kernel["kernel<br/>7 files, 83 symbols<br/>Core / utility"]:::default
        n_d_fs["fs<br/>2 files, 35 symbols<br/>Core / utility"]:::default
        n_d_arch["arch<br/>2 files, 10 symbols<br/>Core / utility"]:::default
        n_d__root_["(root)<br/>1 files, 2 symbols<br/>Core / utility"]:::default
        n_c9["tools: doom_pwad<br/>1 files, 25 symbols<br/>Core / utility"]:::default
    end
    subgraph lane_1["Tier 2"]
        direction LR
        n_c0["headers: kernel<br/>113 files, 4062 symbols<br/>Core / utility"]:::cycle
        n_c3["progs/doomgeneric: p_spec<br/>67 files, 1027 symbols<br/>Core / utility"]:::cycle
    end
    subgraph lane_2["Tier 3"]
        direction LR
        n_c6["progs/doomgeneric: net_defs<br/>13 files, 140 symbols<br/>Core / utility"]:::cycle
        n_c8["headers: tick<br/>2 files, 27 symbols<br/>Core / utility"]:::default
        n_c7["headers: batch<br/>2 files, 13 symbols<br/>Core / utility"]:::default
    end
    subgraph lane_3["Tier 4 - foundation"]
        direction LR
        n_c2["progs/src<br/>67 files, 2550 symbols<br/>Core / utility"]:::cycle
    end
    n_c0 ==>|"9"| n_c2
    n_c0 -->|"1"| n_c7
    n_c0 -->|"1"| n_c8
    n_c1 ==>|"77"| n_c3
    n_c3 -->|"4"| n_c6
    n_c4 -->|"3"| n_c0
    n_c5 ==>|"8"| n_c0
    n_c6 -->|"2"| n_c2
    n_c4 <-.-|"2 upward"| n_c0
    n_c5 <-.-|"2 upward"| n_c0
    n_c0 <-.-|"1 upward"| n_c2
    n_c1 <-.-|"3 upward"| n_c2
    n_c3 <-.-|"1 upward"| n_c2
    n_c1 <-.-|"63 upward"| n_c3
    n_c1 <-.-|"2 upward"| n_c4
    n_c1 <-.-|"12 upward"| n_c6
    n_c3 <-.-|"2 upward"| n_c6
    linkStyle 8,9,10,11,12,13,14,15,16 stroke:#f87171,stroke-width:2px;
    n_c1 ~~~ n_c0
    n_c0 ~~~ n_c6
    n_c6 ~~~ n_c2
```

---

## Execution Flows

Entry points are scored from `__main__` guards, `main` functions, entry-style names and files, and call-graph sources. Each flow walks resolved calls in call-site order (depth <= 4, <= 40 steps); numbers give the call order, dashed arrows revisit an already expanded callee, red arrows are recursion. Interactive version with zoom and per-node docs: `readmenator-apidocs/index.html#/flows`.

### `bootloader.main`

`bootloader.c:21`, score 11: `main` in a compiled-language file; entry-style name `main`.

Call tree:

```mermaid
flowchart LR
    classDef entry fill:#0e7490,stroke:#22d3ee,color:#ecfeff,stroke-width:2px;
    n_bootloader_c__main["bootloader.main<br/>bootloader.c:21"]:::entry
    n_bootloader_c__main -.->|"recursion"| n_bootloader_c__main
    linkStyle 0 stroke:#f87171,stroke-width:2px;
```

### `doomedit.main`

`progs/doomedit/doomedit.c:2246`, score 11: `main` in a compiled-language file; entry-style name `main`.

Call tree:

```mermaid
flowchart LR
    classDef default fill:#111827,stroke:#38bdf8,color:#e5e7eb;
    classDef entry fill:#0e7490,stroke:#22d3ee,color:#ecfeff,stroke-width:2px;
    classDef external fill:#1a1530,stroke:#a78bfa,color:#ede9fe;
    n_progs_doomedit_doomedit_c__main["doomedit.main<br/>doomedit.c:2246"]:::entry
    n_progs_doomedit_doomedit_c__dmap_selftest["doomedit.dmap_selftest<br/>/** Headless demo room shared by --demo and t...<br/>doomedit.c:2122"]:::default
    n_progs_nuklear_nuklear_minios_h__nk_minios_font["nuklear_minios.nk_minios_font<br/>Hybrid palette: indices 0-14 are the desktop...<br/>nuklear_minios.h:63"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_sys_vga_mode["nuklear_minios.nk_sys_vga_mode<br/>nuklear_minios.h:45"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_sys_kbd_raw["nuklear_minios.nk_sys_kbd_raw<br/>nuklear_minios.h:44"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_build_palette["nuklear_minios.nk_build_palette<br/>Hybrid palette: indices 0-14 are the desktop...<br/>nuklear_minios.h:57"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_sys_palette["nuklear_minios.nk_sys_palette<br/>nuklear_minios.h:43"]:::external
    n_progs_doomedit_doomedit_c__dmap_new["doomedit.dmap_new<br/>case DMAP_RSUIT: case DMAP_CMAP: case DMAP_LA...<br/>doomedit.c:639"]:::default
    n_progs_doomedit_doomedit_c__dmap_push_history["doomedit.dmap_push_history<br/>doomedit.c:272"]:::default
    n_progs_nuklear_nuklear_minios_h__nk_rasterize["nuklear_minios.nk_rasterize<br/>Hybrid palette: indices 0-14 are the desktop...<br/>nuklear_minios.h:66"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_rgb_available["nuklear_minios.nk_rgb_available<br/>RGB companion buffer (R,G,B byte order, NK_W...<br/>nuklear_minios.h:33"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_sys_nk_frame["nuklear_minios.nk_sys_nk_frame<br/>nuklear_minios.h:52"]:::external
    n_progs_nuklear_nuklear_minios_h__nk_sys_fb_info["nuklear_minios.nk_sys_fb_info<br/>nuklear_minios.h:46"]:::external
    n_progs_doomedit_doomedit_c__dmap_demo_room["doomedit.dmap_demo_room<br/>nk_set_window_origin(origin[0], origin[1])#59; n...<br/>doomedit.c:2110"]:::default
    n_progs_doomedit_doomedit_c__dmap_build_wad["doomedit.dmap_build_wad<br/>Compile the grid into a vanilla multi-sector...<br/>doomedit.c:1343"]:::default
    n_progs_doomedit_doomedit_c__dmap_validate["doomedit.dmap_validate<br/>dmap_sec_floor[nsec] = DMAP_FLOOR_H#59; dmap_sec...<br/>doomedit.c:1244"]:::default
    n_progs_doomedit_doomedit_c__dmap_walkable["doomedit.dmap_walkable<br/>__asm__ volatile(#quot;syscall#quot; : #quot;=a#quot;(ret) : #quot;a#quot;(...<br/>doomedit.c:577"]:::default
    n_progs_doomedit_doomedit_c__dmap_is_wall["doomedit.dmap_is_wall<br/>: #quot;rcx#quot;, #quot;r11#quot;, #quot;memory#quot;)#59; return ret#59; } /**...<br/>doomedit.c:570"]:::default
    n_progs_doomedit_doomedit_c__dmap_label_regions["doomedit.dmap_label_regions<br/>Sector table backing the multi-sector exporter.<br/>doomedit.c:1163"]:::default
    n_progs_doomedit_doomedit_c__dmap_thing_type["doomedit.dmap_thing_type<br/>Thing type ids from the engine mobjinfo table...<br/>doomedit.c:165"]:::default
    n_progs_doomedit_doomedit_c__dmap_w16["doomedit.dmap_w16<br/>doomedit.c:1318"]:::default
    n_progs_doomedit_doomedit_c__dmap_wtex["doomedit.dmap_wtex<br/>doomedit.c:1326"]:::default
    n_progs_doomedit_doomedit_c__dmap_w8["doomedit.dmap_w8<br/>doomedit.c:1317"]:::default
    n_progs_doomedit_doomedit_c__dmap_seg_angle["doomedit.dmap_seg_angle<br/>dmap_wp++ = (unsigned char)(v & 0xFF)#59; dmap_w...<br/>doomedit.c:1333"]:::default
    n_progs_doomedit_doomedit_c__dmap_w32["doomedit.dmap_w32<br/>doomedit.c:1322"]:::default
    n_progs_doomedit_doomedit_c__main -.->|"recursion"| n_progs_doomedit_doomedit_c__main
    n_progs_doomedit_doomedit_c__main -->|"1"| n_progs_doomedit_doomedit_c__dmap_selftest
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"1"| n_progs_nuklear_nuklear_minios_h__nk_minios_font
    n_progs_nuklear_nuklear_minios_h__nk_minios_font -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_minios_font
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"2"| n_progs_nuklear_nuklear_minios_h__nk_sys_vga_mode
    n_progs_nuklear_nuklear_minios_h__nk_sys_vga_mode -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_sys_vga_mode
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"3"| n_progs_nuklear_nuklear_minios_h__nk_sys_kbd_raw
    n_progs_nuklear_nuklear_minios_h__nk_sys_kbd_raw -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_sys_kbd_raw
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"4"| n_progs_nuklear_nuklear_minios_h__nk_build_palette
    n_progs_nuklear_nuklear_minios_h__nk_build_palette -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_build_palette
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"5"| n_progs_nuklear_nuklear_minios_h__nk_sys_palette
    n_progs_nuklear_nuklear_minios_h__nk_sys_palette -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_sys_palette
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"6"| n_progs_doomedit_doomedit_c__dmap_new
    n_progs_doomedit_doomedit_c__dmap_new -->|"1"| n_progs_doomedit_doomedit_c__dmap_push_history
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"7"| n_progs_nuklear_nuklear_minios_h__nk_rasterize
    n_progs_nuklear_nuklear_minios_h__nk_rasterize -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_rasterize
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"8"| n_progs_nuklear_nuklear_minios_h__nk_rgb_available
    n_progs_nuklear_nuklear_minios_h__nk_rgb_available -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_rgb_available
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"9"| n_progs_nuklear_nuklear_minios_h__nk_sys_nk_frame
    n_progs_nuklear_nuklear_minios_h__nk_sys_nk_frame -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_sys_nk_frame
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"10"| n_progs_nuklear_nuklear_minios_h__nk_sys_fb_info
    n_progs_nuklear_nuklear_minios_h__nk_sys_fb_info -.->|"recursion"| n_progs_nuklear_nuklear_minios_h__nk_sys_fb_info
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"11"| n_progs_doomedit_doomedit_c__dmap_demo_room
    n_progs_doomedit_doomedit_c__dmap_demo_room -.-> n_progs_doomedit_doomedit_c__dmap_new
    n_progs_doomedit_doomedit_c__dmap_selftest -->|"12"| n_progs_doomedit_doomedit_c__dmap_build_wad
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"1"| n_progs_doomedit_doomedit_c__dmap_validate
    n_progs_doomedit_doomedit_c__dmap_validate -->|"1"| n_progs_doomedit_doomedit_c__dmap_walkable
    n_progs_doomedit_doomedit_c__dmap_validate -->|"2"| n_progs_doomedit_doomedit_c__dmap_is_wall
    n_progs_doomedit_doomedit_c__dmap_validate -->|"3"| n_progs_doomedit_doomedit_c__dmap_label_regions
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"2"| n_progs_doomedit_doomedit_c__dmap_thing_type
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"3"| n_progs_doomedit_doomedit_c__dmap_is_wall
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"4"| n_progs_doomedit_doomedit_c__dmap_walkable
    n_progs_doomedit_doomedit_c__dmap_walkable -.-> n_progs_doomedit_doomedit_c__dmap_thing_type
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"5"| n_progs_doomedit_doomedit_c__dmap_w16
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"6"| n_progs_doomedit_doomedit_c__dmap_wtex
    n_progs_doomedit_doomedit_c__dmap_wtex -->|"1"| n_progs_doomedit_doomedit_c__dmap_w8
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"7"| n_progs_doomedit_doomedit_c__dmap_seg_angle
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"8"| n_progs_doomedit_doomedit_c__dmap_w8
    n_progs_doomedit_doomedit_c__dmap_build_wad -->|"9"| n_progs_doomedit_doomedit_c__dmap_w32
    n_progs_doomedit_doomedit_c__dmap_w32 -.-> n_progs_doomedit_doomedit_c__dmap_w16
    linkStyle 0,3,5,7,9,11,15,17,19,21 stroke:#f87171,stroke-width:2px;
```

Cross-file sequence:

```mermaid
sequenceDiagram
    autonumber
    participant p_progs_doomedit_doomedit_c as doomedit.c
    participant p_progs_nuklear_nuklear_minios_h as nuklear_minios.h
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_minios_font()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_sys_vga_mode()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_sys_kbd_raw()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_build_palette()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_sys_palette()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_rasterize()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_rgb_available()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_sys_nk_frame()
    p_progs_doomedit_doomedit_c->>p_progs_nuklear_nuklear_minios_h: nk_sys_fb_info()
```

### `i_main.main`

`progs/doomgeneric/i_main.c:40`, score 11: `main` in a compiled-language file; entry-style name `main`.

Call tree:

```mermaid
flowchart LR
    classDef default fill:#111827,stroke:#38bdf8,color:#e5e7eb;
    classDef entry fill:#0e7490,stroke:#22d3ee,color:#ecfeff,stroke-width:2px;
    n_progs_doomgeneric_i_main_c__main["i_main.main<br/>i_main.c:40"]:::entry
    n_progs_doomgeneric_i_main_c__M_FindResponseFile["i_main.M_FindResponseFile<br/>i_main.c:35"]:::default
    n_progs_doomgeneric_i_main_c__dg_Create["i_main.dg_Create<br/>i_main.c:37"]:::default
    n_progs_doomgeneric_i_main_c__D_DoomMain["i_main.D_DoomMain<br/>i_main.c:33"]:::default
    n_progs_doomgeneric_i_main_c__main -.->|"recursion"| n_progs_doomgeneric_i_main_c__main
    n_progs_doomgeneric_i_main_c__main -->|"1"| n_progs_doomgeneric_i_main_c__M_FindResponseFile
    n_progs_doomgeneric_i_main_c__M_FindResponseFile -.->|"recursion"| n_progs_doomgeneric_i_main_c__M_FindResponseFile
    n_progs_doomgeneric_i_main_c__main -->|"2"| n_progs_doomgeneric_i_main_c__dg_Create
    n_progs_doomgeneric_i_main_c__dg_Create -.->|"recursion"| n_progs_doomgeneric_i_main_c__dg_Create
    n_progs_doomgeneric_i_main_c__main -->|"3"| n_progs_doomgeneric_i_main_c__D_DoomMain
    n_progs_doomgeneric_i_main_c__D_DoomMain -.->|"recursion"| n_progs_doomgeneric_i_main_c__D_DoomMain
    linkStyle 0,2,4,6 stroke:#f87171,stroke-width:2px;
```

---

## Ranked Context

Files ranked by composite score for the current query context. The ranking combines Personalized PageRank (query relevance), global authority, test coverage, documentation coverage, and code freshness. Model: v1.0.

| Rank | File | Composite | PPR | Authority | Test | Doc |
|------|------|-----------|-----|-----------|------|-----|
| 1 | `batch.c` | 0.2002 | 0.0000 | 0.0011 | 0.00 | 2.00 |
| 2 | `r_sky.c` | 0.2002 | 0.0000 | 0.0011 | 0.00 | 2.00 |
| 3 | `mutate_mcp.sh` | 0.2000 | 0.0000 | 0.0000 | 0.00 | 2.00 |
| 4 | `media_unavailable.c` | 0.1502 | 0.0000 | 0.0011 | 0.00 | 1.50 |
| 5 | `mkvocab.py` | 0.1500 | 0.0000 | 0.0000 | 0.00 | 1.50 |
| 6 | `abi.c` | 0.1335 | 0.0000 | 0.0011 | 0.00 | 1.33 |
| 7 | `check_fork_stubs.py` | 0.1250 | 0.0000 | 0.0000 | 0.00 | 1.25 |
| 8 | `test_call_align.py` | 0.1250 | 0.0000 | 0.0000 | 0.00 | 1.25 |
| 9 | `clip_bridge.py` | 0.1200 | 0.0000 | 0.0000 | 0.00 | 1.20 |
| 10 | `check_mutant_anchors.py` | 0.1167 | 0.0000 | 0.0000 | 0.00 | 1.17 |

**Query anchors:** progs/nuklear/nuklear_minios.c, progs/file/file.c, progs/paint/paint.c, progs/pokemon/platform_minios.c

---

## God Nodes

Most architecturally central files ranked by combined import/export degree and symbol richness.

| File | Score | Connections | PageRank |
|------|-------|-------------|----------|
| `string.c` | 181.3 | | 0.0000 |
| `doomtype.h` | 101.4 | | 0.0000 |
| `doomdef.h` | 90.9 | | 0.0000 |
| `syscalls.c` | 90.3 | | 0.0000 |
| `doomstat.h` | 84.8 | | 0.0000 |
| `z_zone.h` | 81.3 | | 0.0000 |
| `i_system.h` | 81.2 | | 0.0000 |
| `d_main.c` | 80.9 | | 0.0000 |
| `minios_abi.h` | 79.6 | | 0.0000 |
| `sched.h` | 75.8 | | 0.0000 |

---

## Community Analysis

Files grouped by import-based community detection. Cohesion measures how tightly connected each community is internally.

### headers: kernel (Cohesion: 0.90)

**137 files** in this community:

- `ap_entry.S` (S, 9 symbols)
- `stage1.S` (S, 11 symbols)
- `stage2.S` (S, 40 symbols)
- `syscall_entry.S` (S, 4 symbols)
- `block.c` (c, 19 symbols)
- `driver.c` (c, 8 symbols)
- `ide.c` (c, 19 symbols)
- `kbd.c` (c, 35 symbols)
- `mouse.c` (c, 7 symbols)
- `nvme.c` (c, 50 symbols)
- `pcm2.c` (c, 43 symbols)
- `pcspk.c` (c, 18 symbols)
- `rtc.c` (c, 25 symbols)
- `sb16.c` (c, 64 symbols)
- `usbblk.c` (c, 44 symbols)
- `usbhid.c` (c, 26 symbols)
- `virtio_blk.c` (c, 39 symbols)
- `virtio_net.c` (c, 44 symbols)
- `xhci.c` (c, 209 symbols)
- `ext4.c` (c, 38 symbols)
- ... and 117 more files

### progs/doomgeneric: d_englsh (Cohesion: 0.66)

**99 files** in this community:

- `am_map.c` (c, 87 symbols)
- `am_map.h` (h, 8 symbols)
- `config.h` (h, 16 symbols)
- `d_englsh.h` (h, 286 symbols)
- `d_event.c` (c, 3 symbols)
- `d_event.h` (h, 4 symbols)
- `d_iwad.c` (c, 27 symbols)
- `d_iwad.h` (h, 14 symbols)
- `d_main.c` (c, 29 symbols)
- `d_main.h` (h, 8 symbols)
- `d_net.c` (c, 8 symbols)
- `d_textur.h` (h, 2 symbols)
- `deh_main.h` (h, 12 symbols)
- `deh_str.h` (h, 11 symbols)
- `doomfeatures.h` (h, 2 symbols)
- `doomgeneric.c` (c, 1 symbols)
- `doomgeneric.h` (h, 10 symbols)
- `doomgeneric_sdl.c` (c, 10 symbols)
- `doomgeneric_soso.c` (c, 13 symbols)
- `doomgeneric_sosox.c` (c, 12 symbols)
- ... and 79 more files

### progs/src (Cohesion: 0.71)

**86 files** in this community:

- `abi.h` (h, 10 symbols)
- `arena.h` (h, 15 symbols)
- `audio.h` (h, 18 symbols)
- `httpd.h` (h, 10 symbols)
- `leakcheck.h` (h, 24 symbols)
- `pcm_ring.h` (h, 7 symbols)
- `seccomp_bpf.h` (h, 58 symbols)
- `select_map.h` (h, 16 symbols)
- `sign.h` (h, 14 symbols)
- `abi.c` (c, 3 symbols)
- `ed25519.c` (c, 36 symbols)
- `seccomp_bpf.c` (c, 12 symbols)
- `string.c` (c, 13 symbols)
- `doomedit.c` (c, 108 symbols)
- `doomgeneric_minios.c` (c, 29 symbols)
- `memio.c` (c, 9 symbols)
- `memio.h` (h, 10 symbols)
- `file.c` (c, 65 symbols)
- `file_assoc.h` (h, 17 symbols)
- `freedomui_minios.c` (c, 44 symbols)
- ... and 66 more files

### progs/doomgeneric: p_spec (Cohesion: 0.56)

**69 files** in this community:

- `d_items.c` (c, 0 symbols)
- `d_items.h` (h, 3 symbols)
- `d_loop.h` (h, 10 symbols)
- `d_mode.c` (c, 6 symbols)
- `d_mode.h` (h, 3 symbols)
- `d_player.h` (h, 5 symbols)
- `d_think.h` (h, 4 symbols)
- `deh_misc.h` (h, 49 symbols)
- `doomdata.h` (h, 11 symbols)
- `doomdef.c` (c, 0 symbols)
- `doomdef.h` (h, 9 symbols)
- `doomstat.c` (c, 0 symbols)
- `doomstat.h` (h, 68 symbols)
- `hu_lib.c` (c, 22 symbols)
- `hu_lib.h` (h, 24 symbols)
- `info.c` (c, 74 symbols)
- `info.h` (h, 6 symbols)
- `m_bbox.c` (c, 2 symbols)
- `m_bbox.h` (h, 3 symbols)
- `m_fixed.h` (h, 6 symbols)
- ... and 49 more files

### tools: tls_crypto (Cohesion: 0.77)

**43 files** in this community:

- `ktime.h` (h, 3 symbols)
- `tls.h` (h, 73 symbols)
- `tls_port.h` (h, 49 symbols)
- `tls_roots.h` (h, 0 symbols)
- `time.c` (c, 4 symbols)
- `mcp_dbg_driver.py` (py, 6 symbols)
- `mcp_dogfood.py` (py, 6 symbols)
- `minios_addons.py` (py, 16 symbols)
- `minios_mcp.py` (py, 51 symbols)
- `tls.c` (c, 27 symbols)
- `tls_crypto.c` (c, 78 symbols)
- `tls_x509.c` (c, 23 symbols)
- `doomgeneric_xlib.c` (c, 9 symbols)
- `minios.c` (c, 17 symbols)
- `hello.py` (py, 0 symbols)
- `mip.py` (py, 15 symbols)
- `lxabi.c` (c, 61 symbols)
- `lxsel.c` (c, 11 symbols)
- `shell.py` (py, 3 symbols)
- `test.py` (py, 20 symbols)
- ... and 23 more files

### headers: vga_fb (Cohesion: 0.72)

**17 files** in this community:

- `desktop_icons.h` (h, 3 symbols)
- `desktop_shortcuts.h` (h, 27 symbols)
- `vga_cursor.h` (h, 9 symbols)
- `vga_fx.h` (h, 9 symbols)
- `wm_events.h` (h, 39 symbols)
- `wm_focus.h` (h, 5 symbols)
- `wm_geom.h` (h, 11 symbols)
- `wm_gfxview.h` (h, 15 symbols)
- `wm_layout.h` (h, 16 symbols)
- `wm_render.h` (h, 5 symbols)
- `wm_tiling.h` (h, 3 symbols)
- `wm_window.h` (h, 10 symbols)
- `vga_cursor.c` (c, 13 symbols)
- `vga_fb.c` (c, 210 symbols)
- `vga_fx.c` (c, 9 symbols)
- `test_fx.c` (c, 2 symbols)
- `test_wm.c` (c, 2 symbols)

### progs/doomgeneric: net_defs (Cohesion: 0.42)

**13 files** in this community:

- `d_loop.c` (c, 18 symbols)
- `d_ticcmd.h` (h, 2 symbols)
- `net_client.h` (h, 21 symbols)
- `net_defs.h` (h, 28 symbols)
- `net_gui.h` (h, 2 symbols)
- `net_io.h` (h, 9 symbols)
- `net_loop.h` (h, 3 symbols)
- `net_packet.h` (h, 9 symbols)
- `net_query.h` (h, 12 symbols)
- `net_sdl.h` (h, 2 symbols)
- `net_server.h` (h, 6 symbols)
- `sha1.c` (c, 19 symbols)
- `sha1.h` (h, 9 symbols)

### headers: batch (Cohesion: 0.67)

**3 files** in this community:

- `batch.h` (h, 12 symbols)
- `batch.c` (c, 1 symbols)
- `test_batch.c` (c, 3 symbols)

### headers: tick (Cohesion: 0.67)

**3 files** in this community:

- `tick.h` (h, 16 symbols)
- `tick.c` (c, 11 symbols)
- `test_tick.c` (c, 6 symbols)

### tools: doom_pwad (Cohesion: 1.00)

**2 files** in this community:

- `test_doom_pwad.py` (py, 44 symbols)
- `doom_pwad.py` (py, 25 symbols)

---

## Surprising Connections

Files in different communities connected through 3+ indirect hops.

- `qga.h` <-> `d_englsh.h` (9 hops, across 3 communities)
- `qga.h` <-> `d_event.c` (9 hops, across 4 communities)
- `qga.h` <-> `d_items.c` (9 hops, across 3 communities)
- `qga.h` <-> `d_think.h` (9 hops, across 3 communities)
- `qga.h` <-> `doomstat.c` (9 hops, across 4 communities)

---

## Suggested Questions

Auto-generated exploration prompts based on graph structure:

- What does string.c depend on, and what depends on it? (90 connections)
- What does doomtype.h depend on, and what depends on it? (50 connections)
- What does doomdef.h depend on, and what depends on it? (45 connections)
- How are the 137 files in 'headers: kernel' related to each other?
- Why are qga.h and d_englsh.h connected through 9 hops across 3 communities?

---

## Force-Graph Explorer

Heterogeneous explorer payload (files, communities, layers, externals) rendered with force-graph physics, stable family colors, log2 node sizing, and convex-hull community overlays. Open `readmenator-maps/graph-force.html` (linked from the maps gallery) or run `explorer`.

- Nodes: 731 (community: 10, external: 127, file: 589, layer: 5)
- Edges: 3329

---

## Corpus Analytics

Attribution funnel and distributions for the explorer dashboard.

- Files: 589 | With symbols: 568 | Attributed: 472 | God nodes: 10 | Symbols: 13027

- Layer `utility`: 458 files
- Layer `testing`: 82 files
- Layer `infrastructure`: 39 files
- Layer `presentation`: 6 files
- Layer `data_access`: 4 files

- Language `c`: 288 files
- Language `h`: 196 files
- Language `py`: 67 files
- Language `sh`: 17 files
- Language `s`: 13 files
- Language `S`: 7 files
- Language `lua`: 1 files

---

## Taint Propagation Map

Taint analysis traces how dangerous imports propagate through the codebase via transitive dependencies. Source files import dangerous modules directly; sink files receive the danger indirectly.

**Taint Sources:** 9 | **Taint Sinks:** 11 | **Propagation Paths:** 20

- `mcp_dbg_driver.py` imports `subprocess` (0 hop to `mcp_dbg_driver.py`) [high]
  Path: mcp_dbg_driver.py
- `mcp_dbg_driver.py` imports `subprocess` (1 hop to `time.c`) [high]
  Path: mcp_dbg_driver.py -> time.c
- `mcp_dbg_driver.py` imports `subprocess` (2 hops to `ktime.h`) [high]
  Path: mcp_dbg_driver.py -> time.c -> ktime.h
- `mcp_dogfood.py` imports `subprocess` (0 hop to `mcp_dogfood.py`) [high]
  Path: mcp_dogfood.py
- `mcp_dogfood.py` imports `subprocess` (1 hop to `time.c`) [high]
  Path: mcp_dogfood.py -> time.c
- `mcp_dogfood.py` imports `subprocess` (2 hops to `ktime.h`) [high]
  Path: mcp_dogfood.py -> time.c -> ktime.h
- `minios_addons.py` imports `subprocess` (0 hop to `minios_addons.py`) [high]
  Path: minios_addons.py
- `minios_addons.py` imports `subprocess` (1 hop to `time.c`) [high]
  Path: minios_addons.py -> time.c
- `minios_addons.py` imports `subprocess` (2 hops to `ktime.h`) [high]
  Path: minios_addons.py -> time.c -> ktime.h
- `minios_mcp.py` imports `subprocess` (0 hop to `minios_mcp.py`) [high]
  Path: minios_mcp.py
- `minios_mcp.py` imports `subprocess` (1 hop to `minios_addons.py`) [high]
  Path: minios_mcp.py -> minios_addons.py
- `minios_mcp.py` imports `subprocess` (1 hop to `time.c`) [high]
  Path: minios_mcp.py -> time.c
- `minios_mcp.py` imports `subprocess` (2 hops to `ktime.h`) [high]
  Path: minios_mcp.py -> time.c -> ktime.h
- `test_minios_mcp.py` imports `subprocess` (0 hop to `test_minios_mcp.py`) [high]
  Path: test_minios_mcp.py
- `test_minifs_tools.py` imports `subprocess` (0 hop to `test_minifs_tools.py`) [high]
  Path: test_minifs_tools.py
- `test_mip.py` imports `subprocess` (0 hop to `test_mip.py`) [high]
  Path: test_mip.py
- `boot_wl.py` imports `subprocess` (0 hop to `boot_wl.py`) [high]
  Path: boot_wl.py
- `boot_wl.py` imports `subprocess` (1 hop to `time.c`) [high]
  Path: boot_wl.py -> time.c
- `boot_wl.py` imports `subprocess` (2 hops to `ktime.h`) [high]
  Path: boot_wl.py -> time.c -> ktime.h
- `check_kb_sync.py` imports `subprocess` (0 hop to `check_kb_sync.py`) [high]
  Path: check_kb_sync.py

---

## Hotspot Analysis

Files ranked by combined complexity (symbol count) and centrality (connection count). High-scoring files are architecturally critical and may need refactoring attention.

| File | Complexity | Centrality | Combined | Symbols | Connections |
|------|-----------|------------|----------|---------|-------------|
| `batch.c` | 0.002 | 0.022 | 0.014 | 1 | 2 |
| `r_sky.c` | 0.002 | 0.066 | 0.041 | 1 | 6 |
| `mutate_mcp.sh` | 0.002 | 0.000 | 0.001 | 1 | 0 |
| `media_unavailable.c` | 0.005 | 0.077 | 0.048 | 2 | 7 |
| `mkvocab.py` | 0.005 | 0.033 | 0.022 | 2 | 3 |
| `abi.c` | 0.007 | 0.033 | 0.023 | 3 | 3 |
| `check_fork_stubs.py` | 0.010 | 0.022 | 0.017 | 4 | 2 |
| `test_call_align.py` | 0.010 | 0.055 | 0.037 | 4 | 5 |
| `clip_bridge.py` | 0.012 | 0.022 | 0.018 | 5 | 2 |
| `check_mutant_anchors.py` | 0.015 | 0.044 | 0.032 | 6 | 4 |
| `syscalls.c` | 0.638 | 0.714 | 0.684 | 263 | 65 |
| `string.c` | 0.032 | 1.000 | 0.613 | 13 | 91 |
| `d_main.c` | 0.070 | 0.890 | 0.562 | 29 | 81 |
| `shell.c` | 0.238 | 0.703 | 0.517 | 98 | 64 |
| `g_game.c` | 0.131 | 0.769 | 0.514 | 54 | 70 |

---

## Dataflow Analysis

Procedural intra-function dataflow findings (zero tokens, regex-based heuristics, all INFERRED). Each lead is grounded at file:line for manual review.

**50 findings** (DEAD_STORE: 38, UNCHECKED_ALLOC: 7, UNINIT_USE: 5).

| File | Function | Line | Kind | Variable | Description |
|------|----------|------|------|----------|-------------|
| `boot/uefi_stub.c` | `efi_main` | 518 | `UNCHECKED_ALLOC` | `rc` | Result of allocator stored in `rc` is never checked against NULL. |
| `drivers/sb16.c` | `sb16_pump` | 259 | `DEAD_STORE` | `dst` | `dst` assigned at line 259 but never read afterwards. |
| `drivers/sb16.c` | `sb16_init` | 531 | `DEAD_STORE` | `major` | `major` assigned at line 531 but never read afterwards. |
| `drivers/virtio_blk.c` | `vblk_desc` | 169 | `DEAD_STORE` | `d` | `d` assigned at line 169 but never read afterwards. |
| `drivers/virtio_blk.c` | `vblk_avail_push` | 189 | `DEAD_STORE` | `a` | `a` assigned at line 189 but never read afterwards. |
| `drivers/virtio_net.c` | `vnet_desc` | 146 | `DEAD_STORE` | `d` | `d` assigned at line 146 but never read afterwards. |
| `fs/kfile.c` | `kpipe_pair` | 103 | `DEAD_STORE` | `ref` | `ref` assigned at line 103 but never read afterwards. |
| `kernel/loader.c` | `ldso_bind_into` | 932 | `UNINIT_USE` | `symname` | `symname` may be read before initialization (declared line 896). |
| `kernel/loader.c` | `load_exec_elf` | 1278 | `DEAD_STORE` | `base` | `base` assigned at line 1278 but never read afterwards. |
| `kernel/loader.c` | `load_exec_elf` | 1283 | `DEAD_STORE` | `max_end` | `max_end` assigned at line 1283 but never read afterwards. |
| `kernel/mm/cow.c` | `cow_rehash` | 117 | `DEAD_STORE` | `ref` | `ref` assigned at line 117 but never read afterwards. |
| `kernel/mm/paging.c` | `mm_setup_protections` | 44 | `DEAD_STORE` | `pd` | `pd` assigned at line 44 but never read afterwards. |
| `kernel/mm/paging.c` | `honest` | 686 | `DEAD_STORE` | `pt` | `pt` assigned at line 686 but never read afterwards. |
| `kernel/sched.c` | `irqstat_report` | 632 | `DEAD_STORE` | `txf` | `txf` assigned at line 632 but never read afterwards. |
| `kernel/sched.c` | `syscall` | 1399 | `DEAD_STORE` | `wheel` | `wheel` assigned at line 1399 but never read afterwards. |
| `kernel/sched.c` | `proc_spawn_elf_inner` | 2080 | `DEAD_STORE` | `frame` | `frame` assigned at line 2080 but never read afterwards. |
| `kernel/sched.c` | `schedule` | 2178 | `DEAD_STORE` | `cpu` | `cpu` assigned at line 2178 but never read afterwards. |
| `kernel/sched.c` | `MSR` | 2694 | `DEAD_STORE` | `frame` | `frame` assigned at line 2694 but never read afterwards. |
| `kernel/sched.c` | `do_clone_thread` | 2783 | `DEAD_STORE` | `frame` | `frame` assigned at line 2783 but never read afterwards. |
| `kernel/sched.c` | `do_execve` | 3078 | `DEAD_STORE` | `frame` | `frame` assigned at line 3078 but never read afterwards. |
| `kernel/shell.c` | `context` | 1731 | `UNINIT_USE` | `buf` | `buf` may be read before initialization (declared line 1723). |
| `kernel/syscalls.c` | `sys_minios_gfx_zoom` | 426 | `DEAD_STORE` | `gfx_zoom_2x` | `gfx_zoom_2x` assigned at line 426 but never read afterwards. |
| `kernel/syscalls.c` | `sys_minios_gfx_title` | 709 | `DEAD_STORE` | `gfx_win_title` | `gfx_win_title` assigned at line 709 but never read afterwards. |
| `kernel/syscalls.c` | `FIONREAD` | 2653 | `DEAD_STORE` | `ws` | `ws` assigned at line 2653 but never read afterwards. |
| `kernel/syscalls_proc.c` | `groups` | 227 | `DEAD_STORE` | `status` | `status` assigned at line 227 but never read afterwards. |
| `kernel/vga_fb.c` | `taskbar_render` | 2564 | `DEAD_STORE` | `lx` | `lx` assigned at line 2564 but never read afterwards. |
| `kernel/vga_fb.c` | `line` | 2934 | `DEAD_STORE` | `rows_before` | `rows_before` assigned at line 2934 but never read afterwards. |
| `kernel/vga_fb.c` | `wallpaper_ensure` | 3627 | `DEAD_STORE` | `d` | `d` assigned at line 3627 but never read afterwards. |
| `kernel/vga_fb.c` | `icon_decode` | 3752 | `DEAD_STORE` | `dst` | `dst` assigned at line 3752 but never read afterwards. |
| `kernel/vga_fb.c` | `icon_embedded_rgba` | 3771 | `DEAD_STORE` | `dst` | `dst` assigned at line 3771 but never read afterwards. |
| `kernel/vga_fb.c` | `vga_fb_mouse_tick` | 4345 | `DEAD_STORE` | `gcfg` | `gcfg` assigned at line 4345 but never read afterwards. |
| `kernel/vga_fb.c` | `vga_fb_mouse_tick` | 4346 | `DEAD_STORE` | `ecfg` | `ecfg` assigned at line 4346 but never read afterwards. |
| `kernel/vga_fb.c` | `vga_fb_mouse_tick` | 4348 | `DEAD_STORE` | `win_w` | `win_w` assigned at line 4348 but never read afterwards. |
| `net/net.c` | `net_dns_resolve` | 302 | `DEAD_STORE` | `rc` | `rc` assigned at line 302 but never read afterwards. |
| `net/net.c` | `net_sys_socket` | 1224 | `DEAD_STORE` | `nonblock` | `nonblock` assigned at line 1224 but never read afterwards. |
| `net/net.c` | `net_sys_socket` | 1225 | `DEAD_STORE` | `cloexec` | `cloexec` assigned at line 1225 but never read afterwards. |
| `net/tls_crypto.c` | `ecdsa_verify` | 1227 | `UNINIT_USE` | `gen` | `gen` may be read before initialization (declared line 1223). |
| `progs/doomedit/doomedit.c` | `dmap_build_wad` | 1556 | `DEAD_STORE` | `side` | `side` assigned at line 1556 but never read afterwards. |
| `progs/doomedit/doomedit.c` | `dmap_build_wad` | 1633 | `DEAD_STORE` | `dir` | `dir` assigned at line 1633 but never read afterwards. |
| `progs/doomedit/doomedit.c` | `dmap_selftest` | 2145 | `DEAD_STORE` | `mrgb` | `mrgb` assigned at line 2145 but never read afterwards. |
| `progs/doomgeneric/d_iwad.c` | `GetRegistryString` | 217 | `UNCHECKED_ALLOC` | `result` | Result of allocator stored in `result` is never checked against NULL. |
| `progs/doomgeneric/d_iwad.c` | `CheckSteamGUSPatches` | 346 | `UNCHECKED_ALLOC` | `patch_path` | Result of allocator stored in `patch_path` is never checked against NULL. |
| `progs/doomgeneric/d_iwad.c` | `CheckDirectoryHasIWAD` | 425 | `UNCHECKED_ALLOC` | `filename` | Result of allocator stored in `filename` is never checked against NULL. |
| `progs/doomgeneric/d_iwad.c` | `D_FindAllIWADs` | 764 | `UNCHECKED_ALLOC` | `result` | Result of allocator stored in `result` is never checked against NULL. |
| `progs/doomgeneric/doomgeneric.c` | `dg_Create` | 8 | `UNCHECKED_ALLOC` | `DG_ScreenBuffer` | Result of allocator stored in `DG_ScreenBuffer` is never checked against NULL. |
| `progs/doomgeneric/doomgeneric_minios.c` | `DG_Init` | 235 | `UNINIT_USE` | `myargc` | `myargc` may be read before initialization (declared line 233). |
| `progs/doomgeneric/doomgeneric_minios.c` | `DG_Init` | 235 | `UNINIT_USE` | `myargv` | `myargv` may be read before initialization (declared line 234). |
| `progs/doomgeneric/doomgeneric_minios.c` | `DG_DrawFrame` | 251 | `DEAD_STORE` | `dst` | `dst` assigned at line 251 but never read afterwards. |
| `progs/doomgeneric/doomgeneric_soso.c` | `DG_Init` | 144 | `UNCHECKED_ALLOC` | `FrameBuffer` | Result of allocator stored in `FrameBuffer` is never checked against NULL. |
| `progs/doomgeneric/g_game.c` | `G_PlayerReborn` | 1082 | `DEAD_STORE` | `killcount` | `killcount` assigned at line 1082 but never read afterwards. |

---

## Concept Graph

Semantic second-brain layer: nouns are concept nodes, verbs are edges. Each noun maps atomically to a file set (EXTRACTED); each verb aggregates structural imports, calls, and inherits into consumes, invokes, extends, depends_on, or bridges (INFERRED).

**50 concepts, 100 relations.**

| Concept | Files | Mentions |
|---------|-------|----------|
| `progs` | 319 | 335 |
| `free` | 241 | 525 |
| `any` | 239 | 476 |
| `without` | 231 | 458 |
| `program` | 221 | 447 |
| `can` | 219 | 277 |
| `under` | 212 | 230 |
| `see` | 192 | 201 |
| `doomgeneric` | 188 | 211 |
| `version` | 186 | 378 |
| `but` | 186 | 198 |
| `later` | 184 | 198 |
| `more` | 182 | 196 |
| `either` | 182 | 187 |
| `public` | 179 | 355 |
| `gnu` | 178 | 349 |
| `even` | 176 | 178 |
| `purpose` | 175 | 175 |
| `published` | 174 | 175 |
| `software` | 172 | 499 |
| `terms` | 172 | 175 |
| `general` | 171 | 341 |
| `option` | 171 | 174 |
| `foundation` | 171 | 172 |
| `hope` | 171 | 171 |
| `implied` | 171 | 171 |
| `modify` | 171 | 171 |
| `license` | 170 | 510 |
| `warranty` | 170 | 340 |
| `copyright` | 170 | 322 |

### Verb Edges

| Source | Verb | Target | Strength | Evidence |
|--------|------|--------|----------|----------|
| `free` | `depends_on` | `progs` | 1.00 | 10 |
| `free` | `depends_on` | `without` | 0.99 | 10 |
| `progs` | `depends_on` | `version` | 0.99 | 10 |
| `any` | `depends_on` | `free` | 0.98 | 10 |
| `any` | `depends_on` | `progs` | 0.98 | 10 |
| `any` | `depends_on` | `without` | 0.98 | 10 |
| `doomgeneric` | `depends_on` | `progs` | 0.98 | 10 |
| `free` | `depends_on` | `program` | 0.98 | 10 |
| `program` | `depends_on` | `progs` | 0.98 | 10 |
| `program` | `depends_on` | `without` | 0.98 | 10 |
| `progs` | `depends_on` | `program` | 0.98 | 10 |
| `without` | `depends_on` | `progs` | 0.98 | 10 |
| `any` | `depends_on` | `program` | 0.97 | 10 |
| `can` | `depends_on` | `progs` | 0.97 | 10 |
| `free` | `depends_on` | `any` | 0.97 | 10 |
| `free` | `depends_on` | `can` | 0.97 | 10 |
| `free` | `depends_on` | `version` | 0.97 | 10 |
| `program` | `depends_on` | `free` | 0.97 | 10 |
| `progs` | `depends_on` | `doomgeneric` | 0.97 | 10 |
| `under` | `depends_on` | `progs` | 0.97 | 10 |
| `under` | `depends_on` | `without` | 0.97 | 10 |
| `without` | `depends_on` | `free` | 0.97 | 10 |
| `any` | `depends_on` | `can` | 0.96 | 10 |
| `any` | `depends_on` | `version` | 0.96 | 10 |
| `can` | `depends_on` | `any` | 0.96 | 10 |
| `can` | `depends_on` | `free` | 0.96 | 10 |
| `can` | `depends_on` | `program` | 0.96 | 10 |
| `can` | `depends_on` | `without` | 0.96 | 10 |
| `doomgeneric` | `depends_on` | `version` | 0.96 | 10 |
| `program` | `depends_on` | `any` | 0.96 | 10 |

### Dialectic Prompts

- Thesis: `any` centralizes 239 files; Antithesis: `but` pulls 186 files with 181 shared (Jaccard 0.74); Synthesis: should they merge, split by layer, or keep `depends_on` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `can` pulls 219 files with 195 shared (Jaccard 0.74); Synthesis: should they merge, split by layer, or keep `depends_on` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `copyright` pulls 170 files with 170 shared (Jaccard 0.71); Synthesis: should they merge, split by layer, or keep `bridges` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `description` pulls 159 files with 159 shared (Jaccard 0.67); Synthesis: should they merge, split by layer, or keep `bridges` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `details` pulls 170 files with 170 shared (Jaccard 0.71); Synthesis: should they merge, split by layer, or keep `bridges` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `distributed` pulls 170 files with 170 shared (Jaccard 0.71); Synthesis: should they merge, split by layer, or keep `bridges` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `doomgeneric` pulls 188 files with 170 shared (Jaccard 0.66); Synthesis: should they merge, split by layer, or keep `depends_on` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `either` pulls 182 files with 178 shared (Jaccard 0.73); Synthesis: should they merge, split by layer, or keep `bridges` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `even` pulls 176 files with 171 shared (Jaccard 0.70); Synthesis: should they merge, split by layer, or keep `bridges` explicit?
- Thesis: `any` centralizes 239 files; Antithesis: `fitness` pulls 170 files with 170 shared (Jaccard 0.71); Synthesis: should they merge, split by layer, or keep `bridges` explicit?

---

## Dependency Cycles

Circular dependencies detected in the resolved import graph. Cycles increase coupling and make refactoring harder.

| Cycle | Length | Files |
|-------|--------|-------|
| `r_data.h -> r_state.h -> r_data.h` | 2 | 2 |

---

## Change Impact Analysis

Files sorted by how many other files would be affected if they changed. High-impact files should be changed with caution.

| File | Direct Dependents | Transitive Dependents | Total Impact |
|------|------------------|----------------------|--------------|
| `string.c` | 50 | 0 | 90 |
| `minios_abi.h` | 32 | 31 | 63 |
| `m_fixed.h` | 9 | 50 | 59 |
| `v_patch.h` | 2 | 50 | 54 |
| `d_ticcmd.h` | 6 | 47 | 53 |
| `i_video.h` | 18 | 35 | 53 |
| `sha1.h` | 5 | 47 | 52 |
| `vma.h` | 8 | 43 | 51 |
| `d_items.h` | 2 | 49 | 51 |
| `d_mode.h` | 6 | 45 | 51 |
| `doomdef.h` | 41 | 10 | 51 |
| `i_timer.h` | 9 | 42 | 51 |
| `info.h` | 4 | 47 | 51 |
| `net_defs.h` | 9 | 42 | 51 |
| `d_event.h` | 13 | 37 | 50 |

---

## Architecture Violations

Violations of architectural layer rules detected in the import graph. **3 strict violations, 0 warnings.**

| Source | Source Layer | Target | Target Layer | Description | Severity |
|--------|-------------|--------|-------------|-------------|----------|
| `test_httpd.c` | testing | `httpd.h` | presentation | testing must not import presentation | strict |
| `test_wm.c` | testing | `wm_render.h` | presentation | testing must not import presentation | strict |
| `test_wm.c` | testing | `wm_layout.h` | presentation | testing must not import presentation | strict |

---

## Suggested Linting Rules

Automatically suggested linting and security rules based on patterns detected in the codebase. These can be exported as Semgrep rules using the `--export-rules` flag.

| Rule ID | Severity | Description | Language | Matches |
|---------|----------|-------------|----------|---------|
| `RM001` | info | Large number of functions in S: 98 total | S | 98 |
| `RM002` | info | Large number of functions in c: 4841 total | c | 4841 |
| `RM003` | info | Large number of functions in h: 1713 total | h | 1713 |
| `RM004` | info | Large number of functions in py: 742 total | py | 742 |
| `RM005` | info | Large number of functions in sh: 47 total | sh | 47 |
| `RM006` | info | Large number of functions in s: 328 total | s | 328 |
| `RM007` | info | Large number of functions in lua: 20 total | lua | 20 |
| `RM008` | info | Print statement found (consider logging instead) | python | 318 |

---

## Orphans

Files with no documentation or low connectivity. These are candidates for documentation investment or cleanup.

- `isr_stubs.S` (24 symbols, no doc)
- `syscall_entry.S` (4 symbols, no doc)
- `tlb_nmi.S` (1 symbols, no doc)
- `bootloader.c` (2 symbols, no doc)
- `nvme.c` (50 symbols, no doc)
- `nvme.h` (7 symbols, no doc)
- `lz4_kernel.h` (4 symbols, no doc)
- `pcspk.h` (9 symbols, no doc)
- `lz4_kernel.c` (10 symbols, no doc)
- `__init__.py` (0 symbols, no doc)
- `aes.s` (30 symbols, no doc)
- `cp.s` (2 symbols, no doc)
- `cvmfmt.s` (4 symbols, no doc)
- `fib.s` (3 symbols, no doc)
- `freedom.s` (92 symbols, no doc)
- `http.s` (3 symbols, no doc)
- `json.s` (32 symbols, no doc)
- `ldhello.s` (2 symbols, no doc)
- `lz4.s` (7 symbols, no doc)
- `lzss.s` (30 symbols, no doc)
- *... and 27 more*

---

## Query Recipes

Example queries you can run against this knowledge base using the ranking engine:

```
# Find files most relevant to a concept
readmenator query "Where is the import resolver implemented?"

# Rank files by relevance to a topic
readmenator query "How does documentation generation work?"

# Explain why a file ranks highly
readmenator query "explain readmenator/_documentation.py"

# Trace dependency paths with ranked context
readmenator query "path from CLI to exporter"
```

The ranking model uses the following signals:

- **Personalized PageRank** (45% weight): query-specific relevance via seed propagation
- **Global Authority** (20% weight): structural importance via standard PageRank
- **Test Coverage** (15% weight): fraction of symbols referenced in test files
- **Doc Coverage** (10% weight): presence of docstrings and file-level docs
- **Freshness** (10% weight): recent modification activity

Results include score decomposition and justification paths for each ranked item.

---

## Structural Knowledge Map

> **Note:** The visual graph below has been intelligently pruned to the top 300 most relevant nodes to prevent rendering crashes. Full details of all files are documented in the Architecture Reference.

```mermaid
graph LR
    classDef mod fill:#1e1e1e,stroke:#ff6666,stroke-width:2px,color:#fff;
    classDef cls fill:#2d2d2d,stroke:#4ec9b0,stroke-width:2px,color:#fff;
    classDef fn fill:#333,stroke:#dcdcaa,stroke-width:1px,color:#dcdcaa;
    classDef ext fill:#111,stroke:#666,stroke-dasharray:5 5,color:#aaa;
    subgraph community_1 ["progs/doomgeneric: d_englsh"]
    progs_doomgeneric_d_main_c["d_main.c (c)"]
    class progs_doomgeneric_d_main_c mod;
    progs_doomgeneric_d_main_c_D_ProcessEvents["D_ProcessEvents"]
    class progs_doomgeneric_d_main_c_D_ProcessEvents fn;
    progs_doomgeneric_d_main_c --> progs_doomgeneric_d_main_c_D_ProcessEvents
    progs_doomgeneric_d_main_c_D_Display["D_Display"]
    class progs_doomgeneric_d_main_c_D_Display fn;
    progs_doomgeneric_d_main_c --> progs_doomgeneric_d_main_c_D_Display
    progs_doomgeneric_d_main_c_D_BindVariables["D_BindVariables"]
    class progs_doomgeneric_d_main_c_D_BindVariables fn;
    progs_doomgeneric_d_main_c --> progs_doomgeneric_d_main_c_D_BindVariables
    progs_doomgeneric_d_main_c_D_GrabMouseCallback["D_GrabMouseCallback"]
    class progs_doomgeneric_d_main_c_D_GrabMouseCallback fn;
    progs_doomgeneric_d_main_c --> progs_doomgeneric_d_main_c_D_GrabMouseCallback
    progs_doomgeneric_d_main_c_D_DoomLoop["D_DoomLoop"]
    class progs_doomgeneric_d_main_c_D_DoomLoop fn;
    progs_doomgeneric_d_main_c --> progs_doomgeneric_d_main_c_D_DoomLoop
    progs_doomgeneric_g_game_c["g_game.c (c)"]
    class progs_doomgeneric_g_game_c mod;
    end
    subgraph community_0 ["headers: kernel"]
    kernel_syscalls_c["syscalls.c (c)"]
    class kernel_syscalls_c mod;
    kernel_shell_c["shell.c (c)"]
    class kernel_shell_c mod;
    progs_doomgeneric_m_menu_c["m_menu.c (c)"]
    class progs_doomgeneric_m_menu_c mod;
    progs_doomgeneric_st_stuff_c["st_stuff.c (c)"]
    class progs_doomgeneric_st_stuff_c mod;
    progs_doomgeneric_i_input_c["i_input.c (c)"]
    class progs_doomgeneric_i_input_c mod;
    kernel_sched_c["sched.c (c)"]
    class kernel_sched_c mod;
    kernel_c["kernel.c (c)"]
    class kernel_c mod;
    end
    subgraph community_5 ["headers: vga_fb"]
    kernel_vga_fb_c["vga_fb.c (c)"]
    class kernel_vga_fb_c mod;
    progs_doomgeneric_i_system_c["i_system.c (c)"]
    class progs_doomgeneric_i_system_c mod;
    end
    subgraph community_6 ["progs/doomgeneric: net_defs"]
    progs_doomgeneric_d_loop_c["d_loop.c (c)"]
    class progs_doomgeneric_d_loop_c mod;
    progs_doomgeneric_am_map_c["am_map.c (c)"]
    class progs_doomgeneric_am_map_c mod;
    end
    subgraph community_3 ["progs/doomgeneric: p_spec"]
    progs_doomgeneric_p_spec_c["p_spec.c (c)"]
    class progs_doomgeneric_p_spec_c mod;
    progs_doomgeneric_hu_stuff_c["hu_stuff.c (c)"]
    class progs_doomgeneric_hu_stuff_c mod;
    progs_doomgeneric_d_net_c["d_net.c (c)"]
    class progs_doomgeneric_d_net_c mod;
    progs_doomgeneric_s_sound_c["s_sound.c (c)"]
    class progs_doomgeneric_s_sound_c mod;
    progs_doomgeneric_wi_stuff_c["wi_stuff.c (c)"]
    class progs_doomgeneric_wi_stuff_c mod;
    progs_doomgeneric_m_misc_c["m_misc.c (c)"]
    class progs_doomgeneric_m_misc_c mod;
    progs_doomgeneric_f_finale_c["f_finale.c (c)"]
    class progs_doomgeneric_f_finale_c mod;
    progs_doomgeneric_v_video_c["v_video.c (c)"]
    class progs_doomgeneric_v_video_c mod;
    end
    subgraph community_4 ["tools: tls_crypto"]
    progs_src_lxabi_c["lxabi.c (c)"]
    class progs_src_lxabi_c mod;
    progs_doomgeneric_d_iwad_c["d_iwad.c (c)"]
    class progs_doomgeneric_d_iwad_c mod;
    progs_doomgeneric_p_map_c["p_map.c (c)"]
    class progs_doomgeneric_p_map_c mod;
    progs_doomgeneric_i_video_c["i_video.c (c)"]
    class progs_doomgeneric_i_video_c mod;
    progs_doomgeneric_p_setup_c["p_setup.c (c)"]
    class progs_doomgeneric_p_setup_c mod;
    progs_doomgeneric_r_data_c["r_data.c (c)"]
    class progs_doomgeneric_r_data_c mod;
    progs_doomgeneric_p_inter_c["p_inter.c (c)"]
    class progs_doomgeneric_p_inter_c mod;
    progs_doomgeneric_w_wad_c["w_wad.c (c)"]
    class progs_doomgeneric_w_wad_c mod;
    progs_doomgeneric_p_saveg_c["p_saveg.c (c)"]
    class progs_doomgeneric_p_saveg_c mod;
    progs_doomgeneric_m_config_c["m_config.c (c)"]
    class progs_doomgeneric_m_config_c mod;
    progs_doomgeneric_st_lib_c["st_lib.c (c)"]
    class progs_doomgeneric_st_lib_c mod;
    progs_doomgeneric_p_mobj_c["p_mobj.c (c)"]
    class progs_doomgeneric_p_mobj_c mod;
    progs_doomgeneric_p_enemy_c["p_enemy.c (c)"]
    class progs_doomgeneric_p_enemy_c mod;
    end
    subgraph community_2 ["progs/src"]
    progs_file_file_c["file.c (c)"]
    class progs_file_file_c mod;
    progs_doomgeneric_i_sound_c["i_sound.c (c)"]
    class progs_doomgeneric_i_sound_c mod;
    progs_doomgeneric_i_joystick_c["i_joystick.c (c)"]
    class progs_doomgeneric_i_joystick_c mod;
    progs_doomgeneric_p_plats_c["p_plats.c (c)"]
    class progs_doomgeneric_p_plats_c mod;
    progs_doomgeneric_p_switch_c["p_switch.c (c)"]
    class progs_doomgeneric_p_switch_c mod;
    progs_doomgeneric_i_minios_sound_c["i_minios_sound.c (c)"]
    class progs_doomgeneric_i_minios_sound_c mod;
    progs_doomgeneric_p_pspr_c["p_pspr.c (c)"]
    class progs_doomgeneric_p_pspr_c mod;
    progs_nuklear_node_editor_c["node_editor.c (c)"]
    class progs_nuklear_node_editor_c mod;
    progs_doomgeneric_r_things_c["r_things.c (c)"]
    class progs_doomgeneric_r_things_c mod;
    progs_doomgeneric_p_doors_c["p_doors.c (c)"]
    class progs_doomgeneric_p_doors_c mod;
    progs_doomgeneric_r_local_h["r_local.h (h)"]
    class progs_doomgeneric_r_local_h mod;
    progs_wl_wlcomp_c["wlcomp.c (c)"]
    class progs_wl_wlcomp_c mod;
    tests_test_wm_c["test_wm.c (c)"]
    class tests_test_wm_c mod;
    progs_doomgeneric_r_draw_c["r_draw.c (c)"]
    class progs_doomgeneric_r_draw_c mod;
    progs_tls_u_tls_u_port_c["tls_u_port.c (c)"]
    class progs_tls_u_tls_u_port_c mod;
    progs_doomgeneric_r_bsp_c["r_bsp.c (c)"]
    class progs_doomgeneric_r_bsp_c mod;
    progs_doomgeneric_r_plane_c["r_plane.c (c)"]
    class progs_doomgeneric_r_plane_c mod;
    progs_pokemon_platform_minios_c["platform_minios.c (c)"]
    class progs_pokemon_platform_minios_c mod;
    mcp_test_minios_mcp_py["test_minios_mcp.py (py)"]
    class mcp_test_minios_mcp_py mod;
    progs_freedomui_freedomui_minios_c["freedomui_minios.c (c)"]
    class progs_freedomui_freedomui_minios_c mod;
    kernel_mm_paging_c["paging.c (c)"]
    class kernel_mm_paging_c mod;
    tests_test_ext4_c["test_ext4.c (c)"]
    class tests_test_ext4_c mod;
    tests_test_fat32_c["test_fat32.c (c)"]
    class tests_test_fat32_c mod;
    progs_doomgeneric_hu_lib_c["hu_lib.c (c)"]
    class progs_doomgeneric_hu_lib_c mod;
    progs_src_lxnet_c["lxnet.c (c)"]
    class progs_src_lxnet_c mod;
    progs_doomgeneric_doomgeneric_soso_c["doomgeneric_soso.c (c)"]
    class progs_doomgeneric_doomgeneric_soso_c mod;
    progs_doomgeneric_doomgeneric_sosox_c["doomgeneric_sosox.c (c)"]
    class progs_doomgeneric_doomgeneric_sosox_c mod;
    kernel_spawn_c["spawn.c (c)"]
    class kernel_spawn_c mod;
    progs_tls_u_tls_u_main_c["tls_u_main.c (c)"]
    class progs_tls_u_tls_u_main_c mod;
    progs_piano_piano_c["piano.c (c)"]
    class progs_piano_piano_c mod;
    progs_src_freedom_wl_c["freedom_wl.c (c)"]
    class progs_src_freedom_wl_c mod;
    progs_src_lxsecc_c["lxsecc.c (c)"]
    class progs_src_lxsecc_c mod;
    tls_test_c["tls_test.c (c)"]
    class tls_test_c mod;
    progs_doomgeneric_r_main_c["r_main.c (c)"]
    class progs_doomgeneric_r_main_c mod;
    progs_doomgeneric_f_wipe_c["f_wipe.c (c)"]
    class progs_doomgeneric_f_wipe_c mod;
    progs_doomgeneric_doomgeneric_xlib_c["doomgeneric_xlib.c (c)"]
    class progs_doomgeneric_doomgeneric_xlib_c mod;
    kernel_minifetch_c["minifetch.c (c)"]
    class kernel_minifetch_c mod;
    progs_doomgeneric_p_ceilng_c["p_ceilng.c (c)"]
    class progs_doomgeneric_p_ceilng_c mod;
    progs_doomgeneric_p_floor_c["p_floor.c (c)"]
    class progs_doomgeneric_p_floor_c mod;
    tests_test_wl_c["test_wl.c (c)"]
    class tests_test_wl_c mod;
    progs_doomgeneric_w_main_c["w_main.c (c)"]
    class progs_doomgeneric_w_main_c mod;
    progs_vedit_vedit_c["vedit.c (c)"]
    class progs_vedit_vedit_c mod;
    progs_lisp_lisp_c["lisp.c (c)"]
    class progs_lisp_lisp_c mod;
    kernel_loader_c["loader.c (c)"]
    class kernel_loader_c mod;
    progs_paint_paint_c["paint.c (c)"]
    class progs_paint_paint_c mod;
    progs_nuklear_nuklear_minios_c["nuklear_minios.c (c)"]
    class progs_nuklear_nuklear_minios_c mod;
    mcp_minios_mcp_py["minios_mcp.py (py)"]
    class mcp_minios_mcp_py mod;
    tools_minios_hyper_py["minios_hyper.py (py)"]
    class tools_minios_hyper_py mod;
    progs_freedomui_platform_minios_c["platform_minios.c (c)"]
    class progs_freedomui_platform_minios_c mod;
    drivers_pcm2_c["pcm2.c (c)"]
    class drivers_pcm2_c mod;
    smp_c["smp.c (c)"]
    class smp_c mod;
    drivers_kbd_c["kbd.c (c)"]
    class drivers_kbd_c mod;
    kernel_console_in_c["console_in.c (c)"]
    class kernel_console_in_c mod;
    tools_test_gui_freedom_py["test_gui_freedom.py (py)"]
    class tools_test_gui_freedom_py mod;
    progs_doomgeneric_doomgeneric_minios_c["doomgeneric_minios.c (c)"]
    class progs_doomgeneric_doomgeneric_minios_c mod;
    drivers_usbhid_c["usbhid.c (c)"]
    class drivers_usbhid_c mod;
    drivers_block_c["block.c (c)"]
    class drivers_block_c mod;
    kernel_exec_c["exec.c (c)"]
    class kernel_exec_c mod;
    progs_doomgeneric_m_argv_c["m_argv.c (c)"]
    class progs_doomgeneric_m_argv_c mod;
    progs_doomedit_doomedit_c["doomedit.c (c)"]
    class progs_doomedit_doomedit_c mod;
    headers_tls_port_h["tls_port.h (h)"]
    class headers_tls_port_h mod;
    progs_doomgeneric_i_scale_c["i_scale.c (c)"]
    class progs_doomgeneric_i_scale_c mod;
    progs_doomgeneric_r_defs_h["r_defs.h (h)"]
    class progs_doomgeneric_r_defs_h mod;
    tools_test_gui_wm_py["test_gui_wm.py (py)"]
    class tools_test_gui_wm_py mod;
    tools_boot_wl_py["boot_wl.py (py)"]
    class tools_boot_wl_py mod;
    progs_doomgeneric_statdump_c["statdump.c (c)"]
    class progs_doomgeneric_statdump_c mod;
    progs_doomgeneric_r_segs_c["r_segs.c (c)"]
    class progs_doomgeneric_r_segs_c mod;
    progs_doomgeneric_w_checksum_c["w_checksum.c (c)"]
    class progs_doomgeneric_w_checksum_c mod;
    progs_doomgeneric_p_telept_c["p_telept.c (c)"]
    class progs_doomgeneric_p_telept_c mod;
    net_net_c["net.c (c)"]
    class net_net_c mod;
    fs_minifs_c["minifs.c (c)"]
    class fs_minifs_c mod;
    kernel_proc_sec_c["proc_sec.c (c)"]
    class kernel_proc_sec_c mod;
    progs_quake2generic_q2generic_minios_c["q2generic_minios.c (c)"]
    class progs_quake2generic_q2generic_minios_c mod;
    progs_doomgeneric_p_maputl_c["p_maputl.c (c)"]
    class progs_doomgeneric_p_maputl_c mod;
    tools_test_gui_fashion_py["test_gui_fashion.py (py)"]
    class tools_test_gui_fashion_py mod;
    tools_test_gui_icon_cwd_py["test_gui_icon_cwd.py (py)"]
    class tools_test_gui_icon_cwd_py mod;
    tools_tls_test_py["tls_test.py (py)"]
    class tools_tls_test_py mod;
    progs_doomgeneric_doomgeneric_sdl_c["doomgeneric_sdl.c (c)"]
    class progs_doomgeneric_doomgeneric_sdl_c mod;
    headers_kernel_h["kernel.h (h)"]
    class headers_kernel_h mod;
    progs_doomgeneric_info_c["info.c (c)"]
    class progs_doomgeneric_info_c mod;
    progs_doomgeneric_doomstat_h["doomstat.h (h)"]
    class progs_doomgeneric_doomstat_h mod;
    end
    subgraph community_9 ["tools: doom_pwad"]
    tests_test_doom_pwad_py["test_doom_pwad.py (py)"]
    class tests_test_doom_pwad_py mod;
    progs_doomgeneric_p_lights_c["p_lights.c (c)"]
    class progs_doomgeneric_p_lights_c mod;
    tools_repro_gui_py["repro_gui.py (py)"]
    class tools_repro_gui_py mod;
    tools_minios_gui_py["minios_gui.py (py)"]
    class tools_minios_gui_py mod;
    progs_doomgeneric_d_player_h["d_player.h (h)"]
    class progs_doomgeneric_d_player_h mod;
    progs_doomgeneric_i_endoom_c["i_endoom.c (c)"]
    class progs_doomgeneric_i_endoom_c mod;
    progs_doomgeneric_p_mobj_h["p_mobj.h (h)"]
    class progs_doomgeneric_p_mobj_h mod;
    progs_minicraft_minicraft_c["minicraft.c (c)"]
    class progs_minicraft_minicraft_c mod;
    drivers_sb16_c["sb16.c (c)"]
    class drivers_sb16_c mod;
    fs_ext4_c["ext4.c (c)"]
    class fs_ext4_c mod;
    fs_fat32_c["fat32.c (c)"]
    class fs_fat32_c mod;
    net_rtl8139_c["rtl8139.c (c)"]
    class net_rtl8139_c mod;
    kernel_mm_cow_c["cow.c (c)"]
    class kernel_mm_cow_c mod;
    kernel_syscalls_proc_c["syscalls_proc.c (c)"]
    class kernel_syscalls_proc_c mod;
    progs_doomgeneric_sha1_c["sha1.c (c)"]
    class progs_doomgeneric_sha1_c mod;
    progs_src_lxsel_c["lxsel.c (c)"]
    class progs_src_lxsel_c mod;
    progs_doomgeneric_gusconf_c["gusconf.c (c)"]
    class progs_doomgeneric_gusconf_c mod;
    progs_doomgeneric_doomdef_h["doomdef.h (h)"]
    class progs_doomgeneric_doomdef_h mod;
    progs_doomgeneric_m_controls_c["m_controls.c (c)"]
    class progs_doomgeneric_m_controls_c mod;
    progs_src_pip_c["pip.c (c)"]
    class progs_src_pip_c mod;
    progs_doomgeneric_w_file_c["w_file.c (c)"]
    class progs_doomgeneric_w_file_c mod;
    tools_probe_compute_vga_py["probe_compute_vga.py (py)"]
    class tools_probe_compute_vga_py mod;
    tools_probe_minicraft_py["probe_minicraft.py (py)"]
    class tools_probe_minicraft_py mod;
    kernel_mm_tlb_c["tlb.c (c)"]
    class kernel_mm_tlb_c mod;
    progs_src_test_py_py["test_py.py (py)"]
    class progs_src_test_py_py mod;
    tests_test_pcache_c["test_pcache.c (c)"]
    class tests_test_pcache_c mod;
    tests_test_usbhid_c["test_usbhid.c (c)"]
    class tests_test_usbhid_c mod;
    tests_test_usbblk_c["test_usbblk.c (c)"]
    class tests_test_usbblk_c mod;
    tools_update_sources_py["update_sources.py (py)"]
    class tools_update_sources_py mod;
    progs_doomgeneric_net_client_h["net_client.h (h)"]
    class progs_doomgeneric_net_client_h mod;
    mcp_minios_addons_py["minios_addons.py (py)"]
    class mcp_minios_addons_py mod;
    progs_doomgeneric_deh_main_h["deh_main.h (h)"]
    class progs_doomgeneric_deh_main_h mod;
    progs_doomgeneric_i_cdmus_c["i_cdmus.c (c)"]
    class progs_doomgeneric_i_cdmus_c mod;
    progs_doomgeneric_memio_c["memio.c (c)"]
    class progs_doomgeneric_memio_c mod;
    progs_doomgeneric_p_user_c["p_user.c (c)"]
    class progs_doomgeneric_p_user_c mod;
    mcp_mcp_dbg_driver_py["mcp_dbg_driver.py (py)"]
    class mcp_mcp_dbg_driver_py mod;
    mcp_mcp_dogfood_py["mcp_dogfood.py (py)"]
    class mcp_mcp_dogfood_py mod;
    tools_minios_cli_py["minios_cli.py (py)"]
    class tools_minios_cli_py mod;
    progs_doomgeneric_p_sight_c["p_sight.c (c)"]
    class progs_doomgeneric_p_sight_c mod;
    tools_gdb_repro_py["gdb_repro.py (py)"]
    class tools_gdb_repro_py mod;
    tests_test_xhci_c["test_xhci.c (c)"]
    class tests_test_xhci_c mod;
    drivers_xhci_c["xhci.c (c)"]
    class drivers_xhci_c mod;
    drivers_nvme_c["nvme.c (c)"]
    class drivers_nvme_c mod;
    drivers_usbblk_c["usbblk.c (c)"]
    class drivers_usbblk_c mod;
    drivers_virtio_net_c["virtio_net.c (c)"]
    class drivers_virtio_net_c mod;
    fs_vfs_c["vfs.c (c)"]
    class fs_vfs_c mod;
    tests_test_mip_py["test_mip.py (py)"]
    class tests_test_mip_py mod;
    drivers_virtio_blk_c["virtio_blk.c (c)"]
    class drivers_virtio_blk_c mod;
    kernel_console_c["console.c (c)"]
    class kernel_console_c mod;
    headers_futex_h["futex.h (h)"]
    class headers_futex_h mod;
    progs_doomgeneric_net_defs_h["net_defs.h (h)"]
    class progs_doomgeneric_net_defs_h mod;
    progs_src_opl3_c["opl3.c (c)"]
    class progs_src_opl3_c mod;
    progs_doomgeneric_w_wad_h["w_wad.h (h)"]
    class progs_doomgeneric_w_wad_h mod;
    progs_quake2generic_snddma_minios_c["snddma_minios.c (c)"]
    class progs_quake2generic_snddma_minios_c mod;
    progs_src_apsse_c["apsse.c (c)"]
    class progs_src_apsse_c mod;
    tests_test_ldso_c["test_ldso.c (c)"]
    class tests_test_ldso_c mod;
    progs_src_lxtls_c["lxtls.c (c)"]
    class progs_src_lxtls_c mod;
    progs_src_lxproc_c["lxproc.c (c)"]
    class progs_src_lxproc_c mod;
    progs_lua_lua_main_c["lua_main.c (c)"]
    class progs_lua_lua_main_c mod;
    tools_test_gui_gfxview_py["test_gui_gfxview.py (py)"]
    class tools_test_gui_gfxview_py mod;
    progs_doomgeneric_i_timer_c["i_timer.c (c)"]
    class progs_doomgeneric_i_timer_c mod;
    fs_fsimg_c["fsimg.c (c)"]
    class fs_fsimg_c mod;
    progs_doomgeneric_w_file_stdc_c["w_file_stdc.c (c)"]
    class progs_doomgeneric_w_file_stdc_c mod;
    kernel_panic_c["panic.c (c)"]
    class kernel_panic_c mod;
    tests_test_leakcheck_c["test_leakcheck.c (c)"]
    class tests_test_leakcheck_c mod;
    progs_doomgeneric_m_fixed_c["m_fixed.c (c)"]
    class progs_doomgeneric_m_fixed_c mod;
    progs_freedomui_media_unavailable_c["media_unavailable.c (c)"]
    class progs_freedomui_media_unavailable_c mod;
    tools_test_gui_zoom_py["test_gui_zoom.py (py)"]
    class tools_test_gui_zoom_py mod;
    progs_nuklear_cvm_emit_c["cvm_emit.c (c)"]
    class progs_nuklear_cvm_emit_c mod;
    net_tls_c["tls.c (c)"]
    class net_tls_c mod;
    progs_doomgeneric_g_game_h["g_game.h (h)"]
    class progs_doomgeneric_g_game_h mod;
    progs_doomgeneric_st_stuff_h["st_stuff.h (h)"]
    class progs_doomgeneric_st_stuff_h mod;
    progs_doomgeneric_z_zone_c["z_zone.c (c)"]
    class progs_doomgeneric_z_zone_c mod;
    tests_test_seccomp_bpf_c["test_seccomp_bpf.c (c)"]
    class tests_test_seccomp_bpf_c mod;
    tools_test_lisp_py["test_lisp.py (py)"]
    class tools_test_lisp_py mod;
    tests_stubs_kernel_h["kernel.h (h)"]
    class tests_stubs_kernel_h mod;
    tests_test_ps2_keymap_c["test_ps2_keymap.c (c)"]
    class tests_test_ps2_keymap_c mod;
    tests_test_minifs_tools_py["test_minifs_tools.py (py)"]
    class tests_test_minifs_tools_py mod;
    progs_doomgeneric_doomgeneric_win_c["doomgeneric_win.c (c)"]
    class progs_doomgeneric_doomgeneric_win_c mod;
    tests_test_minios_png_c["test_minios_png.c (c)"]
    class tests_test_minios_png_c mod;
    headers_spawn_h["spawn.h (h)"]
    class headers_spawn_h mod;
    tests_test_pcm_c["test_pcm.c (c)"]
    class tests_test_pcm_c mod;
    progs_nuklear_nuklear_theme_c["nuklear_theme.c (c)"]
    class progs_nuklear_nuklear_theme_c mod;
    progs_doomgeneric_p_tick_c["p_tick.c (c)"]
    class progs_doomgeneric_p_tick_c mod;
    tests_test_driver_c["test_driver.c (c)"]
    class tests_test_driver_c mod;
    progs_doomgeneric_p_pspr_h["p_pspr.h (h)"]
    class progs_doomgeneric_p_pspr_h mod;
    tools_qga_client_py["qga_client.py (py)"]
    class tools_qga_client_py mod;
    tools_test_http_server_py["test_http_server.py (py)"]
    class tools_test_http_server_py mod;
    progs_doomgeneric_m_cheat_c["m_cheat.c (c)"]
    class progs_doomgeneric_m_cheat_c mod;
    progs_doomgeneric_r_sky_c["r_sky.c (c)"]
    class progs_doomgeneric_r_sky_c mod;
    tools_test_gui_menu_py["test_gui_menu.py (py)"]
    class tools_test_gui_menu_py mod;
    headers_sched_h["sched.h (h)"]
    class headers_sched_h mod;
    headers_vga_fb_h["vga_fb.h (h)"]
    class headers_vga_fb_h mod;
    progs_freedomui_ps2_keymap_c["ps2_keymap.c (c)"]
    class progs_freedomui_ps2_keymap_c mod;
    progs_src_freedom_c["freedom.c (c)"]
    class progs_src_freedom_c mod;
    headers_sync_h["sync.h (h)"]
    class headers_sync_h mod;
    qga_c["qga.c (c)"]
    class qga_c mod;
    headers_leakcheck_h["leakcheck.h (h)"]
    class headers_leakcheck_h mod;
    tools_sign_elf_py["sign_elf.py (py)"]
    class tools_sign_elf_py mod;
    kernel_editor_c["editor.c (c)"]
    class kernel_editor_c mod;
    drivers_ide_c["ide.c (c)"]
    class drivers_ide_c mod;
    drivers_pcspk_c["pcspk.c (c)"]
    class drivers_pcspk_c mod;
    headers_rcu_h["rcu.h (h)"]
    class headers_rcu_h mod;
    progs_lua_minios_c["minios.c (c)"]
    class progs_lua_minios_c mod;
    tools_wm_layout_sync_py["wm_layout_sync.py (py)"]
    class tools_wm_layout_sync_py mod;
    progs_micropython_variants_minios_lib_mip_py["mip.py (py)"]
    class progs_micropython_variants_minios_lib_mip_py mod;
    headers_percpu_rq_h["percpu_rq.h (h)"]
    class headers_percpu_rq_h mod;
    kernel_vga_cursor_c["vga_cursor.c (c)"]
    class kernel_vga_cursor_c mod;
    kernel_mm_swap_c["swap.c (c)"]
    class kernel_mm_swap_c mod;
    kernel_mm_c["mm.c (c)"]
    class kernel_mm_c mod;
    tests_test_fault_c["test_fault.c (c)"]
    class tests_test_fault_c mod;
    progs_src_thdemo_c["thdemo.c (c)"]
    class progs_src_thdemo_c mod;
    tests_test_file_assoc_c["test_file_assoc.c (c)"]
    class tests_test_file_assoc_c mod;
    kernel_vga_fx_c["vga_fx.c (c)"]
    class kernel_vga_fx_c mod;
    progs_src_fptest_c["fptest.c (c)"]
    class progs_src_fptest_c mod;
    tests_test_sanitize_c["test_sanitize.c (c)"]
    class tests_test_sanitize_c mod;
    tests_test_select_map_c["test_select_map.c (c)"]
    class tests_test_select_map_c mod;
    tests_test_theme_c["test_theme.c (c)"]
    class tests_test_theme_c mod;
    drivers_mouse_c["mouse.c (c)"]
    class drivers_mouse_c mod;
    tests_test_vma_bench_c["test_vma_bench.c (c)"]
    class tests_test_vma_bench_c mod;
    tools_check_surprising_py["check_surprising.py (py)"]
    class tools_check_surprising_py mod;
    tests_test_sign_c["test_sign.c (c)"]
    class tests_test_sign_c mod;
    tools_test_call_align_py["test_call_align.py (py)"]
    class tools_test_call_align_py mod;
    progs_doomgeneric_sounds_c["sounds.c (c)"]
    class progs_doomgeneric_sounds_c mod;
    tools_mkramdisk_py["mkramdisk.py (py)"]
    class tools_mkramdisk_py mod;
    tests_test_abi_c["test_abi.c (c)"]
    class tests_test_abi_c mod;
    tests_test_arena_c["test_arena.c (c)"]
    class tests_test_arena_c mod;
    tests_test_freedomui_c["test_freedomui.c (c)"]
    class tests_test_freedomui_c mod;
    tests_test_httpd_c["test_httpd.c (c)"]
    class tests_test_httpd_c mod;
    progs_topogpt3_topogpt3_c["topogpt3.c (c)"]
    class progs_topogpt3_topogpt3_c mod;
    progs_doomgeneric_p_local_h["p_local.h (h)"]
    class progs_doomgeneric_p_local_h mod;
    net_tls_crypto_c["tls_crypto.c (c)"]
    class net_tls_crypto_c mod;
    progs_doomgeneric_r_state_h["r_state.h (h)"]
    class progs_doomgeneric_r_state_h mod;
    progs_doomgeneric_r_main_h["r_main.h (h)"]
    class progs_doomgeneric_r_main_h mod;
    progs_doomgeneric_v_video_h["v_video.h (h)"]
    class progs_doomgeneric_v_video_h mod;
    net_tls_x509_c["tls_x509.c (c)"]
    class net_tls_x509_c mod;
    progs_doomgeneric_tables_h["tables.h (h)"]
    class progs_doomgeneric_tables_h mod;
    progs_micropython_variants_minios_minios_module_c["minios_module.c (c)"]
    class progs_micropython_variants_minios_minios_module_c mod;
    progs_wl_wl_pixbuf_h["wl_pixbuf.h (h)"]
    class progs_wl_wl_pixbuf_h mod;
    progs_file_file_assoc_h["file_assoc.h (h)"]
    class progs_file_file_assoc_h mod;
    progs_doomgeneric_s_sound_h["s_sound.h (h)"]
    class progs_doomgeneric_s_sound_h mod;
    progs_doomgeneric_m_misc_h["m_misc.h (h)"]
    class progs_doomgeneric_m_misc_h mod;
    progs_doomgeneric_i_system_h["i_system.h (h)"]
    class progs_doomgeneric_i_system_h mod;
    progs_doomgeneric_doomdata_h["doomdata.h (h)"]
    class progs_doomgeneric_doomdata_h mod;
    kernel_futex_c["futex.c (c)"]
    class kernel_futex_c mod;
    tests_test_vma_c["test_vma.c (c)"]
    class tests_test_vma_c mod;
    headers_shell_h["shell.h (h)"]
    class headers_shell_h mod;
    progs_doomgeneric_am_map_h["am_map.h (h)"]
    class progs_doomgeneric_am_map_h mod;
    progs_src_sbtone_c["sbtone.c (c)"]
    class progs_src_sbtone_c mod;
    progs_doomgeneric_r_data_h["r_data.h (h)"]
    class progs_doomgeneric_r_data_h mod;
    progs_doomgeneric_d_mode_c["d_mode.c (c)"]
    class progs_doomgeneric_d_mode_c mod;
    tools_check_mutant_anchors_py["check_mutant_anchors.py (py)"]
    class tools_check_mutant_anchors_py mod;
    progs_doomgeneric_f_finale_h["f_finale.h (h)"]
    class progs_doomgeneric_f_finale_h mod;
    tools_check_cohesion_py["check_cohesion.py (py)"]
    class tools_check_cohesion_py mod;
    progs_src_shell_py["shell.py (py)"]
    class progs_src_shell_py mod;
    tools_check_complexity_py["check_complexity.py (py)"]
    class tools_check_complexity_py mod;
    tools_gen_icons_py["gen_icons.py (py)"]
    class tools_gen_icons_py mod;
    tools_check_addons_py["check_addons.py (py)"]
    class tools_check_addons_py mod;
    tools_check_kb_sync_py["check_kb_sync.py (py)"]
    class tools_check_kb_sync_py mod;
    tools_gen_desktop_pngs_py["gen_desktop_pngs.py (py)"]
    class tools_gen_desktop_pngs_py mod;
    progs_doomgeneric_d_items_c["d_items.c (c)"]
    class progs_doomgeneric_d_items_c mod;
    fs_kfile_c["kfile.c (c)"]
    class fs_kfile_c mod;
    progs_nuklear_nuklear_minios_h["nuklear_minios.h (h)"]
    class progs_nuklear_nuklear_minios_h mod;
    drivers_rtc_c["rtc.c (c)"]
    class drivers_rtc_c mod;
    tools_doom_pwad_py["doom_pwad.py (py)"]
    class tools_doom_pwad_py mod;
    tools_mkfs_minifs_py["mkfs.minifs.py (py)"]
    class tools_mkfs_minifs_py mod;
    tests_test_paint_c["test_paint.c (c)"]
    class tests_test_paint_c mod;
    tools_minifs_saves_py["minifs_saves.py (py)"]
    class tools_minifs_saves_py mod;
    progs_src_test_py["test.py (py)"]
    class progs_src_test_py mod;
    tools_minifs_fsck_py["minifs_fsck.py (py)"]
    class tools_minifs_fsck_py mod;
    fs_pcache_c["pcache.c (c)"]
    class fs_pcache_c mod;
    tests_test_vedit_build_c["test_vedit_build.c (c)"]
    class tests_test_vedit_build_c mod;
    progs_doomgeneric_doomtype_h["doomtype.h (h)"]
    class progs_doomgeneric_doomtype_h mod;
    end
    subgraph community_8 ["headers: tick"]
    kernel_tick_c["tick.c (c)"]
    class kernel_tick_c mod;
    progs_doomgeneric_deh_str_h["deh_str.h (h)"]
    class progs_doomgeneric_deh_str_h mod;
    kernel_lz4_kernel_c["lz4_kernel.c (c)"]
    class kernel_lz4_kernel_c mod;
    kernel_serial_c["serial.c (c)"]
    class kernel_serial_c mod;
    tools_kernel_feature_survey_py["kernel_feature_survey.py (py)"]
    class tools_kernel_feature_survey_py mod;
    progs_doomgeneric_w_file_h["w_file.h (h)"]
    class progs_doomgeneric_w_file_h mod;
    tests_test_futex_c["test_futex.c (c)"]
    class tests_test_futex_c mod;
    tests_test_pci_c["test_pci.c (c)"]
    class tests_test_pci_c mod;
    tests_test_sync_c["test_sync.c (c)"]
    class tests_test_sync_c mod;
    tests_test_tick_c["test_tick.c (c)"]
    class tests_test_tick_c mod;
    tests_test_panic_c["test_panic.c (c)"]
    class tests_test_panic_c mod;
    tools_check_abi_numbers_py["check_abi_numbers.py (py)"]
    class tools_check_abi_numbers_py mod;
    end
    progs_doomgeneric_d_main_c ~~~ progs_doomgeneric_am_map_c
    progs_doomgeneric_g_game_c ~~~ progs_doomgeneric_hu_stuff_c
    progs_doomgeneric_m_menu_c ~~~ progs_doomgeneric_d_net_c
    progs_doomgeneric_st_stuff_c ~~~ progs_doomgeneric_s_sound_c
    progs_doomgeneric_i_input_c ~~~ progs_doomgeneric_wi_stuff_c
    progs_doomgeneric_i_system_c ~~~ progs_doomgeneric_m_misc_c
    progs_doomgeneric_am_map_c ~~~ progs_doomgeneric_f_finale_c
    progs_doomgeneric_hu_stuff_c ~~~ progs_doomgeneric_v_video_c
    progs_doomgeneric_d_net_c ~~~ progs_doomgeneric_d_iwad_c
    progs_doomgeneric_s_sound_c ~~~ progs_doomgeneric_i_video_c
    progs_doomgeneric_wi_stuff_c ~~~ progs_doomgeneric_w_wad_c
    progs_doomgeneric_m_misc_c ~~~ progs_doomgeneric_p_saveg_c
    progs_doomgeneric_f_finale_c ~~~ progs_doomgeneric_m_config_c
    progs_doomgeneric_v_video_c ~~~ progs_doomgeneric_st_lib_c
    progs_doomgeneric_d_iwad_c ~~~ progs_doomgeneric_i_sound_c
    progs_doomgeneric_i_video_c ~~~ progs_doomgeneric_i_joystick_c
    progs_doomgeneric_w_wad_c ~~~ progs_doomgeneric_i_minios_sound_c
    progs_doomgeneric_p_saveg_c ~~~ progs_doomgeneric_r_things_c
    progs_doomgeneric_m_config_c ~~~ progs_doomgeneric_r_draw_c
    progs_doomgeneric_st_lib_c ~~~ progs_doomgeneric_doomgeneric_soso_c
    progs_doomgeneric_i_sound_c ~~~ progs_doomgeneric_doomgeneric_sosox_c
    progs_doomgeneric_i_joystick_c ~~~ progs_doomgeneric_f_wipe_c
    progs_doomgeneric_i_minios_sound_c ~~~ progs_doomgeneric_w_main_c
    progs_doomgeneric_r_things_c ~~~ progs_doomgeneric_m_argv_c
    progs_doomgeneric_r_draw_c ~~~ progs_doomgeneric_i_scale_c
    progs_doomgeneric_doomgeneric_soso_c ~~~ progs_doomgeneric_w_checksum_c
    progs_doomgeneric_doomgeneric_sosox_c ~~~ progs_doomgeneric_doomgeneric_sdl_c
    progs_doomgeneric_f_wipe_c ~~~ progs_doomgeneric_i_endoom_c
    progs_doomgeneric_w_main_c ~~~ progs_doomgeneric_gusconf_c
    progs_doomgeneric_m_argv_c ~~~ progs_doomgeneric_m_controls_c
    progs_doomgeneric_i_scale_c ~~~ progs_doomgeneric_w_file_c
    progs_doomgeneric_w_checksum_c ~~~ progs_doomgeneric_deh_main_h
    progs_doomgeneric_doomgeneric_sdl_c ~~~ progs_doomgeneric_i_cdmus_c
    progs_doomgeneric_i_endoom_c ~~~ progs_doomgeneric_w_wad_h
    progs_doomgeneric_gusconf_c ~~~ progs_doomgeneric_i_timer_c
    progs_doomgeneric_m_controls_c ~~~ progs_doomgeneric_w_file_stdc_c
    progs_doomgeneric_w_file_c ~~~ progs_doomgeneric_m_fixed_c
    progs_doomgeneric_deh_main_h ~~~ progs_doomgeneric_g_game_h
    progs_doomgeneric_i_cdmus_c ~~~ progs_doomgeneric_st_stuff_h
    progs_doomgeneric_w_wad_h ~~~ progs_doomgeneric_z_zone_c
    progs_doomgeneric_i_timer_c ~~~ progs_doomgeneric_doomgeneric_win_c
    progs_doomgeneric_w_file_stdc_c ~~~ progs_doomgeneric_m_cheat_c
    progs_doomgeneric_m_fixed_c ~~~ progs_doomgeneric_v_video_h
    progs_doomgeneric_g_game_h ~~~ progs_doomgeneric_m_misc_h
    progs_doomgeneric_st_stuff_h ~~~ progs_doomgeneric_i_system_h
    progs_doomgeneric_z_zone_c ~~~ progs_doomgeneric_am_map_h
    progs_doomgeneric_doomgeneric_win_c ~~~ progs_doomgeneric_f_finale_h
    progs_doomgeneric_m_cheat_c ~~~ progs_doomgeneric_doomtype_h
    progs_doomgeneric_v_video_h ~~~ progs_doomgeneric_deh_str_h
    progs_doomgeneric_m_misc_h ~~~ progs_doomgeneric_w_file_h
    kernel_syscalls_c ~~~ tests_test_fat32_c
    kernel_shell_c ~~~ kernel_spawn_c
    kernel_sched_c ~~~ kernel_minifetch_c
    kernel_c ~~~ kernel_loader_c
    kernel_mm_paging_c ~~~ drivers_pcm2_c
    tests_test_ext4_c ~~~ smp_c
    tests_test_fat32_c ~~~ drivers_kbd_c
    kernel_spawn_c ~~~ kernel_console_in_c
    kernel_minifetch_c ~~~ drivers_usbhid_c
    kernel_loader_c ~~~ drivers_block_c
    drivers_pcm2_c ~~~ kernel_exec_c
    smp_c ~~~ net_net_c
    drivers_kbd_c ~~~ fs_minifs_c
    kernel_console_in_c ~~~ kernel_proc_sec_c
    drivers_usbhid_c ~~~ headers_kernel_h
    drivers_block_c ~~~ drivers_sb16_c
    kernel_exec_c ~~~ fs_ext4_c
    net_net_c ~~~ fs_fat32_c
    fs_minifs_c ~~~ net_rtl8139_c
    kernel_proc_sec_c ~~~ kernel_mm_cow_c
    headers_kernel_h ~~~ kernel_syscalls_proc_c
    drivers_sb16_c ~~~ kernel_mm_tlb_c
    fs_ext4_c ~~~ tests_test_pcache_c
    fs_fat32_c ~~~ tests_test_usbhid_c
    net_rtl8139_c ~~~ tests_test_usbblk_c
    kernel_mm_cow_c ~~~ tests_test_xhci_c
    kernel_syscalls_proc_c ~~~ drivers_xhci_c
    kernel_mm_tlb_c ~~~ drivers_nvme_c
    tests_test_pcache_c ~~~ drivers_usbblk_c
    tests_test_usbhid_c ~~~ drivers_virtio_net_c
    tests_test_usbblk_c ~~~ fs_vfs_c
    tests_test_xhci_c ~~~ drivers_virtio_blk_c
    drivers_xhci_c ~~~ kernel_console_c
    drivers_nvme_c ~~~ headers_futex_h
    drivers_usbblk_c ~~~ tests_test_ldso_c
    drivers_virtio_net_c ~~~ fs_fsimg_c
    fs_vfs_c ~~~ kernel_panic_c
    drivers_virtio_blk_c ~~~ headers_spawn_h
    kernel_console_c ~~~ tests_test_driver_c
    headers_futex_h ~~~ headers_sched_h
    tests_test_ldso_c ~~~ headers_vga_fb_h
    fs_fsimg_c ~~~ headers_sync_h
    kernel_panic_c ~~~ qga_c
    headers_spawn_h ~~~ kernel_editor_c
    tests_test_driver_c ~~~ drivers_ide_c
    headers_sched_h ~~~ drivers_pcspk_c
    headers_vga_fb_h ~~~ headers_rcu_h
    headers_sync_h ~~~ headers_percpu_rq_h
    qga_c ~~~ kernel_mm_swap_c
    kernel_editor_c ~~~ kernel_mm_c
    drivers_ide_c ~~~ tests_test_fault_c
    drivers_pcspk_c ~~~ drivers_mouse_c
    headers_rcu_h ~~~ tests_test_vma_bench_c
    headers_percpu_rq_h ~~~ kernel_futex_c
    kernel_mm_swap_c ~~~ tests_test_vma_c
    kernel_mm_c ~~~ headers_shell_h
    tests_test_fault_c ~~~ fs_kfile_c
    drivers_mouse_c ~~~ drivers_rtc_c
    tests_test_vma_bench_c ~~~ fs_pcache_c
    kernel_futex_c ~~~ kernel_lz4_kernel_c
    tests_test_vma_c ~~~ kernel_serial_c
    headers_shell_h ~~~ tests_test_futex_c
    fs_kfile_c ~~~ tests_test_pci_c
    drivers_rtc_c ~~~ tests_test_sync_c
    fs_pcache_c ~~~ tests_test_panic_c
    progs_doomgeneric_p_spec_c ~~~ progs_doomgeneric_p_enemy_c
    progs_doomgeneric_p_map_c ~~~ progs_doomgeneric_p_plats_c
    progs_doomgeneric_p_setup_c ~~~ progs_doomgeneric_p_switch_c
    progs_doomgeneric_r_data_c ~~~ progs_doomgeneric_p_pspr_c
    progs_doomgeneric_p_inter_c ~~~ progs_doomgeneric_p_doors_c
    progs_doomgeneric_p_mobj_c ~~~ progs_doomgeneric_r_local_h
    progs_doomgeneric_p_enemy_c ~~~ progs_doomgeneric_r_bsp_c
    progs_doomgeneric_p_plats_c ~~~ progs_doomgeneric_r_plane_c
    progs_doomgeneric_p_switch_c ~~~ progs_doomgeneric_hu_lib_c
    progs_doomgeneric_p_pspr_c ~~~ progs_doomgeneric_r_main_c
    progs_doomgeneric_p_doors_c ~~~ progs_doomgeneric_p_ceilng_c
    progs_doomgeneric_r_local_h ~~~ progs_doomgeneric_p_floor_c
    progs_doomgeneric_r_bsp_c ~~~ progs_doomgeneric_r_defs_h
    progs_doomgeneric_r_plane_c ~~~ progs_doomgeneric_statdump_c
    progs_doomgeneric_hu_lib_c ~~~ progs_doomgeneric_r_segs_c
    progs_doomgeneric_r_main_c ~~~ progs_doomgeneric_p_telept_c
    progs_doomgeneric_p_ceilng_c ~~~ progs_quake2generic_q2generic_minios_c
    progs_doomgeneric_p_floor_c ~~~ progs_doomgeneric_p_maputl_c
    progs_doomgeneric_r_defs_h ~~~ progs_doomgeneric_info_c
    progs_doomgeneric_statdump_c ~~~ progs_doomgeneric_doomstat_h
    progs_doomgeneric_r_segs_c ~~~ progs_doomgeneric_p_lights_c
    progs_doomgeneric_p_telept_c ~~~ progs_doomgeneric_d_player_h
    progs_quake2generic_q2generic_minios_c ~~~ progs_doomgeneric_p_mobj_h
    progs_doomgeneric_p_maputl_c ~~~ progs_doomgeneric_doomdef_h
    progs_doomgeneric_info_c ~~~ progs_doomgeneric_p_user_c
    progs_doomgeneric_doomstat_h ~~~ progs_doomgeneric_p_sight_c
    progs_doomgeneric_p_lights_c ~~~ progs_doomgeneric_p_tick_c
    progs_doomgeneric_d_player_h ~~~ progs_doomgeneric_p_pspr_h
    progs_doomgeneric_p_mobj_h ~~~ progs_doomgeneric_r_sky_c
    progs_doomgeneric_doomdef_h ~~~ progs_doomgeneric_sounds_c
    progs_doomgeneric_p_user_c ~~~ progs_doomgeneric_p_local_h
    progs_doomgeneric_p_sight_c ~~~ progs_doomgeneric_r_state_h
    progs_doomgeneric_p_tick_c ~~~ progs_doomgeneric_r_main_h
    progs_doomgeneric_p_pspr_h ~~~ progs_doomgeneric_tables_h
    progs_doomgeneric_r_sky_c ~~~ progs_doomgeneric_s_sound_h
    progs_doomgeneric_sounds_c ~~~ progs_doomgeneric_doomdata_h
    progs_doomgeneric_p_local_h ~~~ progs_doomgeneric_r_data_h
    progs_doomgeneric_r_state_h ~~~ progs_doomgeneric_d_mode_c
    progs_doomgeneric_r_main_h ~~~ progs_doomgeneric_d_items_c
    progs_src_lxabi_c ~~~ tools_minios_hyper_py
    progs_tls_u_tls_u_port_c ~~~ tools_test_gui_freedom_py
    progs_tls_u_tls_u_main_c ~~~ headers_tls_port_h
    tls_test_c ~~~ tools_test_gui_wm_py
    progs_doomgeneric_doomgeneric_xlib_c ~~~ tools_boot_wl_py
    mcp_minios_mcp_py ~~~ tools_test_gui_fashion_py
    tools_minios_hyper_py ~~~ tools_test_gui_icon_cwd_py
    tools_test_gui_freedom_py ~~~ tools_tls_test_py
    headers_tls_port_h ~~~ tools_repro_gui_py
    tools_test_gui_wm_py ~~~ tools_minios_gui_py
    tools_boot_wl_py ~~~ progs_src_lxsel_c
    tools_test_gui_fashion_py ~~~ tools_probe_compute_vga_py
    tools_test_gui_icon_cwd_py ~~~ tools_probe_minicraft_py
    tools_tls_test_py ~~~ progs_src_test_py_py
    tools_repro_gui_py ~~~ mcp_minios_addons_py
    tools_minios_gui_py ~~~ mcp_mcp_dbg_driver_py
    progs_src_lxsel_c ~~~ mcp_mcp_dogfood_py
    tools_probe_compute_vga_py ~~~ tools_minios_cli_py
    tools_probe_minicraft_py ~~~ tools_gdb_repro_py
    progs_src_test_py_py ~~~ tools_test_gui_gfxview_py
    mcp_minios_addons_py ~~~ tools_test_gui_zoom_py
    mcp_mcp_dbg_driver_py ~~~ net_tls_c
    mcp_mcp_dogfood_py ~~~ tools_qga_client_py
    tools_minios_cli_py ~~~ tools_test_http_server_py
    tools_gdb_repro_py ~~~ tools_test_gui_menu_py
    tools_test_gui_gfxview_py ~~~ progs_lua_minios_c
    tools_test_gui_zoom_py ~~~ progs_micropython_variants_minios_lib_mip_py
    net_tls_c ~~~ net_tls_crypto_c
    tools_qga_client_py ~~~ net_tls_x509_c
    tools_test_http_server_py ~~~ progs_src_shell_py
    tools_test_gui_menu_py ~~~ progs_src_test_py
    progs_file_file_c ~~~ progs_piano_piano_c
    progs_nuklear_node_editor_c ~~~ progs_src_freedom_wl_c
    progs_wl_wlcomp_c ~~~ progs_src_lxsecc_c
    progs_pokemon_platform_minios_c ~~~ tests_test_wl_c
    progs_freedomui_freedomui_minios_c ~~~ progs_vedit_vedit_c
    progs_src_lxnet_c ~~~ progs_lisp_lisp_c
    progs_piano_piano_c ~~~ progs_paint_paint_c
    progs_src_freedom_wl_c ~~~ progs_nuklear_nuklear_minios_c
    progs_src_lxsecc_c ~~~ progs_freedomui_platform_minios_c
    tests_test_wl_c ~~~ progs_doomgeneric_doomgeneric_minios_c
    progs_vedit_vedit_c ~~~ progs_doomedit_doomedit_c
    progs_lisp_lisp_c ~~~ progs_minicraft_minicraft_c
    progs_paint_paint_c ~~~ progs_src_pip_c
    progs_nuklear_nuklear_minios_c ~~~ progs_doomgeneric_memio_c
    progs_freedomui_platform_minios_c ~~~ progs_src_opl3_c
    progs_doomgeneric_doomgeneric_minios_c ~~~ progs_quake2generic_snddma_minios_c
    progs_doomedit_doomedit_c ~~~ progs_src_apsse_c
    progs_minicraft_minicraft_c ~~~ progs_src_lxtls_c
    progs_src_pip_c ~~~ progs_src_lxproc_c
    progs_doomgeneric_memio_c ~~~ progs_lua_lua_main_c
    progs_src_opl3_c ~~~ tests_test_leakcheck_c
    progs_quake2generic_snddma_minios_c ~~~ progs_freedomui_media_unavailable_c
    progs_src_apsse_c ~~~ progs_nuklear_cvm_emit_c
    progs_src_lxtls_c ~~~ tests_test_seccomp_bpf_c
    progs_src_lxproc_c ~~~ tests_stubs_kernel_h
    progs_lua_lua_main_c ~~~ tests_test_ps2_keymap_c
    tests_test_leakcheck_c ~~~ tests_test_minios_png_c
    progs_freedomui_media_unavailable_c ~~~ tests_test_pcm_c
    progs_nuklear_cvm_emit_c ~~~ progs_nuklear_nuklear_theme_c
    tests_test_seccomp_bpf_c ~~~ progs_freedomui_ps2_keymap_c
    tests_stubs_kernel_h ~~~ progs_src_freedom_c
    tests_test_ps2_keymap_c ~~~ headers_leakcheck_h
    tests_test_minios_png_c ~~~ progs_src_thdemo_c
    tests_test_pcm_c ~~~ tests_test_file_assoc_c
    progs_nuklear_nuklear_theme_c ~~~ progs_src_fptest_c
    progs_freedomui_ps2_keymap_c ~~~ tests_test_sanitize_c
    progs_src_freedom_c ~~~ tests_test_select_map_c
    headers_leakcheck_h ~~~ tests_test_theme_c
    progs_src_thdemo_c ~~~ tests_test_sign_c
    tests_test_file_assoc_c ~~~ tests_test_abi_c
    progs_src_fptest_c ~~~ tests_test_arena_c
    tests_test_sanitize_c ~~~ tests_test_freedomui_c
    tests_test_select_map_c ~~~ tests_test_httpd_c
    tests_test_theme_c ~~~ progs_topogpt3_topogpt3_c
    tests_test_sign_c ~~~ progs_micropython_variants_minios_minios_module_c
    tests_test_abi_c ~~~ progs_wl_wl_pixbuf_h
    tests_test_arena_c ~~~ progs_file_file_assoc_h
    tests_test_freedomui_c ~~~ progs_src_sbtone_c
    tests_test_httpd_c ~~~ progs_nuklear_nuklear_minios_h
    progs_topogpt3_topogpt3_c ~~~ tests_test_paint_c
    progs_micropython_variants_minios_minios_module_c ~~~ tests_test_vedit_build_c
    mcp_test_minios_mcp_py ~~~ tools_wm_layout_sync_py
    tools_update_sources_py ~~~ tools_check_surprising_py
    tests_test_mip_py ~~~ tools_test_call_align_py
    tools_test_lisp_py ~~~ tools_mkramdisk_py
    tests_test_minifs_tools_py ~~~ tools_check_mutant_anchors_py
    tools_sign_elf_py ~~~ tools_check_cohesion_py
    tools_wm_layout_sync_py ~~~ tools_check_complexity_py
    tools_check_surprising_py ~~~ tools_gen_icons_py
    tools_test_call_align_py ~~~ tools_check_addons_py
    tools_mkramdisk_py ~~~ tools_check_kb_sync_py
    tools_check_mutant_anchors_py ~~~ tools_gen_desktop_pngs_py
    tools_check_cohesion_py ~~~ tools_mkfs_minifs_py
    tools_check_complexity_py ~~~ tools_minifs_saves_py
    tools_gen_icons_py ~~~ tools_minifs_fsck_py
    tools_check_addons_py ~~~ tools_kernel_feature_survey_py
    tools_check_kb_sync_py ~~~ tools_check_abi_numbers_py
```

---

## UML Class Diagram

Auto-generated Mermaid class diagrams from parsed class-level symbols, split into groups of at most 6 classes so each diagram stays readable. Per-module class diagrams with exact members live in `readmenator-apidocs/modules/`.

#### `boot/uefi_stub.c`

```mermaid
classDiagram
  direction LR
  class uefi_stub_c_efi_simple_text_output {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_gop {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_file {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_table_header {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_input_key {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_pixel_bitmask {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_gop_mode_info {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_gop_mode {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_mem_desc {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_boot_services {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_system_table {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_block_io {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_block_media {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_loaded_image {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
  class uefi_stub_c_efi_sfs {
    <<struct>>
    +com1_putc(char c)
    +puts_both(const char *s)
    +puts_con(const u16 *s)
    +put_u64(u64 v)
    +put_hex(u64 v)
    +w_u16(unsigned long addr, unsigned v)
    +w_u32(unsigned long addr, unsigned long v)
    +w_u64(unsigned long addr, unsigned long long v)
    +boot_kernel(unsigned long src, unsigned long len)
    +efi_main(efi_handle image, efi_system_table *systab)
  }
```

#### `drivers/usbblk.c`, `drivers/usbhid.c`, `drivers/virtio_blk.c`

```mermaid
classDiagram
  direction LR
  class usbblk_c_ubk_disk_t {
    <<struct>>
    +ubk_counters(ubk_counters_t *out)
    +ubk_cdb10(unsigned char *cdb, unsigned char opcode,
                      unsigned lo...
    +ubk_build_cbw(unsigned char *out, unsigned tag, unsigned long lba,
                   unsign...
    +ubk_check_csw(const unsigned char *csw, unsigned tag, unsigned expect_len)
    +ubk_command_raw(unsigned char *cdb, unsigned cdb_len,
                           unsig...
    +ubk_sense(void)
    +ubk_command(unsigned char *cdb, unsigned cdb_len,
                       unsigned char...
    +ubk_unit_ready(void)
    +ubk_read_capacity(unsigned long *sectors)
    +ubk_present(void)
  }
  class usbhid_c_usbhid_dev_t {
    <<struct>>
    +usbhid_set1_from_usage(unsigned usage, unsigned char *sc, int *e0)
    +usbhid_usage_make(unsigned usage, unsigned char *sc, int *e0)
    +usbhid_report_has(const unsigned char report[HID_KBD_REPORT_LEN],
                    ...
    +usbhid_put(unsigned char *out, int max, int n, unsigned char sc)
    +usbhid_emit_mod(unsigned char *out, int max, int n, unsigned bit,
                    ...
    +usbhid_emit_usage(unsigned char *out, int max, int n,
                             uns...
    +usbhid_kbd_scancodes(const unsigned char prev[HID_KBD_REPORT_LEN],
                         c...
    +usbhid_mouse_decode(const unsigned char prev[HID_MOUSE_REPORT_LEN],
                        ...
    +usbhid_keyboard_present(void)
    +usbhid_mouse_present(void)
  }
  class virtio_blk_c_vblk_req_t {
    <<struct>>
    +vblk_outl(unsigned short port, unsigned val)
    +vblk_inl(unsigned short port)
    +vblk_outb(unsigned short port, unsigned char val)
    +vblk_inb(unsigned short port)
    +vblk_inw(unsigned short port)
    +vblk_outw(unsigned short port, unsigned short val)
    +vblk_init(void)
    +vblk_present(void)
    +vblk_sectors(void)
    +vblk_desc(unsigned idx, unsigned long addr, unsigned len,
        unsigned short flag...
  }
```

#### `drivers/xhci.c`, `fs/ext4.c`

```mermaid
classDiagram
  direction LR
  class xhci_c_xhc_trb_t {
    <<struct>>
    +xhc_ep_b(void)
    +xhc_stride(void)
    +xhc_put32(unsigned char *base, unsigned off, unsigned val)
    +xhc_get32(const unsigned char *base, unsigned off)
    +xhc_put64(unsigned char *base, unsigned off,
                      unsigned long long...
    +xhc_put16(unsigned char *base, unsigned off, unsigned val)
    +xhc_puttrb(xhc_trb_t *trb, unsigned long long param,
                       unsigned ...
    +xhc_op_read32(unsigned off)
    +xhc_op_write32(unsigned off, unsigned val)
    +xhc_run_write32(unsigned off, unsigned val)
  }
  class xhci_c_xhc_ring_t {
    <<struct>>
    +xhc_ep_b(void)
    +xhc_stride(void)
    +xhc_put32(unsigned char *base, unsigned off, unsigned val)
    +xhc_get32(const unsigned char *base, unsigned off)
    +xhc_put64(unsigned char *base, unsigned off,
                      unsigned long long...
    +xhc_put16(unsigned char *base, unsigned off, unsigned val)
    +xhc_puttrb(xhc_trb_t *trb, unsigned long long param,
                       unsigned ...
    +xhc_op_read32(unsigned off)
    +xhc_op_write32(unsigned off, unsigned val)
    +xhc_run_write32(unsigned off, unsigned val)
  }
  class xhci_c_xhc_pending_t {
    <<struct>>
    +xhc_ep_b(void)
    +xhc_stride(void)
    +xhc_put32(unsigned char *base, unsigned off, unsigned val)
    +xhc_get32(const unsigned char *base, unsigned off)
    +xhc_put64(unsigned char *base, unsigned off,
                      unsigned long long...
    +xhc_put16(unsigned char *base, unsigned off, unsigned val)
    +xhc_puttrb(xhc_trb_t *trb, unsigned long long param,
                       unsigned ...
    +xhc_op_read32(unsigned off)
    +xhc_op_write32(unsigned off, unsigned val)
    +xhc_run_write32(unsigned off, unsigned val)
  }
  class xhci_c_xhc_devrec_t {
    <<struct>>
    +xhc_ep_b(void)
    +xhc_stride(void)
    +xhc_put32(unsigned char *base, unsigned off, unsigned val)
    +xhc_get32(const unsigned char *base, unsigned off)
    +xhc_put64(unsigned char *base, unsigned off,
                      unsigned long long...
    +xhc_put16(unsigned char *base, unsigned off, unsigned val)
    +xhc_puttrb(xhc_trb_t *trb, unsigned long long param,
                       unsigned ...
    +xhc_op_read32(unsigned off)
    +xhc_op_write32(unsigned off, unsigned val)
    +xhc_run_write32(unsigned off, unsigned val)
  }
  class ext4_c_ext_geo_t {
    <<struct>>
    +ext_ld16(const unsigned char *p)
    +ext_ld32(const unsigned char *p)
    +ext_parse_sb(const fsimg_t *img, ext_geo_t *g)
    +ext_inode_off(const fsimg_t *img, const ext_geo_t *g,
                         unsigne...
    +ext_read_inode(const fsimg_t *img, const ext_geo_t *g,
                          unsig...
    +ext_map(const fsimg_t *img, const ext_geo_t *g,
                   const unsigned char...
    +ext_map_leaf(const fsimg_t *img, const ext_geo_t *g,
                        const uns...
    +ext_resolve(const fsimg_t *img, const ext_geo_t *g,
                       const char ...
    +ext_file_block(const fsimg_t *img, const ext_geo_t *g,
                          const...
    +ext4_list(const char *imgpath, const char *dirpath,
              char names[][EXT4_NAME_MAX ...
  }
  class ext4_c_ext_ino_t {
    <<struct>>
    +ext_ld16(const unsigned char *p)
    +ext_ld32(const unsigned char *p)
    +ext_parse_sb(const fsimg_t *img, ext_geo_t *g)
    +ext_inode_off(const fsimg_t *img, const ext_geo_t *g,
                         unsigne...
    +ext_read_inode(const fsimg_t *img, const ext_geo_t *g,
                          unsig...
    +ext_map(const fsimg_t *img, const ext_geo_t *g,
                   const unsigned char...
    +ext_map_leaf(const fsimg_t *img, const ext_geo_t *g,
                        const uns...
    +ext_resolve(const fsimg_t *img, const ext_geo_t *g,
                       const char ...
    +ext_file_block(const fsimg_t *img, const ext_geo_t *g,
                          const...
    +ext4_list(const char *imgpath, const char *dirpath,
              char names[][EXT4_NAME_MAX ...
  }
```

#### `fs/fat32.c`, `fs/pcache.c`, `fs/ramdisk.c`

```mermaid
classDiagram
  direction LR
  class fat32_c_fat_geo_t {
    <<struct>>
    +fat_ld16(const unsigned char *p)
    +fat_ld32(const unsigned char *p)
    +fat_img_open(const char *resolved, fsimg_t *img)
    +fat_parse_bpb(const fsimg_t *img, fat_geo_t *g)
    +fat_mbr_is_fat(unsigned char t)
    +fat_dev_base(void)
    +fat_clus_ok(const fat_geo_t *g, unsigned c)
    +fat_entry(const fsimg_t *img, const fat_geo_t *g,
                     unsigned clus, ...
    +fat_eoc(unsigned v)
    +fat_badch(char c)
  }
  class pcache_c_pcache_slot_t {
    <<struct>>
    +pcache_init(void)
    +pcache_lookup(int ino, unsigned index)
    +pcache_get(int ino, unsigned index, int *is_new)
    +pcache_publish(int ino, unsigned index, const unsigned char *data)
    +pcache_put(int slot)
    +pcache_ref(int ino, unsigned index)
    +pcache_unmap(int ino, unsigned index)
    +pcache_slot_phys(int slot)
    +match(owned, ref dropped unless already zero), 0
 * otherwise. */
int pcache_put_if(int...
    +pcache_ref_if(int ino, unsigned index, unsigned long phys)
  }
  class ramdisk_c_RDSuper {
    <<struct>>
    +ramdisk_reserve(unsigned long want)
    +ramdisk_setup_from(void *data, unsigned size)
    +ramdisk_init(void)
    +ramdisk_open(const char *name)
    +ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)
    +ramdisk_write(RDFile *f, const void *buf, unsigned offset, unsigned len)
    +ramdisk_create(const char *name, unsigned size)
    +ramdisk_resize(RDFile *f, unsigned newsize)
    +ramdisk_list(RDFile **out, int max)
    +ramdisk_count(void)
  }
```

#### `fs/vfs.c`, `headers/arena.h`, `headers/batch.h`

```mermaid
classDiagram
  direction LR
  class vfs_c_vfs_mount_t {
    <<struct>>
    +vfs_init(void)
    +vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver)
    +vfs_unregister(const char *prefix)
    +vfs_open(const char *path, int mode, vfs_file_t *f)
    +taken(ops tables are static, never freed), so a
 * listing can never pin an unmoun...
    +ramdisk_vfs_open(const char *path, int mode, void **handle)
    +ramdisk_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_close(void *handle)
    +ramdisk_vfs_fstat(void *handle, unsigned long *size_out)
  }
  class vfs_c_ramdisk_handle_t {
    <<struct>>
    +vfs_init(void)
    +vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver)
    +vfs_unregister(const char *prefix)
    +vfs_open(const char *path, int mode, vfs_file_t *f)
    +taken(ops tables are static, never freed), so a
 * listing can never pin an unmoun...
    +ramdisk_vfs_open(const char *path, int mode, void **handle)
    +ramdisk_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_close(void *handle)
    +ramdisk_vfs_fstat(void *handle, unsigned long *size_out)
  }
  class vfs_c_minifs_handle_t {
    <<struct>>
    +vfs_init(void)
    +vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver)
    +vfs_unregister(const char *prefix)
    +vfs_open(const char *path, int mode, vfs_file_t *f)
    +taken(ops tables are static, never freed), so a
 * listing can never pin an unmoun...
    +ramdisk_vfs_open(const char *path, int mode, void **handle)
    +ramdisk_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_close(void *handle)
    +ramdisk_vfs_fstat(void *handle, unsigned long *size_out)
  }
  class vfs_c_mem_file_t {
    <<struct>>
    +vfs_init(void)
    +vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver)
    +vfs_unregister(const char *prefix)
    +vfs_open(const char *path, int mode, vfs_file_t *f)
    +taken(ops tables are static, never freed), so a
 * listing can never pin an unmoun...
    +ramdisk_vfs_open(const char *path, int mode, void **handle)
    +ramdisk_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)
    +ramdisk_vfs_close(void *handle)
    +ramdisk_vfs_fstat(void *handle, unsigned long *size_out)
  }
  class arena_h_minios_arena {
    <<struct>>
    +arena_init(arena_t *a, void *block, size_t size)
    +arena_align_up(size_t n, size_t align)
    +arena_bytes_for(size_t count, size_t elem_size)
    +arena_alloc(arena_t *a, size_t size, size_t align)
    +arena_used(const arena_t *a)
    +arena_free_bytes(const arena_t *a)
    +arena_reset(arena_t *a)
    +arena_checkpoint(const arena_t *a)
    +arena_rewind(arena_t *a, size_t checkpoint)
    +arena_contains(const arena_t *a, const void *ptr)
  }
  class batch_h_batch_op_t {
    <<struct>>
    +batch_exec(const batch_op_t *ops, long *results, int count, int *completed, batch_handler_t dispatch);
  }
```

#### `headers/desktop_shortcuts.h`, `headers/driver.h`, `headers/drivers/modifiers.h`

```mermaid
classDiagram
  direction LR
  class desktop_shortcuts_h_desktop_shortcut {
    <<struct>>
    +desktop_shortcuts_load(void);
    +desktop_shortcuts_draw(void);
    +desktop_shortcuts_hit_test(int mx, int my);
  }
  class driver_h_device {
    <<struct>>
    +device_register(device_t *dev);
    +device_find(const char *name);
    +device_find_by_type(int type);
    +device_count(void);
    +device_reset(void);
  }
  class driver_h_block_ops_t {
    <<struct>>
    +device_register(device_t *dev);
    +device_find(const char *name);
    +device_find_by_type(int type);
    +device_count(void);
    +device_reset(void);
  }
  class driver_h_audio_ops_t {
    <<struct>>
    +device_register(device_t *dev);
    +device_find(const char *name);
    +device_find_by_type(int type);
    +device_count(void);
    +device_reset(void);
  }
  class modifiers_h_modifier_state_t {
    <<struct>>
    +modifiers_init(modifier_state_t *st)
    +modifiers_update(const modifier_keys_t *keys,
                                 ...
    +modifiers_match(const modifier_state_t *st, int mask)
  }
  class modifiers_h_modifier_keys_t {
    <<struct>>
    +modifiers_init(modifier_state_t *st)
    +modifiers_update(const modifier_keys_t *keys,
                                 ...
    +modifiers_match(const modifier_state_t *st, int mask)
  }
```

#### `headers/drivers/pci.h`, `headers/drivers/usbblk.h`, `headers/drivers/usbhid.h`

```mermaid
classDiagram
  direction LR
  class pci_h_pci_bdf_t {
    <<struct>>
    +pci_cfg_read(unsigned bus, unsigned dev,
        unsigned func, unsigned r...
    +pci_cfg_write(unsigned bus, unsigned dev,
        unsigned func, unsigned reg,...
    +pci_cfg_read8(unsigned bus, unsigned dev,
        unsigned func, unsi...
    +pci_cfg_write8(unsigned bus, unsigned dev,
        unsigned func, unsigned reg...
    +pci_present(unsigned bus, unsigned dev, unsigned func,
        void (*outl)(uns...
    +xHCI(0x0C/0x03/0x30) would look for class 0x03, and a PCI
 * bridge (0x06/0x04)...
    +pci_is_multifunction(unsigned bus, unsigned dev,
        void (*outl)(unsigned ...
    +pci_find(unsigned vendor, unsigned device,
        unsigned (*inl)(unsigned sho...
    +pci_find_class(pci_bdf_t *out,
        unsigned cls, unsigned subclass, unsigne...
    +pci_bar_count(unsigned bus, unsigned dev, unsigned func,
        void (*ou...
  }
  class usbblk_h_ubk_counters_t {
    <<struct>>
    +ubk_init(void);
    +ubk_present(void);
    +ubk_sectors(void);
    +ubk_read_sectors(unsigned long lba, unsigned count, void *buf);
    +ubk_write_sectors(unsigned long lba, unsigned count, const void *buf);
    +ubk_counters(ubk_counters_t *out);
    +ubk_build_cbw(unsigned char *out, unsigned tag, unsigned long lba, unsigned blocks, int read, int data_len);
    +ubk_check_csw(const unsigned char *csw, unsigned tag, unsigned expect_len);
  }
  class usbhid_h_usbhid_counters_t {
    <<struct>>
    +usbhid_init(void);
    +usbhid_poll_keyboard(void);
    +usbhid_poll_mouse(void);
    +usbhid_poll(void);
    +usbhid_keyboard_present(void);
    +usbhid_mouse_present(void);
    +usbhid_press_kbd_report(const unsigned char report[HID_KBD_REPORT_LEN]);
    +usbhid_kbd_scancodes(const unsigned char prev[HID_KBD_REPORT_LEN], const unsigned char cur[HID_KBD_REPORT_LEN], unsigned char *out, int max);
    +usbhid_mouse_decode(const unsigned char prev[HID_MOUSE_REPORT_LEN], const unsigned char cur[HID_MOUSE_REPORT_LEN], int *dx, int *dy, int *buttons, int *wheel);
    +usbhid_counters(usbhid_counters_t *out);
  }
```

#### `headers/drivers/xhci.h`, `headers/ext4.h`, `headers/fat32.h`

```mermaid
classDiagram
  direction LR
  class xhci_h_xhc_iface_t {
    <<struct>>
    +xhc_init(void);
    +xhc_poll(void);
    +xhc_port_count(void);
    +xhc_port_state(int port, xhc_port_t *out);
    +xhc_port_reset(int port);
    +xhc_enumerate(int port);
    +xhc_enumerate_all(void);
    +xhc_device_count(void);
    +xhc_device_info(int index, xhc_dev_t *out);
    +xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto, xhc_iface_t *out);
  }
  class xhci_h_xhc_port_t {
    <<struct>>
    +xhc_init(void);
    +xhc_poll(void);
    +xhc_port_count(void);
    +xhc_port_state(int port, xhc_port_t *out);
    +xhc_port_reset(int port);
    +xhc_enumerate(int port);
    +xhc_enumerate_all(void);
    +xhc_device_count(void);
    +xhc_device_info(int index, xhc_dev_t *out);
    +xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto, xhc_iface_t *out);
  }
  class xhci_h_xhc_dev_t {
    <<struct>>
    +xhc_init(void);
    +xhc_poll(void);
    +xhc_port_count(void);
    +xhc_port_state(int port, xhc_port_t *out);
    +xhc_port_reset(int port);
    +xhc_enumerate(int port);
    +xhc_enumerate_all(void);
    +xhc_device_count(void);
    +xhc_device_info(int index, xhc_dev_t *out);
    +xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto, xhc_iface_t *out);
  }
  class xhci_h_xhc_counters_t {
    <<struct>>
    +xhc_init(void);
    +xhc_poll(void);
    +xhc_port_count(void);
    +xhc_port_state(int port, xhc_port_t *out);
    +xhc_port_reset(int port);
    +xhc_enumerate(int port);
    +xhc_enumerate_all(void);
    +xhc_device_count(void);
    +xhc_device_info(int index, xhc_dev_t *out);
    +xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto, xhc_iface_t *out);
  }
  class ext4_h_ext4_handle_t {
    <<struct>>
    +ext4_list(const char *imgpath, const char *dirpath, char names[][EXT4_NAME_MAX + 1], int *isdir, int cap);
    +ext4_vfs_open(const char *path, int mode, void **handle);
    +ext4_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len);
    +ext4_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len);
    +ext4_vfs_close(void *handle);
    +ext4_vfs_fstat(void *handle, unsigned long *size_out);
    +ext4_vfs_truncate(void *handle, unsigned long size);
    +first(proven by a superblock read), then a magic * scan over 2048-aligned LBAs for superfloppy layouts. Returns the * base LBA, or -1 when no ext4 is present. Cached. */ long ext_dev
  }
  class fat32_h_fat32_handle_t {
    <<struct>>
    +file(built on the host with * mkfs.vfat, packed into minifs.bin) is parsed here: BPB validation, * cluster-chain walking and 8.3 directory traversal. Only t
    +fat32_list(const char *imgpath, const char *dirpath, char names[][FAT32_NAME_MAX], int *isdir, int cap);
    +fat_dev_base(void);
    +fat32_vfs_open(const char *path, int mode, void **handle);
    +fat32_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len);
    +fat32_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len);
    +fat32_vfs_close(void *handle);
    +fat32_vfs_fstat(void *handle, unsigned long *size_out);
    +fat32_vfs_truncate(void *handle, unsigned long size);
  }
```

#### `headers/fsimg.h`, `headers/futex.h`

```mermaid
classDiagram
  direction LR
  class fsimg_h_fsimg_t {
    <<struct>>
    +fsimg_open_file(const char *resolved, fsimg_t *img);
    +fsimg_open_dev(unsigned long base_lba, unsigned long nsec, fsimg_t *img);
    +fsimg_read(const fsimg_t *img, unsigned long off, void *buf, unsigned long len);
    +fsimg_split(const char *path, char *left, unsigned llen, char *right, unsigned rlen);
  }
  class futex_h_futex_bucket_t {
    <<struct>>
    +futex_init(void);
    +futex_wait(unsigned long uaddr, int val);
    +futex_wake(unsigned long uaddr, int n);
    +futex_forget(int pid);
    +FUTEX_CLOCK_REALTIME(it only selects the clock of a BITSET deadline). * Returns -1 for anything unserved (REQUEUE, CMP_REQUEUE, WAKE_OP, PI/PP, * unknown flags). Host-tested (tests/test_futex.c);
    +futex_linux_cmd(long op);
    +futex_timeout_remaining_us(int cmd, long sec, long nsec, unsigned long now_us);
  }
```

---

## Code Property Graph

Machine-readable Code Property Graph (CPG) in JSON-LD format. This block allows AI agents to parse the full structural graph without additional file reads. Compatible with GraphRAG pipelines.

```json
{"@context": "https://schema.org", "analysis": {"communities": [{"cohesion": 0.896, "id": 0, "label": "headers: kernel", "size": 137}, {"cohesion": 0.665, "id": 1, "label": "progs/doomgeneric: d_englsh", "size": 99}, {"cohesion": 0.715, "id": 2, "label": "progs/src", "size": 86}, {"cohesion": 0.557, "id": 3, "label": "progs/doomgeneric: p_spec", "size": 69}, {"cohesion": 0.769, "id": 4, "label": "tools: tls_crypto", "size": 43}, {"cohesion": 0.722, "id": 5, "label": "headers: vga_fb", "size": 17}, {"cohesion": 0.422, "id": 6, "label": "progs/doomgeneric: net_defs", "size": 13}, {"cohesion": 0.667, "id": 7, "label": "headers: batch", "size": 3}, {"cohesion": 0.667, "id": 8, "label": "headers: tick", "size": 3}, {"cohesion": 1.0, "id": 9, "label": "tools: doom_pwad", "size": 2}], "god_nodes": [{"node_id": "kernel/string.c", "score": 181.3}, {"node_id": "progs/doomgeneric/doomtype.h", "score": 101.4}, {"node_id": "progs/doomgeneric/doomdef.h", "score": 90.9}, {"node_id": "kernel/syscalls.c", "score": 90.3}, {"node_id": "progs/doomgeneric/doomstat.h", "score": 84.8}, {"node_id": "progs/doomgeneric/z_zone.h", "score": 81.3}, {"node_id": "progs/doomgeneric/i_system.h", "score": 81.2}, {"node_id": "progs/doomgeneric/d_main.c", "score": 80.9}, {"node_id": "progs/minios_abi.h", "score": 79.6}, {"node_id": "headers/sched.h", "score": 75.8}], "surprising_connections": [{"hops": 9, "source": "headers/qga.h", "target": "progs/doomgeneric/d_englsh.h"}, {"hops": 9, "source": "headers/qga.h", "target": "progs/doomgeneric/d_event.c"}, {"hops": 9, "source": "headers/qga.h", "target": "progs/doomgeneric/d_items.c"}, {"hops": 9, "source": "headers/qga.h", "target": "progs/doomgeneric/d_think.h"}, {"hops": 9, "source": "headers/qga.h", "target": "progs/doomgeneric/doomstat.c"}]}, "edges": [{"confidence": "EXTRACTED", "relation": "imports", "source": "arch/x86/ap_entry.S", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "arch/x86/boot/stage1.S", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "arch/x86/boot/stage2.S", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "arch/x86/syscall_entry.S", "target": "syscall_asm.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "ide.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "drivers/nvme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/block.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/driver.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/ide.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/ide.c", "target": "ide.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/ide.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "wm_events.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/kbd.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/mouse.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/mouse.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/mouse.c", "target": "drivers/mouse.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/nvme.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/nvme.c", "target": "drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/nvme.c", "target": "drivers/nvme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/nvme.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "sb16.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "pcm2.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "pcm_ring.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcm2.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcspk.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcspk.c", "target": "pcspk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/pcspk.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/rtc.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/rtc.c", "target": "rtc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/sb16.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/sb16.c", "target": "sb16.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/sb16.c", "target": "pcm2.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/sb16.c", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/sb16.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbblk.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbblk.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbblk.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbblk.c", "target": "drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/usbhid.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_blk.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_blk.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_blk.c", "target": "drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_blk.c", "target": "drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_net.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_net.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_net.c", "target": "drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/virtio_net.c", "target": "drivers/virtio_net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/xhci.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/xhci.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/xhci.c", "target": "drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "drivers/xhci.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ext4.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ext4.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ext4.c", "target": "ext4.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ext4.c", "target": "fsimg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ext4.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fat32.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fat32.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fat32.c", "target": "fat32.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fat32.c", "target": "fsimg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fat32.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fsimg.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fsimg.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fsimg.c", "target": "fsimg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/fsimg.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/kfile.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/kfile.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/minifs.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/minifs.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/minifs.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/minifs.c", "target": "ide.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/minifs.c", "target": "lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/minifs.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/pcache.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/pcache.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ramdisk.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/ramdisk.c", "target": "miniz.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/vfs.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/vfs.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/vfs.c", "target": "fat32.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/vfs.c", "target": "ext4.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/zip.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "fs/zip.c", "target": "miniz.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/arch/x86/cpu_setup.h", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/arena.h", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/batch.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/desktop_icons.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/desktop_shortcuts.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/drivers/mouse.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/editor.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/futex.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/futex.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/futex.h", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/futex.h", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel/console_in.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel/vga_cursor.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel.h", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel.h", "target": "ldso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel.h", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/kernel.h", "target": "pipe.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/leakcheck.h", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/leakcheck.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/leakcheck.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/leakcheck.h", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/net/rtl8139.h", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/percpu_rq.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/percpu_rq.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/percpu_rq.h", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/rcu.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/rcu.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/rcu.h", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/sched.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/sched.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/sched.h", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/shell.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/shell.h", "target": "kernel/console_in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/smp.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/spawn.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/spawn.h", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/spawn.h", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/sync.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/sync.h", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/sync.h", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/tls_port.h", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/vga_fb.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/vga_fb.h", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/vga_fb.h", "target": "wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/wm_events.h", "target": "drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/wm_focus.h", "target": "wm_window.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/wm_render.h", "target": "wm_window.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "headers/wm_window.h", "target": "wm_geom.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/abi.c", "target": "abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/abi.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/batch.c", "target": "batch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/clip.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console.c", "target": "xxhash.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console.c", "target": "stb/stb_api.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "kernel/console_in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/console_in.c", "target": "pipe.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/cvm_host.c", "target": "cvm.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/cvm_host.c", "target": "cvm_jit.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/ed25519.c", "target": "sign.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/editor.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/editor.c", "target": "shell.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/editor.c", "target": "editor.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/exec.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/futex.c", "target": "futex.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/futex.c", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/klog.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/ldso_parse.c", "target": "ldso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "ldso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/loader.c", "target": "sign.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/lz4_kernel.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/lz4_kernel.c", "target": "lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "minifetch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "rtc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "stb_api.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/minifetch.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/cow.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/cow.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/cow.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/cow.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/cow.c", "target": "tlb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "ldso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/paging.c", "target": "tlb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/swap.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/swap.c", "target": "ide.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/swap.c", "target": "lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/tlb.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/tlb.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/tlb.c", "target": "smp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/tlb.c", "target": "spinlock.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm/tlb.c", "target": "tlb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/mm.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/panic.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/panic.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/panic.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/panic.c", "target": "panic.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/percpu_rq.c", "target": "percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/printf.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/proc_sec.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/proc_sec.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/proc_sec.c", "target": "sanitize.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/proc_sec.c", "target": "syscalls_proc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/proc_sec.c", "target": "seccomp_bpf.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/proc_sec.c", "target": "proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/rcu.c", "target": "rcu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/redirect.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "spawn.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "smp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "futex.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "rcu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "sb16.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "pcm2.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "tick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "drivers/mouse.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sched.c", "target": "tlb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/scrollback.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/seccomp_bpf.c", "target": "seccomp_bpf.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/serial.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/serial.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "httpd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "fat32.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "ext4.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/virtio_net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/nvme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "smp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "pcspk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "sb16.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "pcm2.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "rtc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "wm_layout.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "xxhash.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "zip.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "minifetch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "shell.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "spawn.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "tlb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "editor.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/shell.c", "target": "kernel/console_in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "spawn.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "arena.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/spawn.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/string.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/symtab.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/sync.c", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "ide.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "pcspk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "sb16.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "pcm2.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "rtc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "zip.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "futex.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "batch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "rcu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "sanitize.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "select_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "syscalls_proc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "shell.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "ktime.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "randmix.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "tlb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls.c", "target": "spawn.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls_proc.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls_proc.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls_proc.c", "target": "sanitize.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls_proc.c", "target": "proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/syscalls_proc.c", "target": "syscalls_proc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/tick.c", "target": "tick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/tick.c", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/time.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/time.c", "target": "ktime.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_cursor.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_cursor.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_cursor.c", "target": "kernel/vga_cursor.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "kernel/vga_cursor.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "desktop_shortcuts.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "desktop_icons.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "stb_api.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_geom.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_events.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_window.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_render.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_tiling.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_focus.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_layout.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "wm_gfxview.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fb.c", "target": "vga_fx.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fx.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fx.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel/vga_fx.c", "target": "vga_fx.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "ide.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "block.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "sb16.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "smp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "arch/x86/cpu_setup.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "kernel.c", "target": "syscall_asm.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dbg_driver.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/mcp_dogfood.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_addons.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "atexit"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "signal"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "tty"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "minios_addons"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/minios_mcp.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "unittest"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "mcp/test_minios_mcp.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/net.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/net.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/net.c", "target": "tls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/net.c", "target": "net/rtl8139.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/net.c", "target": "drivers/virtio_net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/net.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/rtl8139.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/rtl8139.c", "target": "net.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/rtl8139.c", "target": "net/rtl8139.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/rtl8139.c", "target": "drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/rtl8139.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls.c", "target": "tls_port.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls.c", "target": "tls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls.c", "target": "tls_roots.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls_crypto.c", "target": "tls_port.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls_crypto.c", "target": "tls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls_x509.c", "target": "tls_port.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "net/tls_x509.c", "target": "tls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomedit/doomedit.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "m_controls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.c", "target": "am_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/am_map.h", "target": "m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_event.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_event.c", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_event.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_items.c", "target": "info.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_items.c", "target": "d_items.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_items.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.c", "target": "windows.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_iwad.h", "target": "d_mode.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "d_loop.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_client.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_gui.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_query.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_server.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_sdl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.c", "target": "net_loop.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_loop.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "w_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "f_finale.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "f_wipe.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "m_controls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "m_menu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "i_endoom.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "wi_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "am_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "net_client.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "net_dedicated.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "net_query.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "p_setup.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "statdump.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.c", "target": "d_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_main.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_mode.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_mode.c", "target": "d_mode.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_mode.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "d_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "m_menu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "w_checksum.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_net.c", "target": "d_loop.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_player.h", "target": "d_items.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_player.h", "target": "p_pspr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_player.h", "target": "p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_player.h", "target": "d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_player.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_textur.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/d_ticcmd.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_main.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_main.h", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_main.h", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_main.h", "target": "sha1.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_misc.h", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_str.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/deh_str.h", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdata.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdata.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdef.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdef.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdef.h", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdef.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdef.h", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomdef.h", "target": "d_mode.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "stdbool.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "SDL.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "sys/ioctl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "sys/mman.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "termios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "soso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "sys/ioctl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "termios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "soso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "nano-X.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_win.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_win.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_win.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_win.c", "target": "Windows.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "sys/time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "X11/Xlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "X11/Xutil.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "X11/Xatom.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.h", "target": "doomdata.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.h", "target": "d_loop.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.h", "target": "d_player.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.h", "target": "d_mode.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomstat.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomtype.h", "target": "strings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomtype.h", "target": "inttypes.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/doomtype.h", "target": "limits.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/dstrings.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/dstrings.h", "target": "d_englsh.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/dummy.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "d_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.c", "target": "hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_finale.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/f_wipe.c", "target": "f_wipe.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "f_finale.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "m_controls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "m_menu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "p_setup.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "p_tick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "d_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "wi_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "am_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "statdump.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "r_sky.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/g_game.h", "target": "d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/gusconf.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "hu_lib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.c", "target": "r_draw.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_lib.h", "target": "r_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "hu_lib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "m_controls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/hu_stuff.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "SDL.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "SDL_cdrom.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "i_cdmus.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_endoom.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_endoom.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_endoom.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_endoom.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_endoom.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_endoom.c", "target": "txt_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "i_scale.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "tables.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_input.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "SDL.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "SDL_joystick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_joystick.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_main.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_main.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "i_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_scale.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "SDL_mixer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "gusconf.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "i_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_sound.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_swap.h", "target": "SDL_endian.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "stdarg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "windows.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "SDL.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "i_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.c", "target": "CoreFoundation/CFUserNotification.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.h", "target": "d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_system.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_timer.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_timer.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_timer.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_timer.c", "target": "stdarg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "d_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "tables.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "stdbool.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "stdarg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.c", "target": "sys/types.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/i_video.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.c", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.c", "target": "info.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.c", "target": "p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/info.h", "target": "d_think.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_argv.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_bbox.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_bbox.h", "target": "limits.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_bbox.h", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_cheat.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_cheat.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_cheat.c", "target": "m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_config.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_controls.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_controls.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_controls.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_controls.c", "target": "m_config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_controls.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_fixed.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_fixed.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_fixed.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_fixed.c", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "d_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "i_timer.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "m_controls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.c", "target": "m_menu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_menu.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "windows.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "direct.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "sys/stat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "sys/types.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.h", "target": "stdarg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_misc.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/m_random.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/memio.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/memio.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/memio.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/memio.c", "target": "memio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/memio.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_client.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_client.h", "target": "d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_client.h", "target": "sha1.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_client.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_defs.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_defs.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_defs.h", "target": "d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_defs.h", "target": "sha1.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_gui.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_io.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_loop.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_packet.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_query.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/net_sdl.h", "target": "net_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_doors.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_enemy.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_floor.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "am_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_inter.c", "target": "p_inter.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_lights.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_lights.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_lights.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_lights.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_lights.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_local.h", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_local.h", "target": "p_spec.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_map.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_maputl.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_maputl.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_maputl.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_maputl.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_maputl.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_maputl.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.h", "target": "tables.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.h", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.h", "target": "d_think.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.h", "target": "doomdata.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_mobj.h", "target": "info.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_plats.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.c", "target": "p_pspr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.h", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.h", "target": "tables.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_pspr.h", "target": "info.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_saveg.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_setup.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_sight.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_sight.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_sight.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_sight.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_spec.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_switch.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_telept.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_telept.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_telept.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_telept.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_telept.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_telept.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_tick.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_tick.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_tick.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_user.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_user.c", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_user.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/p_user.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "r_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "r_plane.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "r_things.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_bsp.c", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "r_sky.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.c", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.h", "target": "r_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_data.h", "target": "r_state.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_defs.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_defs.h", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_defs.h", "target": "d_think.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_defs.h", "target": "p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_defs.h", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_defs.h", "target": "v_patch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_draw.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "tables.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_bsp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_segs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_plane.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_things.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_local.h", "target": "r_draw.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "d_loop.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "m_menu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.c", "target": "r_sky.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.h", "target": "d_player.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_main.h", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.c", "target": "r_sky.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_plane.h", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_segs.c", "target": "r_sky.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_sky.c", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_sky.c", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_sky.c", "target": "r_sky.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_state.h", "target": "d_player.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_state.h", "target": "r_data.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/r_things.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "i_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.h", "target": "p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/s_sound.h", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.c", "target": "assert.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.c", "target": "sha1.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sha1.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sounds.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sounds.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sounds.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/sounds.h", "target": "i_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "st_lib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_lib.h", "target": "r_defs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "st_lib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "p_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "p_inter.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "am_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "dstrings.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.h", "target": "d_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/st_stuff.h", "target": "m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "d_player.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "d_mode.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/statdump.c", "target": "statdump.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/tables.c", "target": "tables.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/tables.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/tables.h", "target": "m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "deh_str.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.c", "target": "png.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/v_video.h", "target": "v_patch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "sha1.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "w_checksum.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_checksum.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.c", "target": "w_file.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "w_file.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "m_argv.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "w_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "w_merge.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_main.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "config.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "i_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.h", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.h", "target": "d_mode.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/w_wad.h", "target": "w_file.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "m_misc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "m_random.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "deh_main.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "i_swap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "w_wad.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "g_game.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "s_sound.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "doomstat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "sounds.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "v_video.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "wi_stuff.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/wi_stuff.h", "target": "doomdef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/z_zone.c", "target": "z_zone.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/z_zone.c", "target": "i_system.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/z_zone.c", "target": "doomtype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/doomgeneric/z_zone.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "minios_png.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "file/file_assoc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "stb_image.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file.c", "target": "leakcheck.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file_assoc.h", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file_assoc.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/file/file_assoc.h", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "url.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "link_nav.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "html_parse.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "ui.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/freedomui_minios.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/media_unavailable.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/media_unavailable.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/media_unavailable.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/media_unavailable.c", "target": "sys/types.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/media_unavailable.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/media_unavailable.c", "target": "media_decoder.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "platform.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "malloc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "sys/syscall.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/platform_minios.c", "target": "ps2_keymap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/ps2_keymap.c", "target": "ps2_keymap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/ps2_keymap.c", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/ps2_keymap.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/ps2_keymap.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/freedomui/ps2_keymap.h", "target": "key_event.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "ctype.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "inttypes.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "limits.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "stdbool.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lisp/lisp.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/lua_main.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/lua_main.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/lua_main.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/lua_main.c", "target": "lua.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/lua_main.c", "target": "lauxlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/lua_main.c", "target": "lualib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/minios.c", "target": "lua.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/minios.c", "target": "lauxlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/minios.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/lua/minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/lib/hello.py", "target": "minios"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/lib/mip.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/lib/mip.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/lib/mip.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/lib/mip.py", "target": "minios"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/minios_module.c", "target": "py/runtime.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/minios_module.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/micropython/variants/minios/minios_module.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minicraft/minicraft.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minios_png.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/minios_png.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/cvm_emit.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/cvm_emit.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/cvm_emit.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/cvm_emit.c", "target": "cvm_emit.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/cvm_emit.h", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/font8x8.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/font8x8.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "sys/types.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "sys/stat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/node_editor.c", "target": "cvm_emit.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.c", "target": "wl/wl_client.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_minios.h", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_theme.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_theme.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_theme.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/nuklear/nuklear_theme.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/paint/paint.c", "target": "stb_image.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "opl3.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/piano/piano.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/minios_stubs/SDL.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "gbrt.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "ppu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "platform_sdl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "audio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "minios_png.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/pokemon/platform_minios.c", "target": "stb_image.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "quake2.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "quakegeneric.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "client/keys.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "ref_soft/r_local.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/snddma_minios.c", "target": "client/client.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/snddma_minios.c", "target": "client/snd_loc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/snddma_minios.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/snddma_minios.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/quake2generic/snddma_minios.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/apsse.c", "target": "emmintrin.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/apsse.c", "target": "pthread.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/apsse.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/apsse.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/apsse.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/apsse.c", "target": "sys/mman.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/audio.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/cvmfmt.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/cvmfmt.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/fptest.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/fptest.c", "target": "mthreads.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/fptest.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "wl/wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/freedom_wl.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "dirent.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "poll.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "pthread.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "signal.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/eventfd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/ioctl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/resource.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/sysinfo.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/stat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/syscall.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/uio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "sys/wait.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxabi.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "arpa/inet.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "netdb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "netinet/in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "netinet/tcp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "poll.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "sys/ioctl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "sys/uio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxnet.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxproc.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxproc.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxproc.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxproc.c", "target": "sys/wait.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxproc.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxproc.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "linux/audit.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "linux/filter.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "linux/seccomp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "sys/mman.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "sys/prctl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "sys/syscall.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "sys/wait.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsecc.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "sys/select.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "sys/syscall.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "sys/time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxsel.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxtls.c", "target": "curl/curl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxtls.c", "target": "openssl/err.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxtls.c", "target": "openssl/evp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxtls.c", "target": "openssl/rand.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxtls.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/lxtls.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/mthreads.h", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/opl3.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/opl3.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/opl3.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/opl3.c", "target": "opl3.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/opl3.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "errno.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/pip.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/sbtone.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/sbtone.c", "target": "math.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/sbtone.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/scfuzz.c", "target": "mthreads.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/shell.py", "target": "minios"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/shell.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/shell.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test.py", "target": "minios"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "mip"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/test_py.py", "target": "asyncio"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/thdemo.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/thdemo.c", "target": "mthreads.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/src/thdemo.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "sys/types.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "netinet/in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "arpa/inet.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "netdb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "stdarg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "tls_port.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_main.c", "target": "tls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "sys/types.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "netinet/in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "arpa/inet.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "netdb.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "sys/time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "poll.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "fcntl.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/tls_u/tls_u_port.c", "target": "time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/topogpt3/topogpt3.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/topogpt3/topogpt3.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/topogpt3/topogpt3.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "sys/stat.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "nuklear.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/vedit/vedit.c", "target": "leakcheck.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wl_client.h", "target": "wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wl_mbox.h", "target": "wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wl_pixbuf.h", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wl_pixbuf.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wl_pixbuf.h", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "wl/wl_client.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "progs/wl/wlcomp.c", "target": "wl/wl_pixbuf.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "qga.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "qga.c", "target": "qga.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "qga.c", "target": "rtc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "smp.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "sched.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "ap_stub.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "smp.c", "target": "arch/x86/cpu_setup.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/stubs/kernel.h", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/stubs/kernel.h", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/stubs/kernel.h", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/stubs/kernel.h", "target": "stdint.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/stubs/kernel.h", "target": "stdarg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_abi.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_abi.c", "target": "abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_abi.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_arena.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_arena.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_arena.c", "target": "arena.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_batch.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_batch.c", "target": "batch.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "unittest"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "doom_pwad"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "doom_pwad"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_doom_pwad.py", "target": "doom_pwad"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_driver.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_driver.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_driver.c", "target": "assert.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_driver.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "ext4.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "fsimg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "fs/fsimg.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ext4.c", "target": "fs/ext4.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "minifs.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "fat32.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "fsimg.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "fs/fsimg.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fat32.c", "target": "fs/fat32.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fault.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fault.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fault.c", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_file_assoc.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_file_assoc.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_file_assoc.c", "target": "progs/file/file_assoc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_freedom_wl.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_freedom_wl.c", "target": "../progs/src/freedom_wl.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_freedomui.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_freedomui.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_freedomui.c", "target": "../progs/freedomui/freedomui_minios.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_futex.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_futex.c", "target": "futex.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fx.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_fx.c", "target": "vga_fx.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_hal_io.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_hal_io.c", "target": "arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_httpd.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_httpd.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_httpd.c", "target": "httpd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ktime.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ktime.c", "target": "ktime.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ldso.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ldso.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ldso.c", "target": "ldso.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ldso.c", "target": "kernel/ldso_parse.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_leakcheck.c", "target": "leakcheck.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_leakcheck.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_leakcheck.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_leakcheck.c", "target": "progs/file/file_assoc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minifs_tools.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minifs_tools.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minifs_tools.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minifs_tools.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minifs_tools.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minifs_tools.py", "target": "unittest"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minios_png.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minios_png.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minios_png.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_minios_png.c", "target": "progs/minios_png.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "unittest"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_mip.py", "target": "http.server"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_modifiers.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_modifiers.c", "target": "drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_notify.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_notify.c", "target": "wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_paint.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_paint.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_panic.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_panic.c", "target": "panic.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcache.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcache.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcache.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcache.c", "target": "kernel.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcache.c", "target": "pcache.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcache.c", "target": "fs/pcache.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pci.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pci.c", "target": "drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcm.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcm.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcm.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pcm.c", "target": "pcm_ring.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_percpu_rq.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_percpu_rq.c", "target": "percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pipe.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_pipe.c", "target": "pipe.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ps2_keymap.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ps2_keymap.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ps2_keymap.c", "target": "xkbcommon/xkbcommon-keysyms.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_ps2_keymap.c", "target": "../progs/freedomui/ps2_keymap.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_randmix.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_randmix.c", "target": "randmix.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_rcu.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_rcu.c", "target": "rcu.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_rtc.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_rtc.c", "target": "rtc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sanitize.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sanitize.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sanitize.c", "target": "sanitize.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_seccomp_bpf.c", "target": "stddef.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_seccomp_bpf.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_seccomp_bpf.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_seccomp_bpf.c", "target": "seccomp_bpf.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_select_map.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_select_map.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_select_map.c", "target": "select_map.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sign.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sign.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sign.c", "target": "sign.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sync.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_sync.c", "target": "sync.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_theme.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_theme.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_theme.c", "target": "../progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_tick.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_tick.c", "target": "tick.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbblk.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbblk.c", "target": "driver.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbblk.c", "target": "drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbblk.c", "target": "drivers/xhci.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbblk.c", "target": "drivers/usbblk.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbhid.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbhid.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbhid.c", "target": "drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbhid.c", "target": "drivers/xhci.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_usbhid.c", "target": "drivers/usbhid.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vedit_build.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vedit_build.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vma.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vma.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vma.c", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vma_bench.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vma_bench.c", "target": "sys/time.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_vma_bench.c", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "malloc.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "progs/wl/wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "progs/wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "progs/wl/wl_pixbuf.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "progs/nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wl.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_geom.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_events.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_window.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_render.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_tiling.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_focus.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_layout.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_wm.c", "target": "wm_gfxview.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_xhci.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_xhci.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_xhci.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_xhci.c", "target": "drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tests/test_xhci.c", "target": "drivers/xhci.c"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "stdlib.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "string.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "unistd.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "sys/socket.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "sys/select.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "netinet/in.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "arpa/inet.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "tls_port.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "tls.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tls_test.c", "target": "tls_test_roots.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/abi_stamp.c", "target": "stdio.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/abi_stamp.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "pty"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "termios"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/boot_wl.py", "target": "tty"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_abi_numbers.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_abi_numbers.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_abi_numbers.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_addons.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_addons.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_addons.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_addons.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_cohesion.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_cohesion.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_cohesion.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_cohesion.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_complexity.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_complexity.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_complexity.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_complexity.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_fork_stubs.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_fork_stubs.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_kb_sync.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_kb_sync.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_kb_sync.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_kb_sync.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_mutant_anchors.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_mutant_anchors.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_mutant_anchors.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_mutant_anchors.py", "target": "pathlib"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_spin_discipline.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_spin_discipline.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_spin_discipline.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_surprising.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_surprising.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_surprising.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_surprising.py", "target": "collections"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_surprising.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_syscall_sanitize.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/check_syscall_sanitize.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/clip_bridge.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/clip_bridge.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/doom_pwad.py", "target": "math"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/doom_pwad.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/doom_pwad.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "pty"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gdb_repro.py", "target": "importlib.util"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_desktop_pngs.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_desktop_pngs.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_desktop_pngs.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_desktop_pngs.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_icons.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_icons.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_icons.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_icons.py", "target": "zlib"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_minifs.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_zip_fixtures.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_zip_fixtures.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/gen_zip_fixtures.py", "target": "zipfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/kernel_feature_survey.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/kernel_feature_survey.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/kernel_feature_survey.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_dump.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_dump.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_fsck.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_fsck.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_fsck.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_saves.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_saves.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minifs_saves.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_cli.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "pty"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_gui.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/minios_hyper.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkcpyzip.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkcpyzip.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkcpyzip.py", "target": "zipfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkfs.minifs.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkfs.minifs.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkfs.minifs.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkpak1.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkpak1.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkpak1.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkramdisk.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkramdisk.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkramdisk.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkramdisk.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkramdisk.py", "target": "zlib"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkvocab.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkvocab.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/mkvocab.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_compute_vga.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/probe_minicraft.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/qga_client.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/qga_client.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/qga_client.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/qga_client.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/qga_client.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "pty"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "select"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/repro_gui.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/sign_elf.py", "target": "hashlib"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/sign_elf.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/sign_elf.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/sign_elf.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/sign_elf.py", "target": "nacl.bindings"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_call_align.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_call_align.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_call_align.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_call_align.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_call_align.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_fashion.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_freedom.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_gfxview.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_gfxview.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_gfxview.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_gfxview.py", "target": "test_gui_wm"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_gfxview.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_icon_cwd.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_menu.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_menu.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_menu.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_menu.py", "target": "test_gui_wm"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_wm.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_zoom.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_zoom.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_zoom.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_zoom.py", "target": "test_gui_wm"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_gui_zoom.py", "target": "PIL"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_http_server.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_http_server.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_http_server.py", "target": "http.server"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_http_server.py", "target": "fcntl"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_http_server.py", "target": "struct"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_lisp.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_lisp.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_lisp.py", "target": "shutil"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_lisp.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_lisp.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_lisp.py", "target": "tempfile"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_net_fixture.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_net_fixture.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/test_net_fixture.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "os"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "shlex"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "socket"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "ssl"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "threading"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "time"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/tls_test.py", "target": "datetime"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "__future__"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "json"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "subprocess"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "dataclasses"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "datetime"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/update_sources.py", "target": "pathlib"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/wm_layout_sync.py", "target": "__future__"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/wm_layout_sync.py", "target": "argparse"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/wm_layout_sync.py", "target": "pathlib"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/wm_layout_sync.py", "target": "re"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "tools/wm_layout_sync.py", "target": "sys"}, {"confidence": "EXTRACTED", "relation": "imports", "source": "vma.c", "target": "vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "arch/x86/ap_entry.S", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "arch/x86/boot/stage1.S", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "arch/x86/boot/stage2.S", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "arch/x86/syscall_entry.S", "target": "headers/syscall_asm.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/block.c", "target": "headers/ide.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/block.c", "target": "headers/drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/block.c", "target": "headers/drivers/nvme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/block.c", "target": "headers/drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/block.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/block.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/driver.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/ide.c", "target": "headers/ide.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/ide.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/kbd.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/kbd.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/kbd.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/kbd.c", "target": "headers/drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/kbd.c", "target": "headers/wm_events.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/kbd.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/mouse.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/mouse.c", "target": "headers/drivers/mouse.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/nvme.c", "target": "headers/drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/nvme.c", "target": "headers/drivers/nvme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/nvme.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcm2.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcm2.c", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcm2.c", "target": "headers/sb16.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcm2.c", "target": "headers/pcm2.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcm2.c", "target": "headers/pcm_ring.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcm2.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcspk.c", "target": "headers/pcspk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/pcspk.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/rtc.c", "target": "headers/rtc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/sb16.c", "target": "headers/sb16.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/sb16.c", "target": "headers/pcm2.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/sb16.c", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/sb16.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbblk.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbblk.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbblk.c", "target": "headers/drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbhid.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbhid.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbhid.c", "target": "headers/drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbhid.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbhid.c", "target": "headers/drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/usbhid.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/virtio_blk.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/virtio_blk.c", "target": "headers/drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/virtio_blk.c", "target": "headers/drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/virtio_net.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/virtio_net.c", "target": "headers/drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/virtio_net.c", "target": "headers/drivers/virtio_net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/xhci.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/xhci.c", "target": "headers/drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "drivers/xhci.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/ext4.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/ext4.c", "target": "headers/ext4.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/ext4.c", "target": "headers/fsimg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/ext4.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fat32.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fat32.c", "target": "headers/fat32.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fat32.c", "target": "headers/fsimg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fat32.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fsimg.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fsimg.c", "target": "headers/fsimg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/fsimg.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/kfile.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/minifs.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/minifs.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/minifs.c", "target": "headers/ide.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/minifs.c", "target": "headers/lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/minifs.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/pcache.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/vfs.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/vfs.c", "target": "headers/fat32.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "fs/vfs.c", "target": "headers/ext4.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/arch/x86/cpu_setup.h", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/editor.h", "target": "headers/kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/futex.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/futex.h", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/futex.h", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/kernel.h", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/kernel.h", "target": "headers/ldso.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/kernel.h", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/kernel.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/kernel.h", "target": "headers/pipe.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/leakcheck.h", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/net/rtl8139.h", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/percpu_rq.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/percpu_rq.h", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/rcu.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/rcu.h", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/sched.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/sched.h", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/shell.h", "target": "headers/kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/shell.h", "target": "headers/kernel/console_in.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/smp.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/spawn.h", "target": "headers/kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/spawn.h", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/spawn.h", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/sync.h", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/sync.h", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/tls_port.h", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/tls_port.h", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/tls_port.h", "target": "headers/kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/tls_port.h", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/vga_fb.h", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/vga_fb.h", "target": "headers/wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/wm_events.h", "target": "headers/drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/wm_focus.h", "target": "headers/wm_window.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/wm_render.h", "target": "headers/wm_window.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "headers/wm_window.h", "target": "headers/wm_geom.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/abi.c", "target": "headers/abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/batch.c", "target": "headers/batch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console_in.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console_in.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console_in.c", "target": "headers/drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console_in.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console_in.c", "target": "headers/kernel/console_in.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/console_in.c", "target": "headers/pipe.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/ed25519.c", "target": "headers/sign.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/editor.c", "target": "headers/shell.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/editor.c", "target": "headers/editor.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/exec.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/exec.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/exec.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/exec.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/exec.c", "target": "headers/proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/exec.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/futex.c", "target": "headers/futex.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/futex.c", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/ldso_parse.c", "target": "headers/ldso.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/loader.c", "target": "headers/ldso.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/loader.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/loader.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/loader.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/loader.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/loader.c", "target": "headers/sign.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/lz4_kernel.c", "target": "headers/lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/minifetch.c", "target": "headers/minifetch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/minifetch.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/minifetch.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/minifetch.c", "target": "headers/rtc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/minifetch.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/minifetch.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/cow.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/cow.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/cow.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/cow.c", "target": "headers/tlb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/ldso.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/paging.c", "target": "headers/tlb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/swap.c", "target": "headers/ide.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/swap.c", "target": "headers/lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/tlb.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/tlb.c", "target": "headers/smp.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/tlb.c", "target": "headers/spinlock.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm/tlb.c", "target": "headers/tlb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/mm.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/panic.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/panic.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/panic.c", "target": "headers/panic.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/percpu_rq.c", "target": "headers/percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/proc_sec.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/proc_sec.c", "target": "headers/sanitize.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/proc_sec.c", "target": "headers/syscalls_proc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/proc_sec.c", "target": "headers/seccomp_bpf.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/proc_sec.c", "target": "headers/proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/rcu.c", "target": "headers/rcu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/spawn.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/smp.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/futex.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/rcu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/sb16.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/pcm2.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/tick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/drivers/mouse.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sched.c", "target": "headers/tlb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/seccomp_bpf.c", "target": "headers/seccomp_bpf.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/serial.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/httpd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/fat32.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/ext4.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/virtio_net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/nvme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/smp.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/pcspk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/sb16.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/pcm2.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/rtc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/wm_layout.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/zip.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/minifetch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/shell.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/spawn.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/tlb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/editor.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/shell.c", "target": "headers/kernel/console_in.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/spawn.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/arena.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/spawn.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/sync.c", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/ide.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/pcspk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/sb16.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/pcm2.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/rtc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/lz4_kernel.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/zip.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/futex.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/batch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/rcu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/sanitize.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/select_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/syscalls_proc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/shell.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/ktime.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/randmix.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/tlb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls.c", "target": "headers/spawn.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls_proc.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls_proc.c", "target": "headers/sanitize.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls_proc.c", "target": "headers/proc_sec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/syscalls_proc.c", "target": "headers/syscalls_proc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/tick.c", "target": "headers/tick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/time.c", "target": "headers/ktime.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_cursor.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_cursor.c", "target": "headers/kernel/vga_cursor.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/kernel/vga_cursor.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/drivers/kbd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/desktop_shortcuts.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/desktop_icons.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_geom.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_events.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_window.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_render.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_tiling.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_focus.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_layout.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/wm_gfxview.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fb.c", "target": "headers/vga_fx.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fx.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel/vga_fx.c", "target": "headers/vga_fx.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/ide.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/block.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/drivers/virtio_blk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/sb16.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/smp.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/arch/x86/cpu_setup.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "kernel.c", "target": "headers/syscall_asm.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "mcp/mcp_dbg_driver.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "mcp/mcp_dogfood.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "mcp/minios_addons.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "mcp/minios_mcp.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "mcp/minios_mcp.py", "target": "mcp/minios_addons.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/net.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/net.c", "target": "headers/tls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/net.c", "target": "headers/net/rtl8139.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/net.c", "target": "headers/drivers/virtio_net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/net.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/rtl8139.c", "target": "headers/net.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/rtl8139.c", "target": "headers/net/rtl8139.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/rtl8139.c", "target": "headers/drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/rtl8139.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls.c", "target": "headers/tls_port.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls.c", "target": "headers/tls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls.c", "target": "headers/tls_roots.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls_crypto.c", "target": "headers/tls_port.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls_crypto.c", "target": "headers/tls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls_x509.c", "target": "headers/tls_port.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "net/tls_x509.c", "target": "headers/tls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomedit/doomedit.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomedit/doomedit.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomedit/doomedit.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomedit/doomedit.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/m_controls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.c", "target": "progs/doomgeneric/am_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/am_map.h", "target": "progs/doomgeneric/m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_event.c", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_event.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_items.c", "target": "progs/doomgeneric/info.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_items.c", "target": "progs/doomgeneric/d_items.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_items.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_iwad.h", "target": "progs/doomgeneric/d_mode.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/d_loop.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_client.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_gui.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_query.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_server.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_sdl.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.c", "target": "progs/doomgeneric/net_loop.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_loop.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/w_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/f_finale.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/f_wipe.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/m_controls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/m_menu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/i_endoom.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/wi_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/am_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/net_client.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/net_dedicated.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/net_query.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/p_setup.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/statdump.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.c", "target": "progs/doomgeneric/d_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_main.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_mode.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_mode.c", "target": "progs/doomgeneric/d_mode.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_mode.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/d_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/m_menu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/w_checksum.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_net.c", "target": "progs/doomgeneric/d_loop.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_player.h", "target": "progs/doomgeneric/d_items.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_player.h", "target": "progs/doomgeneric/p_pspr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_player.h", "target": "progs/doomgeneric/p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_player.h", "target": "progs/doomgeneric/d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_player.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_textur.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/d_ticcmd.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/deh_main.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/deh_main.h", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/deh_main.h", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/deh_main.h", "target": "progs/doomgeneric/sha1.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/deh_misc.h", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/deh_str.h", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdata.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdata.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdef.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdef.h", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdef.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdef.h", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomdef.h", "target": "progs/doomgeneric/d_mode.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sdl.c", "target": "progs/pokemon/minios_stubs/SDL.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_soso.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_sosox.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_win.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_win.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomgeneric_xlib.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomstat.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomstat.h", "target": "progs/doomgeneric/doomdata.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomstat.h", "target": "progs/doomgeneric/d_loop.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomstat.h", "target": "progs/doomgeneric/d_player.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomstat.h", "target": "progs/doomgeneric/d_mode.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/doomstat.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/dstrings.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/dstrings.h", "target": "progs/doomgeneric/d_englsh.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/dummy.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/d_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.c", "target": "progs/doomgeneric/hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_finale.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/f_wipe.c", "target": "progs/doomgeneric/f_wipe.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/f_finale.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/m_controls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/m_menu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/p_setup.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/p_tick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/d_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/wi_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/am_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/statdump.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/r_sky.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/g_game.h", "target": "progs/doomgeneric/d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/gusconf.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/gusconf.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/gusconf.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/gusconf.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/hu_lib.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.c", "target": "progs/doomgeneric/r_draw.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_lib.h", "target": "progs/doomgeneric/r_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/hu_lib.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/m_controls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/hu_stuff.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "progs/pokemon/minios_stubs/SDL.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_cdmus.c", "target": "progs/doomgeneric/i_cdmus.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_endoom.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_endoom.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_endoom.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_endoom.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/i_scale.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/tables.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_input.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/pokemon/minios_stubs/SDL.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/doomgeneric/i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_joystick.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_main.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/doomgeneric/i_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_minios_sound.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_scale.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_scale.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_scale.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_scale.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_scale.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_scale.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/gusconf.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/i_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_sound.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/pokemon/minios_stubs/SDL.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/i_joystick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/i_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.h", "target": "progs/doomgeneric/d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_system.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_timer.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_timer.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_timer.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/d_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/tables.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.c", "target": "progs/doomgeneric/doomgeneric.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/i_video.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/info.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/info.c", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/info.c", "target": "progs/doomgeneric/info.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/info.c", "target": "progs/doomgeneric/p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/info.h", "target": "progs/doomgeneric/d_think.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_argv.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_argv.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_argv.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_argv.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_argv.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_argv.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_bbox.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_bbox.h", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_cheat.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_cheat.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_cheat.c", "target": "progs/doomgeneric/m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_config.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_controls.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_controls.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_controls.c", "target": "progs/doomgeneric/m_config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_controls.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_fixed.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_fixed.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_fixed.c", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/d_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/i_timer.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/m_controls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.c", "target": "progs/doomgeneric/m_menu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_menu.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_misc.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/m_random.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/memio.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/memio.c", "target": "progs/doomgeneric/memio.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/memio.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_client.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_client.h", "target": "progs/doomgeneric/d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_client.h", "target": "progs/doomgeneric/sha1.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_client.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_defs.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_defs.h", "target": "progs/doomgeneric/d_ticcmd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_defs.h", "target": "progs/doomgeneric/sha1.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_gui.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_io.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_loop.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_packet.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_query.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/net_sdl.h", "target": "progs/doomgeneric/net_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_ceilng.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_doors.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_enemy.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_floor.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/am_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_inter.c", "target": "progs/doomgeneric/p_inter.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_lights.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_lights.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_lights.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_lights.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_lights.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_local.h", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_local.h", "target": "progs/doomgeneric/p_spec.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_map.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_maputl.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_maputl.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_maputl.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_maputl.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_maputl.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/hu_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.h", "target": "progs/doomgeneric/tables.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.h", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.h", "target": "progs/doomgeneric/d_think.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.h", "target": "progs/doomgeneric/doomdata.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_mobj.h", "target": "progs/doomgeneric/info.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_plats.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.c", "target": "progs/doomgeneric/p_pspr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.h", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.h", "target": "progs/doomgeneric/tables.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_pspr.h", "target": "progs/doomgeneric/info.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/p_saveg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_saveg.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_setup.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_sight.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_sight.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_sight.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_sight.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_spec.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_switch.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_telept.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_telept.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_telept.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_telept.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_telept.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_telept.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_tick.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_tick.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_tick.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_user.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_user.c", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_user.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/p_user.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/r_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/r_plane.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/r_things.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_bsp.c", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/r_sky.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.c", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.h", "target": "progs/doomgeneric/r_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_data.h", "target": "progs/doomgeneric/r_state.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_defs.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_defs.h", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_defs.h", "target": "progs/doomgeneric/d_think.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_defs.h", "target": "progs/doomgeneric/p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_defs.h", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_defs.h", "target": "progs/doomgeneric/v_patch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_draw.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/tables.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_bsp.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_segs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_plane.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_things.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_local.h", "target": "progs/doomgeneric/r_draw.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.c", "target": "progs/doomgeneric/d_loop.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.c", "target": "progs/doomgeneric/m_menu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.c", "target": "progs/doomgeneric/r_sky.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.h", "target": "progs/doomgeneric/d_player.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_main.h", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.c", "target": "progs/doomgeneric/r_sky.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_plane.h", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_segs.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_segs.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_segs.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_segs.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_segs.c", "target": "progs/doomgeneric/r_sky.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_sky.c", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_sky.c", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_sky.c", "target": "progs/doomgeneric/r_sky.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_state.h", "target": "progs/doomgeneric/d_player.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_state.h", "target": "progs/doomgeneric/r_data.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/r_things.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/i_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.h", "target": "progs/doomgeneric/p_mobj.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/s_sound.h", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sha1.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sha1.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sha1.c", "target": "progs/doomgeneric/sha1.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sha1.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sounds.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sounds.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/sounds.h", "target": "progs/doomgeneric/i_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/st_lib.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_lib.h", "target": "progs/doomgeneric/r_defs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/deh_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/doomkeys.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/st_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/st_lib.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/p_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/p_inter.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/am_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/dstrings.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.h", "target": "progs/doomgeneric/d_event.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/st_stuff.h", "target": "progs/doomgeneric/m_cheat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/statdump.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/statdump.c", "target": "progs/doomgeneric/d_player.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/statdump.c", "target": "progs/doomgeneric/d_mode.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/statdump.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/statdump.c", "target": "progs/doomgeneric/statdump.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/tables.c", "target": "progs/doomgeneric/tables.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/tables.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/tables.h", "target": "progs/doomgeneric/m_fixed.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/deh_str.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/m_bbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/v_video.h", "target": "progs/doomgeneric/v_patch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_checksum.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_checksum.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_checksum.c", "target": "progs/doomgeneric/sha1.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_checksum.c", "target": "progs/doomgeneric/w_checksum.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_checksum.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_checksum.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file.c", "target": "progs/doomgeneric/w_file.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "progs/doomgeneric/w_file.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_file_stdc.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/doomfeatures.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/m_argv.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/w_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/w_merge.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_main.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/config.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/d_iwad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/i_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.h", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.h", "target": "progs/doomgeneric/d_mode.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/w_wad.h", "target": "progs/doomgeneric/w_file.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/m_misc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/m_random.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/deh_main.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/i_swap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/w_wad.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/g_game.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/s_sound.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/doomstat.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/sounds.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/v_video.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.c", "target": "progs/doomgeneric/wi_stuff.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/wi_stuff.h", "target": "progs/doomgeneric/doomdef.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/z_zone.c", "target": "progs/doomgeneric/z_zone.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/z_zone.c", "target": "progs/doomgeneric/i_system.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/doomgeneric/z_zone.c", "target": "progs/doomgeneric/doomtype.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "progs/minios_png.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "progs/file/file_assoc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file.c", "target": "headers/leakcheck.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/file/file_assoc.h", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/freedomui_minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/freedomui_minios.c", "target": "progs/nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/freedomui_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/media_unavailable.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/platform_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/platform_minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/platform_minios.c", "target": "progs/freedomui/ps2_keymap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/ps2_keymap.c", "target": "progs/freedomui/ps2_keymap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/freedomui/ps2_keymap.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/lisp/lisp.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/lisp/lisp.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/lua/lua_main.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/lua/minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/micropython/variants/minios/lib/hello.py", "target": "progs/lua/minios.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/micropython/variants/minios/lib/mip.py", "target": "progs/lua/minios.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/micropython/variants/minios/minios_module.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/minicraft/minicraft.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/minicraft/minicraft.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/cvm_emit.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/cvm_emit.c", "target": "progs/nuklear/cvm_emit.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/font8x8.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/node_editor.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/node_editor.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/node_editor.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/node_editor.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/node_editor.c", "target": "progs/nuklear/cvm_emit.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_minios.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_minios.c", "target": "progs/nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_minios.c", "target": "progs/wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_minios.c", "target": "progs/wl/wl_client.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_minios.h", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_theme.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/nuklear/nuklear_theme.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/paint/paint.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/paint/paint.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/paint/paint.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/paint/paint.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/piano/piano.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/piano/piano.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/piano/piano.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/piano/piano.c", "target": "progs/src/opl3.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/piano/piano.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/pokemon/platform_minios.c", "target": "headers/audio.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/pokemon/platform_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/pokemon/platform_minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/pokemon/platform_minios.c", "target": "progs/minios_png.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "progs/doomgeneric/r_local.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/quake2generic/q2generic_minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/quake2generic/snddma_minios.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/quake2generic/snddma_minios.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/apsse.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/audio.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/cvmfmt.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/fptest.c", "target": "progs/src/mthreads.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/fptest.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/freedom.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/freedom_wl.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/freedom_wl.c", "target": "headers/vga_fb.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/freedom_wl.c", "target": "progs/nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/freedom_wl.c", "target": "progs/wl/wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/freedom_wl.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxabi.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxabi.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxabi.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxabi.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxnet.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxproc.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxsecc.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxsel.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxsel.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/lxtls.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/mthreads.h", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/opl3.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/opl3.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/pip.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/pip.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/sbtone.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/scfuzz.c", "target": "progs/src/mthreads.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/shell.py", "target": "progs/lua/minios.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/test.py", "target": "progs/lua/minios.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/test_py.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/test_py.py", "target": "progs/micropython/variants/minios/lib/mip.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/thdemo.c", "target": "progs/src/mthreads.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/src/thdemo.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/tls_u/tls_u_main.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/tls_u/tls_u_main.c", "target": "headers/tls_port.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/tls_u/tls_u_main.c", "target": "headers/tls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/tls_u/tls_u_port.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/tls_u/tls_u_port.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/tls_u/tls_u_port.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/topogpt3/topogpt3.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/vedit/vedit.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/vedit/vedit.c", "target": "progs/nuklear/nuklear_minios.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/vedit/vedit.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/vedit/vedit.c", "target": "headers/leakcheck.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wl_client.h", "target": "progs/wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wl_mbox.h", "target": "progs/wl/wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wl_pixbuf.h", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "progs/nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "progs/wl/wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "progs/wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "progs/wl/wl_client.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "progs/wl/wlcomp.c", "target": "progs/wl/wl_pixbuf.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "qga.c", "target": "headers/qga.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "qga.c", "target": "headers/rtc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "smp.c", "target": "headers/arch/x86/boot/bootdefs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "smp.c", "target": "headers/smp.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "smp.c", "target": "headers/sched.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "smp.c", "target": "headers/ap_stub.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "smp.c", "target": "headers/arch/x86/msr.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "smp.c", "target": "headers/arch/x86/cpu_setup.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/stubs/kernel.h", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_abi.c", "target": "headers/abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_abi.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_arena.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_arena.c", "target": "headers/arena.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_batch.c", "target": "headers/batch.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_doom_pwad.py", "target": "tools/doom_pwad.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_doom_pwad.py", "target": "tools/doom_pwad.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_doom_pwad.py", "target": "tools/doom_pwad.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_driver.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_driver.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ext4.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ext4.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ext4.c", "target": "headers/ext4.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ext4.c", "target": "headers/fsimg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ext4.c", "target": "fs/fsimg.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ext4.c", "target": "fs/ext4.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fat32.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fat32.c", "target": "headers/minifs.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fat32.c", "target": "headers/fat32.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fat32.c", "target": "headers/fsimg.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fat32.c", "target": "fs/fsimg.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fat32.c", "target": "fs/fat32.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fault.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fault.c", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_file_assoc.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_file_assoc.c", "target": "progs/file/file_assoc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_freedom_wl.c", "target": "progs/src/freedom_wl.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_freedomui.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_freedomui.c", "target": "progs/freedomui/freedomui_minios.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_futex.c", "target": "headers/futex.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_fx.c", "target": "headers/vga_fx.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_hal_io.c", "target": "headers/arch/x86/hal_io.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_httpd.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_httpd.c", "target": "headers/httpd.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ktime.c", "target": "headers/ktime.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ldso.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ldso.c", "target": "headers/ldso.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ldso.c", "target": "kernel/ldso_parse.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_leakcheck.c", "target": "headers/leakcheck.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_leakcheck.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_leakcheck.c", "target": "progs/file/file_assoc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_minios_png.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_minios_png.c", "target": "progs/minios_png.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_modifiers.c", "target": "headers/drivers/modifiers.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_notify.c", "target": "headers/wm_notify.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_paint.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_panic.c", "target": "headers/panic.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pcache.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pcache.c", "target": "headers/pcache.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pcache.c", "target": "fs/pcache.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pci.c", "target": "headers/drivers/pci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pcm.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pcm.c", "target": "headers/pcm_ring.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_percpu_rq.c", "target": "headers/percpu_rq.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_pipe.c", "target": "headers/pipe.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ps2_keymap.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_ps2_keymap.c", "target": "progs/freedomui/ps2_keymap.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_randmix.c", "target": "headers/randmix.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_rcu.c", "target": "headers/rcu.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_rtc.c", "target": "headers/rtc.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_sanitize.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_sanitize.c", "target": "headers/sanitize.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_seccomp_bpf.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_seccomp_bpf.c", "target": "headers/seccomp_bpf.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_select_map.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_select_map.c", "target": "headers/select_map.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_sign.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_sign.c", "target": "headers/sign.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_sync.c", "target": "headers/sync.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_theme.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_theme.c", "target": "progs/nuklear/nuklear_theme.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_tick.c", "target": "headers/tick.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbblk.c", "target": "headers/driver.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbblk.c", "target": "headers/drivers/usbblk.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbblk.c", "target": "drivers/xhci.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbblk.c", "target": "drivers/usbblk.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbhid.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbhid.c", "target": "headers/drivers/usbhid.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbhid.c", "target": "drivers/xhci.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_usbhid.c", "target": "drivers/usbhid.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_vedit_build.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_vma.c", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_vma_bench.c", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_vma_bench.c", "target": "headers/vma.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wl.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wl.c", "target": "progs/wl/wl_mini.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wl.c", "target": "progs/wl/wl_mbox.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wl.c", "target": "progs/wl/wl_pixbuf.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wl.c", "target": "progs/nk_palette.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wl.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_geom.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_events.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_window.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_render.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_tiling.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_focus.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_layout.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_wm.c", "target": "headers/wm_gfxview.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_xhci.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_xhci.c", "target": "headers/drivers/xhci.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tests/test_xhci.c", "target": "drivers/xhci.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tls_test.c", "target": "kernel/string.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tls_test.c", "target": "headers/tls_port.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tls_test.c", "target": "headers/tls.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/abi_stamp.c", "target": "progs/minios_abi.h"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/boot_wl.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/gdb_repro.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/minios_cli.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/minios_gui.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/minios_hyper.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/probe_compute_vga.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/probe_minicraft.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/qga_client.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/repro_gui.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_fashion.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_freedom.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_gfxview.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_gfxview.py", "target": "tools/test_gui_wm.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_icon_cwd.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_menu.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_menu.py", "target": "tools/test_gui_wm.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_wm.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_zoom.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_gui_zoom.py", "target": "tools/test_gui_wm.py"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/test_http_server.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "tools/tls_test.py", "target": "kernel/time.c"}, {"confidence": "EXTRACTED", "relation": "resolved_imports", "source": "vma.c", "target": "headers/vma.h"}], "generator": "readmenator", "metadata": {"edge_count": 9676, "file_count": 589, "language_count": 7, "symbol_count": 13027}, "nodes": [{"doc": "ap_entry.S - SMP application-processor bootstrap stub.", "id": "arch/x86/ap_entry.S", "kind": "module", "label": "ap_entry.S", "language": "S", "sha256": "f901a6e3e7262b5e", "symbol_count": 9, "symbols": [{"kind": "function", "line": 21, "name": "ap_stub_start"}, {"kind": "function", "line": 39, "name": "ap_pm"}, {"kind": "function", "line": 62, "name": "ap_lm"}, {"kind": "function", "line": 80, "name": "ap_patch_slot"}, {"kind": "function", "line": 84, "name": "ap_gdt32"}, {"doc": "movw %ax, %ss /* Load smp_ap_entry()'s address from the BSP-patched slot and go. mov ap_patch_slot(%rip), %rax jmp *%rax .globl ap_patch_slot ap_patch_slot: .quad 0 .p2align 2 ap_gdt32: .quad 0x0000000000000000 .quad 0x00CF9A000000FFFF     /* code32 base 0 limit 4G .quad 0x00CF92000000FFFF     /* data32 base 0 limit 4G", "kind": "function", "line": 88, "name": "ap_gdt32_ptr"}, {"kind": "function", "line": 91, "name": "ap_gdt32_end"}, {"kind": "function", "line": 93, "name": "ap_gdt64_ptr"}, {"kind": "function", "line": 98, "name": "ap_stub_end"}]}, {"doc": "stage1.S - MiniOS boot sector.", "id": "arch/x86/boot/stage1.S", "kind": "module", "label": "stage1.S", "language": "S", "sha256": "24326caac4c8b35e", "symbol_count": 11, "symbols": [{"kind": "function", "line": 28, "name": "main"}, {"kind": "function", "line": 32, "name": "normalize"}, {"kind": "function", "line": 78, "name": "no_extensions"}, {"kind": "function", "line": 82, "name": "read_failed"}, {"kind": "function", "line": 85, "name": "fail"}, {"kind": "function", "line": 88, "name": "halt"}, {"kind": "function", "line": 93, "name": "puts"}, {"kind": "function", "line": 97, "name": "puts_next"}, {"kind": "function", "line": 103, "name": "puts_done"}, {"kind": "function", "line": 107, "name": "msg_no_lba"}, {"kind": "function", "line": 109, "name": "msg_read"}]}, {"doc": "stage2.S - MiniOS second-stage loader.", "id": "arch/x86/boot/stage2.S", "kind": "module", "label": "stage2.S", "language": "S", "sha256": "c16685179337d0dc", "symbol_count": 40, "symbols": [{"kind": "function", "line": 39, "name": "stage2_main"}, {"kind": "function", "line": 54, "name": "a20_ready"}, {"kind": "function", "line": 69, "name": "load_chunk"}, {"kind": "function", "line": 74, "name": "chunk_size_ready"}, {"kind": "function", "line": 81, "name": "read_piece"}, {"kind": "function", "line": 86, "name": "piece_size_ready"}, {"kind": "function", "line": 118, "name": "chunk_copy"}, {"kind": "function", "line": 131, "name": "chunk_leave_pm"}, {"kind": "function", "line": 141, "name": "chunk_resume"}, {"kind": "function", "line": 162, "name": "enter_long_mode"}, {"kind": "function", "line": 190, "name": "fill_pt0_low"}, {"kind": "function", "line": 208, "name": "dma_uncache"}, {"kind": "function", "line": 216, "name": "fill_pt0_kernel"}, {"kind": "function", "line": 235, "name": "fill_pt1_kernel"}, {"kind": "function", "line": 244, "name": "fill_pt1_bss"}, {"doc": "endif", "kind": "function", "line": 260, "name": "fill_page_directory"}, {"kind": "function", "line": 289, "name": "read_failed"}, {"kind": "function", "line": 293, "name": "halt"}, {"kind": "function", "line": 298, "name": "puts"}, {"kind": "function", "line": 302, "name": "puts_next"}, {"kind": "function", "line": 308, "name": "puts_done"}, {"kind": "function", "line": 312, "name": "msg_read"}, {"doc": "Probe VESA BIOS Extensions for a high-resolution linear framebuffer and record it for the kernel in the fixed VBE_INFO_ADDR struct. Tries 1024x768 (true color first, then 8-bit palette), then 800x600x32, 800x600x8, 640x480x32 and 640x480x8, then falls back to VGA Mode 13h. Runs in real mode (the kernel image is already fully loaded, so this scratch is safe) and must complete before the transition to long mode kills the BIOS video services. A true-color mode frees the desktop from the 256-entry VGA DAC palette; the 8-bit modes keep that path unchanged. The kernel maps the framebuffer slot by slot, so a multi-MB framebuffer * spanning two 2 MB PD slots is fully mapped.", "kind": "function", "line": 325, "name": "vbe_probe"}, {"doc": "Try one VBE mode held in %bx. On success the mode is set with the linear framebuffer bit and carry is cleared; on any failure carry is set so the caller can try the next candidate. Only 8/24/32-bit modes are accepted: a 15/16-bit mode would need an RGB565 packer the kernel does not carry, * so it is skipped like an unsupported mode.", "kind": "function", "line": 364, "name": "vbe_try_mode"}, {"kind": "function", "line": 395, "name": "vbe_try_bpp_ok"}, {"kind": "function", "line": 420, "name": "vbe_set_fail"}, {"kind": "function", "line": 423, "name": "vbe_try_fail"}, {"kind": "function", "line": 429, "name": "vbe_ok"}, {"doc": "Pick the kernel's physical load base: a 2 MB-aligned address in the 64-position window above the kernel heap, seeded from the TSC and the RTC so consecutive boots land at different locations. Returns the base in eax. The virtual base stays at the link-time 0x100000, which PT0/PT1 map * to the returned physical base.", "kind": "function", "line": 438, "name": "kaslr_pick"}, {"kind": "function", "line": 475, "name": "gdt32_start"}, {"kind": "function", "line": 481, "name": "gdt32_end"}, {"kind": "function", "line": 482, "name": "gdt32_ptr"}, {"kind": "function", "line": 487, "name": "gdt64_image"}, {"kind": "function", "line": 493, "name": "gdt64_ptr"}, {"kind": "function", "line": 497, "name": "saved_gdtr"}, {"kind": "function", "line": 500, "name": "sectors_left"}, {"kind": "function", "line": 502, "name": "chunk_sectors"}, {"kind": "function", "line": 504, "name": "next_lba"}, {"kind": "function", "line": 506, "name": "dest_addr"}, {"kind": "function", "line": 508, "name": "kaslr_dest"}]}, {"id": "arch/x86/ctx_sw.S", "kind": "module", "label": "ctx_sw.S", "language": "S", "sha256": "1c9922111991499b", "symbol_count": 9, "symbols": [{"doc": "captured the rest. Offsets mirror CTX_*_OFF in headers/sched.h (asserted in C). Requires frame pointers (CFLAGS_KERN carries -fno-omit-frame-pointer; without it %rbp is meaningless here).  rip MUST be 8(%rbp) -- the return into schedule()'s CALLER (yield / do_waitpid / do_exit) -- never (%rsp), the return into schedule() itself. A resume into schedule's tail re-runs the publish/unlock/ switch sequence a second time (double unlock of sched_lock plus a switch to the stale nxt), which hangs the machine; a resume into the caller simply continues it (callees restore rsp from rbp with `leave`, so the parked rsp=rbp+16 is exact). This mirrors what GCC lowers __builtin_return_address(0) to (*(rbp+8)) and is the reason the old comment insists the tail must never run twice.", "kind": "function", "line": 70, "name": "sched_park_capture"}, {"kind": "function", "line": 82, "name": "switch_save_only"}, {"kind": "function", "line": 91, "name": "switch_to"}, {"kind": "function", "line": 134, "name": "switch_to_notrap"}, {"kind": "function", "line": 221, "name": "user_trampoline"}, {"kind": "function", "line": 233, "name": "fork_trampoline"}, {"kind": "function", "line": 273, "name": "exec_enter"}, {"kind": "function", "line": 302, "name": "resume_iretq"}, {"kind": "function", "line": 342, "name": "k_run_on_stack"}]}, {"id": "arch/x86/isr_stubs.S", "kind": "module", "label": "isr_stubs.S", "language": "S", "sha256": "9227535534f7ef58", "symbol_count": 24, "symbols": [{"kind": "function", "line": 67, "name": "tf_rax"}, {"kind": "function", "line": 68, "name": "tf_rbx"}, {"kind": "function", "line": 69, "name": "tf_rcx"}, {"kind": "function", "line": 70, "name": "tf_rdx"}, {"kind": "function", "line": 71, "name": "tf_rsi"}, {"kind": "function", "line": 72, "name": "tf_rdi"}, {"kind": "function", "line": 73, "name": "tf_rbp"}, {"kind": "function", "line": 74, "name": "tf_r8"}, {"kind": "function", "line": 75, "name": "tf_r9"}, {"kind": "function", "line": 76, "name": "tf_r10"}, {"kind": "function", "line": 77, "name": "tf_r11"}, {"kind": "function", "line": 78, "name": "tf_r12"}, {"kind": "function", "line": 79, "name": "tf_r13"}, {"kind": "function", "line": 80, "name": "tf_r14"}, {"kind": "function", "line": 81, "name": "tf_r15"}, {"kind": "function", "line": 82, "name": "tf_rip"}, {"kind": "function", "line": 83, "name": "tf_cs"}, {"kind": "function", "line": 84, "name": "tf_rflags"}, {"kind": "function", "line": 85, "name": "tf_rsp"}, {"kind": "function", "line": 86, "name": "tf_ss"}, {"kind": "function", "line": 87, "name": "tf_vector"}, {"kind": "function", "line": 88, "name": "tf_errcode"}, {"kind": "function", "line": 96, "name": "isr_common"}, {"kind": "function", "line": 195, "name": "isr_stub_table"}]}, {"id": "arch/x86/syscall_entry.S", "kind": "module", "label": "syscall_entry.S", "language": "S", "sha256": "7e6b252045b1a1b9", "symbol_count": 4, "symbols": [{"kind": "function", "line": 49, "name": "syscall_kstack"}, {"kind": "function", "line": 52, "name": "kstack_base"}, {"kind": "function", "line": 55, "name": "sc_top_save_addr"}, {"kind": "function", "line": 65, "name": "syscall_entry"}]}, {"id": "arch/x86/tlb_nmi.S", "kind": "module", "label": "tlb_nmi.S", "language": "S", "sha256": "c8b5bdfc76f2f7c8", "symbol_count": 1, "symbols": [{"kind": "function", "line": 21, "name": "tlb_nmi_entry"}]}, {"doc": "Docstring: boot/uefi_stub.c -- Minimal MiniOS UEFI stub (Phase 1).", "id": "boot/uefi_stub.c", "kind": "module", "label": "uefi_stub.c", "language": "c", "sha256": "2a42d87e4780802a", "symbol_count": 50, "symbols": [{"kind": "struct", "line": 61, "name": "efi_simple_text_output"}, {"kind": "struct", "line": 100, "name": "efi_gop"}, {"kind": "struct", "line": 288, "name": "efi_file"}, {"kind": "struct", "line": 45, "name": "efi_table_header"}, {"kind": "struct", "line": 53, "name": "efi_input_key"}, {"kind": "struct", "line": 74, "name": "efi_pixel_bitmask"}, {"kind": "struct", "line": 81, "name": "efi_gop_mode_info"}, {"kind": "struct", "line": 90, "name": "efi_gop_mode"}, {"kind": "struct", "line": 107, "name": "efi_mem_desc"}, {"kind": "struct", "line": 115, "name": "efi_boot_services"}, {"kind": "struct", "line": 171, "name": "efi_system_table"}, {"doc": "Block I/O protocol (boot disk proof): Revision, Media pointer, Reset, ReadBlocks, WriteBlocks, FlushBlocks. Only Media->BlockSize * and a one-block read are touched.", "kind": "struct", "line": 240, "name": "efi_block_io"}, {"kind": "struct", "line": 250, "name": "efi_block_media"}, {"kind": "struct", "line": 272, "name": "efi_loaded_image"}, {"kind": "struct", "line": 302, "name": "efi_sfs"}, {"doc": "and a missing header turns the first call into a jump at the \"BOOTSERV\" magic itself).  Phase 2a (landed): SimpleFileSystem reads kernel.bin whole, ExitBootServices, then a 64-bit entry prints the handoff block over serial and halts (load + exit + jump with no kernel changes). Slices (b) dynamic framebuffer and (c) full boot to shell stay future work; VESA/VGA text is the fallback, INT 13h paths untouched.  Hand-rolled GUIDs are byte-checked against EDK2, never memory: LoadedImage is 5B1B31A1 (not B1) and SFS Data2 is 0x6459 (not 0x52); each wrong byte is a silent EFI_NOT_FOUND with no hint which nibble lied.", "kind": "type_alias", "line": 26, "name": "u64", "signature": "typedef unsigned long long u64;"}, {"kind": "type_alias", "line": 28, "name": "u32", "signature": "typedef unsigned int u32;"}, {"kind": "type_alias", "line": 29, "name": "u16", "signature": "typedef unsigned short u16;"}, {"kind": "type_alias", "line": 30, "name": "u8", "signature": "typedef unsigned char u8;"}, {"kind": "type_alias", "line": 31, "name": "efi_status", "signature": "typedef u64 efi_status;"}, {"kind": "type_alias", "line": 33, "name": "efi_physical_addr", "signature": "typedef u64 efi_physical_addr;"}, {"kind": "type_alias", "line": 34, "name": "efi_virtual_addr", "signature": "typedef u64 efi_virtual_addr;"}, {"kind": "type_alias", "line": 57, "name": "efi_simple_text_output", "signature": "typedef struct efi_simple_text_output efi_simple_text_output;"}, {"kind": "type_alias", "line": 98, "name": "efi_gop", "signature": "typedef struct efi_gop efi_gop;"}, {"kind": "type_alias", "line": 279, "name": "efi_file", "signature": "typedef struct efi_file efi_file;"}, {"kind": "function", "line": 188, "name": "com1_putc", "signature": "static void com1_putc(char c)"}, {"kind": "function", "line": 197, "name": "puts_both", "signature": "static void puts_both(const char *s)"}, {"kind": "function", "line": 205, "name": "puts_con", "signature": "static void puts_con(const u16 *s)"}, {"kind": "function", "line": 210, "name": "put_u64", "signature": "static void put_u64(u64 v)"}, {"kind": "function", "line": 227, "name": "put_hex", "signature": "static void put_hex(u64 v)"}, {"kind": "function", "line": 350, "name": "w_u16", "signature": "static void w_u16(unsigned long addr, unsigned v)"}, {"kind": "function", "line": 356, "name": "w_u32", "signature": "static void w_u32(unsigned long addr, unsigned long v)"}, {"kind": "function", "line": 364, "name": "w_u64", "signature": "static void w_u64(unsigned long addr, unsigned long long v)"}, {"kind": "function", "line": 371, "name": "boot_kernel", "signature": "static void boot_kernel(unsigned long src, unsigned long len)"}, {"kind": "function", "line": 416, "name": "efi_main", "signature": "efi_status EFIABI efi_main(efi_handle image, efi_system_table *systab)"}, {"kind": "macro", "line": 41, "name": "EFIABI", "signature": "#define EFIABI"}, {"kind": "macro", "line": 43, "name": "EFI_SUCCESS", "signature": "#define EFI_SUCCESS"}, {"kind": "macro", "line": 267, "name": "EFI_LOADER_DATA", "signature": "#define EFI_LOADER_DATA"}, {"kind": "macro", "line": 268, "name": "EFI_FILE_MODE_READ", "signature": "#define EFI_FILE_MODE_READ"}, {"kind": "macro", "line": 269, "name": "EFI_BUFFER_TOO_SMALL", "signature": "#define EFI_BUFFER_TOO_SMALL"}, {"kind": "macro", "line": 270, "name": "UEFI_KERNEL_MAX", "signature": "#define UEFI_KERNEL_MAX"}, {"kind": "macro", "line": 316, "name": "UBOOT_LOW_PAGES", "signature": "#define UBOOT_LOW_PAGES"}, {"kind": "macro", "line": 317, "name": "UBOOT_KERN_PAGES", "signature": "#define UBOOT_KERN_PAGES"}, {"kind": "macro", "line": 318, "name": "UBOOT_KERN_SPAN", "signature": "#define UBOOT_KERN_SPAN"}, {"kind": "macro", "line": 319, "name": "UBOOT_KERN_BASE", "signature": "#define UBOOT_KERN_BASE"}, {"kind": "macro", "line": 320, "name": "UBOOT_TRAMP", "signature": "#define UBOOT_TRAMP"}, {"kind": "macro", "line": 321, "name": "TRAMP_LGDT_OFF", "signature": "#define TRAMP_LGDT_OFF"}, {"kind": "macro", "line": 322, "name": "TRAMP_LEN", "signature": "#define TRAMP_LEN"}, {"kind": "macro", "line": 323, "name": "UBOOT_GDT", "signature": "#define UBOOT_GDT"}, {"kind": "macro", "line": 324, "name": "UBOOT_GDT_DESC", "signature": "#define UBOOT_GDT_DESC"}]}, {"id": "bootloader.c", "kind": "module", "label": "bootloader.c", "language": "c", "sha256": "ca3f118cd4e0f32e", "symbol_count": 2, "symbols": [{"kind": "function", "line": 21, "name": "main", "signature": "void main(void)"}, {"kind": "macro", "line": 19, "name": "KSECTORS", "signature": "#define KSECTORS"}]}, {"doc": "Block device layer for MiniFS.", "id": "drivers/block.c", "kind": "module", "label": "block.c", "language": "c", "sha256": "147a773546b67cb0", "symbol_count": 19, "symbols": [{"kind": "function", "line": 64, "name": "bc_index", "signature": "static unsigned int bc_index(unsigned int block_num)"}, {"kind": "function", "line": 68, "name": "bc_invalidate_locked", "signature": "static void bc_invalidate_locked(unsigned int block_num)"}, {"kind": "function", "line": 73, "name": "bc_invalidate", "signature": "static void bc_invalidate(unsigned int block_num)"}, {"kind": "function", "line": 80, "name": "block_init", "signature": "void block_init(void)"}, {"kind": "function", "line": 113, "name": "block_set_base", "signature": "void block_set_base(unsigned int lba_base)"}, {"doc": "Strategy consumer: sector I/O goes through the registered block device's ops table (dev->ops->read/write), never straight at the hardware. The virtio queue wins when block_init preferred it (same image as IDE, or IDE absent on virtio-only hardware); IDE stays as the fallback, and the direct ide_* call covers the window between block_init's probe and the registry publish, plus images whose IDE probe found no disk * (registry still publishes, present() says 0).", "kind": "function", "line": 128, "name": "block_dev_read", "signature": "static int block_dev_read(unsigned lba, unsigned count, void *buf)"}, {"kind": "function", "line": 146, "name": "block_dev_write", "signature": "static int block_dev_write(unsigned lba, unsigned count, const void *buf)"}, {"kind": "function", "line": 164, "name": "block_read", "signature": "int block_read(unsigned int block_num, void *buf)"}, {"kind": "function", "line": 205, "name": "block_write", "signature": "int block_write(unsigned int block_num, const void *buf)"}, {"kind": "function", "line": 214, "name": "block_read_multi", "signature": "int block_read_multi(unsigned int block_num, unsigned int count, void *buf)"}, {"kind": "function", "line": 219, "name": "block_write_multi", "signature": "int block_write_multi(unsigned int block_num, unsigned int count, const void *buf)"}, {"kind": "function", "line": 234, "name": "block_flush", "signature": "void block_flush(void)"}, {"kind": "function", "line": 236, "name": "block_total", "signature": "unsigned int block_total(void)"}, {"doc": "Docstring: Absolute sector read on the active backend, with no cache and no base offset: partition tables and foreign filesystems address the * whole disk, not the MiniFS window.", "kind": "function", "line": 244, "name": "block_read_sectors", "signature": "int block_read_sectors(unsigned lba, unsigned count, void *buf)"}, {"doc": "Docstring: Size of the active backend in sectors, so scanners fence to * the USB stick when it is the backend and not to the IDE disk.", "kind": "function", "line": 255, "name": "block_disk_sectors", "signature": "unsigned long block_disk_sectors(void)"}, {"kind": "function", "line": 122, "name": "table", "signature": "* ops table (dev->ops->read/write), never straight at the hardware. The * virtio queue wins when block_init preferred it (same image as IDE, or * IDE absent on virtio-only hardware);"}, {"kind": "macro", "line": 53, "name": "BC_WAYS", "signature": "#define BC_WAYS"}, {"kind": "macro", "line": 54, "name": "BC_MASK", "signature": "#define BC_MASK"}, {"kind": "macro", "line": 62, "name": "BC_LINE", "signature": "#define BC_LINE(idx)"}]}, {"doc": "driver.c -- Device registry for the Strategy-pattern driver layer.", "id": "drivers/driver.c", "kind": "module", "label": "driver.c", "language": "c", "sha256": "af9f3087633bef42", "symbol_count": 8, "symbols": [{"kind": "function", "line": 14, "name": "dev_len", "signature": "static unsigned dev_len(const char *s)"}, {"kind": "function", "line": 20, "name": "dev_copy", "signature": "static void dev_copy(char *dst, const char *src, unsigned cap)"}, {"kind": "function", "line": 27, "name": "dev_eq", "signature": "static int dev_eq(const char *a, const char *b)"}, {"kind": "function", "line": 32, "name": "device_reset", "signature": "void device_reset(void)"}, {"kind": "function", "line": 44, "name": "device_register", "signature": "int device_register(device_t *dev)"}, {"kind": "function", "line": 66, "name": "device_find", "signature": "device_t *device_find(const char *name)"}, {"kind": "function", "line": 76, "name": "device_find_by_type", "signature": "device_t *device_find_by_type(int type)"}, {"kind": "function", "line": 85, "name": "device_count", "signature": "int device_count(void)"}]}, {"doc": "IDE/ATA PIO driver for MiniOS.", "id": "drivers/ide.c", "kind": "module", "label": "ide.c", "language": "c", "sha256": "bf044a9f5605317f", "symbol_count": 19, "symbols": [{"kind": "function", "line": 13, "name": "ide_delay", "signature": "static void ide_delay(void)"}, {"kind": "function", "line": 23, "name": "ide_read_status", "signature": "static unsigned char ide_read_status(void)"}, {"kind": "function", "line": 27, "name": "ide_wait_not_busy", "signature": "static int ide_wait_not_busy(unsigned int timeout)"}, {"kind": "function", "line": 40, "name": "ide_wait_drq", "signature": "static int ide_wait_drq(unsigned int timeout)"}, {"kind": "function", "line": 53, "name": "ide_select_drive", "signature": "static void ide_select_drive(unsigned char drive)"}, {"kind": "function", "line": 59, "name": "ide_soft_reset", "signature": "static void ide_soft_reset(void)"}, {"kind": "function", "line": 66, "name": "ide_identify", "signature": "static int ide_identify(void)"}, {"kind": "function", "line": 91, "name": "ide_init", "signature": "void ide_init(void)"}, {"kind": "function", "line": 110, "name": "ide_present", "signature": "int ide_present(void)"}, {"kind": "function", "line": 111, "name": "ide_total_sectors", "signature": "unsigned int ide_total_sectors(void)"}, {"kind": "function", "line": 113, "name": "ide_ops_read", "signature": "static int ide_ops_read(device_t *dev, unsigned lba, unsigned count, void *buf)"}, {"kind": "function", "line": 118, "name": "ide_ops_write", "signature": "static int ide_ops_write(device_t *dev, unsigned lba, unsigned count, const void *buf)"}, {"kind": "function", "line": 123, "name": "ide_ops_total", "signature": "static unsigned ide_ops_total(device_t *dev)"}, {"kind": "function", "line": 128, "name": "ide_ops_present", "signature": "static int ide_ops_present(device_t *dev)"}, {"kind": "function", "line": 148, "name": "ide_register_device", "signature": "void ide_register_device(void)"}, {"kind": "function", "line": 152, "name": "ide_read_sectors", "signature": "int ide_read_sectors(unsigned int lba, unsigned int count, void *buf)"}, {"kind": "function", "line": 184, "name": "ide_write_sectors", "signature": "int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf)"}, {"kind": "function", "line": 214, "name": "ide_read_sector", "signature": "int ide_read_sector(unsigned int lba, void *buf)"}, {"kind": "function", "line": 218, "name": "ide_write_sector", "signature": "int ide_write_sector(unsigned int lba, const void *buf)"}]}, {"doc": "================================================================", "id": "drivers/kbd.c", "kind": "module", "label": "kbd.c", "language": "c", "sha256": "c8a3044dc28f48d2", "symbol_count": 35, "symbols": [{"kind": "function", "line": 100, "name": "kbd_get_layout", "signature": "int kbd_get_layout(void)"}, {"kind": "function", "line": 101, "name": "kbd_set_layout", "signature": "void kbd_set_layout(int layout)"}, {"kind": "function", "line": 105, "name": "kbd_toggle_layout", "signature": "void kbd_toggle_layout(void)"}, {"doc": "#define kbd_super (kbd_mods.super) #define kbd_altgr (kbd_mods.altgr) #define KBD_QUEUE_LEN 8 #define KBD_SCAN_DEL 0x53 static unsigned char kbd_queue[KBD_QUEUE_LEN]; static int kbd_q_head, kbd_q_tail; static int kbd_e0; /** Docstring: Full-queue drop counters observable via wm state. static unsigned long kbd_drop_cooked; static unsigned long kbd_drop_raw; /** Docstring: Report cooked and raw queue drop counters.", "kind": "function", "line": 132, "name": "kbd_drop_counts", "signature": "void kbd_drop_counts(unsigned long *cooked, unsigned long *raw)"}, {"kind": "function", "line": 146, "name": "kbd_q_push", "signature": "void kbd_q_push(unsigned char c)"}, {"kind": "function", "line": 156, "name": "kbd_raw_push_internal", "signature": "static void kbd_raw_push_internal(unsigned char c)"}, {"kind": "function", "line": 166, "name": "kbd_q_empty", "signature": "int kbd_q_empty(void)"}, {"kind": "function", "line": 168, "name": "kbd_q_pop", "signature": "int kbd_q_pop(void)"}, {"kind": "function", "line": 175, "name": "kbd_available", "signature": "int kbd_available(void)"}, {"kind": "function", "line": 181, "name": "kbd_raw_mode_get", "signature": "int kbd_raw_mode_get(void)"}, {"kind": "function", "line": 182, "name": "kbd_raw_mode_set", "signature": "void kbd_raw_mode_set(int on)"}, {"kind": "function", "line": 183, "name": "kbd_raw_empty", "signature": "int kbd_raw_empty(void)"}, {"kind": "function", "line": 184, "name": "kbd_raw_pop", "signature": "int kbd_raw_pop(void)"}, {"kind": "function", "line": 190, "name": "kbd_raw_push_byte", "signature": "void kbd_raw_push_byte(unsigned char c)"}, {"kind": "function", "line": 191, "name": "kbd_e0_get", "signature": "int kbd_e0_get(void)"}, {"kind": "function", "line": 192, "name": "kbd_e0_set", "signature": "void kbd_e0_set(int v)"}, {"kind": "function", "line": 193, "name": "kbd_flush_all", "signature": "void kbd_flush_all(void)"}, {"doc": "Drop queued raw scancodes (shell-typed while a terminal owned PS/2) so a * newly focused game never replays them as input. Cooked shell keys stay.", "kind": "function", "line": 200, "name": "kbd_raw_flush", "signature": "void kbd_raw_flush(void)"}, {"kind": "function", "line": 221, "name": "raw_track_mods", "signature": "static int raw_track_mods(int code, int brk, int e0)"}, {"doc": "wm_raw_combo performs the WM action and reports 1 when the byte must be swallowed. Deliberately narrower than the cooked set: bare keys (Tab, F11/F5, arrows) always reach the game, and Alt+arrows stay with the game too (DOOM strafes with Alt+arrows); Super is never a game key, so the full Super set plus Alt+Tab / Alt+Enter / Alt+M,X,Q / Alt+[/]-/=/0 work raw. A swallowed Tab make also swallows its break (same flag as cooked * would need, kept here beside the consumer). static int wm_raw_swallow_tab_break; static int raw_track_mods(int code, int brk, int e0) { return modifiers_update(&kbd_keys, &kbd_mods, code, brk, e0); } /** Docstring: Dispatch one looked-up WM combo to the window manager.", "kind": "function", "line": 226, "name": "wm_combo_dispatch", "signature": "static int wm_combo_dispatch(int action, int zone)"}, {"kind": "function", "line": 278, "name": "wm_raw_combo", "signature": "static int wm_raw_combo(int code, int e0)"}, {"kind": "function", "line": 297, "name": "bare", "signature": "* second byte is not a WM combo is delivered bare (keypad alias): games map\n * both, so play surv..."}, {"kind": "function", "line": 333, "name": "key", "signature": "* navigation key (which is pushed to the cooked queue as an escape sequence\n * instead) or a key ..."}, {"kind": "function", "line": 449, "name": "kbd_read", "signature": "int kbd_read(void)"}, {"kind": "function", "line": 463, "name": "kbd_reset_for_shell", "signature": "void kbd_reset_for_shell(void)"}, {"kind": "function", "line": 210, "name": "paths", "signature": "* keeps the modifier state in sync on both paths (the old raw branch never * tracked Alt/Super, so a modifier held across raw mode stuck forever);"}, {"kind": "function", "line": 215, "name": "too", "signature": "* too (DOOM strafes with Alt+arrows);"}, {"kind": "macro", "line": 115, "name": "kbd_shift", "signature": "#define kbd_shift"}, {"kind": "macro", "line": 116, "name": "kbd_ctrl", "signature": "#define kbd_ctrl"}, {"kind": "macro", "line": 117, "name": "kbd_alt", "signature": "#define kbd_alt"}, {"kind": "macro", "line": 118, "name": "kbd_super", "signature": "#define kbd_super"}, {"kind": "macro", "line": 119, "name": "kbd_altgr", "signature": "#define kbd_altgr"}, {"kind": "macro", "line": 121, "name": "KBD_QUEUE_LEN", "signature": "#define KBD_QUEUE_LEN"}, {"kind": "macro", "line": 122, "name": "KBD_SCAN_DEL", "signature": "#define KBD_SCAN_DEL"}, {"kind": "macro", "line": 141, "name": "KBD_RAW_LEN", "signature": "#define KBD_RAW_LEN"}]}, {"doc": "Docstring: PS/2 mouse device driver (drivers/mouse.c).", "id": "drivers/mouse.c", "kind": "module", "label": "mouse.c", "language": "c", "sha256": "0ba966ef2b8f74a3", "symbol_count": 7, "symbols": [{"kind": "function", "line": 20, "name": "mouse_wait_data", "signature": "static void mouse_wait_data(void)"}, {"kind": "function", "line": 24, "name": "mouse_write", "signature": "static void mouse_write(unsigned char data)"}, {"kind": "function", "line": 31, "name": "mouse_read", "signature": "static unsigned char mouse_read(void)"}, {"kind": "function", "line": 36, "name": "mouse_hw_init", "signature": "void mouse_hw_init(void)"}, {"kind": "function", "line": 112, "name": "mouse_disable", "signature": "void mouse_disable(void)"}, {"kind": "function", "line": 113, "name": "mouse_enable", "signature": "void mouse_enable(void)"}, {"kind": "function", "line": 83, "name": "wrong", "signature": "* later packet is framed wrong (a left press reads back as bit 1, * motion warps), permanently. */ mouse_write(HAL_MOUSE_CMD_RESET);"}]}, {"id": "drivers/nvme.c", "kind": "module", "label": "nvme.c", "language": "c", "sha256": "095f46b525094603", "symbol_count": 50, "symbols": [{"kind": "function", "line": 48, "name": "xnv_outl", "signature": "static void xnv_outl(unsigned short port, unsigned val)"}, {"kind": "function", "line": 52, "name": "xnv_inl", "signature": "static unsigned xnv_inl(unsigned short port)"}, {"kind": "function", "line": 58, "name": "nvme_present", "signature": "int nvme_present(void)"}, {"kind": "function", "line": 62, "name": "nvme_version", "signature": "unsigned nvme_version(void)"}, {"kind": "function", "line": 66, "name": "nvme_note", "signature": "const char *nvme_note(void)"}, {"kind": "function", "line": 89, "name": "xnv_r32", "signature": "static unsigned xnv_r32(unsigned off)"}, {"kind": "function", "line": 93, "name": "xnv_w32", "signature": "static void xnv_w32(unsigned off, unsigned val)"}, {"kind": "function", "line": 97, "name": "xnv_r64", "signature": "static unsigned long long xnv_r64(unsigned off)"}, {"kind": "function", "line": 102, "name": "xnv_w64", "signature": "static void xnv_w64(unsigned off, unsigned long long val)"}, {"kind": "function", "line": 106, "name": "xnv_put16", "signature": "static void xnv_put16(unsigned char *p, unsigned short v)"}, {"kind": "function", "line": 111, "name": "xnv_put32", "signature": "static void xnv_put32(unsigned char *p, unsigned long v)"}, {"kind": "function", "line": 118, "name": "xnv_put64", "signature": "static void xnv_put64(unsigned char *p, unsigned long long v)"}, {"kind": "function", "line": 124, "name": "xnv_get32", "signature": "static unsigned long xnv_get32(const unsigned char *p)"}, {"kind": "function", "line": 129, "name": "xnv_wait_rdy", "signature": "static int xnv_wait_rdy(unsigned want)"}, {"kind": "function", "line": 139, "name": "xnv_next_cid", "signature": "static unsigned short xnv_next_cid(void)"}, {"kind": "function", "line": 145, "name": "xnv_poll", "signature": "static int xnv_poll(unsigned char *cq, unsigned cq_db, unsigned short *head,\n        unsigned sho..."}, {"kind": "function", "line": 169, "name": "xnv_cmd", "signature": "static int xnv_cmd(unsigned char *sq, unsigned sq_db, unsigned char *cq,\n        unsigned cq_db, ..."}, {"kind": "function", "line": 196, "name": "xnv_queues", "signature": "static int xnv_queues(void)"}, {"kind": "function", "line": 286, "name": "nvme_sectors", "signature": "unsigned long nvme_sectors(void)"}, {"kind": "function", "line": 290, "name": "nvme_read_sectors", "signature": "int nvme_read_sectors(unsigned lba, unsigned count, void *buf)"}, {"kind": "function", "line": 310, "name": "nvme_init", "signature": "int nvme_init(void)"}, {"kind": "macro", "line": 6, "name": "NVME_CLASS_BASE", "signature": "#define NVME_CLASS_BASE"}, {"kind": "macro", "line": 7, "name": "NVME_CLASS_SUB", "signature": "#define NVME_CLASS_SUB"}, {"kind": "macro", "line": 8, "name": "NVME_CLASS_PI", "signature": "#define NVME_CLASS_PI"}, {"kind": "macro", "line": 10, "name": "NVME_REG_VS", "signature": "#define NVME_REG_VS"}, {"kind": "macro", "line": 11, "name": "NVME_REG_CAP", "signature": "#define NVME_REG_CAP"}, {"kind": "macro", "line": 12, "name": "NVME_REG_CC", "signature": "#define NVME_REG_CC"}, {"kind": "macro", "line": 13, "name": "NVME_REG_CSTS", "signature": "#define NVME_REG_CSTS"}, {"kind": "macro", "line": 14, "name": "NVME_REG_AQA", "signature": "#define NVME_REG_AQA"}, {"kind": "macro", "line": 15, "name": "NVME_REG_ASQ", "signature": "#define NVME_REG_ASQ"}, {"kind": "macro", "line": 16, "name": "NVME_REG_ACQ", "signature": "#define NVME_REG_ACQ"}, {"kind": "macro", "line": 17, "name": "NVME_DB_BASE", "signature": "#define NVME_DB_BASE"}, {"kind": "macro", "line": 19, "name": "NVME_CC_EN", "signature": "#define NVME_CC_EN"}, {"kind": "macro", "line": 20, "name": "NVME_CC_IOSQES", "signature": "#define NVME_CC_IOSQES"}, {"kind": "macro", "line": 21, "name": "NVME_CC_IOCQES", "signature": "#define NVME_CC_IOCQES"}, {"kind": "macro", "line": 22, "name": "NVME_CSTS_RDY", "signature": "#define NVME_CSTS_RDY"}, {"kind": "macro", "line": 24, "name": "NVME_QSIZE", "signature": "#define NVME_QSIZE"}, {"kind": "macro", "line": 25, "name": "NVME_SQE_LEN", "signature": "#define NVME_SQE_LEN"}, {"kind": "macro", "line": 26, "name": "NVME_CQE_LEN", "signature": "#define NVME_CQE_LEN"}, {"kind": "macro", "line": 27, "name": "NVME_QPAGES", "signature": "#define NVME_QPAGES"}, {"kind": "macro", "line": 29, "name": "NVME_OPC_CREATE_IOSQ", "signature": "#define NVME_OPC_CREATE_IOSQ"}, {"kind": "macro", "line": 30, "name": "NVME_OPC_READ", "signature": "#define NVME_OPC_READ"}, {"kind": "macro", "line": 31, "name": "NVME_OPC_CREATE_IOCQ", "signature": "#define NVME_OPC_CREATE_IOCQ"}, {"kind": "macro", "line": 32, "name": "NVME_OPC_IDENTIFY", "signature": "#define NVME_OPC_IDENTIFY"}, {"kind": "macro", "line": 33, "name": "NVME_NSID", "signature": "#define NVME_NSID"}, {"kind": "macro", "line": 34, "name": "NVME_CNS_NS", "signature": "#define NVME_CNS_NS"}, {"kind": "macro", "line": 35, "name": "NVME_LBADS_512", "signature": "#define NVME_LBADS_512"}, {"kind": "macro", "line": 37, "name": "NVME_MAX_SECTORS", "signature": "#define NVME_MAX_SECTORS"}, {"kind": "macro", "line": 38, "name": "NVME_SECTOR", "signature": "#define NVME_SECTOR"}, {"kind": "macro", "line": 39, "name": "NVME_TMO_MS", "signature": "#define NVME_TMO_MS"}]}, {"doc": "drivers/pcm2.c -- low-latency PCM audio over SB16 single-cycle DMA.", "id": "drivers/pcm2.c", "kind": "module", "label": "pcm2.c", "language": "c", "sha256": "b28afb39fe86a676", "symbol_count": 43, "symbols": [{"kind": "function", "line": 79, "name": "pcm2_dma", "signature": "static unsigned char *pcm2_dma(void)"}, {"kind": "function", "line": 83, "name": "pcm2_wait_write", "signature": "static int pcm2_wait_write(void)"}, {"kind": "function", "line": 90, "name": "pcm2_cmd", "signature": "static void pcm2_cmd(unsigned char c)"}, {"kind": "function", "line": 95, "name": "pcm2_dma_program", "signature": "static void pcm2_dma_program(void)"}, {"kind": "function", "line": 108, "name": "pcm2_dma_stop", "signature": "static void pcm2_dma_stop(void)"}, {"kind": "function", "line": 112, "name": "pcm2_dsp_play", "signature": "static void pcm2_dsp_play(void)"}, {"kind": "function", "line": 122, "name": "pcm2_wake_owner", "signature": "static void pcm2_wake_owner(void)"}, {"doc": "Fill the DMA block from the ring (silence on underrun) and arm one single-cycle transfer. Runs under pcm2_lock, so a single in-flight * block means no double arm and no lost wakeup.", "kind": "function", "line": 135, "name": "pcm2_arm_block", "signature": "static void pcm2_arm_block(void)"}, {"kind": "function", "line": 150, "name": "loop", "signature": "* loop (the auto-init livelock is structurally impossible here). The IRQ\n * path rejects a stray ..."}, {"kind": "function", "line": 179, "name": "pcm2_active", "signature": "int pcm2_active(void)"}, {"kind": "function", "line": 183, "name": "pcm2_open", "signature": "int pcm2_open(unsigned flags, int owner)"}, {"kind": "function", "line": 221, "name": "pcm2_owner_live", "signature": "static int pcm2_owner_live(void)"}, {"kind": "function", "line": 226, "name": "pcm2_release_locked", "signature": "static void pcm2_release_locked(void)"}, {"kind": "function", "line": 235, "name": "pcm2_write", "signature": "int pcm2_write(const unsigned char *user, unsigned len, int owner)"}, {"kind": "function", "line": 282, "name": "pcm2_close", "signature": "void pcm2_close(int owner)"}, {"kind": "function", "line": 293, "name": "pcm2_irq", "signature": "void pcm2_irq(void)"}, {"kind": "function", "line": 306, "name": "pcm2_poll", "signature": "void pcm2_poll(void)"}, {"kind": "function", "line": 318, "name": "pcm2_counters", "signature": "void pcm2_counters(pcm2_counters_t *out)"}, {"kind": "macro", "line": 26, "name": "PCM2_BASE_PORT", "signature": "#define PCM2_BASE_PORT"}, {"kind": "macro", "line": 27, "name": "PCM2_DSP_RESET", "signature": "#define PCM2_DSP_RESET"}, {"kind": "macro", "line": 28, "name": "PCM2_DSP_WRITE_DATA", "signature": "#define PCM2_DSP_WRITE_DATA"}, {"kind": "macro", "line": 29, "name": "PCM2_DSP_STATUS", "signature": "#define PCM2_DSP_STATUS"}, {"kind": "macro", "line": 30, "name": "PCM2_IRQ_ACK", "signature": "#define PCM2_IRQ_ACK"}, {"kind": "macro", "line": 32, "name": "PCM2_CMD_SET_FREQ", "signature": "#define PCM2_CMD_SET_FREQ"}, {"kind": "macro", "line": 33, "name": "PCM2_CMD_SPK_ON", "signature": "#define PCM2_CMD_SPK_ON"}, {"kind": "macro", "line": 34, "name": "PCM2_CMD_PLAY8", "signature": "#define PCM2_CMD_PLAY8"}, {"kind": "macro", "line": 35, "name": "PCM2_CMD_STOP_NOW", "signature": "#define PCM2_CMD_STOP_NOW"}, {"kind": "macro", "line": 42, "name": "PCM2_DMA_MODE_PORT", "signature": "#define PCM2_DMA_MODE_PORT"}, {"kind": "macro", "line": 43, "name": "PCM2_DMA_CH1_SINGLE", "signature": "#define PCM2_DMA_CH1_SINGLE"}, {"kind": "macro", "line": 44, "name": "PCM2_DMA_CH1_ADDR", "signature": "#define PCM2_DMA_CH1_ADDR"}, {"kind": "macro", "line": 45, "name": "PCM2_DMA_CH1_CNT", "signature": "#define PCM2_DMA_CH1_CNT"}, {"kind": "macro", "line": 46, "name": "PCM2_DMA_CH1_PAGE", "signature": "#define PCM2_DMA_CH1_PAGE"}, {"kind": "macro", "line": 47, "name": "PCM2_DMA_MASK", "signature": "#define PCM2_DMA_MASK"}, {"kind": "macro", "line": 48, "name": "PCM2_DMA_FF_CLR", "signature": "#define PCM2_DMA_FF_CLR"}, {"kind": "macro", "line": 49, "name": "PCM2_DMA_CH1_MASK", "signature": "#define PCM2_DMA_CH1_MASK"}, {"kind": "macro", "line": 50, "name": "PCM2_DMA_CH1_UNMASK", "signature": "#define PCM2_DMA_CH1_UNMASK"}, {"kind": "macro", "line": 52, "name": "PCM2_DMA_ADDR", "signature": "#define PCM2_DMA_ADDR"}, {"kind": "macro", "line": 53, "name": "PCM2_DMA_COUNT", "signature": "#define PCM2_DMA_COUNT"}, {"kind": "macro", "line": 54, "name": "PCM2_READY_MASK", "signature": "#define PCM2_READY_MASK"}, {"kind": "macro", "line": 55, "name": "PCM2_PROBE_WAIT", "signature": "#define PCM2_PROBE_WAIT"}, {"kind": "macro", "line": 56, "name": "PCM2_SILENCE", "signature": "#define PCM2_SILENCE"}, {"kind": "macro", "line": 59, "name": "PCM2_BLOCK_MS", "signature": "#define PCM2_BLOCK_MS"}, {"kind": "macro", "line": 60, "name": "PCM2_BLOCK_SLACK_MS", "signature": "#define PCM2_BLOCK_SLACK_MS"}]}, {"doc": "PC speaker driver with a software master volume. The speaker has no", "id": "drivers/pcspk.c", "kind": "module", "label": "pcspk.c", "language": "c", "sha256": "df8bbdc4e82b0433", "symbol_count": 18, "symbols": [{"kind": "function", "line": 33, "name": "pcspk_ops_tone", "signature": "static void pcspk_ops_tone(device_t *dev, unsigned freq)"}, {"kind": "function", "line": 38, "name": "pcspk_ops_off", "signature": "static void pcspk_ops_off(device_t *dev)"}, {"kind": "function", "line": 43, "name": "pcspk_ops_set_volume", "signature": "static void pcspk_ops_set_volume(device_t *dev, unsigned vol)"}, {"kind": "function", "line": 48, "name": "pcspk_ops_get_volume", "signature": "static unsigned pcspk_ops_get_volume(device_t *dev)"}, {"kind": "function", "line": 72, "name": "pcspk_init", "signature": "void pcspk_init(void)"}, {"kind": "function", "line": 78, "name": "pcspk_set_volume", "signature": "void pcspk_set_volume(unsigned volume)"}, {"kind": "function", "line": 82, "name": "pcspk_get_volume", "signature": "unsigned pcspk_get_volume(void)"}, {"kind": "function", "line": 86, "name": "pcspk_tone", "signature": "void pcspk_tone(unsigned freq)"}, {"kind": "function", "line": 104, "name": "pcspk_off", "signature": "void pcspk_off(void)"}, {"kind": "macro", "line": 14, "name": "PIT_CH2_DATA", "signature": "#define PIT_CH2_DATA"}, {"kind": "macro", "line": 15, "name": "PIT_CH2_CMD", "signature": "#define PIT_CH2_CMD"}, {"kind": "macro", "line": 16, "name": "SPEAKER_PORT", "signature": "#define SPEAKER_PORT"}, {"kind": "macro", "line": 17, "name": "PIT_FREQ", "signature": "#define PIT_FREQ"}, {"kind": "macro", "line": 19, "name": "PCSPK_MIN_FREQ", "signature": "#define PCSPK_MIN_FREQ"}, {"kind": "macro", "line": 20, "name": "PCSPK_MAX_FREQ", "signature": "#define PCSPK_MAX_FREQ"}, {"kind": "macro", "line": 22, "name": "SPEAKER_DATA_BIT", "signature": "#define SPEAKER_DATA_BIT"}, {"kind": "macro", "line": 23, "name": "SPEAKER_GATE_BIT", "signature": "#define SPEAKER_GATE_BIT"}, {"kind": "macro", "line": 24, "name": "SPEAKER_ENABLE_BITS", "signature": "#define SPEAKER_ENABLE_BITS"}]}, {"doc": "CMOS RTC time-of-day reader. The desktop clock and the shell `date` builtin", "id": "drivers/rtc.c", "kind": "module", "label": "rtc.c", "language": "c", "sha256": "a49de26f906dfb05", "symbol_count": 25, "symbols": [{"kind": "function", "line": 35, "name": "rtc_cmos_read", "signature": "static inline unsigned char rtc_cmos_read(unsigned char reg)"}, {"kind": "function", "line": 40, "name": "rtc_from_bcd", "signature": "static int rtc_from_bcd(unsigned char v)"}, {"kind": "function", "line": 44, "name": "rtc_read_tod", "signature": "int rtc_read_tod(int *hour, int *min, int *sec)"}, {"kind": "function", "line": 68, "name": "rtc_month_len", "signature": "static int rtc_month_len(long full_year, long mon)"}, {"kind": "function", "line": 78, "name": "rtc_read_date", "signature": "int rtc_read_date(int *year, int *mon, int *day)"}, {"kind": "function", "line": 102, "name": "rtc_wall_seconds", "signature": "int rtc_wall_seconds(unsigned long *out)"}, {"kind": "macro", "line": 9, "name": "RTC_CMOS_ADDR", "signature": "#define RTC_CMOS_ADDR"}, {"kind": "macro", "line": 10, "name": "RTC_CMOS_DATA", "signature": "#define RTC_CMOS_DATA"}, {"kind": "macro", "line": 12, "name": "RTC_REG_SEC", "signature": "#define RTC_REG_SEC"}, {"kind": "macro", "line": 13, "name": "RTC_REG_MIN", "signature": "#define RTC_REG_MIN"}, {"kind": "macro", "line": 14, "name": "RTC_REG_HOUR", "signature": "#define RTC_REG_HOUR"}, {"kind": "macro", "line": 15, "name": "RTC_REG_DAY", "signature": "#define RTC_REG_DAY"}, {"kind": "macro", "line": 16, "name": "RTC_REG_MON", "signature": "#define RTC_REG_MON"}, {"kind": "macro", "line": 17, "name": "RTC_REG_YEAR", "signature": "#define RTC_REG_YEAR"}, {"kind": "macro", "line": 18, "name": "RTC_REG_STATUS_A", "signature": "#define RTC_REG_STATUS_A"}, {"kind": "macro", "line": 19, "name": "RTC_REG_STATUS_B", "signature": "#define RTC_REG_STATUS_B"}, {"kind": "macro", "line": 21, "name": "RTC_UPDATE_IN_PROGRESS", "signature": "#define RTC_UPDATE_IN_PROGRESS"}, {"kind": "macro", "line": 22, "name": "RTC_BCD_FLAG", "signature": "#define RTC_BCD_FLAG"}, {"kind": "macro", "line": 24, "name": "RTC_HOUR_MIN", "signature": "#define RTC_HOUR_MIN"}, {"kind": "macro", "line": 25, "name": "RTC_HOUR_MAX", "signature": "#define RTC_HOUR_MAX"}, {"kind": "macro", "line": 26, "name": "RTC_MIN_MIN", "signature": "#define RTC_MIN_MIN"}, {"kind": "macro", "line": 27, "name": "RTC_MIN_MAX", "signature": "#define RTC_MIN_MAX"}, {"kind": "macro", "line": 28, "name": "RTC_SEC_MIN", "signature": "#define RTC_SEC_MIN"}, {"kind": "macro", "line": 29, "name": "RTC_SEC_MAX", "signature": "#define RTC_SEC_MAX"}, {"kind": "macro", "line": 33, "name": "RTC_UPDATE_WAIT", "signature": "#define RTC_UPDATE_WAIT"}]}, {"doc": "Sound Blaster 16 DMA audio driver.", "id": "drivers/sb16.c", "kind": "module", "label": "sb16.c", "language": "c", "sha256": "d06ca860cea8ce14", "symbol_count": 64, "symbols": [{"doc": "Mixer stream id backing the legacy sb16_pcm_open/submit API (WQ_NONE when closed).  The legacy path forwards into the mixer so submitted PCM actually reaches the DMA ring through sb16_mix_all; a dedicated * kernel-side ring here would be a second, never-drained copy. static int legacy_stream = WQ_NONE; /* Reset the legacy kernel-side audio ring to empty.", "kind": "function", "line": 118, "name": "sb16_kring_reset", "signature": "static void sb16_kring_reset(void)"}, {"kind": "function", "line": 130, "name": "sb16_slot", "signature": "static unsigned char *sb16_slot(unsigned i)"}, {"kind": "function", "line": 138, "name": "sb16_stream_open", "signature": "int sb16_stream_open(void)"}, {"kind": "function", "line": 154, "name": "sb16_stream_close", "signature": "void sb16_stream_close(int id)"}, {"kind": "function", "line": 162, "name": "sb16_stream_submit", "signature": "int sb16_stream_submit(int id, const unsigned char *pcm, unsigned len)"}, {"kind": "function", "line": 177, "name": "sb16_stream_volume", "signature": "void sb16_stream_volume(int id, unsigned char vol)"}, {"kind": "function", "line": 183, "name": "sb16_stream_count", "signature": "int sb16_stream_count(void)"}, {"kind": "function", "line": 194, "name": "sb16_mix_all", "signature": "static void sb16_mix_all(void)"}, {"kind": "function", "line": 236, "name": "sb16_pump", "signature": "void sb16_pump(void)"}, {"doc": "DSP write-ready: bit 7 of the status port clear means the DSP accepts a command or data byte.  Bounded so a dead DSP can never hang the kernel; the byte is still issued after the timeout (the DSP takes it * once it catches up after a reset).", "kind": "function", "line": 278, "name": "sb16_wait_write", "signature": "static int sb16_wait_write(void)"}, {"kind": "function", "line": 282, "name": "sb16_cmd", "signature": "static void sb16_cmd(unsigned char c)"}, {"kind": "function", "line": 287, "name": "sb16_read_data", "signature": "static int sb16_read_data(unsigned char *out)"}, {"kind": "function", "line": 297, "name": "sb16_reset_dsp", "signature": "static int sb16_reset_dsp(void)"}, {"kind": "function", "line": 323, "name": "sb16_dma_play", "signature": "static void sb16_dma_play(unsigned addr, unsigned len)"}, {"kind": "function", "line": 339, "name": "sb16_refill", "signature": "static void sb16_refill(int slot_index)"}, {"kind": "function", "line": 355, "name": "sb16_arm", "signature": "static void sb16_arm(int from_irq)"}, {"kind": "function", "line": 380, "name": "sb16_present", "signature": "int sb16_present(void)"}, {"kind": "function", "line": 382, "name": "sb16_tone", "signature": "void sb16_tone(unsigned freq)"}, {"kind": "function", "line": 398, "name": "sb16_pcm_open", "signature": "void sb16_pcm_open(void)"}, {"kind": "function", "line": 422, "name": "sb16_pcm_close", "signature": "void sb16_pcm_close(void)"}, {"kind": "function", "line": 431, "name": "sb16_pcm_submit", "signature": "int sb16_pcm_submit(const unsigned char *pcm, unsigned len)"}, {"kind": "function", "line": 449, "name": "sb16_irq", "signature": "void sb16_irq(void)"}, {"kind": "function", "line": 457, "name": "sb16_poll", "signature": "void sb16_poll(void)"}, {"kind": "function", "line": 466, "name": "sb16_ring_free", "signature": "unsigned sb16_ring_free(void)"}, {"kind": "function", "line": 467, "name": "sb16_mode_active", "signature": "int sb16_mode_active(void)"}, {"doc": "Audible legacy ownership for the pcm2 mutual exclusion: a PCM stream is always audible-by-contract, a tone only when sounding. * Silent/idle legacy state (probe-only, tone(0)) never blocks pcm2.", "kind": "function", "line": 472, "name": "sb16_legacy_busy", "signature": "int sb16_legacy_busy(void)"}, {"kind": "function", "line": 479, "name": "sb16_counters", "signature": "void sb16_counters(sb16_counters_t *out)"}, {"doc": "stream is always audible-by-contract, a tone only when sounding. * Silent/idle legacy state (probe-only, tone(0)) never blocks pcm2. int sb16_legacy_busy(void) { if (legacy_stream != WQ_NONE) return 1; if (sb16_inflight && sb16_mode == SB16_MODE_PCM) return 1; if (sb16_inflight && sb16_freq != 0) return 1; return 0; } void sb16_counters(sb16_counters_t *out) { if (out) *out = sb16_stat; } /** Docstring: Strategy verbs publishing the PCM sink to the registry.", "kind": "function", "line": 484, "name": "sb16_ops_present", "signature": "static int sb16_ops_present(device_t *dev)"}, {"doc": "} void sb16_counters(sb16_counters_t *out) { if (out) *out = sb16_stat; } /** Docstring: Strategy verbs publishing the PCM sink to the registry. static int sb16_ops_present(device_t *dev) { (void)dev; return sb16_present(); } /** Docstring: Strategy verb for PCM open.", "kind": "function", "line": 491, "name": "sb16_ops_pcm_open", "signature": "static void sb16_ops_pcm_open(device_t *dev)"}, {"doc": "static int sb16_ops_present(device_t *dev) { (void)dev; return sb16_present(); } /** Docstring: Strategy verb for PCM open. static void sb16_ops_pcm_open(device_t *dev) { (void)dev; sb16_pcm_open(); } /** Docstring: Strategy verb for PCM close.", "kind": "function", "line": 498, "name": "sb16_ops_pcm_close", "signature": "static void sb16_ops_pcm_close(device_t *dev)"}, {"doc": "static void sb16_ops_pcm_open(device_t *dev) { (void)dev; sb16_pcm_open(); } /** Docstring: Strategy verb for PCM close. static void sb16_ops_pcm_close(device_t *dev) { (void)dev; sb16_pcm_close(); } /** Docstring: Strategy verb for PCM submit.", "kind": "function", "line": 505, "name": "sb16_ops_pcm_submit", "signature": "static int sb16_ops_pcm_submit(device_t *dev, const unsigned char *pcm, unsigned len)"}, {"kind": "function", "line": 530, "name": "sb16_init", "signature": "int sb16_init(void)"}, {"kind": "function", "line": 22, "name": "IRQ", "signature": "* QEMU audio backends never raise the completion IRQ (they only consume once * their engine buffer drains, which a stalled host backend never does), and * without a fallback the 7-slot ring fills once"}, {"kind": "function", "line": 535, "name": "pending", "signature": "* reading without it eats whatever byte happens to be pending (or * times out), so the probe used to fail or misread here. */ sb16_cmd(SB16_CMD_READ_VER);"}, {"kind": "macro", "line": 48, "name": "SB16_BASE_PORT", "signature": "#define SB16_BASE_PORT"}, {"kind": "macro", "line": 49, "name": "SB16_DSP_RESET", "signature": "#define SB16_DSP_RESET"}, {"kind": "macro", "line": 50, "name": "SB16_DSP_READ_DATA", "signature": "#define SB16_DSP_READ_DATA"}, {"kind": "macro", "line": 51, "name": "SB16_DSP_WRITE_DATA", "signature": "#define SB16_DSP_WRITE_DATA"}, {"kind": "macro", "line": 52, "name": "SB16_DSP_STATUS", "signature": "#define SB16_DSP_STATUS"}, {"kind": "macro", "line": 53, "name": "SB16_IRQ_ACK", "signature": "#define SB16_IRQ_ACK"}, {"kind": "macro", "line": 55, "name": "SB16_CMD_READ_VER", "signature": "#define SB16_CMD_READ_VER"}, {"kind": "macro", "line": 56, "name": "SB16_CMD_SET_FREQ", "signature": "#define SB16_CMD_SET_FREQ"}, {"kind": "macro", "line": 57, "name": "SB16_CMD_PLAY8", "signature": "#define SB16_CMD_PLAY8"}, {"kind": "macro", "line": 58, "name": "SB16_CMD_SPK_ON", "signature": "#define SB16_CMD_SPK_ON"}, {"kind": "macro", "line": 59, "name": "SB16_CMD_SPK_OFF", "signature": "#define SB16_CMD_SPK_OFF"}, {"kind": "macro", "line": 61, "name": "SB16_DSP_RDSTATUS", "signature": "#define SB16_DSP_RDSTATUS"}, {"kind": "macro", "line": 67, "name": "DMA_MODE_PORT", "signature": "#define DMA_MODE_PORT"}, {"kind": "macro", "line": 68, "name": "DMA_CH1_SINGLE_READ", "signature": "#define DMA_CH1_SINGLE_READ"}, {"kind": "macro", "line": 70, "name": "SB16_FREQ_LO", "signature": "#define SB16_FREQ_LO"}, {"kind": "macro", "line": 71, "name": "SB16_FREQ_HI", "signature": "#define SB16_FREQ_HI"}, {"kind": "macro", "line": 73, "name": "SB16_DSP_READY_MASK", "signature": "#define SB16_DSP_READY_MASK"}, {"kind": "macro", "line": 75, "name": "DMA_CH1_ADDR", "signature": "#define DMA_CH1_ADDR"}, {"kind": "macro", "line": 76, "name": "DMA_CH1_CNT", "signature": "#define DMA_CH1_CNT"}, {"kind": "macro", "line": 77, "name": "DMA_CH1_PAGE", "signature": "#define DMA_CH1_PAGE"}, {"kind": "macro", "line": 78, "name": "DMA_MASK", "signature": "#define DMA_MASK"}, {"kind": "macro", "line": 79, "name": "DMA_FF_CLR", "signature": "#define DMA_FF_CLR"}, {"kind": "macro", "line": 80, "name": "DMA_CH1_UNMASK", "signature": "#define DMA_CH1_UNMASK"}, {"kind": "macro", "line": 81, "name": "DMA_CH1_MASK", "signature": "#define DMA_CH1_MASK"}, {"kind": "macro", "line": 83, "name": "SB16_DMA_BUF0", "signature": "#define SB16_DMA_BUF0"}, {"kind": "macro", "line": 84, "name": "SB16_SILENCE_SLOT", "signature": "#define SB16_SILENCE_SLOT"}, {"kind": "macro", "line": 85, "name": "SB16_BUF", "signature": "#define SB16_BUF"}, {"kind": "macro", "line": 88, "name": "SB16_MODE_TONE", "signature": "#define SB16_MODE_TONE"}, {"kind": "macro", "line": 89, "name": "SB16_MODE_PCM", "signature": "#define SB16_MODE_PCM"}, {"kind": "macro", "line": 91, "name": "SB16_SQ_CYCLE", "signature": "#define SB16_SQ_CYCLE"}]}, {"doc": "usbblk.c -- USB mass storage, Bulk-Only Transport over SCSI.", "id": "drivers/usbblk.c", "kind": "module", "label": "usbblk.c", "language": "c", "sha256": "7d4f06ee481baa91", "symbol_count": 44, "symbols": [{"doc": "Docstring: One registered disk: its device record, the OUT and IN endpoint indices, the sector count, and the tag counter that pairs each CBW with its CSW. The transfer buffers are heap, because the controller cannot reach * .bss under KASLR.", "kind": "struct", "line": 44, "name": "ubk_disk_t"}, {"kind": "function", "line": 72, "name": "ubk_counters", "signature": "void ubk_counters(ubk_counters_t *out)"}, {"doc": "Docstring: Ten-byte SCSI CDB at the CBW command block: opcode, LBA big-endian, transfer length big-endian. READ(10) and WRITE(10) are ten-byte * commands, and a six-byte block with the same opcode is rejected. define UBK_CDB_LEN 10u", "kind": "function", "line": 80, "name": "ubk_cdb10", "signature": "static void ubk_cdb10(unsigned char *cdb, unsigned char opcode,\n                      unsigned lo..."}, {"kind": "function", "line": 92, "name": "ubk_build_cbw", "signature": "void ubk_build_cbw(unsigned char *out, unsigned tag, unsigned long lba,\n                   unsign..."}, {"kind": "function", "line": 121, "name": "ubk_check_csw", "signature": "int ubk_check_csw(const unsigned char *csw, unsigned tag, unsigned expect_len)"}, {"doc": "Docstring: Issue one command with an optional data stage and check the status wrapper. cdb carries cdb_len bytes (6 or 10), data is null for a command with no data stage. Returns 1 only when every stage completed * and the CSW agreed with the CBW.", "kind": "function", "line": 187, "name": "ubk_command_raw", "signature": "static int ubk_command_raw(unsigned char *cdb, unsigned cdb_len,\n                           unsig..."}, {"doc": "Docstring: REQUEST SENSE after a failure, so a unit attention clears instead of failing every later command, and the key lands in the log. Six-byte command, eighteen bytes of sense. Best-effort: its own failure * changes nothing. define UBK_SENSE_LEN 18u", "kind": "function", "line": 262, "name": "ubk_sense", "signature": "static void ubk_sense(void)"}, {"doc": "Docstring: One command with a single recovery: on a transport failure the pipe is reset and cleared and the command runs once more, because real silicon stalls commands an emulator accepts. A second failure, or * a CSW that disagrees, is reported as-is.", "kind": "function", "line": 279, "name": "ubk_command", "signature": "static int ubk_command(unsigned char *cdb, unsigned cdb_len,\n                       unsigned char..."}, {"doc": "Docstring: Wait for the medium with TEST UNIT READY. Real devices answer CHECK CONDITION until the media is up; without this the first capacity read runs against a device that is not there yet. Bounded, so a dead * device costs tries, never the boot. define UBK_READY_TRIES 5u", "kind": "function", "line": 294, "name": "ubk_unit_ready", "signature": "static int ubk_unit_ready(void)"}, {"doc": "Docstring: Read the sector count with READ CAPACITY(10). Returns 1 on a successful command with a plausible count. Both fields arrive big-endian, * so a little-endian read reports a capacity the medium does not have.", "kind": "function", "line": 311, "name": "ubk_read_capacity", "signature": "static int ubk_read_capacity(unsigned long *sectors)"}, {"kind": "function", "line": 336, "name": "ubk_present", "signature": "int ubk_present(void)"}, {"kind": "function", "line": 340, "name": "ubk_sectors", "signature": "unsigned long ubk_sectors(void)"}, {"doc": "Docstring: Move whole sectors. Every refusal is checked before the command is built, so a bad range never reaches the device, and a failed CSW never * leaves a buffer described as valid.", "kind": "function", "line": 347, "name": "ubk_xfer", "signature": "static int ubk_xfer(unsigned long lba, unsigned count, void *buf, int read)"}, {"kind": "function", "line": 365, "name": "ubk_read_sectors", "signature": "int ubk_read_sectors(unsigned long lba, unsigned count, void *buf)"}, {"kind": "function", "line": 370, "name": "ubk_write_sectors", "signature": "int ubk_write_sectors(unsigned long lba, unsigned count, const void *buf)"}, {"doc": "Docstring: Take a bulk OUT and a bulk IN endpoint from a claimed interface * and program them. Returns 1 on success.", "kind": "function", "line": 377, "name": "ubk_claim_eps", "signature": "static int ubk_claim_eps(int device, const xhc_iface_t *iface)"}, {"doc": "Docstring: Block-ops adapters so the disk registers with the existing block layer instead of growing a parallel one. The device argument is unused: a second USB disk is not supported and the bound is enforced in ubk_init, so routing the registry through a device pointer would be a parameter that cannot carry a distinction. Every call is a refusal unless the range is * inside the disk, which keeps a bad LBA from the page cache off the device.", "kind": "function", "line": 421, "name": "ubk_blk_read", "signature": "static int ubk_blk_read(device_t *dev, unsigned lba, unsigned count,\n                        void..."}, {"kind": "function", "line": 427, "name": "ubk_blk_write", "signature": "static int ubk_blk_write(device_t *dev, unsigned lba, unsigned count,\n                         co..."}, {"kind": "function", "line": 433, "name": "ubk_blk_sectors", "signature": "static unsigned ubk_blk_sectors(device_t *dev)"}, {"kind": "function", "line": 438, "name": "ubk_blk_present", "signature": "static int ubk_blk_present(device_t *dev)"}, {"kind": "function", "line": 457, "name": "ubk_init", "signature": "int ubk_init(void)"}, {"kind": "macro", "line": 22, "name": "UBK_CBW_LEN", "signature": "#define UBK_CBW_LEN"}, {"kind": "macro", "line": 23, "name": "UBK_CBW_SIG", "signature": "#define UBK_CBW_SIG"}, {"kind": "macro", "line": 24, "name": "UBK_CBW_FLAG_IN", "signature": "#define UBK_CBW_FLAG_IN"}, {"kind": "macro", "line": 27, "name": "UBK_CSW_LEN", "signature": "#define UBK_CSW_LEN"}, {"kind": "macro", "line": 28, "name": "UBK_CSW_SIG", "signature": "#define UBK_CSW_SIG"}, {"kind": "macro", "line": 29, "name": "UBK_CSW_STATUS_PASSED", "signature": "#define UBK_CSW_STATUS_PASSED"}, {"kind": "macro", "line": 30, "name": "UBK_CSW_STATUS_FAILED", "signature": "#define UBK_CSW_STATUS_FAILED"}, {"kind": "macro", "line": 33, "name": "UBK_SCSI_TEST_UNIT_READY", "signature": "#define UBK_SCSI_TEST_UNIT_READY"}, {"kind": "macro", "line": 34, "name": "UBK_SCSI_REQUEST_SENSE", "signature": "#define UBK_SCSI_REQUEST_SENSE"}, {"kind": "macro", "line": 35, "name": "UBK_SCSI_INQUIRY", "signature": "#define UBK_SCSI_INQUIRY"}, {"kind": "macro", "line": 36, "name": "UBK_SCSI_READ_CAPACITY", "signature": "#define UBK_SCSI_READ_CAPACITY"}, {"kind": "macro", "line": 37, "name": "UBK_SCSI_READ10", "signature": "#define UBK_SCSI_READ10"}, {"kind": "macro", "line": 38, "name": "UBK_SCSI_WRITE10", "signature": "#define UBK_SCSI_WRITE10"}, {"kind": "macro", "line": 63, "name": "UBK_BULK_INTERVAL", "signature": "#define UBK_BULK_INTERVAL"}, {"kind": "macro", "line": 64, "name": "UBK_BULK_BURST", "signature": "#define UBK_BULK_BURST"}, {"kind": "macro", "line": 70, "name": "UBK_MAX_XFER_BLOCKS", "signature": "#define UBK_MAX_XFER_BLOCKS"}, {"kind": "macro", "line": 79, "name": "UBK_CDB_LEN", "signature": "#define UBK_CDB_LEN"}, {"kind": "macro", "line": 148, "name": "UBK_MS_RESET", "signature": "#define UBK_MS_RESET"}, {"kind": "macro", "line": 149, "name": "UBK_CLEAR_FEATURE", "signature": "#define UBK_CLEAR_FEATURE"}, {"kind": "macro", "line": 150, "name": "UBK_ENDP_HALT", "signature": "#define UBK_ENDP_HALT"}, {"kind": "macro", "line": 181, "name": "UBK_CDB6_LEN", "signature": "#define UBK_CDB6_LEN"}, {"kind": "macro", "line": 261, "name": "UBK_SENSE_LEN", "signature": "#define UBK_SENSE_LEN"}, {"kind": "macro", "line": 293, "name": "UBK_READY_TRIES", "signature": "#define UBK_READY_TRIES"}]}, {"doc": "usbhid.c -- USB HID boot-protocol keyboard and mouse.", "id": "drivers/usbhid.c", "kind": "module", "label": "usbhid.c", "language": "c", "sha256": "40d1c2a451146d0d", "symbol_count": 26, "symbols": [{"doc": "Docstring: A claimed HID interface: the device record, the endpoint index that serves it, and the previous report so the next one can be * differenced against it.", "kind": "struct", "line": 40, "name": "usbhid_dev_t"}, {"kind": "function", "line": 117, "name": "usbhid_set1_from_usage", "signature": "int usbhid_set1_from_usage(unsigned usage, unsigned char *sc, int *e0)"}, {"doc": "Docstring: Set-1 make code for any usage, 0x04..0xDD. Returns 0 when the usage has no set-1 equivalent so the caller drops it rather than inventing * a scancode.", "kind": "function", "line": 128, "name": "usbhid_usage_make", "signature": "static int usbhid_usage_make(unsigned usage, unsigned char *sc, int *e0)"}, {"doc": "Docstring: True when a report lists a usage in any slot but the given one. The array is not ordered -- a device may reorder it at any report -- so a naive slot-by-slot compare would emit a break for a key that merely moved position, which the keyboard layer sees as the user releasing and * re-pressing it.", "kind": "function", "line": 138, "name": "usbhid_report_has", "signature": "static int usbhid_report_has(const unsigned char report[HID_KBD_REPORT_LEN],\n                    ..."}, {"doc": "Docstring: Append one scancode or return USBHID_TRUNCATED.  Truncation is a hard signal, not a silent clamp: a half-emitted key event leaves the keyboard layer with a make and no break, which wedges the modifier state for the next report. The buffer is sized so this cannot happen for a legal report, so a report that does reach it is a bug worth * seeing.", "kind": "function", "line": 153, "name": "usbhid_put", "signature": "static int usbhid_put(unsigned char *out, int max, int n, unsigned char sc)"}, {"doc": "Docstring: Append the make or break bytes for one modifier bit.  A press is prefix, then make. A release is break, then the prefix break. That asymmetry is not cosmetic: the keyboard decode path treats a break with a pending prefix as \"finish the pair\", so releasing this way leaves no * dangling 0xE0 for the next report to complete by accident.", "kind": "function", "line": 165, "name": "usbhid_emit_mod", "signature": "static int usbhid_emit_mod(unsigned char *out, int max, int n, unsigned bit,\n                    ..."}, {"doc": "if (pressed) { if (e0) { n = usbhid_put(out, max, n, 0xE0); if (n < 0) return n; } return usbhid_put(out, max, n, sc); } n = usbhid_put(out, max, n, (unsigned char)(sc | 0x80u)); if (n < 0) return n; if (e0) n = usbhid_put(out, max, n, 0xE0 | 0x80u); return n; } /** Docstring: Append the make or break bytes for one usage.", "kind": "function", "line": 183, "name": "usbhid_emit_usage", "signature": "static int usbhid_emit_usage(unsigned char *out, int max, int n,\n                             uns..."}, {"kind": "function", "line": 206, "name": "usbhid_kbd_scancodes", "signature": "int usbhid_kbd_scancodes(const unsigned char prev[HID_KBD_REPORT_LEN],\n                         c..."}, {"kind": "function", "line": 241, "name": "usbhid_mouse_decode", "signature": "void usbhid_mouse_decode(const unsigned char prev[HID_MOUSE_REPORT_LEN],\n                        ..."}, {"kind": "function", "line": 256, "name": "usbhid_keyboard_present", "signature": "int usbhid_keyboard_present(void)"}, {"kind": "function", "line": 263, "name": "usbhid_mouse_present", "signature": "int usbhid_mouse_present(void)"}, {"kind": "function", "line": 270, "name": "usbhid_counters", "signature": "void usbhid_counters(usbhid_counters_t *out)"}, {"kind": "function", "line": 274, "name": "usbhid_press_kbd_report", "signature": "int usbhid_press_kbd_report(const unsigned char report[HID_KBD_REPORT_LEN])"}, {"doc": "Docstring: Ask a HID device for boot protocol, so its reports use the fixed layout this driver decodes. Without it a keyboard may answer with the report-descriptor-defined layout, whose key order and size are arbitrary, * and every decode above would be a guess.", "kind": "function", "line": 295, "name": "usbhid_set_boot_protocol", "signature": "static int usbhid_set_boot_protocol(int device, int iface)"}, {"doc": "Docstring: True when an endpoint index is already spoken for. Two HID devices cannot share one endpoint context, so the second claim walks past the first one's index instead of reconfiguring it under the controller's * feet.", "kind": "function", "line": 312, "name": "usbhid_ep_taken", "signature": "static int usbhid_ep_taken(int ep_index)"}, {"doc": "Docstring: Take an interrupt IN endpoint from a claimed interface and program it, at the first free endpoint index. Returns the index, or -1 * when the interface has no interrupt IN endpoint or none can be configured.", "kind": "function", "line": 325, "name": "usbhid_take_ep", "signature": "static int usbhid_take_ep(int device, const xhc_iface_t *iface,\n                          int *maxp)"}, {"doc": "Docstring: Claim a HID interface as a keyboard or a mouse.  Which one it is comes from the endpoint's packet size, not from a guess on the device name or vendor: a boot keyboard endpoint is eight bytes and a boot mouse endpoint is three or four, and the reports are fixed-length by * the boot protocol, so the size is the type.", "kind": "function", "line": 353, "name": "usbhid_claim", "signature": "static int usbhid_claim(int device, const xhc_iface_t *iface, int is_mouse)"}, {"doc": "Docstring: Endpoint packet size that distinguishes a boot keyboard (eight bytes) from a boot mouse (three or four). Anything else is a HID device * this driver does not speak, and is left alone rather than misread.", "kind": "function", "line": 380, "name": "usbhid_is_mouse_maxp", "signature": "static int usbhid_is_mouse_maxp(int maxp)"}, {"kind": "function", "line": 384, "name": "usbhid_init", "signature": "int usbhid_init(void)"}, {"doc": "Docstring: One interrupt-in report from a device and hand it to a decoder. The request is exactly the boot report size, because xHCI reports no byte count for a non-isochronous transfer: asking for the endpoint's maximum and accepting whatever length came back would be unsound, and asking for the report size is what the boot protocol specifies.  Never waits: at most one transfer is outstanding per device, posted on one poll and collected on a later one. An endpoint with nothing to say NAKs, which is not an event but continued silence, so a pending transfer simply stays out until it completes or ages past the budget. Either way this * function returns immediately, which is what makes it safe from the tick.", "kind": "function", "line": 422, "name": "usbhid_poll_one", "signature": "static int usbhid_poll_one(usbhid_dev_t *d)"}, {"kind": "function", "line": 485, "name": "usbhid_poll_keyboard", "signature": "int usbhid_poll_keyboard(void)"}, {"kind": "function", "line": 493, "name": "usbhid_poll_mouse", "signature": "int usbhid_poll_mouse(void)"}, {"kind": "function", "line": 501, "name": "usbhid_poll", "signature": "int usbhid_poll(void)"}, {"kind": "macro", "line": 35, "name": "USBHID_MAX_DEVS", "signature": "#define USBHID_MAX_DEVS"}, {"kind": "macro", "line": 55, "name": "USBHID_INTERVAL", "signature": "#define USBHID_INTERVAL"}, {"kind": "macro", "line": 204, "name": "USBHID_MAX_SCANCODES", "signature": "#define USBHID_MAX_SCANCODES"}]}, {"doc": "Docstring: drivers/virtio_blk.c -- Polled legacy virtio-blk driver.", "id": "drivers/virtio_blk.c", "kind": "module", "label": "virtio_blk.c", "language": "c", "sha256": "1da10ca5ef255c7e", "symbol_count": 39, "symbols": [{"kind": "struct", "line": 56, "name": "vblk_req_t"}, {"kind": "function", "line": 71, "name": "vblk_outl", "signature": "static void vblk_outl(unsigned short port, unsigned val)"}, {"kind": "function", "line": 75, "name": "vblk_inl", "signature": "static unsigned vblk_inl(unsigned short port)"}, {"kind": "function", "line": 81, "name": "vblk_outb", "signature": "static void vblk_outb(unsigned short port, unsigned char val)"}, {"kind": "function", "line": 85, "name": "vblk_inb", "signature": "static unsigned char vblk_inb(unsigned short port)"}, {"kind": "function", "line": 89, "name": "vblk_inw", "signature": "static unsigned short vblk_inw(unsigned short port)"}, {"kind": "function", "line": 93, "name": "vblk_outw", "signature": "static void vblk_outw(unsigned short port, unsigned short val)"}, {"doc": "Docstring: Probe PCI for a virtio-blk device and bring queue 0 up. Idempotent: a second call reuses the live queue. Returns 1 when the * device is ready, 0 when absent or unusable (fail-closed, IDE stays).", "kind": "function", "line": 100, "name": "vblk_init", "signature": "int vblk_init(void)"}, {"doc": "{ unsigned long cap_lo = vblk_inl(vblk_iobase + 0x14); unsigned long cap_hi = vblk_inl(vblk_iobase + 0x18); (void)cap_hi; vblk_capacity = cap_lo; } vblk_outb(vblk_iobase + 0x12, VBLK_F_ACK | VBLK_F_DRIVER | VBLK_F_OK | VBLK_F_DRIVER_OK); vblk_last_used = 0; vblk_on = 1; return 1; } /** Docstring: True once vblk_init brought the queue up.", "kind": "function", "line": 158, "name": "vblk_present", "signature": "int vblk_present(void)"}, {"doc": "} vblk_outb(vblk_iobase + 0x12, VBLK_F_ACK | VBLK_F_DRIVER | VBLK_F_OK | VBLK_F_DRIVER_OK); vblk_last_used = 0; vblk_on = 1; return 1; } /** Docstring: True once vblk_init brought the queue up. int vblk_present(void) { return vblk_on; } /** Docstring: Device capacity in 512-byte sectors (0 when absent).", "kind": "function", "line": 163, "name": "vblk_sectors", "signature": "unsigned long vblk_sectors(void)"}, {"kind": "function", "line": 167, "name": "vblk_desc", "signature": "static void vblk_desc(unsigned idx, unsigned long addr, unsigned len,\n        unsigned short flag..."}, {"kind": "function", "line": 183, "name": "vblk_avail_idx", "signature": "static unsigned short vblk_avail_idx(void)"}, {"kind": "function", "line": 188, "name": "vblk_avail_push", "signature": "static void vblk_avail_push(unsigned short head)"}, {"kind": "function", "line": 199, "name": "vblk_used_idx", "signature": "static unsigned short vblk_used_idx(void)"}, {"doc": "Docstring: One synchronous request. dir 0 reads sectors into buf, 1 writes them out. Single head descriptor reused every call (one in flight at a time: the shell and the block cache never overlap device access on one CPU, and SMP callers serialize on fs_lock upstream). The header and status byte live in the heap alongside the queue: stale statics would sit in the KASLR-slid image where VA != PA, and the device would DMA to the wrong RAM while the guest polls a status byte that never changes. Bounded poll, * fail-closed past the deadline.", "kind": "function", "line": 212, "name": "vblk_request", "signature": "static int vblk_request(unsigned dir, unsigned long sector,\n        unsigned char *buf, unsigned ..."}, {"doc": "Docstring: Write count sectors from buf at lba. The caller buffer is DMA-safe by construction (identity-mapped heap/user pages), so it is handed to the device directly, never bounced. Chunks like * the read path past 16 sectors.", "kind": "function", "line": 266, "name": "vblk_write_sectors", "signature": "int vblk_write_sectors(unsigned lba, unsigned count, const void *buf)"}, {"doc": "Docstring: Registry ops for the block layer dispatch. Same shape as * the ide0 table, so block_dev_read/write resolve vblk0 by name.", "kind": "function", "line": 282, "name": "vblk_ops_read", "signature": "static int vblk_ops_read(device_t *dev, unsigned lba, unsigned count,\n        void *buf)"}, {"doc": "Docstring: Registry ops for the block layer dispatch. Same shape as * the ide0 table, so block_dev_read/write resolve vblk0 by name. static int vblk_ops_read(device_t *dev, unsigned lba, unsigned count, void *buf) { (void)dev; return vblk_read_sectors(lba, count, buf); } /** Docstring: Registry write op, const buffer through the queue.", "kind": "function", "line": 289, "name": "vblk_ops_write", "signature": "static int vblk_ops_write(device_t *dev, unsigned lba, unsigned count,\n        const void *buf)"}, {"doc": "static int vblk_ops_read(device_t *dev, unsigned lba, unsigned count, void *buf) { (void)dev; return vblk_read_sectors(lba, count, buf); } /** Docstring: Registry write op, const buffer through the queue. static int vblk_ops_write(device_t *dev, unsigned lba, unsigned count, const void *buf) { (void)dev; return vblk_write_sectors(lba, count, buf); } /** Docstring: Registry capacity op, sectors behind the queue.", "kind": "function", "line": 296, "name": "vblk_ops_total", "signature": "static unsigned vblk_ops_total(device_t *dev)"}, {"doc": "/** Docstring: Registry write op, const buffer through the queue. static int vblk_ops_write(device_t *dev, unsigned lba, unsigned count, const void *buf) { (void)dev; return vblk_write_sectors(lba, count, buf); } /** Docstring: Registry capacity op, sectors behind the queue. static unsigned vblk_ops_total(device_t *dev) { (void)dev; return (unsigned)vblk_sectors(); } /** Docstring: Registry presence op, true once the queue is up.", "kind": "function", "line": 302, "name": "vblk_ops_present", "signature": "static int vblk_ops_present(device_t *dev)"}, {"doc": "Docstring: Publish vblk0 for the block layer preference. Boot-time only, before sti, like the ide0 registration; re-registration is a * no-op (duplicate refused).", "kind": "function", "line": 327, "name": "vblk_register_device", "signature": "void vblk_register_device(void)"}, {"kind": "macro", "line": 28, "name": "VBLK_VENDOR", "signature": "#define VBLK_VENDOR"}, {"kind": "macro", "line": 29, "name": "VBLK_DEV_LEGACY", "signature": "#define VBLK_DEV_LEGACY"}, {"kind": "macro", "line": 30, "name": "VBLK_DEV_TRANS", "signature": "#define VBLK_DEV_TRANS"}, {"kind": "macro", "line": 32, "name": "VBLK_F_ACK", "signature": "#define VBLK_F_ACK"}, {"kind": "macro", "line": 33, "name": "VBLK_F_DRIVER", "signature": "#define VBLK_F_DRIVER"}, {"kind": "macro", "line": 34, "name": "VBLK_F_OK", "signature": "#define VBLK_F_OK"}, {"kind": "macro", "line": 35, "name": "VBLK_F_DRIVER_OK", "signature": "#define VBLK_F_DRIVER_OK"}, {"kind": "macro", "line": 37, "name": "VBLK_QNUM", "signature": "#define VBLK_QNUM"}, {"kind": "macro", "line": 38, "name": "VBLK_DESC_SZ", "signature": "#define VBLK_DESC_SZ"}, {"kind": "macro", "line": 43, "name": "VBLK_AVAIL_OFF", "signature": "#define VBLK_AVAIL_OFF"}, {"kind": "macro", "line": 44, "name": "VBLK_USED_OFF", "signature": "#define VBLK_USED_OFF"}, {"kind": "macro", "line": 45, "name": "VBLK_QAREA", "signature": "#define VBLK_QAREA"}, {"kind": "macro", "line": 47, "name": "VBLK_DESC_NEXT", "signature": "#define VBLK_DESC_NEXT"}, {"kind": "macro", "line": 48, "name": "VBLK_DESC_WRITE", "signature": "#define VBLK_DESC_WRITE"}, {"kind": "macro", "line": 50, "name": "VBLK_REQ_IN", "signature": "#define VBLK_REQ_IN"}, {"kind": "macro", "line": 51, "name": "VBLK_REQ_OUT", "signature": "#define VBLK_REQ_OUT"}, {"kind": "macro", "line": 53, "name": "VBLK_TMO_MS", "signature": "#define VBLK_TMO_MS"}, {"kind": "macro", "line": 54, "name": "VBLK_SECTOR", "signature": "#define VBLK_SECTOR"}]}, {"doc": "Docstring: drivers/virtio_net.c -- Polled legacy virtio-net driver.", "id": "drivers/virtio_net.c", "kind": "module", "label": "virtio_net.c", "language": "c", "sha256": "779c45d5cb446f60", "symbol_count": 44, "symbols": [{"kind": "function", "line": 81, "name": "vnet_outb", "signature": "static void vnet_outb(unsigned short port, unsigned char v)"}, {"kind": "function", "line": 85, "name": "vnet_outw", "signature": "static void vnet_outw(unsigned short port, unsigned short v)"}, {"kind": "function", "line": 89, "name": "vnet_outl", "signature": "static void vnet_outl(unsigned short port, unsigned v)"}, {"kind": "function", "line": 93, "name": "vnet_inb", "signature": "static unsigned char vnet_inb(unsigned short port)"}, {"kind": "function", "line": 99, "name": "vnet_inw", "signature": "static unsigned short vnet_inw(unsigned short port)"}, {"kind": "function", "line": 105, "name": "vnet_inl", "signature": "static unsigned vnet_inl(unsigned short port)"}, {"doc": "Docstring: Bring one queue up: negotiate no features, size it, publish its page area, return its depth. Shared by RX and TX so * the two setups cannot drift apart.", "kind": "function", "line": 114, "name": "vnet_queue_up", "signature": "static unsigned vnet_queue_up(unsigned qsel)"}, {"doc": "vnet_outl(vnet_io + 0x08, (unsigned)pfn); if (qsel == VNET_Q_RX) { vnet_rx_page = page; vnet_rx_used = page + VNET_USED_OFF; vnet_rx_qnum = qmax; } else { vnet_tx_page = page; vnet_tx_used = page + VNET_USED_OFF; vnet_tx_qnum = qmax; } return qmax; } /** Docstring: Write one descriptor into the given queue area.", "kind": "function", "line": 144, "name": "vnet_desc", "signature": "static void vnet_desc(unsigned char *page, unsigned idx, unsigned long addr,\n        unsigned len..."}, {"doc": "unsigned i; for (i = 0; i < 8; i++) d[i] = (unsigned char)((addr >> (i * 8)) & 0xFFu); d[8] = (unsigned char)(len & 0xFFu); d[9] = (unsigned char)((len >> 8) & 0xFFu); d[10] = (unsigned char)((len >> 16) & 0xFFu); d[11] = (unsigned char)((len >> 24) & 0xFFu); d[12] = (unsigned char)(flags & 0xFFu); d[13] = (unsigned char)((flags >> 8) & 0xFFu); d[14] = (unsigned char)(next & 0xFFu); d[15] = (unsigned char)((next >> 8) & 0xFFu); } /** Docstring: Push one head descriptor index onto a queue avail ring.", "kind": "function", "line": 161, "name": "vnet_avail_push", "signature": "static void vnet_avail_push(unsigned char *page, unsigned qnum,\n        unsigned short head)"}, {"doc": "/** Docstring: Push one head descriptor index onto a queue avail ring. static void vnet_avail_push(unsigned char *page, unsigned qnum, unsigned short head) { unsigned char *a = page + VNET_AVAIL_OFF; unsigned short idx = (unsigned short)(a[2] | (a[3] << 8)); unsigned off = 4u + (unsigned)(idx % (unsigned short)qnum) * 2u; a[off] = (unsigned char)(head & 0xFFu); a[off + 1] = (unsigned char)((head >> 8) & 0xFFu); idx++; a[2] = (unsigned char)(idx & 0xFFu); a[3] = (unsigned char)((idx >> 8) & 0xFFu); } /** Docstring: Read the used-ring index of a queue area.", "kind": "function", "line": 174, "name": "vnet_used_idx", "signature": "static unsigned short vnet_used_idx(unsigned char *used)"}, {"kind": "function", "line": 181, "name": "unusable", "signature": "* unusable (fail-closed, rtl8139 stays). */\nint vnet_init(void)"}, {"doc": "vnet_desc(vnet_rx_page, i, (unsigned long)(vnet_rx_bufs + i * VNET_RX_SIZE), VNET_RX_SIZE, VNET_DESC_WRITE, 0u); vnet_avail_push(vnet_rx_page, vnet_rx_qnum, (unsigned short)i); } vnet_outb(vnet_io + 0x12, VNET_F_ACK | VNET_F_DRIVER | VNET_F_OK | VNET_F_DRIVER_OK); vnet_rx_last = 0; vnet_tx_last = 0; vnet_on = 1; return 1; } /** Docstring: True once vnet_init brought the queues up.", "kind": "function", "line": 223, "name": "vnet_present", "signature": "int vnet_present(void)"}, {"doc": "vnet_outb(vnet_io + 0x12, VNET_F_ACK | VNET_F_DRIVER | VNET_F_OK | VNET_F_DRIVER_OK); vnet_rx_last = 0; vnet_tx_last = 0; vnet_on = 1; return 1; } /** Docstring: True once vnet_init brought the queues up. int vnet_present(void) { return vnet_on; } /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes).", "kind": "function", "line": 228, "name": "vnet_get_mac", "signature": "void vnet_get_mac(unsigned char out[6])"}, {"doc": "} /** Docstring: True once vnet_init brought the queues up. int vnet_present(void) { return vnet_on; } /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]) { unsigned i; for (i = 0; i < 6; i++) out[i] = vnet_mac[i]; } /** Docstring: The NIC I/O base, or 0 when the device is absent.", "kind": "function", "line": 234, "name": "vnet_iobase", "signature": "unsigned short vnet_iobase(void)"}, {"doc": "} /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]) { unsigned i; for (i = 0; i < 6; i++) out[i] = vnet_mac[i]; } /** Docstring: The NIC I/O base, or 0 when the device is absent. unsigned short vnet_iobase(void) { return vnet_io; } /** Docstring: Frame-level TX/RX counters.", "kind": "function", "line": 239, "name": "vnet_counters", "signature": "void vnet_counters(unsigned int *tx_frames, unsigned int *rx_frames)"}, {"doc": "vnet_avail_push(vnet_tx_page, vnet_tx_qnum, 0u); vnet_outw(vnet_io + 0x10, (unsigned short)VNET_Q_TX); deadline = ktime_ms() + VNET_TMO_MS; while (vnet_used_idx(vnet_tx_used) == vnet_tx_last) { if (ktime_ms() > deadline) return 0; __asm__ volatile(\"pause\"); } vnet_tx_last = vnet_used_idx(vnet_tx_used); (void)vnet_inb(vnet_io + 0x13); vnet_tx_packets++; return 1; } /** Docstring: Link-up status from the config space.", "kind": "function", "line": 277, "name": "vnet_link_up", "signature": "int vnet_link_up(void)"}, {"doc": "Docstring: Drain completed RX buffers into net_rx_handle_frame, reposting every descriptor. The 10-byte device header is skipped; frames outside 14..1514 payload bytes are dropped and counted, * exactly like the rtl8139 path. Bounded per call, never blocks.", "kind": "function", "line": 287, "name": "vnet_poll", "signature": "void vnet_poll(void)"}, {"kind": "macro", "line": 29, "name": "VNET_VENDOR", "signature": "#define VNET_VENDOR"}, {"kind": "macro", "line": 30, "name": "VNET_DEV_LEGACY", "signature": "#define VNET_DEV_LEGACY"}, {"kind": "macro", "line": 31, "name": "VNET_DEV_TRANS", "signature": "#define VNET_DEV_TRANS"}, {"kind": "macro", "line": 33, "name": "VNET_F_ACK", "signature": "#define VNET_F_ACK"}, {"kind": "macro", "line": 34, "name": "VNET_F_DRIVER", "signature": "#define VNET_F_DRIVER"}, {"kind": "macro", "line": 35, "name": "VNET_F_OK", "signature": "#define VNET_F_OK"}, {"kind": "macro", "line": 36, "name": "VNET_F_DRIVER_OK", "signature": "#define VNET_F_DRIVER_OK"}, {"kind": "macro", "line": 38, "name": "VNET_QNUM", "signature": "#define VNET_QNUM"}, {"kind": "macro", "line": 39, "name": "VNET_DESC_SZ", "signature": "#define VNET_DESC_SZ"}, {"kind": "macro", "line": 40, "name": "VNET_AVAIL_OFF", "signature": "#define VNET_AVAIL_OFF"}, {"kind": "macro", "line": 41, "name": "VNET_USED_OFF", "signature": "#define VNET_USED_OFF"}, {"kind": "macro", "line": 42, "name": "VNET_QAREA", "signature": "#define VNET_QAREA"}, {"kind": "macro", "line": 44, "name": "VNET_DESC_NEXT", "signature": "#define VNET_DESC_NEXT"}, {"kind": "macro", "line": 45, "name": "VNET_DESC_WRITE", "signature": "#define VNET_DESC_WRITE"}, {"kind": "macro", "line": 47, "name": "VNET_Q_RX", "signature": "#define VNET_Q_RX"}, {"kind": "macro", "line": 48, "name": "VNET_Q_TX", "signature": "#define VNET_Q_TX"}, {"kind": "macro", "line": 50, "name": "VNET_HDR_LEN", "signature": "#define VNET_HDR_LEN"}, {"kind": "macro", "line": 51, "name": "VNET_RX_BUFS", "signature": "#define VNET_RX_BUFS"}, {"kind": "macro", "line": 52, "name": "VNET_RX_SIZE", "signature": "#define VNET_RX_SIZE"}, {"kind": "macro", "line": 53, "name": "VNET_TX_SIZE", "signature": "#define VNET_TX_SIZE"}, {"kind": "macro", "line": 54, "name": "VNET_MIN_FRAME", "signature": "#define VNET_MIN_FRAME"}, {"kind": "macro", "line": 55, "name": "VNET_MAX_FRAME", "signature": "#define VNET_MAX_FRAME"}, {"kind": "macro", "line": 56, "name": "VNET_TMO_MS", "signature": "#define VNET_TMO_MS"}, {"kind": "macro", "line": 57, "name": "VNET_POLL_MAX", "signature": "#define VNET_POLL_MAX"}, {"kind": "macro", "line": 59, "name": "VNET_CFG_MAC", "signature": "#define VNET_CFG_MAC"}, {"kind": "macro", "line": 60, "name": "VNET_CFG_STATUS", "signature": "#define VNET_CFG_STATUS"}, {"kind": "macro", "line": 61, "name": "VNET_ST_LINK_UP", "signature": "#define VNET_ST_LINK_UP"}]}, {"doc": "xhci.c -- xHCI host controller driver, polled event ring.", "id": "drivers/xhci.c", "kind": "module", "label": "xhci.c", "language": "c", "sha256": "1bbd1e897b10b0a4", "symbol_count": 209, "symbols": [{"doc": "Docstring: A Transfer Request Block, 16 bytes per spec: 8-byte parameter, 4-byte status, 4-byte control. This size is load-bearing: a 24-byte struct * spaces the ring wrong and the controller walks garbage.", "kind": "struct", "line": 239, "name": "xhc_trb_t"}, {"doc": "Docstring: A non-control endpoint's transfer ring plus the producer's place in it. dci is the doorbell target and context index plus one. rearm requests a link re-arm once the producer is halfway round the new lap (see xhc_cmd_rearm: re-arming at the wrap itself races the * controller into reading the link stale).", "kind": "struct", "line": 250, "name": "xhc_ring_t"}, {"doc": "Docstring: A transfer waiting for its event. The caller-visible token is the index plus one, so 0 is always \"refused\" and never a valid token. since dates the post for the async reap budget. len is the asked length * and got the bytes the device actually moved, from the event's residue.", "kind": "struct", "line": 264, "name": "xhc_pending_t"}, {"doc": "Docstring: One enumerated device, with its cached configuration * descriptor on the heap.", "kind": "struct", "line": 276, "name": "xhc_devrec_t"}, {"kind": "function", "line": 296, "name": "xhc_ep_b", "signature": "static unsigned xhc_ep_b(void)"}, {"kind": "function", "line": 300, "name": "xhc_stride", "signature": "static unsigned xhc_stride(void)"}, {"kind": "function", "line": 327, "name": "xhc_put32", "signature": "static void xhc_put32(unsigned char *base, unsigned off, unsigned val)"}, {"kind": "function", "line": 334, "name": "xhc_get32", "signature": "static unsigned xhc_get32(const unsigned char *base, unsigned off)"}, {"kind": "function", "line": 339, "name": "xhc_put64", "signature": "static void xhc_put64(unsigned char *base, unsigned off,\n                      unsigned long long..."}, {"kind": "function", "line": 345, "name": "xhc_put16", "signature": "static void xhc_put16(unsigned char *base, unsigned off, unsigned val)"}, {"kind": "function", "line": 350, "name": "xhc_puttrb", "signature": "static void xhc_puttrb(xhc_trb_t *trb, unsigned long long param,\n                       unsigned ..."}, {"kind": "function", "line": 359, "name": "xhc_op_read32", "signature": "static unsigned xhc_op_read32(unsigned off)"}, {"kind": "function", "line": 363, "name": "xhc_op_write32", "signature": "static void xhc_op_write32(unsigned off, unsigned val)"}, {"kind": "function", "line": 367, "name": "xhc_run_write32", "signature": "static void xhc_run_write32(unsigned off, unsigned val)"}, {"kind": "function", "line": 371, "name": "xhc_run_read32", "signature": "static unsigned xhc_run_read32(unsigned off)"}, {"kind": "function", "line": 375, "name": "xhc_now_ms", "signature": "static unsigned long xhc_now_ms(void)"}, {"doc": "Docstring: Write back and invalidate the cache lines covering a range the controller can reach. QEMU (and non-coherent silicon) reads device memory out of RAM rather than out of the CPU's caches, so a TRB that is still dirty in a write-back line is invisible to the controller, and an event TRB the controller just wrote is invisible to a guest that holds a stale cached copy. Flushing both hands the buffer over explicitly. On coherent * hardware this is a cheap no-op for correctness, never a requirement.", "kind": "function", "line": 386, "name": "xhc_flush", "signature": "static void xhc_flush(const void *p, unsigned long len)"}, {"kind": "function", "line": 393, "name": "xhc_idle", "signature": "static void xhc_idle(unsigned spin)"}, {"doc": "--- Context addressing ---- * Device context N lives at xhc_ctx + N * stride; slot 0 is unused.", "kind": "function", "line": 400, "name": "xhc_slot_ctx", "signature": "static unsigned char *xhc_slot_ctx(int slot)"}, {"kind": "function", "line": 404, "name": "xhc_ep_ctx", "signature": "static unsigned char *xhc_ep_ctx(int slot, int ep)"}, {"kind": "function", "line": 409, "name": "xhc_in_slot", "signature": "static unsigned char *xhc_in_slot(void)"}, {"kind": "function", "line": 413, "name": "xhc_in_ep", "signature": "static unsigned char *xhc_in_ep(int ci)"}, {"doc": "static unsigned char *xhc_ep_ctx(int slot, int ep) { return xhc_slot_ctx(slot) + xhc_ep_b() + (unsigned long)(unsigned)ep * xhc_ep_b(); } static unsigned char *xhc_in_slot(void) { return xhc_in_ctx + xhc_ep_b(); } static unsigned char *xhc_in_ep(int ci) { return xhc_in_slot() + xhc_ep_b() + (unsigned long)(unsigned)ci * xhc_ep_b(); } /** Docstring: Build one 32-byte endpoint context per spec Table 140.", "kind": "function", "line": 418, "name": "xhc_ep_ctx_build", "signature": "static void xhc_ep_ctx_build(unsigned char *ep, unsigned type,\n                             unsig..."}, {"doc": "dw0 = ((mult & 0x3u) << XHC_EP_MULT_SHIFT) | ((interval & 0xFFu) << XHC_EP_INTERVAL_SHIFT); dw1 = (XHC_EP_CERR & 0x3u) | ((type & 0x7u) << XHC_EP_TYPE_SHIFT) | ((burst & 0xFFu) << XHC_EP_BURST_SHIFT) | ((maxp & 0xFFFFu) << XHC_EP_MAXP_SHIFT); xhc_put32(ep, XHC_EP_DW0_OFF, dw0); xhc_put32(ep, XHC_EP_DW1_OFF, dw1); xhc_put64(ep, XHC_EP_DEQ_OFF, (dequeue & ~0xFu) | (dcs ? XHC_EP_DCS_BIT : 0u)); xhc_put32(ep, XHC_EP_AVG_OFF, 8u); } /** Docstring: Build one 32-byte slot context: speed, entries and root port.", "kind": "function", "line": 439, "name": "xhc_slot_ctx_build", "signature": "static void xhc_slot_ctx_build(unsigned char *sc, unsigned speed,\n                               ..."}, {"doc": "Docstring: Toggle-cycle bit of a Link TRB. Set, so the controller toggles its expected cycle when it follows the link instead of reading the next * generation as stale. #define XF_LINK_TC 2u /** Docstring: Arm the link TRB with the current generation.", "kind": "function", "line": 458, "name": "xhc_arm_link_trb", "signature": "static void xhc_arm_link_trb(xhc_trb_t *ring, unsigned gen)"}, {"kind": "function", "line": 465, "name": "xhc_arm_link", "signature": "static void xhc_arm_link(void)"}, {"kind": "function", "line": 477, "name": "xhc_cmd_wrap", "signature": "static void xhc_cmd_wrap(void)"}, {"kind": "function", "line": 483, "name": "xhc_cmd_maybe_arm", "signature": "static void xhc_cmd_maybe_arm(void)"}, {"doc": "Docstring: Fill one command-ring slot without ringing the doorbell. The caller batches its TRBs and rings once. Wraps instead of refusing: a ring that goes deaf after 1023 commands turns a long-lived machine * into a hang.", "kind": "function", "line": 494, "name": "xhc_cmd_slot", "signature": "static xhc_trb_t *xhc_cmd_slot(void)"}, {"doc": "Docstring: Ring the command doorbell. Per spec section 5.4 the host controller doorbell is array entry 0 written with target 0: the controller * tracks the ring itself and any other value is undefined.", "kind": "function", "line": 506, "name": "xhc_cmd_ring_doorbell", "signature": "static void xhc_cmd_ring_doorbell(void)"}, {"doc": "Docstring: Ring a slot doorbell for endpoint context index ep: DCI is the * index plus one, and EP0 rings target 1.", "kind": "function", "line": 519, "name": "xhc_slot_doorbell", "signature": "static void xhc_slot_doorbell(int slot, int ep)"}, {"doc": "Docstring: Next event TRB, or 0 when the ring is empty.  The cycle bit separates generations, so a slot the controller has not written reads as \"not mine\" and the drain stops without needing a count. The read is fenced before the slot is released, or the next poll re-reads * a stale cached copy as a fresh event.", "kind": "function", "line": 535, "name": "xhc_evt_next", "signature": "static xhc_trb_t *xhc_evt_next(void)"}, {"doc": "Docstring: The TRB a completion names, as a host pointer. The value is a physical address and the kernel is identity mapped there, which is the * reason every ring here is a heap object.", "kind": "function", "line": 552, "name": "xhc_evt_trb_ptr", "signature": "static xhc_trb_t *xhc_evt_trb_ptr(xhc_trb_t *ev)"}, {"doc": "Docstring: Tell the controller the event ring was drained: ERDP advances to the dequeue pointer with EHB set to clear the handler-busy latch, so a * poll that never reports back stalls the ring after one segment.", "kind": "function", "line": 559, "name": "xhc_evt_advance", "signature": "static void xhc_evt_advance(void)"}, {"kind": "function", "line": 570, "name": "xhc_pending_claim_len", "signature": "static int xhc_pending_claim_len(xhc_trb_t *trb, unsigned len)"}, {"kind": "function", "line": 586, "name": "xhc_pending_claim", "signature": "static int xhc_pending_claim(xhc_trb_t *trb)"}, {"kind": "function", "line": 590, "name": "xhc_pending_drop", "signature": "static void xhc_pending_drop(int token)"}, {"kind": "function", "line": 595, "name": "xhc_poll", "signature": "int xhc_poll(void)"}, {"doc": "Docstring: Wait for a pending transfer to complete. Returns 1 on completion, 0 on timeout, and drops the claim either way so a timed-out * waiter cannot hold the table shut forever.", "kind": "function", "line": 638, "name": "xhc_wait", "signature": "static int xhc_wait(int token, unsigned budget_ms)"}, {"doc": "if (token < 1 || token > XHC_MAX_PENDING) return 0; end = xhc_now_ms() + budget_ms; for (;;) { xhc_poll(); if (xhc_pending[token - 1].done) return 1; if ((long)(xhc_now_ms() - end) >= 0) { xhc_pending_drop(token); return 0; } xhc_idle(256); } } /** Docstring: Outcome of a completed transfer.", "kind": "function", "line": 654, "name": "xhc_status", "signature": "static int xhc_status(int token)"}, {"doc": "Docstring: Submit one command TRB and wait for its completion, by TRB pointer so a completion for anything else is counted rather than handed to the wrong waiter. Returns 1 when the controller reported success, 0 * otherwise, with the raw completion code and any returned slot id.", "kind": "function", "line": 663, "name": "xhc_cmd_run_ep", "signature": "static int xhc_cmd_run_ep(unsigned type, unsigned long long param,\n                            un..."}, {"kind": "function", "line": 709, "name": "xhc_cmd_run", "signature": "static int xhc_cmd_run(unsigned type, unsigned long long param, unsigned slot,\n                  ..."}, {"doc": "Docstring: Stop, reset and re-point one endpoint's transfer ring. Stop works from any state and drops whatever the endpoint was chewing on; reset clears a halt; set-dequeue hands the ring back at the producer's current position with its generation, so a Bulk-Only recovery can * continue on the same ring instead of rebuilding the endpoint.", "kind": "function", "line": 719, "name": "xhc_ep_command", "signature": "static int xhc_ep_command(unsigned type, int slot, int dci)"}, {"kind": "function", "line": 723, "name": "xhc_reset_endpoint", "signature": "int xhc_reset_endpoint(int index, int ep_index)"}, {"kind": "function", "line": 749, "name": "xhc_port_count", "signature": "int xhc_port_count(void)"}, {"kind": "function", "line": 753, "name": "xhc_port_state", "signature": "int xhc_port_state(int port, xhc_port_t *out)"}, {"doc": "Docstring: Ask a port to reset, and wait for it to settle. Per spec the reset bit is PORTSC bit 4: set it with the W1C change bits written clear, * then wait for PED set and PR clear. Returns 1 on a connected device.", "kind": "function", "line": 776, "name": "xhc_port_reset", "signature": "int xhc_port_reset(int port)"}, {"kind": "function", "line": 806, "name": "xhc_device_count", "signature": "int xhc_device_count(void)"}, {"kind": "function", "line": 814, "name": "xhc_device_info", "signature": "int xhc_device_info(int index, xhc_dev_t *out)"}, {"doc": "out->address = 0; } if (index < 0 || index >= XHC_MAX_DEVICES) return 0; if (!xhc_devs[index].used) return 0; if (out) { out->slot = xhc_devs[index].slot; out->port = xhc_devs[index].port; out->speed = xhc_devs[index].speed; out->address = xhc_devs[index].address; } return 1; } /** Docstring: Allocate a free device record, or -1.", "kind": "function", "line": 833, "name": "xhc_dev_alloc", "signature": "static int xhc_dev_alloc(void)"}, {"doc": "Docstring: Release one device record after a failed enumeration: its EP0 ring and cached descriptor go back, so a retry starts clean instead of * refusing on its own leftover ring.", "kind": "function", "line": 843, "name": "xhc_dev_release", "signature": "static void xhc_dev_release(int index)"}, {"kind": "function", "line": 863, "name": "xhc_open_interface", "signature": "int xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto,\n                   ..."}, {"doc": "Docstring: Wrap a transfer ring instead of refusing after a thousand transfers: the producer goes back to slot zero with the toggled generation and the endpoint context DCS follows it at once, while the link keeps the old generation until the producer is halfway round (see xhc_cmd_rearm: re-arming at the wrap itself races the controller * into reading the link stale and the ring stops forever).", "kind": "function", "line": 936, "name": "xhc_ring_wrap", "signature": "static void xhc_ring_wrap(int index, xhc_ring_t *ring, int ep)"}, {"kind": "function", "line": 949, "name": "xhc_ring_maybe_arm", "signature": "static void xhc_ring_maybe_arm(xhc_ring_t *ring)"}, {"doc": "Docstring: Post one TRB on a device EP0 transfer ring, wrapping instead of refusing. The gate is the ring, not the used flag: control transfers * run during enumeration, before the record is marked used.", "kind": "function", "line": 959, "name": "xhc_ep0_slot", "signature": "static xhc_trb_t *xhc_ep0_slot(int index)"}, {"kind": "function", "line": 971, "name": "xhc_ep0_bump", "signature": "static void xhc_ep0_bump(int index)"}, {"doc": "Docstring: One control transfer on the device EP0 transfer ring: a setup TRB with IDT, an optional data TRB and a status TRB with IOC, behind one * slot doorbell. Only the status stage is waited on.", "kind": "function", "line": 979, "name": "xhc_control_stage", "signature": "static int xhc_control_stage(int index, const unsigned char setup[8],\n                           ..."}, {"doc": "Docstring: USB is lossy and emulated controllers occasionally drop a completion, so a control transfer retries its whole setup-data-status stage up to three times before reporting failure. A stall or a refused * stage is not retried: only a missing or failed completion is. define XHC_CONTROL_TRIES 3u", "kind": "function", "line": 1048, "name": "xhc_control", "signature": "int xhc_control(int index, const unsigned char setup[8], void *data,\n                unsigned len..."}, {"doc": "Docstring: Pack a standard request with no data stage: bmRequestType, * bRequest, wValue, wIndex.", "kind": "function", "line": 1069, "name": "xhc_setup_nodata", "signature": "static void xhc_setup_nodata(unsigned char *setup, unsigned char type,\n                          ..."}, {"doc": "Docstring: Pack a standard request with a data stage of a known length: * same as above with wLength filled in.", "kind": "function", "line": 1082, "name": "xhc_setup_data", "signature": "static void xhc_setup_data(unsigned char *setup, unsigned char type,\n                           u..."}, {"doc": "Docstring: Endpoint context index for a USB endpoint address: DCI is one * plus twice the endpoint number plus the direction, with EP0 at DCI 1.", "kind": "function", "line": 1093, "name": "xhc_dci", "signature": "static int xhc_dci(int ep_addr)"}, {"kind": "function", "line": 1100, "name": "xhc_configure_endpoint", "signature": "int xhc_configure_endpoint(int index, int ep_index, int ep_addr, int ep_type,\n                   ..."}, {"doc": "Docstring: Post one Normal TRB with IOC on an endpoint's ring and ring its * slot doorbell. Returns the pending token, or 0 on refusal.", "kind": "function", "line": 1162, "name": "xhc_ep_post", "signature": "static int xhc_ep_post(int index, int ep_index, void *buf, unsigned len)"}, {"doc": "len & 0x1FFFFu, (unsigned)(XHC_TRB_MAKE_TYPE(XHC_TRB_TYPE_NORMAL) | ring->gen | XHC_TRB_IOC)); xhc_flush(trb, sizeof(*trb)); if (ring->is_out) xhc_flush(buf, len); slot = xhc_devs[index].slot; hal_mmio_wmb(); hal_mmio_write32( (volatile unsigned *)(xhc_db + (unsigned)slot * XHC_DB_STRIDE), (unsigned)ring->dci); return token; } /** Docstring: Actual bytes moved, for short-packet honesty.", "kind": "function", "line": 1197, "name": "xhc_got", "signature": "static int xhc_got(int token)"}, {"kind": "function", "line": 1202, "name": "xhc_transfer", "signature": "int xhc_transfer(int index, int ep_index, void *buf, unsigned len, int *got)"}, {"doc": "Docstring: Post one endpoint transfer without waiting: the completion arrives on the event ring and is collected by xhc_poll_token. Returns the * token, or 0 on refusal.", "kind": "function", "line": 1222, "name": "xhc_transfer_async", "signature": "int xhc_transfer_async(int index, int ep_index, void *buf, unsigned len)"}, {"doc": "Docstring: Non-blocking completion check for xhc_transfer_async. Drains the ring, then reports 1 on success, -1 on a failed completion, -2 on a wait past the budget, and 0 while still outstanding. Consumed tokens are dropped, so a caller that polls to completion never leaks the table. A zero budget never expires: an interrupt endpoint with nothing to say answers NAK rather than an event, and expiring its only transfer orphans * the report it eventually delivers to a token nobody holds.", "kind": "function", "line": 1233, "name": "xhc_poll_token_limit", "signature": "int xhc_poll_token_limit(int token, unsigned budget_ms)"}, {"kind": "function", "line": 1252, "name": "xhc_poll_token", "signature": "int xhc_poll_token(int token)"}, {"doc": "Docstring: Enable a slot and build its device context with a working control endpoint on its own transfer ring. The input context adds the slot * and EP0; the DCBAA entry points at the output device context.", "kind": "function", "line": 1261, "name": "xhc_address", "signature": "static int xhc_address(int index, int slot, int port, int speed)"}, {"doc": "Docstring: Fetch the device descriptor. wValue packs the descriptor type * above the index: a device descriptor is type 1, so 0x0100, not zero.", "kind": "function", "line": 1316, "name": "xhc_get_device_desc", "signature": "static int xhc_get_device_desc(int index, unsigned char *buf)"}, {"doc": "Docstring: Fetch the configuration descriptor.  The first request is for nine bytes, which is the fixed prefix every USB configuration descriptor starts with and the only place wTotalLength lives. Asking for the maximum on the first request instead is the classic mistake: a device with a longer descriptor set answers with wTotalLength bytes, and one with a shorter set answers a short packet, so either way the caller cannot tell how much it got without reading the length back first. The second request asks for that length, capped at XHC_MAX_CONFIG_DESC, and the length reported back is re-read from the device so a truncated copy is * never described as complete.", "kind": "function", "line": 1333, "name": "xhc_get_config_desc", "signature": "static int xhc_get_config_desc(int index, unsigned char *buf, unsigned *len)"}, {"kind": "function", "line": 1358, "name": "xhc_enumerate", "signature": "int xhc_enumerate(int port)"}, {"kind": "function", "line": 1444, "name": "xhc_enumerate_all", "signature": "int xhc_enumerate_all(void)"}, {"kind": "function", "line": 1454, "name": "xhc_outl", "signature": "static void xhc_outl(unsigned short port, unsigned val)"}, {"kind": "function", "line": 1458, "name": "xhc_inl", "signature": "static unsigned xhc_inl(unsigned short port)"}, {"kind": "function", "line": 1464, "name": "xhc_free_all", "signature": "static void xhc_free_all(void)"}, {"doc": "Docstring: Allocate the command ring, the event ring, the ERST, the DCBAA and the context array. Returns 1 on success; on any failure everything allocated so far is released, so a controller that runs out of memory * leaves no half-built rings behind.", "kind": "function", "line": 1494, "name": "xhc_alloc_all", "signature": "static int xhc_alloc_all(unsigned max_slots)"}, {"doc": "Docstring: Reset the controller, program its ring state, and bring it to run. Returns 1 when it leaves reset and reports itself un-halted, 0 on a reset or run timeout. Both waits are bounded: an unbounded spin here is an unusable machine, not a slow one.  The order is the whole trick, and getting it backwards produces a driver that appears to hang forever: HCRESET clears the command ring pointer, the DCBAA pointer, CONFIG and every interrupter register, so a sequence that programs the rings first and then resets leaves the controller running with nothing programmed and no command ever completing. Reset, then program, then * Run.", "kind": "function", "line": 1593, "name": "xhc_start", "signature": "static int xhc_start(unsigned contexts)"}, {"kind": "function", "line": 1658, "name": "xhc_init", "signature": "int xhc_init(void)"}, {"kind": "function", "line": 1790, "name": "xhc_counters", "signature": "void xhc_counters(xhc_counters_t *out)"}, {"kind": "function", "line": 1794, "name": "xhc_probe_note", "signature": "const char *xhc_probe_note(void)"}, {"kind": "function", "line": 1798, "name": "xhc_info", "signature": "int xhc_info(unsigned *version, unsigned *slots, unsigned *ports,\n             unsigned *caplength)"}, {"kind": "macro", "line": 55, "name": "XHC_CAP_OFF", "signature": "#define XHC_CAP_OFF"}, {"kind": "macro", "line": 58, "name": "XHC_OP_USBCMD", "signature": "#define XHC_OP_USBCMD"}, {"kind": "macro", "line": 59, "name": "XHC_OP_USBSTS", "signature": "#define XHC_OP_USBSTS"}, {"kind": "macro", "line": 60, "name": "XHC_OP_PAGESIZE", "signature": "#define XHC_OP_PAGESIZE"}, {"kind": "macro", "line": 61, "name": "XHC_OP_CRCR", "signature": "#define XHC_OP_CRCR"}, {"kind": "macro", "line": 62, "name": "XHC_OP_DCBAAP", "signature": "#define XHC_OP_DCBAAP"}, {"kind": "macro", "line": 63, "name": "XHC_OP_CONFIG", "signature": "#define XHC_OP_CONFIG"}, {"kind": "macro", "line": 64, "name": "XHC_OP_PORTSC", "signature": "#define XHC_OP_PORTSC"}, {"kind": "macro", "line": 65, "name": "XHC_PORT_STRIDE", "signature": "#define XHC_PORT_STRIDE"}, {"kind": "macro", "line": 71, "name": "XHC_RUN_INTR0", "signature": "#define XHC_RUN_INTR0"}, {"kind": "macro", "line": 72, "name": "XHC_RUN_IMAN", "signature": "#define XHC_RUN_IMAN"}, {"kind": "macro", "line": 73, "name": "XHC_RUN_IMOD", "signature": "#define XHC_RUN_IMOD"}, {"kind": "macro", "line": 74, "name": "XHC_RUN_ERSTSZ", "signature": "#define XHC_RUN_ERSTSZ"}, {"kind": "macro", "line": 75, "name": "XHC_RUN_ERSTBA", "signature": "#define XHC_RUN_ERSTBA"}, {"kind": "macro", "line": 76, "name": "XHC_RUN_ERDP", "signature": "#define XHC_RUN_ERDP"}, {"kind": "macro", "line": 77, "name": "XHC_IMAN_IP", "signature": "#define XHC_IMAN_IP"}, {"kind": "macro", "line": 78, "name": "XHC_IMAN_IE", "signature": "#define XHC_IMAN_IE"}, {"kind": "macro", "line": 79, "name": "XHC_ERDP_EHB", "signature": "#define XHC_ERDP_EHB"}, {"kind": "macro", "line": 82, "name": "XHC_CAP_HCSP1", "signature": "#define XHC_CAP_HCSP1"}, {"kind": "macro", "line": 83, "name": "XHC_CAP_HCSP2", "signature": "#define XHC_CAP_HCSP2"}, {"kind": "macro", "line": 84, "name": "XHC_CAP_HCSP3", "signature": "#define XHC_CAP_HCSP3"}, {"kind": "macro", "line": 85, "name": "XHC_CAP_HCCP1", "signature": "#define XHC_CAP_HCCP1"}, {"kind": "macro", "line": 86, "name": "XHC_CAP_DBOFF", "signature": "#define XHC_CAP_DBOFF"}, {"kind": "macro", "line": 87, "name": "XHC_CAP_RTSOFF", "signature": "#define XHC_CAP_RTSOFF"}, {"kind": "macro", "line": 88, "name": "XHC_HCC_AC64", "signature": "#define XHC_HCC_AC64"}, {"kind": "macro", "line": 89, "name": "XHC_HCC_CSZ", "signature": "#define XHC_HCC_CSZ"}, {"kind": "macro", "line": 92, "name": "XHC_CMD_RUN", "signature": "#define XHC_CMD_RUN"}, {"kind": "macro", "line": 93, "name": "XHC_CMD_RESET", "signature": "#define XHC_CMD_RESET"}, {"kind": "macro", "line": 96, "name": "XHC_STS_HALTED", "signature": "#define XHC_STS_HALTED"}, {"kind": "macro", "line": 97, "name": "XHC_STS_ATE", "signature": "#define XHC_STS_ATE"}, {"kind": "macro", "line": 100, "name": "XHC_PORT_CCS", "signature": "#define XHC_PORT_CCS"}, {"kind": "macro", "line": 101, "name": "XHC_PORT_PED", "signature": "#define XHC_PORT_PED"}, {"kind": "macro", "line": 102, "name": "XHC_PORT_PR", "signature": "#define XHC_PORT_PR"}, {"kind": "macro", "line": 103, "name": "XHC_PORT_PP", "signature": "#define XHC_PORT_PP"}, {"kind": "macro", "line": 104, "name": "XHC_PORT_SPEED_SHIFT", "signature": "#define XHC_PORT_SPEED_SHIFT"}, {"kind": "macro", "line": 105, "name": "XHC_PORT_SPEED_MASK", "signature": "#define XHC_PORT_SPEED_MASK"}, {"kind": "macro", "line": 106, "name": "XHC_PORT_CHG_MASK", "signature": "#define XHC_PORT_CHG_MASK"}, {"kind": "macro", "line": 109, "name": "XHC_TRB_TYPE", "signature": "#define XHC_TRB_TYPE(t)"}, {"kind": "macro", "line": 110, "name": "XHC_TRB_CYCLE", "signature": "#define XHC_TRB_CYCLE(t)"}, {"kind": "macro", "line": 111, "name": "XHC_TRB_MAKE_TYPE", "signature": "#define XHC_TRB_MAKE_TYPE(v)"}, {"kind": "macro", "line": 113, "name": "XHC_TRB_TYPE_NORMAL", "signature": "#define XHC_TRB_TYPE_NORMAL"}, {"kind": "macro", "line": 114, "name": "XHC_TRB_TYPE_SETUP", "signature": "#define XHC_TRB_TYPE_SETUP"}, {"kind": "macro", "line": 115, "name": "XHC_TRB_TYPE_DATA", "signature": "#define XHC_TRB_TYPE_DATA"}, {"kind": "macro", "line": 116, "name": "XHC_TRB_TYPE_STATUS", "signature": "#define XHC_TRB_TYPE_STATUS"}, {"kind": "macro", "line": 117, "name": "XHC_TRB_TYPE_LINK", "signature": "#define XHC_TRB_TYPE_LINK"}, {"kind": "macro", "line": 118, "name": "XHC_TRB_TYPE_NOOP_TRB", "signature": "#define XHC_TRB_TYPE_NOOP_TRB"}, {"kind": "macro", "line": 119, "name": "XHC_TRB_TYPE_ENABLE_SLOT", "signature": "#define XHC_TRB_TYPE_ENABLE_SLOT"}, {"kind": "macro", "line": 120, "name": "XHC_TRB_TYPE_ADDRESS_DEVICE", "signature": "#define XHC_TRB_TYPE_ADDRESS_DEVICE"}, {"kind": "macro", "line": 121, "name": "XHC_TRB_TYPE_CONFIGURE_ENDPOINT", "signature": "#define XHC_TRB_TYPE_CONFIGURE_ENDPOINT"}, {"kind": "macro", "line": 122, "name": "XHC_TRB_TYPE_RESET_ENDPOINT", "signature": "#define XHC_TRB_TYPE_RESET_ENDPOINT"}, {"kind": "macro", "line": 123, "name": "XHC_TRB_TYPE_STOP_ENDPOINT", "signature": "#define XHC_TRB_TYPE_STOP_ENDPOINT"}, {"kind": "macro", "line": 124, "name": "XHC_TRB_TYPE_SET_DEQUEUE", "signature": "#define XHC_TRB_TYPE_SET_DEQUEUE"}, {"kind": "macro", "line": 125, "name": "XHC_TRB_TYPE_NOOP_CMD", "signature": "#define XHC_TRB_TYPE_NOOP_CMD"}, {"kind": "macro", "line": 126, "name": "XHC_TRB_TYPE_TRANSFER_EVENT", "signature": "#define XHC_TRB_TYPE_TRANSFER_EVENT"}, {"kind": "macro", "line": 127, "name": "XHC_TRB_TYPE_CMD_COMPLETION", "signature": "#define XHC_TRB_TYPE_CMD_COMPLETION"}, {"kind": "macro", "line": 128, "name": "XHC_TRB_TYPE_PORT_STATUS", "signature": "#define XHC_TRB_TYPE_PORT_STATUS"}, {"kind": "macro", "line": 131, "name": "XHC_CC_SUCCESS", "signature": "#define XHC_CC_SUCCESS"}, {"kind": "macro", "line": 132, "name": "XHC_CC_SHORT_PACKET", "signature": "#define XHC_CC_SHORT_PACKET"}, {"kind": "macro", "line": 135, "name": "XHC_EVT_TYPE", "signature": "#define XHC_EVT_TYPE(e)"}, {"kind": "macro", "line": 136, "name": "XHC_EVT_CC", "signature": "#define XHC_EVT_CC(e)"}, {"kind": "macro", "line": 137, "name": "XHC_EVT_SLOT", "signature": "#define XHC_EVT_SLOT(e)"}, {"kind": "macro", "line": 138, "name": "XHC_EVT_LEN", "signature": "#define XHC_EVT_LEN(e)"}, {"kind": "macro", "line": 139, "name": "XHC_EVT_TRANSFER", "signature": "#define XHC_EVT_TRANSFER"}, {"kind": "macro", "line": 140, "name": "XHC_EVT_CMD_COMPLETION", "signature": "#define XHC_EVT_CMD_COMPLETION"}, {"kind": "macro", "line": 150, "name": "XHC_EP_DW0_OFF", "signature": "#define XHC_EP_DW0_OFF"}, {"kind": "macro", "line": 151, "name": "XHC_EP_DW1_OFF", "signature": "#define XHC_EP_DW1_OFF"}, {"kind": "macro", "line": 152, "name": "XHC_EP_DEQ_OFF", "signature": "#define XHC_EP_DEQ_OFF"}, {"kind": "macro", "line": 153, "name": "XHC_EP_AVG_OFF", "signature": "#define XHC_EP_AVG_OFF"}, {"kind": "macro", "line": 154, "name": "XHC_EP_MULT_SHIFT", "signature": "#define XHC_EP_MULT_SHIFT"}, {"kind": "macro", "line": 155, "name": "XHC_EP_INTERVAL_SHIFT", "signature": "#define XHC_EP_INTERVAL_SHIFT"}, {"kind": "macro", "line": 156, "name": "XHC_EP_TYPE_SHIFT", "signature": "#define XHC_EP_TYPE_SHIFT"}, {"kind": "macro", "line": 157, "name": "XHC_EP_BURST_SHIFT", "signature": "#define XHC_EP_BURST_SHIFT"}, {"kind": "macro", "line": 158, "name": "XHC_EP_MAXP_SHIFT", "signature": "#define XHC_EP_MAXP_SHIFT"}, {"kind": "macro", "line": 159, "name": "XHC_EP_DCS_BIT", "signature": "#define XHC_EP_DCS_BIT"}, {"kind": "macro", "line": 162, "name": "XHC_EPT_CONTROL", "signature": "#define XHC_EPT_CONTROL"}, {"kind": "macro", "line": 163, "name": "XHC_EPT_ISO_OUT", "signature": "#define XHC_EPT_ISO_OUT"}, {"kind": "macro", "line": 164, "name": "XHC_EPT_BULK_OUT", "signature": "#define XHC_EPT_BULK_OUT"}, {"kind": "macro", "line": 165, "name": "XHC_EPT_INT_OUT", "signature": "#define XHC_EPT_INT_OUT"}, {"kind": "macro", "line": 166, "name": "XHC_EPT_ISO_IN", "signature": "#define XHC_EPT_ISO_IN"}, {"kind": "macro", "line": 167, "name": "XHC_EPT_BULK_IN", "signature": "#define XHC_EPT_BULK_IN"}, {"kind": "macro", "line": 168, "name": "XHC_EPT_INT_IN", "signature": "#define XHC_EPT_INT_IN"}, {"kind": "macro", "line": 169, "name": "XHC_EP_CERR", "signature": "#define XHC_EP_CERR"}, {"kind": "macro", "line": 173, "name": "XHC_CTX_SLOT_STRIDE", "signature": "#define XHC_CTX_SLOT_STRIDE"}, {"kind": "macro", "line": 174, "name": "XHC_CTX_SLOT_STRIDE64", "signature": "#define XHC_CTX_SLOT_STRIDE64"}, {"kind": "macro", "line": 175, "name": "XHC_CTX_DEVICE_BYTES", "signature": "#define XHC_CTX_DEVICE_BYTES"}, {"kind": "macro", "line": 176, "name": "XHC_CTX_EP_BYTES", "signature": "#define XHC_CTX_EP_BYTES"}, {"kind": "macro", "line": 177, "name": "XHC_ICTX_BYTES", "signature": "#define XHC_ICTX_BYTES"}, {"kind": "macro", "line": 181, "name": "XHC_SLOT_DW0_OFF", "signature": "#define XHC_SLOT_DW0_OFF"}, {"kind": "macro", "line": 182, "name": "XHC_SLOT_DW1_OFF", "signature": "#define XHC_SLOT_DW1_OFF"}, {"kind": "macro", "line": 183, "name": "XHC_SLOT_ADDR_OFF", "signature": "#define XHC_SLOT_ADDR_OFF"}, {"kind": "macro", "line": 184, "name": "XHC_SLOT_SPEED_SHIFT", "signature": "#define XHC_SLOT_SPEED_SHIFT"}, {"kind": "macro", "line": 185, "name": "XHC_SLOT_ENTRIES_SHIFT", "signature": "#define XHC_SLOT_ENTRIES_SHIFT"}, {"kind": "macro", "line": 186, "name": "XHC_SLOT_RHPORT_SHIFT", "signature": "#define XHC_SLOT_RHPORT_SHIFT"}, {"kind": "macro", "line": 189, "name": "XHC_ICTX_DROP_OFF", "signature": "#define XHC_ICTX_DROP_OFF"}, {"kind": "macro", "line": 190, "name": "XHC_ICTX_ADD_OFF", "signature": "#define XHC_ICTX_ADD_OFF"}, {"kind": "macro", "line": 193, "name": "XHC_DCBAA_ENTRIES", "signature": "#define XHC_DCBAA_ENTRIES"}, {"kind": "macro", "line": 196, "name": "XHC_ERST_RING_LO", "signature": "#define XHC_ERST_RING_LO"}, {"kind": "macro", "line": 197, "name": "XHC_ERST_RING_HI", "signature": "#define XHC_ERST_RING_HI"}, {"kind": "macro", "line": 198, "name": "XHC_ERST_SIZE", "signature": "#define XHC_ERST_SIZE"}, {"kind": "macro", "line": 199, "name": "XHC_ERST_CYCLE", "signature": "#define XHC_ERST_CYCLE"}, {"kind": "macro", "line": 200, "name": "XHC_ERST_BYTES", "signature": "#define XHC_ERST_BYTES"}, {"kind": "macro", "line": 212, "name": "XHC_DMA_ALIGN", "signature": "#define XHC_DMA_ALIGN"}, {"kind": "macro", "line": 215, "name": "XHC_RING_USABLE", "signature": "#define XHC_RING_USABLE"}, {"kind": "macro", "line": 218, "name": "XHC_DT_DEVICE", "signature": "#define XHC_DT_DEVICE"}, {"kind": "macro", "line": 219, "name": "XHC_DT_CONFIG", "signature": "#define XHC_DT_CONFIG"}, {"kind": "macro", "line": 220, "name": "XHC_DT_INTERFACE", "signature": "#define XHC_DT_INTERFACE"}, {"kind": "macro", "line": 221, "name": "XHC_DT_ENDPOINT", "signature": "#define XHC_DT_ENDPOINT"}, {"kind": "macro", "line": 224, "name": "XHC_DEV_DESC_LEN_OFF", "signature": "#define XHC_DEV_DESC_LEN_OFF"}, {"kind": "macro", "line": 225, "name": "XHC_DEV_DESC_TYPE_OFF", "signature": "#define XHC_DEV_DESC_TYPE_OFF"}, {"kind": "macro", "line": 226, "name": "XHC_DEV_DESC_NUM_CFG_OFF", "signature": "#define XHC_DEV_DESC_NUM_CFG_OFF"}, {"kind": "macro", "line": 227, "name": "XHC_CFG_TOTAL_LEN_OFF", "signature": "#define XHC_CFG_TOTAL_LEN_OFF"}, {"kind": "macro", "line": 228, "name": "XHC_IFACE_OFF", "signature": "#define XHC_IFACE_OFF"}, {"kind": "macro", "line": 229, "name": "XHC_IFACE_CLASS_OFF", "signature": "#define XHC_IFACE_CLASS_OFF"}, {"kind": "macro", "line": 230, "name": "XHC_IFACE_SUBCLASS_OFF", "signature": "#define XHC_IFACE_SUBCLASS_OFF"}, {"kind": "macro", "line": 231, "name": "XHC_IFACE_PROTO_OFF", "signature": "#define XHC_IFACE_PROTO_OFF"}, {"kind": "macro", "line": 232, "name": "XHC_EP_DESC_ADDR_OFF", "signature": "#define XHC_EP_DESC_ADDR_OFF"}, {"kind": "macro", "line": 233, "name": "XHC_EP_DESC_TYPE_OFF", "signature": "#define XHC_EP_DESC_TYPE_OFF"}, {"kind": "macro", "line": 234, "name": "XHC_EP_DESC_MAXP_OFF", "signature": "#define XHC_EP_DESC_MAXP_OFF"}, {"kind": "macro", "line": 455, "name": "XF_LINK_TC", "signature": "#define XF_LINK_TC"}, {"kind": "macro", "line": 514, "name": "XHC_DB_STRIDE", "signature": "#define XHC_DB_STRIDE"}, {"kind": "macro", "line": 515, "name": "XHC_DB_COMMAND", "signature": "#define XHC_DB_COMMAND"}, {"kind": "macro", "line": 924, "name": "XHC_TRB_IOC", "signature": "#define XHC_TRB_IOC"}, {"kind": "macro", "line": 925, "name": "XHC_TRB_IDT", "signature": "#define XHC_TRB_IDT"}, {"kind": "macro", "line": 926, "name": "XHC_TRB_DIR", "signature": "#define XHC_TRB_DIR"}, {"kind": "macro", "line": 927, "name": "XHC_TRT_OUT", "signature": "#define XHC_TRT_OUT"}, {"kind": "macro", "line": 928, "name": "XHC_TRT_IN", "signature": "#define XHC_TRT_IN"}, {"kind": "macro", "line": 1047, "name": "XHC_CONTROL_TRIES", "signature": "#define XHC_CONTROL_TRIES"}]}, {"doc": "================================================================", "id": "fs/ext4.c", "kind": "module", "label": "ext4.c", "language": "c", "sha256": "d19230123483e08e", "symbol_count": 38, "symbols": [{"doc": "Filesystem geometry from the superblock. 64-bit block counts ride along (real disks use them) but every byte offset is fenced to * the image size before use.", "kind": "struct", "line": 44, "name": "ext_geo_t"}, {"doc": "Decoded inode: kind (0 file, 1 dir), size, extent root or legacy * block list (copied, so later reads never re-parse the inode).", "kind": "struct", "line": 115, "name": "ext_ino_t"}, {"kind": "function", "line": 32, "name": "ext_ld16", "signature": "static unsigned ext_ld16(const unsigned char *p)"}, {"kind": "function", "line": 36, "name": "ext_ld32", "signature": "static unsigned long ext_ld32(const unsigned char *p)"}, {"kind": "function", "line": 55, "name": "ext_parse_sb", "signature": "static int ext_parse_sb(const fsimg_t *img, ext_geo_t *g)"}, {"doc": "Byte offset of an inode. Group and index arithmetic is 64-bit and * fenced to the image before any read.", "kind": "function", "line": 92, "name": "ext_inode_off", "signature": "static int ext_inode_off(const fsimg_t *img, const ext_geo_t *g,\n                         unsigne..."}, {"kind": "function", "line": 122, "name": "ext_read_inode", "signature": "static int ext_read_inode(const fsimg_t *img, const ext_geo_t *g,\n                          unsig..."}, {"kind": "function", "line": 171, "name": "ext_map", "signature": "static int ext_map(const fsimg_t *img, const ext_geo_t *g,\n                   const unsigned char..."}, {"doc": "} r = ext_map_down(img, g, root, nent, lblk, node); if (r <= 0) break; for (d = 0; d < 60 && d < g->bs; d++) root[d] = node[d]; r = -1; continue; } } } kfree(node); return r; } /* One leaf level: find the extent covering lblk.", "kind": "function", "line": 211, "name": "ext_map_leaf", "signature": "static int ext_map_leaf(const fsimg_t *img, const ext_geo_t *g,\n                        const uns..."}, {"kind": "function", "line": 356, "name": "ext_resolve", "signature": "static int ext_resolve(const fsimg_t *img, const ext_geo_t *g,\n                       const char ..."}, {"doc": "Read one logical file block of an open inode into blk (block * sized). Holes and uninitialized extents come back zeroed.", "kind": "function", "line": 464, "name": "ext_file_block", "signature": "static int ext_file_block(const fsimg_t *img, const ext_geo_t *g,\n                          const..."}, {"kind": "function", "line": 485, "name": "ext4_list", "signature": "int ext4_list(const char *imgpath, const char *dirpath,\n              char names[][EXT4_NAME_MAX ..."}, {"doc": "Split \"imgpath:extpath\" (first ':' wins; image names never carry * one). ext paths run deeper than FAT, hence the wider right side.", "kind": "function", "line": 580, "name": "ext_split", "signature": "static int ext_split(const char *path, char *img, char *extp)"}, {"kind": "function", "line": 585, "name": "ext4_vfs_open", "signature": "int ext4_vfs_open(const char *path, int mode, void **handle)"}, {"kind": "function", "line": 626, "name": "ext4_vfs_read", "signature": "int ext4_vfs_read(void *handle, void *buf, unsigned long pos,\n                  unsigned long len)"}, {"kind": "function", "line": 666, "name": "ext4_vfs_write", "signature": "int ext4_vfs_write(void *handle, const void *buf, unsigned long pos,\n                   unsigned ..."}, {"kind": "function", "line": 675, "name": "ext4_vfs_close", "signature": "int ext4_vfs_close(void *handle)"}, {"kind": "function", "line": 680, "name": "ext4_vfs_fstat", "signature": "int ext4_vfs_fstat(void *handle, unsigned long *size_out)"}, {"kind": "function", "line": 687, "name": "ext4_vfs_truncate", "signature": "int ext4_vfs_truncate(void *handle, unsigned long size)"}, {"doc": "Docstring: List one ext4 directory through the VFS verb. Same split-and-wrap shape as the FAT twin: bounded heap arrays behind * the existing list helper, names copied verbatim.", "kind": "function", "line": 696, "name": "ext4_vfs_readdir", "signature": "static int ext4_vfs_readdir(const char *path, vfs_dirent_t *ents,\n        int cap)"}, {"doc": "First Linux-native partition: MBR 0x83 first (proven by a superblock read), then a magic scan for superfloppy layouts. * Bounds and overflow discipline match the FAT prober.", "kind": "function", "line": 745, "name": "ext_mbr_entry", "signature": "static int ext_mbr_entry(const unsigned char *mbr, int idx,\n                         unsigned lon..."}, {"kind": "function", "line": 770, "name": "ext_scan_dev", "signature": "static int ext_scan_dev(unsigned long total_sec,\n                        unsigned long *base_out)"}, {"kind": "function", "line": 791, "name": "ext_dev_base", "signature": "long ext_dev_base(void)"}, {"kind": "function", "line": 168, "name": "ext_map_down", "signature": "static int ext_map_down(const fsimg_t *img, const ext_geo_t *g, const unsigned char *root, unsigned nent, unsigned long lblk, unsigned char *node);"}, {"kind": "function", "line": 352, "name": "only", "signature": "* listings only ('.' skipped, '..' refused). \"\" or \"/\" is root (2). */ static int ext_file_block(const fsimg_t *img, const ext_geo_t *g, const ext_ino_t *st, unsigned long lblk, unsigned char *blk, un"}, {"kind": "macro", "line": 18, "name": "EXT4_SUPER_OFF", "signature": "#define EXT4_SUPER_OFF"}, {"kind": "macro", "line": 19, "name": "EXT4_MAGIC", "signature": "#define EXT4_MAGIC"}, {"kind": "macro", "line": 20, "name": "EXT4_EXT_MAGIC", "signature": "#define EXT4_EXT_MAGIC"}, {"kind": "macro", "line": 21, "name": "EXT4_S_IFMT", "signature": "#define EXT4_S_IFMT"}, {"kind": "macro", "line": 22, "name": "EXT4_S_IFREG", "signature": "#define EXT4_S_IFREG"}, {"kind": "macro", "line": 23, "name": "EXT4_S_IFDIR", "signature": "#define EXT4_S_IFDIR"}, {"kind": "macro", "line": 24, "name": "EXT4_S_IFLNK", "signature": "#define EXT4_S_IFLNK"}, {"kind": "macro", "line": 25, "name": "EXT4_EXTENTS_FL", "signature": "#define EXT4_EXTENTS_FL"}, {"kind": "macro", "line": 26, "name": "EXT4_INDEX_FL", "signature": "#define EXT4_INDEX_FL"}, {"kind": "macro", "line": 27, "name": "EXT4_ENCRYPT_FL", "signature": "#define EXT4_ENCRYPT_FL"}, {"kind": "macro", "line": 28, "name": "EXT4_INLINE_FL", "signature": "#define EXT4_INLINE_FL"}, {"kind": "macro", "line": 29, "name": "EXT4_EXT_UNINIT", "signature": "#define EXT4_EXT_UNINIT"}, {"kind": "macro", "line": 30, "name": "EXT4_MBR_LINUX", "signature": "#define EXT4_MBR_LINUX"}]}, {"doc": "================================================================", "id": "fs/fat32.c", "kind": "module", "label": "fat32.c", "language": "c", "sha256": "9c3ecae23ebeec20", "symbol_count": 31, "symbols": [{"doc": "Parsed BPB plus derived geometry. secs = total data clusters + 2 (cluster numbers 0/1 are reserved), so a valid cluster is * 2 <= c < nclus + 2.", "kind": "struct", "line": 51, "name": "fat_geo_t"}, {"kind": "function", "line": 18, "name": "fat_ld16", "signature": "static unsigned fat_ld16(const unsigned char *p)"}, {"kind": "function", "line": 22, "name": "fat_ld32", "signature": "static unsigned fat_ld32(const unsigned char *p)"}, {"doc": "Open by resolved path: files first (a real file named hd0 keeps * working), the hd0 disk device only as a fallback.", "kind": "function", "line": 29, "name": "fat_img_open", "signature": "static int fat_img_open(const char *resolved, fsimg_t *img)"}, {"kind": "function", "line": 62, "name": "fat_parse_bpb", "signature": "static int fat_parse_bpb(const fsimg_t *img, fat_geo_t *g)"}, {"kind": "function", "line": 120, "name": "fat_mbr_is_fat", "signature": "static int fat_mbr_is_fat(unsigned char t)"}, {"kind": "function", "line": 192, "name": "fat_dev_base", "signature": "long fat_dev_base(void)"}, {"kind": "function", "line": 224, "name": "fat_clus_ok", "signature": "static int fat_clus_ok(const fat_geo_t *g, unsigned c)"}, {"doc": "One FAT32 entry (low 28 bits). Reads the 512 B sector holding it; the entry offset can never leave the image because the cluster is * range-checked first and the FAT region precedes data_off.", "kind": "function", "line": 231, "name": "fat_entry", "signature": "static int fat_entry(const fsimg_t *img, const fat_geo_t *g,\n                     unsigned clus, ..."}, {"kind": "function", "line": 248, "name": "fat_eoc", "signature": "static int fat_eoc(unsigned v)"}, {"doc": "FAT 8.3 forbids these in a query word (plus '/' and extra dots, handled by the splitter). Lowercase folds to upper like the * on-disk short names mtools writes.", "kind": "function", "line": 262, "name": "fat_badch", "signature": "static int fat_badch(char c)"}, {"doc": "Uppercase one 8.3 query word (\"name.ext\", \"name\", never \".ext\") into * padded 8+3 for raw comparison. Refuses overlong parts and paths.", "kind": "function", "line": 274, "name": "fat_qword", "signature": "static int fat_qword(const char *q, unsigned qlen, char name8[8],\n                     char ext3[3])"}, {"doc": "Match one 32-byte directory entry against padded 8+3. Skips * end/deleted/LFN/volume entries; the caller checks the subdir bit.", "kind": "function", "line": 305, "name": "fat_match", "signature": "static int fat_match(const unsigned char *de, const char name8[8],\n                     const cha..."}, {"doc": "Resolve a FAT path to its first cluster, size and subdir bit. Iterative over '/'-separated 8.3 words, depth-capped; '..' and * empty middles refuse. \"\" or \"/\" is the root directory itself.", "kind": "function", "line": 321, "name": "fat_resolve", "signature": "static int fat_resolve(const fsimg_t *img, const fat_geo_t *g,\n                       const char ..."}, {"kind": "function", "line": 421, "name": "fat32_list", "signature": "int fat32_list(const char *imgpath, const char *dirpath,\n               char names[][FAT32_NAME_M..."}, {"kind": "function", "line": 496, "name": "fat32_vfs_open", "signature": "int fat32_vfs_open(const char *path, int mode, void **handle)"}, {"doc": "h->sec_per_clus = g.sec_per_clus; h->rsvd_sec = g.rsvd_sec; h->num_fats = g.num_fats; h->fatsz_sec = g.fatsz_sec; h->root_clus = g.root_clus; h->data_off = (unsigned)g.data_off; h->nclus = g.nclus; h->start_clus = sc; h->file_size = sz; handle = h; return 0; } /* Fill the loopback backend and geometry views of an open handle.", "kind": "function", "line": 537, "name": "fat_views", "signature": "static void fat_views(const fat32_handle_t *h, fsimg_t *img,\n                      fat_geo_t *g)"}, {"doc": "Advance from the file's first cluster to the one holding `pos`, * step-bounded by the cluster count so a cyclic FAT terminates.", "kind": "function", "line": 556, "name": "fat_seek", "signature": "static int fat_seek(const fat32_handle_t *h, unsigned long pos,\n                    unsigned *clu..."}, {"kind": "function", "line": 581, "name": "fat32_vfs_read", "signature": "int fat32_vfs_read(void *handle, void *buf, unsigned long pos,\n                   unsigned long len)"}, {"kind": "function", "line": 621, "name": "fat32_vfs_write", "signature": "int fat32_vfs_write(void *handle, const void *buf, unsigned long pos,\n                    unsigne..."}, {"kind": "function", "line": 630, "name": "fat32_vfs_close", "signature": "int fat32_vfs_close(void *handle)"}, {"kind": "function", "line": 635, "name": "fat32_vfs_fstat", "signature": "int fat32_vfs_fstat(void *handle, unsigned long *size_out)"}, {"kind": "function", "line": 642, "name": "fat32_vfs_truncate", "signature": "int fat32_vfs_truncate(void *handle, unsigned long size)"}, {"kind": "macro", "line": 111, "name": "FAT_MBR_SIG_OFF", "signature": "#define FAT_MBR_SIG_OFF"}, {"kind": "macro", "line": 112, "name": "FAT_MBR_TAB_OFF", "signature": "#define FAT_MBR_TAB_OFF"}, {"kind": "macro", "line": 113, "name": "FAT_MBR_ENTRY_SZ", "signature": "#define FAT_MBR_ENTRY_SZ"}, {"kind": "macro", "line": 114, "name": "FAT_MBR_NENTRY", "signature": "#define FAT_MBR_NENTRY"}, {"kind": "macro", "line": 115, "name": "FAT_MBR_TYPE_OFF", "signature": "#define FAT_MBR_TYPE_OFF"}, {"kind": "macro", "line": 116, "name": "FAT_MBR_START_OFF", "signature": "#define FAT_MBR_START_OFF"}, {"kind": "macro", "line": 117, "name": "FAT_MBR_COUNT_OFF", "signature": "#define FAT_MBR_COUNT_OFF"}, {"kind": "macro", "line": 118, "name": "FAT_MBR_GPT_PROT", "signature": "#define FAT_MBR_GPT_PROT"}]}, {"doc": "================================================================", "id": "fs/fsimg.c", "kind": "module", "label": "fsimg.c", "language": "c", "sha256": "aa8d2d36a200d8ac", "symbol_count": 5, "symbols": [{"kind": "function", "line": 15, "name": "fsimg_open_file", "signature": "int fsimg_open_file(const char *resolved, fsimg_t *img)"}, {"kind": "function", "line": 51, "name": "fsimg_open_dev", "signature": "int fsimg_open_dev(unsigned long base_lba, unsigned long nsec,\n                   fsimg_t *img)"}, {"doc": "Docstring: Sector reads off the active backend through the block layer, so a device image on USB reads from USB. The scratch is heap, never the caller's stack: the USB backend hands the buffer to the controller as a * physical address, which a stack address is not.", "kind": "function", "line": 72, "name": "fsimg_dev_read", "signature": "static int fsimg_dev_read(const fsimg_t *img, unsigned long off,\n                          void *..."}, {"kind": "function", "line": 96, "name": "fsimg_read", "signature": "int fsimg_read(const fsimg_t *img, unsigned long off, void *buf,\n               unsigned long len)"}, {"kind": "function", "line": 112, "name": "fsimg_split", "signature": "int fsimg_split(const char *path, char *left, unsigned llen,\n                char *right, unsigne..."}]}, {"doc": "================================================================", "id": "fs/kfile.c", "kind": "module", "label": "kfile.c", "language": "c", "sha256": "e619a607f0a7a806", "symbol_count": 31, "symbols": [{"kind": "function", "line": 15, "name": "kfile_stdin", "signature": "KFILE *kfile_stdin(void)"}, {"kind": "function", "line": 16, "name": "kfile_stdout", "signature": "KFILE *kfile_stdout(void)"}, {"kind": "function", "line": 17, "name": "kfile_stderr", "signature": "KFILE *kfile_stderr(void)"}, {"kind": "function", "line": 28, "name": "recovery", "signature": "* halts the machine with no recovery (the DOOM ABI-drift black screen),\n * so every public KFILE ..."}, {"kind": "function", "line": 33, "name": "kfile_corrupt", "signature": "static int kfile_corrupt(const KFILE *f)"}, {"kind": "function", "line": 66, "name": "fs_take", "signature": "static inline void fs_take(irqflags_t *flags)"}, {"kind": "function", "line": 70, "name": "fs_drop", "signature": "static inline void fs_drop(irqflags_t flags)"}, {"doc": "Docstring: Create a connected pipe pair sharing one ring. The read end drains, the write end appends; the ring (and its refcount) dies with the last closed end. Fail-closed: any allocation failure frees * what was taken and returns -1 with both outs zeroed.", "kind": "function", "line": 78, "name": "kpipe_pair", "signature": "int kpipe_pair(KFILE **rend_out, KFILE **wend_out)"}, {"doc": "open (retry later, EAGAIN-style), false on EOF, on the write end, or on any non-pipe file. Lets the syscall layer tell \"empty\" from EOF, * which kfread alone reports as 0 items in both cases. int kpipe_empty_wopen(KFILE *f) { irqflags_t flags; int r = 0; if (!f || !f->is_pipe || f->pipe_write || !f->pring) return 0; fs_take(&flags); r = (f->pring->count == 0u && f->pring->wopen) ? 1 : 0; fs_drop(flags); return r; } /** Docstring: Snapshot a pipe's ring under fs_lock (see kernel.h).", "kind": "function", "line": 130, "name": "kpipe_state", "signature": "int kpipe_state(KFILE *f, unsigned *avail, unsigned *space, int *wopen, int *ropen)"}, {"doc": "Docstring: New eventfd description with counter initval. NULL on OOM * or an initial value past KEVENT_MAX.", "kind": "function", "line": 148, "name": "kevent_create", "signature": "KFILE *kevent_create(unsigned long long initval, int semaphore)"}, {"doc": "KFILE *f; if (initval > KEVENT_MAX) return 0; f = kmalloc(sizeof(KFILE)); if (!f) return 0; kmemset(f, 0, sizeof(KFILE)); f->is_eventfd = 1; f->efd_semaphore = semaphore ? 1 : 0; f->efd_count = initval; f->minifs_ino = -1; f->ref = 1; return f; } /** Docstring: Take the counter (or 1 in semaphore mode). -EAGAIN at 0.", "kind": "function", "line": 163, "name": "kevent_read", "signature": "long kevent_read(KFILE *f, unsigned long long *out)"}, {"doc": "irqflags_t flags; long rc = -11; if (!f || !f->is_eventfd) return -22; if (v == ~0ULL) return -22; fs_take(&flags); if (v <= KEVENT_MAX - f->efd_count) { f->efd_count += v; rc = 0; } fs_drop(flags); return rc; } /** Docstring: 1 when a read would not block.", "kind": "function", "line": 199, "name": "kevent_readable", "signature": "int kevent_readable(KFILE *f)"}, {"doc": "if (v <= KEVENT_MAX - f->efd_count) { f->efd_count += v; rc = 0; } fs_drop(flags); return rc; } /** Docstring: 1 when a read would not block. int kevent_readable(KFILE *f) { return f && f->is_eventfd && f->efd_count != 0ULL; } /** Docstring: 1 when a write of 1 would not block.", "kind": "function", "line": 204, "name": "kevent_writable", "signature": "int kevent_writable(KFILE *f)"}, {"doc": "return rc; } /** Docstring: 1 when a read would not block. int kevent_readable(KFILE *f) { return f && f->is_eventfd && f->efd_count != 0ULL; } /** Docstring: 1 when a write of 1 would not block. int kevent_writable(KFILE *f) { return f && f->is_eventfd && f->efd_count < KEVENT_MAX; } /** Docstring: True when f is the write end of a pipe.", "kind": "function", "line": 209, "name": "kpipe_is_write_end", "signature": "int kpipe_is_write_end(KFILE *f)"}, {"doc": "Docstring: Grow a pipe ring buffer, linearizing wrapped bytes first. Returns 0 on success, -1 past PIPE_CAP_MAX or on OOM. The ring keeps * its readable bytes in order; only the capacity changes.", "kind": "function", "line": 216, "name": "kpipe_grow", "signature": "static int kpipe_grow(pipe_ring_t *ring)"}, {"doc": "Directory open for getdents64 (kernel/syscalls.c 217): kfopen refuses directories, so open(2) on one lands here. The handle stores the resolved path (with the trailing slash the listing walks) and the * next-entry index; everything else is enumerated on demand.", "kind": "function", "line": 243, "name": "kfopen_dir", "signature": "KFILE *kfopen_dir(const char *resolved)"}, {"kind": "function", "line": 264, "name": "kfopen", "signature": "KFILE *kfopen(const char *path, const char *mode)"}, {"doc": "True when `dst` can live on MiniFS: no directory part (root), or its * parent resolves there.", "kind": "function", "line": 361, "name": "fs_rename_on_minifs", "signature": "static int fs_rename_on_minifs(const char *dst)"}, {"kind": "function", "line": 379, "name": "directory", "signature": "* empty directory by a directory (-20/-21 for a kind mismatch, -39 for a\n * non-empty directory)...."}, {"kind": "function", "line": 432, "name": "kfclose", "signature": "int kfclose(KFILE *f)"}, {"kind": "function", "line": 477, "name": "kfgetc", "signature": "int kfgetc(KFILE *f)"}, {"kind": "function", "line": 518, "name": "kfgets", "signature": "char *kfgets(char *buf, int size, KFILE *f)"}, {"kind": "function", "line": 532, "name": "kfungetc", "signature": "int kfungetc(int c, KFILE *f)"}, {"kind": "function", "line": 539, "name": "kfread", "signature": "unsigned long kfread(void *ptr, unsigned long size, unsigned long n, KFILE *f)"}, {"kind": "function", "line": 585, "name": "kfwrite", "signature": "unsigned long kfwrite(const void *ptr, unsigned long size, unsigned long n, KFILE *f)"}, {"kind": "function", "line": 651, "name": "kfseek", "signature": "int kfseek(KFILE *f, long offset, int whence)"}, {"kind": "function", "line": 672, "name": "kftell", "signature": "long kftell(KFILE *f)"}, {"kind": "function", "line": 676, "name": "kfflush", "signature": "int kfflush(KFILE *f)"}, {"kind": "function", "line": 702, "name": "kfputs", "signature": "int kfputs(const char *s, KFILE *f)"}, {"kind": "function", "line": 708, "name": "kfputc", "signature": "int kfputc(int c, KFILE *f)"}, {"kind": "function", "line": 713, "name": "krewind", "signature": "void krewind(KFILE *f)"}]}, {"doc": "MiniFS: minimal Unix-like filesystem for MiniOS.", "id": "fs/minifs.c", "kind": "module", "label": "minifs.c", "language": "c", "sha256": "8de44a86e589f7da", "symbol_count": 67, "symbols": [{"doc": "unsigned int *phys_block); static unsigned char *blk_new(void); static void blk_free(unsigned char *b); static unsigned int minifs_crc32(const void *data, unsigned int len); int minifs_resolve_path(const char *path); static MiniFSSuper fs_sb; static unsigned char *fs_ibitmap; static unsigned char *fs_bbitmap; static unsigned int fs_lba_start; static unsigned int fs_next_txn; static int fs_mounted; /* ---- Compression wrappers ----", "kind": "function", "line": 35, "name": "minifs_compress", "signature": "unsigned int minifs_compress(const void *src, unsigned int src_len,\n                             ..."}, {"kind": "function", "line": 46, "name": "minifs_decompress", "signature": "unsigned int minifs_decompress(const void *src, unsigned int src_len,\n                           ..."}, {"kind": "function", "line": 57, "name": "minifs_crc16", "signature": "static unsigned short minifs_crc16(const void *data, unsigned int len)"}, {"kind": "function", "line": 69, "name": "minifs_crc32", "signature": "static unsigned int minifs_crc32(const void *data, unsigned int len)"}, {"kind": "function", "line": 81, "name": "roundup4", "signature": "static unsigned int roundup4(unsigned int v)"}, {"kind": "function", "line": 83, "name": "div_round_up", "signature": "static unsigned int div_round_up(unsigned int n, unsigned int d)"}, {"kind": "function", "line": 92, "name": "returns", "signature": "* overflowed the slot and smashed returns (measured ring-0 #UD on\n * lua->lua->cp). Every scratch..."}, {"kind": "function", "line": 100, "name": "blk_free", "signature": "static void blk_free(unsigned char *b)"}, {"kind": "function", "line": 107, "name": "fs_write_super", "signature": "static int fs_write_super(void)"}, {"kind": "function", "line": 127, "name": "instead", "signature": "* kernel stored the same crc at offset 76 instead (byte order the old\n * write path used), so a r..."}, {"kind": "function", "line": 142, "name": "fs_inode_check", "signature": "static int fs_inode_check(const MiniFSInode *in)"}, {"kind": "function", "line": 167, "name": "fs_read_inode", "signature": "static int fs_read_inode(unsigned int num, MiniFSInode *out)"}, {"kind": "function", "line": 179, "name": "fs_write_inode", "signature": "static int fs_write_inode(unsigned int num, const MiniFSInode *in)"}, {"kind": "function", "line": 201, "name": "bm_test", "signature": "static int bm_test(unsigned char *bm, unsigned int bit)"}, {"kind": "function", "line": 205, "name": "bm_set", "signature": "static void bm_set(unsigned char *bm, unsigned int bit)"}, {"kind": "function", "line": 209, "name": "bm_clear", "signature": "static void bm_clear(unsigned char *bm, unsigned int bit)"}, {"kind": "function", "line": 215, "name": "minifs_alloc_block", "signature": "int minifs_alloc_block(void)"}, {"kind": "function", "line": 232, "name": "minifs_free_block", "signature": "void minifs_free_block(unsigned int block)"}, {"kind": "function", "line": 240, "name": "minifs_alloc_inode", "signature": "int minifs_alloc_inode(void)"}, {"kind": "function", "line": 252, "name": "minifs_free_inode", "signature": "void minifs_free_inode(int num)"}, {"kind": "function", "line": 260, "name": "minifs_inode_get_block", "signature": "int minifs_inode_get_block(MiniFSInode *inode, unsigned int logblk,\n                           un..."}, {"kind": "function", "line": 289, "name": "fs_inode_set_block", "signature": "static int fs_inode_set_block(MiniFSInode *inode, unsigned int logblk,\n                          ..."}, {"kind": "function", "line": 343, "name": "minifs_inode_alloc_block", "signature": "int minifs_inode_alloc_block(MiniFSInode *inode, unsigned int logblk)"}, {"kind": "function", "line": 364, "name": "fs_inode_free_all_blocks", "signature": "static void fs_inode_free_all_blocks(MiniFSInode *inode)"}, {"kind": "function", "line": 446, "name": "journal_load_super", "signature": "static void journal_load_super(void)"}, {"kind": "function", "line": 464, "name": "journal_save_super", "signature": "static void journal_save_super(unsigned int state)"}, {"kind": "function", "line": 478, "name": "journal_save_entries", "signature": "static void journal_save_entries(void)"}, {"kind": "function", "line": 495, "name": "minifs_journal_begin", "signature": "void minifs_journal_begin(unsigned int txn_id)"}, {"doc": "Deprecated alias: historically took an inode number (wrong layer). * Takes a physical block now; prefer minifs_journal_touch.", "kind": "function", "line": 504, "name": "minifs_journal_add_block", "signature": "void minifs_journal_add_block(unsigned int block)"}, {"doc": "Pre-write barrier: persist the entry array and mark the journal DIRTY before any protected data block is modified. A crash after this * point replays the undo log in minifs_journal_recover.", "kind": "function", "line": 511, "name": "minifs_journal_commit", "signature": "int minifs_journal_commit(unsigned int txn_id)"}, {"doc": "Post-write barrier: the protected writes are all on disk, so the undo * log is no longer needed.", "kind": "function", "line": 521, "name": "minifs_journal_clear", "signature": "void minifs_journal_clear(void)"}, {"doc": "Error path after the DIRTY barrier: restore every snapshotted block from the journal data area, then clear. Only undoes blocks recorded * in the live in-RAM entry array.", "kind": "function", "line": 531, "name": "minifs_journal_abort", "signature": "void minifs_journal_abort(void)"}, {"kind": "function", "line": 556, "name": "first", "signature": "* keep the first (oldest) snapshot. */\nvoid minifs_journal_touch(unsigned int phys)"}, {"doc": "Mount-time recovery: replays the undo log left by a crash between the DIRTY barrier and the CLEAN mark. Every on-disk field is hostile data (a crafted image must not cause arbitrary block overwrites): super checksum, entry count bound, per-entry checksum and the target block range are all validated; invalid entries are skipped and * counted, never applied.", "kind": "function", "line": 597, "name": "minifs_journal_recover", "signature": "void minifs_journal_recover(void)"}, {"kind": "function", "line": 683, "name": "fs_namecmp", "signature": "static int fs_namecmp(const char *a, unsigned char alen, const char *b)"}, {"kind": "function", "line": 692, "name": "minifs_dir_lookup", "signature": "int minifs_dir_lookup(int dir_ino, const char *name)"}, {"kind": "function", "line": 722, "name": "minifs_dir_add_entry", "signature": "int minifs_dir_add_entry(int dir_ino, const char *name, int child_ino,\n                          ..."}, {"kind": "function", "line": 860, "name": "minifs_dir_remove_entry", "signature": "int minifs_dir_remove_entry(int dir_ino, const char *name)"}, {"kind": "function", "line": 891, "name": "minifs_dir_read", "signature": "int minifs_dir_read(int dir_ino, int index, MiniFSDirEntry *out, char *name_out)"}, {"kind": "function", "line": 941, "name": "minifs_resolve_path", "signature": "int minifs_resolve_path(const char *path)"}, {"kind": "function", "line": 974, "name": "minifs_create", "signature": "int minifs_create(const char *path, unsigned short mode)"}, {"kind": "function", "line": 1027, "name": "minifs_mkdir", "signature": "int minifs_mkdir(const char *path, unsigned short mode)"}, {"kind": "function", "line": 1076, "name": "minifs_unlink", "signature": "int minifs_unlink(const char *path)"}, {"doc": "Split a resolved path into its parent directory path (\"\" for root) and its leaf name. Single copy for minifs_rename; create/mkdir/unlink keep * their inline splits untouched.", "kind": "function", "line": 1119, "name": "minifs_split_parent", "signature": "static int minifs_split_parent(const char *path, char *parent_out,\n                              ..."}, {"doc": "An entry removal only clears the record in place, so a directory's size never shrinks. Emptiness must therefore be decided by scanning for a live inode; trusting size kept every directory that ever held a * file non-empty and broke nested shutil.rmtree.", "kind": "function", "line": 1148, "name": "minifs_dir_is_empty", "signature": "static int minifs_dir_is_empty(int dir_ino)"}, {"kind": "function", "line": 1175, "name": "minifs_rename", "signature": "int minifs_rename(const char *oldpath, const char *newpath)"}, {"kind": "function", "line": 1225, "name": "minifs_rmdir", "signature": "int minifs_rmdir(const char *path)"}, {"kind": "function", "line": 1266, "name": "minifs_read", "signature": "int minifs_read(int inode_num, void *buf, unsigned int offset, unsigned int len)"}, {"kind": "function", "line": 1337, "name": "minifs_write", "signature": "int minifs_write(int inode_num, const void *buf, unsigned int offset,\n                 unsigned i..."}, {"kind": "function", "line": 1424, "name": "minifs_truncate", "signature": "int minifs_truncate(int inode_num, unsigned int new_size)"}, {"kind": "function", "line": 1441, "name": "minifs_stat", "signature": "int minifs_stat(int inode_num, MiniFSInode *out)"}, {"kind": "function", "line": 1445, "name": "minifs_access", "signature": "int minifs_access(const char *path)"}, {"kind": "function", "line": 1451, "name": "minifs_init", "signature": "void minifs_init(void)"}, {"kind": "function", "line": 1459, "name": "minifs_get_lba_start", "signature": "unsigned int minifs_get_lba_start(void)"}, {"kind": "function", "line": 1460, "name": "minifs_is_mounted", "signature": "int minifs_is_mounted(void)"}, {"doc": "Boot-time exemption from the -Wframe-larger-than=2048 gate: mount and mkfs run once on deep boot stacks, never on 16 KB proc slots, so their single 4 KB probe scratch is safe and keeps heap pressure off the * early boot path. pragma GCC diagnostic push pragma GCC diagnostic ignored \"-Wframe-larger-than=\"", "kind": "function", "line": 1468, "name": "minifs_mount", "signature": "int minifs_mount(void)"}, {"kind": "function", "line": 1618, "name": "minifs_sync", "signature": "int minifs_sync(void)"}, {"kind": "function", "line": 1633, "name": "minifs_file_open", "signature": "MiniFSFile *minifs_file_open(int inode_num, int flags)"}, {"kind": "function", "line": 1647, "name": "minifs_file_close", "signature": "int minifs_file_close(MiniFSFile *f)"}, {"kind": "function", "line": 1654, "name": "minifs_get_total_blocks", "signature": "unsigned int minifs_get_total_blocks(void)"}, {"doc": "} int minifs_file_close(MiniFSFile *f) { if (!f) return 0; if (f->inode_cache) kfree(f->inode_cache); kfree(f); return 0; } unsigned int minifs_get_total_blocks(void) { return fs_sb.total_blocks; } /** Docstring: Filesystem usage snapshot for the mem builtin.", "kind": "function", "line": 1659, "name": "minifs_usage", "signature": "void minifs_usage(unsigned int *free_b, unsigned int *total_b,\n                  unsigned int *fr..."}, {"kind": "function", "line": 16, "name": "minifs_journal_touch", "signature": "void minifs_journal_touch(unsigned int phys);"}, {"kind": "function", "line": 22, "name": "blk_new", "signature": "static unsigned char *blk_new(void);"}, {"kind": "function", "line": 555, "name": "blocks", "signature": "* blocks (self-protection);"}, {"kind": "macro", "line": 13, "name": "DE_NAME", "signature": "#define DE_NAME(de)"}, {"kind": "macro", "line": 14, "name": "DE_NAME_W", "signature": "#define DE_NAME_W(de)"}, {"kind": "macro", "line": 130, "name": "MINIFS_INODE_CRC_OFF", "signature": "#define MINIFS_INODE_CRC_OFF"}]}, {"doc": "Docstring: fs/pcache.c -- page cache store for MiniFS (T5 slice 1).", "id": "fs/pcache.c", "kind": "module", "label": "pcache.c", "language": "c", "sha256": "85ef5b2c0e8ff3f7", "symbol_count": 16, "symbols": [{"kind": "struct", "line": 17, "name": "pcache_slot_t"}, {"kind": "function", "line": 42, "name": "pcache_init", "signature": "void pcache_init(void)"}, {"kind": "function", "line": 54, "name": "pcache_lookup", "signature": "int pcache_lookup(int ino, unsigned index)"}, {"kind": "function", "line": 71, "name": "pcache_get", "signature": "int pcache_get(int ino, unsigned index, int *is_new)"}, {"doc": "Docstring: Publish a privately filled page into the cache atomically. Copies data into a reserved slot and marks it valid under one lock hold, or refs the slot a racing publisher won first; either way the returned slot is complete before any other holder can see it. Returns the slot (ref 1 for this mapping) or -1 when no slot is free, in which case the caller maps its * private page and takes no ref.", "kind": "function", "line": 128, "name": "pcache_publish", "signature": "int pcache_publish(int ino, unsigned index, const unsigned char *data)"}, {"kind": "function", "line": 179, "name": "pcache_put", "signature": "void pcache_put(int slot)"}, {"doc": "Docstring: Take one more ref on a cached page without allocating. Fork uses this for every file-backed page the child inherits, so the child teardown drops exactly what the copy added. Returns the * slot or -1 when the page is not cached.", "kind": "function", "line": 192, "name": "pcache_ref", "signature": "int pcache_ref(int ino, unsigned index)"}, {"doc": "Docstring: Drop the ref a mapping holds on one cached page. The munmap and teardown walks derive (ino, index) from the VMA node and call this per page; unknown pages are a silent no-op so a partially populated mapping unmaps cleanly. Prefer put_if below wherever the PTE is at hand: blind drops can steal another * mapping's ref after a private fallback.", "kind": "function", "line": 216, "name": "pcache_unmap", "signature": "void pcache_unmap(int ino, unsigned index)"}, {"doc": "Docstring: Drop the ref a mapping holds on one cached page. The munmap and teardown walks derive (ino, index) from the VMA node and call this per page; unknown pages are a silent no-op so a partially populated mapping unmaps cleanly. Prefer put_if below wherever the PTE is at hand: blind drops can steal another * mapping's ref after a private fallback. void pcache_unmap(int ino, unsigned index) { int slot = pcache_lookup(ino, index); if (slot >= 0) pcache_put(slot); } /** Docstring: Slot base address for phys comparisons.", "kind": "function", "line": 222, "name": "pcache_slot_phys", "signature": "static unsigned long pcache_slot_phys(int slot)"}, {"kind": "function", "line": 230, "name": "match", "signature": "* a phys match (owned, ref dropped unless already zero), 0\n * otherwise. */\nint pcache_put_if(int..."}, {"doc": "Docstring: Take one more ref only when the cached page is the exact phys the caller shares. Fork proves sharing through the parent PTE before inheriting, so a stale VMA tag never pins a * recycled slot. Returns the slot or -1.", "kind": "function", "line": 255, "name": "pcache_ref_if", "signature": "int pcache_ref_if(int ino, unsigned index, unsigned long phys)"}, {"doc": "Docstring: True when phys is a cache pool page. The teardown sweeper skips those instead of freeing pool memory as if it were * a private data page.", "kind": "function", "line": 277, "name": "pcache_owns_phys", "signature": "int pcache_owns_phys(unsigned long phys)"}, {"kind": "function", "line": 285, "name": "pcache_data", "signature": "unsigned char *pcache_data(int slot)"}, {"kind": "function", "line": 291, "name": "pcache_mark_dirty", "signature": "void pcache_mark_dirty(int slot)"}, {"kind": "function", "line": 299, "name": "pcache_invalidate_ino", "signature": "void pcache_invalidate_ino(int ino)"}, {"kind": "function", "line": 314, "name": "pcache_stats", "signature": "void pcache_stats(unsigned long *pages_out, unsigned long *hits_out,\n        unsigned long *miss_..."}]}, {"doc": "================================================================", "id": "fs/ramdisk.c", "kind": "module", "label": "ramdisk.c", "language": "c", "sha256": "1d205c506cf250dd", "symbol_count": 25, "symbols": [{"kind": "struct", "line": 26, "name": "RDSuper"}, {"kind": "function", "line": 37, "name": "ramdisk_reserve", "signature": "static int ramdisk_reserve(unsigned long want)"}, {"kind": "function", "line": 55, "name": "ramdisk_setup_from", "signature": "void ramdisk_setup_from(void *data, unsigned size)"}, {"kind": "function", "line": 128, "name": "ramdisk_init", "signature": "void ramdisk_init(void)"}, {"kind": "function", "line": 145, "name": "ramdisk_open", "signature": "RDFile *ramdisk_open(const char *name)"}, {"kind": "function", "line": 155, "name": "ramdisk_read", "signature": "int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)"}, {"kind": "function", "line": 163, "name": "ramdisk_write", "signature": "int ramdisk_write(RDFile *f, const void *buf, unsigned offset, unsigned len)"}, {"kind": "function", "line": 171, "name": "ramdisk_create", "signature": "RDFile *ramdisk_create(const char *name, unsigned size)"}, {"kind": "function", "line": 185, "name": "ramdisk_resize", "signature": "int ramdisk_resize(RDFile *f, unsigned newsize)"}, {"kind": "function", "line": 222, "name": "ramdisk_list", "signature": "int ramdisk_list(RDFile **out, int max)"}, {"kind": "function", "line": 230, "name": "ramdisk_count", "signature": "int ramdisk_count(void)"}, {"doc": "int ramdisk_list(RDFile **out, int max) { if (!rd) return 0; int n = (int)rd->count < max ? (int)rd->count : max; unsigned i; for (i = 0; i < (unsigned)n; i++) out[i] = &rd->files[i]; return n; } int ramdisk_count(void) { if (!rd) return 0; return (int)rd->count; } /** Docstring: Ramdisk usage snapshot for the mem builtin.", "kind": "function", "line": 236, "name": "ramdisk_usage", "signature": "void ramdisk_usage(unsigned *used, unsigned *cap, unsigned *max)"}, {"kind": "function", "line": 242, "name": "ramdisk_file_name", "signature": "const char *ramdisk_file_name(int idx)"}, {"kind": "function", "line": 247, "name": "ramdisk_delete", "signature": "int ramdisk_delete(RDFile *f)"}, {"kind": "function", "line": 269, "name": "ramdisk_rename", "signature": "int ramdisk_rename(const char *oldname, const char *newname)"}, {"kind": "macro", "line": 15, "name": "RD_MAGIC", "signature": "#define RD_MAGIC"}, {"kind": "macro", "line": 16, "name": "RD_HEADER_SIZE", "signature": "#define RD_HEADER_SIZE"}, {"kind": "macro", "line": 17, "name": "RD_ENTRY_SIZE", "signature": "#define RD_ENTRY_SIZE"}, {"kind": "macro", "line": 18, "name": "RD_DATA_MIN", "signature": "#define RD_DATA_MIN"}, {"kind": "macro", "line": 19, "name": "RD_DATA_SPARE", "signature": "#define RD_DATA_SPARE"}, {"kind": "macro", "line": 20, "name": "RD_ENTRY_RAW_OFF", "signature": "#define RD_ENTRY_RAW_OFF"}, {"kind": "macro", "line": 21, "name": "RD_ENTRY_STO_OFF", "signature": "#define RD_ENTRY_STO_OFF"}, {"kind": "macro", "line": 22, "name": "RD_ENTRY_OFF_OFF", "signature": "#define RD_ENTRY_OFF_OFF"}, {"kind": "macro", "line": 23, "name": "RD_ENTRY_FLG_OFF", "signature": "#define RD_ENTRY_FLG_OFF"}, {"kind": "macro", "line": 24, "name": "RD_FLAG_DEFLATE", "signature": "#define RD_FLAG_DEFLATE"}]}, {"doc": "================================================================", "id": "fs/vfs.c", "kind": "module", "label": "vfs.c", "language": "c", "sha256": "ad1559b211ec6bb4", "symbol_count": 44, "symbols": [{"kind": "struct", "line": 10, "name": "vfs_mount_t"}, {"kind": "struct", "line": 196, "name": "ramdisk_handle_t"}, {"kind": "struct", "line": 346, "name": "minifs_handle_t"}, {"kind": "struct", "line": 461, "name": "mem_file_t"}, {"kind": "function", "line": 22, "name": "vfs_init", "signature": "void vfs_init(void)"}, {"kind": "function", "line": 27, "name": "vfs_register", "signature": "int vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver)"}, {"kind": "function", "line": 62, "name": "vfs_unregister", "signature": "int vfs_unregister(const char *prefix)"}, {"kind": "function", "line": 106, "name": "vfs_open", "signature": "int vfs_open(const char *path, int mode, vfs_file_t *f)"}, {"kind": "function", "line": 160, "name": "taken", "signature": "* refcount is taken (ops tables are static, never freed), so a\n * listing can never pin an unmoun..."}, {"kind": "function", "line": 212, "name": "ramdisk_vfs_open", "signature": "static int ramdisk_vfs_open(const char *path, int mode, void **handle)"}, {"kind": "function", "line": 238, "name": "ramdisk_vfs_read", "signature": "static int ramdisk_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)"}, {"kind": "function", "line": 247, "name": "ramdisk_vfs_write", "signature": "static int ramdisk_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)"}, {"kind": "function", "line": 255, "name": "ramdisk_vfs_close", "signature": "static int ramdisk_vfs_close(void *handle)"}, {"kind": "function", "line": 261, "name": "ramdisk_vfs_fstat", "signature": "static int ramdisk_vfs_fstat(void *handle, unsigned long *size_out)"}, {"kind": "function", "line": 268, "name": "ramdisk_vfs_truncate", "signature": "static int ramdisk_vfs_truncate(void *handle, unsigned long size)"}, {"doc": "Docstring: List ramdisk leaves under dir (\"\" or \"/\" is root). Flat names with \"/\" as data split into leaves and first-level subdirectories, deduplicated, so \"src/sub/x\" contributes \"sub\" * once and \"src/\" contributes \"src\" as a directory.", "kind": "function", "line": 278, "name": "ramdisk_vfs_readdir", "signature": "static int ramdisk_vfs_readdir(const char *path, vfs_dirent_t *ents,\n        int cap)"}, {"kind": "function", "line": 351, "name": "minifs_vfs_open", "signature": "static int minifs_vfs_open(const char *path, int mode, void **handle)"}, {"kind": "function", "line": 379, "name": "minifs_vfs_read", "signature": "static int minifs_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)"}, {"kind": "function", "line": 388, "name": "minifs_vfs_write", "signature": "static int minifs_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)"}, {"kind": "function", "line": 396, "name": "minifs_vfs_close", "signature": "static int minifs_vfs_close(void *handle)"}, {"kind": "function", "line": 402, "name": "minifs_vfs_fstat", "signature": "static int minifs_vfs_fstat(void *handle, unsigned long *size_out)"}, {"kind": "function", "line": 409, "name": "minifs_vfs_truncate", "signature": "static int minifs_vfs_truncate(void *handle, unsigned long size)"}, {"kind": "function", "line": 470, "name": "mem_lookup", "signature": "static int mem_lookup(const char *path)"}, {"kind": "function", "line": 478, "name": "mem_open", "signature": "static int mem_open(const char *path, int mode, void **handle)"}, {"kind": "function", "line": 498, "name": "mem_slot", "signature": "static int mem_slot(void *handle)"}, {"kind": "function", "line": 505, "name": "mem_read", "signature": "static int mem_read(void *handle, void *buf, unsigned long pos, unsigned long len)"}, {"kind": "function", "line": 515, "name": "mem_write", "signature": "static int mem_write(void *handle, const void *buf, unsigned long pos, unsigned long len)"}, {"kind": "function", "line": 526, "name": "mem_close", "signature": "static int mem_close(void *handle)"}, {"kind": "function", "line": 530, "name": "mem_fstat", "signature": "static int mem_fstat(void *handle, unsigned long *size_out)"}, {"kind": "function", "line": 537, "name": "mem_truncate", "signature": "static int mem_truncate(void *handle, unsigned long size)"}, {"doc": "Docstring: List the flat mem: namespace (root only, files only). * Anything below root refuses: there are no directories here.", "kind": "function", "line": 548, "name": "mem_readdir", "signature": "static int mem_readdir(const char *path, vfs_dirent_t *ents, int cap)"}, {"kind": "function", "line": 580, "name": "fs_resolve", "signature": "int fs_resolve(const char *path, char *out, unsigned cap)"}, {"kind": "function", "line": 613, "name": "fs_dir_exists", "signature": "int fs_dir_exists(const char *dir)"}, {"kind": "function", "line": 638, "name": "fs_is_dir", "signature": "int fs_is_dir(const char *resolved)"}, {"kind": "function", "line": 651, "name": "minifs_mkdir_p", "signature": "int minifs_mkdir_p(const char *resolved)"}, {"kind": "function", "line": 674, "name": "vfs_register_builtins", "signature": "void vfs_register_builtins(void)"}, {"kind": "function", "line": 688, "name": "open", "signature": "* open (loopback image file plus in-image path), so one registration\n * serves every image. */\nin..."}, {"kind": "function", "line": 709, "name": "vfs_read", "signature": "int vfs_read(vfs_file_t *f, void *buf, unsigned long len)"}, {"kind": "function", "line": 718, "name": "vfs_write", "signature": "int vfs_write(vfs_file_t *f, const void *buf, unsigned long len)"}, {"kind": "function", "line": 734, "name": "vfs_close", "signature": "int vfs_close(vfs_file_t *f)"}, {"kind": "function", "line": 752, "name": "vfs_fstat", "signature": "int vfs_fstat(vfs_file_t *f, unsigned long *size_out)"}, {"kind": "macro", "line": 457, "name": "MEM_FILES", "signature": "#define MEM_FILES"}, {"kind": "macro", "line": 458, "name": "MEM_FNAME", "signature": "#define MEM_FNAME"}, {"kind": "macro", "line": 459, "name": "MEM_FSIZE", "signature": "#define MEM_FSIZE"}]}, {"doc": "zip.c — the unzip/zip shell builtins over the miniz zip library.", "id": "fs/zip.c", "kind": "module", "label": "zip.c", "language": "c", "sha256": "48e0fcb80838da16", "symbol_count": 10, "symbols": [{"doc": "Read a whole file (ramdisk first, MiniFS fallback) into a fresh kernel buffer, growing until the read stops making progress. The buffer is bounded by the file size, so a hostile file cannot drive an oversized * allocation. Returns 0 on failure.", "kind": "function", "line": 25, "name": "zip_read_whole", "signature": "static unsigned char *zip_read_whole(const char *path, unsigned long *size)"}, {"kind": "function", "line": 50, "name": "marker", "signature": "* marker (trailing '/') is preserved by the caller, not here. */\nstatic int zip_sanitize_name(con..."}, {"doc": "Build the combined extraction path: destdir (already resolved, may be \"\") joined with the sanitized entry name. Returns 1 and fills `out` when the * path fits.", "kind": "function", "line": 79, "name": "zip_build_path", "signature": "static int zip_build_path(const char *destdir, const char *name, char *out)"}, {"doc": "Create every directory component of `dir` (a resolved, slash-separated name with no trailing '/'), including `dir` itself, as ramdisk directory * markers. Returns 1 on success; the root (empty) always succeeds.", "kind": "function", "line": 95, "name": "zip_ensure_dir_tree", "signature": "static int zip_ensure_dir_tree(const char *dir)"}, {"doc": "Extract one archive entry under destdir. Junk entries (empty or '.'-only * names) are skipped and count as success. Returns 1 on success.", "kind": "function", "line": 117, "name": "zip_do_entry", "signature": "static int zip_do_entry(mz_zip_archive *zip, mz_uint idx, const char *destdir)"}, {"doc": "if (!data) return 0; if (n != usize) { mz_free(data); return 0; } f = kfopen(resolved, \"w\"); if (!f) { mz_free(data); return 0; } rc = (kfwrite(data, 1, usize, f) == usize) ? 0 : -1; if (kfclose(f) != 0) rc = -1; mz_free(data); if (rc != 0) return 0; kprintf(\"  %-24s %lu bytes\\n\", resolved, usize); } return 1; } /* unzip <archive.zip> [dir]  — extract;  unzip -l <archive.zip> — list.", "kind": "function", "line": 176, "name": "shell_cmd_unzip", "signature": "void shell_cmd_unzip(int argc, char **argv)"}, {"doc": "zip <out.zip> <file...> — store each file (under its sanitized name) into * a new archive.", "kind": "function", "line": 254, "name": "shell_cmd_zip", "signature": "void shell_cmd_zip(int argc, char **argv)"}, {"kind": "function", "line": 8, "name": "root", "signature": "* names are hostile data: each is normalized to forward slashes and rejected * when it escapes the extraction root (absolute paths, '.'/'..' components, * empty names), so a crafted archive can never "}, {"kind": "function", "line": 18, "name": "mz_zip_writer_mem_ptr", "signature": "void *mz_zip_writer_mem_ptr(mz_zip_archive *pZip);"}, {"kind": "function", "line": 19, "name": "mz_zip_writer_mem_size", "signature": "size_t mz_zip_writer_mem_size(mz_zip_archive *pZip);"}]}, {"doc": "Docstring: abi.h -- Boot-time ABI manifest gate contract.", "id": "headers/abi.h", "kind": "module", "label": "abi.h", "language": "h", "sha256": "06b00001354c3fec", "symbol_count": 10, "symbols": [{"kind": "function", "line": 25, "name": "abi_verify", "signature": "int abi_verify(const char *text, long version, unsigned long checksum);"}, {"doc": "ifndef ABI_HOST_TEST", "kind": "function", "line": 28, "name": "abi_check_manifest", "signature": "int abi_check_manifest(void);"}, {"kind": "macro", "line": 14, "name": "ABI_H", "signature": "#define ABI_H"}, {"kind": "macro", "line": 16, "name": "ABI_OK", "signature": "#define ABI_OK"}, {"kind": "macro", "line": 17, "name": "ABI_NO_MANIFEST", "signature": "#define ABI_NO_MANIFEST"}, {"kind": "macro", "line": 18, "name": "ABI_BAD_FORMAT", "signature": "#define ABI_BAD_FORMAT"}, {"kind": "macro", "line": 19, "name": "ABI_VERSION_MISMATCH", "signature": "#define ABI_VERSION_MISMATCH"}, {"kind": "macro", "line": 20, "name": "ABI_CHECKSUM_MISMATCH", "signature": "#define ABI_CHECKSUM_MISMATCH"}, {"kind": "macro", "line": 22, "name": "ABI_MANIFEST_NAME", "signature": "#define ABI_MANIFEST_NAME"}, {"kind": "macro", "line": 23, "name": "ABI_MANIFEST_MAX", "signature": "#define ABI_MANIFEST_MAX"}]}, {"doc": "generated from ap_stub.bin - do not edit", "id": "headers/ap_stub.h", "kind": "module", "label": "ap_stub.h", "language": "h", "sha256": "ee411acb7da86cf0", "symbol_count": 0, "symbols": []}, {"doc": "bootdefs.h - centralized configuration for the MiniOS two-stage boot path.", "id": "headers/arch/x86/boot/bootdefs.h", "kind": "module", "label": "bootdefs.h", "language": "h", "sha256": "31813e1ae1e48397", "symbol_count": 157, "symbols": [{"kind": "function", "line": 196, "name": "address", "signature": "* address (below 1 MB so a real-mode SIPI can reach it) and executed by every * AP. It reuses the page tables and 64-bit GDT stage 2 built for the BSP. */ #define AP_STUB_ADDR 0x6000 #define GDT64_COD"}, {"kind": "macro", "line": 52, "name": "BOOTDEFS_H", "signature": "#define BOOTDEFS_H"}, {"kind": "macro", "line": 54, "name": "SECTOR_BYTES", "signature": "#define SECTOR_BYTES"}, {"kind": "macro", "line": 55, "name": "SECTOR_PARAGRAPH_SHIFT", "signature": "#define SECTOR_PARAGRAPH_SHIFT"}, {"kind": "macro", "line": 56, "name": "SECTOR_DWORD_SHIFT", "signature": "#define SECTOR_DWORD_SHIFT"}, {"kind": "macro", "line": 58, "name": "BOOT_SIGNATURE", "signature": "#define BOOT_SIGNATURE"}, {"kind": "macro", "line": 59, "name": "BOOT_SIGNATURE_BYTES", "signature": "#define BOOT_SIGNATURE_BYTES"}, {"kind": "macro", "line": 61, "name": "BOOT_SEG_NULL", "signature": "#define BOOT_SEG_NULL"}, {"kind": "macro", "line": 62, "name": "BOOT_STACK_TOP", "signature": "#define BOOT_STACK_TOP"}, {"kind": "macro", "line": 64, "name": "BOOT_DAP_ADDR", "signature": "#define BOOT_DAP_ADDR"}, {"kind": "macro", "line": 65, "name": "BOOT_DAP_SIZE", "signature": "#define BOOT_DAP_SIZE"}, {"kind": "macro", "line": 66, "name": "BOOT_DAP_OFF_COUNT", "signature": "#define BOOT_DAP_OFF_COUNT"}, {"kind": "macro", "line": 67, "name": "BOOT_DAP_OFF_OFFSET", "signature": "#define BOOT_DAP_OFF_OFFSET"}, {"kind": "macro", "line": 68, "name": "BOOT_DAP_OFF_SEGMENT", "signature": "#define BOOT_DAP_OFF_SEGMENT"}, {"kind": "macro", "line": 69, "name": "BOOT_DAP_OFF_LBA_LO", "signature": "#define BOOT_DAP_OFF_LBA_LO"}, {"kind": "macro", "line": 70, "name": "BOOT_DAP_OFF_LBA_HI", "signature": "#define BOOT_DAP_OFF_LBA_HI"}, {"kind": "macro", "line": 71, "name": "BOOT_DRIVE_ADDR", "signature": "#define BOOT_DRIVE_ADDR"}, {"kind": "macro", "line": 72, "name": "BOOT_KASLR_ADDR", "signature": "#define BOOT_KASLR_ADDR"}, {"kind": "macro", "line": 74, "name": "BOOT_STAGE2_LBA", "signature": "#define BOOT_STAGE2_LBA"}, {"kind": "macro", "line": 75, "name": "BOOT_STAGE2_SECTORS", "signature": "#define BOOT_STAGE2_SECTORS"}, {"kind": "macro", "line": 76, "name": "BOOT_STAGE2_ADDR", "signature": "#define BOOT_STAGE2_ADDR"}, {"kind": "macro", "line": 77, "name": "BOOT_STAGE2_SEG", "signature": "#define BOOT_STAGE2_SEG"}, {"kind": "macro", "line": 79, "name": "BOOT_KERNEL_LBA", "signature": "#define BOOT_KERNEL_LBA"}, {"kind": "macro", "line": 80, "name": "BOOT_KERNEL_BUF_ADDR", "signature": "#define BOOT_KERNEL_BUF_ADDR"}, {"kind": "macro", "line": 81, "name": "BOOT_KERNEL_BUF_SEG", "signature": "#define BOOT_KERNEL_BUF_SEG"}, {"kind": "macro", "line": 82, "name": "BOOT_KERNEL_PHYS_ADDR", "signature": "#define BOOT_KERNEL_PHYS_ADDR"}, {"kind": "macro", "line": 84, "name": "BOOT_CHUNK_SECTORS", "signature": "#define BOOT_CHUNK_SECTORS"}, {"kind": "macro", "line": 85, "name": "BOOT_BIOS_MAX_SECTORS", "signature": "#define BOOT_BIOS_MAX_SECTORS"}, {"kind": "macro", "line": 87, "name": "BOOT_PM_STACK_TOP", "signature": "#define BOOT_PM_STACK_TOP"}, {"kind": "macro", "line": 89, "name": "BOOT_SB16_DMA_ADDR", "signature": "#define BOOT_SB16_DMA_ADDR"}, {"kind": "macro", "line": 90, "name": "BOOT_SB16_DMA_BYTES", "signature": "#define BOOT_SB16_DMA_BYTES"}, {"kind": "macro", "line": 91, "name": "BOOT_PCM2_DMA_ADDR", "signature": "#define BOOT_PCM2_DMA_ADDR"}, {"kind": "macro", "line": 92, "name": "BOOT_PCM2_DMA_BYTES", "signature": "#define BOOT_PCM2_DMA_BYTES"}, {"kind": "macro", "line": 94, "name": "BIOS_DISK_INT", "signature": "#define BIOS_DISK_INT"}, {"kind": "macro", "line": 95, "name": "BIOS_DISK_EXT_CHECK", "signature": "#define BIOS_DISK_EXT_CHECK"}, {"kind": "macro", "line": 96, "name": "BIOS_DISK_EXT_REQ_MAGIC", "signature": "#define BIOS_DISK_EXT_REQ_MAGIC"}, {"kind": "macro", "line": 97, "name": "BIOS_DISK_EXT_ACK_MAGIC", "signature": "#define BIOS_DISK_EXT_ACK_MAGIC"}, {"kind": "macro", "line": 98, "name": "BIOS_DISK_EXT_PACKET_BIT", "signature": "#define BIOS_DISK_EXT_PACKET_BIT"}, {"kind": "macro", "line": 99, "name": "BIOS_DISK_READ_EXT", "signature": "#define BIOS_DISK_READ_EXT"}, {"kind": "macro", "line": 101, "name": "BIOS_VIDEO_INT", "signature": "#define BIOS_VIDEO_INT"}, {"kind": "macro", "line": 102, "name": "BIOS_VIDEO_TTY_WRITE", "signature": "#define BIOS_VIDEO_TTY_WRITE"}, {"kind": "macro", "line": 103, "name": "BIOS_VIDEO_TTY_ATTR", "signature": "#define BIOS_VIDEO_TTY_ATTR"}, {"kind": "macro", "line": 104, "name": "BIOS_VIDEO_SET_MODE", "signature": "#define BIOS_VIDEO_SET_MODE"}, {"kind": "macro", "line": 116, "name": "BIOS_VBE_GET_MODE_INFO", "signature": "#define BIOS_VBE_GET_MODE_INFO"}, {"kind": "macro", "line": 117, "name": "BIOS_VBE_SET_MODE", "signature": "#define BIOS_VBE_SET_MODE"}, {"kind": "macro", "line": 118, "name": "VBE_MODE_1024x768x32", "signature": "#define VBE_MODE_1024x768x32"}, {"kind": "macro", "line": 119, "name": "VBE_MODE_800x600x32", "signature": "#define VBE_MODE_800x600x32"}, {"kind": "macro", "line": 120, "name": "VBE_MODE_640x480x32", "signature": "#define VBE_MODE_640x480x32"}, {"kind": "macro", "line": 121, "name": "VBE_MODE_1024x768x8", "signature": "#define VBE_MODE_1024x768x8"}, {"kind": "macro", "line": 122, "name": "VBE_MODE_800x600x8", "signature": "#define VBE_MODE_800x600x8"}, {"kind": "macro", "line": 123, "name": "VBE_MODE_640x480x8", "signature": "#define VBE_MODE_640x480x8"}, {"kind": "macro", "line": 124, "name": "VBE_MODE_LFB", "signature": "#define VBE_MODE_LFB"}, {"kind": "macro", "line": 125, "name": "VBE_MODE_INFO_ADDR", "signature": "#define VBE_MODE_INFO_ADDR"}, {"kind": "macro", "line": 126, "name": "VBE_MODE_ATTR_OFF", "signature": "#define VBE_MODE_ATTR_OFF"}, {"kind": "macro", "line": 127, "name": "VBE_ATTR_SUPPORTED", "signature": "#define VBE_ATTR_SUPPORTED"}, {"kind": "macro", "line": 128, "name": "VBE_ATTR_LFB", "signature": "#define VBE_ATTR_LFB"}, {"kind": "macro", "line": 129, "name": "VBE_INFO_XRES_OFF", "signature": "#define VBE_INFO_XRES_OFF"}, {"kind": "macro", "line": 130, "name": "VBE_INFO_YRES_OFF", "signature": "#define VBE_INFO_YRES_OFF"}, {"kind": "macro", "line": 131, "name": "VBE_INFO_BYTES_SCAN_OFF", "signature": "#define VBE_INFO_BYTES_SCAN_OFF"}, {"kind": "macro", "line": 132, "name": "VBE_INFO_PHYSBASE_OFF", "signature": "#define VBE_INFO_PHYSBASE_OFF"}, {"kind": "macro", "line": 133, "name": "VBE_INFO_BPP_SRC_OFF", "signature": "#define VBE_INFO_BPP_SRC_OFF"}, {"kind": "macro", "line": 134, "name": "VBE_BPP_8", "signature": "#define VBE_BPP_8"}, {"kind": "macro", "line": 135, "name": "VBE_BPP_24", "signature": "#define VBE_BPP_24"}, {"kind": "macro", "line": 136, "name": "VBE_BPP_32", "signature": "#define VBE_BPP_32"}, {"kind": "macro", "line": 148, "name": "VBE_INFO_ADDR", "signature": "#define VBE_INFO_ADDR"}, {"kind": "macro", "line": 149, "name": "VBE_INFO_FBBASE_OFF", "signature": "#define VBE_INFO_FBBASE_OFF"}, {"kind": "macro", "line": 150, "name": "VBE_INFO_PITCH_OFF", "signature": "#define VBE_INFO_PITCH_OFF"}, {"kind": "macro", "line": 151, "name": "VBE_INFO_WIDTH_OFF", "signature": "#define VBE_INFO_WIDTH_OFF"}, {"kind": "macro", "line": 152, "name": "VBE_INFO_HEIGHT_OFF", "signature": "#define VBE_INFO_HEIGHT_OFF"}, {"kind": "macro", "line": 153, "name": "VBE_INFO_VALID_OFF", "signature": "#define VBE_INFO_VALID_OFF"}, {"kind": "macro", "line": 154, "name": "VBE_INFO_BPP_OFF", "signature": "#define VBE_INFO_BPP_OFF"}, {"kind": "macro", "line": 156, "name": "A20_CONTROL_PORT", "signature": "#define A20_CONTROL_PORT"}, {"kind": "macro", "line": 157, "name": "A20_ENABLE_BIT", "signature": "#define A20_ENABLE_BIT"}, {"kind": "macro", "line": 158, "name": "A20_RESET_CLEAR_MASK", "signature": "#define A20_RESET_CLEAR_MASK"}, {"kind": "macro", "line": 160, "name": "CR0_PE", "signature": "#define CR0_PE"}, {"kind": "macro", "line": 161, "name": "CR0_PE_CLEAR_MASK", "signature": "#define CR0_PE_CLEAR_MASK"}, {"kind": "macro", "line": 162, "name": "CR0_PG", "signature": "#define CR0_PG"}, {"kind": "macro", "line": 163, "name": "CR0_WP", "signature": "#define CR0_WP"}, {"kind": "macro", "line": 164, "name": "CR4_PAE", "signature": "#define CR4_PAE"}, {"kind": "macro", "line": 165, "name": "CR0_MP", "signature": "#define CR0_MP"}, {"kind": "macro", "line": 166, "name": "CR0_EM", "signature": "#define CR0_EM"}, {"kind": "macro", "line": 167, "name": "CR0_NW", "signature": "#define CR0_NW"}, {"kind": "macro", "line": 168, "name": "CR0_CD", "signature": "#define CR0_CD"}, {"kind": "macro", "line": 169, "name": "CR4_OSFXSR", "signature": "#define CR4_OSFXSR"}, {"kind": "macro", "line": 170, "name": "CR4_OSXMMEXCPT", "signature": "#define CR4_OSXMMEXCPT"}, {"kind": "macro", "line": 172, "name": "MSR_EFER", "signature": "#define MSR_EFER"}, {"kind": "macro", "line": 173, "name": "EFER_LME", "signature": "#define EFER_LME"}, {"kind": "macro", "line": 174, "name": "EFER_NXE", "signature": "#define EFER_NXE"}, {"kind": "macro", "line": 176, "name": "GDT32_CODE32_SEL", "signature": "#define GDT32_CODE32_SEL"}, {"kind": "macro", "line": 177, "name": "GDT32_DATA32_SEL", "signature": "#define GDT32_DATA32_SEL"}, {"kind": "macro", "line": 178, "name": "GDT32_CODE16_SEL", "signature": "#define GDT32_CODE16_SEL"}, {"kind": "macro", "line": 179, "name": "GDT32_DATA16_SEL", "signature": "#define GDT32_DATA16_SEL"}, {"kind": "macro", "line": 181, "name": "GDT32_DESC_NULL", "signature": "#define GDT32_DESC_NULL"}, {"kind": "macro", "line": 182, "name": "GDT32_DESC_CODE32", "signature": "#define GDT32_DESC_CODE32"}, {"kind": "macro", "line": 183, "name": "GDT32_DESC_DATA32", "signature": "#define GDT32_DESC_DATA32"}, {"kind": "macro", "line": 184, "name": "GDT32_DESC_CODE16", "signature": "#define GDT32_DESC_CODE16"}, {"kind": "macro", "line": 185, "name": "GDT32_DESC_DATA16", "signature": "#define GDT32_DESC_DATA16"}, {"kind": "macro", "line": 187, "name": "GDT64_ADDR", "signature": "#define GDT64_ADDR"}, {"kind": "macro", "line": 188, "name": "GDT64_BYTES", "signature": "#define GDT64_BYTES"}, {"kind": "macro", "line": 193, "name": "GDT64_SMP_BYTES", "signature": "#define GDT64_SMP_BYTES"}, {"kind": "macro", "line": 198, "name": "AP_STUB_ADDR", "signature": "#define AP_STUB_ADDR"}, {"kind": "macro", "line": 199, "name": "GDT64_CODE_SEL", "signature": "#define GDT64_CODE_SEL"}, {"kind": "macro", "line": 200, "name": "GDT64_DATA_SEL", "signature": "#define GDT64_DATA_SEL"}, {"kind": "macro", "line": 201, "name": "GDT64_USER_DATA_SEL", "signature": "#define GDT64_USER_DATA_SEL"}, {"kind": "macro", "line": 202, "name": "GDT64_USER_CODE_SEL", "signature": "#define GDT64_USER_CODE_SEL"}, {"kind": "macro", "line": 203, "name": "GDT64_DESC_NULL", "signature": "#define GDT64_DESC_NULL"}, {"kind": "macro", "line": 204, "name": "GDT64_DESC_CODE", "signature": "#define GDT64_DESC_CODE"}, {"kind": "macro", "line": 205, "name": "GDT64_DESC_DATA", "signature": "#define GDT64_DESC_DATA"}, {"kind": "macro", "line": 206, "name": "GDT64_DESC_UDATA", "signature": "#define GDT64_DESC_UDATA"}, {"kind": "macro", "line": 207, "name": "GDT64_DESC_UCODE", "signature": "#define GDT64_DESC_UCODE"}, {"kind": "macro", "line": 209, "name": "PT_PML4_ADDR", "signature": "#define PT_PML4_ADDR"}, {"kind": "macro", "line": 210, "name": "PT_PDPT_ADDR", "signature": "#define PT_PDPT_ADDR"}, {"kind": "macro", "line": 211, "name": "PT_PD_ADDR", "signature": "#define PT_PD_ADDR"}, {"kind": "macro", "line": 212, "name": "PT_USER0_ADDR", "signature": "#define PT_USER0_ADDR"}, {"kind": "macro", "line": 213, "name": "PT_USER1_ADDR", "signature": "#define PT_USER1_ADDR"}, {"kind": "macro", "line": 214, "name": "PT_ZERO_DWORDS", "signature": "#define PT_ZERO_DWORDS"}, {"kind": "macro", "line": 215, "name": "PT_FLAGS_PRESENT_RW", "signature": "#define PT_FLAGS_PRESENT_RW"}, {"kind": "macro", "line": 216, "name": "PT_FLAGS_PRESENT_RW_PS", "signature": "#define PT_FLAGS_PRESENT_RW_PS"}, {"kind": "macro", "line": 217, "name": "PT_FLAGS_PS", "signature": "#define PT_FLAGS_PS"}, {"kind": "macro", "line": 218, "name": "PT_FLAGS_USER", "signature": "#define PT_FLAGS_USER"}, {"kind": "macro", "line": 219, "name": "PT_FLAGS_PCD", "signature": "#define PT_FLAGS_PCD"}, {"kind": "macro", "line": 220, "name": "PT_FLAGS_PWT", "signature": "#define PT_FLAGS_PWT"}, {"kind": "macro", "line": 221, "name": "PT_FLAGS_NX", "signature": "#define PT_FLAGS_NX"}, {"kind": "macro", "line": 222, "name": "PT_ADDR_MASK", "signature": "#define PT_ADDR_MASK"}, {"kind": "macro", "line": 223, "name": "PT_USER_ENTRY", "signature": "#define PT_USER_ENTRY"}, {"kind": "macro", "line": 224, "name": "PT_USER_NX_ENTRY", "signature": "#define PT_USER_NX_ENTRY"}, {"kind": "macro", "line": 225, "name": "PT_ENTRY_PRESENT", "signature": "#define PT_ENTRY_PRESENT"}, {"kind": "macro", "line": 226, "name": "PT_ENTRY_USER", "signature": "#define PT_ENTRY_USER"}, {"kind": "macro", "line": 232, "name": "SB16_DMA_PT_ENTRY", "signature": "#define SB16_DMA_PT_ENTRY"}, {"kind": "macro", "line": 233, "name": "SB16_DMA_PT_PAGES", "signature": "#define SB16_DMA_PT_PAGES"}, {"kind": "macro", "line": 238, "name": "PT_FLAGS_UNCACHED", "signature": "#define PT_FLAGS_UNCACHED"}, {"kind": "macro", "line": 244, "name": "KMM_DEVICE_PDPT_SLOT", "signature": "#define KMM_DEVICE_PDPT_SLOT"}, {"kind": "macro", "line": 245, "name": "PT_PD_ENTRIES", "signature": "#define PT_PD_ENTRIES"}, {"kind": "macro", "line": 246, "name": "PT_PD_ENTRY_BYTES", "signature": "#define PT_PD_ENTRY_BYTES"}, {"kind": "macro", "line": 247, "name": "PT_PD_PAGE_BYTES", "signature": "#define PT_PD_PAGE_BYTES"}, {"kind": "macro", "line": 248, "name": "PT_PD_INDEX_SHIFT", "signature": "#define PT_PD_INDEX_SHIFT"}, {"kind": "macro", "line": 249, "name": "PT_FILL_START_INDEX", "signature": "#define PT_FILL_START_INDEX"}, {"kind": "macro", "line": 250, "name": "PT_FILL_START_ADDR", "signature": "#define PT_FILL_START_ADDR"}, {"kind": "macro", "line": 251, "name": "PT_FILL_ENTRIES", "signature": "#define PT_FILL_ENTRIES"}, {"kind": "macro", "line": 271, "name": "PT_USER_TABLES_ADDR", "signature": "#define PT_USER_TABLES_ADDR"}, {"kind": "macro", "line": 272, "name": "PT_USER_TABLES_BYTES", "signature": "#define PT_USER_TABLES_BYTES"}, {"kind": "macro", "line": 284, "name": "KASLR_MIN_ADDR", "signature": "#define KASLR_MIN_ADDR"}, {"kind": "macro", "line": 285, "name": "KASLR_ALIGN_SHIFT", "signature": "#define KASLR_ALIGN_SHIFT"}, {"kind": "macro", "line": 286, "name": "KASLR_MAX_UNITS", "signature": "#define KASLR_MAX_UNITS"}, {"kind": "macro", "line": 287, "name": "KASLR_IMG_OFF_1MB", "signature": "#define KASLR_IMG_OFF_1MB"}, {"kind": "macro", "line": 288, "name": "KASLR_IMG_OFF_2MB", "signature": "#define KASLR_IMG_OFF_2MB"}, {"kind": "macro", "line": 289, "name": "KASLR_IMAGE_SPAN", "signature": "#define KASLR_IMAGE_SPAN"}, {"kind": "macro", "line": 291, "name": "CMOS_INDEX_PORT", "signature": "#define CMOS_INDEX_PORT"}, {"kind": "macro", "line": 292, "name": "CMOS_DATA_PORT", "signature": "#define CMOS_DATA_PORT"}, {"kind": "macro", "line": 293, "name": "CMOS_NMI_DISABLE", "signature": "#define CMOS_NMI_DISABLE"}, {"kind": "macro", "line": 295, "name": "CMOS_REG_EXTMEM_LO", "signature": "#define CMOS_REG_EXTMEM_LO"}, {"kind": "macro", "line": 296, "name": "CMOS_REG_EXTMEM_HI", "signature": "#define CMOS_REG_EXTMEM_HI"}, {"kind": "macro", "line": 297, "name": "CMOS_EXTMEM_BASE", "signature": "#define CMOS_EXTMEM_BASE"}, {"kind": "macro", "line": 298, "name": "CMOS_EXTMEM_UNIT", "signature": "#define CMOS_EXTMEM_UNIT"}, {"kind": "macro", "line": 299, "name": "CMOS_REG_SECONDS", "signature": "#define CMOS_REG_SECONDS"}, {"kind": "macro", "line": 300, "name": "CMOS_REG_MINUTES", "signature": "#define CMOS_REG_MINUTES"}, {"kind": "macro", "line": 301, "name": "CMOS_REG_HOURS", "signature": "#define CMOS_REG_HOURS"}]}, {"doc": "cpu_setup.h - per-CPU control-register setup shared by the BSP (kmain)", "id": "headers/arch/x86/cpu_setup.h", "kind": "module", "label": "cpu_setup.h", "language": "h", "sha256": "db06c654f515d929", "symbol_count": 2, "symbols": [{"doc": "Turn caching on (CR0.CD and CR0.NW clear), then write back and * invalidate so no line filled under the reset policy survives.", "kind": "function", "line": 30, "name": "cpu_enable_caches", "signature": "static inline void cpu_enable_caches(void)"}, {"kind": "macro", "line": 10, "name": "ARCH_X86_CPU_SETUP_H", "signature": "#define ARCH_X86_CPU_SETUP_H"}]}, {"doc": "Docstring: x86 port I/O hardware abstraction contract.", "id": "headers/arch/x86/hal_io.h", "kind": "module", "label": "hal_io.h", "language": "h", "sha256": "8b4ae4eedb27f326", "symbol_count": 69, "symbols": [{"doc": "A device region must be mapped uncached (see kmm_map_uncached): a write-back mapping lets a register read be answered from cache, and a stale event-ring status register is a driver that works on nothing. The fences are the other half of the contract: TRB writes must be ordered before the doorbell store that publishes them, and event TRB reads before the cycle bit is released for reuse.  /** Docstring: Read a 32-bit device register. static inline unsigned hal_mmio_read32(const volatile unsigned *addr) { return *addr; } /** Docstring: Write a 32-bit device register.", "kind": "function", "line": 123, "name": "hal_mmio_write32", "signature": "static inline void hal_mmio_write32(volatile unsigned *addr, unsigned val)"}, {"doc": "bit is released for reuse.  /** Docstring: Read a 32-bit device register. static inline unsigned hal_mmio_read32(const volatile unsigned *addr) { return *addr; } /** Docstring: Write a 32-bit device register. static inline void hal_mmio_write32(volatile unsigned *addr, unsigned val) { addr = val; } /** Docstring: Read a 64-bit device register.", "kind": "function", "line": 128, "name": "hal_mmio_read64", "signature": "static inline unsigned long long hal_mmio_read64(const volatile unsigned long long *addr)"}, {"doc": "return *addr; } /** Docstring: Write a 32-bit device register. static inline void hal_mmio_write32(volatile unsigned *addr, unsigned val) { addr = val; } /** Docstring: Read a 64-bit device register. static inline unsigned long long hal_mmio_read64(const volatile unsigned long long *addr) { return *addr; } /** Docstring: Write a 64-bit device register.", "kind": "function", "line": 133, "name": "hal_mmio_write64", "signature": "static inline void hal_mmio_write64(volatile unsigned long long *addr,\n                          ..."}, {"doc": "} /** Docstring: Read a 64-bit device register. static inline unsigned long long hal_mmio_read64(const volatile unsigned long long *addr) { return *addr; } /** Docstring: Write a 64-bit device register. static inline void hal_mmio_write64(volatile unsigned long long *addr, unsigned long long val) { addr = val; } /** Docstring: Read a 16-bit device register.", "kind": "function", "line": 139, "name": "hal_mmio_read16", "signature": "static inline unsigned short hal_mmio_read16(const volatile unsigned short *addr)"}, {"doc": "} /** Docstring: Write a 64-bit device register. static inline void hal_mmio_write64(volatile unsigned long long *addr, unsigned long long val) { addr = val; } /** Docstring: Read a 16-bit device register. static inline unsigned short hal_mmio_read16(const volatile unsigned short *addr) { return *addr; } /** Docstring: Write a 16-bit device register.", "kind": "function", "line": 144, "name": "hal_mmio_write16", "signature": "static inline void hal_mmio_write16(volatile unsigned short *addr,\n                              ..."}, {"doc": "} /** Docstring: Read a 16-bit device register. static inline unsigned short hal_mmio_read16(const volatile unsigned short *addr) { return *addr; } /** Docstring: Write a 16-bit device register. static inline void hal_mmio_write16(volatile unsigned short *addr, unsigned short val) { addr = val; } /** Docstring: Read an 8-bit device register.", "kind": "function", "line": 150, "name": "hal_mmio_read8", "signature": "static inline unsigned char hal_mmio_read8(const volatile unsigned char *addr)"}, {"doc": "} /** Docstring: Write a 16-bit device register. static inline void hal_mmio_write16(volatile unsigned short *addr, unsigned short val) { addr = val; } /** Docstring: Read an 8-bit device register. static inline unsigned char hal_mmio_read8(const volatile unsigned char *addr) { return *addr; } /** Docstring: Write an 8-bit device register.", "kind": "function", "line": 155, "name": "hal_mmio_write8", "signature": "static inline void hal_mmio_write8(volatile unsigned char *addr,\n                                ..."}, {"doc": "} /** Docstring: Read an 8-bit device register. static inline unsigned char hal_mmio_read8(const volatile unsigned char *addr) { return *addr; } /** Docstring: Write an 8-bit device register. static inline void hal_mmio_write8(volatile unsigned char *addr, unsigned char val) { addr = val; } /** Docstring: Write memory barrier, orders prior stores before later stores.", "kind": "function", "line": 161, "name": "hal_mmio_wmb", "signature": "static inline void hal_mmio_wmb(void)"}, {"doc": "} /** Docstring: Write an 8-bit device register. static inline void hal_mmio_write8(volatile unsigned char *addr, unsigned char val) { addr = val; } /** Docstring: Write memory barrier, orders prior stores before later stores. static inline void hal_mmio_wmb(void) { __asm__ volatile(\"sfence\" ::: \"memory\"); } /** Docstring: Read memory barrier, orders prior loads before later loads.", "kind": "function", "line": 166, "name": "hal_mmio_rmb", "signature": "static inline void hal_mmio_rmb(void)"}, {"doc": "addr = val; } /** Docstring: Write memory barrier, orders prior stores before later stores. static inline void hal_mmio_wmb(void) { __asm__ volatile(\"sfence\" ::: \"memory\"); } /** Docstring: Read memory barrier, orders prior loads before later loads. static inline void hal_mmio_rmb(void) { __asm__ volatile(\"lfence\" ::: \"memory\"); } /** Docstring: Full memory barrier, orders every prior access before later ones.", "kind": "function", "line": 171, "name": "hal_mmio_mb", "signature": "static inline void hal_mmio_mb(void)"}, {"doc": "#ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written. extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls. extern unsigned hal_io_stub_lapic_eois; /** Docstring: Canned byte returned by stub port reads. extern unsigned char hal_io_stub_read_val; /** Docstring: Stub port byte write, records port and value.", "kind": "function", "line": 189, "name": "hal_outb", "signature": "static inline void hal_outb(unsigned short port, unsigned char val)"}, {"doc": "extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls. extern unsigned hal_io_stub_lapic_eois; /** Docstring: Canned byte returned by stub port reads. extern unsigned char hal_io_stub_read_val; /** Docstring: Stub port byte write, records port and value. static inline void hal_outb(unsigned short port, unsigned char val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = val; } /** Docstring: Stub port byte read, returns the canned value.", "kind": "function", "line": 196, "name": "hal_inb", "signature": "static inline unsigned char hal_inb(unsigned short port)"}, {"doc": "/** Docstring: Stub port byte write, records port and value. static inline void hal_outb(unsigned short port, unsigned char val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = val; } /** Docstring: Stub port byte read, returns the canned value. static inline unsigned char hal_inb(unsigned short port) { (void)port; return hal_io_stub_read_val; } /** Docstring: Stub port word write, records port and low byte.", "kind": "function", "line": 202, "name": "hal_outw", "signature": "static inline void hal_outw(unsigned short port, unsigned short val)"}, {"doc": "/** Docstring: Stub port byte read, returns the canned value. static inline unsigned char hal_inb(unsigned short port) { (void)port; return hal_io_stub_read_val; } /** Docstring: Stub port word write, records port and low byte. static inline void hal_outw(unsigned short port, unsigned short val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = (unsigned)(val & 0xFFU); } /** Docstring: Stub port word read, returns the canned value.", "kind": "function", "line": 209, "name": "hal_inw", "signature": "static inline unsigned short hal_inw(unsigned short port)"}, {"doc": "/** Docstring: Stub port word write, records port and low byte. static inline void hal_outw(unsigned short port, unsigned short val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = (unsigned)(val & 0xFFU); } /** Docstring: Stub port word read, returns the canned value. static inline unsigned short hal_inw(unsigned short port) { (void)port; return (unsigned short)hal_io_stub_read_val; } /** Docstring: Stub LAPIC EOI, counts calls.", "kind": "function", "line": 215, "name": "hal_lapic_eoi", "signature": "static inline void hal_lapic_eoi(void)"}, {"doc": "} /** Docstring: Stub port word read, returns the canned value. static inline unsigned short hal_inw(unsigned short port) { (void)port; return (unsigned short)hal_io_stub_read_val; } /** Docstring: Stub LAPIC EOI, counts calls. static inline void hal_lapic_eoi(void) { hal_io_stub_lapic_eois++; } /** Docstring: Stub PIC EOI for an IRQ line.", "kind": "function", "line": 220, "name": "hal_pic_eoi", "signature": "static inline void hal_pic_eoi(int irq)"}, {"doc": "hal_io_stub_lapic_eois++; } /** Docstring: Stub PIC EOI for an IRQ line. static inline void hal_pic_eoi(int irq) { if (irq >= 8) { hal_outb(HAL_PIC2_CMD, HAL_PIC_EOI); } hal_outb(HAL_PIC1_CMD, HAL_PIC_EOI); } #else /** Docstring: Emit a port byte write.", "kind": "function", "line": 230, "name": "hal_outb", "signature": "static inline void hal_outb(unsigned short port, unsigned char val)"}, {"doc": "if (irq >= 8) { hal_outb(HAL_PIC2_CMD, HAL_PIC_EOI); } hal_outb(HAL_PIC1_CMD, HAL_PIC_EOI); } #else /** Docstring: Emit a port byte write. static inline void hal_outb(unsigned short port, unsigned char val) { __asm__ volatile(\"outb %0, %1\" : : \"a\"(val), \"Nd\"(port)); } /** Docstring: Emit a port byte read.", "kind": "function", "line": 235, "name": "hal_inb", "signature": "static inline unsigned char hal_inb(unsigned short port)"}, {"doc": "/** Docstring: Emit a port byte write. static inline void hal_outb(unsigned short port, unsigned char val) { __asm__ volatile(\"outb %0, %1\" : : \"a\"(val), \"Nd\"(port)); } /** Docstring: Emit a port byte read. static inline unsigned char hal_inb(unsigned short port) { unsigned char r; __asm__ volatile(\"inb %1, %0\" : \"=a\"(r) : \"Nd\"(port)); return r; } /** Docstring: Emit a port word write.", "kind": "function", "line": 242, "name": "hal_outw", "signature": "static inline void hal_outw(unsigned short port, unsigned short val)"}, {"doc": "/** Docstring: Emit a port byte read. static inline unsigned char hal_inb(unsigned short port) { unsigned char r; __asm__ volatile(\"inb %1, %0\" : \"=a\"(r) : \"Nd\"(port)); return r; } /** Docstring: Emit a port word write. static inline void hal_outw(unsigned short port, unsigned short val) { __asm__ volatile(\"outw %0, %1\" : : \"a\"(val), \"Nd\"(port)); } /** Docstring: Emit a port word read.", "kind": "function", "line": 247, "name": "hal_inw", "signature": "static inline unsigned short hal_inw(unsigned short port)"}, {"doc": "/** Docstring: Emit a port word write. static inline void hal_outw(unsigned short port, unsigned short val) { __asm__ volatile(\"outw %0, %1\" : : \"a\"(val), \"Nd\"(port)); } /** Docstring: Emit a port word read. static inline unsigned short hal_inw(unsigned short port) { unsigned short r; __asm__ volatile(\"inw %1, %0\" : \"=a\"(r) : \"Nd\"(port)); return r; } /** Docstring: Acknowledge the local APIC after an IPI-driven tick.", "kind": "function", "line": 254, "name": "hal_lapic_eoi", "signature": "static inline void hal_lapic_eoi(void)"}, {"doc": "/** Docstring: Emit a port word read. static inline unsigned short hal_inw(unsigned short port) { unsigned short r; __asm__ volatile(\"inw %1, %0\" : \"=a\"(r) : \"Nd\"(port)); return r; } /** Docstring: Acknowledge the local APIC after an IPI-driven tick. static inline void hal_lapic_eoi(void) { (volatile unsigned *)HAL_LAPIC_EOI_ADDR = 0; } /** Docstring: Send end-of-interrupt for an IRQ line.", "kind": "function", "line": 259, "name": "hal_pic_eoi", "signature": "static inline void hal_pic_eoi(int irq)"}, {"doc": "/** Docstring: Read memory barrier, orders prior loads before later loads. static inline void hal_mmio_rmb(void) { __asm__ volatile(\"lfence\" ::: \"memory\"); } /** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile(\"mfence\" ::: \"memory\"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes.", "kind": "variable", "line": 178, "name": "hal_io_stub_writes", "signature": "extern unsigned hal_io_stub_writes;"}, {"doc": "static inline void hal_mmio_rmb(void) { __asm__ volatile(\"lfence\" ::: \"memory\"); } /** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile(\"mfence\" ::: \"memory\"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written.", "kind": "variable", "line": 180, "name": "hal_io_stub_last_port", "signature": "extern unsigned hal_io_stub_last_port;"}, {"doc": "} /** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile(\"mfence\" ::: \"memory\"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written.", "kind": "variable", "line": 182, "name": "hal_io_stub_last_val", "signature": "extern unsigned hal_io_stub_last_val;"}, {"doc": "/** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile(\"mfence\" ::: \"memory\"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written. extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls.", "kind": "variable", "line": 184, "name": "hal_io_stub_lapic_eois", "signature": "extern unsigned hal_io_stub_lapic_eois;"}, {"doc": "__asm__ volatile(\"mfence\" ::: \"memory\"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written. extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls. extern unsigned hal_io_stub_lapic_eois; /** Docstring: Canned byte returned by stub port reads.", "kind": "variable", "line": 186, "name": "hal_io_stub_read_val", "signature": "extern unsigned char hal_io_stub_read_val;"}, {"kind": "macro", "line": 13, "name": "HAL_IO_H", "signature": "#define HAL_IO_H"}, {"kind": "macro", "line": 16, "name": "HAL_PIC1_CMD", "signature": "#define HAL_PIC1_CMD"}, {"kind": "macro", "line": 18, "name": "HAL_PIC1_DATA", "signature": "#define HAL_PIC1_DATA"}, {"kind": "macro", "line": 20, "name": "HAL_PIC2_CMD", "signature": "#define HAL_PIC2_CMD"}, {"kind": "macro", "line": 22, "name": "HAL_PIC2_DATA", "signature": "#define HAL_PIC2_DATA"}, {"kind": "macro", "line": 24, "name": "HAL_PIC_EOI", "signature": "#define HAL_PIC_EOI"}, {"kind": "macro", "line": 27, "name": "HAL_PIT_CMD", "signature": "#define HAL_PIT_CMD"}, {"kind": "macro", "line": 29, "name": "HAL_PIT_CH0", "signature": "#define HAL_PIT_CH0"}, {"kind": "macro", "line": 32, "name": "HAL_PS2_STATUS", "signature": "#define HAL_PS2_STATUS"}, {"kind": "macro", "line": 34, "name": "HAL_PS2_DATA", "signature": "#define HAL_PS2_DATA"}, {"kind": "macro", "line": 36, "name": "HAL_PS2_MOUSE_OBF", "signature": "#define HAL_PS2_MOUSE_OBF"}, {"kind": "macro", "line": 38, "name": "HAL_PS2_IBF_EMPTY", "signature": "#define HAL_PS2_IBF_EMPTY"}, {"kind": "macro", "line": 40, "name": "HAL_PS2_OBF_FULL", "signature": "#define HAL_PS2_OBF_FULL"}, {"kind": "macro", "line": 42, "name": "HAL_PS2_CMD_WRITE_MOUSE", "signature": "#define HAL_PS2_CMD_WRITE_MOUSE"}, {"kind": "macro", "line": 44, "name": "HAL_PS2_CMD_ENABLE_AUX", "signature": "#define HAL_PS2_CMD_ENABLE_AUX"}, {"kind": "macro", "line": 46, "name": "HAL_PS2_CMD_DISABLE_AUX", "signature": "#define HAL_PS2_CMD_DISABLE_AUX"}, {"kind": "macro", "line": 48, "name": "HAL_PS2_CMD_ENABLE_KBD", "signature": "#define HAL_PS2_CMD_ENABLE_KBD"}, {"kind": "macro", "line": 50, "name": "HAL_PS2_CMD_DISABLE_KBD", "signature": "#define HAL_PS2_CMD_DISABLE_KBD"}, {"kind": "macro", "line": 52, "name": "HAL_PS2_CMD_READ_CONFIG", "signature": "#define HAL_PS2_CMD_READ_CONFIG"}, {"kind": "macro", "line": 54, "name": "HAL_PS2_CMD_WRITE_CONFIG", "signature": "#define HAL_PS2_CMD_WRITE_CONFIG"}, {"kind": "macro", "line": 56, "name": "HAL_PS2_CONFIG_IRQ1", "signature": "#define HAL_PS2_CONFIG_IRQ1"}, {"kind": "macro", "line": 58, "name": "HAL_PS2_CONFIG_IRQ12", "signature": "#define HAL_PS2_CONFIG_IRQ12"}, {"kind": "macro", "line": 60, "name": "HAL_PS2_CONFIG_DISABLE_KBD", "signature": "#define HAL_PS2_CONFIG_DISABLE_KBD"}, {"kind": "macro", "line": 62, "name": "HAL_PS2_CONFIG_DISABLE_AUX", "signature": "#define HAL_PS2_CONFIG_DISABLE_AUX"}, {"kind": "macro", "line": 64, "name": "HAL_PS2_CONFIG_TRANSLATE", "signature": "#define HAL_PS2_CONFIG_TRANSLATE"}, {"kind": "macro", "line": 66, "name": "HAL_MOUSE_CMD_RESET", "signature": "#define HAL_MOUSE_CMD_RESET"}, {"kind": "macro", "line": 68, "name": "HAL_MOUSE_CMD_SET_RATE", "signature": "#define HAL_MOUSE_CMD_SET_RATE"}, {"kind": "macro", "line": 70, "name": "HAL_MOUSE_CMD_GET_ID", "signature": "#define HAL_MOUSE_CMD_GET_ID"}, {"kind": "macro", "line": 72, "name": "HAL_MOUSE_CMD_DEFAULTS", "signature": "#define HAL_MOUSE_CMD_DEFAULTS"}, {"kind": "macro", "line": 74, "name": "HAL_MOUSE_CMD_ENABLE", "signature": "#define HAL_MOUSE_CMD_ENABLE"}, {"kind": "macro", "line": 76, "name": "HAL_MOUSE_CMD_DISABLE", "signature": "#define HAL_MOUSE_CMD_DISABLE"}, {"kind": "macro", "line": 78, "name": "HAL_MOUSE_RATE_KNOCK_200", "signature": "#define HAL_MOUSE_RATE_KNOCK_200"}, {"kind": "macro", "line": 80, "name": "HAL_MOUSE_RATE_KNOCK_100", "signature": "#define HAL_MOUSE_RATE_KNOCK_100"}, {"kind": "macro", "line": 82, "name": "HAL_MOUSE_RATE_KNOCK_80", "signature": "#define HAL_MOUSE_RATE_KNOCK_80"}, {"kind": "macro", "line": 84, "name": "HAL_MOUSE_ID_INTELLI", "signature": "#define HAL_MOUSE_ID_INTELLI"}, {"kind": "macro", "line": 86, "name": "HAL_MOUSE_HW_TIMEOUT", "signature": "#define HAL_MOUSE_HW_TIMEOUT"}, {"kind": "macro", "line": 89, "name": "HAL_MOUSE_SYNC_BIT", "signature": "#define HAL_MOUSE_SYNC_BIT"}, {"kind": "macro", "line": 91, "name": "HAL_MOUSE_OVF_BITS", "signature": "#define HAL_MOUSE_OVF_BITS"}, {"kind": "macro", "line": 93, "name": "HAL_MOUSE_BUTTON_MASK", "signature": "#define HAL_MOUSE_BUTTON_MASK"}, {"kind": "macro", "line": 95, "name": "HAL_MOUSE_PACKET_LEN", "signature": "#define HAL_MOUSE_PACKET_LEN"}, {"kind": "macro", "line": 97, "name": "HAL_MOUSE_SCALE", "signature": "#define HAL_MOUSE_SCALE"}, {"kind": "macro", "line": 100, "name": "HAL_LAPIC_EOI_ADDR", "signature": "#define HAL_LAPIC_EOI_ADDR"}]}, {"doc": "Model-Specific Register access for x86-64.", "id": "headers/arch/x86/msr.h", "kind": "module", "label": "msr.h", "language": "h", "sha256": "fb99809c1bbc0b07", "symbol_count": 9, "symbols": [{"kind": "function", "line": 8, "name": "wrmsr", "signature": "static inline void wrmsr(unsigned msr, unsigned long val)"}, {"kind": "function", "line": 13, "name": "rdmsr", "signature": "static inline unsigned long rdmsr(unsigned msr)"}, {"kind": "macro", "line": 2, "name": "ARCH_X86_MSR_H", "signature": "#define ARCH_X86_MSR_H"}, {"kind": "macro", "line": 19, "name": "MSR_STAR", "signature": "#define MSR_STAR"}, {"kind": "macro", "line": 20, "name": "MSR_LSTAR", "signature": "#define MSR_LSTAR"}, {"kind": "macro", "line": 21, "name": "MSR_SFMASK", "signature": "#define MSR_SFMASK"}, {"kind": "macro", "line": 22, "name": "MSR_FSBASE", "signature": "#define MSR_FSBASE"}, {"kind": "macro", "line": 23, "name": "MSR_GSBASE", "signature": "#define MSR_GSBASE"}, {"kind": "macro", "line": 24, "name": "MSR_KERNEL_GS_BASE", "signature": "#define MSR_KERNEL_GS_BASE"}]}, {"doc": "Docstring: bump arena for MiniOS, kernel and ring-3 alike.", "id": "headers/arena.h", "kind": "module", "label": "arena.h", "language": "h", "sha256": "937db92a2b68f212", "symbol_count": 15, "symbols": [{"doc": "Alignment defaults to 8 bytes when the caller passes 0. Every size sum is overflow checked and fails closed with a null return, never a wrap. Arenas are not thread safe; one arena per CPU or per syscall scope.  #ifndef MINIOS_ARENA_H #define MINIOS_ARENA_H #include <stddef.h> /** Docstring: default borrow alignment when the caller passes align 0. #define ARENA_DEFAULT_ALIGN 8u /** Docstring: one bump scope over a caller-owned backing block.", "kind": "struct", "line": 41, "name": "minios_arena"}, {"doc": "#include <stddef.h> /** Docstring: default borrow alignment when the caller passes align 0. #define ARENA_DEFAULT_ALIGN 8u /** Docstring: one bump scope over a caller-owned backing block. typedef struct minios_arena { unsigned char *base; unsigned char *cur; unsigned char *end; } arena_t; /** Docstring: bind an arena to a backing block, empty when block is null.", "kind": "function", "line": 48, "name": "arena_init", "signature": "static inline void arena_init(arena_t *a, void *block, size_t size)"}, {"doc": "static inline void arena_init(arena_t *a, void *block, size_t size) { if (!a) return; if (!block || size == 0) { a->base = 0; a->cur = 0; a->end = 0; return; } a->base = (unsigned char *)block; a->cur = (unsigned char *)block; a->end = (unsigned char *)block + size; } /** Docstring: round n up to align, 0 on overflow or non-power-of-two align.", "kind": "function", "line": 62, "name": "arena_align_up", "signature": "static inline size_t arena_align_up(size_t n, size_t align)"}, {"doc": "/** Docstring: round n up to align, 0 on overflow or non-power-of-two align. static inline size_t arena_align_up(size_t n, size_t align) { size_t mask; size_t up; if (align == 0) align = ARENA_DEFAULT_ALIGN; if (align & (align - 1)) return 0; mask = align - 1; if (n > (size_t)-1 - mask) return 0; up = (n + mask) & ~mask; return up; } /** Docstring: overflow checked bytes for count items of elem_size.", "kind": "function", "line": 74, "name": "arena_bytes_for", "signature": "static inline size_t arena_bytes_for(size_t count, size_t elem_size)"}, {"doc": "mask = align - 1; if (n > (size_t)-1 - mask) return 0; up = (n + mask) & ~mask; return up; } /** Docstring: overflow checked bytes for count items of elem_size. static inline size_t arena_bytes_for(size_t count, size_t elem_size) { if (count == 0 || elem_size == 0) return 0; if (count > (size_t)-1 / elem_size) return 0; return count * elem_size; } /** Docstring: borrow size bytes at align, null when the scope is exhausted.", "kind": "function", "line": 81, "name": "arena_alloc", "signature": "static inline void *arena_alloc(arena_t *a, size_t size, size_t align)"}, {"doc": "static inline void *arena_alloc(arena_t *a, size_t size, size_t align) { size_t off; size_t up; if (!a || !a->base || size == 0) return 0; off = (size_t)(a->cur - a->base); up = arena_align_up(off, align); if (up == 0 && off != 0) return 0; if (up > (size_t)(a->end - a->base)) return 0; if (size > (size_t)(a->end - a->base) - up) return 0; a->cur = a->base + up + size; return a->base + up; } /** Docstring: bytes borrowed so far, 0 for a null or empty arena.", "kind": "function", "line": 95, "name": "arena_used", "signature": "static inline size_t arena_used(const arena_t *a)"}, {"doc": "if (up == 0 && off != 0) return 0; if (up > (size_t)(a->end - a->base)) return 0; if (size > (size_t)(a->end - a->base) - up) return 0; a->cur = a->base + up + size; return a->base + up; } /** Docstring: bytes borrowed so far, 0 for a null or empty arena. static inline size_t arena_used(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: bytes still borrowable, 0 for a null or empty arena.", "kind": "function", "line": 101, "name": "arena_free_bytes", "signature": "static inline size_t arena_free_bytes(const arena_t *a)"}, {"doc": "/** Docstring: bytes borrowed so far, 0 for a null or empty arena. static inline size_t arena_used(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: bytes still borrowable, 0 for a null or empty arena. static inline size_t arena_free_bytes(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->end - a->cur); } /** Docstring: rewind the scope to empty without releasing the backing block.", "kind": "function", "line": 107, "name": "arena_reset", "signature": "static inline void arena_reset(arena_t *a)"}, {"doc": "/** Docstring: bytes still borrowable, 0 for a null or empty arena. static inline size_t arena_free_bytes(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->end - a->cur); } /** Docstring: rewind the scope to empty without releasing the backing block. static inline void arena_reset(arena_t *a) { if (!a) return; a->cur = a->base; } /** Docstring: bookmark the cursor for a later partial rewind.", "kind": "function", "line": 113, "name": "arena_checkpoint", "signature": "static inline size_t arena_checkpoint(const arena_t *a)"}, {"doc": "/** Docstring: rewind the scope to empty without releasing the backing block. static inline void arena_reset(arena_t *a) { if (!a) return; a->cur = a->base; } /** Docstring: bookmark the cursor for a later partial rewind. static inline size_t arena_checkpoint(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: rewind to a checkpoint, -1 when the mark is out of range.", "kind": "function", "line": 119, "name": "arena_rewind", "signature": "static inline int arena_rewind(arena_t *a, size_t checkpoint)"}, {"doc": "if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: rewind to a checkpoint, -1 when the mark is out of range. static inline int arena_rewind(arena_t *a, size_t checkpoint) { if (!a || !a->base) return -1; if (checkpoint > (size_t)(a->end - a->base)) return -1; if (checkpoint > (size_t)(a->cur - a->base)) return -1; a->cur = a->base + checkpoint; return 0; } /** Docstring: true when ptr lies inside the backing block.", "kind": "function", "line": 128, "name": "arena_contains", "signature": "static inline int arena_contains(const arena_t *a, const void *ptr)"}, {"kind": "function", "line": 3, "name": "kmalloc", "signature": "* * A bump arena serves one kmalloc (kernel) or malloc (ring-3) with pointer * bumps instead of N allocator round trips, then releases the whole scope * with a single free. That is the exact shape of "}, {"kind": "function", "line": 25, "name": "kfree", "signature": "* kfree(back);"}, {"kind": "macro", "line": 33, "name": "MINIOS_ARENA_H", "signature": "#define MINIOS_ARENA_H"}, {"kind": "macro", "line": 38, "name": "ARENA_DEFAULT_ALIGN", "signature": "#define ARENA_DEFAULT_ALIGN"}]}, {"doc": "Unified audio API for MiniOS.", "id": "headers/audio.h", "kind": "module", "label": "audio.h", "language": "h", "sha256": "439b760bd7995d63", "symbol_count": 18, "symbols": [{"doc": "PC speaker (square wave, syscalls 209/210/214) - Sound Blaster 16 (8-bit mono PCM DMA, syscalls 221/222/224) - SB16 multicanal mixer (streams, syscalls 225-228)  Ring-3 programs use these wrappers instead of calling raw syscalls. The kernel dispatches to the appropriate hardware backend.  #define AUDIO_RATE_DEFAULT  22050 #define AUDIO_CHANNELS_MONO 1 #define AUDIO_FORMAT_U8     0 #define AUDIO_FORMAT_S16    1 /* Initialize the audio subsystem.  Probes for SB16, resets PC speaker.", "kind": "function", "line": 21, "name": "audio_init", "signature": "int audio_init(void);"}, {"doc": "Ring-3 programs use these wrappers instead of calling raw syscalls. The kernel dispatches to the appropriate hardware backend.  #define AUDIO_RATE_DEFAULT  22050 #define AUDIO_CHANNELS_MONO 1 #define AUDIO_FORMAT_U8     0 #define AUDIO_FORMAT_S16    1 /* Initialize the audio subsystem.  Probes for SB16, resets PC speaker. int  audio_init(void); /* Tone mode: play a square wave at `freq` Hz.  0 = silence.", "kind": "function", "line": 24, "name": "audio_tone", "signature": "void audio_tone(unsigned freq);"}, {"doc": "#define AUDIO_RATE_DEFAULT  22050 #define AUDIO_CHANNELS_MONO 1 #define AUDIO_FORMAT_U8     0 #define AUDIO_FORMAT_S16    1 /* Initialize the audio subsystem.  Probes for SB16, resets PC speaker. int  audio_init(void); /* Tone mode: play a square wave at `freq` Hz.  0 = silence. void audio_tone(unsigned freq); /* PCM streaming mode (SB16).", "kind": "function", "line": 27, "name": "audio_pcm_open", "signature": "int audio_pcm_open(unsigned rate, unsigned channels, unsigned format);"}, {"kind": "function", "line": 28, "name": "audio_pcm_submit", "signature": "int audio_pcm_submit(const void *buf, unsigned len);"}, {"kind": "function", "line": 29, "name": "audio_pcm_pump", "signature": "void audio_pcm_pump(void);"}, {"kind": "function", "line": 30, "name": "audio_pcm_close", "signature": "void audio_pcm_close(void);"}, {"doc": "/* Initialize the audio subsystem.  Probes for SB16, resets PC speaker. int  audio_init(void); /* Tone mode: play a square wave at `freq` Hz.  0 = silence. void audio_tone(unsigned freq); /* PCM streaming mode (SB16). int  audio_pcm_open(unsigned rate, unsigned channels, unsigned format); int  audio_pcm_submit(const void *buf, unsigned len); void audio_pcm_pump(void); void audio_pcm_close(void); /* Volume control (PC speaker mute switch).", "kind": "function", "line": 33, "name": "audio_set_volume", "signature": "void audio_set_volume(unsigned volume);"}, {"kind": "function", "line": 34, "name": "audio_get_volume", "signature": "unsigned audio_get_volume(void);"}, {"doc": "/* Tone mode: play a square wave at `freq` Hz.  0 = silence. void audio_tone(unsigned freq); /* PCM streaming mode (SB16). int  audio_pcm_open(unsigned rate, unsigned channels, unsigned format); int  audio_pcm_submit(const void *buf, unsigned len); void audio_pcm_pump(void); void audio_pcm_close(void); /* Volume control (PC speaker mute switch). void audio_set_volume(unsigned volume); unsigned audio_get_volume(void); /* Query hardware presence.", "kind": "function", "line": 37, "name": "audio_sb16_present", "signature": "int audio_sb16_present(void);"}, {"doc": "/* PCM streaming mode (SB16). int  audio_pcm_open(unsigned rate, unsigned channels, unsigned format); int  audio_pcm_submit(const void *buf, unsigned len); void audio_pcm_pump(void); void audio_pcm_close(void); /* Volume control (PC speaker mute switch). void audio_set_volume(unsigned volume); unsigned audio_get_volume(void); /* Query hardware presence. int audio_sb16_present(void); /* Mixer stream API (SB16 multicanal).", "kind": "function", "line": 40, "name": "audio_stream_open", "signature": "int audio_stream_open(void);"}, {"kind": "function", "line": 41, "name": "audio_stream_close", "signature": "void audio_stream_close(int id);"}, {"kind": "function", "line": 42, "name": "audio_stream_submit", "signature": "int audio_stream_submit(int id, const void *buf, unsigned len);"}, {"kind": "function", "line": 43, "name": "audio_stream_volume", "signature": "void audio_stream_volume(int id, unsigned char vol);"}, {"kind": "macro", "line": 2, "name": "AUDIO_H", "signature": "#define AUDIO_H"}, {"kind": "macro", "line": 15, "name": "AUDIO_RATE_DEFAULT", "signature": "#define AUDIO_RATE_DEFAULT"}, {"kind": "macro", "line": 16, "name": "AUDIO_CHANNELS_MONO", "signature": "#define AUDIO_CHANNELS_MONO"}, {"kind": "macro", "line": 17, "name": "AUDIO_FORMAT_U8", "signature": "#define AUDIO_FORMAT_U8"}, {"kind": "macro", "line": 18, "name": "AUDIO_FORMAT_S16", "signature": "#define AUDIO_FORMAT_S16"}]}, {"doc": "Docstring: batch.h -- Batched synchronous syscall submission.", "id": "headers/batch.h", "kind": "module", "label": "batch.h", "language": "h", "sha256": "ed0aca6683cdebf1", "symbol_count": 12, "symbols": [{"kind": "struct", "line": 53, "name": "batch_op_t"}, {"kind": "function", "line": 62, "name": "batch_exec", "signature": "long batch_exec(const batch_op_t *ops, long *results, int count, int *completed, batch_handler_t dispatch);"}, {"kind": "macro", "line": 2, "name": "BATCH_H", "signature": "#define BATCH_H"}, {"kind": "macro", "line": 41, "name": "BATCH_MAX_OPS", "signature": "#define BATCH_MAX_OPS"}, {"kind": "macro", "line": 43, "name": "BATCH_OP_NOP", "signature": "#define BATCH_OP_NOP"}, {"kind": "macro", "line": 44, "name": "BATCH_OP_YIELD", "signature": "#define BATCH_OP_YIELD"}, {"kind": "macro", "line": 45, "name": "BATCH_OP_TIME", "signature": "#define BATCH_OP_TIME"}, {"kind": "macro", "line": 46, "name": "BATCH_OP_GETPID", "signature": "#define BATCH_OP_GETPID"}, {"kind": "macro", "line": 48, "name": "BATCH_OK", "signature": "#define BATCH_OK"}, {"kind": "macro", "line": 49, "name": "BATCH_ERR_COUNT", "signature": "#define BATCH_ERR_COUNT"}, {"kind": "macro", "line": 50, "name": "BATCH_ERR_PTR", "signature": "#define BATCH_ERR_PTR"}, {"kind": "macro", "line": 51, "name": "BATCH_ERR_OPCODE", "signature": "#define BATCH_ERR_OPCODE"}]}, {"doc": "Block device abstraction for MiniFS. Maps 4096-byte logical blocks to 512-byte IDE sectors.", "id": "headers/block.h", "kind": "module", "label": "block.h", "language": "h", "sha256": "87c9af62ca748a90", "symbol_count": 14, "symbols": [{"doc": "Block device abstraction for MiniFS. * Maps 4096-byte logical blocks to 512-byte IDE sectors. #define BLOCK_SIZE      4096 #define BLOCK_SHIFT     12 #define SECTORS_PER_BLOCK  (BLOCK_SIZE / IDE_SECTOR_SIZE) /* Initialize the block layer. Calls ide_init() internally.", "kind": "function", "line": 12, "name": "block_init", "signature": "void block_init(void);"}, {"doc": "Block device abstraction for MiniFS. * Maps 4096-byte logical blocks to 512-byte IDE sectors. #define BLOCK_SIZE      4096 #define BLOCK_SHIFT     12 #define SECTORS_PER_BLOCK  (BLOCK_SIZE / IDE_SECTOR_SIZE) /* Initialize the block layer. Calls ide_init() internally. void block_init(void); /* Set the base LBA offset for all block I/O.", "kind": "function", "line": 15, "name": "block_set_base", "signature": "void block_set_base(unsigned int lba_base);"}, {"doc": "Block device abstraction for MiniFS. * Maps 4096-byte logical blocks to 512-byte IDE sectors. #define BLOCK_SIZE      4096 #define BLOCK_SHIFT     12 #define SECTORS_PER_BLOCK  (BLOCK_SIZE / IDE_SECTOR_SIZE) /* Initialize the block layer. Calls ide_init() internally. void block_init(void); /* Set the base LBA offset for all block I/O. void block_set_base(unsigned int lba_base); /* Read/write one 4096-byte block. Returns 0 on success.", "kind": "function", "line": 18, "name": "block_read", "signature": "int block_read(unsigned int block_num, void *buf);"}, {"kind": "function", "line": 19, "name": "block_write", "signature": "int block_write(unsigned int block_num, const void *buf);"}, {"doc": "Read/write multiple contiguous blocks. * Returns 0 on success.", "kind": "function", "line": 23, "name": "block_read_multi", "signature": "int block_read_multi(unsigned int block_num, unsigned int count, void *buf);"}, {"kind": "function", "line": 24, "name": "block_write_multi", "signature": "int block_write_multi(unsigned int block_num, unsigned int count, const void *buf);"}, {"doc": "Read/write multiple contiguous blocks. * Returns 0 on success. int block_read_multi(unsigned int block_num, unsigned int count, void *buf); int block_write_multi(unsigned int block_num, unsigned int count, const void *buf); /* Flush any cached writes (currently a no-op, IDE is synchronous).", "kind": "function", "line": 27, "name": "block_flush", "signature": "void block_flush(void);"}, {"doc": "Read/write multiple contiguous blocks. * Returns 0 on success. int block_read_multi(unsigned int block_num, unsigned int count, void *buf); int block_write_multi(unsigned int block_num, unsigned int count, const void *buf); /* Flush any cached writes (currently a no-op, IDE is synchronous). void block_flush(void); /* Total blocks available, 0 if no disk.", "kind": "function", "line": 30, "name": "block_total", "signature": "unsigned int block_total(void);"}, {"doc": "Docstring: Backend-aware sector I/O on absolute LBAs, bypassing the block cache and the MiniFS base offset. This is what partition scanners and foreign filesystems use, so a FAT on a USB stick reads from USB and not from IDE. buf must be DMA-safe (heap): the USB backend hands it to * the controller as a physical address. Returns 0 on success.", "kind": "function", "line": 37, "name": "block_read_sectors", "signature": "int block_read_sectors(unsigned lba, unsigned count, void *buf);"}, {"doc": "Docstring: Backend-aware sector I/O on absolute LBAs, bypassing the block cache and the MiniFS base offset. This is what partition scanners and foreign filesystems use, so a FAT on a USB stick reads from USB and not from IDE. buf must be DMA-safe (heap): the USB backend hands it to * the controller as a physical address. Returns 0 on success. int block_read_sectors(unsigned lba, unsigned count, void *buf); /** Docstring: Backend-aware disk size in 512-byte sectors, 0 if no disk.", "kind": "function", "line": 40, "name": "block_disk_sectors", "signature": "unsigned long block_disk_sectors(void);"}, {"kind": "macro", "line": 2, "name": "BLOCK_H", "signature": "#define BLOCK_H"}, {"kind": "macro", "line": 7, "name": "BLOCK_SIZE", "signature": "#define BLOCK_SIZE"}, {"kind": "macro", "line": 8, "name": "BLOCK_SHIFT", "signature": "#define BLOCK_SHIFT"}, {"kind": "macro", "line": 9, "name": "SECTORS_PER_BLOCK", "signature": "#define SECTORS_PER_BLOCK"}]}, {"doc": "desktop_icons.h -- embedded icon pixel data for desktop shortcuts.", "id": "headers/desktop_icons.h", "kind": "module", "label": "desktop_icons.h", "language": "h", "sha256": "d75f3ae0cedb0004", "symbol_count": 3, "symbols": [{"kind": "macro", "line": 8, "name": "DESKTOP_ICONS_H", "signature": "#define DESKTOP_ICONS_H"}, {"kind": "macro", "line": 12, "name": "ICON_EMBEDDED_W", "signature": "#define ICON_EMBEDDED_W"}, {"kind": "macro", "line": 13, "name": "ICON_EMBEDDED_H", "signature": "#define ICON_EMBEDDED_H"}]}, {"doc": "desktop_shortcuts.h -- configurable desktop icon shortcuts.", "id": "headers/desktop_shortcuts.h", "kind": "module", "label": "desktop_shortcuts.h", "language": "h", "sha256": "973e41084bb18eb5", "symbol_count": 27, "symbols": [{"doc": "A decoded+cached desktop shortcut. Pixels are raw RGBA bytes (ICON_W*ICON_H*4): the PNG's own colors, alpha below 128 transparent. Embedded fallback icons arrive as palette indices and are expanded to * RGBA at load time, so the renderer has a single code path.", "kind": "struct", "line": 72, "name": "desktop_shortcut"}, {"doc": "Load shortcuts from etc/shortcuts, decode icons, compute layout. * Called once from vga_fb_draw_desktop on first draw.", "kind": "function", "line": 82, "name": "desktop_shortcuts_load", "signature": "void desktop_shortcuts_load(void);"}, {"doc": "Load shortcuts from etc/shortcuts, decode icons, compute layout. * Called once from vga_fb_draw_desktop on first draw. void desktop_shortcuts_load(void); /* Draw all shortcut icons and labels onto the framebuffer.", "kind": "function", "line": 85, "name": "desktop_shortcuts_draw", "signature": "void desktop_shortcuts_draw(void);"}, {"doc": "Handle a left-click at (mx, my).  Returns the command string if the * click hit an icon, or NULL otherwise.", "kind": "function", "line": 89, "name": "desktop_shortcuts_hit_test", "signature": "const char *desktop_shortcuts_hit_test(int mx, int my);"}, {"kind": "macro", "line": 13, "name": "DESKTOP_SHORTCUTS_H", "signature": "#define DESKTOP_SHORTCUTS_H"}, {"kind": "macro", "line": 18, "name": "MAX_SHORTCUTS", "signature": "#define MAX_SHORTCUTS"}, {"kind": "macro", "line": 19, "name": "SHORTCUT_NAME_LEN", "signature": "#define SHORTCUT_NAME_LEN"}, {"kind": "macro", "line": 20, "name": "SHORTCUT_CMD_LEN", "signature": "#define SHORTCUT_CMD_LEN"}, {"kind": "macro", "line": 21, "name": "SHORTCUT_PATH_LEN", "signature": "#define SHORTCUT_PATH_LEN"}, {"kind": "macro", "line": 24, "name": "ICON_W", "signature": "#define ICON_W"}, {"kind": "macro", "line": 25, "name": "ICON_H", "signature": "#define ICON_H"}, {"kind": "macro", "line": 26, "name": "ICON_PAD_X", "signature": "#define ICON_PAD_X"}, {"kind": "macro", "line": 27, "name": "ICON_PAD_Y", "signature": "#define ICON_PAD_Y"}, {"kind": "macro", "line": 28, "name": "ICON_LABEL_H", "signature": "#define ICON_LABEL_H"}, {"kind": "macro", "line": 33, "name": "DOCK_PAD_X", "signature": "#define DOCK_PAD_X"}, {"kind": "macro", "line": 34, "name": "DOCK_PAD_Y", "signature": "#define DOCK_PAD_Y"}, {"kind": "macro", "line": 35, "name": "DOCK_GAP", "signature": "#define DOCK_GAP"}, {"kind": "macro", "line": 36, "name": "DOCK_LABEL_GAP", "signature": "#define DOCK_LABEL_GAP"}, {"kind": "macro", "line": 41, "name": "DOCK_CRYSTAL_STEP", "signature": "#define DOCK_CRYSTAL_STEP"}, {"kind": "macro", "line": 48, "name": "DOCK_MAG_W", "signature": "#define DOCK_MAG_W"}, {"kind": "macro", "line": 49, "name": "DOCK_MAG_H", "signature": "#define DOCK_MAG_H"}, {"kind": "macro", "line": 50, "name": "DOCK_NEAR_W", "signature": "#define DOCK_NEAR_W"}, {"kind": "macro", "line": 51, "name": "DOCK_NEAR_H", "signature": "#define DOCK_NEAR_H"}, {"kind": "macro", "line": 57, "name": "DOCK_BOUNCE_H", "signature": "#define DOCK_BOUNCE_H"}, {"kind": "macro", "line": 58, "name": "DOCK_BOUNCE_TICKS", "signature": "#define DOCK_BOUNCE_TICKS"}, {"kind": "macro", "line": 65, "name": "ICON_PAL_BASE", "signature": "#define ICON_PAL_BASE"}, {"kind": "macro", "line": 66, "name": "ICON_PAL_SIZE", "signature": "#define ICON_PAL_SIZE"}]}, {"doc": "driver.h -- Strategy pattern for hardware drivers (thesis correction 2).", "id": "headers/driver.h", "kind": "module", "label": "driver.h", "language": "h", "sha256": "e1ded722dd8d9028", "symbol_count": 16, "symbols": [{"kind": "struct", "line": 48, "name": "device"}, {"kind": "struct", "line": 28, "name": "block_ops_t"}, {"kind": "struct", "line": 37, "name": "audio_ops_t"}, {"doc": "define DEV_TYPE_BLOCK 1 define DEV_TYPE_AUDIO 2 define DEV_TYPE_NET   3 define DEV_TYPE_CHAR  4", "kind": "type_alias", "line": 25, "name": "device_t", "signature": "typedef struct device device_t;"}, {"kind": "function", "line": 56, "name": "device_register", "signature": "int device_register(device_t *dev);"}, {"kind": "function", "line": 57, "name": "device_find", "signature": "device_t *device_find(const char *name);"}, {"kind": "function", "line": 58, "name": "device_find_by_type", "signature": "device_t *device_find_by_type(int type);"}, {"kind": "function", "line": 59, "name": "device_count", "signature": "int device_count(void);"}, {"kind": "function", "line": 60, "name": "device_reset", "signature": "void device_reset(void);"}, {"kind": "macro", "line": 2, "name": "DRIVER_H", "signature": "#define DRIVER_H"}, {"kind": "macro", "line": 18, "name": "DEV_NAME_LEN", "signature": "#define DEV_NAME_LEN"}, {"kind": "macro", "line": 19, "name": "DEV_MAX", "signature": "#define DEV_MAX"}, {"kind": "macro", "line": 21, "name": "DEV_TYPE_BLOCK", "signature": "#define DEV_TYPE_BLOCK"}, {"kind": "macro", "line": 22, "name": "DEV_TYPE_AUDIO", "signature": "#define DEV_TYPE_AUDIO"}, {"kind": "macro", "line": 23, "name": "DEV_TYPE_NET", "signature": "#define DEV_TYPE_NET"}, {"kind": "macro", "line": 24, "name": "DEV_TYPE_CHAR", "signature": "#define DEV_TYPE_CHAR"}]}, {"doc": "Keyboard layout: US qwerty (default) or Spanish (Spain) qwerty. Toggled from the taskbar widget or the `kbd` shell builtin.", "id": "headers/drivers/kbd.h", "kind": "module", "label": "kbd.h", "language": "h", "sha256": "9f0bf20dd7260637", "symbol_count": 24, "symbols": [{"kind": "function", "line": 9, "name": "kbd_available", "signature": "int kbd_available(void);"}, {"kind": "function", "line": 10, "name": "kbd_read", "signature": "int kbd_read(void);"}, {"kind": "function", "line": 11, "name": "kbd_feed_scancode", "signature": "int kbd_feed_scancode(unsigned char sc);"}, {"kind": "function", "line": 12, "name": "kbd_reset_for_shell", "signature": "void kbd_reset_for_shell(void);"}, {"doc": "Keyboard layout: US qwerty (default) or Spanish (Spain) qwerty. Toggled * from the taskbar widget or the `kbd` shell builtin. #define KBD_LAYOUT_EN 0 #define KBD_LAYOUT_ES 1 int kbd_available(void); int kbd_read(void); int kbd_feed_scancode(unsigned char sc); void kbd_reset_for_shell(void); /* Layout selection", "kind": "function", "line": 15, "name": "kbd_get_layout", "signature": "int kbd_get_layout(void);"}, {"kind": "function", "line": 16, "name": "kbd_set_layout", "signature": "void kbd_set_layout(int layout);"}, {"kind": "function", "line": 17, "name": "kbd_toggle_layout", "signature": "void kbd_toggle_layout(void);"}, {"doc": "Printable test for console input: ASCII 32..126 plus Latin-1 160..255 (the ES layout emits single-byte Latin-1 for ñ ¡ ¿ ´ ¨ · ª º ç Ç ¬). * DEL (127) and the C1 controls (128..159) are never input. static inline int kbd_is_printable(int c) { return (c >= 32 && c <= 126) || (c >= 160 && c <= 255); } /* Translated queue (shell input)", "kind": "function", "line": 27, "name": "kbd_q_empty", "signature": "int kbd_q_empty(void);"}, {"kind": "function", "line": 28, "name": "kbd_q_pop", "signature": "int kbd_q_pop(void);"}, {"kind": "function", "line": 29, "name": "kbd_q_push", "signature": "void kbd_q_push(unsigned char c);"}, {"doc": "Printable test for console input: ASCII 32..126 plus Latin-1 160..255 (the ES layout emits single-byte Latin-1 for ñ ¡ ¿ ´ ¨ · ª º ç Ç ¬). * DEL (127) and the C1 controls (128..159) are never input. static inline int kbd_is_printable(int c) { return (c >= 32 && c <= 126) || (c >= 160 && c <= 255); } /* Translated queue (shell input) int  kbd_q_empty(void); int  kbd_q_pop(void); void kbd_q_push(unsigned char c); /** Docstring: Drop counters for full cooked and raw queues.", "kind": "function", "line": 32, "name": "kbd_drop_counts", "signature": "void kbd_drop_counts(unsigned long *cooked, unsigned long *raw);"}, {"doc": "DEL (127) and the C1 controls (128..159) are never input. static inline int kbd_is_printable(int c) { return (c >= 32 && c <= 126) || (c >= 160 && c <= 255); } /* Translated queue (shell input) int  kbd_q_empty(void); int  kbd_q_pop(void); void kbd_q_push(unsigned char c); /** Docstring: Drop counters for full cooked and raw queues. void kbd_drop_counts(unsigned long *cooked, unsigned long *raw); /* Raw queue (DOOM / SYS_KBD)", "kind": "function", "line": 35, "name": "kbd_raw_mode_get", "signature": "int kbd_raw_mode_get(void);"}, {"kind": "function", "line": 36, "name": "kbd_raw_mode_set", "signature": "void kbd_raw_mode_set(int on);"}, {"kind": "function", "line": 37, "name": "kbd_raw_empty", "signature": "int kbd_raw_empty(void);"}, {"kind": "function", "line": 38, "name": "kbd_raw_pop", "signature": "int kbd_raw_pop(void);"}, {"kind": "function", "line": 39, "name": "kbd_raw_push_byte", "signature": "void kbd_raw_push_byte(unsigned char c);"}, {"kind": "function", "line": 40, "name": "kbd_e0_get", "signature": "int kbd_e0_get(void);"}, {"kind": "function", "line": 41, "name": "kbd_e0_set", "signature": "void kbd_e0_set(int v);"}, {"kind": "function", "line": 42, "name": "kbd_flush_all", "signature": "void kbd_flush_all(void);"}, {"kind": "function", "line": 43, "name": "kbd_raw_flush", "signature": "void kbd_raw_flush(void);"}, {"doc": "Raw-path WM filter for the SYS_KBD direct-port read (DOOM/Quake/Nuklear read scancodes one byte per syscall, bypassing kbd_read): tracks E0 and modifiers, performs Alt+Tab / Super+Tab / Super+arrows / Alt+Enter,M,X,Q and swallows the consumed bytes. Returns 1 when sc must not reach the * app. Declared here so kernel/syscalls.c shares the one implementation.", "kind": "function", "line": 50, "name": "kbd_sys_raw_filter", "signature": "int kbd_sys_raw_filter(unsigned char sc);"}, {"kind": "macro", "line": 2, "name": "KBD_H", "signature": "#define KBD_H"}, {"kind": "macro", "line": 6, "name": "KBD_LAYOUT_EN", "signature": "#define KBD_LAYOUT_EN"}, {"kind": "macro", "line": 7, "name": "KBD_LAYOUT_ES", "signature": "#define KBD_LAYOUT_ES"}]}, {"doc": "Docstring: Unified modifier tracking for cooked and raw paths.", "id": "headers/drivers/modifiers.h", "kind": "module", "label": "modifiers.h", "language": "h", "sha256": "9d3e86d154782b59", "symbol_count": 11, "symbols": [{"doc": "#ifndef MODIFIERS_H #define MODIFIERS_H /** Docstring: Unified modifier tracking for cooked and raw paths.", "kind": "struct", "line": 5, "name": "modifier_state_t"}, {"doc": "Docstring: Key codes feeding the tracker, one config per layout.  The right-hand members are only recognised when the event carries the 0xE0 prefix, which is how scancode set 1 disambiguates the two halves of each pair. Right Alt is the exception that proves the rule: on a Spanish * layout it is AltGr, so it feeds the separate altgr bit rather than alt.", "kind": "struct", "line": 19, "name": "modifier_keys_t"}, {"doc": "int ctrl_r; int alt_l; int alt_r; int super_l; int super_r; } modifier_keys_t; #define MOD_SHIFT (1 << 0) #define MOD_CTRL  (1 << 1) #define MOD_ALT   (1 << 2) #define MOD_ALTGR (1 << 3) #define MOD_SUPER (1 << 4) /** Docstring: Clear every modifier, shell reset path.", "kind": "function", "line": 37, "name": "modifiers_init", "signature": "static inline void modifiers_init(modifier_state_t *st)"}, {"doc": "Docstring: Track one make or break code, 1 when consumed.  Set 1 gives both halves of Ctrl, Alt and Super the same base code and separates them with 0xE0, so an unprefixed code is always the left one. Right Ctrl arrived from a PS/2 keyboard and from a USB HID report with no prefix difference at all before this, and was silently dropped: the state * said Ctrl was up while a key was physically held.", "kind": "function", "line": 54, "name": "modifiers_update", "signature": "static inline int modifiers_update(const modifier_keys_t *keys,\n                                 ..."}, {"doc": "return 1; } if (code == keys->alt_r) { st->altgr = pressed; return 1; } if (code == keys->super_l || code == keys->super_r) { st->super = pressed; return 1; } return 0; } /** Docstring: True when the state covers every bit in mask.", "kind": "function", "line": 92, "name": "modifiers_match", "signature": "static inline int modifiers_match(const modifier_state_t *st, int mask)"}, {"kind": "macro", "line": 2, "name": "MODIFIERS_H", "signature": "#define MODIFIERS_H"}, {"kind": "macro", "line": 30, "name": "MOD_SHIFT", "signature": "#define MOD_SHIFT"}, {"kind": "macro", "line": 31, "name": "MOD_CTRL", "signature": "#define MOD_CTRL"}, {"kind": "macro", "line": 32, "name": "MOD_ALT", "signature": "#define MOD_ALT"}, {"kind": "macro", "line": 33, "name": "MOD_ALTGR", "signature": "#define MOD_ALTGR"}, {"kind": "macro", "line": 34, "name": "MOD_SUPER", "signature": "#define MOD_SUPER"}]}, {"doc": "Docstring: mouse.h -- boundary of the PS/2 mouse device driver", "id": "headers/drivers/mouse.h", "kind": "module", "label": "mouse.h", "language": "h", "sha256": "10b239e18b7968b5", "symbol_count": 4, "symbols": [{"doc": "Docstring: mouse.h -- boundary of the PS/2 mouse device driver (drivers/mouse.c). Owns the controller handshake, the Intellimouse * detect knock and the enable/disable verbs. #include \"kernel.h\" /** Docstring: Detect the wheel mouse and enable data reporting.", "kind": "function", "line": 11, "name": "mouse_hw_init", "signature": "void mouse_hw_init(void);"}, {"doc": "Docstring: mouse.h -- boundary of the PS/2 mouse device driver (drivers/mouse.c). Owns the controller handshake, the Intellimouse * detect knock and the enable/disable verbs. #include \"kernel.h\" /** Docstring: Detect the wheel mouse and enable data reporting. void mouse_hw_init(void); /** Docstring: Disable mouse data reporting.", "kind": "function", "line": 14, "name": "mouse_disable", "signature": "void mouse_disable(void);"}, {"doc": "Docstring: mouse.h -- boundary of the PS/2 mouse device driver (drivers/mouse.c). Owns the controller handshake, the Intellimouse * detect knock and the enable/disable verbs. #include \"kernel.h\" /** Docstring: Detect the wheel mouse and enable data reporting. void mouse_hw_init(void); /** Docstring: Disable mouse data reporting. void mouse_disable(void); /** Docstring: Enable mouse data reporting.", "kind": "function", "line": 17, "name": "mouse_enable", "signature": "void mouse_enable(void);"}, {"kind": "macro", "line": 2, "name": "MOUSE_H", "signature": "#define MOUSE_H"}]}, {"id": "headers/drivers/nvme.h", "kind": "module", "label": "nvme.h", "language": "h", "sha256": "8a719e2dbbdb4e0c", "symbol_count": 7, "symbols": [{"kind": "function", "line": 4, "name": "nvme_init", "signature": "int nvme_init(void);"}, {"kind": "function", "line": 5, "name": "nvme_present", "signature": "int nvme_present(void);"}, {"kind": "function", "line": 6, "name": "nvme_version", "signature": "unsigned nvme_version(void);"}, {"kind": "function", "line": 7, "name": "nvme_note", "signature": "const char *nvme_note(void);"}, {"kind": "function", "line": 8, "name": "nvme_sectors", "signature": "unsigned long nvme_sectors(void);"}, {"kind": "function", "line": 9, "name": "nvme_read_sectors", "signature": "int nvme_read_sectors(unsigned lba, unsigned count, void *buf);"}, {"kind": "macro", "line": 2, "name": "DRIVERS_NVME_H", "signature": "#define DRIVERS_NVME_H"}]}, {"doc": "Docstring: drivers/pci.h -- PCI configuration-space access.", "id": "headers/drivers/pci.h", "kind": "module", "label": "pci.h", "language": "h", "sha256": "7210ad5414d179f2", "symbol_count": 54, "symbols": [{"doc": "Docstring: Sweeps of the bus walk before it gives up. One sweep visits every bus number, so a second sweep only happens when a bridge led to a bus numbered below the bridge itself; four covers any real topology with * room to spare and keeps the walk finite. #define PCI_CLASS_MAX_PASSES 4u /** Docstring: Address of a device on the bus, as found by the walk.", "kind": "struct", "line": 71, "name": "pci_bdf_t"}, {"doc": "Docstring: Read one config dword. (bus, dev, func, reg) with reg dword-aligned by construction (low two bits masked, never a * misaligned access).", "kind": "function", "line": 80, "name": "pci_cfg_read", "signature": "static inline unsigned pci_cfg_read(unsigned bus, unsigned dev,\n        unsigned func, unsigned r..."}, {"doc": "Docstring: Read one config dword. (bus, dev, func, reg) with reg dword-aligned by construction (low two bits masked, never a * misaligned access). static inline unsigned pci_cfg_read(unsigned bus, unsigned dev, unsigned func, unsigned reg, void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { outl(PCI_CFG_ADDR, 0x80000000u | (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xFCu)); return inl(PCI_CFG_DATA); } /** Docstring: Write one config dword. Same addressing as read.", "kind": "function", "line": 90, "name": "pci_cfg_write", "signature": "static inline void pci_cfg_write(unsigned bus, unsigned dev,\n        unsigned func, unsigned reg,..."}, {"doc": "Docstring: Read a config byte. The window is dword aligned once; the * byte selector rides in the low address bits, never a byte port op.", "kind": "function", "line": 100, "name": "pci_cfg_read8", "signature": "static inline unsigned char pci_cfg_read8(unsigned bus, unsigned dev,\n        unsigned func, unsi..."}, {"doc": "Docstring: Read a config byte. The window is dword aligned once; the * byte selector rides in the low address bits, never a byte port op. static inline unsigned char pci_cfg_read8(unsigned bus, unsigned dev, unsigned func, unsigned reg, void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { unsigned dword = pci_cfg_read(bus, dev, func, reg, outl, inl); return (unsigned char)((dword >> ((reg & 3u) * 8u)) & 0xFFu); } /** Docstring: Write a config byte, read-modify-write on the window.", "kind": "function", "line": 109, "name": "pci_cfg_write8", "signature": "static inline void pci_cfg_write8(unsigned bus, unsigned dev,\n        unsigned func, unsigned reg..."}, {"doc": "Docstring: True when a function is populated. A dword read of vendor id returns all ones for an unpopulated function, which is also what a bus * with nothing behind bridge 0 returns, so this doubles as a bus probe.", "kind": "function", "line": 122, "name": "pci_present", "signature": "static inline int pci_present(unsigned bus, unsigned dev, unsigned func,\n        void (*outl)(uns..."}, {"kind": "function", "line": 134, "name": "xHCI", "signature": "* base class: an xHCI (0x0C/0x03/0x30) would look for class 0x03, and a PCI\n * bridge (0x06/0x04)..."}, {"doc": "Docstring: True when a function advertises more than one function in its * slot, so the walk must visit every function number, not just function 0.", "kind": "function", "line": 152, "name": "pci_is_multifunction", "signature": "static inline int pci_is_multifunction(unsigned bus, unsigned dev,\n        void (*outl)(unsigned ..."}, {"doc": "Docstring: Find a device by vendor/device ID on bus 0.  Returns the dev number, or -1 when absent. Bus-0 function-0 only: this is the QEMU seabios/OVMF layout, which is all the emulated single-function devices needed. A device that must also be found behind a chipset bridge * (any xHCI) uses pci_find_class, which walks.", "kind": "function", "line": 165, "name": "pci_find", "signature": "static inline int pci_find(unsigned vendor, unsigned device,\n        unsigned (*inl)(unsigned sho..."}, {"doc": "The walk starts at bus 0 and follows each PCI-to-PCI bridge's secondary bus number, so a controller behind a chipset bridge on real hardware is found exactly as one on QEMU's bus 0. Two 256-bit masks, 32 bytes of stack each: \"reachable\" (a bridge leads here) and \"scanned\" (already looked at). Reachability and scanning are separate so a bus numbered *below* the bridge that leads to it -- a forward reference, legal and real -- is still visited: the sweep runs again while it keeps reaching unscanned buses, bounded by PCI_CLASS_MAX_PASSES. A bus whose function 0 is empty is skipped whole, which makes an unpopulated range cost two reads per bus. Any class component may be PCI_CLASS_ANY.  Returns 1 and fills out on a hit, 0 when nothing matches (out is then * zeroed, so a caller that ignores the result still fails closed).", "kind": "function", "line": 193, "name": "pci_find_class", "signature": "static inline int pci_find_class(pci_bdf_t *out,\n        unsigned cls, unsigned subclass, unsigne..."}, {"doc": "outl, inl)) { unsigned sec = pci_cfg_read8(bus, dev, 0, PCI_REG_BRIDGE_SECONDARY, outl, inl); if (sec != 0u && sec < PCI_MAX_BUS && !(seen[sec >> 6] & (1ULL << (sec & 63u)))) reach[sec >> 6] |= 1ULL << (sec & 63u); } } } if (!progress) break; } return 0; } /** Docstring: Number of 64-bit BARs in the bar/6 dword.", "kind": "function", "line": 248, "name": "pci_bar_count", "signature": "static inline unsigned pci_bar_count(unsigned bus, unsigned dev, unsigned func,\n        void (*ou..."}, {"doc": "void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { unsigned n = 0; while (n < PCI_REG_BAR_COUNT) { unsigned bar = pci_cfg_read(bus, dev, func, PCI_REG_BAR0 + n * 4u, outl, inl); if (bar == 0u || bar == PCI_ABSENT_ID) break; n++; if (bar & PCI_BAR_64BIT) n++; } return n; } /** Docstring: True when a BAR is an I/O port range rather than memory.", "kind": "function", "line": 263, "name": "pci_bar_is_io", "signature": "static inline int pci_bar_is_io(unsigned bus, unsigned dev, unsigned func,\n        unsigned bar,\n..."}, {"doc": "Docstring: True when a BAR is a 64-bit memory BAR, so its high dword is * the next BAR slot and must be programmed together with it.", "kind": "function", "line": 274, "name": "pci_bar_is_64bit", "signature": "static inline int pci_bar_is_64bit(unsigned bus, unsigned dev, unsigned func,\n        unsigned ba..."}, {"doc": "Docstring: True when a BAR is a 64-bit memory BAR, so its high dword is * the next BAR slot and must be programmed together with it. static inline int pci_bar_is_64bit(unsigned bus, unsigned dev, unsigned func, unsigned bar, void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { unsigned val = pci_cfg_read(bus, dev, func, PCI_REG_BAR0 + bar * 4u, outl, inl); return (val & PCI_BAR_IO) == 0 && (val & PCI_BAR_64BIT) != 0; } /** Docstring: Count of trailing zero bits in a 32-bit word, 32 for zero.", "kind": "function", "line": 284, "name": "pci_bar_ctz32", "signature": "static inline unsigned pci_bar_ctz32(unsigned val)"}, {"doc": "A BAR that fits below 4 GB has its unimplemented lines in the low half and an all-ones high half. Reading the high half as the answer instead -- because it is the half that looks non-empty -- reports 2^32 for a 64 KB window and refuses every controller.  A BAR above 4 GB implements all 32 low lines, so the low half is all ones and the count comes from the high half.  Only the low half carries the type bits, which are fields rather than address lines, so only the low half is masked. Applying the same nibble mask to the high half invents four unimplemented lines there and reports a window sixteen times too small. A mask with no unimplemented line in either half describes no window and is refused, which is the fail-closed answer a * caller must refuse on.", "kind": "function", "line": 315, "name": "pci_bar_size_from_mask", "signature": "static inline unsigned long long pci_bar_size_from_mask(unsigned long long mask)"}, {"doc": "The mask is what proves the region is big enough; a size is never assumed from a spec table because a wrong answer is a window overrun on hardware that disagrees. Writing all ones makes the device drive its address lines with the unmasked bits, so the read-back mask has zeroes exactly where address lines exist. The original value is restored before returning, so a caller that then relocates the BAR starts from the firmware assignment rather than from all ones.  Returns 0 for an absent function, an I/O BAR, or a BAR with no address bits at all -- all of which are hard failures for an MMIO driver.  The caller must clear PCI_COMMAND_MEMORY first: writing all ones leaves the device decoding a different address than the one the command register * authorizes, and a device that is still decoding sees its own probe.", "kind": "function", "line": 346, "name": "pci_bar_size", "signature": "static inline unsigned long long pci_bar_size(unsigned bus, unsigned dev,\n        unsigned func, ..."}, {"doc": "Docstring: Program a memory BAR with a physical base address.  Legal only while the command register's memory-space-enable bit is clear: the device must not be decoding at the old address while the BAR changes. A 64-bit BAR takes its high dword from base's upper half, so a caller relocating into a 32-bit window must pass a base whose upper half is zero rather than expecting truncation. Returns 1 on success, 0 when the device * is absent or the BAR is an I/O range.", "kind": "function", "line": 382, "name": "pci_bar_relocate", "signature": "static inline int pci_bar_relocate(unsigned bus, unsigned dev, unsigned func,\n        unsigned ba..."}, {"doc": "Docstring: Physical base a memory BAR is programmed with, read back from the device. Returns 0 for an absent function, an I/O BAR, or a BAR left unassigned, all of which a caller must refuse on.  A 64-bit BAR's high half is zero when the address fits below 4 GB, which is the common case, so the two halves are combined by adding rather than by choosing: a 32-bit BAR's second dword is not part of the BAR at all and * holds whatever the next BAR or a bridge window put there.", "kind": "function", "line": 406, "name": "pci_bar_base", "signature": "static inline unsigned long long pci_bar_base(unsigned bus, unsigned dev,\n        unsigned func, ..."}, {"doc": "Docstring: Restore a BAR pair to previously saved raw values. Used to put a device back exactly as firmware left it when a probe bails, so a later * driver or a warm reboot sees the original assignment.", "kind": "function", "line": 424, "name": "pci_bar_restore", "signature": "static inline void pci_bar_restore(unsigned bus, unsigned dev,\n        unsigned func, unsigned ba..."}, {"kind": "macro", "line": 11, "name": "DRIVERS_PCI_H", "signature": "#define DRIVERS_PCI_H"}, {"kind": "macro", "line": 13, "name": "PCI_CFG_ADDR", "signature": "#define PCI_CFG_ADDR"}, {"kind": "macro", "line": 14, "name": "PCI_CFG_DATA", "signature": "#define PCI_CFG_DATA"}, {"kind": "macro", "line": 15, "name": "PCI_MAX_BUS", "signature": "#define PCI_MAX_BUS"}, {"kind": "macro", "line": 16, "name": "PCI_MAX_DEV", "signature": "#define PCI_MAX_DEV"}, {"kind": "macro", "line": 17, "name": "PCI_MAX_FUNC", "signature": "#define PCI_MAX_FUNC"}, {"kind": "macro", "line": 20, "name": "PCI_REG_VENDOR_ID", "signature": "#define PCI_REG_VENDOR_ID"}, {"kind": "macro", "line": 21, "name": "PCI_REG_COMMAND", "signature": "#define PCI_REG_COMMAND"}, {"kind": "macro", "line": 22, "name": "PCI_REG_CLASS_REV", "signature": "#define PCI_REG_CLASS_REV"}, {"kind": "macro", "line": 23, "name": "PCI_REG_CLASS_PROGIF", "signature": "#define PCI_REG_CLASS_PROGIF"}, {"kind": "macro", "line": 24, "name": "PCI_REG_HEADER_TYPE", "signature": "#define PCI_REG_HEADER_TYPE"}, {"kind": "macro", "line": 25, "name": "PCI_REG_BAR0", "signature": "#define PCI_REG_BAR0"}, {"kind": "macro", "line": 26, "name": "PCI_REG_CARD_BUS", "signature": "#define PCI_REG_CARD_BUS"}, {"kind": "macro", "line": 27, "name": "PCI_REG_BRIDGE_SECONDARY", "signature": "#define PCI_REG_BRIDGE_SECONDARY"}, {"kind": "macro", "line": 28, "name": "PCI_REG_CAP_PTR", "signature": "#define PCI_REG_CAP_PTR"}, {"kind": "macro", "line": 29, "name": "PCI_REG_BAR_COUNT", "signature": "#define PCI_REG_BAR_COUNT"}, {"kind": "macro", "line": 32, "name": "PCI_COMMAND_IO", "signature": "#define PCI_COMMAND_IO"}, {"kind": "macro", "line": 33, "name": "PCI_COMMAND_MEMORY", "signature": "#define PCI_COMMAND_MEMORY"}, {"kind": "macro", "line": 34, "name": "PCI_COMMAND_BUS_MASTER", "signature": "#define PCI_COMMAND_BUS_MASTER"}, {"kind": "macro", "line": 37, "name": "PCI_BAR_TYPE_MASK", "signature": "#define PCI_BAR_TYPE_MASK"}, {"kind": "macro", "line": 38, "name": "PCI_BAR_IO", "signature": "#define PCI_BAR_IO"}, {"kind": "macro", "line": 39, "name": "PCI_BAR_64BIT", "signature": "#define PCI_BAR_64BIT"}, {"kind": "macro", "line": 40, "name": "PCI_BAR_PREFETCH", "signature": "#define PCI_BAR_PREFETCH"}, {"kind": "macro", "line": 41, "name": "PCI_BAR_ADDR_MASK", "signature": "#define PCI_BAR_ADDR_MASK"}, {"kind": "macro", "line": 44, "name": "PCI_ABSENT_ID", "signature": "#define PCI_ABSENT_ID"}, {"kind": "macro", "line": 45, "name": "PCI_HEADER_MULTIFUNC", "signature": "#define PCI_HEADER_MULTIFUNC"}, {"kind": "macro", "line": 46, "name": "PCI_HEADER_TYPE_MASK", "signature": "#define PCI_HEADER_TYPE_MASK"}, {"kind": "macro", "line": 47, "name": "PCI_HDR_TYPE_BRIDGE", "signature": "#define PCI_HDR_TYPE_BRIDGE"}, {"kind": "macro", "line": 55, "name": "PCI_CLASS_BRIDGE", "signature": "#define PCI_CLASS_BRIDGE"}, {"kind": "macro", "line": 56, "name": "PCI_SUBCLASS_PCI_BRIDGE", "signature": "#define PCI_SUBCLASS_PCI_BRIDGE"}, {"kind": "macro", "line": 57, "name": "PCI_CLASS_XHCI", "signature": "#define PCI_CLASS_XHCI"}, {"kind": "macro", "line": 58, "name": "PCI_SUBCLASS_XHCI", "signature": "#define PCI_SUBCLASS_XHCI"}, {"kind": "macro", "line": 59, "name": "PCI_PROGIF_XHCI", "signature": "#define PCI_PROGIF_XHCI"}, {"kind": "macro", "line": 62, "name": "PCI_CLASS_ANY", "signature": "#define PCI_CLASS_ANY"}, {"kind": "macro", "line": 68, "name": "PCI_CLASS_MAX_PASSES", "signature": "#define PCI_CLASS_MAX_PASSES"}]}, {"doc": "Docstring: drivers/usbblk.h -- boundary of the USB mass-storage driver.", "id": "headers/drivers/usbblk.h", "kind": "module", "label": "usbblk.h", "language": "h", "sha256": "c9892d4f424a9251", "symbol_count": 13, "symbols": [{"doc": "Docstring: Counters, so a disk that is absent is distinguishable from a * driver that is broken.", "kind": "struct", "line": 37, "name": "ubk_counters_t"}, {"doc": "Docstring: Bring up mass storage on every enumerated device. Returns the number of disks registered, which is 0 on a machine with none and is not an * error.", "kind": "function", "line": 21, "name": "ubk_init", "signature": "int ubk_init(void);"}, {"doc": "Docstring: Bring up mass storage on every enumerated device. Returns the number of disks registered, which is 0 on a machine with none and is not an * error. int ubk_init(void); /** Docstring: True when a USB disk was registered and is the active backend.", "kind": "function", "line": 24, "name": "ubk_present", "signature": "int ubk_present(void);"}, {"doc": "Docstring: Bring up mass storage on every enumerated device. Returns the number of disks registered, which is 0 on a machine with none and is not an * error. int ubk_init(void); /** Docstring: True when a USB disk was registered and is the active backend. int ubk_present(void); /** Docstring: Sector count of the registered disk.", "kind": "function", "line": 27, "name": "ubk_sectors", "signature": "unsigned long ubk_sectors(void);"}, {"doc": "Docstring: Read or write whole 512-byte sectors. Returns 1 on success, 0 on a refused request: a range outside the disk, a short transfer, a * command failure or a stale CSW. Never reports a partial block as read.", "kind": "function", "line": 32, "name": "ubk_read_sectors", "signature": "int ubk_read_sectors(unsigned long lba, unsigned count, void *buf);"}, {"kind": "function", "line": 33, "name": "ubk_write_sectors", "signature": "int ubk_write_sectors(unsigned long lba, unsigned count, const void *buf);"}, {"doc": "Docstring: Counters, so a disk that is absent is distinguishable from a * driver that is broken. typedef struct { unsigned long commands; unsigned long read_blocks; unsigned long write_blocks; unsigned long failures; unsigned long stalls; } ubk_counters_t; /** Docstring: Snapshot the counters.", "kind": "function", "line": 46, "name": "ubk_counters", "signature": "void ubk_counters(ubk_counters_t *out);"}, {"doc": "Docstring: Build a Command Block Wrapper into out, which must have room for UBK_CBW_LEN bytes. Pure, for the host test: a CBW whose fields disagree with its arguments is a command the device must reject, and getting the * residue wrong makes a short write look complete.", "kind": "function", "line": 52, "name": "ubk_build_cbw", "signature": "void ubk_build_cbw(unsigned char *out, unsigned tag, unsigned long lba, unsigned blocks, int read, int data_len);"}, {"doc": "Docstring: Check a Command Status Wrapper. Returns 1 when the CSW matches the CBW it was sent with and reports success, 0 otherwise. Pure, for the same reason. The residue check is what catches a device that moved fewer bytes than asked for: without it a truncated sector read would be handed * back as good data.", "kind": "function", "line": 60, "name": "ubk_check_csw", "signature": "int ubk_check_csw(const unsigned char *csw, unsigned tag, unsigned expect_len);"}, {"kind": "macro", "line": 11, "name": "DRIVERS_USBBLK_H", "signature": "#define DRIVERS_USBBLK_H"}, {"kind": "macro", "line": 14, "name": "UBK_BLOCK_SIZE", "signature": "#define UBK_BLOCK_SIZE"}, {"kind": "macro", "line": 15, "name": "UBK_MAX_BLOCKS", "signature": "#define UBK_MAX_BLOCKS"}, {"kind": "macro", "line": 16, "name": "UBK_MAX_SECTORS", "signature": "#define UBK_MAX_SECTORS"}]}, {"doc": "Docstring: drivers/usbhid.h -- boundary of the USB HID boot-protocol driver.", "id": "headers/drivers/usbhid.h", "kind": "module", "label": "usbhid.h", "language": "h", "sha256": "de3e62d1d4a2baee", "symbol_count": 33, "symbols": [{"doc": "Docstring: Counters, so a device that is absent is distinguishable from a * driver that is broken.", "kind": "struct", "line": 108, "name": "usbhid_counters_t"}, {"doc": "Docstring: Bring up HID on every enumerated device and report what was found. Returns the number of HID interfaces claimed, which is 0 on a * machine with no HID device and is not an error.", "kind": "function", "line": 60, "name": "usbhid_init", "signature": "int usbhid_init(void);"}, {"doc": "Docstring: Service the interrupt endpoint of a claimed keyboard. One * report per call; returns 1 when a report was processed.", "kind": "function", "line": 64, "name": "usbhid_poll_keyboard", "signature": "int usbhid_poll_keyboard(void);"}, {"doc": "Docstring: Service the interrupt endpoint of a claimed mouse. One report * per call; returns 1 when a report was processed.", "kind": "function", "line": 68, "name": "usbhid_poll_mouse", "signature": "int usbhid_poll_mouse(void);"}, {"doc": "Docstring: Service the interrupt endpoint of a claimed mouse. One report * per call; returns 1 when a report was processed. int usbhid_poll_mouse(void); /** Docstring: Service both, for the tick bus. Returns the reports handled.", "kind": "function", "line": 71, "name": "usbhid_poll", "signature": "int usbhid_poll(void);"}, {"doc": "Docstring: True when a USB keyboard is driving the input path, so the keyboard driver can skip the PS/2 port instead of spinning on a controller * that does not exist on modern hardware.", "kind": "function", "line": 76, "name": "usbhid_keyboard_present", "signature": "int usbhid_keyboard_present(void);"}, {"doc": "Docstring: True when a USB keyboard is driving the input path, so the keyboard driver can skip the PS/2 port instead of spinning on a controller * that does not exist on modern hardware. int usbhid_keyboard_present(void); /** Docstring: True when a USB mouse is driving mouse_state.", "kind": "function", "line": 79, "name": "usbhid_mouse_present", "signature": "int usbhid_mouse_present(void);"}, {"doc": "Docstring: Feed a boot keyboard report through the differ, for the host test and the in-OS self test. Uses the first claimed keyboard's * stored previous report and updates it. Returns the scancodes emitted.", "kind": "function", "line": 84, "name": "usbhid_press_kbd_report", "signature": "int usbhid_press_kbd_report(const unsigned char report[HID_KBD_REPORT_LEN]);"}, {"doc": "Docstring: Set-1 scancode stream for one keyboard report transition.  Pure: no hardware, no kernel state, no allocation, which is what makes it host-testable. Breaks are emitted before makes, for modifiers and for keys alike, so a burst never reads as a held-key repeat. A key that merely moved slot within the array produces nothing, because the array order is the device's choice. Returns the number of scancodes written, which is less * than max only when the report produced no events.", "kind": "function", "line": 94, "name": "usbhid_kbd_scancodes", "signature": "int usbhid_kbd_scancodes(const unsigned char prev[HID_KBD_REPORT_LEN], const unsigned char cur[HID_KBD_REPORT_LEN], unsigned char *out, int max);"}, {"doc": "Docstring: Decode one boot mouse report transition into screen-space motion, buttons and wheel. Pure, for the same reason. dx and dy are raw report deltas; the caller applies the motion scale, matching the PS/2 * path so both sources move the pointer identically.", "kind": "function", "line": 102, "name": "usbhid_mouse_decode", "signature": "void usbhid_mouse_decode(const unsigned char prev[HID_MOUSE_REPORT_LEN], const unsigned char cur[HID_MOUSE_REPORT_LEN], int *dx, int *dy, int *buttons, int *wheel);"}, {"doc": "Docstring: Counters, so a device that is absent is distinguishable from a * driver that is broken. typedef struct { unsigned long kbd_reports; unsigned long mouse_reports; unsigned long scancodes; unsigned long transfer_errors; } usbhid_counters_t; /** Docstring: Snapshot the counters.", "kind": "function", "line": 116, "name": "usbhid_counters", "signature": "void usbhid_counters(usbhid_counters_t *out);"}, {"doc": "Docstring: Translate a HID usage code to its PS/2 set-1 make code and whether it needs the 0xE0 prefix. Returns 0 for a usage with no set-1 equivalent, which the caller drops rather than inventing a scancode for.  A pure function over a table, host-testable: HID usage ids are not scancodes above 0x27 (usage 0x28 is Return while set-1 Return is 0x1C), and the navigation cluster and the right-hand modifiers exist in one place on a USB keyboard while set-1 needs the prefix to tell them from their * left-hand twins. Both decisions live here so no caller has to know them.", "kind": "function", "line": 127, "name": "usbhid_set1_from_usage", "signature": "int usbhid_set1_from_usage(unsigned usage, unsigned char *sc, int *e0);"}, {"kind": "macro", "line": 12, "name": "DRIVERS_USBHID_H", "signature": "#define DRIVERS_USBHID_H"}, {"kind": "macro", "line": 15, "name": "HID_USAGE_MIN", "signature": "#define HID_USAGE_MIN"}, {"kind": "macro", "line": 16, "name": "HID_USAGE_MAX", "signature": "#define HID_USAGE_MAX"}, {"kind": "macro", "line": 17, "name": "HID_MODIFIER_BIT", "signature": "#define HID_MODIFIER_BIT(n)"}, {"kind": "macro", "line": 18, "name": "HID_MOD_LEFT_CTRL", "signature": "#define HID_MOD_LEFT_CTRL"}, {"kind": "macro", "line": 19, "name": "HID_MOD_LEFT_SHIFT", "signature": "#define HID_MOD_LEFT_SHIFT"}, {"kind": "macro", "line": 20, "name": "HID_MOD_LEFT_ALT", "signature": "#define HID_MOD_LEFT_ALT"}, {"kind": "macro", "line": 21, "name": "HID_MOD_LEFT_GUI", "signature": "#define HID_MOD_LEFT_GUI"}, {"kind": "macro", "line": 22, "name": "HID_MOD_RIGHT_CTRL", "signature": "#define HID_MOD_RIGHT_CTRL"}, {"kind": "macro", "line": 23, "name": "HID_MOD_RIGHT_SHIFT", "signature": "#define HID_MOD_RIGHT_SHIFT"}, {"kind": "macro", "line": 24, "name": "HID_MOD_RIGHT_ALT", "signature": "#define HID_MOD_RIGHT_ALT"}, {"kind": "macro", "line": 25, "name": "HID_MOD_RIGHT_GUI", "signature": "#define HID_MOD_RIGHT_GUI"}, {"kind": "macro", "line": 29, "name": "HID_KBD_REPORT_LEN", "signature": "#define HID_KBD_REPORT_LEN"}, {"kind": "macro", "line": 30, "name": "HID_KBD_SLOTS", "signature": "#define HID_KBD_SLOTS"}, {"kind": "macro", "line": 36, "name": "HID_MOUSE_REPORT_LEN", "signature": "#define HID_MOUSE_REPORT_LEN"}, {"kind": "macro", "line": 37, "name": "HID_MOUSE_BUTTON_MASK", "signature": "#define HID_MOUSE_BUTTON_MASK"}, {"kind": "macro", "line": 41, "name": "USBHID_MAX_REPORT_LEN", "signature": "#define USBHID_MAX_REPORT_LEN"}, {"kind": "macro", "line": 46, "name": "USBHID_TRUNCATED", "signature": "#define USBHID_TRUNCATED"}, {"kind": "macro", "line": 51, "name": "USBHID_PROTO_NONE", "signature": "#define USBHID_PROTO_NONE"}, {"kind": "macro", "line": 54, "name": "HID_REQ_SET_PROTOCOL", "signature": "#define HID_REQ_SET_PROTOCOL"}, {"kind": "macro", "line": 55, "name": "HID_PROTOCOL_BOOT", "signature": "#define HID_PROTOCOL_BOOT"}]}, {"doc": "Docstring: drivers/virtio_blk.h -- virtio-blk boundary.", "id": "headers/drivers/virtio_blk.h", "kind": "module", "label": "virtio_blk.h", "language": "h", "sha256": "979ac06da04a2c9a", "symbol_count": 7, "symbols": [{"kind": "function", "line": 11, "name": "vblk_init", "signature": "int vblk_init(void);"}, {"kind": "function", "line": 12, "name": "vblk_present", "signature": "int vblk_present(void);"}, {"kind": "function", "line": 13, "name": "vblk_sectors", "signature": "unsigned long vblk_sectors(void);"}, {"kind": "function", "line": 14, "name": "vblk_read_sectors", "signature": "int vblk_read_sectors(unsigned lba, unsigned count, void *buf);"}, {"kind": "function", "line": 15, "name": "vblk_write_sectors", "signature": "int vblk_write_sectors(unsigned lba, unsigned count, const void *buf);"}, {"doc": "sector contract: probe once, then read/write 512-byte sectors by LBA. The `vblk` builtin and the block-layer preference are * the only consumers; MiniFS itself never names a device. #ifndef DRIVERS_VIRTIO_BLK_H #define DRIVERS_VIRTIO_BLK_H int vblk_init(void); int vblk_present(void); unsigned long vblk_sectors(void); int vblk_read_sectors(unsigned lba, unsigned count, void *buf); int vblk_write_sectors(unsigned lba, unsigned count, const void *buf); /** Docstring: Publish vblk0 for the block layer preference.", "kind": "function", "line": 18, "name": "vblk_register_device", "signature": "void vblk_register_device(void);"}, {"kind": "macro", "line": 9, "name": "DRIVERS_VIRTIO_BLK_H", "signature": "#define DRIVERS_VIRTIO_BLK_H"}]}, {"doc": "Docstring: drivers/virtio_net.h -- virtio-net boundary.", "id": "headers/drivers/virtio_net.h", "kind": "module", "label": "virtio_net.h", "language": "h", "sha256": "8802d7e2f98f3081", "symbol_count": 9, "symbols": [{"doc": "Docstring: Probe PCI for a virtio-net device and bring both queues up. Idempotent: a second call reuses the live queues. Returns 1 when the device is ready, 0 when absent or unusable (fail-closed, * rtl8139 stays).", "kind": "function", "line": 16, "name": "vnet_init", "signature": "int vnet_init(void);"}, {"doc": "Docstring: Probe PCI for a virtio-net device and bring both queues up. Idempotent: a second call reuses the live queues. Returns 1 when the device is ready, 0 when absent or unusable (fail-closed, * rtl8139 stays). int vnet_init(void); /** Docstring: True once vnet_init brought the queues up.", "kind": "function", "line": 19, "name": "vnet_present", "signature": "int vnet_present(void);"}, {"kind": "function", "line": 22, "name": "failure", "signature": "* 0 on failure (no device, oversize, or TX deadline expiry). Pads * short frames to 60 bytes like the rtl8139 path. */ int vnet_send(const unsigned char *frame, unsigned len);"}, {"doc": "Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks.", "kind": "function", "line": 28, "name": "vnet_poll", "signature": "void vnet_poll(void);"}, {"doc": "Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes).", "kind": "function", "line": 31, "name": "vnet_get_mac", "signature": "void vnet_get_mac(unsigned char out[6]);"}, {"doc": "Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]); /** Docstring: The NIC I/O base, or 0 when the device is absent.", "kind": "function", "line": 34, "name": "vnet_iobase", "signature": "unsigned short vnet_iobase(void);"}, {"doc": "Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]); /** Docstring: The NIC I/O base, or 0 when the device is absent. unsigned short vnet_iobase(void); /** Docstring: Frame-level TX/RX counters.", "kind": "function", "line": 37, "name": "vnet_counters", "signature": "void vnet_counters(unsigned int *tx_frames, unsigned int *rx_frames);"}, {"doc": "Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]); /** Docstring: The NIC I/O base, or 0 when the device is absent. unsigned short vnet_iobase(void); /** Docstring: Frame-level TX/RX counters. void vnet_counters(unsigned int *tx_frames, unsigned int *rx_frames); /** Docstring: Link-up status from the config space.", "kind": "function", "line": 40, "name": "vnet_link_up", "signature": "int vnet_link_up(void);"}, {"kind": "macro", "line": 10, "name": "DRIVERS_VIRTIO_NET_H", "signature": "#define DRIVERS_VIRTIO_NET_H"}]}, {"doc": "Docstring: drivers/xhci.h -- boundary of the xHCI host controller driver.", "id": "headers/drivers/xhci.h", "kind": "module", "label": "xhci.h", "language": "h", "sha256": "dc025de6f1e35266", "symbol_count": 51, "symbols": [{"doc": "Docstring: One interface of a device with its endpoints, recovered from a * configuration descriptor. Filled by xhc_open_interface.", "kind": "struct", "line": 94, "name": "xhc_iface_t"}, {"doc": "Docstring: What one root port currently holds. Every field is read from * PORTSC, never inferred.", "kind": "struct", "line": 107, "name": "xhc_port_t"}, {"doc": "Docstring: What one root port currently holds. Every field is read from * PORTSC, never inferred. typedef struct { int connected; int enabled; int speed; int power; } xhc_port_t; /** Docstring: Per-device state the class drivers read back.", "kind": "struct", "line": 115, "name": "xhc_dev_t"}, {"doc": "Docstring: Counters, so a zero is attributable rather than mysterious. * Every field is incremented by the code path that did the work.", "kind": "struct", "line": 124, "name": "xhc_counters_t"}, {"doc": "Docstring: Bring up the first xHCI controller found. Returns 1 when a controller is running and xhc_poll will service it, 0 when there is none, which is the normal case on QEMU and on a machine whose firmware already owns the controller. Never leaves a half-mapped BAR behind: any failure * restores the firmware's assignment.", "kind": "function", "line": 140, "name": "xhc_init", "signature": "int xhc_init(void);"}, {"doc": "Docstring: Service the event ring. Drains every pending TRB and completes the matching transfer. Safe to call from any context, any number of times, with interrupts on or off; it allocates nothing and takes no lock. * Returns 1 when it completed something.", "kind": "function", "line": 146, "name": "xhc_poll", "signature": "int xhc_poll(void);"}, {"doc": "Docstring: Number of root ports the controller reports, bounded by * XHC_MAX_PORTS.", "kind": "function", "line": 150, "name": "xhc_port_count", "signature": "int xhc_port_count(void);"}, {"doc": "Docstring: Read a root port's live state. Returns 1 on a valid port * number, 0 otherwise, and leaves out zeroed on refusal.", "kind": "function", "line": 154, "name": "xhc_port_state", "signature": "int xhc_port_state(int port, xhc_port_t *out);"}, {"doc": "Docstring: Reset a port and wait for the device on it to be addressable. Returns 1 when the port reports a connected, powered, * enabled device.", "kind": "function", "line": 159, "name": "xhc_port_reset", "signature": "int xhc_port_reset(int port);"}, {"doc": "Docstring: Reset, address, describe and register the device on a port. Returns its index, or -1 on any failure, in which case the slot is released and the error is counted. Idempotent per port: a port already * holding a live device returns that device's index.", "kind": "function", "line": 165, "name": "xhc_enumerate", "signature": "int xhc_enumerate(int port);"}, {"doc": "Docstring: Enumerate every port that has something attached. Returns the * number of devices registered by this call.", "kind": "function", "line": 169, "name": "xhc_enumerate_all", "signature": "int xhc_enumerate_all(void);"}, {"doc": "Docstring: Enumerate every port that has something attached. Returns the * number of devices registered by this call. int xhc_enumerate_all(void); /** Docstring: Number of devices enumerated so far.", "kind": "function", "line": 172, "name": "xhc_device_count", "signature": "int xhc_device_count(void);"}, {"doc": "Docstring: Enumerate every port that has something attached. Returns the * number of devices registered by this call. int xhc_enumerate_all(void); /** Docstring: Number of devices enumerated so far. int xhc_device_count(void); /** Docstring: Fetch one enumerated device's state.", "kind": "function", "line": 175, "name": "xhc_device_info", "signature": "int xhc_device_info(int index, xhc_dev_t *out);"}, {"doc": "Docstring: Find an interface of an enumerated device by class triple and copy out its endpoints.  A pure function over the cached configuration descriptor, with every descriptor's bLength, type and remaining span checked before use: an unterminated or zero-length descriptor ends the walk instead of looping, and the endpoint count is capped by XHC_MAX_EPS. out is zeroed first, so a caller that ignores the result sees a zeroed interface, never stale * stack. Returns 1 on a match with at least one endpoint, 0 otherwise.", "kind": "function", "line": 186, "name": "xhc_open_interface", "signature": "int xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto, xhc_iface_t *out);"}, {"doc": "Docstring: Issue a control transfer on the control endpoint of a device. setup is the eight setup bytes, already packed, including the direction bit of bmRequestType. host_to_device selects a write data stage. Returns 1 on * a completed transfer, 0 on a stall, a timeout or a short phase.", "kind": "function", "line": 193, "name": "xhc_control", "signature": "int xhc_control(int index, const unsigned char setup[8], void *data, unsigned len, int host_to_device);"}, {"doc": "Docstring: Configure one non-control endpoint and give it a transfer ring. ep_index is the endpoint context index, 1..XHC_EP_INDEX_LIMIT-1. ep_addr carries the address and direction bits. Returns 1 on success, 0 on * a bad index, a device that is not addressed, or an allocation failure.", "kind": "function", "line": 200, "name": "xhc_configure_endpoint", "signature": "int xhc_configure_endpoint(int index, int ep_index, int ep_addr, int ep_type, int max_packet, int mult, int interval, int burst);"}, {"doc": "Docstring: Move data on a configured endpoint and wait for its transfer event. len must be exactly what the endpoint's protocol transfers: one HID report, or a whole number of 512-byte blocks. got receives the byte count only for the zero-length case, which is how a device reports \"nothing new\"; otherwise the transfer either completed at len or failed.  Returns 1 when the device completed the transfer, 0 on a stall, a transfer * error, or a timeout.", "kind": "function", "line": 211, "name": "xhc_transfer", "signature": "int xhc_transfer(int index, int ep_index, void *buf, unsigned len, int *got);"}, {"doc": "Docstring: Stop, reset and re-point one endpoint's transfer ring after a stall or a timeout, so Bulk-Only recovery continues on the same ring. * Returns 1 when the endpoint is usable again.", "kind": "function", "line": 216, "name": "xhc_reset_endpoint", "signature": "int xhc_reset_endpoint(int index, int ep_index);"}, {"doc": "Docstring: Post one endpoint transfer without waiting. Returns the token * for xhc_poll_token, or 0 on refusal.", "kind": "function", "line": 220, "name": "xhc_transfer_async", "signature": "int xhc_transfer_async(int index, int ep_index, void *buf, unsigned len);"}, {"doc": "Docstring: Non-blocking completion check: 1 on success, -1 on a failed completion, -2 past the transfer budget, 0 while outstanding. A zero * budget never expires, for interrupt endpoints whose silence is NAKs.", "kind": "function", "line": 225, "name": "xhc_poll_token_limit", "signature": "int xhc_poll_token_limit(int token, unsigned budget_ms);"}, {"kind": "function", "line": 226, "name": "xhc_poll_token", "signature": "int xhc_poll_token(int token);"}, {"doc": "Docstring: Non-blocking completion check: 1 on success, -1 on a failed completion, -2 past the transfer budget, 0 while outstanding. A zero * budget never expires, for interrupt endpoints whose silence is NAKs. int xhc_poll_token_limit(int token, unsigned budget_ms); int xhc_poll_token(int token); /** Docstring: Snapshot the counters.", "kind": "function", "line": 229, "name": "xhc_counters", "signature": "void xhc_counters(xhc_counters_t *out);"}, {"doc": "Docstring: Why the last xhc_init failed, or NULL when it succeeded. Reported by the usb builtin so an absent controller and a refused one are * distinguishable.", "kind": "function", "line": 234, "name": "xhc_probe_note", "signature": "const char *xhc_probe_note(void);"}, {"doc": "Docstring: Controller version and capability-derived limits for the usb * builtin. Returns 1 when a controller is present.", "kind": "function", "line": 238, "name": "xhc_info", "signature": "int xhc_info(unsigned *version, unsigned *slots, unsigned *ports, unsigned *caplength);"}, {"kind": "macro", "line": 23, "name": "DRIVERS_XHCI_H", "signature": "#define DRIVERS_XHCI_H"}, {"kind": "macro", "line": 29, "name": "XHC_MAX_DEVICES", "signature": "#define XHC_MAX_DEVICES"}, {"kind": "macro", "line": 34, "name": "XHC_MAX_PORTS", "signature": "#define XHC_MAX_PORTS"}, {"kind": "macro", "line": 38, "name": "XHC_MAX_EPS", "signature": "#define XHC_MAX_EPS"}, {"kind": "macro", "line": 43, "name": "XHC_EP_INDEX_LIMIT", "signature": "#define XHC_EP_INDEX_LIMIT"}, {"kind": "macro", "line": 47, "name": "XHC_MAX_PENDING", "signature": "#define XHC_MAX_PENDING"}, {"kind": "macro", "line": 51, "name": "XHC_MAX_CONFIG_DESC", "signature": "#define XHC_MAX_CONFIG_DESC"}, {"kind": "macro", "line": 56, "name": "XHC_TRB_RING_TRBS", "signature": "#define XHC_TRB_RING_TRBS"}, {"kind": "macro", "line": 61, "name": "XHC_RESET_BUDGET_MS", "signature": "#define XHC_RESET_BUDGET_MS"}, {"kind": "macro", "line": 62, "name": "XHC_CMD_BUDGET_MS", "signature": "#define XHC_CMD_BUDGET_MS"}, {"kind": "macro", "line": 63, "name": "XHC_XFER_BUDGET_MS", "signature": "#define XHC_XFER_BUDGET_MS"}, {"kind": "macro", "line": 64, "name": "XHC_PORT_BUDGET_MS", "signature": "#define XHC_PORT_BUDGET_MS"}, {"kind": "macro", "line": 68, "name": "XHC_CAPLENGTH_MIN", "signature": "#define XHC_CAPLENGTH_MIN"}, {"kind": "macro", "line": 71, "name": "XHC_SPEED_FULL", "signature": "#define XHC_SPEED_FULL"}, {"kind": "macro", "line": 72, "name": "XHC_SPEED_LOW", "signature": "#define XHC_SPEED_LOW"}, {"kind": "macro", "line": 73, "name": "XHC_SPEED_HIGH", "signature": "#define XHC_SPEED_HIGH"}, {"kind": "macro", "line": 74, "name": "XHC_SPEED_SUPER", "signature": "#define XHC_SPEED_SUPER"}, {"kind": "macro", "line": 77, "name": "XHC_EP_CONTROL", "signature": "#define XHC_EP_CONTROL"}, {"kind": "macro", "line": 78, "name": "XHC_EP_ISOCHRONOUS", "signature": "#define XHC_EP_ISOCHRONOUS"}, {"kind": "macro", "line": 79, "name": "XHC_EP_BULK", "signature": "#define XHC_EP_BULK"}, {"kind": "macro", "line": 80, "name": "XHC_EP_INTERRUPT", "signature": "#define XHC_EP_INTERRUPT"}, {"kind": "macro", "line": 83, "name": "XHC_EP_DIR_IN", "signature": "#define XHC_EP_DIR_IN"}, {"kind": "macro", "line": 86, "name": "XHC_CLASS_HID", "signature": "#define XHC_CLASS_HID"}, {"kind": "macro", "line": 87, "name": "XHC_SUBCLASS_BOOT", "signature": "#define XHC_SUBCLASS_BOOT"}, {"kind": "macro", "line": 88, "name": "XHC_CLASS_MASS_STORAGE", "signature": "#define XHC_CLASS_MASS_STORAGE"}, {"kind": "macro", "line": 89, "name": "XHC_SUBCLASS_SCSI", "signature": "#define XHC_SUBCLASS_SCSI"}, {"kind": "macro", "line": 90, "name": "XHC_PROTOCOL_BULK_ONLY", "signature": "#define XHC_PROTOCOL_BULK_ONLY"}]}, {"doc": "editor.h -- the built-in line editor contract.", "id": "headers/editor.h", "kind": "module", "label": "editor.h", "language": "h", "sha256": "04e4e60e57be4bae", "symbol_count": 2, "symbols": [{"kind": "function", "line": 15, "name": "shell_cmd_edit", "signature": "void shell_cmd_edit(int argc, char **argv);"}, {"kind": "macro", "line": 2, "name": "EDITOR_H", "signature": "#define EDITOR_H"}]}, {"doc": "ext4.h -- Read-only ext4 loopback/device driver.", "id": "headers/ext4.h", "kind": "module", "label": "ext4.h", "language": "h", "sha256": "1d2b8463514bc9dd", "symbol_count": 15, "symbols": [{"doc": "singly-indirect blocks), linear directories. Out of scope and refused fail-closed: htree-indexed directories, symlinks (even fast ones), encrypted or inline-data files, doubly and triply indirect blocks, journal replay (reads see the last consistent state). Checksums are not verified; every structural offset is bounds-checked instead. The image backend (regular file or real * disk region) is the shared fsimg contract. #define EXT4_NAME_MAX  255 #define EXT4_MAX_DEPTH 8 #define EXT4_LIST_CAP  64 #define EXT4_PATH_MAX  256 /* One open ext4 file: image backend plus the located inode.", "kind": "struct", "line": 22, "name": "ext4_handle_t"}, {"doc": "List one directory: names (dirs with trailing '/') up to cap. * Returns the entry count, or -1 when the image, path or walk fails.", "kind": "function", "line": 35, "name": "ext4_list", "signature": "int ext4_list(const char *imgpath, const char *dirpath, char names[][EXT4_NAME_MAX + 1], int *isdir, int cap);"}, {"doc": "VFS verbs: open \"imgpath:extpath\" (first ':' splits), read, close, * fstat. Write/truncate refuse. All fail closed with -1.", "kind": "function", "line": 40, "name": "ext4_vfs_open", "signature": "int ext4_vfs_open(const char *path, int mode, void **handle);"}, {"kind": "function", "line": 41, "name": "ext4_vfs_read", "signature": "int ext4_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len);"}, {"kind": "function", "line": 43, "name": "ext4_vfs_write", "signature": "int ext4_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len);"}, {"kind": "function", "line": 45, "name": "ext4_vfs_close", "signature": "int ext4_vfs_close(void *handle);"}, {"kind": "function", "line": 46, "name": "ext4_vfs_fstat", "signature": "int ext4_vfs_fstat(void *handle, unsigned long *size_out);"}, {"kind": "function", "line": 47, "name": "ext4_vfs_truncate", "signature": "int ext4_vfs_truncate(void *handle, unsigned long size);"}, {"kind": "function", "line": 50, "name": "first", "signature": "* MBR 0x83 entry first (proven by a superblock read), then a magic * scan over 2048-aligned LBAs for superfloppy layouts. Returns the * base LBA, or -1 when no ext4 is present. Cached. */ long ext_dev"}, {"kind": "variable", "line": 55, "name": "ext4_vfs_ops", "signature": "extern const vfs_ops_t ext4_vfs_ops;"}, {"kind": "macro", "line": 2, "name": "EXT4_H", "signature": "#define EXT4_H"}, {"kind": "macro", "line": 16, "name": "EXT4_NAME_MAX", "signature": "#define EXT4_NAME_MAX"}, {"kind": "macro", "line": 17, "name": "EXT4_MAX_DEPTH", "signature": "#define EXT4_MAX_DEPTH"}, {"kind": "macro", "line": 18, "name": "EXT4_LIST_CAP", "signature": "#define EXT4_LIST_CAP"}, {"kind": "macro", "line": 19, "name": "EXT4_PATH_MAX", "signature": "#define EXT4_PATH_MAX"}]}, {"doc": "fat32.h -- Read-only FAT32 loopback driver over ramdisk/MiniFS images.", "id": "headers/fat32.h", "kind": "module", "label": "fat32.h", "language": "h", "sha256": "cdf42dac45bae6ac", "symbol_count": 16, "symbols": [{"doc": "One open FAT file: image backend plus the located entry. A loopback image reads through ramdisk/minifs at file offsets; a real disk partition (`hd0`, first FAT32 found) reads absolute LBA sectors * through the IDE driver at dev_lba + offset.", "kind": "struct", "line": 25, "name": "fat32_handle_t"}, {"kind": "function", "line": 6, "name": "file", "signature": "* * A FAT32 disk image stored as a regular file (built on the host with * mkfs.vfat, packed into minifs.bin) is parsed here: BPB validation, * cluster-chain walking and 8.3 directory traversal. Only t"}, {"doc": "List one directory: names (dirs with trailing '/') up to cap. * Returns the entry count, or -1 when the image, path or walk fails.", "kind": "function", "line": 45, "name": "fat32_list", "signature": "int fat32_list(const char *imgpath, const char *dirpath, char names[][FAT32_NAME_MAX], int *isdir, int cap);"}, {"doc": "Locate the first FAT32 partition on the primary IDE master: a real MBR FAT32 entry first (real hardware with a partition table), then a magic scan over 2048-aligned LBAs (superfloppy images with no table, like the os.img tail). Returns the base LBA, or -1 when no FAT32 is present. Result is cached; the disk never changes under * a running guest.", "kind": "function", "line": 54, "name": "fat_dev_base", "signature": "long fat_dev_base(void);"}, {"doc": "VFS verbs: open \"imgpath:fatpath\" (first ':' splits), read, close, * fstat. Write/truncate refuse. All fail closed with -1.", "kind": "function", "line": 58, "name": "fat32_vfs_open", "signature": "int fat32_vfs_open(const char *path, int mode, void **handle);"}, {"kind": "function", "line": 59, "name": "fat32_vfs_read", "signature": "int fat32_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len);"}, {"kind": "function", "line": 61, "name": "fat32_vfs_write", "signature": "int fat32_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len);"}, {"kind": "function", "line": 63, "name": "fat32_vfs_close", "signature": "int fat32_vfs_close(void *handle);"}, {"kind": "function", "line": 64, "name": "fat32_vfs_fstat", "signature": "int fat32_vfs_fstat(void *handle, unsigned long *size_out);"}, {"kind": "function", "line": 65, "name": "fat32_vfs_truncate", "signature": "int fat32_vfs_truncate(void *handle, unsigned long size);"}, {"kind": "variable", "line": 67, "name": "fat32_vfs_ops", "signature": "extern const vfs_ops_t fat32_vfs_ops;"}, {"kind": "macro", "line": 2, "name": "FAT32_H", "signature": "#define FAT32_H"}, {"kind": "macro", "line": 16, "name": "FAT32_NAME_MAX", "signature": "#define FAT32_NAME_MAX"}, {"kind": "macro", "line": 17, "name": "FAT32_MAX_DEPTH", "signature": "#define FAT32_MAX_DEPTH"}, {"kind": "macro", "line": 18, "name": "FAT32_LIST_CAP", "signature": "#define FAT32_LIST_CAP"}, {"kind": "macro", "line": 19, "name": "FAT32_CLUS_MAX", "signature": "#define FAT32_CLUS_MAX"}]}, {"doc": "fsimg.h -- One image backend for read-only filesystem drivers.", "id": "headers/fsimg.h", "kind": "module", "label": "fsimg.h", "language": "h", "sha256": "4a222241020a9275", "symbol_count": 6, "symbols": [{"kind": "struct", "line": 13, "name": "fsimg_t"}, {"doc": "Open a resolved path as a loopback image. Refuses past 4 GB (all * sector math below is 32-bit).", "kind": "function", "line": 23, "name": "fsimg_open_file", "signature": "int fsimg_open_file(const char *resolved, fsimg_t *img);"}, {"doc": "Open an absolute disk region [base_lba, base_lba + nsec) as an * image. Bounds are 64-bit and fenced to the drive size.", "kind": "function", "line": 27, "name": "fsimg_open_dev", "signature": "int fsimg_open_dev(unsigned long base_lba, unsigned long nsec, fsimg_t *img);"}, {"doc": "Read len bytes at off into buf. Fails closed on any bound * violation, short backend transfer, or missing device.", "kind": "function", "line": 32, "name": "fsimg_read", "signature": "int fsimg_read(const fsimg_t *img, unsigned long off, void *buf, unsigned long len);"}, {"doc": "Split \"left:right\" at the first ':' (image names never carry one). Bounds are per side: image paths resolve under RAMDISK_FNAME_LEN, in-image paths may run deeper. Refuses empty sides and overlong parts. Shared by the fat: and ext4: VFS addressings, which have * the same shape.", "kind": "function", "line": 40, "name": "fsimg_split", "signature": "int fsimg_split(const char *path, char *left, unsigned llen, char *right, unsigned rlen);"}, {"kind": "macro", "line": 2, "name": "FSIMG_H", "signature": "#define FSIMG_H"}]}, {"doc": "Docstring: futex.h -- Fast userspace mutex sleep/wake contract.", "id": "headers/futex.h", "kind": "module", "label": "futex.h", "language": "h", "sha256": "31dd4c73ed229770", "symbol_count": 28, "symbols": [{"kind": "struct", "line": 80, "name": "futex_bucket_t"}, {"kind": "function", "line": 86, "name": "futex_init", "signature": "void futex_init(void);"}, {"kind": "function", "line": 87, "name": "futex_wait", "signature": "long futex_wait(unsigned long uaddr, int val);"}, {"kind": "function", "line": 88, "name": "futex_wake", "signature": "long futex_wake(unsigned long uaddr, int n);"}, {"doc": "Unlink pid from whatever futex queue still holds it and clear its * recorded address; a no-op for a pid that is not waiting.", "kind": "function", "line": 91, "name": "futex_forget", "signature": "void futex_forget(int pid);"}, {"kind": "function", "line": 96, "name": "FUTEX_CLOCK_REALTIME", "signature": "* FUTEX_CLOCK_REALTIME (it only selects the clock of a BITSET deadline). * Returns -1 for anything unserved (REQUEUE, CMP_REQUEUE, WAKE_OP, PI/PP, * unknown flags). Host-tested (tests/test_futex.c);"}, {"doc": "Decode a Linux futex(2) op to LINUX_FUTEX_WAIT/WAKE/WAIT_BITSET/ WAKE_BITSET, masking FUTEX_PRIVATE_FLAG (process-private is served on the same global buckets: same semantics, no isolation shortcut) and FUTEX_CLOCK_REALTIME (it only selects the clock of a BITSET deadline). Returns -1 for anything unserved (REQUEUE, CMP_REQUEUE, WAKE_OP, PI/PP, unknown flags). Host-tested (tests/test_futex.c); the kernel errno * mapping lives in syscalls.c, which is not host-compilable.", "kind": "function", "line": 100, "name": "futex_linux_cmd", "signature": "int futex_linux_cmd(long op);"}, {"doc": "Microseconds left before a futex timeout: relative for WAIT, absolute (against now_us on the op's clock) for WAIT_BITSET. Zero or negative means the deadline passed; FUTEX_TIMEOUT_INVALID for a negative second or a nanosecond field outside [0, 1e9); FUTEX_TIMEOUT_FOREVER when the * seconds would overflow a microsecond count. Pure, host-tested.", "kind": "function", "line": 107, "name": "futex_timeout_remaining_us", "signature": "long futex_timeout_remaining_us(int cmd, long sec, long nsec, unsigned long now_us);"}, {"kind": "macro", "line": 2, "name": "FUTEX_H", "signature": "#define FUTEX_H"}, {"kind": "macro", "line": 51, "name": "FUTEX_BUCKETS", "signature": "#define FUTEX_BUCKETS"}, {"kind": "macro", "line": 52, "name": "FUTEX_BUCKET_MASK", "signature": "#define FUTEX_BUCKET_MASK"}, {"kind": "macro", "line": 53, "name": "FUTEX_HASH_GOLDEN", "signature": "#define FUTEX_HASH_GOLDEN"}, {"kind": "macro", "line": 55, "name": "FUTEX_OK", "signature": "#define FUTEX_OK"}, {"kind": "macro", "line": 56, "name": "FUTEX_NOMATCH", "signature": "#define FUTEX_NOMATCH"}, {"kind": "macro", "line": 57, "name": "FUTEX_NOPROC", "signature": "#define FUTEX_NOPROC"}, {"kind": "macro", "line": 58, "name": "FUTEX_WAKE_ALL", "signature": "#define FUTEX_WAKE_ALL"}, {"kind": "macro", "line": 65, "name": "LINUX_FUTEX_WAIT", "signature": "#define LINUX_FUTEX_WAIT"}, {"kind": "macro", "line": 66, "name": "LINUX_FUTEX_WAKE", "signature": "#define LINUX_FUTEX_WAKE"}, {"kind": "macro", "line": 67, "name": "LINUX_FUTEX_WAIT_BITSET", "signature": "#define LINUX_FUTEX_WAIT_BITSET"}, {"kind": "macro", "line": 68, "name": "LINUX_FUTEX_WAKE_BITSET", "signature": "#define LINUX_FUTEX_WAKE_BITSET"}, {"kind": "macro", "line": 69, "name": "LINUX_FUTEX_PRIVATE_FLAG", "signature": "#define LINUX_FUTEX_PRIVATE_FLAG"}, {"kind": "macro", "line": 70, "name": "LINUX_FUTEX_CLOCK_REALTIME", "signature": "#define LINUX_FUTEX_CLOCK_REALTIME"}, {"kind": "macro", "line": 71, "name": "LINUX_FUTEX_BITSET_MATCH_ANY", "signature": "#define LINUX_FUTEX_BITSET_MATCH_ANY"}, {"kind": "macro", "line": 72, "name": "FUTEX_US_PER_S", "signature": "#define FUTEX_US_PER_S"}, {"kind": "macro", "line": 73, "name": "FUTEX_NS_PER_US", "signature": "#define FUTEX_NS_PER_US"}, {"kind": "macro", "line": 74, "name": "FUTEX_NS_PER_S", "signature": "#define FUTEX_NS_PER_S"}, {"kind": "macro", "line": 77, "name": "FUTEX_TIMEOUT_INVALID", "signature": "#define FUTEX_TIMEOUT_INVALID"}, {"kind": "macro", "line": 78, "name": "FUTEX_TIMEOUT_FOREVER", "signature": "#define FUTEX_TIMEOUT_FOREVER"}]}, {"doc": "Docstring: httpd.h -- Minimal static HTTP/1.0 server contract.", "id": "headers/httpd.h", "kind": "module", "label": "httpd.h", "language": "h", "sha256": "5c6763b4b80922ca", "symbol_count": 10, "symbols": [{"doc": "Docstring: Content type by file suffix. Unknown suffixes serve as * application/octet-stream, never refused. Null path reads as octet.", "kind": "function", "line": 28, "name": "httpd_ctype", "signature": "static inline const char *httpd_ctype(const char *path)"}, {"doc": "Docstring: Emit a response head into out. Returns the head length, or HTTPD_ERR_BOUND past cap. body_len is the exact Content-Length; * the caller streams the body after the head.", "kind": "function", "line": 121, "name": "httpd_header", "signature": "static inline int httpd_header(int code, const char *reason,\n        const char *ctype, unsigned ..."}, {"kind": "macro", "line": 15, "name": "HTTPD_H", "signature": "#define HTTPD_H"}, {"kind": "macro", "line": 17, "name": "HTTPD_MAX_PATH", "signature": "#define HTTPD_MAX_PATH"}, {"kind": "macro", "line": 18, "name": "HTTPD_MAX_REQ", "signature": "#define HTTPD_MAX_REQ"}, {"kind": "macro", "line": 19, "name": "HTTPD_HEAD_MAX", "signature": "#define HTTPD_HEAD_MAX"}, {"kind": "macro", "line": 21, "name": "HTTPD_ERR_BOUND", "signature": "#define HTTPD_ERR_BOUND"}, {"kind": "macro", "line": 22, "name": "HTTPD_ERR_METHOD", "signature": "#define HTTPD_ERR_METHOD"}, {"kind": "macro", "line": 23, "name": "HTTPD_ERR_PATH", "signature": "#define HTTPD_ERR_PATH"}, {"kind": "macro", "line": 24, "name": "HTTPD_ERR_VERSION", "signature": "#define HTTPD_ERR_VERSION"}]}, {"doc": "IDE/ATA PIO driver for MiniOS.", "id": "headers/ide.h", "kind": "module", "label": "ide.h", "language": "h", "sha256": "817a94f01e36f161", "symbol_count": 35, "symbols": [{"doc": "#define IDE_CMD_FLUSH       0xE7    /* FLUSH CACHE /* Drive/Head register bits #define IDE_DRIVE_LBA       0x40    /* LBA mode #define IDE_DRIVE_MASTER    0xA0    /* master drive #define IDE_DRIVE_SLAVE     0xB0    /* slave drive /* Timeout in PIT ticks (approximate) #define IDE_TIMEOUT         1000000 /* Sector size in bytes #define IDE_SECTOR_SIZE     512 /* Initialize the IDE driver: probe, IDENTIFY, report geometry.", "kind": "function", "line": 49, "name": "ide_init", "signature": "void ide_init(void);"}, {"doc": "Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error.", "kind": "function", "line": 53, "name": "ide_read_sectors", "signature": "int ide_read_sectors(unsigned int lba, unsigned int count, void *buf);"}, {"kind": "function", "line": 54, "name": "ide_write_sectors", "signature": "int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf);"}, {"doc": "Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error. int ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); /* Convenience: single sector read/write.", "kind": "function", "line": 57, "name": "ide_read_sector", "signature": "int ide_read_sector(unsigned int lba, void *buf);"}, {"kind": "function", "line": 58, "name": "ide_write_sector", "signature": "int ide_write_sector(unsigned int lba, const void *buf);"}, {"doc": "Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error. int ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); /* Convenience: single sector read/write. int ide_read_sector(unsigned int lba, void *buf); int ide_write_sector(unsigned int lba, const void *buf); /* Returns total sectors on the disk, or 0 if not detected.", "kind": "function", "line": 61, "name": "ide_total_sectors", "signature": "unsigned int ide_total_sectors(void);"}, {"doc": "Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error. int ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); /* Convenience: single sector read/write. int ide_read_sector(unsigned int lba, void *buf); int ide_write_sector(unsigned int lba, const void *buf); /* Returns total sectors on the disk, or 0 if not detected. unsigned int ide_total_sectors(void); /* Returns 1 if a disk was successfully detected.", "kind": "function", "line": 64, "name": "ide_present", "signature": "int ide_present(void);"}, {"doc": "Publish the Strategy ops table to the device registry (driver.h). * Called from ide_init; re-registration is a no-op (duplicate refused).", "kind": "function", "line": 68, "name": "ide_register_device", "signature": "void ide_register_device(void);"}, {"kind": "macro", "line": 2, "name": "IDE_H", "signature": "#define IDE_H"}, {"kind": "macro", "line": 9, "name": "IDE_PRIMARY_BASE", "signature": "#define IDE_PRIMARY_BASE"}, {"kind": "macro", "line": 10, "name": "IDE_PRIMARY_CTRL", "signature": "#define IDE_PRIMARY_CTRL"}, {"kind": "macro", "line": 13, "name": "IDE_REG_DATA", "signature": "#define IDE_REG_DATA"}, {"kind": "macro", "line": 14, "name": "IDE_REG_ERROR", "signature": "#define IDE_REG_ERROR"}, {"kind": "macro", "line": 15, "name": "IDE_REG_SECCOUNT", "signature": "#define IDE_REG_SECCOUNT"}, {"kind": "macro", "line": 16, "name": "IDE_REG_LBA_LO", "signature": "#define IDE_REG_LBA_LO"}, {"kind": "macro", "line": 17, "name": "IDE_REG_LBA_MID", "signature": "#define IDE_REG_LBA_MID"}, {"kind": "macro", "line": 18, "name": "IDE_REG_LBA_HI", "signature": "#define IDE_REG_LBA_HI"}, {"kind": "macro", "line": 19, "name": "IDE_REG_DRIVE", "signature": "#define IDE_REG_DRIVE"}, {"kind": "macro", "line": 20, "name": "IDE_REG_STATUS", "signature": "#define IDE_REG_STATUS"}, {"kind": "macro", "line": 21, "name": "IDE_REG_ALTSTATUS", "signature": "#define IDE_REG_ALTSTATUS"}, {"kind": "macro", "line": 24, "name": "IDE_STATUS_ERR", "signature": "#define IDE_STATUS_ERR"}, {"kind": "macro", "line": 25, "name": "IDE_STATUS_DRQ", "signature": "#define IDE_STATUS_DRQ"}, {"kind": "macro", "line": 26, "name": "IDE_STATUS_SRV", "signature": "#define IDE_STATUS_SRV"}, {"kind": "macro", "line": 27, "name": "IDE_STATUS_DF", "signature": "#define IDE_STATUS_DF"}, {"kind": "macro", "line": 28, "name": "IDE_STATUS_RDY", "signature": "#define IDE_STATUS_RDY"}, {"kind": "macro", "line": 29, "name": "IDE_STATUS_BSY", "signature": "#define IDE_STATUS_BSY"}, {"kind": "macro", "line": 32, "name": "IDE_CMD_READ", "signature": "#define IDE_CMD_READ"}, {"kind": "macro", "line": 33, "name": "IDE_CMD_WRITE", "signature": "#define IDE_CMD_WRITE"}, {"kind": "macro", "line": 34, "name": "IDE_CMD_IDENTIFY", "signature": "#define IDE_CMD_IDENTIFY"}, {"kind": "macro", "line": 35, "name": "IDE_CMD_FLUSH", "signature": "#define IDE_CMD_FLUSH"}, {"kind": "macro", "line": 38, "name": "IDE_DRIVE_LBA", "signature": "#define IDE_DRIVE_LBA"}, {"kind": "macro", "line": 39, "name": "IDE_DRIVE_MASTER", "signature": "#define IDE_DRIVE_MASTER"}, {"kind": "macro", "line": 40, "name": "IDE_DRIVE_SLAVE", "signature": "#define IDE_DRIVE_SLAVE"}, {"kind": "macro", "line": 43, "name": "IDE_TIMEOUT", "signature": "#define IDE_TIMEOUT"}, {"kind": "macro", "line": 46, "name": "IDE_SECTOR_SIZE", "signature": "#define IDE_SECTOR_SIZE"}]}, {"doc": "Docstring: console_in.h -- boundary of the console input device", "id": "headers/kernel/console_in.h", "kind": "module", "label": "console_in.h", "language": "h", "sha256": "745d0e5149199696", "symbol_count": 12, "symbols": [{"kind": "function", "line": 7, "name": "Consumers", "signature": "* Consumers (shell prompt, editor, SPAWN waits, GETC_RAW syscall) include * this header instead of reaching into kernel/shell.c. */ #include \"kernel.h\" /** Docstring: Blocking read from PS/2 or COM1 w"}, {"doc": "Docstring: Page the console history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring and the text-mode * console the legacy VGA scrollback ring; this picks the one that is up.", "kind": "function", "line": 19, "name": "console_history_page", "signature": "void console_history_page(int dir);"}, {"doc": "Docstring: Page the console history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring and the text-mode * console the legacy VGA scrollback ring; this picks the one that is up. void console_history_page(int dir); /** Docstring: Next buffered byte without consuming it, or -1.", "kind": "function", "line": 22, "name": "console_peek", "signature": "int console_peek(void);"}, {"doc": "Docstring: Raw console multiplexer backing GETC_RAW: same sources, * no line buffering, echo or scrollback. try returns -1 when idle.", "kind": "function", "line": 26, "name": "console_raw_try", "signature": "int console_raw_try(void);"}, {"kind": "function", "line": 27, "name": "console_raw_get", "signature": "int console_raw_get(void);"}, {"doc": "Docstring: Raw console multiplexer backing GETC_RAW: same sources, * no line buffering, echo or scrollback. try returns -1 when idle. int console_raw_try(void); int console_raw_get(void); /** Docstring: PS/2-only GETC_RAW source for background jobs.", "kind": "function", "line": 30, "name": "console_job_try", "signature": "int console_job_try(void);"}, {"kind": "function", "line": 31, "name": "console_job_get", "signature": "int console_job_get(void);"}, {"doc": "Docstring: Push one byte back into the console FIFO; the next * console_getc/console_peek serves it first. Drops the byte when full.", "kind": "function", "line": 35, "name": "console_ungetc", "signature": "void console_ungetc(unsigned char c);"}, {"doc": "Docstring: Pipeline stdin override: the next console_getc calls serve len bytes from data, then report EOF (-1) instead of blocking on the live console until console_stdin_clear runs. The shell pipeline runner owns this: stage N+1 reads stage N's captured output as its stdin. * Bounded by PIPE_CAP_MAX, fail-closed (0) past it or on OOM.", "kind": "function", "line": 42, "name": "console_stdin_push", "signature": "int console_stdin_push(const char *data, unsigned long len);"}, {"kind": "function", "line": 43, "name": "console_stdin_clear", "signature": "void console_stdin_clear(void);"}, {"kind": "function", "line": 44, "name": "console_stdin_active", "signature": "int console_stdin_active(void);"}, {"kind": "macro", "line": 2, "name": "CONSOLE_IN_H", "signature": "#define CONSOLE_IN_H"}]}, {"doc": "Docstring: vga_cursor.h -- boundary of the pointer sprite layer", "id": "headers/kernel/vga_cursor.h", "kind": "module", "label": "vga_cursor.h", "language": "h", "sha256": "5d69b324ebb920d4", "symbol_count": 9, "symbols": [{"doc": "Docstring: vga_cursor.h -- boundary of the pointer sprite layer (kernel/vga_cursor.c). Owns the arrow bitmap, the saved background and the painted position; draws only through the framebuffer primitives. * Callers move/erase/invalidate through these ops and never poke state. #include \"kernel.h\" /** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle.", "kind": "function", "line": 16, "name": "cursor_over", "signature": "int cursor_over(int x0, int y0, int w, int h);"}, {"doc": "(kernel/vga_cursor.c). Owns the arrow bitmap, the saved background and the painted position; draws only through the framebuffer primitives. * Callers move/erase/invalidate through these ops and never poke state. #include \"kernel.h\" /** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally.", "kind": "function", "line": 19, "name": "cursor_place", "signature": "void cursor_place(int mx, int my);"}, {"doc": "#include \"kernel.h\" /** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved.", "kind": "function", "line": 22, "name": "cursor_move", "signature": "void cursor_move(int mx, int my);"}, {"doc": "/** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved. void cursor_move(int mx, int my); /** Docstring: Restore the saved background and mark the pointer hidden.", "kind": "function", "line": 25, "name": "cursor_erase", "signature": "void cursor_erase(void);"}, {"doc": "/** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved. void cursor_move(int mx, int my); /** Docstring: Restore the saved background and mark the pointer hidden. void cursor_erase(void); /** Docstring: Mark the pointer hidden without touching the framebuffer.", "kind": "function", "line": 28, "name": "cursor_invalidate", "signature": "void cursor_invalidate(void);"}, {"doc": "/** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved. void cursor_move(int mx, int my); /** Docstring: Restore the saved background and mark the pointer hidden. void cursor_erase(void); /** Docstring: Mark the pointer hidden without touching the framebuffer. void cursor_invalidate(void); /** Docstring: Invalidate when the pointer overlaps a repainted rectangle.", "kind": "function", "line": 31, "name": "cursor_note_repaint", "signature": "void cursor_note_repaint(int x0, int y0, int w, int h);"}, {"kind": "macro", "line": 2, "name": "VGA_CURSOR_H", "signature": "#define VGA_CURSOR_H"}, {"kind": "macro", "line": 12, "name": "CURSOR_W", "signature": "#define CURSOR_W"}, {"kind": "macro", "line": 13, "name": "CURSOR_H", "signature": "#define CURSOR_H"}]}, {"doc": "The user-window memory layout (load base, stack, brk cap, graphics", "id": "headers/kernel.h", "kind": "module", "label": "kernel.h", "language": "h", "sha256": "8f0bb4d0fb209f6a", "symbol_count": 412, "symbols": [{"doc": "Docstring: one directory entry behind the readdir verb. Defined * before vfs_ops_t so the verb names the type directly. define VFS_NAME_MAX 255", "kind": "struct", "line": 383, "name": "vfs_dirent"}, {"kind": "struct", "line": 388, "name": "vfs_ops"}, {"kind": "struct", "line": 398, "name": "vfs_file"}, {"doc": "Docstring: Per-process file-descriptor view.  Each process owns one view (heap-allocated, shared on CLONE_FILES with a refcount, deep-copied on fork/spawn/exec-parent with one KFILE ref bump per live entry). f[fd] is the table; cloexec carries one close-on-exec bit per fd; ref counts view owners (never the entries: those keep their own KFILE ref). The shell and every pid without its own view (pid 0, AP idle) use the static root view, which is never * freed. All membership mutates only under fd_lock.", "kind": "struct", "line": 855, "name": "kfd_view"}, {"kind": "struct", "line": 281, "name": "RDFile"}, {"kind": "struct", "line": 470, "name": "KFILE"}, {"kind": "struct", "line": 627, "name": "KSym"}, {"kind": "struct", "line": 632, "name": "KProg"}, {"doc": "ET_REL stack switch (arch/x86/ctx_sw.S): runs entry(argc, argv) on * the 64 KB stack ending at stack_top. See the asm contract there. int  k_run_on_stack(void *stack_top, prog_entry_t entry, int argc, char **argv); /* ========== Execution infrastructure (kernel/exec.c) ==========", "kind": "struct", "line": 666, "name": "kjmpbuf"}, {"kind": "struct", "line": 738, "name": "Elf64_Ehdr"}, {"doc": "Docstring: one directory entry behind the readdir verb. Defined * before vfs_ops_t so the verb names the type directly. define VFS_NAME_MAX 255", "kind": "type_alias", "line": 383, "name": "name", "signature": "typedef struct vfs_dirent { char name[VFS_NAME_MAX + 1];"}, {"doc": "Facade aliases (thesis correction 2B, 4.4BSD/Linux vnode model): vfs_ops_t IS the file_operations table, and vnode is the object it operates on. New code uses these names; vfs_ops_t/vfs_file_t remain as compat aliases. Open/Closed Principle: adding a filesystem means registering a new ops table, never editing a dispatch cascade. No caller branches on which filesystem backs a handle; vfs_read/write/close/fstat dispatch purely * through ops.", "kind": "type_alias", "line": 414, "name": "file_operations", "signature": "typedef vfs_ops_t file_operations;"}, {"kind": "type_alias", "line": 415, "name": "vnode_t", "signature": "typedef vfs_file_t vnode_t;"}, {"doc": "/* ========== Swap (kernel/mm/swap.c) ========== int   swap_out(unsigned long window_sz); int   swap_in(void); /* brk/mmap globals (loader.c) extern unsigned long g_brk; extern unsigned long g_brk_limit; extern unsigned long user_mmap_cur; /* ========== ELF loader (loader.c) ========== /* Minimal ELF64 definitions (used by shell_load, shell_run_elf_buf, SPAWN) define EI_NIDENT 16", "kind": "type_alias", "line": 731, "name": "Elf64_Addr", "signature": "typedef unsigned long long Elf64_Addr;"}, {"kind": "type_alias", "line": 732, "name": "Elf64_Off", "signature": "typedef unsigned long long Elf64_Off;"}, {"kind": "type_alias", "line": 733, "name": "Elf64_Word", "signature": "typedef unsigned int Elf64_Word;"}, {"kind": "type_alias", "line": 734, "name": "Elf64_Half", "signature": "typedef unsigned short Elf64_Half;"}, {"kind": "type_alias", "line": 735, "name": "Elf64_Xword", "signature": "typedef unsigned long long Elf64_Xword;"}, {"kind": "type_alias", "line": 736, "name": "Elf64_Sxword", "signature": "typedef long long Elf64_Sxword;"}, {"kind": "function", "line": 26, "name": "outb", "signature": "static inline void outb(unsigned short port, unsigned char val)"}, {"kind": "function", "line": 29, "name": "inb", "signature": "static inline unsigned char inb(unsigned short port)"}, {"kind": "function", "line": 34, "name": "outw", "signature": "static inline void outw(unsigned short port, unsigned short val)"}, {"kind": "function", "line": 37, "name": "inw", "signature": "static inline unsigned short inw(unsigned short port)"}, {"doc": "String port I/O: one instruction moves `count` words between the port and the buffer.  Under KVM every port access is a VM-exit, so a 512 B sector costs 1 exit this way instead of 256 single-word inw/outw (measured: MiniFS reads ran at ~250 KB/s before, bulk ELF loads took * minutes).  `cld` pins the direction; alignment is not required.", "kind": "function", "line": 47, "name": "insw", "signature": "static inline void insw(unsigned short port, unsigned short *buf,\n                        unsigne..."}, {"kind": "function", "line": 54, "name": "outsw", "signature": "static inline void outsw(unsigned short port, const unsigned short *buf,\n                        ..."}, {"kind": "function", "line": 64, "name": "waits", "signature": "* and mouse_hw_init issues dozens of waits (measured 5 s of boot).  This\n * polls the port once p..."}, {"kind": "function", "line": 903, "name": "C", "signature": "* it with pointer subtraction in C (undefined behaviour). The value is\n * a link-time difference,..."}, {"doc": "Forward: PIT-calibrated wall clock (defined in kernel/time.c); valid * once pit_init has run. Used only by the deadline polls below.", "kind": "function", "line": 25, "name": "ktime_ms", "signature": "unsigned long ktime_ms(void);"}, {"kind": "function", "line": 94, "name": "vga_clear", "signature": "void vga_clear(void);"}, {"kind": "function", "line": 95, "name": "vga_putc", "signature": "void vga_putc(char c);"}, {"kind": "function", "line": 96, "name": "vga_puts", "signature": "void vga_puts(const char *s);"}, {"kind": "function", "line": 97, "name": "vga_scroll", "signature": "void vga_scroll(void);"}, {"kind": "function", "line": 98, "name": "vga_set_cursor", "signature": "void vga_set_cursor(int x, int y);"}, {"kind": "function", "line": 99, "name": "vga_newline", "signature": "void vga_newline(void);"}, {"kind": "function", "line": 100, "name": "vga_cursor_enable", "signature": "void vga_cursor_enable(int on);"}, {"doc": "Console output lock (kernel/console.c): serializes SMP console output across CPUs. Held across the whole vga_putc body; try-or-race so an ISR * dump prints rather than deadlocks on a lock held by interrupted context. extern spinlock_t console_lock; /* VGA state getters (kernel/console.c, for scrollback renderer)", "kind": "function", "line": 108, "name": "vga_get_x", "signature": "int vga_get_x(void);"}, {"kind": "function", "line": 109, "name": "vga_get_y", "signature": "int vga_get_y(void);"}, {"kind": "function", "line": 110, "name": "vga_set_xy", "signature": "void vga_set_xy(int x, int y);"}, {"kind": "function", "line": 111, "name": "vga_get_color", "signature": "char vga_get_color(void);"}, {"doc": "MINFO sleep support (kernel/syscalls.c): timed park for ring-3 monitors. sched_init passes the tick-registration result; without a * registered waker sel 6 fails closed instead of hanging.", "kind": "function", "line": 116, "name": "minfo_sleep_init", "signature": "void minfo_sleep_init(int tick_ok);"}, {"kind": "function", "line": 117, "name": "minfo_tick_wake", "signature": "void minfo_tick_wake(void *ctx);"}, {"doc": "MINFO sleep support (kernel/syscalls.c): timed park for ring-3 monitors. sched_init passes the tick-registration result; without a * registered waker sel 6 fails closed instead of hanging. void minfo_sleep_init(int tick_ok); void minfo_tick_wake(void *ctx); /* ========== Scrollback ring (kernel/scrollback.c) ==========", "kind": "function", "line": 120, "name": "sb_init", "signature": "void sb_init(void);"}, {"kind": "function", "line": 121, "name": "sb_capture_row0", "signature": "void sb_capture_row0(void);"}, {"kind": "function", "line": 122, "name": "sb_reset", "signature": "void sb_reset(void);"}, {"kind": "function", "line": 123, "name": "sb_get_count", "signature": "int sb_get_count(void);"}, {"kind": "function", "line": 124, "name": "sb_get_head", "signature": "int sb_get_head(void);"}, {"kind": "function", "line": 125, "name": "sb_get_char", "signature": "char sb_get_char(int row, int col);"}, {"doc": "monitors. sched_init passes the tick-registration result; without a * registered waker sel 6 fails closed instead of hanging. void minfo_sleep_init(int tick_ok); void minfo_tick_wake(void *ctx); /* ========== Scrollback ring (kernel/scrollback.c) ========== void sb_init(void); void sb_capture_row0(void); void sb_reset(void); int  sb_get_count(void); int  sb_get_head(void); char sb_get_char(int row, int col); /* ========== Serial console (COM1) ==========", "kind": "function", "line": 128, "name": "serial_init", "signature": "void serial_init(void);"}, {"kind": "function", "line": 129, "name": "serial_putc", "signature": "void serial_putc(char c);"}, {"kind": "function", "line": 130, "name": "serial_puts", "signature": "void serial_puts(const char *s);"}, {"kind": "function", "line": 131, "name": "sc_record_dump", "signature": "void sc_record_dump(int pid);"}, {"kind": "function", "line": 132, "name": "serial_e_count", "signature": "unsigned long serial_e_count(void);"}, {"doc": "void sb_init(void); void sb_capture_row0(void); void sb_reset(void); int  sb_get_count(void); int  sb_get_head(void); char sb_get_char(int row, int col); /* ========== Serial console (COM1) ========== void serial_init(void); void serial_putc(char c); void serial_puts(const char *s); void sc_record_dump(int pid); unsigned long serial_e_count(void);          /* E-flood tracer (serial.c) extern unsigned long ser_e_ra, ser_e_cpu;    /* first 'E' writer's RA/CPU", "kind": "function", "line": 134, "name": "serial_available", "signature": "int serial_available(void);"}, {"kind": "function", "line": 135, "name": "serial_getc", "signature": "int serial_getc(void);"}, {"kind": "function", "line": 173, "name": "kbd_read", "signature": "int kbd_read(void);"}, {"kind": "function", "line": 174, "name": "kbd_available", "signature": "int kbd_available(void);"}, {"kind": "function", "line": 175, "name": "kbd_reset_for_shell", "signature": "void kbd_reset_for_shell(void);"}, {"kind": "function", "line": 213, "name": "kmalloc", "signature": "void *kmalloc(unsigned long size);"}, {"kind": "function", "line": 215, "name": "kfree", "signature": "void kfree(void *ptr);"}, {"kind": "function", "line": 216, "name": "kcalloc", "signature": "void *kcalloc(unsigned long nmemb, unsigned long size);"}, {"kind": "function", "line": 217, "name": "krealloc", "signature": "void *krealloc(void *ptr, unsigned long size);"}, {"kind": "function", "line": 218, "name": "kallocator_init", "signature": "void kallocator_init(void);"}, {"kind": "function", "line": 219, "name": "kmalloc_aligned", "signature": "void *kmalloc_aligned(unsigned long size, unsigned long align);"}, {"doc": "define KMALLOC_PAGE 0x1000UL", "kind": "function", "line": 221, "name": "kmalloc_page", "signature": "void *kmalloc_page(void);"}, {"kind": "function", "line": 222, "name": "kfree_aligned", "signature": "void kfree_aligned(void *ptr);"}, {"doc": "dlmalloc backend (third_party/dlmalloc): an mspace rooted over the fixed * kernel heap. The kernel's allocator delegates to these.", "kind": "function", "line": 226, "name": "dlmalloc_init", "signature": "void dlmalloc_init(unsigned long size);"}, {"kind": "function", "line": 230, "name": "dlmalloc_malloc", "signature": "void *dlmalloc_malloc(unsigned long size);"}, {"kind": "function", "line": 231, "name": "dlmalloc_memalign", "signature": "void *dlmalloc_memalign(unsigned long align, unsigned long size);"}, {"kind": "function", "line": 232, "name": "dlmalloc_free", "signature": "void dlmalloc_free(void *ptr);"}, {"kind": "function", "line": 233, "name": "dlmalloc_calloc", "signature": "void *dlmalloc_calloc(unsigned long nmemb, unsigned long size);"}, {"kind": "function", "line": 234, "name": "dlmalloc_realloc", "signature": "void *dlmalloc_realloc(void *ptr, unsigned long size);"}, {"doc": "Bytes of kernel heap actually in use as the dlmalloc space: HEAP_SIZE * clamped to the RAM installed above HEAP_BASE. extern unsigned long kheap_size; void *dlmalloc_malloc(unsigned long size); void *dlmalloc_memalign(unsigned long align, unsigned long size); void  dlmalloc_free(void *ptr); void *dlmalloc_calloc(unsigned long nmemb, unsigned long size); void *dlmalloc_realloc(void *ptr, unsigned long size); /** Docstring: Heap usage snapshot for the mem builtin.", "kind": "function", "line": 236, "name": "dlmalloc_usage", "signature": "void dlmalloc_usage(unsigned long *used, unsigned long *free_b, unsigned long *arena);"}, {"kind": "function", "line": 287, "name": "ramdisk_init", "signature": "void ramdisk_init(void);"}, {"kind": "function", "line": 288, "name": "ramdisk_open", "signature": "RDFile *ramdisk_open(const char *name);"}, {"kind": "function", "line": 289, "name": "ramdisk_read", "signature": "int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len);"}, {"kind": "function", "line": 290, "name": "ramdisk_write", "signature": "int ramdisk_write(RDFile *f, const void *buf, unsigned offset, unsigned len);"}, {"kind": "function", "line": 291, "name": "ramdisk_create", "signature": "RDFile *ramdisk_create(const char *name, unsigned size);"}, {"kind": "function", "line": 292, "name": "ramdisk_resize", "signature": "int ramdisk_resize(RDFile *f, unsigned newsize);"}, {"kind": "function", "line": 293, "name": "ramdisk_delete", "signature": "int ramdisk_delete(RDFile *f);"}, {"kind": "function", "line": 295, "name": "RAMDISK_FNAME_LEN", "signature": "* RAMDISK_FNAME_LEN (fs_resolve guarantees it);"}, {"doc": "Docstring: In-place rename of one ramdisk entry. Both names fit RAMDISK_FNAME_LEN (fs_resolve guarantees it); missing src or an * existing dst refuses, never overwrites. Returns 0 on success.", "kind": "function", "line": 297, "name": "ramdisk_rename", "signature": "int ramdisk_rename(const char *oldname, const char *newname);"}, {"kind": "function", "line": 298, "name": "ramdisk_list", "signature": "int ramdisk_list(RDFile **out, int max);"}, {"kind": "function", "line": 299, "name": "ramdisk_setup_from", "signature": "void ramdisk_setup_from(void *data, unsigned size);"}, {"kind": "function", "line": 300, "name": "ramdisk_count", "signature": "int ramdisk_count(void);"}, {"kind": "function", "line": 301, "name": "ramdisk_file_name", "signature": "const char *ramdisk_file_name(int idx);"}, {"doc": "Docstring: In-place rename of one ramdisk entry. Both names fit RAMDISK_FNAME_LEN (fs_resolve guarantees it); missing src or an * existing dst refuses, never overwrites. Returns 0 on success. int      ramdisk_rename(const char *oldname, const char *newname); int      ramdisk_list(RDFile **out, int max); void     ramdisk_setup_from(void *data, unsigned size); int      ramdisk_count(void); const char *ramdisk_file_name(int idx); /** Docstring: Ramdisk usage snapshot for the mem builtin.", "kind": "function", "line": 303, "name": "ramdisk_usage", "signature": "void ramdisk_usage(unsigned *used, unsigned *cap, unsigned *max);"}, {"doc": "Path resolution choke point shared by the shell builtins and the zip builtins. fs_resolve resolves a path against the cwd into `out` (cap >= RAMDISK_FNAME_LEN); a name that does not fit is rejected like a * missing file, never truncated.", "kind": "function", "line": 311, "name": "fs_resolve", "signature": "int fs_resolve(const char *path, char *out, unsigned cap);"}, {"kind": "function", "line": 312, "name": "fs_dir_exists", "signature": "int fs_dir_exists(const char *dir);"}, {"kind": "function", "line": 313, "name": "fs_is_dir", "signature": "int fs_is_dir(const char *resolved);"}, {"kind": "function", "line": 417, "name": "vfs_register", "signature": "int vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver);"}, {"kind": "function", "line": 418, "name": "vfs_unregister", "signature": "int vfs_unregister(const char *prefix);"}, {"doc": "define VFS_MAX_MOUNTS 8 define VFS_PREFIX_LEN 32 define VFS_DRIVER_LEN 16", "kind": "function", "line": 422, "name": "vfs_list", "signature": "int vfs_list(char prefixes[][VFS_PREFIX_LEN], char drivers[][VFS_DRIVER_LEN], int refs[], int cap);"}, {"kind": "function", "line": 424, "name": "vfs_mount_driver", "signature": "int vfs_mount_driver(const char *prefix, const char *driver);"}, {"kind": "function", "line": 425, "name": "vfs_open", "signature": "int vfs_open(const char *path, int mode, vfs_file_t *f);"}, {"kind": "function", "line": 426, "name": "vfs_read", "signature": "int vfs_read(vfs_file_t *f, void *buf, unsigned long len);"}, {"kind": "function", "line": 427, "name": "vfs_write", "signature": "int vfs_write(vfs_file_t *f, const void *buf, unsigned long len);"}, {"kind": "function", "line": 428, "name": "vfs_close", "signature": "int vfs_close(vfs_file_t *f);"}, {"kind": "function", "line": 429, "name": "vfs_fstat", "signature": "int vfs_fstat(vfs_file_t *f, unsigned long *size_out);"}, {"kind": "function", "line": 430, "name": "vfs_readdir", "signature": "int vfs_readdir(const char *path, vfs_dirent_t *ents, int cap);"}, {"kind": "function", "line": 431, "name": "vfs_init", "signature": "void vfs_init(void);"}, {"kind": "function", "line": 432, "name": "vfs_register_builtins", "signature": "void vfs_register_builtins(void);"}, {"kind": "function", "line": 433, "name": "minifs_mkdir_p", "signature": "int minifs_mkdir_p(const char *resolved);"}, {"kind": "function", "line": 495, "name": "kfopen", "signature": "KFILE *kfopen(const char *path, const char *mode);"}, {"doc": "Directory handle for getdents64: kfopen refuses directories (EISDIR), so open(2) on a directory takes this path instead. resolved must be a * directory path; trailing '/' is added by the helper.", "kind": "function", "line": 499, "name": "kfopen_dir", "signature": "KFILE *kfopen_dir(const char *resolved);"}, {"kind": "function", "line": 500, "name": "kfclose", "signature": "int kfclose(KFILE *f);"}, {"kind": "function", "line": 505, "name": "today", "signature": "* cell is correct today (single shared ET_REL window, no miniGCC * threads);"}, {"doc": "Rename one file within its filesystem; see fs/kfile.c for the contract: * 0 ok, -2 missing src, -21 directory, -17 existing dst, -18 cross-fs.", "kind": "function", "line": 524, "name": "fs_rename", "signature": "int fs_rename(const char *oldr, const char *newr);"}, {"kind": "function", "line": 525, "name": "kfgetc", "signature": "int kfgetc(KFILE *f);"}, {"kind": "function", "line": 526, "name": "kfgets", "signature": "char *kfgets(char *buf, int size, KFILE *f);"}, {"kind": "function", "line": 527, "name": "kfungetc", "signature": "int kfungetc(int c, KFILE *f);"}, {"kind": "function", "line": 528, "name": "kfread", "signature": "unsigned long kfread(void *ptr, unsigned long size, unsigned long nmemb, KFILE *f);"}, {"kind": "function", "line": 529, "name": "kfwrite", "signature": "unsigned long kfwrite(const void *ptr, unsigned long size, unsigned long nmemb, KFILE *f);"}, {"kind": "function", "line": 530, "name": "kfseek", "signature": "int kfseek(KFILE *f, long offset, int whence);"}, {"kind": "function", "line": 531, "name": "kftell", "signature": "long kftell(KFILE *f);"}, {"kind": "function", "line": 532, "name": "kfputs", "signature": "int kfputs(const char *s, KFILE *f);"}, {"kind": "function", "line": 533, "name": "kfputc", "signature": "int kfputc(int c, KFILE *f);"}, {"kind": "function", "line": 534, "name": "kfflush", "signature": "int kfflush(KFILE *f);"}, {"kind": "function", "line": 535, "name": "krewind", "signature": "void krewind(KFILE *f);"}, {"kind": "function", "line": 540, "name": "kfile_stdin", "signature": "KFILE *kfile_stdin(void);"}, {"kind": "function", "line": 541, "name": "kfile_stdout", "signature": "KFILE *kfile_stdout(void);"}, {"kind": "function", "line": 542, "name": "kfile_stderr", "signature": "KFILE *kfile_stderr(void);"}, {"doc": "long   kftell(KFILE *f); int    kfputs(const char *s, KFILE *f); int    kfputc(int c, KFILE *f); int    kfflush(KFILE *f); void   krewind(KFILE *f); extern KFILE *kstdin; extern KFILE *kstdout; extern KFILE *kstderr; KFILE *kfile_stdin(void); KFILE *kfile_stdout(void); KFILE *kfile_stderr(void); /* ========== String functions ==========", "kind": "function", "line": 545, "name": "kstrlen", "signature": "unsigned long kstrlen(const char *s);"}, {"kind": "function", "line": 546, "name": "kstrcpy", "signature": "char *kstrcpy(char *dst, const char *src);"}, {"kind": "function", "line": 547, "name": "kstrncpy", "signature": "char *kstrncpy(char *dst, const char *src, unsigned long n);"}, {"kind": "function", "line": 548, "name": "kstrncat", "signature": "char *kstrncat(char *dst, const char *src, unsigned long n);"}, {"kind": "function", "line": 549, "name": "kstrcmp", "signature": "int kstrcmp(const char *a, const char *b);"}, {"kind": "function", "line": 550, "name": "kstrncmp", "signature": "int kstrncmp(const char *a, const char *b, unsigned long n);"}, {"kind": "function", "line": 551, "name": "kstrchr", "signature": "char *kstrchr(const char *s, int c);"}, {"kind": "function", "line": 552, "name": "kstrstr", "signature": "char *kstrstr(const char *hay, const char *ndl);"}, {"kind": "function", "line": 553, "name": "kmemcpy", "signature": "void *kmemcpy(void *dst, const void *src, unsigned long n);"}, {"kind": "function", "line": 554, "name": "kmemset", "signature": "void *kmemset(void *dst, int c, unsigned long n);"}, {"kind": "function", "line": 555, "name": "kmemcmp", "signature": "int kmemcmp(const void *a, const void *b, unsigned long n);"}, {"kind": "function", "line": 556, "name": "kmemmove", "signature": "void *kmemmove(void *dst, const void *src, unsigned long n);"}, {"kind": "function", "line": 557, "name": "katol", "signature": "long katol(const char *s);"}, {"doc": "char *kstrcpy(char *dst, const char *src); char *kstrncpy(char *dst, const char *src, unsigned long n); char *kstrncat(char *dst, const char *src, unsigned long n); int   kstrcmp(const char *a, const char *b); int   kstrncmp(const char *a, const char *b, unsigned long n); char *kstrchr(const char *s, int c); char *kstrstr(const char *hay, const char *ndl); void *kmemcpy(void *dst, const void *src, unsigned long n); void *kmemset(void *dst, int c, unsigned long n); int   kmemcmp(const void *a, const void *b, unsigned long n); void *kmemmove(void *dst, const void *src, unsigned long n); long   katol(const char *s); /* ========== printf ==========", "kind": "function", "line": 560, "name": "kprintf", "signature": "int kprintf(const char *fmt, ...);"}, {"kind": "function", "line": 561, "name": "kfprintf", "signature": "int kfprintf(KFILE *f, const char *fmt, ...);"}, {"kind": "function", "line": 562, "name": "ksprintf", "signature": "int ksprintf(char *buf, const char *fmt, ...);"}, {"kind": "function", "line": 563, "name": "ksnprintf", "signature": "int ksnprintf(char *buf, unsigned long size, const char *fmt, ...);"}, {"kind": "function", "line": 578, "name": "klog", "signature": "void klog(log_level_t level, log_subsystem_t subsys, const char *fmt, ...);"}, {"kind": "function", "line": 580, "name": "klog_hexdump", "signature": "void klog_hexdump(log_level_t level, log_subsystem_t subsys, const void *data, unsigned long len, const char *label);"}, {"kind": "function", "line": 582, "name": "klog_set_level", "signature": "void klog_set_level(log_level_t level);"}, {"kind": "function", "line": 583, "name": "klog_set_subsys_level", "signature": "void klog_set_subsys_level(log_subsystem_t subsys, log_level_t level);"}, {"kind": "function", "line": 584, "name": "klog_disable", "signature": "void klog_disable(void);"}, {"kind": "function", "line": 585, "name": "klog_enable", "signature": "void klog_enable(void);"}, {"doc": "LOG_SUBSYS_SHELL, LOG_SUBSYS_BOOT, LOG_SUBSYS_GENERAL, LOG_SUBSYS_COUNT } log_subsystem_t; void klog(log_level_t level, log_subsystem_t subsys, const char *fmt, ...); void klog_hexdump(log_level_t level, log_subsystem_t subsys, const void *data, unsigned long len, const char *label); void klog_set_level(log_level_t level); void klog_set_subsys_level(log_subsystem_t subsys, log_level_t level); void klog_disable(void); void klog_enable(void); /* ========== Shell ==========", "kind": "function", "line": 588, "name": "shell_init", "signature": "void shell_init(void);"}, {"kind": "function", "line": 589, "name": "shell_run", "signature": "void shell_run(void);"}, {"kind": "function", "line": 590, "name": "console_getc", "signature": "int console_getc(void);"}, {"kind": "function", "line": 591, "name": "console_peek", "signature": "int console_peek(void);"}, {"kind": "function", "line": 592, "name": "redirect_suspend", "signature": "int redirect_suspend(void);"}, {"kind": "function", "line": 593, "name": "redirect_resume", "signature": "void redirect_resume(int was);"}, {"kind": "function", "line": 594, "name": "redirect_begin", "signature": "int redirect_begin(void);"}, {"kind": "function", "line": 595, "name": "redirect_commit", "signature": "int redirect_commit(const char *path, int append_mode);"}, {"kind": "function", "line": 596, "name": "redirect_take", "signature": "char *redirect_take(unsigned long *len_out);"}, {"kind": "function", "line": 597, "name": "redirect_pending", "signature": "unsigned long redirect_pending(void);"}, {"kind": "function", "line": 598, "name": "redirect_take_into", "signature": "unsigned long redirect_take_into(char *dst, unsigned long cap, unsigned long *len_out);"}, {"kind": "function", "line": 600, "name": "redirect_discard", "signature": "void redirect_discard(void);"}, {"kind": "function", "line": 601, "name": "redirect_active", "signature": "int redirect_active(void);"}, {"kind": "function", "line": 602, "name": "console_stdin_push", "signature": "int console_stdin_push(const char *data, unsigned long len);"}, {"kind": "function", "line": 603, "name": "console_stdin_clear", "signature": "void console_stdin_clear(void);"}, {"kind": "function", "line": 604, "name": "console_stdin_active", "signature": "int console_stdin_active(void);"}, {"doc": "void redirect_resume(int was); int  redirect_begin(void); int  redirect_commit(const char *path, int append_mode); char *redirect_take(unsigned long *len_out); unsigned long redirect_pending(void); unsigned long redirect_take_into(char *dst, unsigned long cap, unsigned long *len_out); void redirect_discard(void); int  redirect_active(void); int console_stdin_push(const char *data, unsigned long len); void console_stdin_clear(void); int console_stdin_active(void); /* ========== Panic screen (kernel/panic.c) ==========", "kind": "function", "line": 607, "name": "panic_screen", "signature": "void panic_screen(unsigned long vector, unsigned long err, unsigned long rip, unsigned long rsp, unsigned long rbp, int halt);"}, {"doc": "unsigned long redirect_pending(void); unsigned long redirect_take_into(char *dst, unsigned long cap, unsigned long *len_out); void redirect_discard(void); int  redirect_active(void); int console_stdin_push(const char *data, unsigned long len); void console_stdin_clear(void); int console_stdin_active(void); /* ========== Panic screen (kernel/panic.c) ========== void panic_screen(unsigned long vector, unsigned long err, unsigned long rip, unsigned long rsp, unsigned long rbp, int halt); /* ========== Shared clipboard (kernel/clip.c) ==========", "kind": "function", "line": 611, "name": "clip_set", "signature": "int clip_set(const char *data, unsigned long len);"}, {"kind": "function", "line": 612, "name": "clip_get", "signature": "int clip_get(char *out, unsigned long cap);"}, {"kind": "function", "line": 613, "name": "clip_clear", "signature": "void clip_clear(void);"}, {"kind": "function", "line": 614, "name": "clip_len_get", "signature": "int clip_len_get(void);"}, {"kind": "function", "line": 615, "name": "shell_take_redirect", "signature": "int shell_take_redirect(int *argc, char **argv, char **path, int *append_mode);"}, {"kind": "function", "line": 616, "name": "shell_run_any", "signature": "int shell_run_any(const char *name, int argc, char **argv);"}, {"kind": "function", "line": 617, "name": "shell_exec_builtin", "signature": "void shell_exec_builtin(int argc, char **argv);"}, {"kind": "function", "line": 618, "name": "shell_report_exit", "signature": "void shell_report_exit(int code);"}, {"kind": "function", "line": 619, "name": "shell_report", "signature": "void shell_report(const char *what, const char *detail);"}, {"kind": "function", "line": 644, "name": "kprog_slot", "signature": "KProg *kprog_slot(const char *name);"}, {"kind": "function", "line": 645, "name": "kprog_lookup", "signature": "KProg *kprog_lookup(const char *name);"}, {"kind": "function", "line": 646, "name": "ksym_resolve", "signature": "void *ksym_resolve(const char *name);"}, {"kind": "function", "line": 647, "name": "k_spawn", "signature": "int k_spawn(const char *name, int argc, char **argv);"}, {"kind": "function", "line": 648, "name": "k_register_program", "signature": "void k_register_program(const char *name, prog_entry_t entry);"}, {"kind": "function", "line": 649, "name": "k_register_process", "signature": "void k_register_process(const char *name, void *proc_entry);"}, {"kind": "function", "line": 650, "name": "k_register_symbol", "signature": "void k_register_symbol(const char *name, void *addr);"}, {"doc": "Libc name table for ET_REL programs (kernel/console.c). Called once * from kmain; the table itself lives in kernel/symtab.c.", "kind": "function", "line": 654, "name": "register_libc_symbols", "signature": "void register_libc_symbols(void);"}, {"doc": "Libc name table for ET_REL programs (kernel/console.c). Called once * from kmain; the table itself lives in kernel/symtab.c. void register_libc_symbols(void); /* ========== Process execution (Linux ELF binaries) ==========", "kind": "function", "line": 657, "name": "k_exec_user", "signature": "int k_exec_user(void *entry, int argc, char **argv);"}, {"kind": "function", "line": 658, "name": "k_run_rel", "signature": "int k_run_rel(prog_entry_t entry, int argc, char **argv);"}, {"kind": "function", "line": 659, "name": "kexit", "signature": "void kexit(int code);"}, {"doc": "ET_REL stack switch (arch/x86/ctx_sw.S): runs entry(argc, argv) on * the 64 KB stack ending at stack_top. See the asm contract there.", "kind": "function", "line": 662, "name": "k_run_on_stack", "signature": "int k_run_on_stack(void *stack_top, prog_entry_t entry, int argc, char **argv);"}, {"kind": "function", "line": 667, "name": "ksetjmp", "signature": "int ksetjmp(void *buf) __attribute__((returns_twice));"}, {"kind": "function", "line": 668, "name": "klongjmp", "signature": "void klongjmp(void *buf, int val) __attribute__((noreturn));"}, {"kind": "function", "line": 671, "name": "setup_user_stack", "signature": "unsigned long *setup_user_stack(char *sbase, unsigned long ssize, int argc, char **argv);"}, {"kind": "function", "line": 673, "name": "vga_mode_set", "signature": "void vga_mode_set(int on);"}, {"kind": "function", "line": 674, "name": "vga_mode_is_active", "signature": "int vga_mode_is_active(void);"}, {"kind": "function", "line": 675, "name": "vga_gfx_ran_set", "signature": "void vga_gfx_ran_set(int on);"}, {"doc": "/* ========== Execution infrastructure (kernel/exec.c) ========== typedef struct { unsigned long v[8]; } kjmpbuf; int  ksetjmp(void *buf) __attribute__((returns_twice)); void klongjmp(void *buf, int val) __attribute__((noreturn)); extern kjmpbuf exec_return; extern int     exec_exit_code; unsigned long *setup_user_stack(char *sbase, unsigned long ssize, int argc, char **argv); void vga_mode_set(int on); int  vga_mode_is_active(void); void vga_gfx_ran_set(int on); /* ========== Desktop shortcut launch ==========", "kind": "function", "line": 678, "name": "desktop_launch", "signature": "void desktop_launch(const char *cmd);"}, {"kind": "function", "line": 679, "name": "shell_queue_launch", "signature": "void shell_queue_launch(const char *cmd);"}, {"doc": "void klongjmp(void *buf, int val) __attribute__((noreturn)); extern kjmpbuf exec_return; extern int     exec_exit_code; unsigned long *setup_user_stack(char *sbase, unsigned long ssize, int argc, char **argv); void vga_mode_set(int on); int  vga_mode_is_active(void); void vga_gfx_ran_set(int on); /* ========== Desktop shortcut launch ========== void desktop_launch(const char *cmd); void shell_queue_launch(const char *cmd); /* ========== Multi-window manager (vga_fb.c) ==========", "kind": "function", "line": 682, "name": "vga_fb_focus_next", "signature": "void vga_fb_focus_next(void);"}, {"kind": "function", "line": 683, "name": "vga_fb_focus_id", "signature": "int vga_fb_focus_id(int id);"}, {"kind": "function", "line": 684, "name": "vga_fb_focus_get", "signature": "int vga_fb_focus_get(void);"}, {"kind": "function", "line": 685, "name": "vga_fb_nterms_get", "signature": "int vga_fb_nterms_get(void);"}, {"kind": "function", "line": 686, "name": "vga_fb_term_split", "signature": "int vga_fb_term_split(void);"}, {"kind": "function", "line": 687, "name": "vga_fb_term_close_focused", "signature": "int vga_fb_term_close_focused(void);"}, {"kind": "function", "line": 688, "name": "vga_fb_tile_all", "signature": "void vga_fb_tile_all(void);"}, {"kind": "function", "line": 689, "name": "vga_fb_list_windows", "signature": "void vga_fb_list_windows(void);"}, {"kind": "function", "line": 690, "name": "vga_fb_park_line", "signature": "void vga_fb_park_line(const char *b, int p);"}, {"kind": "function", "line": 691, "name": "vga_fb_unpark_line", "signature": "int vga_fb_unpark_line(char *b, int *p);"}, {"kind": "function", "line": 692, "name": "vga_fb_set_gfx_program", "signature": "void vga_fb_set_gfx_program(const char *name);"}, {"kind": "function", "line": 693, "name": "vga_fb_act_empty", "signature": "int vga_fb_act_empty(void);"}, {"kind": "function", "line": 694, "name": "vga_fb_prompt_live", "signature": "int vga_fb_prompt_live(void);"}, {"kind": "function", "line": 695, "name": "vga_fb_note_prompt", "signature": "void vga_fb_note_prompt(void);"}, {"kind": "function", "line": 696, "name": "vga_fb_clear_prompt", "signature": "void vga_fb_clear_prompt(void);"}, {"kind": "function", "line": 697, "name": "vga_fb_prompted", "signature": "int vga_fb_prompted(void);"}, {"doc": "Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c.", "kind": "function", "line": 701, "name": "shell_readline_active", "signature": "int shell_readline_active(void);"}, {"kind": "function", "line": 702, "name": "shell_focus_park", "signature": "void shell_focus_park(void);"}, {"kind": "function", "line": 703, "name": "shell_focus_restore", "signature": "void shell_focus_restore(void);"}, {"doc": "Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c. int  shell_readline_active(void); void shell_focus_park(void); void shell_focus_restore(void); /** Docstring: Nonzero while the shell blocks in a foreground wait. extern volatile int shell_fg_active; /* ========== User-pointer validation (kernel.c) ==========", "kind": "function", "line": 708, "name": "user_range_ok", "signature": "int user_range_ok(unsigned long p, unsigned long len);"}, {"kind": "function", "line": 709, "name": "user_str_ok", "signature": "int user_str_ok(unsigned long p, unsigned long maxlen);"}, {"doc": "Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c. int  shell_readline_active(void); void shell_focus_park(void); void shell_focus_restore(void); /** Docstring: Nonzero while the shell blocks in a foreground wait. extern volatile int shell_fg_active; /* ========== User-pointer validation (kernel.c) ========== int user_range_ok(unsigned long p, unsigned long len); int user_str_ok(unsigned long p, unsigned long maxlen); /* ========== Page table helpers (kernel/mm/paging.c) ==========", "kind": "function", "line": 712, "name": "mm_setup_protections", "signature": "void mm_setup_protections(void);"}, {"kind": "function", "line": 713, "name": "pt_page_alloc", "signature": "void *pt_page_alloc(void);"}, {"kind": "function", "line": 714, "name": "pt_page_free", "signature": "void pt_page_free(void *ptr);"}, {"kind": "function", "line": 715, "name": "mm_user_pte_update", "signature": "void mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3);"}, {"kind": "function", "line": 716, "name": "mm_user_set_exec", "signature": "void mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3);"}, {"doc": "extern volatile int shell_fg_active; /* ========== User-pointer validation (kernel.c) ========== int user_range_ok(unsigned long p, unsigned long len); int user_str_ok(unsigned long p, unsigned long maxlen); /* ========== Page table helpers (kernel/mm/paging.c) ========== void  mm_setup_protections(void); void *pt_page_alloc(void); void  pt_page_free(void *ptr); void  mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3); void  mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3); /* ========== Swap (kernel/mm/swap.c) ==========", "kind": "function", "line": 719, "name": "swap_out", "signature": "int swap_out(unsigned long window_sz);"}, {"kind": "function", "line": 720, "name": "swap_in", "signature": "int swap_in(void);"}, {"kind": "function", "line": 766, "name": "elf_load", "signature": "void *elf_load(void *data, unsigned size, void **base_out);"}, {"doc": "Heap/mmap ceiling: the shared-library region starts here with the graphics tail above it, so brk growth and the mmap cursor can reach neither. Replaces bare USER_BRK_END wherever a fresh user view is seeded; the DOOM_BACKBUF_ADDR clamp stays alongside as the graphics * pin, a no-op today and a guard if the region ever moves. #define USER_HEAP_CEIL LDSO_REGION_BASE void *elf_load(void *data, unsigned size, void **base_out);       /* ET_REL relocatable .o", "kind": "function", "line": 767, "name": "load_exec_elf", "signature": "void *load_exec_elf(void *data, unsigned size);"}, {"doc": "Heap/mmap ceiling: the shared-library region starts here with the graphics tail above it, so brk growth and the mmap cursor can reach neither. Replaces bare USER_BRK_END wherever a fresh user view is seeded; the DOOM_BACKBUF_ADDR clamp stays alongside as the graphics * pin, a no-op today and a guard if the region ever moves. #define USER_HEAP_CEIL LDSO_REGION_BASE void *elf_load(void *data, unsigned size, void **base_out);       /* ET_REL relocatable .o void *load_exec_elf(void *data, unsigned size);  /* ET_EXEC / ET_DYN", "kind": "function", "line": 768, "name": "elf_wants_process", "signature": "int elf_wants_process(const void *data, unsigned size);"}, {"doc": "Heap/mmap ceiling: the shared-library region starts here with the graphics tail above it, so brk growth and the mmap cursor can reach neither. Replaces bare USER_BRK_END wherever a fresh user view is seeded; the DOOM_BACKBUF_ADDR clamp stays alongside as the graphics * pin, a no-op today and a guard if the region ever moves. #define USER_HEAP_CEIL LDSO_REGION_BASE void *elf_load(void *data, unsigned size, void **base_out);       /* ET_REL relocatable .o void *load_exec_elf(void *data, unsigned size);  /* ET_EXEC / ET_DYN int elf_wants_process(const void *data, unsigned size);  /* process note", "kind": "function", "line": 769, "name": "load_exec_elf_into", "signature": "void *load_exec_elf_into(void *data, unsigned size, unsigned long cr3, unsigned long *brk_out, unsigned long *base_out);"}, {"doc": "Minimal dynamic linker (T8 ld.so, kernel/loader.c). bind_into maps the DT_NEEDED libraries of an already-copied image into the target window (live legacy view when vma is 0 and cr3 is the current one, isolated window otherwise) and resolves its GLOB_DAT slots; the pseudo_* hooks serve registry file bytes to the page-fault path under ldso pseudo * inodes, so text stays shared through the pcache.", "kind": "function", "line": 778, "name": "ldso_bind_into", "signature": "int ldso_bind_into(void *data, unsigned size, unsigned long base, unsigned long cr3, vma_ctx_t *vma);"}, {"kind": "function", "line": 780, "name": "ldso_pseudo_stat", "signature": "int ldso_pseudo_stat(int ino, unsigned long *size_out);"}, {"kind": "function", "line": 781, "name": "ldso_pseudo_read", "signature": "int ldso_pseudo_read(int ino, void *dst, unsigned long off, unsigned len);"}, {"kind": "function", "line": 782, "name": "pt_clone_user_empty", "signature": "unsigned long pt_clone_user_empty(void);"}, {"kind": "function", "line": 783, "name": "mm_user_ensure_page", "signature": "int mm_user_ensure_page(unsigned long cr3, unsigned long va);"}, {"kind": "function", "line": 784, "name": "mm_user_map_page", "signature": "int mm_user_map_page(unsigned long cr3, unsigned long va, unsigned long phys, int write, int exec);"}, {"kind": "function", "line": 786, "name": "mm_file_fault", "signature": "int mm_file_fault(unsigned long cr3, unsigned long va);"}, {"kind": "function", "line": 787, "name": "mm_file_break", "signature": "int mm_file_break(unsigned long cr3, unsigned long va);"}, {"kind": "function", "line": 788, "name": "mm_file_page_phys", "signature": "unsigned long mm_file_page_phys(unsigned long cr3, unsigned long va);"}, {"kind": "function", "line": 789, "name": "mm_file_range_release", "signature": "void mm_file_range_release(unsigned long cr3, unsigned long base, unsigned long len, int ino, unsigned long off, int unmap);"}, {"doc": "Anonymous demand paging (docs/spec/kernel.md): a reserved page is a non-present PTE carrying PTE_DEMAND and the protection the mapping asked for, in bits the MMU ignores while the present bit is clear (bits 0 and 1 stay clear, so every \"present\" test keeps reading it as absent). The first touch, from ring 3 or a kernel copy into a user buffer, maps a * zeroed page with that protection; PROT_NONE never maps. define PTE_DEMAND        0x200UL define PTE_DEMAND_READ   0x100UL define PTE_DEMAND_WRITE  0x400UL define PTE_DEMAND_EXEC   0x800UL define LINUX_PROT_READ   1UL define LINUX_PROT_WRITE  2UL define LINUX_PROT_EXEC   4UL", "kind": "function", "line": 805, "name": "mm_demand_pte", "signature": "unsigned long mm_demand_pte(unsigned long prot);"}, {"kind": "function", "line": 806, "name": "mm_anon_reserve", "signature": "int mm_anon_reserve(unsigned long cr3, unsigned long base, unsigned long len, unsigned long prot);"}, {"kind": "function", "line": 808, "name": "mm_anon_fault", "signature": "int mm_anon_fault(unsigned long cr3, unsigned long va, int write);"}, {"kind": "function", "line": 809, "name": "pt_page_owned", "signature": "int pt_page_owned(unsigned long phys);"}, {"kind": "function", "line": 810, "name": "mm_anon_release", "signature": "void mm_anon_release(unsigned long cr3, unsigned long base, unsigned long len);"}, {"kind": "function", "line": 811, "name": "cow_drop_ref", "signature": "int cow_drop_ref(unsigned long phys);"}, {"kind": "function", "line": 817, "name": "refused", "signature": "* refused (see kernel/mm/paging.c for the fail-closed list). */ unsigned long kmm_map_device(unsigned long phys, unsigned long len);"}, {"kind": "function", "line": 819, "name": "kmm_make_uncached", "signature": "int kmm_make_uncached(unsigned long phys, unsigned long len);"}, {"kind": "function", "line": 820, "name": "mm_copy_user_page", "signature": "int mm_copy_user_page(unsigned long dst_cr3, unsigned long src_cr3, unsigned long va);"}, {"kind": "function", "line": 824, "name": "fault", "signature": "* fixes one write fault (0 = resume), cow_release_window drops a * dying window's shares ahead of pt_free_user. */ unsigned long cow_fork_window(unsigned long parent_cr3);"}, {"kind": "function", "line": 827, "name": "cow_resolve", "signature": "int cow_resolve(unsigned long cr3, unsigned long va);"}, {"kind": "function", "line": 828, "name": "user_page_present", "signature": "int user_page_present(unsigned long cr3, unsigned long va);"}, {"kind": "function", "line": 829, "name": "cow_release_window", "signature": "void cow_release_window(unsigned long cr3);"}, {"kind": "function", "line": 830, "name": "cow_shared", "signature": "int cow_shared(void);"}, {"kind": "function", "line": 831, "name": "cow_page_shared", "signature": "int cow_page_shared(unsigned long phys);"}, {"doc": "Copy-on-write fork (kernel/mm/cow.c): share on fork, privatize on first write. cow_fork_window builds the child window, cow_resolve fixes one write fault (0 = resume), cow_release_window drops a * dying window's shares ahead of pt_free_user. unsigned long cow_fork_window(unsigned long parent_cr3); int cow_resolve(unsigned long cr3, unsigned long va); int user_page_present(unsigned long cr3, unsigned long va); void cow_release_window(unsigned long cr3); int cow_shared(void); int cow_page_shared(unsigned long phys); /* ========== Linux syscall interface ==========", "kind": "function", "line": 834, "name": "syscall_init", "signature": "void syscall_init(void);"}, {"kind": "function", "line": 838, "name": "ksyscall", "signature": "long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 839, "name": "syscall_trace_enabled", "signature": "long syscall_trace_enabled(void);"}, {"kind": "function", "line": 840, "name": "syscall_trace_set", "signature": "void syscall_trace_set(int on);"}, {"kind": "function", "line": 841, "name": "syscall_trace_verbose_enabled", "signature": "long syscall_trace_verbose_enabled(void);"}, {"kind": "function", "line": 842, "name": "syscall_trace_verbose_set", "signature": "void syscall_trace_verbose_set(int on);"}, {"kind": "function", "line": 843, "name": "syscall_trace_shown", "signature": "unsigned long syscall_trace_shown(void);"}, {"kind": "function", "line": 844, "name": "syscall_name", "signature": "const char *syscall_name(long n);"}, {"kind": "function", "line": 865, "name": "kfd_get", "signature": "KFILE *kfd_get(int fd);"}, {"kind": "function", "line": 866, "name": "kfd_put", "signature": "void kfd_put(KFILE *f);"}, {"kind": "function", "line": 867, "name": "kfd_override", "signature": "KFILE *kfd_override(int fd, KFILE *f);"}, {"kind": "function", "line": 868, "name": "kpipe_pair", "signature": "int kpipe_pair(KFILE **rend_out, KFILE **wend_out);"}, {"kind": "function", "line": 869, "name": "kpipe_empty_wopen", "signature": "int kpipe_empty_wopen(KFILE *f);"}, {"kind": "function", "line": 870, "name": "kpipe_is_write_end", "signature": "int kpipe_is_write_end(KFILE *f);"}, {"doc": "Pipe snapshot for poll and the blocking syscall layer: bytes waiting, * free space, writer open, reader open. -1 on a non-pipe file.", "kind": "function", "line": 873, "name": "kpipe_state", "signature": "int kpipe_state(KFILE *f, unsigned *avail, unsigned *space, int *wopen, int *ropen);"}, {"doc": "poll(2) readiness bits of a non-socket descriptor (kernel/syscalls.c): * pipes, eventfds, files and the console; POLLNVAL for a closed fd.", "kind": "function", "line": 876, "name": "kfd_poll_revents", "signature": "int kfd_poll_revents(int fd);"}, {"doc": "eventfd(2) descriptions (docs/spec/smp-sched.md): create with an initial counter, read (0 or -EAGAIN when the counter is 0), write (0, -EAGAIN on overflow past KEVENT_MAX, -EINVAL for the all-ones value), and the * readiness poll consults. define KEVENT_MAX 0xfffffffffffffffeULL", "kind": "function", "line": 882, "name": "kevent_create", "signature": "KFILE *kevent_create(unsigned long long initval, int semaphore);"}, {"kind": "function", "line": 883, "name": "kevent_read", "signature": "long kevent_read(KFILE *f, unsigned long long *out);"}, {"kind": "function", "line": 884, "name": "kevent_write", "signature": "long kevent_write(KFILE *f, unsigned long long v);"}, {"kind": "function", "line": 885, "name": "kevent_readable", "signature": "int kevent_readable(KFILE *f);"}, {"kind": "function", "line": 886, "name": "kevent_writable", "signature": "int kevent_writable(KFILE *f);"}, {"kind": "function", "line": 889, "name": "fd_lock", "signature": "* fd_lock (never nested, never held across yields);"}, {"kind": "function", "line": 913, "name": "ktime_us", "signature": "unsigned long ktime_us(void);"}, {"kind": "function", "line": 914, "name": "wall_us_now", "signature": "unsigned long wall_us_now(void);"}, {"doc": "it with pointer subtraction in C (undefined behaviour). The value is a link-time difference, so it is invariant under the KASLR slide: ramdisk_start and ramdisk_end move together inside the contiguous * image span. static inline unsigned long ramdisk_image_size(void) { return (unsigned long)ramdisk_size; } /* ========== Kernel clock ========== unsigned long ktime_ms(void); unsigned long ktime_us(void); unsigned long wall_us_now(void); /* ========== Boot-phase log (kernel.c, `bootlog` builtin) ==========", "kind": "function", "line": 917, "name": "bootlog_mark", "signature": "void bootlog_mark(const char *name);"}, {"kind": "function", "line": 918, "name": "bootlog_report", "signature": "void bootlog_report(void);"}, {"doc": "static inline unsigned long ramdisk_image_size(void) { return (unsigned long)ramdisk_size; } /* ========== Kernel clock ========== unsigned long ktime_ms(void); unsigned long ktime_us(void); unsigned long wall_us_now(void); /* ========== Boot-phase log (kernel.c, `bootlog` builtin) ========== void bootlog_mark(const char *name); void bootlog_report(void); /* ========== PC speaker ==========", "kind": "function", "line": 921, "name": "pcspk_init", "signature": "void pcspk_init(void);"}, {"kind": "function", "line": 922, "name": "pcspk_tone", "signature": "void pcspk_tone(unsigned freq);"}, {"kind": "function", "line": 923, "name": "pcspk_off", "signature": "void pcspk_off(void);"}, {"kind": "function", "line": 924, "name": "pcspk_set_volume", "signature": "void pcspk_set_volume(unsigned volume);"}, {"kind": "function", "line": 925, "name": "pcspk_get_volume", "signature": "unsigned pcspk_get_volume(void);"}, {"doc": "unsigned long wall_us_now(void); /* ========== Boot-phase log (kernel.c, `bootlog` builtin) ========== void bootlog_mark(const char *name); void bootlog_report(void); /* ========== PC speaker ========== void     pcspk_init(void); void     pcspk_tone(unsigned freq); void     pcspk_off(void); void     pcspk_set_volume(unsigned volume); unsigned pcspk_get_volume(void); /* ========== RTC time-of-day ==========", "kind": "function", "line": 928, "name": "rtc_read_tod", "signature": "int rtc_read_tod(int *hour, int *min, int *sec);"}, {"doc": "void bootlog_mark(const char *name); void bootlog_report(void); /* ========== PC speaker ========== void     pcspk_init(void); void     pcspk_tone(unsigned freq); void     pcspk_off(void); void     pcspk_set_volume(unsigned volume); unsigned pcspk_get_volume(void); /* ========== RTC time-of-day ========== int rtc_read_tod(int *hour, int *min, int *sec); /* ========== IDE driver ==========", "kind": "function", "line": 931, "name": "ide_init", "signature": "void ide_init(void);"}, {"kind": "function", "line": 932, "name": "ide_read_sectors", "signature": "int ide_read_sectors(unsigned int lba, unsigned int count, void *buf);"}, {"kind": "function", "line": 933, "name": "ide_write_sectors", "signature": "int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf);"}, {"kind": "function", "line": 934, "name": "ide_read_sector", "signature": "int ide_read_sector(unsigned int lba, void *buf);"}, {"kind": "function", "line": 935, "name": "ide_write_sector", "signature": "int ide_write_sector(unsigned int lba, const void *buf);"}, {"kind": "function", "line": 936, "name": "ide_total_sectors", "signature": "unsigned int ide_total_sectors(void);"}, {"kind": "function", "line": 937, "name": "ide_present", "signature": "int ide_present(void);"}, {"doc": "/* ========== RTC time-of-day ========== int rtc_read_tod(int *hour, int *min, int *sec); /* ========== IDE driver ========== void ide_init(void); int  ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int  ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); int  ide_read_sector(unsigned int lba, void *buf); int  ide_write_sector(unsigned int lba, const void *buf); unsigned int ide_total_sectors(void); int  ide_present(void); /* ========== Block device layer ==========", "kind": "function", "line": 940, "name": "block_init", "signature": "void block_init(void);"}, {"kind": "function", "line": 941, "name": "block_read", "signature": "int block_read(unsigned int block_num, void *buf);"}, {"kind": "function", "line": 942, "name": "block_write", "signature": "int block_write(unsigned int block_num, const void *buf);"}, {"kind": "function", "line": 943, "name": "block_read_multi", "signature": "int block_read_multi(unsigned int block_num, unsigned int count, void *buf);"}, {"kind": "function", "line": 944, "name": "block_write_multi", "signature": "int block_write_multi(unsigned int block_num, unsigned int count, const void *buf);"}, {"kind": "function", "line": 945, "name": "block_total", "signature": "unsigned int block_total(void);"}, {"doc": "int  ide_read_sector(unsigned int lba, void *buf); int  ide_write_sector(unsigned int lba, const void *buf); unsigned int ide_total_sectors(void); int  ide_present(void); /* ========== Block device layer ========== void block_init(void); int  block_read(unsigned int block_num, void *buf); int  block_write(unsigned int block_num, const void *buf); int  block_read_multi(unsigned int block_num, unsigned int count, void *buf); int  block_write_multi(unsigned int block_num, unsigned int count, const void *buf); unsigned int block_total(void); /* ========== User-mode fault recovery ==========", "kind": "function", "line": 948, "name": "k_user_fault_return", "signature": "void k_user_fault_return(void);"}, {"doc": "Console output lock (kernel/console.c): serializes SMP console output across CPUs. Held across the whole vga_putc body; try-or-race so an ISR * dump prints rather than deadlocks on a lock held by interrupted context.", "kind": "variable", "line": 105, "name": "console_lock", "signature": "extern spinlock_t console_lock;"}, {"doc": "/* ========== Scrollback ring (kernel/scrollback.c) ========== void sb_init(void); void sb_capture_row0(void); void sb_reset(void); int  sb_get_count(void); int  sb_get_head(void); char sb_get_char(int row, int col); /* ========== Serial console (COM1) ========== void serial_init(void); void serial_putc(char c); void serial_puts(const char *s); void sc_record_dump(int pid); unsigned long serial_e_count(void);          /* E-flood tracer (serial.c)", "kind": "variable", "line": 133, "name": "ser_e_cpu", "signature": "extern unsigned long ser_e_ra, ser_e_cpu;"}, {"kind": "variable", "line": 214, "name": "kmalloc_fail_after", "signature": "extern long kmalloc_fail_after;"}, {"doc": "Bytes of kernel heap actually in use as the dlmalloc space: HEAP_SIZE * clamped to the RAM installed above HEAP_BASE.", "kind": "variable", "line": 229, "name": "kheap_size", "signature": "extern unsigned long kheap_size;"}, {"kind": "variable", "line": 434, "name": "fs_cwd", "signature": "extern char fs_cwd[];"}, {"doc": "Guarded: host test TUs include system headers beside kernel.h. ifndef ENOENT define ENOENT 2 define EIO 5 define EBADF 9 define ENOMEM 12 define ENOTDIR 20 define EISDIR 21 define EINVAL 22 define EFBIG 27 define ENOSPC 28 define ESPIPE 29 define ENAMETOOLONG 36 endif", "kind": "variable", "line": 521, "name": "kerrno", "signature": "extern int kerrno;"}, {"kind": "variable", "line": 537, "name": "kstdin", "signature": "extern KFILE *kstdin;"}, {"kind": "variable", "line": 538, "name": "kstdout", "signature": "extern KFILE *kstdout;"}, {"kind": "variable", "line": 539, "name": "kstderr", "signature": "extern KFILE *kstderr;"}, {"kind": "variable", "line": 639, "name": "ksym_table", "signature": "extern KSym ksym_table[];"}, {"kind": "variable", "line": 640, "name": "ksym_count", "signature": "extern int ksym_count;"}, {"kind": "variable", "line": 641, "name": "kprog_table", "signature": "extern KProg kprog_table[];"}, {"kind": "variable", "line": 642, "name": "kprog_count", "signature": "extern int kprog_count;"}, {"kind": "variable", "line": 669, "name": "exec_return", "signature": "extern kjmpbuf exec_return;"}, {"kind": "variable", "line": 670, "name": "exec_exit_code", "signature": "extern int exec_exit_code;"}, {"doc": "Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c. int  shell_readline_active(void); void shell_focus_park(void); void shell_focus_restore(void); /** Docstring: Nonzero while the shell blocks in a foreground wait.", "kind": "variable", "line": 705, "name": "shell_fg_active", "signature": "extern volatile int shell_fg_active;"}, {"doc": "int user_str_ok(unsigned long p, unsigned long maxlen); /* ========== Page table helpers (kernel/mm/paging.c) ========== void  mm_setup_protections(void); void *pt_page_alloc(void); void  pt_page_free(void *ptr); void  mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3); void  mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3); /* ========== Swap (kernel/mm/swap.c) ========== int   swap_out(unsigned long window_sz); int   swap_in(void); /* brk/mmap globals (loader.c)", "kind": "variable", "line": 723, "name": "g_brk", "signature": "extern unsigned long g_brk;"}, {"kind": "variable", "line": 724, "name": "g_brk_limit", "signature": "extern unsigned long g_brk_limit;"}, {"kind": "variable", "line": 725, "name": "user_mmap_cur", "signature": "extern unsigned long user_mmap_cur;"}, {"doc": "Leaf lock for every view's membership plus KFILE refcounts (never nested, never held across yields); heavy IO may delay a tick, which beats torn metadata. Lock order: sched_lock -> fd_lock (views are * attached under sched_lock, mutated under fd_lock alone).", "kind": "variable", "line": 864, "name": "fd_lock", "signature": "extern spinlock_t fd_lock;"}, {"doc": "Big filesystem lock, defined in fs/kfile.c: serializes whole kf* bodies plus unlink and dir_list against each other. Leaf like fd_lock (never nested, never held across yields); heavy IO may * delay a tick, which beats torn metadata.", "kind": "variable", "line": 891, "name": "fs_lock", "signature": "extern spinlock_t fs_lock;"}, {"doc": "Big filesystem lock, defined in fs/kfile.c: serializes whole kf* bodies plus unlink and dir_list against each other. Leaf like fd_lock (never nested, never held across yields); heavy IO may * delay a tick, which beats torn metadata. extern spinlock_t fs_lock; /* ========== Kernel info ==========", "kind": "variable", "line": 894, "name": "kernel_end", "signature": "extern unsigned long kernel_end;"}, {"kind": "variable", "line": 895, "name": "ramdisk_start", "signature": "extern char ramdisk_start[];"}, {"kind": "variable", "line": 896, "name": "ramdisk_end", "signature": "extern char ramdisk_end[];"}, {"kind": "variable", "line": 897, "name": "ramdisk_size", "signature": "extern char ramdisk_size[];"}, {"kind": "macro", "line": 2, "name": "KERNEL_H", "signature": "#define KERNEL_H"}, {"kind": "macro", "line": 4, "name": "EFAULT", "signature": "#define EFAULT"}, {"kind": "macro", "line": 20, "name": "ALIGN_UP", "signature": "#define ALIGN_UP(x, a)"}, {"kind": "macro", "line": 22, "name": "PORT_IO_DEFINED", "signature": "#define PORT_IO_DEFINED"}, {"kind": "macro", "line": 90, "name": "VGA_BASE", "signature": "#define VGA_BASE"}, {"kind": "macro", "line": 91, "name": "VGA_COLS", "signature": "#define VGA_COLS"}, {"kind": "macro", "line": 92, "name": "VGA_ROWS", "signature": "#define VGA_ROWS"}, {"kind": "macro", "line": 138, "name": "KEY_BACKSPACE", "signature": "#define KEY_BACKSPACE"}, {"kind": "macro", "line": 139, "name": "KEY_ENTER", "signature": "#define KEY_ENTER"}, {"kind": "macro", "line": 140, "name": "KEY_LSHIFT", "signature": "#define KEY_LSHIFT"}, {"kind": "macro", "line": 141, "name": "KEY_RSHIFT", "signature": "#define KEY_RSHIFT"}, {"kind": "macro", "line": 142, "name": "KEY_CAPS", "signature": "#define KEY_CAPS"}, {"kind": "macro", "line": 143, "name": "KEY_E0", "signature": "#define KEY_E0"}, {"kind": "macro", "line": 144, "name": "KEY_UP", "signature": "#define KEY_UP"}, {"kind": "macro", "line": 145, "name": "KEY_DOWN", "signature": "#define KEY_DOWN"}, {"kind": "macro", "line": 146, "name": "KEY_PGUP", "signature": "#define KEY_PGUP"}, {"kind": "macro", "line": 147, "name": "KEY_PGDN", "signature": "#define KEY_PGDN"}, {"kind": "macro", "line": 148, "name": "KEY_ESC", "signature": "#define KEY_ESC"}, {"kind": "macro", "line": 149, "name": "KEY_CSI", "signature": "#define KEY_CSI"}, {"kind": "macro", "line": 150, "name": "KEY_ARR_UP", "signature": "#define KEY_ARR_UP"}, {"kind": "macro", "line": 151, "name": "KEY_ARR_DOWN", "signature": "#define KEY_ARR_DOWN"}, {"kind": "macro", "line": 152, "name": "KEY_ARR_RIGHT", "signature": "#define KEY_ARR_RIGHT"}, {"kind": "macro", "line": 153, "name": "KEY_ARR_LEFT", "signature": "#define KEY_ARR_LEFT"}, {"kind": "macro", "line": 154, "name": "KEY_HOME_SEQ", "signature": "#define KEY_HOME_SEQ"}, {"kind": "macro", "line": 155, "name": "KEY_END_SEQ", "signature": "#define KEY_END_SEQ"}, {"kind": "macro", "line": 156, "name": "KEY_PGUP_SEQ", "signature": "#define KEY_PGUP_SEQ"}, {"kind": "macro", "line": 157, "name": "KEY_PGDN_SEQ", "signature": "#define KEY_PGDN_SEQ"}, {"kind": "macro", "line": 158, "name": "KEY_LEFT", "signature": "#define KEY_LEFT"}, {"kind": "macro", "line": 159, "name": "KEY_RIGHT", "signature": "#define KEY_RIGHT"}, {"kind": "macro", "line": 160, "name": "KEY_LCTRL", "signature": "#define KEY_LCTRL"}, {"kind": "macro", "line": 161, "name": "KEY_RCTRL", "signature": "#define KEY_RCTRL"}, {"kind": "macro", "line": 162, "name": "KEY_F5", "signature": "#define KEY_F5"}, {"kind": "macro", "line": 163, "name": "KEY_F11", "signature": "#define KEY_F11"}, {"kind": "macro", "line": 164, "name": "KEY_TILDE", "signature": "#define KEY_TILDE"}, {"kind": "macro", "line": 165, "name": "KEY_LALT", "signature": "#define KEY_LALT"}, {"kind": "macro", "line": 166, "name": "KEY_RALT", "signature": "#define KEY_RALT"}, {"kind": "macro", "line": 167, "name": "KEY_HOME", "signature": "#define KEY_HOME"}, {"kind": "macro", "line": 168, "name": "KEY_END", "signature": "#define KEY_END"}, {"kind": "macro", "line": 169, "name": "KEY_TAB", "signature": "#define KEY_TAB"}, {"kind": "macro", "line": 170, "name": "KEY_SUPER_L", "signature": "#define KEY_SUPER_L"}, {"kind": "macro", "line": 171, "name": "KEY_SUPER_R", "signature": "#define KEY_SUPER_R"}, {"kind": "macro", "line": 185, "name": "USER_LOAD_BASE", "signature": "#define USER_LOAD_BASE"}, {"kind": "macro", "line": 186, "name": "USER_LOAD_END", "signature": "#define USER_LOAD_END"}, {"kind": "macro", "line": 187, "name": "USER_STACK_SIZE", "signature": "#define USER_STACK_SIZE"}, {"kind": "macro", "line": 188, "name": "USER_STACK_TOP", "signature": "#define USER_STACK_TOP"}, {"kind": "macro", "line": 189, "name": "USER_STACK_BASE", "signature": "#define USER_STACK_BASE"}, {"kind": "macro", "line": 190, "name": "USER_BRK_END", "signature": "#define USER_BRK_END"}, {"kind": "macro", "line": 194, "name": "LDSO_REGION_BASE", "signature": "#define LDSO_REGION_BASE"}, {"kind": "macro", "line": 195, "name": "LDSO_REGION_SIZE", "signature": "#define LDSO_REGION_SIZE"}, {"kind": "macro", "line": 196, "name": "LDSO_REGION_END", "signature": "#define LDSO_REGION_END"}, {"kind": "macro", "line": 201, "name": "SYS_KSTK_TOP", "signature": "#define SYS_KSTK_TOP"}, {"kind": "macro", "line": 202, "name": "SYS_KSTK_BASE", "signature": "#define SYS_KSTK_BASE"}, {"kind": "macro", "line": 204, "name": "HEAP_BASE", "signature": "#define HEAP_BASE"}, {"kind": "macro", "line": 205, "name": "HEAP_SIZE", "signature": "#define HEAP_SIZE"}, {"kind": "macro", "line": 210, "name": "DEV_MMIO_VBASE", "signature": "#define DEV_MMIO_VBASE"}, {"kind": "macro", "line": 211, "name": "PCI_MMIO_SIZE", "signature": "#define PCI_MMIO_SIZE"}, {"kind": "macro", "line": 220, "name": "KMALLOC_PAGE", "signature": "#define KMALLOC_PAGE"}, {"kind": "macro", "line": 269, "name": "RAMDISK_MAX_FILES", "signature": "#define RAMDISK_MAX_FILES"}, {"kind": "macro", "line": 279, "name": "RAMDISK_FNAME_LEN", "signature": "#define RAMDISK_FNAME_LEN"}, {"kind": "macro", "line": 305, "name": "RD_DATA_MAX", "signature": "#define RD_DATA_MAX"}, {"kind": "macro", "line": 322, "name": "ETREL_TRUSTED_DIR", "signature": "#define ETREL_TRUSTED_DIR"}, {"kind": "macro", "line": 323, "name": "ETREL_TRUSTED_LEN", "signature": "#define ETREL_TRUSTED_LEN"}, {"kind": "macro", "line": 382, "name": "VFS_NAME_MAX", "signature": "#define VFS_NAME_MAX"}, {"kind": "macro", "line": 419, "name": "VFS_MAX_MOUNTS", "signature": "#define VFS_MAX_MOUNTS"}, {"kind": "macro", "line": 420, "name": "VFS_PREFIX_LEN", "signature": "#define VFS_PREFIX_LEN"}, {"kind": "macro", "line": 421, "name": "VFS_DRIVER_LEN", "signature": "#define VFS_DRIVER_LEN"}, {"kind": "macro", "line": 468, "name": "EOF", "signature": "#define EOF"}, {"kind": "macro", "line": 509, "name": "ENOENT", "signature": "#define ENOENT"}, {"kind": "macro", "line": 510, "name": "EIO", "signature": "#define EIO"}, {"kind": "macro", "line": 511, "name": "EBADF", "signature": "#define EBADF"}, {"kind": "macro", "line": 512, "name": "ENOMEM", "signature": "#define ENOMEM"}, {"kind": "macro", "line": 513, "name": "ENOTDIR", "signature": "#define ENOTDIR"}, {"kind": "macro", "line": 514, "name": "EISDIR", "signature": "#define EISDIR"}, {"kind": "macro", "line": 515, "name": "EINVAL", "signature": "#define EINVAL"}, {"kind": "macro", "line": 516, "name": "EFBIG", "signature": "#define EFBIG"}, {"kind": "macro", "line": 517, "name": "ENOSPC", "signature": "#define ENOSPC"}, {"kind": "macro", "line": 518, "name": "ESPIPE", "signature": "#define ESPIPE"}, {"kind": "macro", "line": 519, "name": "ENAMETOOLONG", "signature": "#define ENAMETOOLONG"}, {"kind": "macro", "line": 624, "name": "KSYM_MAX", "signature": "#define KSYM_MAX"}, {"kind": "macro", "line": 625, "name": "KPROG_MAX", "signature": "#define KPROG_MAX"}, {"kind": "macro", "line": 730, "name": "EI_NIDENT", "signature": "#define EI_NIDENT"}, {"kind": "macro", "line": 755, "name": "ET_REL", "signature": "#define ET_REL"}, {"kind": "macro", "line": 756, "name": "ET_EXEC", "signature": "#define ET_EXEC"}, {"kind": "macro", "line": 757, "name": "ET_DYN", "signature": "#define ET_DYN"}, {"kind": "macro", "line": 764, "name": "USER_HEAP_CEIL", "signature": "#define USER_HEAP_CEIL"}, {"kind": "macro", "line": 798, "name": "PTE_DEMAND", "signature": "#define PTE_DEMAND"}, {"kind": "macro", "line": 799, "name": "PTE_DEMAND_READ", "signature": "#define PTE_DEMAND_READ"}, {"kind": "macro", "line": 800, "name": "PTE_DEMAND_WRITE", "signature": "#define PTE_DEMAND_WRITE"}, {"kind": "macro", "line": 801, "name": "PTE_DEMAND_EXEC", "signature": "#define PTE_DEMAND_EXEC"}, {"kind": "macro", "line": 802, "name": "LINUX_PROT_READ", "signature": "#define LINUX_PROT_READ"}, {"kind": "macro", "line": 803, "name": "LINUX_PROT_WRITE", "signature": "#define LINUX_PROT_WRITE"}, {"kind": "macro", "line": 804, "name": "LINUX_PROT_EXEC", "signature": "#define LINUX_PROT_EXEC"}, {"kind": "macro", "line": 845, "name": "KFD_MAX", "signature": "#define KFD_MAX"}, {"kind": "macro", "line": 881, "name": "KEVENT_MAX", "signature": "#define KEVENT_MAX"}]}, {"doc": "ktime.h -- pure time-conversion helpers shared by the kernel clock", "id": "headers/ktime.h", "kind": "module", "label": "ktime.h", "language": "h", "sha256": "08e578b17ddb098e", "symbol_count": 3, "symbols": [{"kind": "function", "line": 19, "name": "ktime_us_from_delta", "signature": "static inline unsigned long ktime_us_from_delta(unsigned long delta_ticks,\n                      ..."}, {"doc": "wall_us_from_parts: wall-clock microseconds from an RTC-anchored base. base_sec is the last seen RTC second, base_ktime_us the monotonic clock then, now_ktime_us the monotonic clock now. Pure so the host * suite pins the rollover math; the kernel feeds it live values.", "kind": "function", "line": 30, "name": "wall_us_from_parts", "signature": "static inline unsigned long wall_us_from_parts(unsigned long base_sec,\n                          ..."}, {"kind": "macro", "line": 2, "name": "KTIME_H", "signature": "#define KTIME_H"}]}, {"doc": "Docstring: headers/ldso.h -- minimal dynamic-linking (T8 ld.so) contract.", "id": "headers/ldso.h", "kind": "module", "label": "ldso.h", "language": "h", "sha256": "efe7df596c927c53", "symbol_count": 45, "symbols": [{"kind": "struct", "line": 53, "name": "LdsoSeg"}, {"kind": "struct", "line": 61, "name": "LdsoDynInfo"}, {"kind": "struct", "line": 77, "name": "LdsoRelaRow"}, {"doc": "Docstring: Locate the PT_DYNAMIC file range. Returns 1 with offsets on success, 0 when the image carries no dynamic section (static binary, * not an error), -1 when any header, count or bound is corrupt.", "kind": "function", "line": 86, "name": "ldso_find_dynamic", "signature": "int ldso_find_dynamic(const unsigned char *file, unsigned long long fsize, unsigned long long *dyn_off, unsigned long long *dyn_size);"}, {"doc": "Docstring: Translate a link VA through PT_LOAD into a file offset. Returns 0 with the offset on success, -1 when no segment contains it * or any arithmetic overflows.", "kind": "function", "line": 92, "name": "ldso_vaddr_to_offset", "signature": "int ldso_vaddr_to_offset(const unsigned char *file, unsigned long long fsize, unsigned long long va, unsigned long long *off);"}, {"doc": "Docstring: Collect PT_LOAD spans (at most ncap) for reservation and * GOT-range checks. Returns 0 with the count, -1 on corrupt headers.", "kind": "function", "line": 97, "name": "ldso_segments", "signature": "int ldso_segments(const unsigned char *file, unsigned long long fsize, LdsoSeg *segs, unsigned ncap, unsigned *nseg);"}, {"doc": "Docstring: Walk the dynamic array into info. Caps entries at LDSO_MAX_DYN, keeps the first SONAME, records up to LDSO_MAX_NEEDED * NEEDED offsets. Returns 0 on success, -1 on truncation or overflow.", "kind": "function", "line": 103, "name": "ldso_scan_dynamic", "signature": "int ldso_scan_dynamic(const unsigned char *file, unsigned long long fsize, unsigned long long dyn_off, unsigned long long dyn_size, LdsoDynInfo *info);"}, {"doc": "Docstring: Read the SYSV hash header at a file offset into bucket and chain counts. The chain count is the dynamic symbol count. Returns 0 * on success, -1 when the table is truncated or claims no symbols.", "kind": "function", "line": 110, "name": "ldso_sym_count", "signature": "int ldso_sym_count(const unsigned char *file, unsigned long long fsize, unsigned long long hash_off, unsigned *nsyms);"}, {"doc": "Docstring: Bounded copy of one dynamic string (NEEDED/SONAME/symbol). The NUL must land inside strsz. Returns 0 with a terminated buffer, * -1 on any out-of-range offset or missing terminator.", "kind": "function", "line": 116, "name": "ldso_copy_str", "signature": "int ldso_copy_str(const unsigned char *file, unsigned long long fsize, unsigned long long strtab_off, unsigned long long strsz, unsigned long long name_off, char *out, unsigned out_cap);"}, {"doc": "Docstring: Linear search of a dynamic symbol table by name. Accepts GLOBAL FUNC/NOTYPE definitions only (v1 links functions, nothing else). Returns 1 with st_value on hit, 0 on clean miss, -1 on any * corrupt table bound.", "kind": "function", "line": 124, "name": "ldso_sym_lookup", "signature": "int ldso_sym_lookup(const unsigned char *file, unsigned long long fsize, unsigned long long symtab_off, unsigned nsyms, unsigned long long strtab_off, unsigned long long strsz, const char *name, unsig"}, {"doc": "Docstring: Validate the RELA header triple and report the row count. Only 24-byte entries are supported (v1 emits exactly those). * Returns 0 with the count, -1 on any mismatch or overflow.", "kind": "function", "line": 132, "name": "ldso_rela_count", "signature": "int ldso_rela_count(const LdsoDynInfo *info, unsigned *nrela);"}, {"doc": "Docstring: Read one RELA row with full validation: row inside the table, type GLOB_DAT/JUMP_SLOT (anything else is -2, unsupported), * symbol index below nsyms. Returns 0 on success.", "kind": "function", "line": 137, "name": "ldso_read_rela", "signature": "int ldso_read_rela(const unsigned char *file, unsigned long long fsize, unsigned long long rela_off, unsigned nrela, unsigned idx, unsigned nsyms, LdsoRelaRow *row);"}, {"doc": "Docstring: Basename normalization for registry keys (\"a/b.so\" to \"b.so\", bounded, always terminated). Two spellings of one library * share one registry slot and one load.", "kind": "function", "line": 144, "name": "ldso_basename", "signature": "void ldso_basename(char *out, const char *src);"}, {"kind": "macro", "line": 15, "name": "LDSO_H", "signature": "#define LDSO_H"}, {"kind": "macro", "line": 17, "name": "LDSO_MAX_LIBS", "signature": "#define LDSO_MAX_LIBS"}, {"kind": "macro", "line": 18, "name": "LDSO_MAX_NEEDED", "signature": "#define LDSO_MAX_NEEDED"}, {"kind": "macro", "line": 19, "name": "LDSO_NAME_LEN", "signature": "#define LDSO_NAME_LEN"}, {"kind": "macro", "line": 20, "name": "LDSO_MAX_DYN", "signature": "#define LDSO_MAX_DYN"}, {"kind": "macro", "line": 21, "name": "LDSO_FILE_MAX", "signature": "#define LDSO_FILE_MAX"}, {"kind": "macro", "line": 22, "name": "LDSO_INO_BASE", "signature": "#define LDSO_INO_BASE"}, {"kind": "macro", "line": 24, "name": "LDSO_ET_EXEC", "signature": "#define LDSO_ET_EXEC"}, {"kind": "macro", "line": 25, "name": "LDSO_ET_DYN", "signature": "#define LDSO_ET_DYN"}, {"kind": "macro", "line": 26, "name": "LDSO_EM_X86_64", "signature": "#define LDSO_EM_X86_64"}, {"kind": "macro", "line": 27, "name": "LDSO_PT_LOAD", "signature": "#define LDSO_PT_LOAD"}, {"kind": "macro", "line": 28, "name": "LDSO_PT_DYNAMIC", "signature": "#define LDSO_PT_DYNAMIC"}, {"kind": "macro", "line": 29, "name": "LDSO_PF_X", "signature": "#define LDSO_PF_X"}, {"kind": "macro", "line": 31, "name": "LDSO_DT_NULL", "signature": "#define LDSO_DT_NULL"}, {"kind": "macro", "line": 32, "name": "LDSO_DT_NEEDED", "signature": "#define LDSO_DT_NEEDED"}, {"kind": "macro", "line": 33, "name": "LDSO_DT_HASH", "signature": "#define LDSO_DT_HASH"}, {"kind": "macro", "line": 34, "name": "LDSO_DT_STRTAB", "signature": "#define LDSO_DT_STRTAB"}, {"kind": "macro", "line": 35, "name": "LDSO_DT_SYMTAB", "signature": "#define LDSO_DT_SYMTAB"}, {"kind": "macro", "line": 36, "name": "LDSO_DT_RELA", "signature": "#define LDSO_DT_RELA"}, {"kind": "macro", "line": 37, "name": "LDSO_DT_RELASZ", "signature": "#define LDSO_DT_RELASZ"}, {"kind": "macro", "line": 38, "name": "LDSO_DT_RELAENT", "signature": "#define LDSO_DT_RELAENT"}, {"kind": "macro", "line": 39, "name": "LDSO_DT_STRSZ", "signature": "#define LDSO_DT_STRSZ"}, {"kind": "macro", "line": 40, "name": "LDSO_DT_SYMENT", "signature": "#define LDSO_DT_SYMENT"}, {"kind": "macro", "line": 41, "name": "LDSO_DT_SONAME", "signature": "#define LDSO_DT_SONAME"}, {"kind": "macro", "line": 43, "name": "LDSO_R_GLOB_DAT", "signature": "#define LDSO_R_GLOB_DAT"}, {"kind": "macro", "line": 44, "name": "LDSO_R_JUMP_SLOT", "signature": "#define LDSO_R_JUMP_SLOT"}, {"kind": "macro", "line": 46, "name": "LDSO_STB_GLOBAL", "signature": "#define LDSO_STB_GLOBAL"}, {"kind": "macro", "line": 47, "name": "LDSO_STT_NOTYPE", "signature": "#define LDSO_STT_NOTYPE"}, {"kind": "macro", "line": 48, "name": "LDSO_STT_FUNC", "signature": "#define LDSO_STT_FUNC"}, {"kind": "macro", "line": 49, "name": "LDSO_SHN_UNDEF", "signature": "#define LDSO_SHN_UNDEF"}, {"kind": "macro", "line": 50, "name": "LDSO_SYM_SIZE", "signature": "#define LDSO_SYM_SIZE"}, {"kind": "macro", "line": 51, "name": "LDSO_RELA_SIZE", "signature": "#define LDSO_RELA_SIZE"}]}, {"doc": "Docstring: allocation tracker for MiniOS, STB leakcheck lineage.", "id": "headers/leakcheck.h", "kind": "module", "label": "leakcheck.h", "language": "h", "sha256": "d87966e775ee39d7", "symbol_count": 24, "symbols": [{"kind": "struct", "line": 50, "name": "lk_block"}, {"doc": "#ifndef MINIOS_LK_KERNEL #include <stdlib.h> #include <stdio.h> #endif #ifndef MINIOS_LK_PIPE #ifdef MINIOS_LK_KERNEL #define MINIOS_LK_PIPE 0 #else #define MINIOS_LK_PIPE stdout #endif #endif /** Docstring: one live allocation record, intrusive list node.", "kind": "type_alias", "line": 49, "name": "lk_block_t", "signature": "typedef struct lk_block lk_block_t;"}, {"doc": "#define MINIOS_LK_RAW_ALLOC(sz) kmalloc((unsigned long)(sz)) #define MINIOS_LK_RAW_FREE(p) kfree(p) #else #include <stdlib.h> #include <stdio.h> #include <string.h> #define MINIOS_LK_RAW_ALLOC(sz) malloc(sz) #define MINIOS_LK_RAW_FREE(p) free(p) #endif /** Docstring: head of the live-block list, newest allocation first. static lk_block_t *lk_head; /** Docstring: tracked malloc, records caller file and line.", "kind": "function", "line": 96, "name": "lk_malloc", "signature": "void *lk_malloc(size_t size, const char *file, int line)"}, {"doc": "void *lk_malloc(size_t size, const char *file, int line) { lk_block_t *b = (lk_block_t *)MINIOS_LK_RAW_ALLOC(size + sizeof(*b)); if (b == 0) return 0; b->file = file; b->line = line; b->size = size; b->next = lk_head; b->prev = 0; if (lk_head) lk_head->prev = b; lk_head = b; return b + 1; } /** Docstring: unlink one record from the live-block list.", "kind": "function", "line": 110, "name": "lk_unlink", "signature": "static void lk_unlink(lk_block_t *b)"}, {"doc": "return b + 1; } /** Docstring: unlink one record from the live-block list. static void lk_unlink(lk_block_t *b) { if (b->prev == 0) { lk_head = b->next; } else { b->prev->next = b->next; } if (b->next) b->next->prev = b->prev; } /** Docstring: find the record owning ptr by scanning for its payload base.", "kind": "function", "line": 120, "name": "lk_find", "signature": "static lk_block_t *lk_find(void *ptr)"}, {"doc": "if (b->next) b->next->prev = b->prev; } /** Docstring: find the record owning ptr by scanning for its payload base. static lk_block_t *lk_find(void *ptr) { lk_block_t *b = lk_head; while (b) { if ((void *)(b + 1) == ptr) return b; b = b->next; } return 0; } /** Docstring: tracked free, passes unknown blocks to the raw backend.", "kind": "function", "line": 130, "name": "lk_free", "signature": "void lk_free(void *ptr)"}, {"doc": "/** Docstring: tracked free, passes unknown blocks to the raw backend. void lk_free(void *ptr) { lk_block_t *b; if (ptr == 0) return; b = lk_find(ptr); if (b == 0) { MINIOS_LK_RAW_FREE(ptr); return; } lk_unlink(b); MINIOS_LK_RAW_FREE(b); } /** Docstring: tracked realloc, preserves bytes across a tracked move.", "kind": "function", "line": 143, "name": "lk_realloc", "signature": "void *lk_realloc(void *ptr, size_t size, const char *file, int line)"}, {"doc": "return ptr; } q = lk_malloc(size, file, line); if (q) { d = (unsigned char *)q; s = (unsigned char *)ptr; keep = b->size; for (k = 0; k < keep; k++) d[k] = s[k]; lk_free(ptr); } return q; } /** Docstring: print one live record on the configured pipe.", "kind": "function", "line": 186, "name": "lk_print", "signature": "static void lk_print(const char *reason, const lk_block_t *b)"}, {"doc": "} /** Docstring: print one live record on the configured pipe. static void lk_print(const char *reason, const lk_block_t *b) { #ifdef MINIOS_LK_KERNEL kprintf(\"%s: %s (%d): %lu bytes\\n\", reason, b->file, b->line, (unsigned long)b->size); #else fprintf(MINIOS_LK_PIPE, \"%s: %s (%d): %lu bytes at %p\\n\", reason, b->file, b->line, (unsigned long)b->size, (const void *)(b + 1)); #endif } /** Docstring: report every block still live, newest first.", "kind": "function", "line": 197, "name": "lk_dumpmem", "signature": "void lk_dumpmem(void)"}, {"doc": "b->file, b->line, (unsigned long)b->size, (const void *)(b + 1)); #endif } /** Docstring: report every block still live, newest first. void lk_dumpmem(void) { lk_block_t *b = lk_head; while (b) { lk_print(\"LEAKED\", b); b = b->next; } } /** Docstring: count of blocks still live.", "kind": "function", "line": 206, "name": "lk_live_count", "signature": "unsigned long lk_live_count(void)"}, {"doc": "} /** Docstring: count of blocks still live. unsigned long lk_live_count(void) { unsigned long n = 0; lk_block_t *b = lk_head; while (b) { n++; b = b->next; } return n; } /** Docstring: payload bytes still live.", "kind": "function", "line": 217, "name": "lk_live_bytes", "signature": "unsigned long lk_live_bytes(void)"}, {"doc": "ifdef MINIOS_LK_KERNEL", "kind": "function", "line": 79, "name": "kmalloc", "signature": "extern void *kmalloc(unsigned long size);"}, {"kind": "function", "line": 80, "name": "kfree", "signature": "extern void kfree(void *ptr);"}, {"kind": "function", "line": 81, "name": "kprintf", "signature": "extern int kprintf(const char *fmt, ...);"}, {"kind": "macro", "line": 28, "name": "MINIOS_LEAKCHECK_H", "signature": "#define MINIOS_LEAKCHECK_H"}, {"kind": "macro", "line": 42, "name": "MINIOS_LK_PIPE", "signature": "#define MINIOS_LK_PIPE"}, {"kind": "macro", "line": 44, "name": "MINIOS_LK_PIPE", "signature": "#define MINIOS_LK_PIPE"}, {"kind": "macro", "line": 82, "name": "MINIOS_LK_RAW_ALLOC", "signature": "#define MINIOS_LK_RAW_ALLOC(sz)"}, {"kind": "macro", "line": 83, "name": "MINIOS_LK_RAW_FREE", "signature": "#define MINIOS_LK_RAW_FREE(p)"}, {"kind": "macro", "line": 88, "name": "MINIOS_LK_RAW_ALLOC", "signature": "#define MINIOS_LK_RAW_ALLOC(sz)"}, {"kind": "macro", "line": 89, "name": "MINIOS_LK_RAW_FREE", "signature": "#define MINIOS_LK_RAW_FREE(p)"}, {"kind": "macro", "line": 235, "name": "malloc", "signature": "#define malloc(sz)"}, {"kind": "macro", "line": 236, "name": "free", "signature": "#define free(p)"}, {"kind": "macro", "line": 237, "name": "realloc", "signature": "#define realloc(p, sz)"}]}, {"id": "headers/lz4_kernel.h", "kind": "module", "label": "lz4_kernel.h", "language": "h", "sha256": "0258eba050878af4", "symbol_count": 4, "symbols": [{"kind": "function", "line": 4, "name": "LZ4_compress_default", "signature": "int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity);"}, {"kind": "function", "line": 5, "name": "LZ4_compressBound", "signature": "int LZ4_compressBound(int inputSize);"}, {"kind": "function", "line": 6, "name": "LZ4_decompress_safe", "signature": "int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity);"}, {"kind": "macro", "line": 2, "name": "LZ4_KERNEL_H", "signature": "#define LZ4_KERNEL_H"}]}, {"doc": "Docstring: minifetch.h -- neofetch-style system screen contract.", "id": "headers/minifetch.h", "kind": "module", "label": "minifetch.h", "language": "h", "sha256": "1ef74c09e6c6e3c8", "symbol_count": 2, "symbols": [{"kind": "function", "line": 14, "name": "shell_cmd_minifetch", "signature": "void shell_cmd_minifetch(void);"}, {"kind": "macro", "line": 12, "name": "MINIFETCH_H", "signature": "#define MINIFETCH_H"}]}, {"doc": "MiniFS: a minimal Unix-like filesystem for MiniOS.", "id": "headers/minifs.h", "kind": "module", "label": "minifs.h", "language": "h", "sha256": "4fdb3171dd8c2762", "symbol_count": 77, "symbols": [{"kind": "struct", "line": 33, "name": "MiniFSSuper"}, {"kind": "struct", "line": 52, "name": "MiniFSInode"}, {"kind": "struct", "line": 68, "name": "MiniFSDirEntry"}, {"kind": "struct", "line": 90, "name": "MiniFSJournalSuper"}, {"kind": "struct", "line": 98, "name": "MiniFSJournalEntry"}, {"kind": "struct", "line": 110, "name": "MiniFSFile"}, {"kind": "function", "line": 30, "name": "minifs_compress", "signature": "unsigned int minifs_compress(const void *src, unsigned int src_len, void *dst, unsigned int dst_cap);"}, {"kind": "function", "line": 31, "name": "minifs_decompress", "signature": "unsigned int minifs_decompress(const void *src, unsigned int src_len, void *dst, unsigned int dst_cap);"}, {"kind": "function", "line": 117, "name": "minifs_init", "signature": "void minifs_init(void);"}, {"kind": "function", "line": 118, "name": "minifs_mount", "signature": "int minifs_mount(void);"}, {"kind": "function", "line": 119, "name": "minifs_sync", "signature": "int minifs_sync(void);"}, {"kind": "function", "line": 120, "name": "minifs_is_mounted", "signature": "int minifs_is_mounted(void);"}, {"kind": "function", "line": 122, "name": "minifs_create", "signature": "int minifs_create(const char *path, unsigned short mode);"}, {"kind": "function", "line": 123, "name": "minifs_mkdir", "signature": "int minifs_mkdir(const char *path, unsigned short mode);"}, {"kind": "function", "line": 124, "name": "minifs_unlink", "signature": "int minifs_unlink(const char *path);"}, {"kind": "function", "line": 125, "name": "minifs_rmdir", "signature": "int minifs_rmdir(const char *path);"}, {"kind": "function", "line": 128, "name": "refuses", "signature": "* An existing file dst refuses (no silent overwrite);"}, {"doc": "Docstring: Move one MiniFS directory entry to a new parent/name, keeping its inode (no data moves). Files only; directories refuse. An existing file dst refuses (no silent overwrite); a missing dst * parent refuses. Returns 0 on success, -1 on any failure.", "kind": "function", "line": 130, "name": "minifs_rename", "signature": "int minifs_rename(const char *oldpath, const char *newpath);"}, {"kind": "function", "line": 131, "name": "minifs_read", "signature": "int minifs_read(int inode_num, void *buf, unsigned int offset, unsigned int len);"}, {"kind": "function", "line": 132, "name": "minifs_write", "signature": "int minifs_write(int inode_num, const void *buf, unsigned int offset, unsigned int len);"}, {"kind": "function", "line": 133, "name": "minifs_truncate", "signature": "int minifs_truncate(int inode_num, unsigned int new_size);"}, {"kind": "function", "line": 134, "name": "minifs_stat", "signature": "int minifs_stat(int inode_num, MiniFSInode *out);"}, {"kind": "function", "line": 135, "name": "minifs_access", "signature": "int minifs_access(const char *path);"}, {"kind": "function", "line": 137, "name": "minifs_resolve_path", "signature": "int minifs_resolve_path(const char *path);"}, {"kind": "function", "line": 138, "name": "minifs_dir_lookup", "signature": "int minifs_dir_lookup(int dir_inode, const char *name);"}, {"kind": "function", "line": 139, "name": "minifs_dir_add_entry", "signature": "int minifs_dir_add_entry(int dir_inode, const char *name, int child_inode, unsigned char type);"}, {"kind": "function", "line": 140, "name": "minifs_dir_remove_entry", "signature": "int minifs_dir_remove_entry(int dir_inode, const char *name);"}, {"kind": "function", "line": 141, "name": "minifs_dir_read", "signature": "int minifs_dir_read(int dir_inode, int index, MiniFSDirEntry *out, char *name_out);"}, {"kind": "function", "line": 143, "name": "minifs_alloc_block", "signature": "int minifs_alloc_block(void);"}, {"kind": "function", "line": 144, "name": "minifs_free_block", "signature": "void minifs_free_block(unsigned int block);"}, {"kind": "function", "line": 145, "name": "minifs_alloc_inode", "signature": "int minifs_alloc_inode(void);"}, {"kind": "function", "line": 146, "name": "minifs_free_inode", "signature": "void minifs_free_inode(int inode_num);"}, {"kind": "function", "line": 147, "name": "minifs_inode_get_block", "signature": "int minifs_inode_get_block(MiniFSInode *inode, unsigned int logical_block, unsigned int *phys_block);"}, {"kind": "function", "line": 148, "name": "minifs_inode_alloc_block", "signature": "int minifs_inode_alloc_block(MiniFSInode *inode, unsigned int logical_block);"}, {"kind": "function", "line": 150, "name": "minifs_journal_begin", "signature": "void minifs_journal_begin(unsigned int txn_id);"}, {"kind": "function", "line": 151, "name": "minifs_journal_add_block", "signature": "void minifs_journal_add_block(unsigned int block);"}, {"kind": "function", "line": 152, "name": "minifs_journal_touch", "signature": "void minifs_journal_touch(unsigned int phys);"}, {"kind": "function", "line": 153, "name": "minifs_journal_commit", "signature": "int minifs_journal_commit(unsigned int txn_id);"}, {"kind": "function", "line": 154, "name": "minifs_journal_clear", "signature": "void minifs_journal_clear(void);"}, {"kind": "function", "line": 155, "name": "minifs_journal_abort", "signature": "void minifs_journal_abort(void);"}, {"kind": "function", "line": 156, "name": "minifs_journal_recover", "signature": "void minifs_journal_recover(void);"}, {"kind": "function", "line": 158, "name": "minifs_file_open", "signature": "MiniFSFile *minifs_file_open(int inode_num, int flags);"}, {"kind": "function", "line": 159, "name": "minifs_file_close", "signature": "int minifs_file_close(MiniFSFile *f);"}, {"kind": "function", "line": 161, "name": "minifs_get_lba_start", "signature": "unsigned int minifs_get_lba_start(void);"}, {"kind": "function", "line": 162, "name": "minifs_get_total_blocks", "signature": "unsigned int minifs_get_total_blocks(void);"}, {"doc": "void minifs_journal_begin(unsigned int txn_id); void minifs_journal_add_block(unsigned int block); void minifs_journal_touch(unsigned int phys); int  minifs_journal_commit(unsigned int txn_id); void minifs_journal_clear(void); void minifs_journal_abort(void); void minifs_journal_recover(void); MiniFSFile *minifs_file_open(int inode_num, int flags); int  minifs_file_close(MiniFSFile *f); unsigned int minifs_get_lba_start(void); unsigned int minifs_get_total_blocks(void); /** Docstring: Filesystem usage snapshot for the mem builtin.", "kind": "function", "line": 164, "name": "minifs_usage", "signature": "void minifs_usage(unsigned int *free_b, unsigned int *total_b, unsigned int *free_i, unsigned int *total_i);"}, {"kind": "macro", "line": 2, "name": "MINIFS_H", "signature": "#define MINIFS_H"}, {"kind": "macro", "line": 8, "name": "MINIFS_MAGIC", "signature": "#define MINIFS_MAGIC"}, {"kind": "macro", "line": 9, "name": "MINIFS_VERSION", "signature": "#define MINIFS_VERSION"}, {"kind": "macro", "line": 10, "name": "MINIFS_BLOCK_SIZE", "signature": "#define MINIFS_BLOCK_SIZE"}, {"kind": "macro", "line": 11, "name": "MINIFS_MAX_FILENAME", "signature": "#define MINIFS_MAX_FILENAME"}, {"kind": "macro", "line": 12, "name": "MINIFS_ROOT_INODE", "signature": "#define MINIFS_ROOT_INODE"}, {"kind": "macro", "line": 13, "name": "MINIFS_INODES_PER_BLOCK", "signature": "#define MINIFS_INODES_PER_BLOCK"}, {"kind": "macro", "line": 14, "name": "MINIFS_DIR_ENTRIES_PER_BLOCK", "signature": "#define MINIFS_DIR_ENTRIES_PER_BLOCK"}, {"kind": "macro", "line": 16, "name": "MINIFS_S_IFMT", "signature": "#define MINIFS_S_IFMT"}, {"kind": "macro", "line": 17, "name": "MINIFS_S_IFREG", "signature": "#define MINIFS_S_IFREG"}, {"kind": "macro", "line": 18, "name": "MINIFS_S_IFDIR", "signature": "#define MINIFS_S_IFDIR"}, {"kind": "macro", "line": 19, "name": "MINIFS_S_IFLNK", "signature": "#define MINIFS_S_IFLNK"}, {"kind": "macro", "line": 20, "name": "MINIFS_S_IRWXU", "signature": "#define MINIFS_S_IRWXU"}, {"kind": "macro", "line": 21, "name": "MINIFS_S_IRWXG", "signature": "#define MINIFS_S_IRWXG"}, {"kind": "macro", "line": 22, "name": "MINIFS_S_IRWXO", "signature": "#define MINIFS_S_IRWXO"}, {"kind": "macro", "line": 24, "name": "MINIFS_FT_FILE", "signature": "#define MINIFS_FT_FILE"}, {"kind": "macro", "line": 25, "name": "MINIFS_FT_DIR", "signature": "#define MINIFS_FT_DIR"}, {"kind": "macro", "line": 26, "name": "MINIFS_FT_SYMLINK", "signature": "#define MINIFS_FT_SYMLINK"}, {"kind": "macro", "line": 28, "name": "MINIFS_INODE_COMPRESSED", "signature": "#define MINIFS_INODE_COMPRESSED"}, {"kind": "macro", "line": 75, "name": "MINIFS_DIR_ENTRY_HDR_SIZE", "signature": "#define MINIFS_DIR_ENTRY_HDR_SIZE"}, {"kind": "macro", "line": 77, "name": "MINIFS_JOURNAL_BLOCKS", "signature": "#define MINIFS_JOURNAL_BLOCKS"}, {"kind": "macro", "line": 78, "name": "MINIFS_JOURNAL_MAX_ENTRIES", "signature": "#define MINIFS_JOURNAL_MAX_ENTRIES"}, {"kind": "macro", "line": 79, "name": "MINIFS_JOP_WRITE", "signature": "#define MINIFS_JOP_WRITE"}, {"kind": "macro", "line": 80, "name": "MINIFS_JOP_CREATE", "signature": "#define MINIFS_JOP_CREATE"}, {"kind": "macro", "line": 81, "name": "MINIFS_JOP_DELETE", "signature": "#define MINIFS_JOP_DELETE"}, {"kind": "macro", "line": 82, "name": "MINIFS_JOP_MKDIR", "signature": "#define MINIFS_JOP_MKDIR"}, {"kind": "macro", "line": 83, "name": "MINIFS_JOP_RMDIR", "signature": "#define MINIFS_JOP_RMDIR"}, {"kind": "macro", "line": 84, "name": "MINIFS_JOP_TRUNCATE", "signature": "#define MINIFS_JOP_TRUNCATE"}, {"kind": "macro", "line": 85, "name": "MINIFS_JOP_COMMIT", "signature": "#define MINIFS_JOP_COMMIT"}, {"kind": "macro", "line": 87, "name": "MINIFS_JSTATE_CLEAN", "signature": "#define MINIFS_JSTATE_CLEAN"}, {"kind": "macro", "line": 88, "name": "MINIFS_JSTATE_DIRTY", "signature": "#define MINIFS_JSTATE_DIRTY"}]}, {"id": "headers/net/rtl8139.h", "kind": "module", "label": "rtl8139.h", "language": "h", "sha256": "d60d1c66cb10d71b", "symbol_count": 8, "symbols": [{"doc": "rtl8139 NIC driver interface.  This header is the boundary between the polled rtl8139 driver (rtl8139.c) and the protocol stack (net.c).  The driver owns the port I/O, PCI probe, TX/RX rings, the NIC MAC and the PIT-calibrated clock; the stack owns addressing, sockets and the demux that the driver reaches through rtl_poll.  All frame sizes and MAC constants come from net.h.  #include \"net.h\" /* Nonzero when the rtl8139 was found and initialized.", "kind": "function", "line": 18, "name": "rtl_present", "signature": "int rtl_present(void);"}, {"doc": "This header is the boundary between the polled rtl8139 driver (rtl8139.c) and the protocol stack (net.c).  The driver owns the port I/O, PCI probe, TX/RX rings, the NIC MAC and the PIT-calibrated clock; the stack owns addressing, sockets and the demux that the driver reaches through rtl_poll.  All frame sizes and MAC constants come from net.h.  #include \"net.h\" /* Nonzero when the rtl8139 was found and initialized. int rtl_present(void); /* Calibrate the clock, probe the NIC and set up the TX/RX rings.", "kind": "function", "line": 21, "name": "rtl_init", "signature": "void rtl_init(void);"}, {"doc": "Transmit one raw Ethernet frame.  Returns 1 on success, 0 on failure * (no device, frame too large for a slot, or a TX deadline expiry).", "kind": "function", "line": 25, "name": "rtl_send", "signature": "int rtl_send(const unsigned char *frame, unsigned len);"}, {"kind": "function", "line": 28, "name": "net_rx_handle_frame", "signature": "* net_rx_handle_frame (the protocol demux in net.c). */ void rtl_poll(void);"}, {"doc": "Drain the RX ring once; every received frame is handed to * net_rx_handle_frame (the protocol demux in net.c). void rtl_poll(void); /* Copy the NIC MAC into out (NET_ETH_ALEN bytes).", "kind": "function", "line": 32, "name": "rtl_get_mac", "signature": "void rtl_get_mac(unsigned char out[NET_ETH_ALEN]);"}, {"doc": "Drain the RX ring once; every received frame is handed to * net_rx_handle_frame (the protocol demux in net.c). void rtl_poll(void); /* Copy the NIC MAC into out (NET_ETH_ALEN bytes). void rtl_get_mac(unsigned char out[NET_ETH_ALEN]); /* The NIC I/O base, or 0 when the device is absent.", "kind": "function", "line": 35, "name": "rtl_iobase", "signature": "unsigned short rtl_iobase(void);"}, {"doc": "Drain the RX ring once; every received frame is handed to * net_rx_handle_frame (the protocol demux in net.c). void rtl_poll(void); /* Copy the NIC MAC into out (NET_ETH_ALEN bytes). void rtl_get_mac(unsigned char out[NET_ETH_ALEN]); /* The NIC I/O base, or 0 when the device is absent. unsigned short rtl_iobase(void); /* Frame-level TX/RX counters (bytes are protocol counters in net.c).", "kind": "function", "line": 38, "name": "rtl_counters", "signature": "void rtl_counters(unsigned int *tx_frames, unsigned int *rx_frames);"}, {"kind": "macro", "line": 2, "name": "RTL8139_H", "signature": "#define RTL8139_H"}]}, {"doc": "========== Fixed slirp configuration (QEMU -nic user) ==========", "id": "headers/net.h", "kind": "module", "label": "net.h", "language": "h", "sha256": "c000728aa786e3de", "symbol_count": 103, "symbols": [{"kind": "function", "line": 58, "name": "ring", "signature": "* ring (below) is the rtl8139's 8 KB hardware ring, unrelated. */ #define NET_SOCK_RX_BUF 16384 #define NET_RX_RING_SIZE 8192 #define NET_SOCKETS 16 #define NET_DNS_PORT 53 #define NET_EPHEMERAL_MIN 4"}, {"doc": "net_connect / socket fds are NET_FD_BASE + index for Linux syscalls and * 0..NET_SOCKETS-1 for the libc-style symbols. void net_init(void); /* Linux socket ABI entry points (kernel/syscalls.c routes to them).", "kind": "function", "line": 101, "name": "net_sys_is_socket", "signature": "int net_sys_is_socket(long fd);"}, {"kind": "function", "line": 102, "name": "net_sys_setsockopt", "signature": "long net_sys_setsockopt(long fd, long level, long name, long val, long len);"}, {"kind": "function", "line": 103, "name": "net_sys_getsockopt", "signature": "long net_sys_getsockopt(long fd, long level, long name, long val, long lenp);"}, {"kind": "function", "line": 104, "name": "net_sys_getsockname", "signature": "long net_sys_getsockname(long fd, long addr, long lenp);"}, {"kind": "function", "line": 105, "name": "net_sys_getpeername", "signature": "long net_sys_getpeername(long fd, long addr, long lenp);"}, {"kind": "function", "line": 106, "name": "net_sys_sendmsg", "signature": "long net_sys_sendmsg(long fd, long msg, long flags);"}, {"kind": "function", "line": 107, "name": "net_sys_sendmmsg", "signature": "long net_sys_sendmmsg(long fd, long vec, long vlen, long flags);"}, {"kind": "function", "line": 108, "name": "net_sys_fcntl", "signature": "long net_sys_fcntl(long fd, long cmd, long arg);"}, {"kind": "function", "line": 109, "name": "net_sys_ioctl", "signature": "long net_sys_ioctl(long fd, long req, long arg);"}, {"kind": "function", "line": 110, "name": "net_register_symbols", "signature": "void net_register_symbols(void);"}, {"doc": "void net_init(void); /* Linux socket ABI entry points (kernel/syscalls.c routes to them). int  net_sys_is_socket(long fd); long net_sys_setsockopt(long fd, long level, long name, long val, long len); long net_sys_getsockopt(long fd, long level, long name, long val, long lenp); long net_sys_getsockname(long fd, long addr, long lenp); long net_sys_getpeername(long fd, long addr, long lenp); long net_sys_sendmsg(long fd, long msg, long flags); long net_sys_sendmmsg(long fd, long vec, long vlen, long flags); long net_sys_fcntl(long fd, long cmd, long arg); long net_sys_ioctl(long fd, long req, long arg); void net_register_symbols(void); /* Shell commands", "kind": "function", "line": 113, "name": "net_cmd_status", "signature": "void net_cmd_status(void);"}, {"kind": "function", "line": 114, "name": "net_cmd_ping", "signature": "void net_cmd_ping(const char *ip_text);"}, {"kind": "function", "line": 115, "name": "net_get_addrs", "signature": "void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4]);"}, {"kind": "function", "line": 116, "name": "net_cmd_dns", "signature": "void net_cmd_dns(const char *host);"}, {"doc": "long net_sys_getpeername(long fd, long addr, long lenp); long net_sys_sendmsg(long fd, long msg, long flags); long net_sys_sendmmsg(long fd, long vec, long vlen, long flags); long net_sys_fcntl(long fd, long cmd, long arg); long net_sys_ioctl(long fd, long req, long arg); void net_register_symbols(void); /* Shell commands void net_cmd_status(void); void net_cmd_ping(const char *ip_text); void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4]); void net_cmd_dns(const char *host); /* Libc-style API for ET_REL programs", "kind": "function", "line": 119, "name": "net_open", "signature": "int net_open(void);"}, {"kind": "function", "line": 120, "name": "net_connect", "signature": "int net_connect(const char *host, unsigned short port);"}, {"kind": "function", "line": 121, "name": "net_send", "signature": "int net_send(int fd, const char *buf, int len);"}, {"kind": "function", "line": 122, "name": "net_recv", "signature": "int net_recv(int fd, char *buf, int len);"}, {"doc": "void net_register_symbols(void); /* Shell commands void net_cmd_status(void); void net_cmd_ping(const char *ip_text); void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4]); void net_cmd_dns(const char *host); /* Libc-style API for ET_REL programs int  net_open(void); int  net_connect(const char *host, unsigned short port); int  net_send(int fd, const char *buf, int len); int  net_recv(int fd, char *buf, int len); /* Blocking receive with a deadline: like net_recv, but -1 on timeout.", "kind": "function", "line": 124, "name": "net_recv_timeout", "signature": "int net_recv_timeout(int fd, char *buf, int len, unsigned long timeout_ms);"}, {"kind": "function", "line": 125, "name": "net_close", "signature": "void net_close(int fd);"}, {"kind": "function", "line": 131, "name": "demux", "signature": "* segment through the production demux (httpd selftest). */ int net_listen(unsigned short port);"}, {"kind": "function", "line": 133, "name": "net_accept_nb", "signature": "int net_accept_nb(int fd);"}, {"kind": "function", "line": 134, "name": "net_accept", "signature": "int net_accept(int fd, unsigned long timeout_ms);"}, {"kind": "function", "line": 135, "name": "net_sock_state", "signature": "int net_sock_state(int fd);"}, {"kind": "function", "line": 136, "name": "net_sock_seq", "signature": "int net_sock_seq(int fd, unsigned *seq_out, unsigned *ack_out);"}, {"kind": "function", "line": 137, "name": "net_test_inject_tcp", "signature": "int net_test_inject_tcp(const unsigned char peer[4], unsigned short pport, unsigned short lport, unsigned char flags, unsigned int seq, unsigned int ack, const unsigned char *data, unsigned datalen);"}, {"doc": "index, or -1). net_accept_nb takes an established child without waiting; net_accept waits up to timeout_ms. net_sock_state reports the TCP state for diagnostics. net_test_inject_tcp feeds one peer * segment through the production demux (httpd selftest). int  net_listen(unsigned short port); int  net_accept_nb(int fd); int  net_accept(int fd, unsigned long timeout_ms); int  net_sock_state(int fd); int  net_sock_seq(int fd, unsigned *seq_out, unsigned *ack_out); int  net_test_inject_tcp(const unsigned char peer[4], unsigned short pport, unsigned short lport, unsigned char flags, unsigned int seq, unsigned int ack, const unsigned char *data, unsigned datalen); /* Linux syscall ABI (sockaddr_in layout matches Linux)", "kind": "function", "line": 142, "name": "net_sys_socket", "signature": "long net_sys_socket(long a1, long a2, long a3);"}, {"kind": "function", "line": 143, "name": "net_sys_connect", "signature": "long net_sys_connect(long fd, long sockaddr, long addrlen);"}, {"kind": "function", "line": 144, "name": "net_sys_bind", "signature": "long net_sys_bind(long fd, long sockaddr, long addrlen);"}, {"kind": "function", "line": 145, "name": "net_sys_listen", "signature": "long net_sys_listen(long fd, long backlog);"}, {"kind": "function", "line": 146, "name": "net_sys_accept", "signature": "long net_sys_accept(long fd, long sockaddr, long addrlen);"}, {"kind": "function", "line": 147, "name": "net_sys_sendto", "signature": "long net_sys_sendto(long fd, long buf, long len, long flags, long to, long tolen);"}, {"kind": "function", "line": 148, "name": "net_sys_recvfrom", "signature": "long net_sys_recvfrom(long fd, long buf, long len, long flags, long from, long fromlen);"}, {"kind": "function", "line": 149, "name": "net_sys_shutdown", "signature": "long net_sys_shutdown(long fd, long how);"}, {"kind": "function", "line": 150, "name": "net_sys_close", "signature": "long net_sys_close(long fd);"}, {"kind": "function", "line": 151, "name": "net_sys_poll", "signature": "long net_sys_poll(long fds, long nfds, long timeout_ms);"}, {"kind": "function", "line": 152, "name": "net_sys_dns", "signature": "long net_sys_dns(long host);"}, {"doc": "/* Linux syscall ABI (sockaddr_in layout matches Linux) long net_sys_socket(long a1, long a2, long a3); long net_sys_connect(long fd, long sockaddr, long addrlen); long net_sys_bind(long fd, long sockaddr, long addrlen); long net_sys_listen(long fd, long backlog); long net_sys_accept(long fd, long sockaddr, long addrlen); long net_sys_sendto(long fd, long buf, long len, long flags, long to, long tolen); long net_sys_recvfrom(long fd, long buf, long len, long flags, long from, long fromlen); long net_sys_shutdown(long fd, long how); long net_sys_close(long fd); long net_sys_poll(long fds, long nfds, long timeout_ms); long net_sys_dns(long host); /* Milliseconds since net_init (PIT-calibrated TSC).", "kind": "function", "line": 155, "name": "net_time_ms", "signature": "unsigned long net_time_ms(void);"}, {"doc": "Demux entry point the rtl8139 driver (rtl8139.c) calls for every * frame drained from the RX ring; lives in net.c.", "kind": "function", "line": 159, "name": "net_rx_handle_frame", "signature": "void net_rx_handle_frame(const unsigned char *frame, unsigned len);"}, {"kind": "function", "line": 162, "name": "stack", "signature": "* the stack (dropped fragments);"}, {"doc": "TLS sessions attached to socket fds (tls.c); net_sys_close frees them. With MINIOS_NO_TLS the engine is unlinked and tls.h carries the inline * no-op; this declaration would collide with it, so it is omitted. ifndef MINIOS_NO_TLS", "kind": "function", "line": 170, "name": "tls_free_fd", "signature": "void tls_free_fd(int fd);"}, {"doc": "Aggregate RX drop counter shared between the driver (bad frames) and * the stack (dropped fragments); defined in net.c.", "kind": "variable", "line": 163, "name": "net_rx_dropped", "signature": "extern unsigned int net_rx_dropped;"}, {"kind": "variable", "line": 164, "name": "net6_rx_dropped", "signature": "extern unsigned int net6_rx_dropped;"}, {"kind": "macro", "line": 2, "name": "NET_H", "signature": "#define NET_H"}, {"kind": "macro", "line": 5, "name": "NET_IP_ADDR", "signature": "#define NET_IP_ADDR"}, {"kind": "macro", "line": 6, "name": "NET_NETMASK", "signature": "#define NET_NETMASK"}, {"kind": "macro", "line": 7, "name": "NET_GATEWAY", "signature": "#define NET_GATEWAY"}, {"kind": "macro", "line": 8, "name": "NET_DNS", "signature": "#define NET_DNS"}, {"kind": "macro", "line": 12, "name": "NET_POLLIN", "signature": "#define NET_POLLIN"}, {"kind": "macro", "line": 13, "name": "NET_POLLOUT", "signature": "#define NET_POLLOUT"}, {"kind": "macro", "line": 14, "name": "NET_POLLERR", "signature": "#define NET_POLLERR"}, {"kind": "macro", "line": 15, "name": "NET_POLLHUP", "signature": "#define NET_POLLHUP"}, {"kind": "macro", "line": 16, "name": "NET_POLLNVAL", "signature": "#define NET_POLLNVAL"}, {"kind": "macro", "line": 19, "name": "NET_PCI_VENDOR", "signature": "#define NET_PCI_VENDOR"}, {"kind": "macro", "line": 20, "name": "NET_PCI_DEVICE", "signature": "#define NET_PCI_DEVICE"}, {"kind": "macro", "line": 26, "name": "NET_RX_BUF_LEN", "signature": "#define NET_RX_BUF_LEN"}, {"kind": "macro", "line": 27, "name": "NET_RX_ALIGN", "signature": "#define NET_RX_ALIGN"}, {"kind": "macro", "line": 31, "name": "NET_RX_RING_PAD", "signature": "#define NET_RX_RING_PAD"}, {"kind": "macro", "line": 34, "name": "NET_RCR", "signature": "#define NET_RCR"}, {"kind": "macro", "line": 35, "name": "NET_MAX_FRAME", "signature": "#define NET_MAX_FRAME"}, {"kind": "macro", "line": 36, "name": "NET_TX_SLOTS", "signature": "#define NET_TX_SLOTS"}, {"kind": "macro", "line": 39, "name": "NET_ETH_ALEN", "signature": "#define NET_ETH_ALEN"}, {"kind": "macro", "line": 40, "name": "NET_ETHERTYPE_IP", "signature": "#define NET_ETHERTYPE_IP"}, {"kind": "macro", "line": 41, "name": "NET_ETHERTYPE_ARP", "signature": "#define NET_ETHERTYPE_ARP"}, {"kind": "macro", "line": 42, "name": "NET_ETHERTYPE_IPV6", "signature": "#define NET_ETHERTYPE_IPV6"}, {"kind": "macro", "line": 45, "name": "NET_PROTO_ICMP", "signature": "#define NET_PROTO_ICMP"}, {"kind": "macro", "line": 46, "name": "NET_PROTO_TCP", "signature": "#define NET_PROTO_TCP"}, {"kind": "macro", "line": 47, "name": "NET_PROTO_UDP", "signature": "#define NET_PROTO_UDP"}, {"kind": "macro", "line": 50, "name": "NET_ARP_CACHE", "signature": "#define NET_ARP_CACHE"}, {"kind": "macro", "line": 51, "name": "NET_ARP_REQUEST", "signature": "#define NET_ARP_REQUEST"}, {"kind": "macro", "line": 52, "name": "NET_ARP_REPLY", "signature": "#define NET_ARP_REPLY"}, {"kind": "macro", "line": 55, "name": "NET_TCP_MSS", "signature": "#define NET_TCP_MSS"}, {"kind": "macro", "line": 56, "name": "NET_TCP_WINDOW", "signature": "#define NET_TCP_WINDOW"}, {"kind": "macro", "line": 59, "name": "NET_SOCK_RX_BUF", "signature": "#define NET_SOCK_RX_BUF"}, {"kind": "macro", "line": 60, "name": "NET_RX_RING_SIZE", "signature": "#define NET_RX_RING_SIZE"}, {"kind": "macro", "line": 61, "name": "NET_SOCKETS", "signature": "#define NET_SOCKETS"}, {"kind": "macro", "line": 62, "name": "NET_DNS_PORT", "signature": "#define NET_DNS_PORT"}, {"kind": "macro", "line": 63, "name": "NET_EPHEMERAL_MIN", "signature": "#define NET_EPHEMERAL_MIN"}, {"kind": "macro", "line": 64, "name": "NET_DNS_TRIES", "signature": "#define NET_DNS_TRIES"}, {"kind": "macro", "line": 65, "name": "NET_DNS_TMO_MS", "signature": "#define NET_DNS_TMO_MS"}, {"kind": "macro", "line": 66, "name": "NET_CONNECT_TMO_S", "signature": "#define NET_CONNECT_TMO_S"}, {"kind": "macro", "line": 67, "name": "NET_RETRY_MS", "signature": "#define NET_RETRY_MS"}, {"kind": "macro", "line": 68, "name": "NET_ACCEPT_TMO_MS", "signature": "#define NET_ACCEPT_TMO_MS"}, {"kind": "macro", "line": 69, "name": "NET_TX_MAX", "signature": "#define NET_TX_MAX"}, {"kind": "macro", "line": 72, "name": "NET_FD_BASE", "signature": "#define NET_FD_BASE"}, {"kind": "macro", "line": 77, "name": "NET_UDP_SOCKETS", "signature": "#define NET_UDP_SOCKETS"}, {"kind": "macro", "line": 78, "name": "NET_UDP_QUEUE", "signature": "#define NET_UDP_QUEUE"}, {"kind": "macro", "line": 79, "name": "NET_UDP_DGRAM_MAX", "signature": "#define NET_UDP_DGRAM_MAX"}, {"kind": "macro", "line": 80, "name": "NET_UDP_FD_BASE", "signature": "#define NET_UDP_FD_BASE"}, {"kind": "macro", "line": 81, "name": "NET_UDP_EPHEMERAL_MIN", "signature": "#define NET_UDP_EPHEMERAL_MIN"}, {"kind": "macro", "line": 82, "name": "NET_UDP_EPHEMERAL_MAX", "signature": "#define NET_UDP_EPHEMERAL_MAX"}, {"kind": "macro", "line": 83, "name": "NET_SOCKADDR_IN_LEN", "signature": "#define NET_SOCKADDR_IN_LEN"}, {"kind": "macro", "line": 85, "name": "NET_MSGHDR_LEN", "signature": "#define NET_MSGHDR_LEN"}, {"kind": "macro", "line": 86, "name": "NET_MMSGHDR_LEN", "signature": "#define NET_MMSGHDR_LEN"}, {"kind": "macro", "line": 87, "name": "NET_MSGHDR_NAME_OFF", "signature": "#define NET_MSGHDR_NAME_OFF"}, {"kind": "macro", "line": 88, "name": "NET_MSGHDR_NAMELEN_OFF", "signature": "#define NET_MSGHDR_NAMELEN_OFF"}, {"kind": "macro", "line": 89, "name": "NET_MSGHDR_IOV_OFF", "signature": "#define NET_MSGHDR_IOV_OFF"}, {"kind": "macro", "line": 90, "name": "NET_MSGHDR_IOVLEN_OFF", "signature": "#define NET_MSGHDR_IOVLEN_OFF"}, {"kind": "macro", "line": 91, "name": "NET_MMSGHDR_LEN_OFF", "signature": "#define NET_MMSGHDR_LEN_OFF"}, {"kind": "macro", "line": 92, "name": "NET_IOV_LEN", "signature": "#define NET_IOV_LEN"}, {"kind": "macro", "line": 93, "name": "NET_IOV_MAX", "signature": "#define NET_IOV_MAX"}, {"kind": "macro", "line": 94, "name": "NET_MMSG_MAX", "signature": "#define NET_MMSG_MAX"}]}, {"doc": "Docstring: panic.h -- Kernel panic backtrace contract (header-only).", "id": "headers/panic.h", "kind": "module", "label": "panic.h", "language": "h", "sha256": "545d187e9e31546b", "symbol_count": 5, "symbols": [{"doc": "Docstring: Format an unsigned long as fixed-width lowercase hex into buf, writing exactly digits characters plus a NUL terminator, so the buffer must hold digits + 1 bytes. digits is clamped to [0, PANIC_HEX_MAX_DIGITS] and to the buffer capacity, so the widest field never writes past the terminator. Returns the number of * characters written.", "kind": "function", "line": 28, "name": "panic_hex_str", "signature": "static inline int panic_hex_str(char *buf, int cap, unsigned long v, int digits)"}, {"doc": "Docstring: Walk up to max frame pointers from rbp, storing each frame's return address (*(rbp+8)) into out. Stops on null rbp, failed predicate, a non-advancing frame or a null return address. * Returns the stored count. Fail-closed on null out or null predicate.", "kind": "function", "line": 51, "name": "panic_backtrace", "signature": "static inline int panic_backtrace(unsigned long rbp, panic_valid_fn valid,\n        unsigned long ..."}, {"kind": "macro", "line": 15, "name": "PANIC_H", "signature": "#define PANIC_H"}, {"kind": "macro", "line": 17, "name": "PANIC_BT_MAX", "signature": "#define PANIC_BT_MAX"}, {"kind": "macro", "line": 20, "name": "PANIC_HEX_MAX_DIGITS", "signature": "#define PANIC_HEX_MAX_DIGITS"}]}, {"doc": "Docstring: pcache.h -- page cache for MiniFS, slice 1 (store only).", "id": "headers/pcache.h", "kind": "module", "label": "pcache.h", "language": "h", "sha256": "a063975df8429263", "symbol_count": 17, "symbols": [{"doc": "Docstring: Allocate the page pool; disabled (all calls fail closed) when the heap cannot spare it, exactly like the block * cache. Prints one boot marker either way.", "kind": "function", "line": 28, "name": "pcache_init", "signature": "void pcache_init(void);"}, {"doc": "Docstring: Find a cached page without reserving. Returns the slot * or -1. Never allocates, never evicts.", "kind": "function", "line": 32, "name": "pcache_lookup", "signature": "int pcache_lookup(int ino, unsigned index);"}, {"doc": "Docstring: Get a page, pinned with one ref. Hit returns the live slot; miss reserves an empty or evicted slot (ref 1, clean, *is_new 1, data uninitialized: the caller fills it before any reader sees it) or -1 when every slot is pinned or the pool is disabled, in which case the caller falls back to direct block I/O, fail-open correct. Racy fills must use publish below, never a reserved-then-filled get: a concurrent faulter would map the * half-written page.", "kind": "function", "line": 42, "name": "pcache_get", "signature": "int pcache_get(int ino, unsigned index, int *is_new);"}, {"doc": "Docstring: Publish a privately filled page into the cache atomically. Copies data into a reserved slot and marks it valid under one lock hold, or refs the slot a racing publisher won first; either way the returned slot is complete before any other holder can see it. Returns the slot (ref 1 for this mapping) or -1 when no slot is free, in which case the caller maps its * private page and takes no ref.", "kind": "function", "line": 51, "name": "pcache_publish", "signature": "int pcache_publish(int ino, unsigned index, const unsigned char *data);"}, {"doc": "Docstring: Drop one ref taken by get. A zero ref is a no-op, * never negative.", "kind": "function", "line": 55, "name": "pcache_put", "signature": "void pcache_put(int slot);"}, {"doc": "Docstring: Take one more ref on a cached page without allocating. Fork uses this for every file-backed page the child inherits, so the child teardown drops exactly what the copy added. Returns the * slot or -1 when the page is not cached.", "kind": "function", "line": 61, "name": "pcache_ref", "signature": "int pcache_ref(int ino, unsigned index);"}, {"doc": "Docstring: Drop the ref a mapping holds on one cached page. The munmap and teardown walks derive (ino, index) from the VMA node and call this per page; unknown pages are a silent no-op so a partially populated mapping unmaps cleanly. Prefer put_if below wherever the PTE is at hand: blind drops can steal another * mapping's ref after a private fallback.", "kind": "function", "line": 69, "name": "pcache_unmap", "signature": "void pcache_unmap(int ino, unsigned index);"}, {"kind": "function", "line": 75, "name": "match", "signature": "* a phys match (owned, ref dropped unless already zero), 0 * otherwise. */ int pcache_put_if(int ino, unsigned index, unsigned long phys);"}, {"doc": "Docstring: Take one more ref only when the cached page is the exact phys the caller shares. Fork proves sharing through the parent PTE before inheriting, so a stale VMA tag never pins a * recycled slot. Returns the slot or -1.", "kind": "function", "line": 83, "name": "pcache_ref_if", "signature": "int pcache_ref_if(int ino, unsigned index, unsigned long phys);"}, {"doc": "Docstring: True when phys is a cache pool page. The teardown sweeper skips those instead of freeing pool memory as if it were * a private data page.", "kind": "function", "line": 88, "name": "pcache_owns_phys", "signature": "int pcache_owns_phys(unsigned long phys);"}, {"doc": "Docstring: Page data for a slot from get/lookup, 0 on a bad slot. The pointer stays valid until put drops the last ref and * the slot is recycled.", "kind": "function", "line": 93, "name": "pcache_data", "signature": "unsigned char *pcache_data(int slot);"}, {"doc": "Docstring: Mark a pinned page dirty. Slice 3 flushes it; slice 1 only records. Recycled slots bump a generation counter * (slice 3 exposes it so holders can validate across put).", "kind": "function", "line": 98, "name": "pcache_mark_dirty", "signature": "void pcache_mark_dirty(int slot);"}, {"doc": "Docstring: Drop every page of an inode (truncate/unlink). * Dirty pages drop with them until slice 3 teaches writeback.", "kind": "function", "line": 102, "name": "pcache_invalidate_ino", "signature": "void pcache_invalidate_ino(int ino);"}, {"doc": "Docstring: Snapshot for the mem builtin and BDD: live pages, * cumulative hits/misses/evictions, dirty count.", "kind": "function", "line": 106, "name": "pcache_stats", "signature": "void pcache_stats(unsigned long *pages_out, unsigned long *hits_out, unsigned long *miss_out, unsigned long *evicted_out, unsigned long *dirty_out);"}, {"kind": "macro", "line": 17, "name": "PCACHE_H", "signature": "#define PCACHE_H"}, {"kind": "macro", "line": 20, "name": "PCACHE_PAGES", "signature": "#define PCACHE_PAGES"}, {"kind": "macro", "line": 23, "name": "PCACHE_PAGE", "signature": "#define PCACHE_PAGE"}]}, {"doc": "pcm2.h -- low-latency PCM audio path over SB16 single-cycle DMA.", "id": "headers/pcm2.h", "kind": "module", "label": "pcm2.h", "language": "h", "sha256": "ba251d6eb0a37bd1", "symbol_count": 21, "symbols": [{"kind": "struct", "line": 67, "name": "pcm2_counters_t"}, {"kind": "function", "line": 77, "name": "pcm2_active", "signature": "int pcm2_active(void);"}, {"kind": "function", "line": 78, "name": "pcm2_open", "signature": "int pcm2_open(unsigned flags, int owner);"}, {"kind": "function", "line": 79, "name": "pcm2_write", "signature": "int pcm2_write(const unsigned char *user, unsigned len, int owner);"}, {"kind": "function", "line": 80, "name": "pcm2_close", "signature": "void pcm2_close(int owner);"}, {"kind": "function", "line": 81, "name": "pcm2_irq", "signature": "void pcm2_irq(void);"}, {"kind": "function", "line": 82, "name": "pcm2_poll", "signature": "void pcm2_poll(void);"}, {"kind": "function", "line": 83, "name": "pcm2_counters", "signature": "void pcm2_counters(pcm2_counters_t *out);"}, {"kind": "macro", "line": 2, "name": "PCM2_H", "signature": "#define PCM2_H"}, {"kind": "macro", "line": 52, "name": "PCM2_RATE", "signature": "#define PCM2_RATE"}, {"kind": "macro", "line": 53, "name": "PCM2_FRAG", "signature": "#define PCM2_FRAG"}, {"kind": "macro", "line": 54, "name": "PCM2_FRAGS", "signature": "#define PCM2_FRAGS"}, {"kind": "macro", "line": 55, "name": "PCM2_DMA_BYTES", "signature": "#define PCM2_DMA_BYTES"}, {"kind": "macro", "line": 56, "name": "PCM2_RING", "signature": "#define PCM2_RING"}, {"kind": "macro", "line": 58, "name": "PCM2_FLAG_NONBLOCK", "signature": "#define PCM2_FLAG_NONBLOCK"}, {"kind": "macro", "line": 60, "name": "PCM2_ERR_BUSY", "signature": "#define PCM2_ERR_BUSY"}, {"kind": "macro", "line": 61, "name": "PCM2_ERR_NODEV", "signature": "#define PCM2_ERR_NODEV"}, {"kind": "macro", "line": 62, "name": "PCM2_ERR_NOMEM", "signature": "#define PCM2_ERR_NOMEM"}, {"kind": "macro", "line": 63, "name": "PCM2_ERR_PERM", "signature": "#define PCM2_ERR_PERM"}, {"kind": "macro", "line": 64, "name": "PCM2_ERR_PIPE", "signature": "#define PCM2_ERR_PIPE"}, {"kind": "macro", "line": 65, "name": "PCM2_ERR_INVAL", "signature": "#define PCM2_ERR_INVAL"}]}, {"doc": "pcm_ring.h -- single-producer/single-consumer byte ring for PCM audio.", "id": "headers/pcm_ring.h", "kind": "module", "label": "pcm_ring.h", "language": "h", "sha256": "3f4b9bdf46cd4809", "symbol_count": 7, "symbols": [{"kind": "struct", "line": 26, "name": "pcm_ring_t"}, {"kind": "function", "line": 36, "name": "pcm_ring_init", "signature": "static inline void pcm_ring_init(pcm_ring_t *r, unsigned char *buf,\n                             ..."}, {"kind": "function", "line": 47, "name": "pcm_ring_used", "signature": "static inline unsigned pcm_ring_used(const pcm_ring_t *r)"}, {"kind": "function", "line": 51, "name": "pcm_ring_free", "signature": "static inline unsigned pcm_ring_free(const pcm_ring_t *r)"}, {"kind": "function", "line": 55, "name": "pcm_ring_write", "signature": "static inline unsigned pcm_ring_write(pcm_ring_t *r, const unsigned char *src,\n                  ..."}, {"kind": "function", "line": 76, "name": "pcm_ring_read", "signature": "static inline unsigned pcm_ring_read(pcm_ring_t *r, unsigned char *dst,\n                         ..."}, {"kind": "macro", "line": 2, "name": "PCM_RING_H", "signature": "#define PCM_RING_H"}]}, {"id": "headers/pcspk.h", "kind": "module", "label": "pcspk.h", "language": "h", "sha256": "2f0e0e5c3ed74964", "symbol_count": 9, "symbols": [{"kind": "function", "line": 8, "name": "pcspk_init", "signature": "void pcspk_init(void);"}, {"kind": "function", "line": 9, "name": "pcspk_tone", "signature": "void pcspk_tone(unsigned freq);"}, {"kind": "function", "line": 10, "name": "pcspk_off", "signature": "void pcspk_off(void);"}, {"kind": "function", "line": 11, "name": "pcspk_set_volume", "signature": "void pcspk_set_volume(unsigned volume);"}, {"kind": "function", "line": 12, "name": "pcspk_get_volume", "signature": "unsigned pcspk_get_volume(void);"}, {"kind": "macro", "line": 2, "name": "PCSPK_H", "signature": "#define PCSPK_H"}, {"kind": "macro", "line": 4, "name": "PCSPK_VOL_MIN", "signature": "#define PCSPK_VOL_MIN"}, {"kind": "macro", "line": 5, "name": "PCSPK_VOL_MAX", "signature": "#define PCSPK_VOL_MAX"}, {"kind": "macro", "line": 6, "name": "PCSPK_VOL_DEFAULT", "signature": "#define PCSPK_VOL_DEFAULT"}]}, {"doc": "Docstring: percpu_rq.h -- Per-CPU runqueues with work stealing.", "id": "headers/percpu_rq.h", "kind": "module", "label": "percpu_rq.h", "language": "h", "sha256": "ff5590a3c6a870d6", "symbol_count": 14, "symbols": [{"kind": "struct", "line": 50, "name": "percpu_rq_t"}, {"kind": "function", "line": 61, "name": "rq_init", "signature": "void rq_init(void);"}, {"kind": "function", "line": 62, "name": "rq_enqueue", "signature": "void rq_enqueue(int cpu, int pid);"}, {"kind": "function", "line": 63, "name": "rq_pop_local", "signature": "int rq_pop_local(int cpu);"}, {"kind": "function", "line": 64, "name": "rq_steal_once", "signature": "int rq_steal_once(int self_cpu, int *from_cpu);"}, {"kind": "function", "line": 65, "name": "rq_empty", "signature": "int rq_empty(int cpu);"}, {"kind": "function", "line": 66, "name": "rq_should_rescan", "signature": "int rq_should_rescan(int cpu);"}, {"kind": "function", "line": 67, "name": "rq_note_poll", "signature": "void rq_note_poll(int cpu);"}, {"kind": "function", "line": 68, "name": "rq_stats", "signature": "void rq_stats(int cpu, unsigned long *hits, unsigned long *steals, unsigned long *drops);"}, {"kind": "macro", "line": 2, "name": "PERCPU_RQ_H", "signature": "#define PERCPU_RQ_H"}, {"kind": "macro", "line": 45, "name": "RQ_DEPTH", "signature": "#define RQ_DEPTH"}, {"kind": "macro", "line": 46, "name": "RQ_RESCAN_PERIOD", "signature": "#define RQ_RESCAN_PERIOD"}, {"kind": "macro", "line": 47, "name": "RQ_VALIDATE_ATTEMPTS", "signature": "#define RQ_VALIDATE_ATTEMPTS"}, {"kind": "macro", "line": 48, "name": "WQ_NONE_HINT", "signature": "#define WQ_NONE_HINT"}]}, {"doc": "Docstring: pipe.h -- Kernel pipe ring contract (header-only).", "id": "headers/pipe.h", "kind": "module", "label": "pipe.h", "language": "h", "sha256": "6f9618369966722e", "symbol_count": 17, "symbols": [{"kind": "struct", "line": 27, "name": "pipe_ring_t"}, {"kind": "struct", "line": 37, "name": "pipe_cfg_t"}, {"doc": "Docstring: Bind a caller-owned buffer to a ring. Fails closed on a * null buffer or a zero/oversize capacity.", "kind": "function", "line": 47, "name": "pipe_ring_init", "signature": "static inline int pipe_ring_init(pipe_ring_t *r, unsigned char *buf,\n        unsigned cap)"}, {"doc": "return PIPE_ERR_BOUND; if (cap == 0u || cap > PIPE_CAP_MAX) return PIPE_ERR_BOUND; r->buf = buf; r->cap = cap; r->head = 0u; r->tail = 0u; r->count = 0u; r->wopen = 1; r->ropen = 1; return 0; } /** Docstring: Bytes available to read. Zero on a null ring.", "kind": "function", "line": 64, "name": "pipe_ring_avail", "signature": "static inline unsigned pipe_ring_avail(const pipe_ring_t *r)"}, {"doc": "r->count = 0u; r->wopen = 1; r->ropen = 1; return 0; } /** Docstring: Bytes available to read. Zero on a null ring. static inline unsigned pipe_ring_avail(const pipe_ring_t *r) { if (!r || !r->buf) return 0u; return r->count; } /** Docstring: Free space available to write. Zero on a null ring.", "kind": "function", "line": 71, "name": "pipe_ring_space", "signature": "static inline unsigned pipe_ring_space(const pipe_ring_t *r)"}, {"doc": "Docstring: Append up to len bytes, return bytes stored. Partial on a * full ring, never overrun. Zero on null input or a closed writer.", "kind": "function", "line": 79, "name": "pipe_ring_write", "signature": "static inline unsigned pipe_ring_write(pipe_ring_t *r,\n        const unsigned char *src, unsigned..."}, {"doc": "Docstring: Mark the writer closed. Later reads drain then report EOF. * Idempotent; null ring is a no-op returning PIPE_ERR_BOUND.", "kind": "function", "line": 118, "name": "pipe_ring_close_writer", "signature": "static inline int pipe_ring_close_writer(pipe_ring_t *r)"}, {"doc": "Docstring: Mark the reader closed. Later writes store nothing (the syscall layer answers EPIPE). Idempotent; null ring is a no-op * returning PIPE_ERR_BOUND.", "kind": "function", "line": 128, "name": "pipe_ring_close_reader", "signature": "static inline int pipe_ring_close_reader(pipe_ring_t *r)"}, {"doc": "Docstring: Mark the reader closed. Later writes store nothing (the syscall layer answers EPIPE). Idempotent; null ring is a no-op * returning PIPE_ERR_BOUND. static inline int pipe_ring_close_reader(pipe_ring_t *r) { if (!r) return PIPE_ERR_BOUND; r->ropen = 0; return 0; } /** Docstring: 1 while the read end is open, 0 once closed or on null.", "kind": "function", "line": 135, "name": "pipe_ring_ropen", "signature": "static inline int pipe_ring_ropen(const pipe_ring_t *r)"}, {"doc": "Docstring: Snapshot ring geometry into a caller struct. Fail-closed * on null input.", "kind": "function", "line": 140, "name": "pipe_ring_stat", "signature": "static inline int pipe_ring_stat(const pipe_ring_t *r, pipe_cfg_t *out)"}, {"kind": "function", "line": 4, "name": "ends", "signature": "* * Single source of truth for the pipe byte ring shared by the kernel * pipe ends (fs/kfile.c), the pipe/dup/dup2 syscalls (kernel/syscalls.c) * and the shell pipeline runner (kernel/shell.c). Header"}, {"kind": "macro", "line": 19, "name": "PIPE_H", "signature": "#define PIPE_H"}, {"kind": "macro", "line": 21, "name": "PIPE_CAP_DEFAULT", "signature": "#define PIPE_CAP_DEFAULT"}, {"kind": "macro", "line": 22, "name": "PIPE_CAP_MAX", "signature": "#define PIPE_CAP_MAX"}, {"kind": "macro", "line": 24, "name": "PIPE_ERR_BOUND", "signature": "#define PIPE_ERR_BOUND"}, {"kind": "macro", "line": 25, "name": "PIPE_EMPTY", "signature": "#define PIPE_EMPTY"}, {"kind": "macro", "line": 43, "name": "PIPE_CFG_DEFAULT", "signature": "#define PIPE_CFG_DEFAULT"}]}, {"doc": "Docstring: proc_sec.h -- per-process security state behind the Linux", "id": "headers/proc_sec.h", "kind": "module", "label": "proc_sec.h", "language": "h", "sha256": "16a95b8e9afdf9e2", "symbol_count": 12, "symbols": [{"doc": "Exit code of a process or thread a filter kills: a death by SIGSYS (31), recorded negative like every MiniOS signal death, so wait4 reports * WIFSIGNALED with WTERMSIG == SIGSYS. #define SECCOMP_KILL_EXIT (-31) /* Lifecycle (callers hold sched_lock where noted in sched.c).", "kind": "function", "line": 23, "name": "proc_sec_inherit", "signature": "void proc_sec_inherit(int child, int parent);"}, {"kind": "function", "line": 24, "name": "proc_sec_release", "signature": "void proc_sec_release(int pid);"}, {"kind": "function", "line": 25, "name": "proc_sec_exec", "signature": "void proc_sec_exec(int pid);"}, {"kind": "function", "line": 26, "name": "proc_sec_set_exe", "signature": "void proc_sec_set_exe(int pid, const char *resolved);"}, {"doc": "Exit code of a process or thread a filter kills: a death by SIGSYS (31), recorded negative like every MiniOS signal death, so wait4 reports * WIFSIGNALED with WTERMSIG == SIGSYS. #define SECCOMP_KILL_EXIT (-31) /* Lifecycle (callers hold sched_lock where noted in sched.c). void proc_sec_inherit(int child, int parent); void proc_sec_release(int pid); void proc_sec_exec(int pid); void proc_sec_set_exe(int pid, const char *resolved); /* Resolved image path of pid (\"\" when unknown).", "kind": "function", "line": 28, "name": "proc_sec_exe", "signature": "const char *proc_sec_exe(int pid);"}, {"kind": "function", "line": 31, "name": "it", "signature": "* the syscall must answer in *ret when a filter decided it (ERRNO, TRACE, * USER_NOTIF);"}, {"doc": "Run the caller's filters for syscall n. Returns 1 and stores the value the syscall must answer in *ret when a filter decided it (ERRNO, TRACE, USER_NOTIF); kills the caller for KILL and TRAP; returns 0 to let the * syscall run.", "kind": "function", "line": 34, "name": "proc_sec_filter", "signature": "int proc_sec_filter(long n, long a1, long a2, long a3, long a4, long a5, long a6, long *ret);"}, {"kind": "function", "line": 36, "name": "proc_sec_prctl", "signature": "long proc_sec_prctl(long option, long a2, long a3, long a4, long a5);"}, {"kind": "function", "line": 37, "name": "proc_sec_seccomp", "signature": "long proc_sec_seccomp(long op, long flags, long uargs);"}, {"kind": "macro", "line": 13, "name": "PROC_SEC_H", "signature": "#define PROC_SEC_H"}, {"kind": "macro", "line": 16, "name": "SECCOMP_FILTERS_MAX", "signature": "#define SECCOMP_FILTERS_MAX"}, {"kind": "macro", "line": 20, "name": "SECCOMP_KILL_EXIT", "signature": "#define SECCOMP_KILL_EXIT"}]}, {"doc": "========== QEMU guest agent channel (COM2, ISA 16550) ==========", "id": "headers/qga.h", "kind": "module", "label": "qga.h", "language": "h", "sha256": "4f867a372f907c8d", "symbol_count": 29, "symbols": [{"kind": "function", "line": 48, "name": "qga_init", "signature": "void qga_init(void);"}, {"kind": "function", "line": 49, "name": "qga_poll", "signature": "void qga_poll(void);"}, {"kind": "macro", "line": 2, "name": "QGA_H", "signature": "#define QGA_H"}, {"kind": "macro", "line": 5, "name": "QGA_COM2_BASE", "signature": "#define QGA_COM2_BASE"}, {"kind": "macro", "line": 6, "name": "QGA_COM2_IRQ", "signature": "#define QGA_COM2_IRQ"}, {"kind": "macro", "line": 9, "name": "QGA_UART_THR", "signature": "#define QGA_UART_THR"}, {"kind": "macro", "line": 10, "name": "QGA_UART_RBR", "signature": "#define QGA_UART_RBR"}, {"kind": "macro", "line": 11, "name": "QGA_UART_DLL", "signature": "#define QGA_UART_DLL"}, {"kind": "macro", "line": 12, "name": "QGA_UART_DLM", "signature": "#define QGA_UART_DLM"}, {"kind": "macro", "line": 13, "name": "QGA_UART_IER", "signature": "#define QGA_UART_IER"}, {"kind": "macro", "line": 14, "name": "QGA_UART_FCR", "signature": "#define QGA_UART_FCR"}, {"kind": "macro", "line": 15, "name": "QGA_UART_LCR", "signature": "#define QGA_UART_LCR"}, {"kind": "macro", "line": 16, "name": "QGA_UART_LSR", "signature": "#define QGA_UART_LSR"}, {"kind": "macro", "line": 17, "name": "QGA_UART_MCR", "signature": "#define QGA_UART_MCR"}, {"kind": "macro", "line": 18, "name": "QGA_UART_LSR_TX_RDY", "signature": "#define QGA_UART_LSR_TX_RDY"}, {"kind": "macro", "line": 19, "name": "QGA_UART_LSR_RX_RDY", "signature": "#define QGA_UART_LSR_RX_RDY"}, {"kind": "macro", "line": 20, "name": "QGA_UART_LCR_DLAB", "signature": "#define QGA_UART_LCR_DLAB"}, {"kind": "macro", "line": 21, "name": "QGA_UART_LCR_8N1", "signature": "#define QGA_UART_LCR_8N1"}, {"kind": "macro", "line": 22, "name": "QGA_UART_FCR_CFG", "signature": "#define QGA_UART_FCR_CFG"}, {"kind": "macro", "line": 23, "name": "QGA_UART_MCR_CFG", "signature": "#define QGA_UART_MCR_CFG"}, {"kind": "macro", "line": 25, "name": "QGA_BAUD_DIVISOR", "signature": "#define QGA_BAUD_DIVISOR"}, {"kind": "macro", "line": 30, "name": "QGA_LINE_MAX", "signature": "#define QGA_LINE_MAX"}, {"kind": "macro", "line": 31, "name": "QGA_RESP_MAX", "signature": "#define QGA_RESP_MAX"}, {"kind": "macro", "line": 34, "name": "QGA_FILE_READ_MAX", "signature": "#define QGA_FILE_READ_MAX"}, {"kind": "macro", "line": 37, "name": "QGA_MAX_PAIRS", "signature": "#define QGA_MAX_PAIRS"}, {"kind": "macro", "line": 38, "name": "QGA_KEY_MAX", "signature": "#define QGA_KEY_MAX"}, {"kind": "macro", "line": 39, "name": "QGA_STR_MAX", "signature": "#define QGA_STR_MAX"}, {"kind": "macro", "line": 42, "name": "QGA_MAX_DEPTH", "signature": "#define QGA_MAX_DEPTH"}, {"kind": "macro", "line": 46, "name": "QGA_FILE_MAX", "signature": "#define QGA_FILE_MAX"}]}, {"doc": "randmix.h -- entropy mixer for getrandom (318).", "id": "headers/randmix.h", "kind": "module", "label": "randmix.h", "language": "h", "sha256": "b99336a166b4fdb6", "symbol_count": 2, "symbols": [{"kind": "function", "line": 11, "name": "source", "signature": "* source (all-zero seed) still walks, because the increment is inside\n * the mixer, not in the ca..."}, {"kind": "macro", "line": 2, "name": "RANDMIX_H", "signature": "#define RANDMIX_H"}]}, {"doc": "Docstring: rcu.h -- Read-copy-update, lite epoch edition.", "id": "headers/rcu.h", "kind": "module", "label": "rcu.h", "language": "h", "sha256": "f0fe67aced0a1864", "symbol_count": 17, "symbols": [{"kind": "function", "line": 30, "name": "retirement", "signature": "* retirement (the writer keeps ownership) instead of dropping the free. * Callbacks run in tick context with interrupts disabled, so they must * be short and non-blocking. rcu_synchronize spins on qui"}, {"kind": "function", "line": 51, "name": "rcu_init", "signature": "void rcu_init(void);"}, {"kind": "function", "line": 52, "name": "rcu_read_lock", "signature": "void rcu_read_lock(void);"}, {"kind": "function", "line": 53, "name": "rcu_read_unlock", "signature": "void rcu_read_unlock(void);"}, {"kind": "function", "line": 54, "name": "rcu_deref", "signature": "void *rcu_deref(void *volatile *pp);"}, {"kind": "function", "line": 55, "name": "rcu_publish", "signature": "void rcu_publish(void *volatile *pp, void *v);"}, {"kind": "function", "line": 56, "name": "rcu_call", "signature": "long rcu_call(rcu_cb_t fn, void *arg);"}, {"kind": "function", "line": 57, "name": "rcu_note_tick", "signature": "void rcu_note_tick(int cpu);"}, {"kind": "function", "line": 58, "name": "rcu_note_idle", "signature": "void rcu_note_idle(int cpu);"}, {"kind": "function", "line": 59, "name": "rcu_poll", "signature": "void rcu_poll(void);"}, {"kind": "function", "line": 60, "name": "rcu_synchronize", "signature": "long rcu_synchronize(void);"}, {"kind": "macro", "line": 2, "name": "RCU_H", "signature": "#define RCU_H"}, {"kind": "macro", "line": 42, "name": "RCU_CB_MAX", "signature": "#define RCU_CB_MAX"}, {"kind": "macro", "line": 43, "name": "RCU_SYNC_SPINS", "signature": "#define RCU_SYNC_SPINS"}, {"kind": "macro", "line": 45, "name": "RCU_OK", "signature": "#define RCU_OK"}, {"kind": "macro", "line": 46, "name": "RCU_ERR_FULL", "signature": "#define RCU_ERR_FULL"}, {"kind": "macro", "line": 47, "name": "RCU_ERR_TIMEOUT", "signature": "#define RCU_ERR_TIMEOUT"}]}, {"id": "headers/rtc.h", "kind": "module", "label": "rtc.h", "language": "h", "sha256": "ace44bb9bd2460f1", "symbol_count": 6, "symbols": [{"doc": "Days since 1970-01-01 for a civil date (Howard Hinnant's algorithm, pure integer arithmetic, no tables). Powers rtc_wall_seconds and the host suite (tests/test_rtc.c); valid for the full 2000..2099 CMOS window and far beyond. Lives here (not in rtc.c) so the host test can * compile it without the port-I/O half of the driver.", "kind": "function", "line": 18, "name": "rtc_days_from_civil", "signature": "static inline long rtc_days_from_civil(long y, long m, long d)"}, {"kind": "function", "line": 4, "name": "rtc_read_tod", "signature": "int rtc_read_tod(int *hour, int *min, int *sec);"}, {"doc": "Calendar date from the CMOS RTC (registers 0x07-0x09). Full year (CMOS carries two digits; 0..99 maps to 2000..2099). Fail-closed like the time reader: impossible month/day (including Feb 29 on a non-leap year) or a clock that never stops updating returns 0 and * writes nothing.", "kind": "function", "line": 11, "name": "rtc_read_date", "signature": "int rtc_read_date(int *year, int *mon, int *day);"}, {"kind": "function", "line": 15, "name": "suite", "signature": "* host suite (tests/test_rtc.c);"}, {"doc": "Wall-clock seconds since the Unix epoch from one RTC snapshot. Returns 1 and stores the value, or 0 on any RTC failure (caller decides the fallback; TLS treats 0 as \"no clock\" and fails the * chain check closed downstream).", "kind": "function", "line": 33, "name": "rtc_wall_seconds", "signature": "int rtc_wall_seconds(unsigned long *out);"}, {"kind": "macro", "line": 2, "name": "RTC_H", "signature": "#define RTC_H"}]}, {"doc": "Docstring: sanitize.h -- Single choke point for syscall argument checks.", "id": "headers/sanitize.h", "kind": "module", "label": "sanitize.h", "language": "h", "sha256": "abfabc818125fd1e", "symbol_count": 5, "symbols": [{"kind": "macro", "line": 2, "name": "SANITIZE_H", "signature": "#define SANITIZE_H"}, {"kind": "macro", "line": 32, "name": "SANITIZE_LEN_NEG", "signature": "#define SANITIZE_LEN_NEG(var)"}, {"kind": "macro", "line": 37, "name": "SANITIZE_RANGE", "signature": "#define SANITIZE_RANGE(ptr, len)"}, {"kind": "macro", "line": 43, "name": "SANITIZE_STR", "signature": "#define SANITIZE_STR(ptr, maxlen)"}, {"kind": "macro", "line": 49, "name": "SANITIZE_COPY_IN", "signature": "#define SANITIZE_COPY_IN(kbuf, uptr, count, elemsz)"}]}, {"doc": "Sound Blaster 16 DMA audio driver contract.", "id": "headers/sb16.h", "kind": "module", "label": "sb16.h", "language": "h", "sha256": "4420b3dbb09d5cfa", "symbol_count": 28, "symbols": [{"doc": "Per-stream ring buffer.  Each stream gets SB16_STREAM_BUF bytes of kernel-side buffering so multiple producers never interfere.  At 22050 Hz * 8-bit mono that is ~366 ms per stream. #define SB16_STREAMS      4u       /* max concurrent mixer streams #define SB16_STREAM_BUF   (SB16_PCM_BUF * 4u)  /* 8192 bytes per stream /* Mixer stream state.", "kind": "struct", "line": 46, "name": "sb16_stream_t"}, {"kind": "struct", "line": 55, "name": "sb16_counters_t"}, {"kind": "function", "line": 65, "name": "sb16_init", "signature": "int sb16_init(void);"}, {"kind": "function", "line": 66, "name": "sb16_present", "signature": "int sb16_present(void);"}, {"kind": "function", "line": 67, "name": "sb16_tone", "signature": "void sb16_tone(unsigned freq);"}, {"kind": "function", "line": 68, "name": "sb16_irq", "signature": "void sb16_irq(void);"}, {"kind": "function", "line": 69, "name": "sb16_poll", "signature": "void sb16_poll(void);"}, {"doc": "Legacy single-stream API (maps to mixer stream 0: pcm_open allocates it, * pcm_submit forwards into it, pcm_close releases it).", "kind": "function", "line": 73, "name": "sb16_pcm_open", "signature": "void sb16_pcm_open(void);"}, {"kind": "function", "line": 74, "name": "sb16_pcm_submit", "signature": "int sb16_pcm_submit(const unsigned char *pcm, unsigned len);"}, {"kind": "function", "line": 75, "name": "sb16_pcm_close", "signature": "void sb16_pcm_close(void);"}, {"kind": "function", "line": 76, "name": "sb16_pump", "signature": "void sb16_pump(void);"}, {"doc": "Legacy single-stream API (maps to mixer stream 0: pcm_open allocates it, * pcm_submit forwards into it, pcm_close releases it). void sb16_pcm_open(void); int  sb16_pcm_submit(const unsigned char *pcm, unsigned len); void sb16_pcm_close(void); void sb16_pump(void); /* Mixer stream API.", "kind": "function", "line": 79, "name": "sb16_stream_open", "signature": "int sb16_stream_open(void);"}, {"kind": "function", "line": 80, "name": "sb16_stream_close", "signature": "void sb16_stream_close(int id);"}, {"kind": "function", "line": 81, "name": "sb16_stream_submit", "signature": "int sb16_stream_submit(int id, const unsigned char *pcm, unsigned len);"}, {"kind": "function", "line": 82, "name": "sb16_stream_volume", "signature": "void sb16_stream_volume(int id, unsigned char vol);"}, {"kind": "function", "line": 83, "name": "sb16_stream_count", "signature": "int sb16_stream_count(void);"}, {"kind": "function", "line": 85, "name": "sb16_ring_free", "signature": "unsigned sb16_ring_free(void);"}, {"kind": "function", "line": 86, "name": "sb16_mode_active", "signature": "int sb16_mode_active(void);"}, {"doc": "True while the legacy engine audibly owns the DSP (PCM stream open or a tone sounding). pcm2_open consults it for the mutual -EBUSY; * silent/idle legacy state never blocks the low-latency path.", "kind": "function", "line": 91, "name": "sb16_legacy_busy", "signature": "int sb16_legacy_busy(void);"}, {"kind": "function", "line": 93, "name": "sb16_counters", "signature": "void sb16_counters(sb16_counters_t *out);"}, {"kind": "macro", "line": 2, "name": "SB16_H", "signature": "#define SB16_H"}, {"kind": "macro", "line": 32, "name": "SB16_PCM_BUF", "signature": "#define SB16_PCM_BUF"}, {"kind": "macro", "line": 33, "name": "SB16_PCM_RATE", "signature": "#define SB16_PCM_RATE"}, {"kind": "macro", "line": 34, "name": "SB16_SLOTS", "signature": "#define SB16_SLOTS"}, {"kind": "macro", "line": 35, "name": "SB16_RING_CAP", "signature": "#define SB16_RING_CAP"}, {"kind": "macro", "line": 36, "name": "SB16_ARM_PERIOD_MS", "signature": "#define SB16_ARM_PERIOD_MS"}, {"kind": "macro", "line": 42, "name": "SB16_STREAMS", "signature": "#define SB16_STREAMS"}, {"kind": "macro", "line": 43, "name": "SB16_STREAM_BUF", "signature": "#define SB16_STREAM_BUF"}]}, {"doc": "Forward: full view lives in kernel.h (needs KFILE first); the PCB", "id": "headers/sched.h", "kind": "module", "label": "sched.h", "language": "h", "sha256": "33d3104c69e7131a", "symbol_count": 158, "symbols": [{"doc": "Fields: cpu_id:           index into cpus[], 0 for BSP cur_pid:           PID of the running process on this CPU syscall_kstack:   kernel stack top exchanged on syscall entry kstack_top:       per-CPU interrupt stack top last_sched_tick:  sys_ticks value of last context switch (Phase 2) lapic_id:         APIC ID from hardware is_bsp:           1 for the boot processor, 0 for APs idle:             1 when CPU is in idle loop (Phase 2: idle thread) irq_depth:        interrupt nesting count for irqsave (Phase 3) idle_proc:        pointer to idle process (Phase 2) run_queue:        opaque pointer to per-CPU run queue (Phase 2)", "kind": "struct", "line": 268, "name": "cpu"}, {"doc": "Transient: the owner CPU is between \"decided to switch away\" and \"context fully saved\".  Never claimable: a steal here would resume a * stale context.  schedule() turns it into READY only after the save. #define PROC_SWITCHING  5 /* ---- Limits ---- #define MAX_PROCS       64 #define PROC_KSTACK_SZ  (16UL * 1024) /* ---- SMP limits ---- #define MAX_CPUS        8 #define BOOT_CPU        0 /* ---- Per-process saved registers (offsets must match ctx_sw.S) ----", "kind": "struct", "line": 33, "name": "ctx_regs_t"}, {"doc": "Byte offsets into ctx_regs_t for the pure-asm park capture (sched_park_capture in arch/x86/ctx_sw.S, which cannot use C). * Proven by _Static_asserts in kernel/sched.c; never hand-sync. #define CTX_RBP_OFF    48 #define CTX_RIP_OFF    120 #define CTX_RSP_OFF    128 #define CTX_RFLAGS_OFF 136 /* ---- Process Control Block ----", "kind": "struct", "line": 50, "name": "proc_t"}, {"doc": "The frame syscall_entry.S builds on the per-proc kernel stack, lowest address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at the saved top (sc_top_save[pid]); a fork or clone child copies the user * registers from here so it resumes with the caller's full state.", "kind": "struct", "line": 235, "name": "syscall_frame_t"}, {"doc": "Forward: full view lives in kernel.h (needs KFILE first); the PCB only carries a pointer, so the incomplete type suffices here and * sched.h stays includable without kernel.h.", "kind": "type_alias", "line": 11, "name": "kfd_view_t", "signature": "typedef struct kfd_view kfd_view_t;"}, {"doc": "Per-CPU TSS selectors: slot 5 + 2*cpu in the runtime GDT (each TSS descriptor occupies two 8-byte slots).  CPU 0 keeps selector 0x28, * exactly as before. #define TSS_SEL(cpu) ((uint16_t)((5 + 2 * (cpu)) * 8)) /* Exported IDTR for APs to load during SMP bring-up.", "kind": "type_alias", "line": 375, "name": "limit", "signature": "typedef struct __attribute__((packed)) { uint16_t limit;"}, {"doc": "Per-CPU TSS selectors: slot 5 + 2*cpu in the runtime GDT (each TSS descriptor occupies two 8-byte slots).  CPU 0 keeps selector 0x28, * exactly as before. #define TSS_SEL(cpu) ((uint16_t)((5 + 2 * (cpu)) * 8)) /* Exported IDTR for APs to load during SMP bring-up.", "kind": "function", "line": 375, "name": "__attribute__", "signature": "typedef struct __attribute__((packed))"}, {"kind": "function", "line": 108, "name": "group", "signature": "* process is its own group (tgid == pid);"}, {"kind": "function", "line": 135, "name": "entry", "signature": "* private view with one KFILE ref per live entry (0 on OOM), release * drops the view at reap, cloexec closes marked fds on execve. */ void kfd_view_share(proc_t *child);"}, {"kind": "function", "line": 138, "name": "kfd_view_copy", "signature": "int kfd_view_copy(proc_t *child, proc_t *parent);"}, {"kind": "function", "line": 139, "name": "kfd_view_release", "signature": "void kfd_view_release(proc_t *p);"}, {"kind": "function", "line": 140, "name": "kfd_view_cloexec", "signature": "void kfd_view_cloexec(void);"}, {"kind": "function", "line": 141, "name": "kfd_view_root", "signature": "kfd_view_t *kfd_view_root(void);"}, {"kind": "function", "line": 173, "name": "bytes", "signature": "* RLIM_AS total user bytes (brk growth + mmap) beyond the load base * RLIM_CPU timer ticks of CPU time, then SIGKILL-equivalent (137) * RLIM_NOFILE open-file count in the process's own fd view (enforc"}, {"kind": "function", "line": 232, "name": "first", "signature": "* address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at * the saved top (sc_top_save[pid]);"}, {"doc": "The frame syscall_entry.S builds on the per-proc kernel stack, lowest address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at the saved top (sc_top_save[pid]); a fork or clone child copies the user * registers from here so it resumes with the caller's full state. typedef struct { uint64_t rflags;            /* user r11 uint64_t rip;               /* user rcx uint64_t nr; uint64_t rdi, rsi, rdx, r10, r8, r9; uint64_t pid; uint64_t pcb_kstack; uint64_t r15, r14, r13, r12, rbp, rbx; } syscall_frame_t; /* The current pid's frame, or 0 outside a ring-3 syscall.", "kind": "function", "line": 245, "name": "syscall_frame_current", "signature": "const syscall_frame_t *syscall_frame_current(void);"}, {"doc": "1 when cpu's idle context is parked on the kernel page tables, never on * a process's (whose tables are freed when it dies).", "kind": "function", "line": 359, "name": "sched_idle_on_kernel_cr3", "signature": "int sched_idle_on_kernel_cr3(int cpu);"}, {"doc": "Per-CPU TSS selectors: slot 5 + 2*cpu in the runtime GDT (each TSS descriptor occupies two 8-byte slots).  CPU 0 keeps selector 0x28, * exactly as before. #define TSS_SEL(cpu) ((uint16_t)((5 + 2 * (cpu)) * 8)) /* Exported IDTR for APs to load during SMP bring-up. typedef struct __attribute__((packed)) { uint16_t limit; uint64_t base; } idtr_t; extern idtr_t bsp_idtr; /* ---- Functions ----", "kind": "function", "line": 379, "name": "sched_init", "signature": "void sched_init(void);"}, {"kind": "function", "line": 380, "name": "kstack_report", "signature": "void kstack_report(void);"}, {"kind": "function", "line": 381, "name": "schedtop_report", "signature": "void schedtop_report(void);"}, {"kind": "function", "line": 382, "name": "irqstat_report", "signature": "void irqstat_report(void);"}, {"kind": "function", "line": 383, "name": "gdb_regs_report", "signature": "void gdb_regs_report(int pid);"}, {"kind": "function", "line": 384, "name": "gdb_dump_report", "signature": "void gdb_dump_report(unsigned long addr, unsigned long len);"}, {"kind": "function", "line": 388, "name": "tss_init_ap", "signature": "void tss_init_ap(int cpu);"}, {"kind": "function", "line": 389, "name": "smp_ap_idle_loop", "signature": "void smp_ap_idle_loop(void);"}, {"kind": "function", "line": 390, "name": "proc_create", "signature": "int proc_create(const char *name, int parent_pid);"}, {"kind": "function", "line": 391, "name": "proc_get", "signature": "proc_t *proc_get(int pid);"}, {"kind": "function", "line": 392, "name": "schedule", "signature": "void schedule(void);"}, {"kind": "function", "line": 393, "name": "sched_set_nice", "signature": "int sched_set_nice(int pid, int nice);"}, {"kind": "function", "line": 394, "name": "seccomp_deny_one", "signature": "int seccomp_deny_one(int pid, int n);"}, {"kind": "function", "line": 395, "name": "seccomp_allow_one", "signature": "int seccomp_allow_one(int pid, int n);"}, {"kind": "function", "line": 396, "name": "seccomp_denied", "signature": "int seccomp_denied(int pid, int n);"}, {"kind": "function", "line": 397, "name": "rlimit_cpu_exceeded", "signature": "int rlimit_cpu_exceeded(int pid);"}, {"kind": "function", "line": 398, "name": "rlimit_cpu_tick", "signature": "void rlimit_cpu_tick(int pid);"}, {"kind": "function", "line": 399, "name": "switch_to", "signature": "void switch_to(proc_t *prev, proc_t *next);"}, {"kind": "function", "line": 400, "name": "switch_to_notrap", "signature": "void switch_to_notrap(proc_t *prev, proc_t *next);"}, {"kind": "function", "line": 401, "name": "switch_save_only", "signature": "void switch_save_only(proc_t *prev);"}, {"kind": "function", "line": 408, "name": "resume_iretq", "signature": "void resume_iretq(void);"}, {"kind": "function", "line": 409, "name": "yield", "signature": "void yield(void);"}, {"kind": "function", "line": 410, "name": "do_exit", "signature": "void do_exit(int code);"}, {"kind": "function", "line": 411, "name": "do_clone", "signature": "long do_clone(long flags, long newsp);"}, {"kind": "function", "line": 412, "name": "do_fork", "signature": "long do_fork(void);"}, {"kind": "function", "line": 413, "name": "do_fork_ex", "signature": "long do_fork_ex(uint64_t set_tid, uint64_t clear_tid);"}, {"kind": "function", "line": 414, "name": "do_linux_clone", "signature": "long do_linux_clone(unsigned long flags, unsigned long newsp, unsigned long ptid, unsigned long ctid, unsigned long tls);"}, {"kind": "function", "line": 416, "name": "do_group_exit", "signature": "void do_group_exit(int code);"}, {"kind": "function", "line": 417, "name": "mm_view_claim_current", "signature": "void mm_view_claim_current(void);"}, {"kind": "function", "line": 418, "name": "do_kill_code", "signature": "int do_kill_code(int pid, int code);"}, {"doc": "void     sched_park_capture(proc_t *cur); void     resume_iretq(void); void     yield(void); void     do_exit(int code); long     do_clone(long flags, long newsp); long     do_fork(void); long     do_fork_ex(uint64_t set_tid, uint64_t clear_tid); long     do_linux_clone(unsigned long flags, unsigned long newsp, unsigned long ptid, unsigned long ctid, unsigned long tls); void     do_group_exit(int code); void     mm_view_claim_current(void); int      do_kill_code(int pid, int code); /* Signal a ring-3 fault reports through wait4 (SIGSEGV). define USER_FAULT_SIGNAL 11", "kind": "function", "line": 421, "name": "fork_child_settid", "signature": "void fork_child_settid(void);"}, {"doc": "ASLR jitter, fresh per exec (TSC + ticks + per-exec counter, never zero for stack/brk so consecutive execs differ observably): stack top slides 1..4096 bytes, brk start 1..256 pages past the image, mmap cursor up to 255 pages down, ET_DYN base up to 47 * 2 MB slots up.", "kind": "function", "line": 431, "name": "aslr_stack_bytes", "signature": "unsigned long aslr_stack_bytes(void);"}, {"kind": "function", "line": 432, "name": "aslr_brk_pages", "signature": "unsigned long aslr_brk_pages(void);"}, {"kind": "function", "line": 433, "name": "aslr_mmap_pages", "signature": "unsigned long aslr_mmap_pages(void);"}, {"kind": "function", "line": 434, "name": "aslr_dyn_base", "signature": "unsigned long aslr_dyn_base(void);"}, {"kind": "function", "line": 439, "name": "failure", "signature": "* failure (negative errno);"}, {"doc": "do_execve() - replace the caller's image with a fresh ET_EXEC/ET_DYN program (kernel/sched.c). The caller keeps pid, parent, children, kstack slot family, fd table and limits; everything else (window, VMA, brk view, stack, FPU, FSBASE, name) is rebuilt. Returns only on * failure (negative errno); success enters ring 3 and never returns.", "kind": "function", "line": 440, "name": "do_execve", "signature": "long do_execve(char *kpath, int kargc, char **kargv);"}, {"kind": "function", "line": 441, "name": "do_thread_spawn", "signature": "long do_thread_spawn(unsigned long fn, unsigned long stack, unsigned long arg);"}, {"kind": "function", "line": 443, "name": "do_waitpid", "signature": "int do_waitpid(int pid);"}, {"kind": "function", "line": 444, "name": "do_waitpid_nb", "signature": "int do_waitpid_nb(int pid);"}, {"kind": "function", "line": 445, "name": "shell_reap_nb", "signature": "int shell_reap_nb(int *pid_out, int *code_out);"}, {"kind": "function", "line": 446, "name": "shell_reap_one", "signature": "int shell_reap_one(int pid, int *code_out);"}, {"kind": "function", "line": 447, "name": "shell_nchildren", "signature": "int shell_nchildren(void);"}, {"doc": "kstack slot family, fd table and limits; everything else (window, VMA, brk view, stack, FPU, FSBASE, name) is rebuilt. Returns only on * failure (negative errno); success enters ring 3 and never returns. long     do_execve(char *kpath, int kargc, char **kargv); long     do_thread_spawn(unsigned long fn, unsigned long stack, unsigned long arg); int      do_waitpid(int pid); int      do_waitpid_nb(int pid); int      shell_reap_nb(int *pid_out, int *code_out); int      shell_reap_one(int pid, int *code_out); int      shell_nchildren(void); #define WAITPID_NONE (-0x7FFF) /* do_waitpid_linux: the caller has no matching child at all (-ECHILD). define WAITPID_NOCHILD (-0x7FFE)", "kind": "function", "line": 451, "name": "do_waitpid_linux", "signature": "int do_waitpid_linux(int pid, int nohang, int *found);"}, {"kind": "function", "line": 452, "name": "do_kill", "signature": "int do_kill(int pid);"}, {"kind": "function", "line": 453, "name": "timer_tick", "signature": "void timer_tick(void);"}, {"doc": "unsigned long arg); int      do_waitpid(int pid); int      do_waitpid_nb(int pid); int      shell_reap_nb(int *pid_out, int *code_out); int      shell_reap_one(int pid, int *code_out); int      shell_nchildren(void); #define WAITPID_NONE (-0x7FFF) /* do_waitpid_linux: the caller has no matching child at all (-ECHILD). #define WAITPID_NOCHILD (-0x7FFE) int do_waitpid_linux(int pid, int nohang, int *found); int      do_kill(int pid); void     timer_tick(void); /* ---- Per-process page tables ----", "kind": "function", "line": 456, "name": "pt_clone_user", "signature": "uint64_t pt_clone_user(uint64_t parent_cr3);"}, {"kind": "function", "line": 457, "name": "pt_free_user", "signature": "void pt_free_user(uint64_t cr3);"}, {"kind": "function", "line": 462, "name": "caller", "signature": "* caller (shell mrun) reaps it with do_waitpid. Returns pid or -1. * Programs using mmap/VMA or expecting a shared fd table beyond * O_RDONLY stdin-style use are best-effort in this revision. */ int p"}, {"kind": "variable", "line": 294, "name": "cpus", "signature": "extern cpu_t cpus[MAX_CPUS];"}, {"kind": "variable", "line": 295, "name": "cpu_count", "signature": "extern int cpu_count;"}, {"doc": "Invariant: these structures are accessed by the BSP (boot processor) and will be accessed by APs (application processors) when SMP scheduling is enabled.  All modifications must hold sched_lock.  Per-CPU data (no lock needed): - cpu_t cpus[]: each CPU reads only its own entry via this_cpu() - GS base: set to &cpus[cpu_id] for kernel execution  Shared data (protected by sched_lock): - procs[]: the process table - proc_count: the high-water mark of PIDs - scheduler state in schedule(), do_exit(), do_waitpid()", "kind": "variable", "line": 333, "name": "procs", "signature": "extern proc_t procs[MAX_PROCS];"}, {"kind": "variable", "line": 334, "name": "proc_count", "signature": "extern int proc_count;"}, {"kind": "variable", "line": 335, "name": "sys_ticks", "signature": "extern volatile uint64_t sys_ticks;"}, {"kind": "variable", "line": 336, "name": "user_program_active", "signature": "extern volatile int user_program_active;"}, {"kind": "variable", "line": 337, "name": "sched_lock", "signature": "extern spinlock_t sched_lock;"}, {"kind": "variable", "line": 338, "name": "sched_ready", "signature": "extern volatile int sched_ready;"}, {"doc": "APs (application processors) run CLONE_VM threads: same CR3 as their parent, so no brk/mmap view switch and no TLB shootdown is needed. Non-CLONE_VM processes stay on the BSP, which owns the shared g_brk/user_mmap_cur globals (guarded by mm_lock against concurrent brk/mmap syscalls from AP threads).  Per-CPU idle contexts: an AP with no READY thread parks in ap_idle_proc[cpu] (pid -1, never in procs[], never picked by scans) instead of borrowing procs[0], which the BSP owns.  current_pid == -1 on a CPU means that CPU is idle.  smp_dispatches[cpu] counts threads first dispatched on that CPU; the `smp` shell builtin reports it, so parallel execution is observable * over the serial console without a framebuffer.", "kind": "variable", "line": 356, "name": "ap_idle_proc", "signature": "extern proc_t ap_idle_proc[MAX_CPUS];"}, {"kind": "variable", "line": 360, "name": "smp_dispatches", "signature": "extern volatile unsigned long smp_dispatches[MAX_CPUS];"}, {"kind": "variable", "line": 361, "name": "smp_idle_polls", "signature": "extern volatile unsigned long smp_idle_polls[MAX_CPUS];"}, {"doc": "Per-CPU idle ticks at 100 Hz for the MINFO cpu selector (see the * sibling definition in kernel/sched.c).", "kind": "variable", "line": 364, "name": "cpu_idle_ticks", "signature": "extern volatile unsigned long cpu_idle_ticks[MAX_CPUS];"}, {"doc": "Timer ticks that arrived with a GS base outside cpus[] (fail-safe * EOI, no scheduling action).  Zero in a healthy boot.", "kind": "variable", "line": 367, "name": "smp_dbg_bad_gs", "signature": "extern volatile unsigned smp_dbg_bad_gs;"}, {"kind": "variable", "line": 376, "name": "bsp_idtr", "signature": "extern idtr_t bsp_idtr;"}, {"kind": "variable", "line": 385, "name": "isr_cnt_kbd", "signature": "extern volatile unsigned long isr_cnt_kbd;"}, {"kind": "variable", "line": 386, "name": "isr_cnt_mouse", "signature": "extern volatile unsigned long isr_cnt_mouse;"}, {"kind": "variable", "line": 387, "name": "isr_cnt_sb16", "signature": "extern volatile unsigned long isr_cnt_sb16;"}, {"kind": "macro", "line": 2, "name": "SCHED_H", "signature": "#define SCHED_H"}, {"kind": "macro", "line": 14, "name": "PROC_FREE", "signature": "#define PROC_FREE"}, {"kind": "macro", "line": 15, "name": "PROC_READY", "signature": "#define PROC_READY"}, {"kind": "macro", "line": 16, "name": "PROC_RUNNING", "signature": "#define PROC_RUNNING"}, {"kind": "macro", "line": 17, "name": "PROC_BLOCKED", "signature": "#define PROC_BLOCKED"}, {"kind": "macro", "line": 18, "name": "PROC_ZOMBIE", "signature": "#define PROC_ZOMBIE"}, {"kind": "macro", "line": 22, "name": "PROC_SWITCHING", "signature": "#define PROC_SWITCHING"}, {"kind": "macro", "line": 25, "name": "MAX_PROCS", "signature": "#define MAX_PROCS"}, {"kind": "macro", "line": 26, "name": "PROC_KSTACK_SZ", "signature": "#define PROC_KSTACK_SZ"}, {"kind": "macro", "line": 29, "name": "MAX_CPUS", "signature": "#define MAX_CPUS"}, {"kind": "macro", "line": 30, "name": "BOOT_CPU", "signature": "#define BOOT_CPU"}, {"kind": "macro", "line": 44, "name": "CTX_RBP_OFF", "signature": "#define CTX_RBP_OFF"}, {"kind": "macro", "line": 45, "name": "CTX_RIP_OFF", "signature": "#define CTX_RIP_OFF"}, {"kind": "macro", "line": 46, "name": "CTX_RSP_OFF", "signature": "#define CTX_RSP_OFF"}, {"kind": "macro", "line": 47, "name": "CTX_RFLAGS_OFF", "signature": "#define CTX_RFLAGS_OFF"}, {"kind": "macro", "line": 132, "name": "PROC_T_SIZE", "signature": "#define PROC_T_SIZE"}, {"kind": "macro", "line": 142, "name": "PROC_KSTACK_OFF", "signature": "#define PROC_KSTACK_OFF"}, {"kind": "macro", "line": 147, "name": "PROC_FPU_OFF", "signature": "#define PROC_FPU_OFF"}, {"kind": "macro", "line": 154, "name": "PROC_PID_OFF", "signature": "#define PROC_PID_OFF"}, {"kind": "macro", "line": 155, "name": "PROC_FSBASE_OFF", "signature": "#define PROC_FSBASE_OFF"}, {"kind": "macro", "line": 157, "name": "FPU_SAVE_SZ", "signature": "#define FPU_SAVE_SZ"}, {"kind": "macro", "line": 158, "name": "FPU_MXCSR_OFF", "signature": "#define FPU_MXCSR_OFF"}, {"kind": "macro", "line": 159, "name": "FPU_MXCSR_DEFAULT", "signature": "#define FPU_MXCSR_DEFAULT"}, {"kind": "macro", "line": 163, "name": "SECCOMP_MIN", "signature": "#define SECCOMP_MIN"}, {"kind": "macro", "line": 164, "name": "SECCOMP_MAX", "signature": "#define SECCOMP_MAX"}, {"kind": "macro", "line": 165, "name": "SECCOMP_BIT", "signature": "#define SECCOMP_BIT(n)"}, {"kind": "macro", "line": 168, "name": "SECCOMP_OP_DENY_ONE", "signature": "#define SECCOMP_OP_DENY_ONE"}, {"kind": "macro", "line": 169, "name": "SECCOMP_OP_ALLOW_ONE", "signature": "#define SECCOMP_OP_ALLOW_ONE"}, {"kind": "macro", "line": 170, "name": "SECCOMP_OP_DENY_ALL", "signature": "#define SECCOMP_OP_DENY_ALL"}, {"kind": "macro", "line": 177, "name": "RLIM_OP_SET", "signature": "#define RLIM_OP_SET"}, {"kind": "macro", "line": 178, "name": "RLIM_OP_GET", "signature": "#define RLIM_OP_GET"}, {"kind": "macro", "line": 179, "name": "RLIM_AS", "signature": "#define RLIM_AS"}, {"kind": "macro", "line": 180, "name": "RLIM_CPU", "signature": "#define RLIM_CPU"}, {"kind": "macro", "line": 181, "name": "RLIM_NOFILE", "signature": "#define RLIM_NOFILE"}, {"kind": "macro", "line": 182, "name": "RLIM_EXIT_CPU", "signature": "#define RLIM_EXIT_CPU"}, {"kind": "macro", "line": 184, "name": "NICE_MIN", "signature": "#define NICE_MIN"}, {"kind": "macro", "line": 185, "name": "NICE_MAX", "signature": "#define NICE_MAX"}, {"kind": "macro", "line": 186, "name": "NICE_DEFAULT", "signature": "#define NICE_DEFAULT"}, {"kind": "macro", "line": 191, "name": "SCHED_BASE_QUANTUM", "signature": "#define SCHED_BASE_QUANTUM"}, {"kind": "macro", "line": 192, "name": "SCHED_NICE_MULT_KEY", "signature": "#define SCHED_NICE_MULT_KEY"}, {"kind": "macro", "line": 193, "name": "SCHED_NICE_MULT_CHARGE", "signature": "#define SCHED_NICE_MULT_CHARGE"}, {"kind": "macro", "line": 194, "name": "SCHED_NICE_OFFSET", "signature": "#define SCHED_NICE_OFFSET"}, {"kind": "macro", "line": 197, "name": "CLONE_VM", "signature": "#define CLONE_VM"}, {"kind": "macro", "line": 198, "name": "CLONE_FILES", "signature": "#define CLONE_FILES"}, {"kind": "macro", "line": 200, "name": "LINUX_CLONE_SIGNAL_MASK", "signature": "#define LINUX_CLONE_SIGNAL_MASK"}, {"kind": "macro", "line": 201, "name": "LINUX_CLONE_VM", "signature": "#define LINUX_CLONE_VM"}, {"kind": "macro", "line": 202, "name": "LINUX_CLONE_FS", "signature": "#define LINUX_CLONE_FS"}, {"kind": "macro", "line": 203, "name": "LINUX_CLONE_FILES", "signature": "#define LINUX_CLONE_FILES"}, {"kind": "macro", "line": 204, "name": "LINUX_CLONE_SIGHAND", "signature": "#define LINUX_CLONE_SIGHAND"}, {"kind": "macro", "line": 205, "name": "LINUX_CLONE_PIDFD", "signature": "#define LINUX_CLONE_PIDFD"}, {"kind": "macro", "line": 206, "name": "LINUX_CLONE_PTRACE", "signature": "#define LINUX_CLONE_PTRACE"}, {"kind": "macro", "line": 207, "name": "LINUX_CLONE_VFORK", "signature": "#define LINUX_CLONE_VFORK"}, {"kind": "macro", "line": 208, "name": "LINUX_CLONE_PARENT", "signature": "#define LINUX_CLONE_PARENT"}, {"kind": "macro", "line": 209, "name": "LINUX_CLONE_THREAD", "signature": "#define LINUX_CLONE_THREAD"}, {"kind": "macro", "line": 210, "name": "LINUX_CLONE_NEWNS", "signature": "#define LINUX_CLONE_NEWNS"}, {"kind": "macro", "line": 211, "name": "LINUX_CLONE_SYSVSEM", "signature": "#define LINUX_CLONE_SYSVSEM"}, {"kind": "macro", "line": 212, "name": "LINUX_CLONE_SETTLS", "signature": "#define LINUX_CLONE_SETTLS"}, {"kind": "macro", "line": 213, "name": "LINUX_CLONE_PARENT_SETTID", "signature": "#define LINUX_CLONE_PARENT_SETTID"}, {"kind": "macro", "line": 214, "name": "LINUX_CLONE_CHILD_CLEARTID", "signature": "#define LINUX_CLONE_CHILD_CLEARTID"}, {"kind": "macro", "line": 215, "name": "LINUX_CLONE_DETACHED", "signature": "#define LINUX_CLONE_DETACHED"}, {"kind": "macro", "line": 216, "name": "LINUX_CLONE_UNTRACED", "signature": "#define LINUX_CLONE_UNTRACED"}, {"kind": "macro", "line": 217, "name": "LINUX_CLONE_CHILD_SETTID", "signature": "#define LINUX_CLONE_CHILD_SETTID"}, {"kind": "macro", "line": 218, "name": "LINUX_CLONE_NEWNS_MASK", "signature": "#define LINUX_CLONE_NEWNS_MASK"}, {"kind": "macro", "line": 219, "name": "LINUX_CLONE_IO", "signature": "#define LINUX_CLONE_IO"}, {"kind": "macro", "line": 220, "name": "LINUX_SIGCHLD", "signature": "#define LINUX_SIGCHLD"}, {"kind": "macro", "line": 223, "name": "LINUX_CLONE_THREAD_OK", "signature": "#define LINUX_CLONE_THREAD_OK"}, {"kind": "macro", "line": 228, "name": "LINUX_CLONE_FORK_OK", "signature": "#define LINUX_CLONE_FORK_OK"}, {"kind": "macro", "line": 312, "name": "current_pid", "signature": "#define current_pid"}, {"kind": "macro", "line": 316, "name": "DESKTOP_TICK_INTERVAL", "signature": "#define DESKTOP_TICK_INTERVAL"}, {"kind": "macro", "line": 372, "name": "TSS_SEL", "signature": "#define TSS_SEL(cpu)"}, {"kind": "macro", "line": 420, "name": "USER_FAULT_SIGNAL", "signature": "#define USER_FAULT_SIGNAL"}, {"kind": "macro", "line": 424, "name": "EXECVE_MAX_ARGS", "signature": "#define EXECVE_MAX_ARGS"}, {"kind": "macro", "line": 425, "name": "EXECVE_MAX_ARG", "signature": "#define EXECVE_MAX_ARG"}, {"kind": "macro", "line": 448, "name": "WAITPID_NONE", "signature": "#define WAITPID_NONE"}, {"kind": "macro", "line": 450, "name": "WAITPID_NOCHILD", "signature": "#define WAITPID_NOCHILD"}]}, {"doc": "Docstring: seccomp_bpf.h -- classic BPF checker and interpreter for", "id": "headers/seccomp_bpf.h", "kind": "module", "label": "seccomp_bpf.h", "language": "h", "sha256": "2c42a30d56e1c2e2", "symbol_count": 58, "symbols": [{"doc": "Docstring: seccomp_bpf.h -- classic BPF checker and interpreter for Linux seccomp filters (docs/spec/kernel.md, \"Linux seccomp-bpf, prctl and /proc/self/exe\").  Pure: no kernel state, no allocation, so tests/test_seccomp_bpf.c (make test-seccomp-bpf) drives it on the host. The kernel copies a user sock_fprog, runs sbpf_check once at install time and sbpf_run on every syscall of a filtered process. The instruction and data layouts are the Linux ABI ones (struct sock_filter, struct seccomp_data).  #ifndef SECCOMP_BPF_H #define SECCOMP_BPF_H /* struct sock_filter: 8 bytes.", "kind": "struct", "line": 15, "name": "sbpf_insn"}, {"doc": "Linux ABI ones (struct sock_filter, struct seccomp_data).  #ifndef SECCOMP_BPF_H #define SECCOMP_BPF_H /* struct sock_filter: 8 bytes. typedef struct { unsigned short code; unsigned char  jt; unsigned char  jf; unsigned int   k; } sbpf_insn; /* struct seccomp_data: 64 bytes.", "kind": "struct", "line": 23, "name": "sbpf_data"}, {"doc": "Validate a program before it ever runs: 1..SBPF_MAX_INSNS instructions, only the opcodes Linux accepts for seccomp, word loads inside seccomp_data at aligned offsets, scratch indices below SBPF_MEMWORDS, no constant zero divisor or modulus, constant shifts below 32, every jump landing inside the program, no scratch word read before every path wrote it, and a RET last. scratch must hold len entries (the per-pc * initialized-scratch masks). 0 when valid, SBPF_ERR_INVALID otherwise.", "kind": "function", "line": 95, "name": "sbpf_check", "signature": "int sbpf_check(const sbpf_insn *prog, unsigned len, unsigned short *scratch);"}, {"doc": "Run a program sbpf_check accepted over one syscall's data; returns the 32-bit action. A runtime division or modulus by a zero X returns * SBPF_RET_KILL_PROCESS.", "kind": "function", "line": 100, "name": "sbpf_run", "signature": "unsigned int sbpf_run(const sbpf_insn *prog, unsigned len, const sbpf_data *d);"}, {"doc": "Restrictiveness rank of an action (0 = most restrictive): the order * stacked filters are combined in. Unknown actions rank as KILL_PROCESS.", "kind": "function", "line": 104, "name": "sbpf_action_rank", "signature": "int sbpf_action_rank(unsigned int action);"}, {"kind": "macro", "line": 12, "name": "SECCOMP_BPF_H", "signature": "#define SECCOMP_BPF_H"}, {"kind": "macro", "line": 30, "name": "SBPF_MAX_INSNS", "signature": "#define SBPF_MAX_INSNS"}, {"kind": "macro", "line": 31, "name": "SBPF_DATA_SIZE", "signature": "#define SBPF_DATA_SIZE"}, {"kind": "macro", "line": 32, "name": "SBPF_MEMWORDS", "signature": "#define SBPF_MEMWORDS"}, {"kind": "macro", "line": 33, "name": "SBPF_WORD", "signature": "#define SBPF_WORD"}, {"kind": "macro", "line": 34, "name": "SBPF_SHIFT_MAX", "signature": "#define SBPF_SHIFT_MAX"}, {"kind": "macro", "line": 35, "name": "SBPF_ERR_INVALID", "signature": "#define SBPF_ERR_INVALID"}, {"kind": "macro", "line": 38, "name": "SBPF_RET_KILL_PROCESS", "signature": "#define SBPF_RET_KILL_PROCESS"}, {"kind": "macro", "line": 39, "name": "SBPF_RET_KILL_THREAD", "signature": "#define SBPF_RET_KILL_THREAD"}, {"kind": "macro", "line": 40, "name": "SBPF_RET_TRAP", "signature": "#define SBPF_RET_TRAP"}, {"kind": "macro", "line": 41, "name": "SBPF_RET_ERRNO", "signature": "#define SBPF_RET_ERRNO"}, {"kind": "macro", "line": 42, "name": "SBPF_RET_USER_NOTIF", "signature": "#define SBPF_RET_USER_NOTIF"}, {"kind": "macro", "line": 43, "name": "SBPF_RET_TRACE", "signature": "#define SBPF_RET_TRACE"}, {"kind": "macro", "line": 44, "name": "SBPF_RET_LOG", "signature": "#define SBPF_RET_LOG"}, {"kind": "macro", "line": 45, "name": "SBPF_RET_ALLOW", "signature": "#define SBPF_RET_ALLOW"}, {"kind": "macro", "line": 46, "name": "SBPF_RET_ACTION_FULL", "signature": "#define SBPF_RET_ACTION_FULL"}, {"kind": "macro", "line": 47, "name": "SBPF_RET_DATA", "signature": "#define SBPF_RET_DATA"}, {"kind": "macro", "line": 49, "name": "SBPF_AUDIT_ARCH_X86_64", "signature": "#define SBPF_AUDIT_ARCH_X86_64"}, {"kind": "macro", "line": 52, "name": "SBPF_CLASS", "signature": "#define SBPF_CLASS(c)"}, {"kind": "macro", "line": 53, "name": "SBPF_LD", "signature": "#define SBPF_LD"}, {"kind": "macro", "line": 54, "name": "SBPF_LDX", "signature": "#define SBPF_LDX"}, {"kind": "macro", "line": 55, "name": "SBPF_ST", "signature": "#define SBPF_ST"}, {"kind": "macro", "line": 56, "name": "SBPF_STX", "signature": "#define SBPF_STX"}, {"kind": "macro", "line": 57, "name": "SBPF_ALU", "signature": "#define SBPF_ALU"}, {"kind": "macro", "line": 58, "name": "SBPF_JMP", "signature": "#define SBPF_JMP"}, {"kind": "macro", "line": 59, "name": "SBPF_RET", "signature": "#define SBPF_RET"}, {"kind": "macro", "line": 60, "name": "SBPF_MISC", "signature": "#define SBPF_MISC"}, {"kind": "macro", "line": 61, "name": "SBPF_W", "signature": "#define SBPF_W"}, {"kind": "macro", "line": 62, "name": "SBPF_IMM", "signature": "#define SBPF_IMM"}, {"kind": "macro", "line": 63, "name": "SBPF_ABS", "signature": "#define SBPF_ABS"}, {"kind": "macro", "line": 64, "name": "SBPF_MEM", "signature": "#define SBPF_MEM"}, {"kind": "macro", "line": 65, "name": "SBPF_LEN", "signature": "#define SBPF_LEN"}, {"kind": "macro", "line": 66, "name": "SBPF_ADD", "signature": "#define SBPF_ADD"}, {"kind": "macro", "line": 67, "name": "SBPF_SUB", "signature": "#define SBPF_SUB"}, {"kind": "macro", "line": 68, "name": "SBPF_MUL", "signature": "#define SBPF_MUL"}, {"kind": "macro", "line": 69, "name": "SBPF_DIV", "signature": "#define SBPF_DIV"}, {"kind": "macro", "line": 70, "name": "SBPF_OR", "signature": "#define SBPF_OR"}, {"kind": "macro", "line": 71, "name": "SBPF_AND", "signature": "#define SBPF_AND"}, {"kind": "macro", "line": 72, "name": "SBPF_LSH", "signature": "#define SBPF_LSH"}, {"kind": "macro", "line": 73, "name": "SBPF_RSH", "signature": "#define SBPF_RSH"}, {"kind": "macro", "line": 74, "name": "SBPF_NEG", "signature": "#define SBPF_NEG"}, {"kind": "macro", "line": 75, "name": "SBPF_MOD", "signature": "#define SBPF_MOD"}, {"kind": "macro", "line": 76, "name": "SBPF_XOR", "signature": "#define SBPF_XOR"}, {"kind": "macro", "line": 77, "name": "SBPF_JA", "signature": "#define SBPF_JA"}, {"kind": "macro", "line": 78, "name": "SBPF_JEQ", "signature": "#define SBPF_JEQ"}, {"kind": "macro", "line": 79, "name": "SBPF_JGT", "signature": "#define SBPF_JGT"}, {"kind": "macro", "line": 80, "name": "SBPF_JGE", "signature": "#define SBPF_JGE"}, {"kind": "macro", "line": 81, "name": "SBPF_JSET", "signature": "#define SBPF_JSET"}, {"kind": "macro", "line": 82, "name": "SBPF_K", "signature": "#define SBPF_K"}, {"kind": "macro", "line": 83, "name": "SBPF_X", "signature": "#define SBPF_X"}, {"kind": "macro", "line": 84, "name": "SBPF_A", "signature": "#define SBPF_A"}, {"kind": "macro", "line": 85, "name": "SBPF_TAX", "signature": "#define SBPF_TAX"}, {"kind": "macro", "line": 86, "name": "SBPF_TXA", "signature": "#define SBPF_TXA"}]}, {"doc": "Docstring: select_map.h -- fd_set <-> pollfd translation for select(2).", "id": "headers/select_map.h", "kind": "module", "label": "select_map.h", "language": "h", "sha256": "ffc94c0d378ec44d", "symbol_count": 16, "symbols": [{"kind": "struct", "line": 31, "name": "select_pollfd_t"}, {"kind": "function", "line": 37, "name": "select_fd_isset", "signature": "static inline int select_fd_isset(const unsigned char *set, int fd)"}, {"kind": "function", "line": 41, "name": "select_fd_put", "signature": "static inline void select_fd_put(unsigned char *set, int fd)"}, {"doc": "int fd; short events; short revents; } select_pollfd_t; static inline int select_fd_isset(const unsigned char *set, int fd) { return set && fd >= 0 && (set[fd >> 3] & (1u << (fd & 7))) != 0; } static inline void select_fd_put(unsigned char *set, int fd) { if (set && fd >= 0) set[fd >> 3] |= (unsigned char)(1u << (fd & 7)); } /** Docstring: Count fds below nfds present in any of the three sets.", "kind": "function", "line": 46, "name": "select_poll_count", "signature": "static inline unsigned select_poll_count(const unsigned char *r,\n                                ..."}, {"doc": "Docstring: Build the pollfd array for the fds the sets request.  Entries come out in ascending fd order, one per requested fd, with the union of the classes the three sets asked for. The caller sizes the array through select_poll_count with the same arguments.", "kind": "function", "line": 66, "name": "select_poll_build", "signature": "static inline unsigned select_poll_build(select_pollfd_t *pfd,\n                                  ..."}, {"doc": "Docstring: Map poll revents into fresh result sets (Linux classes).  The \"in\" sets are the kernel-side copies of what the caller requested (roin/win/ein may be NULL); \"out\" sets are zeroed and receive only fds that were both requested in that set and ready in that class, so an fd armed for write only never appears in the read results. Returns the number of fds ready in at least one set, like Linux select.", "kind": "function", "line": 95, "name": "select_poll_result", "signature": "static inline unsigned select_poll_result(unsigned char *rout,\n                                  ..."}, {"doc": "(rv & (SELECT_POLLOUT | SELECT_POLLERR))) { select_fd_put(wout, fd); any = 1; } if (eout && select_fd_isset(ein, fd) && (rv & SELECT_POLLPRI)) { select_fd_put(eout, fd); any = 1; } if (any) ready++; } return ready; } /** Docstring: True when any polled fd reported POLLNVAL (a bad fd).", "kind": "function", "line": 131, "name": "select_poll_badfd", "signature": "static inline int select_poll_badfd(const select_pollfd_t *pfd,\n                                 ..."}, {"kind": "macro", "line": 2, "name": "SELECT_MAP_H", "signature": "#define SELECT_MAP_H"}, {"kind": "macro", "line": 20, "name": "SELECT_FD_SETSIZE", "signature": "#define SELECT_FD_SETSIZE"}, {"kind": "macro", "line": 21, "name": "SELECT_FD_SET_BYTES", "signature": "#define SELECT_FD_SET_BYTES"}, {"kind": "macro", "line": 24, "name": "SELECT_POLLIN", "signature": "#define SELECT_POLLIN"}, {"kind": "macro", "line": 25, "name": "SELECT_POLLPRI", "signature": "#define SELECT_POLLPRI"}, {"kind": "macro", "line": 26, "name": "SELECT_POLLOUT", "signature": "#define SELECT_POLLOUT"}, {"kind": "macro", "line": 27, "name": "SELECT_POLLERR", "signature": "#define SELECT_POLLERR"}, {"kind": "macro", "line": 28, "name": "SELECT_POLLHUP", "signature": "#define SELECT_POLLHUP"}, {"kind": "macro", "line": 29, "name": "SELECT_POLLNVAL", "signature": "#define SELECT_POLLNVAL"}]}, {"doc": "shell.h -- shared shell constants and the line reader/parser reused by", "id": "headers/shell.h", "kind": "module", "label": "shell.h", "language": "h", "sha256": "5333598816efa984", "symbol_count": 8, "symbols": [{"doc": "Read one line into buf with arrow-key editing; used by the built-in * editor to edit file text.", "kind": "function", "line": 18, "name": "shell_readline_buf", "signature": "void shell_readline_buf(char *buf, int size);"}, {"doc": "Read one line into buf with arrow-key editing; used by the built-in * editor to edit file text. void shell_readline_buf(char *buf, int size); /* Tokenize `line` into up to `max_args` argv entries; returns argc.", "kind": "function", "line": 21, "name": "shell_parse", "signature": "int shell_parse(char *line, char **argv, int max_args);"}, {"doc": "Strict signed decimal parse for numeric shell/editor operands: an optional sign followed by at least one digit, whole string consumed, fail-closed on empty input, trailing garbage or overflow. Returns 1 and sets *out on success, 0 otherwise. Replaces katol (which stops at the first non-digit and wraps on overflow) at every builtin call * site, so `kill 12abc` is a diagnostic instead of pid 12.", "kind": "function", "line": 29, "name": "shell_parse_long", "signature": "int shell_parse_long(const char *s, long *out);"}, {"doc": "Bounded pid parse: strict shell_parse_long plus min_pid <= pid < MAX_PROCS. Unifies the wait/kill/vmmap range checks so the bound cannot drift per * call site. Returns 1 and sets *out on success, 0 otherwise.", "kind": "function", "line": 34, "name": "shell_parse_pid", "signature": "int shell_parse_pid(const char *s, int min_pid, int *out);"}, {"doc": "Execute a shell script: read `path` line by line, skip blanks and `#` comments, parse each line and dispatch it through the normal builtin/ * program path.  Returns 0 on success, 1 on file error.", "kind": "function", "line": 39, "name": "shell_cmd_sh", "signature": "int shell_cmd_sh(int argc, char **argv);"}, {"kind": "macro", "line": 2, "name": "SHELL_H", "signature": "#define SHELL_H"}, {"kind": "macro", "line": 13, "name": "CMD_BUF_SZ", "signature": "#define CMD_BUF_SZ"}, {"kind": "macro", "line": 14, "name": "MAX_ARGS", "signature": "#define MAX_ARGS"}]}, {"doc": "Docstring: sign.h -- MiniOS binary signing contract.", "id": "headers/sign.h", "kind": "module", "label": "sign.h", "language": "h", "sha256": "f04fa46090e131af", "symbol_count": 14, "symbols": [{"kind": "struct", "line": 61, "name": "ed_sha"}, {"doc": "Docstring: Look up the trusted public key for a key id. * Answers 0 for unknown ids and for the unprovisioned slot.", "kind": "function", "line": 47, "name": "sign_pubkey", "signature": "static inline const unsigned char *sign_pubkey(unsigned id)"}, {"kind": "function", "line": 69, "name": "ed_sha512_init", "signature": "void ed_sha512_init(ed_sha *c);"}, {"kind": "function", "line": 70, "name": "ed_sha512_update", "signature": "void ed_sha512_update(ed_sha *c, const unsigned char *data, unsigned long len);"}, {"kind": "function", "line": 71, "name": "ed_sha512_final", "signature": "void ed_sha512_final(ed_sha *c, unsigned char out[64]);"}, {"doc": "Docstring: Verify an Ed25519 signature, 1 valid else 0. * See kernel/ed25519.c for the full contract.", "kind": "function", "line": 75, "name": "ed25519_verify", "signature": "int ed25519_verify(const unsigned char sig[64], const unsigned char *msg, unsigned long msglen, const unsigned char pub[32]);"}, {"kind": "macro", "line": 17, "name": "SIGN_H", "signature": "#define SIGN_H"}, {"kind": "macro", "line": 19, "name": "SIGN_KEY_DEV", "signature": "#define SIGN_KEY_DEV"}, {"kind": "macro", "line": 20, "name": "SIGN_KEY_PROD", "signature": "#define SIGN_KEY_PROD"}, {"kind": "macro", "line": 21, "name": "SIGN_KEYS", "signature": "#define SIGN_KEYS"}, {"kind": "macro", "line": 22, "name": "SIGN_PUB_BYTES", "signature": "#define SIGN_PUB_BYTES"}, {"kind": "macro", "line": 23, "name": "SIGN_SIG_BYTES", "signature": "#define SIGN_SIG_BYTES"}, {"kind": "macro", "line": 24, "name": "SIGN_DESC_BYTES", "signature": "#define SIGN_DESC_BYTES"}, {"kind": "macro", "line": 25, "name": "SIGN_NOTE_TYPE", "signature": "#define SIGN_NOTE_TYPE"}]}, {"doc": "SMP bring-up: wake the application processors (APs) via the LAPIC INIT/SIPI", "id": "headers/smp.h", "kind": "module", "label": "smp.h", "language": "h", "sha256": "695bae174fe4a5ec", "symbol_count": 12, "symbols": [{"kind": "function", "line": 41, "name": "smp_init", "signature": "void smp_init(void);"}, {"kind": "function", "line": 42, "name": "smp_ap_entry", "signature": "void smp_ap_entry(void);"}, {"doc": "PIT-anchored LAPIC calibration (ticks per 10 ms at divide-by-16). Measured once by the BSP in smp_init; the AP periodic timer uses it when MINIOS_AP_TIMER is set. lapic_cal_valid is 0 on the fixed * 625000-tick fallback. extern unsigned lapic_cal_10ms; extern int lapic_cal_valid; void smp_init(void); void smp_ap_entry(void);   /* entry point each AP jumps to from ap_entry.S", "kind": "function", "line": 43, "name": "smp_ipi_broadcast", "signature": "void smp_ipi_broadcast(int vector);"}, {"doc": "PIT-anchored LAPIC calibration (ticks per 10 ms at divide-by-16). Measured once by the BSP in smp_init; the AP periodic timer uses it when MINIOS_AP_TIMER is set. lapic_cal_valid is 0 on the fixed * 625000-tick fallback. extern unsigned lapic_cal_10ms; extern int lapic_cal_valid; void smp_init(void); void smp_ap_entry(void);   /* entry point each AP jumps to from ap_entry.S void smp_ipi_broadcast(int vector);  /* fixed-delivery IPI, all except self", "kind": "function", "line": 44, "name": "smp_nmi_broadcast", "signature": "void smp_nmi_broadcast(void);"}, {"kind": "variable", "line": 25, "name": "smp_lock", "signature": "extern spinlock_t smp_lock;"}, {"doc": "Read-back diagnostics written by the AP after its LAPIC setup; the `smp` builtin prints them so a dead AP's APIC state is visible over * the serial console.", "kind": "variable", "line": 30, "name": "smp_dbg_svr", "signature": "extern volatile unsigned smp_dbg_svr;"}, {"kind": "variable", "line": 31, "name": "smp_dbg_lvt", "signature": "extern volatile unsigned smp_dbg_lvt;"}, {"kind": "variable", "line": 32, "name": "smp_dbg_ipis", "signature": "extern volatile unsigned smp_dbg_ipis;"}, {"doc": "Read-back diagnostics written by the AP after its LAPIC setup; the `smp` builtin prints them so a dead AP's APIC state is visible over * the serial console. extern volatile unsigned smp_dbg_svr; extern volatile unsigned smp_dbg_lvt; extern volatile unsigned smp_dbg_ipis;  /* vector-32 ISRs run on APs", "kind": "variable", "line": 33, "name": "smp_dbg_sent", "signature": "extern volatile unsigned smp_dbg_sent;"}, {"doc": "PIT-anchored LAPIC calibration (ticks per 10 ms at divide-by-16). Measured once by the BSP in smp_init; the AP periodic timer uses it when MINIOS_AP_TIMER is set. lapic_cal_valid is 0 on the fixed * 625000-tick fallback.", "kind": "variable", "line": 38, "name": "lapic_cal_10ms", "signature": "extern unsigned lapic_cal_10ms;"}, {"kind": "variable", "line": 39, "name": "lapic_cal_valid", "signature": "extern int lapic_cal_valid;"}, {"kind": "macro", "line": 2, "name": "SMP_H", "signature": "#define SMP_H"}]}, {"doc": "Docstring: Scalar shared-window view saved across a child run.", "id": "headers/spawn.h", "kind": "module", "label": "spawn.h", "language": "h", "sha256": "aba3f1848558891b", "symbol_count": 9, "symbols": [{"doc": "#ifndef SPAWN_H #define SPAWN_H #include \"kernel.h\" #include \"vma.h\" #include \"sched.h\" /** Docstring: Scalar shared-window view saved across a child run.", "kind": "struct", "line": 9, "name": "spawn_ctx_t"}, {"doc": "Docstring: Save the caller shared-window view into ctx. Heap-owns the VMA pool copy (only the live prefix, never the whole VMA_MAX array), so nested spawns no longer alias one file-static buffer. Returns 0 when the * copy cannot be allocated; the caller must refuse the spawn fail-closed.", "kind": "function", "line": 28, "name": "spawn_backup", "signature": "int spawn_backup(spawn_ctx_t *ctx);"}, {"doc": "Docstring: Save the caller shared-window view into ctx. Heap-owns the VMA pool copy (only the live prefix, never the whole VMA_MAX array), so nested spawns no longer alias one file-static buffer. Returns 0 when the * copy cannot be allocated; the caller must refuse the spawn fail-closed. int spawn_backup(spawn_ctx_t *ctx); /** Docstring: Restore a view previously saved by spawn_backup.", "kind": "function", "line": 31, "name": "spawn_restore", "signature": "void spawn_restore(spawn_ctx_t *ctx);"}, {"doc": "Docstring: Save the caller shared-window view into ctx. Heap-owns the VMA pool copy (only the live prefix, never the whole VMA_MAX array), so nested spawns no longer alias one file-static buffer. Returns 0 when the * copy cannot be allocated; the caller must refuse the spawn fail-closed. int spawn_backup(spawn_ctx_t *ctx); /** Docstring: Restore a view previously saved by spawn_backup. void spawn_restore(spawn_ctx_t *ctx); /** Docstring: Validate user argv words against the user window.", "kind": "function", "line": 34, "name": "spawn_validate_argv", "signature": "int spawn_validate_argv(int argc, const char **uargv);"}, {"doc": "Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv.", "kind": "function", "line": 39, "name": "spawn_copy_argv", "signature": "char **spawn_copy_argv(int argc, const char **uargv);"}, {"doc": "Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv. char **spawn_copy_argv(int argc, const char **uargv); /** Docstring: Release a copy produced by spawn_copy_argv with one kfree.", "kind": "function", "line": 42, "name": "spawn_free_argv", "signature": "void spawn_free_argv(char **kargv, int argc);"}, {"doc": "Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv. char **spawn_copy_argv(int argc, const char **uargv); /** Docstring: Release a copy produced by spawn_copy_argv with one kfree. void spawn_free_argv(char **kargv, int argc); /** Docstring: Snapshot a resolved path into a kernel buffer.", "kind": "function", "line": 45, "name": "spawn_load_image", "signature": "unsigned char *spawn_load_image(const char *resolved, unsigned *size_out);"}, {"doc": "Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv. char **spawn_copy_argv(int argc, const char **uargv); /** Docstring: Release a copy produced by spawn_copy_argv with one kfree. void spawn_free_argv(char **kargv, int argc); /** Docstring: Snapshot a resolved path into a kernel buffer. unsigned char *spawn_load_image(const char *resolved, unsigned *size_out); /** Docstring: Run a loaded image by ELF type, return child status.", "kind": "function", "line": 48, "name": "spawn_execute", "signature": "int spawn_execute(const char *resolved, const char *redirect, unsigned char *data, unsigned data_size, int argc, char **kargv, const char **uargv_fallback);"}, {"kind": "macro", "line": 2, "name": "SPAWN_H", "signature": "#define SPAWN_H"}]}, {"doc": "spinlock.h -- Lightweight spinlock for MiniOS kernel.", "id": "headers/spinlock.h", "kind": "module", "label": "spinlock.h", "language": "h", "sha256": "a9d1eef6ee8b8910", "symbol_count": 19, "symbols": [{"kind": "struct", "line": 38, "name": "spinlock_t"}, {"kind": "type_alias", "line": 41, "name": "irqflags_t", "signature": "typedef unsigned long irqflags_t;"}, {"kind": "function", "line": 46, "name": "spin_init", "signature": "static inline void spin_init(spinlock_t *lock)"}, {"doc": "Host unit-test variants (tests/test_sync.c, `make test-sync`): cli/sti and pushf/popf are privileged and fault in userspace, so the host build spins on the GCC atomics only and treats interrupt state as a dummy value.  Kernel builds never define SYNC_HOST_TEST and always take the * real path in the #else branch below.", "kind": "function", "line": 56, "name": "spin_save_irq", "signature": "static inline irqflags_t spin_save_irq(void)"}, {"kind": "function", "line": 57, "name": "spin_restore_irq", "signature": "static inline void spin_restore_irq(irqflags_t flags)"}, {"kind": "function", "line": 58, "name": "spin_lock", "signature": "static inline void spin_lock(spinlock_t *lock)"}, {"kind": "function", "line": 64, "name": "spin_unlock", "signature": "static inline void spin_unlock(spinlock_t *lock)"}, {"kind": "function", "line": 68, "name": "spin_lock_irqsave", "signature": "static inline void spin_lock_irqsave(spinlock_t *lock, irqflags_t *flags)"}, {"kind": "function", "line": 75, "name": "spin_unlock_irqrestore", "signature": "static inline void spin_unlock_irqrestore(spinlock_t *lock, irqflags_t flags)"}, {"kind": "function", "line": 80, "name": "spin_unlock_keep_irq", "signature": "static inline void spin_unlock_keep_irq(spinlock_t *lock)"}, {"kind": "function", "line": 84, "name": "spin_trylock", "signature": "static inline int spin_trylock(spinlock_t *lock)"}, {"doc": "__sync_lock_release(&lock->locked); } static inline void spin_unlock_keep_irq(spinlock_t *lock) { __sync_synchronize(); __sync_lock_release(&lock->locked); } static inline int spin_trylock(spinlock_t *lock) { int was = __sync_lock_test_and_set(&lock->locked, 1); if (!was) __sync_synchronize(); return !was; } #else /* Read RFLAGS and disable interrupts.", "kind": "function", "line": 92, "name": "spin_save_irq", "signature": "static inline irqflags_t spin_save_irq(void)"}, {"doc": "int was = __sync_lock_test_and_set(&lock->locked, 1); if (!was) __sync_synchronize(); return !was; } #else /* Read RFLAGS and disable interrupts. static inline irqflags_t spin_save_irq(void) { irqflags_t flags; __asm__ volatile(\"pushfq; pop %0; cli\" : \"=r\"(flags)); return flags; } /* Restore RFLAGS (including IF) from a saved value.", "kind": "function", "line": 99, "name": "spin_restore_irq", "signature": "static inline void spin_restore_irq(irqflags_t flags)"}, {"doc": "Acquire the lock and disable interrupts. Interrupts are disabled before the CAS loop to prevent ISR re-entry. The memory clobber ensures the compiler does not reorder across the lock. * Use this from ISR context or when a single-level lock is sufficient.", "kind": "function", "line": 107, "name": "spin_lock", "signature": "static inline void spin_lock(spinlock_t *lock)"}, {"doc": "Release the lock and re-enable interrupts. The release uses __sync_lock_release which is a store-release with * the correct memory ordering.", "kind": "function", "line": 118, "name": "spin_unlock", "signature": "static inline void spin_unlock(spinlock_t *lock)"}, {"doc": "Release the lock WITHOUT touching interrupts (IF stays as-is). For context-switch paths: the lock was acquired with interrupts off and they must stay off across the switch, because a timer tick landing between the release and switch_to would park the half-switched state over the incoming thread's ctx.  The incoming * context's own rflags decide IF after the switch.", "kind": "function", "line": 130, "name": "spin_unlock_keep_irq", "signature": "static inline void spin_unlock_keep_irq(spinlock_t *lock)"}, {"doc": "Release the lock and restore the saved interrupt state. If the caller's interrupts were enabled before spin_lock_irqsave, * they are re-enabled here.  If they were disabled, they stay disabled.", "kind": "function", "line": 150, "name": "spin_unlock_irqrestore", "signature": "static inline void spin_unlock_irqrestore(spinlock_t *lock, irqflags_t flags)"}, {"kind": "macro", "line": 2, "name": "SPINLOCK_H", "signature": "#define SPINLOCK_H"}, {"kind": "macro", "line": 44, "name": "SPINLOCK_INIT", "signature": "#define SPINLOCK_INIT"}]}, {"doc": "sync.h -- Blocking synchronization primitives (roadmap Phase 3.1).", "id": "headers/sync.h", "kind": "module", "label": "sync.h", "language": "h", "sha256": "935013b81a68adb1", "symbol_count": 38, "symbols": [{"doc": "wait-queue linkage: procs chain through proc_t.wq_next, WQ_NONE ends the chain and marks an empty queue.  PIDs start at 1 (sched.c), so a * zeroed proc_t never aliases a queued entry. #define WQ_NONE (-1) /* ---- Wait queues ----", "kind": "struct", "line": 42, "name": "wait_queue_t"}, {"doc": "--- Mutex (blocking, non-recursive) ---- Priority inheritance (thesis correction 3): a low-priority holder that blocks a high-priority waiter is boosted to the waiter's effective priority, transitively along the blocked-on chain, until it releases. pi_set_base assigns a thread's base priority (default 0); pi_get_eff reports the boosted value the scheduler must honor. State lives in sync.c parallel arrays: proc_t is 248 bytes by asm contract (sched.c * asserts it, syscall_entry hardcodes it), so no field can be added.", "kind": "struct", "line": 63, "name": "mutex_t"}, {"doc": "wait_queue_t waiters; } mutex_t; #define MUTEX_INIT { SPINLOCK_INIT, 0, WQ_NONE, WAIT_QUEUE_INIT } void mutex_init(mutex_t *m); void mutex_lock(mutex_t *m); void mutex_unlock(mutex_t *m); int  mutex_trylock(mutex_t *m); void mutex_note_waiter(mutex_t *m, int waiter); void pi_set_base(int pid, int prio); int  pi_get_eff(int pid); /* ---- Counting semaphore ----", "kind": "struct", "line": 81, "name": "sem_t"}, {"doc": "--- Condition variable ---- Always paired with a mutex: cond_wait atomically releases the mutex, sleeps, and re-acquires it before returning (Mesa semantics: re-check * the predicate in a loop).", "kind": "struct", "line": 97, "name": "cond_t"}, {"doc": "--- Read-write lock (writer-preferring, no recursion) ---- A queued writer announces itself in `writers_waiting`, and new readers yield to it: without that rule a steady stream of readers starves the writer (every reader sees readers == 0 on its way in). The counter is incremented when the writer starts waiting and * decremented when it finally holds the lock, so it never leaks.", "kind": "struct", "line": 114, "name": "rwlock_t"}, {"kind": "function", "line": 50, "name": "wq_init", "signature": "void wq_init(wait_queue_t *q);"}, {"kind": "function", "line": 51, "name": "sleep_on", "signature": "void sleep_on(wait_queue_t *q);"}, {"kind": "function", "line": 52, "name": "wake_up", "signature": "int wake_up(wait_queue_t *q);"}, {"kind": "function", "line": 53, "name": "wake_up_all", "signature": "int wake_up_all(wait_queue_t *q);"}, {"kind": "function", "line": 56, "name": "inheritance", "signature": "* Priority inheritance (thesis correction 3): a low-priority holder that * blocks a high-priority waiter is boosted to the waiter's effective * priority, transitively along the blocked-on chain, until"}, {"kind": "function", "line": 72, "name": "mutex_init", "signature": "void mutex_init(mutex_t *m);"}, {"kind": "function", "line": 73, "name": "mutex_lock", "signature": "void mutex_lock(mutex_t *m);"}, {"kind": "function", "line": 74, "name": "mutex_unlock", "signature": "void mutex_unlock(mutex_t *m);"}, {"kind": "function", "line": 75, "name": "mutex_trylock", "signature": "int mutex_trylock(mutex_t *m);"}, {"kind": "function", "line": 76, "name": "mutex_note_waiter", "signature": "void mutex_note_waiter(mutex_t *m, int waiter);"}, {"kind": "function", "line": 77, "name": "pi_set_base", "signature": "void pi_set_base(int pid, int prio);"}, {"kind": "function", "line": 78, "name": "pi_get_eff", "signature": "int pi_get_eff(int pid);"}, {"kind": "function", "line": 89, "name": "sem_init", "signature": "void sem_init(sem_t *s, int value);"}, {"kind": "function", "line": 90, "name": "sem_wait", "signature": "void sem_wait(sem_t *s);"}, {"kind": "function", "line": 91, "name": "sem_post", "signature": "void sem_post(sem_t *s);"}, {"kind": "function", "line": 103, "name": "cond_init", "signature": "void cond_init(cond_t *c);"}, {"kind": "function", "line": 104, "name": "cond_wait", "signature": "void cond_wait(cond_t *c, mutex_t *m);"}, {"kind": "function", "line": 105, "name": "cond_signal", "signature": "void cond_signal(cond_t *c);"}, {"kind": "function", "line": 106, "name": "cond_broadcast", "signature": "void cond_broadcast(cond_t *c);"}, {"kind": "function", "line": 124, "name": "rwlock_init", "signature": "void rwlock_init(rwlock_t *rw);"}, {"kind": "function", "line": 125, "name": "rwlock_read_lock", "signature": "void rwlock_read_lock(rwlock_t *rw);"}, {"kind": "function", "line": 126, "name": "rwlock_read_unlock", "signature": "void rwlock_read_unlock(rwlock_t *rw);"}, {"kind": "function", "line": 127, "name": "rwlock_write_lock", "signature": "void rwlock_write_lock(rwlock_t *rw);"}, {"kind": "function", "line": 128, "name": "rwlock_write_unlock", "signature": "void rwlock_write_unlock(rwlock_t *rw);"}, {"kind": "function", "line": 130, "name": "now", "signature": "* available right now (a reader never takes it while a writer waits). */ int rwlock_read_trylock(rwlock_t *rw);"}, {"kind": "function", "line": 132, "name": "rwlock_write_trylock", "signature": "int rwlock_write_trylock(rwlock_t *rw);"}, {"kind": "macro", "line": 2, "name": "SYNC_H", "signature": "#define SYNC_H"}, {"kind": "macro", "line": 39, "name": "WQ_NONE", "signature": "#define WQ_NONE"}, {"kind": "macro", "line": 48, "name": "WAIT_QUEUE_INIT", "signature": "#define WAIT_QUEUE_INIT"}, {"kind": "macro", "line": 70, "name": "MUTEX_INIT", "signature": "#define MUTEX_INIT"}, {"kind": "macro", "line": 87, "name": "SEM_INIT", "signature": "#define SEM_INIT(n)"}, {"kind": "macro", "line": 101, "name": "COND_INIT", "signature": "#define COND_INIT"}, {"kind": "macro", "line": 122, "name": "RWLOCK_INIT", "signature": "#define RWLOCK_INIT"}]}, {"doc": "syscall_asm.h -- numeric contract for arch/x86/syscall_entry.S.", "id": "headers/syscall_asm.h", "kind": "module", "label": "syscall_asm.h", "language": "h", "sha256": "3e58b317ee3d6063", "symbol_count": 13, "symbols": [{"kind": "macro", "line": 2, "name": "SYSCALL_ASM_H", "signature": "#define SYSCALL_ASM_H"}, {"kind": "macro", "line": 15, "name": "SYSCALL_USER_WIN_LO", "signature": "#define SYSCALL_USER_WIN_LO"}, {"kind": "macro", "line": 16, "name": "SYSCALL_USER_WIN_HI", "signature": "#define SYSCALL_USER_WIN_HI"}, {"kind": "macro", "line": 17, "name": "SYSCALL_PROC_T_SIZE", "signature": "#define SYSCALL_PROC_T_SIZE"}, {"kind": "macro", "line": 18, "name": "SYSCALL_PROC_KSTACK_OFF", "signature": "#define SYSCALL_PROC_KSTACK_OFF"}, {"kind": "macro", "line": 19, "name": "SYSCALL_MAX_PROCS", "signature": "#define SYSCALL_MAX_PROCS"}, {"kind": "macro", "line": 20, "name": "SYSCALL_CPU_CUR_PID_OFF", "signature": "#define SYSCALL_CPU_CUR_PID_OFF"}, {"kind": "macro", "line": 21, "name": "SYSCALL_CPU_SC_N_OFF", "signature": "#define SYSCALL_CPU_SC_N_OFF"}, {"kind": "macro", "line": 22, "name": "SYSCALL_CPU_SC_RIP_OFF", "signature": "#define SYSCALL_CPU_SC_RIP_OFF"}, {"kind": "macro", "line": 23, "name": "SYSCALL_CPU_SC_PID_OFF", "signature": "#define SYSCALL_CPU_SC_PID_OFF"}, {"kind": "macro", "line": 24, "name": "SYSCALL_CPU_SC_RET_OFF", "signature": "#define SYSCALL_CPU_SC_RET_OFF"}, {"kind": "macro", "line": 25, "name": "SYSCALL_CPU_SC_TMP_OFF", "signature": "#define SYSCALL_CPU_SC_TMP_OFF"}, {"kind": "macro", "line": 29, "name": "SYSCALL_FRAME_WORDS", "signature": "#define SYSCALL_FRAME_WORDS"}]}, {"doc": "syscalls_proc.h -- process-management syscall handlers shared with the", "id": "headers/syscalls_proc.h", "kind": "module", "label": "syscalls_proc.h", "language": "h", "sha256": "a19da035adb92054", "symbol_count": 20, "symbols": [{"kind": "function", "line": 5, "name": "dispatcher", "signature": "* dispatcher (kernel/syscalls.c). These handlers touch only scheduler * state (current_pid, procs[], do_* / seccomp_* / yield) plus the * kernel-wide user_range_ok validator, so they live in their own"}, {"kind": "function", "line": 12, "name": "sys_minios_nice", "signature": "long sys_minios_nice(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 13, "name": "sys_minios_clone", "signature": "long sys_minios_clone(long flags, long newsp, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 14, "name": "sys_minios_thread_spawn", "signature": "long sys_minios_thread_spawn(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 15, "name": "sys_linux_yield", "signature": "long sys_linux_yield(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 16, "name": "sys_linux_getpid", "signature": "long sys_linux_getpid(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 17, "name": "sys_linux_gettid", "signature": "long sys_linux_gettid(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 18, "name": "sys_linux_fork", "signature": "long sys_linux_fork(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 19, "name": "sys_linux_clone", "signature": "long sys_linux_clone(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 20, "name": "sys_linux_vfork", "signature": "long sys_linux_vfork(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 21, "name": "sys_linux_execve", "signature": "long sys_linux_execve(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 22, "name": "sys_linux_exit", "signature": "long sys_linux_exit(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 23, "name": "sys_linux_wait4", "signature": "long sys_linux_wait4(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 24, "name": "sys_linux_kill", "signature": "long sys_linux_kill(long a1, long a2, long a3, long a4, long a5, long a6);"}, {"doc": "Linux signal numbers 1..LINUX_SIGNAL_MAX; a fatal one ends its target. * The foreground shell reports a signal death as exit code 128 + sig. define LINUX_SIGNAL_MAX       64 define LINUX_SIGNAL_EXIT_BASE 128 define LINUX_EXIT_STATUS_MASK 0xff", "kind": "function", "line": 31, "name": "linux_signal_fatal", "signature": "int linux_signal_fatal(long sig);"}, {"doc": "Linux signal numbers 1..LINUX_SIGNAL_MAX; a fatal one ends its target. * The foreground shell reports a signal death as exit code 128 + sig. #define LINUX_SIGNAL_MAX       64 #define LINUX_SIGNAL_EXIT_BASE 128 #define LINUX_EXIT_STATUS_MASK 0xff int linux_signal_fatal(long sig); /* Shared exit path for sys_linux_exit and the exit_group fall-through.", "kind": "function", "line": 34, "name": "do_proc_exit", "signature": "long do_proc_exit(long code);"}, {"kind": "macro", "line": 2, "name": "SYSCALLS_PROC_H", "signature": "#define SYSCALLS_PROC_H"}, {"kind": "macro", "line": 28, "name": "LINUX_SIGNAL_MAX", "signature": "#define LINUX_SIGNAL_MAX"}, {"kind": "macro", "line": 29, "name": "LINUX_SIGNAL_EXIT_BASE", "signature": "#define LINUX_SIGNAL_EXIT_BASE"}, {"kind": "macro", "line": 30, "name": "LINUX_EXIT_STATUS_MASK", "signature": "#define LINUX_EXIT_STATUS_MASK"}]}, {"doc": "Docstring: Tick listener bus contract.", "id": "headers/tick.h", "kind": "module", "label": "tick.h", "language": "h", "sha256": "22980a2efc3ea536", "symbol_count": 16, "symbols": [{"doc": "gating predicate for the desktop tick.  Design: fixed-size tables, no heap, no locks. Registration happens at boot before sti, dispatch happens in ISR context and only reads. A failed registration returns a negative code and changes nothing. A null entry is never dispatched. Dispatch order equals registration order. Behavior of existing listeners is unchanged; only the call path moves.  #ifndef TICK_H #define TICK_H /** Docstring: Centralized bounds for the tick listener bus.", "kind": "struct", "line": 22, "name": "tick_config_t"}, {"doc": "needs; the bound exists so the tables stay fixed-size. #define TICK_MAX_USB_LISTENERS 2 /** Docstring: Default bus configuration. #define TICK_CONFIG_DEFAULT ((tick_config_t){ \\ TICK_MAX_AUDIO_LISTENERS, \\ TICK_MAX_DESKTOP_LISTENERS, \\ TICK_MAX_USB_LISTENERS \\ }) /** Docstring: Periodic effect signature. Context is opaque to the bus. typedef void (*tick_fn_t)(void *ctx); /** Docstring: Reset both listener lists to empty.", "kind": "function", "line": 47, "name": "tick_reset", "signature": "void tick_reset(void);"}, {"doc": "Docstring: Register an unconditional BSP audio effect.  Returns 0 on success, -1 when the handler is null or the audio table is full. A refusal changes nothing.", "kind": "function", "line": 54, "name": "tick_register_audio", "signature": "int tick_register_audio(tick_fn_t fn, void *ctx);"}, {"doc": "Docstring: Register a gated desktop effect.  Returns 0 on success, -1 when the handler is null or the desktop table is full. A refusal changes nothing.", "kind": "function", "line": 61, "name": "tick_register_desktop", "signature": "int tick_register_desktop(tick_fn_t fn, void *ctx);"}, {"doc": "Docstring: Register a polled USB controller effect.  The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.", "kind": "function", "line": 69, "name": "tick_register_usb", "signature": "int tick_register_usb(tick_fn_t fn, void *ctx);"}, {"doc": "Docstring: Register a polled USB controller effect.  The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order.", "kind": "function", "line": 72, "name": "tick_run_usb", "signature": "void tick_run_usb(void);"}, {"doc": "Docstring: Register a polled USB controller effect.  The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order.", "kind": "function", "line": 75, "name": "tick_run_audio", "signature": "void tick_run_audio(void);"}, {"doc": "The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order. void tick_run_audio(void); /** Docstring: Run desktop listeners in registration order.", "kind": "function", "line": 78, "name": "tick_run_desktop", "signature": "void tick_run_desktop(void);"}, {"doc": "handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order. void tick_run_audio(void); /** Docstring: Run desktop listeners in registration order. void tick_run_desktop(void); /** Docstring: Count registered audio listeners.", "kind": "function", "line": 81, "name": "tick_audio_count", "signature": "int tick_audio_count(void);"}, {"doc": "/** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order. void tick_run_audio(void); /** Docstring: Run desktop listeners in registration order. void tick_run_desktop(void); /** Docstring: Count registered audio listeners. int tick_audio_count(void); /** Docstring: Count registered desktop listeners.", "kind": "function", "line": 84, "name": "tick_desktop_count", "signature": "int tick_desktop_count(void);"}, {"doc": "Docstring: Pure desktop gating predicate.  Returns nonzero when the given tick count falls on a desktop tick for the given interval. A non-positive interval never fires. Holds for every tick value including zero.", "kind": "function", "line": 92, "name": "tick_desktop_due", "signature": "int tick_desktop_due(unsigned long long ticks, unsigned interval);"}, {"kind": "macro", "line": 19, "name": "TICK_H", "signature": "#define TICK_H"}, {"kind": "macro", "line": 29, "name": "TICK_MAX_AUDIO_LISTENERS", "signature": "#define TICK_MAX_AUDIO_LISTENERS"}, {"kind": "macro", "line": 31, "name": "TICK_MAX_DESKTOP_LISTENERS", "signature": "#define TICK_MAX_DESKTOP_LISTENERS"}, {"kind": "macro", "line": 34, "name": "TICK_MAX_USB_LISTENERS", "signature": "#define TICK_MAX_USB_LISTENERS"}, {"kind": "macro", "line": 37, "name": "TICK_CONFIG_DEFAULT", "signature": "#define TICK_CONFIG_DEFAULT"}]}, {"doc": "tlb.h - cross-CPU TLB shootdown (docs/spec/smp-sched.md, \"TLB shootdown\").", "id": "headers/tlb.h", "kind": "module", "label": "tlb.h", "language": "h", "sha256": "e70fe4e1a9806205", "symbol_count": 7, "symbols": [{"kind": "function", "line": 4, "name": "space", "signature": "* while that CPU keeps running the same address space (CLONE_VM threads on * an AP). Callers clear the PTEs, flush locally, call tlb_shootdown with the * address space, and only then release the frame"}, {"doc": "Shootdowns broadcast and acknowledgement waits that ran out of budget * (reported by the smp builtin).", "kind": "function", "line": 22, "name": "tlb_shootdown_count", "signature": "unsigned long tlb_shootdown_count(void);"}, {"kind": "function", "line": 23, "name": "tlb_shootdown_timeouts", "signature": "unsigned long tlb_shootdown_timeouts(void);"}, {"doc": "Shootdowns broadcast and acknowledgement waits that ran out of budget * (reported by the smp builtin). unsigned long tlb_shootdown_count(void); unsigned long tlb_shootdown_timeouts(void); /* The vector-2 gate (arch/x86/tlb_nmi.S) and its acknowledgement counter.", "kind": "function", "line": 26, "name": "tlb_nmi_entry", "signature": "void tlb_nmi_entry(void);"}, {"kind": "variable", "line": 27, "name": "tlb_shoot_acks", "signature": "extern volatile unsigned int tlb_shoot_acks;"}, {"kind": "macro", "line": 10, "name": "TLB_H", "signature": "#define TLB_H"}, {"kind": "macro", "line": 13, "name": "TLB_RELEASE_BATCH", "signature": "#define TLB_RELEASE_BATCH"}]}, {"doc": "========== TLS 1.2 client (RFC 5246) ==========", "id": "headers/tls.h", "kind": "module", "label": "tls.h", "language": "h", "sha256": "b2b96cce83ce602a", "symbol_count": 73, "symbols": [{"kind": "struct", "line": 70, "name": "tls_root"}, {"kind": "struct", "line": 79, "name": "sha256_ctx"}, {"kind": "struct", "line": 85, "name": "tls_pubkey"}, {"kind": "struct", "line": 95, "name": "tls_session"}, {"doc": "Kernel built without the TLS engine (net/tls*.c unlinked): no session can ever exist, so the net.c close path needs no call. Inline no-op * keeps the reference without pulling the engine back in.", "kind": "function", "line": 293, "name": "tls_free_fd", "signature": "static inline void tls_free_fd(int fd)"}, {"kind": "function", "line": 168, "name": "sha256_init", "signature": "void sha256_init(struct sha256_ctx *c);"}, {"kind": "function", "line": 169, "name": "sha256_update", "signature": "void sha256_update(struct sha256_ctx *c, const unsigned char *data, unsigned len);"}, {"kind": "function", "line": 170, "name": "sha256_final", "signature": "void sha256_final(struct sha256_ctx *c, unsigned char out[32]);"}, {"kind": "function", "line": 171, "name": "sha256", "signature": "void sha256(const unsigned char *data, unsigned len, unsigned char out[32]);"}, {"kind": "function", "line": 172, "name": "sha384", "signature": "void sha384(const unsigned char *data, unsigned len, unsigned char out[48]);"}, {"kind": "function", "line": 174, "name": "hmac_sha256", "signature": "void hmac_sha256(const unsigned char *key, unsigned klen, const unsigned char *data, unsigned dlen, unsigned char out[32]);"}, {"doc": "/* ========== Crypto (tls_crypto.c) ========== void sha256_init(struct sha256_ctx *c); void sha256_update(struct sha256_ctx *c, const unsigned char *data, unsigned len); void sha256_final(struct sha256_ctx *c, unsigned char out[32]); void sha256(const unsigned char *data, unsigned len, unsigned char out[32]); void sha384(const unsigned char *data, unsigned len, unsigned char out[48]); void hmac_sha256(const unsigned char *key, unsigned klen, const unsigned char *data, unsigned dlen, unsigned char out[32]); /* TLS 1.2 PRF with SHA-256", "kind": "function", "line": 179, "name": "tls_prf", "signature": "void tls_prf(const unsigned char *secret, unsigned secret_len, const char *label, const unsigned char *seed, unsigned seed_len, unsigned char *out, unsigned out_len);"}, {"doc": "void sha256_final(struct sha256_ctx *c, unsigned char out[32]); void sha256(const unsigned char *data, unsigned len, unsigned char out[32]); void sha384(const unsigned char *data, unsigned len, unsigned char out[48]); void hmac_sha256(const unsigned char *key, unsigned klen, const unsigned char *data, unsigned dlen, unsigned char out[32]); /* TLS 1.2 PRF with SHA-256 void tls_prf(const unsigned char *secret, unsigned secret_len, const char *label, const unsigned char *seed, unsigned seed_len, unsigned char *out, unsigned out_len); /* AES-128 block cipher (key expansion internal; T-table implementation)", "kind": "function", "line": 184, "name": "aes128_encrypt_block", "signature": "void aes128_encrypt_block(const unsigned char key[16], const unsigned char in[16], unsigned char out[16]);"}, {"doc": "GCM. Each call seals one record: tag = 16 bytes appended to ct. * Returns 0 on success, -1 on overflow (len > TLS_REC_MAX).", "kind": "function", "line": 189, "name": "aes128_gcm_seal", "signature": "int aes128_gcm_seal(const unsigned char key[16], const unsigned char salt[4], unsigned long long seq, const unsigned char *aad, unsigned aad_len, const unsigned char *pt, unsigned pt_len, unsigned cha"}, {"doc": "GCM. Each call seals one record: tag = 16 bytes appended to ct. * Returns 0 on success, -1 on overflow (len > TLS_REC_MAX). int aes128_gcm_seal(const unsigned char key[16], const unsigned char salt[4], unsigned long long seq, const unsigned char *aad, unsigned aad_len, const unsigned char *pt, unsigned pt_len, unsigned char *ct, unsigned char tag[16]); /* Returns 0 when the tag verifies, -1 otherwise (constant-time compare).", "kind": "function", "line": 197, "name": "aes128_gcm_open", "signature": "int aes128_gcm_open(const unsigned char key[16], const unsigned char salt[4], unsigned long long seq, const unsigned char *aad, unsigned aad_len, const unsigned char *ct, unsigned ct_len, const unsign"}, {"doc": "Core GCM with an arbitrary 12-byte nonce (the TLS API above is the 4-byte salt + 8-byte sequence special case). Used by the host tests * against the NIST vectors.", "kind": "function", "line": 208, "name": "aes128_gcm_seal_core", "signature": "int aes128_gcm_seal_core(const unsigned char key[16], const unsigned char nonce[12], const unsigned char *aad, unsigned aad_len, const unsigned char *pt, unsigned pt_len, unsigned char *ct, unsigned c"}, {"kind": "function", "line": 213, "name": "aes128_gcm_open_core", "signature": "int aes128_gcm_open_core(const unsigned char key[16], const unsigned char nonce[12], const unsigned char *aad, unsigned aad_len, const unsigned char *ct, unsigned ct_len, const unsigned char tag[16], "}, {"doc": "secp256r1 / secp384r1: shared Jacobian point arithmetic over NIST * primes. curve: 0 = P-256, 1 = P-384.", "kind": "function", "line": 222, "name": "p256_scalar_mult", "signature": "int p256_scalar_mult(const unsigned char scalar[32], const unsigned char qx[32], const unsigned char qy[32], unsigned char rx[32], unsigned char ry[32]);"}, {"kind": "function", "line": 225, "name": "p384_scalar_mult", "signature": "int p384_scalar_mult(const unsigned char scalar[48], const unsigned char qx[48], const unsigned char qy[48], unsigned char rx[48], unsigned char ry[48]);"}, {"doc": "ECDH shared secret: Z = priv * peer_pub (P-256). Returns 0 on success, * -1 when the peer point is not on the curve (fail closed).", "kind": "function", "line": 231, "name": "p256_ecdh", "signature": "int p256_ecdh(const unsigned char priv[32], const unsigned char peer_x[32], const unsigned char peer_y[32], unsigned char z[32]);"}, {"doc": "ECDH shared secret: Z = priv * peer_pub (P-256). Returns 0 on success, * -1 when the peer point is not on the curve (fail closed). int  p256_ecdh(const unsigned char priv[32], const unsigned char peer_x[32], const unsigned char peer_y[32], unsigned char z[32]); /* P-256 point validation and helpers for the handshake", "kind": "function", "line": 236, "name": "p256_point_valid", "signature": "int p256_point_valid(const unsigned char x[32], const unsigned char y[32]);"}, {"kind": "function", "line": 237, "name": "p256_pub", "signature": "int p256_pub(const unsigned char priv[32], unsigned char x[32], unsigned char y[32]);"}, {"kind": "function", "line": 239, "name": "p256_scalar_valid", "signature": "int p256_scalar_valid(const unsigned char scalar[32]);"}, {"doc": "ECDSA verify over a SHA-256 or SHA-384 digest. curve: 0 = P-256, * 1 = P-384. Returns 0 when the signature verifies.", "kind": "function", "line": 243, "name": "ecdsa_verify", "signature": "int ecdsa_verify(int curve, const unsigned char pub_x[], const unsigned char pub_y[], const unsigned char digest[], unsigned digest_len, const unsigned char sig[], unsigned sig_len);"}, {"doc": "RSA PKCS#1 v1.5 signature verify with SHA-256. modulus up to 4096 bits. * digest is the SHA-256 of the signed data. Returns 0 on success.", "kind": "function", "line": 249, "name": "rsa_pkcs1_verify_sha256", "signature": "int rsa_pkcs1_verify_sha256(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[32], const unsigned char *sig, unsigned sig_len);"}, {"kind": "function", "line": 253, "name": "rsa_pkcs1_verify_sha384", "signature": "int rsa_pkcs1_verify_sha384(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[48], const unsigned char *sig, unsigned sig_len);"}, {"doc": "RSA PKCS#1 v1.5 signature verify with SHA-256. modulus up to 4096 bits. * digest is the SHA-256 of the signed data. Returns 0 on success. int  rsa_pkcs1_verify_sha256(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[32], const unsigned char *sig, unsigned sig_len); int  rsa_pkcs1_verify_sha384(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[48], const unsigned char *sig, unsigned sig_len); /* ========== X.509 (tls_x509.c) ========== /* Parse one DER certificate into a public key. Returns 0 on success.", "kind": "function", "line": 261, "name": "tls_x509_parse_pubkey", "signature": "int tls_x509_parse_pubkey(const unsigned char *der, unsigned len, struct tls_pubkey *pk);"}, {"kind": "function", "line": 267, "name": "now", "signature": "* window against now (days since epoch). Returns 0 on success. */ int tls_x509_verify_chain(const unsigned char *chain, unsigned chain_len, unsigned cert_lens[], int n_certs, const char *host, long no"}, {"doc": "Blocking TLS 1.2 handshake over an open TCP socket (net fd index). host is the SNI + certificate hostname. Returns 0 on success, -1 with * a diagnostic on the console. The session lives on the kernel heap.", "kind": "function", "line": 277, "name": "tls_handshake", "signature": "int tls_handshake(int fd, const char *host);"}, {"doc": "Blocking TLS 1.2 handshake over an open TCP socket (net fd index). host is the SNI + certificate hostname. Returns 0 on success, -1 with * a diagnostic on the console. The session lives on the kernel heap. int tls_handshake(int fd, const char *host); /* Send len plaintext bytes as one TLS record. All-or-error.", "kind": "function", "line": 280, "name": "tls_send", "signature": "int tls_send(int fd, const char *buf, int len);"}, {"doc": "Receive decrypted application bytes. 0 = clean EOF (close_notify or FIN * at a record boundary); -1 = protocol error / truncation (diagnostic).", "kind": "function", "line": 284, "name": "tls_recv", "signature": "int tls_recv(int fd, char *buf, int len);"}, {"doc": "Kernel built without the TLS engine (net/tls*.c unlinked): no session can ever exist, so the net.c close path needs no call. Inline no-op * keeps the reference without pulling the engine back in. static inline void tls_free_fd(int fd) { (void)fd; } #endif /* ========== Syscalls (kernel wiring in tls.c) ==========", "kind": "function", "line": 297, "name": "tls_sys_handshake", "signature": "long tls_sys_handshake(long fd, long host);"}, {"kind": "function", "line": 298, "name": "tls_sys_send", "signature": "long tls_sys_send(long fd, long buf, long len);"}, {"kind": "function", "line": 299, "name": "tls_sys_recv", "signature": "long tls_sys_recv(long fd, long buf, long len);"}, {"kind": "variable", "line": 75, "name": "tls_roots", "signature": "extern const struct tls_root tls_roots[TLS_ROOT_COUNT];"}, {"kind": "macro", "line": 2, "name": "TLS_H", "signature": "#define TLS_H"}, {"kind": "macro", "line": 7, "name": "TLS_CT_CCS", "signature": "#define TLS_CT_CCS"}, {"kind": "macro", "line": 8, "name": "TLS_CT_ALERT", "signature": "#define TLS_CT_ALERT"}, {"kind": "macro", "line": 9, "name": "TLS_CT_HANDSHAKE", "signature": "#define TLS_CT_HANDSHAKE"}, {"kind": "macro", "line": 10, "name": "TLS_CT_APPDATA", "signature": "#define TLS_CT_APPDATA"}, {"kind": "macro", "line": 11, "name": "TLS_REC_HEADER", "signature": "#define TLS_REC_HEADER"}, {"kind": "macro", "line": 12, "name": "TLS_REC_MAX", "signature": "#define TLS_REC_MAX"}, {"kind": "macro", "line": 13, "name": "TLS_MSG_MAX", "signature": "#define TLS_MSG_MAX"}, {"kind": "macro", "line": 14, "name": "TLS_PLAIN_MAX", "signature": "#define TLS_PLAIN_MAX"}, {"kind": "macro", "line": 15, "name": "TLS_VERSION_TLS12", "signature": "#define TLS_VERSION_TLS12"}, {"kind": "macro", "line": 16, "name": "TLS_VERSION_TLS10", "signature": "#define TLS_VERSION_TLS10"}, {"kind": "macro", "line": 19, "name": "TLS_HS_CLIENT_HELLO", "signature": "#define TLS_HS_CLIENT_HELLO"}, {"kind": "macro", "line": 20, "name": "TLS_HS_SERVER_HELLO", "signature": "#define TLS_HS_SERVER_HELLO"}, {"kind": "macro", "line": 21, "name": "TLS_HS_CERTIFICATE", "signature": "#define TLS_HS_CERTIFICATE"}, {"kind": "macro", "line": 22, "name": "TLS_HS_SERVER_KEY_EXCHANGE", "signature": "#define TLS_HS_SERVER_KEY_EXCHANGE"}, {"kind": "macro", "line": 23, "name": "TLS_HS_SERVER_HELLO_DONE", "signature": "#define TLS_HS_SERVER_HELLO_DONE"}, {"kind": "macro", "line": 24, "name": "TLS_HS_CLIENT_KEY_EXCHANGE", "signature": "#define TLS_HS_CLIENT_KEY_EXCHANGE"}, {"kind": "macro", "line": 25, "name": "TLS_HS_FINISHED", "signature": "#define TLS_HS_FINISHED"}, {"kind": "macro", "line": 28, "name": "TLS_CSUITE_ECDHE_RSA_AES128GCM", "signature": "#define TLS_CSUITE_ECDHE_RSA_AES128GCM"}, {"kind": "macro", "line": 29, "name": "TLS_CSUITE_ECDHE_ECDSA_AES128GCM", "signature": "#define TLS_CSUITE_ECDHE_ECDSA_AES128GCM"}, {"kind": "macro", "line": 32, "name": "TLS_SIG_RSA_PKCS1_SHA256", "signature": "#define TLS_SIG_RSA_PKCS1_SHA256"}, {"kind": "macro", "line": 33, "name": "TLS_SIG_ECDSA_P256_SHA256", "signature": "#define TLS_SIG_ECDSA_P256_SHA256"}, {"kind": "macro", "line": 34, "name": "TLS_SIG_ECDSA_P384_SHA384", "signature": "#define TLS_SIG_ECDSA_P384_SHA384"}, {"kind": "macro", "line": 37, "name": "TLS_GROUP_SECP256R1", "signature": "#define TLS_GROUP_SECP256R1"}, {"kind": "macro", "line": 40, "name": "TLS_EXT_SERVER_NAME", "signature": "#define TLS_EXT_SERVER_NAME"}, {"kind": "macro", "line": 41, "name": "TLS_EXT_SUPPORTED_GROUPS", "signature": "#define TLS_EXT_SUPPORTED_GROUPS"}, {"kind": "macro", "line": 42, "name": "TLS_EXT_EC_POINT_FORMATS", "signature": "#define TLS_EXT_EC_POINT_FORMATS"}, {"kind": "macro", "line": 43, "name": "TLS_EXT_SIGNATURE_ALGS", "signature": "#define TLS_EXT_SIGNATURE_ALGS"}, {"kind": "macro", "line": 46, "name": "TLS_ALERT_LEVEL_WARNING", "signature": "#define TLS_ALERT_LEVEL_WARNING"}, {"kind": "macro", "line": 47, "name": "TLS_ALERT_LEVEL_FATAL", "signature": "#define TLS_ALERT_LEVEL_FATAL"}, {"kind": "macro", "line": 50, "name": "TLS_HS_TIMEOUT_MS", "signature": "#define TLS_HS_TIMEOUT_MS"}, {"kind": "macro", "line": 51, "name": "TLS_READ_TIMEOUT_MS", "signature": "#define TLS_READ_TIMEOUT_MS"}, {"kind": "macro", "line": 54, "name": "TLS_HOST_MAX", "signature": "#define TLS_HOST_MAX"}, {"kind": "macro", "line": 57, "name": "TLS_CHAIN_MAX", "signature": "#define TLS_CHAIN_MAX"}, {"kind": "macro", "line": 58, "name": "TLS_CERT_MAX", "signature": "#define TLS_CERT_MAX"}, {"kind": "macro", "line": 62, "name": "TLS_BN_4096_WORDS", "signature": "#define TLS_BN_4096_WORDS"}, {"kind": "macro", "line": 63, "name": "TLS_BN_384_WORDS", "signature": "#define TLS_BN_384_WORDS"}, {"kind": "macro", "line": 68, "name": "TLS_ROOT_COUNT", "signature": "#define TLS_ROOT_COUNT"}]}, {"doc": "Portability shim between the MiniOS kernel and the host-side test", "id": "headers/tls_port.h", "kind": "module", "label": "tls_port.h", "language": "h", "sha256": "14c905896a8ab332", "symbol_count": 49, "symbols": [{"kind": "function", "line": 40, "name": "tls_now_days", "signature": "static inline long tls_now_days(void)"}, {"kind": "function", "line": 44, "name": "tls_random", "signature": "static inline void tls_random(unsigned char *out, unsigned len)"}, {"kind": "function", "line": 29, "name": "these", "signature": "* of these (tls_test.c). */ extern int tls_test_send(int fd, const char *buf, int len);"}, {"kind": "function", "line": 31, "name": "tls_test_recv", "signature": "extern int tls_test_recv(int fd, char *buf, int len);"}, {"kind": "function", "line": 32, "name": "tls_test_recv_timeout", "signature": "extern int tls_test_recv_timeout(int fd, char *buf, int len, unsigned long ms);"}, {"kind": "function", "line": 33, "name": "tls_test_close", "signature": "extern void tls_test_close(int fd);"}, {"kind": "function", "line": 62, "name": "sockets", "signature": "* sockets (glibc maps socket/connect/send/recv/poll onto the MiniOS * Linux ABI numbers the kernel implements);"}, {"kind": "function", "line": 64, "name": "gettimeofday", "signature": "* gettimeofday(96) and entropy from /dev/urandom with a time/pid * fallback. Session slots are indexed by raw OS fd, so TLS_FD_MAX * covers both the MiniOS socket range (100+) and host small fds. */ #"}, {"kind": "function", "line": 82, "name": "tls_u_recv", "signature": "int tls_u_recv(int fd, char *buf, int len);"}, {"kind": "function", "line": 83, "name": "tls_u_recv_timeout", "signature": "int tls_u_recv_timeout(int fd, char *buf, int len, unsigned long ms);"}, {"kind": "function", "line": 84, "name": "tls_u_close", "signature": "void tls_u_close(int fd);"}, {"kind": "function", "line": 95, "name": "syscall", "signature": "* the MiniOS DNS syscall (200, invoked sig-0-safe). 0 on success. */ int tls_u_resolve(const char *host, unsigned *ip_out);"}, {"kind": "macro", "line": 2, "name": "TLS_PORT_H", "signature": "#define TLS_PORT_H"}, {"kind": "macro", "line": 18, "name": "TLS_FD_MAX", "signature": "#define TLS_FD_MAX"}, {"kind": "macro", "line": 20, "name": "TLS_PRINTF", "signature": "#define TLS_PRINTF"}, {"kind": "macro", "line": 21, "name": "TLS_MALLOC", "signature": "#define TLS_MALLOC(n)"}, {"kind": "macro", "line": 22, "name": "TLS_FREE", "signature": "#define TLS_FREE(p)"}, {"kind": "macro", "line": 23, "name": "TLS_MEMCPY", "signature": "#define TLS_MEMCPY"}, {"kind": "macro", "line": 24, "name": "TLS_MEMSET", "signature": "#define TLS_MEMSET"}, {"kind": "macro", "line": 25, "name": "TLS_MEMCMP", "signature": "#define TLS_MEMCMP"}, {"kind": "macro", "line": 26, "name": "TLS_STRLEN", "signature": "#define TLS_STRLEN"}, {"kind": "macro", "line": 35, "name": "TLS_SEND", "signature": "#define TLS_SEND"}, {"kind": "macro", "line": 36, "name": "TLS_RECV", "signature": "#define TLS_RECV"}, {"kind": "macro", "line": 37, "name": "TLS_RECV_TIMEOUT", "signature": "#define TLS_RECV_TIMEOUT"}, {"kind": "macro", "line": 38, "name": "TLS_CLOSE", "signature": "#define TLS_CLOSE"}, {"kind": "macro", "line": 71, "name": "TLS_FD_MAX", "signature": "#define TLS_FD_MAX"}, {"kind": "macro", "line": 73, "name": "TLS_PRINTF", "signature": "#define TLS_PRINTF"}, {"kind": "macro", "line": 74, "name": "TLS_MALLOC", "signature": "#define TLS_MALLOC(n)"}, {"kind": "macro", "line": 75, "name": "TLS_FREE", "signature": "#define TLS_FREE(p)"}, {"kind": "macro", "line": 76, "name": "TLS_MEMCPY", "signature": "#define TLS_MEMCPY"}, {"kind": "macro", "line": 77, "name": "TLS_MEMSET", "signature": "#define TLS_MEMSET"}, {"kind": "macro", "line": 78, "name": "TLS_MEMCMP", "signature": "#define TLS_MEMCMP"}, {"kind": "macro", "line": 79, "name": "TLS_STRLEN", "signature": "#define TLS_STRLEN"}, {"kind": "macro", "line": 86, "name": "TLS_SEND", "signature": "#define TLS_SEND"}, {"kind": "macro", "line": 87, "name": "TLS_RECV", "signature": "#define TLS_RECV"}, {"kind": "macro", "line": 88, "name": "TLS_RECV_TIMEOUT", "signature": "#define TLS_RECV_TIMEOUT"}, {"kind": "macro", "line": 89, "name": "TLS_CLOSE", "signature": "#define TLS_CLOSE"}, {"kind": "macro", "line": 103, "name": "TLS_PRINTF", "signature": "#define TLS_PRINTF"}, {"kind": "macro", "line": 104, "name": "TLS_MALLOC", "signature": "#define TLS_MALLOC(n)"}, {"kind": "macro", "line": 105, "name": "TLS_FREE", "signature": "#define TLS_FREE(p)"}, {"kind": "macro", "line": 106, "name": "TLS_MEMCPY", "signature": "#define TLS_MEMCPY"}, {"kind": "macro", "line": 107, "name": "TLS_MEMSET", "signature": "#define TLS_MEMSET"}, {"kind": "macro", "line": 108, "name": "TLS_MEMCMP", "signature": "#define TLS_MEMCMP"}, {"kind": "macro", "line": 109, "name": "TLS_STRLEN", "signature": "#define TLS_STRLEN"}, {"kind": "macro", "line": 111, "name": "TLS_SEND", "signature": "#define TLS_SEND"}, {"kind": "macro", "line": 112, "name": "TLS_RECV", "signature": "#define TLS_RECV"}, {"kind": "macro", "line": 113, "name": "TLS_RECV_TIMEOUT", "signature": "#define TLS_RECV_TIMEOUT"}, {"kind": "macro", "line": 114, "name": "TLS_CLOSE", "signature": "#define TLS_CLOSE"}, {"kind": "macro", "line": 115, "name": "TLS_FD_MAX", "signature": "#define TLS_FD_MAX"}]}, {"doc": "tls_roots.h - embedded CA roots (DER), generated by mkroots.sh.", "id": "headers/tls_roots.h", "kind": "module", "label": "tls_roots.h", "language": "h", "sha256": "fff6d33493ca669c", "symbol_count": 0, "symbols": []}, {"doc": "Framebuffer geometry. The boot loader probes VESA BIOS Extensions for a", "id": "headers/vga_fb.h", "kind": "module", "label": "vga_fb.h", "language": "h", "sha256": "814e5402e805e8a1", "symbol_count": 153, "symbols": [{"doc": "Title-bar window controls (minimize, maximize, close). Drawn as a strip of three FONT_W-wide glyph buttons at the right end of any titled window * (terminal, DOOM, Nuklear); the mouse tick hit-tests them before drag. #define WM_BTN_W       FONT_W #define WM_BTN_H       FONT_H #define WM_BTN_PAD     2 #define WM_BTN_MIN     1 #define WM_BTN_MAX     2 #define WM_BTN_CLOSE   3 /* Terminal geometry (set by vga_fb layout engine) extern int term_x, term_y, term_cols, term_rows; /* ---- Mouse state (updated by IRQ12 handler in sched.c) ----", "kind": "struct", "line": 159, "name": "mouse_state_t"}, {"doc": "Bytes per framebuffer pixel derived from fb_bpp (1 for 8-bit, 3 for 24, * 4 for 32).", "kind": "function", "line": 30, "name": "fb_bytes_per_pixel", "signature": "int fb_bytes_per_pixel(void);"}, {"doc": "Read one desktop pixel as packed 0x00RRGGBB (palette-resolved in 8-bit mode, native in true color). Backstop for `gfx pixel`/`gfx shot`, which * must report colors instead of DAC indices once the DAC is gone.", "kind": "function", "line": 34, "name": "vga_fb_read_rgb", "signature": "unsigned long vga_fb_read_rgb(int x, int y);"}, {"doc": "Store the graphics program's 768-byte palette (SYS_PALETTE). In 8-bit mode it is also programmed into the DAC; in true color it is only kept so the * DOOM/Nuklear blits can expand their indexed back-buffers to RGB.", "kind": "function", "line": 38, "name": "vga_fb_set_gfx_palette", "signature": "void vga_fb_set_gfx_palette(const unsigned char *pal);"}, {"kind": "function", "line": 40, "name": "vga_fb_boot_config", "signature": "void vga_fb_boot_config(void);"}, {"kind": "function", "line": 44, "name": "SYS_DOOM_FRAME", "signature": "* and calls SYS_DOOM_FRAME (211) to have the kernel composite it onto the * desktop at its native resolution, so the shell window stays visible. */ #define DOOM_W MINIOS_DOOM_W #define DOOM_H MINIOS_D"}, {"kind": "function", "line": 63, "name": "SYS_NK_FRAME", "signature": "* SYS_NK_FRAME (220);"}, {"doc": "RGB companion buffer (3 bytes per pixel, R,G,B order, NK_W x NK_H). Mapped by mm_setup_protections like the indexed buffers; presented with * GFX_PRESENT + MINIOS_GFX_BUF_NK_RGB through vga_fb_blit_nk_rgb_window. define NK_RGB_ADDR   MINIOS_NK_RGB_ADDR define NK_RGB_BYTES  MINIOS_NK_RGB_BYTES", "kind": "function", "line": 75, "name": "vga_fb_blit_nk_window", "signature": "void vga_fb_blit_nk_window(void);"}, {"kind": "function", "line": 76, "name": "vga_fb_blit_nk_rgb_window", "signature": "void vga_fb_blit_nk_rgb_window(void);"}, {"kind": "function", "line": 99, "name": "below", "signature": "* file below (800x600 RGB PNG on the ramdisk, produced by * tools/gen_desktop_pngs.py) is decoded once per boot via stbi_load_file, * stretched to the framebuffer and mapped to a fixed 6x6x6 websafe c"}, {"doc": "A scrollback line can be up to the widest terminal (TERM_MAX_COLS), and a long logical line that wrapped across several screen rows is stored whole, * so the ring must not truncate it or a re-rendered line would be cut short. #define SB_MAX_LINES 256 #define SB_LINE_MAX  TERM_MAX_COLS /* ---- Public API ----", "kind": "function", "line": 177, "name": "vga_fb_init", "signature": "void vga_fb_init(void);"}, {"doc": "Feed one completed console line into the terminal history (the text-mode console has no other history) and page that history by one screen (dir -1 up, +1 down). The page keys drive the paging when the * framebuffer terminal is up.", "kind": "function", "line": 182, "name": "vga_fb_term_ring_init", "signature": "void vga_fb_term_ring_init(void);"}, {"kind": "function", "line": 183, "name": "vga_fb_term_feed", "signature": "void vga_fb_term_feed(const char *line, int len);"}, {"kind": "function", "line": 184, "name": "vga_fb_history_page", "signature": "void vga_fb_history_page(int dir);"}, {"kind": "function", "line": 185, "name": "vga_fb_clear", "signature": "void vga_fb_clear(void);"}, {"kind": "function", "line": 186, "name": "vga_fb_pixel", "signature": "void vga_fb_pixel(int x, int y, uint8_t color);"}, {"kind": "function", "line": 187, "name": "vga_fb_rect", "signature": "void vga_fb_rect(int x, int y, int w, int h, uint8_t color);"}, {"doc": "Feed one completed console line into the terminal history (the text-mode console has no other history) and page that history by one screen (dir -1 up, +1 down). The page keys drive the paging when the * framebuffer terminal is up. void     vga_fb_term_ring_init(void); void     vga_fb_term_feed(const char *line, int len); void     vga_fb_history_page(int dir); void     vga_fb_clear(void); void     vga_fb_pixel(int x, int y, uint8_t color); void     vga_fb_rect(int x, int y, int w, int h, uint8_t color); /* Direct RGB primitives: full depth in 32/24-bit, quantized in 8-bit.", "kind": "function", "line": 189, "name": "vga_fb_pixel_rgb", "signature": "void vga_fb_pixel_rgb(int x, int y, uint8_t r, uint8_t g, uint8_t b);"}, {"kind": "function", "line": 190, "name": "vga_fb_rect_rgb", "signature": "void vga_fb_rect_rgb(int x, int y, int w, int h, uint8_t r, uint8_t g, uint8_t b);"}, {"kind": "function", "line": 191, "name": "vga_fb_char", "signature": "void vga_fb_char(int col, int row, char c, uint8_t fg, uint8_t bg);"}, {"kind": "function", "line": 192, "name": "vga_fb_str", "signature": "void vga_fb_str(int col, int row, const char *s, uint8_t fg, uint8_t bg);"}, {"kind": "function", "line": 193, "name": "vga_fb_putc_term", "signature": "void vga_fb_putc_term(char c);"}, {"kind": "function", "line": 194, "name": "vga_fb_puts_term", "signature": "void vga_fb_puts_term(const char *s);"}, {"kind": "function", "line": 195, "name": "term_clear", "signature": "void term_clear(void);"}, {"kind": "function", "line": 196, "name": "vga_fb_text_cursor", "signature": "void vga_fb_text_cursor(int col);"}, {"kind": "function", "line": 197, "name": "vga_fb_hide_text_cursor", "signature": "void vga_fb_hide_text_cursor(void);"}, {"doc": "Packed-pixel primitives (0x00RRGGBB): the cursor layer draws through * these so it never touches raw framebuffer memory itself.", "kind": "function", "line": 200, "name": "fb_read_packed", "signature": "unsigned long fb_read_packed(int x, int y);"}, {"kind": "function", "line": 201, "name": "fb_write_packed", "signature": "void fb_write_packed(int x, int y, unsigned long rgb);"}, {"kind": "function", "line": 202, "name": "vga_fb_draw_desktop", "signature": "void vga_fb_draw_desktop(void);"}, {"kind": "function", "line": 203, "name": "vga_fb_toggle_fullscreen", "signature": "void vga_fb_toggle_fullscreen(void);"}, {"kind": "function", "line": 204, "name": "vga_fb_move_terminal", "signature": "void vga_fb_move_terminal(int dx, int dy);"}, {"kind": "function", "line": 205, "name": "vga_fb_snap_window", "signature": "void vga_fb_snap_window(int zone);"}, {"kind": "function", "line": 206, "name": "vga_fb_resize", "signature": "void vga_fb_resize(int dcols, int drows);"}, {"kind": "function", "line": 207, "name": "vga_fb_reset_default", "signature": "void vga_fb_reset_default(void);"}, {"kind": "function", "line": 208, "name": "vga_fb_toggle_minimize", "signature": "void vga_fb_toggle_minimize(void);"}, {"kind": "function", "line": 209, "name": "vga_fb_is_minimized", "signature": "int vga_fb_is_minimized(void);"}, {"kind": "function", "line": 210, "name": "vga_fb_is_fullscreen", "signature": "int vga_fb_is_fullscreen(void);"}, {"doc": "Graphics window view (headers/wm_gfxview.h owns the math). Fullscreen scales the app to the whole display with the aspect kept and takes the keyboard; hidden minimizes it to its taskbar button while it keeps running. Both glide between frames and return -1 without a program. The origin is the content top-left an app subtracts from SYS_MOUSE coordinates, and map_mouse converts a desktop pointer into the app's * back-buffer space when its view is scaled (1:1 views pass through).", "kind": "function", "line": 218, "name": "vga_fb_gfx_set_fullscreen", "signature": "int vga_fb_gfx_set_fullscreen(int on);"}, {"kind": "function", "line": 219, "name": "vga_fb_gfx_set_hidden", "signature": "int vga_fb_gfx_set_hidden(int hide);"}, {"kind": "function", "line": 220, "name": "vga_fb_gfx_view_name", "signature": "const char *vga_fb_gfx_view_name(void);"}, {"kind": "function", "line": 221, "name": "vga_fb_gfx_origin", "signature": "void vga_fb_gfx_origin(int *x, int *y);"}, {"kind": "function", "line": 222, "name": "vga_fb_gfx_map_mouse", "signature": "void vga_fb_gfx_map_mouse(int *x, int *y);"}, {"doc": "Graphics window view (headers/wm_gfxview.h owns the math). Fullscreen scales the app to the whole display with the aspect kept and takes the keyboard; hidden minimizes it to its taskbar button while it keeps running. Both glide between frames and return -1 without a program. The origin is the content top-left an app subtracts from SYS_MOUSE coordinates, and map_mouse converts a desktop pointer into the app's * back-buffer space when its view is scaled (1:1 views pass through). int      vga_fb_gfx_set_fullscreen(int on); int      vga_fb_gfx_set_hidden(int hide); const char *vga_fb_gfx_view_name(void); void     vga_fb_gfx_origin(int *x, int *y); void     vga_fb_gfx_map_mouse(int *x, int *y); /* Row fast paths of the packed-pixel primitives (clipped once per row).", "kind": "function", "line": 224, "name": "fb_write_row_packed", "signature": "void fb_write_row_packed(int x, int y, const unsigned int *src, int n);"}, {"kind": "function", "line": 225, "name": "fb_read_row_packed", "signature": "void fb_read_row_packed(int x, int y, unsigned int *dst, int n);"}, {"kind": "function", "line": 226, "name": "vga_fb_close_active", "signature": "int vga_fb_close_active(void);"}, {"doc": "Multi-window manager: Alt-Tab focus cycle, Super-Tab tiling, second * terminal. Focus ids 0/1 = terminals, 2 = graphics window. define WM_FOCUS_GFX 2", "kind": "function", "line": 230, "name": "vga_fb_focus_next", "signature": "void vga_fb_focus_next(void);"}, {"kind": "function", "line": 231, "name": "vga_fb_focus_id", "signature": "int vga_fb_focus_id(int id);"}, {"kind": "function", "line": 232, "name": "vga_fb_focus_get", "signature": "int vga_fb_focus_get(void);"}, {"doc": "Focus event bus (wm_notify.h): last move for serial-observable state, * plus programmatic reporting for focus moves owned by other units.", "kind": "function", "line": 235, "name": "vga_fb_focus_event", "signature": "const wm_notify_event_t *vga_fb_focus_event(void);"}, {"kind": "function", "line": 236, "name": "vga_fb_focus_report", "signature": "void vga_fb_focus_report(int before, int source);"}, {"kind": "function", "line": 237, "name": "vga_fb_theme_name", "signature": "int vga_fb_theme_name(char *dst, int cap);"}, {"doc": "PS/2 ownership for pid: 1 when pid may consume the keyboard port. One keyboard feeds every window, so the focused window owns it: a background gfx job reads only while the gfx window is focused, the shell only while a terminal is. A legacy foreground program owns everything (its shell is * blocked, so there is nobody to steal from). Serial stays shell-only.", "kind": "function", "line": 243, "name": "vga_fb_ps2_owner", "signature": "int vga_fb_ps2_owner(int pid);"}, {"kind": "function", "line": 244, "name": "vga_fb_nterms_get", "signature": "int vga_fb_nterms_get(void);"}, {"kind": "function", "line": 245, "name": "vga_fb_term_split", "signature": "int vga_fb_term_split(void);"}, {"kind": "function", "line": 246, "name": "vga_fb_term_close_focused", "signature": "int vga_fb_term_close_focused(void);"}, {"kind": "function", "line": 247, "name": "vga_fb_tile_all", "signature": "void vga_fb_tile_all(void);"}, {"kind": "function", "line": 248, "name": "vga_fb_layout_set", "signature": "int vga_fb_layout_set(int mode);"}, {"kind": "function", "line": 249, "name": "vga_fb_layout_cycle", "signature": "void vga_fb_layout_cycle(void);"}, {"kind": "function", "line": 250, "name": "vga_fb_layout_get", "signature": "int vga_fb_layout_get(void);"}, {"kind": "function", "line": 251, "name": "vga_fb_layout_name", "signature": "const char *vga_fb_layout_name(void);"}, {"kind": "function", "line": 252, "name": "vga_fb_list_windows", "signature": "void vga_fb_list_windows(void);"}, {"kind": "function", "line": 253, "name": "wm_close_pending", "signature": "int wm_close_pending(void);"}, {"kind": "function", "line": 254, "name": "wm_clear_close", "signature": "void wm_clear_close(void);"}, {"kind": "function", "line": 255, "name": "wm_gfx_mode_active", "signature": "int wm_gfx_mode_active(void);"}, {"kind": "function", "line": 256, "name": "vga_fb_mouse_tick", "signature": "void vga_fb_mouse_tick(void);"}, {"doc": "Desktop tick for a kernel wait loop (foreground process wait, mrun): runs vga_fb_mouse_tick at DESKTOP_TICK_INTERVAL unless the exec frame's * timer ISR already owns it.", "kind": "function", "line": 260, "name": "vga_fb_wait_tick", "signature": "void vga_fb_wait_tick(void);"}, {"kind": "function", "line": 261, "name": "vga_fb_mouse_init", "signature": "void vga_fb_mouse_init(void);"}, {"doc": "Dock click bounce (Mac style): arm count and strip repaints while live, * for the serial-observable proof (`wm state` reports both).", "kind": "function", "line": 264, "name": "dock_bounce_counts", "signature": "void dock_bounce_counts(unsigned long *kicks, unsigned long *paints);"}, {"kind": "function", "line": 265, "name": "dock_click_count", "signature": "void dock_click_count(unsigned long *edges);"}, {"kind": "function", "line": 266, "name": "dock_pending_active", "signature": "int dock_pending_active(void);"}, {"kind": "function", "line": 270, "name": "pixels", "signature": "* are heap buffers of packed pixels (fb_read_packed order), 0 on OOM or a * degenerate rect. A disabled effect or a failed snapshot leaves the new * frame in place, so every entry fails closed to a pl"}, {"kind": "function", "line": 274, "name": "vga_fx_enabled", "signature": "int vga_fx_enabled(void);"}, {"kind": "function", "line": 275, "name": "vga_fx_snap_rect", "signature": "unsigned int *vga_fx_snap_rect(int x, int y, int w, int h);"}, {"kind": "function", "line": 276, "name": "vga_fx_restore_rect", "signature": "void vga_fx_restore_rect(int x, int y, int w, int h, const unsigned int *buf);"}, {"kind": "function", "line": 277, "name": "vga_fx_free", "signature": "void vga_fx_free(unsigned int *buf);"}, {"kind": "function", "line": 278, "name": "vga_fx_melt_rect", "signature": "void vga_fx_melt_rect(int x, int y, int w, int h, const unsigned int *oldb, const unsigned int *newb);"}, {"kind": "function", "line": 280, "name": "vga_fx_melt_from_black", "signature": "void vga_fx_melt_from_black(int x, int y, int w, int h, const unsigned int *newb);"}, {"doc": "Graphics-mode pointer. SYS_VGA_MODE toggles vga_fb_set_gfx_mode; while a ring-3 graphics program owns the display the kernel idle loop (and with it vga_fb_mouse_tick) never runs, so the frame-composite functions restore the previous frame's pointer before the blit and redraw it after, keeping the * desktop pointer visible over the whole display without leaving trails.", "kind": "function", "line": 291, "name": "vga_fb_set_gfx_mode", "signature": "void vga_fb_set_gfx_mode(int on);"}, {"doc": "high-resolution linear framebuffer (32-bit true color first, then the 8-bit-palette modes) and records width, height, pitch, physical base and bits per pixel in the fixed VBE_INFO_ADDR struct; vga_fb_boot_config loads them into the globals below before the kernel maps the framebuffer. Without VBE the values are the Mode 13h defaults (320x200x8, phys 0xA0000). In a true-color mode the kernel's palette-index drawing is expanded to RGB on write, so desktop, icons and wallpaper are no longer quantized to the 256-entry VGA DAC; in 8-bit mode the DAC path is used unchanged. FB_ADDR is the fixed virtual address in the user window that both the kernel desktop and graphics programs write through. It sits in the reserved tail above DOOM_BACKBUF_ADDR (which is also the brk cap), so a program's heap can never grow over the framebuffer. All three pinned addresses derive from * progs/minios_abi.h (single source of truth for the kernel-ABI layout). define FB_ADDR    ((volatile uint8_t *)MINIOS_FB_ADDR)", "kind": "variable", "line": 23, "name": "fb_width", "signature": "extern int fb_width;"}, {"kind": "variable", "line": 24, "name": "fb_height", "signature": "extern int fb_height;"}, {"kind": "variable", "line": 25, "name": "fb_pitch", "signature": "extern int fb_pitch;"}, {"kind": "variable", "line": 26, "name": "fb_bpp", "signature": "extern int fb_bpp;"}, {"kind": "variable", "line": 27, "name": "fb_phys_base", "signature": "extern unsigned long fb_phys_base;"}, {"kind": "variable", "line": 50, "name": "gfx_win_title", "signature": "extern const char *gfx_win_title;"}, {"doc": "Number of frames a ring-3 graphics program (DOOM, Quake 2, Nuklear) has composited through SYS_DOOM_FRAME / SYS_NK_FRAME since boot. The shell's `gfx frames` builtin reports it over the serial console, so the BDD suite can prove a game actually rendered frames -- not merely launched -- by * running a demo and checking the counter climbed.", "kind": "variable", "line": 59, "name": "gfx_frames_composited", "signature": "extern unsigned long gfx_frames_composited;"}, {"doc": "Window origin of the last Nuklear composite, so SYS_NK_FRAME can report * where the UI landed for mouse-coordinate translation.", "kind": "variable", "line": 79, "name": "nk_win_y", "signature": "extern int nk_win_x, nk_win_y;"}, {"doc": "Title-bar window controls (minimize, maximize, close). Drawn as a strip of three FONT_W-wide glyph buttons at the right end of any titled window * (terminal, DOOM, Nuklear); the mouse tick hit-tests them before drag. #define WM_BTN_W       FONT_W #define WM_BTN_H       FONT_H #define WM_BTN_PAD     2 #define WM_BTN_MIN     1 #define WM_BTN_MAX     2 #define WM_BTN_CLOSE   3 /* Terminal geometry (set by vga_fb layout engine)", "kind": "variable", "line": 156, "name": "term_rows", "signature": "extern int term_x, term_y, term_cols, term_rows;"}, {"kind": "variable", "line": 167, "name": "mouse_state", "signature": "extern mouse_state_t mouse_state;"}, {"doc": "Melt transitions completed since boot (boot melt counts, so a fresh shell already reports 1 with the effect on). Serial-observable proof the melts * ran, in the same spirit as `gfx frames`.", "kind": "variable", "line": 284, "name": "fx_melts_completed", "signature": "extern unsigned long fx_melts_completed;"}, {"kind": "variable", "line": 293, "name": "vga_fb_active", "signature": "extern int vga_fb_active;"}, {"kind": "macro", "line": 2, "name": "VGA_FB_H", "signature": "#define VGA_FB_H"}, {"kind": "macro", "line": 22, "name": "FB_ADDR", "signature": "#define FB_ADDR"}, {"kind": "macro", "line": 46, "name": "DOOM_W", "signature": "#define DOOM_W"}, {"kind": "macro", "line": 47, "name": "DOOM_H", "signature": "#define DOOM_H"}, {"kind": "macro", "line": 48, "name": "DOOM_BACKBUF_ADDR", "signature": "#define DOOM_BACKBUF_ADDR"}, {"kind": "macro", "line": 52, "name": "GFX_TITLE_DEFAULT", "signature": "#define GFX_TITLE_DEFAULT"}, {"kind": "macro", "line": 67, "name": "NK_W", "signature": "#define NK_W"}, {"kind": "macro", "line": 68, "name": "NK_H", "signature": "#define NK_H"}, {"kind": "macro", "line": 69, "name": "NK_BACKBUF_ADDR", "signature": "#define NK_BACKBUF_ADDR"}, {"kind": "macro", "line": 73, "name": "NK_RGB_ADDR", "signature": "#define NK_RGB_ADDR"}, {"kind": "macro", "line": 74, "name": "NK_RGB_BYTES", "signature": "#define NK_RGB_BYTES"}, {"kind": "macro", "line": 82, "name": "COL_BLACK", "signature": "#define COL_BLACK"}, {"kind": "macro", "line": 83, "name": "COL_BG", "signature": "#define COL_BG"}, {"kind": "macro", "line": 84, "name": "COL_TASKBAR", "signature": "#define COL_TASKBAR"}, {"kind": "macro", "line": 85, "name": "COL_TASKBAR_TXT", "signature": "#define COL_TASKBAR_TXT"}, {"kind": "macro", "line": 86, "name": "COL_TITLEBAR", "signature": "#define COL_TITLEBAR"}, {"kind": "macro", "line": 87, "name": "COL_TITLE_TXT", "signature": "#define COL_TITLE_TXT"}, {"kind": "macro", "line": 88, "name": "COL_TERMINAL", "signature": "#define COL_TERMINAL"}, {"kind": "macro", "line": 89, "name": "COL_TERM_TXT", "signature": "#define COL_TERM_TXT"}, {"kind": "macro", "line": 90, "name": "COL_TERM_CUR", "signature": "#define COL_TERM_CUR"}, {"kind": "macro", "line": 91, "name": "COL_BORDER", "signature": "#define COL_BORDER"}, {"kind": "macro", "line": 92, "name": "COL_WHITE", "signature": "#define COL_WHITE"}, {"kind": "macro", "line": 93, "name": "COL_SHADOW", "signature": "#define COL_SHADOW"}, {"kind": "macro", "line": 94, "name": "COL_HIGHLIGHT", "signature": "#define COL_HIGHLIGHT"}, {"kind": "macro", "line": 95, "name": "COL_SCROLLBAR", "signature": "#define COL_SCROLLBAR"}, {"kind": "macro", "line": 96, "name": "COL_SCROLL_THUMB", "signature": "#define COL_SCROLL_THUMB"}, {"kind": "macro", "line": 103, "name": "WALLPAPER_PATH", "signature": "#define WALLPAPER_PATH"}, {"kind": "macro", "line": 104, "name": "WALL_PAL_BASE", "signature": "#define WALL_PAL_BASE"}, {"kind": "macro", "line": 105, "name": "WALL_PAL_SIZE", "signature": "#define WALL_PAL_SIZE"}, {"kind": "macro", "line": 107, "name": "FONT_W", "signature": "#define FONT_W"}, {"kind": "macro", "line": 108, "name": "FONT_H", "signature": "#define FONT_H"}, {"kind": "macro", "line": 113, "name": "TERM_MAX_COLS", "signature": "#define TERM_MAX_COLS"}, {"kind": "macro", "line": 114, "name": "TERM_MAX_ROWS", "signature": "#define TERM_MAX_ROWS"}, {"kind": "macro", "line": 117, "name": "TASKBAR_H", "signature": "#define TASKBAR_H"}, {"kind": "macro", "line": 118, "name": "TASKBAR_PAD", "signature": "#define TASKBAR_PAD"}, {"kind": "macro", "line": 119, "name": "TASKBAR_CLOCK_CH", "signature": "#define TASKBAR_CLOCK_CH"}, {"kind": "macro", "line": 120, "name": "TASKBAR_VOL_CH", "signature": "#define TASKBAR_VOL_CH"}, {"kind": "macro", "line": 121, "name": "TASKBAR_VOL_STEP", "signature": "#define TASKBAR_VOL_STEP"}, {"kind": "macro", "line": 122, "name": "TASKBAR_ICON_W", "signature": "#define TASKBAR_ICON_W"}, {"kind": "macro", "line": 123, "name": "TASKBAR_BTN_W", "signature": "#define TASKBAR_BTN_W"}, {"kind": "macro", "line": 125, "name": "TASKBAR_KBD_CH", "signature": "#define TASKBAR_KBD_CH"}, {"kind": "macro", "line": 126, "name": "TASKBAR_KBD_W", "signature": "#define TASKBAR_KBD_W"}, {"kind": "macro", "line": 128, "name": "TASKBAR_THEME_CH", "signature": "#define TASKBAR_THEME_CH"}, {"kind": "macro", "line": 129, "name": "TASKBAR_THEME_W", "signature": "#define TASKBAR_THEME_W"}, {"kind": "macro", "line": 132, "name": "TILING_LEFT", "signature": "#define TILING_LEFT"}, {"kind": "macro", "line": 133, "name": "TILING_RIGHT", "signature": "#define TILING_RIGHT"}, {"kind": "macro", "line": 134, "name": "TILING_TOP", "signature": "#define TILING_TOP"}, {"kind": "macro", "line": 135, "name": "TILING_BOTTOM", "signature": "#define TILING_BOTTOM"}, {"kind": "macro", "line": 136, "name": "TILING_TOP_LEFT", "signature": "#define TILING_TOP_LEFT"}, {"kind": "macro", "line": 137, "name": "TILING_TOP_RIGHT", "signature": "#define TILING_TOP_RIGHT"}, {"kind": "macro", "line": 138, "name": "TILING_BOTTOM_LEFT", "signature": "#define TILING_BOTTOM_LEFT"}, {"kind": "macro", "line": 139, "name": "TILING_BOTTOM_RIGHT", "signature": "#define TILING_BOTTOM_RIGHT"}, {"kind": "macro", "line": 142, "name": "SCROLLBAR_W", "signature": "#define SCROLLBAR_W"}, {"kind": "macro", "line": 143, "name": "SCROLLBAR_PAD", "signature": "#define SCROLLBAR_PAD"}, {"kind": "macro", "line": 148, "name": "WM_BTN_W", "signature": "#define WM_BTN_W"}, {"kind": "macro", "line": 149, "name": "WM_BTN_H", "signature": "#define WM_BTN_H"}, {"kind": "macro", "line": 150, "name": "WM_BTN_PAD", "signature": "#define WM_BTN_PAD"}, {"kind": "macro", "line": 151, "name": "WM_BTN_MIN", "signature": "#define WM_BTN_MIN"}, {"kind": "macro", "line": 152, "name": "WM_BTN_MAX", "signature": "#define WM_BTN_MAX"}, {"kind": "macro", "line": 153, "name": "WM_BTN_CLOSE", "signature": "#define WM_BTN_CLOSE"}, {"kind": "macro", "line": 173, "name": "SB_MAX_LINES", "signature": "#define SB_MAX_LINES"}, {"kind": "macro", "line": 174, "name": "SB_LINE_MAX", "signature": "#define SB_LINE_MAX"}, {"kind": "macro", "line": 229, "name": "WM_FOCUS_GFX", "signature": "#define WM_FOCUS_GFX"}]}, {"doc": "Docstring: DOOM-melt desktop effect contract for MiniOS.", "id": "headers/vga_fx.h", "kind": "module", "label": "vga_fx.h", "language": "h", "sha256": "78d399c900c80d46", "symbol_count": 9, "symbols": [{"doc": "Single-file header-only contract owning the melt transition logic the desktop plays when windows appear or disappear and on first boot. The algorithm mirrors progs/doomgeneric/f_wipe.c wipe_initMelt/wipe_doMelt: per-column fronts start with staggered negative delays, then scroll the new frame down over the old one column by column. Pure integer logic over caller-owned arrays, so it stays host-testable; the kernel keeps owning the framebuffer, heap and pacing and only consumes the fronts. All functions fail closed on degenerate input.  #ifndef VGA_FX_H #define VGA_FX_H /** Docstring: Centralized effect configuration, no magic numbers.", "kind": "struct", "line": 16, "name": "vga_fx_config_t"}, {"doc": "typedef struct { int step_px; int frame_ms; int max_delay; unsigned long seed; } vga_fx_config_t; /** Docstring: Default melt pacing: 8 px per frame, 8 ms per frame. #define VGA_FX_CONFIG_DEFAULT { 8, 8, 16, 0x1F2E3D4CUL } /** Docstring: Widest transition the column array can describe. #define VGA_FX_COLS_MAX 1024 /** Docstring: One xorshift32 step, the melt's deterministic PRNG.", "kind": "function", "line": 30, "name": "vga_fx_rand", "signature": "static inline unsigned long vga_fx_rand(unsigned long *s)"}, {"doc": "Docstring: Seed consecutive column fronts with staggered delays. Mirrors f_wipe.c: first column waits a random 0..15 frames, each next * column drifts by -1..+1, clamped at zero, -16 repaired to -15.", "kind": "function", "line": 47, "name": "vga_fx_init_cols", "signature": "static inline int vga_fx_init_cols(const vga_fx_config_t *cfg, int *cols, int w)"}, {"doc": "Docstring: Advance every column front one melt frame. * Returns 1 when every front reached the rect bottom, 0 otherwise.", "kind": "function", "line": 71, "name": "vga_fx_advance", "signature": "static inline int vga_fx_advance(const vga_fx_config_t *cfg, int *cols, int w, int h)"}, {"doc": "done = 0; } else if (cols[i] < h) { int dy = (cols[i] < 16) ? cols[i] + 1 : step; cols[i] += dy; if (cols[i] > h) { cols[i] = h; } done = 0; } } return done; } /** Docstring: Rows [0, front) of one column already show the new frame.", "kind": "function", "line": 97, "name": "vga_fx_front", "signature": "static inline int vga_fx_front(int col_y, int h)"}, {"doc": "/** Docstring: Rows [0, front) of one column already show the new frame. static inline int vga_fx_front(int col_y, int h) { if (col_y < 0) { return 0; } if (col_y > h) { return h; } return col_y; } /** Docstring: Clamp a transition rect inside the framebuffer.", "kind": "function", "line": 109, "name": "vga_fx_clamp_rect", "signature": "static inline int vga_fx_clamp_rect(int *x, int *y, int *w, int *h, int fb_w, int fb_h)"}, {"kind": "macro", "line": 13, "name": "VGA_FX_H", "signature": "#define VGA_FX_H"}, {"kind": "macro", "line": 24, "name": "VGA_FX_CONFIG_DEFAULT", "signature": "#define VGA_FX_CONFIG_DEFAULT"}, {"kind": "macro", "line": 27, "name": "VGA_FX_COLS_MAX", "signature": "#define VGA_FX_COLS_MAX"}]}, {"id": "headers/vma.h", "kind": "module", "label": "vma.h", "language": "h", "sha256": "44fedf2c28372621", "symbol_count": 26, "symbols": [{"kind": "struct", "line": 21, "name": "vma_node"}, {"doc": "Per-process VMA context (multitask foundation): every non-CLONE_VM process owns its live/free trees plus a private node pool, so two concurrent jobs never corrupt each other's mmap bookkeeping the way the old single global tree did (the DOOM-in-isolation #GP came from exactly that: a fresh window over a stale shared tree). CLONE_VM threads share their parent's context pointer. The kernel-global VMA_NIL/roots/pool below are a *view* onto the running process's context, rebound by vma_ctx_bind on every brk/mmap-view switch; the legacy single-window path keeps using the static vma_legacy context, so its behavior is byte-for-byte unchanged. Pools live on the kernel * heap (a static per-proc pool would blow the USER_LOAD_BASE budget).", "kind": "struct", "line": 44, "name": "vma_ctx_t"}, {"doc": "Opaque snapshot of the bound view (all globals vma_ctx_bind swaps, including the MRU). The ld.so child-window dance saves the spawner view, binds the child, and restores exactly, so a stale MRU can * never hand one window's node to another.", "kind": "struct", "line": 76, "name": "vma_view_t"}, {"doc": "Replaces the former flat mmap_used/mmap_free arrays with an O(log n) tree.  A single fixed node pool backs the tree for the life of one ring-3 program; both the live and free trees draw from it.  The pool is reset by vma_tree_init on every exec, so a fresh program starts empty.  The current kernel runs a single address space, so the tree is a set of process-wide globals (vma_live_root, vma_free_root, VMA_NIL, vma_pool) rather than a per-process instance.  The SPAWN syscall saves and restores those globals across a child ET_EXEC/DYN execution.  All operations are integer-only and free of kernel dependencies, which lets the tree be exercised host-side by tests/test_vma.c.", "kind": "type_alias", "line": 20, "name": "base", "signature": "typedef struct vma_node { unsigned long base;"}, {"kind": "function", "line": 64, "name": "vma_tree_init", "signature": "void vma_tree_init(void);"}, {"kind": "function", "line": 65, "name": "vma_tree_insert", "signature": "vma_node_t *vma_tree_insert(vma_node_t **root, unsigned long base, unsigned long len);"}, {"kind": "function", "line": 66, "name": "vma_tree_find", "signature": "vma_node_t *vma_tree_find(vma_node_t *root, unsigned long base);"}, {"kind": "function", "line": 67, "name": "vma_tree_find_containing", "signature": "vma_node_t *vma_tree_find_containing(vma_node_t *root, unsigned long va);"}, {"kind": "function", "line": 68, "name": "vma_tree_delete", "signature": "int vma_tree_delete(vma_node_t **root, unsigned long base);"}, {"kind": "function", "line": 69, "name": "vma_ctx_init", "signature": "void vma_ctx_init(vma_ctx_t *c, vma_node_t *pool);"}, {"kind": "function", "line": 70, "name": "vma_ctx_bind", "signature": "void vma_ctx_bind(vma_ctx_t *c);"}, {"kind": "function", "line": 71, "name": "vma_ctx_save", "signature": "void vma_ctx_save(vma_ctx_t *c);"}, {"kind": "function", "line": 86, "name": "vma_view_save", "signature": "void vma_view_save(vma_view_t *v);"}, {"kind": "function", "line": 87, "name": "vma_view_load", "signature": "void vma_view_load(const vma_view_t *v);"}, {"doc": "Heap-backed contexts live in sched.c (vma.c stays host-testable): * alloc returns a fresh context with a private pool, or 0 on OOM.", "kind": "function", "line": 90, "name": "vma_ctx_alloc", "signature": "vma_ctx_t *vma_ctx_alloc(void);"}, {"kind": "function", "line": 91, "name": "vma_ctx_free", "signature": "void vma_ctx_free(vma_ctx_t *c);"}, {"kind": "variable", "line": 55, "name": "VMA_NIL", "signature": "extern vma_node_t *VMA_NIL;"}, {"kind": "variable", "line": 56, "name": "vma_live_root", "signature": "extern vma_node_t *vma_live_root;"}, {"kind": "variable", "line": 57, "name": "vma_free_root", "signature": "extern vma_node_t *vma_free_root;"}, {"kind": "variable", "line": 58, "name": "vma_pool", "signature": "extern vma_node_t vma_pool[VMA_MAX];"}, {"kind": "variable", "line": 59, "name": "vma_pool_n", "signature": "extern int vma_pool_n;"}, {"kind": "variable", "line": 60, "name": "vma_spare", "signature": "extern vma_node_t *vma_spare;"}, {"kind": "variable", "line": 61, "name": "vma_pool_ptr", "signature": "extern vma_node_t *vma_pool_ptr;"}, {"kind": "variable", "line": 62, "name": "vma_legacy", "signature": "extern vma_ctx_t vma_legacy;"}, {"kind": "macro", "line": 2, "name": "VMA_H", "signature": "#define VMA_H"}, {"kind": "macro", "line": 31, "name": "VMA_MAX", "signature": "#define VMA_MAX"}]}, {"doc": "Docstring: Window event contract for the MiniOS desktop.", "id": "headers/wm_events.h", "kind": "module", "label": "wm_events.h", "language": "h", "sha256": "c4af1a314675fd41", "symbol_count": 39, "symbols": [{"doc": "#define WM_EVENTS_H #include \"drivers/modifiers.h\" /** Docstring: Discrete window manager event kinds. typedef enum { WM_EVT_NONE = 0, WM_EVT_CLICK = 1, WM_EVT_RELEASE = 2, WM_EVT_MOVE = 3, WM_EVT_SCROLL = 4 } wm_event_type_t; /** Docstring: Raw mouse snapshot consumed by the translator.", "kind": "struct", "line": 25, "name": "wm_mouse_t"}, {"doc": "WM_EVT_MOVE = 3, WM_EVT_SCROLL = 4 } wm_event_type_t; /** Docstring: Raw mouse snapshot consumed by the translator. typedef struct { int x; int y; int buttons; int wheel; int present; } wm_mouse_t; /** Docstring: Translated window manager event.", "kind": "struct", "line": 34, "name": "wm_event_t"}, {"doc": "int wheel; int present; } wm_mouse_t; /** Docstring: Translated window manager event. typedef struct { wm_event_type_t type; int x; int y; int button; int wheel; } wm_event_t; /** Docstring: Centralized event translator configuration.", "kind": "struct", "line": 43, "name": "wm_event_config_t"}, {"doc": "WM_COMBO_FOCUS_NEXT = 1, WM_COMBO_TILE_ALL = 2, WM_COMBO_FULLSCREEN = 3, WM_COMBO_MINIMIZE = 4, WM_COMBO_CLOSE = 5, WM_COMBO_SNAP = 6, WM_COMBO_RESIZE_DEC_W = 7, WM_COMBO_RESIZE_INC_W = 8, WM_COMBO_RESIZE_DEC_BOTH = 9, WM_COMBO_RESIZE_INC_BOTH = 10, WM_COMBO_RESET = 11 } wm_combo_action_t; /** Docstring: One row of the shared Alt/Super combo table.", "kind": "struct", "line": 158, "name": "wm_combo_t"}, {"doc": "int button; int wheel; } wm_event_t; /** Docstring: Centralized event translator configuration. typedef struct { int left_mask; int wheel_step; } wm_event_config_t; /** Docstring: Default event configuration matching the PS/2 mouse path. #define WM_EVENT_CONFIG_DEFAULT { 1, 3 } /** Docstring: True on the rising edge of the left button.", "kind": "function", "line": 52, "name": "wm_is_click_edge", "signature": "static inline int wm_is_click_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons)"}, {"doc": "int wheel_step; } wm_event_config_t; /** Docstring: Default event configuration matching the PS/2 mouse path. #define WM_EVENT_CONFIG_DEFAULT { 1, 3 } /** Docstring: True on the rising edge of the left button. static inline int wm_is_click_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons) { int mask = (cfg != 0 && cfg->left_mask != 0) ? cfg->left_mask : 1; return (curr_buttons & mask) && !(prev_buttons & mask); } /** Docstring: True on the falling edge of the left button.", "kind": "function", "line": 59, "name": "wm_is_release_edge", "signature": "static inline int wm_is_release_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_but..."}, {"doc": "static inline int wm_is_click_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons) { int mask = (cfg != 0 && cfg->left_mask != 0) ? cfg->left_mask : 1; return (curr_buttons & mask) && !(prev_buttons & mask); } /** Docstring: True on the falling edge of the left button. static inline int wm_is_release_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons) { int mask = (cfg != 0 && cfg->left_mask != 0) ? cfg->left_mask : 1; return !(curr_buttons & mask) && (prev_buttons & mask); } /** Docstring: Translate two consecutive mouse snapshots into one event.", "kind": "function", "line": 66, "name": "wm_translate_event", "signature": "static inline wm_event_t wm_translate_event(const wm_event_config_t *cfg, const wm_mouse_t *prev,..."}, {"doc": "return evt; } if (curr->wheel != 0) { evt.type = WM_EVT_SCROLL; return evt; } if (curr->x != prev->x || curr->y != prev->y) { evt.type = WM_EVT_MOVE; return evt; } return evt; } /** Docstring: True when the event must suppress a title drag on this tick.", "kind": "function", "line": 104, "name": "wm_event_suppresses_drag", "signature": "static inline int wm_event_suppresses_drag(const wm_event_t *evt)"}, {"doc": "{1, 0, 1, WM_SC_HOME, WM_PATH_COOKED, WM_COMBO_SNAP, WM_SNAP_TOP_LEFT}, {1, 0, 1, WM_SC_END, WM_PATH_COOKED, WM_COMBO_SNAP, WM_SNAP_BOTTOM_RIGHT}, {0, 1, 1, WM_SC_UP, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_TOP}, {0, 1, 1, WM_SC_DOWN, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_BOTTOM}, {0, 1, 1, WM_SC_LEFT, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_LEFT}, {0, 1, 1, WM_SC_RIGHT, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_RIGHT}, {0, 1, 1, WM_SC_HOME, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_TOP_LEFT}, {0, 1, 1, WM_SC_END, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_BOTTOM_RIGHT} }; /** Docstring: Row count of the shared combo table. #define WM_COMBOS_N (sizeof(WM_COMBOS) / sizeof(WM_COMBOS[0])) /** Docstring: Lookup one Alt/Super combo, fail closed on AltGr or mismatch.", "kind": "function", "line": 201, "name": "wm_combo_lookup", "signature": "static inline int wm_combo_lookup(int alt, int altgr, int sup, int e0, int sc, int path, int *zon..."}, {"doc": "continue; } if (!(WM_COMBOS[i].paths & path)) { continue; } if (zone_out != 0) { zone_out = WM_COMBOS[i].zone; } return WM_COMBOS[i].action; } return WM_COMBO_NONE; } /** Docstring: Lookup through one modifier state, AltGr fail-closed.", "kind": "function", "line": 238, "name": "wm_combo_lookup_mods", "signature": "static inline int wm_combo_lookup_mods(const modifier_state_t *st, int e0, int sc, int path, int ..."}, {"kind": "macro", "line": 11, "name": "WM_EVENTS_H", "signature": "#define WM_EVENTS_H"}, {"kind": "macro", "line": 49, "name": "WM_EVENT_CONFIG_DEFAULT", "signature": "#define WM_EVENT_CONFIG_DEFAULT"}, {"kind": "macro", "line": 110, "name": "WM_SC_TAB", "signature": "#define WM_SC_TAB"}, {"kind": "macro", "line": 111, "name": "WM_SC_ENTER", "signature": "#define WM_SC_ENTER"}, {"kind": "macro", "line": 112, "name": "WM_SC_MINUS", "signature": "#define WM_SC_MINUS"}, {"kind": "macro", "line": 113, "name": "WM_SC_EQUAL", "signature": "#define WM_SC_EQUAL"}, {"kind": "macro", "line": 114, "name": "WM_SC_ZERO", "signature": "#define WM_SC_ZERO"}, {"kind": "macro", "line": 115, "name": "WM_SC_Q", "signature": "#define WM_SC_Q"}, {"kind": "macro", "line": 116, "name": "WM_SC_LBRACKET", "signature": "#define WM_SC_LBRACKET"}, {"kind": "macro", "line": 117, "name": "WM_SC_RBRACKET", "signature": "#define WM_SC_RBRACKET"}, {"kind": "macro", "line": 118, "name": "WM_SC_M", "signature": "#define WM_SC_M"}, {"kind": "macro", "line": 119, "name": "WM_SC_X", "signature": "#define WM_SC_X"}, {"kind": "macro", "line": 120, "name": "WM_SC_UP", "signature": "#define WM_SC_UP"}, {"kind": "macro", "line": 121, "name": "WM_SC_DOWN", "signature": "#define WM_SC_DOWN"}, {"kind": "macro", "line": 122, "name": "WM_SC_LEFT", "signature": "#define WM_SC_LEFT"}, {"kind": "macro", "line": 123, "name": "WM_SC_RIGHT", "signature": "#define WM_SC_RIGHT"}, {"kind": "macro", "line": 124, "name": "WM_SC_HOME", "signature": "#define WM_SC_HOME"}, {"kind": "macro", "line": 125, "name": "WM_SC_END", "signature": "#define WM_SC_END"}, {"kind": "macro", "line": 128, "name": "WM_SNAP_LEFT", "signature": "#define WM_SNAP_LEFT"}, {"kind": "macro", "line": 129, "name": "WM_SNAP_RIGHT", "signature": "#define WM_SNAP_RIGHT"}, {"kind": "macro", "line": 130, "name": "WM_SNAP_TOP", "signature": "#define WM_SNAP_TOP"}, {"kind": "macro", "line": 131, "name": "WM_SNAP_BOTTOM", "signature": "#define WM_SNAP_BOTTOM"}, {"kind": "macro", "line": 132, "name": "WM_SNAP_TOP_LEFT", "signature": "#define WM_SNAP_TOP_LEFT"}, {"kind": "macro", "line": 133, "name": "WM_SNAP_TOP_RIGHT", "signature": "#define WM_SNAP_TOP_RIGHT"}, {"kind": "macro", "line": 134, "name": "WM_SNAP_BOTTOM_LEFT", "signature": "#define WM_SNAP_BOTTOM_LEFT"}, {"kind": "macro", "line": 135, "name": "WM_SNAP_BOTTOM_RIGHT", "signature": "#define WM_SNAP_BOTTOM_RIGHT"}, {"kind": "macro", "line": 138, "name": "WM_PATH_COOKED", "signature": "#define WM_PATH_COOKED"}, {"kind": "macro", "line": 139, "name": "WM_PATH_RAW", "signature": "#define WM_PATH_RAW"}, {"kind": "macro", "line": 198, "name": "WM_COMBOS_N", "signature": "#define WM_COMBOS_N"}]}, {"doc": "Docstring: Focus manager contract for the MiniOS desktop.", "id": "headers/wm_focus.h", "kind": "module", "label": "wm_focus.h", "language": "h", "sha256": "22b2ccdaea76a456", "symbol_count": 5, "symbols": [{"doc": "Docstring: Focus manager contract for the MiniOS desktop.  Single-file header-only contract owning focus state transitions. Focus ids share one space across terminals and the graphics window; every transition validates against present flags and the graphics mode so an invalid id can never steal the keyboard. The state struct carries no kernel dependency, keeping all transitions host-testable.  #ifndef WM_FOCUS_H #define WM_FOCUS_H #include \"wm_window.h\" /** Docstring: Focus state snapshot consumed by every transition.", "kind": "struct", "line": 15, "name": "wm_focus_state_t"}, {"doc": "#ifndef WM_FOCUS_H #define WM_FOCUS_H #include \"wm_window.h\" /** Docstring: Focus state snapshot consumed by every transition. typedef struct { int focus; int nterms; int present[4]; int gfx_active; } wm_focus_state_t; /** Docstring: True when id is a selectable focus target in this state.", "kind": "function", "line": 23, "name": "wm_focus_selectable", "signature": "static inline int wm_focus_selectable(const wm_focus_state_t *st, int id)"}, {"doc": "{ if (st == 0) { return 0; } if (id == WM_WINDOW_GFX_ID) { return st->gfx_active ? 1 : 0; } if (id < 0 || id >= st->nterms || id >= 4) { return 0; } return st->present[id] ? 1 : 0; } /** Docstring: Next focus id in rotation order, unchanged when < 2 targets.", "kind": "function", "line": 38, "name": "wm_focus_next", "signature": "static inline int wm_focus_next(const wm_focus_state_t *st)"}, {"doc": "int i; if (st == 0) { return 0; } for (i = 0; i < 4; i++) { flat[i] = 0; } for (i = 0; i < st->nterms && i < 4; i++) { flat[i] = st->present[i]; } return wm_focus_next_id(flat, st->nterms > 4 ? 4 : st->nterms, st->gfx_active, st->focus); } /** Docstring: Validated focus assignment, -1 when id is not selectable.", "kind": "function", "line": 55, "name": "wm_focus_set", "signature": "static inline int wm_focus_set(const wm_focus_state_t *st, int id)"}, {"kind": "macro", "line": 10, "name": "WM_FOCUS_H", "signature": "#define WM_FOCUS_H"}]}, {"doc": "Docstring: Window geometry contract for the MiniOS desktop.", "id": "headers/wm_geom.h", "kind": "module", "label": "wm_geom.h", "language": "h", "sha256": "a72ef1326e46d7d3", "symbol_count": 11, "symbols": [{"doc": "Docstring: Window geometry contract for the MiniOS desktop.  Single-file header-only contract owning every rectangle computation the window manager performs. All dimensions arrive through wm_geom_config_t so no caller hardcodes font metrics, title height or scrollbar width. Every predicate fails closed on degenerate rectangles and every constructor clamps negative extents to zero instead of producing inverted ranges that a hit test could misread.  #ifndef WM_GEOM_H #define WM_GEOM_H /** Docstring: Centralized geometry configuration for one WM layout engine.", "kind": "struct", "line": 14, "name": "wm_geom_config_t"}, {"doc": "#define WM_GEOM_H /** Docstring: Centralized geometry configuration for one WM layout engine. typedef struct { int font_w; int font_h; int scrollbar_w; int title_h; } wm_geom_config_t; /** Docstring: Default geometry matching the kernel 8x8 font layout. #define WM_GEOM_CONFIG_DEFAULT { 8, 8, 8, 8 } /** Docstring: Axis-aligned rectangle in framebuffer pixels.", "kind": "struct", "line": 25, "name": "wm_rect_t"}, {"doc": "} wm_geom_config_t; /** Docstring: Default geometry matching the kernel 8x8 font layout. #define WM_GEOM_CONFIG_DEFAULT { 8, 8, 8, 8 } /** Docstring: Axis-aligned rectangle in framebuffer pixels. typedef struct { int x; int y; int w; int h; } wm_rect_t; /** Docstring: True when the rectangle can contain any point.", "kind": "function", "line": 33, "name": "wm_rect_valid", "signature": "static inline int wm_rect_valid(const wm_rect_t *r)"}, {"doc": "typedef struct { int x; int y; int w; int h; } wm_rect_t; /** Docstring: True when the rectangle can contain any point. static inline int wm_rect_valid(const wm_rect_t *r) { return r != 0 && r->w > 0 && r->h > 0; } /** Docstring: True when point px,py lies inside rectangle r.", "kind": "function", "line": 39, "name": "wm_rect_contains", "signature": "static inline int wm_rect_contains(const wm_rect_t *r, int px, int py)"}, {"doc": "{ return r != 0 && r->w > 0 && r->h > 0; } /** Docstring: True when point px,py lies inside rectangle r. static inline int wm_rect_contains(const wm_rect_t *r, int px, int py) { if (!wm_rect_valid(r)) { return 0; } return px >= r->x && px < r->x + r->w && py >= r->y && py < r->y + r->h; } /** Docstring: Title bar strip for a window at px,py with total width w.", "kind": "function", "line": 48, "name": "wm_title_bar_rect", "signature": "static inline wm_rect_t wm_title_bar_rect(const wm_geom_config_t *cfg, int px, int py, int w)"}, {"doc": "} /** Docstring: Title bar strip for a window at px,py with total width w. static inline wm_rect_t wm_title_bar_rect(const wm_geom_config_t *cfg, int px, int py, int w) { wm_rect_t r; r.x = px; r.y = py; r.w = w > 0 ? w : 0; r.h = (cfg != 0 && cfg->title_h > 0) ? cfg->title_h : 0; return r; } /** Docstring: Text content area below the title bar.", "kind": "function", "line": 59, "name": "wm_content_rect", "signature": "static inline wm_rect_t wm_content_rect(const wm_geom_config_t *cfg, int px, int py, int w, int h)"}, {"doc": "/** Docstring: Text content area below the title bar. static inline wm_rect_t wm_content_rect(const wm_geom_config_t *cfg, int px, int py, int w, int h) { wm_rect_t r; int th = (cfg != 0 && cfg->title_h > 0) ? cfg->title_h : 0; r.x = px; r.y = py + th; r.w = w > 0 ? w : 0; r.h = h - th > 0 ? h - th : 0; return r; } /** Docstring: Scrollbar strip at the right edge of the content area.", "kind": "function", "line": 71, "name": "wm_scrollbar_rect", "signature": "static inline wm_rect_t wm_scrollbar_rect(const wm_geom_config_t *cfg, int px, int py, int conten..."}, {"doc": "/** Docstring: Scrollbar strip at the right edge of the content area. static inline wm_rect_t wm_scrollbar_rect(const wm_geom_config_t *cfg, int px, int py, int content_w, int content_h) { wm_rect_t r; int th = (cfg != 0 && cfg->title_h > 0) ? cfg->title_h : 0; int sw = (cfg != 0 && cfg->scrollbar_w > 0) ? cfg->scrollbar_w : 0; r.x = px + content_w; r.y = py + th; r.w = sw; r.h = content_h > 0 ? content_h : 0; return r; } /** Docstring: True when point px,py hits the title bar of a window at wx,wy with total width w.", "kind": "function", "line": 84, "name": "wm_hit_title_bar", "signature": "static inline int wm_hit_title_bar(const wm_geom_config_t *cfg, int wx, int wy, int w, int px, in..."}, {"doc": "r.y = py + th; r.w = sw; r.h = content_h > 0 ? content_h : 0; return r; } /** Docstring: True when point px,py hits the title bar of a window at wx,wy with total width w. static inline int wm_hit_title_bar(const wm_geom_config_t *cfg, int wx, int wy, int w, int px, int py) { wm_rect_t r = wm_title_bar_rect(cfg, wx, wy, w); return wm_rect_contains(&r, px, py); } /** Docstring: Clamp a point into the framebuffer bounds.", "kind": "function", "line": 91, "name": "wm_clamp_point", "signature": "static inline void wm_clamp_point(int *px, int *py, int fb_w, int fb_h)"}, {"kind": "macro", "line": 11, "name": "WM_GEOM_H", "signature": "#define WM_GEOM_H"}, {"kind": "macro", "line": 22, "name": "WM_GEOM_CONFIG_DEFAULT", "signature": "#define WM_GEOM_CONFIG_DEFAULT"}]}, {"doc": "Docstring: Graphics-window view contract for the MiniOS desktop.", "id": "headers/wm_gfxview.h", "kind": "module", "label": "wm_gfxview.h", "language": "h", "sha256": "f542ff221b9c74c3", "symbol_count": 15, "symbols": [{"doc": "between two frame rects. Pure integer logic, no kernel dependencies, every entry fails closed on degenerate input so it stays host-testable.  #ifndef WM_GFXVIEW_H #define WM_GFXVIEW_H /** Docstring: View modes of the graphics window. typedef enum { WM_GFXVIEW_FLOAT = 0, WM_GFXVIEW_TILED = 1, WM_GFXVIEW_FULL = 2 } wm_gfxview_mode_t; /** Docstring: Centralized view configuration, no magic numbers.", "kind": "struct", "line": 31, "name": "wm_gfxview_config_t"}, {"doc": "Docstring: Default view: 8 px title, integer scale kept when it * covers at least 7/8 of the fit, 10 animation frames at 16 ms. #define WM_GFXVIEW_CONFIG_DEFAULT { 8, 7, 8, 10, 16 } /** Docstring: Largest source or destination edge the math accepts. #define WM_GFXVIEW_DIM_MAX 8192 /** Docstring: One axis-aligned rectangle in framebuffer pixels.", "kind": "struct", "line": 47, "name": "wm_gfxview_rect_t"}, {"doc": "Docstring: One computed view: frame (chrome plus content area), * title strip height (0 in fullscreen) and the scaled content rect.", "kind": "struct", "line": 56, "name": "wm_gfxview_t"}, {"doc": "Docstring: One computed view: frame (chrome plus content area), * title strip height (0 in fullscreen) and the scaled content rect. typedef struct { int mode; wm_gfxview_rect_t frame; int title_h; wm_gfxview_rect_t content; } wm_gfxview_t; /** Docstring: Human name for one view mode, else zero.", "kind": "function", "line": 64, "name": "wm_gfxview_mode_name", "signature": "static inline const char *wm_gfxview_mode_name(int mode)"}, {"doc": "{ switch (mode) { case WM_GFXVIEW_FLOAT: return \"floating\"; case WM_GFXVIEW_TILED: return \"tiled\"; case WM_GFXVIEW_FULL: return \"fullscreen\"; default: return 0; } } /** Docstring: True when every edge lies in the accepted range.", "kind": "function", "line": 79, "name": "wm_gfxview_dims_ok", "signature": "static inline int wm_gfxview_dims_ok(int w, int h)"}, {"kind": "function", "line": 88, "name": "Downscale", "signature": "* Downscale (fit below 1x) always takes the exact fit. Returns 1 on\n * success, 0 on degenerate i..."}, {"doc": "Docstring: Clamp a rect inside the framebuffer by moving, then by * shrinking when it is larger than the screen.", "kind": "function", "line": 134, "name": "wm_gfxview_clamp", "signature": "static inline void wm_gfxview_clamp(wm_gfxview_rect_t *r, int fb_w, int fb_h)"}, {"doc": "r->x = fb_w - r->w; } if (r->y + r->h > fb_h) { r->y = fb_h - r->h; } if (r->x < 0) { r->x = 0; } if (r->y < 0) { r->y = 0; } } /** Docstring: Center an aspect-fit content rect inside an area.", "kind": "function", "line": 160, "name": "wm_gfxview_place_content", "signature": "static inline int wm_gfxview_place_content(const wm_gfxview_config_t *cfg, int sw, int sh,\n      ..."}, {"doc": "Docstring: Map a framebuffer point into back-buffer space. Inside the content rect the point scales exactly into [0, sw) x [0, sh); outside it clamps to the nearest edge so a drag that leaves the window keeps tracking. The result is reported as content origin plus local offset, which is the coordinate space apps already subtract their reported origin from. Returns 1 when the point was inside, 0 when it * was clamped, -1 on degenerate input.", "kind": "function", "line": 255, "name": "wm_gfxview_map_point", "signature": "static inline int wm_gfxview_map_point(const wm_gfxview_t *v, int sw, int sh,\n                   ..."}, {"doc": "Docstring: Ease-out cubic progress in [0, den] for step t of n. 1 - (1 - t/n)^3 in integer arithmetic: fast start, soft landing, * monotonic, exactly 0 at t = 0 and exactly den at t = n.", "kind": "function", "line": 291, "name": "wm_gfxview_ease", "signature": "static inline long wm_gfxview_ease(int t, int n, long den)"}, {"doc": "return 0; } inv = (long)(n - t); r = den - (den * inv * inv * inv) / ((long)n * (long)n * (long)n); if (r < 0) { r = 0; } if (r > den) { r = den; } return r; } /** Docstring: Interpolate one rect between a and b at eased step t of n.", "kind": "function", "line": 313, "name": "wm_gfxview_lerp_rect", "signature": "static inline int wm_gfxview_lerp_rect(const wm_gfxview_rect_t *a, const wm_gfxview_rect_t *b,\n  ..."}, {"doc": "out->x = a->x + (int)(((long)(b->x - a->x) * p) / den); out->y = a->y + (int)(((long)(b->y - a->y) * p) / den); out->w = a->w + (int)(((long)(b->w - a->w) * p) / den); out->h = a->h + (int)(((long)(b->h - a->h) * p) / den); if (out->w < 1) { out->w = 1; } if (out->h < 1) { out->h = 1; } return 1; } /** Docstring: True when two rects are identical.", "kind": "function", "line": 336, "name": "wm_gfxview_rect_same", "signature": "static inline int wm_gfxview_rect_same(const wm_gfxview_rect_t *a, const wm_gfxview_rect_t *b)"}, {"kind": "macro", "line": 21, "name": "WM_GFXVIEW_H", "signature": "#define WM_GFXVIEW_H"}, {"kind": "macro", "line": 41, "name": "WM_GFXVIEW_CONFIG_DEFAULT", "signature": "#define WM_GFXVIEW_CONFIG_DEFAULT"}, {"kind": "macro", "line": 44, "name": "WM_GFXVIEW_DIM_MAX", "signature": "#define WM_GFXVIEW_DIM_MAX"}]}, {"doc": "Docstring: Unified layout contract for the MiniOS desktop.", "id": "headers/wm_layout.h", "kind": "module", "label": "wm_layout.h", "language": "h", "sha256": "31d48fd93877b2b6", "symbol_count": 16, "symbols": [{"doc": "/** Docstring: Layout modes sharing one compute entry point. typedef enum { WM_LAYOUT_TILE = 0, WM_LAYOUT_BSP = 1, WM_LAYOUT_CASCADE = 2, WM_LAYOUT_FIBONACCI = 3, WM_LAYOUT_FULLSCREEN = 4 } wm_layout_mode_t; /** Docstring: Total layout modes in the mode table. #define WM_LAYOUT_MODE_COUNT 5 /** Docstring: One input window for layout computation.", "kind": "struct", "line": 27, "name": "wm_layout_window_t"}, {"doc": "/** Docstring: Total layout modes in the mode table. #define WM_LAYOUT_MODE_COUNT 5 /** Docstring: One input window for layout computation. typedef struct { int kind; int id; int present; int min_cols; int min_rows; } wm_layout_window_t; /** Docstring: Centralized layout configuration for one engine.", "kind": "struct", "line": 36, "name": "wm_layout_config_t"}, {"doc": "/** Docstring: Centralized layout configuration for one engine. typedef struct { int gap; int cascade_dx; int cascade_dy; int fib_num; int fib_den; } wm_layout_config_t; /** Docstring: Default layout matching the legacy two terminal split. #define WM_LAYOUT_CONFIG_DEFAULT { 0, 4, 2, 618, 1000 } /** Docstring: One computed cell in character units.", "kind": "struct", "line": 48, "name": "wm_layout_cell_t"}, {"doc": "/** Docstring: Default layout matching the legacy two terminal split. #define WM_LAYOUT_CONFIG_DEFAULT { 0, 4, 2, 618, 1000 } /** Docstring: One computed cell in character units. typedef struct { int x; int y; int cols; int rows; int fullscreen; } wm_layout_cell_t; /** Docstring: Human name for one layout mode, else zero.", "kind": "function", "line": 57, "name": "wm_layout_mode_name", "signature": "static inline const char *wm_layout_mode_name(int mode)"}, {"doc": "case WM_LAYOUT_BSP: return \"bsp\"; case WM_LAYOUT_CASCADE: return \"cascade\"; case WM_LAYOUT_FIBONACCI: return \"fibonacci\"; case WM_LAYOUT_FULLSCREEN: return \"fullscreen\"; default: return 0; } } /** Docstring: True when mode is a selectable layout mode.", "kind": "function", "line": 76, "name": "wm_layout_mode_valid", "signature": "static inline int wm_layout_mode_valid(int mode)"}, {"doc": "case WM_LAYOUT_FULLSCREEN: return \"fullscreen\"; default: return 0; } } /** Docstring: True when mode is a selectable layout mode. static inline int wm_layout_mode_valid(int mode) { return mode >= WM_LAYOUT_TILE && mode <= WM_LAYOUT_FULLSCREEN; } /** Docstring: Clamp cell extents into the grid, fail closed on nulls.", "kind": "function", "line": 82, "name": "wm_layout_clamp_cell", "signature": "static inline int wm_layout_clamp_cell(wm_layout_cell_t *cell, int max_cols, int max_rows)"}, {"doc": "} if (cell->rows < 1) { cell->rows = 1; } if (cell->x + cell->cols > max_cols) { cell->cols = max_cols - cell->x; } if (cell->y + cell->rows > max_rows) { cell->rows = max_rows - cell->y; } return cell->cols > 0 && cell->rows > 0; } /** Docstring: Full grid cell for the focused window.", "kind": "function", "line": 118, "name": "wm_layout_fullscreen_cell", "signature": "static inline int wm_layout_fullscreen_cell(int max_cols, int max_rows, wm_layout_cell_t *out)"}, {"doc": "return 0; } if (max_cols <= 0 || max_rows <= 0) { return 0; } out->x = 0; out->y = 0; out->cols = max_cols; out->rows = max_rows; out->fullscreen = 1; return 1; } /** Docstring: Tile split across the long axis, legacy dual split exactly.", "kind": "function", "line": 135, "name": "wm_layout_compute_tile", "signature": "static inline int wm_layout_compute_tile(const wm_layout_window_t *wins, int nwin, int max_cols, ..."}, {"doc": "} base = max_rows / nwin; rem = max_rows - base * nwin; for (i = 0; i < nwin; i++) { out[i].x = 0; out[i].y = i * base; out[i].cols = max_cols; out[i].rows = base + ((i == nwin - 1) ? rem : 0); out[i].fullscreen = 0; } return nwin; } /** Docstring: Recursive binary splits alternating axes, bspwm feel.", "kind": "function", "line": 182, "name": "wm_layout_compute_bsp", "signature": "static inline int wm_layout_compute_bsp(const wm_layout_window_t *wins, int nwin, int max_cols, i..."}, {"doc": "} out[i].x = rx; out[i].y = ry; out[i].cols = rw; out[i].rows = half; out[i].fullscreen = 0; ry = ry + half; rh = rh - half; } } return nwin; } /** Docstring: Cascaded offsets so every title stays visible.", "kind": "function", "line": 250, "name": "wm_layout_compute_cascade", "signature": "static inline int wm_layout_compute_cascade(const wm_layout_config_t *cfg, const wm_layout_window..."}, {"doc": "out[i].cols = max_cols - ox; out[i].rows = max_rows - oy; out[i].fullscreen = 0; if (out[i].cols < 1) { out[i].cols = 1; } if (out[i].rows < 1) { out[i].rows = 1; } } return nwin; } /** Docstring: Fibonacci spiral carving integer ratio strips.", "kind": "function", "line": 285, "name": "wm_layout_compute_fibonacci", "signature": "static inline int wm_layout_compute_fibonacci(const wm_layout_config_t *cfg, const wm_layout_wind..."}, {"doc": "} out[i].x = rx; out[i].y = ry; out[i].cols = rw; out[i].rows = cut; out[i].fullscreen = 0; ry = ry + cut; rh = rh - cut; } } return nwin; } /** Docstring: Compute one cell per present window in input order.", "kind": "function", "line": 361, "name": "wm_layout_compute", "signature": "static inline int wm_layout_compute(const wm_layout_config_t *cfg, const wm_layout_window_t *wins..."}, {"doc": "} if (n != nc) { return 0; } for (i = 0; i < nc; i++) { if (!wm_layout_clamp_cell(&cells[i], max_cols, max_rows)) { return 0; } out[i] = cells[i]; } return nc; } /** Docstring: True when two plans cover identical cells in order.", "kind": "function", "line": 443, "name": "wm_layout_same", "signature": "static inline int wm_layout_same(const wm_layout_cell_t *a, const wm_layout_cell_t *b, int n)"}, {"kind": "macro", "line": 12, "name": "WM_LAYOUT_H", "signature": "#define WM_LAYOUT_H"}, {"kind": "macro", "line": 24, "name": "WM_LAYOUT_MODE_COUNT", "signature": "#define WM_LAYOUT_MODE_COUNT"}, {"kind": "macro", "line": 45, "name": "WM_LAYOUT_CONFIG_DEFAULT", "signature": "#define WM_LAYOUT_CONFIG_DEFAULT"}]}, {"doc": "Docstring: Focus event bus for the MiniOS desktop.", "id": "headers/wm_notify.h", "kind": "module", "label": "wm_notify.h", "language": "h", "sha256": "965ce6fe6ba8cc6c", "symbol_count": 9, "symbols": [{"doc": "typedef enum { WM_NOTIFY_FOCUS = 1 } wm_notify_type_t; typedef enum { WM_FOCUS_SRC_KEYBOARD = 1, WM_FOCUS_SRC_POINTER = 2, WM_FOCUS_SRC_TASKBAR = 3, WM_FOCUS_SRC_MODE = 4, WM_FOCUS_SRC_PROGRAM = 5 } wm_focus_source_t; /** Docstring: One focus move, old and new ids share the focus space.", "kind": "struct", "line": 30, "name": "wm_notify_event_t"}, {"kind": "struct", "line": 43, "name": "wm_notify_bus_t"}, {"doc": "/** Docstring: Focus listener, runs synchronously inside emit. typedef void (*wm_notify_handler_t)(const wm_notify_event_t *event); /** Docstring: Static subscriber table plus last emitted event. #define WM_NOTIFY_MAX_HANDLERS 4 typedef struct { wm_notify_handler_t handlers[WM_NOTIFY_MAX_HANDLERS]; int count; wm_notify_event_t last; int has_event; } wm_notify_bus_t; /** Docstring: Drop every subscriber and forget the last event.", "kind": "function", "line": 51, "name": "wm_notify_reset", "signature": "static inline void wm_notify_reset(wm_notify_bus_t *bus)"}, {"doc": "{ int i; if (bus == 0) return; for (i = 0; i < WM_NOTIFY_MAX_HANDLERS; i++) bus->handlers[i] = 0; bus->count = 0; bus->last.type = 0; bus->last.old_focus = 0; bus->last.new_focus = 0; bus->last.source = 0; bus->has_event = 0; } /** Docstring: Register one listener, -1 when full or null.", "kind": "function", "line": 66, "name": "wm_notify_subscribe", "signature": "static inline int wm_notify_subscribe(wm_notify_bus_t *bus,\n                                     ..."}, {"doc": "bus->has_event = 0; } /** Docstring: Register one listener, -1 when full or null. static inline int wm_notify_subscribe(wm_notify_bus_t *bus, wm_notify_handler_t handler) { if (bus == 0 || handler == 0) return -1; if (bus->count >= WM_NOTIFY_MAX_HANDLERS) return -1; bus->handlers[bus->count++] = handler; return 0; } /** Docstring: Deliver one event to every listener, then record it.", "kind": "function", "line": 76, "name": "wm_notify_emit", "signature": "static inline void wm_notify_emit(wm_notify_bus_t *bus,\n                                  const w..."}, {"doc": "static inline void wm_notify_emit(wm_notify_bus_t *bus, const wm_notify_event_t *event) { int i; if (bus == 0 || event == 0) return; for (i = 0; i < bus->count; i++) { if (bus->handlers[i]) bus->handlers[i](event); } bus->last = *event; bus->has_event = 1; } /** Docstring: Last emitted event, 0 when none was ever emitted.", "kind": "function", "line": 90, "name": "wm_notify_last", "signature": "static inline const wm_notify_event_t *wm_notify_last(\n    const wm_notify_bus_t *bus)"}, {"doc": "} bus->last = *event; bus->has_event = 1; } /** Docstring: Last emitted event, 0 when none was ever emitted. static inline const wm_notify_event_t *wm_notify_last( const wm_notify_bus_t *bus) { if (bus == 0 || !bus->has_event) return 0; return &bus->last; } /** Docstring: Short source name for serial-observable state.", "kind": "function", "line": 98, "name": "wm_notify_src_name", "signature": "static inline const char *wm_notify_src_name(int source)"}, {"kind": "macro", "line": 2, "name": "WM_NOTIFY_H", "signature": "#define WM_NOTIFY_H"}, {"kind": "macro", "line": 41, "name": "WM_NOTIFY_MAX_HANDLERS", "signature": "#define WM_NOTIFY_MAX_HANDLERS"}]}, {"doc": "Docstring: Render pipeline contract for the MiniOS desktop.", "id": "headers/wm_render.h", "kind": "module", "label": "wm_render.h", "language": "h", "sha256": "0ba1765e1e02af68", "symbol_count": 5, "symbols": [{"doc": "#define WM_RENDER_H #include \"wm_window.h\" /** Docstring: Composition layers from back to front. typedef enum { WM_LAYER_WALLPAPER = 0, WM_LAYER_SHORTCUTS = 1, WM_LAYER_TASKBAR = 2, WM_LAYER_TERMINAL = 3, WM_LAYER_GRAPHICS = 4 } wm_layer_t; /** Docstring: One composited item in back-to-front order.", "kind": "struct", "line": 25, "name": "wm_render_item_t"}, {"doc": "WM_LAYER_WALLPAPER = 0, WM_LAYER_SHORTCUTS = 1, WM_LAYER_TASKBAR = 2, WM_LAYER_TERMINAL = 3, WM_LAYER_GRAPHICS = 4 } wm_layer_t; /** Docstring: One composited item in back-to-front order. typedef struct { wm_layer_t layer; int id; } wm_render_item_t; /** Docstring: Centralized render pipeline configuration.", "kind": "struct", "line": 31, "name": "wm_render_config_t"}, {"doc": "typedef struct { wm_layer_t layer; int id; } wm_render_item_t; /** Docstring: Centralized render pipeline configuration. typedef struct { int max_items; } wm_render_config_t; /** Docstring: Default pipeline bound for two terminals plus chrome. #define WM_RENDER_CONFIG_DEFAULT { 8 } /** Docstring: Build the back-to-front composition plan for one frame.", "kind": "function", "line": 39, "name": "wm_build_render_plan", "signature": "static inline int wm_build_render_plan(const wm_render_config_t *cfg, const int *present, int nte..."}, {"kind": "macro", "line": 11, "name": "WM_RENDER_H", "signature": "#define WM_RENDER_H"}, {"kind": "macro", "line": 36, "name": "WM_RENDER_CONFIG_DEFAULT", "signature": "#define WM_RENDER_CONFIG_DEFAULT"}]}, {"doc": "Docstring: Tiling layout contract for the MiniOS desktop.", "id": "headers/wm_tiling.h", "kind": "module", "label": "wm_tiling.h", "language": "h", "sha256": "35b80d2faec87b9c", "symbol_count": 3, "symbols": [{"doc": "Docstring: Tiling layout contract for the MiniOS desktop.  Single-file header-only contract owning terminal cell layout. Given the usable grid and which windows exist, it computes one cell per terminal in character units so no caller hardcodes half splits or stack math. Graphics placement stays in the kernel; this contract only reserves its half by narrowing the terminals. All functions fail closed.  #ifndef WM_TILING_H #define WM_TILING_H /** Docstring: Terminal cell in character units.", "kind": "struct", "line": 13, "name": "wm_tile_cell_t"}, {"doc": "#ifndef WM_TILING_H #define WM_TILING_H /** Docstring: Terminal cell in character units. typedef struct { int x; int y; int cols; int rows; int fullscreen; } wm_tile_cell_t; /** Docstring: Compute terminal cells for the current window set.", "kind": "function", "line": 22, "name": "wm_tile_layout", "signature": "static inline int wm_tile_layout(const int *present, int nterms, int gfx_active, int max_cols, in..."}, {"kind": "macro", "line": 10, "name": "WM_TILING_H", "signature": "#define WM_TILING_H"}]}, {"doc": "Docstring: Unified window contract for the MiniOS desktop.", "id": "headers/wm_window.h", "kind": "module", "label": "wm_window.h", "language": "h", "sha256": "b7b2f8c44d03ab7d", "symbol_count": 10, "symbols": [{"doc": "/** Docstring: Window kinds sharing one focus space. typedef enum { WM_WIN_NONE = 0, WM_WIN_TERMINAL = 1, WM_WIN_GRAPHICS = 2 } wm_window_kind_t; /** Docstring: Focus id for the graphics window in the shared focus space. #define WM_WINDOW_GFX_ID 2 /** Docstring: Maximum terminal windows sharing the focus space. #define WM_WINDOW_MAX_TERMS 2 /** Docstring: Unified window descriptor in framebuffer pixels.", "kind": "struct", "line": 29, "name": "wm_window_t"}, {"doc": "/** Docstring: Unified window descriptor in framebuffer pixels. typedef struct { wm_window_kind_t kind; int id; int x; int y; int w; int h; int present; int minimized; } wm_window_t; /** Docstring: True when the window can receive input or pointer hits.", "kind": "function", "line": 41, "name": "wm_window_active", "signature": "static inline int wm_window_active(const wm_window_t *w)"}, {"doc": "int y; int w; int h; int present; int minimized; } wm_window_t; /** Docstring: True when the window can receive input or pointer hits. static inline int wm_window_active(const wm_window_t *w) { return w != 0 && w->kind != WM_WIN_NONE && w->present && !w->minimized && w->w > 0 && w->h > 0; } /** Docstring: Rectangle covering the whole window including decorations.", "kind": "function", "line": 47, "name": "wm_window_rect", "signature": "static inline wm_rect_t wm_window_rect(const wm_window_t *w)"}, {"doc": "} /** Docstring: Rectangle covering the whole window including decorations. static inline wm_rect_t wm_window_rect(const wm_window_t *w) { wm_rect_t r; r.x = (w != 0) ? w->x : 0; r.y = (w != 0) ? w->y : 0; r.w = (w != 0 && w->w > 0) ? w->w : 0; r.h = (w != 0 && w->h > 0) ? w->h : 0; return r; } /** Docstring: True when point px,py hits the window body or decorations.", "kind": "function", "line": 58, "name": "wm_window_contains", "signature": "static inline int wm_window_contains(const wm_window_t *w, int px, int py)"}, {"doc": "return r; } /** Docstring: True when point px,py hits the window body or decorations. static inline int wm_window_contains(const wm_window_t *w, int px, int py) { wm_rect_t r = wm_window_rect(w); if (!wm_window_active(w)) { return 0; } return wm_rect_contains(&r, px, py); } /** Docstring: True when point px,py hits the window title bar.", "kind": "function", "line": 68, "name": "wm_window_title_hits", "signature": "static inline int wm_window_title_hits(const wm_geom_config_t *cfg, const wm_window_t *w, int px,..."}, {"doc": "} return wm_rect_contains(&r, px, py); } /** Docstring: True when point px,py hits the window title bar. static inline int wm_window_title_hits(const wm_geom_config_t *cfg, const wm_window_t *w, int px, int py) { if (!wm_window_active(w)) { return 0; } return wm_hit_title_bar(cfg, w->x, w->y, w->w, px, py); } /** Docstring: Next focus id across present terminals plus graphics when active.", "kind": "function", "line": 77, "name": "wm_focus_next_id", "signature": "static inline int wm_focus_next_id(const int *present, int nterms, int gfx_active, int focus)"}, {"doc": "return focus; } for (k = 0; k < n; k++) { if (ids[k] == focus) { at = k; } } if (at < 0) { return ids[0]; } return ids[(at + 1) % n]; } /** Docstring: Paint order for terminals with focused window last.", "kind": "function", "line": 114, "name": "wm_paint_order", "signature": "static inline int wm_paint_order(const int *present, int nterms, int focus, int *order, int cap)"}, {"kind": "macro", "line": 11, "name": "WM_WINDOW_H", "signature": "#define WM_WINDOW_H"}, {"kind": "macro", "line": 23, "name": "WM_WINDOW_GFX_ID", "signature": "#define WM_WINDOW_GFX_ID"}, {"kind": "macro", "line": 26, "name": "WM_WINDOW_MAX_TERMS", "signature": "#define WM_WINDOW_MAX_TERMS"}]}, {"doc": "zip.h — MiniOS integration API for the miniz zip library.", "id": "headers/zip.h", "kind": "module", "label": "zip.h", "language": "h", "sha256": "49df234e67f3e432", "symbol_count": 3, "symbols": [{"kind": "function", "line": 6, "name": "miniz", "signature": "* * The shell builtins over miniz (see zip.c) are declared here so kernel.c's * shell dispatcher can route the unzip/zip commands. Both builtins work * whole-file in memory over the unified file API ("}, {"kind": "function", "line": 15, "name": "shell_cmd_zip", "signature": "void shell_cmd_zip(int argc, char **argv);"}, {"kind": "macro", "line": 2, "name": "ZIP_H", "signature": "#define ZIP_H"}]}, {"doc": "Docstring: kernel/abi.c -- Boot-time ABI manifest gate.", "id": "kernel/abi.c", "kind": "module", "label": "abi.c", "language": "c", "sha256": "c64807fe670492cb", "symbol_count": 3, "symbols": [{"doc": "order, junk, overflow, missing newline) fails closed as BAD_FORMAT. Number parsing carries its own overflow guard so a hostile manifest can never wrap into a false match. The file has no kernel dependency beyond the manifest check itself, so the host test compiles it with ABI_HOST_TEST and covers every branch without a QEMU boot.  #include \"abi.h\" #ifndef ABI_HOST_TEST #include \"kernel.h\" #endif /** Docstring: Parse one decimal field, overflow-guarded.", "kind": "function", "line": 20, "name": "abi_parse_num", "signature": "static int abi_parse_num(const char **pp, const char *end, unsigned long *out)"}, {"doc": "return 0; while (p < end && *p >= '0' && *p <= '9') { unsigned digit = (unsigned)(*p - '0'); if (v > (0xFFFFFFFFFFFFFFFFUL - digit) / 10) return 0; v = v * 10 + digit; p++; } pp = p; out = v; return 1; } /** Docstring: Verify manifest text against the running ABI.", "kind": "function", "line": 38, "name": "abi_verify", "signature": "int abi_verify(const char *text, long version, unsigned long checksum)"}, {"doc": "p += 2; if (!abi_parse_num(&p, end, &c)) return ABI_BAD_FORMAT; if (p + 1 != end || *p != '\\n') return ABI_BAD_FORMAT; if ((long)v != version) return ABI_VERSION_MISMATCH; if (c != checksum) return ABI_CHECKSUM_MISMATCH; return ABI_OK; } #ifndef ABI_HOST_TEST /** Docstring: Read etc/abi from the ramdisk and verify the running ABI.", "kind": "function", "line": 74, "name": "abi_check_manifest", "signature": "int abi_check_manifest(void)"}]}, {"doc": "Docstring: kernel/batch.c -- Ordered batch executor.", "id": "kernel/batch.c", "kind": "module", "label": "batch.c", "language": "c", "sha256": "ce040dbb0abc0441", "symbol_count": 1, "symbols": [{"doc": "Docstring: Run ops in order, storing one result per index.  Returns BATCH_OK when every operation dispatched without a negative result. On the first negative dispatch result, stops immediately and returns that error. completed always reports the number of successful operations, including on early refusal (zero). A null dispatch table entry for a known opcode is treated as BATCH_ERR_OPCODE, never called.", "kind": "function", "line": 19, "name": "batch_exec", "signature": "long batch_exec(const batch_op_t *ops, long *results, int count,\n                int *completed, ..."}]}, {"doc": "Docstring: kernel/clip.c -- Shared text clipboard.", "id": "kernel/clip.c", "kind": "module", "label": "clip.c", "language": "c", "sha256": "898817037cf05398", "symbol_count": 4, "symbols": [{"doc": "Docstring: Replace the clipboard with len bytes from data. Refused * (return -1) on null data or past CLIP_MAX; empty clears.", "kind": "function", "line": 25, "name": "clip_set", "signature": "int clip_set(const char *data, unsigned long len)"}, {"doc": "Docstring: Copy the clipboard into out (cap bytes). Returns the length, or -1 when empty/cleared. Fail-closed on an undersize * buffer (refuse, never a silently truncated paste). int clip_get(char *out, unsigned long cap) { unsigned long i; if (!out || cap == 0u) return -1; if (!clip_valid || clip_len == 0u) return -1; if ((unsigned long)clip_len > cap) return -1; for (i = 0u; i < clip_len; i++) out[i] = clip_buf[i]; return (int)clip_len; } /** Docstring: Empty the clipboard. Reads then report -1 (empty).", "kind": "function", "line": 48, "name": "clip_clear", "signature": "void clip_clear(void)"}, {"doc": "Docstring: Current length, or -1 when empty. Lets callers size the * read buffer before getting.", "kind": "function", "line": 55, "name": "clip_len_get", "signature": "int clip_len_get(void)"}, {"kind": "macro", "line": 17, "name": "CLIP_MAX", "signature": "#define CLIP_MAX"}]}, {"doc": "console.c -- Execution-context output: text console, capture, libc names.", "id": "kernel/console.c", "kind": "module", "label": "console.c", "language": "c", "sha256": "1c24f3b1ddb9daa5", "symbol_count": 29, "symbols": [{"kind": "function", "line": 18, "name": "vga_get_x", "signature": "int vga_get_x(void)"}, {"kind": "function", "line": 19, "name": "vga_get_y", "signature": "int vga_get_y(void)"}, {"kind": "function", "line": 20, "name": "vga_set_xy", "signature": "void vga_set_xy(int x, int y)"}, {"kind": "function", "line": 21, "name": "vga_get_color", "signature": "char vga_get_color(void)"}, {"kind": "function", "line": 23, "name": "vga_offset", "signature": "static inline unsigned vga_offset(int x, int y)"}, {"kind": "function", "line": 25, "name": "vga_clear", "signature": "void vga_clear(void)"}, {"kind": "function", "line": 36, "name": "vga_set_cursor", "signature": "void vga_set_cursor(int x, int y)"}, {"kind": "function", "line": 56, "name": "vga_scroll", "signature": "void vga_scroll(void)"}, {"kind": "function", "line": 75, "name": "vga_newline", "signature": "void vga_newline(void)"}, {"kind": "function", "line": 81, "name": "vga_cursor_enable", "signature": "void vga_cursor_enable(int on)"}, {"kind": "function", "line": 88, "name": "vga_raw_space", "signature": "static void vga_raw_space(void)"}, {"kind": "function", "line": 110, "name": "redir_grow", "signature": "static int redir_grow(void)"}, {"kind": "function", "line": 120, "name": "redirect_active", "signature": "int redirect_active(void)"}, {"kind": "function", "line": 122, "name": "redirect_putc", "signature": "static int redirect_putc(char c)"}, {"kind": "function", "line": 129, "name": "redirect_suspend", "signature": "int redirect_suspend(void)"}, {"kind": "function", "line": 135, "name": "redirect_resume", "signature": "void redirect_resume(int was)"}, {"kind": "function", "line": 139, "name": "redirect_begin", "signature": "int redirect_begin(void)"}, {"kind": "function", "line": 147, "name": "redirect_commit", "signature": "int redirect_commit(const char *path, int append_mode)"}, {"doc": "Docstring: Bytes waiting in the capture, 0 when idle or overflowed. Lets a caller size one arena block for the whole capture instead of * taking a throwaway heap copy first.", "kind": "function", "line": 185, "name": "redirect_pending", "signature": "unsigned long redirect_pending(void)"}, {"doc": "Docstring: Drain the capture into the caller's arena memory instead of a fresh heap block. Copies at most cap bytes, deactivates the capture and resets the ring exactly like redirect_take, but the caller owns dst so a pipeline stage assembles its output with one kmalloc instead of three. Reports the copied count in len_out; * 0 with len 0 on empty capture or overflow.", "kind": "function", "line": 196, "name": "redirect_take_into", "signature": "unsigned long redirect_take_into(char *dst, unsigned long cap,\n        unsigned long *len_out)"}, {"doc": "Docstring: Drop the capture without any allocation. The ring keeps its backing block for the next Ctrl+R / Ctrl+L build, so repeated toolchain runs reuse one persistent bump buffer instead of churning * the heap.", "kind": "function", "line": 216, "name": "redirect_discard", "signature": "void redirect_discard(void)"}, {"doc": "Text-mode console line buffer. The framebuffer terminal owns its own history; this is the text-mode half of the same history, so the boot log * (printed before the desktop comes up) is still reachable with PageUp. #define VGA_LINE_MAX 256 static char vga_line[VGA_LINE_MAX]; static int  vga_line_len; /** Docstring: Push the buffered text-mode line into the terminal history.", "kind": "function", "line": 231, "name": "vga_line_feed", "signature": "static void vga_line_feed(void)"}, {"kind": "function", "line": 237, "name": "vga_putc", "signature": "void vga_putc(char c)"}, {"kind": "function", "line": 283, "name": "vga_puts", "signature": "void vga_puts(const char *s)"}, {"kind": "function", "line": 287, "name": "register_libc_symbols", "signature": "void register_libc_symbols(void)"}, {"kind": "macro", "line": 4, "name": "XXH_STATIC_LINKING_ONLY", "signature": "#define XXH_STATIC_LINKING_ONLY"}, {"kind": "macro", "line": 96, "name": "REDIR_INITIAL_CAP", "signature": "#define REDIR_INITIAL_CAP"}, {"kind": "macro", "line": 97, "name": "REDIR_MAX_BYTES", "signature": "#define REDIR_MAX_BYTES"}, {"kind": "macro", "line": 226, "name": "VGA_LINE_MAX", "signature": "#define VGA_LINE_MAX"}]}, {"doc": "Docstring: Console input device (kernel/console_in.c).", "id": "kernel/console_in.c", "kind": "module", "label": "console_in.c", "language": "c", "sha256": "061e47f6ff3f0da6", "symbol_count": 32, "symbols": [{"doc": "Pipeline stdin override (see console_in.h): heap buffer served ahead of every live source while set. Drained means EOF (-1), never a block on hardware, so `grep x` at a pipe tail terminates instead of hanging * on the keyboard. Single-owner (the shell runner), never nested. static unsigned char *pipe_stdin_buf; static unsigned long pipe_stdin_len; static unsigned long pipe_stdin_pos; static int pipe_stdin_on; /** Docstring: Install a pipeline stdin buffer (see header).", "kind": "function", "line": 32, "name": "console_stdin_push", "signature": "int console_stdin_push(const char *data, unsigned long len)"}, {"doc": "int console_stdin_push(const char *data, unsigned long len) { unsigned long i; if (!data || len == 0u || len > PIPE_CAP_MAX) return 0; console_stdin_clear(); pipe_stdin_buf = kmalloc(len); if (!pipe_stdin_buf) return 0; for (i = 0u; i < len; i++) pipe_stdin_buf[i] = (unsigned char)data[i]; pipe_stdin_len = len; pipe_stdin_pos = 0u; pipe_stdin_on = 1; return 1; } /** Docstring: Release the pipeline stdin buffer, back to live console.", "kind": "function", "line": 46, "name": "console_stdin_clear", "signature": "void console_stdin_clear(void)"}, {"doc": "Docstring: True while a pipeline stdin buffer is installed (drained * or not). Lets sys_read tell piped EOF from a live block.", "kind": "function", "line": 56, "name": "console_stdin_active", "signature": "int console_stdin_active(void)"}, {"kind": "function", "line": 60, "name": "pb_empty", "signature": "static int pb_empty(void)"}, {"kind": "function", "line": 61, "name": "pb_count", "signature": "static int pb_count(void)"}, {"kind": "function", "line": 62, "name": "pb_push_back", "signature": "static void pb_push_back(unsigned char c)"}, {"kind": "function", "line": 67, "name": "pb_push_front", "signature": "static void pb_push_front(unsigned char c)"}, {"kind": "function", "line": 72, "name": "pb_pop", "signature": "static int pb_pop(void)"}, {"kind": "function", "line": 78, "name": "pb_peek", "signature": "static int pb_peek(void)"}, {"doc": "Docstring: Push one byte back into the console FIFO; the next * console_getc/console_peek serves it first. Drops the byte when full.", "kind": "function", "line": 85, "name": "console_ungetc", "signature": "void console_ungetc(unsigned char c)"}, {"doc": "Docstring: Service the polled USB input path: drain the controller's event ring, then take one report from each claimed HID endpoint. Both keyboard sources share the cooked queue downstream, so a report that produces a byte * is visible to the very next kbd_q_pop.", "kind": "function", "line": 93, "name": "console_poll_usb", "signature": "static void console_poll_usb(void)"}, {"doc": "Docstring: True when the PS/2 data port should be read.  On a machine with no 8042 -- every PC since roughly 2012, and anything with a USB keyboard -- port 0x64 reads back as 0xFF, which kbd_available reads as \"output buffer full\" and port 0x60 as 0xFF, which the decode path reads as a break code. Left unguarded, a shell prompt would spin forever swallowing 0xFF and never accept a character. So the PS/2 port is skipped entirely * once a USB keyboard is driving the path.", "kind": "function", "line": 106, "name": "console_ps2_live", "signature": "static int console_ps2_live(void)"}, {"doc": "Docstring: Next raw byte (kbd queue, then serial, then USB, then PS/2) without touching the pushback FIFO; blocks until one is available.  USB is serviced here, not only on the tick, because the shell prompt is a spin loop: polling it in place gives a keystroke the next iteration rather than up to ten milliseconds later, which is the difference between typing * and feeling the machine lag.", "kind": "function", "line": 118, "name": "raw_blocking_getc", "signature": "static int raw_blocking_getc(void)"}, {"doc": "} console_poll_usb(); if (!kbd_q_empty()) return kbd_q_pop(); if (console_ps2_live()) { int c = kbd_read(); if (c >= 0) return c; } if (vga_fb_active && (++mouse_tick_cnt & 0xFF) == 0) vga_fb_mouse_tick(); __asm__ volatile(\"pause\"); } } /** Docstring: Non-blocking variant of the above for sequence lookahead.", "kind": "function", "line": 139, "name": "raw_try_getc", "signature": "static int raw_try_getc(void)"}, {"kind": "function", "line": 157, "name": "ESC", "signature": "* The bound keeps a bare ESC (never completed into a sequence) from\n * hanging the reader. */\n#de..."}, {"doc": "Docstring: Called after an ESC byte has been read. Pulls the remainder of the sequence non-blocking and classifies it. Returns 1 (PageUp), 2 (PageDown), or 0 for \"not a page key\" — in which case every byte pulled EXCEPT the leading ESC is re-injected into the pushback FIFO so the caller can hand them back to the readline layer exactly as it would * a raw escape.", "kind": "function", "line": 178, "name": "consume_page_after_esc", "signature": "static int consume_page_after_esc(void)"}, {"doc": "Docstring: Page the console history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring, the text-mode console the legacy VGA scrollback ring; this picks the one that is up * and is the single entry point for the page keys.", "kind": "function", "line": 204, "name": "console_history_page", "signature": "void console_history_page(int dir)"}, {"doc": "Docstring: Blocking read from either the PS/2 keyboard or COM1 serial line. Recognises the PageUp/PageDown escape sequences and detours into the scrollback view; the view re-injects any terminating key into the pushback FIFO, so once it returns console_getc() simply serves the FIFO * again.", "kind": "function", "line": 217, "name": "console_getc", "signature": "int console_getc(void)"}, {"doc": "Docstring: Next buffered byte without consuming it, or -1 when nothing is available right now. Used to tell an ESC prefix from a complete escape sequence, which always arrives in one burst. Global so SYS_SPAWN waits in spawn.c can poll for Ctrl+C exactly like the shell foreground * wait does.", "kind": "function", "line": 247, "name": "console_peek", "signature": "int console_peek(void)"}, {"doc": "Docstring: Raw console multiplexer for the GETC_RAW syscall. The same serial + PS/2 sources console_getc funnels, but without the line buffering, echo or scrollback detour: a ring-3 fullscreen program reads keystrokes byte by byte. Blocking spins with a pause (and the desktop tick, as the shell idle loop does); the try variant returns -1 when * nothing is available so user space can implement its own timeout.", "kind": "function", "line": 260, "name": "console_raw_try", "signature": "int console_raw_try(void)"}, {"kind": "function", "line": 264, "name": "console_raw_get", "signature": "int console_raw_get(void)"}, {"doc": "Docstring: GETC_RAW source for ring-3 background jobs. Serves the USB path too, so a ring-3 program that owns the keyboard on modern hardware is * not handed a dead 8042.", "kind": "function", "line": 271, "name": "console_job_try", "signature": "int console_job_try(void)"}, {"doc": "Docstring: GETC_RAW source for ring-3 background jobs. Serves the USB path too, so a ring-3 program that owns the keyboard on modern hardware is * not handed a dead 8042. int console_job_try(void) { console_poll_usb(); if (console_ps2_live()) { int c = kbd_read(); if (c >= 0) return c; } return -1; } /** Docstring: Blocking PS/2-only GETC_RAW source for background jobs.", "kind": "function", "line": 281, "name": "console_job_get", "signature": "int console_job_get(void)"}, {"kind": "function", "line": 297, "name": "scrollback_render", "signature": "static void scrollback_render(int voff, int total, const unsigned char *saved)"}, {"doc": "Docstring: Reads the next scrollback key event: PageUp/PageDown navigate; any other key (or a non-page escape sequence) is re-injected * and reported as SB_EXIT.", "kind": "function", "line": 325, "name": "sb_next", "signature": "static int sb_next(void)"}, {"kind": "function", "line": 335, "name": "scrollback_view", "signature": "static void scrollback_view(int initial_dir)"}, {"kind": "macro", "line": 18, "name": "PB_LEN", "signature": "#define PB_LEN"}, {"kind": "macro", "line": 159, "name": "MAX_SEQ_POLL", "signature": "#define MAX_SEQ_POLL"}, {"kind": "macro", "line": 295, "name": "SB_LEN", "signature": "#define SB_LEN"}, {"kind": "macro", "line": 318, "name": "SB_PGUP", "signature": "#define SB_PGUP"}, {"kind": "macro", "line": 319, "name": "SB_PGDN", "signature": "#define SB_PGDN"}, {"kind": "macro", "line": 320, "name": "SB_EXIT", "signature": "#define SB_EXIT"}]}, {"id": "kernel/cvm_host.c", "kind": "module", "label": "cvm_host.c", "language": "c", "sha256": "f6dc4439d20e2d89", "symbol_count": 45, "symbols": [{"doc": "Output sink for kformat: a stream (FILE*) or a bounded buffer. The buffer form follows the C library: at most cap-1 characters plus a terminating NUL are stored, while len keeps the length the whole * format would have produced (what sprintf and snprintf return).", "kind": "struct", "line": 281, "name": "kout_sink"}, {"kind": "function", "line": 22, "name": "n_strcmp", "signature": "static int64_t n_strcmp(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 28, "name": "n_strncmp", "signature": "static int64_t n_strncmp(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 35, "name": "n_strcpy", "signature": "static int64_t n_strcpy(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 41, "name": "n_strncpy", "signature": "static int64_t n_strncpy(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 48, "name": "n_memcpy", "signature": "static int64_t n_memcpy(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 55, "name": "n_memset", "signature": "static int64_t n_memset(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 61, "name": "n_memmove", "signature": "static int64_t n_memmove(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 68, "name": "n_memcmp", "signature": "static int64_t n_memcmp(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 75, "name": "n_strchr", "signature": "static int64_t n_strchr(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 81, "name": "n_strstr", "signature": "static int64_t n_strstr(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 88, "name": "n_malloc", "signature": "static int64_t n_malloc(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 93, "name": "n_free", "signature": "static int64_t n_free(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 98, "name": "n_calloc", "signature": "static int64_t n_calloc(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 106, "name": "n_realloc", "signature": "static int64_t n_realloc(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 114, "name": "n_exit", "signature": "static int64_t n_exit(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 121, "name": "n_fopen", "signature": "static int64_t n_fopen(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 128, "name": "n_fclose", "signature": "static int64_t n_fclose(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 134, "name": "n_fread", "signature": "static int64_t n_fread(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 141, "name": "n_fwrite", "signature": "static int64_t n_fwrite(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 148, "name": "n_fseek", "signature": "static int64_t n_fseek(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 154, "name": "n_ftell", "signature": "static int64_t n_ftell(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 160, "name": "n_rewind", "signature": "static int64_t n_rewind(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 167, "name": "n_fputs", "signature": "static int64_t n_fputs(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 173, "name": "n_fputc", "signature": "static int64_t n_fputc(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 179, "name": "n_fgetc", "signature": "static int64_t n_fgetc(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 185, "name": "n_ungetc", "signature": "static int64_t n_ungetc(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 191, "name": "n_fflush", "signature": "static int64_t n_fflush(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 197, "name": "n_putchar", "signature": "static int64_t n_putchar(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 204, "name": "n_write", "signature": "static int64_t n_write(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 213, "name": "n_read", "signature": "static int64_t n_read(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 228, "name": "n_puts", "signature": "static int64_t n_puts(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 236, "name": "n_atol", "signature": "static int64_t n_atol(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 249, "name": "n_strtol", "signature": "static int64_t n_strtol(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 262, "name": "n_stderr_addr", "signature": "static int64_t n_stderr_addr(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 267, "name": "n_stdout_addr", "signature": "static int64_t n_stdout_addr(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 272, "name": "n_stdin_addr", "signature": "static int64_t n_stdin_addr(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 288, "name": "kout_char", "signature": "static void kout_char(void *ctx, char c)"}, {"kind": "function", "line": 300, "name": "kout_uint", "signature": "static void kout_uint(void *ctx, unsigned long long v, int base, int upper)"}, {"kind": "function", "line": 313, "name": "kformat", "signature": "static void kformat(void *ctx, const char *fmt, uint64_t *argv, int argc)"}, {"doc": "Docstring: fprintf native. The stream is the first argument, the format the second, the variadic values follow in the CVM argument * vector.", "kind": "function", "line": 390, "name": "n_fprintf", "signature": "static int64_t n_fprintf(void *vm, int ac, uint64_t *av)"}, {"doc": "vector. static int64_t n_fprintf(void *vm, int ac, uint64_t *av) { (void)vm; if (ac < 2) return -1; kout_sink k; k.f = (FILE *)(uintptr_t)av[0]; k.buf = 0; k.cap = 0; k.len = 0; kformat(&k, (const char *)(uintptr_t)av[1], av + 2, ac - 2); return 0; } /* Docstring: printf native. Writes to the standard output.", "kind": "function", "line": 403, "name": "n_printf", "signature": "static int64_t n_printf(void *vm, int ac, uint64_t *av)"}, {"doc": "Docstring: sprintf native. Formats into the caller's buffer and returns the number of characters written. The buffer is the first * argument, the format the second, the variadic values follow.", "kind": "function", "line": 418, "name": "n_sprintf", "signature": "static int64_t n_sprintf(void *vm, int ac, uint64_t *av)"}, {"kind": "function", "line": 452, "name": "register_host_natives", "signature": "static void register_host_natives(CvmState *vm)"}, {"kind": "function", "line": 497, "name": "cvm_main", "signature": "int cvm_main(int argc, char **argv)"}]}, {"doc": "Docstring: kernel/ed25519.c -- Ed25519 signature verification.", "id": "kernel/ed25519.c", "kind": "module", "label": "ed25519.c", "language": "c", "sha256": "4ffd0301628ece66", "symbol_count": 36, "symbols": [{"kind": "struct", "line": 28, "name": "ed_fe"}, {"kind": "struct", "line": 32, "name": "ed_ge"}, {"doc": "Field elements are four little-endian 64-bit limbs. Products use __uint128_t schoolbook multiply with repeated 38-folds, and scalars reduce mod L by binary long division, so no transcription-risk prime multiple tables are needed. Point decoding recovers x by exponentiation with a sqrt(-1) adjustment computed at run time, so the only transcribed constants are the base point encoding, L, q and the SHA-512 table, all generated by script and pinned by tests/test_sign.c.  Every input to verification is public (signature, message, key), so variable-time field arithmetic is acceptable here; the scalar multiply still uses double-and-add-always out of hygiene.", "kind": "type_alias", "line": 23, "name": "ed_u64", "signature": "typedef unsigned long long ed_u64;"}, {"kind": "function", "line": 84, "name": "ed_rotr", "signature": "static ed_u64 ed_rotr(ed_u64 x, unsigned n)"}, {"doc": "/** Docstring: Compressed base point: 0x58 then thirty-one 0x66. static const unsigned char ed_braw[32] = { 0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66 }; static ed_u64 ed_rotr(ed_u64 x, unsigned n) { return (x >> n) | (x << (64u - n)); } /** Docstring: One SHA-512 compression over a 128-byte block.", "kind": "function", "line": 89, "name": "ed_sha_block", "signature": "static void ed_sha_block(ed_sha *c, const unsigned char *p)"}, {"doc": "b = a; a = t1 + t2; } c->h[0] += a; c->h[1] += b; c->h[2] += cc; c->h[3] += d; c->h[4] += e; c->h[5] += f; c->h[6] += g; c->h[7] += h; } /** Docstring: Start a SHA-512 digest.", "kind": "function", "line": 147, "name": "ed_sha512_init", "signature": "void ed_sha512_init(ed_sha *c)"}, {"doc": "c->h[0] = 0x6a09e667f3bcc908ULL; c->h[1] = 0xbb67ae8584caa73bULL; c->h[2] = 0x3c6ef372fe94f82bULL; c->h[3] = 0xa54ff53a5f1d36f1ULL; c->h[4] = 0x510e527fade682d1ULL; c->h[5] = 0x9b05688c2b3e6c1fULL; c->h[6] = 0x1f83d9abfb41bd6bULL; c->h[7] = 0x5be0cd19137e2179ULL; c->lo = 0; c->hi = 0; c->used = 0; } /** Docstring: Feed bytes into a running SHA-512 digest.", "kind": "function", "line": 162, "name": "ed_sha512_update", "signature": "void ed_sha512_update(ed_sha *c, const unsigned char *data, unsigned long len)"}, {"doc": "if ((unsigned long)take > left) take = (unsigned)left; for (k = 0; k < take; k++) c->buf[c->used + k] = data[i + k]; c->used += take; i += take; if (c->used == 128u) { ed_sha_block(c, c->buf); c->used = 0; } } } /** Docstring: Finish a SHA-512 digest into 64 bytes, big-endian length.", "kind": "function", "line": 188, "name": "ed_sha512_final", "signature": "void ed_sha512_final(ed_sha *c, unsigned char out[64])"}, {"doc": "for (k = 0; k < 8u; k++) c->buf[112u + k] = (unsigned char)(c->hi >> (56u - 8u * k)); for (k = 0; k < 8u; k++) c->buf[120u + k] = (unsigned char)(c->lo >> (56u - 8u * k)); ed_sha_block(c, c->buf); for (i = 0; i < 8u; i++) { unsigned b = i * 8u; unsigned s; for (s = 0; s < 8u; s++) out[b + s] = (unsigned char)(c->h[i] >> (56u - 8u * s)); } } /** Docstring: Copy one field element.", "kind": "function", "line": 214, "name": "ed_fe_copy", "signature": "static void ed_fe_copy(ed_fe *r, const ed_fe *a)"}, {"doc": "for (s = 0; s < 8u; s++) out[b + s] = (unsigned char)(c->h[i] >> (56u - 8u * s)); } } /** Docstring: Copy one field element. static void ed_fe_copy(ed_fe *r, const ed_fe *a) { r->v[0] = a->v[0]; r->v[1] = a->v[1]; r->v[2] = a->v[2]; r->v[3] = a->v[3]; } /** Docstring: Zero one field element.", "kind": "function", "line": 222, "name": "ed_fe_zero", "signature": "static void ed_fe_zero(ed_fe *r)"}, {"doc": "r->v[1] = a->v[1]; r->v[2] = a->v[2]; r->v[3] = a->v[3]; } /** Docstring: Zero one field element. static void ed_fe_zero(ed_fe *r) { r->v[0] = 0; r->v[1] = 0; r->v[2] = 0; r->v[3] = 0; } /** Docstring: One as a field element.", "kind": "function", "line": 230, "name": "ed_fe_one", "signature": "static void ed_fe_one(ed_fe *r)"}, {"doc": "r->v[1] = 0; r->v[2] = 0; r->v[3] = 0; } /** Docstring: One as a field element. static void ed_fe_one(ed_fe *r) { r->v[0] = 1; r->v[1] = 0; r->v[2] = 0; r->v[3] = 0; } /** Docstring: Constant-time select between two field elements.", "kind": "function", "line": 238, "name": "ed_fe_cmov", "signature": "static void ed_fe_cmov(ed_fe *r, const ed_fe *b, unsigned flag)"}, {"doc": "r->v[2] = 0; r->v[3] = 0; } /** Docstring: Constant-time select between two field elements. static void ed_fe_cmov(ed_fe *r, const ed_fe *b, unsigned flag) { ed_u64 m = 0ULL - (ed_u64)(flag & 1u); r->v[0] ^= m & (r->v[0] ^ b->v[0]); r->v[1] ^= m & (r->v[1] ^ b->v[1]); r->v[2] ^= m & (r->v[2] ^ b->v[2]); r->v[3] ^= m & (r->v[3] ^ b->v[3]); } /** Docstring: 1 when a is at least b as 256-bit integers, else 0.", "kind": "function", "line": 247, "name": "ed_fe_ge", "signature": "static unsigned ed_fe_ge(const ed_fe *a, const ed_fe *b)"}, {"doc": "} /** Docstring: 1 when a is at least b as 256-bit integers, else 0. static unsigned ed_fe_ge(const ed_fe *a, const ed_fe *b) { if (a->v[3] != b->v[3]) return (a->v[3] > b->v[3]) ? 1u : 0u; if (a->v[2] != b->v[2]) return (a->v[2] > b->v[2]) ? 1u : 0u; if (a->v[1] != b->v[1]) return (a->v[1] > b->v[1]) ? 1u : 0u; return (a->v[0] >= b->v[0]) ? 1u : 0u; } /** Docstring: r holds a minus b, caller guarantees a above b.", "kind": "function", "line": 258, "name": "ed_fe_rawsub", "signature": "static void ed_fe_rawsub(ed_fe *r, const ed_fe *a, const ed_fe *b)"}, {"doc": "ed_u64 d2 = a->v[2] - bw1; ed_u64 c3 = (d2 > a->v[2]) ? 1u : 0u; ed_u64 t2 = d2 - b->v[2]; ed_u64 c4 = (t2 > d2) ? 1u : 0u; ed_u64 bw2 = c3 | c4; ed_u64 d3 = a->v[3] - bw2; ed_u64 t3 = d3 - b->v[3]; r->v[0] = t0; r->v[1] = t1; r->v[2] = t2; r->v[3] = t3; } /** Docstring: r holds a plus b mod q with one conditional subtract.", "kind": "function", "line": 280, "name": "ed_fe_add", "signature": "static void ed_fe_add(ed_fe *r, const ed_fe *a, const ed_fe *b)"}, {"doc": "c = (__uint128_t)a->v[2] + b->v[2] + (ed_u64)(c >> 64); t.v[2] = (ed_u64)c; c = (__uint128_t)a->v[3] + b->v[3] + (ed_u64)(c >> 64); t.v[3] = (ed_u64)c; q.v[0] = ed_qq[0]; q.v[1] = ed_qq[1]; q.v[2] = ed_qq[2]; q.v[3] = ed_qq[3]; if ((ed_u64)(c >> 64) || ed_fe_ge(&t, &q)) ed_fe_rawsub(&t, &t, &q); ed_fe_copy(r, &t); } /** Docstring: r holds a minus b mod q with borrow folded back.", "kind": "function", "line": 302, "name": "ed_fe_sub", "signature": "static void ed_fe_sub(ed_fe *r, const ed_fe *a, const ed_fe *b)"}, {"doc": "q.v[2] = ed_qq[2]; q.v[3] = ed_qq[3]; c = (__uint128_t)t.v[0] + q.v[0]; t.v[0] = (ed_u64)c; c = (__uint128_t)t.v[1] + q.v[1] + (ed_u64)(c >> 64); t.v[1] = (ed_u64)c; c = (__uint128_t)t.v[2] + q.v[2] + (ed_u64)(c >> 64); t.v[2] = (ed_u64)c; t.v[3] = t.v[3] + q.v[3] + (ed_u64)(c >> 64); } ed_fe_copy(r, &t); } /** Docstring: Fold eight limbs mod q with three 38-fold passes.", "kind": "function", "line": 344, "name": "ed_fe_fold", "signature": "static void ed_fe_fold(ed_fe *r, ed_u64 w[8])"}, {"doc": "back.v[0] = w[4] * 38u; back.v[1] = 0; back.v[2] = 0; back.v[3] = 0; ed_fe_add(&t, &t, &back); if (ed_fe_ge(&t, &q)) ed_fe_rawsub(&t, &t, &q); if (ed_fe_ge(&t, &q)) ed_fe_rawsub(&t, &t, &q); } ed_fe_copy(r, &t); } /** Docstring: r holds a times b mod q, schoolbook over 128-bit lanes.", "kind": "function", "line": 387, "name": "ed_fe_mul", "signature": "static void ed_fe_mul(ed_fe *r, const ed_fe *a, const ed_fe *b)"}, {"doc": "} carry = acc; k = i + 4u; while (carry && k < 8u) { __uint128_t s = (__uint128_t)t[k] + (ed_u64)carry; t[k] = (ed_u64)s; carry = s >> 64; k++; } } ed_fe_fold(r, t); } /** Docstring: r holds a squared mod q.", "kind": "function", "line": 416, "name": "ed_fe_sq", "signature": "static void ed_fe_sq(ed_fe *r, const ed_fe *a)"}, {"doc": "t[k] = (ed_u64)s; carry = s >> 64; k++; } } ed_fe_fold(r, t); } /** Docstring: r holds a squared mod q. static void ed_fe_sq(ed_fe *r, const ed_fe *a) { ed_fe_mul(r, a, a); } /** Docstring: r holds a to the e mod q, MSB first, always square.", "kind": "function", "line": 421, "name": "ed_fe_pow", "signature": "static void ed_fe_pow(ed_fe *r, const ed_fe *a, const unsigned char *bits, unsigned nbits)"}, {"doc": "Docstring: r holds one over a mod q via Fermat, exponent q minus 2.  * q minus 2 keeps bits 0, 1, 3 and 5..254 set with 2 and 4 clear.", "kind": "function", "line": 438, "name": "ed_fe_inv", "signature": "static void ed_fe_inv(ed_fe *r, const ed_fe *a)"}, {"doc": "Docstring: r holds one over a mod q via Fermat, exponent q minus 2.  * q minus 2 keeps bits 0, 1, 3 and 5..254 set with 2 and 4 clear. static void ed_fe_inv(ed_fe *r, const ed_fe *a) { unsigned char bits[255]; unsigned i; for (i = 0; i < 255u; i++) bits[i] = 1; bits[252u] = 0; bits[250u] = 0; ed_fe_pow(r, a, bits, 255u); } /** Docstring: Load 32 little-endian bytes into a field element.", "kind": "function", "line": 449, "name": "ed_fe_frombytes", "signature": "static void ed_fe_frombytes(ed_fe *r, const unsigned char b[32])"}, {"doc": "/** Docstring: Load 32 little-endian bytes into a field element. static void ed_fe_frombytes(ed_fe *r, const unsigned char b[32]) { unsigned i; unsigned k; for (i = 0; i < 4u; i++) { ed_u64 w = 0; for (k = 0; k < 8u; k++) w |= (ed_u64)b[i * 8u + k] << (8u * k); r->v[i] = w; } } /** Docstring: Store a field element as 32 little-endian bytes.", "kind": "function", "line": 461, "name": "ed_fe_tobytes", "signature": "static void ed_fe_tobytes(unsigned char b[32], const ed_fe *a)"}, {"doc": "r->v[i] = w; } } /** Docstring: Store a field element as 32 little-endian bytes. static void ed_fe_tobytes(unsigned char b[32], const ed_fe *a) { unsigned i; unsigned k; for (i = 0; i < 4u; i++) for (k = 0; k < 8u; k++) b[i * 8u + k] = (unsigned char)(a->v[i] >> (8u * k)); } /** Docstring: 1 when a equals b limb-wise, else 0.", "kind": "function", "line": 470, "name": "ed_fe_eq", "signature": "static unsigned ed_fe_eq(const ed_fe *a, const ed_fe *b)"}, {"doc": "unsigned k; for (i = 0; i < 4u; i++) for (k = 0; k < 8u; k++) b[i * 8u + k] = (unsigned char)(a->v[i] >> (8u * k)); } /** Docstring: 1 when a equals b limb-wise, else 0. static unsigned ed_fe_eq(const ed_fe *a, const ed_fe *b) { ed_u64 d = (a->v[0] ^ b->v[0]) | (a->v[1] ^ b->v[1]) | (a->v[2] ^ b->v[2]) | (a->v[3] ^ b->v[3]); return (d == 0u) ? 1u : 0u; } /** Docstring: 1 when the 32-byte value is canonical, below q.", "kind": "function", "line": 477, "name": "ed_bytes_lt_q", "signature": "static unsigned ed_bytes_lt_q(const unsigned char b[32])"}, {"doc": "i--; if (i == 31u) qb = 0x7f; else if (i == 0u) qb = 0xed; else qb = 0xff; if (b[i] != qb) return (b[i] < qb) ? 1u : 0u; } return 1u; } /** Docstring: 1 when the 32-byte scalar is canonical, below L.", "kind": "function", "line": 495, "name": "ed_scalar_lt_l", "signature": "static unsigned ed_scalar_lt_l(const unsigned char b[32])"}, {"doc": "lb = (unsigned char)(ed_ll[1] >> (8u * (i - 8u))); else if (i < 24u) lb = 0; else if (i < 31u) lb = 0; else lb = 0x10; if (b[i] != lb) return (b[i] < lb) ? 1u : 0u; } return 1u; } /** Docstring: Subtract the 320-bit order from a 320-bit remainder.", "kind": "function", "line": 517, "name": "ed_rem_sub", "signature": "static void ed_rem_sub(ed_u64 r[5], const ed_u64 a[5], const ed_u64 b[5])"}, {"doc": "ed_u64 c5 = (d3 > a[3]) ? 1u : 0u; ed_u64 t3 = d3 - b[3]; ed_u64 c6 = (t3 > d3) ? 1u : 0u; ed_u64 bw3 = c5 | c6; ed_u64 d4 = a[4] - bw3; ed_u64 t4 = d4 - b[4]; r[0] = t0; r[1] = t1; r[2] = t2; r[3] = t3; r[4] = t4; } /** Docstring: 1 when the 320-bit a holds at least b, else 0.", "kind": "function", "line": 545, "name": "ed_rem_ge", "signature": "static unsigned ed_rem_ge(const ed_u64 a[5], const ed_u64 b[5])"}, {"doc": "/** Docstring: 1 when the 320-bit a holds at least b, else 0. static unsigned ed_rem_ge(const ed_u64 a[5], const ed_u64 b[5]) { if (a[4] != b[4]) return (a[4] > b[4]) ? 1u : 0u; if (a[3] != b[3]) return (a[3] > b[3]) ? 1u : 0u; if (a[2] != b[2]) return (a[2] > b[2]) ? 1u : 0u; if (a[1] != b[1]) return (a[1] > b[1]) ? 1u : 0u; return (a[0] >= b[0]) ? 1u : 0u; } /** Docstring: Reduce a 64-byte digest mod L by binary long division.", "kind": "function", "line": 557, "name": "ed_mod_l", "signature": "static void ed_mod_l(ed_fe *r, const unsigned char h[64])"}, {"doc": "if (ed_rem_ge(rem, lv)) { ed_rem_sub(tmp, rem, lv); for (nk = 0; nk < 5u; nk++) rem[nk] = tmp[nk]; } } } r->v[0] = rem[0]; r->v[1] = rem[1]; r->v[2] = rem[2]; r->v[3] = rem[3]; } /** Docstring: Copy one extended point.", "kind": "function", "line": 596, "name": "ed_ge_copy", "signature": "static void ed_ge_copy(ed_ge *r, const ed_ge *a)"}, {"doc": "r->v[1] = rem[1]; r->v[2] = rem[2]; r->v[3] = rem[3]; } /** Docstring: Copy one extended point. static void ed_ge_copy(ed_ge *r, const ed_ge *a) { ed_fe_copy(&r->x, &a->x); ed_fe_copy(&r->y, &a->y); ed_fe_copy(&r->z, &a->z); ed_fe_copy(&r->t, &a->t); } /** Docstring: Constant-time point select for the scalar multiply.", "kind": "function", "line": 604, "name": "ed_ge_cmov", "signature": "static void ed_ge_cmov(ed_ge *r, const ed_ge *b, unsigned flag)"}, {"doc": "ed_fe_copy(&r->y, &a->y); ed_fe_copy(&r->z, &a->z); ed_fe_copy(&r->t, &a->t); } /** Docstring: Constant-time point select for the scalar multiply. static void ed_ge_cmov(ed_ge *r, const ed_ge *b, unsigned flag) { ed_fe_cmov(&r->x, &b->x, flag); ed_fe_cmov(&r->y, &b->y, flag); ed_fe_cmov(&r->z, &b->z, flag); ed_fe_cmov(&r->t, &b->t, flag); } /** Docstring: Complete twisted-Edwards addition, valid for all inputs.", "kind": "function", "line": 612, "name": "ed_ge_add", "signature": "static void ed_ge_add(ed_ge *r, const ed_ge *p, const ed_ge *q, const ed_fe *d2)"}, {"doc": "ed_fe_mul(&c, &t0, d2); ed_fe_add(&t0, &p->z, &p->z); ed_fe_mul(&d, &t0, &q->z); ed_fe_sub(&e, &b, &a); ed_fe_sub(&f, &d, &c); ed_fe_add(&g, &d, &c); ed_fe_add(&h, &b, &a); ed_fe_mul(&r->x, &e, &f); ed_fe_mul(&r->y, &g, &h); ed_fe_mul(&r->z, &f, &g); ed_fe_mul(&r->t, &e, &h); } /** Docstring: Twisted-Edwards doubling for a fixed at minus one.", "kind": "function", "line": 644, "name": "ed_ge_double", "signature": "static void ed_ge_double(ed_ge *r, const ed_ge *p)"}, {"doc": "ed_fe nb; ed_fe_zero(&na); ed_fe_zero(&nb); ed_fe_sub(&na, &na, &a); ed_fe_sub(&nb, &nb, &b); ed_fe_add(&h, &na, &nb); } ed_fe_mul(&r->x, &e, &f); ed_fe_mul(&r->y, &g, &h); ed_fe_mul(&r->z, &f, &g); ed_fe_mul(&r->t, &e, &h); } /** Docstring: r holds p times the 32-byte little-endian scalar.", "kind": "function", "line": 686, "name": "ed_ge_scalarmult", "signature": "static void ed_ge_scalarmult(ed_ge *r, const ed_ge *p, const unsigned char s[32],\n               ..."}, {"doc": "ed_fe_one(&q.y); ed_fe_one(&q.z); ed_fe_zero(&q.t); for (i = 254; i >= 0; i--) { unsigned bit = (unsigned)((s[i >> 3] >> (i & 7)) & 1u); ed_ge_double(&dbl, &q); ed_ge_copy(&q, &dbl); ed_ge_add(&dbl, &q, p, d2); ed_ge_cmov(&q, &dbl, bit); } ed_ge_copy(r, &q); } /** Docstring: Recover the curve constant d from minus 121665 over 121666.", "kind": "function", "line": 706, "name": "ed_curve_d", "signature": "static void ed_curve_d(ed_fe *d)"}, {"doc": "Docstring: Verify an Ed25519 signature, 1 valid else 0 fail-closed.  Rejects S at or above L and non-canonical R/A encodings before any curve work, then checks [S]B minus [h]A against R by cross-multiplied projective comparison, so no inversion touches * the hot path. Null inputs refuse.", "kind": "function", "line": 810, "name": "ed25519_verify", "signature": "int ed25519_verify(const unsigned char sig[64], const unsigned char *msg,\n                   unsi..."}]}, {"doc": "================================================================", "id": "kernel/editor.c", "kind": "module", "label": "editor.c", "language": "c", "sha256": "c0869a6c0a165ab5", "symbol_count": 22, "symbols": [{"kind": "struct", "line": 24, "name": "EditLine"}, {"kind": "struct", "line": 29, "name": "EditBuf"}, {"kind": "function", "line": 38, "name": "edit_alloc", "signature": "static EditBuf *edit_alloc(const char *fname)"}, {"kind": "function", "line": 55, "name": "edit_free", "signature": "static void edit_free(EditBuf *e)"}, {"kind": "function", "line": 61, "name": "edit_load", "signature": "static int edit_load(EditBuf *e)"}, {"kind": "function", "line": 99, "name": "edit_save", "signature": "static int edit_save(EditBuf *e)"}, {"kind": "function", "line": 113, "name": "edit_print", "signature": "static void edit_print(EditBuf *e, int idx)"}, {"doc": "List a (possibly empty) range [start, end], both 1-based inclusive.  A * single argument lists from that line; no argument lists everything.", "kind": "function", "line": 123, "name": "edit_list", "signature": "static void edit_list(EditBuf *e, int start, int end)"}, {"kind": "function", "line": 135, "name": "edit_set_line", "signature": "static int edit_set_line(EditBuf *e, int idx, const char *text)"}, {"kind": "function", "line": 144, "name": "edit_insert", "signature": "static int edit_insert(EditBuf *e, int idx, const char *text)"}, {"kind": "function", "line": 154, "name": "edit_delete", "signature": "static int edit_delete(EditBuf *e, int idx)"}, {"doc": "Copy a line into a NUL-terminated scratch buffer (lines are otherwise * stored length-prefixed without a terminator).", "kind": "function", "line": 166, "name": "edit_line_cstr", "signature": "static void edit_line_cstr(EditLine *l, char *out)"}, {"kind": "function", "line": 171, "name": "edit_search", "signature": "static void edit_search(EditBuf *e, const char *needle)"}, {"kind": "function", "line": 188, "name": "edit_status", "signature": "static void edit_status(EditBuf *e)"}, {"kind": "function", "line": 196, "name": "edit_usage", "signature": "static void edit_usage(void)"}, {"doc": "A buffer that did not hold the whole file must never be written back: * saving it would drop the part that was never loaded.", "kind": "function", "line": 207, "name": "edit_refuse_save", "signature": "static int edit_refuse_save(EditBuf *e)"}, {"kind": "function", "line": 213, "name": "edit_arg_line", "signature": "static int edit_arg_line(int argc, char **argv, EditBuf *e, int *out)"}, {"kind": "function", "line": 224, "name": "edit_loop", "signature": "static void edit_loop(EditBuf *e)"}, {"kind": "function", "line": 329, "name": "shell_cmd_edit", "signature": "void shell_cmd_edit(int argc, char **argv)"}, {"kind": "macro", "line": 20, "name": "EDIT_MAX_LINES", "signature": "#define EDIT_MAX_LINES"}, {"kind": "macro", "line": 21, "name": "EDIT_LINE_MAX", "signature": "#define EDIT_LINE_MAX"}, {"kind": "macro", "line": 22, "name": "EDIT_FILE_MAX", "signature": "#define EDIT_FILE_MAX"}]}, {"doc": "exec.c - Process execution: setjmp/longjmp, k_exec_user, k_run_rel, kexit.", "id": "kernel/exec.c", "kind": "module", "label": "exec.c", "language": "c", "sha256": "2283a8ad453629a1", "symbol_count": 10, "symbols": [{"kind": "function", "line": 61, "name": "vga_mode_set", "signature": "void vga_mode_set(int on)"}, {"kind": "function", "line": 62, "name": "vga_mode_is_active", "signature": "int  vga_mode_is_active(void)"}, {"kind": "function", "line": 63, "name": "vga_gfx_ran_set", "signature": "void vga_gfx_ran_set(int on)"}, {"doc": "VGA mode tracking: set/cleared by k_exec_user and k_run_rel when a * graphics program owns the display. static int vga_mode13h; static int graphics_program_ran; void vga_mode_set(int on)       { vga_mode13h = on; } int  vga_mode_is_active(void)   { return vga_mode13h; } void vga_gfx_ran_set(int on)    { graphics_program_ran = on; } /* Called from the ISR exception handler when a ring-3 user program faults.", "kind": "function", "line": 66, "name": "k_user_fault_return", "signature": "void k_user_fault_return(void)"}, {"kind": "function", "line": 83, "name": "setup_user_stack", "signature": "unsigned long *setup_user_stack(char *sbase, unsigned long ssize,\n                               ..."}, {"kind": "function", "line": 233, "name": "k_run_rel", "signature": "int k_run_rel(prog_entry_t entry, int argc, char **argv)"}, {"kind": "function", "line": 284, "name": "kexit", "signature": "void kexit(int code)"}, {"doc": "unsigned long sp = ((unsigned long)p - (unsigned long)nwords * 8) & ~15UL; unsigned long *w = (unsigned long *)sp; int idx = 0; w[idx++] = (unsigned long)argc; for (i = 0; i < argc; i++) w[idx++] = (unsigned long)argp[i]; w[idx++] = 0; w[idx++] = 0; w[idx++] = 6;  w[idx++] = 4096; w[idx++] = 25; w[idx++] = (unsigned long)randp; w[idx++] = 0;  w[idx++] = 0; return w; } /* Enter a ring-3 program via iretq.", "kind": "variable", "line": 116, "name": "syscall_kstack", "signature": "extern unsigned long syscall_kstack;"}, {"kind": "macro", "line": 124, "name": "EXEC_KSTACK_SZ", "signature": "#define EXEC_KSTACK_SZ"}, {"kind": "macro", "line": 133, "name": "ETREL_CHILD_STACK_SZ", "signature": "#define ETREL_CHILD_STACK_SZ"}]}, {"doc": "Docstring: kernel/futex.c -- Kernel side of the futex contract.", "id": "kernel/futex.c", "kind": "module", "label": "futex.c", "language": "c", "sha256": "8b4eb47a629b0396", "symbol_count": 10, "symbols": [{"kind": "struct", "line": 16, "name": "futex_table_t"}, {"kind": "function", "line": 23, "name": "futex_hash", "signature": "static unsigned long futex_hash(unsigned long uaddr)"}, {"kind": "function", "line": 31, "name": "futex_bucket", "signature": "static futex_bucket_t *futex_bucket(unsigned long uaddr)"}, {"doc": "static unsigned long futex_hash(unsigned long uaddr) { unsigned long word = uaddr >> 2; word ^= word >> 16; word *= FUTEX_HASH_GOLDEN; word ^= word >> 13; return word & FUTEX_BUCKET_MASK; } static futex_bucket_t *futex_bucket(unsigned long uaddr) { return &futex_table.buckets[futex_hash(uaddr)]; } /** Docstring: Initialize every bucket queue and clear the awaited table.", "kind": "function", "line": 36, "name": "futex_init", "signature": "void futex_init(void)"}, {"doc": "Unlink pid from bucket b's queue (bucket lock held). The walk is bounded by MAX_PROCS: a queue longer than the process table is corrupt, * and walking it forever with interrupts off froze the machine.", "kind": "function", "line": 50, "name": "futex_unlink_locked", "signature": "static void futex_unlink_locked(futex_bucket_t *b, int pid)"}, {"doc": "Docstring: Drop pid from the futex queues (see futex.h). A thread that dies or is killed while waiting stays queued; once its slot is reused the stale node aliases the new thread, and the new thread queueing behind itself linked tail -> tail, a cycle futex_wake spun on forever. * Called before every wait and when a slot is reaped.", "kind": "function", "line": 76, "name": "futex_forget", "signature": "void futex_forget(int pid)"}, {"doc": "futex_table.awaited[cur->pid] = uaddr; if (b->head == WQ_NONE) { b->head = cur->pid; b->tail = cur->pid; } else { procs[b->tail].wq_next = cur->pid; b->tail = cur->pid; } spin_unlock_irqrestore(&b->lock, flags); schedule(); return FUTEX_OK; } /** Docstring: Decode a Linux futex(2) op to WAIT/WAKE.", "kind": "function", "line": 128, "name": "futex_linux_cmd", "signature": "int futex_linux_cmd(long op)"}, {"doc": "} /** Docstring: Decode a Linux futex(2) op to WAIT/WAKE. int futex_linux_cmd(long op) { long cmd; if (op < 0) return -1; cmd = op & ~(long)(LINUX_FUTEX_PRIVATE_FLAG | LINUX_FUTEX_CLOCK_REALTIME); if (cmd == LINUX_FUTEX_WAIT || cmd == LINUX_FUTEX_WAKE || cmd == LINUX_FUTEX_WAIT_BITSET || cmd == LINUX_FUTEX_WAKE_BITSET) return (int)cmd; return -1; } /** Docstring: Microseconds left before a futex timeout (see futex.h).", "kind": "function", "line": 139, "name": "futex_timeout_remaining_us", "signature": "long futex_timeout_remaining_us(int cmd, long sec, long nsec, unsigned long now_us)"}, {"doc": "Docstring: Wake up to n sleepers waiting on uaddr.  Only entries whose recorded address equals uaddr change state; hash collisions sleep through. Entries that no longer sleep (a waiter that died or was killed in the queue) are unlinked on the way. The walk is bounded by MAX_PROCS. Returns the number of threads woken, zero when the bucket holds no waiter for this address. Never sleeps.", "kind": "function", "line": 158, "name": "futex_wake", "signature": "long futex_wake(unsigned long uaddr, int n)"}, {"doc": "ifdef SYNC_HOST_CURRENT_PID", "kind": "variable", "line": 13, "name": "t_cur_pid", "signature": "extern int t_cur_pid;"}]}, {"doc": "klog.c - Structured kernel logging with levels and subsystems.", "id": "kernel/klog.c", "kind": "module", "label": "klog.c", "language": "c", "sha256": "1dcfe0e3242a8601", "symbol_count": 6, "symbols": [{"kind": "function", "line": 29, "name": "klog_set_level", "signature": "void klog_set_level(log_level_t level)"}, {"kind": "function", "line": 33, "name": "klog_set_subsys_level", "signature": "void klog_set_subsys_level(log_subsystem_t subsys, log_level_t level)"}, {"kind": "function", "line": 38, "name": "klog_disable", "signature": "void klog_disable(void)"}, {"kind": "function", "line": 39, "name": "klog_enable", "signature": "void klog_enable(void)"}, {"kind": "function", "line": 41, "name": "klog", "signature": "void klog(log_level_t level, log_subsystem_t subsys,\n          const char *fmt, ...)"}, {"kind": "function", "line": 119, "name": "klog_hexdump", "signature": "void klog_hexdump(log_level_t level, log_subsystem_t subsys,\n                  const void *data, ..."}]}, {"doc": "Docstring: kernel/ldso_parse.c -- pure dynamic-table parsing (T8 ld.so).", "id": "kernel/ldso_parse.c", "kind": "module", "label": "ldso_parse.c", "language": "c", "sha256": "c00eb3dbc215d663", "symbol_count": 20, "symbols": [{"kind": "function", "line": 18, "name": "ldso_rd16", "signature": "static unsigned ldso_rd16(const unsigned char *p)"}, {"kind": "function", "line": 22, "name": "ldso_rd32", "signature": "static unsigned long ldso_rd32(const unsigned char *p)"}, {"kind": "function", "line": 27, "name": "ldso_rd64", "signature": "static unsigned long long ldso_rd64(const unsigned char *p)"}, {"kind": "function", "line": 32, "name": "ldso_slice", "signature": "static int ldso_slice(const unsigned char *file, unsigned long long fsize,\n        unsigned long ..."}, {"kind": "function", "line": 40, "name": "ldso_valid_ehdr", "signature": "static int ldso_valid_ehdr(const unsigned char *file,\n        unsigned long long fsize)"}, {"kind": "function", "line": 54, "name": "ldso_vaddr_to_offset", "signature": "int ldso_vaddr_to_offset(const unsigned char *file,\n        unsigned long long fsize, unsigned lo..."}, {"kind": "function", "line": 86, "name": "ldso_segments", "signature": "int ldso_segments(const unsigned char *file, unsigned long long fsize,\n        LdsoSeg *segs, uns..."}, {"kind": "function", "line": 120, "name": "ldso_find_dynamic", "signature": "int ldso_find_dynamic(const unsigned char *file, unsigned long long fsize,\n        unsigned long ..."}, {"kind": "function", "line": 150, "name": "ldso_scan_dynamic", "signature": "int ldso_scan_dynamic(const unsigned char *file, unsigned long long fsize,\n        unsigned long ..."}, {"kind": "function", "line": 213, "name": "ldso_sym_count", "signature": "int ldso_sym_count(const unsigned char *file, unsigned long long fsize,\n        unsigned long lon..."}, {"kind": "function", "line": 227, "name": "ldso_copy_str", "signature": "int ldso_copy_str(const unsigned char *file, unsigned long long fsize,\n        unsigned long long..."}, {"kind": "function", "line": 250, "name": "ldso_name_eq", "signature": "static int ldso_name_eq(const unsigned char *tab, unsigned long long strsz,\n        unsigned long..."}, {"kind": "function", "line": 263, "name": "ldso_sym_lookup", "signature": "int ldso_sym_lookup(const unsigned char *file, unsigned long long fsize,\n        unsigned long lo..."}, {"kind": "function", "line": 296, "name": "ldso_rela_count", "signature": "int ldso_rela_count(const LdsoDynInfo *info, unsigned *nrela)"}, {"kind": "function", "line": 309, "name": "ldso_read_rela", "signature": "int ldso_read_rela(const unsigned char *file, unsigned long long fsize,\n        unsigned long lon..."}, {"kind": "function", "line": 331, "name": "ldso_basename", "signature": "void ldso_basename(char *out, const char *src)"}, {"kind": "macro", "line": 13, "name": "LDSO_EHSIZE", "signature": "#define LDSO_EHSIZE"}, {"kind": "macro", "line": 14, "name": "LDSO_PHENTSZ", "signature": "#define LDSO_PHENTSZ"}, {"kind": "macro", "line": 15, "name": "LDSO_DYN_ENT", "signature": "#define LDSO_DYN_ENT"}, {"kind": "macro", "line": 16, "name": "LDSO_HASH_HDR", "signature": "#define LDSO_HASH_HDR"}]}, {"doc": "================================================================", "id": "kernel/loader.c", "kind": "module", "label": "loader.c", "language": "c", "sha256": "d883ff63a0117138", "symbol_count": 60, "symbols": [{"kind": "struct", "line": 104, "name": "exec_range"}, {"kind": "struct", "line": 23, "name": "Elf64_Shdr"}, {"kind": "struct", "line": 36, "name": "Elf64_Sym"}, {"kind": "struct", "line": 45, "name": "Elf64_Rela"}, {"kind": "struct", "line": 51, "name": "Elf64_Phdr"}, {"kind": "struct", "line": 388, "name": "LdsoLibEnt"}, {"kind": "function", "line": 114, "name": "elf_name_copy", "signature": "static void elf_name_copy(char *out, unsigned out_cap, const char *tab,\n                         ..."}, {"kind": "function", "line": 128, "name": "elf_load_fail", "signature": "static void elf_load_fail(void *base, void **sec_addrs, const char *why)"}, {"kind": "function", "line": 136, "name": "elf_load", "signature": "void *elf_load(void *data, unsigned size, void **base_out)"}, {"kind": "function", "line": 402, "name": "ldso_pseudo_stat", "signature": "int ldso_pseudo_stat(int ino, unsigned long *size_out)"}, {"kind": "function", "line": 416, "name": "ldso_pseudo_read", "signature": "int ldso_pseudo_read(int ino, void *dst, unsigned long off, unsigned len)"}, {"doc": "Read a whole library file by DT_NEEDED name: exact path first, then the basename, ramdisk before MiniFS (the shell's own search order). * The buffer is heap-owned; every failure releases it.", "kind": "function", "line": 441, "name": "ldso_read_file", "signature": "static int ldso_read_file(const char *name, unsigned char **out,\n        unsigned *size_out)"}, {"doc": "Resolve a DT_NEEDED name to a registry slot, loading and reserving on first use. Validates the full dynamic contract (tables present, 24-byte symbols, hash-sized count, load span inside the region) * before publishing anything.", "kind": "function", "line": 483, "name": "ldso_ensure_slot", "signature": "static int ldso_ensure_slot(const char *needed, int *slot_out)"}, {"kind": "function", "line": 579, "name": "consistent", "signature": "* consistent (the next exec forgets them, a dying window frees them),\n * and only reports. */\nsta..."}, {"doc": "Bind one executable image with DT_NEEDED libraries: map every library into the target window, then resolve each GLOB_DAT row. Static images (no dynamic section, or none needed) return 0 at once, so the legacy paths never observe a difference. Live callers pass cr3 0 and vma 0 (current tables, legacy view already bound); * isolated callers pass the child's tables and context.", "kind": "function", "line": 794, "name": "ldso_bind_into", "signature": "int ldso_bind_into(void *data, unsigned size, unsigned long base,\n        unsigned long cr3, vma_..."}, {"kind": "function", "line": 984, "name": "apply_exec_relocs", "signature": "static void apply_exec_relocs(void *data, unsigned size, unsigned long base,\n                    ..."}, {"doc": "case R_X86_64_GLOB_DAT: case R_X86_64_JUMP_SLOT: PP = S; break; } } } } #define SHT_NOTE    7 #define SIGN_NOTE_NAME \".note.minios.sign\" /* Size of one note field rounded up to ELF_NOTE_ALIGN.", "kind": "function", "line": 1072, "name": "elf_note_pad", "signature": "static unsigned long elf_note_pad(unsigned long n)"}, {"doc": "Docstring: Pull the signature descriptor out of one PT_NOTE span.  Walks notes with the same pad math as the process-note probe. A candidate carries name MINIOS_NOTE_NAME, type MINIOS_NOTE_SIGN and a SIGN_DESC_BYTES descriptor holding one key id byte plus the 64-byte Ed25519 signature. Reports 1 with the descriptor address, * else 0.", "kind": "function", "line": 1083, "name": "elf_sign_note_span", "signature": "static int elf_sign_note_span(const unsigned char *img, unsigned long off,\n                      ..."}, {"doc": "Docstring: Find a signature note across the PT_NOTE segments. * Reports 1 with the first descriptor found, else 0.", "kind": "function", "line": 1108, "name": "elf_sign_note_find", "signature": "static int elf_sign_note_find(const unsigned char *img, unsigned size,\n                          ..."}, {"doc": "Docstring: Find a signature note in the SHT_NOTE section table.  Post-link signing (tools/sign_elf.py) appends a non-allocated .note.minios.sign section, so binaries whose link never carried the note still verify. Bounds discipline mirrors the ET_REL loader: table extent, per-section ranges and the string table are all checked before any byte is read. Reports 1 with the * descriptor address, else 0.", "kind": "function", "line": 1132, "name": "elf_sign_section_find", "signature": "static int elf_sign_section_find(const unsigned char *img, unsigned size,\n                       ..."}, {"doc": "elf_note_pad(SIGN_DESC_BYTES)) continue; elf_name_copy(secname, sizeof(secname), shstrtab, shstr->sh_size, shdrs[i].sh_name); if (kstrcmp(secname, SIGN_NOTE_NAME) != 0) continue; desc_out = img + shdrs[i].sh_offset + ELF_NOTE_HDR + elf_note_pad(sizeof(MINIOS_NOTE_NAME)); return 1; } return 0; } /** Docstring: Feed one little-endian u64 into the image digest.", "kind": "function", "line": 1172, "name": "elf_sign_u64", "signature": "static void elf_sign_u64(ed_sha *c, unsigned long v)"}, {"doc": "} return 0; } /** Docstring: Feed one little-endian u64 into the image digest. static void elf_sign_u64(ed_sha *c, unsigned long v) { unsigned char b[8]; unsigned k; for (k = 0; k < 8u; k++) b[k] = (unsigned char)(v >> (8u * k)); ed_sha512_update(c, b, 8ul); } /** Docstring: Feed one little-endian u32 into the image digest.", "kind": "function", "line": 1181, "name": "elf_sign_u32", "signature": "static void elf_sign_u32(ed_sha *c, unsigned v)"}, {"kind": "function", "line": 1262, "name": "load_exec_elf", "signature": "void *load_exec_elf(void *data, unsigned size)"}, {"kind": "function", "line": 1395, "name": "base_out", "signature": "* the link base via base_out (0 when the caller runs static images\n * only: the dynamic binder ne..."}, {"doc": "Does an ET_EXEC/ET_DYN image ask to run as a process (minios_abi.h, process note)? Header and program-header table are bounds checked like load_exec_elf_into; any malformed table answers 0 and leaves the load * itself to report it.", "kind": "function", "line": 1432, "name": "elf_wants_process", "signature": "int elf_wants_process(const void *data, unsigned size)"}, {"kind": "function", "line": 1456, "name": "load_exec_elf_into", "signature": "void *load_exec_elf_into(void *data, unsigned size, unsigned long cr3,\n                         u..."}, {"kind": "function", "line": 381, "name": "inodes", "signature": "* Pseudo inodes (LDSO_INO_BASE + slot) keep registry pages apart from * MiniFS inodes in the shared cache. No unload in v1: slots and file * copies live for the machine's life, and the refcount names "}, {"kind": "function", "line": 790, "name": "images", "signature": "* Static images (no dynamic section, or none needed) return 0 at * once, so the legacy paths never observe a difference. Live callers * pass cr3 0 and vma 0 (current tables, legacy view already bound)"}, {"kind": "function", "line": 1288, "name": "process", "signature": "* atomic section: a 100 Hz tick between two segments would switch * CR3 into another process (copies landing in its pages, NX marks * and brk carved from its view) and corrupt whoever loses. The * iso"}, {"kind": "function", "line": 1520, "name": "time", "signature": "* time (with the failing offset);"}, {"kind": "macro", "line": 62, "name": "ELF64_R_SYM", "signature": "#define ELF64_R_SYM(i)"}, {"kind": "macro", "line": 63, "name": "ELF64_R_TYPE", "signature": "#define ELF64_R_TYPE(i)"}, {"kind": "macro", "line": 64, "name": "SHN_UNDEF", "signature": "#define SHN_UNDEF"}, {"kind": "macro", "line": 71, "name": "ETREL_IMAGE_MAX", "signature": "#define ETREL_IMAGE_MAX"}, {"kind": "macro", "line": 73, "name": "SHT_SYMTAB", "signature": "#define SHT_SYMTAB"}, {"kind": "macro", "line": 74, "name": "SHT_STRTAB", "signature": "#define SHT_STRTAB"}, {"kind": "macro", "line": 75, "name": "SHT_RELA", "signature": "#define SHT_RELA"}, {"kind": "macro", "line": 76, "name": "SHT_PROGBITS", "signature": "#define SHT_PROGBITS"}, {"kind": "macro", "line": 77, "name": "SHT_NOBITS", "signature": "#define SHT_NOBITS"}, {"kind": "macro", "line": 78, "name": "SHF_ALLOC", "signature": "#define SHF_ALLOC"}, {"kind": "macro", "line": 79, "name": "SHF_EXECINSTR", "signature": "#define SHF_EXECINSTR"}, {"kind": "macro", "line": 81, "name": "EM_X86_64", "signature": "#define EM_X86_64"}, {"kind": "macro", "line": 82, "name": "PT_LOAD", "signature": "#define PT_LOAD"}, {"kind": "macro", "line": 83, "name": "PT_NOTE", "signature": "#define PT_NOTE"}, {"kind": "macro", "line": 87, "name": "ELF_NOTE_HDR", "signature": "#define ELF_NOTE_HDR"}, {"kind": "macro", "line": 88, "name": "ELF_NOTE_ALIGN", "signature": "#define ELF_NOTE_ALIGN"}, {"kind": "macro", "line": 90, "name": "R_X86_64_64", "signature": "#define R_X86_64_64"}, {"kind": "macro", "line": 91, "name": "R_X86_64_PC32", "signature": "#define R_X86_64_PC32"}, {"kind": "macro", "line": 92, "name": "R_X86_64_PLT32", "signature": "#define R_X86_64_PLT32"}, {"kind": "macro", "line": 93, "name": "R_X86_64_GLOB_DAT", "signature": "#define R_X86_64_GLOB_DAT"}, {"kind": "macro", "line": 94, "name": "R_X86_64_JUMP_SLOT", "signature": "#define R_X86_64_JUMP_SLOT"}, {"kind": "macro", "line": 95, "name": "R_X86_64_RELATIVE", "signature": "#define R_X86_64_RELATIVE"}, {"kind": "macro", "line": 96, "name": "R_X86_64_32", "signature": "#define R_X86_64_32"}, {"kind": "macro", "line": 97, "name": "R_X86_64_32S", "signature": "#define R_X86_64_32S"}, {"kind": "macro", "line": 98, "name": "R_X86_64_IRELATIVE", "signature": "#define R_X86_64_IRELATIVE"}, {"kind": "macro", "line": 100, "name": "PF_X", "signature": "#define PF_X"}, {"kind": "macro", "line": 101, "name": "ELF_MAX_SEGMENTS", "signature": "#define ELF_MAX_SEGMENTS"}, {"kind": "macro", "line": 102, "name": "ELF_NAME_MAX", "signature": "#define ELF_NAME_MAX"}, {"kind": "macro", "line": 1067, "name": "SHT_NOTE", "signature": "#define SHT_NOTE"}, {"kind": "macro", "line": 1069, "name": "SIGN_NOTE_NAME", "signature": "#define SIGN_NOTE_NAME"}]}, {"id": "kernel/lz4_kernel.c", "kind": "module", "label": "lz4_kernel.c", "language": "c", "sha256": "6d1d884e928c0d06", "symbol_count": 10, "symbols": [{"kind": "function", "line": 7, "name": "LZ4_read32", "signature": "static inline unsigned int LZ4_read32(const unsigned char *p)"}, {"kind": "function", "line": 14, "name": "LZ4_read16", "signature": "static inline unsigned int LZ4_read16(const unsigned char *p)"}, {"kind": "function", "line": 21, "name": "LZ4_write16", "signature": "static inline void LZ4_write16(unsigned char *dst, unsigned short v)"}, {"kind": "function", "line": 26, "name": "LZ4_hash", "signature": "static unsigned int LZ4_hash(const unsigned char *p)"}, {"kind": "function", "line": 33, "name": "LZ4_compressBound", "signature": "int LZ4_compressBound(int inputSize)"}, {"kind": "function", "line": 40, "name": "LZ4_compress_default", "signature": "int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity)"}, {"kind": "function", "line": 176, "name": "LZ4_decompress_safe", "signature": "int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity)"}, {"kind": "function", "line": 43, "name": "slots", "signature": "* runs from file writes on 16 KB proc slots (stack discipline, * CLAUDE.md). OOM returns 0 and the caller stores uncompressed. */ int *hash_table = (int *)kmalloc(sizeof(int) * HASH_SIZE);"}, {"kind": "macro", "line": 4, "name": "HASH_BITS", "signature": "#define HASH_BITS"}, {"kind": "macro", "line": 5, "name": "HASH_SIZE", "signature": "#define HASH_SIZE"}]}, {"doc": "Docstring: kernel/minifetch.c -- neofetch-style system screen.", "id": "kernel/minifetch.c", "kind": "module", "label": "minifetch.c", "language": "c", "sha256": "f177ac211f885aa1", "symbol_count": 6, "symbols": [{"kind": "struct", "line": 21, "name": "minifetch_cfg"}, {"doc": "\"       DOOM  ready.           \", \"                              \", \"                              \", \"                              \", \"                              \", \"                              \", \"                              \", \"                              \", \"                              \", \"                              \", \"                              \", }; /** Docstring: Render one logo row into out from RGBA pixels.", "kind": "function", "line": 57, "name": "minifetch_row", "signature": "static void minifetch_row(const unsigned char *img, int w, int h, int row,\n                      ..."}, {"doc": "const unsigned char *p1 = img + ((y1 * w) + sx) * 4; unsigned lum; if (p0[3] < 128 && p1[3] < 128) { out[x] = ' '; continue; } lum = (unsigned)(p0[0] + p0[1] + p0[2] + p1[0] + p1[1] + p1[2]) / 6; c = (int)(lum * (unsigned)(ramp_len - 1) / 255); out[x] = mf_cfg.ramp[c]; } out[mf_cfg.logo_cols] = 0; } /** Docstring: Fill rows with the live logo or the fallback text.", "kind": "function", "line": 81, "name": "minifetch_logo", "signature": "static void minifetch_logo(char rows[16][33])"}, {"doc": "stbi_image_free(img); for (r = 0; r < mf_cfg.logo_rows; r++) { for (i = 0; i < mf_cfg.logo_cols; i++) rows[r][i] = mf_fallback[r][i]; rows[r][mf_cfg.logo_cols] = 0; } return; } for (r = 0; r < mf_cfg.logo_rows; r++) minifetch_row(img, w, h, r, rows[r]); stbi_image_free(img); } /** Docstring: Print the spec column into lines, return line count.", "kind": "function", "line": 101, "name": "minifetch_specs", "signature": "static int minifetch_specs(char lines[20][96])"}, {"doc": "ksprintf(lines[n++], \"Display: %dx%dx%d\", fb_width, fb_height, fb_bpp); ksprintf(lines[n++], \"Net: %02x:%02x:%02x:%02x:%02x:%02x %u.%u.%u.%u\", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ip[0], ip[1], ip[2], ip[3]); if (ok) ksprintf(lines[n++], \"Date: %02d:%02d:%02d CMOS\", hh, mm, ss); else ksprintf(lines[n++], \"Date: unavailable\"); ksprintf(lines[n++], \"Toolchain: minigcc.o + ld.o + cvm.o\"); ksprintf(lines[n++], \"Shell: minios sh + lua + micropython\"); return n; } /** Docstring: Print the two-column fetch screen.", "kind": "function", "line": 156, "name": "shell_cmd_minifetch", "signature": "void shell_cmd_minifetch(void)"}, {"kind": "function", "line": 159, "name": "frame", "signature": "* frame (stack discipline, CLAUDE.md). Fail-closed on OOM. */ char (*specs)[96] = (char (*)[96])kmalloc(20 * 96);"}]}, {"doc": "Docstring: kernel/mm/cow.c -- Copy-on-write fork support.", "id": "kernel/mm/cow.c", "kind": "module", "label": "cow.c", "language": "c", "sha256": "6e671f1336973bbf", "symbol_count": 28, "symbols": [{"kind": "struct", "line": 58, "name": "cow_entry_t"}, {"kind": "function", "line": 68, "name": "cow_slot", "signature": "static unsigned long cow_slot(unsigned long phys)"}, {"doc": "unsigned long phys; int ref; } cow_entry_t; static cow_entry_t *cow_tab; static unsigned long cow_live; static unsigned long cow_tombs; static int cow_drops; static unsigned long cow_slot(unsigned long phys) { return ((phys >> 12) * COW_HASH_MUL) >> (64 - COW_BITS); } /* Index of phys's live entry, or -1. Caller holds cow_lock.", "kind": "function", "line": 73, "name": "cow_find", "signature": "static int cow_find(unsigned long phys)"}, {"doc": "Retire entry idx: a tombstone keeps later probe chains intact; an empty * table drops every tombstone at once. Caller holds cow_lock.", "kind": "function", "line": 85, "name": "cow_remove", "signature": "static void cow_remove(int idx)"}, {"doc": "Create the table on first use, outside cow_lock (allocation). Fork * without a table copies pages eagerly, as before.", "kind": "function", "line": 98, "name": "cow_table_ensure", "signature": "static void cow_table_ensure(void)"}, {"doc": "Reinsert the live entries in place when tombstones lengthen the probe chains: lift each live entry out and insert it again. Caller holds * cow_lock.", "kind": "function", "line": 110, "name": "cow_rehash", "signature": "static void cow_rehash(void)"}, {"doc": "Docstring: True when phys is still shared copy-on-write. mprotect consults this before setting a writable bit: upgrading a shared page in place would let one window write another's bytes without ever faulting into cow_resolve. Pure scan, no allocation, safe * under the caller's mm_lock (cow_lock is a leaf here).", "kind": "function", "line": 132, "name": "cow_page_shared", "signature": "int cow_page_shared(unsigned long phys)"}, {"doc": "Copy the parent's demand-paging reservations (non-present PTEs carrying PTE_DEMAND) into the child: a reserved, never-touched page is part of * the address space fork duplicates, and the child faults it in fresh.", "kind": "function", "line": 166, "name": "cow_copy_demand", "signature": "static void cow_copy_demand(unsigned long pcr3, unsigned long ccr3)"}, {"kind": "function", "line": 191, "name": "cow_track", "signature": "static int cow_track(unsigned long phys)"}, {"kind": "function", "line": 221, "name": "cow_walk", "signature": "static void cow_walk(unsigned long cr3, cow_walk_fn fn)"}, {"kind": "function", "line": 255, "name": "cow_fork_one", "signature": "static void cow_fork_one(unsigned long pcr3, unsigned long va,\n        volatile unsigned long *ppte)"}, {"kind": "function", "line": 287, "name": "CPU", "signature": "* address space down on every other CPU (tlb_shootdown in do_fork_ex). */\nunsigned long cow_fork_..."}, {"doc": "Docstring: Resolve a write fault on a CoW page: last sharer gets a permission upgrade, otherwise the faulting window gets a private copy. invlpg keeps the local TLB honest and, once the PTE names the private copy, tlb_shootdown drops the shared frame from every sibling thread's TLB on other CPUs (they would keep reading the old bytes). Returns 0 resolved (resume), * -1 not a CoW page (existing fault handling runs).", "kind": "function", "line": 356, "name": "cow_resolve", "signature": "int cow_resolve(unsigned long cr3, unsigned long va)"}, {"doc": "Docstring: Drop one window's CoW shares before its pages are freed: multi-shared pages are unmapped here (phys survives for the other window), last-shared pages are forgotten so pt_free_user frees them * normally. Runs at the head of pt_free_user.", "kind": "function", "line": 421, "name": "cow_release_window", "signature": "void cow_release_window(unsigned long cr3)"}, {"doc": "idx = cow_find(phys); if (idx < 0) continue; if (cow_tab[idx].ref > 1) { cow_tab[idx].ref--; pt[k] = 0; } else { cow_remove(idx); } } } spin_unlock_irqrestore(&cow_lock, cow_irq); } /** Docstring: Live shared-page refs, for the `mem` pressure readout.", "kind": "function", "line": 464, "name": "cow_shared", "signature": "int cow_shared(void)"}, {"kind": "function", "line": 20, "name": "alternative", "signature": "* window is one instruction wide and the alternative (no CoW) is * documented, so the trade stands. */ #include \"kernel.h\" #include \"bootdefs.h\" #include \"vga_fb.h\" #include \"sched.h\" #include \"tlb.h\""}, {"kind": "function", "line": 217, "name": "private", "signature": "* for every present page in a private (non-graphics) slot. Shared * graphics slots are never CoW: the compositor owns them. */ typedef void (*cow_walk_fn)(unsigned long cr3, unsigned long va, volatile"}, {"kind": "macro", "line": 34, "name": "COW_BITS", "signature": "#define COW_BITS"}, {"kind": "macro", "line": 35, "name": "COW_CAP", "signature": "#define COW_CAP"}, {"kind": "macro", "line": 36, "name": "COW_MASK", "signature": "#define COW_MASK"}, {"kind": "macro", "line": 37, "name": "COW_LOAD_MAX", "signature": "#define COW_LOAD_MAX"}, {"kind": "macro", "line": 38, "name": "COW_TOMB_MAX", "signature": "#define COW_TOMB_MAX"}, {"kind": "macro", "line": 39, "name": "COW_EMPTY", "signature": "#define COW_EMPTY"}, {"kind": "macro", "line": 40, "name": "COW_TOMB", "signature": "#define COW_TOMB"}, {"kind": "macro", "line": 41, "name": "COW_HASH_MUL", "signature": "#define COW_HASH_MUL"}, {"kind": "macro", "line": 46, "name": "PT_USER_RO", "signature": "#define PT_USER_RO"}, {"kind": "macro", "line": 47, "name": "PT_USER_RW_ENTRY", "signature": "#define PT_USER_RW_ENTRY"}, {"kind": "macro", "line": 48, "name": "PT_PTE_RW", "signature": "#define PT_PTE_RW"}]}, {"doc": "paging.c - Page table management for the user window and per-process KPTI.", "id": "kernel/mm/paging.c", "kind": "module", "label": "paging.c", "language": "c", "sha256": "60352fa1fb7b6503", "symbol_count": 33, "symbols": [{"doc": "Page-align a kmalloc'd region. The framebuffer/back-buffer PTEs are built once per 4 KB page from the buffer's base address, and x86 masks the low 12 bits of a PTE into flags, so a 16-byte-aligned `kmalloc` pointer would make the first mapped page start at `buf & ~0xFFF` — i.e. up to 4095 bytes BEFORE the buffer. A guest writing its frame to the mapped VA then overwrote the heap chunk in front of the buffer (a live KFILE), which is the corrupt-handle black screen. The block is page aligned through kmalloc_aligned, so the raw pointer travels in * the word below the base and kfree_aligned releases it safely.", "kind": "function", "line": 32, "name": "mm_page_aligned_alloc", "signature": "static unsigned char *mm_page_aligned_alloc(unsigned size,\n                                      ..."}, {"kind": "function", "line": 41, "name": "mm_setup_protections", "signature": "void mm_setup_protections(void)"}, {"doc": "Docstring: Return the 4 KB page table backing a 2 MB identity slot, splitting the boot leaf if needed.  A 2 MB leaf cannot be refined in place, so the slot is replaced by a freshly allocated page table whose entries reproduce the leaf's identity mapping and rights. Returns the table, or 0 when the slot is empty (a hole in the boot identity map is a boot bug, not something to paper over) or * out of memory.", "kind": "function", "line": 235, "name": "kmm_ensure_pt", "signature": "static volatile unsigned long *kmm_ensure_pt(unsigned long phys)"}, {"kind": "function", "line": 259, "name": "coherent", "signature": "* for memory a device reads and writes by DMA: a controller that is not cache\n * coherent (and an..."}, {"kind": "function", "line": 296, "name": "kmm_map_device", "signature": "unsigned long kmm_map_device(unsigned long phys, unsigned long len)"}, {"kind": "function", "line": 336, "name": "mm_user_pte_update", "signature": "void mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3)"}, {"kind": "function", "line": 356, "name": "mm_user_set_exec", "signature": "void mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3)"}, {"kind": "function", "line": 374, "name": "pt_owned_index", "signature": "static int pt_owned_index(unsigned long phys, unsigned long *byte, unsigned *bit)"}, {"doc": "#define PT_OWNED_BYTES (HEAP_SIZE / 0x1000UL / 8UL) static unsigned char *pt_owned; static int pt_owned_index(unsigned long phys, unsigned long *byte, unsigned *bit) { unsigned long idx; if (phys & 0xFFFUL) return 0; if (phys < HEAP_BASE || phys >= HEAP_BASE + HEAP_SIZE) return 0; idx = (phys - HEAP_BASE) / 0x1000UL; byte = idx / 8UL; bit = (unsigned)(idx % 8UL); return 1; } /* 1 when phys is a page pt_page_alloc handed out and nobody freed.", "kind": "function", "line": 385, "name": "pt_page_owned", "signature": "int pt_page_owned(unsigned long phys)"}, {"kind": "function", "line": 392, "name": "pt_page_alloc", "signature": "void *pt_page_alloc(void)"}, {"kind": "function", "line": 411, "name": "pt_page_free", "signature": "void pt_page_free(void *ptr)"}, {"kind": "function", "line": 420, "name": "pt_clone_user", "signature": "uint64_t pt_clone_user(uint64_t parent_cr3)"}, {"doc": "The legacy path identity-maps the user window (VA == PA), so every CR3 built by pt_clone_user aliases the same physical pages. That is why only one ET_EXEC can run at a time today. The helpers below build an EMPTY user window instead: fresh page tables with no user data pages mapped, except the kernel-owned graphics slots (FB, DOOM/NK back-buffers) which stay shared on purpose. Data pages come from the kernel heap via pt_page_alloc, so each process owns its bytes and switch_to's CR3 swap already isolates them. Pages are freed by the extended pt_free_user below, which releases heap-owned data pages in private slots and never touches identity pages or * the shared graphics slots. /* 1 when this PD slot holds kernel-shared graphics mappings.", "kind": "function", "line": 549, "name": "mt_shared_slot", "signature": "static int mt_shared_slot(unsigned long pd_idx)"}, {"doc": "Fresh user window: kernel mappings copied, every user PT zeroed, graphics slots re-shared from the boot tables. Returns PML4 phys * (usable as CR3), or 0 on OOM. No user data page is mapped.", "kind": "function", "line": 568, "name": "pt_clone_user_empty", "signature": "unsigned long pt_clone_user_empty(void)"}, {"doc": "Ensure one 4 KB user page at va inside cr3 exists (heap-owned). * Returns 0 on success, -1 on OOM or when va leaves the user window.", "kind": "function", "line": 625, "name": "mm_user_ensure_page", "signature": "int mm_user_ensure_page(unsigned long cr3, unsigned long va)"}, {"kind": "function", "line": 655, "name": "honest", "signature": "* and invlpg keeps the local TLB honest (cross-CPU shootdown rides\n * the documented T5 follow-up..."}, {"doc": "Docstring: PTE walker shared by the fault, fork and teardown * paths (forward declaration; documented at the definition). static volatile unsigned long *mm_file_pte(unsigned long cr3, unsigned long va); /* Encode a Linux prot as a demand-paging reservation PTE.", "kind": "function", "line": 704, "name": "mm_demand_pte", "signature": "unsigned long mm_demand_pte(unsigned long prot)"}, {"doc": "Heap-owned anonymous frame: the only kind an unmap may free (the shared pid-0 window and graphics slots map fixed frames outside the heap, and * file pages belong to the page cache).", "kind": "function", "line": 715, "name": "mm_anon_frame", "signature": "static int mm_anon_frame(unsigned long phys)"}, {"doc": "Resolve a fault on a reservation: map a zeroed page with the reserved protection. Returns 0 when mapped or when another CPU mapped it first (the faulting access retries through the fresh PTE), -1 when va is no reservation, the reservation is PROT_NONE, the access is a write to a read-only one, or the heap is exhausted (the caller kills like any * unresolved fault).", "kind": "function", "line": 779, "name": "mm_anon_fault", "signature": "int mm_anon_fault(unsigned long cr3, unsigned long va, int write)"}, {"doc": "Docstring: Read the mapped phys for va in cr3, 0 when the PTE is absent or non-present. Fork and teardown prove sharing through * the tables before taking or dropping cache refs.", "kind": "function", "line": 861, "name": "mm_file_page_phys", "signature": "unsigned long mm_file_page_phys(unsigned long cr3, unsigned long va)"}, {"doc": "Docstring: Locate the PTE for va in cr3 without allocating. Returns 0 for any missing level, huge page or out-of-window address. Read-only walk for the fault path (use mm_user_map_page * to change bits).", "kind": "function", "line": 880, "name": "mm_file_pte", "signature": "static volatile unsigned long *mm_file_pte(unsigned long cr3,\n        unsigned long va)"}, {"kind": "function", "line": 1015, "name": "PTE", "signature": "* PTE (a cache page stays cached, but no stale writer may reach it).\n * Never allocates. */\nvoid ..."}, {"doc": "Docstring: Break a write fault on a cache-shared file page into a private copy (fail-closed). Fires after cow_resolve refuses (a file page is never in the cow table outside fork, and fork-shared ones resolve there first). The PTE must be present, read-only and pointing at the cached page the VMA node names; anything else (recycled slot, truncated file, mprotect-RO anon) returns -1 for the kill path. The mapping keeps its cache ref until munmap or * teardown, so the accounting stays balanced. Returns 0 resumed.", "kind": "function", "line": 1070, "name": "mm_file_break", "signature": "int mm_file_break(unsigned long cr3, unsigned long va)"}, {"doc": "Copy one present user page from src_cr3 to the same VA in dst_cr3, allocating the destination page. Used by fork-style clones. The executable bit rides along: ensure_page maps NX, so an exec source left as-is would fault the clone's fetch with #PF/NX (seen as * err=15 on the child's entry rip).", "kind": "function", "line": 1149, "name": "mm_copy_user_page", "signature": "int mm_copy_user_page(unsigned long dst_cr3, unsigned long src_cr3, unsigned long va)"}, {"kind": "function", "line": 1227, "name": "pt_free_user", "signature": "void pt_free_user(uint64_t cr3)"}, {"kind": "function", "line": 1010, "name": "tables", "signature": "* tables (munmap/mremap in caller context, under their mm_lock);"}, {"kind": "function", "line": 1011, "name": "explicitly", "signature": "* teardown passes the dying window explicitly (zombie-exclusive, no * lock needed). unmap == 0 drops refs only (teardown, whose tables * die next);"}, {"kind": "variable", "line": 49, "name": "_kernel_end", "signature": "extern char _kernel_end[];"}, {"kind": "variable", "line": 696, "name": "mm_lock", "signature": "extern spinlock_t mm_lock;"}, {"kind": "macro", "line": 200, "name": "KMM_DEVICE_MAX", "signature": "#define KMM_DEVICE_MAX"}, {"kind": "macro", "line": 204, "name": "KMM_MAX_IDENTITY", "signature": "#define KMM_MAX_IDENTITY"}, {"kind": "macro", "line": 211, "name": "KMM_DEVICE_FLAGS", "signature": "#define KMM_DEVICE_FLAGS"}, {"kind": "macro", "line": 371, "name": "PT_OWNED_BYTES", "signature": "#define PT_OWNED_BYTES"}]}, {"doc": "swap.c - Swap-out/swap-in for the user window (LZ4-compressed disk swap).", "id": "kernel/mm/swap.c", "kind": "module", "label": "swap.c", "language": "c", "sha256": "7644559f1ef8a7d4", "symbol_count": 11, "symbols": [{"doc": "#include \"ide.h\" #include \"lz4_kernel.h\" #define SWAP_CHUNK_RAW     65536 #define SWAP_CHUNK_CMP     (SWAP_CHUNK_RAW + 1024) #define SWAP_CHUNK_SECTORS 128 #define SWAP_HDR_SECTORS   1 #define SWAP_MAX_SECTORS   131072 #define SWAP_MAGIC         0x53574150 static unsigned char *swap_buf_raw = 0; static unsigned char *swap_buf_cmp = 0; /** Docstring: Lazily own both scratch buffers. Returns 0 on OOM.", "kind": "function", "line": 28, "name": "swap_ensure", "signature": "static int swap_ensure(void)"}, {"kind": "function", "line": 41, "name": "swap_lba", "signature": "static unsigned long swap_lba(void)"}, {"kind": "function", "line": 47, "name": "swap_out", "signature": "int swap_out(unsigned long window_sz)"}, {"kind": "function", "line": 97, "name": "swap_in", "signature": "int swap_in(void)"}, {"kind": "function", "line": 7, "name": "unwired", "signature": "* * Currently unwired (the isolated-window spawn path superseded the * swap-out design);"}, {"kind": "macro", "line": 17, "name": "SWAP_CHUNK_RAW", "signature": "#define SWAP_CHUNK_RAW"}, {"kind": "macro", "line": 18, "name": "SWAP_CHUNK_CMP", "signature": "#define SWAP_CHUNK_CMP"}, {"kind": "macro", "line": 19, "name": "SWAP_CHUNK_SECTORS", "signature": "#define SWAP_CHUNK_SECTORS"}, {"kind": "macro", "line": 20, "name": "SWAP_HDR_SECTORS", "signature": "#define SWAP_HDR_SECTORS"}, {"kind": "macro", "line": 21, "name": "SWAP_MAX_SECTORS", "signature": "#define SWAP_MAX_SECTORS"}, {"kind": "macro", "line": 22, "name": "SWAP_MAGIC", "signature": "#define SWAP_MAGIC"}]}, {"doc": "tlb.c - cross-CPU TLB shootdown (docs/spec/smp-sched.md, \"TLB shootdown\").", "id": "kernel/mm/tlb.c", "kind": "module", "label": "tlb.c", "language": "c", "sha256": "ba27e38cad661944", "symbol_count": 5, "symbols": [{"doc": "1 when another online CPU is running address space cr3 right now. The read races with switches harmlessly: the PTEs are already cleared, so a CPU that loads cr3 after this check starts with a flushed TLB, and one * leaving it is about to reload CR3 anyway.", "kind": "function", "line": 36, "name": "tlb_others_on", "signature": "static int tlb_others_on(unsigned long cr3)"}, {"kind": "function", "line": 49, "name": "tlb_shootdown", "signature": "void tlb_shootdown(unsigned long cr3)"}, {"kind": "function", "line": 71, "name": "tlb_shootdown_count", "signature": "unsigned long tlb_shootdown_count(void)"}, {"kind": "function", "line": 75, "name": "tlb_shootdown_timeouts", "signature": "unsigned long tlb_shootdown_timeouts(void)"}, {"kind": "macro", "line": 24, "name": "TLB_SHOOT_SPIN_MAX", "signature": "#define TLB_SHOOT_SPIN_MAX"}]}, {"doc": "================================================================", "id": "kernel/mm.c", "kind": "module", "label": "mm.c", "language": "c", "sha256": "31a81d58e4c66045", "symbol_count": 11, "symbols": [{"doc": "RAM top from the CMOS extended-memory count (the identity map covers the first gigabyte; nothing else reports the installed size). 0 when * the firmware left the count empty.", "kind": "function", "line": 19, "name": "kheap_ram_top", "signature": "static unsigned long kheap_ram_top(void)"}, {"doc": "Build the heap over [HEAP_BASE, HEAP_BASE + kheap_size): the layout maximum, never past the installed RAM (a smaller machine must not be * handed memory that does not exist).", "kind": "function", "line": 32, "name": "kallocator_init", "signature": "void kallocator_init(void)"}, {"kind": "function", "line": 53, "name": "kmalloc_report_failure", "signature": "static void kmalloc_report_failure(unsigned long size)"}, {"kind": "function", "line": 66, "name": "kmalloc", "signature": "void *kmalloc(unsigned long size)"}, {"doc": "One page-aligned heap page (the page-table and user-page allocator's backing). memalign keeps the cost at one page plus a chunk header, where over-allocating to align cost two pages per page and halved the user memory the heap could back. Same fault injection and reporting as * kmalloc.", "kind": "function", "line": 81, "name": "kmalloc_page", "signature": "void *kmalloc_page(void)"}, {"kind": "function", "line": 90, "name": "kfree", "signature": "void kfree(void *ptr)"}, {"kind": "function", "line": 111, "name": "kcalloc", "signature": "void *kcalloc(unsigned long nmemb, unsigned long size)"}, {"kind": "function", "line": 115, "name": "krealloc", "signature": "void *krealloc(void *ptr, unsigned long size)"}, {"doc": "Docstring: Aligned allocation with a recoverable raw pointer.  Reserves size bytes at the requested power-of-two alignment and stores the original kmalloc pointer in the word below the aligned base, so kfree_aligned releases exactly what the allocator returned. Fail-closed * on zero size, non-power-of-two alignment and size arithmetic overflow.", "kind": "function", "line": 127, "name": "kmalloc_aligned", "signature": "void *kmalloc_aligned(unsigned long size, unsigned long align)"}, {"doc": "Docstring: Release a kmalloc_aligned block. A null pointer is a no-op; * a pointer outside the heap halts through kfree, never silently.", "kind": "function", "line": 143, "name": "kfree_aligned", "signature": "void kfree_aligned(void *ptr)"}, {"kind": "macro", "line": 50, "name": "KMALLOC_REPORT_EVERY", "signature": "#define KMALLOC_REPORT_EVERY"}]}, {"doc": "Docstring: kernel/panic.c -- Kernel panic screen.", "id": "kernel/panic.c", "kind": "module", "label": "panic.c", "language": "c", "sha256": "6bcddc5e02399afa", "symbol_count": 4, "symbols": [{"kind": "function", "line": 23, "name": "panic_hex", "signature": "static void panic_hex(unsigned long v, int digits)"}, {"kind": "function", "line": 30, "name": "panic_fb_puts", "signature": "static void panic_fb_puts(const char *s)"}, {"kind": "function", "line": 61, "name": "panic_fb_hex", "signature": "static void panic_fb_hex(unsigned long v, int digits)"}, {"doc": "Docstring: Paint the panic screen for an unrecoverable fault and halt when asked. vector/err/rip/rsp come from the trap frame, rbp is the faulting frame pointer. halt != 0 ends in hlt (real faults); halt == 0 returns (the `panic` builtin demo). Re-entry halts * silently: the banner path itself faulted, nothing more can print.", "kind": "function", "line": 98, "name": "panic_screen", "signature": "void panic_screen(unsigned long vector, unsigned long err,\n        unsigned long rip, unsigned lo..."}]}, {"doc": "Docstring: kernel/percpu_rq.c -- Per-CPU runqueue hints and stealing.", "id": "kernel/percpu_rq.c", "kind": "module", "label": "percpu_rq.c", "language": "c", "sha256": "76b5b74a61d347a5", "symbol_count": 9, "symbols": [{"kind": "function", "line": 14, "name": "rq_cpu_valid", "signature": "static int rq_cpu_valid(int cpu)"}, {"doc": "topology and on spinlock.h for the ring locks, which keeps it host-testable (tests/test_percpu_rq.c, make test-percpu-rq) with a stub topology of fake CPUs.  #include \"percpu_rq.h\" static percpu_rq_t rqueues[MAX_CPUS]; static int rq_cpu_valid(int cpu) { return cpu >= 0 && cpu < MAX_CPUS && cpu < cpu_count; } /** Docstring: Clear every ring and counter. Called once from sched_init.", "kind": "function", "line": 19, "name": "rq_init", "signature": "void rq_init(void)"}, {"doc": "Docstring: Record pid as READY work for cpu.  Lossy by contract: a full ring drops the hint and counts the drop. The global scan remains the fallback, so a drop costs one rescan period of latency at most, never correctness. Pids outside the table are refused.", "kind": "function", "line": 41, "name": "rq_enqueue", "signature": "void rq_enqueue(int cpu, int pid)"}, {"doc": "return; spin_lock_irqsave(&rqueues[cpu].lock, &flags); if (rqueues[cpu].count >= RQ_DEPTH) { rqueues[cpu].drops++; spin_unlock_irqrestore(&rqueues[cpu].lock, flags); return; } slot = (rqueues[cpu].head + rqueues[cpu].count) % RQ_DEPTH; rqueues[cpu].ring[slot] = pid; rqueues[cpu].count++; spin_unlock_irqrestore(&rqueues[cpu].lock, flags); } /** Docstring: Pop one hint from the local ring, WQ_NONE_HINT when empty.", "kind": "function", "line": 61, "name": "rq_pop_local", "signature": "int rq_pop_local(int cpu)"}, {"doc": "Docstring: Non-blocking steal of one hint from another CPU's ring.  Tries every remote ring once with spin_trylock and returns the first hint found, reporting the donor through from_cpu. Rings that are busy are skipped, never waited on. Returns WQ_NONE_HINT when nothing could be stolen without blocking. The thief's steal counter is owner-written but updated under the donor's lock, so it uses an atomic add (the same pattern as smp_dispatches) instead of relying on the donor's lock.", "kind": "function", "line": 89, "name": "rq_steal_once", "signature": "int rq_steal_once(int self_cpu, int *from_cpu)"}, {"doc": "pid = rqueues[c].ring[rqueues[c].head]; rqueues[c].ring[rqueues[c].head] = WQ_NONE_HINT; rqueues[c].head = (rqueues[c].head + 1) % RQ_DEPTH; rqueues[c].count--; __sync_fetch_and_add(&rqueues[self_cpu].steals, 1); spin_unlock(&rqueues[c].lock); if (from_cpu) from_cpu = c; return pid; } return WQ_NONE_HINT; } /** Docstring: True when cpu holds no hint. Lock-protected peek.", "kind": "function", "line": 115, "name": "rq_empty", "signature": "int rq_empty(int cpu)"}, {"doc": "/** Docstring: True when cpu holds no hint. Lock-protected peek. int rq_empty(int cpu) { irqflags_t flags; int empty; if (!rq_cpu_valid(cpu)) return 1; spin_lock_irqsave(&rqueues[cpu].lock, &flags); empty = (rqueues[cpu].count <= 0); spin_unlock_irqrestore(&rqueues[cpu].lock, flags); return empty; } /** Docstring: Count an unsuccessful claim poll for the rescan schedule.", "kind": "function", "line": 127, "name": "rq_note_poll", "signature": "void rq_note_poll(int cpu)"}, {"doc": "return empty; } /** Docstring: Count an unsuccessful claim poll for the rescan schedule. void rq_note_poll(int cpu) { irqflags_t flags; if (!rq_cpu_valid(cpu)) return; spin_lock_irqsave(&rqueues[cpu].lock, &flags); rqueues[cpu].polls++; spin_unlock_irqrestore(&rqueues[cpu].lock, flags); } /** Docstring: True every RQ_RESCAN_PERIOD polls, bounding hint staleness.", "kind": "function", "line": 137, "name": "rq_should_rescan", "signature": "int rq_should_rescan(int cpu)"}, {"doc": "irqflags_t flags; int due = 0; if (!rq_cpu_valid(cpu)) return 1; spin_lock_irqsave(&rqueues[cpu].lock, &flags); if (rqueues[cpu].polls >= RQ_RESCAN_PERIOD) { rqueues[cpu].polls = 0; due = 1; } spin_unlock_irqrestore(&rqueues[cpu].lock, flags); return due; } /** Docstring: Snapshot hits, steals and drops for diagnostics.", "kind": "function", "line": 152, "name": "rq_stats", "signature": "void rq_stats(int cpu, unsigned long *hits, unsigned long *steals,\n              unsigned long *d..."}]}, {"doc": "================================================================", "id": "kernel/printf.c", "kind": "module", "label": "printf.c", "language": "c", "sha256": "716a8080b07cfaa8", "symbol_count": 10, "symbols": [{"kind": "struct", "line": 177, "name": "snctx"}, {"kind": "function", "line": 7, "name": "putc_buf", "signature": "static void putc_buf(char c, void *ctx, int *written)"}, {"kind": "function", "line": 13, "name": "putc_file", "signature": "static void putc_file(char c, void *ctx, int *written)"}, {"kind": "function", "line": 19, "name": "putc_str", "signature": "static void putc_str(char c, void *ctx, int *written)"}, {"kind": "function", "line": 26, "name": "emit_num", "signature": "static void emit_num(void (*emit)(char, void *, int *), void *ctx, int *written,\n                ..."}, {"kind": "function", "line": 44, "name": "kformat", "signature": "static void kformat(void (*emit)(char, void *, int *), void *ctx,\n                    int *writte..."}, {"kind": "function", "line": 157, "name": "kfprintf", "signature": "int kfprintf(KFILE *f, const char *fmt, ...)"}, {"kind": "function", "line": 166, "name": "ksprintf", "signature": "int ksprintf(char *buf, const char *fmt, ...)"}, {"kind": "function", "line": 178, "name": "putc_snbuf", "signature": "static void putc_snbuf(char c, void *ctx, int *written)"}, {"kind": "function", "line": 184, "name": "ksnprintf", "signature": "int ksnprintf(char *buf, unsigned long size, const char *fmt, ...)"}]}, {"doc": "Docstring: proc_sec.c -- per-process security state: the Linux seccomp", "id": "kernel/proc_sec.c", "kind": "module", "label": "proc_sec.c", "language": "c", "sha256": "73bce68b033b0792", "symbol_count": 43, "symbols": [{"kind": "struct", "line": 48, "name": "sec_filter"}, {"doc": "define ERR_ENOMEM  (-12) define ERR_EACCES  (-13) define ERR_EINVAL  (-22) define ERR_ENOSYS  (-38) define ERR_EOPNOTSUPP (-95)", "kind": "type_alias", "line": 47, "name": "ref", "signature": "typedef struct sec_filter { int ref;"}, {"kind": "function", "line": 74, "name": "pid_ok", "signature": "static int pid_ok(int pid)"}, {"kind": "function", "line": 78, "name": "chain_put", "signature": "static void chain_put(sec_filter_t *f)"}, {"kind": "function", "line": 87, "name": "proc_sec_inherit", "signature": "void proc_sec_inherit(int child, int parent)"}, {"kind": "function", "line": 101, "name": "proc_sec_release", "signature": "void proc_sec_release(int pid)"}, {"doc": "execve keeps the filters and no_new_privs (Linux) and makes the fresh * image dumpable again.", "kind": "function", "line": 115, "name": "proc_sec_exec", "signature": "void proc_sec_exec(int pid)"}, {"kind": "function", "line": 119, "name": "proc_sec_set_exe", "signature": "void proc_sec_set_exe(int pid, const char *resolved)"}, {"kind": "function", "line": 125, "name": "proc_sec_exe", "signature": "const char *proc_sec_exe(int pid)"}, {"doc": "if (pid_ok(pid)) sec_undumpable[pid] = 0; } void proc_sec_set_exe(int pid, const char *resolved) { if (!pid_ok(pid) || !resolved) return; kstrncpy(sec_exe[pid], resolved, RAMDISK_FNAME_LEN - 1); sec_exe[pid][RAMDISK_FNAME_LEN - 1] = 0; } const char *proc_sec_exe(int pid) { return pid_ok(pid) ? sec_exe[pid] : \"\"; } /* Kill per the action: the calling thread, or its whole thread group.", "kind": "function", "line": 130, "name": "sec_kill", "signature": "static void sec_kill(long n, int whole_group)"}, {"kind": "function", "line": 136, "name": "proc_sec_filter", "signature": "int proc_sec_filter(long n, long a1, long a2, long a3, long a4, long a5, long a6, long *ret)"}, {"doc": "Validate and push one program onto the caller's chain. strict skips the * no_new_privs requirement, as Linux strict mode does.", "kind": "function", "line": 191, "name": "sec_install", "signature": "static long sec_install(const sbpf_insn *prog, unsigned len, int strict)"}, {"doc": "return ERR_EINVAL; } kfree(scratch); node->ref = 1; node->len = len; node->depth = depth; node->prev = head; sec_chain[pid] = node; if (sec_mode[pid] != LINUX_SECCOMP_MODE_FILTER) sec_mode[pid] = strict ? LINUX_SECCOMP_MODE_STRICT : LINUX_SECCOMP_MODE_FILTER; return 0; } /* Copy a user struct sock_fprog and install it.", "kind": "function", "line": 224, "name": "sec_install_user", "signature": "static long sec_install_user(long ufprog)"}, {"kind": "function", "line": 235, "name": "proc_sec_prctl", "signature": "long proc_sec_prctl(long option, long a2, long a3, long a4, long a5)"}, {"kind": "function", "line": 290, "name": "proc_sec_seccomp", "signature": "long proc_sec_seccomp(long op, long flags, long uargs)"}, {"kind": "macro", "line": 18, "name": "LINUX_PR_GET_DUMPABLE", "signature": "#define LINUX_PR_GET_DUMPABLE"}, {"kind": "macro", "line": 19, "name": "LINUX_PR_SET_DUMPABLE", "signature": "#define LINUX_PR_SET_DUMPABLE"}, {"kind": "macro", "line": 20, "name": "LINUX_PR_SET_NAME", "signature": "#define LINUX_PR_SET_NAME"}, {"kind": "macro", "line": 21, "name": "LINUX_PR_GET_NAME", "signature": "#define LINUX_PR_GET_NAME"}, {"kind": "macro", "line": 22, "name": "LINUX_PR_GET_SECCOMP", "signature": "#define LINUX_PR_GET_SECCOMP"}, {"kind": "macro", "line": 23, "name": "LINUX_PR_SET_SECCOMP", "signature": "#define LINUX_PR_SET_SECCOMP"}, {"kind": "macro", "line": 24, "name": "LINUX_PR_SET_NO_NEW_PRIVS", "signature": "#define LINUX_PR_SET_NO_NEW_PRIVS"}, {"kind": "macro", "line": 25, "name": "LINUX_PR_GET_NO_NEW_PRIVS", "signature": "#define LINUX_PR_GET_NO_NEW_PRIVS"}, {"kind": "macro", "line": 26, "name": "LINUX_SECCOMP_MODE_DISABLED", "signature": "#define LINUX_SECCOMP_MODE_DISABLED"}, {"kind": "macro", "line": 27, "name": "LINUX_SECCOMP_MODE_STRICT", "signature": "#define LINUX_SECCOMP_MODE_STRICT"}, {"kind": "macro", "line": 28, "name": "LINUX_SECCOMP_MODE_FILTER", "signature": "#define LINUX_SECCOMP_MODE_FILTER"}, {"kind": "macro", "line": 29, "name": "LINUX_SECCOMP_SET_MODE_STRICT", "signature": "#define LINUX_SECCOMP_SET_MODE_STRICT"}, {"kind": "macro", "line": 30, "name": "LINUX_SECCOMP_SET_MODE_FILTER", "signature": "#define LINUX_SECCOMP_SET_MODE_FILTER"}, {"kind": "macro", "line": 31, "name": "LINUX_SECCOMP_GET_ACTION_AVAIL", "signature": "#define LINUX_SECCOMP_GET_ACTION_AVAIL"}, {"kind": "macro", "line": 32, "name": "LINUX_NR_READ", "signature": "#define LINUX_NR_READ"}, {"kind": "macro", "line": 33, "name": "LINUX_NR_WRITE", "signature": "#define LINUX_NR_WRITE"}, {"kind": "macro", "line": 34, "name": "LINUX_NR_RT_SIGRETURN", "signature": "#define LINUX_NR_RT_SIGRETURN"}, {"kind": "macro", "line": 35, "name": "LINUX_NR_EXIT", "signature": "#define LINUX_NR_EXIT"}, {"kind": "macro", "line": 36, "name": "LINUX_ERRNO_MAX", "signature": "#define LINUX_ERRNO_MAX"}, {"kind": "macro", "line": 37, "name": "LINUX_TASK_COMM_LEN", "signature": "#define LINUX_TASK_COMM_LEN"}, {"kind": "macro", "line": 39, "name": "SOCK_FPROG_SIZE", "signature": "#define SOCK_FPROG_SIZE"}, {"kind": "macro", "line": 40, "name": "SOCK_FPROG_FILTER_OFF", "signature": "#define SOCK_FPROG_FILTER_OFF"}, {"kind": "macro", "line": 42, "name": "ERR_ENOMEM", "signature": "#define ERR_ENOMEM"}, {"kind": "macro", "line": 43, "name": "ERR_EACCES", "signature": "#define ERR_EACCES"}, {"kind": "macro", "line": 44, "name": "ERR_EINVAL", "signature": "#define ERR_EINVAL"}, {"kind": "macro", "line": 45, "name": "ERR_ENOSYS", "signature": "#define ERR_ENOSYS"}, {"kind": "macro", "line": 46, "name": "ERR_EOPNOTSUPP", "signature": "#define ERR_EOPNOTSUPP"}, {"kind": "macro", "line": 72, "name": "SEC_STRICT_LEN", "signature": "#define SEC_STRICT_LEN"}]}, {"doc": "Docstring: kernel/rcu.c -- Epoch grace periods over scheduler ticks.", "id": "kernel/rcu.c", "kind": "module", "label": "rcu.c", "language": "c", "sha256": "7963266ec52397d8", "symbol_count": 14, "symbols": [{"kind": "struct", "line": 22, "name": "rcu_slot_t"}, {"kind": "struct", "line": 28, "name": "rcu_state_t"}, {"kind": "function", "line": 13, "name": "rcu_me", "signature": "static cpu_t *rcu_me(void)"}, {"doc": "else", "kind": "function", "line": 17, "name": "rcu_me", "signature": "static cpu_t *rcu_me(void)"}, {"kind": "function", "line": 40, "name": "rcu_cpu_valid", "signature": "static int rcu_cpu_valid(int cpu)"}, {"doc": "unsigned long qs[MAX_CPUS]; unsigned long depth[MAX_CPUS]; rcu_slot_t pending[RCU_CB_MAX]; int pending_count; unsigned long completed; } rcu_state_t; static rcu_state_t rcu_state; static int rcu_cpu_valid(int cpu) { return cpu >= 0 && cpu < MAX_CPUS && cpu < cpu_count; } /** Docstring: Reset epoch, quiescent marks, depths and callbacks.", "kind": "function", "line": 45, "name": "rcu_init", "signature": "void rcu_init(void)"}, {"doc": "for (i = 0; i < MAX_CPUS; i++) { rcu_state.qs[i] = 0; rcu_state.depth[i] = 0; } for (i = 0; i < RCU_CB_MAX; i++) { rcu_state.pending[i].fn = 0; rcu_state.pending[i].arg = 0; rcu_state.pending[i].epoch = 0; } rcu_state.pending_count = 0; rcu_state.completed = 0; } /** Docstring: Enter a read section on the current CPU. Nests.", "kind": "function", "line": 63, "name": "rcu_read_lock", "signature": "void rcu_read_lock(void)"}, {"doc": "/** Docstring: Enter a read section on the current CPU. Nests. void rcu_read_lock(void) { cpu_t *me = rcu_me(); int cpu = me->cpu_id; irqflags_t flags; if (!rcu_cpu_valid(cpu)) return; spin_lock_irqsave(&rcu_state.lock, &flags); rcu_state.depth[cpu]++; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Leave a read section. Underflow is clamped, never wraps.", "kind": "function", "line": 75, "name": "rcu_read_unlock", "signature": "void rcu_read_unlock(void)"}, {"doc": "/** Docstring: Leave a read section. Underflow is clamped, never wraps. void rcu_read_unlock(void) { cpu_t *me = rcu_me(); int cpu = me->cpu_id; irqflags_t flags; if (!rcu_cpu_valid(cpu)) return; spin_lock_irqsave(&rcu_state.lock, &flags); if (rcu_state.depth[cpu] > 0) rcu_state.depth[cpu]--; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Load a published pointer inside a read section.", "kind": "function", "line": 88, "name": "rcu_deref", "signature": "void *rcu_deref(void *volatile *pp)"}, {"doc": "return; spin_lock_irqsave(&rcu_state.lock, &flags); if (rcu_state.depth[cpu] > 0) rcu_state.depth[cpu]--; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Load a published pointer inside a read section. void *rcu_deref(void *volatile *pp) { __sync_synchronize(); return *pp; } /** Docstring: Publish a new pointer value with release ordering.", "kind": "function", "line": 94, "name": "rcu_publish", "signature": "void rcu_publish(void *volatile *pp, void *v)"}, {"doc": "if (rcu_state.pending_count >= RCU_CB_MAX) { r = RCU_ERR_FULL; } else { rcu_slot_t *s = &rcu_state.pending[rcu_state.pending_count]; s->fn = fn; s->arg = arg; s->epoch = rcu_state.epoch; rcu_state.pending_count++; } spin_unlock_irqrestore(&rcu_state.lock, flags); return r; } /** Docstring: Record a quiescent state for cpu at the current epoch.", "kind": "function", "line": 126, "name": "rcu_note_tick", "signature": "void rcu_note_tick(int cpu)"}, {"doc": "} /** Docstring: Record a quiescent state for cpu at the current epoch. void rcu_note_tick(int cpu) { irqflags_t flags; if (!rcu_cpu_valid(cpu)) return; spin_lock_irqsave(&rcu_state.lock, &flags); if (rcu_state.depth[cpu] == 0) rcu_state.qs[cpu] = rcu_state.epoch; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Idle CPUs are always quiescent.", "kind": "function", "line": 137, "name": "rcu_note_idle", "signature": "void rcu_note_idle(int cpu)"}, {"doc": "Docstring: Advance the epoch and run due callbacks.  A grace period closes when every online CPU reported quiescence at the current epoch. Callbacks stamped with an older epoch then run inline and the epoch advances. Runs from the timer tick; never blocks.", "kind": "function", "line": 152, "name": "rcu_poll", "signature": "void rcu_poll(void)"}, {"kind": "function", "line": 193, "name": "expires", "signature": "* expires (ticks stalled, never a hang). No completion assert is\n * possible here by design: a re..."}]}, {"doc": "================================================================", "id": "kernel/redirect.c", "kind": "module", "label": "redirect.c", "language": "c", "sha256": "c3f7b977c726c6b0", "symbol_count": 3, "symbols": [{"kind": "function", "line": 11, "name": "shell_report_exit", "signature": "void shell_report_exit(int code)"}, {"kind": "function", "line": 17, "name": "shell_report", "signature": "void shell_report(const char *what, const char *detail)"}, {"kind": "function", "line": 25, "name": "shell_take_redirect", "signature": "int shell_take_redirect(int *argc, char **argv, char **path, int *append_mode)"}]}, {"id": "kernel/sched.c", "kind": "module", "label": "sched.c", "language": "c", "sha256": "46267013a4a7ba07", "symbol_count": 137, "symbols": [{"kind": "struct", "line": 564, "name": "stop_row"}, {"doc": "1 when cpu's idle context runs on the kernel tables (the `smp` builtin * reports it as idle_cr3=kernel|stale). int sched_idle_on_kernel_cr3(int cpu) { if (cpu < 0 || cpu >= MAX_CPUS) return 0; return ap_idle_proc[cpu].ctx.cr3 == sched_idle_cr3; } /* ---- Trap frame (must match isr_stubs.S) ----", "kind": "struct", "line": 729, "name": "trap_frame_t"}, {"doc": "--- TSS (one per CPU) ----  Every CPU that runs ring-3 code needs a private TSS: a timer tick that preempts ring 3 switches to TSS.rsp0, so two CPUs sharing one TSS would run their ISRs on the same stack.  The runtime GDT grows from 7 entries (5 from stage 2 + 1 TSS descriptor of 2 slots) to 5 + 2*MAX_CPUS entries; CPU 0 keeps selector 0x28 exactly as before.  The GDT lives at 0x8000 with 4 KB reserved up to stage 2 at 0x9000, so 21 entries * (168 bytes) fit with room to spare.", "kind": "type_alias", "line": 109, "name": "res0", "signature": "typedef struct __attribute__((packed)) { uint32_t res0;"}, {"doc": "Per-CPU idle ticks at 100 Hz: isr_dispatch bumps the current CPU's slot whenever the tick arrives with current_pid == -1 (the per-CPU idle context). Sibling of smp_idle_polls, which counts idle-loop passes instead of time; the MINFO cpu selector reports the sum so ring 3 can compute busy percent between two reads. Increment-only, * read without a lock like the other ISR counters. volatile unsigned long cpu_idle_ticks[MAX_CPUS]; static volatile int ser_e_reported; /* ---- IDT ----", "kind": "type_alias", "line": 143, "name": "off_lo", "signature": "typedef struct __attribute__((packed)) { uint16_t off_lo;"}, {"doc": "#include \"rcu.h\" #include \"proc_sec.h\" #include \"bootdefs.h\" #include \"vga_fb.h\" #include \"sb16.h\" #include \"pcm2.h\" #include \"tick.h\" #include \"arch/x86/hal_io.h\" #include \"arch/x86/msr.h\" #include \"drivers/mouse.h\" #include \"drivers/xhci.h\" #include \"tlb.h\" /** Docstring: Audio tick adapter, forwards the bus dispatch to sb16_poll.", "kind": "function", "line": 26, "name": "sched_tick_audio", "signature": "static void sched_tick_audio(void *ctx)"}, {"doc": "#include \"tick.h\" #include \"arch/x86/hal_io.h\" #include \"arch/x86/msr.h\" #include \"drivers/mouse.h\" #include \"drivers/xhci.h\" #include \"tlb.h\" /** Docstring: Audio tick adapter, forwards the bus dispatch to sb16_poll. static void sched_tick_audio(void *ctx) { (void)ctx; sb16_poll(); } /** Docstring: Desktop tick adapter, forwards the bus dispatch to the compositor tick.", "kind": "function", "line": 32, "name": "sched_tick_desktop", "signature": "static void sched_tick_desktop(void *ctx)"}, {"doc": "Docstring: USB tick adapter. The xHCI event ring is polled by decision rather than interrupt-driven, so this is the polling trigger: it drains the ring and nothing else. Transfers are never issued here: an interrupt endpoint with nothing to say answers NAK instead of an event, and waiting for one with the tick held takes the machine with it. HID polling lives in * the console input spin, where a missing report is just silence.", "kind": "function", "line": 43, "name": "sched_tick_usb", "signature": "static void sched_tick_usb(void *ctx)"}, {"kind": "function", "line": 74, "name": "read_cr3", "signature": "static inline unsigned long read_cr3(void)"}, {"doc": "--- TSS (one per CPU) ----  Every CPU that runs ring-3 code needs a private TSS: a timer tick that preempts ring 3 switches to TSS.rsp0, so two CPUs sharing one TSS would run their ISRs on the same stack.  The runtime GDT grows from 7 entries (5 from stage 2 + 1 TSS descriptor of 2 slots) to 5 + 2*MAX_CPUS entries; CPU 0 keeps selector 0x28 exactly as before.  The GDT lives at 0x8000 with 4 KB reserved up to stage 2 at 0x9000, so 21 entries * (168 bytes) fit with room to spare.", "kind": "function", "line": 109, "name": "__attribute__", "signature": "typedef struct __attribute__((packed))"}, {"doc": "Per-CPU idle ticks at 100 Hz: isr_dispatch bumps the current CPU's slot whenever the tick arrives with current_pid == -1 (the per-CPU idle context). Sibling of smp_idle_polls, which counts idle-loop passes instead of time; the MINFO cpu selector reports the sum so ring 3 can compute busy percent between two reads. Increment-only, * read without a lock like the other ISR counters. volatile unsigned long cpu_idle_ticks[MAX_CPUS]; static volatile int ser_e_reported; /* ---- IDT ----", "kind": "function", "line": 143, "name": "__attribute__", "signature": "typedef struct __attribute__((packed))"}, {"kind": "function", "line": 171, "name": "kstack_paint", "signature": "static void kstack_paint(uint64_t top, unsigned long size)"}, {"doc": "allocation rate only, never in the ISR path; the report is fail-closed * (a dead canary prints OVERFLOW, never a forged number). #define KSTACK_PAINT   0xA5A5A5A5A5A5A5A5ULL #define KSTACK_CANARY  0x4B535441434B3735ULL static void kstack_paint(uint64_t top, unsigned long size) { unsigned long long *p = (unsigned long long *)(top - size); unsigned long n = size / 8; unsigned long i; for (i = 1; i < n; i++) p[i] = (unsigned long long)KSTACK_PAINT; p[0] = (unsigned long long)KSTACK_CANARY; } /* 0 = intact (used_out = high-water bytes), -1 = canary dead.", "kind": "function", "line": 180, "name": "kstack_usage", "signature": "static int kstack_usage(uint64_t top, unsigned long size,\n                        unsigned long *..."}, {"doc": "pid of a live process still standing on the stack slot ending at top (its kernel stack, or the stack its open syscall entered on), -1 when * none: a slot is free only when nobody can resume on it. /* 1 when v is the end of a kstack_pool slot (a kernel stack top).", "kind": "function", "line": 199, "name": "kstack_is_slot_end", "signature": "static int kstack_is_slot_end(uint64_t v)"}, {"doc": "The stack slot process j stands on: PCB.kstack between syscalls, the entry's saved top while a syscall is open (the entry parked the user * rsp in PCB.kstack). 0 when j has no stack (a slot being created).", "kind": "function", "line": 209, "name": "kstack_of", "signature": "static uint64_t kstack_of(int j)"}, {"kind": "function", "line": 216, "name": "kstack_owner", "signature": "static int kstack_owner(uint64_t top)"}, {"doc": "Serial-only stack census for the exception dump: every pool slot in use, its owner and high-water mark, and \"CANARY DEAD\" when its bottom word was overwritten (an overflow into the slot below). A kernel stack overflow corrupts the neighbouring slot's saved frames, which surface later as another process returning to user space with garbage * registers; this names the overflowing slot at the moment it matters.", "kind": "function", "line": 231, "name": "kstack_scan_serial", "signature": "static void kstack_scan_serial(void)"}, {"kind": "function", "line": 262, "name": "alloc_kstack", "signature": "static uint64_t alloc_kstack(void)"}, {"kind": "function", "line": 286, "name": "live", "signature": "* every reap leaked its own stack and released a neighbour that could\n * still be live (two procs..."}, {"kind": "function", "line": 306, "name": "MXCSR", "signature": "* A fresh image is explicit zeros plus the default MXCSR (0x1F80, all\n * exceptions masked): fxsa..."}, {"kind": "function", "line": 314, "name": "fpu_restore_from", "signature": "static inline void fpu_restore_from(void *area)"}, {"kind": "function", "line": 318, "name": "fpu_alloc_clean", "signature": "static void *fpu_alloc_clean(void)"}, {"kind": "function", "line": 336, "name": "fpu_free_proc", "signature": "static void fpu_free_proc(proc_t *p)"}, {"doc": "Per-process VMA contexts (vma.h contract; defined here so vma.c stays * host-testable). A private pool is VMA_MAX nodes from the kernel heap.", "kind": "function", "line": 342, "name": "vma_ctx_alloc", "signature": "vma_ctx_t *vma_ctx_alloc(void)"}, {"kind": "function", "line": 352, "name": "vma_ctx_free", "signature": "void vma_ctx_free(vma_ctx_t *c)"}, {"kind": "function", "line": 362, "name": "copy", "signature": "* copy (fail closed, fork refuses) instead of forging pointers. */\n/* Name the link a fork could ..."}, {"kind": "function", "line": 371, "name": "vma_ctx_copy", "signature": "static vma_ctx_t *vma_ctx_copy(vma_ctx_t *src)"}, {"kind": "function", "line": 446, "name": "vma_owned", "signature": "static int vma_owned(proc_t *p)"}, {"doc": "Rebind the global VMA view alongside the brk/mmap view. Callers already hold sched_lock (+mm_lock at the swap sites); the bind itself is a few * stores. Shared (VM/legacy) contexts make this a semantic no-op.", "kind": "function", "line": 454, "name": "vma_save_proc", "signature": "static void vma_save_proc(proc_t *p)"}, {"kind": "function", "line": 458, "name": "vma_load_proc", "signature": "static void vma_load_proc(proc_t *p)"}, {"doc": "The process whose brk/mmap/VMA view an address space lives in: p itself unless p is a CLONE_VM thread, then the non-CLONE_VM process sharing its VMA context (the context is the address space's identity; a pid-0 run's page tables are not recorded in procs[0], so CR3 cannot tell). Threads of the legacy window belong to pid 0. A thread whose owner is gone * shares the held view when it is its own, else keeps its copies.", "kind": "function", "line": 472, "name": "mm_owner", "signature": "static proc_t *mm_owner(proc_t *p)"}, {"doc": "Make the globals describe nxt's address space before nxt runs, from any entry path (a switch, the timer, or the idle loop claiming after the running process died, where there is no outgoing process to name). A task of the address space already held keeps the view; any other saves it into its holder and loads the new owner's, so a thread scheduled after an unrelated process, or a parent resumed from idle after its child died, never allocates from someone else's view. Callers hold * sched_lock and mm_lock.", "kind": "function", "line": 494, "name": "mm_view_enter", "signature": "static void mm_view_enter(proc_t *nxt)"}, {"doc": "The running process installed a fresh view itself (execve, spawn * restore): it is the holder from now on.", "kind": "function", "line": 513, "name": "mm_view_claim_current", "signature": "void mm_view_claim_current(void)"}, {"doc": "Serial-observable stack health: per-proc high-water marks plus the legacy 32 KB syscall stack, ending in `kstack: ok` or * `kstack: OVERFLOW`. The shell `kstack` builtin calls this.", "kind": "function", "line": 520, "name": "kstack_report", "signature": "void kstack_report(void)"}, {"doc": "`schedtop` -- one screenful of scheduler state: uptime from the 100 Hz tick, per-CPU current pid, then one row per live proc (thread group, thread/process flag, state, nice, virtual runtime, consumed ticks). Threads are CLONE_VM procs sharing an address space: the T/P column names them, and tgid is the lowest pid sharing the same VMA view (the group leader), so `thdemo`'s ten threads read as one group with ten per-thread tick counters. Snapshot under sched_lock, print * after release so console I/O never runs with the scheduler held.", "kind": "function", "line": 563, "name": "schedtop_report", "signature": "void schedtop_report(void)"}, {"doc": "`irqstat` -- interrupt arrivals per source. Timer ticks come from sys_ticks (PIT 100 Hz on the BSP, broadcast as IPIs to APs); kbd/mouse/ sb16 are counted at the top of their isr_dispatch arms. NIC and audio queue health ride along from rtl/sb16 counters so one screen answers * \"is the hardware talking and is the guest keeping up\".", "kind": "function", "line": 631, "name": "irqstat_report", "signature": "void irqstat_report(void)"}, {"kind": "function", "line": 650, "name": "stub", "signature": "* gdb stub (`make gdb`, then `target remote :1234` from the host). These\n * helpers are the seria..."}, {"kind": "function", "line": 697, "name": "gdb_dump_report", "signature": "void gdb_dump_report(unsigned long addr, unsigned long len)"}, {"doc": "1 when cpu's idle context runs on the kernel tables (the `smp` builtin * reports it as idle_cr3=kernel|stale).", "kind": "function", "line": 723, "name": "sched_idle_on_kernel_cr3", "signature": "int sched_idle_on_kernel_cr3(int cpu)"}, {"doc": "Parked trap frames for preempted ring-3 contexts, one slot per pid. The ISR copies the preempted frame here (never onto a live stack: the TSS stack is reused by the next tick and a thread's own kstack may be mid-syscall), points ctx at the copy and resumes it later through resume_iretq + iretq.  Dedicated slots mean parking can never clobber * live kernel state. static trap_frame_t isr_park[MAX_PROCS]; /* ---- IDT init ----", "kind": "function", "line": 745, "name": "idt_set", "signature": "static void idt_set(int vec, void (*h)(void))"}, {"kind": "function", "line": 756, "name": "idt_init", "signature": "static void idt_init(void)"}, {"doc": "NMI is the TLB shootdown (kernel/mm/tlb.c): its own gate, its own * IST stack, never the trap-frame path. idt_set(NMI_VECTOR, tlb_nmi_entry); idt[NMI_VECTOR].ist = NMI_IST_SLOT; bsp_idtr.limit = sizeof(idt) - 1; bsp_idtr.base = (uint64_t)&idt; __asm__ volatile(\"lidt %0\" :: \"m\"(bsp_idtr)); } /* ---- PIC ----", "kind": "function", "line": 772, "name": "pic_init", "signature": "static void pic_init(void)"}, {"doc": "Master: unmask IRQ0 (timer) + IRQ1 (keyboard) + IRQ2 (cascade) + IRQ4 (COM1, UART IER stays 0 so it never fires) + IRQ5 (Sound Blaster 16 DMA done).  In the mask register a bit set means masked, so 0xC8 masks only IRQ3, IRQ6 and IRQ7.  Masking IRQ5 here starves the SB16 completion interrupt and leaves audio on the * timer watchdog alone (audible as jitter); keep it unmasked. hal_outb(HAL_PIC1_DATA, 0xC8); /* Slave: unmask IRQ12 (mouse) only. 0xEF = ~bit4. hal_outb(HAL_PIC2_DATA, 0xEF); } /* ---- PIT channel 0: 100 Hz ----", "kind": "function", "line": 807, "name": "pit_init", "signature": "static void pit_init(void)"}, {"kind": "function", "line": 814, "name": "pic_eoi", "signature": "static void pic_eoi(int irq)"}, {"kind": "function", "line": 821, "name": "tss_write_desc", "signature": "static void tss_write_desc(int cpu)"}, {"kind": "function", "line": 838, "name": "tss_init", "signature": "static void tss_init(void)"}, {"doc": "Load this AP's task register.  The BSP wrote every descriptor in tss_init before the APs were woken, so the AP only points its TR at its own slot; its ring-3 preempts then land on its private rsp0 * stack instead of the BSP's.", "kind": "function", "line": 870, "name": "tss_init_ap", "signature": "void tss_init_ap(int cpu)"}, {"kind": "function", "line": 888, "name": "context", "signature": "* context (anything entered via k_exec_user) is inside a syscall\n * (entry swapped 0 in), and a c..."}, {"kind": "function", "line": 901, "name": "point", "signature": "* return address as the resume point (\"continue the ISR\"), which\n * required the stranded ISR fra..."}, {"doc": "Fair-share scan with sched_lock HELD.  Returns a claimed (PROC_RUNNING) pid or -1.  vm_only restricts the pick to CLONE_VM threads, which is what APs run: same CR3, no brk/mmap view switch, no TLB work. Boyscout fix for static round-robin starvation: every READY candidate is compared by vruntime (plus nice bias), the minimum wins, and the winner is charged one quantum weighted by its nice. A CPU-bound nice-0 task can no longer starve an interactive nice--10 task; equal nice degrades to * round-robin order via the rotating start.", "kind": "function", "line": 930, "name": "sched_next_locked", "signature": "static int sched_next_locked(int start, int vm_only)"}, {"doc": "for (t = 0; t < MAX_PROCS; t++) { int cand = (start + 1 + t) % MAX_PROCS; unsigned long key; if (procs[cand].state != PROC_READY) continue; if (vm_only && !(procs[cand].clone_flags & CLONE_VM)) continue; key = procs[cand].vruntime + (unsigned long)(procs[cand].nice + SCHED_NICE_OFFSET) * SCHED_NICE_MULT_KEY; if (best < 0 || key < best_key) { best = cand; best_key = key; } } if (best < 0) return -1; procs[best].state = PROC_RUNNING; procs[best].vruntime += SCHED_BASE_QUANTUM + (unsigned long)(procs[best].nice + SCHED_NICE_OFFSET) * SCHED_NICE_MULT_CHARGE; return best; } /* Set scheduling niceness for pid (-20..19, clamped). Returns 0 or -1.", "kind": "function", "line": 948, "name": "sched_set_nice", "signature": "int sched_set_nice(int pid, int nice)"}, {"doc": "procs[best].state = PROC_RUNNING; procs[best].vruntime += SCHED_BASE_QUANTUM + (unsigned long)(procs[best].nice + SCHED_NICE_OFFSET) * SCHED_NICE_MULT_CHARGE; return best; } /* Set scheduling niceness for pid (-20..19, clamped). Returns 0 or -1. int sched_set_nice(int pid, int nice) { if (pid < 0 || pid >= MAX_PROCS) return -1; if (procs[pid].state == PROC_FREE) return -1; if (nice < NICE_MIN) nice = NICE_MIN; if (nice > NICE_MAX) nice = NICE_MAX; procs[pid].nice = nice; return 0; } /* Seccomp-basic helpers: deny/allow one MiniOS syscall for pid.", "kind": "function", "line": 957, "name": "seccomp_deny_one", "signature": "int seccomp_deny_one(int pid, int n)"}, {"kind": "function", "line": 964, "name": "seccomp_allow_one", "signature": "int seccomp_allow_one(int pid, int n)"}, {"kind": "function", "line": 971, "name": "seccomp_denied", "signature": "int seccomp_denied(int pid, int n)"}, {"doc": "Claim one READY thread for this CPU's idle loop (the AP only claims CLONE_VM threads): marks it RUNNING under lock and installs it as the * CPU's current pid.  Returns the pid, or -1 when nothing is ready.", "kind": "function", "line": 980, "name": "smp_try_claim_hint", "signature": "static int smp_try_claim_hint(int pid, int vm_only)"}, {"kind": "function", "line": 996, "name": "smp_claim_thread_v", "signature": "static int smp_claim_thread_v(int vm_only)"}, {"doc": "AP idle loop: hlt until a CLONE_VM thread is ready, run it, repeat. Entered once from smp_ap_entry on the AP stub stack; the first switch_to out of here saves these registers into ap_idle_proc[cpu], so every return to idle resumes this loop.  Interrupts stay OFF from the claim through the switch: a LAPIC tick landing in between would park this half-switched state over the incoming thread's ctx.  Threads enter with their own rflags (IF=1); a resume back to idle restores IF=0, so sti runs after every * switch_to return.  The hlt itself needs IF=1 to wake.", "kind": "function", "line": 1042, "name": "smp_ap_idle_loop", "signature": "void smp_ap_idle_loop(void)"}, {"doc": "AP timer preemption: time-slice the AP's current CLONE_VM thread with the next READY one.  An idle AP (cur_pid -1) needs nothing: its idle loop polls.  The park/unclaim discipline is the same as the BSP tick: park the trap frame (complete ctx), publish READY, claim the next, switch NOTRAP (load-only) so a stealing CPU always resumes a valid context.  A non-VM proc can never run here by construction; if one is * ever observed, leave it alone (fail safe, never migrate it).", "kind": "function", "line": 1076, "name": "sched_ap_preempt", "signature": "static void sched_ap_preempt(trap_frame_t *frame)"}, {"doc": "True when some AP is idle.  The BSP tick uses this to leave freshly parked CLONE_VM threads unclaimed: the idle AP's next poll (IPI wake) picks them up, which keeps thread execution biased to the APs * instead of the BSP winning every claim race.", "kind": "function", "line": 1146, "name": "smp_any_ap_idle", "signature": "static int smp_any_ap_idle(void)"}, {"kind": "function", "line": 1182, "name": "rlimit_cpu_exceeded", "signature": "int rlimit_cpu_exceeded(int pid)"}, {"kind": "function", "line": 1203, "name": "isr_dispatch", "signature": "void isr_dispatch(int vector, trap_frame_t *frame)"}, {"kind": "function", "line": 1780, "name": "BSP", "signature": "* CPU believe it is the BSP (wrong per-CPU identity, two CPUs\n         * running the shell contex..."}, {"kind": "function", "line": 1821, "name": "proc_get", "signature": "proc_t *proc_get(int pid)"}, {"kind": "function", "line": 1827, "name": "proc_create", "signature": "int proc_create(const char *name, int parent_pid)"}, {"doc": "Spawn body: runs with the timer held off by the wrapper below, so page-table construction, heap allocation and the READY publish are one atomic section against the 100 Hz preempt. A spawn that interleaves with a running process's brk/mmap/page-table syscalls otherwise shares every allocator and table writer with no fencing except per-call locks, and the newcomer is the one that pays (wild #UD/#PF in early init, a different page each boot). The window is RAM-speed only (file PIO stays outside in the caller); ticks coalesce across it, which is the documented cost of correctness, same trade as the fs_lock leaf. Never blocks: no schedule, yield, * wait or sleep on any path below.", "kind": "function", "line": 1945, "name": "proc_spawn_elf_inner", "signature": "static int proc_spawn_elf_inner(const char *name, void *data, unsigned size,\n                   i..."}, {"doc": "Atomic spawn wrapper: the whole construction (page tables, image copy, stack, publish) runs with the timer held off, so a running process's syscalls can never interleave the newcomer's heap and table writes. See the inner note for why the newcomer paid. Flags saved/restored (not bare cli/sti) so a caller that entered with IF=0 keeps it; scheduler-structure protection inside is spin_lock_irqsave on sched_lock/mm_lock, the CR3 windows save * theirs locally.", "kind": "function", "line": 2105, "name": "proc_spawn_elf", "signature": "int proc_spawn_elf(const char *name, void *data, unsigned size,\n                   int argc, char..."}, {"kind": "function", "line": 2147, "name": "schedule", "signature": "* that keeps schedule()'s own rbp runs the caller's frame accesses\n * (locals, leave/ret) on the ..."}, {"kind": "function", "line": 2154, "name": "schedule", "signature": "void schedule(void)"}, {"kind": "function", "line": 2235, "name": "yield", "signature": "void yield(void)"}, {"kind": "function", "line": 2250, "name": "do_exit", "signature": "void do_exit(int code)"}, {"doc": "frame is ambiguous, this one starts cleanly at fn(arg) on the given stack:  child RIP = fn, child RSP = stack, child RDI = arg (SysV first arg), entered through the same user_trampoline + iretq path as proc_create.  The caller (pthread-like user code) owns the stack: it must be allocated before the call (8 KB each per the roadmap) with its TOP passed here, and must stay alive until the thread is joined.  fn and stack must lie in the user window (checked by the syscall wrapper).  The thread shares CR3, the fd view and (by the schedule() CLONE_VM rule) the live brk/mmap view with its parent; the parent joins it with do_waitpid, which reaps the exit code without freeing the shared page tables. * Returns the child PID, or -1 when no slot or stack is usable.", "kind": "function", "line": 2314, "name": "do_thread_spawn", "signature": "long do_thread_spawn(unsigned long fn, unsigned long stack,\n                     unsigned long arg)"}, {"kind": "function", "line": 2514, "name": "itself", "signature": "* the shell itself (use mrun first), and a CLONE_VM thread forking\n * would duplicate shared stat..."}, {"doc": "Every register Linux preserves across a syscall, copied into a child's * PCB so it resumes after the syscall exactly like the caller.", "kind": "function", "line": 2537, "name": "ctx_from_frame", "signature": "static void ctx_from_frame(ctx_regs_t *c, const syscall_frame_t *f)"}, {"doc": "First code a fork or clone child runs (fork_trampoline, its own window live): store its tid at the CLONE_CHILD_SETTID address. A copy-on-write * page privatizes through the #PF path, never touching the parent's.", "kind": "function", "line": 2555, "name": "fork_child_settid", "signature": "void fork_child_settid(void)"}, {"kind": "function", "line": 2564, "name": "do_fork", "signature": "long do_fork(void)"}, {"doc": "A fork that fails names the resource that ran out (failure paths * report): -ENOMEM alone cannot tell a heap leak from a full stack pool.", "kind": "function", "line": 2570, "name": "fork_report", "signature": "static void fork_report(const char *what)"}, {"kind": "function", "line": 2577, "name": "do_fork_ex", "signature": "long do_fork_ex(uint64_t set_tid, uint64_t clear_tid)"}, {"doc": "NPTL thread (clone with CLONE_VM|CLONE_SIGHAND|CLONE_THREAD): same window and fd view, resumes after the syscall on newsp with the caller's registers, FSBASE = tls, joins the caller's thread group and is reaped * automatically. *parent_tid is written before the child is published.", "kind": "function", "line": 2724, "name": "do_clone_thread", "signature": "static long do_clone_thread(unsigned long flags, unsigned long newsp,\n                           ..."}, {"doc": "Zombify every live CLONE_THREAD member of a group except one pid. Caller * holds sched_lock; the slots are reclaimed by the auto-reap sweep.", "kind": "function", "line": 2838, "name": "kill_group_threads_locked", "signature": "static void kill_group_threads_locked(int tgid, int except)"}, {"doc": "Linux exit_group(2) and fatal-signal semantics, minus the caller's own exit (the caller follows with do_exit or do_proc_exit): every other thread of the group dies, and when the caller is a worker thread the leader dies too with code, so its parent's wait reports the group's fate instead of waiting on a leader that would never end. A foreground leader (pid 0) is the shell context and cannot be zombified; its * workers die and the leader keeps running, as before.", "kind": "function", "line": 2859, "name": "do_group_exit", "signature": "void do_group_exit(int code)"}, {"kind": "function", "line": 2887, "name": "aslr_mix", "signature": "static unsigned long aslr_mix(unsigned long salt)"}, {"kind": "function", "line": 2896, "name": "aslr_stack_bytes", "signature": "unsigned long aslr_stack_bytes(void)"}, {"kind": "function", "line": 2897, "name": "aslr_brk_pages", "signature": "unsigned long aslr_brk_pages(void)"}, {"kind": "function", "line": 2898, "name": "aslr_mmap_pages", "signature": "unsigned long aslr_mmap_pages(void)"}, {"kind": "function", "line": 2899, "name": "aslr_dyn_base", "signature": "unsigned long aslr_dyn_base(void)"}, {"doc": "Scope, fail-closed: the caller must be an isolated non-CLONE_VM ring-3 proc (pid 0 has no own window; a thread calling execve would keep CLONE_VM on a private window, which the view switch does not serve, so it refuses with -ENOSYS). Sibling threads die with the old image like Linux: at adopt, every CLONE_VM sharer of the old window becomes a zombie for its parent. ET_REL refuses with -ENOEXEC (ring-0 extensions load only through SPAWN's trust gate). OOM at any pre-adopt step releases what was claimed and returns -12 with the caller byte-identical. CLOEXEC fds close at adopt (armed by Linux O_CLOEXEC on open); the rest survive like fork. envp is not carried: setup_user_stack builds argc/argv only, so every execve starts with an empty * environment.", "kind": "function", "line": 2926, "name": "do_execve", "signature": "long do_execve(char *kpath, int kargc, char **kargv)"}, {"doc": "A zombie may still be finishing its exit tail (schedule()'s save and switch) on its own kernel stack on some CPU; its slot is reclaimable * only once no CPU runs it any more.", "kind": "function", "line": 3159, "name": "proc_running_anywhere", "signature": "static int proc_running_anywhere(int pid)"}, {"doc": "Reclaim every auto-reaped (CLONE_THREAD) zombie, or only those of one * thread group when tgid >= 0. Caller holds sched_lock.", "kind": "function", "line": 3168, "name": "reap_autoreap_locked", "signature": "static void reap_autoreap_locked(int tgid)"}, {"doc": "First free pid slot after reclaiming finished threads, or -1. Caller * holds sched_lock.", "kind": "function", "line": 3180, "name": "alloc_pid_locked", "signature": "static int alloc_pid_locked(void)"}, {"doc": "1 while a thread of group tgid has not finished exiting: still alive, or a zombie some CPU is still running on. Its leader's page tables and VMA context are the thread's too, so the leader is not reapable yet * (Linux likewise reports a group only once every thread is gone).", "kind": "function", "line": 3192, "name": "group_threads_live_locked", "signature": "static int group_threads_live_locked(int tgid)"}, {"kind": "function", "line": 3203, "name": "waitpid_scan", "signature": "static int waitpid_scan(int pid, int *found)"}, {"kind": "function", "line": 3224, "name": "do_waitpid", "signature": "int do_waitpid(int pid)"}, {"doc": "1 when the caller has a waitable child matching pid (-1 = any): one that is not an auto-reaped thread, in any state but free. Caller holds * sched_lock.", "kind": "function", "line": 3241, "name": "waitpid_has_child", "signature": "static int waitpid_has_child(int pid)"}, {"doc": "Linux wait4 core (docs/spec/smp-sched.md): reap one matching child and report its pid through *found and its raw exit code as the result; WAITPID_NOCHILD when there is nothing to wait for, WAITPID_NONE when * nohang and nothing has exited yet.", "kind": "function", "line": 3255, "name": "do_waitpid_linux", "signature": "int do_waitpid_linux(int pid, int nohang, int *found)"}, {"doc": "Reap one zombie child for `jobs`/auto-reap messages: returns 1 with * pid+code, or 0 when none is ready. Never blocks.", "kind": "function", "line": 3272, "name": "shell_reap_nb", "signature": "int shell_reap_nb(int *pid_out, int *code_out)"}, {"doc": "Reap one specific zombie child (foreground wait). Returns 1 with the * code, or 0 when that pid is not a reaped zombie right now.", "kind": "function", "line": 3286, "name": "shell_reap_one", "signature": "int shell_reap_one(int pid, int *code_out)"}, {"doc": "Reap one specific zombie child (foreground wait). Returns 1 with the * code, or 0 when that pid is not a reaped zombie right now. int shell_reap_one(int pid, int *code_out) { int code, found = -1; if (!proc_get(current_pid)) return 0; spin_lock(&sched_lock); code = waitpid_scan(pid, &found); spin_unlock(&sched_lock); if (code == WAITPID_NONE) return 0; if (code_out) *code_out = code; return 1; } /* Live non-free children of the caller (shell job table size).", "kind": "function", "line": 3298, "name": "shell_nchildren", "signature": "int shell_nchildren(void)"}, {"doc": "True kill: the TARGET becomes a zombie for its parent to reap (its stack/tables free in do_waitpid, never here). Killing self keeps the old do_exit path. A zombie on an AP is abandoned by the AP preempt * path, so a kill never leaves a corpse running.", "kind": "function", "line": 3324, "name": "do_kill", "signature": "int do_kill(int pid)"}, {"doc": "End pid with exit code (negative: killed by signal -code, as wait4 * reports it). Killing the caller is a group exit.", "kind": "function", "line": 3330, "name": "do_kill_code", "signature": "int do_kill_code(int pid, int code)"}, {"kind": "function", "line": 3357, "name": "timer_tick", "signature": "void timer_tick(void)"}, {"kind": "function", "line": 3362, "name": "sched_init", "signature": "void sched_init(void)"}, {"kind": "function", "line": 66, "name": "user_trampoline", "signature": "extern void user_trampoline(void);"}, {"kind": "function", "line": 67, "name": "fork_trampoline", "signature": "extern void fork_trampoline(void);"}, {"kind": "function", "line": 72, "name": "exec_enter", "signature": "extern void exec_enter(unsigned long frame);"}, {"kind": "function", "line": 82, "name": "PROC_KSTACK_OFF", "signature": "* PROC_KSTACK_OFF (it cannot use C here). The asm derives both * immediates from headers/syscall_asm.h, so this assert is the single * check: if it fires, the struct changed and the macros in sched.h "}, {"kind": "function", "line": 97, "name": "descriptor", "signature": "* descriptor (two slots) per CPU past the 5 stage-2 entries. */ _Static_assert((5 + 2 * MAX_CPUS) * 8 == GDT64_SMP_BYTES, \"GDT SMP size\");"}, {"kind": "function", "line": 128, "name": "here", "signature": "* smp_ap_idle_loop here (idle_proc ctx.rsp points at the top). */ static char ap_idle_stack[MAX_CPUS][4096] __attribute__((aligned(16)));"}, {"kind": "function", "line": 452, "name": "sched_lock", "signature": "* hold sched_lock (+mm_lock at the swap sites);"}, {"kind": "function", "line": 567, "name": "slot", "signature": "* must not eat a quarter of a 16 KB slot (see the stack discipline * contract in CLAUDE.md). Fail-closed on OOM. */ struct stop_row *snap = (struct stop_row *)kmalloc(sizeof(struct stop_row) * MAX_PRO"}, {"kind": "function", "line": 627, "name": "sys_ticks", "signature": "* sys_ticks (PIT 100 Hz on the BSP, broadcast as IPIs to APs);"}, {"kind": "function", "line": 634, "name": "rtl_counters", "signature": "extern void rtl_counters(unsigned int *tx_frames, unsigned int *rx_frames);"}, {"kind": "function", "line": 636, "name": "rtl_present", "signature": "extern int rtl_present(void);"}, {"kind": "function", "line": 796, "name": "IRQ4", "signature": "* IRQ4 (COM1, UART IER stays 0 so it never fires) + * IRQ5 (Sound Blaster 16 DMA done). In the mask register a bit set * means masked, so 0xC8 masks only IRQ3, IRQ6 and IRQ7. Masking IRQ5 * here starv"}, {"kind": "function", "line": 913, "name": "FSBASE", "signature": "* for FSBASE (per-proc TLS): a thread preempted after arch_prctl * would otherwise resume with whatever base the next thread left * behind. GSBASE is deliberately untouched (live kernel per-CPU). */ i"}, {"kind": "function", "line": 1320, "name": "syscall", "signature": "* outgoing syscall (see sched_rearm_kgs). Without * this the next entry swapgs puts garbage under GS * and the pid math faults. */ sched_rearm_kgs();"}, {"kind": "function", "line": 2180, "name": "PROC_SWITCHING", "signature": "* while the thread is still PROC_SWITCHING (never claimable), * then set the resume point and publish. A BLOCKED/ZOMBIE * thread keeps its state (no one claims it until a wake). */ switch_save_only(cu"}, {"kind": "function", "line": 2243, "name": "returns", "signature": "* that returns (and the resumed thread returns with IF=1). */ __asm__ volatile(\"cli\");"}, {"kind": "function", "line": 2345, "name": "registers", "signature": "* registers (float args would need XMM inheritance, which the * arg-passing contract does not carry: fn takes one integer arg). */ child->fpu_save = fpu_alloc_clean();"}, {"kind": "function", "line": 2595, "name": "shares", "signature": "* thread on another CPU kept its writable translation and wrote straight * into frames the child now shares (the forked FreeDom renderer read the * parent's later pointers as garbage), so its TLB is s"}, {"kind": "function", "line": 2633, "name": "MSR", "signature": "* in the MSR (the PCB field refreshes on switch-out) and its FPU * regs live in the CPU (the PCB image refreshes on switch-out). * The child resumes user code directly, never through glibc init, * so "}, {"kind": "function", "line": 2908, "name": "cli", "signature": "* cli (disk PIO must never run with the timer held off);"}, {"kind": "function", "line": 2922, "name": "adopt", "signature": "* adopt (armed by Linux O_CLOEXEC on open);"}, {"kind": "function", "line": 3370, "name": "it", "signature": "* it (SPAWN/exec point proc 0 here transiently);"}, {"kind": "function", "line": 3422, "name": "park", "signature": "* an image its live FPU registers would be dropped by the preempt * park (the save path skips a null area). */ procs[0].fpu_save = fpu_alloc_clean();"}, {"kind": "function", "line": 3433, "name": "zeroed", "signature": "* still zeroed (kmemset happens inside idt_init) faults through a * null gate. Handlers for 32/33/44 are safe pre-mouse-init. */ idt_init();"}, {"doc": "#define MY_USER_LOAD_BASE USER_LOAD_BASE proc_t procs[MAX_PROCS]; int    proc_count; cpu_t  cpus[MAX_CPUS]; int    cpu_count = 1; volatile uint64_t sys_ticks; volatile int user_program_active; volatile int sched_ready; spinlock_t sched_lock = SPINLOCK_INIT; extern void user_trampoline(void); extern void fork_trampoline(void); /* Per-pid kernel-stack tops the syscall entry saves (syscall_entry.S).", "kind": "variable", "line": 69, "name": "sc_top_save", "signature": "extern unsigned long sc_top_save[];"}, {"kind": "variable", "line": 152, "name": "isr_stub_table", "signature": "extern void *isr_stub_table[];"}, {"kind": "variable", "line": 635, "name": "net_rx_dropped", "signature": "extern unsigned int net_rx_dropped;"}, {"doc": "Guards the shared g_brk/g_brk_limit/user_mmap_cur view and the VMA trees against concurrent brk/mmap/munmap syscalls from threads on different CPUs.  Defined in kernel/syscalls.c; always taken INSIDE sched_lock (lock order: sched_lock -> mm_lock), never alone in the * scheduler paths.", "kind": "variable", "line": 882, "name": "mm_lock", "signature": "extern spinlock_t mm_lock;"}, {"kind": "macro", "line": 53, "name": "MY_SYS_KSTK_TOP", "signature": "#define MY_SYS_KSTK_TOP"}, {"kind": "macro", "line": 54, "name": "MY_USER_STACK_TOP", "signature": "#define MY_USER_STACK_TOP"}, {"kind": "macro", "line": 55, "name": "MY_USER_LOAD_BASE", "signature": "#define MY_USER_LOAD_BASE"}, {"kind": "macro", "line": 123, "name": "NMI_IST_STACK_SZ", "signature": "#define NMI_IST_STACK_SZ"}, {"kind": "macro", "line": 124, "name": "NMI_VECTOR", "signature": "#define NMI_VECTOR"}, {"kind": "macro", "line": 125, "name": "NMI_IST_SLOT", "signature": "#define NMI_IST_SLOT"}, {"kind": "macro", "line": 155, "name": "KSTACK_SZ", "signature": "#define KSTACK_SZ"}, {"kind": "macro", "line": 168, "name": "KSTACK_PAINT", "signature": "#define KSTACK_PAINT"}, {"kind": "macro", "line": 169, "name": "KSTACK_CANARY", "signature": "#define KSTACK_CANARY"}]}, {"doc": "scrollback.c - Console scrollback ring buffer.", "id": "kernel/scrollback.c", "kind": "module", "label": "scrollback.c", "language": "c", "sha256": "225281a42b933059", "symbol_count": 8, "symbols": [{"kind": "function", "line": 17, "name": "sb_init", "signature": "void sb_init(void)"}, {"kind": "function", "line": 23, "name": "sb_capture_row0", "signature": "void sb_capture_row0(void)"}, {"kind": "function", "line": 34, "name": "sb_reset", "signature": "void sb_reset(void)"}, {"kind": "function", "line": 38, "name": "sb_get_count", "signature": "int sb_get_count(void)"}, {"kind": "function", "line": 39, "name": "sb_get_head", "signature": "int sb_get_head(void)"}, {"kind": "function", "line": 41, "name": "sb_get_char", "signature": "char sb_get_char(int row, int col)"}, {"kind": "function", "line": 4, "name": "vga_scroll", "signature": "* Captured lazily from vga_scroll();"}, {"kind": "macro", "line": 12, "name": "SCROLLBACK_ROWS", "signature": "#define SCROLLBACK_ROWS"}]}, {"doc": "Docstring: seccomp_bpf.c -- classic BPF checker and interpreter for Linux", "id": "kernel/seccomp_bpf.c", "kind": "module", "label": "seccomp_bpf.c", "language": "c", "sha256": "49eb15f5cf7930a1", "symbol_count": 12, "symbols": [{"doc": "Freestanding: no libc, no kernel state; the same object links into the kernel and into the host test.  #include \"seccomp_bpf.h\" #define SBPF_OP_MASK   0xf0u #define SBPF_SRC_MASK  0x08u #define SBPF_SIZE_MASK 0x18u #define SBPF_MODE_MASK 0xe0u #define SBPF_RVAL_MASK 0x18u #define SBPF_MISC_MASK 0xf8u #define SBPF_MEM_ALL   0xffffu /* Is code one of the classic opcodes Linux accepts in a seccomp filter?", "kind": "function", "line": 17, "name": "sbpf_opcode_ok", "signature": "static int sbpf_opcode_ok(const sbpf_insn *in)"}, {"kind": "function", "line": 69, "name": "sbpf_check", "signature": "int sbpf_check(const sbpf_insn *prog, unsigned len, unsigned short *scratch)"}, {"doc": "scratch[pc + 1u + in->k] &= (unsigned short)memvalid; } else { scratch[pc + 1u + in->jt] &= (unsigned short)memvalid; scratch[pc + 1u + in->jf] &= (unsigned short)memvalid; } memvalid = SBPF_MEM_ALL; } else if (cls == SBPF_RET) { memvalid = SBPF_MEM_ALL; } } return 0; } /* 32-bit word of seccomp_data at a checked, aligned offset.", "kind": "function", "line": 114, "name": "sbpf_load_word", "signature": "static unsigned int sbpf_load_word(const sbpf_data *d, unsigned off)"}, {"kind": "function", "line": 120, "name": "sbpf_run", "signature": "unsigned int sbpf_run(const sbpf_insn *prog, unsigned len, const sbpf_data *d)"}, {"kind": "function", "line": 194, "name": "sbpf_action_rank", "signature": "int sbpf_action_rank(unsigned int action)"}, {"kind": "macro", "line": 8, "name": "SBPF_OP_MASK", "signature": "#define SBPF_OP_MASK"}, {"kind": "macro", "line": 9, "name": "SBPF_SRC_MASK", "signature": "#define SBPF_SRC_MASK"}, {"kind": "macro", "line": 10, "name": "SBPF_SIZE_MASK", "signature": "#define SBPF_SIZE_MASK"}, {"kind": "macro", "line": 11, "name": "SBPF_MODE_MASK", "signature": "#define SBPF_MODE_MASK"}, {"kind": "macro", "line": 12, "name": "SBPF_RVAL_MASK", "signature": "#define SBPF_RVAL_MASK"}, {"kind": "macro", "line": 13, "name": "SBPF_MISC_MASK", "signature": "#define SBPF_MISC_MASK"}, {"kind": "macro", "line": 14, "name": "SBPF_MEM_ALL", "signature": "#define SBPF_MEM_ALL"}]}, {"doc": "serial.c -- COM1 16550 UART driver.", "id": "kernel/serial.c", "kind": "module", "label": "serial.c", "language": "c", "sha256": "521a991bc7d3a6f2", "symbol_count": 9, "symbols": [{"kind": "function", "line": 20, "name": "serial_init", "signature": "void serial_init(void)"}, {"kind": "function", "line": 30, "name": "serial_tx_ready", "signature": "static int serial_tx_ready(void)"}, {"kind": "function", "line": 31, "name": "serial_rx_ready", "signature": "static int serial_rx_ready(void)"}, {"kind": "function", "line": 33, "name": "serial_putc", "signature": "void serial_putc(char c)"}, {"kind": "function", "line": 38, "name": "serial_e_count", "signature": "unsigned long serial_e_count(void)"}, {"kind": "function", "line": 40, "name": "serial_puts", "signature": "void serial_puts(const char *s)"}, {"kind": "function", "line": 42, "name": "serial_available", "signature": "int serial_available(void)"}, {"kind": "function", "line": 44, "name": "serial_getc", "signature": "int serial_getc(void)"}, {"kind": "macro", "line": 18, "name": "COM1", "signature": "#define COM1"}]}, {"id": "kernel/shell.c", "kind": "module", "label": "shell.c", "language": "c", "sha256": "f073dfc29442fc2e", "symbol_count": 98, "symbols": [{"kind": "struct", "line": 2079, "name": "job_row"}, {"kind": "struct", "line": 3723, "name": "ps_row"}, {"doc": "Runnable-file lookup: a bare name is mapped to a toolchain directory by its suffix, so `ld.o` finds objects/ld.o, `fib.elf` finds bin/fib.elf and `w1.cvm` finds cvm/w1.cvm. A bare name with no recognised suffix (cp, freedom, ...) resolves through bin/, the command path. Every candidate is checked for existence before it is run, so a name can never be truncated * into a path it does not own.", "kind": "struct", "line": 61, "name": "ShellRunDir"}, {"doc": "Queue a desktop-icon command to run after the current user program exits. Overwrites any earlier pending launch; safe to call from the ISR (it only * copies into a kernel buffer).", "kind": "function", "line": 87, "name": "shell_queue_launch", "signature": "void shell_queue_launch(const char *cmd)"}, {"kind": "function", "line": 115, "name": "shell_readline_active", "signature": "int shell_readline_active(void)"}, {"kind": "function", "line": 116, "name": "shell_focus_park", "signature": "void shell_focus_park(void)"}, {"kind": "function", "line": 121, "name": "shell_focus_restore", "signature": "void shell_focus_restore(void)"}, {"kind": "function", "line": 148, "name": "shell_prompt", "signature": "static void shell_prompt(void)"}, {"doc": "Strict decimal parse for the `vol` builtin: delegates the digit and overflow work to shell_parse_long and clamps the result to the * speaker's valid range. Garbage is rejected, never silently zero.", "kind": "function", "line": 158, "name": "shell_parse_vol", "signature": "static int shell_parse_vol(const char *s, unsigned *out)"}, {"doc": "Read one line into buf (at most size-1 chars). Echoes input and * honours backspace. Shared by the shell prompt and the editor.", "kind": "function", "line": 184, "name": "shell_readline_buf", "signature": "void shell_readline_buf(char *buf, int size)"}, {"doc": "The component of a ramdisk path after the last '/', or the whole path when * there is no '/'. Used to match a bare command word against a file's name.", "kind": "function", "line": 213, "name": "shell_name_base", "signature": "static const char *shell_name_base(const char *path)"}, {"doc": "Runnable tier of a file name for first-word TAB completion: 0=.elf, 1=.cvm, 2=.o, 3=anything else. A bare command word completes toward the highest-priority non-empty tier, so `poke` offers the game binary instead * of its icon PNG.", "kind": "function", "line": 238, "name": "shell_complete_tier", "signature": "static int shell_complete_tier(const char *nm)"}, {"kind": "function", "line": 250, "name": "shell_complete_replace", "signature": "static void shell_complete_replace(char *buf, int size, int *pos,\n                               ..."}, {"doc": "Complete an argument word from MiniFS (the ramdisk loop at the call site covers the ramdisk half). The word's directory part resolves against the cwd; entries of that MiniFS directory matching the leaf prefix are offered as full word-relative paths, directories with a trailing '/'. At most 8 entries in static storage, never truncated, * duplicates of ramdisk offers skipped.", "kind": "function", "line": 271, "name": "shell_complete_minifs_arg", "signature": "static void shell_complete_minifs_arg(const char *word, unsigned long wlen,\n                     ..."}, {"kind": "function", "line": 338, "name": "shell_readline", "signature": "static void shell_readline(void)"}, {"doc": "Redraw the edit line: erase what is shown, then write `text` into buf and onto the console, leaving the text cursor at `*pos`. The cursor is drawn on the framebuffer terminal; on the serial console the text is rewritten * and the reader's position is implied by the console cursor.", "kind": "function", "line": 346, "name": "shell_hist_show", "signature": "static void shell_hist_show(char *buf, int size, int *pos, const char *text)"}, {"doc": "Repaint the edit line after a cursor move or mid-line edit: erase the whole visible line, rewrite buf, then back the console cursor up to `pos` and redraw the framebuffer text cursor there. `shell_cur` holds the on-screen cursor column, so the erase backs up to the line start before blanking it * (a serial backspace alone does not clear a character).", "kind": "function", "line": 368, "name": "shell_line_repaint", "signature": "static void shell_line_repaint(char *buf, int size, int pos)"}, {"doc": "Insert character c into buf at `pos`, shifting the tail right. Bounds * checked; the caller repaints afterwards.", "kind": "function", "line": 381, "name": "shell_line_insert", "signature": "static void shell_line_insert(char *buf, int size, int *pos, char c)"}, {"doc": "Insert character c into buf at `pos`, shifting the tail right. Bounds * checked; the caller repaints afterwards. static void shell_line_insert(char *buf, int size, int *pos, char c) { int len = (int)kstrlen(buf); if (len >= size - 1) return; kmemmove(buf + *pos + 1, buf + *pos, (unsigned long)(len - *pos + 1)); buf[*pos] = c; (*pos)++; } /* Delete the character before the cursor (backspace).", "kind": "function", "line": 390, "name": "shell_line_backspace", "signature": "static void shell_line_backspace(char *buf, int size, int *pos)"}, {"doc": "kmemmove(buf + *pos + 1, buf + *pos, (unsigned long)(len - *pos + 1)); buf[*pos] = c; (*pos)++; } /* Delete the character before the cursor (backspace). static void shell_line_backspace(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); if (*pos <= 0) return; kmemmove(buf + *pos - 1, buf + *pos, (unsigned long)(len - *pos + 1)); (*pos)--; } /* Delete the character at the cursor (Delete key).", "kind": "function", "line": 398, "name": "shell_line_delete", "signature": "static void shell_line_delete(char *buf, int size, int *pos)"}, {"doc": "int len = (int)kstrlen(buf); if (*pos <= 0) return; kmemmove(buf + *pos - 1, buf + *pos, (unsigned long)(len - *pos + 1)); (*pos)--; } /* Delete the character at the cursor (Delete key). static void shell_line_delete(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); if (*pos >= len) return; kmemmove(buf + *pos, buf + *pos + 1, (unsigned long)(len - *pos)); } /* Delete from the cursor to the start of the line (Ctrl+U).", "kind": "function", "line": 405, "name": "shell_line_kill_front", "signature": "static void shell_line_kill_front(char *buf, int size, int *pos)"}, {"doc": "static void shell_line_delete(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); if (*pos >= len) return; kmemmove(buf + *pos, buf + *pos + 1, (unsigned long)(len - *pos)); } /* Delete from the cursor to the start of the line (Ctrl+U). static void shell_line_kill_front(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); kmemmove(buf, buf + *pos, (unsigned long)(len - *pos + 1)); pos = 0; } /* Delete from the cursor to the end of the line (Ctrl+K).", "kind": "function", "line": 412, "name": "shell_line_kill_tail", "signature": "static void shell_line_kill_tail(char *buf, int size, int *pos)"}, {"doc": "/* Delete from the cursor to the start of the line (Ctrl+U). static void shell_line_kill_front(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); kmemmove(buf, buf + *pos, (unsigned long)(len - *pos + 1)); pos = 0; } /* Delete from the cursor to the end of the line (Ctrl+K). static void shell_line_kill_tail(char *buf, int size, int *pos) { buf[*pos] = '\\0'; } /* Delete the word before the cursor (Ctrl+W): skip spaces, then non-spaces.", "kind": "function", "line": 417, "name": "shell_line_kill_word", "signature": "static void shell_line_kill_word(char *buf, int size, int *pos)"}, {"doc": "Most recent history entry starting with `prefix` (of length plen) that is strictly longer than the prefix, or -1 when there is none. The suggestion * for a typed prefix is always the newest match, zsh-style.", "kind": "function", "line": 429, "name": "shell_hist_newest_match", "signature": "static int shell_hist_newest_match(const char *prefix, unsigned long plen)"}, {"kind": "function", "line": 446, "name": "line", "signature": "* to the live line (handled by the caller resetting shell_hist_idx). */\nstatic void shell_hist_na..."}, {"doc": "Shell prompt readline: like shell_readline_buf plus command history. Up arrow (ESC [ A) recalls the previous command starting with the typed prefix (empty prefix recalls everything), down arrow moves forward. Right arrow at end of line accepts the newest history match for the prefix; TAB completes programs, files and recent history words. Any * editing key while scrolling returns to the live line.", "kind": "function", "line": 491, "name": "shell_readline_hist", "signature": "static void shell_readline_hist(char *buf, int size)"}, {"kind": "function", "line": 826, "name": "shell_parse", "signature": "int shell_parse(char *line, char **argv, int max_args)"}, {"doc": "Startup commands from etc/init: one shell command per line, `#` comments and blank lines skipped. Runs once at boot before the first prompt; a missing file means a plain boot. Each line goes through the same parse + redirect + builtin dispatch as an * interactive command, so init stays a plain command list.", "kind": "function", "line": 855, "name": "shell_run_init", "signature": "static void shell_run_init(void)"}, {"kind": "function", "line": 894, "name": "shell_run", "signature": "void shell_run(void)"}, {"kind": "function", "line": 966, "name": "shell_load", "signature": "static int shell_load(const char *fname, char *progname_out, void **entry_out)"}, {"kind": "function", "line": 1029, "name": "outw_port", "signature": "static inline void outw_port(unsigned short port, unsigned short val)"}, {"kind": "function", "line": 1035, "name": "shell_cmd_poweroff", "signature": "static void shell_cmd_poweroff(void)"}, {"doc": "The toolchain directory that owns `name`, chosen by suffix. Bare names with * no recognised suffix fall through to the command path bin/.", "kind": "function", "line": 1051, "name": "shell_run_dir_for", "signature": "static const ShellRunDir *shell_run_dir_for(const char *name)"}, {"doc": "Is `resolved` (already normalised against the cwd) a real ramdisk file? A * directory name or a non-existent path is rejected, never run.", "kind": "function", "line": 1069, "name": "shell_file_is_real", "signature": "static int shell_file_is_real(const char *resolved)"}, {"doc": "Resolve `name` to a full ramdisk path suitable for running. A bare name is tried first against the cwd, then through the suffix-picked toolchain directory, then through the remaining directories as fallback. Returns 1 and fills `out` (cap bytes) on success, 0 when no candidate is a real file. A candidate that cannot fit `cap` is skipped like a missing file, never * truncated.", "kind": "function", "line": 1081, "name": "shell_resolve_run", "signature": "static int shell_resolve_run(const char *name, char *out, unsigned cap)"}, {"doc": "ET_REL trust gate (boyscout fix for ring-0 .o without validation): relocatables execute as kernel extensions, so only the toolchain directory (ETREL_TRUSTED_DIR in kernel.h) owns them. `full` is already normalised by fs_resolve (\"..\"/\".\"/\"//\" collapsed, no symlinks on MiniFS), so a prefix match is a containment proof, not a string hope. TOCTOU note: the bytes are snapshotted into a kernel buffer at open time and the gate checks the same resolved path the bytes were read from; swapping the file between resolve and open only changes WHICH bytes load, and hostile bytes still face the ELF/reloc validators plus * the ETREL_IMAGE_MAX cap. ET_EXEC/ET_DYN/CVM are unaffected.", "kind": "function", "line": 1123, "name": "etrel_path_trusted", "signature": "static int etrel_path_trusted(const char *full)"}, {"doc": "Run a raw ELF image (ET_REL, ET_EXEC or ET_DYN) already read into `data`. argv[0] is the program name the program sees. Returns the exit code, or -1 when the buffer is not a loadable ELF. The image is not registered; it is * relocated and executed fresh, then dropped.", "kind": "function", "line": 1163, "name": "shell_run_elf_buf_path", "signature": "static int shell_run_elf_buf_path(const char *data, unsigned size, int argc,\n                    ..."}, {"doc": "Load the ramdisk file at `full` and run it as an ELF. Returns the exit * code, or -1 when the file cannot be read or loaded.", "kind": "function", "line": 1196, "name": "shell_run_elf_file", "signature": "static int shell_run_elf_file(const char *full, int argc, char **argv)"}, {"doc": "Load a Linux ELF from the MiniFS disk and run it (preserves the historical * `run` fallback when a name is not on the ramdisk).", "kind": "function", "line": 1209, "name": "shell_run_elf_minifs", "signature": "static int shell_run_elf_minifs(const char *name, int argc, char **argv)"}, {"doc": "Run a `.cvm` module at the resolved path `full`. The interpreter is loaded from the ramdisk on first use and cached. argv[0] is the module name the module sees; the interpreter passes it and the remaining words through as * a Linux-style argv.", "kind": "function", "line": 1266, "name": "shell_run_cvm", "signature": "static int shell_run_cvm(const char *full, int argc, char **argv)"}, {"doc": "Run `name` as a ramdisk/MiniFS file: `.cvm` modules through the interpreter, ELF files by content through the matching loader. Returns the * exit code, or -1 when the name resolves to nothing runnable.", "kind": "function", "line": 1302, "name": "shell_run_file", "signature": "static int shell_run_file(const char *name, int argc, char **argv)"}, {"doc": "--- Multitask run (mrun): concurrent isolated ELFs ----  `mrun a.elf b.elf ...` loads each ET_EXEC/ET_DYN into its own user window (proc_spawn_elf) and waits for all of them. The 100 Hz timer preempts the BSP across the READY set, so small programs overlap in time instead of running one after another. ET_REL is refused (ring-0 extensions are not multitask-safe); `.cvm` keeps the `run` path. Best-effort limits of this revision: no mmap/VMA isolation between the children (programs that mmap concurrently share the global VMA * tree) and one shared fd table; exit codes print per program.", "kind": "function", "line": 1346, "name": "shell_read_elf_bytes", "signature": "static int shell_read_elf_bytes(const char *name, unsigned char **out,\n                          ..."}, {"kind": "function", "line": 1412, "name": "code", "signature": "* the last exit code (130 when interrupted). */\nstatic int shell_wait_fg(int *pids, int n, int ki..."}, {"kind": "function", "line": 1466, "name": "shell_cmd_mrun", "signature": "static void shell_cmd_mrun(int argc, char **argv)"}, {"doc": "`run <elf> &`: background a single isolated ELF (same spawn path as mrun). ET_REL and .cvm stay foreground-only: ring-0 extensions and the * single cached interpreter cannot run detached.", "kind": "function", "line": 1514, "name": "shell_run_bg", "signature": "static void shell_run_bg(const char *name, int argc, char **argv)"}, {"kind": "function", "line": 1557, "name": "desktop_path", "signature": "static void desktop_path(const char *name, char *dst, unsigned cap)"}, {"kind": "function", "line": 1566, "name": "desktop_flag", "signature": "static void desktop_flag(const char *name)"}, {"kind": "function", "line": 1576, "name": "desktop_flag_on", "signature": "static int desktop_flag_on(const char *name)"}, {"kind": "function", "line": 1590, "name": "flows", "signature": "* and external flows (make wl) set it themselves. */\nstatic void desktop_unflag(const char *name)"}, {"kind": "function", "line": 1598, "name": "desktop_srv_alive", "signature": "static int desktop_srv_alive(void)"}, {"kind": "function", "line": 1614, "name": "shell_cmd_desktop", "signature": "static void shell_cmd_desktop(int argc, char **argv)"}, {"doc": "Unified dispatcher used by `run` and by bare commands: a registered program wins, then the runnable-file resolver. argv[0] is the command/program name * as typed. Returns the exit code, or -1 when the name cannot be run.", "kind": "function", "line": 1678, "name": "shell_run_any", "signature": "int shell_run_any(const char *name, int argc, char **argv)"}, {"doc": "--- Graphics debugging (`gfx` builtin) ----  The serial console is the observability surface the BDD suite drives, but a framebuffer program's output never reaches it. `gfx` lifts the graphics side onto the console: state, single-pixel sampling, region statistics and a PPM screenshot are all reported as text, so the desktop and the windowed graphics programs are testable from the shell exactly like `date`/`vol` are. Every coordinate is clamped to the framebuffer and every parse is * strict, so a malformed invocation is a usage diagnostic, never a crash.", "kind": "function", "line": 1751, "name": "gfx_parse_int", "signature": "static int gfx_parse_int(const char *s, int *out)"}, {"doc": "Read the current 256-entry VGA DAC palette (3x6-bit per entry, read at 8-bit precision by the kernel's normalisation). Used by `gfx shot` to turn the * indexed framebuffer into an RGB PPM.", "kind": "function", "line": 1771, "name": "gfx_read_palette", "signature": "static void gfx_read_palette(unsigned char pal[768])"}, {"kind": "function", "line": 1778, "name": "shell_cmd_gfx", "signature": "static void shell_cmd_gfx(int argc, char **argv)"}, {"doc": "`wm <op>` — window-manager operations, exposed as a shell builtin so the tiling-WM behaviour is observable and testable over the serial console exactly like `date`/`vol`. The operations are the same functions the title-bar buttons, the Alt/Super shortcuts and the mouse tick call, so * the framebuffer and the shell can never disagree.", "kind": "function", "line": 1930, "name": "shell_cmd_wm", "signature": "static void shell_cmd_wm(int argc, char **argv)"}, {"kind": "function", "line": 2065, "name": "tree", "signature": "* tree (mmap-heavy jobs stay best-effort), legacy blocking `run` ignores\n * Ctrl+C (it never poll..."}, {"kind": "function", "line": 2078, "name": "shell_cmd_jobs", "signature": "static void shell_cmd_jobs(void)"}, {"doc": "Live-child check for one pid: a slot that is neither FREE nor reparented still belongs to this shell. Waiting on anything else (an already reaped job, a stranger's pid) must fail fast: the old code fell into shell_wait_fg for a pid that can never exit again and yield-looped forever with the console wedged (only Ctrl+C * escaped), which read exactly like a dead machine.", "kind": "function", "line": 2107, "name": "shell_has_child", "signature": "static int shell_has_child(int pid)"}, {"kind": "function", "line": 2117, "name": "shell_cmd_wait", "signature": "static void shell_cmd_wait(int argc, char **argv)"}, {"kind": "function", "line": 2152, "name": "shell_cmd_kill", "signature": "static void shell_cmd_kill(int argc, char **argv)"}, {"doc": "`mem` — memory and disk pressure in one screenful: kernel heap use (dlmalloc), ramdisk use versus its cap, MiniFS free blocks/inodes and live processes. The demo-scale failure mode is a silent exhaustion (a big Zone alloc or a ramdisk write fails closed far from its cause), * so this is the first thing to read when a load stops loading.", "kind": "function", "line": 2175, "name": "shell_cmd_mem", "signature": "static void shell_cmd_mem(void)"}, {"kind": "function", "line": 2208, "name": "VMA", "signature": "* plus the live VMA (mmap) tree. The walk is bounded (64-deep explicit\n * stack, 128 regions prin..."}, {"kind": "function", "line": 2281, "name": "to", "signature": "* actually trap to (brk/mmap/munmap/mprotect) and says so up front. */\nstatic void shell_cmd_trac..."}, {"doc": "Strict unsigned parse for debugger/inspector operands: `0x`-prefixed hex or plain decimal, no signs, no trailing garbage, fail-closed on overflow or empty input. katol is decimal-only, so `gdb dump 0x400000` used to parse as 0; this is the single choke point for numeric * inspector arguments.", "kind": "function", "line": 2350, "name": "shell_parse_u64", "signature": "static int shell_parse_u64(const char *s, unsigned long *out)"}, {"doc": "Strict signed decimal twin of shell_parse_u64: optional sign, at least one digit, whole string consumed, overflow fail-closed. The bound comes from the compiler's __LONG_MAX__ (freestanding-safe, no libc header needed); a negative sign allows one extra unit of magnitude for LONG_MIN. Shared through shell.h so the editor's line * numbers use the same choke point instead of a second copy.", "kind": "function", "line": 2366, "name": "shell_parse_long", "signature": "int shell_parse_long(const char *s, long *out)"}, {"doc": "Bounded pid parse shared by wait/kill/vmmap: one range check instead of three open-coded copies. min_pid is 1 for job commands (pid 0 is the * shell view, never a job) and 0 for inspectors like vmmap.", "kind": "function", "line": 2387, "name": "shell_parse_pid", "signature": "int shell_parse_pid(const char *s, int min_pid, int *out)"}, {"doc": "`gdb <op>` -- in-OS inspector half of the debugger story. Full register-level debugging (breakpoints, single-step, live register edit) stays on the QEMU gdb stub: `make gdb`, then from the host `gdb -ex 'target remote :1234' -ex 'add-symbol-file kernel.elf 0x100000'`. Here: `gdb regs [pid]` dumps the stored context (LIVE sampled registers for the running pid), `gdb dump <addr> <len>` hexdumps 1..256 bytes * (decimal or 0x-hex), `gdb qemu` prints the remote hookup.", "kind": "function", "line": 2402, "name": "shell_cmd_gdb", "signature": "static void shell_cmd_gdb(int argc, char **argv)"}, {"doc": "`hash <file>` — XXH64 (64-bit, seed 0) of a ramdisk/MiniFS file, streamed in bounded chunks so a large MiniFS file never needs a whole-file buffer. This is the integrity tool for CVM modules and any ramdisk payload: an image built from source is compared against a recorded hash, and a module * that drifted is detected before it is trusted.", "kind": "function", "line": 2445, "name": "shell_cmd_hash", "signature": "static void shell_cmd_hash(int argc, char **argv)"}, {"doc": "Docstring: Resolve `arg` against the cwd into `out` (`RAMDISK_FNAME_LEN` bytes); on failure print `<cmd>: <arg>: <reason>` and return 0. Unifies the resolve-or-diagnose prelude every path-taking * builtin repeats.", "kind": "function", "line": 2464, "name": "shell_resolve_arg", "signature": "static int shell_resolve_arg(const char *cmd, const char *arg,\n                             const..."}, {"doc": "Serve one accepted connection: read one request, map GET path onto the VFS mounts under root, stream head + body, close. Every failure is a status code, never a hang: the request read is deadline * bounded and every oversize/shortfall path answers 4xx.", "kind": "function", "line": 2570, "name": "shell_httpd_one", "signature": "static void shell_httpd_one(int child, const char *root)"}, {"doc": "Accept loop: one connection at a time, Ctrl+C quits. The accept poll is non-blocking with a yield so the desktop tick and the console stay live while waiting for peers. max_conn < 0 serves forever; otherwise the loop exits after that many connections * (--once scripts a single fetch from the host with -hostfwd).", "kind": "function", "line": 2655, "name": "shell_httpd_serve", "signature": "static void shell_httpd_serve(unsigned short port, const char *root,\n        int max_conn)"}, {"doc": "List one directory from a cross-filesystem VFS driver (fat:, ext4:) to the console: same \"drv:/img:path\" addressing as the cat twin, served by the readdir verb so the builtin never names the * backing driver. Shared by the fat and ext4 builtins. define SHELL_LS_CAP 64", "kind": "function", "line": 2822, "name": "shell_cross_ls", "signature": "static void shell_cross_ls(const char *drv, const char *imgarg,\n                           const ..."}, {"doc": "Stream one file from a cross-filesystem VFS driver (fat:, ext4:) to the console: \"drv:/img:path\" per open (the prefix match needs '/' after \"drv:\", stripped before the driver splits img from path), 4 KB heap chunks so a hostile size can never drive an oversized alloc. Shared by the fat and ext4 builtins instead of * one copy each.", "kind": "function", "line": 2863, "name": "shell_cross_cat", "signature": "static void shell_cross_cat(const char *drv, const char *imgarg,\n                            cons..."}, {"kind": "function", "line": 2905, "name": "shell_exec_builtin", "signature": "void shell_exec_builtin(int argc, char **argv)"}, {"kind": "function", "line": 3331, "name": "driver", "signature": "* stream through the fat: VFS driver (\"img:fatpath\" per open,\n     * registered at boot beside me..."}, {"kind": "function", "line": 4105, "name": "shell_is_pipe_tok", "signature": "static int shell_is_pipe_tok(const char *a)"}, {"doc": "Run one pipeline stage with stdin/out doors installed. input may be 0 (first stage reads the live console). Returns the stage output (caller frees) with its length; on any setup failure prints a diagnostic and returns 0 with len 0. not_last selects the stdout * pipe override for ET_EXEC children.", "kind": "function", "line": 4144, "name": "shell_run_stage", "signature": "static char *shell_run_stage(char **sargv, int sargc,\n        const char *input, unsigned long in..."}, {"kind": "function", "line": 151, "name": "shell_run_pipeline", "signature": "static int shell_run_pipeline(char **argv, int argc, const char *redir_path, int redir_append, int redirected);"}, {"kind": "function", "line": 594, "name": "text", "signature": "* swallowed the sequence as plain text (\"5~\" in the * line) and the history was unreachable from the * prompt. */ console_getc();"}, {"kind": "function", "line": 665, "name": "root", "signature": "* MiniFS root (where the big ELFs live under bare names), * and only the highest-priority non-empty tier is kept. An * explicit path or an argument word keeps every match, so * navigating to data file"}, {"kind": "function", "line": 848, "name": "desktop_unflag", "signature": "static void desktop_unflag(const char *name);"}, {"kind": "function", "line": 1339, "name": "window", "signature": "* window (proc_spawn_elf) and waits for all of them. The 100 Hz timer * preempts the BSP across the READY set, so small programs overlap in * time instead of running one after another. ET_REL is refus"}, {"kind": "function", "line": 1544, "name": "this", "signature": "* boot into the tiled Wayland desktop: every NK app started after * this (paint, vedit, file, nuklear, doomedit, piano) runs as a * Wayland client (pixels to its pid-unique mailbox, input from its * ."}, {"kind": "function", "line": 1705, "name": "context", "signature": "* ISR context (which corrupts the running program's state) or * nesting a second foreground run inside the wait. */ shell_queue_launch(cmd);"}, {"kind": "function", "line": 2980, "name": "terminal", "signature": "* sequence clears serial consoles and is swallowed without * garbage by the framebuffer terminal (vedit pattern). */ if (vga_fb_active) term_clear();"}, {"kind": "function", "line": 3725, "name": "frame", "signature": "* not live in this frame (stack discipline, CLAUDE.md). */ struct ps_row *snap = (struct ps_row *)kmalloc(sizeof(struct ps_row) * MAX_PROCS);"}, {"kind": "function", "line": 4093, "name": "stdout", "signature": "* the pipe exactly like stdout (`2>` is an alias of `>`). * Per-stage `exit code:` lines report to the console, never into the * pipe (shell_report suspends the capture), so `run x | cat` shows the * "}, {"kind": "macro", "line": 25, "name": "XXH_STATIC_LINKING_ONLY", "signature": "#define XXH_STATIC_LINKING_ONLY"}, {"kind": "macro", "line": 53, "name": "SHELL_CVM_INTERP", "signature": "#define SHELL_CVM_INTERP"}, {"kind": "macro", "line": 72, "name": "SHELL_RUN_DIRS", "signature": "#define SHELL_RUN_DIRS"}, {"kind": "macro", "line": 98, "name": "SHELL_HIST_MAX", "signature": "#define SHELL_HIST_MAX"}, {"kind": "macro", "line": 232, "name": "SHELL_BUILTIN_COUNT", "signature": "#define SHELL_BUILTIN_COUNT"}, {"kind": "macro", "line": 1033, "name": "QEMU_PM_PORT", "signature": "#define QEMU_PM_PORT"}, {"kind": "macro", "line": 2563, "name": "HTTPD_REQ_CAP", "signature": "#define HTTPD_REQ_CAP"}, {"kind": "macro", "line": 2564, "name": "HTTPD_IO_CHUNK", "signature": "#define HTTPD_IO_CHUNK"}, {"kind": "macro", "line": 2821, "name": "SHELL_LS_CAP", "signature": "#define SHELL_LS_CAP"}, {"kind": "macro", "line": 4103, "name": "PIPE_HOP_MAX", "signature": "#define PIPE_HOP_MAX"}]}, {"doc": "Docstring: Save the caller shared-window view into ctx.", "id": "kernel/spawn.c", "kind": "module", "label": "spawn.c", "language": "c", "sha256": "5e6946e0c07aee12", "symbol_count": 9, "symbols": [{"doc": "#include \"kernel.h\" #include \"sched.h\" #include \"vma.h\" #include \"spawn.h\" #include \"arena.h\" #include \"minifs.h\" #include \"vga_fb.h\" #include \"arch/x86/msr.h\" /** Docstring: Save the caller shared-window view into ctx.", "kind": "function", "line": 11, "name": "spawn_backup", "signature": "int spawn_backup(spawn_ctx_t *ctx)"}, {"doc": "if (!ctx->pool_copy) return 0; for (i = 0; i < vma_pool_n; i++) ctx->pool_copy[i] = vma_pool[i]; } ctx->live_root = vma_live_root; ctx->free_root = vma_free_root; ctx->pool_n = vma_pool_n; ctx->spare = vma_spare; for (i = 0; i < KFD_MAX; i++) ctx->kfd[i] = kfd_get(i); return 1; } /** Docstring: Restore a view previously saved by spawn_backup.", "kind": "function", "line": 38, "name": "spawn_restore", "signature": "void spawn_restore(spawn_ctx_t *ctx)"}, {"doc": "Docstring: Release a copy produced by spawn_copy_argv. The copy is one arena block holding the pointer vector plus every word, so one kfree * releases the whole scope; argc only sizes the legacy contract.", "kind": "function", "line": 87, "name": "spawn_free_argv", "signature": "void spawn_free_argv(char **kargv, int argc)"}, {"doc": "Docstring: Copy user argv into kernel memory, zero terminated. One kmalloc serves the pointer vector plus every word through a bump arena, so a Ctrl+R / Ctrl+L spawn costs a single heap block and frees it with a single kfree instead of argc+1 round trips that fragment * the heap and leak one word per missed free. Fail-closed with 0.", "kind": "function", "line": 99, "name": "spawn_copy_argv", "signature": "char **spawn_copy_argv(int argc, const char **uargv)"}, {"doc": "slen = (unsigned long)kstrlen(uargv[i]) + 1; dst = (char *)arena_alloc(&a, (size_t)slen, 1); if (!dst) { kfree(kargv); return 0; } kmemcpy(dst, uargv[i], slen); kargv[i] = dst; } kargv[argc] = 0; return kargv; } /** Docstring: Validate user argv words against the user window.", "kind": "function", "line": 143, "name": "spawn_validate_argv", "signature": "int spawn_validate_argv(int argc, const char **uargv)"}, {"doc": "if (!user_range_ok((unsigned long)uargv, (unsigned long)(argc + 1) * sizeof(char *))) return 0; for (i = 0; i < argc; i++) { unsigned long s; if (!uargv[i]) break; s = (unsigned long)uargv[i]; if (s < USER_LOAD_BASE || s >= USER_LOAD_END) return 0; if (!user_str_ok(s, USER_LOAD_END - s)) return 0; } return 1; } /** Docstring: Snapshot a resolved path into a kernel buffer.", "kind": "function", "line": 161, "name": "spawn_load_image", "signature": "unsigned char *spawn_load_image(const char *resolved, unsigned *size_out)"}, {"doc": "MiniFSInode mi; if (minifs_stat(ino, &mi) >= 0 && mi.size > 0) { data_size = mi.size; data = (unsigned char *)kmalloc(data_size); if (data) minifs_read(ino, data, 0, data_size); } } } if (!data) return 0; size_out = data_size; return data; } /** Docstring: Run one ET_REL child through the ring-0 loader.", "kind": "function", "line": 196, "name": "spawn_run_rel", "signature": "static int spawn_run_rel(const char *resolved, const char *redirect,\n                         uns..."}, {"doc": "return EFAULT; } entry = elf_load((void *)data, data_size, &base); if (redirect && redirect[0]) did_redirect = redirect_begin(); rc = EFAULT; if (entry) rc = k_run_rel(entry, argc, kargv ? kargv : (char **)uargv_fallback); kfree(base); if (did_redirect && redirect_commit(redirect, 0) != 0) kprintf(\"SPAWN: redirect to %s failed, output dropped\", redirect); return rc; } /** Docstring: Run one ET_EXEC child in an isolated window.", "kind": "function", "line": 222, "name": "spawn_run_exec", "signature": "static int spawn_run_exec(const char *resolved, const char *redirect,\n                           ..."}, {"doc": "do_kill(pid); do_waitpid(pid); rc = 130; break; } yield(); } } if (did_redirect && redirect_commit(redirect, 0) != 0) kprintf(\"SPAWN: redirect to %s failed, output dropped\", redirect); return rc; } /** Docstring: Run a loaded image by ELF type, return child status.", "kind": "function", "line": 268, "name": "spawn_execute", "signature": "int spawn_execute(const char *resolved, const char *redirect,\n                  unsigned char *da..."}]}, {"doc": "string.c -- Kernel string and memory functions.", "id": "kernel/string.c", "kind": "module", "label": "string.c", "language": "c", "sha256": "e6abe6a08b089cd0", "symbol_count": 13, "symbols": [{"kind": "function", "line": 17, "name": "kstrlen", "signature": "unsigned long kstrlen(const char *s)"}, {"kind": "function", "line": 23, "name": "kstrcpy", "signature": "char *kstrcpy(char *dst, const char *src)"}, {"kind": "function", "line": 29, "name": "kstrncpy", "signature": "char *kstrncpy(char *dst, const char *src, unsigned long n)"}, {"kind": "function", "line": 35, "name": "kstrncat", "signature": "char *kstrncat(char *dst, const char *src, unsigned long n)"}, {"kind": "function", "line": 43, "name": "kstrcmp", "signature": "int kstrcmp(const char *a, const char *b)"}, {"kind": "function", "line": 48, "name": "kstrncmp", "signature": "int kstrncmp(const char *a, const char *b, unsigned long n)"}, {"kind": "function", "line": 53, "name": "kstrchr", "signature": "char *kstrchr(const char *s, int c)"}, {"kind": "function", "line": 58, "name": "kstrstr", "signature": "char *kstrstr(const char *hay, const char *ndl)"}, {"kind": "function", "line": 68, "name": "kmemcpy", "signature": "void *kmemcpy(void *dst, const void *src, unsigned long n)"}, {"kind": "function", "line": 75, "name": "kmemset", "signature": "void *kmemset(void *dst, int c, unsigned long n)"}, {"kind": "function", "line": 81, "name": "kmemcmp", "signature": "int kmemcmp(const void *a, const void *b, unsigned long n)"}, {"kind": "function", "line": 87, "name": "kmemmove", "signature": "void *kmemmove(void *dst, const void *src, unsigned long n)"}, {"kind": "function", "line": 95, "name": "katol", "signature": "long katol(const char *s)"}]}, {"doc": "================================================================", "id": "kernel/symtab.c", "kind": "module", "label": "symtab.c", "language": "c", "sha256": "8042baa7abfec625", "symbol_count": 7, "symbols": [{"kind": "function", "line": 10, "name": "k_register_symbol", "signature": "void k_register_symbol(const char *name, void *addr)"}, {"kind": "function", "line": 18, "name": "ksym_resolve", "signature": "void *ksym_resolve(const char *name)"}, {"kind": "function", "line": 34, "name": "kprog_slot", "signature": "KProg *kprog_slot(const char *name)"}, {"kind": "function", "line": 42, "name": "kprog_lookup", "signature": "KProg *kprog_lookup(const char *name)"}, {"kind": "function", "line": 49, "name": "k_register_program", "signature": "void k_register_program(const char *name, prog_entry_t entry)"}, {"kind": "function", "line": 57, "name": "k_register_process", "signature": "void k_register_process(const char *name, void *proc_entry)"}, {"kind": "function", "line": 65, "name": "k_spawn", "signature": "int k_spawn(const char *name, int argc, char **argv)"}]}, {"doc": "sync.c -- Blocking synchronization primitives (roadmap Phase 3.1).", "id": "kernel/sync.c", "kind": "module", "label": "sync.c", "language": "c", "sha256": "20c5713459bb26f5", "symbol_count": 28, "symbols": [{"kind": "function", "line": 29, "name": "wq_init", "signature": "void wq_init(wait_queue_t *q)"}, {"kind": "function", "line": 35, "name": "sleep_on", "signature": "void sleep_on(wait_queue_t *q)"}, {"kind": "function", "line": 56, "name": "wake_up", "signature": "int wake_up(wait_queue_t *q)"}, {"kind": "function", "line": 72, "name": "wake_up_all", "signature": "int wake_up_all(wait_queue_t *q)"}, {"kind": "function", "line": 78, "name": "mutex_init", "signature": "void mutex_init(mutex_t *m)"}, {"kind": "function", "line": 95, "name": "pi_valid", "signature": "static int pi_valid(int pid)"}, {"kind": "function", "line": 101, "name": "pi_set_base", "signature": "void pi_set_base(int pid, int prio)"}, {"kind": "function", "line": 110, "name": "pi_get_eff", "signature": "int pi_get_eff(int pid)"}, {"kind": "function", "line": 115, "name": "pi_recompute", "signature": "static void pi_recompute(int pid)"}, {"kind": "function", "line": 126, "name": "pi_boost", "signature": "static void pi_boost(int waiter, int owner)"}, {"kind": "function", "line": 152, "name": "mutex_lock", "signature": "void mutex_lock(mutex_t *m)"}, {"kind": "function", "line": 172, "name": "mutex_trylock", "signature": "int mutex_trylock(mutex_t *m)"}, {"kind": "function", "line": 188, "name": "mutex_unlock", "signature": "void mutex_unlock(mutex_t *m)"}, {"kind": "function", "line": 209, "name": "sem_init", "signature": "void sem_init(sem_t *s, int value)"}, {"kind": "function", "line": 215, "name": "sem_wait", "signature": "void sem_wait(sem_t *s)"}, {"kind": "function", "line": 229, "name": "sem_post", "signature": "void sem_post(sem_t *s)"}, {"kind": "function", "line": 237, "name": "cond_init", "signature": "void cond_init(cond_t *c)"}, {"kind": "function", "line": 241, "name": "cond_wait", "signature": "void cond_wait(cond_t *c, mutex_t *m)"}, {"kind": "function", "line": 247, "name": "cond_signal", "signature": "void cond_signal(cond_t *c)"}, {"kind": "function", "line": 251, "name": "cond_broadcast", "signature": "void cond_broadcast(cond_t *c)"}, {"kind": "function", "line": 255, "name": "rwlock_init", "signature": "void rwlock_init(rwlock_t *rw)"}, {"kind": "function", "line": 263, "name": "rwlock_read_trylock", "signature": "int rwlock_read_trylock(rwlock_t *rw)"}, {"kind": "function", "line": 277, "name": "rwlock_write_trylock", "signature": "int rwlock_write_trylock(rwlock_t *rw)"}, {"kind": "function", "line": 289, "name": "rwlock_read_lock", "signature": "void rwlock_read_lock(rwlock_t *rw)"}, {"kind": "function", "line": 296, "name": "rwlock_read_unlock", "signature": "void rwlock_read_unlock(rwlock_t *rw)"}, {"kind": "function", "line": 306, "name": "rwlock_write_lock", "signature": "void rwlock_write_lock(rwlock_t *rw)"}, {"kind": "function", "line": 328, "name": "rwlock_write_unlock", "signature": "void rwlock_write_unlock(rwlock_t *rw)"}, {"doc": "Host unit-test hook (tests/test_sync.c, `make test-sync`): current_pid * is mapped to this test global by -Dcurrent_pid=t_cur_pid.", "kind": "variable", "line": 26, "name": "t_cur_pid", "signature": "extern int t_cur_pid;"}]}, {"doc": "syscalls.c - Linux x86-64 syscall dispatcher and SYS_SPAWN.", "id": "kernel/syscalls.c", "kind": "module", "label": "syscalls.c", "language": "c", "sha256": "d7c10ebc2c49860a", "symbol_count": 263, "symbols": [{"kind": "struct", "line": 1229, "name": "kiovec"}, {"doc": "strace-style name resolver: Linux table first, then the MiniOS window, then the out-of-table Linux numbers the dispatcher answers (openat, newfstatat, clock_gettime, ...). The tail is a data table, not a switch: a `case N:` ladder would trip tools/check_abi_numbers.py (its CASE_RE parses every `case N:` in this file as a dispatch site) and forces a comment per number to satisfy Rule C. Unknown numbers stay numeric so a * new stub never prints a wrong name.", "kind": "struct", "line": 3455, "name": "sc_extra_name"}, {"doc": "Syscall flight recorder: each process's last SC_RECORD_LEN syscalls (number, first three arguments, result), written on every call with no I/O so it never perturbs timing the way tracing does. Per process, so a busy poll loop elsewhere cannot flush a dying worker's history; kept after exit until the slot is reused. The exception dump prints the * faulting process's log and `sclog <pid>` any process's. Heap-owned. define SC_RECORD_LEN 32", "kind": "struct", "line": 3533, "name": "sc_record"}, {"kind": "struct", "line": 3534, "name": "sc_log"}, {"kind": "struct", "line": 238, "name": "minios_syscall_entry_t"}, {"doc": "Docstring: View owning the caller's fds: its own on isolated procs * and threads, the root on pid 0 and any pid without one.", "kind": "function", "line": 61, "name": "kfd_view_current", "signature": "static kfd_view_t *kfd_view_current(void)"}, {"doc": "Docstring: Static root view (shell pid 0, pids without their own): * entries are the historical shared table, never freed.", "kind": "function", "line": 71, "name": "kfd_view_root", "signature": "kfd_view_t *kfd_view_root(void)"}, {"kind": "function", "line": 90, "name": "kfd_get", "signature": "KFILE *kfd_get(int fd)"}, {"kind": "function", "line": 103, "name": "kfd_put", "signature": "void kfd_put(KFILE *f)"}, {"doc": "} void kfd_put(KFILE *f) { irqflags_t flags; int drop = 0; if (!f) return; spin_lock_irqsave(&fd_lock, &flags); f->ref--; if (f->ref <= 0) drop = 1; spin_unlock_irqrestore(&fd_lock, flags); if (drop) kfclose(f); } /** Docstring: Count live entries in a view (fd accounting source).", "kind": "function", "line": 115, "name": "kfd_view_count", "signature": "static int kfd_view_count(kfd_view_t *v)"}, {"kind": "function", "line": 139, "name": "untouched", "signature": "* child untouched (caller refuses fail-closed). */\nint kfd_view_copy(proc_t *child, proc_t *parent)"}, {"kind": "function", "line": 166, "name": "NULL", "signature": "* on NULL (already released or never owned). */\nvoid kfd_view_release(proc_t *p)"}, {"doc": "Docstring: Close every CLOEXEC fd in the caller's own view (execve: the image is replaced, marked descriptors must not survive). Runs on * the live view entries with the same ref discipline as close.", "kind": "function", "line": 197, "name": "kfd_view_cloexec", "signature": "void kfd_view_cloexec(void)"}, {"doc": "wall_us_now: RTC-anchored wall clock in microseconds (Phase 0.2/0.3). The RTC gives whole seconds; the fraction is the free-running ktime_us rebased at every RTC second edge, so successive reads order correctly across the edge. Shared by gettimeofday (96), clock_gettime (228) and the shell `clock` builtin: one source, never three disagreeing clocks. On RTC failure the base stays 0 and time reads as small uptime-like * values; callers that need an epoch treat 0 as \"no clock\".", "kind": "function", "line": 256, "name": "wall_us_now", "signature": "unsigned long wall_us_now(void)"}, {"kind": "function", "line": 266, "name": "sys_minios_dns", "signature": "static long sys_minios_dns(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 271, "name": "sys_minios_tls_retired", "signature": "static long sys_minios_tls_retired(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "time (201): the retired kernel-TLS handshake number now serves Linux time(2), exactly as 202 serves futex (ADR-0014 record in tools/check_abi_numbers.py). Static glibc calls it when there is no vDSO; -ENOSYS made OpenSSL and libcurl check certificate lifetimes against * (time_t)-1. Answers RTC-anchored wall seconds, stored at a1 when set.", "kind": "function", "line": 284, "name": "sys_linux_time", "signature": "static long sys_linux_time(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 293, "name": "sys_linux_futex", "signature": "static long sys_linux_futex(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 342, "name": "sys_minios_time", "signature": "static long sys_minios_time(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 346, "name": "sys_minios_kbd", "signature": "static long sys_minios_kbd(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 366, "name": "sys_minios_palette", "signature": "static long sys_minios_palette(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 378, "name": "sys_minios_kbd_raw", "signature": "static long sys_minios_kbd_raw(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 384, "name": "sys_minios_vga_mode", "signature": "static long sys_minios_vga_mode(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 391, "name": "sys_minios_pcspk_init", "signature": "static long sys_minios_pcspk_init(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 395, "name": "sys_minios_pcspk_tone", "signature": "static long sys_minios_pcspk_tone(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 409, "name": "sys_minios_doom_frame", "signature": "static long sys_minios_doom_frame(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Graphics window scale request (a1): 0 native, 1 2x nearest-neighbour zoom for the 320x200 game window, 2 true fullscreen (aspect-fit to the whole display, the WM view contract in wm_gfxview.h), 3 leave fullscreen. Scalar only, no pointer to validate; anything else is EINVAL, and 2/3 without a graphics program are EINVAL too, so an old * caller probing the call keeps its windowed behaviour.", "kind": "function", "line": 420, "name": "sys_minios_gfx_zoom", "signature": "static long sys_minios_gfx_zoom(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 429, "name": "sys_minios_rtc", "signature": "static long sys_minios_rtc(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 442, "name": "sys_minios_fb_info", "signature": "static long sys_minios_fb_info(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 462, "name": "sys_minios_pcspk_vol", "signature": "static long sys_minios_pcspk_vol(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 486, "name": "minfo_sleep_init", "signature": "void minfo_sleep_init(int tick_ok)"}, {"kind": "function", "line": 491, "name": "minfo_tick_wake", "signature": "void minfo_tick_wake(void *ctx)"}, {"kind": "function", "line": 503, "name": "view", "signature": "* view (same as the `clear` builtin). Anything else is -EINVAL. Each\n * out-word is range-checked..."}, {"kind": "function", "line": 594, "name": "sys_minios_spawn", "signature": "static long sys_minios_spawn(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 605, "name": "sys_minios_lz4_compress", "signature": "static long sys_minios_lz4_compress(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 618, "name": "sys_minios_lz4_decompress", "signature": "static long sys_minios_lz4_decompress(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 632, "name": "sys_minios_mouse", "signature": "static long sys_minios_mouse(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 656, "name": "sys_minios_nk_frame", "signature": "static long sys_minios_nk_frame(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "} static long sys_minios_nk_frame(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a2; (void)a3; (void)a4; (void)a5; (void)a6; if (a1) SANITIZE_RANGE(a1, 2 * sizeof(int)); gfx_note_compositor(); vga_fb_blit_nk_window(); if (a1) { int *o = (int *)(unsigned long)a1; vga_fb_gfx_origin(&o[0], &o[1]); } return 0; } /** Docstring: Resolve the registered PCM sink, 0 when absent.", "kind": "function", "line": 669, "name": "sb16_audio_device", "signature": "static device_t *sb16_audio_device(void)"}, {"kind": "function", "line": 675, "name": "sys_minios_sb16_open", "signature": "static long sys_minios_sb16_open(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 687, "name": "sys_minios_sb16_submit", "signature": "static long sys_minios_sb16_submit(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 698, "name": "sys_minios_gfx_title", "signature": "static long sys_minios_gfx_title(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 712, "name": "sys_minios_sb16_pump", "signature": "static long sys_minios_sb16_pump(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 716, "name": "sys_minios_sb16_stream_open", "signature": "static long sys_minios_sb16_stream_open(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 720, "name": "sys_minios_sb16_stream_close", "signature": "static long sys_minios_sb16_stream_close(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 724, "name": "sys_minios_sb16_stream_submit", "signature": "static long sys_minios_sb16_stream_submit(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Low-latency PCM path (pcm2, syscalls 246-248): OPEN takes flags, WRITE returns bytes taken (blocking unless NONBLOCK), CLOSE releases. Pointer/length validated at the boundary like every other dispatcher case; the driver copies in fragment chunks and * blocks with the scheduler, never with a spin.", "kind": "function", "line": 737, "name": "sys_minios_pcm2_open", "signature": "static long sys_minios_pcm2_open(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 742, "name": "sys_minios_pcm2_write", "signature": "static long sys_minios_pcm2_write(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 750, "name": "sys_minios_pcm2_close", "signature": "static long sys_minios_pcm2_close(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Shared text clipboard (syscalls 249-250): SET copies len bytes in (refused past 4096, never truncated), GET copies out up to cap (refused when empty or undersize, never a partial paste). All pointers validated at the boundary; kernel addresses fail with * -EFAULT before entry.", "kind": "function", "line": 760, "name": "sys_minios_clip_set", "signature": "static long sys_minios_clip_set(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 770, "name": "sys_minios_clip_get", "signature": "static long sys_minios_clip_get(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 786, "name": "sys_minios_sb16_stream_vol", "signature": "static long sys_minios_sb16_stream_vol(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 799, "name": "sys_minios_futex_wait", "signature": "static long sys_minios_futex_wait(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 805, "name": "sys_minios_futex_wake", "signature": "static long sys_minios_futex_wake(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 814, "name": "batch_kdispatch", "signature": "static long batch_kdispatch(uint32_t opcode)"}, {"kind": "function", "line": 829, "name": "DOOM_FRAME", "signature": "* DOOM_FRAME (211) and NK_FRAME (220) stay as compat aliases. */\nstatic long sys_minios_gfx_prese..."}, {"doc": "Raw keystroke read for fullscreen ring-3 programs (vedit): one byte from the serial + PS/2 multiplexer with no line buffering, no echo and no scrollback detour. a1 == 0 polls (-1 when idle, so user space can bound its own escape-sequence timeout); otherwise blocks until a byte. * Bytes are the same CSI form both consoles carry, PS/2 included.", "kind": "function", "line": 863, "name": "sys_minios_getc_raw", "signature": "static long sys_minios_getc_raw(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 874, "name": "sys_minios_submit_batch", "signature": "static long sys_minios_submit_batch(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "RLIMIT/cgroups-lite (240): a1 = op (SET/GET), a2 = resource (AS/CPU/NOFILE), a3 = value for SET. Values are bytes, ticks, count; 0 clears (unlimited). Only lowers... no: any non-negative value sets (raising allowed; the threat model is cooperative containment, not * privilege). Returns the old value on SET, current on GET.", "kind": "function", "line": 897, "name": "sys_minios_rlimit", "signature": "static long sys_minios_rlimit(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 976, "name": "sys_linux_getdents64", "signature": "static long sys_linux_getdents64(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1069, "name": "sys_minios_dir_list", "signature": "static long sys_minios_dir_list(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1241, "name": "syscall_trace_enabled", "signature": "long syscall_trace_enabled(void)"}, {"kind": "function", "line": 1242, "name": "syscall_trace_set", "signature": "void syscall_trace_set(int on)"}, {"kind": "function", "line": 1243, "name": "syscall_trace_verbose_enabled", "signature": "long syscall_trace_verbose_enabled(void)"}, {"kind": "function", "line": 1244, "name": "syscall_trace_verbose_set", "signature": "void syscall_trace_verbose_set(int on)"}, {"kind": "function", "line": 1245, "name": "syscall_trace_shown", "signature": "unsigned long syscall_trace_shown(void)"}, {"kind": "function", "line": 1271, "name": "sys_linux_read", "signature": "static long sys_linux_read(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Write cnt validated user bytes to fd: a dup2/pipe override on fd 1/2 (pipeline stage stdout) is served instead of the console, no override means the historical console path byte for byte, and every other * description goes through kfile_user_write.", "kind": "function", "line": 1327, "name": "fd_write", "signature": "static long fd_write(long fd, const char *buf, long cnt)"}, {"kind": "function", "line": 1351, "name": "sys_linux_write", "signature": "static long sys_linux_write(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1358, "name": "sys_linux_writev", "signature": "static long sys_linux_writev(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Install an open description as the lowest free fd (>= 3), honouring * close-on-exec; shared by do_open_path's file and directory branches.", "kind": "function", "line": 1403, "name": "kfd_install", "signature": "static long kfd_install(KFILE *f, int cloexec)"}, {"doc": "Trusted core: `path` is already a kernel string (syscall argument that * passed SANITIZE_STR, or an *at(2) join built in kernel memory).", "kind": "function", "line": 1426, "name": "do_open_kpath", "signature": "static long do_open_kpath(const char *path, long flags)"}, {"kind": "function", "line": 1452, "name": "do_open_path", "signature": "static long do_open_path(const char *path, long flags)"}, {"kind": "function", "line": 1457, "name": "sys_linux_open", "signature": "static long sys_linux_open(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1466, "name": "cwd", "signature": "* ENAMETOOLONG instead of silently resolving against the cwd (the bug\n * that broke shutil.rmtree..."}, {"doc": "Claim the lowest free fd slot >= minfd for an already-opened KFILE (pipes, dup, eventfd), arming close-on-exec when asked. The slot scan and publish re-check under fd_lock like do_open_path; the caller keeps * ownership on failure. Slots 0..2 stay the console's.", "kind": "function", "line": 1529, "name": "kfd_claim_from", "signature": "static long kfd_claim_from(KFILE *f, long minfd, int cloexec)"}, {"kind": "function", "line": 1554, "name": "kfd_claim", "signature": "static long kfd_claim(KFILE *f)"}, {"doc": "pipe2 (293): O_CLOEXEC arms close-on-exec on both ends, O_NONBLOCK makes * both descriptions non-blocking; O_DIRECT packet pipes are refused.", "kind": "function", "line": 1578, "name": "sys_linux_pipe2", "signature": "static long sys_linux_pipe2(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1606, "name": "sys_linux_pipe", "signature": "static long sys_linux_pipe(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "kfclose(w); return wfd; } ufd[0] = (int)rfd; ufd[1] = (int)wfd; return 0; } static long sys_linux_pipe(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a2; return sys_linux_pipe2(a1, 0, a3, a4, a5, a6); } /* close-on-exec bit of fd in the caller's view (fd < KFD_MAX).", "kind": "function", "line": 1612, "name": "kfd_cloexec_get", "signature": "static int kfd_cloexec_get(long fd)"}, {"kind": "function", "line": 1622, "name": "kfd_cloexec_set", "signature": "static void kfd_cloexec_set(long fd, int on)"}, {"doc": "Linux open-file status flags of a description: access mode from its * kind plus O_APPEND and O_NONBLOCK.", "kind": "function", "line": 1633, "name": "kfile_status_flags", "signature": "static long kfile_status_flags(KFILE *f)"}, {"doc": "break; case LINUX_F_SETFL: if (f) f->nonblock = (a3 & LINUX_O_NONBLOCK) ? 1 : 0; r = 0; break; default: r = -22; break; } if (f) kfd_put(f); return r; } /* dup3 (292): dup2 with O_CLOEXEC as the only flag; old == new is EINVAL.", "kind": "function", "line": 1684, "name": "sys_linux_dup3", "signature": "static long sys_linux_dup3(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "return r; } /* dup3 (292): dup2 with O_CLOEXEC as the only flag; old == new is EINVAL. static long sys_linux_dup3(long a1, long a2, long a3, long a4, long a5, long a6) { long r; if (a3 & ~(long)LINUX_O_CLOEXEC) return -22; if (a1 == a2) return -22; r = sys_linux_dup2(a1, a2, 0, a4, a5, a6); if (r >= 0 && r < KFD_MAX) kfd_cloexec_set(r, (a3 & LINUX_O_CLOEXEC) ? 1 : 0); return r; } /* close_range (436): mark [first, last] close-on-exec, or close it.", "kind": "function", "line": 1694, "name": "sys_linux_close_range", "signature": "static long sys_linux_close_range(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "spin_lock_irqsave(&fd_lock, &flags_irq); for (fd = lo; fd <= hi && fd < KFD_MAX; fd++) if (v->f[fd]) v->cloexec |= (1u << (unsigned)fd); spin_unlock_irqrestore(&fd_lock, flags_irq); return 0; } for (fd = lo; fd <= hi && fd < KFD_MAX; fd++) if (fd >= FD_STD_COUNT) sys_linux_close((long)fd, 0, 0, 0, 0, 0); for (fd = NET_FD_BASE; fd < (unsigned long)(NET_UDP_FD_BASE + NET_UDP_SOCKETS); fd++) if (fd >= lo && fd <= hi && net_sys_is_socket((long)fd)) net_sys_close((long)fd); return 0; } /* eventfd2 (290) / eventfd (284): a counter description (kevent_*).", "kind": "function", "line": 1718, "name": "sys_linux_eventfd2", "signature": "static long sys_linux_eventfd2(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1731, "name": "sys_linux_eventfd", "signature": "static long sys_linux_eventfd(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Docstring: poll(2) readiness of a non-socket descriptor (pipes, eventfds, files, console), masked by nothing: the caller keeps the * requested bits plus POLLERR/POLLHUP/POLLNVAL. POLLNVAL for a closed fd.", "kind": "function", "line": 1739, "name": "kfd_poll_revents", "signature": "int kfd_poll_revents(int fd)"}, {"doc": "Linux read on a description: an eventfd takes its counter, a pipe read end blocks (yielding) while empty with the writer open unless O_NONBLOCK (-EAGAIN), and reports EOF once the writer closed; every * other file reads through kfread.", "kind": "function", "line": 1774, "name": "kfile_user_read", "signature": "static long kfile_user_read(KFILE *f, char *buf, long cnt)"}, {"doc": "Linux write on a description: an eventfd adds to its counter, a pipe write end blocks (yielding) while full unless O_NONBLOCK and answers -EPIPE once the reader closed; every other file writes through * kfwrite.", "kind": "function", "line": 1804, "name": "kfile_user_write", "signature": "static long kfile_user_write(KFILE *f, const char *buf, long cnt)"}, {"kind": "function", "line": 1833, "name": "sys_linux_dup", "signature": "static long sys_linux_dup(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1848, "name": "sys_linux_dup2", "signature": "static long sys_linux_dup2(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1882, "name": "sys_linux_close", "signature": "static long sys_linux_close(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 1905, "name": "sys_linux_lseek", "signature": "static long sys_linux_lseek(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Back isolated user windows (mrun/proc_spawn_elf): their page tables start with only segments + stack mapped, so heap/mmap growth must materialize pages. Shared-window PTEs are already present and the call * below is a no-op there: zero behavior change on the legacy path.", "kind": "function", "line": 1923, "name": "mm_ensure_cur", "signature": "static int mm_ensure_cur(unsigned long start, unsigned long end)"}, {"kind": "function", "line": 1932, "name": "sys_linux_brk", "signature": "static long sys_linux_brk(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Docstring: Tag a freshly carved live node as file-backed. The node was just inserted at base, so the exact find hits; failure * leaves it anonymous and fails the call, never half-tagged.", "kind": "function", "line": 1973, "name": "mmap_tag_file", "signature": "static int mmap_tag_file(unsigned long base, int ino, unsigned long off)"}, {"doc": "Invariant guard for every range mmap hands out: it must not overlap a live mapping or reach below the brk heap. A hit means the VMA trees or the bump pointer are corrupt; handing the range out would give one page * two owners, so the mapping is refused and the defect reported.", "kind": "function", "line": 1988, "name": "mmap_range_free", "signature": "static int mmap_range_free(unsigned long base, unsigned long len)"}, {"kind": "function", "line": 1997, "name": "sys_linux_mmap", "signature": "static long sys_linux_mmap(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Lowest live mapping overlapping [base, end), or VMA_NIL. Bounded * explicit-stack walk like the mmap best-fit search.", "kind": "function", "line": 2095, "name": "vma_live_first_overlap", "signature": "static vma_node_t *vma_live_first_overlap(unsigned long base, unsigned long end)"}, {"doc": "int sp = 0; vma_node_t *x = vma_live_root; while (x != VMA_NIL || sp > 0) { while (x != VMA_NIL) { if (sp < 64) stack[sp++] = x; x = x->left; } x = stack[--sp]; if (x->base < end && x->base + x->len > base && (best == VMA_NIL || x->base < best->base)) best = x; x = x->right; } return best; } /* Insert a live remainder of a split mapping, keeping its file identity.", "kind": "function", "line": 2112, "name": "vma_live_remainder", "signature": "static int vma_live_remainder(unsigned long base, unsigned long len,\n        int file, int ino, u..."}, {"kind": "function", "line": 2126, "name": "split", "signature": "* hold a split (the mapping is restored untouched). */\nstatic long sys_linux_munmap(long a1, long..."}, {"doc": "Docstring: Locate the PTE for a user address in the caller's live tables (syscall entry keeps the caller CR3 loaded, so no KPTI swap is needed). Mirrors the cow_resolve walk exactly: PML4 entry 0, PDPT entry 0, 4 KB PT pages only. Returns 0 for any missing level or huge page; the caller turns that into -ENOMEM without touching * a single bit, so a half-mapped range never applies half.", "kind": "function", "line": 2176, "name": "mprotect_pte", "signature": "static volatile unsigned long *mprotect_pte(unsigned long cr3,\n        unsigned long va)"}, {"kind": "function", "line": 2200, "name": "first", "signature": "* passes under mm_lock: validate every page first (present, user,\n * private), then apply, so a h..."}, {"doc": "Free-tree node covering [base, base+len) entirely, or VMA_NIL. Bounded * explicit-stack walk like the mmap best-fit search above.", "kind": "function", "line": 2281, "name": "vma_free_cover", "signature": "static vma_node_t *vma_free_cover(unsigned long base, unsigned long len)"}, {"doc": "while (x != VMA_NIL || sp > 0) { while (x != VMA_NIL) { if (sp < 64) stack[sp++] = x; x = x->left; } x = stack[--sp]; if (x->base <= base && end - x->base <= x->len) return x; x = x->right; } return VMA_NIL; } /* 1 when any live node intersects [base, base+len). Bounded walk.", "kind": "function", "line": 2300, "name": "vma_live_overlap", "signature": "static int vma_live_overlap(unsigned long base, unsigned long len)"}, {"doc": "Linux mremap(25): resize or move one mmap region. glibc's realloc calls it when growing large mmap'd chunks (the file-browser PNG preview hits it three times per wallpaper decode), so ENOSYS here silently breaks every big realloc even though malloc has no fallback left. The old mapping is one exact live VMA node (what mmap inserts); anything else is EFAULT, never a partial move. Shrink splits precisely, grow extends in place when the adjacent pages are free, otherwise MAYMOVE relocates (copy + free old, old untouched on ENOMEM) and FIXED relocates only to * a free-covered target. new_size 0 unmaps like munmap.", "kind": "function", "line": 2327, "name": "sys_linux_mremap", "signature": "static long sys_linux_mremap(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2593, "name": "sys_linux_sigaction", "signature": "static long sys_linux_sigaction(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2598, "name": "sys_linux_sigprocmask", "signature": "static long sys_linux_sigprocmask(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "#define LINUX_TCGETS     0x5401 #define LINUX_TIOCGWINSZ 0x5413 #define LINUX_FIONREAD   0x541B #define LINUX_FIONBIO    0x5421 #define LINUX_FIONCLEX   0x5450 #define LINUX_FIOCLEX    0x5451 #define LINUX_TCGETS2    0x802C542AL #define LINUX_ENOTTY     25 #define LINUX_WINSIZE_LEN 8 #define LINUX_TERMIOS_LEN  36 #define LINUX_TERMIOS2_LEN 44 #define LINUX_IOCTL_INT  ((unsigned long)sizeof(int)) /* Bytes a read of f would return now (FIONREAD).", "kind": "function", "line": 2617, "name": "kfile_readable_bytes", "signature": "static int kfile_readable_bytes(KFILE *f)"}, {"kind": "function", "line": 2633, "name": "FIONREAD", "signature": "* descriptor answers FIONREAD (bytes readable now), FIONBIO (O_NONBLOCK),\n * FIOCLEX/FIONCLEX (FD..."}, {"kind": "function", "line": 2673, "name": "sys_linux_access", "signature": "static long sys_linux_access(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2695, "name": "sys_linux_socket", "signature": "static long sys_linux_socket(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2700, "name": "sys_linux_connect", "signature": "static long sys_linux_connect(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2706, "name": "sys_linux_bind", "signature": "static long sys_linux_bind(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2712, "name": "sys_linux_listen", "signature": "static long sys_linux_listen(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2717, "name": "sys_linux_accept", "signature": "static long sys_linux_accept(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2723, "name": "sys_linux_sendto", "signature": "static long sys_linux_sendto(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2728, "name": "sys_linux_recvfrom", "signature": "static long sys_linux_recvfrom(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2733, "name": "sys_linux_shutdown", "signature": "static long sys_linux_shutdown(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "prlimit64(pid, resource, new, old): pid 0 or a live pid. Setting NOFILE (at most KFD_MAX), AS and CPU updates the MiniOS limit; the stack is fixed by the window layout, so only a value at or below it is accepted * (and changes nothing).", "kind": "function", "line": 2768, "name": "sys_linux_prlimit64", "signature": "static long sys_linux_prlimit64(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "sched_getaffinity(pid, size, mask): every task may run on every CPU, so the mask has the low cpu_count bits set; the return value is the * mask size written, as Linux reports it.", "kind": "function", "line": 2801, "name": "sys_linux_sched_getaffinity", "signature": "static long sys_linux_sched_getaffinity(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Microseconds of a user timespec, or -EINVAL when it is malformed * (negative, or tv_nsec outside [0, 1e9)); huge intervals saturate.", "kind": "function", "line": 2823, "name": "linux_timespec_us", "signature": "static long linux_timespec_us(long ts)"}, {"doc": "pause(34): wait for a signal. MiniOS installs no handlers, so the only * signal that ends the wait is a fatal one, which ends the caller.", "kind": "function", "line": 2840, "name": "sys_linux_pause", "signature": "static long sys_linux_pause(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "nanosleep(35): sleep the relative interval at *req on the monotonic * clock; -EINVAL for a malformed interval, -EFAULT for a bad pointer.", "kind": "function", "line": 2848, "name": "sys_linux_nanosleep", "signature": "static long sys_linux_nanosleep(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2863, "name": "clock_gettime", "signature": "* clock_gettime(1) reads. */\nstatic long sys_linux_clock_nanosleep(long a1, long a2, long a3, lon..."}, {"kind": "function", "line": 2880, "name": "sys_linux_setsockopt", "signature": "static long sys_linux_setsockopt(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2887, "name": "sys_linux_getsockopt", "signature": "static long sys_linux_getsockopt(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2894, "name": "sys_linux_getsockname", "signature": "static long sys_linux_getsockname(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2900, "name": "sys_linux_getpeername", "signature": "static long sys_linux_getpeername(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2906, "name": "sys_linux_sendmsg", "signature": "static long sys_linux_sendmsg(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2912, "name": "sys_linux_sendmmsg", "signature": "static long sys_linux_sendmmsg(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 2920, "name": "sys_linux_poll", "signature": "static long sys_linux_poll(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Convert a sanitized timeval/timespec to a net_sys_poll budget: 0 polls once, -1 waits forever (net_sys_poll's negative timeout). Sub-millisecond fractions round up so a sleep never returns early. * Returns 0 on success, -1 on a negative or out-of-range field.", "kind": "function", "line": 2946, "name": "select_timeout_ms", "signature": "static int select_timeout_ms(const long *t, int pselect, long *out)"}, {"kind": "function", "line": 3031, "name": "sys_linux_select", "signature": "static long sys_linux_select(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3036, "name": "sys_linux_pselect6", "signature": "static long sys_linux_pselect6(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3041, "name": "sys_linux_flock", "signature": "static long sys_linux_flock(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "fsync/fdatasync: the ramdisk is memory (always durable) and MiniFS persists through kfclose/minifs_sync, so there is nothing to flush that close would not already flush. Success is truthful here, not a * lie: no write-back cache sits between the caller and the medium.", "kind": "function", "line": 3050, "name": "sys_linux_fsync", "signature": "static long sys_linux_fsync(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3055, "name": "sys_linux_fdatasync", "signature": "static long sys_linux_fdatasync(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3060, "name": "sys_linux_getcwd", "signature": "static long sys_linux_getcwd(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "static long sys_linux_getcwd(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a3; (void)a4; (void)a5; (void)a6; char *buf = (char *)a1; unsigned long sz = (unsigned long)a2; if (!buf || sz == 0) return -22; SANITIZE_RANGE(buf, sz); unsigned long cwd_len = (unsigned long)kstrlen(fs_cwd); if (sz < cwd_len + 1) return -34; for (unsigned long i = 0; i <= cwd_len; i++) buf[i] = fs_cwd[i]; return (long)(cwd_len + 1); } /* Trusted core: `path` is already a kernel string.", "kind": "function", "line": 3073, "name": "unlink_kpath", "signature": "static long unlink_kpath(const char *path)"}, {"kind": "function", "line": 3089, "name": "sys_linux_unlink", "signature": "static long sys_linux_unlink(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "readlink of /proc/self/exe answers the caller's image path (absolute, no NUL, truncated to the buffer like Linux); MiniOS has no other links, * so every other path is -EINVAL.", "kind": "function", "line": 3101, "name": "readlink_path", "signature": "static long readlink_path(const char *path, char *buf, long bufsz)"}, {"kind": "function", "line": 3117, "name": "sys_linux_readlink", "signature": "static long sys_linux_readlink(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "if (!exe[0]) return -2; len = (long)kstrlen(exe) + 1; if (len > bufsz) len = bufsz; buf[0] = '/'; for (i = 1; i < len; i++) buf[i] = exe[i - 1]; return len; } static long sys_linux_readlink(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a4; (void)a5; (void)a6; return readlink_path((const char *)a1, (char *)a2, a3); } /* prctl (157): no_new_privs, dumpable, name and seccomp (proc_sec.c).", "kind": "function", "line": 3123, "name": "sys_linux_prctl", "signature": "static long sys_linux_prctl(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "rename(82): same-filesystem file move through fs_rename (ramdisk in-place, MiniFS entry move). Both paths sanitize as user strings and resolve against the shell cwd like unlink; directories, existing dst * and cross-filesystem dsts refuse with their errno, never half-moved.", "kind": "function", "line": 3132, "name": "sys_linux_rename", "signature": "static long sys_linux_rename(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3146, "name": "sys_linux_fstat", "signature": "static long sys_linux_fstat(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3171, "name": "sys_linux_gettimeofday", "signature": "static long sys_linux_gettimeofday(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3194, "name": "sys_linux_arch_prctl", "signature": "static long sys_linux_arch_prctl(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3206, "name": "sys_linux_uname", "signature": "static long sys_linux_uname(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3230, "name": "answer", "signature": "* made glibc answer (uid_t)-1, which CPython's startup reads. */\n#define LINUX_UID_GID_ROOT 0\n\nst..."}, {"kind": "function", "line": 3238, "name": "sys_linux_getgid", "signature": "static long sys_linux_getgid(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3243, "name": "sys_linux_geteuid", "signature": "static long sys_linux_geteuid(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3248, "name": "sys_linux_getegid", "signature": "static long sys_linux_getegid(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "madvise (28): advice only; glibc frees thread stacks with it and * ignores the result, MiniOS keeps the pages, so 0 is truthful.", "kind": "function", "line": 3255, "name": "sys_linux_madvise", "signature": "static long sys_linux_madvise(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "mkdir (83): a MiniFS directory. The parent must exist (-ENOENT), an existing name is -EEXIST, the mode is accepted and ignored (MiniFS has * no permission bits). Runs under fs_lock like unlink.", "kind": "function", "line": 3263, "name": "sys_linux_mkdir", "signature": "static long sys_linux_mkdir(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "rmdir (84): remove one empty MiniFS directory (the ramdisk carries no directories of its own; its prefixes come from files). Missing paths are ENOENT, a non-directory is ENOTDIR and a non-empty directory or the root is ENOTEMPTY, like Linux. pip's tempdir cleanup * (shutil.rmtree) is the main caller. /* Trusted core: `path` is already a kernel string.", "kind": "function", "line": 3299, "name": "rmdir_kpath", "signature": "static long rmdir_kpath(const char *path)"}, {"kind": "function", "line": 3320, "name": "sys_linux_rmdir", "signature": "static long sys_linux_rmdir(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3334, "name": "sys_linux_umask", "signature": "static long sys_linux_umask(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3357, "name": "sys_linux_fchmod", "signature": "static long sys_linux_fchmod(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3443, "name": "trace_is_noisy", "signature": "static int trace_is_noisy(long n)"}, {"doc": "define SC_EXTRA_COUNT (sizeof(sc_extra_names) / sizeof(sc_extra_names[0]))", "kind": "function", "line": 3472, "name": "syscall_name", "signature": "const char *syscall_name(long n)"}, {"kind": "function", "line": 3513, "name": "trace_hint_print", "signature": "static void trace_hint_print(long n, int kind, const char *path,\n                             lon..."}, {"kind": "function", "line": 3537, "name": "sc_record", "signature": "static void sc_record(long n, long a1, long a2, long a3, long ret)"}, {"kind": "function", "line": 3557, "name": "sc_hex", "signature": "static void sc_hex(unsigned long v)"}, {"doc": "e->a3 = a3; e->ret = ret; } static void sc_hex(unsigned long v) { static const char digits[] = \"0123456789abcdef\"; char h[17]; int i; for (i = 15; i >= 0; i--) { h[i] = digits[v & 0xF]; v >>= 4; } h[16] = 0; serial_puts(h); } /* Serial-only, safe from the exception path: pid's log, oldest first.", "kind": "function", "line": 3567, "name": "sc_record_dump", "signature": "void sc_record_dump(int pid)"}, {"kind": "function", "line": 3585, "name": "ksyscall", "signature": "long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3624, "name": "user_range_ok", "signature": "int user_range_ok(unsigned long p, unsigned long len)"}, {"kind": "function", "line": 3641, "name": "products", "signature": "* products (writev cnt*sizeof, poll a2*8, spawn (argc+1)*sizeof) are\n * pre-bounded against (END-..."}, {"kind": "function", "line": 3654, "name": "ksyscall_dispatch", "signature": "static long ksyscall_dispatch(long n, long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 3932, "name": "k_syscall_spawn", "signature": "static int k_syscall_spawn(const char *path, const char *redirect,\n                             i..."}, {"kind": "function", "line": 225, "name": "by", "signature": "* is indexed by (syscall_number - 200). New syscalls are added by: * 1. Adding a MINIOS_SYS_* constant to progs/minios_abi.h * 2. Implementing a static long sys_*(long a1, ..., long a6) function here "}, {"kind": "function", "line": 479, "name": "boot", "signature": "* boot (minfo_sleep_init from sched_init);"}, {"kind": "function", "line": 1260, "name": "unchanged", "signature": "* unchanged (same code, same order of checks). Numbers >= 200 that * overlap real Linux ABIs stay in the switch as documented * fall-throughs, as do out-of-range numbers (e.g. 334) and the * default E"}, {"kind": "function", "line": 1287, "name": "EAGAIN", "signature": "* writer open is EAGAIN (-11, retry);"}, {"kind": "function", "line": 1288, "name": "EOF", "signature": "* is EOF (0). */ KFILE *o = kfd_get(0);"}, {"kind": "function", "line": 2322, "name": "node", "signature": "* mapping is one exact live VMA node (what mmap inserts);"}, {"kind": "function", "line": 2859, "name": "clock", "signature": "* clock (the monotonic TSC clock times it, as Linux does: glibc sends * every nanosleep here as a relative CLOCK_REALTIME sleep);"}, {"kind": "function", "line": 2865, "name": "long", "signature": "unsigned long (*now)(void);"}, {"kind": "function", "line": 3637, "name": "Discipline", "signature": "* * Discipline (audit 2026-09, kept as comment, not a deprecation: both * primitives are legitimate): user_range_ok is ONLY for exact-size * buffers (sizeof(int), 144-byte stat, fixed PCM length);"}, {"kind": "function", "line": 3801, "name": "readlink", "signature": "* readlink (89). */ return readlink_path((const char *)a2, (char *)a3, a4);"}, {"kind": "function", "line": 3923, "name": "proc_spawn_elf", "signature": "* proc_spawn_elf (the same path mrun uses) and the caller blocks in * do_waitpid, so the parent address space is left intact. */ #include \"spawn.h\" static int k_syscall_spawn(const char *path, const c"}, {"kind": "variable", "line": 422, "name": "gfx_zoom_2x", "signature": "extern int gfx_zoom_2x;"}, {"kind": "variable", "line": 703, "name": "gfx_win_title", "signature": "extern const char *gfx_win_title;"}, {"kind": "macro", "line": 52, "name": "KFD_MAX", "signature": "#define KFD_MAX"}, {"kind": "macro", "line": 243, "name": "MINIOS_SYSCALL_BASE", "signature": "#define MINIOS_SYSCALL_BASE"}, {"kind": "macro", "line": 244, "name": "MINIOS_SYSCALL_COUNT", "signature": "#define MINIOS_SYSCALL_COUNT"}, {"kind": "macro", "line": 947, "name": "LINUX_DT_DIR", "signature": "#define LINUX_DT_DIR"}, {"kind": "macro", "line": 948, "name": "LINUX_DT_REG", "signature": "#define LINUX_DT_REG"}, {"kind": "macro", "line": 949, "name": "GETDENTS64_NAME_OFF", "signature": "#define GETDENTS64_NAME_OFF"}, {"kind": "macro", "line": 950, "name": "GETDENTS64_ALIGN", "signature": "#define GETDENTS64_ALIGN"}, {"kind": "macro", "line": 1231, "name": "SYSCALL_TRACE", "signature": "#define SYSCALL_TRACE"}, {"kind": "macro", "line": 1251, "name": "SYS_NOISY_TIME", "signature": "#define SYS_NOISY_TIME"}, {"kind": "macro", "line": 1252, "name": "SYS_NOISY_KBD", "signature": "#define SYS_NOISY_KBD"}, {"kind": "macro", "line": 1253, "name": "SYS_NOISY_MOUSE", "signature": "#define SYS_NOISY_MOUSE"}, {"kind": "macro", "line": 1254, "name": "SYS_NOISY_GETC_RAW", "signature": "#define SYS_NOISY_GETC_RAW"}, {"kind": "macro", "line": 1468, "name": "LINUX_AT_FDCWD", "signature": "#define LINUX_AT_FDCWD"}, {"kind": "macro", "line": 1503, "name": "LINUX_O_RDONLY", "signature": "#define LINUX_O_RDONLY"}, {"kind": "macro", "line": 1504, "name": "LINUX_O_WRONLY", "signature": "#define LINUX_O_WRONLY"}, {"kind": "macro", "line": 1505, "name": "LINUX_O_RDWR", "signature": "#define LINUX_O_RDWR"}, {"kind": "macro", "line": 1506, "name": "LINUX_O_APPEND", "signature": "#define LINUX_O_APPEND"}, {"kind": "macro", "line": 1507, "name": "LINUX_O_NONBLOCK", "signature": "#define LINUX_O_NONBLOCK"}, {"kind": "macro", "line": 1508, "name": "LINUX_O_DIRECT", "signature": "#define LINUX_O_DIRECT"}, {"kind": "macro", "line": 1509, "name": "LINUX_O_CLOEXEC", "signature": "#define LINUX_O_CLOEXEC"}, {"kind": "macro", "line": 1510, "name": "LINUX_FD_CLOEXEC", "signature": "#define LINUX_FD_CLOEXEC"}, {"kind": "macro", "line": 1511, "name": "LINUX_F_DUPFD", "signature": "#define LINUX_F_DUPFD"}, {"kind": "macro", "line": 1512, "name": "LINUX_F_GETFD", "signature": "#define LINUX_F_GETFD"}, {"kind": "macro", "line": 1513, "name": "LINUX_F_SETFD", "signature": "#define LINUX_F_SETFD"}, {"kind": "macro", "line": 1514, "name": "LINUX_F_GETFL", "signature": "#define LINUX_F_GETFL"}, {"kind": "macro", "line": 1515, "name": "LINUX_F_SETFL", "signature": "#define LINUX_F_SETFL"}, {"kind": "macro", "line": 1516, "name": "LINUX_F_DUPFD_CLOEXEC", "signature": "#define LINUX_F_DUPFD_CLOEXEC"}, {"kind": "macro", "line": 1517, "name": "LINUX_CLOSE_RANGE_UNSHARE", "signature": "#define LINUX_CLOSE_RANGE_UNSHARE"}, {"kind": "macro", "line": 1518, "name": "LINUX_CLOSE_RANGE_CLOEXEC", "signature": "#define LINUX_CLOSE_RANGE_CLOEXEC"}, {"kind": "macro", "line": 1519, "name": "LINUX_EFD_SEMAPHORE", "signature": "#define LINUX_EFD_SEMAPHORE"}, {"kind": "macro", "line": 1520, "name": "LINUX_EFD_NONBLOCK", "signature": "#define LINUX_EFD_NONBLOCK"}, {"kind": "macro", "line": 1521, "name": "LINUX_EFD_CLOEXEC", "signature": "#define LINUX_EFD_CLOEXEC"}, {"kind": "macro", "line": 1522, "name": "LINUX_EVENTFD_WORD", "signature": "#define LINUX_EVENTFD_WORD"}, {"kind": "macro", "line": 1523, "name": "FD_STD_COUNT", "signature": "#define FD_STD_COUNT"}, {"kind": "macro", "line": 1965, "name": "LINUX_MAP_SHARED", "signature": "#define LINUX_MAP_SHARED"}, {"kind": "macro", "line": 1966, "name": "LINUX_MAP_PRIVATE", "signature": "#define LINUX_MAP_PRIVATE"}, {"kind": "macro", "line": 1967, "name": "LINUX_MAP_FIXED", "signature": "#define LINUX_MAP_FIXED"}, {"kind": "macro", "line": 1968, "name": "LINUX_MAP_ANONYMOUS", "signature": "#define LINUX_MAP_ANONYMOUS"}, {"kind": "macro", "line": 2276, "name": "LINUX_MREMAP_MAYMOVE", "signature": "#define LINUX_MREMAP_MAYMOVE"}, {"kind": "macro", "line": 2277, "name": "LINUX_MREMAP_FIXED", "signature": "#define LINUX_MREMAP_FIXED"}, {"kind": "macro", "line": 2603, "name": "LINUX_TCGETS", "signature": "#define LINUX_TCGETS"}, {"kind": "macro", "line": 2604, "name": "LINUX_TIOCGWINSZ", "signature": "#define LINUX_TIOCGWINSZ"}, {"kind": "macro", "line": 2605, "name": "LINUX_FIONREAD", "signature": "#define LINUX_FIONREAD"}, {"kind": "macro", "line": 2606, "name": "LINUX_FIONBIO", "signature": "#define LINUX_FIONBIO"}, {"kind": "macro", "line": 2607, "name": "LINUX_FIONCLEX", "signature": "#define LINUX_FIONCLEX"}, {"kind": "macro", "line": 2608, "name": "LINUX_FIOCLEX", "signature": "#define LINUX_FIOCLEX"}, {"kind": "macro", "line": 2609, "name": "LINUX_TCGETS2", "signature": "#define LINUX_TCGETS2"}, {"kind": "macro", "line": 2610, "name": "LINUX_ENOTTY", "signature": "#define LINUX_ENOTTY"}, {"kind": "macro", "line": 2611, "name": "LINUX_WINSIZE_LEN", "signature": "#define LINUX_WINSIZE_LEN"}, {"kind": "macro", "line": 2612, "name": "LINUX_TERMIOS_LEN", "signature": "#define LINUX_TERMIOS_LEN"}, {"kind": "macro", "line": 2613, "name": "LINUX_TERMIOS2_LEN", "signature": "#define LINUX_TERMIOS2_LEN"}, {"kind": "macro", "line": 2614, "name": "LINUX_IOCTL_INT", "signature": "#define LINUX_IOCTL_INT"}, {"kind": "macro", "line": 2738, "name": "LINUX_RLIMIT_CPU", "signature": "#define LINUX_RLIMIT_CPU"}, {"kind": "macro", "line": 2739, "name": "LINUX_RLIMIT_STACK", "signature": "#define LINUX_RLIMIT_STACK"}, {"kind": "macro", "line": 2740, "name": "LINUX_RLIMIT_NOFILE", "signature": "#define LINUX_RLIMIT_NOFILE"}, {"kind": "macro", "line": 2741, "name": "LINUX_RLIMIT_AS", "signature": "#define LINUX_RLIMIT_AS"}, {"kind": "macro", "line": 2742, "name": "LINUX_RLIMIT_NLIMITS", "signature": "#define LINUX_RLIMIT_NLIMITS"}, {"kind": "macro", "line": 2743, "name": "LINUX_RLIM_INFINITY", "signature": "#define LINUX_RLIM_INFINITY"}, {"kind": "macro", "line": 2744, "name": "LINUX_RLIMIT_PAIR", "signature": "#define LINUX_RLIMIT_PAIR"}, {"kind": "macro", "line": 2746, "name": "LINUX_RLIMIT_TICKS_PER_S", "signature": "#define LINUX_RLIMIT_TICKS_PER_S"}, {"kind": "macro", "line": 2747, "name": "LINUX_CPUMASK_BYTES", "signature": "#define LINUX_CPUMASK_BYTES"}, {"kind": "macro", "line": 2812, "name": "LINUX_CLOCK_REALTIME", "signature": "#define LINUX_CLOCK_REALTIME"}, {"kind": "macro", "line": 2813, "name": "LINUX_CLOCK_MONOTONIC", "signature": "#define LINUX_CLOCK_MONOTONIC"}, {"kind": "macro", "line": 2814, "name": "LINUX_CLOCK_BOOTTIME", "signature": "#define LINUX_CLOCK_BOOTTIME"}, {"kind": "macro", "line": 2815, "name": "LINUX_TIMER_ABSTIME", "signature": "#define LINUX_TIMER_ABSTIME"}, {"kind": "macro", "line": 2816, "name": "LINUX_NS_PER_US", "signature": "#define LINUX_NS_PER_US"}, {"kind": "macro", "line": 2817, "name": "LINUX_US_PER_S", "signature": "#define LINUX_US_PER_S"}, {"kind": "macro", "line": 2818, "name": "LINUX_NS_PER_S", "signature": "#define LINUX_NS_PER_S"}, {"kind": "macro", "line": 2819, "name": "LINUX_SLEEP_MAX_S", "signature": "#define LINUX_SLEEP_MAX_S"}, {"kind": "macro", "line": 2935, "name": "SELECT_NFDS_MAX", "signature": "#define SELECT_NFDS_MAX"}, {"kind": "macro", "line": 2936, "name": "SELECT_TIMEVAL_BYTES", "signature": "#define SELECT_TIMEVAL_BYTES"}, {"kind": "macro", "line": 2937, "name": "SELECT_TIMESPEC_BYTES", "signature": "#define SELECT_TIMESPEC_BYTES"}, {"kind": "macro", "line": 2940, "name": "SELECT_TIMEOUT_MS_MAX", "signature": "#define SELECT_TIMEOUT_MS_MAX"}, {"kind": "macro", "line": 3096, "name": "PROC_SELF_EXE", "signature": "#define PROC_SELF_EXE"}, {"kind": "macro", "line": 3231, "name": "LINUX_UID_GID_ROOT", "signature": "#define LINUX_UID_GID_ROOT"}, {"kind": "macro", "line": 3368, "name": "LINUX_SYSCALL_COUNT", "signature": "#define LINUX_SYSCALL_COUNT"}, {"kind": "macro", "line": 3471, "name": "SC_EXTRA_COUNT", "signature": "#define SC_EXTRA_COUNT"}, {"kind": "macro", "line": 3493, "name": "TRACE_HINT_NONE", "signature": "#define TRACE_HINT_NONE"}, {"kind": "macro", "line": 3494, "name": "TRACE_HINT_PATH", "signature": "#define TRACE_HINT_PATH"}, {"kind": "macro", "line": 3532, "name": "SC_RECORD_LEN", "signature": "#define SC_RECORD_LEN"}]}, {"doc": "syscalls_proc.c - Process-management syscall handlers.", "id": "kernel/syscalls_proc.c", "kind": "module", "label": "syscalls_proc.c", "language": "c", "sha256": "ec17044217db076e", "symbol_count": 24, "symbols": [{"kind": "function", "line": 18, "name": "sys_minios_clone", "signature": "long sys_minios_clone(long flags, long newsp, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 24, "name": "sys_minios_thread_spawn", "signature": "long sys_minios_thread_spawn(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "Seccomp-basic (238): a1 = op (1 deny-one, 2 allow-one, 3 deny-all), a2 = syscall number (ops 1-2). Applies to current_pid only; the * 200..231 window is filterable, Linux numbers never are.", "kind": "function", "line": 37, "name": "sys_minios_seccomp", "signature": "long sys_minios_seccomp(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "int pid = current_pid; if (a1 == SECCOMP_OP_DENY_ONE) return seccomp_deny_one(pid, (int)a2); if (a1 == SECCOMP_OP_ALLOW_ONE) return seccomp_allow_one(pid, (int)a2); if (a1 == SECCOMP_OP_DENY_ALL) { int n; if (pid < 0 || pid >= MAX_PROCS) return -1; if (procs[pid].state == PROC_FREE) return -1; for (n = SECCOMP_MIN; n <= SECCOMP_MAX; n++) procs[pid].seccomp_deny |= SECCOMP_BIT(n); return 0; } return -22; } /* Nice (239): a1 = new nice when a2 != 0, else query. Clamped NICE_MIN..NICE_MAX.", "kind": "function", "line": 53, "name": "sys_minios_nice", "signature": "long sys_minios_nice(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 66, "name": "sys_linux_yield", "signature": "long sys_linux_yield(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "getpid answers the thread group: a CLONE_THREAD member reports its leader, a process its own pid. The pid-0 exec frame (a foreground `run`) and threads it created keep answering 1, the value programs saw before * there were real pids.", "kind": "function", "line": 75, "name": "sys_linux_getpid", "signature": "long sys_linux_getpid(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"doc": "getpid answers the thread group: a CLONE_THREAD member reports its leader, a process its own pid. The pid-0 exec frame (a foreground `run`) and threads it created keep answering 1, the value programs saw before * there were real pids. long sys_linux_getpid(long a1, long a2, long a3, long a4, long a5, long a6) { proc_t *p = proc_get(current_pid); (void)a1; (void)a2; (void)a3; (void)a4; (void)a5; (void)a6; if (p && p->autoreap) return p->tgid > 0 ? p->tgid : 1; return current_pid > 0 ? current_pid : 1; } /* Linux clone(2): (flags, newsp, parent_tid, child_tid, tls).", "kind": "function", "line": 83, "name": "sys_linux_clone", "signature": "long sys_linux_clone(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 89, "name": "sys_linux_fork", "signature": "long sys_linux_fork(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 94, "name": "sys_linux_vfork", "signature": "long sys_linux_vfork(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 99, "name": "sys_linux_execve", "signature": "long sys_linux_execve(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 184, "name": "sys_linux_exit", "signature": "long sys_linux_exit(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 192, "name": "kill", "signature": "* historic kill (SIGKILL), -N is signal N (a seccomp kill is -SIGSYS). */\n#define LINUX_WNOHANG  ..."}, {"kind": "function", "line": 213, "name": "groups", "signature": "* groups (pid 0 and < -1) are not modelled and wait for any child. */\nlong sys_linux_wait4(long a..."}, {"doc": "kill(pid, sig): sig 0 only probes that pid exists; a fatal signal ends the target as killed by sig (wait4 reports WTERMSIG); any other signal is delivered to its default action, ignore. Process groups (pid <= 0) * are not modelled.", "kind": "function", "line": 248, "name": "sys_linux_kill", "signature": "long sys_linux_kill(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 259, "name": "sys_linux_gettid", "signature": "long sys_linux_gettid(long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 5, "name": "state", "signature": "* touches only scheduler state (current_pid, procs[], do_* / * seccomp_* / yield) plus the kernel-wide user_range_ok validator, so * this TU includes only kernel.h and sched.h. The dispatch tables in "}, {"kind": "function", "line": 245, "name": "sig", "signature": "* the target as killed by sig (wait4 reports WTERMSIG);"}, {"kind": "macro", "line": 193, "name": "LINUX_WNOHANG", "signature": "#define LINUX_WNOHANG"}, {"kind": "macro", "line": 194, "name": "LINUX_SIGKILL", "signature": "#define LINUX_SIGKILL"}, {"kind": "macro", "line": 195, "name": "LINUX_STATUS_SHIFT", "signature": "#define LINUX_STATUS_SHIFT"}, {"kind": "macro", "line": 196, "name": "LINUX_STATUS_CODE", "signature": "#define LINUX_STATUS_CODE"}, {"kind": "macro", "line": 197, "name": "LINUX_ECHILD", "signature": "#define LINUX_ECHILD"}, {"kind": "macro", "line": 198, "name": "LINUX_EINVAL", "signature": "#define LINUX_EINVAL"}, {"kind": "macro", "line": 199, "name": "LINUX_ESRCH", "signature": "#define LINUX_ESRCH"}]}, {"doc": "Docstring: Tick listener bus implementation.", "id": "kernel/tick.c", "kind": "module", "label": "tick.c", "language": "c", "sha256": "45c52031b1641f84", "symbol_count": 11, "symbols": [{"doc": "Docstring: Tick listener bus implementation.  Owns two fixed listener tables behind the tick.h contract. Tables are static storage, cleared by tick_reset, appended by the register calls and read by the run calls. No allocation, no locks, no user pointers. Registration is boot-time only; dispatch is ISR-safe because it only reads entries written before sti.  #include \"tick.h\" #include <stddef.h> /** Docstring: Single registered listener slot.", "kind": "struct", "line": 15, "name": "tick_slot_t"}, {"doc": "/** Docstring: Audio listener table. static tick_slot_t tick_audio_slots[TICK_MAX_AUDIO_LISTENERS]; /** Docstring: Desktop listener table. static tick_slot_t tick_desktop_slots[TICK_MAX_DESKTOP_LISTENERS]; /** Docstring: USB listener table. static tick_slot_t tick_usb_slots[TICK_MAX_USB_LISTENERS]; /** Docstring: Active audio listener count. static int tick_audio_used; /** Docstring: Active desktop listener count. static int tick_desktop_used; /** Docstring: Active USB listener count. static int tick_usb_used; /** Docstring: Reset every listener list to empty.", "kind": "function", "line": 34, "name": "tick_reset", "signature": "void tick_reset(void)"}, {"doc": "Docstring: Register an unconditional BSP audio effect.  Returns 0 on success, -1 when the handler is null or the audio table is full. A refusal changes nothing.", "kind": "function", "line": 58, "name": "tick_register_audio", "signature": "int tick_register_audio(tick_fn_t fn, void *ctx)"}, {"doc": "Docstring: Register a gated desktop effect.  Returns 0 on success, -1 when the handler is null or the desktop table is full. A refusal changes nothing.", "kind": "function", "line": 76, "name": "tick_register_desktop", "signature": "int tick_register_desktop(tick_fn_t fn, void *ctx)"}, {"kind": "function", "line": 89, "name": "tick_register_usb", "signature": "int tick_register_usb(tick_fn_t fn, void *ctx)"}, {"doc": "int tick_register_usb(tick_fn_t fn, void *ctx) { if (fn == NULL) { return -1; } if (tick_usb_used < 0 || tick_usb_used >= TICK_MAX_USB_LISTENERS) { return -1; } tick_usb_slots[tick_usb_used].fn = fn; tick_usb_slots[tick_usb_used].ctx = ctx; tick_usb_used++; return 0; } /** Docstring: Run USB listeners in registration order.", "kind": "function", "line": 103, "name": "tick_run_usb", "signature": "void tick_run_usb(void)"}, {"doc": "return 0; } /** Docstring: Run USB listeners in registration order. void tick_run_usb(void) { int i; for (i = 0; i < tick_usb_used; i++) { if (tick_usb_slots[i].fn != NULL) { tick_usb_slots[i].fn(tick_usb_slots[i].ctx); } } } /** Docstring: Run audio listeners in registration order.", "kind": "function", "line": 113, "name": "tick_run_audio", "signature": "void tick_run_audio(void)"}, {"doc": "} } /** Docstring: Run audio listeners in registration order. void tick_run_audio(void) { int i; for (i = 0; i < tick_audio_used; i++) { if (tick_audio_slots[i].fn != NULL) { tick_audio_slots[i].fn(tick_audio_slots[i].ctx); } } } /** Docstring: Run desktop listeners in registration order.", "kind": "function", "line": 123, "name": "tick_run_desktop", "signature": "void tick_run_desktop(void)"}, {"doc": "} } /** Docstring: Run desktop listeners in registration order. void tick_run_desktop(void) { int i; for (i = 0; i < tick_desktop_used; i++) { if (tick_desktop_slots[i].fn != NULL) { tick_desktop_slots[i].fn(tick_desktop_slots[i].ctx); } } } /** Docstring: Count registered audio listeners.", "kind": "function", "line": 133, "name": "tick_audio_count", "signature": "int tick_audio_count(void)"}, {"doc": "} /** Docstring: Count registered audio listeners. int tick_audio_count(void) { if (tick_audio_used < 0) { return 0; } if (tick_audio_used > TICK_MAX_AUDIO_LISTENERS) { return TICK_MAX_AUDIO_LISTENERS; } return tick_audio_used; } /** Docstring: Count registered desktop listeners.", "kind": "function", "line": 144, "name": "tick_desktop_count", "signature": "int tick_desktop_count(void)"}, {"doc": "Docstring: Pure desktop gating predicate.  Returns nonzero when the given tick count falls on a desktop tick for the given interval. A non-positive interval never fires. Holds for every tick value including zero.", "kind": "function", "line": 160, "name": "tick_desktop_due", "signature": "int tick_desktop_due(unsigned long long ticks, unsigned interval)"}]}, {"doc": "================================================================", "id": "kernel/time.c", "kind": "module", "label": "time.c", "language": "c", "sha256": "239b97bd61db0646", "symbol_count": 4, "symbols": [{"kind": "function", "line": 13, "name": "ktime_rdtsc", "signature": "static unsigned long ktime_rdtsc(void)"}, {"kind": "function", "line": 19, "name": "ktime_init", "signature": "static void ktime_init(void)"}, {"kind": "function", "line": 33, "name": "ktime_ms", "signature": "unsigned long ktime_ms(void)"}, {"doc": "Microsecond resolution over the same calibrated ratio (Phase 0.2/0.3: clock_gettime nsec and gettimeofday usec both derive from here, so the * two clocks share one source and never disagree about ordering).", "kind": "function", "line": 41, "name": "ktime_us", "signature": "unsigned long ktime_us(void)"}]}, {"doc": "Docstring: Hardware pointer sprite layer (kernel/vga_cursor.c).", "id": "kernel/vga_cursor.c", "kind": "module", "label": "vga_cursor.c", "language": "c", "sha256": "06c92faa7870cf95", "symbol_count": 13, "symbols": [{"doc": "The cursor is drawn with its top-left corner at (mx, my), so the sprite spans down-right of the pointer. The caller clamps mx/my so the position stays inside the framebuffer; pixels outside the screen are clipped by the packed helpers, and the snapshot holds packed RGB so a restore is exact in * any color depth.", "kind": "function", "line": 40, "name": "cursor_save_bg", "signature": "static void cursor_save_bg(int mx, int my)"}, {"doc": "spans down-right of the pointer. The caller clamps mx/my so the position stays inside the framebuffer; pixels outside the screen are clipped by the packed helpers, and the snapshot holds packed RGB so a restore is exact in * any color depth. static void cursor_save_bg(int mx, int my) { int i, j; int x0 = mx - CURSOR_TIP_X; int y0 = my - CURSOR_TIP_Y; for (j = 0; j < 8; j++) for (i = 0; i < 8; i++) cursor_save[j][i] = fb_read_packed(x0 + i, y0 + j); } /** Docstring: True when the arrow bitmap sets pixel i,j.", "kind": "function", "line": 50, "name": "cursor_is_set", "signature": "static int cursor_is_set(int i, int j)"}, {"doc": "int y0 = my - CURSOR_TIP_Y; for (j = 0; j < 8; j++) for (i = 0; i < 8; i++) cursor_save[j][i] = fb_read_packed(x0 + i, y0 + j); } /** Docstring: True when the arrow bitmap sets pixel i,j. static int cursor_is_set(int i, int j) { if (i < 0 || i >= 8 || j < 0 || j >= 8) return 0; return (cursor_bmp[j] & (0x80 >> i)) ? 1 : 0; } /** Docstring: True when an 8-neighbour of i,j belongs to the arrow.", "kind": "function", "line": 57, "name": "cursor_has_set_neighbour", "signature": "static int cursor_has_set_neighbour(int i, int j)"}, {"kind": "function", "line": 68, "name": "cursor_draw", "signature": "static void cursor_draw(int mx, int my)"}, {"kind": "function", "line": 81, "name": "cursor_restore", "signature": "static void cursor_restore(int mx, int my)"}, {"doc": "Docstring: True when the cursor sprite overlaps the given screen rectangle. Used to decide whether a partial repaint overwrote the cursor, in which case its saved background must be refreshed; otherwise the cursor keeps its saved background and moves without leaving a trail. The sprite is CURSOR_W x CURSOR_H with its top-left corner at * (mx, my).", "kind": "function", "line": 96, "name": "cursor_over", "signature": "int cursor_over(int x0, int y0, int w, int h)"}, {"doc": "Docstring: Paint the pointer at mx/my unconditionally: save the * background, draw the sprite, record the position.", "kind": "function", "line": 106, "name": "cursor_place", "signature": "void cursor_place(int mx, int my)"}, {"doc": "Docstring: Desktop-tick pointer update: repaint only when the position * moved since the last paint, otherwise keep the saved background.", "kind": "function", "line": 116, "name": "cursor_move", "signature": "void cursor_move(int mx, int my)"}, {"doc": "Docstring: Restore the saved background when the pointer is up, then mark it hidden. A repaint that covered the sprite calls * cursor_invalidate instead: the background is gone, nothing to restore.", "kind": "function", "line": 133, "name": "cursor_erase", "signature": "void cursor_erase(void)"}, {"doc": "Docstring: Mark the pointer hidden without touching the framebuffer. * Used after any repaint that may have covered the sprite.", "kind": "function", "line": 141, "name": "cursor_invalidate", "signature": "void cursor_invalidate(void)"}, {"doc": "Docstring: Invalidate the pointer when it overlaps a repainted screen * rectangle, so the next move re-saves a fresh background.", "kind": "function", "line": 147, "name": "cursor_note_repaint", "signature": "void cursor_note_repaint(int x0, int y0, int w, int h)"}, {"kind": "macro", "line": 28, "name": "CURSOR_TIP_X", "signature": "#define CURSOR_TIP_X"}, {"kind": "macro", "line": 29, "name": "CURSOR_TIP_Y", "signature": "#define CURSOR_TIP_Y"}]}, {"id": "kernel/vga_fb.c", "kind": "module", "label": "vga_fb.c", "language": "c", "sha256": "5d05f55ff6a72099", "symbol_count": 210, "symbols": [{"kind": "struct", "line": 978, "name": "termwin_t"}, {"doc": "/** Docstring: Focus ids share one space across terminals and graphics. _Static_assert(WM_FOCUS_GFX == WM_WINDOW_GFX_ID, \"gfx focus id drifted from unified window contract\"); /** Docstring: File-scope drag state shared by the tick and focus paths. static int wm_dragging; static int wm_grab_cx; static int wm_skip_drag; static int wm_gdrag; static int wm_ggx; static int wm_ggy; /** Docstring: Geometry config derived once from the font layout.", "kind": "function", "line": 49, "name": "wm_geom_cfg", "signature": "static wm_geom_config_t wm_geom_cfg(void)"}, {"doc": "static int wm_ggy; /** Docstring: Geometry config derived once from the font layout. static wm_geom_config_t wm_geom_cfg(void) { wm_geom_config_t cfg; cfg.font_w = FONT_W; cfg.font_h = FONT_H; cfg.scrollbar_w = SCROLLBAR_W; cfg.title_h = FONT_H; return cfg; } /** Docstring: Event config for the PS/2 mouse button mask.", "kind": "function", "line": 60, "name": "wm_event_cfg", "signature": "static wm_event_config_t wm_event_cfg(void)"}, {"doc": "cfg.title_h = FONT_H; return cfg; } /** Docstring: Event config for the PS/2 mouse button mask. static wm_event_config_t wm_event_cfg(void) { wm_event_config_t cfg; cfg.left_mask = 1; cfg.wheel_step = 3; return cfg; } /** Docstring: Reset terminal and graphics drag grabs on focus change.", "kind": "function", "line": 69, "name": "wm_drag_reset", "signature": "static void wm_drag_reset(void)"}, {"kind": "function", "line": 90, "name": "vga_fb_boot_config", "signature": "void vga_fb_boot_config(void)"}, {"kind": "function", "line": 117, "name": "fb_bytes_per_pixel", "signature": "int fb_bytes_per_pixel(void)"}, {"doc": "Docstring: Bulk copy through the string engine: quadwords first (rep movsq, an eighth of the iterations, which is what matters under an emulator that runs every string iteration as its own step), then * the byte tail. Source and destination never overlap here.", "kind": "function", "line": 151, "name": "fb_copy_bytes", "signature": "static void fb_copy_bytes(volatile void *dst, const volatile void *src, unsigned long n)"}, {"doc": "Docstring: Fill n 32-bit words with one value: pairs as quadwords * (rep stosq), then the odd word.", "kind": "function", "line": 169, "name": "fb_fill_u32", "signature": "static void fb_fill_u32(volatile void *dst, unsigned int v, unsigned long n)"}, {"doc": "static void fb_fill_u32(volatile void *dst, unsigned int v, unsigned long n) { void *d = (void *)dst; unsigned long q = n >> 1; unsigned long pat = ((unsigned long)v << 32) | (unsigned long)v; __asm__ volatile(\"cld; rep stosq\" : \"+D\"(d), \"+c\"(q) : \"a\"(pat) : \"memory\"); if (n & 1UL) (volatile unsigned int *)d = v; } /** Docstring: Bytes one framebuffer frame spans (pitch times height).", "kind": "function", "line": 183, "name": "fb_frame_bytes", "signature": "static unsigned long fb_frame_bytes(void)"}, {"doc": ": \"+D\"(d), \"+c\"(q) : \"a\"(pat) : \"memory\"); if (n & 1UL) (volatile unsigned int *)d = v; } /** Docstring: Bytes one framebuffer frame spans (pitch times height). static unsigned long fb_frame_bytes(void) { return (unsigned long)fb_pitch * (unsigned long)fb_height; } /** Docstring: Ensure the shadow exists; 1 when it is usable.", "kind": "function", "line": 189, "name": "fb_shadow_ready", "signature": "static int fb_shadow_ready(void)"}, {"doc": "return 1; } if (fb_shadow) { return 0; } fb_shadow = (uint8_t *)kmalloc(need); if (!fb_shadow) { return 0; } fb_shadow_bytes = need; return 1; } /** Docstring: Copy the whole shadow onto the visible framebuffer.", "kind": "function", "line": 210, "name": "fb_present_shadow", "signature": "static void fb_present_shadow(void)"}, {"doc": "Docstring: Enter a composition. Returns 1 for the outermost owner that redirected drawing into the shadow, 0 for a nested or degraded * entry that must not present.", "kind": "function", "line": 221, "name": "fb_compose_begin", "signature": "static int fb_compose_begin(void)"}, {"doc": "entry that must not present. static int fb_compose_begin(void) { if (fb_compose_depth++ > 0) { return 0; } if (!fb_shadow_ready()) { return 0; } fb_tgt = fb_shadow; return 1; } /** Docstring: Leave a composition; the owner presents unless held.", "kind": "function", "line": 234, "name": "fb_compose_end", "signature": "static void fb_compose_end(int owner)"}, {"doc": "Docstring: Completed-logical-lines ring, heap-owned since the .bss diet (256 x TERM_MAX_COLS). Null until vga_fb_init owns it; pushes before then are dropped and reads see an empty ring, so early boot * text still reaches the screen and serial without a scrollback entry. static char (*lg)[SB_LINE_MAX] = 0; #define LG_LINE(a) (lg[(a) % SB_MAX_LINES]) static int  lg_head, lg_tail, lg_count; static char act[SB_LINE_MAX];                /* in-progress line static int  act_len; static int  disp_off;                        /* scrollback rows above the bottom static int  term_cursor_col = -1;            /* text cursor column (-1 = hidden) static int  csi_state;                       /* ANSI CSI drop: 1 after ESC, 2 in params /* Ring accessor: logical line at age i (0 = oldest, count-1 = newest).", "kind": "function", "line": 305, "name": "lg_get", "signature": "static const char *lg_get(int i)"}, {"doc": "Append a completed logical line to the ring. The line is stored whole (no * width-dependent wrap), so it can be re-wrapped on any future resize.", "kind": "function", "line": 312, "name": "lg_push", "signature": "static void lg_push(const char *line, int len)"}, {"kind": "function", "line": 333, "name": "lg_alloc", "signature": "static void lg_alloc(void)"}, {"doc": "Docstring: Create the terminal history ring. Called once the heap is up, before the boot banner is printed, so the text-mode console has * somewhere to put the boot log.", "kind": "function", "line": 349, "name": "vga_fb_term_ring_init", "signature": "void vga_fb_term_ring_init(void)"}, {"doc": "Docstring: Feed one completed console line into the terminal history. The text-mode console (the boot log, before the desktop comes up) has no other history, and the desktop terminal owns the ring afterwards, so the * ring is the one place both halves land.", "kind": "function", "line": 357, "name": "vga_fb_term_feed", "signature": "void vga_fb_term_feed(const char *line, int len)"}, {"doc": "Docstring: Feed one completed console line into the terminal history. The text-mode console (the boot log, before the desktop comes up) has no other history, and the desktop terminal owns the ring afterwards, so the * ring is the one place both halves land. void vga_fb_term_feed(const char *line, int len) { if (!line || len <= 0) return; if (!lg_ready) return; lg_push(line, len); } /* Display rows a logical line of `len` characters occupies at term_cols.", "kind": "function", "line": 364, "name": "line_nrows", "signature": "static int line_nrows(int len)"}, {"kind": "function", "line": 371, "name": "act_nrows", "signature": "static int act_nrows(void)"}, {"doc": "lg_push(line, len); } /* Display rows a logical line of `len` characters occupies at term_cols. static int line_nrows(int len) { int w = term_cols > 0 ? term_cols : 1; int n = len / w + (len % w ? 1 : 0); if (n < 1) n = 1;   /* an empty line still shows as one row return n; } static int act_nrows(void) { return line_nrows(act_len); } /* Total display rows of the whole history (completed lines + active line).", "kind": "function", "line": 374, "name": "total_rows", "signature": "static int total_rows(void)"}, {"doc": "return n; } static int act_nrows(void) { return line_nrows(act_len); } /* Total display rows of the whole history (completed lines + active line). static int total_rows(void) { int t = 0, i; for (i = 0; i < lg_count; i++) t += line_nrows((int)kstrlen(lg_get(i))); return t + act_nrows(); } /* Clamp disp_off to a legal scroll range.", "kind": "function", "line": 382, "name": "disp_clamp", "signature": "static void disp_clamp(void)"}, {"doc": "Locate the logical line contributing the display row `abs`, and set *off to the character offset where that display row starts. Returns the line text, * or 0 when abs is beyond the history.", "kind": "function", "line": 400, "name": "line_at", "signature": "static const char *line_at(int abs, int *off)"}, {"kind": "function", "line": 456, "name": "first", "signature": "* screen ever showing it whole first (the old flash-then-melt). */\nstatic unsigned int *fx_start_..."}, {"doc": "Handshake between the present path and the desktop tick, the two painters of the graphics-mode pointer. A present announces itself and waits out a tick that is mid-paint; the tick announces itself and backs off when a present is running. Both sides are sequentially consistent, so at most one of them ever touches the sprite. The tick runs in the timer interrupt and never waits, so a present interrupted on its own * CPU cannot deadlock it. static volatile int gfx_presenting; static volatile int gfx_cursor_following; static volatile unsigned long gfx_last_present; /** Docstring: View configuration shared by every graphics path.", "kind": "function", "line": 572, "name": "gfx_view_cfg", "signature": "static wm_gfxview_config_t gfx_view_cfg(void)"}, {"doc": "Docstring: 1 while a visible fullscreen graphics window owns every * pixel: the terminals, taskbar and dock must not paint through it.", "kind": "function", "line": 581, "name": "gfx_covers_screen", "signature": "static int gfx_covers_screen(void)"}, {"doc": "Docstring: 1 while a visible fullscreen graphics window owns every * pixel: the terminals, taskbar and dock must not paint through it. static int gfx_covers_screen(void) { return vga_fb_gfx_mode && !gfx_hidden && gfx_view_mode == WM_GFXVIEW_FULL; } /** Docstring: Copy the presented source into the persistent layer.", "kind": "function", "line": 587, "name": "gfx_keep_save", "signature": "static void gfx_keep_save(const volatile uint8_t *src, int kind, int sw, int sh)"}, {"kind": "function", "line": 613, "name": "vga_fb_set_gfx_program", "signature": "void vga_fb_set_gfx_program(const char *name)"}, {"doc": "Basename of a shortcut command's program: first token after an optional `run`, then past the last '/'. \"run quake2generic.elf +set basedir .\" -> * \"quake2generic.elf\"; \"nuklear\" -> \"nuklear\".", "kind": "function", "line": 632, "name": "shcmd_base", "signature": "static void shcmd_base(const char *cmd, char *out, unsigned long cap)"}, {"kind": "function", "line": 649, "name": "ci_eq", "signature": "static int ci_eq(const char *a, const char *b)"}, {"doc": "Icon of the running program via the shortcuts config: whoever composited * last, resolved through its launch command. Zero hardcoded names.", "kind": "function", "line": 662, "name": "gfx_prog_icon", "signature": "static const uint8_t *gfx_prog_icon(void)"}, {"kind": "function", "line": 675, "name": "vga_fb_set_gfx_mode", "signature": "void vga_fb_set_gfx_mode(int on)"}, {"doc": "Docstring: Compute the view for a sw x sh source under the current mode. A tiled mode without a usable cell, or any degenerate result, * falls back to floating so a frame is never dropped for geometry.", "kind": "function", "line": 726, "name": "gfx_view_for", "signature": "static int gfx_view_for(int sw, int sh, wm_gfxview_t *v)"}, {"doc": "mode. A tiled mode without a usable cell, or any degenerate result, * falls back to floating so a frame is never dropped for geometry. static int gfx_view_for(int sw, int sh, wm_gfxview_t *v) { wm_gfxview_config_t cfg = gfx_view_cfg(); int zoom = (gfx_zoom_2x && sw == DOOM_W && sh == DOOM_H) ? 2 : 1; if (wm_gfxview_compute(&cfg, gfx_view_mode, sw, sh, zoom, fb_width, fb_height, &gfx_cell, gfx_win_ox, gfx_win_oy, v)) return 1; return wm_gfxview_compute(&cfg, WM_GFXVIEW_FLOAT, sw, sh, zoom, fb_width, fb_height, &gfx_cell, gfx_win_ox, gfx_win_oy, v); } /** Docstring: Publish a view as the window geometry every reader uses.", "kind": "function", "line": 738, "name": "gfx_view_publish", "signature": "static void gfx_view_publish(const wm_gfxview_t *v)"}, {"doc": "Docstring: Floating-mode frame of the current source, used by the * snap and drag math, which move the native window, never a tile.", "kind": "function", "line": 752, "name": "gfx_float_frame", "signature": "static int gfx_float_frame(wm_gfxview_rect_t *out)"}, {"doc": "Docstring: Content origin of the graphics window (the point an app * subtracts from SYS_MOUSE coordinates), for the present syscalls.", "kind": "function", "line": 768, "name": "vga_fb_gfx_origin", "signature": "void vga_fb_gfx_origin(int *x, int *y)"}, {"doc": "Docstring: Map a desktop pointer into the graphics app's back-buffer space when its view is scaled. A 1:1 view is left untouched so native windows keep the exact historical coordinates (including outside the window); a scaled view maps through the inverse transform so the app's * `mouse - origin` lands on the pixel under the arrow.", "kind": "function", "line": 785, "name": "vga_fb_gfx_map_mouse", "signature": "void vga_fb_gfx_map_mouse(int *x, int *y)"}, {"doc": "Restore the last composite's pointer before the new frame covers it. Only meaningful in graphics mode; the desktop path (vga_fb_mouse_tick) manages * its own cursor with the same functions.", "kind": "function", "line": 800, "name": "vga_fb_gfx_cursor_erase", "signature": "static void vga_fb_gfx_cursor_erase(void)"}, {"doc": "Clamp the mouse into the framebuffer (the idle loop that normally clamps never runs in graphics mode) and draw the pointer at the current position. Over a fullscreen app the arrow hides after GFX_CURSOR_IDLE_TICKS without motion and reappears on the next move, so a game never plays with a * stray pointer parked in the middle of the screen.", "kind": "function", "line": 810, "name": "vga_fb_gfx_cursor_draw", "signature": "static void vga_fb_gfx_cursor_draw(void)"}, {"doc": "char eline[WM_ELINE_SZ]; int epos, has_line; int prompted; } termwin_t; static termwin_t twins[WM_MAX_TERMS]; static int wm_nterms = 1; static int wm_focus; static int wm_term; static int wm_inited; /** Docstring: Single focus event bus owned by the desktop. static wm_notify_bus_t wm_bus; static int wm_bus_ready; /** Docstring: Focus listener clearing a possibly stale cursor sprite.", "kind": "function", "line": 1001, "name": "wm_focus_cursor_sync", "signature": "static void wm_focus_cursor_sync(const wm_notify_event_t *e)"}, {"doc": "static int wm_term; static int wm_inited; /** Docstring: Single focus event bus owned by the desktop. static wm_notify_bus_t wm_bus; static int wm_bus_ready; /** Docstring: Focus listener clearing a possibly stale cursor sprite. static void wm_focus_cursor_sync(const wm_notify_event_t *e) { (void)e; cursor_invalidate(); } /** Docstring: Emit one focus event when the id actually moved.", "kind": "function", "line": 1008, "name": "wm_emit_focus_moved", "signature": "static void wm_emit_focus_moved(int before, int source)"}, {"doc": "/** Docstring: Emit one focus event when the id actually moved. static void wm_emit_focus_moved(int before, int source) { wm_notify_event_t e; if (before == wm_focus) return; e.type = WM_NOTIFY_FOCUS; e.old_focus = before; e.new_focus = wm_focus; e.source = source; wm_notify_emit(&wm_bus, &e); } /** Docstring: Last focus event for serial-observable state.", "kind": "function", "line": 1020, "name": "vga_fb_focus_event", "signature": "const wm_notify_event_t *vga_fb_focus_event(void)"}, {"doc": "e.type = WM_NOTIFY_FOCUS; e.old_focus = before; e.new_focus = wm_focus; e.source = source; wm_notify_emit(&wm_bus, &e); } /** Docstring: Last focus event for serial-observable state. const wm_notify_event_t *vga_fb_focus_event(void) { return wm_notify_last(&wm_bus); } /** Docstring: Record a programmatic focus move from another unit.", "kind": "function", "line": 1026, "name": "vga_fb_focus_report", "signature": "void vga_fb_focus_report(int before, int source)"}, {"kind": "function", "line": 1035, "name": "tw_park", "signature": "static void tw_park(int i)"}, {"kind": "function", "line": 1065, "name": "tw_unpark", "signature": "static void tw_unpark(int i)"}, {"kind": "function", "line": 1100, "name": "wm_init_once", "signature": "static void wm_init_once(void)"}, {"doc": "twins[k].has_line = 0; twins[k].eline[0] = '\\0'; twins[k].epos = 0; twins[k].prompted = 0; } twins[0].lg = lg; if (!wm_bus_ready) { wm_bus_ready = 1; wm_notify_reset(&wm_bus); wm_notify_subscribe(&wm_bus, wm_focus_cursor_sync); } } /** Docstring: Select window i and drop any in-flight drag grab.", "kind": "function", "line": 1125, "name": "tw_select", "signature": "static void tw_select(int i)"}, {"kind": "function", "line": 1137, "name": "vga_fb_focus_get", "signature": "int vga_fb_focus_get(void)"}, {"kind": "function", "line": 1138, "name": "vga_fb_nterms_get", "signature": "int vga_fb_nterms_get(void)"}, {"doc": "if (!twins[i].present) return; if (shell_readline_active()) shell_focus_park(); tw_park(wm_term); wm_focus = i; wm_term = i; tw_unpark(i); wm_drag_reset(); if (shell_readline_active()) shell_focus_restore(); } int vga_fb_focus_get(void) { return wm_focus; } int vga_fb_nterms_get(void) { return wm_nterms; } /** Docstring: Single snapshot of every window for focus decisions.", "kind": "function", "line": 1141, "name": "wm_snapshot_state", "signature": "static void wm_snapshot_state(wm_focus_state_t *st)"}, {"doc": "/** Docstring: Single snapshot of every window for focus decisions. static void wm_snapshot_state(wm_focus_state_t *st) { int i; wm_init_once(); st->focus = wm_focus; st->nterms = wm_nterms; st->gfx_active = vga_fb_gfx_mode ? 1 : 0; for (i = 0; i < 4; i++) st->present[i] = 0; for (i = 0; i < wm_nterms && i < 4; i++) st->present[i] = twins[i].present ? 1 : 0; } /** Docstring: Cycle focus across terminals plus graphics when active.", "kind": "function", "line": 1154, "name": "vga_fb_focus_next", "signature": "void vga_fb_focus_next(void)"}, {"doc": "Docstring: Route WM focus with the graphics mode switch.  A program that enables the display owns the keyboard: without this, a gfx child spawned from another gfx app (file -> vedit) keeps the terminal focused, so its keys and wheel keep landing on the shell while the app looks hung. The enable arm mirrors the focus-gfx path (park shell line, flush stale raw bytes); the disable arm hands the * terminal back silently, never with the Alt-Tab nag.", "kind": "function", "line": 1200, "name": "wm_gfx_focus_sync", "signature": "static void wm_gfx_focus_sync(int on)"}, {"doc": "tw_park(wm_term); wm_focus = WM_FOCUS_GFX; kbd_raw_flush(); wm_emit_focus_moved(before, WM_FOCUS_SRC_MODE); } } else { if (wm_focus == WM_FOCUS_GFX) { tw_select(wm_term); wm_emit_focus_moved(before, WM_FOCUS_SRC_MODE); } } } /** Docstring: Focus window id directly, fail closed on invalid id.", "kind": "function", "line": 1219, "name": "vga_fb_focus_id", "signature": "int vga_fb_focus_id(int id)"}, {"doc": "Docstring: Copy the boot-time history into the terminal that owns the screen after the desktop comes up. The boot log is printed in text mode, before the second window exists, so it lives in the first window's ring; the shell runs in the other one, and the page keys must reach the boot * banner from there.", "kind": "function", "line": 1254, "name": "vga_fb_boot_history_to_active", "signature": "static void vga_fb_boot_history_to_active(void)"}, {"kind": "function", "line": 1269, "name": "content", "signature": "* windows would share content (same prompt/output on both) and a park\n * would alias src == dst. ..."}, {"doc": "twins[1].lg = 0; twins[1].present = 0; twins[1].has_line = 0; twins[1].eline[0] = '\\0'; twins[1].epos = 0; twins[1].prompted = 0; wm_nterms = 1; vga_fb_reset_default(); fx_finish_full(fx_old); return 1; } /** Docstring: Tile terminals through the tiling contract, graphics right. /** Docstring: Set active layout mode, fail closed on bad mode.", "kind": "function", "line": 1354, "name": "vga_fb_layout_set", "signature": "int vga_fb_layout_set(int mode)"}, {"doc": "/** Docstring: Tile terminals through the tiling contract, graphics right. /** Docstring: Set active layout mode, fail closed on bad mode. int vga_fb_layout_set(int mode) { if (!wm_layout_mode_valid(mode)) { return -1; } wm_layout_mode = mode; wm_last_n = -1; return 0; } /** Docstring: Cycle layout mode tile bsp cascade fibonacci.", "kind": "function", "line": 1365, "name": "vga_fb_layout_cycle", "signature": "void vga_fb_layout_cycle(void)"}, {"doc": "if (wm_layout_mode == WM_LAYOUT_TILE) { wm_layout_mode = WM_LAYOUT_BSP; } else if (wm_layout_mode == WM_LAYOUT_BSP) { wm_layout_mode = WM_LAYOUT_CASCADE; } else if (wm_layout_mode == WM_LAYOUT_CASCADE) { wm_layout_mode = WM_LAYOUT_FIBONACCI; } else { wm_layout_mode = WM_LAYOUT_TILE; } wm_last_n = -1; vga_fb_tile_all(); } /** Docstring: Active layout mode id.", "kind": "function", "line": 1381, "name": "vga_fb_layout_get", "signature": "int vga_fb_layout_get(void)"}, {"doc": "} else { wm_layout_mode = WM_LAYOUT_TILE; } wm_last_n = -1; vga_fb_tile_all(); } /** Docstring: Active layout mode id. int vga_fb_layout_get(void) { return wm_layout_mode; } /** Docstring: Active layout mode name, never null.", "kind": "function", "line": 1387, "name": "vga_fb_layout_name", "signature": "const char *vga_fb_layout_name(void)"}, {"kind": "function", "line": 1399, "name": "alone", "signature": "* window alone (an unfocused graphics window minimizes to the taskbar,\n * exactly like the hidden..."}, {"kind": "function", "line": 1526, "name": "vga_fb_list_windows", "signature": "void vga_fb_list_windows(void)"}, {"doc": "vn ? vn : \"floating\", gfx_view_valid ? gfx_view.content.x : gfx_win_x, gfx_view_valid ? gfx_view.content.y : gfx_win_y, gfx_view_valid ? gfx_view.content.w : 0, gfx_view_valid ? gfx_view.content.h : 0); serial_puts(b); taskbar_layout(); ksprintf(b, \"win gfxbtn x=%d w=%d %s\\n\", tb_gfx_x, tb_gfx_w, gfx_task_icon() ? \"icon\" : \"text\"); serial_puts(b); } } /* 1 when the focused window's active line is empty (fresh prompt spot).", "kind": "function", "line": 1584, "name": "vga_fb_act_empty", "signature": "int vga_fb_act_empty(void)"}, {"doc": "The shell loop calls note after printing a prompt (it is live in the * focused window) and clear once the line is submitted for execution.", "kind": "function", "line": 1588, "name": "vga_fb_note_prompt", "signature": "void vga_fb_note_prompt(void)"}, {"kind": "function", "line": 1593, "name": "vga_fb_clear_prompt", "signature": "void vga_fb_clear_prompt(void)"}, {"kind": "function", "line": 1598, "name": "vga_fb_prompted", "signature": "int vga_fb_prompted(void)"}, {"doc": "1 when the active line is empty or holds exactly a fresh prompt, so printing another one would stack duplicate `miniOS> ` lines on every * refocus. Compares the whole line, not a prefix.", "kind": "function", "line": 1607, "name": "vga_fb_prompt_live", "signature": "int vga_fb_prompt_live(void)"}, {"doc": "1 when the active line is empty or holds exactly a fresh prompt, so printing another one would stack duplicate `miniOS> ` lines on every * refocus. Compares the whole line, not a prefix. int vga_fb_prompt_live(void) { if (act_len == 0) return 1; if (kstrcmp(act, \"miniOS> \") == 0) return 1; return 0; } /* Park the shell's half-typed line into the focused window slot.", "kind": "function", "line": 1614, "name": "vga_fb_park_line", "signature": "void vga_fb_park_line(const char *b, int p)"}, {"doc": "A fresh prompt parks empty: record no line, so `wm list` does not * claim a half-typed command that never existed. t->has_line = (b[0] != '\\0' || p > 0) ? 1 : 0; } /* Restore the focused window's parked line. Returns 1 when one existed.", "kind": "function", "line": 1629, "name": "vga_fb_unpark_line", "signature": "int vga_fb_unpark_line(char *b, int *p)"}, {"doc": "termwin_t *t; int k; wm_init_once(); if (wm_focus < 0 || wm_focus >= WM_MAX_TERMS) return 0; t = &twins[wm_focus]; if (!t->has_line) return 0; for (k = 0; k < WM_ELINE_SZ - 1 && t->eline[k]; k++) b[k] = t->eline[k]; b[k] = '\\0'; p = t->epos; return 1; } /* Hit-test: is (mx,my) inside terminal i's rectangle (title + content)? /** Docstring: True when point hits terminal window i including decorations.", "kind": "function", "line": 1644, "name": "tw_hit", "signature": "static int tw_hit(int i, int mx, int my)"}, {"kind": "function", "line": 1750, "name": "vga_fb_set_gfx_palette", "signature": "void vga_fb_set_gfx_palette(const unsigned char *pal)"}, {"doc": "--- True-color pixel layer ---- VBE true-color framebuffers store pixels natively as B,G,R(,X) bytes, so the DAC is bypassed entirely. Every index the desktop draws with resolves here: UI 0-14 through desk_pal, wallpaper 16-231 through the websafe cube, icons 240-255 through icon_pal. Indices with no owner (15, 232-239) are black. Graphics back-buffers never pass through this table; they expand * through gfx_pal at blit time.", "kind": "function", "line": 1765, "name": "fb_pack_idx", "signature": "static unsigned long fb_pack_idx(unsigned idx)"}, {"kind": "function", "line": 1781, "name": "fb_write_packed", "signature": "void fb_write_packed(int x, int y, unsigned long rgb)"}, {"kind": "function", "line": 1801, "name": "fb_read_packed", "signature": "unsigned long fb_read_packed(int x, int y)"}, {"kind": "function", "line": 1825, "name": "vga_fb_read_rgb", "signature": "unsigned long vga_fb_read_rgb(int x, int y)"}, {"doc": "Docstring: Write n packed pixels (0x00RRGGBB, or raw indices in 8-bit mode) to row y from column x, clipped once. The row fast path the * melt and the snapshot restore use instead of one call per pixel.", "kind": "function", "line": 1830, "name": "fb_write_row_packed", "signature": "void fb_write_row_packed(int x, int y, const unsigned int *src, int n)"}, {"doc": "Docstring: Read n packed pixels of row y from column x into dst, * clipped once; pixels outside the screen read as 0.", "kind": "function", "line": 1860, "name": "fb_read_row_packed", "signature": "void fb_read_row_packed(int x, int y, unsigned int *dst, int n)"}, {"doc": "int xx = x + i; if (xx < 0 || xx >= fb_width) continue; if (fb_bpp == 32) { dst[i] = *(volatile unsigned int *)(p + (unsigned)xx * 4u) & 0x00FFFFFFu; } else if (fb_bpp == 24) { const volatile uint8_t *q = p + (unsigned)xx * 3u; dst[i] = (unsigned int)q[0] | ((unsigned int)q[1] << 8) | ((unsigned int)q[2] << 16); } else { dst[i] = p[xx]; } } } /** Docstring: Fill a clipped horizontal run with one packed pixel.", "kind": "function", "line": 1882, "name": "fb_fill_run", "signature": "static void fb_fill_run(int x, int y, int n, unsigned long px)"}, {"doc": "for (i = 0; i < n; i++) { q[0] = (uint8_t)(px & 0xFF); q[1] = (uint8_t)((px >> 8) & 0xFF); q[2] = (uint8_t)((px >> 16) & 0xFF); q += 3; } } else { volatile uint8_t *q = p + (unsigned)x; for (i = 0; i < n; i++) q[i] = (uint8_t)(px & 0xFF); } } /* Nearest cube level for one 0-255 channel (boundaries at 25/76/127/178/229).", "kind": "function", "line": 1908, "name": "wall_level", "signature": "static int wall_level(int v)"}, {"kind": "function", "line": 1917, "name": "vga_fb_set_palette", "signature": "static void vga_fb_set_palette(void)"}, {"doc": "Resolve one byte to its 8-row glyph: ASCII through font8x8, Spanish Latin-1 through the table above, anything else (including control codes) as a blank. Takes an unsigned value so Latin-1 bytes above 127 survive a * signed-char parameter.", "kind": "function", "line": 1970, "name": "fb_glyph", "signature": "static const uint8_t *fb_glyph(unsigned char c)"}, {"doc": "case 0xAC: return glyph_notsign; case 0xB4: return glyph_acute; case 0xB7: return glyph_middot; case 0xBA: return glyph_ord_masc; case 0xBF: return glyph_inv_quest; case 0xC7: return glyph_Ccedil; case 0xD1: return glyph_Ntilde; case 0xE7: return glyph_ccedil; case 0xF1: return glyph_ntilde; default: return font8x8[0]; } } /* ---- Drawing primitives ----", "kind": "function", "line": 1991, "name": "vga_fb_pixel", "signature": "void vga_fb_pixel(int x, int y, uint8_t color)"}, {"doc": "} } /* ---- Drawing primitives ---- void vga_fb_pixel(int x, int y, uint8_t color) { if (fb_bpp == 8) { if (x >= 0 && x < fb_width && y >= 0 && y < fb_height) FBT[(unsigned)y * (unsigned)fb_pitch + (unsigned)x] = color; return; } fb_write_packed(x, y, fb_pack_idx(color)); } /** Docstring: Clear the render target to black in bulk.", "kind": "function", "line": 2001, "name": "vga_fb_clear", "signature": "void vga_fb_clear(void)"}, {"doc": "Docstring: Solid rectangle: the color resolves once, every row is one * clipped run fill instead of a per-pixel palette lookup and call.", "kind": "function", "line": 2011, "name": "vga_fb_rect", "signature": "void vga_fb_rect(int x, int y, int w, int h, uint8_t color)"}, {"doc": "Direct RGB pixel: full color depth in true-color modes, best-effort quantization in 8-bit mode. This is the primitive future UI (gradients, hover glows, selection blends) builds on instead of the 15-entry UI * palette. Packed order 0x00RRGGBB, same as fb_write_packed.", "kind": "function", "line": 2026, "name": "vga_fb_pixel_rgb", "signature": "void vga_fb_pixel_rgb(int x, int y, uint8_t r, uint8_t g, uint8_t b)"}, {"kind": "function", "line": 2035, "name": "vga_fb_rect_rgb", "signature": "void vga_fb_rect_rgb(int x, int y, int w, int h, uint8_t r, uint8_t g, uint8_t b)"}, {"kind": "function", "line": 2042, "name": "vga_fb_char", "signature": "void vga_fb_char(int col, int row, char c, uint8_t fg, uint8_t bg)"}, {"kind": "function", "line": 2056, "name": "vga_fb_str", "signature": "void vga_fb_str(int col, int row, const char *s, uint8_t fg, uint8_t bg)"}, {"doc": "Blit a text string at an absolute pixel position. Used for window chrome (title bar, taskbar) which lives outside the content-relative coordinate * space that vga_fb_char/str operate in.", "kind": "function", "line": 2067, "name": "text_px", "signature": "static void text_px(int px, int py, const char *s, uint8_t fg, uint8_t bg)"}, {"doc": "--- Window controls ---- Three glyph buttons at the right end of a window's title bar: minimize (_), maximize (square) and close (X). They are shared by the terminal window and the composited graphics windows (DOOM/Nuklear), so hit-testing must work on * any titled window. Each button is FONT_W x FONT_H, separated by WM_BTN_PAD. static int wm_buttons_x0(int win_x, int win_w) { return win_x + win_w - 3 * (WM_BTN_W + WM_BTN_PAD); } /* Draw the three window-control glyphs at (px,py), the title bar's top-left.", "kind": "function", "line": 2093, "name": "wm_draw_buttons", "signature": "static void wm_draw_buttons(int px, int py, int win_w, uint8_t fg, uint8_t bg)"}, {"doc": "} for (i = 1; i < WM_BTN_H - 1; i++) { vga_fb_pixel(bx + 1, by + i, fg); vga_fb_pixel(bx + WM_BTN_W - 2, by + i, fg); } bx += WM_BTN_W + WM_BTN_PAD; /* close: two crossing diagonals. for (i = 1; i < WM_BTN_W - 1; i++) { vga_fb_pixel(bx + i, by + i, fg); vga_fb_pixel(bx + WM_BTN_W - 1 - i, by + i, fg); } } /* Return which window-control button is under (mx,my), or 0 for none.", "kind": "function", "line": 2119, "name": "wm_buttons_hit", "signature": "static int wm_buttons_hit(int mx, int my, int win_x, int win_y, int win_w)"}, {"doc": "Close request bridge: the syscall dispatcher polls this so a graphics * program's next syscall exits it on the child's own stack.", "kind": "function", "line": 2134, "name": "wm_close_pending", "signature": "int wm_close_pending(void)"}, {"kind": "function", "line": 2135, "name": "wm_clear_close", "signature": "void wm_clear_close(void)"}, {"kind": "function", "line": 2136, "name": "wm_gfx_mode_active", "signature": "int wm_gfx_mode_active(void)"}, {"doc": "Close request bridge: the syscall dispatcher polls this so a graphics * program's next syscall exits it on the child's own stack. int wm_close_pending(void) { return wm_close_request; } void wm_clear_close(void) { wm_close_request = 0; } int wm_gfx_mode_active(void) { return vga_fb_gfx_mode; } /** Docstring: PS/2 owner check with pid range validation, focus routed.", "kind": "function", "line": 2139, "name": "vga_fb_ps2_owner", "signature": "int vga_fb_ps2_owner(int pid)"}, {"kind": "function", "line": 2159, "name": "taskbar", "signature": "* minimize hides the app to the taskbar (it never closes it), maximize\n * toggles true fullscreen..."}, {"kind": "function", "line": 2207, "name": "directly", "signature": "* RGB sources pack directly (quantized to the wallpaper cube in 8-bit). */\nstatic void gfx_scale_..."}, {"doc": "Docstring: Clear the frame area the content does not cover (the * letterbox bars of a tiled or fullscreen view) to black.", "kind": "function", "line": 2312, "name": "gfx_letterbox", "signature": "static void gfx_letterbox(const wm_gfxview_t *v)"}, {"doc": "int ah = v->frame.h - v->title_h; const wm_gfxview_rect_t *c = &v->content; if (aw <= 0 || ah <= 0) return; if (c->y > ay) vga_fb_rect(ax, ay, aw, c->y - ay, COL_BLACK); if (c->y + c->h < ay + ah) vga_fb_rect(ax, c->y + c->h, aw, ay + ah - (c->y + c->h), COL_BLACK); if (c->x > ax) vga_fb_rect(ax, c->y, c->x - ax, c->h, COL_BLACK); if (c->x + c->w < ax + aw) vga_fb_rect(c->x + c->w, c->y, ax + aw - (c->x + c->w), c->h, COL_BLACK); } /** Docstring: Paint the title strip (title text plus window controls).", "kind": "function", "line": 2331, "name": "gfx_title", "signature": "static void gfx_title(const wm_gfxview_t *v)"}, {"doc": "Docstring: Compose one graphics frame at a view into the render target: * title, letterbox (when full is set) and the scaled content.", "kind": "function", "line": 2343, "name": "gfx_compose", "signature": "static void gfx_compose(const volatile uint8_t *src, int kind, int sw, int sh,\n                  ..."}, {"doc": "Docstring: Present under the pointer handshake: wait out a desktop tick that is moving the sprite, composite, then stamp the present time the * tick's idle follow measures against.", "kind": "function", "line": 2409, "name": "gfx_present", "signature": "static void gfx_present(const volatile uint8_t *bb, int kind, int sw, int sh)"}, {"doc": "Docstring: Move the graphics-mode pointer from the desktop tick while the app is idle. The present path stays the pointer's painter whenever frames flow; only after GFX_CURSOR_FOLLOW_TICKS without one, with the pointer moved and no present or desktop composite in flight, does the tick restore the old sprite and draw it at the new position with the same * save/restore helpers the present uses.", "kind": "function", "line": 2425, "name": "gfx_cursor_follow_idle", "signature": "static void gfx_cursor_follow_idle(void)"}, {"kind": "function", "line": 2438, "name": "vga_fb_blit_gfx_window", "signature": "void vga_fb_blit_gfx_window(void)"}, {"kind": "function", "line": 2447, "name": "vga_fb_blit_nk_window", "signature": "void vga_fb_blit_nk_window(void)"}, {"doc": "Composite the Nuklear RGB back-buffer (NK_RGB_ADDR, NK_W x NK_H x 3 bytes) * through the same present path as the indexed buffers.", "kind": "function", "line": 2453, "name": "vga_fb_blit_nk_rgb_window", "signature": "void vga_fb_blit_nk_rgb_window(void)"}, {"kind": "function", "line": 2462, "name": "term_recalc", "signature": "static void term_recalc(void)"}, {"doc": "Preserve the current window position, clamping it into range so a * drag or Ctrl+arrow move is not undone by the next layout pass. if (term_x < 0) term_x = 0; if (term_y < 0) term_y = 0; if (term_x > max_cols - term_cols) term_x = max_cols - term_cols; if (term_y > max_rows - term_rows) term_y = max_rows - term_rows; } term_px_x = term_x * FONT_W; term_px_y = term_y * FONT_H; term_px_w = term_cols * FONT_W; term_px_h = term_rows * FONT_H; } /* ---- Desktop ----", "kind": "function", "line": 2488, "name": "draw_title_win", "signature": "static void draw_title_win(int idx, int focused)"}, {"kind": "function", "line": 2519, "name": "taskbar_layout", "signature": "static void taskbar_layout(void)"}, {"doc": "Running-app button right after it: mini icon + title while a graphics program owns the display. Clicking it focuses the app (brings it to * the front), so a window buried by Alt+Tab/tile is always reachable. tb_gfx_x = tb_restore_x + tb_restore_w + TASKBAR_PAD; tb_gfx_w = 0; if (vga_fb_gfx_mode) { int tl = (int)kstrlen(gfx_win_title); if (tl > TB_GFX_TITLE_MAX) tl = TB_GFX_TITLE_MAX; tb_gfx_w = FONT_W + 2 + tl * FONT_W; } } /* 8x8 speaker glyph: body on the left, two sound arcs to the right.", "kind": "function", "line": 2550, "name": "draw_speaker_icon", "signature": "static void draw_speaker_icon(int x, int y, uint8_t color)"}, {"kind": "function", "line": 2559, "name": "taskbar_render", "signature": "static void taskbar_render(void)"}, {"doc": "Redraw the clock only when the wall-clock second changes. Only the taskbar strip is repainted, so the cursor must be re-saved (invalidated) only when it actually sat over the taskbar; otherwise it keeps its saved * background and moves normally, which is what prevents pointer trails.", "kind": "function", "line": 2638, "name": "taskbar_tick", "signature": "static void taskbar_tick(void)"}, {"doc": "Docstring: Active Nuklear theme name for the taskbar widget.  Reads etc/themes/current (ramdisk); a missing file, a bad name or an * overlong read falls back to \"dark\", never a stale or partial name.", "kind": "function", "line": 2654, "name": "vga_fb_theme_name", "signature": "int vga_fb_theme_name(char *dst, int cap)"}, {"doc": "Cycle the active theme to the next etc/themes/ entry (ramdisk). Holds no locks; click context only. Writes the choice back to current so the * next app launch picks it up; running apps keep their theme.", "kind": "function", "line": 2675, "name": "taskbar_theme_cycle", "signature": "static void taskbar_theme_cycle(void)"}, {"doc": "Click handling for the keyboard widget, the speaker icon and -/+ buttons, plus the restore button that reappears while the terminal window is minimized. A click on \"EN\" switches to Spanish and a click on \"ES\" * switches back to English. A click on the theme name cycles etc/themes.", "kind": "function", "line": 2715, "name": "taskbar_handle_click", "signature": "static void taskbar_handle_click(int mx, int my)"}, {"doc": "return; } if (mx >= tb_minus_x && mx < tb_minus_x + TASKBAR_BTN_W) { v = pcspk_get_volume(); pcspk_set_volume(v > TASKBAR_VOL_STEP ? v - TASKBAR_VOL_STEP : 0); return; } if (mx >= tb_plus_x && mx < tb_plus_x + TASKBAR_BTN_W) { pcspk_set_volume(pcspk_get_volume() + TASKBAR_VOL_STEP); return; } } /* ---- Scrollbar (attached to the window's right edge) ----", "kind": "function", "line": 2775, "name": "draw_scrollbar", "signature": "static void draw_scrollbar(void)"}, {"doc": "Blank one viewport row: every cell is repainted with the terminal background. vga_fb_str with an empty string would draw nothing and leave * whatever pixels the previous content left behind, so blanking is explicit.", "kind": "function", "line": 2810, "name": "render_blank_row", "signature": "static void render_blank_row(int vrow)"}, {"doc": "Render one display row at viewport row `vrow` for the absolute display row `abs`. Rows outside the history (above the oldest line, or below the active line) are blanked. When this is a row of the active line and a text cursor * is shown, the cursor cell is drawn inverted (COL_TERM_CUR background).", "kind": "function", "line": 2820, "name": "render_row", "signature": "static void render_row(int vrow, int abs)"}, {"kind": "function", "line": 2855, "name": "term_render", "signature": "static void term_render(void)"}, {"kind": "function", "line": 2870, "name": "buffer", "signature": "* owns the buffer (indices reset, render reads an empty ring). */\nvoid term_clear(void)"}, {"doc": "Repaint only the bottom region that a live edit touches: from the active line's first visible display row to the bottom of the window. Used for a character append/backspace that does not change the number of display rows, * so typing stays cheap while remaining correct.", "kind": "function", "line": 2887, "name": "term_render_active", "signature": "static void term_render_active(void)"}, {"kind": "function", "line": 2930, "name": "line", "signature": "* display stale bytes left over from a longer previous line (e.g. the prompt\n * would show the ta..."}, {"kind": "function", "line": 2939, "name": "escapes", "signature": "* swallowing them here keeps the escapes (which the serial side needs)\n     * from printing as li..."}, {"kind": "function", "line": 2996, "name": "vga_fb_puts_term", "signature": "void vga_fb_puts_term(const char *s)"}, {"doc": "Show the text cursor at character column `col` of the active line, or hide * it with a negative column. The cursor is a block rendered by render_row.", "kind": "function", "line": 3002, "name": "vga_fb_text_cursor", "signature": "void vga_fb_text_cursor(int col)"}, {"doc": "Show the text cursor at character column `col` of the active line, or hide * it with a negative column. The cursor is a block rendered by render_row. void vga_fb_text_cursor(int col) { if (col < 0) { term_cursor_col = -1; } else { term_cursor_col = col; } disp_clamp(); term_render(); } /* Hide the text cursor (used when a live edit starts or the window redraws).", "kind": "function", "line": 3010, "name": "vga_fb_hide_text_cursor", "signature": "void vga_fb_hide_text_cursor(void)"}, {"doc": "Docstring: Repaint the desktop through the shared render plan. The whole frame composes off-screen (see the render-target section) and is presented once, pointer included, so a redraw never flashes a cleared or half-painted screen. A pending graphics-close melt keeps the closing rect showing the old pixels in the presented frame and * then melts the fresh desktop over it on the visible framebuffer.", "kind": "function", "line": 3034, "name": "vga_fb_draw_desktop", "signature": "void vga_fb_draw_desktop(void)"}, {"doc": "Docstring: View of the persistent source inside an arbitrary frame, * titled when the frame is tall enough to carry a title strip.", "kind": "function", "line": 3129, "name": "gfx_view_in_rect", "signature": "static void gfx_view_in_rect(const wm_gfxview_rect_t *r, int titled, wm_gfxview_t *v)"}, {"doc": "Docstring: Glide the persistent source frame from one rect to * another over the desktop, then settle with a plain redraw.", "kind": "function", "line": 3148, "name": "gfx_animate", "signature": "static void gfx_animate(const wm_gfxview_rect_t *from, const wm_gfxview_rect_t *to,\n             ..."}, {"doc": "fb_tgt = fb_shadow; gfx_compose(gfx_keep, gfx_keep_kind, gfx_keep_sw, gfx_keep_sh, &v, 0); fb_tgt = 0; fb_compose_depth--; fb_present_shadow(); gfx_wait_until(t0 + (unsigned long)(t * cfg.anim_frame_ms)); } kfree(bg); cursor_invalidate(); gfx_frame_dirty = 1; vga_fb_draw_desktop(); } /** Docstring: Taskbar button rect of the running app (minimize target).", "kind": "function", "line": 3198, "name": "gfx_taskbar_rect", "signature": "static void gfx_taskbar_rect(wm_gfxview_rect_t *r)"}, {"doc": "Docstring: Hand keyboard focus to the graphics window without a * redraw (callers repaint once afterwards). static void gfx_take_focus(int source) { int before = wm_focus; if (wm_focus == WM_FOCUS_GFX) return; if (shell_readline_active()) shell_focus_park(); tw_park(wm_term); wm_focus = WM_FOCUS_GFX; kbd_raw_flush(); wm_emit_focus_moved(before, source); } /** Docstring: Hand keyboard focus back to the last terminal.", "kind": "function", "line": 3235, "name": "gfx_drop_focus", "signature": "static void gfx_drop_focus(int source)"}, {"kind": "function", "line": 3246, "name": "from", "signature": "* leaving returns to the view it came from (floating or tiled). Returns\n * 0 on success, -1 witho..."}, {"doc": "Docstring: Minimize (hide) or restore the graphics window. The app keeps running; a hidden window paints nothing, drops the keyboard to the terminal and glides into its taskbar button; a restore glides back * out and takes the keyboard. Returns 0, or -1 without a program.", "kind": "function", "line": 3280, "name": "vga_fb_gfx_set_hidden", "signature": "int vga_fb_gfx_set_hidden(int hide)"}, {"doc": "if (gfx_view_valid) gfx_animate(&from, &btn, titled, 0); else vga_fb_draw_desktop(); return 0; } gfx_hidden = 0; gfx_take_focus(WM_FOCUS_SRC_TASKBAR); wm_last_n = -1; gfx_transition(&btn, 0); return 0; } /** Docstring: Graphics view state for `wm state`/`wm list`.", "kind": "function", "line": 3308, "name": "vga_fb_gfx_view_name", "signature": "const char *vga_fb_gfx_view_name(void)"}, {"doc": "/** Docstring: Graphics view state for `wm state`/`wm list`. const char *vga_fb_gfx_view_name(void) { const char *n; if (!vga_fb_gfx_mode) return \"none\"; if (gfx_hidden) return \"minimized\"; n = wm_gfxview_mode_name(gfx_view_mode); return n ? n : \"floating\"; } /* ---- Keyboard shortcuts ---- /** Docstring: Toggle fullscreen of the focused terminal window.", "kind": "function", "line": 3320, "name": "term_toggle_fullscreen", "signature": "static void term_toggle_fullscreen(void)"}, {"doc": "Docstring: Toggle fullscreen on the focused window: the graphics * window scales to the whole display, a terminal fills the grid.", "kind": "function", "line": 3332, "name": "vga_fb_toggle_fullscreen", "signature": "void vga_fb_toggle_fullscreen(void)"}, {"doc": "Minimize/restore the terminal window. The content is not touched; the window is merely hidden and repainted on restore. Fullscreen and minimize * are mutually exclusive: entering fullscreen un-minimizes.", "kind": "function", "line": 3343, "name": "term_toggle_minimize", "signature": "static void term_toggle_minimize(void)"}, {"doc": "Minimize/restore the terminal window. The content is not touched; the window is merely hidden and repainted on restore. Fullscreen and minimize * are mutually exclusive: entering fullscreen un-minimizes. static void term_toggle_minimize(void) { unsigned int *fx_old = fx_start_full(); term_minimized = !term_minimized; if (term_minimized) term_fullscreen = 0; disp_off = 0; vga_fb_draw_desktop(); fx_finish_full(fx_old); } /** Docstring: Minimize/restore the focused window (graphics or terminal).", "kind": "function", "line": 3353, "name": "vga_fb_toggle_minimize", "signature": "void vga_fb_toggle_minimize(void)"}, {"kind": "function", "line": 3361, "name": "vga_fb_is_minimized", "signature": "int vga_fb_is_minimized(void)"}, {"kind": "function", "line": 3362, "name": "vga_fb_is_fullscreen", "signature": "int vga_fb_is_fullscreen(void)"}, {"doc": "Snap the focused graphics window into a screen region (halves place it against that edge, quadrants into that corner) at its native size: a * snap floats the window, it never scales it. Glides to the target.", "kind": "function", "line": 3367, "name": "gfx_snap", "signature": "static void gfx_snap(int zone)"}, {"doc": "Docstring: Terminal close button: restore the default geometry (the * shell cannot be closed).", "kind": "function", "line": 3400, "name": "term_close_default", "signature": "static void term_close_default(void)"}, {"doc": "Close the focused window. For the graphics window (focused) this arms the close request that the syscall dispatcher honours on the child's next syscall; for a terminal it restores the default position (the shell cannot be closed). Returns 1 when a close was armed, 0 * otherwise.", "kind": "function", "line": 3416, "name": "vga_fb_close_active", "signature": "int vga_fb_close_active(void)"}, {"kind": "function", "line": 3430, "name": "vga_fb_move_terminal", "signature": "void vga_fb_move_terminal(int dx, int dy)"}, {"doc": "--- Tiling window operations (Alt = WM modifier) ---- Snap places the window in a screen half or quadrant and sizes it to that region; resize grows/shrinks the persisted size. Both exit fullscreen and * preserve the new size across redraws.", "kind": "function", "line": 3475, "name": "term_max_cols", "signature": "static int term_max_cols(void)"}, {"kind": "function", "line": 3479, "name": "term_max_rows", "signature": "static int term_max_rows(void)"}, {"kind": "function", "line": 3484, "name": "term_finish_layout", "signature": "static void term_finish_layout(void)"}, {"kind": "function", "line": 3490, "name": "vga_fb_snap_window", "signature": "void vga_fb_snap_window(int zone)"}, {"kind": "function", "line": 3518, "name": "vga_fb_resize", "signature": "void vga_fb_resize(int dcols, int drows)"}, {"doc": "int ncol = term_sz_cols + dcols; int nrow = term_sz_rows + drows; if (ncol < 1) ncol = 1; if (nrow < 1) nrow = 1; if (ncol > mc) ncol = mc; if (nrow > mr) nrow = mr; if (ncol == term_sz_cols && nrow == term_sz_rows && !term_fullscreen) return; term_fullscreen = 0; term_sz_cols = ncol; term_sz_rows = nrow; term_finish_layout(); } /** Docstring: Restore defaults on the focused window plus graphics offset.", "kind": "function", "line": 3538, "name": "vga_fb_reset_default", "signature": "void vga_fb_reset_default(void)"}, {"kind": "function", "line": 3592, "name": "wallpaper_ensure", "signature": "static void wallpaper_ensure(void)"}, {"doc": "d[2] = px[0]; if (bpx == 4) d[3] = 0; } } } stbi_image_free(img); wall_native = cache; wall_cw = fb_width; wall_ch = fb_height; wall_bpx = bpx; } /** Docstring: True when the native cache matches the live mode.", "kind": "function", "line": 3644, "name": "wallpaper_usable", "signature": "static int wallpaper_usable(void)"}, {"kind": "function", "line": 3649, "name": "wallpaper_draw", "signature": "static void wallpaper_draw(void)"}, {"doc": "--- Desktop shortcut icons ---- Shortcuts are defined in etc/shortcuts on the ramdisk, one per line: name|icon_path|command Icons are 32x32 PNG files decoded at boot via stbi_load_file and mapped to the icon palette (VGA DAC indices 240-255).  The cached palette-indexed * pixels are redrawn on every desktop paint; mouse clicks launch the command. static struct desktop_shortcut shortcuts[MAX_SHORTCUTS]; static int shortcut_count; static int shortcuts_loaded; /* Find a pipe-delimited field by index (0-based).", "kind": "function", "line": 3675, "name": "pipe_field", "signature": "static const char *pipe_field(const char *line, int idx, char *buf, int buflen)"}, {"doc": "Nearest entry in the 16-colour icon palette (squared RGB distance, * integer-only: at most 3*255*255 per entry, far from overflow).", "kind": "function", "line": 3693, "name": "icon_nearest", "signature": "static int icon_nearest(int r, int g, int b)"}, {"doc": "for (i = 0; i < ICON_PAL_SIZE; i++) { int dr = r - icon_pal[i][0]; int dg = g - icon_pal[i][1]; int db = b - icon_pal[i][2]; int d = dr * dr + dg * dg + db * db; if (d < best_d) { best_d = d; best = i; } } return best; } /* Embedded fallback when the shortcut's PNG is missing or undecodable.", "kind": "function", "line": 3709, "name": "icon_embedded", "signature": "static const uint8_t *icon_embedded(const char *name)"}, {"doc": "Decode a shortcut's PNG to raw 32x32 RGBA pixels. Returns a heap buffer that lives until reboot, or 0 on any failure (missing file, undecodable image, exhausted heap); the caller then uses icon_embedded. Keeping the PNG's own colors (instead of mapping to the 16-entry icon palette) is what makes icons distinguishable on a true-color desktop; the 8-bit mode * quantizes back through icon_nearest at draw time.", "kind": "function", "line": 3729, "name": "icon_decode", "signature": "static const uint8_t *icon_decode(const char *path)"}, {"doc": "Expand an embedded index icon (desktop_icons.h, transparent 0) to RGBA through the icon palette, so fallback art follows the same draw path as * decoded PNGs. Returns a heap buffer or 0 when exhausted.", "kind": "function", "line": 3763, "name": "icon_embedded_rgba", "signature": "static const uint8_t *icon_embedded_rgba(const uint8_t *idx)"}, {"doc": "Width of the longest shortcut label in pixels (cached after load). Labels are centred under their icon and a dock column must be wide enough for one, * or neighbouring labels overlap. static int dock_cell_w; /* Width (px) one label occupies (FONT_W per character).", "kind": "function", "line": 3791, "name": "dock_label_px", "signature": "static int dock_label_px(const struct desktop_shortcut *sc)"}, {"doc": "Dock layout: one centred row just above the taskbar. Every shortcut owns a column `dock_cell_w` wide (enough for its label), the icon is centred in the column and the label centred beneath it, so long names never collide with a neighbour. Recomputed on every draw/hit-test from fb_width/fb_height so a * resolution change never leaves stale coordinates behind.", "kind": "function", "line": 3800, "name": "shortcuts_layout", "signature": "static void shortcuts_layout(void)"}, {"doc": "dock_h = ICON_H + DOCK_LABEL_GAP + ICON_LABEL_H + 2 * DOCK_PAD_Y; x0 = (fb_width - dock_w) / 2; if (x0 < 0) x0 = 0; y0 = fb_height - TASKBAR_H - DOCK_GAP - dock_h; if (y0 < 0) y0 = 0; cell_left = x0 + DOCK_PAD_X; for (i = 0; i < shortcut_count; i++) { shortcuts[i].x = cell_left + (dock_cell_w - ICON_W) / 2; shortcuts[i].y = y0 + DOCK_PAD_Y; cell_left += dock_cell_w; } } /* Left edge of shortcut i's column (used to centre its label under the icon).", "kind": "function", "line": 3818, "name": "shortcut_cell_left", "signature": "static int shortcut_cell_left(int i)"}, {"kind": "function", "line": 3825, "name": "desktop_shortcuts_load", "signature": "void desktop_shortcuts_load(void)"}, {"doc": "Blit one shortcut icon scaled to dw x dh at (dx, dy), nearest neighbour from the cached 32x32 RGBA source. Alpha below 128 stays * transparent; 8-bit mode quantizes through the icon palette.", "kind": "function", "line": 3881, "name": "shortcut_draw_scaled", "signature": "static void shortcut_draw_scaled(const struct desktop_shortcut *sc,\n                             ..."}, {"doc": "Index of the shortcut column under (mx, my), or -1. Same column bounds * as the click hit test, so hover and click always agree.", "kind": "function", "line": 3906, "name": "dock_hover_index", "signature": "static int dock_hover_index(int mx, int my)"}, {"kind": "function", "line": 3933, "name": "dock_bounce_counts", "signature": "void dock_bounce_counts(unsigned long *kicks, unsigned long *paints)"}, {"kind": "function", "line": 3943, "name": "dock_click_count", "signature": "void dock_click_count(unsigned long *edges)"}, {"doc": "Ticks elapsed since the bounce click, capped so the subtraction can * never wrap on a late read.", "kind": "function", "line": 3949, "name": "dock_bounce_elapsed", "signature": "static unsigned long dock_bounce_elapsed(void)"}, {"doc": "Ticks elapsed since the bounce click, capped so the subtraction can * never wrap on a late read. static unsigned long dock_bounce_elapsed(void) { unsigned long now = (unsigned long)sys_ticks; unsigned long el = now - dock_bounce_start; if (el > DOCK_BOUNCE_TICKS) el = DOCK_BOUNCE_TICKS; return el; } /* 1 while the bounce animation is live, 0 once it expired or is idle.", "kind": "function", "line": 3957, "name": "dock_bounce_live", "signature": "static int dock_bounce_live(void)"}, {"kind": "function", "line": 4007, "name": "dock_pending_active", "signature": "int dock_pending_active(void)"}, {"doc": "Paint every shortcut icon and label at the given hover sizes. Shared by the full desktop paint and the flicker-free hover repaint, so the two can never diverge. Growth is bottom-aligned on the slot with no * relayout: it overlays upward and the strip erase restores it.", "kind": "function", "line": 4015, "name": "dock_paint_icons", "signature": "static void dock_paint_icons(int hover)"}, {"kind": "function", "line": 4051, "name": "desktop_shortcuts_draw", "signature": "void desktop_shortcuts_draw(void)"}, {"doc": "Paint one wallpaper rectangle from the cache (solid fill when the cache * is absent or stale): the strip-erase primitive for the hover repaint.", "kind": "function", "line": 4078, "name": "wallpaper_rect", "signature": "static void wallpaper_rect(int x0, int y0, int w, int h)"}, {"doc": "Hover repaint without the fullscreen flash: erase only the dock strip (bar plus the overflow the magnified icons rise into), restore the crystal and repaint the icons at the new hover sizes. No clear, no wallpaper rewrite, no terminal re-render, so there is no black frame; the strip is cheap (a few rows) and runs once per hover crossing. Terminals paint over the dock on a full desktop paint, so a terminal dragged across the dock is overpainted here until its next render; that drag case is rare and heals on the next paint. Fullscreen * terminals hide the dock, so the tick never calls this there.", "kind": "function", "line": 4109, "name": "dock_paint_hover", "signature": "static void dock_paint_hover(int hover)"}, {"doc": "Icon for the taskbar running-app button. First the running program via its launch command (config-driven, covers apps that never set a window title); then the window title against the shortcut name as fallback (case-insensitive, \"*\" suffix ignored). Text-only button when nothing matches. Load is idempotent, so a click before the first desktop paint * still resolves.", "kind": "function", "line": 4145, "name": "gfx_task_icon", "signature": "static const uint8_t *gfx_task_icon(void)"}, {"kind": "function", "line": 4166, "name": "desktop_shortcuts_hit_test", "signature": "const char *desktop_shortcuts_hit_test(int mx, int my)"}, {"doc": "const char *desktop_shortcuts_hit_test(int mx, int my) { shortcuts_layout(); for (int i = 0; i < shortcut_count; i++) { struct desktop_shortcut *sc = &shortcuts[i]; int cl = shortcut_cell_left(i); if (mx >= cl && mx < cl + dock_cell_w && my >= sc->y && my < sc->y + ICON_H + ICON_LABEL_H) { return sc->cmd; } } return 0; } /** Docstring: Focus the topmost window at point, paint order.", "kind": "function", "line": 4180, "name": "mouse_focus_topmost", "signature": "static int mouse_focus_topmost(int mx, int my)"}, {"doc": "if (!twins[f].present) continue; if (tw_hit(f, mx, my)) { if (f == wm_focus) return 0; before = wm_focus; tw_select(f); vga_fb_draw_desktop(); wm_emit_focus_moved(before, WM_FOCUS_SRC_POINTER); return 1; } } return 0; } /** Docstring: Scroll the focused terminal from a wheel sample.", "kind": "function", "line": 4206, "name": "mouse_apply_wheel", "signature": "static void mouse_apply_wheel(int wheel, int step)"}, {"doc": "Docstring: Title-bar drag of the graphics window. Redraws on every offset change and once more on release, so the persistent layer moves with the pointer and no duplicated copy survives the drop. Grabbing a tiled window floats it at native size under the pointer (the grab point keeps its relative position along the title); a fullscreen window has * no title and never drags.", "kind": "function", "line": 4230, "name": "mouse_drag_gfx", "signature": "static void mouse_drag_gfx(const wm_geom_config_t *gcfg, int mx, int my)"}, {"doc": "Docstring: Title-bar drag of the focused terminal window. The motion path already repaints per step; the release edge repaints once more so * the final coordinates settle with no duplicated copy left behind.", "kind": "function", "line": 4282, "name": "mouse_drag_term", "signature": "static void mouse_drag_term(const wm_geom_config_t *gcfg, int win_w, int mx, int my, int gfx_cursor)"}, {"doc": "wm_grab_cx = (mx - term_px_x) / FONT_W; } } else { wm_dragging = 0; } if (wm_dragging) { vga_fb_drag_terminal(mx, my, wm_grab_cx); if (!gfx_cursor) cursor_invalidate(); } else if (was) { vga_fb_draw_desktop(); } } /** Docstring: Scrollbar drag of the focused terminal window.", "kind": "function", "line": 4305, "name": "mouse_scrollbar", "signature": "static void mouse_scrollbar(const wm_geom_config_t *gcfg, int mx, int my)"}, {"doc": "Docstring: Drive the desktop from a kernel wait loop. While the shell waits for a foreground process nothing else runs vga_fb_mouse_tick: the timer ISR drives it only for the pid-0 exec frame (user_program_active) and the shell's input loop is not running, so the pointer, taskbar and window controls froze for the whole run. The loop calls this between yields; it ticks at the ISR's cadence and stands down whenever the ISR * owns the desktop, so the two never run the tick concurrently.", "kind": "function", "line": 4334, "name": "vga_fb_wait_tick", "signature": "void vga_fb_wait_tick(void)"}, {"doc": "timer ISR drives it only for the pid-0 exec frame (user_program_active) and the shell's input loop is not running, so the pointer, taskbar and window controls froze for the whole run. The loop calls this between yields; it ticks at the ISR's cadence and stands down whenever the ISR * owns the desktop, so the two never run the tick concurrently. void vga_fb_wait_tick(void) { static unsigned long last; if (!vga_fb_active || user_program_active) return; if ((unsigned long)sys_ticks - last < DESKTOP_TICK_INTERVAL) return; last = (unsigned long)sys_ticks; vga_fb_mouse_tick(); } /** Docstring: Per-tick mouse dispatch over unified geometry and events.", "kind": "function", "line": 4343, "name": "vga_fb_mouse_tick", "signature": "void vga_fb_mouse_tick(void)"}, {"kind": "function", "line": 4467, "name": "state", "signature": "* ignores the button state (the arming press is consumed) and settles\n     * once on expiry, so t..."}, {"kind": "function", "line": 4545, "name": "vga_fb_mouse_init", "signature": "void vga_fb_mouse_init(void)"}, {"doc": "Docstring: Page the terminal history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring, so the page keys move that viewport; the legacy VGA scrollback ring only serves the * text-mode console, where the framebuffer terminal does not exist.", "kind": "function", "line": 4599, "name": "vga_fb_history_page", "signature": "void vga_fb_history_page(int dir)"}, {"kind": "function", "line": 4611, "name": "vga_fb_init", "signature": "void vga_fb_init(void)"}, {"kind": "function", "line": 133, "name": "compositions", "signature": "* compositions (an ISR tick composing inside a syscall composition) draw * into the same shadow and leave the present to the outermost owner. * The shadow is allocated once on first use and never free"}, {"kind": "function", "line": 533, "name": "flag", "signature": "* is the minimized flag (the program keeps running, nothing composites);"}, {"kind": "function", "line": 537, "name": "letterbox", "signature": "* present to repaint chrome plus letterbox (after a desktop redraw or a * view change);"}, {"kind": "function", "line": 782, "name": "coordinates", "signature": "* windows keep the exact historical coordinates (including outside the * window);"}, {"kind": "function", "line": 976, "name": "gfx_transition", "signature": "static void gfx_transition(const wm_gfxview_rect_t *from, int from_titled);"}, {"kind": "function", "line": 1195, "name": "app", "signature": "* a gfx child spawned from another gfx app (file -> vedit) keeps the * terminal focused, so its keys and wheel keep landing on the shell * while the app looks hung. The enable arm mirrors the focus-gf"}, {"kind": "function", "line": 2569, "name": "title", "signature": "* 8px row plus its title (bright when focused). The hint line * starts after it instead of underneath. */ const uint8_t *ipx = gfx_task_icon();"}, {"kind": "function", "line": 4140, "name": "command", "signature": "* its launch command (config-driven, covers apps that never set a window * title);"}, {"kind": "function", "line": 4227, "name": "pointer", "signature": "* tiled window floats it at native size under the pointer (the grab point * keeps its relative position along the title);"}, {"kind": "function", "line": 4354, "name": "path", "signature": "* present path (blit_gfx_buf) is the sole cursor painter. The tick * used to share the sprite state with it and raced every present * (~60fps vs 25Hz): stale restores painted trails and flicker, worst"}, {"kind": "macro", "line": 145, "name": "FBT", "signature": "#define FBT"}, {"kind": "macro", "line": 296, "name": "LG_LINE", "signature": "#define LG_LINE(a)"}, {"kind": "macro", "line": 524, "name": "GFX_SRC_IDX", "signature": "#define GFX_SRC_IDX"}, {"kind": "macro", "line": 525, "name": "GFX_SRC_RGB", "signature": "#define GFX_SRC_RGB"}, {"kind": "macro", "line": 526, "name": "GFX_KEEP_BYTES", "signature": "#define GFX_KEEP_BYTES"}, {"kind": "macro", "line": 552, "name": "GFX_CURSOR_IDLE_TICKS", "signature": "#define GFX_CURSOR_IDLE_TICKS"}, {"kind": "macro", "line": 558, "name": "GFX_CURSOR_FOLLOW_TICKS", "signature": "#define GFX_CURSOR_FOLLOW_TICKS"}, {"kind": "macro", "line": 610, "name": "GFX_PROG_LEN", "signature": "#define GFX_PROG_LEN"}, {"kind": "macro", "line": 936, "name": "WIN_DEF_COLS", "signature": "#define WIN_DEF_COLS"}, {"kind": "macro", "line": 937, "name": "WIN_DEF_ROWS", "signature": "#define WIN_DEF_ROWS"}, {"kind": "macro", "line": 938, "name": "WIN_DEF_X", "signature": "#define WIN_DEF_X"}, {"kind": "macro", "line": 939, "name": "WIN_DEF_Y", "signature": "#define WIN_DEF_Y"}, {"kind": "macro", "line": 967, "name": "WM_MAX_TERMS", "signature": "#define WM_MAX_TERMS"}, {"kind": "macro", "line": 968, "name": "WM_ELINE_SZ", "signature": "#define WM_ELINE_SZ"}, {"kind": "macro", "line": 1687, "name": "FB_OFFSET", "signature": "#define FB_OFFSET(x,y)"}, {"kind": "macro", "line": 2517, "name": "TB_GFX_TITLE_MAX", "signature": "#define TB_GFX_TITLE_MAX"}]}, {"doc": "DOOM-melt desktop effects (see headers/vga_fx.h for the contract).", "id": "kernel/vga_fx.c", "kind": "module", "label": "vga_fx.c", "language": "c", "sha256": "fc8cb2a6dc121b82", "symbol_count": 9, "symbols": [{"kind": "function", "line": 22, "name": "vga_fx_set_enabled", "signature": "void vga_fx_set_enabled(int on)"}, {"kind": "function", "line": 27, "name": "vga_fx_enabled", "signature": "int vga_fx_enabled(void)"}, {"doc": "Deadline pacing over the PIT-calibrated TSC clock. Interrupts stay on, so the 100 Hz tick keeps running; a concurrent desktop tick may tear one * melt frame cosmetically, never corrupt state.", "kind": "function", "line": 35, "name": "fx_wait_until", "signature": "static void fx_wait_until(unsigned long deadline)"}, {"kind": "function", "line": 41, "name": "vga_fx_snap_rect", "signature": "unsigned int *vga_fx_snap_rect(int x, int y, int w, int h)"}, {"kind": "function", "line": 63, "name": "vga_fx_restore_rect", "signature": "void vga_fx_restore_rect(int x, int y, int w, int h, const unsigned int *buf)"}, {"kind": "function", "line": 77, "name": "vga_fx_free", "signature": "void vga_fx_free(unsigned int *buf)"}, {"kind": "function", "line": 90, "name": "once", "signature": "* once (prev[] tracks the revealed frontier per column), then the final\n * restore guarantees the..."}, {"doc": "Drive one old->new melt. The framebuffer must show the old rect on entry * and shows the new rect on return.", "kind": "function", "line": 150, "name": "vga_fx_melt_rect", "signature": "void vga_fx_melt_rect(int x, int y, int w, int h,\n    const unsigned int *oldb, const unsigned in..."}, {"doc": "Boot melt: the framebuffer is already cleared to black on entry, so no * old snapshot is needed; the new frame scrolls down over black.", "kind": "function", "line": 159, "name": "vga_fx_melt_from_black", "signature": "void vga_fx_melt_from_black(int x, int y, int w, int h, const unsigned int *newb)"}]}, {"doc": "kernel.c -- Mediator: boot orchestration and the syscall trampoline.", "id": "kernel.c", "kind": "module", "label": "kernel.c", "language": "c", "sha256": "4dc04c5fe9d65390", "symbol_count": 15, "symbols": [{"kind": "function", "line": 117, "name": "syscall_init", "signature": "void syscall_init(void)"}, {"kind": "function", "line": 192, "name": "bootlog_mark", "signature": "void bootlog_mark(const char *name)"}, {"kind": "function", "line": 199, "name": "bootlog_report", "signature": "void bootlog_report(void)"}, {"kind": "function", "line": 207, "name": "__attribute__", "signature": "__attribute__((section(\".init.text\")))\nvoid kmain(void)"}, {"kind": "function", "line": 279, "name": "tables", "signature": "* tables (already built above) for its uncached register window and the\n     * heap for its rings..."}, {"kind": "function", "line": 104, "name": "table", "signature": "* Symbol table (for resolving program references) * ================================================================ */ #define KSYM_MAX 256 /* ---- SYSCALL/SYSRET setup ------------------------------"}, {"kind": "function", "line": 130, "name": "ksyscall", "signature": "extern long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6);"}, {"kind": "function", "line": 146, "name": "kstack", "signature": "* Reading gs:8 instead resolves every thread to the wrong kstack (0 on * the BSP, 1 on APs): harmless while a single process runs, fatal as * soon as two threads syscall concurrently. */ _Static_asser"}, {"kind": "function", "line": 185, "name": "ms", "signature": "* 0 ms (TSC ticks since power-on divided down, still monotonic);"}, {"kind": "function", "line": 257, "name": "size", "signature": "* image size (see kernel.ld);"}, {"kind": "variable", "line": 115, "name": "syscall_kstack", "signature": "extern unsigned long syscall_kstack;"}, {"kind": "variable", "line": 179, "name": "ramdisk_start", "signature": "extern char ramdisk_start[];"}, {"kind": "variable", "line": 180, "name": "ramdisk_end", "signature": "extern char ramdisk_end[];"}, {"kind": "macro", "line": 107, "name": "KSYM_MAX", "signature": "#define KSYM_MAX"}, {"kind": "macro", "line": 188, "name": "BOOTLOG_MAX", "signature": "#define BOOTLOG_MAX"}]}, {"id": "mcp/__init__.py", "kind": "module", "label": "__init__.py", "language": "py", "sha256": "9a62779e844a15fa", "symbol_count": 0, "symbols": []}, {"doc": "Debug driver: boot MiniOS through the MCP bridge and run freedom.", "id": "mcp/mcp_dbg_driver.py", "kind": "module", "label": "mcp_dbg_driver.py", "language": "py", "sha256": "a5126846fc22fb61", "symbol_count": 6, "symbols": [{"kind": "class", "line": 15, "name": "Client", "signature": "class Client"}, {"kind": "function", "line": 64, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 16, "name": "__init__", "signature": "def __init__(self)"}, {"kind": "method", "line": 28, "name": "request", "signature": "def request(self, method, params)"}, {"kind": "method", "line": 46, "name": "tool", "signature": "def tool(self, name, params)"}, {"kind": "method", "line": 54, "name": "close", "signature": "def close(self)"}]}, {"doc": "Dogfood: drive minios_mcp.py over stdio JSON-RPC and install the freedom addon from a git repo, then browse with the installed binary.  Stdlib only. Usage: python3 mcp_dogfood.py <addons-dir>", "id": "mcp/mcp_dogfood.py", "kind": "module", "label": "mcp_dogfood.py", "language": "py", "sha256": "cfa46579de503ab4", "symbol_count": 6, "symbols": [{"kind": "class", "line": 19, "name": "Client", "signature": "class Client"}, {"kind": "function", "line": 78, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 20, "name": "__init__", "signature": "def __init__(self, addons_dir)"}, {"kind": "method", "line": 40, "name": "request", "signature": "def request(self, method, params)"}, {"kind": "method", "line": 58, "name": "tool", "signature": "def tool(self, name, params)"}, {"kind": "method", "line": 68, "name": "close", "signature": "def close(self)"}]}, {"doc": "MiniOS addon marketplace (lazyaddons-style).  Addons are YAML files that say where a program's source lives on GitHub and how it is built. Two flavors share one dialect:  - kind `guest` (default): built *inside* the OS. This module parses that YAML with a strict stdlib-only subset parser (no PyYAML) and installs the addon into a running MiniOS session: clone the repo, upload each source through the editor in bounded chunks, reassemble with `cat`, build and verify inside the OS. - kind `host`: built on the host with the ordinary gcc toolchain and packed into the image by `make` (every sibling checkout and every vendored tree). `minios_install` refuses these with a diagnostic that names the make target instead of half-installing them. - kind `reference`: source-only reference checkouts (never vendored, never linked, never built). Same refusal as `host`.  The host shell is never invoked; the only commands run are the addon's own build/verify lines, driven line by line through the MiniOS shell.", "id": "mcp/minios_addons.py", "kind": "module", "label": "minios_addons.py", "language": "py", "sha256": "4b24ff00ac0b8aad", "symbol_count": 16, "symbols": [{"doc": "Expected marketplace failure, reported to the client as isError.", "kind": "class", "line": 56, "name": "AddonError", "signature": "class AddonError(Exception)"}, {"kind": "function", "line": 62, "name": "_clean", "signature": "def _clean(s)"}, {"kind": "function", "line": 66, "name": "_unquote", "signature": "def _unquote(v)"}, {"doc": "Parse the strict YAML subset. Returns the addon dict.\n\nGrammar: flat `key: value` lines; `install:` opens an indented block\nwith `repo_url:`, an optional `kind:` (`guest` default, `host`,\n`reference`), optional `dir_var:`/`ref:`/`artifact:` metadata, a\n`files:` list of `- src:`/`dst:` pairs, and `build:` / `host_build:` /\n`verify:` lists of `- ...` command lines (`verify` items may carry a\nnested `exit_code:`). Everything else is a parse error with its line\nnumber.", "kind": "function", "line": 73, "name": "parse_addon_yaml", "signature": "def parse_addon_yaml(text)"}, {"doc": "Check bounds and character sets. Raises AddonError.", "kind": "function", "line": 205, "name": "validate_addon", "signature": "def validate_addon(addon, source)"}, {"doc": "dst paths live on the ramdisk: relative, no '..', bounded charset.", "kind": "function", "line": 295, "name": "validate_addon_path", "signature": "def validate_addon_path(path)"}, {"doc": "Build/verify lines are single printable-ASCII shell commands.", "kind": "function", "line": 309, "name": "validate_shell_line", "signature": "def validate_shell_line(line)"}, {"doc": "Load every addon yaml; each entry is a dict or an error string.", "kind": "function", "line": 323, "name": "load_addons_dir", "signature": "def load_addons_dir(addons_dir)"}, {"doc": "Split a source into editor-sized chunks. Raises AddonError.", "kind": "function", "line": 347, "name": "split_for_editor", "signature": "def split_for_editor(text)"}, {"kind": "function", "line": 372, "name": "exit_code_of", "signature": "def exit_code_of(text)"}, {"doc": "Host-side record of installed addons (system temp dir).", "kind": "class", "line": 377, "name": "AddonState", "signature": "class AddonState"}, {"doc": "Install one validated addon into the booted MiniOS session.\n\nFailure at any step raises AddonError; upload parts are removed and\nnothing is recorded, so a half-installed package is never reported.", "kind": "function", "line": 401, "name": "install_addon", "signature": "def install_addon(session, addon, cfg)"}, {"kind": "function", "line": 85, "name": "fail", "signature": "def fail(lineno, why)"}, {"kind": "method", "line": 380, "name": "__init__", "signature": "def __init__(self, path)"}, {"kind": "method", "line": 383, "name": "load", "signature": "def load(self)"}, {"kind": "method", "line": 393, "name": "save", "signature": "def save(self, addons)"}]}, {"doc": "MiniOS MCP bridge.  Exposes a running MiniOS instance as tools over the MCP stdio protocol. The server boots os.img in QEMU, owns a pty-backed serial console, and lets a client write, compile, link and run software inside the OS.  Python 3 standard library only. One QEMU child per server, terminated on every exit path. The host shell is never invoked.", "id": "mcp/minios_mcp.py", "kind": "module", "label": "minios_mcp.py", "language": "py", "sha256": "4d5bccd4e435de4f", "symbol_count": 51, "symbols": [{"doc": "Resolve the configuration: defaults overridden by the environment.", "kind": "function", "line": 71, "name": "env_config", "signature": "def env_config()"}, {"doc": "Clamp a requested wait to the bounded timeout range.", "kind": "function", "line": 89, "name": "clamp_timeout", "signature": "def clamp_timeout(ms)"}, {"doc": "Reject file names the ramdisk or the shell would mishandle.", "kind": "function", "line": 102, "name": "validate_path", "signature": "def validate_path(name)"}, {"doc": "Reject lines the kernel readline cannot carry (printable ASCII).", "kind": "function", "line": 118, "name": "validate_content", "signature": "def validate_content(text)"}, {"doc": "Expected tool failure, reported to the client as isError.", "kind": "class", "line": 131, "name": "ToolError", "signature": "class ToolError(Exception)"}, {"doc": "JSON-RPC level failure carrying a standard error code.", "kind": "class", "line": 137, "name": "RPCError", "signature": "class RPCError(Exception)"}, {"doc": "Bounded console log with absolute byte positions and waits.", "kind": "class", "line": 146, "name": "LogBuffer", "signature": "class LogBuffer"}, {"doc": "One QEMU child, one pty, one console log, one consume cursor.", "kind": "class", "line": 216, "name": "MiniOSSession", "signature": "class MiniOSSession"}, {"kind": "function", "line": 580, "name": "subprocess_launch", "signature": "def subprocess_launch(cfg, slave_fd)"}, {"doc": "JSON-RPC dispatch loop over stdio.", "kind": "class", "line": 731, "name": "MCPServer", "signature": "class MCPServer"}, {"kind": "function", "line": 888, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 140, "name": "__init__", "signature": "def __init__(self, code, message)"}, {"kind": "method", "line": 149, "name": "__init__", "signature": "def __init__(self, cap)"}, {"kind": "method", "line": 155, "name": "append", "signature": "def append(self, data)"}, {"kind": "method", "line": 163, "name": "bytes_from", "signature": "def bytes_from(self, pos)"}, {"kind": "method", "line": 168, "name": "text_from", "signature": "def text_from(self, pos, end)"}, {"kind": "method", "line": 175, "name": "find", "signature": "def find(self, marker, start)"}, {"doc": "Block until marker appears at or after start; return position.", "kind": "method", "line": 179, "name": "wait_for", "signature": "def wait_for(self, marker, start, timeout_ms)"}, {"doc": "Block until any of markers appears at or after start; return the\nearliest position found, or -1 when the timeout expires first.", "kind": "method", "line": 192, "name": "wait_for_any", "signature": "def wait_for_any(self, markers, start, timeout_ms)"}, {"kind": "method", "line": 206, "name": "_find_locked", "signature": "def _find_locked(self, marker, start)"}, {"kind": "method", "line": 219, "name": "__init__", "signature": "def __init__(self, cfg)"}, {"kind": "method", "line": 230, "name": "booted", "signature": "def booted(self)"}, {"kind": "method", "line": 233, "name": "status", "signature": "def status(self)"}, {"kind": "method", "line": 242, "name": "_reap_stale", "signature": "def _reap_stale(self)"}, {"kind": "method", "line": 278, "name": "_drop_pidfile", "signature": "def _drop_pidfile(self)"}, {"kind": "method", "line": 284, "name": "boot", "signature": "def boot(self, timeout_ms)"}, {"kind": "method", "line": 319, "name": "_read_loop", "signature": "def _read_loop(self)"}, {"kind": "method", "line": 329, "name": "_close_pty", "signature": "def _close_pty(self)"}, {"kind": "method", "line": 339, "name": "_write_line", "signature": "def _write_line(self, line)"}, {"doc": "Editor content lines may be empty (blank lines in the file).", "kind": "method", "line": 348, "name": "_write_editor_line", "signature": "def _write_editor_line(self, line)"}, {"kind": "method", "line": 356, "name": "send", "signature": "def send(self, line, timeout_ms)"}, {"kind": "method", "line": 367, "name": "expect", "signature": "def expect(self, marker, timeout_ms)"}, {"kind": "method", "line": 381, "name": "snapshot", "signature": "def snapshot(self, max_bytes)"}, {"doc": "Run a generic scenario: send a list of shell commands, then assert\nthat each expected marker appears (and each refuted marker does not)\nin the output those commands produced. Returns a verdict plus the\ncaptured transcript. This is the reusable harness behind every in-OS\nfeature test, so a session never has to hand-roll a QEMU boot and\nmarker-assertion script.", "kind": "method", "line": 391, "name": "run_test", "signature": "def run_test(self, commands, expect, refute, timeout_ms)"}, {"kind": "method", "line": 447, "name": "cat", "signature": "def cat(self, path)"}, {"doc": "Run a MicroPython script (or `-c` code) inside MiniOS and return\nits output, including the `exit code: N` line. MicroPython now runs\nreliably thanks to the kernel fix that zeroes the initial registers\nat the ELF entry (rdx is rtld_fini for glibc's _start).", "kind": "method", "line": 453, "name": "run_python", "signature": "def run_python(self, script, args, timeout_ms)"}, {"doc": "Read a ramdisk file and return exactly its bytes.\n\nThe serial console frames lines with carriage returns (CRLF, and a\nCR before each new line while the terminal redraws); the kernel cat\nappends one newline after the content. Content written through this\nbridge is printable ASCII only, so every CR is framing: they are all\ndropped first, then the echoed command line, the prompt and that\nsingle trailing newline are stripped.", "kind": "method", "line": 464, "name": "cat_body", "signature": "def cat_body(self, path, missing_ok)"}, {"kind": "method", "line": 493, "name": "_cleanup_parts", "signature": "def _cleanup_parts(self, parts)"}, {"kind": "method", "line": 500, "name": "write", "signature": "def write(self, path, content)"}, {"kind": "method", "line": 537, "name": "poweroff", "signature": "def poweroff(self, timeout_ms)"}, {"kind": "method", "line": 557, "name": "terminate", "signature": "def terminate(self)"}, {"kind": "method", "line": 576, "name": "close", "signature": "def close(self)"}, {"kind": "method", "line": 734, "name": "__init__", "signature": "def __init__(self, cfg)"}, {"kind": "method", "line": 738, "name": "run", "signature": "def run(self)"}, {"kind": "method", "line": 746, "name": "_handle", "signature": "def _handle(self, line)"}, {"kind": "method", "line": 772, "name": "_initialize", "signature": "def _initialize(self, params)"}, {"kind": "method", "line": 779, "name": "_call", "signature": "def _call(self, params)"}, {"kind": "method", "line": 796, "name": "_dispatch", "signature": "def _dispatch(self, name, args)"}, {"kind": "method", "line": 842, "name": "_addons_list", "signature": "def _addons_list(self)"}, {"kind": "method", "line": 863, "name": "_addon_install", "signature": "def _addon_install(self, args)"}, {"kind": "method", "line": 884, "name": "_reply", "signature": "def _reply(self, msg)"}]}, {"doc": "Mutation testing for the MiniOS MCP bridge. Every mutant is injected into a private copy of minios_mcp.py and run against the unit and BDD suite. A mutant that survives (suite fully green) exposes a test gap.  Suites run in parallel (one worker per core, MUTATE_JOBS to override); each mutant gets its own pid file and addon state so the runs stay independent.  Mutation format: \"name | sed -i expression | file\"", "id": "mcp/mutate_mcp.sh", "kind": "module", "label": "mutate_mcp.sh", "language": "sh", "sha256": "cdaca180c33c3b1b", "symbol_count": 1, "symbols": [{"doc": "Each mutant runs the suite in its own directory with its own pid file and addon state, so the runs are independent and may execute in parallel. The worker writes the exit code; the loop below maps it onto the verdict.", "kind": "function", "line": 116, "name": "run_one"}]}, {"doc": "Unit and BDD suite for the MiniOS MCP bridge.  Unit tests exercise protocol dispatch, input validation and buffer/cursor semantics without QEMU. BDD scenarios boot the real os.img and drive the edit/compile/link/run loop over JSON-RPC; they skip when QEMU or the image is absent.  Environment overrides: MINIOS_MCP (server path), MINIOS_IMAGE, QEMU, MINIOS_SKIP_BDD=1 forces the QEMU scenarios to skip.", "id": "mcp/test_minios_mcp.py", "kind": "module", "label": "test_minios_mcp.py", "language": "py", "sha256": "1855a1d973983a92", "symbol_count": 107, "symbols": [{"kind": "function", "line": 29, "name": "load_module", "signature": "def load_module()"}, {"kind": "function", "line": 52, "name": "have_qemu", "signature": "def have_qemu()"}, {"doc": "Child process running minios_mcp.py, driven over stdio JSON-RPC.", "kind": "class", "line": 58, "name": "MCPServer", "signature": "class MCPServer"}, {"kind": "class", "line": 141, "name": "TestProtocol", "signature": "class TestProtocol(TestCase)"}, {"kind": "class", "line": 205, "name": "TestValidation", "signature": "class TestValidation(TestCase)"}, {"kind": "class", "line": 254, "name": "TestLogBuffer", "signature": "class TestLogBuffer(TestCase)"}, {"doc": "Fail-fast for QEMU-backed classes: once a tool call has hit a\nconsole wait timeout the bridge is stuck (a mutated marker, a hung\nshell) and every remaining test would only burn its own timeout, so\nthey are skipped instead.", "kind": "class", "line": 306, "name": "_ConsoleBDDBase", "signature": "class _ConsoleBDDBase(TestCase)"}, {"kind": "class", "line": 342, "name": "TestMiniOSBDD", "signature": "class TestMiniOSBDD(_ConsoleBDDBase)"}, {"kind": "class", "line": 480, "name": "TestAddonYaml", "signature": "class TestAddonYaml(TestCase)"}, {"kind": "class", "line": 602, "name": "TestAddonHelpers", "signature": "class TestAddonHelpers(TestCase)"}, {"doc": "In-memory stand-in for the MiniOS session (no QEMU).", "kind": "class", "line": 642, "name": "FakeOS", "signature": "class FakeOS"}, {"kind": "class", "line": 708, "name": "TestAddonInstall", "signature": "class TestAddonInstall(TestCase)"}, {"doc": "Install a fixture addon from a local git repo into the real OS.", "kind": "class", "line": 844, "name": "TestAddonBDD", "signature": "class TestAddonBDD(_ConsoleBDDBase)"}, {"kind": "method", "line": 61, "name": "__init__", "signature": "def __init__(self, env_extra)"}, {"kind": "method", "line": 80, "name": "initialize", "signature": "def initialize(self)"}, {"kind": "method", "line": 84, "name": "request", "signature": "def request(self, method, params)"}, {"kind": "method", "line": 91, "name": "raw", "signature": "def raw(self, line)"}, {"kind": "method", "line": 96, "name": "_read_response", "signature": "def _read_response(self)"}, {"kind": "method", "line": 102, "name": "_roundtrip", "signature": "def _roundtrip(self, msg)"}, {"kind": "method", "line": 110, "name": "tool", "signature": "def tool(self, name, params)"}, {"kind": "method", "line": 120, "name": "close", "signature": "def close(self)"}, {"kind": "method", "line": 143, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 149, "name": "tearDownClass", "signature": "def tearDownClass(cls)"}, {"kind": "method", "line": 152, "name": "test_initialize", "signature": "def test_initialize(self)"}, {"kind": "method", "line": 158, "name": "test_tools_list", "signature": "def test_tools_list(self)"}, {"kind": "method", "line": 166, "name": "test_ping", "signature": "def test_ping(self)"}, {"kind": "method", "line": 170, "name": "test_unknown_method", "signature": "def test_unknown_method(self)"}, {"kind": "method", "line": 174, "name": "test_malformed_json", "signature": "def test_malformed_json(self)"}, {"kind": "method", "line": 178, "name": "test_unknown_tool", "signature": "def test_unknown_tool(self)"}, {"kind": "method", "line": 183, "name": "test_send_not_booted", "signature": "def test_send_not_booted(self)"}, {"kind": "method", "line": 189, "name": "test_send_empty_line_rejected", "signature": "def test_send_empty_line_rejected(self)"}, {"kind": "method", "line": 195, "name": "test_test_not_booted", "signature": "def test_test_not_booted(self)"}, {"kind": "method", "line": 207, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 212, "name": "test_path_accepts_plain_names", "signature": "def test_path_accepts_plain_names(self)"}, {"kind": "method", "line": 216, "name": "test_path_rejects_unsafe", "signature": "def test_path_rejects_unsafe(self)"}, {"kind": "method", "line": 220, "name": "test_path_rejects_long", "signature": "def test_path_rejects_long(self)"}, {"kind": "method", "line": 223, "name": "test_content_accepts_ascii", "signature": "def test_content_accepts_ascii(self)"}, {"kind": "method", "line": 226, "name": "test_content_rejects_non_printable", "signature": "def test_content_rejects_non_printable(self)"}, {"kind": "method", "line": 230, "name": "test_timeout_clamped", "signature": "def test_timeout_clamped(self)"}, {"kind": "method", "line": 234, "name": "test_write_rejects_line_too_long", "signature": "def test_write_rejects_line_too_long(self)"}, {"kind": "method", "line": 243, "name": "test_write_rejects_too_many_lines", "signature": "def test_write_rejects_too_many_lines(self)"}, {"kind": "method", "line": 256, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 261, "name": "test_bounds", "signature": "def test_bounds(self)"}, {"kind": "method", "line": 268, "name": "test_find_and_total", "signature": "def test_find_and_total(self)"}, {"kind": "method", "line": 275, "name": "test_cursor_prevents_stale_match", "signature": "def test_cursor_prevents_stale_match(self)"}, {"kind": "method", "line": 284, "name": "test_wait_for_any_earliest", "signature": "def test_wait_for_any_earliest(self)"}, {"kind": "method", "line": 292, "name": "test_cat_body_drops_console_framing", "signature": "def test_cat_body_drops_console_framing(self)"}, {"kind": "method", "line": 298, "name": "test_editor_prompt_forms_cover_kernel_markers", "signature": "def test_editor_prompt_forms_cover_kernel_markers(self)"}, {"kind": "method", "line": 315, "name": "guard_server", "signature": "def guard_server(cls)"}, {"kind": "method", "line": 336, "name": "setUp", "signature": "def setUp(self)"}, {"kind": "method", "line": 344, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 351, "name": "tearDownClass", "signature": "def tearDownClass(cls)"}, {"kind": "method", "line": 355, "name": "test_t01_boot", "signature": "def test_t01_boot(self)"}, {"kind": "method", "line": 365, "name": "test_t02_expect", "signature": "def test_t02_expect(self)"}, {"kind": "method", "line": 372, "name": "test_t03_write_and_cat", "signature": "def test_t03_write_and_cat(self)"}, {"kind": "method", "line": 382, "name": "test_t04_toolchain_elf", "signature": "def test_t04_toolchain_elf(self)"}, {"kind": "method", "line": 394, "name": "test_t05_toolchain_cvm", "signature": "def test_t05_toolchain_cvm(self)"}, {"kind": "method", "line": 404, "name": "test_t06_selfhosted_compiler", "signature": "def test_t06_selfhosted_compiler(self)"}, {"kind": "method", "line": 411, "name": "test_t07_bin_command_path", "signature": "def test_t07_bin_command_path(self)"}, {"kind": "method", "line": 419, "name": "test_t08_python_script", "signature": "def test_t08_python_script(self)"}, {"kind": "method", "line": 426, "name": "test_t09_py_eval", "signature": "def test_t09_py_eval(self)"}, {"kind": "method", "line": 431, "name": "test_t10_minios_test", "signature": "def test_t10_minios_test(self)"}, {"kind": "method", "line": 452, "name": "test_t11_poweroff_and_reboot", "signature": "def test_t11_poweroff_and_reboot(self)"}, {"kind": "method", "line": 482, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 492, "name": "test_parse_valid", "signature": "def test_parse_valid(self)"}, {"kind": "method", "line": 502, "name": "test_validate_accepts_valid", "signature": "def test_validate_accepts_valid(self)"}, {"kind": "method", "line": 506, "name": "test_unknown_key_rejected", "signature": "def test_unknown_key_rejected(self)"}, {"kind": "method", "line": 510, "name": "test_bad_indent_rejected", "signature": "def test_bad_indent_rejected(self)"}, {"kind": "method", "line": 514, "name": "test_validate_rejects_bad_dst", "signature": "def test_validate_rejects_bad_dst(self)"}, {"kind": "method", "line": 519, "name": "test_validate_rejects_missing_name", "signature": "def test_validate_rejects_missing_name(self)"}, {"kind": "method", "line": 523, "name": "test_validate_rejects_long_build_line", "signature": "def test_validate_rejects_long_build_line(self)"}, {"kind": "method", "line": 531, "name": "test_validate_rejects_control_chars", "signature": "def test_validate_rejects_control_chars(self)"}, {"kind": "method", "line": 536, "name": "test_validate_rejects_empty_files", "signature": "def test_validate_rejects_empty_files(self)"}, {"kind": "method", "line": 541, "name": "test_host_kind_accepts_empty_files", "signature": "def test_host_kind_accepts_empty_files(self)"}, {"kind": "method", "line": 556, "name": "test_reference_kind_carries_nothing", "signature": "def test_reference_kind_carries_nothing(self)"}, {"kind": "method", "line": 564, "name": "test_bad_kind_rejected", "signature": "def test_bad_kind_rejected(self)"}, {"kind": "method", "line": 572, "name": "test_host_kind_requires_artifact", "signature": "def test_host_kind_requires_artifact(self)"}, {"kind": "method", "line": 586, "name": "test_install_refuses_host_before_touching_session", "signature": "def test_install_refuses_host_before_touching_session(self)"}, {"kind": "method", "line": 604, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 614, "name": "test_split_for_editor_chunks", "signature": "def test_split_for_editor_chunks(self)"}, {"kind": "method", "line": 621, "name": "test_split_rejects_long_line", "signature": "def test_split_rejects_long_line(self)"}, {"kind": "method", "line": 625, "name": "test_split_rejects_non_ascii", "signature": "def test_split_rejects_non_ascii(self)"}, {"kind": "method", "line": 629, "name": "test_exit_code_of", "signature": "def test_exit_code_of(self)"}, {"kind": "method", "line": 634, "name": "test_state_roundtrip", "signature": "def test_state_roundtrip(self)"}, {"kind": "method", "line": 645, "name": "__init__", "signature": "def __init__(self, exit_codes)"}, {"kind": "method", "line": 652, "name": "booted", "signature": "def booted(self)"}, {"kind": "method", "line": 655, "name": "boot", "signature": "def boot(self, timeout_ms)"}, {"kind": "method", "line": 659, "name": "write", "signature": "def write(self, path, content)"}, {"kind": "method", "line": 666, "name": "send", "signature": "def send(self, line, timeout_ms)"}, {"kind": "method", "line": 690, "name": "cat_body", "signature": "def cat_body(self, path, missing_ok)"}, {"kind": "class", "line": 697, "name": "_toolerror", "signature": "class _toolerror(Exception)"}, {"kind": "method", "line": 702, "name": "_cleanup_parts", "signature": "def _cleanup_parts(self, parts)"}, {"kind": "method", "line": 710, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 742, "name": "tearDownClass", "signature": "def tearDownClass(cls)"}, {"kind": "method", "line": 747, "name": "make_addon", "signature": "def make_addon(self)"}, {"kind": "method", "line": 769, "name": "test_install_success", "signature": "def test_install_success(self)"}, {"kind": "method", "line": 782, "name": "test_install_mismatch_aborts_and_cleans", "signature": "def test_install_mismatch_aborts_and_cleans(self)"}, {"kind": "method", "line": 796, "name": "test_install_multi_chunk_reassembly", "signature": "def test_install_multi_chunk_reassembly(self)"}, {"kind": "method", "line": 828, "name": "test_install_verify_failure_aborts", "signature": "def test_install_verify_failure_aborts(self)"}, {"kind": "method", "line": 835, "name": "test_install_build_failure_aborts", "signature": "def test_install_build_failure_aborts(self)"}, {"kind": "method", "line": 848, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 886, "name": "tearDownClass", "signature": "def tearDownClass(cls)"}, {"kind": "method", "line": 894, "name": "test_addons_list", "signature": "def test_addons_list(self)"}, {"kind": "method", "line": 900, "name": "test_install_fixture", "signature": "def test_install_fixture(self)"}, {"kind": "method", "line": 909, "name": "test_install_unknown_addon_fails", "signature": "def test_install_unknown_addon_fails(self)"}, {"kind": "function", "line": 318, "name": "guarded", "signature": "def guarded(name, params)"}, {"kind": "function", "line": 786, "name": "broken_cat", "signature": "def broken_cat(path, missing_ok)"}]}, {"doc": "MiniOS network stack: virtio-net preferred, rtl8139 fallback, under", "id": "net/net.c", "kind": "module", "label": "net.c", "language": "c", "sha256": "ce85b9578c460f45", "symbol_count": 157, "symbols": [{"kind": "struct", "line": 95, "name": "net_arp_entry"}, {"kind": "struct", "line": 221, "name": "net_dns_state"}, {"kind": "struct", "line": 408, "name": "net_tcp_sock"}, {"doc": "int           tx_pending; unsigned char tx_buf[NET_TX_MAX]; unsigned int  tx_len; unsigned int  tx_seq; /* Linux socket ABI state (docs/spec/network.md). int           nonblock;   /* O_NONBLOCK on the socket int           cloexec;    /* FD_CLOEXEC as recorded by fcntl/SOCK_CLOEXEC int           connecting; /* a non-blocking connect is in flight int           so_error;   /* pending error for SO_ERROR (positive errno) unsigned long syn_deadline; unsigned long syn_retry; }; /* One received datagram.", "kind": "struct", "line": 437, "name": "net_udp_dgram"}, {"doc": "int           so_error;   /* pending error for SO_ERROR (positive errno) unsigned long syn_deadline; unsigned long syn_retry; }; /* One received datagram. struct net_udp_dgram { unsigned short len; unsigned short sport; unsigned char  sip[4]; unsigned char  data[NET_UDP_DGRAM_MAX]; }; /* Datagram socket: a bounded ring of received datagrams.", "kind": "struct", "line": 445, "name": "net_udp_sock"}, {"kind": "function", "line": 38, "name": "net_drv_send", "signature": "static int net_drv_send(const unsigned char *frame, unsigned len)"}, {"kind": "function", "line": 43, "name": "net_drv_poll", "signature": "static void net_drv_poll(void)"}, {"kind": "function", "line": 48, "name": "net_drv_present", "signature": "static int net_drv_present(void)"}, {"kind": "function", "line": 57, "name": "net_put16", "signature": "static void net_put16(unsigned char *p, unsigned short v)"}, {"kind": "function", "line": 62, "name": "net_put32", "signature": "static void net_put32(unsigned char *p, unsigned int v)"}, {"kind": "function", "line": 69, "name": "net_get16", "signature": "static unsigned short net_get16(const unsigned char *p)"}, {"kind": "function", "line": 73, "name": "net_get32", "signature": "static unsigned int net_get32(const unsigned char *p)"}, {"kind": "function", "line": 78, "name": "net_checksum", "signature": "static unsigned short net_checksum(const void *data, unsigned len)"}, {"kind": "function", "line": 103, "name": "net_arp_store", "signature": "static void net_arp_store(const unsigned char *ip, const unsigned char *mac)"}, {"kind": "function", "line": 118, "name": "net_arp_lookup", "signature": "static int net_arp_lookup(const unsigned char *ip, unsigned char *mac_out)"}, {"kind": "function", "line": 129, "name": "net_arp_request", "signature": "static void net_arp_request(const unsigned char *ip)"}, {"doc": "kmemcpy(frame + 6, net_mac, NET_ETH_ALEN); net_put16(frame + 12, NET_ETHERTYPE_ARP); net_put16(frame + 14, 1);                 /* ethernet net_put16(frame + 16, 0x0800);            /* IPv4 frame[18] = 6; frame[19] = 4; net_put16(frame + 20, NET_ARP_REQUEST); kmemcpy(frame + 22, net_mac, NET_ETH_ALEN); kmemcpy(frame + 28, net_our_ip, 4); kmemcpy(frame + 38, ip, 4); net_drv_send(frame, 42); } /* Resolve an IP on the 10.0.2.0/24 link. Retries, bounded timeout.", "kind": "function", "line": 147, "name": "net_arp_resolve", "signature": "static int net_arp_resolve(const unsigned char *ip, unsigned char *mac_out)"}, {"doc": "================================================================ IPv4 / ICMP / UDP / DNS * ================================================================ static unsigned short net_ip_id; static unsigned short net_icmp_id = 0x4D49; static unsigned short net_udp_port = NET_EPHEMERAL_MIN; static unsigned int   net_tx_bytes; static unsigned int   net_rx_bytes; /* Send a frame on the link: dst IP decides the destination MAC.", "kind": "function", "line": 172, "name": "net_ip_send", "signature": "static int net_ip_send(const unsigned char *dip, unsigned char proto,\n                       cons..."}, {"kind": "function", "line": 208, "name": "net_udp_send", "signature": "static int net_udp_send(const unsigned char *dip, unsigned short sport,\n                        u..."}, {"doc": "net_put16(pkt + 6, 0);                    /* checksum optional for UDP kmemcpy(pkt + 8, data, len); return net_ip_send(dip, NET_PROTO_UDP, pkt, total); } struct net_dns_state { unsigned short id; unsigned char  ip[4]; int            done; }; static struct net_dns_state net_dns; /* Parse a DNS response for the first A record.", "kind": "function", "line": 230, "name": "net_dns_parse", "signature": "static void net_dns_parse(const unsigned char *data, unsigned len)"}, {"doc": "rtype = net_get16(data + pos); rdlen = net_get16(data + pos + 8); pos += 10; if (pos + rdlen > len) return; if (rtype == 1 && rdlen == 4) { kmemcpy(net_dns.ip, data + pos, 4); net_dns.done = 1; return; } pos += rdlen; } } /* Blocking A-record lookup against NET_DNS.", "kind": "function", "line": 268, "name": "net_dns_resolve", "signature": "static int net_dns_resolve(const char *host, unsigned char ip_out[4])"}, {"kind": "function", "line": 329, "name": "net_udp_send", "signature": "net_udp_send((const unsigned char[])"}, {"kind": "function", "line": 348, "name": "net_icmp_rx", "signature": "static void net_icmp_rx(const unsigned char *ip, unsigned len)"}, {"kind": "function", "line": 377, "name": "net_ping", "signature": "static int net_ping(const unsigned char ip[4])"}, {"kind": "function", "line": 469, "name": "net_sock_alloc", "signature": "static struct net_tcp_sock *net_sock_alloc(void)"}, {"kind": "function", "line": 484, "name": "net_sock_index", "signature": "static int net_sock_index(const struct net_tcp_sock *s)"}, {"doc": "} } return 0; } static int net_sock_index(const struct net_tcp_sock *s) { int i; if (!net_sockets) return -1; for (i = 0; i < NET_SOCKETS; i++) if (&net_sockets[i] == s) return i; return -1; } /* Compute the TCP checksum over a pseudo header + segment.", "kind": "function", "line": 493, "name": "net_tcp_checksum", "signature": "static unsigned short net_tcp_checksum(const unsigned char *src, const unsigned char *dst,\n      ..."}, {"doc": "const unsigned char *seg, unsigned len) { unsigned char buf[NET_TX_MAX + 12]; unsigned total = 12 + len; kmemcpy(buf, src, 4); kmemcpy(buf + 4, dst, 4); buf[8] = 0; buf[9] = NET_PROTO_TCP; net_put16(buf + 10, (unsigned short)len); kmemcpy(buf + 12, seg, len); if (total & 1) buf[total++] = 0; return net_checksum(buf, total); } /* UDP checksum over pseudo header + datagram (may be 0 = not computed).", "kind": "function", "line": 509, "name": "net_udp_checksum_ok", "signature": "static int net_udp_checksum_ok(const unsigned char *src, const unsigned char *dst,\n              ..."}, {"kind": "function", "line": 525, "name": "net_tcp_xmit", "signature": "static int net_tcp_xmit(struct net_tcp_sock *s, unsigned flags,\n                        const uns..."}, {"kind": "function", "line": 559, "name": "net_tcp_rx", "signature": "static void net_tcp_rx(const unsigned char *ip, unsigned len)"}, {"doc": "Passive open: park a SYN_RCVD child on a LISTEN socket and answer SYN-ACK. Single backlog slot: a second SYN while one pends is dropped (the peer retransmits), never queued unbounded. The SYN-ACK transmit fails closed without an ARP entry; the peer's SYN retry * replays it once the entry resolves.", "kind": "function", "line": 687, "name": "net_tcp_passive_open", "signature": "static int net_tcp_passive_open(struct net_tcp_sock *ls,\n        const unsigned char peer[4], uns..."}, {"doc": "kmemcpy(c->dip, peer, 4); c->dport = pport; c->sport = lport; c->seq = net_tcp_seq; net_tcp_seq += 0x1000; c->rx_next = pseq + 1; c->ack = pseq + 1; c->state = NET_TCP_SYN_RCVD; net_tcp_xmit(c, 0x12, 0, 0, 1); ls->pending = idx; return 1; } /* Blocking connect of an allocated socket to an IPv4 address.", "kind": "function", "line": 711, "name": "net_tcp_connect_into", "signature": "static int net_tcp_connect_into(struct net_tcp_sock *s, const unsigned char ip[4],\n              ..."}, {"doc": "unsigned long retry = net_time_ms() + NET_RETRY_MS; while (net_time_ms() < retry && s->state == NET_TCP_SYN_SENT) net_drv_poll(); if (s->state == NET_TCP_SYN_SENT) net_tcp_xmit(s, 0x02, 0, 0, 0); } if (s->state != NET_TCP_ESTABLISHED) { s->in_use = 0; s->state = NET_TCP_CLOSED; return 0; } return 1; } /* Blocking send (stop-and-wait, one outstanding segment).", "kind": "function", "line": 738, "name": "net_tcp_send", "signature": "static int net_tcp_send(struct net_tcp_sock *s, const char *buf, int len)"}, {"doc": "net_time_ms() < deadline) { unsigned long retry = net_time_ms() + NET_RETRY_MS; while (net_time_ms() < retry && s->tx_pending) net_drv_poll(); if (s->tx_pending) net_tcp_xmit(s, 0x18, s->tx_buf, chunk, 0); } if (s->tx_pending || s->state != NET_TCP_ESTABLISHED) return sent ? sent : -1; buf += chunk; len -= (int)chunk; sent += (int)chunk; } return sent; } /* Blocking receive; 0 = EOF (FIN).", "kind": "function", "line": 764, "name": "net_tcp_recv", "signature": "static int net_tcp_recv(struct net_tcp_sock *s, char *buf, int len)"}, {"kind": "function", "line": 802, "name": "net_tcp_close", "signature": "static void net_tcp_close(struct net_tcp_sock *s)"}, {"kind": "function", "line": 822, "name": "net_rx_handle_frame", "signature": "void net_rx_handle_frame(const unsigned char *frame, unsigned len)"}, {"kind": "function", "line": 886, "name": "net_open", "signature": "int net_open(void)"}, {"kind": "function", "line": 892, "name": "net_connect", "signature": "int net_connect(const char *host, unsigned short port)"}, {"kind": "function", "line": 901, "name": "net_send", "signature": "int net_send(int fd, const char *buf, int len)"}, {"kind": "function", "line": 906, "name": "net_recv", "signature": "int net_recv(int fd, char *buf, int len)"}, {"kind": "function", "line": 911, "name": "net_recv_timeout", "signature": "int net_recv_timeout(int fd, char *buf, int len, unsigned long timeout_ms)"}, {"kind": "function", "line": 916, "name": "net_close", "signature": "void net_close(int fd)"}, {"doc": "Docstring: Allocate a socket bound to a local port and listening. * Returns the socket index, or -1 when the table is full.", "kind": "function", "line": 927, "name": "net_listen", "signature": "int net_listen(unsigned short port)"}, {"doc": "Docstring: Take a pending child off a LISTEN socket without waiting. Returns the child index, or -1 when no handshake has * completed yet. The child is ESTABLISHED and owned by the caller.", "kind": "function", "line": 942, "name": "net_accept_nb", "signature": "int net_accept_nb(int fd)"}, {"kind": "function", "line": 959, "name": "polling", "signature": "* without polling (the peer's ACK arrives through the driver poll). */\nint net_accept(int fd, uns..."}, {"doc": "Docstring: Socket state for diagnostics (the `net` builtin and the * httpd selftest). -1 on a wild fd.", "kind": "function", "line": 976, "name": "net_sock_state", "signature": "int net_sock_state(int fd)"}, {"kind": "function", "line": 1096, "name": "net_fd_udp", "signature": "static int net_fd_udp(long fd)"}, {"kind": "function", "line": 1102, "name": "net_sys_is_socket", "signature": "int net_sys_is_socket(long fd)"}, {"kind": "function", "line": 1106, "name": "net_udp_alloc", "signature": "static struct net_udp_sock *net_udp_alloc(void)"}, {"doc": "static struct net_udp_sock *net_udp_alloc(void) { int i; if (!net_udp_sockets) return 0; for (i = 0; i < NET_UDP_SOCKETS; i++) { if (!net_udp_sockets[i].in_use) { kmemset(&net_udp_sockets[i], 0, sizeof(net_udp_sockets[i])); net_udp_sockets[i].in_use = 1; return &net_udp_sockets[i]; } } return 0; } /* Next free datagram port in the user ephemeral range.", "kind": "function", "line": 1120, "name": "net_udp_ephemeral", "signature": "static unsigned short net_udp_ephemeral(void)"}, {"doc": "Queue a received datagram on the user socket bound to dport (and, when connected, from that peer only). 1 when a socket owned the port (full * queues drop the datagram, like a full Linux receive buffer).", "kind": "function", "line": 1136, "name": "net_udp_deliver", "signature": "static int net_udp_deliver(const unsigned char sip[4], unsigned short sport,\n                    ..."}, {"kind": "function", "line": 1158, "name": "net_put_sockaddr", "signature": "static void net_put_sockaddr(unsigned char *sa, const unsigned char ip[4], unsigned short port)"}, {"doc": "Store a sockaddr_in at a user address with a user socklen_t length * pointer, truncating like Linux and reporting the full length.", "kind": "function", "line": 1168, "name": "net_store_sockaddr", "signature": "static long net_store_sockaddr(long addr, long lenp, const unsigned char ip[4],\n                 ..."}, {"doc": "int len; if (!addr || !lenp) return 0; if (!user_range_ok((unsigned long)lenp, sizeof(int))) return -LNX_EFAULT; len = *(int *)lenp; if (len < 0) return -LNX_EINVAL; if (len > NET_SOCKADDR_IN_LEN) len = NET_SOCKADDR_IN_LEN; if (len > 0 && !user_range_ok((unsigned long)addr, (unsigned long)len)) return -LNX_EFAULT; net_put_sockaddr(sa, ip, port); kmemcpy((void *)addr, sa, (unsigned long)len); (int *)lenp = NET_SOCKADDR_IN_LEN; return 0; } /* Read a user sockaddr_in (AF_INET, at least 16 bytes).", "kind": "function", "line": 1185, "name": "net_load_sockaddr", "signature": "static long net_load_sockaddr(long addr, long len, unsigned char ip[4], unsigned short *port)"}, {"kind": "function", "line": 1222, "name": "net_sys_socket", "signature": "long net_sys_socket(long a1, long a2, long a3)"}, {"kind": "function", "line": 1249, "name": "net_sys_connect", "signature": "long net_sys_connect(long fd, long sockaddr, long addrlen)"}, {"kind": "function", "line": 1296, "name": "net_sys_bind", "signature": "long net_sys_bind(long fd, long sockaddr, long addrlen)"}, {"kind": "function", "line": 1318, "name": "net_sys_listen", "signature": "long net_sys_listen(long fd, long backlog)"}, {"kind": "function", "line": 1329, "name": "net_sys_accept", "signature": "long net_sys_accept(long fd, long sockaddr, long addrlen)"}, {"doc": "Send len validated bytes: a stream sends synchronously (stop-and-wait), * a datagram goes out as one UDP datagram to `to` or the connected peer.", "kind": "function", "line": 1347, "name": "net_send_bytes", "signature": "static long net_send_bytes(long fd, const unsigned char *buf, long len,\n                         ..."}, {"kind": "function", "line": 1375, "name": "net_sys_sendto", "signature": "long net_sys_sendto(long fd, long buf, long len, long flags, long to, long tolen)"}, {"kind": "function", "line": 1390, "name": "net_sys_recvfrom", "signature": "long net_sys_recvfrom(long fd, long buf, long len, long flags, long from, long fromlen)"}, {"doc": "long rc = net_store_sockaddr(from, fromlen, s->dip, s->dport); if (rc) return rc; } return (long)take; } if (s->rx_eof || s->state == NET_TCP_DEAD) return 0; if (!s->connecting && s->state != NET_TCP_ESTABLISHED) return -LNX_ENOTCONN; if (nonblock) return -LNX_EAGAIN; yield(); } } } /* Gather one msghdr's iovecs (validated) into kbuf, at most cap bytes.", "kind": "function", "line": 1450, "name": "net_gather_msg", "signature": "static long net_gather_msg(long msg, unsigned char *kbuf, long cap)"}, {"kind": "function", "line": 1470, "name": "net_sys_sendmsg", "signature": "long net_sys_sendmsg(long fd, long msg, long flags)"}, {"doc": "sendmmsg (307): glibc's resolver sends its A and AAAA queries together and treats ENOSYS as a failed lookup. Returns the messages sent, storing * each one's byte count in msg_len; an error on the first is returned.", "kind": "function", "line": 1498, "name": "net_sys_sendmmsg", "signature": "long net_sys_sendmmsg(long fd, long vec, long vlen, long flags)"}, {"kind": "function", "line": 1514, "name": "net_sys_shutdown", "signature": "long net_sys_shutdown(long fd, long how)"}, {"kind": "function", "line": 1523, "name": "net_sys_close", "signature": "long net_sys_close(long fd)"}, {"kind": "function", "line": 1534, "name": "net_sys_setsockopt", "signature": "long net_sys_setsockopt(long fd, long level, long name, long val, long len)"}, {"kind": "function", "line": 1569, "name": "net_sys_getsockopt", "signature": "long net_sys_getsockopt(long fd, long level, long name, long val, long lenp)"}, {"kind": "function", "line": 1616, "name": "net_sys_getsockname", "signature": "long net_sys_getsockname(long fd, long addr, long lenp)"}, {"kind": "function", "line": 1625, "name": "net_sys_getpeername", "signature": "long net_sys_getpeername(long fd, long addr, long lenp)"}, {"doc": "fcntl on a socket: O_NONBLOCK through F_GETFL/F_SETFL, FD_CLOEXEC recorded through F_GETFD/F_SETFD (sockets live in one table shared by * fork, so execve keeps them; docs/spec/network.md).", "kind": "function", "line": 1643, "name": "net_sys_fcntl", "signature": "long net_sys_fcntl(long fd, long cmd, long arg)"}, {"doc": "ioctl on a socket: FIONREAD answers the bytes a read would return now (a stream's buffered bytes, the size of a datagram socket's next datagram), FIONBIO sets O_NONBLOCK from the int at arg, FIOCLEX and FIONCLEX record FD_CLOEXEC; terminal and every other request is ENOTTY, * as Linux answers it for a socket. arg is validated by the caller.", "kind": "function", "line": 1674, "name": "net_sys_ioctl", "signature": "long net_sys_ioctl(long fd, long req, long arg)"}, {"doc": "return 0; } } else { return -LNX_EBADF; } switch (req) { case LNX_FIONBIO: *nb = *(const int *)arg != 0; return 0; case LNX_FIOCLEX: *ce = 1; return 0; case LNX_FIONCLEX: *ce = 0; return 0; default: return -LNX_ENOTTY; } } /* poll(2) readiness of a socket descriptor.", "kind": "function", "line": 1707, "name": "net_socket_revents", "signature": "static unsigned short net_socket_revents(long fd)"}, {"kind": "function", "line": 1727, "name": "net_sys_poll", "signature": "long net_sys_poll(long fds, long nfds, long timeout_ms)"}, {"doc": "MiniOS syscall 200: resolve a hostname, returned as a network-order * 32-bit address (like inet_addr), or -1 on failure.", "kind": "function", "line": 1767, "name": "net_sys_dns", "signature": "long net_sys_dns(long host)"}, {"kind": "function", "line": 1778, "name": "net_parse_ip", "signature": "static int net_parse_ip(const char *text, unsigned char ip[4])"}, {"kind": "function", "line": 1803, "name": "net_cmd_status", "signature": "void net_cmd_status(void)"}, {"doc": "kprintf(\"virtio-net iobase 0x%x\\n\", vnet_iobase()); } else { rtl_counters(&tx_frames, &rx_frames); kprintf(\"rtl8139  iobase 0x%x\\n\", rtl_iobase()); } kprintf(\"mac      %02x:%02x:%02x:%02x:%02x:%02x\\n\", net_mac[0], net_mac[1], net_mac[2], net_mac[3], net_mac[4], net_mac[5]); kprintf(\"ip       %u.%u.%u.%u/24\\n\", net_our_ip[0], net_our_ip[1], net_our_ip[2], net_our_ip[3]); vga_puts(\"gateway  10.0.2.2  dns 10.0.2.3\\n\"); kprintf(\"tx       %u frames, %u bytes\\n\", tx_frames, net_tx_bytes); kprintf(\"rx       %u frames, %u bytes, %u dropped, %u v6 dropped\\n\", rx_frames, net_rx_bytes, net_rx_dropped, net6_rx_dropped); } /** Docstring: Copy the station MAC and IP out for status screens.", "kind": "function", "line": 1825, "name": "net_get_addrs", "signature": "void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4])"}, {"kind": "function", "line": 1831, "name": "net_cmd_ping", "signature": "void net_cmd_ping(const char *ip_text)"}, {"kind": "function", "line": 1842, "name": "net_cmd_dns", "signature": "void net_cmd_dns(const char *host)"}, {"kind": "function", "line": 1855, "name": "net_register_symbols", "signature": "void net_register_symbols(void)"}, {"kind": "function", "line": 1863, "name": "net_init", "signature": "void net_init(void)"}, {"kind": "macro", "line": 400, "name": "NET_TCP_CLOSED", "signature": "#define NET_TCP_CLOSED"}, {"kind": "macro", "line": 401, "name": "NET_TCP_SYN_SENT", "signature": "#define NET_TCP_SYN_SENT"}, {"kind": "macro", "line": 402, "name": "NET_TCP_ESTABLISHED", "signature": "#define NET_TCP_ESTABLISHED"}, {"kind": "macro", "line": 403, "name": "NET_TCP_FIN_SENT", "signature": "#define NET_TCP_FIN_SENT"}, {"kind": "macro", "line": 404, "name": "NET_TCP_DEAD", "signature": "#define NET_TCP_DEAD"}, {"kind": "macro", "line": 405, "name": "NET_TCP_LISTEN", "signature": "#define NET_TCP_LISTEN"}, {"kind": "macro", "line": 406, "name": "NET_TCP_SYN_RCVD", "signature": "#define NET_TCP_SYN_RCVD"}, {"kind": "macro", "line": 1028, "name": "LNX_AF_INET", "signature": "#define LNX_AF_INET"}, {"kind": "macro", "line": 1029, "name": "LNX_SOCK_STREAM", "signature": "#define LNX_SOCK_STREAM"}, {"kind": "macro", "line": 1030, "name": "LNX_SOCK_DGRAM", "signature": "#define LNX_SOCK_DGRAM"}, {"kind": "macro", "line": 1031, "name": "LNX_SOCK_TYPE_MASK", "signature": "#define LNX_SOCK_TYPE_MASK"}, {"kind": "macro", "line": 1032, "name": "LNX_SOCK_NONBLOCK", "signature": "#define LNX_SOCK_NONBLOCK"}, {"kind": "macro", "line": 1033, "name": "LNX_SOCK_CLOEXEC", "signature": "#define LNX_SOCK_CLOEXEC"}, {"kind": "macro", "line": 1034, "name": "LNX_IPPROTO_TCP", "signature": "#define LNX_IPPROTO_TCP"}, {"kind": "macro", "line": 1035, "name": "LNX_IPPROTO_UDP", "signature": "#define LNX_IPPROTO_UDP"}, {"kind": "macro", "line": 1036, "name": "LNX_MSG_PEEK", "signature": "#define LNX_MSG_PEEK"}, {"kind": "macro", "line": 1037, "name": "LNX_MSG_DONTWAIT", "signature": "#define LNX_MSG_DONTWAIT"}, {"kind": "macro", "line": 1038, "name": "LNX_MSG_NOSIGNAL", "signature": "#define LNX_MSG_NOSIGNAL"}, {"kind": "macro", "line": 1039, "name": "LNX_SOL_SOCKET", "signature": "#define LNX_SOL_SOCKET"}, {"kind": "macro", "line": 1040, "name": "LNX_SO_REUSEADDR", "signature": "#define LNX_SO_REUSEADDR"}, {"kind": "macro", "line": 1041, "name": "LNX_SO_TYPE", "signature": "#define LNX_SO_TYPE"}, {"kind": "macro", "line": 1042, "name": "LNX_SO_ERROR", "signature": "#define LNX_SO_ERROR"}, {"kind": "macro", "line": 1043, "name": "LNX_SO_SNDBUF", "signature": "#define LNX_SO_SNDBUF"}, {"kind": "macro", "line": 1044, "name": "LNX_SO_RCVBUF", "signature": "#define LNX_SO_RCVBUF"}, {"kind": "macro", "line": 1045, "name": "LNX_SO_KEEPALIVE", "signature": "#define LNX_SO_KEEPALIVE"}, {"kind": "macro", "line": 1046, "name": "LNX_SO_LINGER", "signature": "#define LNX_SO_LINGER"}, {"kind": "macro", "line": 1047, "name": "LNX_SO_RCVTIMEO", "signature": "#define LNX_SO_RCVTIMEO"}, {"kind": "macro", "line": 1048, "name": "LNX_SO_SNDTIMEO", "signature": "#define LNX_SO_SNDTIMEO"}, {"kind": "macro", "line": 1049, "name": "LNX_IPPROTO_IP", "signature": "#define LNX_IPPROTO_IP"}, {"kind": "macro", "line": 1050, "name": "LNX_IP_TOS", "signature": "#define LNX_IP_TOS"}, {"kind": "macro", "line": 1051, "name": "LNX_IP_TTL", "signature": "#define LNX_IP_TTL"}, {"kind": "macro", "line": 1052, "name": "LNX_IP_MTU_DISCOVER", "signature": "#define LNX_IP_MTU_DISCOVER"}, {"kind": "macro", "line": 1053, "name": "LNX_IP_RECVERR", "signature": "#define LNX_IP_RECVERR"}, {"kind": "macro", "line": 1054, "name": "NET_IP_DEFAULT_TTL", "signature": "#define NET_IP_DEFAULT_TTL"}, {"kind": "macro", "line": 1055, "name": "LNX_TCP_NODELAY", "signature": "#define LNX_TCP_NODELAY"}, {"kind": "macro", "line": 1056, "name": "LNX_TCP_KEEPIDLE", "signature": "#define LNX_TCP_KEEPIDLE"}, {"kind": "macro", "line": 1057, "name": "LNX_TCP_KEEPINTVL", "signature": "#define LNX_TCP_KEEPINTVL"}, {"kind": "macro", "line": 1058, "name": "LNX_TCP_KEEPCNT", "signature": "#define LNX_TCP_KEEPCNT"}, {"kind": "macro", "line": 1059, "name": "LNX_O_RDWR", "signature": "#define LNX_O_RDWR"}, {"kind": "macro", "line": 1060, "name": "LNX_O_NONBLOCK", "signature": "#define LNX_O_NONBLOCK"}, {"kind": "macro", "line": 1061, "name": "LNX_FD_CLOEXEC", "signature": "#define LNX_FD_CLOEXEC"}, {"kind": "macro", "line": 1062, "name": "LNX_F_GETFD", "signature": "#define LNX_F_GETFD"}, {"kind": "macro", "line": 1063, "name": "LNX_F_SETFD", "signature": "#define LNX_F_SETFD"}, {"kind": "macro", "line": 1064, "name": "LNX_F_GETFL", "signature": "#define LNX_F_GETFL"}, {"kind": "macro", "line": 1065, "name": "LNX_F_SETFL", "signature": "#define LNX_F_SETFL"}, {"kind": "macro", "line": 1066, "name": "LNX_POLLIN", "signature": "#define LNX_POLLIN"}, {"kind": "macro", "line": 1067, "name": "LNX_POLLOUT", "signature": "#define LNX_POLLOUT"}, {"kind": "macro", "line": 1068, "name": "LNX_POLLERR", "signature": "#define LNX_POLLERR"}, {"kind": "macro", "line": 1069, "name": "LNX_POLLHUP", "signature": "#define LNX_POLLHUP"}, {"kind": "macro", "line": 1070, "name": "LNX_POLLNVAL", "signature": "#define LNX_POLLNVAL"}, {"kind": "macro", "line": 1071, "name": "LNX_EBADF", "signature": "#define LNX_EBADF"}, {"kind": "macro", "line": 1072, "name": "LNX_EAGAIN", "signature": "#define LNX_EAGAIN"}, {"kind": "macro", "line": 1073, "name": "LNX_EFAULT", "signature": "#define LNX_EFAULT"}, {"kind": "macro", "line": 1074, "name": "LNX_EINVAL", "signature": "#define LNX_EINVAL"}, {"kind": "macro", "line": 1075, "name": "LNX_EPIPE", "signature": "#define LNX_EPIPE"}, {"kind": "macro", "line": 1076, "name": "LNX_EDESTADDRREQ", "signature": "#define LNX_EDESTADDRREQ"}, {"kind": "macro", "line": 1077, "name": "LNX_EMSGSIZE", "signature": "#define LNX_EMSGSIZE"}, {"kind": "macro", "line": 1078, "name": "LNX_ENOPROTOOPT", "signature": "#define LNX_ENOPROTOOPT"}, {"kind": "macro", "line": 1079, "name": "LNX_EPROTONOSUPPORT", "signature": "#define LNX_EPROTONOSUPPORT"}, {"kind": "macro", "line": 1080, "name": "LNX_EOPNOTSUPP", "signature": "#define LNX_EOPNOTSUPP"}, {"kind": "macro", "line": 1081, "name": "LNX_EAFNOSUPPORT", "signature": "#define LNX_EAFNOSUPPORT"}, {"kind": "macro", "line": 1082, "name": "LNX_EISCONN", "signature": "#define LNX_EISCONN"}, {"kind": "macro", "line": 1083, "name": "LNX_ENOTCONN", "signature": "#define LNX_ENOTCONN"}, {"kind": "macro", "line": 1084, "name": "LNX_ETIMEDOUT", "signature": "#define LNX_ETIMEDOUT"}, {"kind": "macro", "line": 1085, "name": "LNX_ECONNREFUSED", "signature": "#define LNX_ECONNREFUSED"}, {"kind": "macro", "line": 1086, "name": "LNX_EALREADY", "signature": "#define LNX_EALREADY"}, {"kind": "macro", "line": 1087, "name": "LNX_EINPROGRESS", "signature": "#define LNX_EINPROGRESS"}, {"kind": "macro", "line": 1088, "name": "NET_SEND_FLAGS_OK", "signature": "#define NET_SEND_FLAGS_OK"}, {"kind": "macro", "line": 1089, "name": "NET_RECV_FLAGS_OK", "signature": "#define NET_RECV_FLAGS_OK"}, {"kind": "macro", "line": 1663, "name": "LNX_FIONREAD", "signature": "#define LNX_FIONREAD"}, {"kind": "macro", "line": 1664, "name": "LNX_FIONBIO", "signature": "#define LNX_FIONBIO"}, {"kind": "macro", "line": 1665, "name": "LNX_FIONCLEX", "signature": "#define LNX_FIONCLEX"}, {"kind": "macro", "line": 1666, "name": "LNX_FIOCLEX", "signature": "#define LNX_FIOCLEX"}, {"kind": "macro", "line": 1667, "name": "LNX_ENOTTY", "signature": "#define LNX_ENOTTY"}]}, {"id": "net/rtl8139.c", "kind": "module", "label": "rtl8139.c", "language": "c", "sha256": "ff413b8bd6ba2684", "symbol_count": 29, "symbols": [{"doc": "Byte/word port I/O comes from kernel.h (outb/inb/outw/inw, same asm). * Only the dword pair stays local: the shared header has no outl/inl.", "kind": "function", "line": 29, "name": "outl_port", "signature": "static void outl_port(unsigned short port, unsigned int val)"}, {"kind": "function", "line": 33, "name": "inl_port", "signature": "static unsigned int inl_port(unsigned short port)"}, {"kind": "function", "line": 39, "name": "rtl_reg8", "signature": "static unsigned char rtl_reg8(unsigned short off)"}, {"kind": "function", "line": 40, "name": "rtl_reg8_w", "signature": "static void rtl_reg8_w(unsigned short off, unsigned char v)"}, {"kind": "function", "line": 41, "name": "rtl_reg16", "signature": "static unsigned short rtl_reg16(unsigned short off)"}, {"kind": "function", "line": 42, "name": "rtl_reg16_w", "signature": "static void rtl_reg16_w(unsigned short off, unsigned short v)"}, {"kind": "function", "line": 43, "name": "rtl_reg32", "signature": "static unsigned int rtl_reg32(unsigned short off)"}, {"kind": "function", "line": 44, "name": "rtl_reg32_w", "signature": "static void rtl_reg32_w(unsigned short off, unsigned int v)"}, {"doc": "PCI config space lives in drivers/pci.h now (shared with virtio-blk and future devices); only the dword port pair stays * local, passed in as callbacks.", "kind": "function", "line": 58, "name": "rtl_find", "signature": "static unsigned short rtl_find(void)"}, {"kind": "function", "line": 79, "name": "deleted", "signature": "* been deleted (a second base/per-ms pair beside ktime's is a second\n * clock, and drivers must n..."}, {"kind": "function", "line": 107, "name": "rtl_present", "signature": "int rtl_present(void)"}, {"kind": "function", "line": 111, "name": "rtl_reset", "signature": "static void rtl_reset(void)"}, {"kind": "function", "line": 120, "name": "rtl_init", "signature": "void rtl_init(void)"}, {"kind": "function", "line": 168, "name": "rtl_tx_wait", "signature": "static int rtl_tx_wait(unsigned slot, unsigned long deadline)"}, {"kind": "function", "line": 177, "name": "rtl_send", "signature": "int rtl_send(const unsigned char *frame, unsigned len)"}, {"kind": "function", "line": 205, "name": "rtl_get_mac", "signature": "void rtl_get_mac(unsigned char out[NET_ETH_ALEN])"}, {"kind": "function", "line": 210, "name": "rtl_iobase", "signature": "unsigned short rtl_iobase(void)"}, {"kind": "function", "line": 214, "name": "rtl_counters", "signature": "void rtl_counters(unsigned int *tx_frames, unsigned int *rx_frames)"}, {"kind": "function", "line": 238, "name": "rtl_poll", "signature": "void rtl_poll(void)"}, {"kind": "macro", "line": 46, "name": "RTL_REG_CR", "signature": "#define RTL_REG_CR"}, {"kind": "macro", "line": 47, "name": "RTL_REG_TSD0", "signature": "#define RTL_REG_TSD0"}, {"kind": "macro", "line": 48, "name": "RTL_REG_TSAD0", "signature": "#define RTL_REG_TSAD0"}, {"kind": "macro", "line": 49, "name": "RTL_REG_RBSTART", "signature": "#define RTL_REG_RBSTART"}, {"kind": "macro", "line": 50, "name": "RTL_REG_CAPR", "signature": "#define RTL_REG_CAPR"}, {"kind": "macro", "line": 51, "name": "RTL_REG_CBR", "signature": "#define RTL_REG_CBR"}, {"kind": "macro", "line": 52, "name": "RTL_REG_9346CR", "signature": "#define RTL_REG_9346CR"}, {"kind": "macro", "line": 53, "name": "RTL_REG_CONFIG1", "signature": "#define RTL_REG_CONFIG1"}, {"kind": "macro", "line": 99, "name": "RTL_MIN_FRAME", "signature": "#define RTL_MIN_FRAME"}, {"kind": "macro", "line": 166, "name": "RTL_TX_YIELD_EVERY", "signature": "#define RTL_TX_YIELD_EVERY"}]}, {"doc": "tls.c - TLS 1.2 client sessions for MiniOS.", "id": "net/tls.c", "kind": "module", "label": "tls.c", "language": "c", "sha256": "83cc284ef402cb42", "symbol_count": 27, "symbols": [{"kind": "function", "line": 25, "name": "tls_fail", "signature": "static void tls_fail(struct tls_session *s, const char *stage, const char *reason)"}, {"kind": "function", "line": 33, "name": "tls_fd_of", "signature": "static int tls_fd_of(const struct tls_session *s)"}, {"kind": "function", "line": 40, "name": "tls_free_fd", "signature": "void tls_free_fd(int fd)"}, {"doc": "Build the TLS 1.2 AEAD additional data: seq(8) || type || 0303 || * TLSCompressed.length (the plaintext length, RFC 5288 section 3).", "kind": "function", "line": 52, "name": "tls_aad", "signature": "static void tls_aad(unsigned char aad[13], int type, unsigned long long seq,\n                    ..."}, {"doc": "Send one record: header || nonce_explicit(8) || ciphertext || tag. The nonce_explicit is the sequence number (RFC 5288 allows it and * OpenSSL uses it); the nonce is salt || nonce_explicit.", "kind": "function", "line": 66, "name": "tls_send_record", "signature": "static int tls_send_record(struct tls_session *s, int type,\n                           const unsi..."}, {"doc": "for (i = 0; i < 8; i++) buf[5 + i] = (unsigned char)(s->cli_seq >> (56 - i * 8)); TLS_MEMCPY(nonce, s->cli_salt, 4); TLS_MEMCPY(nonce + 4, buf + 5, 8); if (aes128_gcm_seal_core(s->cli_key, nonce, aad, 13, payload, (unsigned)len, buf + 5 + 8, buf + 5 + 8 + len) != 0) return -1; s->cli_seq++; if (TLS_SEND(tls_fd_of(s), (const char *)buf, total) != total) return -1; return 0; } /* Send one plaintext record (ChangeCipherSpec is never encrypted).", "kind": "function", "line": 95, "name": "tls_send_raw_record", "signature": "static int tls_send_raw_record(struct tls_session *s, int type,\n                               co..."}, {"doc": "Read one record: header into s->rec_hdr, payload into s->rec. Returns: 1 = record ready, 0 = clean TCP EOF, -1 = torn record or bad header, -2 = timeout. A non-positive deadline blocks forever * (application-data reads behave like plain TCP).", "kind": "function", "line": 114, "name": "tls_read_record", "signature": "static int tls_read_record(struct tls_session *s, int fd, int deadline_ms)"}, {"kind": "function", "line": 173, "name": "exchange", "signature": "* key exchange (ClientHello, ClientKeyExchange) go out in plaintext\n * records, as TLS 1.2 requir..."}, {"doc": "const unsigned char *body, int len) { if (len < 0 || len > 1024) return -1; s->pt[0] = (unsigned char)type; s->pt[1] = (unsigned char)(len >> 16); s->pt[2] = (unsigned char)(len >> 8); s->pt[3] = (unsigned char)len; TLS_MEMCPY(s->pt + 4, body, (unsigned)len); sha256_update(&s->hs_hash, s->pt, (unsigned)(len + 4)); if (!s->keys_ready) return tls_send_raw_record(s, TLS_CT_HANDSHAKE, s->pt, len + 4); return tls_send_record(s, TLS_CT_HANDSHAKE, s->pt, len + 4); } /* ClientHello body (without the handshake header). Returns length.", "kind": "function", "line": 190, "name": "build_client_hello", "signature": "static int build_client_hello(struct tls_session *s, unsigned char *out)"}, {"doc": "out[pos++] = 0x00; out[pos++] = 0x06; out[pos++] = 0x04; out[pos++] = 0x01;   /* rsa_pkcs1_sha256 out[pos++] = 0x04; out[pos++] = 0x03;   /* ecdsa_p256_sha256 out[pos++] = 0x05; out[pos++] = 0x03;   /* ecdsa_p384_sha384 { int extlen = pos - ext_start - 2; out[ext_start] = (unsigned char)(extlen >> 8); out[ext_start + 1] = (unsigned char)extlen; } } return pos; } /* Derive all keys and send ClientKeyExchange, CCS, Finished.", "kind": "function", "line": 244, "name": "client_finish_flight", "signature": "static int client_finish_flight(struct tls_session *s)"}, {"kind": "function", "line": 340, "name": "parse_server_hello", "signature": "static int parse_server_hello(struct tls_session *s,\n                              const unsigned..."}, {"kind": "function", "line": 370, "name": "parse_certificate", "signature": "static int parse_certificate(struct tls_session *s,\n                             const unsigned c..."}, {"kind": "function", "line": 401, "name": "parse_server_key_exchange", "signature": "static int parse_server_key_exchange(struct tls_session *s,\n                                     ..."}, {"kind": "function", "line": 466, "name": "tls_handshake", "signature": "int tls_handshake(int fd, const char *host)"}, {"kind": "function", "line": 687, "name": "tls_send", "signature": "int tls_send(int fd, const char *buf, int len)"}, {"kind": "function", "line": 696, "name": "tls_recv", "signature": "int tls_recv(int fd, char *buf, int len)"}, {"doc": "if !defined(TLS_TEST) && !defined(TLS_RING3)", "kind": "function", "line": 772, "name": "tls_sys_handshake", "signature": "long tls_sys_handshake(long fd, long host)"}, {"kind": "function", "line": 777, "name": "tls_sys_send", "signature": "long tls_sys_send(long fd, long buf, long len)"}, {"kind": "function", "line": 782, "name": "tls_sys_recv", "signature": "long tls_sys_recv(long fd, long buf, long len)"}, {"kind": "function", "line": 789, "name": "tls_rdtsc", "signature": "static inline unsigned long long tls_rdtsc(void)"}, {"kind": "function", "line": 795, "name": "tls_random", "signature": "void tls_random(unsigned char *out, unsigned len)"}, {"doc": "unsigned long long seed = tls_rdtsc() ^ ((unsigned long long)net_time_ms() << 33); unsigned i; static unsigned long long counter = 0x6D696E69544C53ULL; counter ^= seed; for (i = 0; i < len; i++) { seed = seed * 6364136223846793005ULL + 1442695040888963407ULL; out[i] = (unsigned char)((seed >> 33) ^ (counter >> (i & 7) * 8)); counter = counter * 6364136223846793005ULL + 1; } } /* The port helpers in net.c are static; these live here for the RTC. ifndef PORT_IO_DEFINED define PORT_IO_DEFINED", "kind": "function", "line": 810, "name": "outb", "signature": "static inline void outb(unsigned short port, unsigned char v)"}, {"kind": "function", "line": 813, "name": "inb", "signature": "static inline unsigned char inb(unsigned short port)"}, {"doc": "/* The port helpers in net.c are static; these live here for the RTC. #ifndef PORT_IO_DEFINED #define PORT_IO_DEFINED static inline void outb(unsigned short port, unsigned char v) { __asm__ volatile(\"outb %0, %1\" : : \"a\"(v), \"Nd\"(port)); } static inline unsigned char inb(unsigned short port) { unsigned char v; __asm__ volatile(\"inb %1, %0\" : \"=a\"(v) : \"Nd\"(port)); return v; } #endif /* CMOS RTC -> days since epoch. Registers are BCD.", "kind": "function", "line": 821, "name": "cmos_read", "signature": "static inline unsigned char cmos_read(unsigned char reg)"}, {"kind": "function", "line": 826, "name": "tls_now_days", "signature": "long tls_now_days(void)"}, {"kind": "function", "line": 64, "name": "number", "signature": "* The nonce_explicit is the sequence number (RFC 5288 allows it and * OpenSSL uses it);"}, {"kind": "macro", "line": 809, "name": "PORT_IO_DEFINED", "signature": "#define PORT_IO_DEFINED"}]}, {"doc": "tls_crypto.c - the crypto behind the kernel TLS 1.2 client.", "id": "net/tls_crypto.c", "kind": "module", "label": "tls_crypto.c", "language": "c", "sha256": "24c29591939a35d0", "symbol_count": 78, "symbols": [{"kind": "struct", "line": 655, "name": "mont_ctx"}, {"kind": "struct", "line": 838, "name": "ec_curve"}, {"doc": "Jacobian point: three coordinates in Montgomery domain, nw words each. * The point at infinity has Z = 0.", "kind": "struct", "line": 859, "name": "jpt"}, {"kind": "struct", "line": 316, "name": "gf128"}, {"kind": "function", "line": 33, "name": "sha256_rotr", "signature": "static unsigned sha256_rotr(unsigned x, unsigned n)"}, {"kind": "function", "line": 37, "name": "sha256_init", "signature": "void sha256_init(struct sha256_ctx *c)"}, {"kind": "function", "line": 50, "name": "sha256_block", "signature": "static void sha256_block(struct sha256_ctx *c, const unsigned char *p)"}, {"kind": "function", "line": 80, "name": "sha256_update", "signature": "void sha256_update(struct sha256_ctx *c, const unsigned char *data, unsigned len)"}, {"kind": "function", "line": 105, "name": "sha256_final", "signature": "void sha256_final(struct sha256_ctx *c, unsigned char out[32])"}, {"kind": "function", "line": 126, "name": "sha256", "signature": "void sha256(const unsigned char *data, unsigned len, unsigned char out[32])"}, {"kind": "function", "line": 135, "name": "hmac_sha256", "signature": "void hmac_sha256(const unsigned char *key, unsigned klen,\n                 const unsigned char *d..."}, {"kind": "function", "line": 165, "name": "p_hash", "signature": "static void p_hash(const unsigned char *secret, unsigned secret_len,\n                   const uns..."}, {"kind": "function", "line": 188, "name": "tls_prf", "signature": "void tls_prf(const unsigned char *secret, unsigned secret_len,\n             const char *label, co..."}, {"kind": "function", "line": 230, "name": "aes_xtime", "signature": "static unsigned aes_xtime(unsigned x)"}, {"kind": "function", "line": 235, "name": "aes_key_expand", "signature": "static void aes_key_expand(const unsigned char key[16], unsigned rk[44])"}, {"kind": "function", "line": 253, "name": "aes_mixcol", "signature": "static void aes_mixcol(unsigned a0, unsigned a1, unsigned a2, unsigned a3,\n                      ..."}, {"kind": "function", "line": 263, "name": "aes128_encrypt_block", "signature": "void aes128_encrypt_block(const unsigned char key[16],\n                          const unsigned c..."}, {"kind": "function", "line": 321, "name": "gf_shift_right", "signature": "static gf128 gf_shift_right(gf128 v)"}, {"doc": "z = z * h, in GF(2^128), MSB-first. Branches on z bits (public: * AAD/ciphertext), never on h bits (secret).", "kind": "function", "line": 334, "name": "gf_mul", "signature": "static gf128 gf_mul(gf128 z, gf128 h)"}, {"kind": "function", "line": 351, "name": "gf_put", "signature": "static gf128 gf_put(const unsigned char *p)"}, {"kind": "function", "line": 361, "name": "ghash_blocks", "signature": "static gf128 ghash_blocks(gf128 z, gf128 h, const unsigned char *data, unsigned len)"}, {"doc": "if (len > 0) { unsigned char pad[16]; gf128 b; TLS_MEMSET(pad, 0, 16); TLS_MEMCPY(pad, data, len); b = gf_put(pad); z.lo ^= b.lo; z.hi ^= b.hi; z = gf_mul(z, h); } return z; } /* Compute GCM tag for aad || ct (ct already ciphertext).", "kind": "function", "line": 384, "name": "gcm_tag_core", "signature": "static void gcm_tag_core(const unsigned char key[16],\n                         const unsigned cha..."}, {"kind": "function", "line": 427, "name": "gcm_ctr_core", "signature": "static void gcm_ctr_core(const unsigned char key[16],\n                         const unsigned cha..."}, {"doc": "TLS_MEMCPY(blk, nonce, 12); blk[12] = (unsigned char)(ctr >> 24); blk[13] = (unsigned char)(ctr >> 16); blk[14] = (unsigned char)(ctr >> 8); blk[15] = (unsigned char)(ctr); aes128_encrypt_block(key, blk, crypt); if (take > 16) take = 16; for (i = 0; i < (int)take; i++) out[off + i] = in[off + i] ^ crypt[i]; off += take; ctr++; } } /* TLS nonce: 4-byte implicit salt || 8-byte sequence number.", "kind": "function", "line": 450, "name": "tls_nonce", "signature": "static void tls_nonce(const unsigned char salt[4], unsigned long long seq,\n                      ..."}, {"kind": "function", "line": 457, "name": "gcm_tag", "signature": "static void gcm_tag(const unsigned char key[16], const unsigned char salt[4],\n                   ..."}, {"kind": "function", "line": 467, "name": "gcm_ctr", "signature": "static void gcm_ctr(const unsigned char key[16], const unsigned char salt[4],\n                   ..."}, {"kind": "function", "line": 475, "name": "aes128_gcm_seal", "signature": "int aes128_gcm_seal(const unsigned char key[16],\n                    const unsigned char salt[4],..."}, {"kind": "function", "line": 487, "name": "aes128_gcm_open", "signature": "int aes128_gcm_open(const unsigned char key[16],\n                    const unsigned char salt[4],..."}, {"kind": "function", "line": 505, "name": "aes128_gcm_seal_core", "signature": "int aes128_gcm_seal_core(const unsigned char key[16],\n                         const unsigned cha..."}, {"kind": "function", "line": 516, "name": "aes128_gcm_open_core", "signature": "int aes128_gcm_open_core(const unsigned char key[16],\n                         const unsigned cha..."}, {"kind": "function", "line": 537, "name": "bn_zero", "signature": "static void bn_zero(unsigned *a, int nw)"}, {"kind": "function", "line": 542, "name": "bn_is_zero", "signature": "static int bn_is_zero(const unsigned *a, int nw)"}, {"kind": "function", "line": 549, "name": "bn_cmp", "signature": "static int bn_cmp(const unsigned *a, const unsigned *b, int nw)"}, {"doc": "for (i = 0; i < nw; i++) v |= a[i]; return v == 0; } static int bn_cmp(const unsigned *a, const unsigned *b, int nw) { int i; for (i = nw - 1; i >= 0; i--) { if (a[i] < b[i]) return -1; if (a[i] > b[i]) return 1; } return 0; } /* r = a + b; returns carry out.", "kind": "function", "line": 559, "name": "bn_add", "signature": "static unsigned bn_add(const unsigned *a, const unsigned *b, unsigned *r, int nw)"}, {"doc": "/* r = a + b; returns carry out. static unsigned bn_add(const unsigned *a, const unsigned *b, unsigned *r, int nw) { unsigned long long carry = 0; int i; for (i = 0; i < nw; i++) { unsigned long long t = (unsigned long long)a[i] + b[i] + carry; r[i] = (unsigned)t; carry = t >> 32; } return (unsigned)carry; } /* r = a - b; a must be >= b; returns borrow (0 = fine).", "kind": "function", "line": 571, "name": "bn_sub", "signature": "static unsigned bn_sub(const unsigned *a, const unsigned *b, unsigned *r, int nw)"}, {"doc": "r = 2a mod n, for a < n. v = 2^(32nw) mod n = 2^(32nw) - n (the * Montgomery \"one\"): 2a + carry means 2a - 2^(32nw) + v = 2a - n < n.", "kind": "function", "line": 584, "name": "bn_dbl_mod", "signature": "static void bn_dbl_mod(const unsigned *a, const unsigned *n, const unsigned *v,\n                 ..."}, {"doc": "Montgomery multiplication. n is odd, n0inv = -n^(-1) mod 2^32. r = a*b*R^-1 mod n, R = 2^(32nw). * a, b < n.", "kind": "function", "line": 596, "name": "bn_mont_mul", "signature": "static void bn_mont_mul(const unsigned *a, const unsigned *b, const unsigned *n,\n                ..."}, {"doc": "carry = v >> 32; } s = (unsigned long long)t[nw] + carry; t[nw - 1] = (unsigned)s; t[nw] = t[nw + 1] + (unsigned)(s >> 32); } if (t[nw] || bn_cmp(t, n, nw) >= 0) { bn_sub(t, n, r, nw); } else { for (i = 0; i < nw; i++) r[i] = t[i]; } } /* -n^(-1) mod 2^32 via Newton iteration (n0 must be odd).", "kind": "function", "line": 635, "name": "bn_mont_n0inv", "signature": "static unsigned bn_mont_n0inv(unsigned n0)"}, {"doc": "} else { for (i = 0; i < nw; i++) r[i] = t[i]; } } /* -n^(-1) mod 2^32 via Newton iteration (n0 must be odd). static unsigned bn_mont_n0inv(unsigned n0) { unsigned inv = 1; int i; for (i = 0; i < 5; i++) inv *= 2 - n0 * inv; return 0 - inv; } /* R^2 mod n, R = 2^(32nw): 64*nw doublings from 1.", "kind": "function", "line": 643, "name": "bn_mont_r2", "signature": "static void bn_mont_r2(const unsigned *n, const unsigned *v, int nw,\n                       unsig..."}, {"kind": "function", "line": 663, "name": "bn_from_be", "signature": "static void bn_from_be(const unsigned char *bytes, unsigned len,\n                       unsigned ..."}, {"kind": "function", "line": 671, "name": "bn_to_be", "signature": "static void bn_to_be(const unsigned *a, unsigned char *out, unsigned len)"}, {"kind": "function", "line": 677, "name": "mont_init", "signature": "static void mont_init(struct mont_ctx *m, const unsigned char *p_bytes,\n                      uns..."}, {"kind": "function", "line": 689, "name": "mont_to", "signature": "static void mont_to(struct mont_ctx *m, const unsigned *a, unsigned *r)"}, {"kind": "function", "line": 693, "name": "mont_from", "signature": "static void mont_from(struct mont_ctx *m, const unsigned *a, unsigned *r)"}, {"kind": "function", "line": 700, "name": "mont_mul", "signature": "static void mont_mul(struct mont_ctx *m, const unsigned *a, const unsigned *b,\n                  ..."}, {"kind": "function", "line": 705, "name": "mont_sqr", "signature": "static void mont_sqr(struct mont_ctx *m, const unsigned *a, unsigned *r)"}, {"doc": "Field add/sub over the mont modulus (in Montgomery domain). The carry of a+b is corrected with one = 2^(32nw) - n, and a - b < 0 is * p - (b - a); neither path can overflow one word.", "kind": "function", "line": 712, "name": "mont_add", "signature": "static void mont_add(struct mont_ctx *m, const unsigned *a, const unsigned *b,\n                  ..."}, {"kind": "function", "line": 721, "name": "mont_sub", "signature": "static void mont_sub(struct mont_ctx *m, const unsigned *a, const unsigned *b,\n                  ..."}, {"doc": "Field inverse via Fermat: a^(p-2) mod p (a in Montgomery domain; * the result stays in Montgomery domain).", "kind": "function", "line": 736, "name": "mont_inv", "signature": "static void mont_inv(struct mont_ctx *m, const unsigned *a, unsigned *r)"}, {"kind": "function", "line": 848, "name": "ec_init", "signature": "static void ec_init(struct ec_curve *c, const unsigned char *p,\n                    const unsigne..."}, {"kind": "function", "line": 865, "name": "jpt_is_inf", "signature": "static int jpt_is_inf(const struct jpt *p, int nw)"}, {"kind": "function", "line": 869, "name": "jpt_set_inf", "signature": "static void jpt_set_inf(struct jpt *p, int nw)"}, {"kind": "function", "line": 875, "name": "jpt_copy", "signature": "static void jpt_copy(struct jpt *d, const struct jpt *s, int nw)"}, {"doc": "bn_zero(p->y, nw); bn_zero(p->z, nw); } static void jpt_copy(struct jpt *d, const struct jpt *s, int nw) { int i; for (i = 0; i < nw; i++) { d->x[i] = s->x[i]; d->y[i] = s->y[i]; d->z[i] = s->z[i]; } } /* Constant-time swap of two points on a 0/~0 mask.", "kind": "function", "line": 885, "name": "jpt_cswap", "signature": "static void jpt_cswap(struct jpt *a, struct jpt *b, unsigned mask, int nw)"}, {"doc": "} /* Constant-time swap of two points on a 0/~0 mask. static void jpt_cswap(struct jpt *a, struct jpt *b, unsigned mask, int nw) { int i; for (i = 0; i < nw; i++) { unsigned t; t = (a->x[i] ^ b->x[i]) & mask; a->x[i] ^= t; b->x[i] ^= t; t = (a->y[i] ^ b->y[i]) & mask; a->y[i] ^= t; b->y[i] ^= t; t = (a->z[i] ^ b->z[i]) & mask; a->z[i] ^= t; b->z[i] ^= t; } } /* P3 = 2 * P1 (a = p - 3: E = 3(A - Z1^4)).", "kind": "function", "line": 896, "name": "jpt_dbl", "signature": "static void jpt_dbl(struct ec_curve *c, const struct jpt *p1, struct jpt *p3)"}, {"doc": "mont_sqr(m, E, F); mont_add(m, D, D, t);          /* 2D mont_sub(m, F, t, p3->x);      /* X3 = F - 2D mont_sub(m, D, p3->x, t); mont_mul(m, E, t, t2); mont_add(m, C, C, t); mont_add(m, t, t, t); mont_add(m, t, t, t);          /* 8C mont_sub(m, t2, t, p3->y);     /* Y3 = E(D-X3) - 8C mont_mul(m, p1->y, p1->z, YZ); mont_add(m, YZ, YZ, p3->z);    /* Z3 = 2YZ } /* P3 = P1 + P2 (generic Jacobian add).", "kind": "function", "line": 936, "name": "jpt_add", "signature": "static void jpt_add(struct ec_curve *c, const struct jpt *p1, const struct jpt *p2,\n             ..."}, {"doc": "Constant-iteration scalar multiplication: the classic ladder. * Fixed iteration count, no table lookups indexed by secret bits.", "kind": "function", "line": 980, "name": "jpt_scalar_mult", "signature": "static void jpt_scalar_mult(struct ec_curve *c, const struct jpt *base,\n                         ..."}, {"doc": "Affine from Jacobian: x = X/Z^2, y = Y/Z^3. Bytes out are big-endian. * y_out may be NULL when only the x coordinate is wanted.", "kind": "function", "line": 1007, "name": "jpt_to_affine", "signature": "static void jpt_to_affine(struct ec_curve *c, const struct jpt *p,\n                          unsi..."}, {"doc": "Affine from bytes with on-curve validation. Returns 0 when the point * is valid and not the point at infinity.", "kind": "function", "line": 1032, "name": "jpt_from_affine", "signature": "static int jpt_from_affine(struct ec_curve *c, const unsigned char *x_bytes,\n                    ..."}, {"kind": "function", "line": 1076, "name": "ec_curve_by_id", "signature": "static struct ec_curve *ec_curve_by_id(int curve)"}, {"kind": "function", "line": 1080, "name": "ec_boot", "signature": "static void ec_boot(void)"}, {"kind": "function", "line": 1088, "name": "p256_scalar_mult", "signature": "int p256_scalar_mult(const unsigned char scalar[32],\n                     const unsigned char qx[..."}, {"kind": "function", "line": 1101, "name": "p384_scalar_mult", "signature": "int p384_scalar_mult(const unsigned char scalar[48],\n                     const unsigned char qx[..."}, {"kind": "function", "line": 1114, "name": "p256_ecdh", "signature": "int p256_ecdh(const unsigned char priv[32],\n              const unsigned char peer_x[32], const u..."}, {"kind": "function", "line": 1129, "name": "der_parse_sig", "signature": "static int der_parse_sig(const unsigned char *sig, unsigned sig_len,\n                         con..."}, {"kind": "function", "line": 1163, "name": "ecdsa_verify", "signature": "int ecdsa_verify(int curve, const unsigned char pub_x[], const unsigned char pub_y[],\n           ..."}, {"doc": "EMSA-PKCS1-v1_5 DigestInfo check for an arbitrary hash: the encoding is 00 01 FF.. 00 <prefix><digest>. Constant-time: every byte of the * encoding contributes to the diff.", "kind": "function", "line": 1261, "name": "rsa_verify_digestinfo", "signature": "static int rsa_verify_digestinfo(const unsigned char *em, unsigned em_len,\n                      ..."}, {"doc": "diff |= em[i] ^ 0xff; } if (i >= em_len) return -1;         /* no separator if (i < 10) return -1;              /* padding too short (RFC 8017) i++; if (em_len - i != prefix_len + digest_len) return -1; for (i = 0; i < prefix_len; i++) diff |= em[em_len - prefix_len - digest_len + i] ^ prefix[i]; for (i = 0; i < digest_len; i++) diff |= em[em_len - digest_len + i] ^ digest[i]; return diff ? -1 : 0; } /* Shared RSA PKCS#1 v1.5 core: m^e mod n, EMSA-PKCS1-v1_5 in em.", "kind": "function", "line": 1285, "name": "rsa_pkcs1_verify_raw", "signature": "static int rsa_pkcs1_verify_raw(const unsigned char *n, unsigned n_len,\n                         ..."}, {"kind": "function", "line": 1326, "name": "rsa_pkcs1_verify_sha256", "signature": "int rsa_pkcs1_verify_sha256(const unsigned char *n, unsigned n_len,\n                            c..."}, {"kind": "function", "line": 1340, "name": "rsa_pkcs1_verify_sha384", "signature": "int rsa_pkcs1_verify_sha384(const unsigned char *n, unsigned n_len,\n                            c..."}, {"kind": "function", "line": 1386, "name": "sha384_rotr", "signature": "static unsigned long long sha384_rotr(unsigned long long x, unsigned n)"}, {"kind": "function", "line": 1390, "name": "sha384_raw", "signature": "static void sha384_raw(const unsigned char *data, unsigned len,\n                       unsigned c..."}, {"kind": "function", "line": 1506, "name": "sha384", "signature": "void sha384(const unsigned char *data, unsigned len, unsigned char out[48])"}, {"kind": "function", "line": 1512, "name": "p256_point_valid", "signature": "int p256_point_valid(const unsigned char x[32], const unsigned char y[32])"}, {"kind": "function", "line": 1520, "name": "p256_pub", "signature": "int p256_pub(const unsigned char priv[32],\n             unsigned char x[32], unsigned char y[32])"}, {"kind": "function", "line": 1539, "name": "p256_scalar_valid", "signature": "int p256_scalar_valid(const unsigned char scalar[32])"}, {"kind": "function", "line": 326, "name": "word", "signature": "* of the low word (hi holds bits 64..127, lo bits 0..63). Masked in, * so the shift never branches on key bits. */ r.hi = (v.hi >> 1) ^ (0xE100000000000000ULL & mask);"}, {"kind": "macro", "line": 535, "name": "TLS_BN_WORDS", "signature": "#define TLS_BN_WORDS"}]}, {"doc": "tls_x509.c - minimal X.509 DER parsing and chain verification.", "id": "net/tls_x509.c", "kind": "module", "label": "tls_x509.c", "language": "c", "sha256": "4a5fd793c528ef14", "symbol_count": 23, "symbols": [{"kind": "struct", "line": 43, "name": "der_tlv"}, {"kind": "struct", "line": 129, "name": "x509_name"}, {"kind": "struct", "line": 172, "name": "x509_sans"}, {"kind": "struct", "line": 265, "name": "x509_cert"}, {"kind": "function", "line": 36, "name": "oid_eq", "signature": "static int oid_eq(const unsigned char *bytes, unsigned len,\n                  const unsigned char..."}, {"doc": "Parse the TLV at p[pos]; advances pos to the first byte after it. * Returns 0 on success, -1 on any bound violation.", "kind": "function", "line": 51, "name": "der_next", "signature": "static int der_next(const unsigned char *p, unsigned limit, unsigned *pos,\n                    st..."}, {"doc": "len = (len << 8) | p[(*pos)++]; } } else { len = p[(*pos)++]; } if (len > limit - *pos) return -1; out->val = p + *pos; out->len = len; out->tag = tag; pos += len; return 0; } /* A constructed SEQUENCE/SET whose content must parse as children.", "kind": "function", "line": 82, "name": "der_container", "signature": "static int der_container(const unsigned char *p, unsigned limit, unsigned *pos,\n                 ..."}, {"kind": "function", "line": 94, "name": "days_from_civil", "signature": "static long days_from_civil(int y, int m, int d)"}, {"doc": "/* ---- Time ---- static long days_from_civil(int y, int m, int d) { long era, doe, yoe; int doy; y -= m <= 2 ? 1 : 0; era = (y >= 0 ? y : y - 399) / 400; yoe = y - (int)era * 400; doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; doe = (long)yoe * 365 + yoe / 4 - yoe / 100 + doy; return era * 146097 + doe - 719468; } /* UTCTime / GeneralizedTime \"....Z\" -> days since epoch, or -1.", "kind": "function", "line": 106, "name": "der_time_to_days", "signature": "static long der_time_to_days(const struct der_tlv *t)"}, {"doc": "} if (mon < 1 || mon > 12 || day < 1 || day > 31 || year < 1970 || year > 2100) return -1; return days_from_civil(year, mon, day); } /* ---- Name / extensions ---- struct x509_name { unsigned char cn[64]; unsigned cn_len; }; /* Find the first CN in an RDNSequence. Returns 0 when found.", "kind": "function", "line": 135, "name": "name_find_cn", "signature": "static int name_find_cn(const unsigned char *p, unsigned limit,\n                        struct x5..."}, {"kind": "function", "line": 178, "name": "san_add", "signature": "static void san_add(struct x509_sans *out, const unsigned char *v, unsigned len)"}, {"doc": "struct x509_sans { unsigned char dns[TLS_SAN_MAX][64]; unsigned      len[TLS_SAN_MAX]; int           count; }; static void san_add(struct x509_sans *out, const unsigned char *v, unsigned len) { if (out->count >= TLS_SAN_MAX || len >= 64) return; TLS_MEMCPY(out->dns[out->count], v, len); out->len[out->count] = len; out->count++; } /* Walk the SAN extension (2.5.29.17) OCTET STRING body.", "kind": "function", "line": 186, "name": "san_parse", "signature": "static void san_parse(const unsigned char *p, unsigned limit,\n                      struct x509_s..."}, {"doc": "unsigned seq_len, pos = 0; out->count = 0; if (der_container(p, limit, &pos, &seq, &seq_len) != 0) return; pos = 0; while (pos < seq_len) { struct der_tlv t; if (der_next(seq, seq_len, &pos, &t) != 0) return; if (t.tag == 0x82) san_add(out, t.val, t.len); /* dNSName } } /* ---- Public key ---- /* SPKI SEQUENCE content: { alg SEQUENCE { OID, params }, BIT STRING }.", "kind": "function", "line": 203, "name": "spki_parse", "signature": "static int spki_parse(const unsigned char *p, unsigned limit,\n                      struct tls_pu..."}, {"kind": "function", "line": 279, "name": "cert_parse", "signature": "static int cert_parse(const unsigned char *der, unsigned len,\n                      struct x509_c..."}, {"kind": "function", "line": 392, "name": "ascii_lower", "signature": "static int ascii_lower(int c)"}, {"doc": "} } } } return 0; } /* ---- Hostname matching ---- static int ascii_lower(int c) { return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c; } /* Exact match, ASCII case-insensitive.", "kind": "function", "line": 397, "name": "host_match_exact", "signature": "static int host_match_exact(const char *host, const unsigned char *name,\n                        ..."}, {"doc": "Wildcard: \"*.example.com\" matches exactly one label (\"a.example.com\", * never \"a.b.example.com\" nor \"example.com\").", "kind": "function", "line": 410, "name": "host_match_wildcard", "signature": "static int host_match_wildcard(const char *host, const unsigned char *name,\n                     ..."}, {"kind": "function", "line": 431, "name": "host_matches", "signature": "static int host_matches(const char *host, const struct x509_cert *leaf)"}, {"kind": "function", "line": 452, "name": "tls_x509_parse_pubkey", "signature": "int tls_x509_parse_pubkey(const unsigned char *der, unsigned len,\n                          struc..."}, {"doc": "Trust anchors are matched by public key, not by self-signature: a presented root is often a cross-signed copy (signed by a legacy root, e.g. the SSL.com 2022 roots are signed by Comodo AAA), so checking its signature against its own key would reject a perfectly valid anchor. Key equality is safe because every link above the top is still signature-verified: an attacker cannot present a top cert carrying an embedded root's public key unless the chain below it was signed with * that root's private key.", "kind": "function", "line": 468, "name": "pubkey_equal", "signature": "static int pubkey_equal(const struct tls_pubkey *a, const struct tls_pubkey *b)"}, {"doc": "signature-verified: an attacker cannot present a top cert carrying an embedded root's public key unless the chain below it was signed with * that root's private key. static int pubkey_equal(const struct tls_pubkey *a, const struct tls_pubkey *b) { if (a->kind != b->kind) return 0; if (a->kind == 0) return a->n_len == b->n_len && a->e_len == b->e_len && TLS_MEMCMP(a->n, b->n, a->n_len) == 0 && TLS_MEMCMP(a->e, b->e, a->e_len) == 0; return TLS_MEMCMP(a->qx, b->qx, 48) == 0 && TLS_MEMCMP(a->qy, b->qy, 48) == 0; } /* Verify one certificate's signature with an issuer public key.", "kind": "function", "line": 479, "name": "cert_verify_signature", "signature": "static int cert_verify_signature(const struct x509_cert *cert,\n                                 c..."}, {"kind": "function", "line": 521, "name": "tls_x509_verify_chain", "signature": "int tls_x509_verify_chain(const unsigned char *chain, unsigned chain_len,\n                       ..."}, {"kind": "macro", "line": 170, "name": "TLS_SAN_MAX", "signature": "#define TLS_SAN_MAX"}]}, {"id": "progs/asm/aes.s", "kind": "module", "label": "aes.s", "language": "s", "sha256": "3d4916e23618a67d", "symbol_count": 30, "symbols": [{"kind": "function", "line": 3, "name": "aes_rk"}, {"kind": "function", "line": 7, "name": "aes_sb"}, {"kind": "function", "line": 11, "name": "aes_rc"}, {"kind": "function", "line": 15, "name": "aes_st"}, {"kind": "function", "line": 19, "name": "aes_iv"}, {"kind": "function", "line": 23, "name": "aes_read_all"}, {"kind": "function", "line": 238, "name": "aes_write_all"}, {"kind": "function", "line": 345, "name": "aes_has"}, {"kind": "function", "line": 498, "name": "hex_val"}, {"kind": "function", "line": 620, "name": "aes_parse_hex"}, {"kind": "function", "line": 783, "name": "aes_gf_mul"}, {"kind": "function", "line": 884, "name": "aes_xtime"}, {"kind": "function", "line": 933, "name": "aes_rotl8"}, {"kind": "function", "line": 970, "name": "aes_init_tables"}, {"kind": "function", "line": 1197, "name": "aes_key_expand"}, {"kind": "function", "line": 1646, "name": "aes_add_round_key"}, {"kind": "function", "line": 1721, "name": "aes_sub_bytes"}, {"kind": "function", "line": 1774, "name": "aes_shift_rows"}, {"kind": "function", "line": 1993, "name": "aes_mix_columns"}, {"kind": "function", "line": 2466, "name": "aes_cipher"}, {"kind": "function", "line": 2565, "name": "aes_iv_increment"}, {"kind": "function", "line": 2648, "name": "aes_ctr_crypt"}, {"kind": "function", "line": 2791, "name": "aes_hdr_put"}, {"kind": "function", "line": 2906, "name": "aes_hdr_get"}, {"kind": "function", "line": 3059, "name": "aes_tool_name"}, {"kind": "function", "line": 3077, "name": "aes_run"}, {"kind": "function", "line": 3087, "name": "__sl_3"}, {"kind": "function", "line": 3091, "name": "__sl_4"}, {"kind": "function", "line": 3807, "name": "main"}, {"kind": "function", "line": 4113, "name": "_start"}]}, {"id": "progs/asm/cp.s", "kind": "module", "label": "cp.s", "language": "s", "sha256": "706a59cf1d9ea9f3", "symbol_count": 2, "symbols": [{"kind": "function", "line": 3, "name": "main"}, {"kind": "function", "line": 322, "name": "_start"}]}, {"id": "progs/asm/cvmfmt.s", "kind": "module", "label": "cvmfmt.s", "language": "s", "sha256": "71b152eb469510b7", "symbol_count": 4, "symbols": [{"kind": "function", "line": 3, "name": "fwin"}, {"kind": "function", "line": 7, "name": "fcanary"}, {"kind": "function", "line": 11, "name": "main"}, {"kind": "function", "line": 245, "name": "_start"}]}, {"id": "progs/asm/fib.s", "kind": "module", "label": "fib.s", "language": "s", "sha256": "e4cc2d98e3d0b67f", "symbol_count": 3, "symbols": [{"kind": "function", "line": 3, "name": "fib"}, {"kind": "function", "line": 61, "name": "main"}, {"kind": "function", "line": 82, "name": "_start"}]}, {"id": "progs/asm/freedom.s", "kind": "module", "label": "freedom.s", "language": "s", "sha256": "f3272f8af5aeb5fa", "symbol_count": 92, "symbols": [{"kind": "function", "line": 3, "name": "tls_close"}, {"kind": "function", "line": 24, "name": "f_host"}, {"kind": "function", "line": 28, "name": "f_path"}, {"kind": "function", "line": 32, "name": "f_port"}, {"kind": "function", "line": 36, "name": "f_secure"}, {"kind": "function", "line": 40, "name": "f_loc"}, {"kind": "function", "line": 44, "name": "f_redir"}, {"kind": "function", "line": 48, "name": "f_status"}, {"kind": "function", "line": 52, "name": "f_clen"}, {"kind": "function", "line": 56, "name": "f_has_clen"}, {"kind": "function", "line": 60, "name": "f_chunked"}, {"kind": "function", "line": 64, "name": "f_hdr"}, {"kind": "function", "line": 68, "name": "f_hlen"}, {"kind": "function", "line": 72, "name": "f_tag"}, {"kind": "function", "line": 76, "name": "f_suppress"}, {"kind": "function", "line": 80, "name": "f_comment"}, {"kind": "function", "line": 84, "name": "f_cmdash"}, {"kind": "function", "line": 88, "name": "f_tagn"}, {"kind": "function", "line": 92, "name": "f_tagnlen"}, {"kind": "function", "line": 96, "name": "f_ent"}, {"kind": "function", "line": 100, "name": "f_entlen"}, {"kind": "function", "line": 104, "name": "f_ws"}, {"kind": "function", "line": 108, "name": "f_utbuf"}, {"kind": "function", "line": 112, "name": "f_utlen"}, {"kind": "function", "line": 116, "name": "f_utrem"}, {"kind": "function", "line": 120, "name": "f_attr_on"}, {"kind": "function", "line": 124, "name": "f_waitq"}, {"kind": "function", "line": 128, "name": "f_inval"}, {"kind": "function", "line": 132, "name": "f_inval2"}, {"kind": "function", "line": 136, "name": "f_attr"}, {"kind": "function", "line": 140, "name": "f_attrlen"}, {"kind": "function", "line": 144, "name": "f_val"}, {"kind": "function", "line": 148, "name": "f_vallen"}, {"kind": "function", "line": 152, "name": "f_id"}, {"kind": "function", "line": 156, "name": "f_idlen"}, {"kind": "function", "line": 160, "name": "f_cls"}, {"kind": "function", "line": 164, "name": "f_clslen"}, {"kind": "function", "line": 168, "name": "f_href"}, {"kind": "function", "line": 172, "name": "f_hreflen"}, {"kind": "function", "line": 176, "name": "f_rel_ss"}, {"kind": "function", "line": 180, "name": "f_styleattr"}, {"kind": "function", "line": 184, "name": "f_stylelen"}, {"kind": "function", "line": 188, "name": "f_dump_css"}, {"kind": "function", "line": 192, "name": "f_dump_dom"}, {"kind": "function", "line": 196, "name": "f_mode"}, {"kind": "function", "line": 200, "name": "f_rawcap"}, {"kind": "function", "line": 204, "name": "f_depth"}, {"kind": "function", "line": 208, "name": "f_dom"}, {"kind": "function", "line": 212, "name": "f_domlen"}, {"kind": "function", "line": 216, "name": "f_css"}, {"kind": "function", "line": 220, "name": "f_csslen"}, {"kind": "function", "line": 224, "name": "f_linkhost"}, {"kind": "function", "line": 228, "name": "f_linkpath"}, {"kind": "function", "line": 232, "name": "f_linkn"}, {"kind": "function", "line": 236, "name": "f_cstage"}, {"kind": "function", "line": 240, "name": "f_csize"}, {"kind": "function", "line": 244, "name": "f_crem"}, {"kind": "function", "line": 248, "name": "f_bdone"}, {"kind": "function", "line": 252, "name": "atoi"}, {"kind": "function", "line": 338, "name": "append"}, {"kind": "function", "line": 437, "name": "ci_lower"}, {"kind": "function", "line": 486, "name": "ci_starts"}, {"kind": "function", "line": 559, "name": "ci_eq"}, {"kind": "function", "line": 656, "name": "ci_index"}, {"kind": "function", "line": 715, "name": "looks_like_url"}, {"kind": "function", "line": 789, "name": "has_scheme"}, {"kind": "function", "line": 1064, "name": "make_search"}, {"kind": "function", "line": 1295, "name": "split_url"}, {"kind": "function", "line": 1810, "name": "resolve_redirect"}, {"kind": "function", "line": 2333, "name": "put_ws"}, {"kind": "function", "line": 2379, "name": "put_utf"}, {"kind": "function", "line": 2915, "name": "put_text"}, {"kind": "function", "line": 3018, "name": "put_entity"}, {"kind": "function", "line": 3849, "name": "css_append"}, {"kind": "function", "line": 3920, "name": "css_line"}, {"kind": "function", "line": 3978, "name": "dom_append"}, {"kind": "function", "line": 4049, "name": "dom_space"}, {"kind": "function", "line": 4083, "name": "dom_nl"}, {"kind": "function", "line": 4117, "name": "record_attr"}, {"kind": "function", "line": 4449, "name": "is_void_tag"}, {"kind": "function", "line": 4757, "name": "classify_tag"}, {"kind": "function", "line": 5961, "name": "body_byte"}, {"kind": "function", "line": 7203, "name": "head_line"}, {"kind": "function", "line": 7460, "name": "parse_head"}, {"kind": "function", "line": 7676, "name": "recv_body"}, {"kind": "function", "line": 7736, "name": "send_all"}, {"kind": "function", "line": 7810, "name": "fetch"}, {"kind": "function", "line": 9293, "name": "fetch_css"}, {"kind": "function", "line": 10112, "name": "print_css_dump"}, {"kind": "function", "line": 10212, "name": "print_dom_dump"}, {"kind": "function", "line": 10291, "name": "main"}, {"kind": "function", "line": 11761, "name": "_start"}]}, {"id": "progs/asm/http.s", "kind": "module", "label": "http.s", "language": "s", "sha256": "e98adee542f76a0b", "symbol_count": 3, "symbols": [{"kind": "function", "line": 3, "name": "atoi"}, {"kind": "function", "line": 89, "name": "main"}, {"kind": "function", "line": 709, "name": "_start"}]}, {"id": "progs/asm/json.s", "kind": "module", "label": "json.s", "language": "s", "sha256": "4a66fc11784c36e4", "symbol_count": 32, "symbols": [{"kind": "function", "line": 3, "name": "js_key"}, {"kind": "function", "line": 7, "name": "js_str"}, {"kind": "function", "line": 11, "name": "js_type"}, {"kind": "function", "line": 15, "name": "js_num"}, {"kind": "function", "line": 19, "name": "js_first"}, {"kind": "function", "line": 23, "name": "js_count"}, {"kind": "function", "line": 27, "name": "js_next"}, {"kind": "function", "line": 31, "name": "js_n"}, {"kind": "function", "line": 35, "name": "js_pool"}, {"kind": "function", "line": 39, "name": "js_plen"}, {"kind": "function", "line": 43, "name": "js_src"}, {"kind": "function", "line": 47, "name": "js_pos"}, {"kind": "function", "line": 51, "name": "js_len"}, {"kind": "function", "line": 55, "name": "js_err"}, {"kind": "function", "line": 59, "name": "js_read_all"}, {"kind": "function", "line": 274, "name": "js_new"}, {"kind": "function", "line": 306, "name": "js_skip_ws"}, {"kind": "function", "line": 397, "name": "js_peek"}, {"kind": "function", "line": 437, "name": "js_parse_string"}, {"kind": "function", "line": 851, "name": "js_parse_number"}, {"kind": "function", "line": 947, "name": "js_key_match"}, {"kind": "function", "line": 983, "name": "js_parse_object"}, {"kind": "function", "line": 1335, "name": "js_parse_array"}, {"kind": "function", "line": 1594, "name": "js_parse_value"}, {"kind": "function", "line": 2481, "name": "js_indent"}, {"kind": "function", "line": 2524, "name": "js_print_str"}, {"kind": "function", "line": 2747, "name": "js_print_value"}, {"kind": "function", "line": 3313, "name": "js_find_member"}, {"kind": "function", "line": 3391, "name": "js_array_at"}, {"kind": "function", "line": 3460, "name": "js_query"}, {"kind": "function", "line": 3772, "name": "main"}, {"kind": "function", "line": 4169, "name": "_start"}]}, {"id": "progs/asm/ldhello.s", "kind": "module", "label": "ldhello.s", "language": "s", "sha256": "1eda6c9f40c5f161", "symbol_count": 2, "symbols": [{"kind": "function", "line": 3, "name": "main"}, {"kind": "function", "line": 14, "name": "_start"}]}, {"id": "progs/asm/lz4.s", "kind": "module", "label": "lz4.s", "language": "s", "sha256": "682988aa1ccbc218", "symbol_count": 7, "symbols": [{"kind": "function", "line": 3, "name": "lz4_has"}, {"kind": "function", "line": 156, "name": "lz4_read_all"}, {"kind": "function", "line": 371, "name": "lz4_write_all"}, {"kind": "function", "line": 478, "name": "lz4_compress_file"}, {"kind": "function", "line": 791, "name": "lz4_decompress_file"}, {"kind": "function", "line": 1228, "name": "main"}, {"kind": "function", "line": 1535, "name": "_start"}]}, {"id": "progs/asm/lzss.s", "kind": "module", "label": "lzss.s", "language": "s", "sha256": "3ae03d757d901a84", "symbol_count": 30, "symbols": [{"kind": "function", "line": 3, "name": "lz_win"}, {"kind": "function", "line": 7, "name": "lz_src"}, {"kind": "function", "line": 11, "name": "lz_srclen"}, {"kind": "function", "line": 15, "name": "lz_srcpos"}, {"kind": "function", "line": 19, "name": "lz_dst"}, {"kind": "function", "line": 23, "name": "lz_dstcap"}, {"kind": "function", "line": 27, "name": "lz_dstlen"}, {"kind": "function", "line": 31, "name": "lz_err"}, {"kind": "function", "line": 35, "name": "lz_buf"}, {"kind": "function", "line": 39, "name": "lz_mask"}, {"kind": "function", "line": 43, "name": "lz_in_getc"}, {"kind": "function", "line": 79, "name": "lz_out_put"}, {"kind": "function", "line": 116, "name": "lz_putbit1"}, {"kind": "function", "line": 174, "name": "lz_putbit0"}, {"kind": "function", "line": 223, "name": "lz_flush_bits"}, {"kind": "function", "line": 251, "name": "lz_out_literal"}, {"kind": "function", "line": 321, "name": "lz_out_pair"}, {"kind": "function", "line": 447, "name": "lz_next_mb"}, {"kind": "function", "line": 451, "name": "lz_encode"}, {"kind": "function", "line": 1051, "name": "lz_getbit"}, {"kind": "function", "line": 1171, "name": "lz_decode"}, {"kind": "function", "line": 1514, "name": "lz_hdr_put"}, {"kind": "function", "line": 1629, "name": "lz_hdr_get"}, {"kind": "function", "line": 1782, "name": "lz_has"}, {"kind": "function", "line": 1935, "name": "lz_read_all"}, {"kind": "function", "line": 2150, "name": "lz_write_all"}, {"kind": "function", "line": 2257, "name": "lz_compress"}, {"kind": "function", "line": 2628, "name": "lz_decompress"}, {"kind": "function", "line": 3178, "name": "main"}, {"kind": "function", "line": 3497, "name": "_start"}]}, {"id": "progs/asm/mtop.s", "kind": "module", "label": "mtop.s", "language": "s", "sha256": "321cbe1bbdf1980d", "symbol_count": 36, "symbols": [{"kind": "function", "line": 3, "name": "h_cpu"}, {"kind": "function", "line": 7, "name": "h_mem"}, {"kind": "function", "line": 11, "name": "h_fill"}, {"kind": "function", "line": 15, "name": "last_dns"}, {"kind": "function", "line": 19, "name": "last_dns_ms"}, {"kind": "function", "line": 23, "name": "last_sock"}, {"kind": "function", "line": 27, "name": "prev_total"}, {"kind": "function", "line": 31, "name": "prev_idle"}, {"kind": "function", "line": 35, "name": "have_prev"}, {"kind": "function", "line": 39, "name": "disk_f"}, {"kind": "function", "line": 43, "name": "disk_path"}, {"kind": "function", "line": 47, "name": "sc3"}, {"kind": "function", "line": 78, "name": "mtop_time"}, {"kind": "function", "line": 106, "name": "mtop_rtc"}, {"kind": "function", "line": 137, "name": "mtop_key"}, {"kind": "function", "line": 165, "name": "mtop_minfo"}, {"kind": "function", "line": 206, "name": "emit"}, {"kind": "function", "line": 241, "name": "mtop_quit_key"}, {"kind": "function", "line": 317, "name": "mtop_clear_ansi"}, {"kind": "function", "line": 401, "name": "mtop_clear"}, {"kind": "function", "line": 443, "name": "mtop_atoi"}, {"kind": "function", "line": 569, "name": "mtop_putu"}, {"kind": "function", "line": 725, "name": "mtop_put2"}, {"kind": "function", "line": 765, "name": "mtop_put_kb"}, {"kind": "function", "line": 887, "name": "mtop_bar"}, {"kind": "function", "line": 1038, "name": "mtop_hist_max"}, {"kind": "function", "line": 1106, "name": "mtop_hist_push"}, {"kind": "function", "line": 1201, "name": "mtop_spark"}, {"kind": "function", "line": 1452, "name": "mtop_mem"}, {"kind": "function", "line": 1556, "name": "mtop_cpu"}, {"kind": "function", "line": 1842, "name": "mtop_disk_open"}, {"kind": "function", "line": 1966, "name": "mtop_disk_read"}, {"kind": "function", "line": 2128, "name": "mtop_net_probe"}, {"kind": "function", "line": 2275, "name": "mtop_frame"}, {"kind": "function", "line": 3831, "name": "main"}, {"kind": "function", "line": 4781, "name": "_start"}]}, {"id": "progs/asm/sign.s", "kind": "module", "label": "sign.s", "language": "s", "sha256": "9b2dc7f20600ed0b", "symbol_count": 85, "symbols": [{"kind": "function", "line": 3, "name": "sign_k0"}, {"kind": "function", "line": 7, "name": "sign_k1"}, {"kind": "function", "line": 11, "name": "sign_k2"}, {"kind": "function", "line": 15, "name": "sign_k3"}, {"kind": "function", "line": 19, "name": "sign_k4"}, {"kind": "function", "line": 23, "name": "sign_k5"}, {"kind": "function", "line": 27, "name": "sign_k6"}, {"kind": "function", "line": 31, "name": "sign_k7"}, {"kind": "function", "line": 35, "name": "sign_seed_hex"}, {"kind": "function", "line": 39, "name": "sign_bx_hex"}, {"kind": "function", "line": 43, "name": "sign_by_hex"}, {"kind": "function", "line": 47, "name": "sign_ax_hex"}, {"kind": "function", "line": 51, "name": "sign_ay_hex"}, {"kind": "function", "line": 55, "name": "sign_pub_hex"}, {"kind": "function", "line": 59, "name": "sign_note_name"}, {"kind": "function", "line": 63, "name": "sign_section_name"}, {"kind": "function", "line": 67, "name": "sign_k"}, {"kind": "function", "line": 71, "name": "sign_h"}, {"kind": "function", "line": 75, "name": "sign_w"}, {"kind": "function", "line": 79, "name": "sign_buf"}, {"kind": "function", "line": 83, "name": "sign_used"}, {"kind": "function", "line": 87, "name": "sign_nlo"}, {"kind": "function", "line": 91, "name": "sign_nhi"}, {"kind": "function", "line": 95, "name": "sign_q4"}, {"kind": "function", "line": 99, "name": "sign_l8"}, {"kind": "function", "line": 103, "name": "sign_gb"}, {"kind": "function", "line": 107, "name": "sign_ga"}, {"kind": "function", "line": 111, "name": "sign_hexval"}, {"kind": "function", "line": 232, "name": "sign_unhex"}, {"kind": "function", "line": 325, "name": "sign_byte"}, {"kind": "function", "line": 363, "name": "sign_copy"}, {"kind": "function", "line": 405, "name": "sign_strlen"}, {"kind": "function", "line": 444, "name": "sign_le16"}, {"kind": "function", "line": 494, "name": "sign_le32"}, {"kind": "function", "line": 596, "name": "sign_put32"}, {"kind": "function", "line": 688, "name": "sign_hexout"}, {"kind": "function", "line": 866, "name": "sign_offok"}, {"kind": "function", "line": 927, "name": "sign_rotr"}, {"kind": "function", "line": 1099, "name": "sign_carry2"}, {"kind": "function", "line": 1158, "name": "sign_borrow2"}, {"kind": "function", "line": 1218, "name": "sign_add3"}, {"kind": "function", "line": 1292, "name": "sign_be32"}, {"kind": "function", "line": 1394, "name": "sign_block"}, {"kind": "function", "line": 3105, "name": "sign_sha_init"}, {"kind": "function", "line": 3287, "name": "sign_sha_update"}, {"kind": "function", "line": 3477, "name": "sign_sha_final"}, {"kind": "function", "line": 3871, "name": "sign_feed32"}, {"kind": "function", "line": 3962, "name": "sign_key_init"}, {"kind": "function", "line": 4387, "name": "fe_copy"}, {"kind": "function", "line": 4435, "name": "fe_zero"}, {"kind": "function", "line": 4476, "name": "fe_one"}, {"kind": "function", "line": 4505, "name": "fe_cmov"}, {"kind": "function", "line": 4589, "name": "fe_ge"}, {"kind": "function", "line": 4713, "name": "fe_rawsub"}, {"kind": "function", "line": 4837, "name": "fe_add"}, {"kind": "function", "line": 5031, "name": "fe_sub"}, {"kind": "function", "line": 5297, "name": "fe_rowadd"}, {"kind": "function", "line": 5426, "name": "fe_foldadd"}, {"kind": "function", "line": 5481, "name": "fe_mul"}, {"kind": "function", "line": 6109, "name": "fe_sq"}, {"kind": "function", "line": 6135, "name": "fe_inv"}, {"kind": "function", "line": 6284, "name": "fe_frombytes"}, {"kind": "function", "line": 6432, "name": "fe_tobytes"}, {"kind": "function", "line": 6586, "name": "fe_curved"}, {"kind": "function", "line": 6712, "name": "ge_copy"}, {"kind": "function", "line": 6760, "name": "fe_off"}, {"kind": "function", "line": 6780, "name": "ge_cmov"}, {"kind": "function", "line": 6864, "name": "ge_add"}, {"kind": "function", "line": 7325, "name": "ge_double"}, {"kind": "function", "line": 7701, "name": "ge_scalarmult"}, {"kind": "function", "line": 7916, "name": "sc_mod_l"}, {"kind": "function", "line": 8461, "name": "sc_mul_add"}, {"kind": "function", "line": 9013, "name": "sign_rev32"}, {"kind": "function", "line": 9084, "name": "sign_points_init"}, {"kind": "function", "line": 9485, "name": "sign_digest"}, {"kind": "function", "line": 10733, "name": "sign_read"}, {"kind": "function", "line": 10972, "name": "sign_write"}, {"kind": "function", "line": 11061, "name": "sign_note_span"}, {"kind": "function", "line": 11374, "name": "sign_digest_of"}, {"kind": "function", "line": 11834, "name": "sign_patch_notes"}, {"kind": "function", "line": 12154, "name": "sign_append"}, {"kind": "function", "line": 13433, "name": "sign_file"}, {"kind": "function", "line": 14501, "name": "sign_selftest"}, {"kind": "function", "line": 14647, "name": "main"}, {"kind": "function", "line": 14926, "name": "_start"}]}, {"id": "progs/asm/w1.s", "kind": "module", "label": "w1.s", "language": "s", "sha256": "cfd7d7a01734e3a0", "symbol_count": 2, "symbols": [{"kind": "function", "line": 3, "name": "main"}, {"kind": "function", "line": 37, "name": "_start"}]}, {"doc": "doomedit.c - tile map editor that builds playable Doom PWADs.", "id": "progs/doomedit/doomedit.c", "kind": "module", "label": "doomedit.c", "language": "c", "sha256": "c90548b461c2facb", "symbol_count": 108, "symbols": [{"doc": "Thing type ids from the engine mobjinfo table, each with its sprite * verified present in the shareware IWAD.", "kind": "function", "line": 165, "name": "dmap_thing_type", "signature": "static int dmap_thing_type(int cell)"}, {"kind": "function", "line": 272, "name": "dmap_push_history", "signature": "static void dmap_push_history(void)"}, {"kind": "function", "line": 289, "name": "dmap_undo", "signature": "static int dmap_undo(void)"}, {"kind": "function", "line": 307, "name": "dmap_redo", "signature": "static int dmap_redo(void)"}, {"doc": "dmap_undo_h[dmap_undo_top] = dmap_h; memcpy(dmap_undo_g[dmap_undo_top], dmap_grid, sizeof(dmap_grid)); dmap_undo_top++; } dmap_redo_top--; dmap_w = dmap_redo_w[dmap_redo_top]; dmap_h = dmap_redo_h[dmap_redo_top]; memcpy(dmap_grid, dmap_redo_g[dmap_redo_top], sizeof(dmap_grid)); dmap_anchor_active = 0; dmap_recenter(); return 0; } /** Single-cell paint keeping the one-player / one-exit invariant.", "kind": "function", "line": 326, "name": "dmap_apply_cell", "signature": "static void dmap_apply_cell(int r, int c, int brush)"}, {"doc": "if (brush == DMAP_PLAYER || brush == DMAP_EXIT) { for (rr = 0; rr < dmap_h; rr++) for (cc = 0; cc < dmap_w; cc++) if (dmap_grid[rr][cc] == brush) dmap_grid[rr][cc] = DMAP_FLOOR; } dmap_grid[r][c] = (char)brush; if (brush == DMAP_PLAYER) { dmap_px = (float)c + 0.5f; dmap_py = (float)r + 0.5f; } } /** 4-way flood fill of the connected region holding old_cell.", "kind": "function", "line": 344, "name": "dmap_flood_fill", "signature": "static void dmap_flood_fill(int sr, int sc, int new_cell)"}, {"doc": "if (nr < 0 || nc < 0 || nr >= dmap_h || nc >= dmap_w) continue; if (dmap_grid[nr][nc] != old_cell) continue; dmap_grid[nr][nc] = (char)new_cell; stack_r[top] = nr; stack_c[top] = nc; top++; } } dmap_level_sel = 0; } /** Bresenham line of cells, clipped to the grid.", "kind": "function", "line": 383, "name": "dmap_draw_line", "signature": "static void dmap_draw_line(int r0, int c0, int r1, int c1, int cell)"}, {"doc": "e2 = err; if (e2 > -dr) { err -= dc; r0 += sr; } if (e2 < dc) { err += dr; c0 += sc; } } dmap_level_sel = 0; } /** Hollow rectangle border between two corners, clipped to the grid.", "kind": "function", "line": 411, "name": "dmap_draw_rect", "signature": "static void dmap_draw_rect(int r0, int c0, int r1, int c1, int cell)"}, {"doc": "for (r = rt; r <= rb; r++) { if (r >= 0 && r < dmap_h && cl >= 0 && cl < dmap_w) { if (dmap_grid[r][cl] != DMAP_PLAYER && dmap_grid[r][cl] != DMAP_EXIT) dmap_grid[r][cl] = (char)cell; } if (r >= 0 && r < dmap_h && cr >= 0 && cr < dmap_w) { if (dmap_grid[r][cr] != DMAP_PLAYER && dmap_grid[r][cr] != DMAP_EXIT) dmap_grid[r][cr] = (char)cell; } } dmap_level_sel = 0; } /** BFS reachability from the player start; seen[] is 1 for reachable.", "kind": "function", "line": 440, "name": "dmap_reach_map", "signature": "static void dmap_reach_map(int seen[DMAP_MAX_H][DMAP_MAX_W])"}, {"doc": "int nr = cr + dirs[k][0], nc = cc + dirs[k][1]; if (nr < 0 || nc < 0 || nr >= dmap_h || nc >= dmap_w) continue; if (seen[nr][nc] || !dmap_walkable(dmap_grid[nr][nc])) continue; seen[nr][nc] = 1; stack_r[top] = nr; stack_c[top] = nc; top++; } } } /** Shortest walkable distance player -> exit in tiles, -1 when broken.", "kind": "function", "line": 480, "name": "dmap_path_len", "signature": "static int dmap_path_len(void)"}, {"doc": "if (nr < 0 || nc < 0 || nr >= dmap_h || nc >= dmap_w) continue; if (dist[nr][nc] >= 0 || !dmap_walkable(dmap_grid[nr][nc])) continue; dist[nr][nc] = dist[cr][cc] + 1; qr[tail] = nr; qc[tail] = nc; tail++; } } return -1; } /** Headless stats line for the panel: size, sectors, path, monsters.", "kind": "function", "line": 522, "name": "dmap_stats", "signature": "static void dmap_stats(char *out, int max)"}, {"doc": "} path = dmap_path_len(); if (dmap_validate(msg, sizeof(msg)) == 0) snprintf(out, (size_t)max, \"%dx%d %d sect path %d mon %d things %d\", dmap_w, dmap_h, dmap_nsectors, path, monsters, things); else snprintf(out, (size_t)max, \"%dx%d floor %d path - mon %d: %s\", dmap_w, dmap_h, floors, monsters, msg); } /** Forward: the validator lives below the level tables. static int dmap_validate(char *msg, int max); /** Run a program through SYS_SPAWN, preserving the editor.", "kind": "function", "line": 550, "name": "dmap_spawn", "signature": "static long dmap_spawn(const char *path, int argc, const char **argv)"}, {"doc": "static int dmap_validate(char *msg, int max); /** Run a program through SYS_SPAWN, preserving the editor. static long dmap_spawn(const char *path, int argc, const char **argv) { long ret; register long r10 __asm__(\"r10\") = (long)argv; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_SPAWN), \"D\"(path), \"S\"((long)0), \"d\"((long)argc), \"r\"(r10) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Release or reclaim the display around a spawned child.", "kind": "function", "line": 561, "name": "dmap_vga", "signature": "static long dmap_vga(int on)"}, {"doc": ": \"rcx\", \"r11\", \"memory\"); return ret; } /** Release or reclaim the display around a spawned child. static long dmap_vga(int on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_VGA_MODE), \"D\"((long)on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** True for solid cells; out of bounds counts as wall to stay closed.", "kind": "function", "line": 570, "name": "dmap_is_wall", "signature": "static int dmap_is_wall(int row, int col)"}, {"doc": "__asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_VGA_MODE), \"D\"((long)on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** True for solid cells; out of bounds counts as wall to stay closed. static int dmap_is_wall(int row, int col) { if (row < 0 || col < 0 || row >= dmap_h || col >= dmap_w) return 1; return dmap_grid[row][col] == DMAP_WALL; } /** True for cells the player can stand on: floor, markers and things.", "kind": "function", "line": 577, "name": "dmap_walkable", "signature": "static int dmap_walkable(int cell)"}, {"doc": "/** True for solid cells; out of bounds counts as wall to stay closed. static int dmap_is_wall(int row, int col) { if (row < 0 || col < 0 || row >= dmap_h || col >= dmap_w) return 1; return dmap_grid[row][col] == DMAP_WALL; } /** True for cells the player can stand on: floor, markers and things. static int dmap_walkable(int cell) { return cell == DMAP_FLOOR || cell == DMAP_EXIT || cell == DMAP_DOOR || cell == DMAP_DARK || cell == DMAP_NUKE || dmap_thing_type(cell) > 0; } /** Sector class of a walkable cell: doors stand alone, styles never merge.", "kind": "function", "line": 583, "name": "dmap_cell_class", "signature": "static int dmap_cell_class(int cell)"}, {"doc": "} /** Sector class of a walkable cell: doors stand alone, styles never merge. static int dmap_cell_class(int cell) { if (cell == DMAP_DOOR) return 1; if (cell == DMAP_DARK) return 2; if (cell == DMAP_NUKE) return 3; return 0; } /** Canvas ink per cell category, so the palette reads at a glance.", "kind": "function", "line": 594, "name": "dmap_cell_color", "signature": "static struct nk_color dmap_cell_color(int cell)"}, {"doc": "case DMAP_RSUIT: case DMAP_CMAP: case DMAP_LAMP: return nk_rgb(200, 90, 200); case DMAP_KEYB: case DMAP_KEYR: case DMAP_KEYY: return nk_rgb(240, 240, 240); case DMAP_DOOR: return nk_rgb(220, 140, 40); case DMAP_DARK: return nk_rgb(40, 40, 56); case DMAP_NUKE: return nk_rgb(60, 160, 60); default: return nk_rgb(64, 64, 64); } } /** Fill the grid with floor and a solid border.", "kind": "function", "line": 639, "name": "dmap_new", "signature": "static void dmap_new(void)"}, {"doc": "\"########################\", \"#P.....####............#\", \"#..i...+......,,,,,....#\", \"#......####...,,,,,...E#\", \"#..m...#~~~#..,,,,,....#\", \"#......#~~~+....a......#\", \"#..s...#~~~#..d........#\", \"#......#~~~#...........#\", \"########################\", 0 } }; /** Move the preview camera onto the player start tile.", "kind": "function", "line": 804, "name": "dmap_recenter", "signature": "static void dmap_recenter(void)"}, {"doc": "/** Move the preview camera onto the player start tile. static void dmap_recenter(void) { int r, c; for (r = 0; r < dmap_h; r++) for (c = 0; c < dmap_w; c++) if (dmap_grid[r][c] == DMAP_PLAYER) { dmap_px = (float)c + 0.5f; dmap_py = (float)r + 0.5f; } dmap_angle = 0.0f; } /** Load a bundled level into the grid, fail closed on a bad index.", "kind": "function", "line": 816, "name": "dmap_load_preset", "signature": "static int dmap_load_preset(int idx)"}, {"doc": "int ch = dmap_levels[idx][row][k]; if (!dmap_walkable(ch) && ch != DMAP_WALL) return -1; dmap_grid[row][k] = (char)ch; } } dmap_anchor_active = 0; dmap_recenter(); dmap_level_sel = idx + 1; snprintf(dmap_status, sizeof(dmap_status), \"level: %s\", dmap_level_names[idx]); return 0; } /** Xorshift32: the only RNG the editor needs, no libc state.", "kind": "function", "line": 849, "name": "dmap_rand", "signature": "static unsigned dmap_rand(void)"}, {"doc": "dmap_level_sel = idx + 1; snprintf(dmap_status, sizeof(dmap_status), \"level: %s\", dmap_level_names[idx]); return 0; } /** Xorshift32: the only RNG the editor needs, no libc state. static unsigned dmap_rand(void) { dmap_rng ^= dmap_rng << 13; dmap_rng ^= dmap_rng >> 17; dmap_rng ^= dmap_rng << 5; return dmap_rng; } /** One random interior floor cell, 0 when it is not floor.", "kind": "function", "line": 857, "name": "dmap_free_cell", "signature": "static int dmap_free_cell(int *r, int *c)"}, {"doc": "Procedural map of connected rooms: several non-overlapping rect rooms carved out of solid rock, joined in sequence by L corridors, the player starting in the first room and the exit marker in the last one, with the full thing palette scattered on floor cells. Keeps the first layout the validator accepts; the fallback is the plain room when no attempt passes. Each attempt then gains a wall divider pierced by working doors, dark patches and one nukage pool, * so random maps are multi-sector like the bundled ones.", "kind": "function", "line": 871, "name": "dmap_random_map", "signature": "static void dmap_random_map(unsigned seed)"}, {"doc": "} if (dmap_validate(msg, sizeof(msg)) == 0) { dmap_recenter(); snprintf(dmap_status, sizeof(dmap_status), \"random %dx%d %d rooms ok\", dmap_w, dmap_h, nrooms); return; } dmap_rng = dmap_rng * 1664525u + 1013904223u; } dmap_new(); snprintf(dmap_status, sizeof(dmap_status), \"random fell back to plain room\"); } /** Load a grid text file, refusing ragged or illegal content.", "kind": "function", "line": 1077, "name": "dmap_load", "signature": "static int dmap_load(const char *path)"}, {"doc": "if (row < 3 || w < 3 || w > DMAP_MAX_W) return -1; dmap_push_history(); dmap_anchor_active = 0; dmap_w = w; dmap_h = row; for (r = 0; r < dmap_h; r++) for (c = 0; c < dmap_w; c++) dmap_grid[r][c] = tmp[r][c]; dmap_recenter(); return 0; } /** Store the grid as text for later editing sessions.", "kind": "function", "line": 1129, "name": "dmap_save_txt", "signature": "static int dmap_save_txt(const char *path)"}, {"doc": "Sector table backing the multi-sector exporter. Regions are same-class floor areas (doors stand alone, dark and nukage never merge); every region becomes one sector, so light, heights and flats vary per room * while the BSP stays one trivial subsector. static int dmap_sect[DMAP_MAX_H][DMAP_MAX_W]; static int dmap_sec_floor[DMAP_MAX_SECTORS]; static int dmap_sec_ceil[DMAP_MAX_SECTORS]; static int dmap_sec_light[DMAP_MAX_SECTORS]; static int dmap_sec_special[DMAP_MAX_SECTORS]; static int dmap_sec_tag[DMAP_MAX_SECTORS]; static const char *dmap_sec_flat[DMAP_MAX_SECTORS]; static const char *dmap_sec_skin[DMAP_MAX_SECTORS]; /** Flood same-class walkable cells into sector ids; walls stay -1.", "kind": "function", "line": 1163, "name": "dmap_label_regions", "signature": "static int dmap_label_regions(void)"}, {"doc": "dmap_sec_floor[nsec] = DMAP_FLOOR_H; dmap_sec_ceil[nsec] = DMAP_CEIL_H; dmap_sec_flat[nsec] = DMAP_FLOOR_FLAT; dmap_sec_light[nsec] = DMAP_LIGHT; dmap_sec_special[nsec] = 0; dmap_sec_skin[nsec] = DMAP_WALL_MID; } nsec++; } dmap_nsectors = nsec; return 0; } /** Validate the map, reporting the first problem for the status line.", "kind": "function", "line": 1244, "name": "dmap_validate", "signature": "static int dmap_validate(char *msg, int max)"}, {"kind": "function", "line": 1317, "name": "dmap_w8", "signature": "static void dmap_w8(unsigned v)"}, {"kind": "function", "line": 1318, "name": "dmap_w16", "signature": "static void dmap_w16(int v)"}, {"kind": "function", "line": 1322, "name": "dmap_w32", "signature": "static void dmap_w32(int v)"}, {"kind": "function", "line": 1326, "name": "dmap_wtex", "signature": "static void dmap_wtex(const char *name)"}, {"doc": "dmap_wp++ = (unsigned char)(v & 0xFF); dmap_wp++ = (unsigned char)((v >> 8) & 0xFF); } static void dmap_w32(int v) { dmap_w16(v & 0xFFFF); dmap_w16((v >> 16) & 0xFFFF); } static void dmap_wtex(const char *name) { int k; for (k = 0; k < 8; k++) dmap_w8(name[k] ? (unsigned)name[k] : 0u); } /** Stored short angle for a seg direction, matching the engine loader.", "kind": "function", "line": 1333, "name": "dmap_seg_angle", "signature": "static int dmap_seg_angle(int dx, int dy)"}, {"doc": "Compile the grid into a vanilla multi-sector E1M1 PWAD image. Every region and door block is its own sector; all segs share one subsector * under a trivial root node, which needs no ordering.", "kind": "function", "line": 1343, "name": "dmap_build_wad", "signature": "static int dmap_build_wad(int *size_out)"}, {"doc": "dmap_wp = dmap_wad; dmap_w8('P'); dmap_w8('W'); dmap_w8('A'); dmap_w8('D'); dmap_w32(11); dmap_w32(table_off); size_out = total; } } return 0; } /** Write the compiled level to a snapshot path in /saves.", "kind": "function", "line": 1660, "name": "dmap_export_wad", "signature": "static int dmap_export_wad(const char *path)"}, {"doc": "int size = 0; FILE *fp; size_t wrote; if (dmap_build_wad(&size) != 0) return -1; fp = fopen(path, \"wb\"); if (!fp) return -1; wrote = fwrite(dmap_wad, 1, (size_t)size, fp); fclose(fp); return wrote == (size_t)size ? 0 : -1; } /** Validate a PWAD file header and lump census, headless.", "kind": "function", "line": 1675, "name": "dmap_check_wad", "signature": "static int dmap_check_wad(const char *path)"}, {"doc": "if (!fp) return -1; if (fread(head, 1, 12, fp) != 12) { fclose(fp); return -1; } fclose(fp); magic_ok = head[0] == 'P' && head[1] == 'W' && head[2] == 'A' && head[3] == 'D'; if (!magic_ok) return -1; return 0; } /** DDA raycaster preview in the raycastlib grid style, integer math free.", "kind": "function", "line": 1693, "name": "dmap_preview", "signature": "static void dmap_preview(struct nk_command_buffer *canvas, struct nk_rect area)"}, {"doc": "dist = 0.05f; line_h = (int)(area.h / dist); if (line_h > (int)area.h) line_h = (int)area.h; y0 = (int)(area.y + (area.h - (float)line_h) / 2.0f); if (side == 0) shade = nk_rgb(176, 150, 120); else shade = nk_rgb(128, 106, 84); nk_fill_rect(canvas, nk_rect(area.x + (float)col * cell, (float)y0, cell + 1.0f, (float)line_h), 0.0f, shade); } } /** Brush combobox above the canvas: one row for the whole palette.", "kind": "function", "line": 1760, "name": "dmap_brush_combo", "signature": "static void dmap_brush_combo(struct nk_context *ctx)"}, {"doc": "Paintable tile canvas with per-category colors. The caller owns the layout row and column: this only claims the widget, draws and paints. Tools: paint one cell, fill the connected region, or two clicks for a * line / rectangle border. Single edits stay single-undo gestures.", "kind": "function", "line": 1773, "name": "dmap_canvas", "signature": "static void dmap_canvas(struct nk_context *ctx)"}, {"doc": "dmap_draw_rect(dmap_anchor_r, dmap_anchor_c, r, c, dmap_brush); dmap_anchor_active = 0; dmap_level_sel = 0; } } else { dmap_push_history(); dmap_apply_cell(r, c, dmap_brush); dmap_level_sel = 0; } } } } /** Preview strip with turn and step controls bound to the player.", "kind": "function", "line": 1863, "name": "dmap_preview_row", "signature": "static void dmap_preview_row(struct nk_context *ctx)"}, {"doc": "} if (nk_button_label(ctx, \"Reset\")) { int r, c; for (r = 0; r < dmap_h; r++) for (c = 0; c < dmap_w; c++) if (dmap_grid[r][c] == DMAP_PLAYER) { dmap_px = (float)c + 0.5f; dmap_py = (float)r + 0.5f; } dmap_angle = 0.0f; } } /** Export the snapshot pair and boot Doom on the fresh PWAD.", "kind": "function", "line": 1898, "name": "dmap_run_map", "signature": "static void dmap_run_map(void)"}, {"kind": "function", "line": 2037, "name": "dmap_scancode", "signature": "static void dmap_scancode(int code, int make, int e0, void *ud)"}, {"doc": "dmap_ctrl_held = make; return; } if (!make || !dmap_ctrl_held) return; if (code == 0x13) dmap_run_requested = 1; else if (code == 0x2C) dmap_undo_requested = 1; else if (code == 0x15) dmap_redo_requested = 1; } /** Frame loop owning the display exactly like the sibling editors.", "kind": "function", "line": 2056, "name": "dmap_gui_run", "signature": "static void dmap_gui_run(void)"}, {"doc": "nk_set_window_origin(origin[0], origin[1]); nk_clear(&ctx); { unsigned t0 = (unsigned)nk_sys_time_ms(); while ((unsigned)nk_sys_time_ms() - t0 < DMAP_FRAME_MS) __asm__ volatile(\"pause\"); } } nk_free(&ctx); nk_sys_kbd_raw(0); nk_sys_vga_mode(0); } /** Headless demo room shared by --demo and the selftest build check.", "kind": "function", "line": 2110, "name": "dmap_demo_room", "signature": "static void dmap_demo_room(void)"}, {"doc": "/** Headless demo room shared by --demo and the selftest build check. static void dmap_demo_room(void) { dmap_w = 9; dmap_h = 7; dmap_new(); dmap_grid[1][2] = DMAP_FLOOR; dmap_grid[2][7] = DMAP_EXIT; dmap_grid[3][5] = DMAP_IMP; dmap_grid[4][3] = DMAP_MEDI; dmap_grid[2][6] = DMAP_SHELLS; } /** Render one UI frame and prove the composite plus the PWAD builder.", "kind": "function", "line": 2122, "name": "dmap_selftest", "signature": "static int dmap_selftest(void)"}, {"kind": "function", "line": 2246, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 1150, "name": "areas", "signature": "* floor areas (doors stand alone, dark and nukage never merge);"}, {"kind": "macro", "line": 55, "name": "DMAP_MAX_W", "signature": "#define DMAP_MAX_W"}, {"kind": "macro", "line": 56, "name": "DMAP_MAX_H", "signature": "#define DMAP_MAX_H"}, {"kind": "macro", "line": 57, "name": "DMAP_DEF_W", "signature": "#define DMAP_DEF_W"}, {"kind": "macro", "line": 58, "name": "DMAP_DEF_H", "signature": "#define DMAP_DEF_H"}, {"kind": "macro", "line": 59, "name": "DMAP_TILE", "signature": "#define DMAP_TILE"}, {"kind": "macro", "line": 60, "name": "DMAP_CELL_PX", "signature": "#define DMAP_CELL_PX"}, {"kind": "macro", "line": 61, "name": "DMAP_CANVAS_W", "signature": "#define DMAP_CANVAS_W"}, {"kind": "macro", "line": 62, "name": "DMAP_PANEL_MIN_H", "signature": "#define DMAP_PANEL_MIN_H"}, {"kind": "macro", "line": 63, "name": "DMAP_PREV_W", "signature": "#define DMAP_PREV_W"}, {"kind": "macro", "line": 64, "name": "DMAP_PREV_H", "signature": "#define DMAP_PREV_H"}, {"kind": "macro", "line": 65, "name": "DMAP_UI_MEMORY", "signature": "#define DMAP_UI_MEMORY"}, {"kind": "macro", "line": 66, "name": "DMAP_WAD_MAX", "signature": "#define DMAP_WAD_MAX"}, {"kind": "macro", "line": 67, "name": "DMAP_FNAME_MAX", "signature": "#define DMAP_FNAME_MAX"}, {"kind": "macro", "line": 68, "name": "DMAP_STATUS_MAX", "signature": "#define DMAP_STATUS_MAX"}, {"kind": "macro", "line": 69, "name": "DMAP_SLOTS", "signature": "#define DMAP_SLOTS"}, {"kind": "macro", "line": 70, "name": "DMAP_LEVEL_COUNT", "signature": "#define DMAP_LEVEL_COUNT"}, {"kind": "macro", "line": 71, "name": "DMAP_RANDOM_ATTEMPTS", "signature": "#define DMAP_RANDOM_ATTEMPTS"}, {"kind": "macro", "line": 72, "name": "DMAP_MAX_SECTORS", "signature": "#define DMAP_MAX_SECTORS"}, {"kind": "macro", "line": 73, "name": "DMAP_ROOM_MAX", "signature": "#define DMAP_ROOM_MAX"}, {"kind": "macro", "line": 74, "name": "DMAP_ROOM_TRIES", "signature": "#define DMAP_ROOM_TRIES"}, {"kind": "macro", "line": 75, "name": "DMAP_FRAME_MS", "signature": "#define DMAP_FRAME_MS"}, {"kind": "macro", "line": 76, "name": "DMAP_TURN_STEP", "signature": "#define DMAP_TURN_STEP"}, {"kind": "macro", "line": 77, "name": "DMAP_MOVE_STEP", "signature": "#define DMAP_MOVE_STEP"}, {"kind": "macro", "line": 78, "name": "DMAP_FOV_PLANE", "signature": "#define DMAP_FOV_PLANE"}, {"kind": "macro", "line": 79, "name": "DMAP_MAX_LINES", "signature": "#define DMAP_MAX_LINES"}, {"kind": "macro", "line": 80, "name": "DMAP_MAX_VERTS", "signature": "#define DMAP_MAX_VERTS"}, {"kind": "macro", "line": 81, "name": "DMAP_MAX_THINGS", "signature": "#define DMAP_MAX_THINGS"}, {"kind": "macro", "line": 82, "name": "DMAP_PLAYER_TYPE", "signature": "#define DMAP_PLAYER_TYPE"}, {"kind": "macro", "line": 83, "name": "DMAP_THING_OPT", "signature": "#define DMAP_THING_OPT"}, {"kind": "macro", "line": 84, "name": "DMAP_EXIT_SPECIAL", "signature": "#define DMAP_EXIT_SPECIAL"}, {"kind": "macro", "line": 85, "name": "DMAP_DOOR_SPECIAL", "signature": "#define DMAP_DOOR_SPECIAL"}, {"kind": "macro", "line": 86, "name": "DMAP_FLAG_BLOCKING", "signature": "#define DMAP_FLAG_BLOCKING"}, {"kind": "macro", "line": 87, "name": "DMAP_FLAG_TWOSIDED", "signature": "#define DMAP_FLAG_TWOSIDED"}, {"kind": "macro", "line": 88, "name": "DMAP_NO_SIDE", "signature": "#define DMAP_NO_SIDE"}, {"kind": "macro", "line": 89, "name": "DMAP_WALL_MID", "signature": "#define DMAP_WALL_MID"}, {"kind": "macro", "line": 90, "name": "DMAP_EXIT_MID", "signature": "#define DMAP_EXIT_MID"}, {"kind": "macro", "line": 91, "name": "DMAP_DOOR_UPPER", "signature": "#define DMAP_DOOR_UPPER"}, {"kind": "macro", "line": 92, "name": "DMAP_DARK_MID", "signature": "#define DMAP_DARK_MID"}, {"kind": "macro", "line": 93, "name": "DMAP_NUKE_MID", "signature": "#define DMAP_NUKE_MID"}, {"kind": "macro", "line": 94, "name": "DMAP_UNUSED_TEX", "signature": "#define DMAP_UNUSED_TEX"}, {"kind": "macro", "line": 95, "name": "DMAP_FLOOR_FLAT", "signature": "#define DMAP_FLOOR_FLAT"}, {"kind": "macro", "line": 96, "name": "DMAP_NUKE_FLAT", "signature": "#define DMAP_NUKE_FLAT"}, {"kind": "macro", "line": 97, "name": "DMAP_CEIL_FLAT", "signature": "#define DMAP_CEIL_FLAT"}, {"kind": "macro", "line": 98, "name": "DMAP_FLOOR_H", "signature": "#define DMAP_FLOOR_H"}, {"kind": "macro", "line": 99, "name": "DMAP_NUKE_FLOOR", "signature": "#define DMAP_NUKE_FLOOR"}, {"kind": "macro", "line": 100, "name": "DMAP_CEIL_H", "signature": "#define DMAP_CEIL_H"}, {"kind": "macro", "line": 101, "name": "DMAP_DOOR_CEIL", "signature": "#define DMAP_DOOR_CEIL"}, {"kind": "macro", "line": 102, "name": "DMAP_LIGHT", "signature": "#define DMAP_LIGHT"}, {"kind": "macro", "line": 103, "name": "DMAP_DARK_LIGHT", "signature": "#define DMAP_DARK_LIGHT"}, {"kind": "macro", "line": 104, "name": "DMAP_DOOR_LIGHT", "signature": "#define DMAP_DOOR_LIGHT"}, {"kind": "macro", "line": 105, "name": "DMAP_NUKE_SPECIAL", "signature": "#define DMAP_NUKE_SPECIAL"}, {"kind": "macro", "line": 106, "name": "DMAP_NODE_LEAF", "signature": "#define DMAP_NODE_LEAF"}, {"kind": "macro", "line": 107, "name": "DMAP_TOOL_DOOM", "signature": "#define DMAP_TOOL_DOOM"}, {"kind": "macro", "line": 108, "name": "DMAP_SAVE_TXT", "signature": "#define DMAP_SAVE_TXT"}, {"kind": "macro", "line": 109, "name": "DMAP_SAVE_WAD", "signature": "#define DMAP_SAVE_WAD"}, {"kind": "macro", "line": 110, "name": "DMAP_TITLE", "signature": "#define DMAP_TITLE"}, {"kind": "macro", "line": 111, "name": "DMAP_HISTORY", "signature": "#define DMAP_HISTORY"}, {"kind": "macro", "line": 112, "name": "DMAP_TOOL_PAINT", "signature": "#define DMAP_TOOL_PAINT"}, {"kind": "macro", "line": 113, "name": "DMAP_TOOL_LINE", "signature": "#define DMAP_TOOL_LINE"}, {"kind": "macro", "line": 114, "name": "DMAP_TOOL_RECT", "signature": "#define DMAP_TOOL_RECT"}, {"kind": "macro", "line": 115, "name": "DMAP_TOOL_FILL", "signature": "#define DMAP_TOOL_FILL"}, {"kind": "macro", "line": 230, "name": "DMAP_BRUSH_COUNT", "signature": "#define DMAP_BRUSH_COUNT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION:  the automap code", "id": "progs/doomgeneric/am_map.c", "kind": "module", "label": "am_map.c", "language": "c", "sha256": "c647931febd6dd62", "symbol_count": 87, "symbols": [{"kind": "struct", "line": 111, "name": "fpoint_t"}, {"kind": "struct", "line": 116, "name": "fline_t"}, {"kind": "struct", "line": 121, "name": "mpoint_t"}, {"kind": "struct", "line": 126, "name": "mline_t"}, {"kind": "struct", "line": 131, "name": "islope_t"}, {"kind": "function", "line": 275, "name": "AM_getIslope", "signature": "void\nAM_getIslope\n( mline_t*\tml,\n  islope_t*\tis )"}, {"kind": "function", "line": 293, "name": "AM_activateNewScale", "signature": "void AM_activateNewScale(void)"}, {"kind": "function", "line": 308, "name": "AM_saveScaleAndLoc", "signature": "void AM_saveScaleAndLoc(void)"}, {"kind": "function", "line": 319, "name": "AM_restoreScaleAndLoc", "signature": "void AM_restoreScaleAndLoc(void)"}, {"doc": "adds a marker at the current location", "kind": "function", "line": 343, "name": "AM_addMark", "signature": "void AM_addMark(void)"}, {"doc": "Determines bounding box of all vertices, sets global variables controlling zoom range.", "kind": "function", "line": 355, "name": "AM_findMinMaxBoundaries", "signature": "void AM_findMinMaxBoundaries(void)"}, {"kind": "function", "line": 395, "name": "AM_changeWindowLoc", "signature": "void AM_changeWindowLoc(void)"}, {"kind": "function", "line": 424, "name": "AM_initVariables", "signature": "void AM_initVariables(void)"}, {"kind": "function", "line": 480, "name": "AM_loadPics", "signature": "void AM_loadPics(void)"}, {"kind": "function", "line": 493, "name": "AM_unloadPics", "signature": "void AM_unloadPics(void)"}, {"kind": "function", "line": 505, "name": "AM_clearMarks", "signature": "void AM_clearMarks(void)"}, {"doc": "should be called at the start of every level right now, i figure it out myself", "kind": "function", "line": 518, "name": "AM_LevelInit", "signature": "void AM_LevelInit(void)"}, {"kind": "function", "line": 541, "name": "AM_Stop", "signature": "void AM_Stop (void)"}, {"kind": "function", "line": 554, "name": "AM_Start", "signature": "void AM_Start (void)"}, {"doc": "set the window scale to the maximum size", "kind": "function", "line": 573, "name": "AM_minOutWindowScale", "signature": "void AM_minOutWindowScale(void)"}, {"doc": "set the window scale to the minimum size", "kind": "function", "line": 583, "name": "AM_maxOutWindowScale", "signature": "void AM_maxOutWindowScale(void)"}, {"kind": "function", "line": 595, "name": "AM_Responder", "signature": "boolean\nAM_Responder\n( event_t*\tev )"}, {"doc": "Zooming", "kind": "function", "line": 742, "name": "AM_changeWindowScale", "signature": "void AM_changeWindowScale(void)"}, {"kind": "function", "line": 761, "name": "AM_doFollowPlayer", "signature": "void AM_doFollowPlayer(void)"}, {"kind": "function", "line": 785, "name": "AM_updateLightLev", "signature": "void AM_updateLightLev(void)"}, {"doc": "Updates on Game Tick", "kind": "function", "line": 806, "name": "AM_Ticker", "signature": "void AM_Ticker (void)"}, {"doc": "Clear automap frame buffer.", "kind": "function", "line": 834, "name": "AM_clearFB", "signature": "void AM_clearFB(int color)"}, {"kind": "function", "line": 848, "name": "AM_clipMline", "signature": "boolean\nAM_clipMline\n( mline_t*\tml,\n  fline_t*\tfl )"}, {"kind": "function", "line": 984, "name": "AM_drawFline", "signature": "void\nAM_drawFline\n( fline_t*\tfl,\n  int\t\tcolor )"}, {"kind": "function", "line": 1062, "name": "AM_drawMline", "signature": "void\nAM_drawMline\n( mline_t*\tml,\n  int\t\tcolor )"}, {"doc": "Draws flat (floor/ceiling tile) aligned grid lines.", "kind": "function", "line": 1077, "name": "AM_drawGrid", "signature": "void AM_drawGrid(int color)"}, {"doc": "Determines visible lines, draws them. This is LineDef based, not LineSeg based.", "kind": "function", "line": 1123, "name": "AM_drawWalls", "signature": "void AM_drawWalls(void)"}, {"kind": "function", "line": 1179, "name": "AM_rotate", "signature": "void\nAM_rotate\n( fixed_t*\tx,\n  fixed_t*\ty,\n  angle_t\ta )"}, {"kind": "function", "line": 1198, "name": "AM_drawLineCharacter", "signature": "void\nAM_drawLineCharacter\n( mline_t*\tlineguy,\n  int\t\tlineguylines,\n  fixed_t\tscale,\n  angle_t\tang..."}, {"kind": "function", "line": 1246, "name": "AM_drawPlayers", "signature": "void AM_drawPlayers(void)"}, {"kind": "function", "line": 1291, "name": "AM_drawThings", "signature": "void\nAM_drawThings\n( int\tcolors,\n  int \tcolorrange)"}, {"kind": "function", "line": 1311, "name": "AM_drawMarks", "signature": "void AM_drawMarks(void)"}, {"kind": "function", "line": 1332, "name": "AM_drawCrosshair", "signature": "void AM_drawCrosshair(int color)"}, {"kind": "function", "line": 1338, "name": "AM_Drawer", "signature": "void AM_Drawer (void)"}, {"kind": "macro", "line": 50, "name": "REDS", "signature": "#define REDS"}, {"kind": "macro", "line": 51, "name": "REDRANGE", "signature": "#define REDRANGE"}, {"kind": "macro", "line": 52, "name": "BLUES", "signature": "#define BLUES"}, {"kind": "macro", "line": 53, "name": "BLUERANGE", "signature": "#define BLUERANGE"}, {"kind": "macro", "line": 54, "name": "GREENS", "signature": "#define GREENS"}, {"kind": "macro", "line": 55, "name": "GREENRANGE", "signature": "#define GREENRANGE"}, {"kind": "macro", "line": 56, "name": "GRAYS", "signature": "#define GRAYS"}, {"kind": "macro", "line": 57, "name": "GRAYSRANGE", "signature": "#define GRAYSRANGE"}, {"kind": "macro", "line": 58, "name": "BROWNS", "signature": "#define BROWNS"}, {"kind": "macro", "line": 59, "name": "BROWNRANGE", "signature": "#define BROWNRANGE"}, {"kind": "macro", "line": 60, "name": "YELLOWS", "signature": "#define YELLOWS"}, {"kind": "macro", "line": 61, "name": "YELLOWRANGE", "signature": "#define YELLOWRANGE"}, {"kind": "macro", "line": 62, "name": "BLACK", "signature": "#define BLACK"}, {"kind": "macro", "line": 63, "name": "WHITE", "signature": "#define WHITE"}, {"kind": "macro", "line": 66, "name": "BACKGROUND", "signature": "#define BACKGROUND"}, {"kind": "macro", "line": 67, "name": "YOURCOLORS", "signature": "#define YOURCOLORS"}, {"kind": "macro", "line": 68, "name": "YOURRANGE", "signature": "#define YOURRANGE"}, {"kind": "macro", "line": 69, "name": "WALLCOLORS", "signature": "#define WALLCOLORS"}, {"kind": "macro", "line": 70, "name": "WALLRANGE", "signature": "#define WALLRANGE"}, {"kind": "macro", "line": 71, "name": "TSWALLCOLORS", "signature": "#define TSWALLCOLORS"}, {"kind": "macro", "line": 72, "name": "TSWALLRANGE", "signature": "#define TSWALLRANGE"}, {"kind": "macro", "line": 73, "name": "FDWALLCOLORS", "signature": "#define FDWALLCOLORS"}, {"kind": "macro", "line": 74, "name": "FDWALLRANGE", "signature": "#define FDWALLRANGE"}, {"kind": "macro", "line": 75, "name": "CDWALLCOLORS", "signature": "#define CDWALLCOLORS"}, {"kind": "macro", "line": 76, "name": "CDWALLRANGE", "signature": "#define CDWALLRANGE"}, {"kind": "macro", "line": 77, "name": "THINGCOLORS", "signature": "#define THINGCOLORS"}, {"kind": "macro", "line": 78, "name": "THINGRANGE", "signature": "#define THINGRANGE"}, {"kind": "macro", "line": 79, "name": "SECRETWALLCOLORS", "signature": "#define SECRETWALLCOLORS"}, {"kind": "macro", "line": 80, "name": "SECRETWALLRANGE", "signature": "#define SECRETWALLRANGE"}, {"kind": "macro", "line": 81, "name": "GRIDCOLORS", "signature": "#define GRIDCOLORS"}, {"kind": "macro", "line": 82, "name": "GRIDRANGE", "signature": "#define GRIDRANGE"}, {"kind": "macro", "line": 83, "name": "XHAIRCOLORS", "signature": "#define XHAIRCOLORS"}, {"kind": "macro", "line": 87, "name": "AM_NUMMARKPOINTS", "signature": "#define AM_NUMMARKPOINTS"}, {"kind": "macro", "line": 90, "name": "INITSCALEMTOF", "signature": "#define INITSCALEMTOF"}, {"kind": "macro", "line": 93, "name": "F_PANINC", "signature": "#define F_PANINC"}, {"kind": "macro", "line": 96, "name": "M_ZOOMIN", "signature": "#define M_ZOOMIN"}, {"kind": "macro", "line": 99, "name": "M_ZOOMOUT", "signature": "#define M_ZOOMOUT"}, {"kind": "macro", "line": 102, "name": "FTOM", "signature": "#define FTOM(x)"}, {"kind": "macro", "line": 103, "name": "MTOF", "signature": "#define MTOF(x)"}, {"kind": "macro", "line": 105, "name": "CXMTOF", "signature": "#define CXMTOF(x)"}, {"kind": "macro", "line": 106, "name": "CYMTOF", "signature": "#define CYMTOF(y)"}, {"kind": "macro", "line": 109, "name": "LINE_NEVERSEE", "signature": "#define LINE_NEVERSEE"}, {"kind": "macro", "line": 143, "name": "R", "signature": "#define R"}, {"kind": "macro", "line": 155, "name": "R", "signature": "#define R"}, {"kind": "macro", "line": 176, "name": "R", "signature": "#define R"}, {"kind": "macro", "line": 184, "name": "R", "signature": "#define R"}, {"kind": "macro", "line": 869, "name": "DOOUTCODE", "signature": "#define DOOUTCODE(oc, mx, my)"}, {"kind": "macro", "line": 1010, "name": "PUTDOT", "signature": "#define PUTDOT(xx,yy,cc)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: AutoMap module.     Used by ST StatusBar stuff.", "id": "progs/doomgeneric/am_map.h", "kind": "module", "label": "am_map.h", "language": "h", "sha256": "f67d32a2b1bd5ca5", "symbol_count": 8, "symbols": [{"doc": "Called by main loop.", "kind": "function", "line": 35, "name": "AM_Ticker", "signature": "void AM_Ticker (void);"}, {"doc": "Called by main loop, called instead of view drawer if automap active.", "kind": "function", "line": 39, "name": "AM_Drawer", "signature": "void AM_Drawer (void);"}, {"doc": "Called to force the automap to quit if the level is completed while it is up.", "kind": "function", "line": 43, "name": "AM_Stop", "signature": "void AM_Stop (void);"}, {"kind": "variable", "line": 46, "name": "cheat_amap", "signature": "extern cheatseq_t cheat_amap;"}, {"kind": "macro", "line": 20, "name": "__AMMAP_H__", "signature": "#define __AMMAP_H__"}, {"kind": "macro", "line": 26, "name": "AM_MSGHEADER", "signature": "#define AM_MSGHEADER"}, {"kind": "macro", "line": 27, "name": "AM_MSGENTERED", "signature": "#define AM_MSGENTERED"}, {"kind": "macro", "line": 28, "name": "AM_MSGEXITED", "signature": "#define AM_MSGEXITED"}]}, {"doc": "config.hin.  Generated from configure.ac by autoheader.", "id": "progs/doomgeneric/config.h", "kind": "module", "label": "config.h", "language": "h", "sha256": "07384b139305b90c", "symbol_count": 16, "symbols": [{"kind": "macro", "line": 10, "name": "HAVE_INTTYPES_H", "signature": "#define HAVE_INTTYPES_H"}, {"kind": "macro", "line": 46, "name": "HAVE_STDINT_H", "signature": "#define HAVE_STDINT_H"}, {"kind": "macro", "line": 49, "name": "HAVE_STDLIB_H", "signature": "#define HAVE_STDLIB_H"}, {"kind": "macro", "line": 52, "name": "HAVE_STRINGS_H", "signature": "#define HAVE_STRINGS_H"}, {"kind": "macro", "line": 55, "name": "HAVE_STRING_H", "signature": "#define HAVE_STRING_H"}, {"kind": "macro", "line": 61, "name": "HAVE_SYS_TYPES_H", "signature": "#define HAVE_SYS_TYPES_H"}, {"kind": "macro", "line": 67, "name": "PACKAGE", "signature": "#define PACKAGE"}, {"kind": "macro", "line": 73, "name": "PACKAGE_NAME", "signature": "#define PACKAGE_NAME"}, {"kind": "macro", "line": 76, "name": "PACKAGE_STRING", "signature": "#define PACKAGE_STRING"}, {"kind": "macro", "line": 79, "name": "PACKAGE_TARNAME", "signature": "#define PACKAGE_TARNAME"}, {"kind": "macro", "line": 82, "name": "PACKAGE_URL", "signature": "#define PACKAGE_URL"}, {"kind": "macro", "line": 85, "name": "PACKAGE_VERSION", "signature": "#define PACKAGE_VERSION"}, {"kind": "macro", "line": 88, "name": "PROGRAM_PREFIX", "signature": "#define PROGRAM_PREFIX"}, {"kind": "macro", "line": 91, "name": "STDC_HEADERS", "signature": "#define STDC_HEADERS"}, {"kind": "macro", "line": 94, "name": "VERSION", "signature": "#define VERSION"}, {"kind": "macro", "line": 100, "name": "FILES_DIR", "signature": "#define FILES_DIR"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Printed strings for translation. English language support (default).     Printed strings for translation    D_Main.C", "id": "progs/doomgeneric/d_englsh.h", "kind": "module", "label": "d_englsh.h", "language": "h", "sha256": "14f84bbe6070a8bf", "symbol_count": 286, "symbols": [{"kind": "macro", "line": 21, "name": "__D_ENGLSH__", "signature": "#define __D_ENGLSH__"}, {"kind": "macro", "line": 30, "name": "D_DEVSTR", "signature": "#define D_DEVSTR"}, {"kind": "macro", "line": 31, "name": "D_CDROM", "signature": "#define D_CDROM"}, {"kind": "macro", "line": 36, "name": "PRESSKEY", "signature": "#define PRESSKEY"}, {"kind": "macro", "line": 37, "name": "PRESSYN", "signature": "#define PRESSYN"}, {"kind": "macro", "line": 38, "name": "QUITMSG", "signature": "#define QUITMSG"}, {"kind": "macro", "line": 39, "name": "LOADNET", "signature": "#define LOADNET"}, {"kind": "macro", "line": 40, "name": "QLOADNET", "signature": "#define QLOADNET"}, {"kind": "macro", "line": 41, "name": "QSAVESPOT", "signature": "#define QSAVESPOT"}, {"kind": "macro", "line": 42, "name": "SAVEDEAD", "signature": "#define SAVEDEAD"}, {"kind": "macro", "line": 43, "name": "QSPROMPT", "signature": "#define QSPROMPT"}, {"kind": "macro", "line": 44, "name": "QLPROMPT", "signature": "#define QLPROMPT"}, {"kind": "macro", "line": 46, "name": "NEWGAME", "signature": "#define NEWGAME"}, {"kind": "macro", "line": 50, "name": "NIGHTMARE", "signature": "#define NIGHTMARE"}, {"kind": "macro", "line": 54, "name": "SWSTRING", "signature": "#define SWSTRING"}, {"kind": "macro", "line": 58, "name": "MSGOFF", "signature": "#define MSGOFF"}, {"kind": "macro", "line": 59, "name": "MSGON", "signature": "#define MSGON"}, {"kind": "macro", "line": 60, "name": "NETEND", "signature": "#define NETEND"}, {"kind": "macro", "line": 61, "name": "ENDGAME", "signature": "#define ENDGAME"}, {"kind": "macro", "line": 63, "name": "DOSY", "signature": "#define DOSY"}, {"kind": "macro", "line": 65, "name": "DETAILHI", "signature": "#define DETAILHI"}, {"kind": "macro", "line": 66, "name": "DETAILLO", "signature": "#define DETAILLO"}, {"kind": "macro", "line": 67, "name": "GAMMALVL0", "signature": "#define GAMMALVL0"}, {"kind": "macro", "line": 68, "name": "GAMMALVL1", "signature": "#define GAMMALVL1"}, {"kind": "macro", "line": 69, "name": "GAMMALVL2", "signature": "#define GAMMALVL2"}, {"kind": "macro", "line": 70, "name": "GAMMALVL3", "signature": "#define GAMMALVL3"}, {"kind": "macro", "line": 71, "name": "GAMMALVL4", "signature": "#define GAMMALVL4"}, {"kind": "macro", "line": 72, "name": "EMPTYSTRING", "signature": "#define EMPTYSTRING"}, {"kind": "macro", "line": 77, "name": "GOTARMOR", "signature": "#define GOTARMOR"}, {"kind": "macro", "line": 78, "name": "GOTMEGA", "signature": "#define GOTMEGA"}, {"kind": "macro", "line": 79, "name": "GOTHTHBONUS", "signature": "#define GOTHTHBONUS"}, {"kind": "macro", "line": 80, "name": "GOTARMBONUS", "signature": "#define GOTARMBONUS"}, {"kind": "macro", "line": 81, "name": "GOTSTIM", "signature": "#define GOTSTIM"}, {"kind": "macro", "line": 82, "name": "GOTMEDINEED", "signature": "#define GOTMEDINEED"}, {"kind": "macro", "line": 83, "name": "GOTMEDIKIT", "signature": "#define GOTMEDIKIT"}, {"kind": "macro", "line": 84, "name": "GOTSUPER", "signature": "#define GOTSUPER"}, {"kind": "macro", "line": 86, "name": "GOTBLUECARD", "signature": "#define GOTBLUECARD"}, {"kind": "macro", "line": 87, "name": "GOTYELWCARD", "signature": "#define GOTYELWCARD"}, {"kind": "macro", "line": 88, "name": "GOTREDCARD", "signature": "#define GOTREDCARD"}, {"kind": "macro", "line": 89, "name": "GOTBLUESKUL", "signature": "#define GOTBLUESKUL"}, {"kind": "macro", "line": 90, "name": "GOTYELWSKUL", "signature": "#define GOTYELWSKUL"}, {"kind": "macro", "line": 91, "name": "GOTREDSKULL", "signature": "#define GOTREDSKULL"}, {"kind": "macro", "line": 93, "name": "GOTINVUL", "signature": "#define GOTINVUL"}, {"kind": "macro", "line": 94, "name": "GOTBERSERK", "signature": "#define GOTBERSERK"}, {"kind": "macro", "line": 95, "name": "GOTINVIS", "signature": "#define GOTINVIS"}, {"kind": "macro", "line": 96, "name": "GOTSUIT", "signature": "#define GOTSUIT"}, {"kind": "macro", "line": 97, "name": "GOTMAP", "signature": "#define GOTMAP"}, {"kind": "macro", "line": 98, "name": "GOTVISOR", "signature": "#define GOTVISOR"}, {"kind": "macro", "line": 99, "name": "GOTMSPHERE", "signature": "#define GOTMSPHERE"}, {"kind": "macro", "line": 101, "name": "GOTCLIP", "signature": "#define GOTCLIP"}, {"kind": "macro", "line": 102, "name": "GOTCLIPBOX", "signature": "#define GOTCLIPBOX"}, {"kind": "macro", "line": 103, "name": "GOTROCKET", "signature": "#define GOTROCKET"}, {"kind": "macro", "line": 104, "name": "GOTROCKBOX", "signature": "#define GOTROCKBOX"}, {"kind": "macro", "line": 105, "name": "GOTCELL", "signature": "#define GOTCELL"}, {"kind": "macro", "line": 106, "name": "GOTCELLBOX", "signature": "#define GOTCELLBOX"}, {"kind": "macro", "line": 107, "name": "GOTSHELLS", "signature": "#define GOTSHELLS"}, {"kind": "macro", "line": 108, "name": "GOTSHELLBOX", "signature": "#define GOTSHELLBOX"}, {"kind": "macro", "line": 109, "name": "GOTBACKPACK", "signature": "#define GOTBACKPACK"}, {"kind": "macro", "line": 111, "name": "GOTBFG9000", "signature": "#define GOTBFG9000"}, {"kind": "macro", "line": 112, "name": "GOTCHAINGUN", "signature": "#define GOTCHAINGUN"}, {"kind": "macro", "line": 113, "name": "GOTCHAINSAW", "signature": "#define GOTCHAINSAW"}, {"kind": "macro", "line": 114, "name": "GOTLAUNCHER", "signature": "#define GOTLAUNCHER"}, {"kind": "macro", "line": 115, "name": "GOTPLASMA", "signature": "#define GOTPLASMA"}, {"kind": "macro", "line": 116, "name": "GOTSHOTGUN", "signature": "#define GOTSHOTGUN"}, {"kind": "macro", "line": 117, "name": "GOTSHOTGUN2", "signature": "#define GOTSHOTGUN2"}, {"kind": "macro", "line": 122, "name": "PD_BLUEO", "signature": "#define PD_BLUEO"}, {"kind": "macro", "line": 123, "name": "PD_REDO", "signature": "#define PD_REDO"}, {"kind": "macro", "line": 124, "name": "PD_YELLOWO", "signature": "#define PD_YELLOWO"}, {"kind": "macro", "line": 125, "name": "PD_BLUEK", "signature": "#define PD_BLUEK"}, {"kind": "macro", "line": 126, "name": "PD_REDK", "signature": "#define PD_REDK"}, {"kind": "macro", "line": 127, "name": "PD_YELLOWK", "signature": "#define PD_YELLOWK"}, {"kind": "macro", "line": 132, "name": "GGSAVED", "signature": "#define GGSAVED"}, {"kind": "macro", "line": 137, "name": "HUSTR_MSGU", "signature": "#define HUSTR_MSGU"}, {"kind": "macro", "line": 139, "name": "HUSTR_E1M1", "signature": "#define HUSTR_E1M1"}, {"kind": "macro", "line": 140, "name": "HUSTR_E1M2", "signature": "#define HUSTR_E1M2"}, {"kind": "macro", "line": 141, "name": "HUSTR_E1M3", "signature": "#define HUSTR_E1M3"}, {"kind": "macro", "line": 142, "name": "HUSTR_E1M4", "signature": "#define HUSTR_E1M4"}, {"kind": "macro", "line": 143, "name": "HUSTR_E1M5", "signature": "#define HUSTR_E1M5"}, {"kind": "macro", "line": 144, "name": "HUSTR_E1M6", "signature": "#define HUSTR_E1M6"}, {"kind": "macro", "line": 145, "name": "HUSTR_E1M7", "signature": "#define HUSTR_E1M7"}, {"kind": "macro", "line": 146, "name": "HUSTR_E1M8", "signature": "#define HUSTR_E1M8"}, {"kind": "macro", "line": 147, "name": "HUSTR_E1M9", "signature": "#define HUSTR_E1M9"}, {"kind": "macro", "line": 149, "name": "HUSTR_E2M1", "signature": "#define HUSTR_E2M1"}, {"kind": "macro", "line": 150, "name": "HUSTR_E2M2", "signature": "#define HUSTR_E2M2"}, {"kind": "macro", "line": 151, "name": "HUSTR_E2M3", "signature": "#define HUSTR_E2M3"}, {"kind": "macro", "line": 152, "name": "HUSTR_E2M4", "signature": "#define HUSTR_E2M4"}, {"kind": "macro", "line": 153, "name": "HUSTR_E2M5", "signature": "#define HUSTR_E2M5"}, {"kind": "macro", "line": 154, "name": "HUSTR_E2M6", "signature": "#define HUSTR_E2M6"}, {"kind": "macro", "line": 155, "name": "HUSTR_E2M7", "signature": "#define HUSTR_E2M7"}, {"kind": "macro", "line": 156, "name": "HUSTR_E2M8", "signature": "#define HUSTR_E2M8"}, {"kind": "macro", "line": 157, "name": "HUSTR_E2M9", "signature": "#define HUSTR_E2M9"}, {"kind": "macro", "line": 159, "name": "HUSTR_E3M1", "signature": "#define HUSTR_E3M1"}, {"kind": "macro", "line": 160, "name": "HUSTR_E3M2", "signature": "#define HUSTR_E3M2"}, {"kind": "macro", "line": 161, "name": "HUSTR_E3M3", "signature": "#define HUSTR_E3M3"}, {"kind": "macro", "line": 162, "name": "HUSTR_E3M4", "signature": "#define HUSTR_E3M4"}, {"kind": "macro", "line": 163, "name": "HUSTR_E3M5", "signature": "#define HUSTR_E3M5"}, {"kind": "macro", "line": 164, "name": "HUSTR_E3M6", "signature": "#define HUSTR_E3M6"}, {"kind": "macro", "line": 165, "name": "HUSTR_E3M7", "signature": "#define HUSTR_E3M7"}, {"kind": "macro", "line": 166, "name": "HUSTR_E3M8", "signature": "#define HUSTR_E3M8"}, {"kind": "macro", "line": 167, "name": "HUSTR_E3M9", "signature": "#define HUSTR_E3M9"}, {"kind": "macro", "line": 169, "name": "HUSTR_E4M1", "signature": "#define HUSTR_E4M1"}, {"kind": "macro", "line": 170, "name": "HUSTR_E4M2", "signature": "#define HUSTR_E4M2"}, {"kind": "macro", "line": 171, "name": "HUSTR_E4M3", "signature": "#define HUSTR_E4M3"}, {"kind": "macro", "line": 172, "name": "HUSTR_E4M4", "signature": "#define HUSTR_E4M4"}, {"kind": "macro", "line": 173, "name": "HUSTR_E4M5", "signature": "#define HUSTR_E4M5"}, {"kind": "macro", "line": 174, "name": "HUSTR_E4M6", "signature": "#define HUSTR_E4M6"}, {"kind": "macro", "line": 175, "name": "HUSTR_E4M7", "signature": "#define HUSTR_E4M7"}, {"kind": "macro", "line": 176, "name": "HUSTR_E4M8", "signature": "#define HUSTR_E4M8"}, {"kind": "macro", "line": 177, "name": "HUSTR_E4M9", "signature": "#define HUSTR_E4M9"}, {"kind": "macro", "line": 179, "name": "HUSTR_1", "signature": "#define HUSTR_1"}, {"kind": "macro", "line": 180, "name": "HUSTR_2", "signature": "#define HUSTR_2"}, {"kind": "macro", "line": 181, "name": "HUSTR_3", "signature": "#define HUSTR_3"}, {"kind": "macro", "line": 182, "name": "HUSTR_4", "signature": "#define HUSTR_4"}, {"kind": "macro", "line": 183, "name": "HUSTR_5", "signature": "#define HUSTR_5"}, {"kind": "macro", "line": 184, "name": "HUSTR_6", "signature": "#define HUSTR_6"}, {"kind": "macro", "line": 185, "name": "HUSTR_7", "signature": "#define HUSTR_7"}, {"kind": "macro", "line": 186, "name": "HUSTR_8", "signature": "#define HUSTR_8"}, {"kind": "macro", "line": 187, "name": "HUSTR_9", "signature": "#define HUSTR_9"}, {"kind": "macro", "line": 188, "name": "HUSTR_10", "signature": "#define HUSTR_10"}, {"kind": "macro", "line": 189, "name": "HUSTR_11", "signature": "#define HUSTR_11"}, {"kind": "macro", "line": 191, "name": "HUSTR_12", "signature": "#define HUSTR_12"}, {"kind": "macro", "line": 192, "name": "HUSTR_13", "signature": "#define HUSTR_13"}, {"kind": "macro", "line": 193, "name": "HUSTR_14", "signature": "#define HUSTR_14"}, {"kind": "macro", "line": 194, "name": "HUSTR_15", "signature": "#define HUSTR_15"}, {"kind": "macro", "line": 195, "name": "HUSTR_16", "signature": "#define HUSTR_16"}, {"kind": "macro", "line": 196, "name": "HUSTR_17", "signature": "#define HUSTR_17"}, {"kind": "macro", "line": 197, "name": "HUSTR_18", "signature": "#define HUSTR_18"}, {"kind": "macro", "line": 198, "name": "HUSTR_19", "signature": "#define HUSTR_19"}, {"kind": "macro", "line": 199, "name": "HUSTR_20", "signature": "#define HUSTR_20"}, {"kind": "macro", "line": 201, "name": "HUSTR_21", "signature": "#define HUSTR_21"}, {"kind": "macro", "line": 202, "name": "HUSTR_22", "signature": "#define HUSTR_22"}, {"kind": "macro", "line": 203, "name": "HUSTR_23", "signature": "#define HUSTR_23"}, {"kind": "macro", "line": 204, "name": "HUSTR_24", "signature": "#define HUSTR_24"}, {"kind": "macro", "line": 205, "name": "HUSTR_25", "signature": "#define HUSTR_25"}, {"kind": "macro", "line": 206, "name": "HUSTR_26", "signature": "#define HUSTR_26"}, {"kind": "macro", "line": 207, "name": "HUSTR_27", "signature": "#define HUSTR_27"}, {"kind": "macro", "line": 208, "name": "HUSTR_28", "signature": "#define HUSTR_28"}, {"kind": "macro", "line": 209, "name": "HUSTR_29", "signature": "#define HUSTR_29"}, {"kind": "macro", "line": 210, "name": "HUSTR_30", "signature": "#define HUSTR_30"}, {"kind": "macro", "line": 212, "name": "HUSTR_31", "signature": "#define HUSTR_31"}, {"kind": "macro", "line": 213, "name": "HUSTR_32", "signature": "#define HUSTR_32"}, {"kind": "macro", "line": 215, "name": "PHUSTR_1", "signature": "#define PHUSTR_1"}, {"kind": "macro", "line": 216, "name": "PHUSTR_2", "signature": "#define PHUSTR_2"}, {"kind": "macro", "line": 217, "name": "PHUSTR_3", "signature": "#define PHUSTR_3"}, {"kind": "macro", "line": 218, "name": "PHUSTR_4", "signature": "#define PHUSTR_4"}, {"kind": "macro", "line": 219, "name": "PHUSTR_5", "signature": "#define PHUSTR_5"}, {"kind": "macro", "line": 220, "name": "PHUSTR_6", "signature": "#define PHUSTR_6"}, {"kind": "macro", "line": 221, "name": "PHUSTR_7", "signature": "#define PHUSTR_7"}, {"kind": "macro", "line": 222, "name": "PHUSTR_8", "signature": "#define PHUSTR_8"}, {"kind": "macro", "line": 223, "name": "PHUSTR_9", "signature": "#define PHUSTR_9"}, {"kind": "macro", "line": 224, "name": "PHUSTR_10", "signature": "#define PHUSTR_10"}, {"kind": "macro", "line": 225, "name": "PHUSTR_11", "signature": "#define PHUSTR_11"}, {"kind": "macro", "line": 227, "name": "PHUSTR_12", "signature": "#define PHUSTR_12"}, {"kind": "macro", "line": 228, "name": "PHUSTR_13", "signature": "#define PHUSTR_13"}, {"kind": "macro", "line": 229, "name": "PHUSTR_14", "signature": "#define PHUSTR_14"}, {"kind": "macro", "line": 230, "name": "PHUSTR_15", "signature": "#define PHUSTR_15"}, {"kind": "macro", "line": 231, "name": "PHUSTR_16", "signature": "#define PHUSTR_16"}, {"kind": "macro", "line": 232, "name": "PHUSTR_17", "signature": "#define PHUSTR_17"}, {"kind": "macro", "line": 233, "name": "PHUSTR_18", "signature": "#define PHUSTR_18"}, {"kind": "macro", "line": 234, "name": "PHUSTR_19", "signature": "#define PHUSTR_19"}, {"kind": "macro", "line": 235, "name": "PHUSTR_20", "signature": "#define PHUSTR_20"}, {"kind": "macro", "line": 237, "name": "PHUSTR_21", "signature": "#define PHUSTR_21"}, {"kind": "macro", "line": 238, "name": "PHUSTR_22", "signature": "#define PHUSTR_22"}, {"kind": "macro", "line": 239, "name": "PHUSTR_23", "signature": "#define PHUSTR_23"}, {"kind": "macro", "line": 240, "name": "PHUSTR_24", "signature": "#define PHUSTR_24"}, {"kind": "macro", "line": 241, "name": "PHUSTR_25", "signature": "#define PHUSTR_25"}, {"kind": "macro", "line": 242, "name": "PHUSTR_26", "signature": "#define PHUSTR_26"}, {"kind": "macro", "line": 243, "name": "PHUSTR_27", "signature": "#define PHUSTR_27"}, {"kind": "macro", "line": 244, "name": "PHUSTR_28", "signature": "#define PHUSTR_28"}, {"kind": "macro", "line": 245, "name": "PHUSTR_29", "signature": "#define PHUSTR_29"}, {"kind": "macro", "line": 246, "name": "PHUSTR_30", "signature": "#define PHUSTR_30"}, {"kind": "macro", "line": 248, "name": "PHUSTR_31", "signature": "#define PHUSTR_31"}, {"kind": "macro", "line": 249, "name": "PHUSTR_32", "signature": "#define PHUSTR_32"}, {"kind": "macro", "line": 251, "name": "THUSTR_1", "signature": "#define THUSTR_1"}, {"kind": "macro", "line": 252, "name": "THUSTR_2", "signature": "#define THUSTR_2"}, {"kind": "macro", "line": 253, "name": "THUSTR_3", "signature": "#define THUSTR_3"}, {"kind": "macro", "line": 254, "name": "THUSTR_4", "signature": "#define THUSTR_4"}, {"kind": "macro", "line": 255, "name": "THUSTR_5", "signature": "#define THUSTR_5"}, {"kind": "macro", "line": 256, "name": "THUSTR_6", "signature": "#define THUSTR_6"}, {"kind": "macro", "line": 257, "name": "THUSTR_7", "signature": "#define THUSTR_7"}, {"kind": "macro", "line": 258, "name": "THUSTR_8", "signature": "#define THUSTR_8"}, {"kind": "macro", "line": 259, "name": "THUSTR_9", "signature": "#define THUSTR_9"}, {"kind": "macro", "line": 260, "name": "THUSTR_10", "signature": "#define THUSTR_10"}, {"kind": "macro", "line": 261, "name": "THUSTR_11", "signature": "#define THUSTR_11"}, {"kind": "macro", "line": 263, "name": "THUSTR_12", "signature": "#define THUSTR_12"}, {"kind": "macro", "line": 264, "name": "THUSTR_13", "signature": "#define THUSTR_13"}, {"kind": "macro", "line": 265, "name": "THUSTR_14", "signature": "#define THUSTR_14"}, {"kind": "macro", "line": 266, "name": "THUSTR_15", "signature": "#define THUSTR_15"}, {"kind": "macro", "line": 267, "name": "THUSTR_16", "signature": "#define THUSTR_16"}, {"kind": "macro", "line": 268, "name": "THUSTR_17", "signature": "#define THUSTR_17"}, {"kind": "macro", "line": 269, "name": "THUSTR_18", "signature": "#define THUSTR_18"}, {"kind": "macro", "line": 270, "name": "THUSTR_19", "signature": "#define THUSTR_19"}, {"kind": "macro", "line": 271, "name": "THUSTR_20", "signature": "#define THUSTR_20"}, {"kind": "macro", "line": 273, "name": "THUSTR_21", "signature": "#define THUSTR_21"}, {"kind": "macro", "line": 274, "name": "THUSTR_22", "signature": "#define THUSTR_22"}, {"kind": "macro", "line": 275, "name": "THUSTR_23", "signature": "#define THUSTR_23"}, {"kind": "macro", "line": 276, "name": "THUSTR_24", "signature": "#define THUSTR_24"}, {"kind": "macro", "line": 277, "name": "THUSTR_25", "signature": "#define THUSTR_25"}, {"kind": "macro", "line": 278, "name": "THUSTR_26", "signature": "#define THUSTR_26"}, {"kind": "macro", "line": 279, "name": "THUSTR_27", "signature": "#define THUSTR_27"}, {"kind": "macro", "line": 280, "name": "THUSTR_28", "signature": "#define THUSTR_28"}, {"kind": "macro", "line": 281, "name": "THUSTR_29", "signature": "#define THUSTR_29"}, {"kind": "macro", "line": 282, "name": "THUSTR_30", "signature": "#define THUSTR_30"}, {"kind": "macro", "line": 284, "name": "THUSTR_31", "signature": "#define THUSTR_31"}, {"kind": "macro", "line": 285, "name": "THUSTR_32", "signature": "#define THUSTR_32"}, {"kind": "macro", "line": 287, "name": "HUSTR_CHATMACRO1", "signature": "#define HUSTR_CHATMACRO1"}, {"kind": "macro", "line": 288, "name": "HUSTR_CHATMACRO2", "signature": "#define HUSTR_CHATMACRO2"}, {"kind": "macro", "line": 289, "name": "HUSTR_CHATMACRO3", "signature": "#define HUSTR_CHATMACRO3"}, {"kind": "macro", "line": 290, "name": "HUSTR_CHATMACRO4", "signature": "#define HUSTR_CHATMACRO4"}, {"kind": "macro", "line": 291, "name": "HUSTR_CHATMACRO5", "signature": "#define HUSTR_CHATMACRO5"}, {"kind": "macro", "line": 292, "name": "HUSTR_CHATMACRO6", "signature": "#define HUSTR_CHATMACRO6"}, {"kind": "macro", "line": 293, "name": "HUSTR_CHATMACRO7", "signature": "#define HUSTR_CHATMACRO7"}, {"kind": "macro", "line": 294, "name": "HUSTR_CHATMACRO8", "signature": "#define HUSTR_CHATMACRO8"}, {"kind": "macro", "line": 295, "name": "HUSTR_CHATMACRO9", "signature": "#define HUSTR_CHATMACRO9"}, {"kind": "macro", "line": 296, "name": "HUSTR_CHATMACRO0", "signature": "#define HUSTR_CHATMACRO0"}, {"kind": "macro", "line": 298, "name": "HUSTR_TALKTOSELF1", "signature": "#define HUSTR_TALKTOSELF1"}, {"kind": "macro", "line": 299, "name": "HUSTR_TALKTOSELF2", "signature": "#define HUSTR_TALKTOSELF2"}, {"kind": "macro", "line": 300, "name": "HUSTR_TALKTOSELF3", "signature": "#define HUSTR_TALKTOSELF3"}, {"kind": "macro", "line": 301, "name": "HUSTR_TALKTOSELF4", "signature": "#define HUSTR_TALKTOSELF4"}, {"kind": "macro", "line": 302, "name": "HUSTR_TALKTOSELF5", "signature": "#define HUSTR_TALKTOSELF5"}, {"kind": "macro", "line": 304, "name": "HUSTR_MESSAGESENT", "signature": "#define HUSTR_MESSAGESENT"}, {"kind": "macro", "line": 309, "name": "HUSTR_PLRGREEN", "signature": "#define HUSTR_PLRGREEN"}, {"kind": "macro", "line": 310, "name": "HUSTR_PLRINDIGO", "signature": "#define HUSTR_PLRINDIGO"}, {"kind": "macro", "line": 311, "name": "HUSTR_PLRBROWN", "signature": "#define HUSTR_PLRBROWN"}, {"kind": "macro", "line": 312, "name": "HUSTR_PLRRED", "signature": "#define HUSTR_PLRRED"}, {"kind": "macro", "line": 314, "name": "HUSTR_KEYGREEN", "signature": "#define HUSTR_KEYGREEN"}, {"kind": "macro", "line": 315, "name": "HUSTR_KEYINDIGO", "signature": "#define HUSTR_KEYINDIGO"}, {"kind": "macro", "line": 316, "name": "HUSTR_KEYBROWN", "signature": "#define HUSTR_KEYBROWN"}, {"kind": "macro", "line": 317, "name": "HUSTR_KEYRED", "signature": "#define HUSTR_KEYRED"}, {"kind": "macro", "line": 323, "name": "AMSTR_FOLLOWON", "signature": "#define AMSTR_FOLLOWON"}, {"kind": "macro", "line": 324, "name": "AMSTR_FOLLOWOFF", "signature": "#define AMSTR_FOLLOWOFF"}, {"kind": "macro", "line": 326, "name": "AMSTR_GRIDON", "signature": "#define AMSTR_GRIDON"}, {"kind": "macro", "line": 327, "name": "AMSTR_GRIDOFF", "signature": "#define AMSTR_GRIDOFF"}, {"kind": "macro", "line": 329, "name": "AMSTR_MARKEDSPOT", "signature": "#define AMSTR_MARKEDSPOT"}, {"kind": "macro", "line": 330, "name": "AMSTR_MARKSCLEARED", "signature": "#define AMSTR_MARKSCLEARED"}, {"kind": "macro", "line": 336, "name": "STSTR_MUS", "signature": "#define STSTR_MUS"}, {"kind": "macro", "line": 337, "name": "STSTR_NOMUS", "signature": "#define STSTR_NOMUS"}, {"kind": "macro", "line": 338, "name": "STSTR_DQDON", "signature": "#define STSTR_DQDON"}, {"kind": "macro", "line": 339, "name": "STSTR_DQDOFF", "signature": "#define STSTR_DQDOFF"}, {"kind": "macro", "line": 341, "name": "STSTR_KFAADDED", "signature": "#define STSTR_KFAADDED"}, {"kind": "macro", "line": 342, "name": "STSTR_FAADDED", "signature": "#define STSTR_FAADDED"}, {"kind": "macro", "line": 344, "name": "STSTR_NCON", "signature": "#define STSTR_NCON"}, {"kind": "macro", "line": 345, "name": "STSTR_NCOFF", "signature": "#define STSTR_NCOFF"}, {"kind": "macro", "line": 347, "name": "STSTR_BEHOLD", "signature": "#define STSTR_BEHOLD"}, {"kind": "macro", "line": 348, "name": "STSTR_BEHOLDX", "signature": "#define STSTR_BEHOLDX"}, {"kind": "macro", "line": 350, "name": "STSTR_CHOPPERS", "signature": "#define STSTR_CHOPPERS"}, {"kind": "macro", "line": 351, "name": "STSTR_CLEV", "signature": "#define STSTR_CLEV"}, {"kind": "macro", "line": 356, "name": "E1TEXT", "signature": "#define E1TEXT"}, {"kind": "macro", "line": 374, "name": "E2TEXT", "signature": "#define E2TEXT"}, {"kind": "macro", "line": 394, "name": "E3TEXT", "signature": "#define E3TEXT"}, {"kind": "macro", "line": 414, "name": "E4TEXT", "signature": "#define E4TEXT"}, {"kind": "macro", "line": 435, "name": "C1TEXT", "signature": "#define C1TEXT"}, {"kind": "macro", "line": 451, "name": "C2TEXT", "signature": "#define C2TEXT"}, {"kind": "macro", "line": 473, "name": "C3TEXT", "signature": "#define C3TEXT"}, {"kind": "macro", "line": 487, "name": "C4TEXT", "signature": "#define C4TEXT"}, {"kind": "macro", "line": 508, "name": "C5TEXT", "signature": "#define C5TEXT"}, {"kind": "macro", "line": 518, "name": "C6TEXT", "signature": "#define C6TEXT"}, {"kind": "macro", "line": 526, "name": "P1TEXT", "signature": "#define P1TEXT"}, {"kind": "macro", "line": 543, "name": "P2TEXT", "signature": "#define P2TEXT"}, {"kind": "macro", "line": 554, "name": "P3TEXT", "signature": "#define P3TEXT"}, {"kind": "macro", "line": 568, "name": "P4TEXT", "signature": "#define P4TEXT"}, {"kind": "macro", "line": 584, "name": "P5TEXT", "signature": "#define P5TEXT"}, {"kind": "macro", "line": 592, "name": "P6TEXT", "signature": "#define P6TEXT"}, {"kind": "macro", "line": 598, "name": "T1TEXT", "signature": "#define T1TEXT"}, {"kind": "macro", "line": 613, "name": "T2TEXT", "signature": "#define T2TEXT"}, {"kind": "macro", "line": 625, "name": "T3TEXT", "signature": "#define T3TEXT"}, {"kind": "macro", "line": 635, "name": "T4TEXT", "signature": "#define T4TEXT"}, {"kind": "macro", "line": 649, "name": "T5TEXT", "signature": "#define T5TEXT"}, {"kind": "macro", "line": 657, "name": "T6TEXT", "signature": "#define T6TEXT"}, {"kind": "macro", "line": 674, "name": "CC_ZOMBIE", "signature": "#define CC_ZOMBIE"}, {"kind": "macro", "line": 675, "name": "CC_SHOTGUN", "signature": "#define CC_SHOTGUN"}, {"kind": "macro", "line": 676, "name": "CC_HEAVY", "signature": "#define CC_HEAVY"}, {"kind": "macro", "line": 677, "name": "CC_IMP", "signature": "#define CC_IMP"}, {"kind": "macro", "line": 678, "name": "CC_DEMON", "signature": "#define CC_DEMON"}, {"kind": "macro", "line": 679, "name": "CC_LOST", "signature": "#define CC_LOST"}, {"kind": "macro", "line": 680, "name": "CC_CACO", "signature": "#define CC_CACO"}, {"kind": "macro", "line": 681, "name": "CC_HELL", "signature": "#define CC_HELL"}, {"kind": "macro", "line": 682, "name": "CC_BARON", "signature": "#define CC_BARON"}, {"kind": "macro", "line": 683, "name": "CC_ARACH", "signature": "#define CC_ARACH"}, {"kind": "macro", "line": 684, "name": "CC_PAIN", "signature": "#define CC_PAIN"}, {"kind": "macro", "line": 685, "name": "CC_REVEN", "signature": "#define CC_REVEN"}, {"kind": "macro", "line": 686, "name": "CC_MANCU", "signature": "#define CC_MANCU"}, {"kind": "macro", "line": 687, "name": "CC_ARCH", "signature": "#define CC_ARCH"}, {"kind": "macro", "line": 688, "name": "CC_SPIDER", "signature": "#define CC_SPIDER"}, {"kind": "macro", "line": 689, "name": "CC_CYBER", "signature": "#define CC_CYBER"}, {"kind": "macro", "line": 690, "name": "CC_HERO", "signature": "#define CC_HERO"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: Event handling.  Events are asynchronous inputs generally generated by the game user. Events can be discarded if no responder claims them", "id": "progs/doomgeneric/d_event.c", "kind": "module", "label": "d_event.c", "language": "c", "sha256": "186f09b978c0df63", "symbol_count": 3, "symbols": [{"doc": "D_PostEvent Called by the I/O functions when input is detected", "kind": "function", "line": 35, "name": "D_PostEvent", "signature": "void D_PostEvent (event_t* ev)"}, {"kind": "function", "line": 43, "name": "D_PopEvent", "signature": "event_t *D_PopEvent(void)"}, {"kind": "macro", "line": 25, "name": "MAXEVENTS", "signature": "#define MAXEVENTS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:          Event handling.", "id": "progs/doomgeneric/d_event.h", "kind": "module", "label": "d_event.h", "language": "h", "sha256": "7a66fd6f755a8a8b", "symbol_count": 4, "symbols": [{"doc": "Event structure.", "kind": "struct", "line": 42, "name": "event_t"}, {"doc": "Called by IO functions when input is detected.", "kind": "function", "line": 129, "name": "D_PostEvent", "signature": "void D_PostEvent (event_t *ev);"}, {"kind": "function", "line": 133, "name": "D_PopEvent", "signature": "event_t *D_PopEvent(void);"}, {"kind": "macro", "line": 21, "name": "__D_EVENT__", "signature": "#define __D_EVENT__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:    We are referring to sprite numbers.     PSPRITE ACTIONS for waepons. This struct controls the weapon animations.  Each entry is: ammo/amunition type", "id": "progs/doomgeneric/d_items.c", "kind": "module", "label": "d_items.c", "language": "c", "sha256": "71175f526df33793", "symbol_count": 0, "symbols": []}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Items: key cards, artifacts, weapon, ammunition.        Weapon info: sprite frames, ammunition use.", "id": "progs/doomgeneric/d_items.h", "kind": "module", "label": "d_items.h", "language": "h", "sha256": "0e7825744fa2ddc7", "symbol_count": 3, "symbols": [{"doc": "Weapon info: sprite frames, ammunition use.", "kind": "struct", "line": 28, "name": "weaponinfo_t"}, {"kind": "variable", "line": 39, "name": "weaponinfo", "signature": "extern weaponinfo_t weaponinfo[NUMWEAPONS];"}, {"kind": "macro", "line": 21, "name": "__D_ITEMS__", "signature": "#define __D_ITEMS__"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Search for and locate an IWAD file, and initialize according to the IWAD type.", "id": "progs/doomgeneric/d_iwad.c", "kind": "module", "label": "d_iwad.c", "language": "c", "sha256": "cd3a015b801a0dc0", "symbol_count": 27, "symbols": [{"kind": "struct", "line": 83, "name": "registry_value_t"}, {"kind": "function", "line": 64, "name": "AddIWADDir", "signature": "static void AddIWADDir(char *dir)"}, {"kind": "function", "line": 192, "name": "GetRegistryString", "signature": "static char *GetRegistryString(registry_value_t *reg_val)"}, {"kind": "function", "line": 236, "name": "CheckUninstallStrings", "signature": "static void CheckUninstallStrings(void)"}, {"kind": "function", "line": 270, "name": "CheckCollectorsEdition", "signature": "static void CheckCollectorsEdition(void)"}, {"kind": "function", "line": 297, "name": "CheckSteamEdition", "signature": "static void CheckSteamEdition(void)"}, {"kind": "function", "line": 324, "name": "CheckSteamGUSPatches", "signature": "static void CheckSteamGUSPatches(void)"}, {"kind": "function", "line": 364, "name": "CheckDOSDefaults", "signature": "static void CheckDOSDefaults(void)"}, {"kind": "function", "line": 391, "name": "DirIsFile", "signature": "static boolean DirIsFile(char *path, char *filename)"}, {"kind": "function", "line": 408, "name": "CheckDirectoryHasIWAD", "signature": "static char *CheckDirectoryHasIWAD(char *dir, char *iwadname)"}, {"kind": "function", "line": 449, "name": "SearchDirectoryForIWAD", "signature": "static char *SearchDirectoryForIWAD(char *dir, int mask, GameMission_t *mission)"}, {"kind": "function", "line": 477, "name": "IdentifyIWADByName", "signature": "static GameMission_t IdentifyIWADByName(char *name, int mask)"}, {"kind": "function", "line": 518, "name": "AddDoomWadPath", "signature": "static void AddDoomWadPath(void)"}, {"kind": "function", "line": 569, "name": "BuildIWADDirList", "signature": "static void BuildIWADDirList(void)"}, {"kind": "function", "line": 630, "name": "D_FindWADByName", "signature": "char *D_FindWADByName(char *name)"}, {"kind": "function", "line": 681, "name": "D_TryFindWADByName", "signature": "char *D_TryFindWADByName(char *filename)"}, {"kind": "function", "line": 704, "name": "D_FindIWAD", "signature": "char *D_FindIWAD(int mask, GameMission_t *mission)"}, {"kind": "function", "line": 757, "name": "D_FindAllIWADs", "signature": "const iwad_t **D_FindAllIWADs(int mask)"}, {"kind": "function", "line": 796, "name": "D_SaveGameIWADName", "signature": "char *D_SaveGameIWADName(GameMission_t gamemission)"}, {"kind": "function", "line": 820, "name": "D_SuggestIWADName", "signature": "char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)"}, {"kind": "function", "line": 835, "name": "D_SuggestGameName", "signature": "char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)"}, {"kind": "macro", "line": 58, "name": "MAX_IWAD_DIRS", "signature": "#define MAX_IWAD_DIRS"}, {"kind": "macro", "line": 80, "name": "WIN32_LEAN_AND_MEAN", "signature": "#define WIN32_LEAN_AND_MEAN"}, {"kind": "macro", "line": 90, "name": "UNINSTALLER_STRING", "signature": "#define UNINSTALLER_STRING"}, {"kind": "macro", "line": 102, "name": "SOFTWARE_KEY", "signature": "#define SOFTWARE_KEY"}, {"kind": "macro", "line": 104, "name": "SOFTWARE_KEY", "signature": "#define SOFTWARE_KEY"}, {"kind": "macro", "line": 189, "name": "STEAM_BFG_GUS_PATCHES", "signature": "#define STEAM_BFG_GUS_PATCHES"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Find IWAD and initialize according to IWAD type.", "id": "progs/doomgeneric/d_iwad.h", "kind": "module", "label": "d_iwad.h", "language": "h", "sha256": "305c2082b4a16e9f", "symbol_count": 14, "symbols": [{"kind": "struct", "line": 34, "name": "iwad_t"}, {"kind": "function", "line": 42, "name": "D_FindWADByName", "signature": "char *D_FindWADByName(char *filename);"}, {"kind": "function", "line": 43, "name": "D_TryFindWADByName", "signature": "char *D_TryFindWADByName(char *filename);"}, {"kind": "function", "line": 44, "name": "D_FindIWAD", "signature": "char *D_FindIWAD(int mask, GameMission_t *mission);"}, {"kind": "function", "line": 45, "name": "D_FindAllIWADs", "signature": "const iwad_t **D_FindAllIWADs(int mask);"}, {"kind": "function", "line": 46, "name": "D_SaveGameIWADName", "signature": "char *D_SaveGameIWADName(GameMission_t gamemission);"}, {"kind": "function", "line": 47, "name": "D_SuggestIWADName", "signature": "char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);"}, {"kind": "function", "line": 48, "name": "D_SuggestGameName", "signature": "char *D_SuggestGameName(GameMission_t mission, GameMode_t mode);"}, {"kind": "function", "line": 49, "name": "D_CheckCorrectIWAD", "signature": "void D_CheckCorrectIWAD(GameMission_t mission);"}, {"kind": "macro", "line": 20, "name": "__D_IWAD__", "signature": "#define __D_IWAD__"}, {"kind": "macro", "line": 24, "name": "IWAD_MASK_DOOM", "signature": "#define IWAD_MASK_DOOM"}, {"kind": "macro", "line": 30, "name": "IWAD_MASK_HERETIC", "signature": "#define IWAD_MASK_HERETIC"}, {"kind": "macro", "line": 31, "name": "IWAD_MASK_HEXEN", "signature": "#define IWAD_MASK_HEXEN"}, {"kind": "macro", "line": 32, "name": "IWAD_MASK_STRIFE", "signature": "#define IWAD_MASK_STRIFE"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main loop code.", "id": "progs/doomgeneric/d_loop.c", "kind": "module", "label": "d_loop.c", "language": "c", "sha256": "11a723932a75b67f", "symbol_count": 18, "symbols": [{"kind": "struct", "line": 45, "name": "ticcmd_set_t"}, {"kind": "function", "line": 119, "name": "GetAdjustedTime", "signature": "static int GetAdjustedTime(void)"}, {"kind": "function", "line": 136, "name": "BuildNewTic", "signature": "static boolean BuildNewTic(void)"}, {"kind": "function", "line": 203, "name": "NetUpdate", "signature": "void NetUpdate (void)"}, {"kind": "function", "line": 252, "name": "D_Disconnected", "signature": "static void D_Disconnected(void)"}, {"kind": "function", "line": 271, "name": "D_ReceiveTic", "signature": "void D_ReceiveTic(ticcmd_t *ticcmds, boolean *players_mask)"}, {"kind": "function", "line": 305, "name": "D_StartGameLoop", "signature": "void D_StartGameLoop(void)"}, {"kind": "function", "line": 315, "name": "BlockUntilStart", "signature": "static void BlockUntilStart(net_gamesettings_t *settings,\n                            netgame_sta..."}, {"kind": "function", "line": 340, "name": "D_StartNetGame", "signature": "void D_StartNetGame(net_gamesettings_t *settings,\n                    netgame_startup_callback_t ..."}, {"kind": "function", "line": 452, "name": "D_InitNetGame", "signature": "boolean D_InitNetGame(net_connect_data_t *connect_data)"}, {"doc": "D_QuitNetGame Called before quitting to leave a net game without hanging the other players", "kind": "function", "line": 560, "name": "D_QuitNetGame", "signature": "void D_QuitNetGame (void)"}, {"kind": "function", "line": 568, "name": "GetLowTic", "signature": "static int GetLowTic(void)"}, {"kind": "function", "line": 591, "name": "OldNetSync", "signature": "static void OldNetSync(void)"}, {"kind": "function", "line": 642, "name": "PlayersInGame", "signature": "static boolean PlayersInGame(void)"}, {"kind": "function", "line": 672, "name": "TicdupSquash", "signature": "static void TicdupSquash(ticcmd_set_t *set)"}, {"kind": "function", "line": 689, "name": "SinglePlayerClear", "signature": "static void SinglePlayerClear(ticcmd_set_t *set)"}, {"kind": "function", "line": 706, "name": "TryRunTics", "signature": "void TryRunTics (void)"}, {"kind": "function", "line": 822, "name": "D_RegisterLoopCallbacks", "signature": "void D_RegisterLoopCallbacks(loop_interface_t *i)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main loop stuff.     Callback function invoked while waiting for the netgame to start. The callback is invoked when new players are ready. The callback should return true, or return false to abort startup.", "id": "progs/doomgeneric/d_loop.h", "kind": "module", "label": "d_loop.h", "language": "h", "sha256": "18d628f6b0812944", "symbol_count": 10, "symbols": [{"kind": "struct", "line": 31, "name": "loop_interface_t"}, {"doc": "Register callback functions for the main loop code to use.", "kind": "function", "line": 52, "name": "D_RegisterLoopCallbacks", "signature": "void D_RegisterLoopCallbacks(loop_interface_t *i);"}, {"doc": "Create any new ticcmds and broadcast to other players.", "kind": "function", "line": 55, "name": "NetUpdate", "signature": "void NetUpdate (void);"}, {"doc": "Broadcasts special packets to other players to notify of game exit", "kind": "function", "line": 59, "name": "D_QuitNetGame", "signature": "void D_QuitNetGame (void);"}, {"doc": "? how many ticks to run?", "kind": "function", "line": 62, "name": "TryRunTics", "signature": "void TryRunTics (void);"}, {"doc": "Called at start of game loop to initialize timers", "kind": "function", "line": 65, "name": "D_StartGameLoop", "signature": "void D_StartGameLoop(void);"}, {"kind": "function", "line": 74, "name": "D_StartNetGame", "signature": "void D_StartNetGame(net_gamesettings_t *settings, netgame_startup_callback_t callback);"}, {"kind": "variable", "line": 77, "name": "singletics", "signature": "extern boolean singletics;"}, {"kind": "variable", "line": 78, "name": "ticdup", "signature": "extern int gametic, ticdup;"}, {"kind": "macro", "line": 20, "name": "__D_LOOP__", "signature": "#define __D_LOOP__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DOOM main program (D_DoomMain) and game loop (D_DoomLoop), plus functions to determine game mode (shareware, registered), parse command line parameters, configure game parameters (turbo), and call the startup functions.", "id": "progs/doomgeneric/d_main.c", "kind": "module", "label": "d_main.c", "language": "c", "sha256": "c41019af767838cf", "symbol_count": 29, "symbols": [{"doc": "D_ProcessEvents Send all the events of the given timestamp down the responder chain", "kind": "function", "line": 139, "name": "D_ProcessEvents", "signature": "void D_ProcessEvents (void)"}, {"kind": "function", "line": 169, "name": "D_Display", "signature": "void D_Display (void)"}, {"kind": "function", "line": 335, "name": "D_BindVariables", "signature": "void D_BindVariables(void)"}, {"kind": "function", "line": 388, "name": "D_GrabMouseCallback", "signature": "boolean D_GrabMouseCallback(void)"}, {"doc": "D_DoomLoop", "kind": "function", "line": 408, "name": "D_DoomLoop", "signature": "void D_DoomLoop (void)"}, {"doc": "D_PageTicker Handles timing for warped projection", "kind": "function", "line": 490, "name": "D_PageTicker", "signature": "void D_PageTicker (void)"}, {"doc": "D_PageDrawer", "kind": "function", "line": 501, "name": "D_PageDrawer", "signature": "void D_PageDrawer (void)"}, {"doc": "D_AdvanceDemo Called after each demo or intro demosequence finishes", "kind": "function", "line": 511, "name": "D_AdvanceDemo", "signature": "void D_AdvanceDemo (void)"}, {"doc": "This cycles through the demo sequences. FIXME - version dependend demo numbers?", "kind": "function", "line": 521, "name": "D_DoAdvanceDemo", "signature": "void D_DoAdvanceDemo (void)"}, {"doc": "D_StartTitle", "kind": "function", "line": 609, "name": "D_StartTitle", "signature": "void D_StartTitle (void)"}, {"kind": "function", "line": 658, "name": "GetGameName", "signature": "static char *GetGameName(char *gamename)"}, {"kind": "function", "line": 701, "name": "SetMissionForPackName", "signature": "static void SetMissionForPackName(char *pack_name)"}, {"kind": "function", "line": 737, "name": "D_IdentifyVersion", "signature": "void D_IdentifyVersion(void)"}, {"kind": "function", "line": 820, "name": "D_SetGameDescription", "signature": "void D_SetGameDescription(void)"}, {"kind": "function", "line": 883, "name": "D_AddFile", "signature": "static boolean D_AddFile(char *filename)"}, {"kind": "function", "line": 918, "name": "PrintDehackedBanners", "signature": "void PrintDehackedBanners(void)"}, {"kind": "function", "line": 963, "name": "InitGameVersion", "signature": "static void InitGameVersion(void)"}, {"kind": "function", "line": 1065, "name": "PrintGameVersion", "signature": "void PrintGameVersion(void)"}, {"kind": "function", "line": 1082, "name": "D_Endoom", "signature": "static void D_Endoom(void)"}, {"doc": "if ORIGCODE Load dehacked patches needed for certain IWADs.", "kind": "function", "line": 1105, "name": "LoadIwadDeh", "signature": "static void LoadIwadDeh(void)"}, {"doc": "D_DoomMain", "kind": "function", "line": 1178, "name": "D_DoomMain", "signature": "void D_DoomMain (void)"}, {"kind": "function", "line": 131, "name": "D_ConnectNetGame", "signature": "void D_ConnectNetGame(void);"}, {"kind": "function", "line": 132, "name": "D_CheckNetGame", "signature": "void D_CheckNetGame(void);"}, {"kind": "function", "line": 167, "name": "R_ExecuteSetViewSize", "signature": "void R_ExecuteSetViewSize (void);"}, {"kind": "variable", "line": 106, "name": "inhelpscreens", "signature": "extern boolean inhelpscreens;"}, {"kind": "variable", "line": 165, "name": "setsizeneeded", "signature": "extern boolean setsizeneeded;"}, {"kind": "variable", "line": 166, "name": "showMessages", "signature": "extern int showMessages;"}, {"kind": "variable", "line": 1351, "name": "forwardmove", "signature": "extern int forwardmove[2];"}, {"kind": "variable", "line": 1352, "name": "sidemove", "signature": "extern int sidemove[2];"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.         Read events from all input devices", "id": "progs/doomgeneric/d_main.h", "kind": "module", "label": "d_main.h", "language": "h", "sha256": "02429610ad886820", "symbol_count": 8, "symbols": [{"kind": "function", "line": 30, "name": "D_ProcessEvents", "signature": "void D_ProcessEvents (void);"}, {"doc": "BASE LEVEL", "kind": "function", "line": 36, "name": "D_PageTicker", "signature": "void D_PageTicker (void);"}, {"kind": "function", "line": 37, "name": "D_PageDrawer", "signature": "void D_PageDrawer (void);"}, {"kind": "function", "line": 38, "name": "D_AdvanceDemo", "signature": "void D_AdvanceDemo (void);"}, {"kind": "function", "line": 39, "name": "D_DoAdvanceDemo", "signature": "void D_DoAdvanceDemo (void);"}, {"kind": "function", "line": 40, "name": "D_StartTitle", "signature": "void D_StartTitle (void);"}, {"kind": "variable", "line": 46, "name": "gameaction", "signature": "extern gameaction_t gameaction;"}, {"kind": "macro", "line": 21, "name": "__D_MAIN__", "signature": "#define __D_MAIN__"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: Functions and definitions relating to the game type and operational mode.    Valid game mode/mission combinations, with the number of episodes/maps for each.", "id": "progs/doomgeneric/d_mode.c", "kind": "module", "label": "d_mode.c", "language": "c", "sha256": "acc50e09f501b237", "symbol_count": 6, "symbols": [{"kind": "function", "line": 50, "name": "D_ValidGameMode", "signature": "boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode)"}, {"kind": "function", "line": 65, "name": "D_ValidEpisodeMap", "signature": "boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,\n                          int e..."}, {"kind": "function", "line": 103, "name": "D_GetNumEpisodes", "signature": "int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode)"}, {"kind": "function", "line": 135, "name": "D_ValidGameVersion", "signature": "boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version)"}, {"kind": "function", "line": 161, "name": "D_IsEpisodeMap", "signature": "boolean D_IsEpisodeMap(GameMission_t mission)"}, {"kind": "function", "line": 182, "name": "D_GameMissionString", "signature": "char *D_GameMissionString(GameMission_t mission)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Functions and definitions relating to the game type and operational mode.     The \"mission\" controls what game we are playing.", "id": "progs/doomgeneric/d_mode.h", "kind": "module", "label": "d_mode.h", "language": "h", "sha256": "7886464002079f67", "symbol_count": 3, "symbols": [{"kind": "function", "line": 93, "name": "D_GetNumEpisodes", "signature": "int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode);"}, {"kind": "function", "line": 95, "name": "D_GameMissionString", "signature": "char *D_GameMissionString(GameMission_t mission);"}, {"kind": "macro", "line": 21, "name": "__D_MODE__", "signature": "#define __D_MODE__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DOOM Network game communication and protocol, all OS independend parts.", "id": "progs/doomgeneric/d_net.c", "kind": "module", "label": "d_net.c", "language": "c", "sha256": "99d0758de7f7576e", "symbol_count": 8, "symbols": [{"kind": "function", "line": 45, "name": "PlayerQuitGame", "signature": "static void PlayerQuitGame(player_t *player)"}, {"kind": "function", "line": 71, "name": "RunTic", "signature": "static void RunTic(ticcmd_t *cmds, boolean *ingame)"}, {"kind": "function", "line": 108, "name": "LoadGameSettings", "signature": "static void LoadGameSettings(net_gamesettings_t *settings)"}, {"kind": "function", "line": 139, "name": "SaveGameSettings", "signature": "static void SaveGameSettings(net_gamesettings_t *settings)"}, {"kind": "function", "line": 159, "name": "InitConnectData", "signature": "static void InitConnectData(net_connect_data_t *connect_data)"}, {"kind": "function", "line": 215, "name": "D_ConnectNetGame", "signature": "void D_ConnectNetGame(void)"}, {"doc": "D_CheckNetGame Works out player numbers among the net participants", "kind": "function", "line": 240, "name": "D_CheckNetGame", "signature": "void D_CheckNetGame (void)"}, {"kind": "variable", "line": 73, "name": "advancedemo", "signature": "extern boolean advancedemo;"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:       The player data structure depends on a number of other structs: items (internal inventory), animation states (closely tied to the sprites used to represent them, unfortunately).", "id": "progs/doomgeneric/d_player.h", "kind": "module", "label": "d_player.h", "language": "h", "sha256": "e303bd61546f7adc", "symbol_count": 5, "symbols": [{"doc": "Extended player object info: player_t", "kind": "struct", "line": 78, "name": "player_s"}, {"doc": "INTERMISSION Structure passed e.g. to WI_Start(wb)", "kind": "struct", "line": 168, "name": "wbplayerstruct_t"}, {"kind": "struct", "line": 182, "name": "wbstartstruct_t"}, {"doc": "Extended player object info: player_t", "kind": "type_alias", "line": 78, "name": "mo", "signature": "typedef struct player_s { mobj_t* mo;"}, {"kind": "macro", "line": 21, "name": "__D_PLAYER__", "signature": "#define __D_PLAYER__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Typedefs related to to textures etc., isolated here to make it easier separating modules.          Flats?", "id": "progs/doomgeneric/d_textur.h", "kind": "module", "label": "d_textur.h", "language": "h", "sha256": "5e1f2976cf039acd", "symbol_count": 2, "symbols": [{"doc": "Flats?  a pic is an unmasked block of pixels", "kind": "struct", "line": 33, "name": "pic_t"}, {"kind": "macro", "line": 22, "name": "__D_TEXTUR__", "signature": "#define __D_TEXTUR__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: MapObj data. Map Objects or mobjs are actors, entities, thinker, take-your-pick... anything that moves, acts, or suffers state changes of more or less violent nature.          Experimental stuff.", "id": "progs/doomgeneric/d_think.h", "kind": "module", "label": "d_think.h", "language": "h", "sha256": "6a7d65328ffb0d27", "symbol_count": 4, "symbols": [{"doc": "Doubly linked list of actors.", "kind": "struct", "line": 58, "name": "thinker_s"}, {"doc": "Historically, \"think_t\" is yet another function pointer to a routine to handle an actor.", "kind": "type_alias", "line": 54, "name": "think_t", "signature": "typedef actionf_t think_t;"}, {"doc": "Doubly linked list of actors.", "kind": "type_alias", "line": 58, "name": "prev", "signature": "typedef struct thinker_s { struct thinker_s* prev;"}, {"kind": "macro", "line": 23, "name": "__D_THINK__", "signature": "#define __D_THINK__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.       The data sampled per tick (single player) and transmitted to other peers (multiplayer). Mainly movements/button commands per game tick, plus a checksum for internal state consistency.", "id": "progs/doomgeneric/d_ticcmd.h", "kind": "module", "label": "d_ticcmd.h", "language": "h", "sha256": "d20e810a1975ad79", "symbol_count": 2, "symbols": [{"kind": "struct", "line": 32, "name": "ticcmd_t"}, {"kind": "macro", "line": 22, "name": "__D_TICCMD__", "signature": "#define __D_TICCMD__"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Dehacked entrypoint and common code     These are the limits that dehacked uses (from dheinit.h in the dehacked source).  If these limits are exceeded, it does not generate an error, but a warning is displayed.", "id": "progs/doomgeneric/deh_main.h", "kind": "module", "label": "deh_main.h", "language": "h", "sha256": "7092372dc27ffb99", "symbol_count": 12, "symbols": [{"kind": "function", "line": 33, "name": "DEH_ParseCommandLine", "signature": "void DEH_ParseCommandLine(void);"}, {"kind": "function", "line": 34, "name": "DEH_LoadFile", "signature": "int DEH_LoadFile(char *filename);"}, {"kind": "function", "line": 35, "name": "DEH_LoadLump", "signature": "int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error);"}, {"kind": "function", "line": 36, "name": "DEH_LoadLumpByName", "signature": "int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error);"}, {"kind": "function", "line": 40, "name": "DEH_Checksum", "signature": "void DEH_Checksum(sha1_digest_t digest);"}, {"kind": "variable", "line": 42, "name": "deh_allow_extended_strings", "signature": "extern boolean deh_allow_extended_strings;"}, {"kind": "variable", "line": 43, "name": "deh_allow_long_strings", "signature": "extern boolean deh_allow_long_strings;"}, {"kind": "variable", "line": 44, "name": "deh_allow_long_cheats", "signature": "extern boolean deh_allow_long_cheats;"}, {"kind": "variable", "line": 45, "name": "deh_apply_cheats", "signature": "extern boolean deh_apply_cheats;"}, {"kind": "macro", "line": 19, "name": "DEH_MAIN_H", "signature": "#define DEH_MAIN_H"}, {"kind": "macro", "line": 30, "name": "DEH_VANILLA_NUMSTATES", "signature": "#define DEH_VANILLA_NUMSTATES"}, {"kind": "macro", "line": 31, "name": "DEH_VANILLA_NUMSFX", "signature": "#define DEH_VANILLA_NUMSFX"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Parses \"Misc\" sections in dehacked files", "id": "progs/doomgeneric/deh_misc.h", "kind": "module", "label": "deh_misc.h", "language": "h", "sha256": "bcba0a699917ccaa", "symbol_count": 49, "symbols": [{"kind": "variable", "line": 42, "name": "deh_initial_health", "signature": "extern int deh_initial_health;"}, {"kind": "variable", "line": 43, "name": "deh_initial_bullets", "signature": "extern int deh_initial_bullets;"}, {"kind": "variable", "line": 44, "name": "deh_max_health", "signature": "extern int deh_max_health;"}, {"kind": "variable", "line": 45, "name": "deh_max_armor", "signature": "extern int deh_max_armor;"}, {"kind": "variable", "line": 46, "name": "deh_green_armor_class", "signature": "extern int deh_green_armor_class;"}, {"kind": "variable", "line": 47, "name": "deh_blue_armor_class", "signature": "extern int deh_blue_armor_class;"}, {"kind": "variable", "line": 48, "name": "deh_max_soulsphere", "signature": "extern int deh_max_soulsphere;"}, {"kind": "variable", "line": 49, "name": "deh_soulsphere_health", "signature": "extern int deh_soulsphere_health;"}, {"kind": "variable", "line": 50, "name": "deh_megasphere_health", "signature": "extern int deh_megasphere_health;"}, {"kind": "variable", "line": 51, "name": "deh_god_mode_health", "signature": "extern int deh_god_mode_health;"}, {"kind": "variable", "line": 52, "name": "deh_idfa_armor", "signature": "extern int deh_idfa_armor;"}, {"kind": "variable", "line": 53, "name": "deh_idfa_armor_class", "signature": "extern int deh_idfa_armor_class;"}, {"kind": "variable", "line": 54, "name": "deh_idkfa_armor", "signature": "extern int deh_idkfa_armor;"}, {"kind": "variable", "line": 55, "name": "deh_idkfa_armor_class", "signature": "extern int deh_idkfa_armor_class;"}, {"kind": "variable", "line": 56, "name": "deh_bfg_cells_per_shot", "signature": "extern int deh_bfg_cells_per_shot;"}, {"kind": "variable", "line": 57, "name": "deh_species_infighting", "signature": "extern int deh_species_infighting;"}, {"kind": "macro", "line": 19, "name": "DEH_MISC_H", "signature": "#define DEH_MISC_H"}, {"kind": "macro", "line": 23, "name": "DEH_DEFAULT_INITIAL_HEALTH", "signature": "#define DEH_DEFAULT_INITIAL_HEALTH"}, {"kind": "macro", "line": 24, "name": "DEH_DEFAULT_INITIAL_BULLETS", "signature": "#define DEH_DEFAULT_INITIAL_BULLETS"}, {"kind": "macro", "line": 25, "name": "DEH_DEFAULT_MAX_HEALTH", "signature": "#define DEH_DEFAULT_MAX_HEALTH"}, {"kind": "macro", "line": 26, "name": "DEH_DEFAULT_MAX_ARMOR", "signature": "#define DEH_DEFAULT_MAX_ARMOR"}, {"kind": "macro", "line": 27, "name": "DEH_DEFAULT_GREEN_ARMOR_CLASS", "signature": "#define DEH_DEFAULT_GREEN_ARMOR_CLASS"}, {"kind": "macro", "line": 28, "name": "DEH_DEFAULT_BLUE_ARMOR_CLASS", "signature": "#define DEH_DEFAULT_BLUE_ARMOR_CLASS"}, {"kind": "macro", "line": 29, "name": "DEH_DEFAULT_MAX_SOULSPHERE", "signature": "#define DEH_DEFAULT_MAX_SOULSPHERE"}, {"kind": "macro", "line": 30, "name": "DEH_DEFAULT_SOULSPHERE_HEALTH", "signature": "#define DEH_DEFAULT_SOULSPHERE_HEALTH"}, {"kind": "macro", "line": 31, "name": "DEH_DEFAULT_MEGASPHERE_HEALTH", "signature": "#define DEH_DEFAULT_MEGASPHERE_HEALTH"}, {"kind": "macro", "line": 32, "name": "DEH_DEFAULT_GOD_MODE_HEALTH", "signature": "#define DEH_DEFAULT_GOD_MODE_HEALTH"}, {"kind": "macro", "line": 33, "name": "DEH_DEFAULT_IDFA_ARMOR", "signature": "#define DEH_DEFAULT_IDFA_ARMOR"}, {"kind": "macro", "line": 34, "name": "DEH_DEFAULT_IDFA_ARMOR_CLASS", "signature": "#define DEH_DEFAULT_IDFA_ARMOR_CLASS"}, {"kind": "macro", "line": 35, "name": "DEH_DEFAULT_IDKFA_ARMOR", "signature": "#define DEH_DEFAULT_IDKFA_ARMOR"}, {"kind": "macro", "line": 36, "name": "DEH_DEFAULT_IDKFA_ARMOR_CLASS", "signature": "#define DEH_DEFAULT_IDKFA_ARMOR_CLASS"}, {"kind": "macro", "line": 37, "name": "DEH_DEFAULT_BFG_CELLS_PER_SHOT", "signature": "#define DEH_DEFAULT_BFG_CELLS_PER_SHOT"}, {"kind": "macro", "line": 38, "name": "DEH_DEFAULT_SPECIES_INFIGHTING", "signature": "#define DEH_DEFAULT_SPECIES_INFIGHTING"}, {"kind": "macro", "line": 63, "name": "deh_initial_health", "signature": "#define deh_initial_health"}, {"kind": "macro", "line": 64, "name": "deh_initial_bullets", "signature": "#define deh_initial_bullets"}, {"kind": "macro", "line": 65, "name": "deh_max_health", "signature": "#define deh_max_health"}, {"kind": "macro", "line": 66, "name": "deh_max_armor", "signature": "#define deh_max_armor"}, {"kind": "macro", "line": 67, "name": "deh_green_armor_class", "signature": "#define deh_green_armor_class"}, {"kind": "macro", "line": 68, "name": "deh_blue_armor_class", "signature": "#define deh_blue_armor_class"}, {"kind": "macro", "line": 69, "name": "deh_max_soulsphere", "signature": "#define deh_max_soulsphere"}, {"kind": "macro", "line": 70, "name": "deh_soulsphere_health", "signature": "#define deh_soulsphere_health"}, {"kind": "macro", "line": 71, "name": "deh_megasphere_health", "signature": "#define deh_megasphere_health"}, {"kind": "macro", "line": 72, "name": "deh_god_mode_health", "signature": "#define deh_god_mode_health"}, {"kind": "macro", "line": 73, "name": "deh_idfa_armor", "signature": "#define deh_idfa_armor"}, {"kind": "macro", "line": 74, "name": "deh_idfa_armor_class", "signature": "#define deh_idfa_armor_class"}, {"kind": "macro", "line": 75, "name": "deh_idkfa_armor", "signature": "#define deh_idkfa_armor"}, {"kind": "macro", "line": 76, "name": "deh_idkfa_armor_class", "signature": "#define deh_idkfa_armor_class"}, {"kind": "macro", "line": 77, "name": "deh_bfg_cells_per_shot", "signature": "#define deh_bfg_cells_per_shot"}, {"kind": "macro", "line": 78, "name": "deh_species_infighting", "signature": "#define deh_species_infighting"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Dehacked string replacements      Used to do dehacked text substitutions throughout the program", "id": "progs/doomgeneric/deh_str.h", "kind": "module", "label": "deh_str.h", "language": "h", "sha256": "0bffd7c3f246b050", "symbol_count": 11, "symbols": [{"kind": "function", "line": 29, "name": "DEH_String", "signature": "char *DEH_String(char *s);"}, {"kind": "function", "line": 30, "name": "DEH_printf", "signature": "void DEH_printf(char *fmt, ...);"}, {"kind": "function", "line": 31, "name": "DEH_fprintf", "signature": "void DEH_fprintf(FILE *fstream, char *fmt, ...);"}, {"kind": "function", "line": 32, "name": "DEH_snprintf", "signature": "void DEH_snprintf(char *buffer, size_t len, char *fmt, ...);"}, {"kind": "function", "line": 33, "name": "DEH_AddStringReplacement", "signature": "void DEH_AddStringReplacement(char *from_text, char *to_text);"}, {"kind": "macro", "line": 19, "name": "DEH_STR_H", "signature": "#define DEH_STR_H"}, {"kind": "macro", "line": 38, "name": "DEH_String", "signature": "#define DEH_String(x)"}, {"kind": "macro", "line": 39, "name": "DEH_printf", "signature": "#define DEH_printf"}, {"kind": "macro", "line": 40, "name": "DEH_fprintf", "signature": "#define DEH_fprintf"}, {"kind": "macro", "line": 41, "name": "DEH_snprintf", "signature": "#define DEH_snprintf"}, {"kind": "macro", "line": 42, "name": "DEH_AddStringReplacement", "signature": "#define DEH_AddStringReplacement(x, y)"}]}, {"id": "progs/doomgeneric/doom.h", "kind": "module", "label": "doom.h", "language": "h", "sha256": "d9feb3771dca311e", "symbol_count": 2, "symbols": [{"kind": "function", "line": 28, "name": "D_DoomMain", "signature": "void D_DoomMain (void);"}, {"kind": "macro", "line": 10, "name": "SRC_CHOCDOOM_DOOM_H_", "signature": "#define SRC_CHOCDOOM_DOOM_H_"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: all external data is defined here most of the data is loaded into different structures at run time some internal structures shared by many modules are here    The most basic types we use, portability.  Some global defines, that configure the game.", "id": "progs/doomgeneric/doomdata.h", "kind": "module", "label": "doomdata.h", "language": "h", "sha256": "c296f3cbd788e87c", "symbol_count": 11, "symbols": [{"kind": "macro", "line": 22, "name": "__DOOMDATA__", "signature": "#define __DOOMDATA__"}, {"kind": "macro", "line": 98, "name": "ML_BLOCKING", "signature": "#define ML_BLOCKING"}, {"kind": "macro", "line": 101, "name": "ML_BLOCKMONSTERS", "signature": "#define ML_BLOCKMONSTERS"}, {"kind": "macro", "line": 105, "name": "ML_TWOSIDED", "signature": "#define ML_TWOSIDED"}, {"kind": "macro", "line": 117, "name": "ML_DONTPEGTOP", "signature": "#define ML_DONTPEGTOP"}, {"kind": "macro", "line": 120, "name": "ML_DONTPEGBOTTOM", "signature": "#define ML_DONTPEGBOTTOM"}, {"kind": "macro", "line": 123, "name": "ML_SECRET", "signature": "#define ML_SECRET"}, {"kind": "macro", "line": 126, "name": "ML_SOUNDBLOCK", "signature": "#define ML_SOUNDBLOCK"}, {"kind": "macro", "line": 129, "name": "ML_DONTDRAW", "signature": "#define ML_DONTDRAW"}, {"kind": "macro", "line": 132, "name": "ML_MAPPED", "signature": "#define ML_MAPPED"}, {"kind": "macro", "line": 175, "name": "NF_SUBSECTOR", "signature": "#define\tNF_SUBSECTOR"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DoomDef - basic defines for DOOM, e.g. Version, game mode and skill level, and display parameters.      Location for any defines turned variables.  None.", "id": "progs/doomgeneric/doomdef.c", "kind": "module", "label": "doomdef.c", "language": "c", "sha256": "2aebd7ef7ea9fa2d", "symbol_count": 0, "symbols": []}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Internally used data structures for virtually everything, lots of other stuff.", "id": "progs/doomgeneric/doomdef.h", "kind": "module", "label": "doomdef.h", "language": "h", "sha256": "bffb986830bcf569", "symbol_count": 9, "symbols": [{"kind": "macro", "line": 21, "name": "__DOOMDEF__", "signature": "#define __DOOMDEF__"}, {"kind": "macro", "line": 34, "name": "DOOM_VERSION", "signature": "#define DOOM_VERSION"}, {"kind": "macro", "line": 37, "name": "DOOM_191_VERSION", "signature": "#define DOOM_191_VERSION"}, {"kind": "macro", "line": 42, "name": "RANGECHECK", "signature": "#define RANGECHECK"}, {"kind": "macro", "line": 45, "name": "MAXPLAYERS", "signature": "#define MAXPLAYERS"}, {"kind": "macro", "line": 77, "name": "MTF_EASY", "signature": "#define\tMTF_EASY"}, {"kind": "macro", "line": 78, "name": "MTF_NORMAL", "signature": "#define\tMTF_NORMAL"}, {"kind": "macro", "line": 79, "name": "MTF_HARD", "signature": "#define\tMTF_HARD"}, {"kind": "macro", "line": 82, "name": "MTF_AMBUSH", "signature": "#define\tMTF_AMBUSH"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: List of features which can be enabled/disabled to slim down the program.    Enables wad merging (the '-merge' command line parameter)   Enables dehacked support ('-deh')   Enables multiplayer support (network games)", "id": "progs/doomgeneric/doomfeatures.h", "kind": "module", "label": "doomfeatures.h", "language": "h", "sha256": "1e2d7f3177e35973", "symbol_count": 2, "symbols": [{"kind": "macro", "line": 20, "name": "DOOM_FEATURES_H", "signature": "#define DOOM_FEATURES_H"}, {"kind": "macro", "line": 36, "name": "FEATURE_SOUND", "signature": "#define FEATURE_SOUND"}]}, {"id": "progs/doomgeneric/doomgeneric.c", "kind": "module", "label": "doomgeneric.c", "language": "c", "sha256": "5b90a36c3e234895", "symbol_count": 1, "symbols": [{"kind": "function", "line": 6, "name": "dg_Create", "signature": "void dg_Create()"}]}, {"id": "progs/doomgeneric/doomgeneric.h", "kind": "module", "label": "doomgeneric.h", "language": "h", "sha256": "2ca79d74a6a1ec4a", "symbol_count": 10, "symbols": [{"kind": "function", "line": 14, "name": "DG_Init", "signature": "void DG_Init();"}, {"kind": "function", "line": 15, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame();"}, {"kind": "function", "line": 16, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms);"}, {"kind": "function", "line": 17, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs();"}, {"kind": "function", "line": 18, "name": "DG_GetKey", "signature": "int DG_GetKey(int* pressed, unsigned char* key);"}, {"kind": "function", "line": 19, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char * title);"}, {"kind": "variable", "line": 11, "name": "DG_ScreenBuffer", "signature": "extern uint32_t* DG_ScreenBuffer;"}, {"kind": "macro", "line": 2, "name": "DOOM_GENERIC", "signature": "#define DOOM_GENERIC"}, {"kind": "macro", "line": 7, "name": "DOOMGENERIC_RESX", "signature": "#define DOOMGENERIC_RESX"}, {"kind": "macro", "line": 8, "name": "DOOMGENERIC_RESY", "signature": "#define DOOMGENERIC_RESY"}]}, {"doc": "doomgeneric_minios.c - MiniOS platform layer for doomgeneric.", "id": "progs/doomgeneric/doomgeneric_minios.c", "kind": "module", "label": "doomgeneric_minios.c", "language": "c", "sha256": "9d2c56b88f5fee63", "symbol_count": 29, "symbols": [{"doc": "DOOM renders into a kernel-backed back-buffer in the user window; the * kernel composites it onto the desktop as a window on GFX_PRESENT/BUF_GAME. #define FB_ADDR    ((volatile uint8_t *)MINIOS_DOOM_BACKBUF_ADDR) #define FB_WIDTH   320 #define FB_HEIGHT  200 /* ---------- Palette management ---------- /* Extern from i_video.c - the gamma-corrected palette colors", "kind": "struct", "line": 103, "name": "color"}, {"kind": "function", "line": 24, "name": "mini_parse_autoframes", "signature": "static void mini_parse_autoframes(int argc, char **argv)"}, {"kind": "function", "line": 43, "name": "mini_parse_windowed", "signature": "static void mini_parse_windowed(int argc, char **argv)"}, {"kind": "function", "line": 56, "name": "sys_time_ms", "signature": "static long sys_time_ms(void)"}, {"kind": "function", "line": 61, "name": "sys_kbd", "signature": "static long sys_kbd(void)"}, {"kind": "function", "line": 66, "name": "sys_palette", "signature": "static long sys_palette(const unsigned char *pal)"}, {"kind": "function", "line": 71, "name": "sys_kbd_raw", "signature": "static long sys_kbd_raw(int on)"}, {"kind": "function", "line": 76, "name": "sys_vga_mode", "signature": "static long sys_vga_mode(int on)"}, {"kind": "function", "line": 81, "name": "sys_gfx_zoom", "signature": "static long sys_gfx_zoom(long mode)"}, {"kind": "function", "line": 86, "name": "sys_doom_frame", "signature": "static long sys_doom_frame(void)"}, {"kind": "function", "line": 110, "name": "load_vga_palette", "signature": "static void load_vga_palette(void)"}, {"kind": "function", "line": 123, "name": "scancode_to_doom", "signature": "static unsigned char scancode_to_doom(unsigned char raw)"}, {"kind": "function", "line": 182, "name": "kbd_enqueue", "signature": "static void kbd_enqueue(unsigned char doom_key, int pressed)"}, {"kind": "function", "line": 189, "name": "kbd_poll", "signature": "static void kbd_poll(void)"}, {"kind": "function", "line": 232, "name": "DG_Init", "signature": "void DG_Init(void)"}, {"kind": "function", "line": 243, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame(void)"}, {"kind": "function", "line": 274, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms)"}, {"kind": "function", "line": 280, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs(void)"}, {"kind": "function", "line": 284, "name": "DG_GetKey", "signature": "int DG_GetKey(int *pressed, unsigned char *key)"}, {"kind": "function", "line": 295, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char *title)"}, {"kind": "function", "line": 4, "name": "MINIOS_DOOM_BACKBUF_ADDR", "signature": "* MINIOS_DOOM_BACKBUF_ADDR (minios_abi.h);"}, {"kind": "variable", "line": 104, "name": "colors", "signature": "extern struct color colors[256];"}, {"kind": "variable", "line": 230, "name": "I_VideoBuffer", "signature": "extern unsigned char *I_VideoBuffer;"}, {"kind": "variable", "line": 233, "name": "myargc", "signature": "extern int myargc;"}, {"kind": "variable", "line": 234, "name": "myargv", "signature": "extern char **myargv;"}, {"kind": "macro", "line": 96, "name": "FB_ADDR", "signature": "#define FB_ADDR"}, {"kind": "macro", "line": 97, "name": "FB_WIDTH", "signature": "#define FB_WIDTH"}, {"kind": "macro", "line": 98, "name": "FB_HEIGHT", "signature": "#define FB_HEIGHT"}, {"kind": "macro", "line": 178, "name": "KBD_QUEUE_SIZE", "signature": "#define KBD_QUEUE_SIZE"}]}, {"doc": "doomgeneric for soso os", "id": "progs/doomgeneric/doomgeneric_sdl.c", "kind": "module", "label": "doomgeneric_sdl.c", "language": "c", "sha256": "f63fc355e3a0d77f", "symbol_count": 10, "symbols": [{"kind": "function", "line": 23, "name": "convertToDoomKey", "signature": "static unsigned char convertToDoomKey(unsigned int key)"}, {"kind": "function", "line": 63, "name": "addKeyToQueue", "signature": "static void addKeyToQueue(int pressed, unsigned int keyCode)"}, {"kind": "function", "line": 72, "name": "handleKeyInput", "signature": "static void handleKeyInput()"}, {"kind": "function", "line": 93, "name": "DG_Init", "signature": "void DG_Init()"}, {"kind": "function", "line": 112, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame()"}, {"kind": "function", "line": 123, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms)"}, {"kind": "function", "line": 128, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs()"}, {"kind": "function", "line": 133, "name": "DG_GetKey", "signature": "int DG_GetKey(int* pressed, unsigned char* doomKey)"}, {"kind": "function", "line": 152, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char * title)"}, {"kind": "macro", "line": 17, "name": "KEYQUEUE_SIZE", "signature": "#define KEYQUEUE_SIZE"}]}, {"doc": "doomgeneric for soso os", "id": "progs/doomgeneric/doomgeneric_soso.c", "kind": "module", "label": "doomgeneric_soso.c", "language": "c", "sha256": "4cde5c1a1dc46622", "symbol_count": 13, "symbols": [{"kind": "enum", "line": 36, "name": "EnFrameBuferIoctl"}, {"kind": "function", "line": 43, "name": "convertToDoomKey", "signature": "static unsigned char convertToDoomKey(unsigned char scancode)"}, {"kind": "function", "line": 92, "name": "addKeyToQueue", "signature": "static void addKeyToQueue(int pressed, unsigned char keyCode)"}, {"kind": "function", "line": 108, "name": "disableRawMode", "signature": "void disableRawMode()"}, {"kind": "function", "line": 114, "name": "enableRawMode", "signature": "void enableRawMode()"}, {"kind": "function", "line": 124, "name": "DG_Init", "signature": "void DG_Init()"}, {"kind": "function", "line": 186, "name": "handleKeyInput", "signature": "static void handleKeyInput()"}, {"kind": "function", "line": 214, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame()"}, {"kind": "function", "line": 227, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms)"}, {"kind": "function", "line": 232, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs()"}, {"kind": "function", "line": 237, "name": "DG_GetKey", "signature": "int DG_GetKey(int* pressed, unsigned char* doomKey)"}, {"kind": "function", "line": 258, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char * title)"}, {"kind": "macro", "line": 24, "name": "KEYQUEUE_SIZE", "signature": "#define KEYQUEUE_SIZE"}]}, {"doc": "doomgeneric for soso os (nano-x version) TODO: get keys from X, not using direct keyboard access!", "id": "progs/doomgeneric/doomgeneric_sosox.c", "kind": "module", "label": "doomgeneric_sosox.c", "language": "c", "sha256": "30a8663404308c57", "symbol_count": 12, "symbols": [{"kind": "function", "line": 39, "name": "convert_to_doom_key", "signature": "static unsigned char convert_to_doom_key(unsigned char scancode)"}, {"kind": "function", "line": 88, "name": "add_key_to_queue", "signature": "static void add_key_to_queue(int pressed, unsigned char key_code)"}, {"kind": "function", "line": 102, "name": "disable_raw_mode", "signature": "void disable_raw_mode()"}, {"kind": "function", "line": 107, "name": "enable_raw_mode", "signature": "void enable_raw_mode()"}, {"kind": "function", "line": 117, "name": "DG_Init", "signature": "void DG_Init()"}, {"kind": "function", "line": 159, "name": "handle_key_input", "signature": "static void handle_key_input()"}, {"kind": "function", "line": 187, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame()"}, {"kind": "function", "line": 225, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms)"}, {"kind": "function", "line": 230, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs()"}, {"kind": "function", "line": 235, "name": "DG_GetKey", "signature": "int DG_GetKey(int* pressed, unsigned char* doomKey)"}, {"kind": "function", "line": 256, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char * title)"}, {"kind": "macro", "line": 24, "name": "KEYQUEUE_SIZE", "signature": "#define KEYQUEUE_SIZE"}]}, {"id": "progs/doomgeneric/doomgeneric_win.c", "kind": "module", "label": "doomgeneric_win.c", "language": "c", "sha256": "6b6a020925757343", "symbol_count": 10, "symbols": [{"kind": "function", "line": 20, "name": "convertToDoomKey", "signature": "static unsigned char convertToDoomKey(unsigned char key)"}, {"kind": "function", "line": 59, "name": "addKeyToQueue", "signature": "static void addKeyToQueue(int pressed, unsigned char keyCode)"}, {"kind": "function", "line": 70, "name": "wndProc", "signature": "static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)"}, {"kind": "function", "line": 95, "name": "DG_Init", "signature": "void DG_Init()"}, {"kind": "function", "line": 146, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame()"}, {"kind": "function", "line": 162, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms)"}, {"kind": "function", "line": 167, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs()"}, {"kind": "function", "line": 172, "name": "DG_GetKey", "signature": "int DG_GetKey(int* pressed, unsigned char* doomKey)"}, {"kind": "function", "line": 193, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char * title)"}, {"kind": "macro", "line": 14, "name": "KEYQUEUE_SIZE", "signature": "#define KEYQUEUE_SIZE"}]}, {"id": "progs/doomgeneric/doomgeneric_xlib.c", "kind": "module", "label": "doomgeneric_xlib.c", "language": "c", "sha256": "5cf98e74d33b6ff6", "symbol_count": 9, "symbols": [{"kind": "function", "line": 27, "name": "convertToDoomKey", "signature": "static unsigned char convertToDoomKey(unsigned int key)"}, {"kind": "function", "line": 68, "name": "addKeyToQueue", "signature": "static void addKeyToQueue(int pressed, unsigned int keyCode)"}, {"kind": "function", "line": 79, "name": "DG_Init", "signature": "void DG_Init()"}, {"kind": "function", "line": 127, "name": "DG_DrawFrame", "signature": "void DG_DrawFrame()"}, {"kind": "function", "line": 172, "name": "DG_SleepMs", "signature": "void DG_SleepMs(uint32_t ms)"}, {"kind": "function", "line": 177, "name": "DG_GetTicksMs", "signature": "uint32_t DG_GetTicksMs()"}, {"kind": "function", "line": 187, "name": "DG_GetKey", "signature": "int DG_GetKey(int* pressed, unsigned char* doomKey)"}, {"kind": "function", "line": 208, "name": "DG_SetWindowTitle", "signature": "void DG_SetWindowTitle(const char * title)"}, {"kind": "macro", "line": 21, "name": "KEYQUEUE_SIZE", "signature": "#define KEYQUEUE_SIZE"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Key definitions     DOOM keyboard definition. This is the stuff configured by Setup.Exe. Most key data are simple ascii (uppercased).", "id": "progs/doomgeneric/doomkeys.h", "kind": "module", "label": "doomkeys.h", "language": "h", "sha256": "7f68152bbce2d79b", "symbol_count": 59, "symbols": [{"kind": "macro", "line": 20, "name": "__DOOMKEYS__", "signature": "#define __DOOMKEYS__"}, {"kind": "macro", "line": 27, "name": "KEY_RIGHTARROW", "signature": "#define KEY_RIGHTARROW"}, {"kind": "macro", "line": 28, "name": "KEY_LEFTARROW", "signature": "#define KEY_LEFTARROW"}, {"kind": "macro", "line": 29, "name": "KEY_UPARROW", "signature": "#define KEY_UPARROW"}, {"kind": "macro", "line": 30, "name": "KEY_DOWNARROW", "signature": "#define KEY_DOWNARROW"}, {"kind": "macro", "line": 31, "name": "KEY_STRAFE_L", "signature": "#define KEY_STRAFE_L"}, {"kind": "macro", "line": 32, "name": "KEY_STRAFE_R", "signature": "#define KEY_STRAFE_R"}, {"kind": "macro", "line": 33, "name": "KEY_USE", "signature": "#define KEY_USE"}, {"kind": "macro", "line": 34, "name": "KEY_FIRE", "signature": "#define KEY_FIRE"}, {"kind": "macro", "line": 35, "name": "KEY_ESCAPE", "signature": "#define KEY_ESCAPE"}, {"kind": "macro", "line": 36, "name": "KEY_ENTER", "signature": "#define KEY_ENTER"}, {"kind": "macro", "line": 37, "name": "KEY_TAB", "signature": "#define KEY_TAB"}, {"kind": "macro", "line": 38, "name": "KEY_F1", "signature": "#define KEY_F1"}, {"kind": "macro", "line": 39, "name": "KEY_F2", "signature": "#define KEY_F2"}, {"kind": "macro", "line": 40, "name": "KEY_F3", "signature": "#define KEY_F3"}, {"kind": "macro", "line": 41, "name": "KEY_F4", "signature": "#define KEY_F4"}, {"kind": "macro", "line": 42, "name": "KEY_F5", "signature": "#define KEY_F5"}, {"kind": "macro", "line": 43, "name": "KEY_F6", "signature": "#define KEY_F6"}, {"kind": "macro", "line": 44, "name": "KEY_F7", "signature": "#define KEY_F7"}, {"kind": "macro", "line": 45, "name": "KEY_F8", "signature": "#define KEY_F8"}, {"kind": "macro", "line": 46, "name": "KEY_F9", "signature": "#define KEY_F9"}, {"kind": "macro", "line": 47, "name": "KEY_F10", "signature": "#define KEY_F10"}, {"kind": "macro", "line": 48, "name": "KEY_F11", "signature": "#define KEY_F11"}, {"kind": "macro", "line": 49, "name": "KEY_F12", "signature": "#define KEY_F12"}, {"kind": "macro", "line": 51, "name": "KEY_BACKSPACE", "signature": "#define KEY_BACKSPACE"}, {"kind": "macro", "line": 52, "name": "KEY_PAUSE", "signature": "#define KEY_PAUSE"}, {"kind": "macro", "line": 54, "name": "KEY_EQUALS", "signature": "#define KEY_EQUALS"}, {"kind": "macro", "line": 55, "name": "KEY_MINUS", "signature": "#define KEY_MINUS"}, {"kind": "macro", "line": 57, "name": "KEY_RSHIFT", "signature": "#define KEY_RSHIFT"}, {"kind": "macro", "line": 58, "name": "KEY_RCTRL", "signature": "#define KEY_RCTRL"}, {"kind": "macro", "line": 59, "name": "KEY_RALT", "signature": "#define KEY_RALT"}, {"kind": "macro", "line": 61, "name": "KEY_LALT", "signature": "#define KEY_LALT"}, {"kind": "macro", "line": 65, "name": "KEY_CAPSLOCK", "signature": "#define KEY_CAPSLOCK"}, {"kind": "macro", "line": 66, "name": "KEY_NUMLOCK", "signature": "#define KEY_NUMLOCK"}, {"kind": "macro", "line": 67, "name": "KEY_SCRLCK", "signature": "#define KEY_SCRLCK"}, {"kind": "macro", "line": 68, "name": "KEY_PRTSCR", "signature": "#define KEY_PRTSCR"}, {"kind": "macro", "line": 70, "name": "KEY_HOME", "signature": "#define KEY_HOME"}, {"kind": "macro", "line": 71, "name": "KEY_END", "signature": "#define KEY_END"}, {"kind": "macro", "line": 72, "name": "KEY_PGUP", "signature": "#define KEY_PGUP"}, {"kind": "macro", "line": 73, "name": "KEY_PGDN", "signature": "#define KEY_PGDN"}, {"kind": "macro", "line": 74, "name": "KEY_INS", "signature": "#define KEY_INS"}, {"kind": "macro", "line": 75, "name": "KEY_DEL", "signature": "#define KEY_DEL"}, {"kind": "macro", "line": 77, "name": "KEYP_0", "signature": "#define KEYP_0"}, {"kind": "macro", "line": 78, "name": "KEYP_1", "signature": "#define KEYP_1"}, {"kind": "macro", "line": 79, "name": "KEYP_2", "signature": "#define KEYP_2"}, {"kind": "macro", "line": 80, "name": "KEYP_3", "signature": "#define KEYP_3"}, {"kind": "macro", "line": 81, "name": "KEYP_4", "signature": "#define KEYP_4"}, {"kind": "macro", "line": 82, "name": "KEYP_5", "signature": "#define KEYP_5"}, {"kind": "macro", "line": 83, "name": "KEYP_6", "signature": "#define KEYP_6"}, {"kind": "macro", "line": 84, "name": "KEYP_7", "signature": "#define KEYP_7"}, {"kind": "macro", "line": 85, "name": "KEYP_8", "signature": "#define KEYP_8"}, {"kind": "macro", "line": 86, "name": "KEYP_9", "signature": "#define KEYP_9"}, {"kind": "macro", "line": 88, "name": "KEYP_DIVIDE", "signature": "#define KEYP_DIVIDE"}, {"kind": "macro", "line": 89, "name": "KEYP_PLUS", "signature": "#define KEYP_PLUS"}, {"kind": "macro", "line": 90, "name": "KEYP_MINUS", "signature": "#define KEYP_MINUS"}, {"kind": "macro", "line": 91, "name": "KEYP_MULTIPLY", "signature": "#define KEYP_MULTIPLY"}, {"kind": "macro", "line": 92, "name": "KEYP_PERIOD", "signature": "#define KEYP_PERIOD"}, {"kind": "macro", "line": 93, "name": "KEYP_EQUALS", "signature": "#define KEYP_EQUALS"}, {"kind": "macro", "line": 94, "name": "KEYP_ENTER", "signature": "#define KEYP_ENTER"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Put all global tate variables here.      Game Mode - identify IWAD as shareware, retail etc.", "id": "progs/doomgeneric/doomstat.c", "kind": "module", "label": "doomstat.c", "language": "c", "sha256": "6c26994f9ece76c1", "symbol_count": 0, "symbols": []}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: All the global variables that store the internal state. Theoretically speaking, the internal state of the engine should be found by looking at the variables collected here, and every relevant module will have to include this header file. In practice, things are a bit messy.     We need globally shared data structures, for defining the global state variables.", "id": "progs/doomgeneric/doomstat.h", "kind": "module", "label": "doomstat.h", "language": "h", "sha256": "92354d62cf4265e7", "symbol_count": 68, "symbols": [{"doc": "----------------------- Command line parameters.", "kind": "variable", "line": 46, "name": "nomonsters", "signature": "extern boolean nomonsters;"}, {"kind": "variable", "line": 47, "name": "respawnparm", "signature": "extern boolean respawnparm;"}, {"kind": "variable", "line": 48, "name": "fastparm", "signature": "extern boolean fastparm;"}, {"kind": "variable", "line": 50, "name": "devparm", "signature": "extern boolean devparm;"}, {"doc": "---------------------------------------------------- Game Mode - identify IWAD as shareware, retail etc.", "kind": "variable", "line": 56, "name": "gamemode", "signature": "extern GameMode_t gamemode;"}, {"kind": "variable", "line": 57, "name": "gamemission", "signature": "extern GameMission_t gamemission;"}, {"kind": "variable", "line": 58, "name": "gameversion", "signature": "extern GameVersion_t gameversion;"}, {"kind": "variable", "line": 59, "name": "gamedescription", "signature": "extern char *gamedescription;"}, {"doc": "If true, we're using one of the mangled BFG edition IWADs.", "kind": "variable", "line": 62, "name": "bfgedition", "signature": "extern boolean bfgedition;"}, {"doc": "Set if homebrew PWAD stuff has been added.", "kind": "variable", "line": 74, "name": "modifiedgame", "signature": "extern boolean modifiedgame;"}, {"doc": "Defaults for menu, methinks.", "kind": "variable", "line": 82, "name": "startskill", "signature": "extern skill_t startskill;"}, {"kind": "variable", "line": 83, "name": "startepisode", "signature": "extern int startepisode;"}, {"kind": "variable", "line": 84, "name": "startmap", "signature": "extern int startmap;"}, {"kind": "variable", "line": 89, "name": "startloadgame", "signature": "extern int startloadgame;"}, {"kind": "variable", "line": 91, "name": "autostart", "signature": "extern boolean autostart;"}, {"doc": "Selected by user.", "kind": "variable", "line": 94, "name": "gameskill", "signature": "extern skill_t gameskill;"}, {"kind": "variable", "line": 95, "name": "gameepisode", "signature": "extern int gameepisode;"}, {"kind": "variable", "line": 96, "name": "gamemap", "signature": "extern int gamemap;"}, {"doc": "If non-zero, exit the level after this number of minutes", "kind": "variable", "line": 99, "name": "timelimit", "signature": "extern int timelimit;"}, {"doc": "Nightmare mode flag, single player.", "kind": "variable", "line": 102, "name": "respawnmonsters", "signature": "extern boolean respawnmonsters;"}, {"doc": "Netgame? Only true if >1 player.", "kind": "variable", "line": 105, "name": "netgame", "signature": "extern boolean netgame;"}, {"doc": "0=Cooperative; 1=Deathmatch; 2=Altdeath", "kind": "variable", "line": 108, "name": "deathmatch", "signature": "extern int deathmatch;"}, {"doc": "From m_menu.c: Sound FX volume has default, 0 - 15 Music volume has default, 0 - 15 These are multiplied by 8.", "kind": "variable", "line": 120, "name": "sfxVolume", "signature": "extern int sfxVolume;"}, {"kind": "variable", "line": 121, "name": "musicVolume", "signature": "extern int musicVolume;"}, {"doc": "Current music/sfx card - index useless w/o a reference LUT in a sound module. Ideally, this would use indices found in: /usr/include/linux/soundcard.h", "kind": "variable", "line": 127, "name": "snd_MusicDevice", "signature": "extern int snd_MusicDevice;"}, {"kind": "variable", "line": 128, "name": "snd_SfxDevice", "signature": "extern int snd_SfxDevice;"}, {"doc": "Config file? Same disclaimer as above.", "kind": "variable", "line": 130, "name": "snd_DesiredMusicDevice", "signature": "extern int snd_DesiredMusicDevice;"}, {"kind": "variable", "line": 131, "name": "snd_DesiredSfxDevice", "signature": "extern int snd_DesiredSfxDevice;"}, {"doc": "Depending on view size - no status bar? Note that there is no way to disable the status bar explicitely.", "kind": "variable", "line": 141, "name": "statusbaractive", "signature": "extern boolean statusbaractive;"}, {"kind": "variable", "line": 143, "name": "automapactive", "signature": "extern boolean automapactive;"}, {"kind": "variable", "line": 144, "name": "menuactive", "signature": "extern boolean menuactive;"}, {"kind": "variable", "line": 145, "name": "paused", "signature": "extern boolean paused;"}, {"kind": "variable", "line": 148, "name": "viewactive", "signature": "extern boolean viewactive;"}, {"kind": "variable", "line": 150, "name": "nodrawers", "signature": "extern boolean nodrawers;"}, {"kind": "variable", "line": 153, "name": "testcontrols", "signature": "extern boolean testcontrols;"}, {"kind": "variable", "line": 154, "name": "testcontrols_mousespeed", "signature": "extern int testcontrols_mousespeed;"}, {"doc": "This one is related to the 3-screen display mode. ANG90 = left side, ANG270 = right", "kind": "variable", "line": 161, "name": "viewangleoffset", "signature": "extern int viewangleoffset;"}, {"doc": "Player taking events, and displaying.", "kind": "variable", "line": 164, "name": "consoleplayer", "signature": "extern int consoleplayer;"}, {"kind": "variable", "line": 165, "name": "displayplayer", "signature": "extern int displayplayer;"}, {"doc": "------------------------------------ Scores, rating. Statistics on a given map, for intermission.", "kind": "variable", "line": 172, "name": "totalkills", "signature": "extern int totalkills;"}, {"kind": "variable", "line": 173, "name": "totalitems", "signature": "extern int totalitems;"}, {"kind": "variable", "line": 174, "name": "totalsecret", "signature": "extern int totalsecret;"}, {"doc": "Timer, for scores.", "kind": "variable", "line": 177, "name": "levelstarttic", "signature": "extern int levelstarttic;"}, {"kind": "variable", "line": 178, "name": "leveltime", "signature": "extern int leveltime;"}, {"doc": "------------------------------------- DEMO playback/recording related stuff. No demo, there is a human player in charge? Disable save/end game?", "kind": "variable", "line": 186, "name": "usergame", "signature": "extern boolean usergame;"}, {"doc": "?", "kind": "variable", "line": 189, "name": "demoplayback", "signature": "extern boolean demoplayback;"}, {"kind": "variable", "line": 190, "name": "demorecording", "signature": "extern boolean demorecording;"}, {"kind": "variable", "line": 195, "name": "lowres_turn", "signature": "extern boolean lowres_turn;"}, {"doc": "Quit after playing a demo from cmdline.", "kind": "variable", "line": 198, "name": "singledemo", "signature": "extern boolean singledemo;"}, {"doc": "?", "kind": "variable", "line": 204, "name": "gamestate", "signature": "extern gamestate_t gamestate;"}, {"doc": "Bookkeeping on players - state.", "kind": "variable", "line": 220, "name": "players", "signature": "extern player_t players[MAXPLAYERS];"}, {"doc": "Alive? Disconnected?", "kind": "variable", "line": 223, "name": "playeringame", "signature": "extern boolean playeringame[MAXPLAYERS];"}, {"doc": "Player spawn spots for deathmatch. define MAX_DM_STARTS   10", "kind": "variable", "line": 228, "name": "deathmatchstarts", "signature": "extern mapthing_t deathmatchstarts[MAX_DM_STARTS];"}, {"kind": "variable", "line": 229, "name": "deathmatch_p", "signature": "extern mapthing_t* deathmatch_p;"}, {"doc": "Player spawn spots.", "kind": "variable", "line": 232, "name": "playerstarts", "signature": "extern mapthing_t playerstarts[MAXPLAYERS];"}, {"doc": "Intermission stats. Parameters for world map / intermission.", "kind": "variable", "line": 236, "name": "wminfo", "signature": "extern wbstartstruct_t wminfo;"}, {"doc": "File handling stuff.", "kind": "variable", "line": 249, "name": "savegamedir", "signature": "extern char * savegamedir;"}, {"kind": "variable", "line": 250, "name": "basedefault", "signature": "extern char basedefault[1024];"}, {"doc": "if true, load all graphics at level load", "kind": "variable", "line": 253, "name": "precache", "signature": "extern boolean precache;"}, {"doc": "wipegamestate can be set to -1 to force a wipe on the next draw", "kind": "variable", "line": 258, "name": "wipegamestate", "signature": "extern gamestate_t wipegamestate;"}, {"kind": "variable", "line": 260, "name": "mouseSensitivity", "signature": "extern int mouseSensitivity;"}, {"kind": "variable", "line": 262, "name": "bodyqueslot", "signature": "extern int bodyqueslot;"}, {"doc": "Needed to store the number of the dummy sky flat. Used for rendering, as well as tracking projectiles etc.", "kind": "variable", "line": 269, "name": "skyflatnum", "signature": "extern int skyflatnum;"}, {"kind": "variable", "line": 276, "name": "rndindex", "signature": "extern int rndindex;"}, {"kind": "variable", "line": 278, "name": "netcmds", "signature": "extern ticcmd_t *netcmds;"}, {"kind": "macro", "line": 26, "name": "__D_STATE__", "signature": "#define __D_STATE__"}, {"kind": "macro", "line": 69, "name": "logical_gamemission", "signature": "#define logical_gamemission"}, {"kind": "macro", "line": 227, "name": "MAX_DM_STARTS", "signature": "#define MAX_DM_STARTS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Simple basic typedefs, isolated here to make it easier separating modules.     #define macros to provide functions missing in Windows. Outside Windows, we use strings.h for str[n]casecmp.", "id": "progs/doomgeneric/doomtype.h", "kind": "module", "label": "doomtype.h", "language": "h", "sha256": "25470092d28f0e62", "symbol_count": 14, "symbols": [{"doc": "Use builtin bool type with C++.", "kind": "type_alias", "line": 68, "name": "boolean", "signature": "typedef bool boolean;"}, {"doc": "endif", "kind": "type_alias", "line": 81, "name": "byte", "signature": "typedef uint8_t byte;"}, {"kind": "macro", "line": 22, "name": "__DOOMTYPE__", "signature": "#define __DOOMTYPE__"}, {"kind": "macro", "line": 30, "name": "strcasecmp", "signature": "#define strcasecmp"}, {"kind": "macro", "line": 31, "name": "strncasecmp", "signature": "#define strncasecmp"}, {"kind": "macro", "line": 50, "name": "PACKEDATTR", "signature": "#define PACKEDATTR"}, {"kind": "macro", "line": 52, "name": "PACKEDATTR", "signature": "#define PACKEDATTR"}, {"kind": "macro", "line": 88, "name": "DIR_SEPARATOR", "signature": "#define DIR_SEPARATOR"}, {"kind": "macro", "line": 89, "name": "DIR_SEPARATOR_S", "signature": "#define DIR_SEPARATOR_S"}, {"kind": "macro", "line": 90, "name": "PATH_SEPARATOR", "signature": "#define PATH_SEPARATOR"}, {"kind": "macro", "line": 94, "name": "DIR_SEPARATOR", "signature": "#define DIR_SEPARATOR"}, {"kind": "macro", "line": 95, "name": "DIR_SEPARATOR_S", "signature": "#define DIR_SEPARATOR_S"}, {"kind": "macro", "line": 96, "name": "PATH_SEPARATOR", "signature": "#define PATH_SEPARATOR"}, {"kind": "macro", "line": 100, "name": "arrlen", "signature": "#define arrlen(array)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Globally defined strings.", "id": "progs/doomgeneric/dstrings.c", "kind": "module", "label": "dstrings.c", "language": "c", "sha256": "ca23811dfb9766f3", "symbol_count": 0, "symbols": []}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: DOOM strings, by language.      All important printed strings.   Misc. other strings.", "id": "progs/doomgeneric/dstrings.h", "kind": "module", "label": "dstrings.h", "language": "h", "sha256": "f279c950ed4bd857", "symbol_count": 5, "symbols": [{"kind": "variable", "line": 37, "name": "doom1_endmsg", "signature": "extern char *doom1_endmsg[];"}, {"kind": "variable", "line": 38, "name": "doom2_endmsg", "signature": "extern char *doom2_endmsg[];"}, {"kind": "macro", "line": 22, "name": "__DSTRINGS__", "signature": "#define __DSTRINGS__"}, {"kind": "macro", "line": 30, "name": "SAVEGAMENAME", "signature": "#define SAVEGAMENAME"}, {"kind": "macro", "line": 35, "name": "NUM_QUITMESSAGES", "signature": "#define NUM_QUITMESSAGES"}]}, {"id": "progs/doomgeneric/dummy.c", "kind": "module", "label": "dummy.c", "language": "c", "sha256": "ffc79e57c8205c85", "symbol_count": 1, "symbols": [{"kind": "function", "line": 43, "name": "I_InitTimidityConfig", "signature": "void I_InitTimidityConfig(void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Game completion, final screen animation.     Functions.", "id": "progs/doomgeneric/f_finale.c", "kind": "module", "label": "f_finale.c", "language": "c", "sha256": "76caab0d090e7ca2", "symbol_count": 18, "symbols": [{"kind": "struct", "line": 60, "name": "textscreen_t"}, {"doc": "Final DOOM 2 animation Casting by id Software. in order of appearance", "kind": "struct", "line": 300, "name": "castinfo_t"}, {"doc": "F_StartFinale", "kind": "function", "line": 108, "name": "F_StartFinale", "signature": "void F_StartFinale (void)"}, {"kind": "function", "line": 160, "name": "F_Responder", "signature": "boolean F_Responder (event_t *event)"}, {"doc": "F_Ticker", "kind": "function", "line": 172, "name": "F_Ticker", "signature": "void F_Ticker (void)"}, {"kind": "function", "line": 227, "name": "F_TextWrite", "signature": "void F_TextWrite (void)"}, {"doc": "F_StartCast", "kind": "function", "line": 340, "name": "F_StartCast", "signature": "void F_StartCast (void)"}, {"doc": "F_CastTicker", "kind": "function", "line": 358, "name": "F_CastTicker", "signature": "void F_CastTicker (void)"}, {"kind": "function", "line": 465, "name": "F_CastResponder", "signature": "boolean F_CastResponder (event_t* ev)"}, {"kind": "function", "line": 486, "name": "F_CastPrint", "signature": "void F_CastPrint (char* text)"}, {"kind": "function", "line": 541, "name": "F_CastDrawer", "signature": "void F_CastDrawer (void)"}, {"kind": "function", "line": 572, "name": "F_DrawPatchCol", "signature": "void\nF_DrawPatchCol\n( int\t\tx,\n  patch_t*\tpatch,\n  int\t\tcol )"}, {"doc": "F_BunnyScroll", "kind": "function", "line": 606, "name": "F_BunnyScroll", "signature": "void F_BunnyScroll (void)"}, {"kind": "function", "line": 661, "name": "F_ArtScreenDrawer", "signature": "static void F_ArtScreenDrawer(void)"}, {"doc": "F_Drawer", "kind": "function", "line": 702, "name": "F_Drawer", "signature": "void F_Drawer (void)"}, {"doc": "include \"hu_stuff.h\"", "kind": "variable", "line": 224, "name": "hu_font", "signature": "extern patch_t *hu_font[HU_FONTSIZE];"}, {"kind": "macro", "line": 57, "name": "TEXTSPEED", "signature": "#define\tTEXTSPEED"}, {"kind": "macro", "line": 58, "name": "TEXTWAIT", "signature": "#define\tTEXTWAIT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:        FINALE   Called by main loop.", "id": "progs/doomgeneric/f_finale.h", "kind": "module", "label": "f_finale.h", "language": "h", "sha256": "16a88fd7987fc1ee", "symbol_count": 4, "symbols": [{"doc": "Called by main loop.", "kind": "function", "line": 34, "name": "F_Ticker", "signature": "void F_Ticker (void);"}, {"doc": "Called by main loop.", "kind": "function", "line": 37, "name": "F_Drawer", "signature": "void F_Drawer (void);"}, {"kind": "function", "line": 40, "name": "F_StartFinale", "signature": "void F_StartFinale (void);"}, {"kind": "macro", "line": 21, "name": "__F_FINALE__", "signature": "#define __F_FINALE__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Mission begin melt/wipe screen special effect.", "id": "progs/doomgeneric/f_wipe.c", "kind": "module", "label": "f_wipe.c", "language": "c", "sha256": "4558dfd253adc165", "symbol_count": 10, "symbols": [{"kind": "function", "line": 43, "name": "wipe_shittyColMajorXform", "signature": "void\nwipe_shittyColMajorXform\n( short*\tarray,\n  int\t\twidth,\n  int\t\theight )"}, {"kind": "function", "line": 65, "name": "wipe_initColorXForm", "signature": "int\nwipe_initColorXForm\n( int\twidth,\n  int\theight,\n  int\tticks )"}, {"kind": "function", "line": 75, "name": "wipe_doColorXForm", "signature": "int\nwipe_doColorXForm\n( int\twidth,\n  int\theight,\n  int\tticks )"}, {"kind": "function", "line": 121, "name": "wipe_exitColorXForm", "signature": "int\nwipe_exitColorXForm\n( int\twidth,\n  int\theight,\n  int\tticks )"}, {"kind": "function", "line": 133, "name": "wipe_initMelt", "signature": "int\nwipe_initMelt\n( int\twidth,\n  int\theight,\n  int\tticks )"}, {"kind": "function", "line": 164, "name": "wipe_doMelt", "signature": "int\nwipe_doMelt\n( int\twidth,\n  int\theight,\n  int\tticks )"}, {"kind": "function", "line": 219, "name": "wipe_exitMelt", "signature": "int\nwipe_exitMelt\n( int\twidth,\n  int\theight,\n  int\tticks )"}, {"kind": "function", "line": 231, "name": "wipe_StartScreen", "signature": "int\nwipe_StartScreen\n( int\tx,\n  int\ty,\n  int\twidth,\n  int\theight )"}, {"kind": "function", "line": 243, "name": "wipe_EndScreen", "signature": "int\nwipe_EndScreen\n( int\tx,\n  int\ty,\n  int\twidth,\n  int\theight )"}, {"kind": "function", "line": 256, "name": "wipe_ScreenWipe", "signature": "int\nwipe_ScreenWipe\n( int\twipeno,\n  int\tx,\n  int\ty,\n  int\twidth,\n  int\theight,\n  int\tticks )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Mission start screen wipe/melt, special effects.      SCREEN WIPE PACKAGE", "id": "progs/doomgeneric/f_wipe.h", "kind": "module", "label": "f_wipe.h", "language": "h", "sha256": "b309beae57704854", "symbol_count": 4, "symbols": [{"kind": "function", "line": 39, "name": "wipe_StartScreen", "signature": "int wipe_StartScreen ( int x, int y, int width, int height );"}, {"kind": "function", "line": 47, "name": "wipe_EndScreen", "signature": "int wipe_EndScreen ( int x, int y, int width, int height );"}, {"kind": "function", "line": 55, "name": "wipe_ScreenWipe", "signature": "int wipe_ScreenWipe ( int wipeno, int x, int y, int width, int height, int ticks );"}, {"kind": "macro", "line": 21, "name": "__F_WIPE_H__", "signature": "#define __F_WIPE_H__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none", "id": "progs/doomgeneric/g_game.c", "kind": "module", "label": "g_game.c", "language": "c", "sha256": "cbb72e172a7fcc96", "symbol_count": 54, "symbols": [{"kind": "function", "line": 233, "name": "G_CmdChecksum", "signature": "int G_CmdChecksum (ticcmd_t* cmd)"}, {"kind": "function", "line": 244, "name": "WeaponSelectable", "signature": "static boolean WeaponSelectable(weapontype_t weapon)"}, {"kind": "function", "line": 281, "name": "G_NextWeapon", "signature": "static int G_NextWeapon(int direction)"}, {"doc": "G_BuildTiccmd Builds a ticcmd from all of the available inputs or reads it from the demo buffer. If recording a demo, write it out", "kind": "function", "line": 322, "name": "G_BuildTiccmd", "signature": "void G_BuildTiccmd (ticcmd_t* cmd, int maketic)"}, {"doc": "G_DoLoadLevel", "kind": "function", "line": 603, "name": "G_DoLoadLevel", "signature": "void G_DoLoadLevel (void)"}, {"kind": "function", "line": 675, "name": "SetJoyButtons", "signature": "static void SetJoyButtons(unsigned int buttons_mask)"}, {"kind": "function", "line": 703, "name": "SetMouseButtons", "signature": "static void SetMouseButtons(unsigned int buttons_mask)"}, {"doc": "G_Responder Get info needed to make ticcmd_ts for the players.", "kind": "function", "line": 733, "name": "G_Responder", "signature": "boolean G_Responder (event_t* ev)"}, {"doc": "G_Ticker Make ticcmd_ts for the players.", "kind": "function", "line": 854, "name": "G_Ticker", "signature": "void G_Ticker (void)"}, {"doc": "G_InitPlayer Called at the start. Called by the game initialization functions.", "kind": "function", "line": 1039, "name": "G_InitPlayer", "signature": "void G_InitPlayer (int player)"}, {"doc": "G_PlayerFinishLevel Can when a player completes a level.", "kind": "function", "line": 1051, "name": "G_PlayerFinishLevel", "signature": "void G_PlayerFinishLevel (int player)"}, {"doc": "G_PlayerReborn Called after a player dies almost everything is cleared and initialized", "kind": "function", "line": 1072, "name": "G_PlayerReborn", "signature": "void G_PlayerReborn (int player)"}, {"kind": "function", "line": 1116, "name": "G_CheckSpot", "signature": "boolean\nG_CheckSpot\n( int\t\tplayernum,\n  mapthing_t*\tmthing )"}, {"doc": "G_DeathMatchSpawnPlayer Spawns a player at one of the random death match spots called at level load and each death", "kind": "function", "line": 1223, "name": "G_DeathMatchSpawnPlayer", "signature": "void G_DeathMatchSpawnPlayer (int playernum)"}, {"doc": "G_DoReborn", "kind": "function", "line": 1250, "name": "G_DoReborn", "signature": "void G_DoReborn (int playernum)"}, {"kind": "function", "line": 1296, "name": "G_ScreenShot", "signature": "void G_ScreenShot (void)"}, {"kind": "function", "line": 1328, "name": "G_ExitLevel", "signature": "void G_ExitLevel (void)"}, {"doc": "Here's for the german edition.", "kind": "function", "line": 1335, "name": "G_SecretExitLevel", "signature": "void G_SecretExitLevel (void)"}, {"kind": "function", "line": 1346, "name": "G_DoCompleted", "signature": "void G_DoCompleted (void)"}, {"doc": "G_WorldDone", "kind": "function", "line": 1494, "name": "G_WorldDone", "signature": "void G_WorldDone (void)"}, {"kind": "function", "line": 1519, "name": "G_DoWorldDone", "signature": "void G_DoWorldDone (void)"}, {"kind": "function", "line": 1539, "name": "G_LoadGame", "signature": "void G_LoadGame (char* name)"}, {"kind": "function", "line": 1548, "name": "G_DoLoadGame", "signature": "void G_DoLoadGame (void)"}, {"kind": "function", "line": 1601, "name": "G_SaveGame", "signature": "void\nG_SaveGame\n( int\tslot,\n  char*\tdescription )"}, {"kind": "function", "line": 1610, "name": "G_DoSaveGame", "signature": "void G_DoSaveGame (void)"}, {"kind": "function", "line": 1698, "name": "G_DeferedInitNew", "signature": "void\nG_DeferedInitNew\n( skill_t\tskill,\n  int\t\tepisode,\n  int\t\tmap)"}, {"kind": "function", "line": 1710, "name": "G_DoNewGame", "signature": "void G_DoNewGame (void)"}, {"kind": "function", "line": 1727, "name": "G_InitNew", "signature": "void\nG_InitNew\n( skill_t\tskill,\n  int\t\tepisode,\n  int\t\tmap )"}, {"kind": "function", "line": 1898, "name": "G_ReadDemoTiccmd", "signature": "void G_ReadDemoTiccmd (ticcmd_t* cmd)"}, {"kind": "function", "line": 1926, "name": "IncreaseDemoBuffer", "signature": "static void IncreaseDemoBuffer(void)"}, {"kind": "function", "line": 1956, "name": "G_WriteDemoTiccmd", "signature": "void G_WriteDemoTiccmd (ticcmd_t* cmd)"}, {"doc": "G_RecordDemo", "kind": "function", "line": 2010, "name": "G_RecordDemo", "signature": "void G_RecordDemo (char *name)"}, {"doc": "Get the demo version code appropriate for the version set in gameversion.", "kind": "function", "line": 2040, "name": "G_VanillaVersionCode", "signature": "int G_VanillaVersionCode(void)"}, {"kind": "function", "line": 2058, "name": "G_BeginRecording", "signature": "void G_BeginRecording (void)"}, {"kind": "function", "line": 2107, "name": "G_DeferedPlayDemo", "signature": "void G_DeferedPlayDemo (char* name)"}, {"kind": "function", "line": 2115, "name": "DemoVersionDescription", "signature": "static char *DemoVersionDescription(int version)"}, {"kind": "function", "line": 2152, "name": "G_DoPlayDemo", "signature": "void G_DoPlayDemo (void)"}, {"doc": "G_TimeDemo", "kind": "function", "line": 2215, "name": "G_TimeDemo", "signature": "void G_TimeDemo (char* name)"}, {"kind": "function", "line": 2243, "name": "G_CheckDemoStatus", "signature": "boolean G_CheckDemoStatus (void)"}, {"kind": "function", "line": 88, "name": "G_DoVictory", "signature": "void G_DoVictory (void);"}, {"doc": "G_CheckSpot Returns false if the player cannot be respawned at the given mapthing_t spot because something is occupying it", "kind": "function", "line": 1113, "name": "P_SpawnPlayer", "signature": "void P_SpawnPlayer (mapthing_t* mthing);"}, {"kind": "function", "line": 1535, "name": "R_ExecuteSetViewSize", "signature": "void R_ExecuteSetViewSize (void);"}, {"kind": "variable", "line": 939, "name": "player_names", "signature": "extern char *player_names[4];"}, {"kind": "variable", "line": 1326, "name": "pagename", "signature": "extern char* pagename;"}, {"doc": "G_InitFromSavegame Can be called by the startup code or the menu task.", "kind": "variable", "line": 1534, "name": "setsizeneeded", "signature": "extern boolean setsizeneeded;"}, {"kind": "macro", "line": 76, "name": "SAVEGAMESIZE", "signature": "#define SAVEGAMESIZE"}, {"kind": "macro", "line": 152, "name": "MAXPLMOVE", "signature": "#define MAXPLMOVE"}, {"kind": "macro", "line": 154, "name": "TURBOTHRESHOLD", "signature": "#define TURBOTHRESHOLD"}, {"kind": "macro", "line": 193, "name": "SLOWTURNTICS", "signature": "#define SLOWTURNTICS"}, {"kind": "macro", "line": 195, "name": "NUMKEYS", "signature": "#define NUMKEYS"}, {"kind": "macro", "line": 196, "name": "MAX_JOY_BUTTONS", "signature": "#define MAX_JOY_BUTTONS"}, {"kind": "macro", "line": 225, "name": "BODYQUESIZE", "signature": "#define\tBODYQUESIZE"}, {"kind": "macro", "line": 1545, "name": "VERSIONSIZE", "signature": "#define VERSIONSIZE"}, {"kind": "macro", "line": 1895, "name": "DEMOMARKER", "signature": "#define DEMOMARKER"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Duh.        GAME", "id": "progs/doomgeneric/g_game.h", "kind": "module", "label": "g_game.h", "language": "h", "sha256": "4412fda515867c37", "symbol_count": 22, "symbols": [{"doc": "GAME", "kind": "function", "line": 31, "name": "G_DeathMatchSpawnPlayer", "signature": "void G_DeathMatchSpawnPlayer (int playernum);"}, {"kind": "function", "line": 33, "name": "G_InitNew", "signature": "void G_InitNew (skill_t skill, int episode, int map);"}, {"doc": "Can be called by the startup code or M_Responder. A normal game starts at map 1, but a warp test can start elsewhere", "kind": "function", "line": 38, "name": "G_DeferedInitNew", "signature": "void G_DeferedInitNew (skill_t skill, int episode, int map);"}, {"kind": "function", "line": 40, "name": "G_DeferedPlayDemo", "signature": "void G_DeferedPlayDemo (char* demo);"}, {"doc": "Can be called by the startup code or M_Responder, calls P_SetupLevel or W_EnterWorld.", "kind": "function", "line": 44, "name": "G_LoadGame", "signature": "void G_LoadGame (char* name);"}, {"kind": "function", "line": 46, "name": "G_DoLoadGame", "signature": "void G_DoLoadGame (void);"}, {"doc": "Called by M_Responder.", "kind": "function", "line": 49, "name": "G_SaveGame", "signature": "void G_SaveGame (int slot, char* description);"}, {"doc": "Only called by startup code.", "kind": "function", "line": 52, "name": "G_RecordDemo", "signature": "void G_RecordDemo (char* name);"}, {"kind": "function", "line": 54, "name": "G_BeginRecording", "signature": "void G_BeginRecording (void);"}, {"kind": "function", "line": 56, "name": "G_PlayDemo", "signature": "void G_PlayDemo (char* name);"}, {"kind": "function", "line": 57, "name": "G_TimeDemo", "signature": "void G_TimeDemo (char* name);"}, {"kind": "function", "line": 60, "name": "G_ExitLevel", "signature": "void G_ExitLevel (void);"}, {"kind": "function", "line": 61, "name": "G_SecretExitLevel", "signature": "void G_SecretExitLevel (void);"}, {"kind": "function", "line": 63, "name": "G_WorldDone", "signature": "void G_WorldDone (void);"}, {"kind": "function", "line": 67, "name": "G_BuildTiccmd", "signature": "void G_BuildTiccmd (ticcmd_t *cmd, int maketic);"}, {"kind": "function", "line": 69, "name": "G_Ticker", "signature": "void G_Ticker (void);"}, {"kind": "function", "line": 72, "name": "G_ScreenShot", "signature": "void G_ScreenShot (void);"}, {"kind": "function", "line": 74, "name": "G_DrawMouseSpeedBox", "signature": "void G_DrawMouseSpeedBox(void);"}, {"kind": "function", "line": 75, "name": "G_VanillaVersionCode", "signature": "int G_VanillaVersionCode(void);"}, {"kind": "variable", "line": 77, "name": "vanilla_savegame_limit", "signature": "extern int vanilla_savegame_limit;"}, {"kind": "variable", "line": 78, "name": "vanilla_demo_limit", "signature": "extern int vanilla_demo_limit;"}, {"kind": "macro", "line": 21, "name": "__G_GAME__", "signature": "#define __G_GAME__"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: GUS emulation code.  Actually emulating a GUS is far too much work; fortunately GUS \"emulation\" already exists in the form of Timidity, which supports GUS patch files. This code therefore converts Doom's DMXGUS lump into an equivalent Timidity configuration file.", "id": "progs/doomgeneric/gusconf.c", "kind": "module", "label": "gusconf.c", "language": "c", "sha256": "9dace5db8bac7734", "symbol_count": 10, "symbols": [{"kind": "struct", "line": 34, "name": "gus_config_t"}, {"kind": "function", "line": 43, "name": "MappingIndex", "signature": "static unsigned int MappingIndex(void)"}, {"kind": "function", "line": 61, "name": "SplitLine", "signature": "static int SplitLine(char *line, char **fields, unsigned int max_fields)"}, {"kind": "function", "line": 108, "name": "ParseLine", "signature": "static void ParseLine(gus_config_t *config, char *line)"}, {"kind": "function", "line": 129, "name": "ParseDMXConfig", "signature": "static void ParseDMXConfig(char *dmxconf, gus_config_t *config)"}, {"kind": "function", "line": 165, "name": "FreeDMXConfig", "signature": "static void FreeDMXConfig(gus_config_t *config)"}, {"kind": "function", "line": 175, "name": "ReadDMXConfig", "signature": "static char *ReadDMXConfig(void)"}, {"kind": "function", "line": 197, "name": "WriteTimidityConfig", "signature": "static boolean WriteTimidityConfig(char *path, gus_config_t *config)"}, {"kind": "function", "line": 244, "name": "GUS_WriteConfig", "signature": "boolean GUS_WriteConfig(char *path)"}, {"kind": "macro", "line": 32, "name": "MAX_INSTRUMENTS", "signature": "#define MAX_INSTRUMENTS"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: GUS emulation code.", "id": "progs/doomgeneric/gusconf.h", "kind": "module", "label": "gusconf.h", "language": "h", "sha256": "8b3f7b0cbbcfb4d2", "symbol_count": 3, "symbols": [{"kind": "variable", "line": 23, "name": "gus_patch_path", "signature": "extern char *gus_patch_path;"}, {"kind": "variable", "line": 24, "name": "gus_ram_kb", "signature": "extern unsigned int gus_ram_kb;"}, {"kind": "macro", "line": 19, "name": "__GUSCONF_H__", "signature": "#define __GUSCONF_H__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  heads-up text and input code", "id": "progs/doomgeneric/hu_lib.c", "kind": "module", "label": "hu_lib.c", "language": "c", "sha256": "3d73ecabcf682e83", "symbol_count": 22, "symbols": [{"kind": "function", "line": 36, "name": "HUlib_init", "signature": "void HUlib_init(void)"}, {"kind": "function", "line": 40, "name": "HUlib_clearTextLine", "signature": "void HUlib_clearTextLine(hu_textline_t* t)"}, {"kind": "function", "line": 48, "name": "HUlib_initTextLine", "signature": "void\nHUlib_initTextLine\n( hu_textline_t*\tt,\n  int\t\t\tx,\n  int\t\t\ty,\n  patch_t**\t\tf,\n  int\t\t\tsc )"}, {"kind": "function", "line": 63, "name": "HUlib_addCharToTextLine", "signature": "boolean\nHUlib_addCharToTextLine\n( hu_textline_t*\tt,\n  char\t\t\tch )"}, {"kind": "function", "line": 80, "name": "HUlib_delCharFromTextLine", "signature": "boolean HUlib_delCharFromTextLine(hu_textline_t* t)"}, {"kind": "function", "line": 94, "name": "HUlib_drawTextLine", "signature": "void\nHUlib_drawTextLine\n( hu_textline_t*\tl,\n  boolean\t\tdrawcursor )"}, {"doc": "sorta called by HU_Erase and just better darn get things straight", "kind": "function", "line": 137, "name": "HUlib_eraseTextLine", "signature": "void HUlib_eraseTextLine(hu_textline_t* l)"}, {"kind": "function", "line": 169, "name": "HUlib_initSText", "signature": "void\nHUlib_initSText\n( hu_stext_t*\ts,\n  int\t\tx,\n  int\t\ty,\n  int\t\th,\n  patch_t**\tfont,\n  int\t\tstar..."}, {"kind": "function", "line": 192, "name": "HUlib_addLineToSText", "signature": "void HUlib_addLineToSText(hu_stext_t* s)"}, {"kind": "function", "line": 209, "name": "HUlib_addMessageToSText", "signature": "void\nHUlib_addMessageToSText\n( hu_stext_t*\ts,\n  char*\t\tprefix,\n  char*\t\tmsg )"}, {"kind": "function", "line": 223, "name": "HUlib_drawSText", "signature": "void HUlib_drawSText(hu_stext_t* s)"}, {"kind": "function", "line": 246, "name": "HUlib_eraseSText", "signature": "void HUlib_eraseSText(hu_stext_t* s)"}, {"kind": "function", "line": 262, "name": "HUlib_initIText", "signature": "void\nHUlib_initIText\n( hu_itext_t*\tit,\n  int\t\tx,\n  int\t\ty,\n  patch_t**\tfont,\n  int\t\tstartchar,\n  ..."}, {"doc": "The following deletion routines adhere to the left margin restriction", "kind": "function", "line": 278, "name": "HUlib_delCharFromIText", "signature": "void HUlib_delCharFromIText(hu_itext_t* it)"}, {"kind": "function", "line": 284, "name": "HUlib_eraseLineFromIText", "signature": "void HUlib_eraseLineFromIText(hu_itext_t* it)"}, {"doc": "Resets left margin as well", "kind": "function", "line": 291, "name": "HUlib_resetIText", "signature": "void HUlib_resetIText(hu_itext_t* it)"}, {"kind": "function", "line": 298, "name": "HUlib_addPrefixToIText", "signature": "void\nHUlib_addPrefixToIText\n( hu_itext_t*\tit,\n  char*\t\tstr )"}, {"kind": "function", "line": 310, "name": "HUlib_keyInIText", "signature": "boolean\nHUlib_keyInIText\n( hu_itext_t*\tit,\n  unsigned char ch )"}, {"kind": "function", "line": 329, "name": "HUlib_drawIText", "signature": "void HUlib_drawIText(hu_itext_t* it)"}, {"kind": "function", "line": 340, "name": "HUlib_eraseIText", "signature": "void HUlib_eraseIText(hu_itext_t* it)"}, {"kind": "variable", "line": 34, "name": "automapactive", "signature": "extern boolean automapactive;"}, {"kind": "macro", "line": 32, "name": "noterased", "signature": "#define noterased"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none    We are referring to patches.  font stuff", "id": "progs/doomgeneric/hu_lib.h", "kind": "module", "label": "hu_lib.h", "language": "h", "sha256": "2765473b6de24ab7", "symbol_count": 24, "symbols": [{"doc": "Text Line widget (parent of Scrolling Text and Input Text widgets)", "kind": "struct", "line": 36, "name": "hu_textline_t"}, {"doc": "Scrolling Text window widget (child of Text Line widget)", "kind": "struct", "line": 56, "name": "hu_stext_t"}, {"doc": "Input Text Line widget (child of Text Line widget)", "kind": "struct", "line": 72, "name": "hu_itext_t"}, {"doc": "initializes heads-up widget library", "kind": "function", "line": 91, "name": "HUlib_init", "signature": "void HUlib_init(void);"}, {"doc": "clear a line of text", "kind": "function", "line": 98, "name": "HUlib_clearTextLine", "signature": "void HUlib_clearTextLine(hu_textline_t *t);"}, {"kind": "function", "line": 100, "name": "HUlib_initTextLine", "signature": "void HUlib_initTextLine(hu_textline_t *t, int x, int y, patch_t **f, int sc);"}, {"doc": "draws tline", "kind": "function", "line": 109, "name": "HUlib_drawTextLine", "signature": "void HUlib_drawTextLine(hu_textline_t *l, boolean drawcursor);"}, {"doc": "erases text line", "kind": "function", "line": 112, "name": "HUlib_eraseTextLine", "signature": "void HUlib_eraseTextLine(hu_textline_t *l);"}, {"kind": "function", "line": 121, "name": "HUlib_initSText", "signature": "void HUlib_initSText ( hu_stext_t* s, int x, int y, int h, patch_t** font, int startchar, boolean* on );"}, {"doc": "add a new line", "kind": "function", "line": 131, "name": "HUlib_addLineToSText", "signature": "void HUlib_addLineToSText(hu_stext_t* s);"}, {"kind": "function", "line": 135, "name": "HUlib_addMessageToSText", "signature": "void HUlib_addMessageToSText ( hu_stext_t* s, char* prefix, char* msg );"}, {"doc": "draws stext", "kind": "function", "line": 141, "name": "HUlib_drawSText", "signature": "void HUlib_drawSText(hu_stext_t* s);"}, {"doc": "erases all stext lines", "kind": "function", "line": 144, "name": "HUlib_eraseSText", "signature": "void HUlib_eraseSText(hu_stext_t* s);"}, {"kind": "function", "line": 148, "name": "HUlib_initIText", "signature": "void HUlib_initIText ( hu_itext_t* it, int x, int y, patch_t** font, int startchar, boolean* on );"}, {"doc": "enforces left margin", "kind": "function", "line": 157, "name": "HUlib_delCharFromIText", "signature": "void HUlib_delCharFromIText(hu_itext_t* it);"}, {"doc": "enforces left margin", "kind": "function", "line": 160, "name": "HUlib_eraseLineFromIText", "signature": "void HUlib_eraseLineFromIText(hu_itext_t* it);"}, {"doc": "resets line and left margin", "kind": "function", "line": 163, "name": "HUlib_resetIText", "signature": "void HUlib_resetIText(hu_itext_t* it);"}, {"kind": "function", "line": 167, "name": "HUlib_addPrefixToIText", "signature": "void HUlib_addPrefixToIText ( hu_itext_t* it, char* str );"}, {"kind": "function", "line": 177, "name": "HUlib_drawIText", "signature": "void HUlib_drawIText(hu_itext_t* it);"}, {"doc": "erases all itext lines", "kind": "function", "line": 180, "name": "HUlib_eraseIText", "signature": "void HUlib_eraseIText(hu_itext_t* it);"}, {"kind": "macro", "line": 19, "name": "__HULIB__", "signature": "#define __HULIB__"}, {"kind": "macro", "line": 25, "name": "HU_CHARERASE", "signature": "#define HU_CHARERASE"}, {"kind": "macro", "line": 27, "name": "HU_MAXLINES", "signature": "#define HU_MAXLINES"}, {"kind": "macro", "line": 28, "name": "HU_MAXLINELENGTH", "signature": "#define HU_MAXLINELENGTH"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  Heads-up displays", "id": "progs/doomgeneric/hu_stuff.c", "kind": "module", "label": "hu_stuff.c", "language": "c", "sha256": "b021af7067afb5a9", "symbol_count": 24, "symbols": [{"kind": "function", "line": 286, "name": "HU_Init", "signature": "void HU_Init(void)"}, {"kind": "function", "line": 303, "name": "HU_Stop", "signature": "void HU_Stop(void)"}, {"kind": "function", "line": 308, "name": "HU_Start", "signature": "void HU_Start(void)"}, {"kind": "function", "line": 383, "name": "HU_Drawer", "signature": "void HU_Drawer(void)"}, {"kind": "function", "line": 393, "name": "HU_Erase", "signature": "void HU_Erase(void)"}, {"kind": "function", "line": 402, "name": "HU_Ticker", "signature": "void HU_Ticker(void)"}, {"kind": "function", "line": 482, "name": "HU_queueChatChar", "signature": "void HU_queueChatChar(char c)"}, {"kind": "function", "line": 495, "name": "HU_dequeueChatChar", "signature": "char HU_dequeueChatChar(void)"}, {"kind": "function", "line": 512, "name": "HU_Responder", "signature": "boolean HU_Responder(event_t *ev)"}, {"kind": "variable", "line": 103, "name": "showMessages", "signature": "extern int showMessages;"}, {"kind": "macro", "line": 47, "name": "HU_TITLE", "signature": "#define HU_TITLE"}, {"kind": "macro", "line": 48, "name": "HU_TITLE2", "signature": "#define HU_TITLE2"}, {"kind": "macro", "line": 49, "name": "HU_TITLEP", "signature": "#define HU_TITLEP"}, {"kind": "macro", "line": 50, "name": "HU_TITLET", "signature": "#define HU_TITLET"}, {"kind": "macro", "line": 51, "name": "HU_TITLE_CHEX", "signature": "#define HU_TITLE_CHEX"}, {"kind": "macro", "line": 52, "name": "HU_TITLEHEIGHT", "signature": "#define HU_TITLEHEIGHT"}, {"kind": "macro", "line": 53, "name": "HU_TITLEX", "signature": "#define HU_TITLEX"}, {"kind": "macro", "line": 54, "name": "HU_TITLEY", "signature": "#define HU_TITLEY"}, {"kind": "macro", "line": 56, "name": "HU_INPUTTOGGLE", "signature": "#define HU_INPUTTOGGLE"}, {"kind": "macro", "line": 57, "name": "HU_INPUTX", "signature": "#define HU_INPUTX"}, {"kind": "macro", "line": 58, "name": "HU_INPUTY", "signature": "#define HU_INPUTY"}, {"kind": "macro", "line": 59, "name": "HU_INPUTWIDTH", "signature": "#define HU_INPUTWIDTH"}, {"kind": "macro", "line": 60, "name": "HU_INPUTHEIGHT", "signature": "#define HU_INPUTHEIGHT"}, {"kind": "macro", "line": 475, "name": "QUEUESIZE", "signature": "#define QUEUESIZE"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  Head up display       Globally visible constants.   Calculate # of glyphs in font.", "id": "progs/doomgeneric/hu_stuff.h", "kind": "module", "label": "hu_stuff.h", "language": "h", "sha256": "a840574fc8b9b6a7", "symbol_count": 17, "symbols": [{"kind": "function", "line": 46, "name": "HU_Init", "signature": "void HU_Init(void);"}, {"kind": "function", "line": 47, "name": "HU_Start", "signature": "void HU_Start(void);"}, {"kind": "function", "line": 51, "name": "HU_Ticker", "signature": "void HU_Ticker(void);"}, {"kind": "function", "line": 52, "name": "HU_Drawer", "signature": "void HU_Drawer(void);"}, {"kind": "function", "line": 53, "name": "HU_dequeueChatChar", "signature": "char HU_dequeueChatChar(void);"}, {"kind": "function", "line": 54, "name": "HU_Erase", "signature": "void HU_Erase(void);"}, {"kind": "variable", "line": 56, "name": "chat_macros", "signature": "extern char *chat_macros[10];"}, {"kind": "macro", "line": 19, "name": "__HU_STUFF_H__", "signature": "#define __HU_STUFF_H__"}, {"kind": "macro", "line": 27, "name": "HU_FONTSTART", "signature": "#define HU_FONTSTART"}, {"kind": "macro", "line": 28, "name": "HU_FONTEND", "signature": "#define HU_FONTEND"}, {"kind": "macro", "line": 31, "name": "HU_FONTSIZE", "signature": "#define HU_FONTSIZE"}, {"kind": "macro", "line": 33, "name": "HU_BROADCAST", "signature": "#define HU_BROADCAST"}, {"kind": "macro", "line": 35, "name": "HU_MSGX", "signature": "#define HU_MSGX"}, {"kind": "macro", "line": 36, "name": "HU_MSGY", "signature": "#define HU_MSGY"}, {"kind": "macro", "line": 37, "name": "HU_MSGWIDTH", "signature": "#define HU_MSGWIDTH"}, {"kind": "macro", "line": 38, "name": "HU_MSGHEIGHT", "signature": "#define HU_MSGHEIGHT"}, {"kind": "macro", "line": 40, "name": "HU_MSGTIMEOUT", "signature": "#define HU_MSGTIMEOUT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   SDL implementation of the Hexen CD interface.", "id": "progs/doomgeneric/i_cdmus.c", "kind": "module", "label": "i_cdmus.c", "language": "c", "sha256": "dcc690bb873b1c9b", "symbol_count": 9, "symbols": [{"kind": "function", "line": 38, "name": "I_CDMusInit", "signature": "int I_CDMusInit(void)"}, {"kind": "function", "line": 92, "name": "I_CDMusPrintStartup", "signature": "void I_CDMusPrintStartup(void)"}, {"kind": "function", "line": 107, "name": "I_CDMusPlay", "signature": "int I_CDMusPlay(int track)"}, {"kind": "function", "line": 130, "name": "I_CDMusStop", "signature": "int I_CDMusStop(void)"}, {"kind": "function", "line": 145, "name": "I_CDMusResume", "signature": "int I_CDMusResume(void)"}, {"kind": "function", "line": 160, "name": "I_CDMusSetVolume", "signature": "int I_CDMusSetVolume(int volume)"}, {"kind": "function", "line": 169, "name": "I_CDMusFirstTrack", "signature": "int I_CDMusFirstTrack(void)"}, {"kind": "function", "line": 202, "name": "I_CDMusLastTrack", "signature": "int I_CDMusLastTrack(void)"}, {"kind": "function", "line": 219, "name": "I_CDMusTrackLength", "signature": "int I_CDMusTrackLength(int track_num)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   i_cdmus.h", "id": "progs/doomgeneric/i_cdmus.h", "kind": "module", "label": "i_cdmus.h", "language": "h", "sha256": "0980dbab8712debe", "symbol_count": 18, "symbols": [{"kind": "function", "line": 31, "name": "I_CDMusInit", "signature": "int I_CDMusInit(void);"}, {"kind": "function", "line": 32, "name": "I_CDMusPrintStartup", "signature": "void I_CDMusPrintStartup(void);"}, {"kind": "function", "line": 33, "name": "I_CDMusPlay", "signature": "int I_CDMusPlay(int track);"}, {"kind": "function", "line": 34, "name": "I_CDMusStop", "signature": "int I_CDMusStop(void);"}, {"kind": "function", "line": 35, "name": "I_CDMusResume", "signature": "int I_CDMusResume(void);"}, {"kind": "function", "line": 36, "name": "I_CDMusSetVolume", "signature": "int I_CDMusSetVolume(int volume);"}, {"kind": "function", "line": 37, "name": "I_CDMusFirstTrack", "signature": "int I_CDMusFirstTrack(void);"}, {"kind": "function", "line": 38, "name": "I_CDMusLastTrack", "signature": "int I_CDMusLastTrack(void);"}, {"kind": "function", "line": 39, "name": "I_CDMusTrackLength", "signature": "int I_CDMusTrackLength(int track);"}, {"kind": "variable", "line": 29, "name": "cd_Error", "signature": "extern int cd_Error;"}, {"kind": "macro", "line": 19, "name": "__ICDMUS__", "signature": "#define __ICDMUS__"}, {"kind": "macro", "line": 21, "name": "CDERR_NOTINSTALLED", "signature": "#define CDERR_NOTINSTALLED"}, {"kind": "macro", "line": 22, "name": "CDERR_NOAUDIOSUPPORT", "signature": "#define CDERR_NOAUDIOSUPPORT"}, {"kind": "macro", "line": 23, "name": "CDERR_NOAUDIOTRACKS", "signature": "#define CDERR_NOAUDIOTRACKS"}, {"kind": "macro", "line": 24, "name": "CDERR_BADDRIVE", "signature": "#define CDERR_BADDRIVE"}, {"kind": "macro", "line": 25, "name": "CDERR_BADTRACK", "signature": "#define CDERR_BADTRACK"}, {"kind": "macro", "line": 26, "name": "CDERR_IOCTLBUFFMEM", "signature": "#define CDERR_IOCTLBUFFMEM"}, {"kind": "macro", "line": 27, "name": "CDERR_DEVREQBASE", "signature": "#define CDERR_DEVREQBASE"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Exit text-mode ENDOOM screen.", "id": "progs/doomgeneric/i_endoom.c", "kind": "module", "label": "i_endoom.c", "language": "c", "sha256": "c72ffc4cf7ac291b", "symbol_count": 3, "symbols": [{"kind": "function", "line": 36, "name": "I_Endoom", "signature": "void I_Endoom(byte *endoom_data)"}, {"kind": "macro", "line": 29, "name": "ENDOOM_W", "signature": "#define ENDOOM_W"}, {"kind": "macro", "line": 30, "name": "ENDOOM_H", "signature": "#define ENDOOM_H"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Exit text-mode ENDOOM screen.     Display the Endoom screen on shutdown.  Pass a pointer to the ENDOOM lump.", "id": "progs/doomgeneric/i_endoom.h", "kind": "module", "label": "i_endoom.h", "language": "h", "sha256": "f023295280d38c82", "symbol_count": 2, "symbols": [{"kind": "function", "line": 26, "name": "I_Endoom", "signature": "void I_Endoom(byte *data);"}, {"kind": "macro", "line": 21, "name": "__I_ENDOOM__", "signature": "#define __I_ENDOOM__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.", "id": "progs/doomgeneric/i_input.c", "kind": "module", "label": "i_input.c", "language": "c", "sha256": "3a409b2be2d66f34", "symbol_count": 5, "symbols": [{"kind": "function", "line": 225, "name": "TranslateKey", "signature": "static unsigned char TranslateKey(unsigned char key)"}, {"kind": "function", "line": 242, "name": "GetTypedChar", "signature": "static unsigned char GetTypedChar(unsigned char key)"}, {"kind": "function", "line": 263, "name": "UpdateShiftStatus", "signature": "static void UpdateShiftStatus(int pressed, unsigned char key)"}, {"kind": "function", "line": 279, "name": "I_GetEvent", "signature": "void I_GetEvent(void)"}, {"kind": "function", "line": 338, "name": "I_InitInput", "signature": "void I_InitInput(void)"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: SDL Joystick code.", "id": "progs/doomgeneric/i_joystick.c", "kind": "module", "label": "i_joystick.c", "language": "c", "sha256": "2f627ff37bc146ef", "symbol_count": 10, "symbols": [{"kind": "function", "line": 77, "name": "I_ShutdownJoystick", "signature": "void I_ShutdownJoystick(void)"}, {"doc": "ifdef ORIGCODE", "kind": "function", "line": 90, "name": "IsValidAxis", "signature": "static boolean IsValidAxis(int axis)"}, {"kind": "function", "line": 115, "name": "I_InitJoystick", "signature": "void I_InitJoystick(void)"}, {"doc": "ifdef ORIGCODE", "kind": "function", "line": 171, "name": "IsAxisButton", "signature": "static boolean IsAxisButton(int physbutton)"}, {"kind": "function", "line": 203, "name": "ReadButtonState", "signature": "static int ReadButtonState(int vbutton)"}, {"kind": "function", "line": 228, "name": "GetButtonsState", "signature": "static int GetButtonsState(void)"}, {"kind": "function", "line": 248, "name": "GetAxisState", "signature": "static int GetAxisState(int axis, int invert)"}, {"doc": "endif", "kind": "function", "line": 321, "name": "I_UpdateJoystick", "signature": "void I_UpdateJoystick(void)"}, {"kind": "function", "line": 339, "name": "I_BindJoystickVariables", "signature": "void I_BindJoystickVariables(void)"}, {"kind": "macro", "line": 38, "name": "DEAD_ZONE", "signature": "#define DEAD_ZONE"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System-specific joystick interface.     Number of \"virtual\" joystick buttons defined in configuration files. This needs to be at least as large as the number of different key bindings supported by the higher-level game code (joyb* variables).  If this bit is set in a configuration file axis value, the axis is not actually a joystick axis, but instead is a \"button axis\". This means that instead of reading an SDL joystick axis, we read the state of two buttons to get the axis value. This is needed for eg.", "id": "progs/doomgeneric/i_joystick.h", "kind": "module", "label": "i_joystick.h", "language": "h", "sha256": "fd2d0f867599c41a", "symbol_count": 18, "symbols": [{"kind": "function", "line": 63, "name": "I_InitJoystick", "signature": "void I_InitJoystick(void);"}, {"kind": "function", "line": 64, "name": "I_ShutdownJoystick", "signature": "void I_ShutdownJoystick(void);"}, {"kind": "function", "line": 65, "name": "I_UpdateJoystick", "signature": "void I_UpdateJoystick(void);"}, {"kind": "function", "line": 67, "name": "I_BindJoystickVariables", "signature": "void I_BindJoystickVariables(void);"}, {"kind": "macro", "line": 20, "name": "__I_JOYSTICK__", "signature": "#define __I_JOYSTICK__"}, {"kind": "macro", "line": 25, "name": "NUM_VIRTUAL_BUTTONS", "signature": "#define NUM_VIRTUAL_BUTTONS"}, {"kind": "macro", "line": 33, "name": "BUTTON_AXIS", "signature": "#define BUTTON_AXIS"}, {"kind": "macro", "line": 36, "name": "IS_BUTTON_AXIS", "signature": "#define IS_BUTTON_AXIS(axis)"}, {"kind": "macro", "line": 39, "name": "BUTTON_AXIS_NEG", "signature": "#define BUTTON_AXIS_NEG(axis)"}, {"kind": "macro", "line": 40, "name": "BUTTON_AXIS_POS", "signature": "#define BUTTON_AXIS_POS(axis)"}, {"kind": "macro", "line": 43, "name": "CREATE_BUTTON_AXIS", "signature": "#define CREATE_BUTTON_AXIS(neg, pos)"}, {"kind": "macro", "line": 48, "name": "HAT_AXIS", "signature": "#define HAT_AXIS"}, {"kind": "macro", "line": 50, "name": "IS_HAT_AXIS", "signature": "#define IS_HAT_AXIS(axis)"}, {"kind": "macro", "line": 53, "name": "HAT_AXIS_HAT", "signature": "#define HAT_AXIS_HAT(axis)"}, {"kind": "macro", "line": 55, "name": "HAT_AXIS_DIRECTION", "signature": "#define HAT_AXIS_DIRECTION(axis)"}, {"kind": "macro", "line": 57, "name": "CREATE_HAT_AXIS", "signature": "#define CREATE_HAT_AXIS(hat, direction)"}, {"kind": "macro", "line": 60, "name": "HAT_AXIS_HORIZONTAL", "signature": "#define HAT_AXIS_HORIZONTAL"}, {"kind": "macro", "line": 61, "name": "HAT_AXIS_VERTICAL", "signature": "#define HAT_AXIS_VERTICAL"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main program, simply calls D_DoomMain high level loop.   #include \"config.h\"   #include \"doomtype.h\" #include \"i_system.h\"   D_DoomMain() Not a globally visible function, just included for source reference, calls all startup code, parses command line options.", "id": "progs/doomgeneric/i_main.c", "kind": "module", "label": "i_main.c", "language": "c", "sha256": "25ce2b763f83017e", "symbol_count": 4, "symbols": [{"kind": "function", "line": 40, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 33, "name": "D_DoomMain", "signature": "void D_DoomMain (void);"}, {"kind": "function", "line": 35, "name": "M_FindResponseFile", "signature": "void M_FindResponseFile(void);"}, {"kind": "function", "line": 37, "name": "dg_Create", "signature": "void dg_Create();"}]}, {"id": "progs/doomgeneric/i_minios_sound.c", "kind": "module", "label": "i_minios_sound.c", "language": "c", "sha256": "bbdf027d593bdcbc", "symbol_count": 54, "symbols": [{"kind": "struct", "line": 17, "name": "pcspk_channel_t"}, {"kind": "struct", "line": 146, "name": "mus_player_t"}, {"kind": "function", "line": 32, "name": "sys_tone_hw", "signature": "static long sys_tone_hw(unsigned f)"}, {"kind": "function", "line": 35, "name": "sys_time", "signature": "static long sys_time(void)"}, {"kind": "function", "line": 38, "name": "sys_pcm2_open", "signature": "static long sys_pcm2_open(long flags)"}, {"kind": "function", "line": 41, "name": "sys_pcm2_write", "signature": "static long sys_pcm2_write(const void *buf, long len)"}, {"kind": "function", "line": 44, "name": "sys_pcm2_close", "signature": "static void sys_pcm2_close(void)"}, {"kind": "function", "line": 68, "name": "audio_ensure", "signature": "static void audio_ensure(void)"}, {"doc": "SFX are muted on pcm2 (music only): effect tones ruined the melody, so audio_pump below only advances the shared clock and mus_render_pcm mixes * music plus drums. The legacy speaker path still programs real tones.", "kind": "function", "line": 77, "name": "audio_pump", "signature": "static void audio_pump(void)"}, {"kind": "function", "line": 85, "name": "audio_tone", "signature": "static void audio_tone(unsigned freq)"}, {"kind": "function", "line": 92, "name": "audio_close", "signature": "static void audio_close(void)"}, {"kind": "function", "line": 169, "name": "mus_read_varlen", "signature": "static int mus_read_varlen(mus_player_t *m, unsigned long *out)"}, {"doc": "Process one full block of events at the current tick and advance pos past * its delta.  Returns the delta in *out.  Returns 0 at end of score.", "kind": "function", "line": 183, "name": "mus_next_block", "signature": "static int mus_next_block(mus_player_t *m, unsigned long *out)"}, {"kind": "function", "line": 228, "name": "mus_note_cmp", "signature": "static int mus_note_cmp(const void *a, const void *b)"}, {"doc": "Split the sounding notes into a bass pedal (the lowest note below the bass line) and the melody arpeggio (the highest MUS_ARP_MAX melody * notes).  Percussion never enters active[], so it is skipped here too.", "kind": "function", "line": 236, "name": "mus_build_chord", "signature": "static void mus_build_chord(mus_player_t *m)"}, {"doc": "Hold a tone for the given number of milliseconds. On pcm2 the hold's audio is queued up front (NONBLOCK) and the busy-wait preserves timing * while it plays; on the legacy speaker the tone is programmed and held.", "kind": "function", "line": 261, "name": "mus_hold_tone", "signature": "static void mus_hold_tone(unsigned freq, unsigned long ms)"}, {"doc": "Play one full cycle of the pseudo-polyphony: the bass pedal first, held long like the NES triangle voice, then the melody notes arpeggiated rapidly.  The repeated cycle at this cadence is what the ear integrates * into a chord instead of one voice.", "kind": "function", "line": 274, "name": "mus_play_chord", "signature": "static void mus_play_chord(mus_player_t *m)"}, {"kind": "function", "line": 288, "name": "mus_advance", "signature": "static void mus_advance(mus_player_t *m, unsigned long ms)"}, {"doc": "Polyphonic pcm2 music: every sounding voice at once, as the score has it. The legacy path above time-slices one square wave because the PC speaker is a single channel; pcm2 takes mixed PCM, so there is no reason to arpeggiate. Each MUS tick renders its active set (all melody voices plus the bass, each with a persistent phase for click-free sustains) normalized to a constant level, plus a short noise burst for percussion hits captured in mus_next_block. Timing is tick-exact: ticks convert to samples with an absolute counter, so the rate never drifts. Runs under the shared audio_last_ms clock, so sfx and music never double-render an interval; the current sfx tone mixes in as one more * voice, giving true sfx+music polyphony.", "kind": "function", "line": 320, "name": "mus_render_pcm", "signature": "static void mus_render_pcm(mus_player_t *m, unsigned char *out, unsigned n)"}, {"kind": "function", "line": 359, "name": "mus_render_push", "signature": "static void mus_render_push(mus_player_t *m, unsigned n)"}, {"kind": "function", "line": 369, "name": "mus_advance_pcm", "signature": "static void mus_advance_pcm(mus_player_t *m)"}, {"kind": "function", "line": 410, "name": "MUS_Init", "signature": "static boolean MUS_Init(void)"}, {"kind": "function", "line": 415, "name": "MUS_Shutdown", "signature": "static void MUS_Shutdown(void)"}, {"kind": "function", "line": 422, "name": "MUS_SetMusicVolume", "signature": "static void MUS_SetMusicVolume(int volume)"}, {"kind": "function", "line": 424, "name": "MUS_Pause", "signature": "static void MUS_Pause(void)"}, {"kind": "function", "line": 425, "name": "MUS_Resume", "signature": "static void MUS_Resume(void)"}, {"kind": "function", "line": 427, "name": "MUS_RegisterSong", "signature": "static void *MUS_RegisterSong(void *data, int len)"}, {"kind": "function", "line": 442, "name": "MUS_UnRegisterSong", "signature": "static void MUS_UnRegisterSong(void *handle)"}, {"kind": "function", "line": 448, "name": "MUS_PlaySong", "signature": "static void MUS_PlaySong(void *handle, boolean looping)"}, {"kind": "function", "line": 469, "name": "MUS_StopSong", "signature": "static void MUS_StopSong(void)"}, {"kind": "function", "line": 474, "name": "MUS_MusicIsPlaying", "signature": "static boolean MUS_MusicIsPlaying(void)"}, {"kind": "function", "line": 478, "name": "MUS_Poll", "signature": "static void MUS_Poll(void)"}, {"kind": "function", "line": 512, "name": "PCSPK_Init", "signature": "static boolean PCSPK_Init(boolean use_sfx_prefix)"}, {"kind": "function", "line": 519, "name": "PCSPK_Shutdown", "signature": "static void PCSPK_Shutdown(void)"}, {"kind": "function", "line": 529, "name": "PCSPK_GetSfxLumpNum", "signature": "static int PCSPK_GetSfxLumpNum(sfxinfo_t *sfx)"}, {"kind": "function", "line": 540, "name": "free_channel", "signature": "static void free_channel(int i)"}, {"kind": "function", "line": 549, "name": "PCSPK_Update", "signature": "static void PCSPK_Update(void)"}, {"kind": "function", "line": 587, "name": "PCSPK_UpdateSoundParams", "signature": "static void PCSPK_UpdateSoundParams(int ch, int v, int s)"}, {"kind": "function", "line": 591, "name": "PCSPK_StartSound", "signature": "static int PCSPK_StartSound(sfxinfo_t *sfx, int channel, int vol, int sep)"}, {"kind": "function", "line": 641, "name": "PCSPK_StopSound", "signature": "static void PCSPK_StopSound(int channel)"}, {"kind": "function", "line": 647, "name": "PCSPK_SoundIsPlaying", "signature": "static boolean PCSPK_SoundIsPlaying(int channel)"}, {"kind": "function", "line": 653, "name": "PCSPK_CacheSounds", "signature": "static void PCSPK_CacheSounds(sfxinfo_t *s, int n)"}, {"kind": "function", "line": 51, "name": "muted", "signature": "* pcm2 while sfx stay muted (effect tones ruined the melody);"}, {"kind": "macro", "line": 12, "name": "PCSPK_CHANNELS", "signature": "#define PCSPK_CHANNELS"}, {"kind": "macro", "line": 13, "name": "PCSPK_TICK_MS", "signature": "#define PCSPK_TICK_MS"}, {"kind": "macro", "line": 55, "name": "DOOM_PCM_RATE", "signature": "#define DOOM_PCM_RATE"}, {"kind": "macro", "line": 56, "name": "DOOM_PCM_VOL", "signature": "#define DOOM_PCM_VOL"}, {"kind": "macro", "line": 118, "name": "MUS_TICKS_PER_SEC", "signature": "#define MUS_TICKS_PER_SEC"}, {"kind": "macro", "line": 119, "name": "MUS_PERCUSSION_CHAN", "signature": "#define MUS_PERCUSSION_CHAN"}, {"kind": "macro", "line": 120, "name": "MUS_ARP_SLOT_MS", "signature": "#define MUS_ARP_SLOT_MS"}, {"kind": "macro", "line": 121, "name": "MUS_BASS_HOLD_MS", "signature": "#define MUS_BASS_HOLD_MS"}, {"kind": "macro", "line": 122, "name": "MUS_BASS_LINE_MIDI", "signature": "#define MUS_BASS_LINE_MIDI"}, {"kind": "macro", "line": 123, "name": "MUS_ARP_MAX", "signature": "#define MUS_ARP_MAX"}, {"kind": "macro", "line": 125, "name": "DOOM_PCM_DRUM_SMP", "signature": "#define DOOM_PCM_DRUM_SMP"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Screen scale-up code: 1x,2x,3x,4x pixel doubling Aspect ratio-correcting stretch functions", "id": "progs/doomgeneric/i_scale.c", "kind": "module", "label": "i_scale.c", "language": "c", "sha256": "1ab70df7b89e6f39", "symbol_count": 39, "symbols": [{"kind": "function", "line": 61, "name": "I_InitScale", "signature": "void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch)"}, {"kind": "function", "line": 75, "name": "I_Scale1x", "signature": "static boolean I_Scale1x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 105, "name": "I_Scale2x", "signature": "static boolean I_Scale2x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 146, "name": "I_Scale3x", "signature": "static boolean I_Scale3x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 191, "name": "I_Scale4x", "signature": "static boolean I_Scale4x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 240, "name": "I_Scale5x", "signature": "static boolean I_Scale5x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 295, "name": "FindNearestColor", "signature": "static int FindNearestColor(byte *palette, int r, int g, int b)"}, {"kind": "function", "line": 332, "name": "GenerateStretchTable", "signature": "static byte *GenerateStretchTable(byte *palette, int pct)"}, {"kind": "function", "line": 361, "name": "I_InitStretchTables", "signature": "static void I_InitStretchTables(byte *palette)"}, {"kind": "function", "line": 387, "name": "I_InitSquashTable", "signature": "static void I_InitSquashTable(byte *palette)"}, {"kind": "function", "line": 404, "name": "I_ResetScaleTables", "signature": "void I_ResetScaleTables(byte *palette)"}, {"kind": "function", "line": 434, "name": "WriteBlendedLine1x", "signature": "static inline void WriteBlendedLine1x(byte *dest, byte *src1, byte *src2, \n                      ..."}, {"kind": "function", "line": 450, "name": "I_Stretch1x", "signature": "static boolean I_Stretch1x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 507, "name": "WriteLine2x", "signature": "static inline void WriteLine2x(byte *dest, byte *src)"}, {"kind": "function", "line": 520, "name": "WriteBlendedLine2x", "signature": "static inline void WriteBlendedLine2x(byte *dest, byte *src1, byte *src2, \n                      ..."}, {"kind": "function", "line": 539, "name": "I_Stretch2x", "signature": "static boolean I_Stretch2x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 620, "name": "WriteLine3x", "signature": "static inline void WriteLine3x(byte *dest, byte *src)"}, {"kind": "function", "line": 634, "name": "WriteBlendedLine3x", "signature": "static inline void WriteBlendedLine3x(byte *dest, byte *src1, byte *src2, \n                      ..."}, {"kind": "function", "line": 654, "name": "I_Stretch3x", "signature": "static boolean I_Stretch3x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 759, "name": "WriteLine4x", "signature": "static inline void WriteLine4x(byte *dest, byte *src)"}, {"kind": "function", "line": 774, "name": "WriteBlendedLine4x", "signature": "static inline void WriteBlendedLine4x(byte *dest, byte *src1, byte *src2, \n                      ..."}, {"kind": "function", "line": 795, "name": "I_Stretch4x", "signature": "static boolean I_Stretch4x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 924, "name": "WriteLine5x", "signature": "static inline void WriteLine5x(byte *dest, byte *src)"}, {"kind": "function", "line": 942, "name": "I_Stretch5x", "signature": "static boolean I_Stretch5x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 1030, "name": "WriteSquashedLine1x", "signature": "static inline void WriteSquashedLine1x(byte *dest, byte *src)"}, {"kind": "function", "line": 1061, "name": "I_Squash1x", "signature": "static boolean I_Squash1x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 1102, "name": "WriteSquashedLine2x", "signature": "static inline void WriteSquashedLine2x(byte *dest, byte *src)"}, {"kind": "function", "line": 1160, "name": "I_Squash2x", "signature": "static boolean I_Squash2x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 1197, "name": "WriteSquashedLine3x", "signature": "static inline void WriteSquashedLine3x(byte *dest, byte *src)"}, {"kind": "function", "line": 1243, "name": "I_Squash3x", "signature": "static boolean I_Squash3x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 1279, "name": "WriteSquashedLine4x", "signature": "static inline void WriteSquashedLine4x(byte *dest, byte *src)"}, {"kind": "function", "line": 1354, "name": "I_Squash4x", "signature": "static boolean I_Squash4x(int x1, int y1, int x2, int y2)"}, {"kind": "function", "line": 1390, "name": "WriteSquashedLine5x", "signature": "static inline void WriteSquashedLine5x(byte *dest, byte *src)"}, {"kind": "function", "line": 1419, "name": "I_Squash5x", "signature": "static boolean I_Squash5x(int x1, int y1, int x2, int y2)"}, {"kind": "macro", "line": 32, "name": "inline", "signature": "#define inline"}, {"kind": "macro", "line": 1099, "name": "DRAW_PIXEL2", "signature": "#define DRAW_PIXEL2"}, {"kind": "macro", "line": 1194, "name": "DRAW_PIXEL3", "signature": "#define DRAW_PIXEL3"}, {"kind": "macro", "line": 1276, "name": "DRAW_PIXEL4", "signature": "#define DRAW_PIXEL4"}, {"kind": "macro", "line": 1387, "name": "DRAW_PIXEL5", "signature": "#define DRAW_PIXEL5"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Pixel-doubling scale up functions.", "id": "progs/doomgeneric/i_scale.h", "kind": "module", "label": "i_scale.h", "language": "h", "sha256": "b1673d13fb6e007e", "symbol_count": 18, "symbols": [{"kind": "function", "line": 25, "name": "I_InitScale", "signature": "void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch);"}, {"kind": "function", "line": 26, "name": "I_ResetScaleTables", "signature": "void I_ResetScaleTables(byte *palette);"}, {"kind": "variable", "line": 30, "name": "mode_scale_1x", "signature": "extern screen_mode_t mode_scale_1x;"}, {"kind": "variable", "line": 31, "name": "mode_scale_2x", "signature": "extern screen_mode_t mode_scale_2x;"}, {"kind": "variable", "line": 32, "name": "mode_scale_3x", "signature": "extern screen_mode_t mode_scale_3x;"}, {"kind": "variable", "line": 33, "name": "mode_scale_4x", "signature": "extern screen_mode_t mode_scale_4x;"}, {"kind": "variable", "line": 34, "name": "mode_scale_5x", "signature": "extern screen_mode_t mode_scale_5x;"}, {"kind": "variable", "line": 38, "name": "mode_stretch_1x", "signature": "extern screen_mode_t mode_stretch_1x;"}, {"kind": "variable", "line": 39, "name": "mode_stretch_2x", "signature": "extern screen_mode_t mode_stretch_2x;"}, {"kind": "variable", "line": 40, "name": "mode_stretch_3x", "signature": "extern screen_mode_t mode_stretch_3x;"}, {"kind": "variable", "line": 41, "name": "mode_stretch_4x", "signature": "extern screen_mode_t mode_stretch_4x;"}, {"kind": "variable", "line": 42, "name": "mode_stretch_5x", "signature": "extern screen_mode_t mode_stretch_5x;"}, {"kind": "variable", "line": 46, "name": "mode_squash_1x", "signature": "extern screen_mode_t mode_squash_1x;"}, {"kind": "variable", "line": 47, "name": "mode_squash_2x", "signature": "extern screen_mode_t mode_squash_2x;"}, {"kind": "variable", "line": 48, "name": "mode_squash_3x", "signature": "extern screen_mode_t mode_squash_3x;"}, {"kind": "variable", "line": 49, "name": "mode_squash_4x", "signature": "extern screen_mode_t mode_squash_4x;"}, {"kind": "variable", "line": 50, "name": "mode_squash_5x", "signature": "extern screen_mode_t mode_squash_5x;"}, {"kind": "macro", "line": 21, "name": "__I_SCALE__", "signature": "#define __I_SCALE__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none", "id": "progs/doomgeneric/i_sound.c", "kind": "module", "label": "i_sound.c", "language": "c", "sha256": "c37a497637fc32a9", "symbol_count": 34, "symbols": [{"kind": "function", "line": 116, "name": "SndDeviceInList", "signature": "static boolean SndDeviceInList(snddevice_t device, snddevice_t *list,\n                           ..."}, {"kind": "function", "line": 135, "name": "InitSfxModule", "signature": "static void InitSfxModule(boolean use_sfx_prefix)"}, {"kind": "function", "line": 163, "name": "InitMusicModule", "signature": "static void InitMusicModule(void)"}, {"kind": "function", "line": 195, "name": "I_InitSound", "signature": "void I_InitSound(boolean use_sfx_prefix)"}, {"kind": "function", "line": 250, "name": "I_ShutdownSound", "signature": "void I_ShutdownSound(void)"}, {"kind": "function", "line": 263, "name": "I_GetSfxLumpNum", "signature": "int I_GetSfxLumpNum(sfxinfo_t *sfxinfo)"}, {"kind": "function", "line": 275, "name": "I_UpdateSound", "signature": "void I_UpdateSound(void)"}, {"kind": "function", "line": 288, "name": "CheckVolumeSeparation", "signature": "static void CheckVolumeSeparation(int *vol, int *sep)"}, {"kind": "function", "line": 309, "name": "I_UpdateSoundParams", "signature": "void I_UpdateSoundParams(int channel, int vol, int sep)"}, {"kind": "function", "line": 318, "name": "I_StartSound", "signature": "int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep)"}, {"kind": "function", "line": 331, "name": "I_StopSound", "signature": "void I_StopSound(int channel)"}, {"kind": "function", "line": 339, "name": "I_SoundIsPlaying", "signature": "boolean I_SoundIsPlaying(int channel)"}, {"kind": "function", "line": 351, "name": "I_PrecacheSounds", "signature": "void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds)"}, {"kind": "function", "line": 359, "name": "I_InitMusic", "signature": "void I_InitMusic(void)"}, {"kind": "function", "line": 363, "name": "I_ShutdownMusic", "signature": "void I_ShutdownMusic(void)"}, {"kind": "function", "line": 368, "name": "I_SetMusicVolume", "signature": "void I_SetMusicVolume(int volume)"}, {"kind": "function", "line": 376, "name": "I_PauseSong", "signature": "void I_PauseSong(void)"}, {"kind": "function", "line": 384, "name": "I_ResumeSong", "signature": "void I_ResumeSong(void)"}, {"kind": "function", "line": 392, "name": "I_RegisterSong", "signature": "void *I_RegisterSong(void *data, int len)"}, {"kind": "function", "line": 404, "name": "I_UnRegisterSong", "signature": "void I_UnRegisterSong(void *handle)"}, {"kind": "function", "line": 412, "name": "I_PlaySong", "signature": "void I_PlaySong(void *handle, boolean looping)"}, {"kind": "function", "line": 420, "name": "I_StopSong", "signature": "void I_StopSong(void)"}, {"kind": "function", "line": 428, "name": "I_MusicIsPlaying", "signature": "boolean I_MusicIsPlaying(void)"}, {"kind": "function", "line": 440, "name": "I_BindSoundVariables", "signature": "void I_BindSoundVariables(void)"}, {"kind": "function", "line": 65, "name": "I_InitTimidityConfig", "signature": "extern void I_InitTimidityConfig(void);"}, {"kind": "variable", "line": 66, "name": "sound_sdl_module", "signature": "extern sound_module_t sound_sdl_module;"}, {"kind": "variable", "line": 67, "name": "sound_pcsound_module", "signature": "extern sound_module_t sound_pcsound_module;"}, {"kind": "variable", "line": 68, "name": "music_sdl_module", "signature": "extern music_module_t music_sdl_module;"}, {"kind": "variable", "line": 69, "name": "music_opl_module", "signature": "extern music_module_t music_opl_module;"}, {"kind": "variable", "line": 70, "name": "music_pcspeaker_module", "signature": "extern music_module_t music_pcspeaker_module;"}, {"kind": "variable", "line": 74, "name": "opl_io_port", "signature": "extern int opl_io_port;"}, {"kind": "variable", "line": 78, "name": "timidity_cfg_path", "signature": "extern char *timidity_cfg_path;"}, {"doc": "ifdef ORIGCODE", "kind": "variable", "line": 443, "name": "use_libsamplerate", "signature": "extern int use_libsamplerate;"}, {"kind": "variable", "line": 444, "name": "libsamplerate_scale", "signature": "extern float libsamplerate_scale;"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The not so system specific sound interface.        SoundFX struct.", "id": "progs/doomgeneric/i_sound.h", "kind": "module", "label": "i_sound.h", "language": "h", "sha256": "a56ad3b85d82a20e", "symbol_count": 30, "symbols": [{"kind": "struct", "line": 31, "name": "sfxinfo_struct"}, {"doc": "MusicInfo struct.", "kind": "struct", "line": 72, "name": "musicinfo_t"}, {"kind": "struct", "line": 105, "name": "sound_module_t"}, {"kind": "struct", "line": 164, "name": "music_module_t"}, {"doc": "SoundFX struct.", "kind": "type_alias", "line": 29, "name": "sfxinfo_t", "signature": "typedef struct sfxinfo_struct sfxinfo_t;"}, {"kind": "function", "line": 152, "name": "I_InitSound", "signature": "void I_InitSound(boolean use_sfx_prefix);"}, {"kind": "function", "line": 153, "name": "I_ShutdownSound", "signature": "void I_ShutdownSound(void);"}, {"kind": "function", "line": 154, "name": "I_GetSfxLumpNum", "signature": "int I_GetSfxLumpNum(sfxinfo_t *sfxinfo);"}, {"kind": "function", "line": 155, "name": "I_UpdateSound", "signature": "void I_UpdateSound(void);"}, {"kind": "function", "line": 156, "name": "I_UpdateSoundParams", "signature": "void I_UpdateSoundParams(int channel, int vol, int sep);"}, {"kind": "function", "line": 157, "name": "I_StartSound", "signature": "int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep);"}, {"kind": "function", "line": 158, "name": "I_StopSound", "signature": "void I_StopSound(int channel);"}, {"kind": "function", "line": 160, "name": "I_PrecacheSounds", "signature": "void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds);"}, {"kind": "function", "line": 217, "name": "I_InitMusic", "signature": "void I_InitMusic(void);"}, {"kind": "function", "line": 218, "name": "I_ShutdownMusic", "signature": "void I_ShutdownMusic(void);"}, {"kind": "function", "line": 219, "name": "I_SetMusicVolume", "signature": "void I_SetMusicVolume(int volume);"}, {"kind": "function", "line": 220, "name": "I_PauseSong", "signature": "void I_PauseSong(void);"}, {"kind": "function", "line": 221, "name": "I_ResumeSong", "signature": "void I_ResumeSong(void);"}, {"kind": "function", "line": 222, "name": "I_RegisterSong", "signature": "void *I_RegisterSong(void *data, int len);"}, {"kind": "function", "line": 223, "name": "I_UnRegisterSong", "signature": "void I_UnRegisterSong(void *handle);"}, {"kind": "function", "line": 224, "name": "I_PlaySong", "signature": "void I_PlaySong(void *handle, boolean looping);"}, {"kind": "function", "line": 225, "name": "I_StopSong", "signature": "void I_StopSong(void);"}, {"kind": "function", "line": 235, "name": "I_BindSoundVariables", "signature": "void I_BindSoundVariables(void);"}, {"kind": "variable", "line": 228, "name": "snd_sfxdevice", "signature": "extern int snd_sfxdevice;"}, {"kind": "variable", "line": 229, "name": "snd_musicdevice", "signature": "extern int snd_musicdevice;"}, {"kind": "variable", "line": 230, "name": "snd_samplerate", "signature": "extern int snd_samplerate;"}, {"kind": "variable", "line": 231, "name": "snd_cachesize", "signature": "extern int snd_cachesize;"}, {"kind": "variable", "line": 232, "name": "snd_maxslicetime_ms", "signature": "extern int snd_maxslicetime_ms;"}, {"kind": "variable", "line": 233, "name": "snd_musiccmd", "signature": "extern char *snd_musiccmd;"}, {"kind": "macro", "line": 21, "name": "__I_SOUND__", "signature": "#define __I_SOUND__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Endianess handling, swapping 16bit and 32bit.      Endianess handling. WAD files are stored little endian.  Just use SDL's endianness swapping functions.", "id": "progs/doomgeneric/i_swap.h", "kind": "module", "label": "i_swap.h", "language": "h", "sha256": "90f7aa38f27883b7", "symbol_count": 8, "symbols": [{"kind": "macro", "line": 21, "name": "__I_SWAP__", "signature": "#define __I_SWAP__"}, {"kind": "macro", "line": 34, "name": "SHORT", "signature": "#define SHORT(x)"}, {"kind": "macro", "line": 35, "name": "LONG", "signature": "#define LONG(x)"}, {"kind": "macro", "line": 40, "name": "SYS_LITTLE_ENDIAN", "signature": "#define SYS_LITTLE_ENDIAN"}, {"kind": "macro", "line": 42, "name": "SYS_BIG_ENDIAN", "signature": "#define SYS_BIG_ENDIAN"}, {"kind": "macro", "line": 47, "name": "SHORT", "signature": "#define SHORT(x)"}, {"kind": "macro", "line": 48, "name": "LONG", "signature": "#define LONG(x)"}, {"kind": "macro", "line": 50, "name": "SYS_LITTLE_ENDIAN", "signature": "#define SYS_LITTLE_ENDIAN"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:", "id": "progs/doomgeneric/i_system.c", "kind": "module", "label": "i_system.c", "language": "c", "sha256": "603164de28852d40", "symbol_count": 21, "symbols": [{"kind": "struct", "line": 64, "name": "atexit_listentry_s"}, {"doc": "#include \"i_timer.h\" #include \"i_video.h\" #include \"i_system.h\" #include \"w_wad.h\" #include \"z_zone.h\" #ifdef __MACOSX__ #include <CoreFoundation/CFUserNotification.h> #endif #define DEFAULT_RAM 6 /* MiB #define MIN_RAM     6  /* MiB", "kind": "type_alias", "line": 60, "name": "atexit_listentry_t", "signature": "typedef struct atexit_listentry_s atexit_listentry_t;"}, {"kind": "function", "line": 73, "name": "I_AtExit", "signature": "void I_AtExit(atexit_func_t func, boolean run_on_error)"}, {"kind": "function", "line": 87, "name": "I_Tactile", "signature": "void I_Tactile(int on, int off, int total)"}, {"kind": "function", "line": 95, "name": "AutoAllocMemory", "signature": "static byte *AutoAllocMemory(int *size, int default_ram, int min_ram)"}, {"kind": "function", "line": 133, "name": "I_ZoneBase", "signature": "byte *I_ZoneBase (int *size)"}, {"kind": "function", "line": 166, "name": "I_PrintBanner", "signature": "void I_PrintBanner(char *msg)"}, {"kind": "function", "line": 177, "name": "I_PrintDivider", "signature": "void I_PrintDivider(void)"}, {"kind": "function", "line": 189, "name": "I_PrintStartupBanner", "signature": "void I_PrintStartupBanner(char *gamedescription)"}, {"kind": "function", "line": 210, "name": "I_ConsoleStdout", "signature": "boolean I_ConsoleStdout(void)"}, {"kind": "function", "line": 246, "name": "I_Quit", "signature": "void I_Quit (void)"}, {"kind": "function", "line": 272, "name": "ZenityAvailable", "signature": "static int ZenityAvailable(void)"}, {"kind": "function", "line": 280, "name": "EscapeShellString", "signature": "static char *EscapeShellString(char *string)"}, {"kind": "function", "line": 323, "name": "ZenityErrorBox", "signature": "static int ZenityErrorBox(char *message)"}, {"kind": "function", "line": 359, "name": "I_Error", "signature": "void I_Error (char *error, ...)"}, {"kind": "function", "line": 502, "name": "I_GetMemoryValue", "signature": "boolean I_GetMemoryValue(unsigned int offset, void *value, int size)"}, {"kind": "macro", "line": 27, "name": "WIN32_LEAN_AND_MEAN", "signature": "#define WIN32_LEAN_AND_MEAN"}, {"kind": "macro", "line": 58, "name": "DEFAULT_RAM", "signature": "#define DEFAULT_RAM"}, {"kind": "macro", "line": 59, "name": "MIN_RAM", "signature": "#define MIN_RAM"}, {"kind": "macro", "line": 268, "name": "ZENITY_BINARY", "signature": "#define ZENITY_BINARY"}, {"kind": "macro", "line": 490, "name": "DOS_MEM_DUMP_SIZE", "signature": "#define DOS_MEM_DUMP_SIZE"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.", "id": "progs/doomgeneric/i_system.h", "kind": "module", "label": "i_system.h", "language": "h", "sha256": "effdb086bbbc94c6", "symbol_count": 12, "symbols": [{"doc": "Called by DoomMain.", "kind": "function", "line": 30, "name": "I_Init", "signature": "void I_Init (void);"}, {"doc": "Called by startup code to get the ammount of memory to malloc for the zone management.", "kind": "function", "line": 35, "name": "I_ZoneBase", "signature": "byte* I_ZoneBase (int *size);"}, {"doc": "Either returns a null ticcmd, or calls a loadable driver to build it. This ticcmd will then be modified by the gameloop for normal input.", "kind": "function", "line": 48, "name": "I_BaseTiccmd", "signature": "ticcmd_t* I_BaseTiccmd (void);"}, {"doc": "Called by M_Responder when quit is selected. Clean exit, displays sell blurb.", "kind": "function", "line": 53, "name": "I_Quit", "signature": "void I_Quit (void);"}, {"kind": "function", "line": 55, "name": "I_Error", "signature": "void I_Error (char *error, ...);"}, {"kind": "function", "line": 57, "name": "I_Tactile", "signature": "void I_Tactile (int on, int off, int total);"}, {"kind": "function", "line": 65, "name": "I_AtExit", "signature": "void I_AtExit(atexit_func_t func, boolean run_if_error);"}, {"kind": "function", "line": 69, "name": "I_BindVariables", "signature": "void I_BindVariables(void);"}, {"kind": "function", "line": 73, "name": "I_PrintStartupBanner", "signature": "void I_PrintStartupBanner(char *gamedescription);"}, {"kind": "function", "line": 77, "name": "I_PrintBanner", "signature": "void I_PrintBanner(char *text);"}, {"kind": "function", "line": 81, "name": "I_PrintDivider", "signature": "void I_PrintDivider(void);"}, {"kind": "macro", "line": 21, "name": "__I_SYSTEM__", "signature": "#define __I_SYSTEM__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Timer functions.     #include <sys/time.h> #include <unistd.h>    I_GetTime", "id": "progs/doomgeneric/i_timer.c", "kind": "module", "label": "i_timer.c", "language": "c", "sha256": "286f4fa16c021b73", "symbol_count": 6, "symbols": [{"kind": "function", "line": 37, "name": "I_GetTicks", "signature": "int I_GetTicks(void)"}, {"kind": "function", "line": 42, "name": "I_GetTime", "signature": "int  I_GetTime (void)"}, {"kind": "function", "line": 61, "name": "I_GetTimeMS", "signature": "int I_GetTimeMS(void)"}, {"kind": "function", "line": 75, "name": "I_Sleep", "signature": "void I_Sleep(int ms)"}, {"kind": "function", "line": 83, "name": "I_WaitVBL", "signature": "void I_WaitVBL(int count)"}, {"kind": "function", "line": 89, "name": "I_InitTimer", "signature": "void I_InitTimer(void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System-specific timer interface      Called by D_DoomLoop, returns current time in tics.", "id": "progs/doomgeneric/i_timer.h", "kind": "module", "label": "i_timer.h", "language": "h", "sha256": "14fa89a9a6efb01d", "symbol_count": 7, "symbols": [{"doc": "Called by D_DoomLoop, returns current time in tics.", "kind": "function", "line": 27, "name": "I_GetTime", "signature": "int I_GetTime (void);"}, {"doc": "returns current time in ms", "kind": "function", "line": 30, "name": "I_GetTimeMS", "signature": "int I_GetTimeMS (void);"}, {"doc": "Pause for a specified number of ms", "kind": "function", "line": 33, "name": "I_Sleep", "signature": "void I_Sleep(int ms);"}, {"doc": "Initialize timer", "kind": "function", "line": 36, "name": "I_InitTimer", "signature": "void I_InitTimer(void);"}, {"doc": "Wait for vertical retrace or pause a bit.", "kind": "function", "line": 39, "name": "I_WaitVBL", "signature": "void I_WaitVBL(int count);"}, {"kind": "macro", "line": 21, "name": "__I_TIMER__", "signature": "#define __I_TIMER__"}, {"kind": "macro", "line": 23, "name": "TICRATE", "signature": "#define TICRATE"}]}, {"doc": "Emacs style mode select   -*- C++ -*- -----------------------------------------------------------------------------  $Id:$  Copyright (C) 1993-1996 by id Software, Inc.  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  $Log:$  DESCRIPTION: DOOM graphics stuff for X11, UNIX.  -----------------------------------------------------------------------------", "id": "progs/doomgeneric/i_video.c", "kind": "module", "label": "i_video.c", "language": "c", "sha256": "0c270a1047f10553", "symbol_count": 31, "symbols": [{"kind": "struct", "line": 54, "name": "FB_BitField"}, {"kind": "struct", "line": 60, "name": "FB_ScreenInfo"}, {"kind": "struct", "line": 80, "name": "color"}, {"kind": "struct", "line": 120, "name": "col_t"}, {"kind": "function", "line": 131, "name": "cmap_to_rgb565", "signature": "void cmap_to_rgb565(uint16_t * out, uint8_t * in, int in_pixels)"}, {"kind": "function", "line": 152, "name": "cmap_to_fb", "signature": "void cmap_to_fb(uint8_t * out, uint8_t * in, int in_pixels)"}, {"kind": "function", "line": 179, "name": "I_InitGraphics", "signature": "void I_InitGraphics (void)"}, {"kind": "function", "line": 232, "name": "I_ShutdownGraphics", "signature": "void I_ShutdownGraphics (void)"}, {"kind": "function", "line": 237, "name": "I_StartFrame", "signature": "void I_StartFrame (void)"}, {"kind": "function", "line": 242, "name": "I_StartTic", "signature": "void I_StartTic (void)"}, {"kind": "function", "line": 247, "name": "I_UpdateNoBlit", "signature": "void I_UpdateNoBlit (void)"}, {"kind": "function", "line": 255, "name": "I_FinishUpdate", "signature": "void I_FinishUpdate (void)"}, {"doc": "I_ReadScreen", "kind": "function", "line": 302, "name": "I_ReadScreen", "signature": "void I_ReadScreen (byte* scr)"}, {"kind": "function", "line": 315, "name": "I_SetPalette", "signature": "void I_SetPalette (byte* palette)"}, {"kind": "function", "line": 333, "name": "I_GetPaletteIndex", "signature": "int I_GetPaletteIndex (int r, int g, int b)"}, {"kind": "function", "line": 369, "name": "I_BeginRead", "signature": "void I_BeginRead (void)"}, {"kind": "function", "line": 373, "name": "I_EndRead", "signature": "void I_EndRead (void)"}, {"kind": "function", "line": 377, "name": "I_SetWindowTitle", "signature": "void I_SetWindowTitle (char *title)"}, {"kind": "function", "line": 382, "name": "I_GraphicsCheckCommandLine", "signature": "void I_GraphicsCheckCommandLine (void)"}, {"kind": "function", "line": 386, "name": "I_SetGrabMouseCallback", "signature": "void I_SetGrabMouseCallback (grabmouse_callback_t func)"}, {"kind": "function", "line": 390, "name": "I_EnableLoadingDisk", "signature": "void I_EnableLoadingDisk(void)"}, {"kind": "function", "line": 394, "name": "I_BindVideoVariables", "signature": "void I_BindVideoVariables (void)"}, {"kind": "function", "line": 398, "name": "I_DisplayFPSDots", "signature": "void I_DisplayFPSDots (boolean dots_on)"}, {"kind": "function", "line": 402, "name": "I_CheckIsScreensaver", "signature": "void I_CheckIsScreensaver (void)"}, {"kind": "function", "line": 89, "name": "I_GetEvent", "signature": "void I_GetEvent(void);"}, {"kind": "function", "line": 228, "name": "I_InitInput", "signature": "extern int I_InitInput(void);"}, {"kind": "variable", "line": 52, "name": "minios_palette_dirty", "signature": "extern volatile int minios_palette_dirty;"}, {"kind": "macro", "line": 310, "name": "GFX_RGB565", "signature": "#define GFX_RGB565(r, g, b)"}, {"kind": "macro", "line": 311, "name": "GFX_RGB565_R", "signature": "#define GFX_RGB565_R(color)"}, {"kind": "macro", "line": 312, "name": "GFX_RGB565_G", "signature": "#define GFX_RGB565_G(color)"}, {"kind": "macro", "line": 313, "name": "GFX_RGB565_B", "signature": "#define GFX_RGB565_B(color)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.      Screen width and height.   Screen width used for \"squash\" scale functions", "id": "progs/doomgeneric/i_video.h", "kind": "module", "label": "i_video.h", "language": "h", "sha256": "16a40a69912d36aa", "symbol_count": 41, "symbols": [{"kind": "struct", "line": 40, "name": "screen_mode_t"}, {"doc": "Called by D_DoomMain, determines the hardware configuration and sets up the video mode", "kind": "function", "line": 97, "name": "I_InitGraphics", "signature": "void I_InitGraphics (void);"}, {"kind": "function", "line": 99, "name": "I_GraphicsCheckCommandLine", "signature": "void I_GraphicsCheckCommandLine(void);"}, {"kind": "function", "line": 101, "name": "I_ShutdownGraphics", "signature": "void I_ShutdownGraphics(void);"}, {"doc": "Takes full 8 bit values.", "kind": "function", "line": 104, "name": "I_SetPalette", "signature": "void I_SetPalette (byte* palette);"}, {"kind": "function", "line": 105, "name": "I_GetPaletteIndex", "signature": "int I_GetPaletteIndex(int r, int g, int b);"}, {"kind": "function", "line": 107, "name": "I_UpdateNoBlit", "signature": "void I_UpdateNoBlit (void);"}, {"kind": "function", "line": 108, "name": "I_FinishUpdate", "signature": "void I_FinishUpdate (void);"}, {"kind": "function", "line": 110, "name": "I_ReadScreen", "signature": "void I_ReadScreen (byte* scr);"}, {"kind": "function", "line": 112, "name": "I_BeginRead", "signature": "void I_BeginRead (void);"}, {"kind": "function", "line": 114, "name": "I_SetWindowTitle", "signature": "void I_SetWindowTitle(char *title);"}, {"kind": "function", "line": 116, "name": "I_CheckIsScreensaver", "signature": "void I_CheckIsScreensaver(void);"}, {"kind": "function", "line": 117, "name": "I_SetGrabMouseCallback", "signature": "void I_SetGrabMouseCallback(grabmouse_callback_t func);"}, {"kind": "function", "line": 119, "name": "I_DisplayFPSDots", "signature": "void I_DisplayFPSDots(boolean dots_on);"}, {"kind": "function", "line": 120, "name": "I_BindVideoVariables", "signature": "void I_BindVideoVariables(void);"}, {"kind": "function", "line": 122, "name": "I_InitWindowTitle", "signature": "void I_InitWindowTitle(void);"}, {"kind": "function", "line": 123, "name": "I_InitWindowIcon", "signature": "void I_InitWindowIcon(void);"}, {"kind": "function", "line": 128, "name": "I_StartFrame", "signature": "void I_StartFrame (void);"}, {"kind": "function", "line": 133, "name": "I_StartTic", "signature": "void I_StartTic (void);"}, {"kind": "function", "line": 137, "name": "I_EnableLoadingDisk", "signature": "void I_EnableLoadingDisk(void);"}, {"kind": "variable", "line": 139, "name": "video_driver", "signature": "extern char *video_driver;"}, {"kind": "variable", "line": 140, "name": "screenvisible", "signature": "extern boolean screenvisible;"}, {"kind": "variable", "line": 142, "name": "mouse_acceleration", "signature": "extern float mouse_acceleration;"}, {"kind": "variable", "line": 143, "name": "mouse_threshold", "signature": "extern int mouse_threshold;"}, {"kind": "variable", "line": 144, "name": "vanilla_keyboard_mapping", "signature": "extern int vanilla_keyboard_mapping;"}, {"kind": "variable", "line": 145, "name": "screensaver_mode", "signature": "extern boolean screensaver_mode;"}, {"kind": "variable", "line": 146, "name": "usegamma", "signature": "extern int usegamma;"}, {"kind": "variable", "line": 147, "name": "I_VideoBuffer", "signature": "extern byte *I_VideoBuffer;"}, {"kind": "variable", "line": 149, "name": "screen_width", "signature": "extern int screen_width;"}, {"kind": "variable", "line": 150, "name": "screen_height", "signature": "extern int screen_height;"}, {"kind": "variable", "line": 151, "name": "screen_bpp", "signature": "extern int screen_bpp;"}, {"kind": "variable", "line": 152, "name": "fullscreen", "signature": "extern int fullscreen;"}, {"kind": "variable", "line": 153, "name": "aspect_ratio_correct", "signature": "extern int aspect_ratio_correct;"}, {"kind": "variable", "line": 155, "name": "show_diskicon", "signature": "extern int show_diskicon;"}, {"kind": "variable", "line": 156, "name": "diskicon_readbytes", "signature": "extern int diskicon_readbytes;"}, {"kind": "macro", "line": 21, "name": "__I_VIDEO__", "signature": "#define __I_VIDEO__"}, {"kind": "macro", "line": 27, "name": "SCREENWIDTH", "signature": "#define SCREENWIDTH"}, {"kind": "macro", "line": 28, "name": "SCREENHEIGHT", "signature": "#define SCREENHEIGHT"}, {"kind": "macro", "line": 32, "name": "SCREENWIDTH_4_3", "signature": "#define SCREENWIDTH_4_3"}, {"kind": "macro", "line": 36, "name": "SCREENHEIGHT_4_3", "signature": "#define SCREENHEIGHT_4_3"}, {"kind": "macro", "line": 38, "name": "MAX_MOUSE_BUTTONS", "signature": "#define MAX_MOUSE_BUTTONS"}]}, {"id": "progs/doomgeneric/icon.c", "kind": "module", "label": "icon.c", "language": "c", "sha256": "a2aacb813259f73d", "symbol_count": 0, "symbols": []}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Thing frame/state LUT, generated by multigen utilitiy. This one is the original DOOM version, preserved.    Data.", "id": "progs/doomgeneric/info.c", "kind": "module", "label": "info.c", "language": "c", "sha256": "7bbbbd9504cb1aeb", "symbol_count": 74, "symbols": [{"doc": "Doesn't work with g++, needs actionf_p1", "kind": "function", "line": 51, "name": "A_Light0", "signature": "void A_Light0();"}, {"kind": "function", "line": 52, "name": "A_WeaponReady", "signature": "void A_WeaponReady();"}, {"kind": "function", "line": 53, "name": "A_Lower", "signature": "void A_Lower();"}, {"kind": "function", "line": 54, "name": "A_Raise", "signature": "void A_Raise();"}, {"kind": "function", "line": 55, "name": "A_Punch", "signature": "void A_Punch();"}, {"kind": "function", "line": 56, "name": "A_ReFire", "signature": "void A_ReFire();"}, {"kind": "function", "line": 57, "name": "A_FirePistol", "signature": "void A_FirePistol();"}, {"kind": "function", "line": 58, "name": "A_Light1", "signature": "void A_Light1();"}, {"kind": "function", "line": 59, "name": "A_FireShotgun", "signature": "void A_FireShotgun();"}, {"kind": "function", "line": 60, "name": "A_Light2", "signature": "void A_Light2();"}, {"kind": "function", "line": 61, "name": "A_FireShotgun2", "signature": "void A_FireShotgun2();"}, {"kind": "function", "line": 62, "name": "A_CheckReload", "signature": "void A_CheckReload();"}, {"kind": "function", "line": 63, "name": "A_OpenShotgun2", "signature": "void A_OpenShotgun2();"}, {"kind": "function", "line": 64, "name": "A_LoadShotgun2", "signature": "void A_LoadShotgun2();"}, {"kind": "function", "line": 65, "name": "A_CloseShotgun2", "signature": "void A_CloseShotgun2();"}, {"kind": "function", "line": 66, "name": "A_FireCGun", "signature": "void A_FireCGun();"}, {"kind": "function", "line": 67, "name": "A_GunFlash", "signature": "void A_GunFlash();"}, {"kind": "function", "line": 68, "name": "A_FireMissile", "signature": "void A_FireMissile();"}, {"kind": "function", "line": 69, "name": "A_Saw", "signature": "void A_Saw();"}, {"kind": "function", "line": 70, "name": "A_FirePlasma", "signature": "void A_FirePlasma();"}, {"kind": "function", "line": 71, "name": "A_BFGsound", "signature": "void A_BFGsound();"}, {"kind": "function", "line": 72, "name": "A_FireBFG", "signature": "void A_FireBFG();"}, {"kind": "function", "line": 73, "name": "A_BFGSpray", "signature": "void A_BFGSpray();"}, {"kind": "function", "line": 74, "name": "A_Explode", "signature": "void A_Explode();"}, {"kind": "function", "line": 75, "name": "A_Pain", "signature": "void A_Pain();"}, {"kind": "function", "line": 76, "name": "A_PlayerScream", "signature": "void A_PlayerScream();"}, {"kind": "function", "line": 77, "name": "A_Fall", "signature": "void A_Fall();"}, {"kind": "function", "line": 78, "name": "A_XScream", "signature": "void A_XScream();"}, {"kind": "function", "line": 79, "name": "A_Look", "signature": "void A_Look();"}, {"kind": "function", "line": 80, "name": "A_Chase", "signature": "void A_Chase();"}, {"kind": "function", "line": 81, "name": "A_FaceTarget", "signature": "void A_FaceTarget();"}, {"kind": "function", "line": 82, "name": "A_PosAttack", "signature": "void A_PosAttack();"}, {"kind": "function", "line": 83, "name": "A_Scream", "signature": "void A_Scream();"}, {"kind": "function", "line": 84, "name": "A_SPosAttack", "signature": "void A_SPosAttack();"}, {"kind": "function", "line": 85, "name": "A_VileChase", "signature": "void A_VileChase();"}, {"kind": "function", "line": 86, "name": "A_VileStart", "signature": "void A_VileStart();"}, {"kind": "function", "line": 87, "name": "A_VileTarget", "signature": "void A_VileTarget();"}, {"kind": "function", "line": 88, "name": "A_VileAttack", "signature": "void A_VileAttack();"}, {"kind": "function", "line": 89, "name": "A_StartFire", "signature": "void A_StartFire();"}, {"kind": "function", "line": 90, "name": "A_Fire", "signature": "void A_Fire();"}, {"kind": "function", "line": 91, "name": "A_FireCrackle", "signature": "void A_FireCrackle();"}, {"kind": "function", "line": 92, "name": "A_Tracer", "signature": "void A_Tracer();"}, {"kind": "function", "line": 93, "name": "A_SkelWhoosh", "signature": "void A_SkelWhoosh();"}, {"kind": "function", "line": 94, "name": "A_SkelFist", "signature": "void A_SkelFist();"}, {"kind": "function", "line": 95, "name": "A_SkelMissile", "signature": "void A_SkelMissile();"}, {"kind": "function", "line": 96, "name": "A_FatRaise", "signature": "void A_FatRaise();"}, {"kind": "function", "line": 97, "name": "A_FatAttack1", "signature": "void A_FatAttack1();"}, {"kind": "function", "line": 98, "name": "A_FatAttack2", "signature": "void A_FatAttack2();"}, {"kind": "function", "line": 99, "name": "A_FatAttack3", "signature": "void A_FatAttack3();"}, {"kind": "function", "line": 100, "name": "A_BossDeath", "signature": "void A_BossDeath();"}, {"kind": "function", "line": 101, "name": "A_CPosAttack", "signature": "void A_CPosAttack();"}, {"kind": "function", "line": 102, "name": "A_CPosRefire", "signature": "void A_CPosRefire();"}, {"kind": "function", "line": 103, "name": "A_TroopAttack", "signature": "void A_TroopAttack();"}, {"kind": "function", "line": 104, "name": "A_SargAttack", "signature": "void A_SargAttack();"}, {"kind": "function", "line": 105, "name": "A_HeadAttack", "signature": "void A_HeadAttack();"}, {"kind": "function", "line": 106, "name": "A_BruisAttack", "signature": "void A_BruisAttack();"}, {"kind": "function", "line": 107, "name": "A_SkullAttack", "signature": "void A_SkullAttack();"}, {"kind": "function", "line": 108, "name": "A_Metal", "signature": "void A_Metal();"}, {"kind": "function", "line": 109, "name": "A_SpidRefire", "signature": "void A_SpidRefire();"}, {"kind": "function", "line": 110, "name": "A_BabyMetal", "signature": "void A_BabyMetal();"}, {"kind": "function", "line": 111, "name": "A_BspiAttack", "signature": "void A_BspiAttack();"}, {"kind": "function", "line": 112, "name": "A_Hoof", "signature": "void A_Hoof();"}, {"kind": "function", "line": 113, "name": "A_CyberAttack", "signature": "void A_CyberAttack();"}, {"kind": "function", "line": 114, "name": "A_PainAttack", "signature": "void A_PainAttack();"}, {"kind": "function", "line": 115, "name": "A_PainDie", "signature": "void A_PainDie();"}, {"kind": "function", "line": 116, "name": "A_KeenDie", "signature": "void A_KeenDie();"}, {"kind": "function", "line": 117, "name": "A_BrainPain", "signature": "void A_BrainPain();"}, {"kind": "function", "line": 118, "name": "A_BrainScream", "signature": "void A_BrainScream();"}, {"kind": "function", "line": 119, "name": "A_BrainDie", "signature": "void A_BrainDie();"}, {"kind": "function", "line": 120, "name": "A_BrainAwake", "signature": "void A_BrainAwake();"}, {"kind": "function", "line": 121, "name": "A_BrainSpit", "signature": "void A_BrainSpit();"}, {"kind": "function", "line": 122, "name": "A_SpawnSound", "signature": "void A_SpawnSound();"}, {"kind": "function", "line": 123, "name": "A_SpawnFly", "signature": "void A_SpawnFly();"}, {"kind": "function", "line": 124, "name": "A_BrainExplode", "signature": "void A_BrainExplode();"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Thing frame/state LUT, generated by multigen utilitiy. This one is the original DOOM version, preserved.    Needed for action function pointer handling.", "id": "progs/doomgeneric/info.h", "kind": "module", "label": "info.h", "language": "h", "sha256": "813d1593887fc211", "symbol_count": 6, "symbols": [{"kind": "struct", "line": 1144, "name": "state_t"}, {"kind": "struct", "line": 1301, "name": "mobjinfo_t"}, {"kind": "variable", "line": 1156, "name": "states", "signature": "extern state_t states[NUMSTATES];"}, {"kind": "variable", "line": 1157, "name": "sprnames", "signature": "extern char *sprnames[];"}, {"kind": "variable", "line": 1329, "name": "mobjinfo", "signature": "extern mobjinfo_t mobjinfo[NUMMOBJTYPES];"}, {"kind": "macro", "line": 22, "name": "__INFO__", "signature": "#define __INFO__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:", "id": "progs/doomgeneric/m_argv.c", "kind": "module", "label": "m_argv.c", "language": "c", "sha256": "2bf495aba6f0b30c", "symbol_count": 7, "symbols": [{"kind": "function", "line": 43, "name": "M_CheckParmWithArgs", "signature": "int M_CheckParmWithArgs(char *check, int num_args)"}, {"kind": "function", "line": 63, "name": "M_ParmExists", "signature": "boolean M_ParmExists(char *check)"}, {"kind": "function", "line": 68, "name": "M_CheckParm", "signature": "int M_CheckParm(char *check)"}, {"kind": "function", "line": 75, "name": "LoadResponseFile", "signature": "static void LoadResponseFile(int argv_index)"}, {"kind": "function", "line": 235, "name": "M_FindResponseFile", "signature": "void M_FindResponseFile(void)"}, {"kind": "function", "line": 250, "name": "M_GetExecutableName", "signature": "char *M_GetExecutableName(void)"}, {"kind": "macro", "line": 73, "name": "MAXARGVS", "signature": "#define MAXARGVS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Nil.       MISC", "id": "progs/doomgeneric/m_argv.h", "kind": "module", "label": "m_argv.h", "language": "h", "sha256": "12930c006a152746", "symbol_count": 7, "symbols": [{"doc": "Returns the position of the given parameter in the arg list (0 if not found).", "kind": "function", "line": 33, "name": "M_CheckParm", "signature": "int M_CheckParm (char* check);"}, {"doc": "Same as M_CheckParm, but checks that num_args arguments are available following the specified argument.", "kind": "function", "line": 37, "name": "M_CheckParmWithArgs", "signature": "int M_CheckParmWithArgs(char *check, int num_args);"}, {"kind": "function", "line": 39, "name": "M_FindResponseFile", "signature": "void M_FindResponseFile(void);"}, {"kind": "function", "line": 47, "name": "M_GetExecutableName", "signature": "char *M_GetExecutableName(void);"}, {"doc": "MISC", "kind": "variable", "line": 28, "name": "myargc", "signature": "extern int myargc;"}, {"kind": "variable", "line": 29, "name": "myargv", "signature": "extern char** myargv;"}, {"kind": "macro", "line": 21, "name": "__M_ARGV__", "signature": "#define __M_ARGV__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main loop menu stuff. Random number LUT. Default Config File. PCX Screenshots.", "id": "progs/doomgeneric/m_bbox.c", "kind": "module", "label": "m_bbox.c", "language": "c", "sha256": "cb84e03a87829b4a", "symbol_count": 2, "symbols": [{"kind": "function", "line": 29, "name": "M_ClearBox", "signature": "void M_ClearBox (fixed_t *box)"}, {"kind": "function", "line": 36, "name": "M_AddToBox", "signature": "void\nM_AddToBox\n( fixed_t*\tbox,\n  fixed_t\tx,\n  fixed_t\ty )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Nil.        Bounding box coordinate storage.", "id": "progs/doomgeneric/m_bbox.h", "kind": "module", "label": "m_bbox.h", "language": "h", "sha256": "97e1ac1b972706fc", "symbol_count": 3, "symbols": [{"doc": "Bounding box functions.", "kind": "function", "line": 38, "name": "M_ClearBox", "signature": "void M_ClearBox (fixed_t* box);"}, {"kind": "function", "line": 41, "name": "M_AddToBox", "signature": "void M_AddToBox ( fixed_t* box, fixed_t x, fixed_t y );"}, {"kind": "macro", "line": 21, "name": "__M_BBOX__", "signature": "#define __M_BBOX__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Cheat sequence checking.        CHEAT SEQUENCE PACKAGE", "id": "progs/doomgeneric/m_cheat.c", "kind": "module", "label": "m_cheat.c", "language": "c", "sha256": "5727f2818809fb24", "symbol_count": 2, "symbols": [{"kind": "function", "line": 35, "name": "cht_CheckCheat", "signature": "int\ncht_CheckCheat\n( cheatseq_t*\tcht,\n  char\t\tkey )"}, {"kind": "function", "line": 82, "name": "cht_GetParam", "signature": "void\ncht_GetParam\n( cheatseq_t*\tcht,\n  char*\t\tbuffer )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Cheat code checking.      CHEAT SEQUENCE PACKAGE   declaring a cheat", "id": "progs/doomgeneric/m_cheat.h", "kind": "module", "label": "m_cheat.h", "language": "h", "sha256": "58dc50fcb769fe12", "symbol_count": 7, "symbols": [{"kind": "struct", "line": 35, "name": "cheatseq_t"}, {"kind": "function", "line": 51, "name": "cht_CheckCheat", "signature": "int cht_CheckCheat ( cheatseq_t* cht, char key );"}, {"kind": "function", "line": 57, "name": "cht_GetParam", "signature": "void cht_GetParam ( cheatseq_t* cht, char* buffer );"}, {"kind": "macro", "line": 21, "name": "__M_CHEAT__", "signature": "#define __M_CHEAT__"}, {"kind": "macro", "line": 29, "name": "CHEAT", "signature": "#define CHEAT(value, parameters)"}, {"kind": "macro", "line": 32, "name": "MAX_CHEAT_LEN", "signature": "#define MAX_CHEAT_LEN"}, {"kind": "macro", "line": 33, "name": "MAX_CHEAT_PARAMS", "signature": "#define MAX_CHEAT_PARAMS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Configuration file interface.", "id": "progs/doomgeneric/m_config.c", "kind": "module", "label": "m_config.c", "language": "c", "sha256": "f4492f51cbef2071", "symbol_count": 26, "symbols": [{"kind": "struct", "line": 61, "name": "default_t"}, {"kind": "struct", "line": 88, "name": "default_collection_t"}, {"kind": "function", "line": 1563, "name": "SearchCollection", "signature": "static default_t *SearchCollection(default_collection_t *collection, char *name)"}, {"kind": "function", "line": 1609, "name": "SaveDefaultCollection", "signature": "static void SaveDefaultCollection(default_collection_t *collection)"}, {"kind": "function", "line": 1716, "name": "ParseIntParameter", "signature": "static int ParseIntParameter(char *strparm)"}, {"kind": "function", "line": 1728, "name": "SetVariable", "signature": "static void SetVariable(default_t *def, char *value)"}, {"kind": "function", "line": 1771, "name": "LoadDefaultCollection", "signature": "static void LoadDefaultCollection(default_collection_t *collection)"}, {"kind": "function", "line": 1836, "name": "M_SetConfigFilenames", "signature": "void M_SetConfigFilenames(char *main_config, char *extra_config)"}, {"kind": "function", "line": 1846, "name": "M_SaveDefaults", "signature": "void M_SaveDefaults (void)"}, {"kind": "function", "line": 1856, "name": "M_SaveDefaultsAlternate", "signature": "void M_SaveDefaultsAlternate(char *main, char *extra)"}, {"kind": "function", "line": 1881, "name": "M_LoadDefaults", "signature": "void M_LoadDefaults (void)"}, {"kind": "function", "line": 1937, "name": "GetDefaultForName", "signature": "static default_t *GetDefaultForName(char *name)"}, {"kind": "function", "line": 1964, "name": "M_BindVariable", "signature": "void M_BindVariable(char *name, void *location)"}, {"kind": "function", "line": 1977, "name": "M_SetVariable", "signature": "boolean M_SetVariable(char *name, char *value)"}, {"kind": "function", "line": 1995, "name": "M_GetIntVariable", "signature": "int M_GetIntVariable(char *name)"}, {"kind": "function", "line": 2010, "name": "M_GetStrVariable", "signature": "const char *M_GetStrVariable(char *name)"}, {"kind": "function", "line": 2025, "name": "M_GetFloatVariable", "signature": "float M_GetFloatVariable(char *name)"}, {"kind": "function", "line": 2043, "name": "GetDefaultConfigDir", "signature": "static char *GetDefaultConfigDir(void)"}, {"kind": "function", "line": 2059, "name": "M_SetConfigDir", "signature": "void M_SetConfigDir(char *dir)"}, {"kind": "function", "line": 2087, "name": "M_GetSaveGameDir", "signature": "char *M_GetSaveGameDir(char *iwadname)"}, {"kind": "macro", "line": 95, "name": "CONFIG_VARIABLE_GENERIC", "signature": "#define CONFIG_VARIABLE_GENERIC(name, type)"}, {"kind": "macro", "line": 98, "name": "CONFIG_VARIABLE_KEY", "signature": "#define CONFIG_VARIABLE_KEY(name)"}, {"kind": "macro", "line": 100, "name": "CONFIG_VARIABLE_INT", "signature": "#define CONFIG_VARIABLE_INT(name)"}, {"kind": "macro", "line": 102, "name": "CONFIG_VARIABLE_INT_HEX", "signature": "#define CONFIG_VARIABLE_INT_HEX(name)"}, {"kind": "macro", "line": 104, "name": "CONFIG_VARIABLE_FLOAT", "signature": "#define CONFIG_VARIABLE_FLOAT(name)"}, {"kind": "macro", "line": 106, "name": "CONFIG_VARIABLE_STRING", "signature": "#define CONFIG_VARIABLE_STRING(name)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Configuration file interface.", "id": "progs/doomgeneric/m_config.h", "kind": "module", "label": "m_config.h", "language": "h", "sha256": "0f1b3653e0a9f144", "symbol_count": 12, "symbols": [{"kind": "function", "line": 25, "name": "M_LoadDefaults", "signature": "void M_LoadDefaults(void);"}, {"kind": "function", "line": 26, "name": "M_SaveDefaults", "signature": "void M_SaveDefaults(void);"}, {"kind": "function", "line": 27, "name": "M_SaveDefaultsAlternate", "signature": "void M_SaveDefaultsAlternate(char *main, char *extra);"}, {"kind": "function", "line": 28, "name": "M_SetConfigDir", "signature": "void M_SetConfigDir(char *dir);"}, {"kind": "function", "line": 29, "name": "M_BindVariable", "signature": "void M_BindVariable(char *name, void *variable);"}, {"kind": "function", "line": 31, "name": "M_GetIntVariable", "signature": "int M_GetIntVariable(char *name);"}, {"kind": "function", "line": 32, "name": "M_GetStrVariable", "signature": "const char *M_GetStrVariable(char *name);"}, {"kind": "function", "line": 33, "name": "M_GetFloatVariable", "signature": "float M_GetFloatVariable(char *name);"}, {"kind": "function", "line": 34, "name": "M_SetConfigFilenames", "signature": "void M_SetConfigFilenames(char *main_config, char *extra_config);"}, {"kind": "function", "line": 35, "name": "M_GetSaveGameDir", "signature": "char *M_GetSaveGameDir(char *iwadname);"}, {"kind": "variable", "line": 37, "name": "configdir", "signature": "extern char *configdir;"}, {"kind": "macro", "line": 21, "name": "__M_CONFIG__", "signature": "#define __M_CONFIG__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.       Keyboard controls", "id": "progs/doomgeneric/m_controls.c", "kind": "module", "label": "m_controls.c", "language": "c", "sha256": "35c1a6272c80265f", "symbol_count": 9, "symbols": [{"kind": "function", "line": 204, "name": "M_BindBaseControls", "signature": "void M_BindBaseControls(void)"}, {"kind": "function", "line": 241, "name": "M_BindHereticControls", "signature": "void M_BindHereticControls(void)"}, {"kind": "function", "line": 256, "name": "M_BindHexenControls", "signature": "void M_BindHexenControls(void)"}, {"kind": "function", "line": 272, "name": "M_BindStrifeControls", "signature": "void M_BindStrifeControls(void)"}, {"kind": "function", "line": 307, "name": "M_BindWeaponControls", "signature": "void M_BindWeaponControls(void)"}, {"kind": "function", "line": 328, "name": "M_BindMapControls", "signature": "void M_BindMapControls(void)"}, {"kind": "function", "line": 344, "name": "M_BindMenuControls", "signature": "void M_BindMenuControls(void)"}, {"kind": "function", "line": 375, "name": "M_BindChatControls", "signature": "void M_BindChatControls(unsigned int num_players)"}, {"kind": "function", "line": 394, "name": "M_ApplyPlatformDefaults", "signature": "void M_ApplyPlatformDefaults(void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.", "id": "progs/doomgeneric/m_controls.h", "kind": "module", "label": "m_controls.h", "language": "h", "sha256": "87c02efaf02ffbc6", "symbol_count": 119, "symbols": [{"kind": "function", "line": 156, "name": "M_BindBaseControls", "signature": "void M_BindBaseControls(void);"}, {"kind": "function", "line": 157, "name": "M_BindHereticControls", "signature": "void M_BindHereticControls(void);"}, {"kind": "function", "line": 158, "name": "M_BindHexenControls", "signature": "void M_BindHexenControls(void);"}, {"kind": "function", "line": 159, "name": "M_BindStrifeControls", "signature": "void M_BindStrifeControls(void);"}, {"kind": "function", "line": 160, "name": "M_BindWeaponControls", "signature": "void M_BindWeaponControls(void);"}, {"kind": "function", "line": 161, "name": "M_BindMapControls", "signature": "void M_BindMapControls(void);"}, {"kind": "function", "line": 162, "name": "M_BindMenuControls", "signature": "void M_BindMenuControls(void);"}, {"kind": "function", "line": 163, "name": "M_BindChatControls", "signature": "void M_BindChatControls(unsigned int num_players);"}, {"kind": "function", "line": 165, "name": "M_ApplyPlatformDefaults", "signature": "void M_ApplyPlatformDefaults(void);"}, {"kind": "variable", "line": 20, "name": "key_right", "signature": "extern int key_right;"}, {"kind": "variable", "line": 21, "name": "key_left", "signature": "extern int key_left;"}, {"kind": "variable", "line": 23, "name": "key_up", "signature": "extern int key_up;"}, {"kind": "variable", "line": 24, "name": "key_down", "signature": "extern int key_down;"}, {"kind": "variable", "line": 25, "name": "key_strafeleft", "signature": "extern int key_strafeleft;"}, {"kind": "variable", "line": 26, "name": "key_straferight", "signature": "extern int key_straferight;"}, {"kind": "variable", "line": 27, "name": "key_fire", "signature": "extern int key_fire;"}, {"kind": "variable", "line": 28, "name": "key_use", "signature": "extern int key_use;"}, {"kind": "variable", "line": 29, "name": "key_strafe", "signature": "extern int key_strafe;"}, {"kind": "variable", "line": 30, "name": "key_speed", "signature": "extern int key_speed;"}, {"kind": "variable", "line": 32, "name": "key_jump", "signature": "extern int key_jump;"}, {"kind": "variable", "line": 34, "name": "key_flyup", "signature": "extern int key_flyup;"}, {"kind": "variable", "line": 35, "name": "key_flydown", "signature": "extern int key_flydown;"}, {"kind": "variable", "line": 36, "name": "key_flycenter", "signature": "extern int key_flycenter;"}, {"kind": "variable", "line": 37, "name": "key_lookup", "signature": "extern int key_lookup;"}, {"kind": "variable", "line": 38, "name": "key_lookdown", "signature": "extern int key_lookdown;"}, {"kind": "variable", "line": 39, "name": "key_lookcenter", "signature": "extern int key_lookcenter;"}, {"kind": "variable", "line": 40, "name": "key_invleft", "signature": "extern int key_invleft;"}, {"kind": "variable", "line": 41, "name": "key_invright", "signature": "extern int key_invright;"}, {"kind": "variable", "line": 42, "name": "key_useartifact", "signature": "extern int key_useartifact;"}, {"doc": "villsa [STRIFE] strife keys", "kind": "variable", "line": 45, "name": "key_usehealth", "signature": "extern int key_usehealth;"}, {"kind": "variable", "line": 46, "name": "key_invquery", "signature": "extern int key_invquery;"}, {"kind": "variable", "line": 47, "name": "key_mission", "signature": "extern int key_mission;"}, {"kind": "variable", "line": 48, "name": "key_invpop", "signature": "extern int key_invpop;"}, {"kind": "variable", "line": 49, "name": "key_invkey", "signature": "extern int key_invkey;"}, {"kind": "variable", "line": 50, "name": "key_invhome", "signature": "extern int key_invhome;"}, {"kind": "variable", "line": 51, "name": "key_invend", "signature": "extern int key_invend;"}, {"kind": "variable", "line": 52, "name": "key_invuse", "signature": "extern int key_invuse;"}, {"kind": "variable", "line": 53, "name": "key_invdrop", "signature": "extern int key_invdrop;"}, {"kind": "variable", "line": 55, "name": "key_message_refresh", "signature": "extern int key_message_refresh;"}, {"kind": "variable", "line": 56, "name": "key_pause", "signature": "extern int key_pause;"}, {"kind": "variable", "line": 58, "name": "key_multi_msg", "signature": "extern int key_multi_msg;"}, {"kind": "variable", "line": 59, "name": "key_multi_msgplayer", "signature": "extern int key_multi_msgplayer[8];"}, {"kind": "variable", "line": 61, "name": "key_weapon1", "signature": "extern int key_weapon1;"}, {"kind": "variable", "line": 62, "name": "key_weapon2", "signature": "extern int key_weapon2;"}, {"kind": "variable", "line": 63, "name": "key_weapon3", "signature": "extern int key_weapon3;"}, {"kind": "variable", "line": 64, "name": "key_weapon4", "signature": "extern int key_weapon4;"}, {"kind": "variable", "line": 65, "name": "key_weapon5", "signature": "extern int key_weapon5;"}, {"kind": "variable", "line": 66, "name": "key_weapon6", "signature": "extern int key_weapon6;"}, {"kind": "variable", "line": 67, "name": "key_weapon7", "signature": "extern int key_weapon7;"}, {"kind": "variable", "line": 68, "name": "key_weapon8", "signature": "extern int key_weapon8;"}, {"kind": "variable", "line": 70, "name": "key_arti_all", "signature": "extern int key_arti_all;"}, {"kind": "variable", "line": 71, "name": "key_arti_health", "signature": "extern int key_arti_health;"}, {"kind": "variable", "line": 72, "name": "key_arti_poisonbag", "signature": "extern int key_arti_poisonbag;"}, {"kind": "variable", "line": 73, "name": "key_arti_blastradius", "signature": "extern int key_arti_blastradius;"}, {"kind": "variable", "line": 74, "name": "key_arti_teleport", "signature": "extern int key_arti_teleport;"}, {"kind": "variable", "line": 75, "name": "key_arti_teleportother", "signature": "extern int key_arti_teleportother;"}, {"kind": "variable", "line": 76, "name": "key_arti_egg", "signature": "extern int key_arti_egg;"}, {"kind": "variable", "line": 77, "name": "key_arti_invulnerability", "signature": "extern int key_arti_invulnerability;"}, {"kind": "variable", "line": 79, "name": "key_demo_quit", "signature": "extern int key_demo_quit;"}, {"kind": "variable", "line": 80, "name": "key_spy", "signature": "extern int key_spy;"}, {"kind": "variable", "line": 81, "name": "key_prevweapon", "signature": "extern int key_prevweapon;"}, {"kind": "variable", "line": 82, "name": "key_nextweapon", "signature": "extern int key_nextweapon;"}, {"kind": "variable", "line": 84, "name": "key_map_north", "signature": "extern int key_map_north;"}, {"kind": "variable", "line": 85, "name": "key_map_south", "signature": "extern int key_map_south;"}, {"kind": "variable", "line": 86, "name": "key_map_east", "signature": "extern int key_map_east;"}, {"kind": "variable", "line": 87, "name": "key_map_west", "signature": "extern int key_map_west;"}, {"kind": "variable", "line": 88, "name": "key_map_zoomin", "signature": "extern int key_map_zoomin;"}, {"kind": "variable", "line": 89, "name": "key_map_zoomout", "signature": "extern int key_map_zoomout;"}, {"kind": "variable", "line": 90, "name": "key_map_toggle", "signature": "extern int key_map_toggle;"}, {"kind": "variable", "line": 91, "name": "key_map_maxzoom", "signature": "extern int key_map_maxzoom;"}, {"kind": "variable", "line": 92, "name": "key_map_follow", "signature": "extern int key_map_follow;"}, {"kind": "variable", "line": 93, "name": "key_map_grid", "signature": "extern int key_map_grid;"}, {"kind": "variable", "line": 94, "name": "key_map_mark", "signature": "extern int key_map_mark;"}, {"kind": "variable", "line": 95, "name": "key_map_clearmark", "signature": "extern int key_map_clearmark;"}, {"kind": "variable", "line": 99, "name": "key_menu_activate", "signature": "extern int key_menu_activate;"}, {"kind": "variable", "line": 100, "name": "key_menu_up", "signature": "extern int key_menu_up;"}, {"kind": "variable", "line": 101, "name": "key_menu_down", "signature": "extern int key_menu_down;"}, {"kind": "variable", "line": 102, "name": "key_menu_left", "signature": "extern int key_menu_left;"}, {"kind": "variable", "line": 103, "name": "key_menu_right", "signature": "extern int key_menu_right;"}, {"kind": "variable", "line": 104, "name": "key_menu_back", "signature": "extern int key_menu_back;"}, {"kind": "variable", "line": 105, "name": "key_menu_forward", "signature": "extern int key_menu_forward;"}, {"kind": "variable", "line": 106, "name": "key_menu_confirm", "signature": "extern int key_menu_confirm;"}, {"kind": "variable", "line": 107, "name": "key_menu_abort", "signature": "extern int key_menu_abort;"}, {"kind": "variable", "line": 109, "name": "key_menu_help", "signature": "extern int key_menu_help;"}, {"kind": "variable", "line": 110, "name": "key_menu_save", "signature": "extern int key_menu_save;"}, {"kind": "variable", "line": 111, "name": "key_menu_load", "signature": "extern int key_menu_load;"}, {"kind": "variable", "line": 112, "name": "key_menu_volume", "signature": "extern int key_menu_volume;"}, {"kind": "variable", "line": 113, "name": "key_menu_detail", "signature": "extern int key_menu_detail;"}, {"kind": "variable", "line": 114, "name": "key_menu_qsave", "signature": "extern int key_menu_qsave;"}, {"kind": "variable", "line": 115, "name": "key_menu_endgame", "signature": "extern int key_menu_endgame;"}, {"kind": "variable", "line": 116, "name": "key_menu_messages", "signature": "extern int key_menu_messages;"}, {"kind": "variable", "line": 117, "name": "key_menu_qload", "signature": "extern int key_menu_qload;"}, {"kind": "variable", "line": 118, "name": "key_menu_quit", "signature": "extern int key_menu_quit;"}, {"kind": "variable", "line": 119, "name": "key_menu_gamma", "signature": "extern int key_menu_gamma;"}, {"kind": "variable", "line": 121, "name": "key_menu_incscreen", "signature": "extern int key_menu_incscreen;"}, {"kind": "variable", "line": 122, "name": "key_menu_decscreen", "signature": "extern int key_menu_decscreen;"}, {"kind": "variable", "line": 123, "name": "key_menu_screenshot", "signature": "extern int key_menu_screenshot;"}, {"kind": "variable", "line": 125, "name": "mousebfire", "signature": "extern int mousebfire;"}, {"kind": "variable", "line": 126, "name": "mousebstrafe", "signature": "extern int mousebstrafe;"}, {"kind": "variable", "line": 127, "name": "mousebforward", "signature": "extern int mousebforward;"}, {"kind": "variable", "line": 129, "name": "mousebjump", "signature": "extern int mousebjump;"}, {"kind": "variable", "line": 131, "name": "mousebstrafeleft", "signature": "extern int mousebstrafeleft;"}, {"kind": "variable", "line": 132, "name": "mousebstraferight", "signature": "extern int mousebstraferight;"}, {"kind": "variable", "line": 133, "name": "mousebbackward", "signature": "extern int mousebbackward;"}, {"kind": "variable", "line": 134, "name": "mousebuse", "signature": "extern int mousebuse;"}, {"kind": "variable", "line": 136, "name": "mousebprevweapon", "signature": "extern int mousebprevweapon;"}, {"kind": "variable", "line": 137, "name": "mousebnextweapon", "signature": "extern int mousebnextweapon;"}, {"kind": "variable", "line": 139, "name": "joybfire", "signature": "extern int joybfire;"}, {"kind": "variable", "line": 140, "name": "joybstrafe", "signature": "extern int joybstrafe;"}, {"kind": "variable", "line": 141, "name": "joybuse", "signature": "extern int joybuse;"}, {"kind": "variable", "line": 142, "name": "joybspeed", "signature": "extern int joybspeed;"}, {"kind": "variable", "line": 144, "name": "joybjump", "signature": "extern int joybjump;"}, {"kind": "variable", "line": 146, "name": "joybstrafeleft", "signature": "extern int joybstrafeleft;"}, {"kind": "variable", "line": 147, "name": "joybstraferight", "signature": "extern int joybstraferight;"}, {"kind": "variable", "line": 149, "name": "joybprevweapon", "signature": "extern int joybprevweapon;"}, {"kind": "variable", "line": 150, "name": "joybnextweapon", "signature": "extern int joybnextweapon;"}, {"kind": "variable", "line": 152, "name": "joybmenu", "signature": "extern int joybmenu;"}, {"kind": "variable", "line": 154, "name": "dclick_use", "signature": "extern int dclick_use;"}, {"kind": "macro", "line": 18, "name": "__M_CONTROLS_H__", "signature": "#define __M_CONTROLS_H__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Fixed point implementation.", "id": "progs/doomgeneric/m_fixed.c", "kind": "module", "label": "m_fixed.c", "language": "c", "sha256": "70d2b5d7f44f1840", "symbol_count": 2, "symbols": [{"kind": "function", "line": 34, "name": "FixedMul", "signature": "fixed_t\nFixedMul\n( fixed_t\ta,\n  fixed_t\tb )"}, {"kind": "function", "line": 47, "name": "FixedDiv", "signature": "fixed_t FixedDiv(fixed_t a, fixed_t b)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Fixed point arithemtics, implementation.         Fixed point, 32bit as 16.16.", "id": "progs/doomgeneric/m_fixed.h", "kind": "module", "label": "m_fixed.h", "language": "h", "sha256": "ee32bb268447144c", "symbol_count": 6, "symbols": [{"doc": "Fixed point, 32bit as 16.16.  define FRACBITS\t\t16 define FRACUNIT\t\t(1<<FRACBITS)", "kind": "type_alias", "line": 31, "name": "fixed_t", "signature": "typedef int fixed_t;"}, {"kind": "function", "line": 34, "name": "FixedMul", "signature": "fixed_t FixedMul (fixed_t a, fixed_t b);"}, {"kind": "function", "line": 35, "name": "FixedDiv", "signature": "fixed_t FixedDiv (fixed_t a, fixed_t b);"}, {"kind": "macro", "line": 21, "name": "__M_FIXED__", "signature": "#define __M_FIXED__"}, {"kind": "macro", "line": 29, "name": "FRACBITS", "signature": "#define FRACBITS"}, {"kind": "macro", "line": 30, "name": "FRACUNIT", "signature": "#define FRACUNIT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DOOM selection menu, options, episode etc. Sliders and icons. Kinda widget stuff.", "id": "progs/doomgeneric/m_menu.c", "kind": "module", "label": "m_menu.c", "language": "c", "sha256": "ced3b17381e38213", "symbol_count": 68, "symbols": [{"kind": "struct", "line": 151, "name": "menu_s"}, {"doc": "MENU TYPEDEFS", "kind": "struct", "line": 133, "name": "menuitem_t"}, {"kind": "type_alias", "line": 148, "name": "numitems", "signature": "typedef struct menu_s { short numitems;"}, {"doc": "M_ReadSaveStrings read the strings from the savegame files", "kind": "function", "line": 503, "name": "M_ReadSaveStrings", "signature": "void M_ReadSaveStrings(void)"}, {"doc": "M_LoadGame & Cie.", "kind": "function", "line": 530, "name": "M_DrawLoad", "signature": "void M_DrawLoad(void)"}, {"doc": "Draw border for the savegame description", "kind": "function", "line": 549, "name": "M_DrawSaveLoadBorder", "signature": "void M_DrawSaveLoadBorder(int x,int y)"}, {"doc": "User wants to load this game", "kind": "function", "line": 572, "name": "M_LoadSelect", "signature": "void M_LoadSelect(int choice)"}, {"doc": "Selected from DOOM menu", "kind": "function", "line": 585, "name": "M_LoadGame", "signature": "void M_LoadGame (int choice)"}, {"doc": "M_SaveGame & Cie.", "kind": "function", "line": 601, "name": "M_DrawSave", "signature": "void M_DrawSave(void)"}, {"doc": "M_Responder calls this when user is finished", "kind": "function", "line": 622, "name": "M_DoSave", "signature": "void M_DoSave(int slot)"}, {"doc": "User wants to save. Start string input for M_Responder", "kind": "function", "line": 635, "name": "M_SaveSelect", "signature": "void M_SaveSelect(int choice)"}, {"doc": "Selected from DOOM menu", "kind": "function", "line": 650, "name": "M_SaveGame", "signature": "void M_SaveGame (int choice)"}, {"kind": "function", "line": 672, "name": "M_QuickSaveResponse", "signature": "void M_QuickSaveResponse(int key)"}, {"kind": "function", "line": 681, "name": "M_QuickSave", "signature": "void M_QuickSave(void)"}, {"doc": "M_QuickLoad", "kind": "function", "line": 709, "name": "M_QuickLoadResponse", "signature": "void M_QuickLoadResponse(int key)"}, {"kind": "function", "line": 719, "name": "M_QuickLoad", "signature": "void M_QuickLoad(void)"}, {"doc": "Read This Menus Had a \"quick hack to fix romero bug\"", "kind": "function", "line": 743, "name": "M_DrawReadThis1", "signature": "void M_DrawReadThis1(void)"}, {"doc": "Read This Menus - optional second page.", "kind": "function", "line": 820, "name": "M_DrawReadThis2", "signature": "void M_DrawReadThis2(void)"}, {"doc": "Change Sfx & Music volumes", "kind": "function", "line": 834, "name": "M_DrawSound", "signature": "void M_DrawSound(void)"}, {"kind": "function", "line": 845, "name": "M_Sound", "signature": "void M_Sound(int choice)"}, {"kind": "function", "line": 850, "name": "M_SfxVol", "signature": "void M_SfxVol(int choice)"}, {"kind": "function", "line": 867, "name": "M_MusicVol", "signature": "void M_MusicVol(int choice)"}, {"doc": "M_DrawMainMenu", "kind": "function", "line": 890, "name": "M_DrawMainMenu", "signature": "void M_DrawMainMenu(void)"}, {"doc": "M_NewGame", "kind": "function", "line": 902, "name": "M_DrawNewGame", "signature": "void M_DrawNewGame(void)"}, {"kind": "function", "line": 908, "name": "M_NewGame", "signature": "void M_NewGame(int choice)"}, {"kind": "function", "line": 930, "name": "M_DrawEpisode", "signature": "void M_DrawEpisode(void)"}, {"kind": "function", "line": 935, "name": "M_VerifyNightmare", "signature": "void M_VerifyNightmare(int key)"}, {"kind": "function", "line": 944, "name": "M_ChooseSkill", "signature": "void M_ChooseSkill(int choice)"}, {"kind": "function", "line": 956, "name": "M_Episode", "signature": "void M_Episode(int choice)"}, {"kind": "function", "line": 987, "name": "M_DrawOptions", "signature": "void M_DrawOptions(void)"}, {"kind": "function", "line": 1007, "name": "M_Options", "signature": "void M_Options(int choice)"}, {"doc": "Toggle messages on/off", "kind": "function", "line": 1017, "name": "M_ChangeMessages", "signature": "void M_ChangeMessages(int choice)"}, {"doc": "M_EndGame", "kind": "function", "line": 1035, "name": "M_EndGameResponse", "signature": "void M_EndGameResponse(int key)"}, {"kind": "function", "line": 1045, "name": "M_EndGame", "signature": "void M_EndGame(int choice)"}, {"doc": "M_ReadThis", "kind": "function", "line": 1069, "name": "M_ReadThis", "signature": "void M_ReadThis(int choice)"}, {"kind": "function", "line": 1075, "name": "M_ReadThis2", "signature": "void M_ReadThis2(int choice)"}, {"kind": "function", "line": 1093, "name": "M_FinishReadThis", "signature": "void M_FinishReadThis(int choice)"}, {"kind": "function", "line": 1131, "name": "M_QuitResponse", "signature": "void M_QuitResponse(int key)"}, {"kind": "function", "line": 1147, "name": "M_SelectEndMessage", "signature": "static char *M_SelectEndMessage(void)"}, {"kind": "function", "line": 1168, "name": "M_QuitDOOM", "signature": "void M_QuitDOOM(int choice)"}, {"kind": "function", "line": 1179, "name": "M_ChangeSensitivity", "signature": "void M_ChangeSensitivity(int choice)"}, {"kind": "function", "line": 1197, "name": "M_ChangeDetail", "signature": "void M_ChangeDetail(int choice)"}, {"kind": "function", "line": 1213, "name": "M_SizeDisplay", "signature": "void M_SizeDisplay(int choice)"}, {"kind": "function", "line": 1244, "name": "M_DrawThermo", "signature": "void\nM_DrawThermo\n( int\tx,\n  int\ty,\n  int\tthermWidth,\n  int\tthermDot )"}, {"kind": "function", "line": 1270, "name": "M_DrawEmptyCell", "signature": "void\nM_DrawEmptyCell\n( menu_t*\tmenu,\n  int\t\titem )"}, {"kind": "function", "line": 1279, "name": "M_DrawSelCell", "signature": "void\nM_DrawSelCell\n( menu_t*\tmenu,\n  int\t\titem )"}, {"kind": "function", "line": 1289, "name": "M_StartMessage", "signature": "void\nM_StartMessage\n( char*\t\tstring,\n  void*\t\troutine,\n  boolean\tinput )"}, {"kind": "function", "line": 1304, "name": "M_StopMessage", "signature": "void M_StopMessage(void)"}, {"doc": "Find string width from hu_font chars", "kind": "function", "line": 1315, "name": "M_StringWidth", "signature": "int M_StringWidth(char* string)"}, {"doc": "Find string height from hu_font chars", "kind": "function", "line": 1338, "name": "M_StringHeight", "signature": "int M_StringHeight(char* string)"}, {"kind": "function", "line": 1357, "name": "M_WriteText", "signature": "void\nM_WriteText\n( int\t\tx,\n  int\t\ty,\n  char*\t\tstring)"}, {"kind": "function", "line": 1403, "name": "IsNullKey", "signature": "static boolean IsNullKey(int key)"}, {"doc": "M_Responder", "kind": "function", "line": 1416, "name": "M_Responder", "signature": "boolean M_Responder (event_t* ev)"}, {"doc": "M_StartControlPanel", "kind": "function", "line": 1899, "name": "M_StartControlPanel", "signature": "void M_StartControlPanel (void)"}, {"doc": "if 0", "kind": "function", "line": 1913, "name": "M_DrawOPLDev", "signature": "static void M_DrawOPLDev(void)"}, {"doc": "M_Drawer Called after the view has been rendered, but before it has been blitted.", "kind": "function", "line": 1951, "name": "M_Drawer", "signature": "void M_Drawer (void)"}, {"doc": "M_ClearMenus", "kind": "function", "line": 2041, "name": "M_ClearMenus", "signature": "void M_ClearMenus (void)"}, {"doc": "M_SetupNextMenu", "kind": "function", "line": 2054, "name": "M_SetupNextMenu", "signature": "void M_SetupNextMenu(menu_t *menudef)"}, {"doc": "M_Ticker", "kind": "function", "line": 2064, "name": "M_Ticker", "signature": "void M_Ticker (void)"}, {"doc": "M_Init", "kind": "function", "line": 2077, "name": "M_Init", "signature": "void M_Init (void)"}, {"kind": "function", "line": 193, "name": "M_StartGame", "signature": "void M_StartGame(int choice);"}, {"kind": "function", "line": 1915, "name": "I_OPL_DevMessages", "signature": "extern void I_OPL_DevMessages(char *, size_t);"}, {"kind": "variable", "line": 62, "name": "hu_font", "signature": "extern patch_t* hu_font[HU_FONTSIZE];"}, {"kind": "variable", "line": 63, "name": "message_dontfuckwithme", "signature": "extern boolean message_dontfuckwithme;"}, {"kind": "variable", "line": 65, "name": "chat_on", "signature": "extern boolean chat_on;"}, {"kind": "variable", "line": 123, "name": "sendpause", "signature": "extern boolean sendpause;"}, {"kind": "macro", "line": 120, "name": "SKULLXOFF", "signature": "#define SKULLXOFF"}, {"kind": "macro", "line": 121, "name": "LINEHEIGHT", "signature": "#define LINEHEIGHT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Menu widget stuff, episode selection and such.         MENUS  Called by main loop,", "id": "progs/doomgeneric/m_menu.h", "kind": "module", "label": "m_menu.h", "language": "h", "sha256": "b2fbacaae4d6e332", "symbol_count": 7, "symbols": [{"doc": "Called by main loop, only used for menu (skull cursor) animation.", "kind": "function", "line": 40, "name": "M_Ticker", "signature": "void M_Ticker (void);"}, {"doc": "Called by main loop, draws the menus directly into the screen buffer.", "kind": "function", "line": 44, "name": "M_Drawer", "signature": "void M_Drawer (void);"}, {"doc": "Called by D_DoomMain, loads the config file.", "kind": "function", "line": 48, "name": "M_Init", "signature": "void M_Init (void);"}, {"doc": "Called by intro code to force menu up upon a keypress, does nothing if menu is already up.", "kind": "function", "line": 52, "name": "M_StartControlPanel", "signature": "void M_StartControlPanel (void);"}, {"kind": "variable", "line": 56, "name": "detailLevel", "signature": "extern int detailLevel;"}, {"kind": "variable", "line": 57, "name": "screenblocks", "signature": "extern int screenblocks;"}, {"kind": "macro", "line": 21, "name": "__M_MENU__", "signature": "#define __M_MENU__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Miscellaneous.", "id": "progs/doomgeneric/m_misc.c", "kind": "module", "label": "m_misc.c", "language": "c", "sha256": "0e564466353cebdf", "symbol_count": 22, "symbols": [{"kind": "function", "line": 55, "name": "M_MakeDirectory", "signature": "void M_MakeDirectory(char *path)"}, {"kind": "function", "line": 66, "name": "M_FileExists", "signature": "boolean M_FileExists(char *filename)"}, {"kind": "function", "line": 89, "name": "M_FileLength", "signature": "long M_FileLength(FILE *handle)"}, {"kind": "function", "line": 111, "name": "M_WriteFile", "signature": "boolean M_WriteFile(char *name, void *source, int length)"}, {"kind": "function", "line": 135, "name": "M_ReadFile", "signature": "int M_ReadFile(char *name, byte **buffer)"}, {"kind": "function", "line": 166, "name": "M_TempFile", "signature": "char *M_TempFile(char *s)"}, {"kind": "function", "line": 189, "name": "M_StrToInt", "signature": "boolean M_StrToInt(const char *str, int *result)"}, {"kind": "function", "line": 197, "name": "M_ExtractFileBase", "signature": "void M_ExtractFileBase(char *path, char *dest)"}, {"kind": "function", "line": 242, "name": "M_ForceUppercase", "signature": "void M_ForceUppercase(char *text)"}, {"kind": "function", "line": 258, "name": "M_StrCaseStr", "signature": "char *M_StrCaseStr(char *haystack, char *needle)"}, {"kind": "function", "line": 291, "name": "M_StringDuplicate", "signature": "char *M_StringDuplicate(const char *orig)"}, {"kind": "function", "line": 310, "name": "M_StringReplace", "signature": "char *M_StringReplace(const char *haystack, const char *needle,\n                      const char ..."}, {"kind": "function", "line": 372, "name": "M_StringCopy", "signature": "boolean M_StringCopy(char *dest, const char *src, size_t dest_size)"}, {"kind": "function", "line": 393, "name": "M_StringConcat", "signature": "boolean M_StringConcat(char *dest, const char *src, size_t dest_size)"}, {"kind": "function", "line": 408, "name": "M_StringStartsWith", "signature": "boolean M_StringStartsWith(const char *s, const char *prefix)"}, {"kind": "function", "line": 416, "name": "M_StringEndsWith", "signature": "boolean M_StringEndsWith(const char *s, const char *suffix)"}, {"kind": "function", "line": 425, "name": "M_StringJoin", "signature": "char *M_StringJoin(const char *s, ...)"}, {"doc": "Safe, portable vsnprintf().", "kind": "function", "line": 481, "name": "M_vsnprintf", "signature": "int M_vsnprintf(char *buf, size_t buf_len, const char *s, va_list args)"}, {"doc": "Safe, portable snprintf().", "kind": "function", "line": 507, "name": "M_snprintf", "signature": "int M_snprintf(char *buf, size_t buf_len, const char *s, ...)"}, {"kind": "function", "line": 519, "name": "M_OEMToUTF8", "signature": "char *M_OEMToUTF8(const char *oem)"}, {"kind": "macro", "line": 28, "name": "WIN32_LEAN_AND_MEAN", "signature": "#define WIN32_LEAN_AND_MEAN"}, {"kind": "macro", "line": 476, "name": "vsnprintf", "signature": "#define vsnprintf"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Miscellaneous.", "id": "progs/doomgeneric/m_misc.h", "kind": "module", "label": "m_misc.h", "language": "h", "sha256": "a139da9d9856b53c", "symbol_count": 14, "symbols": [{"kind": "function", "line": 29, "name": "M_ReadFile", "signature": "int M_ReadFile(char *name, byte **buffer);"}, {"kind": "function", "line": 30, "name": "M_MakeDirectory", "signature": "void M_MakeDirectory(char *dir);"}, {"kind": "function", "line": 31, "name": "M_TempFile", "signature": "char *M_TempFile(char *s);"}, {"kind": "function", "line": 33, "name": "M_FileLength", "signature": "long M_FileLength(FILE *handle);"}, {"kind": "function", "line": 35, "name": "M_ExtractFileBase", "signature": "void M_ExtractFileBase(char *path, char *dest);"}, {"kind": "function", "line": 36, "name": "M_ForceUppercase", "signature": "void M_ForceUppercase(char *text);"}, {"kind": "function", "line": 37, "name": "M_StrCaseStr", "signature": "char *M_StrCaseStr(char *haystack, char *needle);"}, {"kind": "function", "line": 38, "name": "M_StringDuplicate", "signature": "char *M_StringDuplicate(const char *orig);"}, {"kind": "function", "line": 41, "name": "M_StringReplace", "signature": "char *M_StringReplace(const char *haystack, const char *needle, const char *replacement);"}, {"kind": "function", "line": 43, "name": "M_StringJoin", "signature": "char *M_StringJoin(const char *s, ...);"}, {"kind": "function", "line": 46, "name": "M_vsnprintf", "signature": "int M_vsnprintf(char *buf, size_t buf_len, const char *s, va_list args);"}, {"kind": "function", "line": 47, "name": "M_snprintf", "signature": "int M_snprintf(char *buf, size_t buf_len, const char *s, ...);"}, {"kind": "function", "line": 48, "name": "M_OEMToUTF8", "signature": "char *M_OEMToUTF8(const char *ansi);"}, {"kind": "macro", "line": 21, "name": "__M_MISC__", "signature": "#define __M_MISC__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Random number LUT.    M_Random Returns a 0-255 number", "id": "progs/doomgeneric/m_random.c", "kind": "module", "label": "m_random.c", "language": "c", "sha256": "f8764bd85e3c036c", "symbol_count": 3, "symbols": [{"doc": "Which one is deterministic?", "kind": "function", "line": 50, "name": "P_Random", "signature": "int P_Random (void)"}, {"kind": "function", "line": 56, "name": "M_Random", "signature": "int M_Random (void)"}, {"kind": "function", "line": 62, "name": "M_ClearRandom", "signature": "void M_ClearRandom (void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:          Returns a number from 0 to 255, from a lookup table.", "id": "progs/doomgeneric/m_random.h", "kind": "module", "label": "m_random.h", "language": "h", "sha256": "1ff3d290529bf2ed", "symbol_count": 4, "symbols": [{"doc": "Returns a number from 0 to 255, from a lookup table.", "kind": "function", "line": 30, "name": "M_Random", "signature": "int M_Random (void);"}, {"doc": "As M_Random, but used only by the play simulation.", "kind": "function", "line": 33, "name": "P_Random", "signature": "int P_Random (void);"}, {"doc": "Fix randoms for demos.", "kind": "function", "line": 36, "name": "M_ClearRandom", "signature": "void M_ClearRandom (void);"}, {"kind": "macro", "line": 21, "name": "__M_RANDOM__", "signature": "#define __M_RANDOM__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Emulates the IO functions in C stdio.h reading and writing to memory.", "id": "progs/doomgeneric/memio.c", "kind": "module", "label": "memio.c", "language": "c", "sha256": "9d6eba8274a97360", "symbol_count": 9, "symbols": [{"kind": "struct", "line": 32, "name": "_MEMFILE"}, {"kind": "function", "line": 42, "name": "mem_fopen_read", "signature": "MEMFILE *mem_fopen_read(void *buf, size_t buflen)"}, {"kind": "function", "line": 58, "name": "mem_fread", "signature": "size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream)"}, {"kind": "function", "line": 90, "name": "mem_fopen_write", "signature": "MEMFILE *mem_fopen_write(void)"}, {"kind": "function", "line": 107, "name": "mem_fwrite", "signature": "size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream)"}, {"kind": "function", "line": 143, "name": "mem_get_buf", "signature": "void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen)"}, {"kind": "function", "line": 149, "name": "mem_fclose", "signature": "void mem_fclose(MEMFILE *stream)"}, {"kind": "function", "line": 159, "name": "mem_ftell", "signature": "long mem_ftell(MEMFILE *stream)"}, {"kind": "function", "line": 164, "name": "mem_fseek", "signature": "int mem_fseek(MEMFILE *stream, signed long position, mem_rel_t whence)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.", "id": "progs/doomgeneric/memio.h", "kind": "module", "label": "memio.h", "language": "h", "sha256": "b2af94c03f868bb3", "symbol_count": 10, "symbols": [{"doc": "ifndef MEMIO_H define MEMIO_H", "kind": "type_alias", "line": 18, "name": "MEMFILE", "signature": "typedef struct _MEMFILE MEMFILE;"}, {"kind": "function", "line": 28, "name": "mem_fopen_read", "signature": "MEMFILE *mem_fopen_read(void *buf, size_t buflen);"}, {"kind": "function", "line": 29, "name": "mem_fread", "signature": "size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream);"}, {"kind": "function", "line": 30, "name": "mem_fopen_write", "signature": "MEMFILE *mem_fopen_write(void);"}, {"kind": "function", "line": 31, "name": "mem_fwrite", "signature": "size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream);"}, {"kind": "function", "line": 32, "name": "mem_get_buf", "signature": "void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen);"}, {"kind": "function", "line": 33, "name": "mem_fclose", "signature": "void mem_fclose(MEMFILE *stream);"}, {"kind": "function", "line": 34, "name": "mem_ftell", "signature": "long mem_ftell(MEMFILE *stream);"}, {"kind": "function", "line": 35, "name": "mem_fseek", "signature": "int mem_fseek(MEMFILE *stream, signed long offset, mem_rel_t whence);"}, {"kind": "macro", "line": 17, "name": "MEMIO_H", "signature": "#define MEMIO_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Network client code", "id": "progs/doomgeneric/net_client.h", "kind": "module", "label": "net_client.h", "language": "h", "sha256": "0ad070804a94de4b", "symbol_count": 21, "symbols": [{"kind": "function", "line": 26, "name": "NET_CL_Disconnect", "signature": "void NET_CL_Disconnect(void);"}, {"kind": "function", "line": 27, "name": "NET_CL_Run", "signature": "void NET_CL_Run(void);"}, {"kind": "function", "line": 28, "name": "NET_CL_Init", "signature": "void NET_CL_Init(void);"}, {"kind": "function", "line": 29, "name": "NET_CL_LaunchGame", "signature": "void NET_CL_LaunchGame(void);"}, {"kind": "function", "line": 30, "name": "NET_CL_StartGame", "signature": "void NET_CL_StartGame(net_gamesettings_t *settings);"}, {"kind": "function", "line": 31, "name": "NET_CL_SendTiccmd", "signature": "void NET_CL_SendTiccmd(ticcmd_t *ticcmd, int maketic);"}, {"kind": "function", "line": 33, "name": "NET_Init", "signature": "void NET_Init(void);"}, {"kind": "function", "line": 35, "name": "NET_BindVariables", "signature": "void NET_BindVariables(void);"}, {"kind": "variable", "line": 37, "name": "net_client_connected", "signature": "extern boolean net_client_connected;"}, {"kind": "variable", "line": 38, "name": "net_client_received_wait_data", "signature": "extern boolean net_client_received_wait_data;"}, {"kind": "variable", "line": 39, "name": "net_client_wait_data", "signature": "extern net_waitdata_t net_client_wait_data;"}, {"kind": "variable", "line": 40, "name": "net_waiting_for_launch", "signature": "extern boolean net_waiting_for_launch;"}, {"kind": "variable", "line": 41, "name": "net_player_name", "signature": "extern char *net_player_name;"}, {"kind": "variable", "line": 43, "name": "net_server_wad_sha1sum", "signature": "extern sha1_digest_t net_server_wad_sha1sum;"}, {"kind": "variable", "line": 44, "name": "net_server_deh_sha1sum", "signature": "extern sha1_digest_t net_server_deh_sha1sum;"}, {"kind": "variable", "line": 45, "name": "net_server_is_freedoom", "signature": "extern unsigned int net_server_is_freedoom;"}, {"kind": "variable", "line": 46, "name": "net_local_wad_sha1sum", "signature": "extern sha1_digest_t net_local_wad_sha1sum;"}, {"kind": "variable", "line": 47, "name": "net_local_deh_sha1sum", "signature": "extern sha1_digest_t net_local_deh_sha1sum;"}, {"kind": "variable", "line": 48, "name": "net_local_is_freedoom", "signature": "extern unsigned int net_local_is_freedoom;"}, {"kind": "variable", "line": 50, "name": "drone", "signature": "extern boolean drone;"}, {"kind": "macro", "line": 18, "name": "NET_CLIENT_H", "signature": "#define NET_CLIENT_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Dedicated server code.", "id": "progs/doomgeneric/net_dedicated.h", "kind": "module", "label": "net_dedicated.h", "language": "h", "sha256": "9aa1fc0a1f449853", "symbol_count": 2, "symbols": [{"kind": "function", "line": 21, "name": "NET_DedicatedServer", "signature": "void NET_DedicatedServer(void);"}, {"kind": "macro", "line": 19, "name": "NET_DEDICATED_H", "signature": "#define NET_DEDICATED_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Definitions for use in networking code.      Absolute maximum number of \"nodes\" in the game.  This is different to NET_MAXPLAYERS, as there may be observers that are not participating (eg. left/right monitors)", "id": "progs/doomgeneric/net_defs.h", "kind": "module", "label": "net_defs.h", "language": "h", "sha256": "7d6adf965b97e825", "symbol_count": 28, "symbols": [{"kind": "struct", "line": 52, "name": "_net_packet_s"}, {"kind": "struct", "line": 60, "name": "_net_module_s"}, {"kind": "struct", "line": 95, "name": "_net_addr_s"}, {"kind": "struct", "line": 147, "name": "net_connect_data_t"}, {"kind": "struct", "line": 163, "name": "net_gamesettings_t"}, {"kind": "struct", "line": 202, "name": "net_ticdiff_t"}, {"kind": "struct", "line": 210, "name": "net_full_ticcmd_t"}, {"kind": "struct", "line": 220, "name": "net_querydata_t"}, {"kind": "struct", "line": 233, "name": "net_waitdata_t"}, {"doc": "define BACKUPTICS 128", "kind": "type_alias", "line": 46, "name": "net_module_t", "signature": "typedef struct _net_module_s net_module_t;"}, {"kind": "type_alias", "line": 48, "name": "net_packet_t", "signature": "typedef struct _net_packet_s net_packet_t;"}, {"kind": "type_alias", "line": 49, "name": "net_addr_t", "signature": "typedef struct _net_addr_s net_addr_t;"}, {"kind": "type_alias", "line": 50, "name": "net_context_t", "signature": "typedef struct _net_context_s net_context_t;"}, {"kind": "macro", "line": 19, "name": "NET_DEFS_H", "signature": "#define NET_DEFS_H"}, {"kind": "macro", "line": 31, "name": "MAXNETNODES", "signature": "#define MAXNETNODES"}, {"kind": "macro", "line": 37, "name": "NET_MAXPLAYERS", "signature": "#define NET_MAXPLAYERS"}, {"kind": "macro", "line": 41, "name": "MAXPLAYERNAME", "signature": "#define MAXPLAYERNAME"}, {"kind": "macro", "line": 45, "name": "BACKUPTICS", "signature": "#define BACKUPTICS"}, {"kind": "macro", "line": 103, "name": "NET_MAGIC_NUMBER", "signature": "#define NET_MAGIC_NUMBER"}, {"kind": "macro", "line": 107, "name": "NET_RELIABLE_PACKET", "signature": "#define NET_RELIABLE_PACKET"}, {"kind": "macro", "line": 193, "name": "NET_TICDIFF_FORWARD", "signature": "#define NET_TICDIFF_FORWARD"}, {"kind": "macro", "line": 194, "name": "NET_TICDIFF_SIDE", "signature": "#define NET_TICDIFF_SIDE"}, {"kind": "macro", "line": 195, "name": "NET_TICDIFF_TURN", "signature": "#define NET_TICDIFF_TURN"}, {"kind": "macro", "line": 196, "name": "NET_TICDIFF_BUTTONS", "signature": "#define NET_TICDIFF_BUTTONS"}, {"kind": "macro", "line": 197, "name": "NET_TICDIFF_CONSISTANCY", "signature": "#define NET_TICDIFF_CONSISTANCY"}, {"kind": "macro", "line": 198, "name": "NET_TICDIFF_CHATCHAR", "signature": "#define NET_TICDIFF_CHATCHAR"}, {"kind": "macro", "line": 199, "name": "NET_TICDIFF_RAVEN", "signature": "#define NET_TICDIFF_RAVEN"}, {"kind": "macro", "line": 200, "name": "NET_TICDIFF_STRIFE", "signature": "#define NET_TICDIFF_STRIFE"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Graphical stuff related to the networking code:  * The client waiting screen when we are waiting for the server to start the game.", "id": "progs/doomgeneric/net_gui.h", "kind": "module", "label": "net_gui.h", "language": "h", "sha256": "9e675f04e7f3f431", "symbol_count": 2, "symbols": [{"kind": "function", "line": 26, "name": "NET_WaitForLaunch", "signature": "extern void NET_WaitForLaunch(void);"}, {"kind": "macro", "line": 22, "name": "NET_GUI_H", "signature": "#define NET_GUI_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Network packet manipulation (net_packet_t)", "id": "progs/doomgeneric/net_io.h", "kind": "module", "label": "net_io.h", "language": "h", "sha256": "09a9c18d1f7f1d84", "symbol_count": 9, "symbols": [{"kind": "function", "line": 25, "name": "NET_NewContext", "signature": "net_context_t *NET_NewContext(void);"}, {"kind": "function", "line": 26, "name": "NET_AddModule", "signature": "void NET_AddModule(net_context_t *context, net_module_t *module);"}, {"kind": "function", "line": 27, "name": "NET_SendPacket", "signature": "void NET_SendPacket(net_addr_t *addr, net_packet_t *packet);"}, {"kind": "function", "line": 28, "name": "NET_SendBroadcast", "signature": "void NET_SendBroadcast(net_context_t *context, net_packet_t *packet);"}, {"kind": "function", "line": 31, "name": "NET_AddrToString", "signature": "char *NET_AddrToString(net_addr_t *addr);"}, {"kind": "function", "line": 32, "name": "NET_FreeAddress", "signature": "void NET_FreeAddress(net_addr_t *addr);"}, {"kind": "function", "line": 33, "name": "NET_ResolveAddress", "signature": "net_addr_t *NET_ResolveAddress(net_context_t *context, char *address);"}, {"kind": "variable", "line": 23, "name": "net_broadcast_addr", "signature": "extern net_addr_t net_broadcast_addr;"}, {"kind": "macro", "line": 19, "name": "NET_IO_H", "signature": "#define NET_IO_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Loopback network module for server compiled into the client", "id": "progs/doomgeneric/net_loop.h", "kind": "module", "label": "net_loop.h", "language": "h", "sha256": "629e667f49adbc87", "symbol_count": 3, "symbols": [{"kind": "variable", "line": 23, "name": "net_loop_client_module", "signature": "extern net_module_t net_loop_client_module;"}, {"kind": "variable", "line": 24, "name": "net_loop_server_module", "signature": "extern net_module_t net_loop_server_module;"}, {"kind": "macro", "line": 19, "name": "NET_LOOP_H", "signature": "#define NET_LOOP_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Definitions for use in networking code.", "id": "progs/doomgeneric/net_packet.h", "kind": "module", "label": "net_packet.h", "language": "h", "sha256": "86e77e741a96d5b0", "symbol_count": 9, "symbols": [{"kind": "function", "line": 23, "name": "NET_NewPacket", "signature": "net_packet_t *NET_NewPacket(int initial_size);"}, {"kind": "function", "line": 24, "name": "NET_PacketDup", "signature": "net_packet_t *NET_PacketDup(net_packet_t *packet);"}, {"kind": "function", "line": 25, "name": "NET_FreePacket", "signature": "void NET_FreePacket(net_packet_t *packet);"}, {"kind": "function", "line": 35, "name": "NET_ReadString", "signature": "char *NET_ReadString(net_packet_t *packet);"}, {"kind": "function", "line": 37, "name": "NET_WriteInt8", "signature": "void NET_WriteInt8(net_packet_t *packet, unsigned int i);"}, {"kind": "function", "line": 38, "name": "NET_WriteInt16", "signature": "void NET_WriteInt16(net_packet_t *packet, unsigned int i);"}, {"kind": "function", "line": 39, "name": "NET_WriteInt32", "signature": "void NET_WriteInt32(net_packet_t *packet, unsigned int i);"}, {"kind": "function", "line": 41, "name": "NET_WriteString", "signature": "void NET_WriteString(net_packet_t *packet, char *string);"}, {"kind": "macro", "line": 19, "name": "NET_PACKET_H", "signature": "#define NET_PACKET_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Querying servers to find their current status.", "id": "progs/doomgeneric/net_query.h", "kind": "module", "label": "net_query.h", "language": "h", "sha256": "eef2c706c8d1f849", "symbol_count": 12, "symbols": [{"kind": "function", "line": 28, "name": "NET_StartLANQuery", "signature": "extern int NET_StartLANQuery(void);"}, {"kind": "function", "line": 29, "name": "NET_StartMasterQuery", "signature": "extern int NET_StartMasterQuery(void);"}, {"kind": "function", "line": 31, "name": "NET_LANQuery", "signature": "extern void NET_LANQuery(void);"}, {"kind": "function", "line": 32, "name": "NET_MasterQuery", "signature": "extern void NET_MasterQuery(void);"}, {"kind": "function", "line": 33, "name": "NET_QueryAddress", "signature": "extern void NET_QueryAddress(char *addr);"}, {"kind": "function", "line": 34, "name": "NET_FindLANServer", "signature": "extern net_addr_t *NET_FindLANServer(void);"}, {"kind": "function", "line": 36, "name": "NET_Query_Poll", "signature": "extern int NET_Query_Poll(net_query_callback_t callback, void *user_data);"}, {"kind": "function", "line": 38, "name": "NET_Query_ResolveMaster", "signature": "extern net_addr_t *NET_Query_ResolveMaster(net_context_t *context);"}, {"kind": "function", "line": 39, "name": "NET_Query_AddToMaster", "signature": "extern void NET_Query_AddToMaster(net_addr_t *master_addr);"}, {"kind": "function", "line": 40, "name": "NET_Query_CheckAddedToMaster", "signature": "extern boolean NET_Query_CheckAddedToMaster(boolean *result);"}, {"kind": "function", "line": 41, "name": "NET_Query_MasterResponse", "signature": "extern void NET_Query_MasterResponse(net_packet_t *packet);"}, {"kind": "macro", "line": 19, "name": "NET_QUERY_H", "signature": "#define NET_QUERY_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Networking module which uses SDL_net", "id": "progs/doomgeneric/net_sdl.h", "kind": "module", "label": "net_sdl.h", "language": "h", "sha256": "a8e1cbe8462f4371", "symbol_count": 2, "symbols": [{"kind": "variable", "line": 23, "name": "net_sdl_module", "signature": "extern net_module_t net_sdl_module;"}, {"kind": "macro", "line": 19, "name": "NET_SDL_H", "signature": "#define NET_SDL_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Network server code    initialize server and wait for connections", "id": "progs/doomgeneric/net_server.h", "kind": "module", "label": "net_server.h", "language": "h", "sha256": "7ee26cbb9d49a473", "symbol_count": 6, "symbols": [{"kind": "function", "line": 22, "name": "NET_SV_Init", "signature": "void NET_SV_Init(void);"}, {"kind": "function", "line": 26, "name": "NET_SV_Run", "signature": "void NET_SV_Run(void);"}, {"kind": "function", "line": 31, "name": "NET_SV_Shutdown", "signature": "void NET_SV_Shutdown(void);"}, {"kind": "function", "line": 35, "name": "NET_SV_AddModule", "signature": "void NET_SV_AddModule(net_module_t *module);"}, {"kind": "function", "line": 39, "name": "NET_SV_RegisterWithMaster", "signature": "void NET_SV_RegisterWithMaster(void);"}, {"kind": "macro", "line": 18, "name": "NET_SERVER_H", "signature": "#define NET_SERVER_H"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  Ceiling aninmation (lowering, crushing, raising)       State.  Data.", "id": "progs/doomgeneric/p_ceilng.c", "kind": "module", "label": "p_ceilng.c", "language": "c", "sha256": "707b524bab3253cc", "symbol_count": 6, "symbols": [{"kind": "function", "line": 45, "name": "T_MoveCeiling", "signature": "void T_MoveCeiling (ceiling_t* ceiling)"}, {"kind": "function", "line": 161, "name": "EV_DoCeiling", "signature": "int\nEV_DoCeiling\n( line_t*\tline,\n  ceiling_e\ttype )"}, {"doc": "Add an active ceiling", "kind": "function", "line": 240, "name": "P_AddActiveCeiling", "signature": "void P_AddActiveCeiling(ceiling_t* c)"}, {"doc": "Remove a ceiling's thinker", "kind": "function", "line": 259, "name": "P_RemoveActiveCeiling", "signature": "void P_RemoveActiveCeiling(ceiling_t* c)"}, {"doc": "Restart a ceiling that's in-stasis", "kind": "function", "line": 280, "name": "P_ActivateInStasisCeiling", "signature": "void P_ActivateInStasisCeiling(line_t* line)"}, {"doc": "EV_CeilingCrushStop Stop a ceiling from crushing!", "kind": "function", "line": 303, "name": "EV_CeilingCrushStop", "signature": "int\tEV_CeilingCrushStop(line_t\t*line)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Door animation code (opening/closing)        State.", "id": "progs/doomgeneric/p_doors.c", "kind": "module", "label": "p_doors.c", "language": "c", "sha256": "a6ae418fb4abf263", "symbol_count": 10, "symbols": [{"doc": "T_VerticalDoor", "kind": "function", "line": 57, "name": "T_VerticalDoor", "signature": "void T_VerticalDoor (vldoor_t* door)"}, {"kind": "function", "line": 195, "name": "EV_DoLockedDoor", "signature": "int\nEV_DoLockedDoor\n( line_t*\tline,\n  vldoor_e\ttype,\n  mobj_t*\tthing )"}, {"kind": "function", "line": 252, "name": "EV_DoDoor", "signature": "int\nEV_DoDoor\n( line_t*\tline,\n  vldoor_e\ttype )"}, {"kind": "function", "line": 337, "name": "EV_VerticalDoor", "signature": "void\nEV_VerticalDoor\n( line_t*\tline,\n  mobj_t*\tthing )"}, {"doc": "Spawn a door that closes after 30 seconds", "kind": "function", "line": 519, "name": "P_SpawnDoorCloseIn30", "signature": "void P_SpawnDoorCloseIn30 (sector_t* sec)"}, {"kind": "function", "line": 542, "name": "P_SpawnDoorRaiseIn5Mins", "signature": "void\nP_SpawnDoorRaiseIn5Mins\n( sector_t*\tsec,\n  int\t\tsecnum )"}, {"kind": "function", "line": 580, "name": "P_InitSlidingDoorFrames", "signature": "void P_InitSlidingDoorFrames(void)"}, {"doc": "Return index into \"slideFrames\" array for which door type to use", "kind": "function", "line": 624, "name": "P_FindSlidingDoorType", "signature": "int P_FindSlidingDoorType(line_t*\tline)"}, {"kind": "function", "line": 639, "name": "T_SlidingDoor", "signature": "void T_SlidingDoor (slidedoor_t*\tdoor)"}, {"kind": "function", "line": 727, "name": "EV_SlidingDoor", "signature": "void\nEV_SlidingDoor\n( line_t*\tline,\n  mobj_t*\tthing )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Enemy thinking, AI. Action Pointer Functions that are associated with states/frames.", "id": "progs/doomgeneric/p_enemy.c", "kind": "module", "label": "p_enemy.c", "language": "c", "sha256": "2e2d0d1f4a902012", "symbol_count": 68, "symbols": [{"kind": "function", "line": 99, "name": "P_RecursiveSound", "signature": "void\nP_RecursiveSound\n( sector_t*\tsec,\n  int\t\tsoundblocks )"}, {"kind": "function", "line": 152, "name": "P_NoiseAlert", "signature": "void\nP_NoiseAlert\n( mobj_t*\ttarget,\n  mobj_t*\temmiter )"}, {"doc": "P_CheckMeleeRange", "kind": "function", "line": 167, "name": "P_CheckMeleeRange", "signature": "boolean P_CheckMeleeRange (mobj_t*\tactor)"}, {"doc": "P_CheckMissileRange", "kind": "function", "line": 190, "name": "P_CheckMissileRange", "signature": "boolean P_CheckMissileRange (mobj_t* actor)"}, {"kind": "function", "line": 260, "name": "P_Move", "signature": "boolean P_Move (mobj_t*\tactor)"}, {"doc": "TryWalk Attempts to move actor on in its current (ob->moveangle) direction. If blocked by either a wall or an actor returns FALSE If move is either clear or blocked only by a door, returns TRUE and sets... If a door is in the way, an OpenDoor call is made to start it opening.", "kind": "function", "line": 337, "name": "P_TryWalk", "signature": "boolean P_TryWalk (mobj_t* actor)"}, {"kind": "function", "line": 351, "name": "P_NewChaseDir", "signature": "void P_NewChaseDir (mobj_t*\tactor)"}, {"kind": "function", "line": 487, "name": "P_LookForPlayers", "signature": "boolean\nP_LookForPlayers\n( mobj_t*\tactor,\n  boolean\tallaround )"}, {"doc": "A_KeenDie DOOM II special, map 32. Uses special tag 666.", "kind": "function", "line": 551, "name": "A_KeenDie", "signature": "void A_KeenDie (mobj_t* mo)"}, {"doc": "A_Look Stay in state until a player is sighted.", "kind": "function", "line": 589, "name": "A_Look", "signature": "void A_Look (mobj_t* actor)"}, {"doc": "A_Chase Actor has a melee attack, so it tries to close as fast as possible", "kind": "function", "line": 657, "name": "A_Chase", "signature": "void A_Chase (mobj_t*\tactor)"}, {"doc": "A_FaceTarget", "kind": "function", "line": 767, "name": "A_FaceTarget", "signature": "void A_FaceTarget (mobj_t* actor)"}, {"doc": "A_PosAttack", "kind": "function", "line": 787, "name": "A_PosAttack", "signature": "void A_PosAttack (mobj_t* actor)"}, {"kind": "function", "line": 806, "name": "A_SPosAttack", "signature": "void A_SPosAttack (mobj_t* actor)"}, {"kind": "function", "line": 830, "name": "A_CPosAttack", "signature": "void A_CPosAttack (mobj_t* actor)"}, {"kind": "function", "line": 850, "name": "A_CPosRefire", "signature": "void A_CPosRefire (mobj_t* actor)"}, {"kind": "function", "line": 867, "name": "A_SpidRefire", "signature": "void A_SpidRefire (mobj_t* actor)"}, {"kind": "function", "line": 883, "name": "A_BspiAttack", "signature": "void A_BspiAttack (mobj_t *actor)"}, {"doc": "A_TroopAttack", "kind": "function", "line": 898, "name": "A_TroopAttack", "signature": "void A_TroopAttack (mobj_t* actor)"}, {"kind": "function", "line": 920, "name": "A_SargAttack", "signature": "void A_SargAttack (mobj_t* actor)"}, {"kind": "function", "line": 935, "name": "A_HeadAttack", "signature": "void A_HeadAttack (mobj_t* actor)"}, {"kind": "function", "line": 954, "name": "A_CyberAttack", "signature": "void A_CyberAttack (mobj_t* actor)"}, {"kind": "function", "line": 964, "name": "A_BruisAttack", "signature": "void A_BruisAttack (mobj_t* actor)"}, {"doc": "A_SkelMissile", "kind": "function", "line": 987, "name": "A_SkelMissile", "signature": "void A_SkelMissile (mobj_t* actor)"}, {"kind": "function", "line": 1006, "name": "A_Tracer", "signature": "void A_Tracer (mobj_t* actor)"}, {"kind": "function", "line": 1078, "name": "A_SkelWhoosh", "signature": "void A_SkelWhoosh (mobj_t*\tactor)"}, {"kind": "function", "line": 1086, "name": "A_SkelFist", "signature": "void A_SkelFist (mobj_t*\tactor)"}, {"kind": "function", "line": 1114, "name": "PIT_VileCheck", "signature": "boolean PIT_VileCheck (mobj_t*\tthing)"}, {"doc": "A_VileChase Check for ressurecting a body", "kind": "function", "line": 1152, "name": "A_VileChase", "signature": "void A_VileChase (mobj_t* actor)"}, {"doc": "A_VileStart", "kind": "function", "line": 1218, "name": "A_VileStart", "signature": "void A_VileStart (mobj_t* actor)"}, {"kind": "function", "line": 1230, "name": "A_StartFire", "signature": "void A_StartFire (mobj_t* actor)"}, {"kind": "function", "line": 1236, "name": "A_FireCrackle", "signature": "void A_FireCrackle (mobj_t* actor)"}, {"kind": "function", "line": 1242, "name": "A_Fire", "signature": "void A_Fire (mobj_t* actor)"}, {"doc": "A_VileTarget Spawn the hellfire", "kind": "function", "line": 1273, "name": "A_VileTarget", "signature": "void A_VileTarget (mobj_t*\tactor)"}, {"doc": "A_VileAttack", "kind": "function", "line": 1298, "name": "A_VileAttack", "signature": "void A_VileAttack (mobj_t* actor)"}, {"kind": "function", "line": 1339, "name": "A_FatRaise", "signature": "void A_FatRaise (mobj_t *actor)"}, {"kind": "function", "line": 1346, "name": "A_FatAttack1", "signature": "void A_FatAttack1 (mobj_t* actor)"}, {"kind": "function", "line": 1366, "name": "A_FatAttack2", "signature": "void A_FatAttack2 (mobj_t* actor)"}, {"kind": "function", "line": 1385, "name": "A_FatAttack3", "signature": "void A_FatAttack3 (mobj_t*\tactor)"}, {"kind": "function", "line": 1415, "name": "A_SkullAttack", "signature": "void A_SkullAttack (mobj_t* actor)"}, {"kind": "function", "line": 1446, "name": "A_PainShootSkull", "signature": "void\nA_PainShootSkull\n( mobj_t*\tactor,\n  angle_t\tangle )"}, {"doc": "A_PainAttack Spawn a lost soul and launch it at the target", "kind": "function", "line": 1508, "name": "A_PainAttack", "signature": "void A_PainAttack (mobj_t* actor)"}, {"kind": "function", "line": 1518, "name": "A_PainDie", "signature": "void A_PainDie (mobj_t* actor)"}, {"kind": "function", "line": 1531, "name": "A_Scream", "signature": "void A_Scream (mobj_t* actor)"}, {"kind": "function", "line": 1568, "name": "A_XScream", "signature": "void A_XScream (mobj_t* actor)"}, {"kind": "function", "line": 1573, "name": "A_Pain", "signature": "void A_Pain (mobj_t* actor)"}, {"kind": "function", "line": 1581, "name": "A_Fall", "signature": "void A_Fall (mobj_t *actor)"}, {"doc": "A_Explode", "kind": "function", "line": 1594, "name": "A_Explode", "signature": "void A_Explode (mobj_t* thingy)"}, {"kind": "function", "line": 1605, "name": "CheckBossEnd", "signature": "static boolean CheckBossEnd(mobjtype_t motype)"}, {"doc": "A_BossDeath Possibly trigger special effects if on first boss level", "kind": "function", "line": 1656, "name": "A_BossDeath", "signature": "void A_BossDeath (mobj_t* mo)"}, {"kind": "function", "line": 1757, "name": "A_Hoof", "signature": "void A_Hoof (mobj_t* mo)"}, {"kind": "function", "line": 1763, "name": "A_Metal", "signature": "void A_Metal (mobj_t* mo)"}, {"kind": "function", "line": 1769, "name": "A_BabyMetal", "signature": "void A_BabyMetal (mobj_t* mo)"}, {"kind": "function", "line": 1776, "name": "A_OpenShotgun2", "signature": "void\nA_OpenShotgun2\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 1784, "name": "A_LoadShotgun2", "signature": "void\nA_LoadShotgun2\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 1797, "name": "A_CloseShotgun2", "signature": "void\nA_CloseShotgun2\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 1811, "name": "A_BrainAwake", "signature": "void A_BrainAwake (mobj_t* mo)"}, {"kind": "function", "line": 1841, "name": "A_BrainPain", "signature": "void A_BrainPain (mobj_t*\tmo)"}, {"kind": "function", "line": 1847, "name": "A_BrainScream", "signature": "void A_BrainScream (mobj_t*\tmo)"}, {"kind": "function", "line": 1873, "name": "A_BrainExplode", "signature": "void A_BrainExplode (mobj_t* mo)"}, {"kind": "function", "line": 1894, "name": "A_BrainDie", "signature": "void A_BrainDie (mobj_t*\tmo)"}, {"kind": "function", "line": 1899, "name": "A_BrainSpit", "signature": "void A_BrainSpit (mobj_t*\tmo)"}, {"doc": "travelling cube sound", "kind": "function", "line": 1928, "name": "A_SpawnSound", "signature": "void A_SpawnSound (mobj_t* mo)"}, {"kind": "function", "line": 1934, "name": "A_SpawnFly", "signature": "void A_SpawnFly (mobj_t* mo)"}, {"kind": "function", "line": 1992, "name": "A_PlayerScream", "signature": "void A_PlayerScream (mobj_t* mo)"}, {"kind": "function", "line": 1792, "name": "A_ReFire", "signature": "void A_ReFire ( player_t* player, pspdef_t* psp );"}, {"kind": "macro", "line": 1337, "name": "FATSPREAD", "signature": "#define\tFATSPREAD"}, {"kind": "macro", "line": 1413, "name": "SKULLSPEED", "signature": "#define\tSKULLSPEED"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Floor animation: raising stairs.       State. Data.", "id": "progs/doomgeneric/p_floor.c", "kind": "module", "label": "p_floor.c", "language": "c", "sha256": "712c9d45044f4041", "symbol_count": 4, "symbols": [{"kind": "function", "line": 42, "name": "T_MovePlane", "signature": "result_e\nT_MovePlane\n( sector_t*\tsector,\n  fixed_t\tspeed,\n  fixed_t\tdest,\n  boolean\tcrush,\n  int\t..."}, {"doc": "MOVE A FLOOR TO IT'S DESTINATION (UP OR DOWN)", "kind": "function", "line": 202, "name": "T_MoveFloor", "signature": "void T_MoveFloor(floormove_t* floor)"}, {"kind": "function", "line": 251, "name": "EV_DoFloor", "signature": "int\nEV_DoFloor\n( line_t*\tline,\n  floor_e\tfloortype )"}, {"kind": "function", "line": 444, "name": "EV_BuildStairs", "signature": "int\nEV_BuildStairs\n( line_t*\tline,\n  stair_e\ttype )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handling interactions (i.e., collisions).      Data.", "id": "progs/doomgeneric/p_inter.c", "kind": "module", "label": "p_inter.c", "language": "c", "sha256": "e14d7655da6c3410", "symbol_count": 10, "symbols": [{"kind": "function", "line": 66, "name": "P_GiveAmmo", "signature": "boolean\nP_GiveAmmo\n( player_t*\tplayer,\n  ammotype_t\tammo,\n  int\t\tnum )"}, {"kind": "function", "line": 160, "name": "P_GiveWeapon", "signature": "boolean\nP_GiveWeapon\n( player_t*\tplayer,\n  weapontype_t\tweapon,\n  boolean\tdropped )"}, {"kind": "function", "line": 223, "name": "P_GiveBody", "signature": "boolean\nP_GiveBody\n( player_t*\tplayer,\n  int\t\tnum )"}, {"kind": "function", "line": 246, "name": "P_GiveArmor", "signature": "boolean\nP_GiveArmor\n( player_t*\tplayer,\n  int\t\tarmortype )"}, {"kind": "function", "line": 268, "name": "P_GiveCard", "signature": "void\nP_GiveCard\n( player_t*\tplayer,\n  card_t\tcard )"}, {"kind": "function", "line": 284, "name": "P_GivePower", "signature": "boolean\nP_GivePower\n( player_t*\tplayer,\n  int /*powertype_t*/\tpower )"}, {"kind": "function", "line": 333, "name": "P_TouchSpecialThing", "signature": "void\nP_TouchSpecialThing\n( mobj_t*\tspecial,\n  mobj_t*\ttoucher )"}, {"kind": "function", "line": 666, "name": "P_KillMobj", "signature": "void\nP_KillMobj\n( mobj_t*\tsource,\n  mobj_t*\ttarget )"}, {"kind": "function", "line": 779, "name": "P_DamageMobj", "signature": "void\nP_DamageMobj\n( mobj_t*\ttarget,\n  mobj_t*\tinflictor,\n  mobj_t*\tsource,\n  int \t\tdamage )"}, {"kind": "macro", "line": 43, "name": "BONUSADD", "signature": "#define BONUSADD"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:", "id": "progs/doomgeneric/p_inter.h", "kind": "module", "label": "p_inter.h", "language": "h", "sha256": "eb9b7042a9dff119", "symbol_count": 1, "symbols": [{"kind": "macro", "line": 21, "name": "__P_INTER__", "signature": "#define __P_INTER__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handle Sector base lighting effects. Muzzle flash?        State.", "id": "progs/doomgeneric/p_lights.c", "kind": "module", "label": "p_lights.c", "language": "c", "sha256": "acc6ad01b92fc769", "symbol_count": 11, "symbols": [{"doc": "T_FireFlicker", "kind": "function", "line": 39, "name": "T_FireFlicker", "signature": "void T_FireFlicker (fireflicker_t* flick)"}, {"doc": "P_SpawnFireFlicker", "kind": "function", "line": 61, "name": "P_SpawnFireFlicker", "signature": "void P_SpawnFireFlicker (sector_t*\tsector)"}, {"doc": "T_LightFlash Do flashing lights.", "kind": "function", "line": 91, "name": "T_LightFlash", "signature": "void T_LightFlash (lightflash_t* flash)"}, {"doc": "P_SpawnLightFlash After the map has been loaded, scan each sector for specials that spawn thinkers", "kind": "function", "line": 117, "name": "P_SpawnLightFlash", "signature": "void P_SpawnLightFlash (sector_t*\tsector)"}, {"doc": "T_StrobeFlash", "kind": "function", "line": 148, "name": "T_StrobeFlash", "signature": "void T_StrobeFlash (strobe_t*\t\tflash)"}, {"kind": "function", "line": 174, "name": "P_SpawnStrobeFlash", "signature": "void\nP_SpawnStrobeFlash\n( sector_t*\tsector,\n  int\t\tfastOrSlow,\n  int\t\tinSync )"}, {"doc": "Start strobing lights (usually from a trigger)", "kind": "function", "line": 208, "name": "EV_StartLightStrobing", "signature": "void EV_StartLightStrobing(line_t*\tline)"}, {"doc": "TURN LINE'S TAG LIGHTS OFF", "kind": "function", "line": 229, "name": "EV_TurnTagLightsOff", "signature": "void EV_TurnTagLightsOff(line_t* line)"}, {"kind": "function", "line": 264, "name": "EV_LightTurnOn", "signature": "void\nEV_LightTurnOn\n( line_t*\tline,\n  int\t\tbright )"}, {"kind": "function", "line": 307, "name": "T_Glow", "signature": "void T_Glow(glow_t*\tg)"}, {"kind": "function", "line": 334, "name": "P_SpawnGlowingLight", "signature": "void P_SpawnGlowingLight(sector_t*\tsector)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Play functions, animation, global header.", "id": "progs/doomgeneric/p_local.h", "kind": "module", "label": "p_local.h", "language": "h", "sha256": "ebba786a9d2bfaae", "symbol_count": 91, "symbols": [{"doc": "P_MAPUTL", "kind": "struct", "line": 133, "name": "divline_t"}, {"kind": "struct", "line": 142, "name": "d"}, {"kind": "function", "line": 70, "name": "P_InitThinkers", "signature": "void P_InitThinkers (void);"}, {"kind": "function", "line": 71, "name": "P_AddThinker", "signature": "void P_AddThinker (thinker_t* thinker);"}, {"kind": "function", "line": 72, "name": "P_RemoveThinker", "signature": "void P_RemoveThinker (thinker_t* thinker);"}, {"doc": "P_PSPR", "kind": "function", "line": 78, "name": "P_SetupPsprites", "signature": "void P_SetupPsprites (player_t* curplayer);"}, {"kind": "function", "line": 79, "name": "P_MovePsprites", "signature": "void P_MovePsprites (player_t* curplayer);"}, {"kind": "function", "line": 80, "name": "P_DropWeapon", "signature": "void P_DropWeapon (player_t* player);"}, {"doc": "P_USER", "kind": "function", "line": 86, "name": "P_PlayerThink", "signature": "void P_PlayerThink (player_t* player);"}, {"kind": "function", "line": 104, "name": "P_RespawnSpecials", "signature": "void P_RespawnSpecials (void);"}, {"kind": "function", "line": 107, "name": "P_SpawnMobj", "signature": "mobj_t* P_SpawnMobj ( fixed_t x, fixed_t y, fixed_t z, mobjtype_t type );"}, {"kind": "function", "line": 113, "name": "P_RemoveMobj", "signature": "void P_RemoveMobj (mobj_t* th);"}, {"kind": "function", "line": 114, "name": "P_SubstNullMobj", "signature": "mobj_t* P_SubstNullMobj (mobj_t* th);"}, {"kind": "function", "line": 116, "name": "P_MobjThinker", "signature": "void P_MobjThinker (mobj_t* mobj);"}, {"kind": "function", "line": 118, "name": "P_SpawnPuff", "signature": "void P_SpawnPuff (fixed_t x, fixed_t y, fixed_t z);"}, {"kind": "function", "line": 119, "name": "P_SpawnBlood", "signature": "void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, int damage);"}, {"kind": "function", "line": 120, "name": "P_SpawnMissile", "signature": "mobj_t* P_SpawnMissile (mobj_t* source, mobj_t* dest, mobjtype_t type);"}, {"kind": "function", "line": 121, "name": "P_SpawnPlayerMissile", "signature": "void P_SpawnPlayerMissile (mobj_t* source, mobjtype_t type);"}, {"doc": "P_ENEMY", "kind": "function", "line": 127, "name": "P_NoiseAlert", "signature": "void P_NoiseAlert (mobj_t* target, mobj_t* emmiter);"}, {"kind": "function", "line": 162, "name": "P_AproxDistance", "signature": "fixed_t P_AproxDistance (fixed_t dx, fixed_t dy);"}, {"kind": "function", "line": 163, "name": "P_PointOnLineSide", "signature": "int P_PointOnLineSide (fixed_t x, fixed_t y, line_t* line);"}, {"kind": "function", "line": 164, "name": "P_PointOnDivlineSide", "signature": "int P_PointOnDivlineSide (fixed_t x, fixed_t y, divline_t* line);"}, {"kind": "function", "line": 165, "name": "P_MakeDivline", "signature": "void P_MakeDivline (line_t* li, divline_t* dl);"}, {"kind": "function", "line": 166, "name": "P_InterceptVector", "signature": "fixed_t P_InterceptVector (divline_t* v2, divline_t* v1);"}, {"kind": "function", "line": 167, "name": "P_BoxOnLineSide", "signature": "int P_BoxOnLineSide (fixed_t* tmbox, line_t* ld);"}, {"kind": "function", "line": 174, "name": "P_LineOpening", "signature": "void P_LineOpening (line_t* linedef);"}, {"kind": "function", "line": 194, "name": "P_UnsetThingPosition", "signature": "void P_UnsetThingPosition (mobj_t* thing);"}, {"kind": "function", "line": 195, "name": "P_SetThingPosition", "signature": "void P_SetThingPosition (mobj_t* thing);"}, {"kind": "function", "line": 228, "name": "P_SlideMove", "signature": "void P_SlideMove (mobj_t* mo);"}, {"kind": "function", "line": 230, "name": "P_UseLines", "signature": "void P_UseLines (player_t* player);"}, {"kind": "function", "line": 237, "name": "P_AimLineAttack", "signature": "fixed_t P_AimLineAttack ( mobj_t* t1, angle_t angle, fixed_t distance );"}, {"kind": "function", "line": 243, "name": "P_LineAttack", "signature": "void P_LineAttack ( mobj_t* t1, angle_t angle, fixed_t distance, fixed_t slope, int damage );"}, {"kind": "function", "line": 251, "name": "P_RadiusAttack", "signature": "void P_RadiusAttack ( mobj_t* spot, mobj_t* source, int damage );"}, {"kind": "function", "line": 279, "name": "P_TouchSpecialThing", "signature": "void P_TouchSpecialThing ( mobj_t* special, mobj_t* toucher );"}, {"kind": "function", "line": 284, "name": "P_DamageMobj", "signature": "void P_DamageMobj ( mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage );"}, {"doc": "both the head and tail of the thinker list", "kind": "variable", "line": 67, "name": "thinkercap", "signature": "extern thinker_t thinkercap;"}, {"kind": "variable", "line": 98, "name": "itemrespawnque", "signature": "extern mapthing_t itemrespawnque[ITEMQUESIZE];"}, {"kind": "variable", "line": 99, "name": "itemrespawntime", "signature": "extern int itemrespawntime[ITEMQUESIZE];"}, {"kind": "variable", "line": 100, "name": "iquehead", "signature": "extern int iquehead;"}, {"kind": "variable", "line": 101, "name": "iquetail", "signature": "extern int iquetail;"}, {"kind": "variable", "line": 157, "name": "intercepts", "signature": "extern intercept_t intercepts[MAXINTERCEPTS];"}, {"kind": "variable", "line": 158, "name": "intercept_p", "signature": "extern intercept_t* intercept_p;"}, {"kind": "variable", "line": 169, "name": "opentop", "signature": "extern fixed_t opentop;"}, {"kind": "variable", "line": 170, "name": "openbottom", "signature": "extern fixed_t openbottom;"}, {"kind": "variable", "line": 171, "name": "openrange", "signature": "extern fixed_t openrange;"}, {"kind": "variable", "line": 172, "name": "lowfloor", "signature": "extern fixed_t lowfloor;"}, {"kind": "variable", "line": 183, "name": "trace", "signature": "extern divline_t trace;"}, {"doc": "If \"floatok\" true, move would be ok if within \"tmfloorz - tmceilingz\".", "kind": "variable", "line": 204, "name": "floatok", "signature": "extern boolean floatok;"}, {"kind": "variable", "line": 205, "name": "tmfloorz", "signature": "extern fixed_t tmfloorz;"}, {"kind": "variable", "line": 206, "name": "tmceilingz", "signature": "extern fixed_t tmceilingz;"}, {"kind": "variable", "line": 209, "name": "ceilingline", "signature": "extern line_t* ceilingline;"}, {"kind": "variable", "line": 222, "name": "spechit", "signature": "extern line_t* spechit[MAXSPECIALCROSS];"}, {"kind": "variable", "line": 223, "name": "numspechit", "signature": "extern int numspechit;"}, {"kind": "variable", "line": 234, "name": "linetarget", "signature": "extern mobj_t* linetarget;"}, {"doc": "P_SETUP", "kind": "variable", "line": 261, "name": "rejectmatrix", "signature": "extern byte* rejectmatrix;"}, {"kind": "variable", "line": 262, "name": "blockmaplump", "signature": "extern short* blockmaplump;"}, {"kind": "variable", "line": 263, "name": "blockmap", "signature": "extern short* blockmap;"}, {"kind": "variable", "line": 264, "name": "bmapwidth", "signature": "extern int bmapwidth;"}, {"kind": "variable", "line": 265, "name": "bmapheight", "signature": "extern int bmapheight;"}, {"kind": "variable", "line": 266, "name": "bmaporgx", "signature": "extern fixed_t bmaporgx;"}, {"kind": "variable", "line": 267, "name": "bmaporgy", "signature": "extern fixed_t bmaporgy;"}, {"kind": "variable", "line": 268, "name": "blocklinks", "signature": "extern mobj_t** blocklinks;"}, {"doc": "P_INTER", "kind": "variable", "line": 275, "name": "maxammo", "signature": "extern int maxammo[NUMAMMO];"}, {"kind": "variable", "line": 276, "name": "clipammo", "signature": "extern int clipammo[NUMAMMO];"}, {"kind": "macro", "line": 21, "name": "__P_LOCAL__", "signature": "#define __P_LOCAL__"}, {"kind": "macro", "line": 27, "name": "FLOATSPEED", "signature": "#define FLOATSPEED"}, {"kind": "macro", "line": 30, "name": "MAXHEALTH", "signature": "#define MAXHEALTH"}, {"kind": "macro", "line": 31, "name": "VIEWHEIGHT", "signature": "#define VIEWHEIGHT"}, {"kind": "macro", "line": 35, "name": "MAPBLOCKUNITS", "signature": "#define MAPBLOCKUNITS"}, {"kind": "macro", "line": 36, "name": "MAPBLOCKSIZE", "signature": "#define MAPBLOCKSIZE"}, {"kind": "macro", "line": 37, "name": "MAPBLOCKSHIFT", "signature": "#define MAPBLOCKSHIFT"}, {"kind": "macro", "line": 38, "name": "MAPBMASK", "signature": "#define MAPBMASK"}, {"kind": "macro", "line": 39, "name": "MAPBTOFRAC", "signature": "#define MAPBTOFRAC"}, {"kind": "macro", "line": 43, "name": "PLAYERRADIUS", "signature": "#define PLAYERRADIUS"}, {"kind": "macro", "line": 48, "name": "MAXRADIUS", "signature": "#define MAXRADIUS"}, {"kind": "macro", "line": 50, "name": "GRAVITY", "signature": "#define GRAVITY"}, {"kind": "macro", "line": 51, "name": "MAXMOVE", "signature": "#define MAXMOVE"}, {"kind": "macro", "line": 53, "name": "USERANGE", "signature": "#define USERANGE"}, {"kind": "macro", "line": 54, "name": "MELEERANGE", "signature": "#define MELEERANGE"}, {"kind": "macro", "line": 55, "name": "MISSILERANGE", "signature": "#define MISSILERANGE"}, {"kind": "macro", "line": 58, "name": "BASETHRESHOLD", "signature": "#define\tBASETHRESHOLD"}, {"kind": "macro", "line": 92, "name": "ONFLOORZ", "signature": "#define ONFLOORZ"}, {"kind": "macro", "line": 93, "name": "ONCEILINGZ", "signature": "#define ONCEILINGZ"}, {"kind": "macro", "line": 96, "name": "ITEMQUESIZE", "signature": "#define ITEMQUESIZE"}, {"kind": "macro", "line": 154, "name": "MAXINTERCEPTS_ORIGINAL", "signature": "#define MAXINTERCEPTS_ORIGINAL"}, {"kind": "macro", "line": 155, "name": "MAXINTERCEPTS", "signature": "#define MAXINTERCEPTS"}, {"kind": "macro", "line": 179, "name": "PT_ADDLINES", "signature": "#define PT_ADDLINES"}, {"kind": "macro", "line": 180, "name": "PT_ADDTHINGS", "signature": "#define PT_ADDTHINGS"}, {"kind": "macro", "line": 181, "name": "PT_EARLYOUT", "signature": "#define PT_EARLYOUT"}, {"kind": "macro", "line": 219, "name": "MAXSPECIALCROSS", "signature": "#define MAXSPECIALCROSS"}, {"kind": "macro", "line": 220, "name": "MAXSPECIALCROSS_ORIGINAL", "signature": "#define MAXSPECIALCROSS_ORIGINAL"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard, Andrey Budko  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Movement, collision handling. Shooting and aiming.", "id": "progs/doomgeneric/p_map.c", "kind": "module", "label": "p_map.c", "language": "c", "sha256": "adb4c28e3cc2865b", "symbol_count": 24, "symbols": [{"doc": "PIT_StompThing", "kind": "function", "line": 97, "name": "PIT_StompThing", "signature": "boolean PIT_StompThing (mobj_t* thing)"}, {"kind": "function", "line": 131, "name": "P_TeleportMove", "signature": "boolean\nP_TeleportMove\n( mobj_t*\tthing,\n  fixed_t\tx,\n  fixed_t\ty )"}, {"doc": "PIT_CheckLine Adjusts tmfloorz and tmceilingz as lines are contacted", "kind": "function", "line": 206, "name": "PIT_CheckLine", "signature": "boolean PIT_CheckLine (line_t* ld)"}, {"doc": "PIT_CheckThing", "kind": "function", "line": 275, "name": "PIT_CheckThing", "signature": "boolean PIT_CheckThing (mobj_t* thing)"}, {"kind": "function", "line": 402, "name": "P_CheckPosition", "signature": "boolean\nP_CheckPosition\n( mobj_t*\tthing,\n  fixed_t\tx,\n  fixed_t\ty )"}, {"kind": "function", "line": 478, "name": "P_TryMove", "signature": "boolean\nP_TryMove\n( mobj_t*\tthing,\n  fixed_t\tx,\n  fixed_t\ty )"}, {"doc": "P_ThingHeightClip Takes a valid thing and adjusts the thing->floorz, thing->ceilingz, and possibly thing->z. This is called for all nearby monsters whenever a sector changes height. If the thing doesn't fit, the z will be set to the lowest value and false will be returned.", "kind": "function", "line": 557, "name": "P_ThingHeightClip", "signature": "boolean P_ThingHeightClip (mobj_t* thing)"}, {"doc": "P_HitSlideLine Adjusts the xmove / ymove so that the next move will slide along the wall.", "kind": "function", "line": 611, "name": "P_HitSlideLine", "signature": "void P_HitSlideLine (line_t* ld)"}, {"doc": "PTR_SlideTraverse", "kind": "function", "line": 663, "name": "PTR_SlideTraverse", "signature": "boolean PTR_SlideTraverse (intercept_t* in)"}, {"doc": "P_SlideMove The momx / momy move is bad, so try to slide along a wall. Find the first line hit, move flush to it, and slide along it  This is a kludgy mess.", "kind": "function", "line": 722, "name": "P_SlideMove", "signature": "void P_SlideMove (mobj_t* mo)"}, {"kind": "function", "line": 843, "name": "PTR_AimTraverse", "signature": "boolean\nPTR_AimTraverse (intercept_t* in)"}, {"doc": "PTR_ShootTraverse", "kind": "function", "line": 928, "name": "PTR_ShootTraverse", "signature": "boolean PTR_ShootTraverse (intercept_t* in)"}, {"kind": "function", "line": 1068, "name": "P_AimLineAttack", "signature": "fixed_t\nP_AimLineAttack\n( mobj_t*\tt1,\n  angle_t\tangle,\n  fixed_t\tdistance )"}, {"kind": "function", "line": 1110, "name": "P_LineAttack", "signature": "void\nP_LineAttack\n( mobj_t*\tt1,\n  angle_t\tangle,\n  fixed_t\tdistance,\n  fixed_t\tslope,\n  int\t\tdama..."}, {"kind": "function", "line": 1142, "name": "PTR_UseTraverse", "signature": "boolean\tPTR_UseTraverse (intercept_t* in)"}, {"doc": "P_UseLines Looks for special lines in front of the player to activate.", "kind": "function", "line": 1177, "name": "P_UseLines", "signature": "void P_UseLines (player_t*\tplayer)"}, {"doc": "PIT_RadiusAttack \"bombsource\" is the creature that caused the explosion at \"bombspot\".", "kind": "function", "line": 1211, "name": "PIT_RadiusAttack", "signature": "boolean PIT_RadiusAttack (mobj_t* thing)"}, {"kind": "function", "line": 1253, "name": "P_RadiusAttack", "signature": "void\nP_RadiusAttack\n( mobj_t*\tspot,\n  mobj_t*\tsource,\n  int\t\tdamage )"}, {"doc": "PIT_ChangeSector", "kind": "function", "line": 1304, "name": "PIT_ChangeSector", "signature": "boolean PIT_ChangeSector (mobj_t*\tthing)"}, {"kind": "function", "line": 1368, "name": "P_ChangeSector", "signature": "boolean\nP_ChangeSector\n( sector_t*\tsector,\n  boolean\tcrunch )"}, {"kind": "function", "line": 1391, "name": "SpechitOverrun", "signature": "static void SpechitOverrun(line_t *ld)"}, {"doc": "slopes to top and bottom of target", "kind": "variable", "line": 834, "name": "topslope", "signature": "extern fixed_t topslope;"}, {"kind": "variable", "line": 835, "name": "bottomslope", "signature": "extern fixed_t bottomslope;"}, {"kind": "macro", "line": 50, "name": "DEFAULT_SPECHIT_MAGIC", "signature": "#define DEFAULT_SPECHIT_MAGIC"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard Copyright(C) 2005, 2006 Andrey Budko  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Movement/collision utility functions, as used by function in p_map.c. BLOCKMAP Iterator functions, and some PIT_* functions to use for iteration.", "id": "progs/doomgeneric/p_maputl.c", "kind": "module", "label": "p_maputl.c", "language": "c", "sha256": "7a658ce884e66bcc", "symbol_count": 19, "symbols": [{"kind": "struct", "line": 738, "name": "intercepts_overrun_t"}, {"kind": "function", "line": 44, "name": "P_AproxDistance", "signature": "fixed_t\nP_AproxDistance\n( fixed_t\tdx,\n  fixed_t\tdy )"}, {"kind": "function", "line": 61, "name": "P_PointOnLineSide", "signature": "int\nP_PointOnLineSide\n( fixed_t\tx,\n  fixed_t\ty,\n  line_t*\tline )"}, {"kind": "function", "line": 105, "name": "P_BoxOnLineSide", "signature": "int\nP_BoxOnLineSide\n( fixed_t*\ttmbox,\n  line_t*\tld )"}, {"kind": "function", "line": 156, "name": "P_PointOnDivlineSide", "signature": "int\nP_PointOnDivlineSide\n( fixed_t\tx,\n  fixed_t\ty,\n  divline_t*\tline )"}, {"kind": "function", "line": 206, "name": "P_MakeDivline", "signature": "void\nP_MakeDivline\n( line_t*\tli,\n  divline_t*\tdl )"}, {"kind": "function", "line": 226, "name": "P_InterceptVector", "signature": "fixed_t\nP_InterceptVector\n( divline_t*\tv2,\n  divline_t*\tv1 )"}, {"kind": "function", "line": 295, "name": "P_LineOpening", "signature": "void P_LineOpening (line_t* linedef)"}, {"doc": "P_UnsetThingPosition Unlinks a thing from block map and sectors. On each position change, BLOCKMAP and other lookups maintaining lists ot things inside these structures need to be updated.", "kind": "function", "line": 342, "name": "P_UnsetThingPosition", "signature": "void P_UnsetThingPosition (mobj_t* thing)"}, {"kind": "function", "line": 391, "name": "P_SetThingPosition", "signature": "void\nP_SetThingPosition (mobj_t* thing)"}, {"kind": "function", "line": 467, "name": "P_BlockLinesIterator", "signature": "boolean\nP_BlockLinesIterator\n( int\t\t\tx,\n  int\t\t\ty,\n  boolean(*func)(line_t*) )"}, {"kind": "function", "line": 508, "name": "P_BlockThingsIterator", "signature": "boolean\nP_BlockThingsIterator\n( int\t\t\tx,\n  int\t\t\ty,\n  boolean(*func)(mobj_t*) )"}, {"kind": "function", "line": 559, "name": "PIT_AddLineIntercepts", "signature": "boolean\nPIT_AddLineIntercepts (line_t* ld)"}, {"doc": "PIT_AddThingIntercepts", "kind": "function", "line": 614, "name": "PIT_AddThingIntercepts", "signature": "boolean PIT_AddThingIntercepts (mobj_t* thing)"}, {"kind": "function", "line": 682, "name": "P_TraverseIntercepts", "signature": "boolean\nP_TraverseIntercepts\n( traverser_t\tfunc,\n  fixed_t\tmaxfrac )"}, {"kind": "function", "line": 782, "name": "InterceptsMemoryOverrun", "signature": "static void InterceptsMemoryOverrun(int location, int value)"}, {"kind": "function", "line": 827, "name": "InterceptsOverrun", "signature": "static void InterceptsOverrun(int num_intercepts, intercept_t *intercept)"}, {"kind": "function", "line": 861, "name": "P_PathTraverse", "signature": "boolean\nP_PathTraverse\n( fixed_t\t\tx1,\n  fixed_t\t\ty1,\n  fixed_t\t\tx2,\n  fixed_t\t\ty2,\n  int\t\t\tflags,..."}, {"kind": "variable", "line": 731, "name": "bulletslope", "signature": "extern fixed_t bulletslope;"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Moving object handling. Spawn functions.", "id": "progs/doomgeneric/p_mobj.c", "kind": "module", "label": "p_mobj.c", "language": "c", "sha256": "9b7db31b1eec59ce", "symbol_count": 21, "symbols": [{"kind": "function", "line": 48, "name": "P_SetMobjState", "signature": "boolean\nP_SetMobjState\n( mobj_t*\tmobj,\n  statenum_t\tstate )"}, {"doc": "P_ExplodeMissile", "kind": "function", "line": 84, "name": "P_ExplodeMissile", "signature": "void P_ExplodeMissile (mobj_t* mo)"}, {"kind": "function", "line": 108, "name": "P_XYMovement", "signature": "void P_XYMovement (mobj_t* mo)"}, {"doc": "P_ZMovement", "kind": "function", "line": 240, "name": "P_ZMovement", "signature": "void P_ZMovement (mobj_t* mo)"}, {"kind": "function", "line": 383, "name": "P_NightmareRespawn", "signature": "void\nP_NightmareRespawn (mobj_t* mobj)"}, {"doc": "P_MobjThinker", "kind": "function", "line": 441, "name": "P_MobjThinker", "signature": "void P_MobjThinker (mobj_t* mobj)"}, {"kind": "function", "line": 506, "name": "P_SpawnMobj", "signature": "mobj_t*\nP_SpawnMobj\n( fixed_t\tx,\n  fixed_t\ty,\n  fixed_t\tz,\n  mobjtype_t\ttype )"}, {"kind": "function", "line": 572, "name": "P_RemoveMobj", "signature": "void P_RemoveMobj (mobj_t* mobj)"}, {"doc": "P_RespawnSpecials", "kind": "function", "line": 604, "name": "P_RespawnSpecials", "signature": "void P_RespawnSpecials (void)"}, {"doc": "P_SpawnPlayer Called when a player is spawned on the level. Most of the player structure stays unchanged between levels.", "kind": "function", "line": 668, "name": "P_SpawnPlayer", "signature": "void P_SpawnPlayer (mapthing_t* mthing)"}, {"doc": "P_SpawnMapThing The fields of the mapthing should already be in host byte order.", "kind": "function", "line": 739, "name": "P_SpawnMapThing", "signature": "void P_SpawnMapThing (mapthing_t* mthing)"}, {"kind": "function", "line": 851, "name": "P_SpawnPuff", "signature": "void\nP_SpawnPuff\n( fixed_t\tx,\n  fixed_t\ty,\n  fixed_t\tz )"}, {"kind": "function", "line": 878, "name": "P_SpawnBlood", "signature": "void\nP_SpawnBlood\n( fixed_t\tx,\n  fixed_t\ty,\n  fixed_t\tz,\n  int\t\tdamage )"}, {"doc": "P_CheckMissileSpawn Moves the missile forward a bit and possibly explodes it right there.", "kind": "function", "line": 907, "name": "P_CheckMissileSpawn", "signature": "void P_CheckMissileSpawn (mobj_t* th)"}, {"kind": "function", "line": 929, "name": "P_SubstNullMobj", "signature": "mobj_t *P_SubstNullMobj(mobj_t *mobj)"}, {"kind": "function", "line": 950, "name": "P_SpawnMissile", "signature": "mobj_t*\nP_SpawnMissile\n( mobj_t*\tsource,\n  mobj_t*\tdest,\n  mobjtype_t\ttype )"}, {"kind": "function", "line": 996, "name": "P_SpawnPlayerMissile", "signature": "void\nP_SpawnPlayerMissile\n( mobj_t*\tsource,\n  mobjtype_t\ttype )"}, {"kind": "function", "line": 37, "name": "G_PlayerReborn", "signature": "void G_PlayerReborn (int player);"}, {"doc": "P_SpawnPuff", "kind": "variable", "line": 848, "name": "attackrange", "signature": "extern fixed_t attackrange;"}, {"kind": "macro", "line": 105, "name": "STOPSPEED", "signature": "#define STOPSPEED"}, {"kind": "macro", "line": 106, "name": "FRICTION", "signature": "#define FRICTION"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Map Objects, MObj, definition and handling.     Basics.  We need the thinker_t stuff.  We need the WAD data structure for Map things,", "id": "progs/doomgeneric/p_mobj.h", "kind": "module", "label": "p_mobj.h", "language": "h", "sha256": "27a95e4eb63aad70", "symbol_count": 3, "symbols": [{"doc": "Map Object definition.", "kind": "struct", "line": 201, "name": "mobj_s"}, {"doc": "Map Object definition.", "kind": "type_alias", "line": 201, "name": "thinker", "signature": "typedef struct mobj_s { // List: thinker links. thinker_t thinker;"}, {"kind": "macro", "line": 21, "name": "__P_MOBJ__", "signature": "#define __P_MOBJ__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Plats (i.e. elevator platforms) code, raising/lowering.       State.", "id": "progs/doomgeneric/p_plats.c", "kind": "module", "label": "p_plats.c", "language": "c", "sha256": "52e992e53e1e525b", "symbol_count": 6, "symbols": [{"doc": "Move a plat up and down", "kind": "function", "line": 45, "name": "T_PlatRaise", "signature": "void T_PlatRaise(plat_t* plat)"}, {"kind": "function", "line": 129, "name": "EV_DoPlat", "signature": "int\nEV_DoPlat\n( line_t*\tline,\n  plattype_e\ttype,\n  int\t\tamount )"}, {"kind": "function", "line": 248, "name": "P_ActivateInStasis", "signature": "void P_ActivateInStasis(int tag)"}, {"kind": "function", "line": 263, "name": "EV_StopPlat", "signature": "void EV_StopPlat(line_t* line)"}, {"kind": "function", "line": 278, "name": "P_AddActivePlat", "signature": "void P_AddActivePlat(plat_t* plat)"}, {"kind": "function", "line": 291, "name": "P_RemoveActivePlat", "signature": "void P_RemoveActivePlat(plat_t* plat)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Weapon sprite animation, weapon objects. Action functions for weapons.       State.", "id": "progs/doomgeneric/p_pspr.c", "kind": "module", "label": "p_pspr.c", "language": "c", "sha256": "f497aad5e8f74b47", "symbol_count": 35, "symbols": [{"kind": "function", "line": 50, "name": "P_SetPsprite", "signature": "void\nP_SetPsprite\n( player_t*\tplayer,\n  int\t\tposition,\n  statenum_t\tstnum )"}, {"kind": "function", "line": 103, "name": "P_CalcSwing", "signature": "void P_CalcSwing (player_t*\tplayer)"}, {"doc": "P_BringUpWeapon Starts bringing the pending weapon up from the bottom of the screen. Uses player", "kind": "function", "line": 129, "name": "P_BringUpWeapon", "signature": "void P_BringUpWeapon (player_t* player)"}, {"doc": "P_CheckAmmo Returns true if there is enough ammo to shoot. If not, selects the next weapon to use.", "kind": "function", "line": 152, "name": "P_CheckAmmo", "signature": "boolean P_CheckAmmo (player_t* player)"}, {"doc": "P_FireWeapon.", "kind": "function", "line": 237, "name": "P_FireWeapon", "signature": "void P_FireWeapon (player_t* player)"}, {"doc": "P_DropWeapon Player died, so put the weapon away.", "kind": "function", "line": 256, "name": "P_DropWeapon", "signature": "void P_DropWeapon (player_t* player)"}, {"kind": "function", "line": 273, "name": "A_WeaponReady", "signature": "void\nA_WeaponReady\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"doc": "A_ReFire The player can re-fire the weapon without lowering it entirely.", "kind": "function", "line": 334, "name": "A_ReFire", "signature": "void A_ReFire\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 357, "name": "A_CheckReload", "signature": "void\nA_CheckReload\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 376, "name": "A_Lower", "signature": "void\nA_Lower\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 414, "name": "A_Raise", "signature": "void\nA_Raise\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 440, "name": "A_GunFlash", "signature": "void\nA_GunFlash\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 459, "name": "A_Punch", "signature": "void\nA_Punch\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 493, "name": "A_Saw", "signature": "void\nA_Saw\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 542, "name": "DecreaseAmmo", "signature": "static void DecreaseAmmo(player_t *player, int ammonum, int amount)"}, {"kind": "function", "line": 559, "name": "A_FireMissile", "signature": "void\nA_FireMissile\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 572, "name": "A_FireBFG", "signature": "void\nA_FireBFG\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 587, "name": "A_FirePlasma", "signature": "void\nA_FirePlasma\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 610, "name": "P_BulletSlope", "signature": "void P_BulletSlope (mobj_t*\tmo)"}, {"kind": "function", "line": 635, "name": "P_GunShot", "signature": "void\nP_GunShot\n( mobj_t*\tmo,\n  boolean\taccurate )"}, {"kind": "function", "line": 656, "name": "A_FirePistol", "signature": "void\nA_FirePistol\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 678, "name": "A_FireShotgun", "signature": "void\nA_FireShotgun\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 705, "name": "A_FireShotgun2", "signature": "void\nA_FireShotgun2\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"kind": "function", "line": 742, "name": "A_FireCGun", "signature": "void\nA_FireCGun\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"doc": "?", "kind": "function", "line": 770, "name": "A_Light0", "signature": "void A_Light0 (player_t *player, pspdef_t *psp)"}, {"kind": "function", "line": 775, "name": "A_Light1", "signature": "void A_Light1 (player_t *player, pspdef_t *psp)"}, {"kind": "function", "line": 780, "name": "A_Light2", "signature": "void A_Light2 (player_t *player, pspdef_t *psp)"}, {"doc": "A_BFGSpray Spawn a BFG explosion on every monster in view", "kind": "function", "line": 790, "name": "A_BFGSpray", "signature": "void A_BFGSpray (mobj_t* mo)"}, {"kind": "function", "line": 827, "name": "A_BFGsound", "signature": "void\nA_BFGsound\n( player_t*\tplayer,\n  pspdef_t*\tpsp )"}, {"doc": "P_SetupPsprites Called at start of level for each player.", "kind": "function", "line": 840, "name": "P_SetupPsprites", "signature": "void P_SetupPsprites (player_t* player)"}, {"doc": "P_MovePsprites Called every tic by player thinking routine.", "kind": "function", "line": 860, "name": "P_MovePsprites", "signature": "void P_MovePsprites (player_t* player)"}, {"kind": "macro", "line": 38, "name": "LOWERSPEED", "signature": "#define LOWERSPEED"}, {"kind": "macro", "line": 39, "name": "RAISESPEED", "signature": "#define RAISESPEED"}, {"kind": "macro", "line": 41, "name": "WEAPONBOTTOM", "signature": "#define WEAPONBOTTOM"}, {"kind": "macro", "line": 42, "name": "WEAPONTOP", "signature": "#define WEAPONTOP"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Sprite animation.     Basic data types. Needs fixed point, and BAM angles.    Needs to include the precompiled", "id": "progs/doomgeneric/p_pspr.h", "kind": "module", "label": "p_pspr.h", "language": "h", "sha256": "5af811131d25f49f", "symbol_count": 4, "symbols": [{"kind": "struct", "line": 62, "name": "pspdef_t"}, {"kind": "macro", "line": 21, "name": "__P_PSPR__", "signature": "#define __P_PSPR__"}, {"kind": "macro", "line": 44, "name": "FF_FULLBRIGHT", "signature": "#define FF_FULLBRIGHT"}, {"kind": "macro", "line": 45, "name": "FF_FRAMEMASK", "signature": "#define FF_FRAMEMASK"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Archiving: SaveGame I/O.      State.", "id": "progs/doomgeneric/p_saveg.c", "kind": "module", "label": "p_saveg.c", "language": "c", "sha256": "00523068acd9def9", "symbol_count": 58, "symbols": [{"kind": "function", "line": 47, "name": "P_TempSaveGameFile", "signature": "char *P_TempSaveGameFile(void)"}, {"kind": "function", "line": 61, "name": "P_SaveGameFile", "signature": "char *P_SaveGameFile(int slot)"}, {"kind": "function", "line": 81, "name": "saveg_read8", "signature": "static byte saveg_read8(void)"}, {"kind": "function", "line": 99, "name": "saveg_write8", "signature": "static void saveg_write8(byte value)"}, {"kind": "function", "line": 112, "name": "saveg_read16", "signature": "static short saveg_read16(void)"}, {"kind": "function", "line": 122, "name": "saveg_write16", "signature": "static void saveg_write16(short value)"}, {"kind": "function", "line": 128, "name": "saveg_read32", "signature": "static int saveg_read32(void)"}, {"kind": "function", "line": 140, "name": "saveg_write32", "signature": "static void saveg_write32(int value)"}, {"kind": "function", "line": 150, "name": "saveg_read_pad", "signature": "static void saveg_read_pad(void)"}, {"kind": "function", "line": 166, "name": "saveg_write_pad", "signature": "static void saveg_write_pad(void)"}, {"kind": "function", "line": 185, "name": "saveg_readp", "signature": "static void *saveg_readp(void)"}, {"kind": "function", "line": 190, "name": "saveg_writep", "signature": "static void saveg_writep(void *p)"}, {"kind": "function", "line": 208, "name": "saveg_read_mapthing_t", "signature": "static void saveg_read_mapthing_t(mapthing_t *str)"}, {"kind": "function", "line": 226, "name": "saveg_write_mapthing_t", "signature": "static void saveg_write_mapthing_t(mapthing_t *str)"}, {"kind": "function", "line": 248, "name": "saveg_read_actionf_t", "signature": "static void saveg_read_actionf_t(actionf_t *str)"}, {"kind": "function", "line": 254, "name": "saveg_write_actionf_t", "signature": "static void saveg_write_actionf_t(actionf_t *str)"}, {"kind": "function", "line": 273, "name": "saveg_read_thinker_t", "signature": "static void saveg_read_thinker_t(thinker_t *str)"}, {"kind": "function", "line": 285, "name": "saveg_write_thinker_t", "signature": "static void saveg_write_thinker_t(thinker_t *str)"}, {"kind": "function", "line": 301, "name": "saveg_read_mobj_t", "signature": "static void saveg_read_mobj_t(mobj_t *str)"}, {"kind": "function", "line": 421, "name": "saveg_write_mobj_t", "signature": "static void saveg_write_mobj_t(mobj_t *str)"}, {"kind": "function", "line": 541, "name": "saveg_read_ticcmd_t", "signature": "static void saveg_read_ticcmd_t(ticcmd_t *str)"}, {"kind": "function", "line": 563, "name": "saveg_write_ticcmd_t", "signature": "static void saveg_write_ticcmd_t(ticcmd_t *str)"}, {"kind": "function", "line": 589, "name": "saveg_read_pspdef_t", "signature": "static void saveg_read_pspdef_t(pspdef_t *str)"}, {"kind": "function", "line": 615, "name": "saveg_write_pspdef_t", "signature": "static void saveg_write_pspdef_t(pspdef_t *str)"}, {"kind": "function", "line": 641, "name": "saveg_read_player_t", "signature": "static void saveg_read_player_t(player_t *str)"}, {"kind": "function", "line": 772, "name": "saveg_write_player_t", "signature": "static void saveg_write_player_t(player_t *str)"}, {"kind": "function", "line": 908, "name": "saveg_read_ceiling_t", "signature": "static void saveg_read_ceiling_t(ceiling_t *str)"}, {"kind": "function", "line": 944, "name": "saveg_write_ceiling_t", "signature": "static void saveg_write_ceiling_t(ceiling_t *str)"}, {"kind": "function", "line": 981, "name": "saveg_read_vldoor_t", "signature": "static void saveg_read_vldoor_t(vldoor_t *str)"}, {"kind": "function", "line": 1011, "name": "saveg_write_vldoor_t", "signature": "static void saveg_write_vldoor_t(vldoor_t *str)"}, {"kind": "function", "line": 1042, "name": "saveg_read_floormove_t", "signature": "static void saveg_read_floormove_t(floormove_t *str)"}, {"kind": "function", "line": 1075, "name": "saveg_write_floormove_t", "signature": "static void saveg_write_floormove_t(floormove_t *str)"}, {"kind": "function", "line": 1109, "name": "saveg_read_plat_t", "signature": "static void saveg_read_plat_t(plat_t *str)"}, {"kind": "function", "line": 1151, "name": "saveg_write_plat_t", "signature": "static void saveg_write_plat_t(plat_t *str)"}, {"kind": "function", "line": 1194, "name": "saveg_read_lightflash_t", "signature": "static void saveg_read_lightflash_t(lightflash_t *str)"}, {"kind": "function", "line": 1221, "name": "saveg_write_lightflash_t", "signature": "static void saveg_write_lightflash_t(lightflash_t *str)"}, {"kind": "function", "line": 1249, "name": "saveg_read_strobe_t", "signature": "static void saveg_read_strobe_t(strobe_t *str)"}, {"kind": "function", "line": 1276, "name": "saveg_write_strobe_t", "signature": "static void saveg_write_strobe_t(strobe_t *str)"}, {"kind": "function", "line": 1304, "name": "saveg_read_glow_t", "signature": "static void saveg_read_glow_t(glow_t *str)"}, {"kind": "function", "line": 1325, "name": "saveg_write_glow_t", "signature": "static void saveg_write_glow_t(glow_t *str)"}, {"kind": "function", "line": 1347, "name": "P_WriteSaveGameHeader", "signature": "void P_WriteSaveGameHeader(char *description)"}, {"kind": "function", "line": 1379, "name": "P_ReadSaveGameHeader", "signature": "boolean P_ReadSaveGameHeader(void)"}, {"kind": "function", "line": 1419, "name": "P_ReadSaveGameEOF", "signature": "boolean P_ReadSaveGameEOF(void)"}, {"kind": "function", "line": 1432, "name": "P_WriteSaveGameEOF", "signature": "void P_WriteSaveGameEOF(void)"}, {"doc": "P_ArchivePlayers", "kind": "function", "line": 1440, "name": "P_ArchivePlayers", "signature": "void P_ArchivePlayers (void)"}, {"doc": "P_UnArchivePlayers", "kind": "function", "line": 1460, "name": "P_UnArchivePlayers", "signature": "void P_UnArchivePlayers (void)"}, {"doc": "P_ArchiveWorld", "kind": "function", "line": 1484, "name": "P_ArchiveWorld", "signature": "void P_ArchiveWorld (void)"}, {"doc": "P_UnArchiveWorld", "kind": "function", "line": 1532, "name": "P_UnArchiveWorld", "signature": "void P_UnArchiveWorld (void)"}, {"doc": "P_ArchiveThinkers", "kind": "function", "line": 1592, "name": "P_ArchiveThinkers", "signature": "void P_ArchiveThinkers (void)"}, {"doc": "P_UnArchiveThinkers", "kind": "function", "line": 1620, "name": "P_UnArchiveThinkers", "signature": "void P_UnArchiveThinkers (void)"}, {"doc": "Things to handle:  T_MoveCeiling, (ceiling_t: sector_t * swizzle), - active list T_VerticalDoor, (vldoor_t: sector_t * swizzle), T_MoveFloor, (floormove_t: sector_t * swizzle), T_LightFlash, (lightflash_t: sector_t * swizzle), T_StrobeFlash, (strobe_t: sector_t *), T_Glow, (glow_t: sector_t *), T_PlatRaise, (plat_t: sector_t *), - active list", "kind": "function", "line": 1704, "name": "P_ArchiveSpecials", "signature": "void P_ArchiveSpecials (void)"}, {"doc": "P_UnArchiveSpecials", "kind": "function", "line": 1793, "name": "P_UnArchiveSpecials", "signature": "void P_UnArchiveSpecials (void)"}, {"kind": "macro", "line": 36, "name": "SAVEGAME_EOF", "signature": "#define SAVEGAME_EOF"}, {"kind": "macro", "line": 37, "name": "VERSIONSIZE", "signature": "#define VERSIONSIZE"}, {"kind": "macro", "line": 197, "name": "saveg_read_enum", "signature": "#define saveg_read_enum"}, {"kind": "macro", "line": 198, "name": "saveg_write_enum", "signature": "#define saveg_write_enum"}, {"kind": "macro", "line": 266, "name": "saveg_read_think_t", "signature": "#define saveg_read_think_t"}, {"kind": "macro", "line": 267, "name": "saveg_write_think_t", "signature": "#define saveg_write_think_t"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Savegame I/O, archiving, persistence.      maximum size of a savegame description   temporary filename to use while saving.", "id": "progs/doomgeneric/p_saveg.h", "kind": "module", "label": "p_saveg.h", "language": "h", "sha256": "b4fdcf80f0306af9", "symbol_count": 16, "symbols": [{"kind": "function", "line": 31, "name": "P_TempSaveGameFile", "signature": "char *P_TempSaveGameFile(void);"}, {"kind": "function", "line": 35, "name": "P_SaveGameFile", "signature": "char *P_SaveGameFile(int slot);"}, {"kind": "function", "line": 40, "name": "P_WriteSaveGameHeader", "signature": "void P_WriteSaveGameHeader(char *description);"}, {"kind": "function", "line": 45, "name": "P_WriteSaveGameEOF", "signature": "void P_WriteSaveGameEOF(void);"}, {"doc": "Persistent storage/archiving. These are the load / save game routines.", "kind": "function", "line": 49, "name": "P_ArchivePlayers", "signature": "void P_ArchivePlayers (void);"}, {"kind": "function", "line": 50, "name": "P_UnArchivePlayers", "signature": "void P_UnArchivePlayers (void);"}, {"kind": "function", "line": 51, "name": "P_ArchiveWorld", "signature": "void P_ArchiveWorld (void);"}, {"kind": "function", "line": 52, "name": "P_UnArchiveWorld", "signature": "void P_UnArchiveWorld (void);"}, {"kind": "function", "line": 53, "name": "P_ArchiveThinkers", "signature": "void P_ArchiveThinkers (void);"}, {"kind": "function", "line": 54, "name": "P_UnArchiveThinkers", "signature": "void P_UnArchiveThinkers (void);"}, {"kind": "function", "line": 55, "name": "P_ArchiveSpecials", "signature": "void P_ArchiveSpecials (void);"}, {"kind": "function", "line": 56, "name": "P_UnArchiveSpecials", "signature": "void P_UnArchiveSpecials (void);"}, {"kind": "variable", "line": 58, "name": "save_stream", "signature": "extern FILE *save_stream;"}, {"kind": "variable", "line": 59, "name": "savegame_error", "signature": "extern boolean savegame_error;"}, {"kind": "macro", "line": 21, "name": "__P_SAVEG__", "signature": "#define __P_SAVEG__"}, {"kind": "macro", "line": 27, "name": "SAVESTRINGSIZE", "signature": "#define SAVESTRINGSIZE"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Do all the WAD I/O, get map description, set up initial state and misc. LUTs.", "id": "progs/doomgeneric/p_setup.c", "kind": "module", "label": "p_setup.c", "language": "c", "sha256": "4486a198649812b5", "symbol_count": 17, "symbols": [{"doc": "P_LoadVertexes", "kind": "function", "line": 118, "name": "P_LoadVertexes", "signature": "void P_LoadVertexes (int lump)"}, {"doc": "GetSectorAtNullAddress", "kind": "function", "line": 153, "name": "GetSectorAtNullAddress", "signature": "sector_t* GetSectorAtNullAddress(void)"}, {"doc": "P_LoadSegs", "kind": "function", "line": 172, "name": "P_LoadSegs", "signature": "void P_LoadSegs (int lump)"}, {"doc": "P_LoadSubsectors", "kind": "function", "line": 236, "name": "P_LoadSubsectors", "signature": "void P_LoadSubsectors (int lump)"}, {"doc": "P_LoadSectors", "kind": "function", "line": 265, "name": "P_LoadSectors", "signature": "void P_LoadSectors (int lump)"}, {"doc": "P_LoadNodes", "kind": "function", "line": 298, "name": "P_LoadNodes", "signature": "void P_LoadNodes (int lump)"}, {"doc": "P_LoadThings", "kind": "function", "line": 335, "name": "P_LoadThings", "signature": "void P_LoadThings (int lump)"}, {"doc": "P_LoadLineDefs Also counts secret lines for intermissions.", "kind": "function", "line": 392, "name": "P_LoadLineDefs", "signature": "void P_LoadLineDefs (int lump)"}, {"doc": "P_LoadSideDefs", "kind": "function", "line": 473, "name": "P_LoadSideDefs", "signature": "void P_LoadSideDefs (int lump)"}, {"doc": "P_LoadBlockMap", "kind": "function", "line": 504, "name": "P_LoadBlockMap", "signature": "void P_LoadBlockMap (int lump)"}, {"doc": "P_GroupLines Builds sector line lists and subsector sector numbers. Finds block bounding boxes for sectors.", "kind": "function", "line": 545, "name": "P_GroupLines", "signature": "void P_GroupLines (void)"}, {"kind": "function", "line": 661, "name": "PadRejectArray", "signature": "static void PadRejectArray(byte *array, unsigned int len)"}, {"kind": "function", "line": 712, "name": "P_LoadReject", "signature": "static void P_LoadReject(int lumpnum)"}, {"kind": "function", "line": 744, "name": "P_SetupLevel", "signature": "void\nP_SetupLevel\n( int\t\tepisode,\n  int\t\tmap,\n  int\t\tplayermask,\n  skill_t\tskill)"}, {"doc": "P_Init", "kind": "function", "line": 847, "name": "P_Init", "signature": "void P_Init (void)"}, {"kind": "function", "line": 44, "name": "P_SpawnMapThing", "signature": "void P_SpawnMapThing (mapthing_t* mthing);"}, {"kind": "macro", "line": 105, "name": "MAX_DEATHMATCH_STARTS", "signature": "#define MAX_DEATHMATCH_STARTS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Setup a game, startup stuff.        NOT called by W_Ticker. Fixme.", "id": "progs/doomgeneric/p_setup.h", "kind": "module", "label": "p_setup.h", "language": "h", "sha256": "5871b9df523ebaf2", "symbol_count": 3, "symbols": [{"kind": "function", "line": 28, "name": "P_SetupLevel", "signature": "void P_SetupLevel ( int episode, int map, int playermask, skill_t skill);"}, {"doc": "Called by startup code.", "kind": "function", "line": 35, "name": "P_Init", "signature": "void P_Init (void);"}, {"kind": "macro", "line": 21, "name": "__P_SETUP__", "signature": "#define __P_SETUP__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: LineOfSight/Visibility checks, uses REJECT Lookup Table.       State.   P_CheckSight", "id": "progs/doomgeneric/p_sight.c", "kind": "module", "label": "p_sight.c", "language": "c", "sha256": "27f0186b350cf627", "symbol_count": 5, "symbols": [{"kind": "function", "line": 48, "name": "P_DivlineSide", "signature": "int\nP_DivlineSide\n( fixed_t\tx,\n  fixed_t\ty,\n  divline_t*\tnode )"}, {"kind": "function", "line": 102, "name": "P_InterceptVector2", "signature": "fixed_t\nP_InterceptVector2\n( divline_t*\tv2,\n  divline_t*\tv1 )"}, {"doc": "P_CrossSubsector Returns true if strace crosses the given subsector successfully.", "kind": "function", "line": 128, "name": "P_CrossSubsector", "signature": "boolean P_CrossSubsector (int num)"}, {"doc": "P_CrossBSPNode Returns true if strace crosses the given node successfully.", "kind": "function", "line": 258, "name": "P_CrossBSPNode", "signature": "boolean P_CrossBSPNode (int bspnum)"}, {"kind": "function", "line": 301, "name": "P_CheckSight", "signature": "boolean\nP_CheckSight\n( mobj_t*\tt1,\n  mobj_t*\tt2 )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Implements special effects: Texture animation, height or lighting changes according to adjacent sectors, respective utility functions, etc. Line Tag handling. Line and Sector triggers.", "id": "progs/doomgeneric/p_spec.c", "kind": "module", "label": "p_spec.c", "language": "c", "sha256": "96eb670d56dbb742", "symbol_count": 31, "symbols": [{"doc": "Animating textures and planes There is another anim_t used in wi_stuff, unrelated.", "kind": "struct", "line": 55, "name": "anim_t"}, {"doc": "source animation definition", "kind": "struct", "line": 68, "name": "animdef_t"}, {"kind": "function", "line": 143, "name": "P_InitPicAnims", "signature": "void P_InitPicAnims (void)"}, {"kind": "function", "line": 203, "name": "getSide", "signature": "side_t*\ngetSide\n( int\t\tcurrentSector,\n  int\t\tline,\n  int\t\tside )"}, {"kind": "function", "line": 219, "name": "getSector", "signature": "sector_t*\ngetSector\n( int\t\tcurrentSector,\n  int\t\tline,\n  int\t\tside )"}, {"kind": "function", "line": 234, "name": "twoSided", "signature": "int\ntwoSided\n( int\tsector,\n  int\tline )"}, {"kind": "function", "line": 250, "name": "getNextSector", "signature": "sector_t*\ngetNextSector\n( line_t*\tline,\n  sector_t*\tsec )"}, {"doc": "P_FindLowestFloorSurrounding() FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS", "kind": "function", "line": 269, "name": "P_FindLowestFloorSurrounding", "signature": "fixed_t\tP_FindLowestFloorSurrounding(sector_t* sec)"}, {"doc": "P_FindHighestFloorSurrounding() FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS", "kind": "function", "line": 296, "name": "P_FindHighestFloorSurrounding", "signature": "fixed_t\tP_FindHighestFloorSurrounding(sector_t *sec)"}, {"kind": "function", "line": 330, "name": "P_FindNextHighestFloor", "signature": "fixed_t\nP_FindNextHighestFloor\n( sector_t* sec,\n  int       currentheight )"}, {"kind": "function", "line": 392, "name": "P_FindLowestCeilingSurrounding", "signature": "fixed_t\nP_FindLowestCeilingSurrounding(sector_t* sec)"}, {"doc": "FIND HIGHEST CEILING IN THE SURROUNDING SECTORS", "kind": "function", "line": 417, "name": "P_FindHighestCeilingSurrounding", "signature": "fixed_t\tP_FindHighestCeilingSurrounding(sector_t* sec)"}, {"kind": "function", "line": 444, "name": "P_FindSectorFromLineTag", "signature": "int\nP_FindSectorFromLineTag\n( line_t*\tline,\n  int\t\tstart )"}, {"kind": "function", "line": 464, "name": "P_FindMinSurroundingLight", "signature": "int\nP_FindMinSurroundingLight\n( sector_t*\tsector,\n  int\t\tmax )"}, {"kind": "function", "line": 502, "name": "P_CrossSpecialLine", "signature": "void\nP_CrossSpecialLine\n( int\t\tlinenum,\n  int\t\tside,\n  mobj_t*\tthing )"}, {"kind": "function", "line": 969, "name": "P_ShootSpecialLine", "signature": "void\nP_ShootSpecialLine\n( mobj_t*\tthing,\n  line_t*\tline )"}, {"doc": "P_PlayerInSpecialSector Called every tic frame that the player origin is in a special sector", "kind": "function", "line": 1019, "name": "P_PlayerInSpecialSector", "signature": "void P_PlayerInSpecialSector (player_t* player)"}, {"kind": "function", "line": 1093, "name": "P_UpdateSpecials", "signature": "void P_UpdateSpecials (void)"}, {"kind": "function", "line": 1178, "name": "DonutOverrun", "signature": "static void DonutOverrun(fixed_t *s3_floorheight, short *s3_floorpic,\n                         li..."}, {"doc": "Special Stuff that can not be categorized", "kind": "function", "line": 1257, "name": "EV_DoDonut", "signature": "int EV_DoDonut(line_t*\tline)"}, {"doc": "Parses command line parameters.", "kind": "function", "line": 1374, "name": "P_SpawnSpecials", "signature": "void P_SpawnSpecials (void)"}, {"kind": "variable", "line": 80, "name": "anims", "signature": "extern anim_t anims[MAXANIMS];"}, {"kind": "variable", "line": 81, "name": "lastanim", "signature": "extern anim_t* lastanim;"}, {"kind": "variable", "line": 138, "name": "numlinespecials", "signature": "extern short numlinespecials;"}, {"kind": "variable", "line": 139, "name": "linespeciallist", "signature": "extern line_t* linespeciallist[MAXLINEANIMS];"}, {"kind": "variable", "line": 1185, "name": "numflats", "signature": "extern int numflats;"}, {"kind": "macro", "line": 78, "name": "MAXANIMS", "signature": "#define MAXANIMS"}, {"kind": "macro", "line": 136, "name": "MAXLINEANIMS", "signature": "#define MAXLINEANIMS"}, {"kind": "macro", "line": 327, "name": "MAX_ADJOINING_SECTORS", "signature": "#define MAX_ADJOINING_SECTORS"}, {"kind": "macro", "line": 1175, "name": "DONUT_FLOORHEIGHT_DEFAULT", "signature": "#define DONUT_FLOORHEIGHT_DEFAULT"}, {"kind": "macro", "line": 1176, "name": "DONUT_FLOORPIC_DEFAULT", "signature": "#define DONUT_FLOORPIC_DEFAULT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none Implements special effects: Texture animation, height or lighting changes according to adjacent sectors, respective utility functions, etc.       End-level timer (-TIMER option)", "id": "progs/doomgeneric/p_spec.h", "kind": "module", "label": "p_spec.h", "language": "h", "sha256": "226e08c902850db2", "symbol_count": 94, "symbols": [{"doc": "P_LIGHTS", "kind": "struct", "line": 121, "name": "fireflicker_t"}, {"kind": "struct", "line": 133, "name": "lightflash_t"}, {"kind": "struct", "line": 147, "name": "strobe_t"}, {"kind": "struct", "line": 162, "name": "glow_t"}, {"doc": "P_SWITCH", "kind": "struct", "line": 206, "name": "switchlist_t"}, {"kind": "struct", "line": 224, "name": "button_t"}, {"kind": "struct", "line": 282, "name": "plat_t"}, {"kind": "struct", "line": 340, "name": "vldoor_t"}, {"kind": "struct", "line": 415, "name": "slidedoor_t"}, {"kind": "struct", "line": 431, "name": "slidename_t"}, {"kind": "struct", "line": 446, "name": "slideframe_t"}, {"kind": "struct", "line": 490, "name": "ceiling_t"}, {"kind": "struct", "line": 581, "name": "floormove_t"}, {"doc": "at game start", "kind": "function", "line": 39, "name": "P_InitPicAnims", "signature": "void P_InitPicAnims (void);"}, {"doc": "at map load", "kind": "function", "line": 42, "name": "P_SpawnSpecials", "signature": "void P_SpawnSpecials (void);"}, {"doc": "every tic", "kind": "function", "line": 45, "name": "P_UpdateSpecials", "signature": "void P_UpdateSpecials (void);"}, {"kind": "function", "line": 55, "name": "P_ShootSpecialLine", "signature": "void P_ShootSpecialLine ( mobj_t* thing, line_t* line );"}, {"kind": "function", "line": 60, "name": "P_CrossSpecialLine", "signature": "void P_CrossSpecialLine ( int linenum, int side, mobj_t* thing );"}, {"kind": "function", "line": 65, "name": "P_PlayerInSpecialSector", "signature": "void P_PlayerInSpecialSector (player_t* player);"}, {"kind": "function", "line": 68, "name": "twoSided", "signature": "int twoSided ( int sector, int line );"}, {"kind": "function", "line": 73, "name": "getSector", "signature": "sector_t* getSector ( int currentSector, int line, int side );"}, {"kind": "function", "line": 79, "name": "getSide", "signature": "side_t* getSide ( int currentSector, int line, int side );"}, {"kind": "function", "line": 84, "name": "P_FindLowestFloorSurrounding", "signature": "fixed_t P_FindLowestFloorSurrounding(sector_t* sec);"}, {"kind": "function", "line": 85, "name": "P_FindHighestFloorSurrounding", "signature": "fixed_t P_FindHighestFloorSurrounding(sector_t* sec);"}, {"kind": "function", "line": 88, "name": "P_FindNextHighestFloor", "signature": "fixed_t P_FindNextHighestFloor ( sector_t* sec, int currentheight );"}, {"kind": "function", "line": 92, "name": "P_FindLowestCeilingSurrounding", "signature": "fixed_t P_FindLowestCeilingSurrounding(sector_t* sec);"}, {"kind": "function", "line": 93, "name": "P_FindHighestCeilingSurrounding", "signature": "fixed_t P_FindHighestCeilingSurrounding(sector_t* sec);"}, {"kind": "function", "line": 96, "name": "P_FindSectorFromLineTag", "signature": "int P_FindSectorFromLineTag ( line_t* line, int start );"}, {"kind": "function", "line": 101, "name": "P_FindMinSurroundingLight", "signature": "int P_FindMinSurroundingLight ( sector_t* sector, int max );"}, {"kind": "function", "line": 106, "name": "getNextSector", "signature": "sector_t* getNextSector ( line_t* line, sector_t* sec );"}, {"doc": "SPECIAL", "kind": "function", "line": 114, "name": "EV_DoDonut", "signature": "int EV_DoDonut(line_t* line);"}, {"kind": "function", "line": 178, "name": "P_SpawnFireFlicker", "signature": "void P_SpawnFireFlicker (sector_t* sector);"}, {"kind": "function", "line": 179, "name": "T_LightFlash", "signature": "void T_LightFlash (lightflash_t* flash);"}, {"kind": "function", "line": 180, "name": "P_SpawnLightFlash", "signature": "void P_SpawnLightFlash (sector_t* sector);"}, {"kind": "function", "line": 181, "name": "T_StrobeFlash", "signature": "void T_StrobeFlash (strobe_t* flash);"}, {"kind": "function", "line": 184, "name": "P_SpawnStrobeFlash", "signature": "void P_SpawnStrobeFlash ( sector_t* sector, int fastOrSlow, int inSync );"}, {"kind": "function", "line": 189, "name": "EV_StartLightStrobing", "signature": "void EV_StartLightStrobing(line_t* line);"}, {"kind": "function", "line": 190, "name": "EV_TurnTagLightsOff", "signature": "void EV_TurnTagLightsOff(line_t* line);"}, {"kind": "function", "line": 193, "name": "EV_LightTurnOn", "signature": "void EV_LightTurnOn ( line_t* line, int bright );"}, {"kind": "function", "line": 197, "name": "T_Glow", "signature": "void T_Glow(glow_t* g);"}, {"kind": "function", "line": 198, "name": "P_SpawnGlowingLight", "signature": "void P_SpawnGlowingLight(sector_t* sector);"}, {"kind": "function", "line": 249, "name": "P_ChangeSwitchTexture", "signature": "void P_ChangeSwitchTexture ( line_t* line, int useAgain );"}, {"kind": "function", "line": 253, "name": "P_InitSwitchList", "signature": "void P_InitSwitchList(void);"}, {"kind": "function", "line": 308, "name": "T_PlatRaise", "signature": "void T_PlatRaise(plat_t* plat);"}, {"kind": "function", "line": 311, "name": "EV_DoPlat", "signature": "int EV_DoPlat ( line_t* line, plattype_e type, int amount );"}, {"kind": "function", "line": 316, "name": "P_AddActivePlat", "signature": "void P_AddActivePlat(plat_t* plat);"}, {"kind": "function", "line": 317, "name": "P_RemoveActivePlat", "signature": "void P_RemoveActivePlat(plat_t* plat);"}, {"kind": "function", "line": 318, "name": "EV_StopPlat", "signature": "void EV_StopPlat(line_t* line);"}, {"kind": "function", "line": 319, "name": "P_ActivateInStasis", "signature": "void P_ActivateInStasis(int tag);"}, {"kind": "function", "line": 365, "name": "EV_VerticalDoor", "signature": "void EV_VerticalDoor ( line_t* line, mobj_t* thing );"}, {"kind": "function", "line": 370, "name": "EV_DoDoor", "signature": "int EV_DoDoor ( line_t* line, vldoor_e type );"}, {"kind": "function", "line": 375, "name": "EV_DoLockedDoor", "signature": "int EV_DoLockedDoor ( line_t* line, vldoor_e type, mobj_t* thing );"}, {"kind": "function", "line": 380, "name": "T_VerticalDoor", "signature": "void T_VerticalDoor (vldoor_t* door);"}, {"kind": "function", "line": 381, "name": "P_SpawnDoorCloseIn30", "signature": "void P_SpawnDoorCloseIn30 (sector_t* sec);"}, {"kind": "function", "line": 384, "name": "P_SpawnDoorRaiseIn5Mins", "signature": "void P_SpawnDoorRaiseIn5Mins ( sector_t* sec, int secnum );"}, {"kind": "function", "line": 464, "name": "P_InitSlidingDoorFrames", "signature": "void P_InitSlidingDoorFrames(void);"}, {"kind": "function", "line": 467, "name": "EV_SlidingDoor", "signature": "void EV_SlidingDoor ( line_t* line, mobj_t* thing );"}, {"kind": "function", "line": 520, "name": "EV_DoCeiling", "signature": "int EV_DoCeiling ( line_t* line, ceiling_e type );"}, {"kind": "function", "line": 524, "name": "T_MoveCeiling", "signature": "void T_MoveCeiling (ceiling_t* ceiling);"}, {"kind": "function", "line": 525, "name": "P_AddActiveCeiling", "signature": "void P_AddActiveCeiling(ceiling_t* c);"}, {"kind": "function", "line": 526, "name": "P_RemoveActiveCeiling", "signature": "void P_RemoveActiveCeiling(ceiling_t* c);"}, {"kind": "function", "line": 527, "name": "EV_CeilingCrushStop", "signature": "int EV_CeilingCrushStop(line_t* line);"}, {"kind": "function", "line": 528, "name": "P_ActivateInStasisCeiling", "signature": "void P_ActivateInStasisCeiling(line_t* line);"}, {"kind": "function", "line": 617, "name": "EV_BuildStairs", "signature": "int EV_BuildStairs ( line_t* line, stair_e type );"}, {"kind": "function", "line": 622, "name": "EV_DoFloor", "signature": "int EV_DoFloor ( line_t* line, floor_e floortype );"}, {"kind": "function", "line": 626, "name": "T_MoveFloor", "signature": "void T_MoveFloor( floormove_t* floor);"}, {"kind": "function", "line": 632, "name": "EV_Teleport", "signature": "int EV_Teleport ( line_t* line, int side, mobj_t* thing );"}, {"doc": "End-level timer (-TIMER option)", "kind": "variable", "line": 30, "name": "levelTimer", "signature": "extern boolean levelTimer;"}, {"kind": "variable", "line": 31, "name": "levelTimeCount", "signature": "extern int levelTimeCount;"}, {"kind": "variable", "line": 246, "name": "buttonlist", "signature": "extern button_t buttonlist[MAXBUTTONS];"}, {"kind": "variable", "line": 306, "name": "activeplats", "signature": "extern plat_t* activeplats[MAXPLATS];"}, {"kind": "variable", "line": 517, "name": "activeceilings", "signature": "extern ceiling_t* activeceilings[MAXCEILINGS];"}, {"kind": "macro", "line": 24, "name": "__P_SPEC__", "signature": "#define __P_SPEC__"}, {"kind": "macro", "line": 35, "name": "MO_TELEPORTMAN", "signature": "#define MO_TELEPORTMAN"}, {"kind": "macro", "line": 173, "name": "GLOWSPEED", "signature": "#define GLOWSPEED"}, {"kind": "macro", "line": 174, "name": "STROBEBRIGHT", "signature": "#define STROBEBRIGHT"}, {"kind": "macro", "line": 175, "name": "FASTDARK", "signature": "#define FASTDARK"}, {"kind": "macro", "line": 176, "name": "SLOWDARK", "signature": "#define SLOWDARK"}, {"kind": "macro", "line": 238, "name": "MAXSWITCHES", "signature": "#define MAXSWITCHES"}, {"kind": "macro", "line": 241, "name": "MAXBUTTONS", "signature": "#define MAXBUTTONS"}, {"kind": "macro", "line": 244, "name": "BUTTONTIME", "signature": "#define BUTTONTIME"}, {"kind": "macro", "line": 301, "name": "PLATWAIT", "signature": "#define PLATWAIT"}, {"kind": "macro", "line": 302, "name": "PLATSPEED", "signature": "#define PLATSPEED"}, {"kind": "macro", "line": 303, "name": "MAXPLATS", "signature": "#define MAXPLATS"}, {"kind": "macro", "line": 361, "name": "VDOORSPEED", "signature": "#define VDOORSPEED"}, {"kind": "macro", "line": 362, "name": "VDOORWAIT", "signature": "#define VDOORWAIT"}, {"kind": "macro", "line": 456, "name": "SNUMFRAMES", "signature": "#define SNUMFRAMES"}, {"kind": "macro", "line": 458, "name": "SDOORWAIT", "signature": "#define SDOORWAIT"}, {"kind": "macro", "line": 459, "name": "SWAITTICS", "signature": "#define SWAITTICS"}, {"kind": "macro", "line": 462, "name": "MAXSLIDEDOORS", "signature": "#define MAXSLIDEDOORS"}, {"kind": "macro", "line": 513, "name": "CEILSPEED", "signature": "#define CEILSPEED"}, {"kind": "macro", "line": 514, "name": "CEILWAIT", "signature": "#define CEILWAIT"}, {"kind": "macro", "line": 515, "name": "MAXCEILINGS", "signature": "#define MAXCEILINGS"}, {"kind": "macro", "line": 597, "name": "FLOORSPEED", "signature": "#define FLOORSPEED"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: Switches, buttons. Two-state animation. Exits.", "id": "progs/doomgeneric/p_switch.c", "kind": "module", "label": "p_switch.c", "language": "c", "sha256": "a87e935d528e94a4", "symbol_count": 4, "symbols": [{"doc": "P_InitSwitchList Only called at game initialization.", "kind": "function", "line": 101, "name": "P_InitSwitchList", "signature": "void P_InitSwitchList(void)"}, {"kind": "function", "line": 149, "name": "P_StartButton", "signature": "void\nP_StartButton\n( line_t*\tline,\n  bwhere_e\tw,\n  int\t\ttexture,\n  int\t\ttime )"}, {"kind": "function", "line": 195, "name": "P_ChangeSwitchTexture", "signature": "void\nP_ChangeSwitchTexture\n( line_t*\tline,\n  int \t\tuseAgain )"}, {"kind": "function", "line": 270, "name": "P_UseSpecialLine", "signature": "boolean\nP_UseSpecialLine\n( mobj_t*\tthing,\n  line_t*\tline,\n  int\t\tside )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Teleportation.          Data.", "id": "progs/doomgeneric/p_telept.c", "kind": "module", "label": "p_telept.c", "language": "c", "sha256": "d62ef8128f5bfa38", "symbol_count": 1, "symbols": [{"kind": "function", "line": 42, "name": "EV_Teleport", "signature": "int\nEV_Teleport\n( line_t*\tline,\n  int\t\tside,\n  mobj_t*\tthing )"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Archiving: SaveGame I/O. Thinker, Ticker.", "id": "progs/doomgeneric/p_tick.c", "kind": "module", "label": "p_tick.c", "language": "c", "sha256": "28efbc242e9807dc", "symbol_count": 6, "symbols": [{"doc": "P_InitThinkers", "kind": "function", "line": 46, "name": "P_InitThinkers", "signature": "void P_InitThinkers (void)"}, {"doc": "P_AddThinker Adds a new thinker at the end of the list.", "kind": "function", "line": 58, "name": "P_AddThinker", "signature": "void P_AddThinker (thinker_t* thinker)"}, {"doc": "P_RemoveThinker Deallocation is lazy -- it will not actually be freed until its thinking turn comes up.", "kind": "function", "line": 73, "name": "P_RemoveThinker", "signature": "void P_RemoveThinker (thinker_t* thinker)"}, {"doc": "P_AllocateThinker Allocates memory and adds a new thinker at the end of the list.", "kind": "function", "line": 85, "name": "P_AllocateThinker", "signature": "void P_AllocateThinker (thinker_t*\tthinker)"}, {"doc": "P_RunThinkers", "kind": "function", "line": 94, "name": "P_RunThinkers", "signature": "void P_RunThinkers (void)"}, {"kind": "function", "line": 123, "name": "P_Ticker", "signature": "void P_Ticker (void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: ?        Called by C_Ticker, can call G_PlayerExited. Carries out all thinking of monsters and players.", "id": "progs/doomgeneric/p_tick.h", "kind": "module", "label": "p_tick.h", "language": "h", "sha256": "adce8e2c4a03fce9", "symbol_count": 2, "symbols": [{"doc": "Called by C_Ticker, can call G_PlayerExited. Carries out all thinking of monsters and players.", "kind": "function", "line": 29, "name": "P_Ticker", "signature": "void P_Ticker (void);"}, {"kind": "macro", "line": 21, "name": "__P_TICK__", "signature": "#define __P_TICK__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Player related stuff. Bobbing POV/weapon, movement. Pending weapon.", "id": "progs/doomgeneric/p_user.c", "kind": "module", "label": "p_user.c", "language": "c", "sha256": "eb07291c474798c8", "symbol_count": 8, "symbols": [{"kind": "function", "line": 52, "name": "P_Thrust", "signature": "void\nP_Thrust\n( player_t*\tplayer,\n  angle_t\tangle,\n  fixed_t\tmove )"}, {"doc": "P_CalcHeight Calculate the walking / running height adjustment", "kind": "function", "line": 70, "name": "P_CalcHeight", "signature": "void P_CalcHeight (player_t* player)"}, {"doc": "P_MovePlayer", "kind": "function", "line": 141, "name": "P_MovePlayer", "signature": "void P_MovePlayer (player_t* player)"}, {"kind": "function", "line": 175, "name": "P_DeathThink", "signature": "void P_DeathThink (player_t* player)"}, {"doc": "P_PlayerThink", "kind": "function", "line": 229, "name": "P_PlayerThink", "signature": "void P_PlayerThink (player_t* player)"}, {"kind": "macro", "line": 34, "name": "INVERSECOLORMAP", "signature": "#define INVERSECOLORMAP"}, {"kind": "macro", "line": 42, "name": "MAXBOB", "signature": "#define MAXBOB"}, {"kind": "macro", "line": 173, "name": "ANG5", "signature": "#define ANG5"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: BSP traversal, handling of LineSegs for rendering.", "id": "progs/doomgeneric/r_bsp.c", "kind": "module", "label": "r_bsp.c", "language": "c", "sha256": "89638d168de5d501", "symbol_count": 11, "symbols": [{"doc": "ClipWallSegment Clips the given range of columns and includes it in the new clip list.", "kind": "struct", "line": 73, "name": "cliprange_t"}, {"doc": "R_ClearDrawSegs", "kind": "function", "line": 61, "name": "R_ClearDrawSegs", "signature": "void R_ClearDrawSegs (void)"}, {"kind": "function", "line": 97, "name": "R_ClipSolidWallSegment", "signature": "void\nR_ClipSolidWallSegment\n( int\t\t\tfirst,\n  int\t\t\tlast )"}, {"kind": "function", "line": 190, "name": "R_ClipPassWallSegment", "signature": "void\nR_ClipPassWallSegment\n( int\tfirst,\n  int\tlast )"}, {"doc": "R_ClearClipSegs", "kind": "function", "line": 238, "name": "R_ClearClipSegs", "signature": "void R_ClearClipSegs (void)"}, {"doc": "R_AddLine Clips the given segment and adds any visible pieces to the line list.", "kind": "function", "line": 252, "name": "R_AddLine", "signature": "void R_AddLine (seg_t*\tline)"}, {"kind": "function", "line": 374, "name": "R_CheckBBox", "signature": "boolean R_CheckBBox (fixed_t*\tbspcoord)"}, {"doc": "R_Subsector Determine floor/ceiling planes. Add sprites of things in sector. Draw one or more line segments.", "kind": "function", "line": 490, "name": "R_Subsector", "signature": "void R_Subsector (int num)"}, {"doc": "RenderBSPNode Renders all subsectors below a given node, traversing subtree recursively. Just call with BSP root.", "kind": "function", "line": 545, "name": "R_RenderBSPNode", "signature": "void R_RenderBSPNode (int bspnum)"}, {"kind": "function", "line": 51, "name": "R_StoreWallRange", "signature": "void R_StoreWallRange ( int start, int stop );"}, {"kind": "macro", "line": 81, "name": "MAXSEGS", "signature": "#define MAXSEGS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh module, BSP traversal and handling.", "id": "progs/doomgeneric/r_bsp.h", "kind": "module", "label": "r_bsp.h", "language": "h", "sha256": "f8338f7087b57020", "symbol_count": 20, "symbols": [{"doc": "BSP?", "kind": "function", "line": 54, "name": "R_ClearClipSegs", "signature": "void R_ClearClipSegs (void);"}, {"kind": "function", "line": 55, "name": "R_ClearDrawSegs", "signature": "void R_ClearDrawSegs (void);"}, {"kind": "function", "line": 58, "name": "R_RenderBSPNode", "signature": "void R_RenderBSPNode (int bspnum);"}, {"kind": "variable", "line": 25, "name": "curline", "signature": "extern seg_t* curline;"}, {"kind": "variable", "line": 26, "name": "sidedef", "signature": "extern side_t* sidedef;"}, {"kind": "variable", "line": 27, "name": "linedef", "signature": "extern line_t* linedef;"}, {"kind": "variable", "line": 28, "name": "frontsector", "signature": "extern sector_t* frontsector;"}, {"kind": "variable", "line": 29, "name": "backsector", "signature": "extern sector_t* backsector;"}, {"kind": "variable", "line": 31, "name": "rw_x", "signature": "extern int rw_x;"}, {"kind": "variable", "line": 32, "name": "rw_stopx", "signature": "extern int rw_stopx;"}, {"kind": "variable", "line": 34, "name": "segtextured", "signature": "extern boolean segtextured;"}, {"doc": "false if the back side is the same plane", "kind": "variable", "line": 37, "name": "markfloor", "signature": "extern boolean markfloor;"}, {"kind": "variable", "line": 38, "name": "markceiling", "signature": "extern boolean markceiling;"}, {"kind": "variable", "line": 40, "name": "skymap", "signature": "extern boolean skymap;"}, {"kind": "variable", "line": 42, "name": "drawsegs", "signature": "extern drawseg_t drawsegs[MAXDRAWSEGS];"}, {"kind": "variable", "line": 43, "name": "ds_p", "signature": "extern drawseg_t* ds_p;"}, {"kind": "variable", "line": 45, "name": "hscalelight", "signature": "extern lighttable_t** hscalelight;"}, {"kind": "variable", "line": 46, "name": "vscalelight", "signature": "extern lighttable_t** vscalelight;"}, {"kind": "variable", "line": 47, "name": "dscalelight", "signature": "extern lighttable_t** dscalelight;"}, {"kind": "macro", "line": 21, "name": "__R_BSP__", "signature": "#define __R_BSP__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Preparation of data for rendering, generation of lookups, caching, retrieval by name.", "id": "progs/doomgeneric/r_data.c", "kind": "module", "label": "r_data.c", "language": "c", "sha256": "fb019e6ecbd1c17a", "symbol_count": 17, "symbols": [{"kind": "struct", "line": 106, "name": "texture_s"}, {"doc": "A single patch from a texture definition, basically a rectangular area within the texture rectangle.", "kind": "struct", "line": 89, "name": "texpatch_t"}, {"doc": "A maptexturedef_t describes a rectangular texture, which is composed of one or more mappatch_t structures that arrange graphic patches.", "kind": "type_alias", "line": 103, "name": "texture_t", "signature": "typedef struct texture_s texture_t;"}, {"kind": "function", "line": 186, "name": "R_DrawColumnInCache", "signature": "void\nR_DrawColumnInCache\n( column_t*\tpatch,\n  byte*\t\tcache,\n  int\t\toriginy,\n  int\t\tcacheheight )"}, {"doc": "R_GenerateComposite Using the texture definition, the composite texture is created from the patches, and each column is cached.", "kind": "function", "line": 226, "name": "R_GenerateComposite", "signature": "void R_GenerateComposite (int texnum)"}, {"doc": "R_GenerateLookup", "kind": "function", "line": 294, "name": "R_GenerateLookup", "signature": "void R_GenerateLookup (int texnum)"}, {"kind": "function", "line": 383, "name": "R_GetColumn", "signature": "byte*\nR_GetColumn\n( int\t\ttex,\n  int\t\tcol )"}, {"kind": "function", "line": 404, "name": "GenerateTextureHashTable", "signature": "static void GenerateTextureHashTable(void)"}, {"doc": "R_InitTextures Initializes the texture list with the textures from the world map.", "kind": "function", "line": 451, "name": "R_InitTextures", "signature": "void R_InitTextures (void)"}, {"doc": "R_InitFlats", "kind": "function", "line": 633, "name": "R_InitFlats", "signature": "void R_InitFlats (void)"}, {"doc": "R_InitSpriteLumps Finds the width and hoffset of all sprites in the wad, so the sprite does not need to be cached completely just for having the header info ready during rendering.", "kind": "function", "line": 655, "name": "R_InitSpriteLumps", "signature": "void R_InitSpriteLumps (void)"}, {"doc": "R_InitColormaps", "kind": "function", "line": 685, "name": "R_InitColormaps", "signature": "void R_InitColormaps (void)"}, {"doc": "R_InitData Locates all the lumps that will be used by all views Must be called after W_Init.", "kind": "function", "line": 703, "name": "R_InitData", "signature": "void R_InitData (void)"}, {"doc": "R_FlatNumForName Retrieval, get a flat number for a flat name.", "kind": "function", "line": 720, "name": "R_FlatNumForName", "signature": "int R_FlatNumForName (char* name)"}, {"doc": "R_CheckTextureNumForName Check whether texture is available. Filter out NoTexture indicator.", "kind": "function", "line": 744, "name": "R_CheckTextureNumForName", "signature": "int\tR_CheckTextureNumForName (char *name)"}, {"doc": "R_TextureNumForName Calls R_CheckTextureNumForName, aborts with error message.", "kind": "function", "line": 775, "name": "R_TextureNumForName", "signature": "int\tR_TextureNumForName (char* name)"}, {"kind": "function", "line": 800, "name": "R_PrecacheLevel", "signature": "void R_PrecacheLevel (void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh module, data I/O, caching, retrieval of graphics by name.       Retrieve column data for span blitting.", "id": "progs/doomgeneric/r_data.h", "kind": "module", "label": "r_data.h", "language": "h", "sha256": "3c9b4343fbc6428b", "symbol_count": 7, "symbols": [{"kind": "function", "line": 30, "name": "R_GetColumn", "signature": "byte* R_GetColumn ( int tex, int col );"}, {"doc": "I/O, setting up the stuff.", "kind": "function", "line": 36, "name": "R_InitData", "signature": "void R_InitData (void);"}, {"kind": "function", "line": 37, "name": "R_PrecacheLevel", "signature": "void R_PrecacheLevel (void);"}, {"doc": "Retrieval. Floor/ceiling opaque texture tiles, lookup by name. For animation?", "kind": "function", "line": 43, "name": "R_FlatNumForName", "signature": "int R_FlatNumForName (char* name);"}, {"doc": "Called by P_Ticker for switches and animations, returns the texture number for the texture name.", "kind": "function", "line": 48, "name": "R_TextureNumForName", "signature": "int R_TextureNumForName (char *name);"}, {"kind": "function", "line": 49, "name": "R_CheckTextureNumForName", "signature": "int R_CheckTextureNumForName (char *name);"}, {"kind": "macro", "line": 22, "name": "__R_DATA__", "signature": "#define __R_DATA__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh/rendering module, shared data struct definitions.      Screenwidth.  Some more or less basic data types we depend on.", "id": "progs/doomgeneric/r_defs.h", "kind": "module", "label": "r_defs.h", "language": "h", "sha256": "88b7497aa14ad760", "symbol_count": 25, "symbols": [{"doc": "Forward of LineDefs, for Sectors.", "kind": "struct", "line": 76, "name": "line_s"}, {"kind": "struct", "line": 175, "name": "line_s"}, {"doc": "A SubSector. References a Sector. Basically, this is a list of LineSegs, indicating the visible walls that define (all or some) sides of a convex BSP leaf.", "kind": "struct", "line": 223, "name": "subsector_s"}, {"doc": "?", "kind": "struct", "line": 306, "name": "drawseg_s"}, {"doc": "A vissprite_t is a thing that will be drawn during a refresh. I.e. a sprite object that is partly visible.", "kind": "struct", "line": 338, "name": "vissprite_s"}, {"doc": "Your plain vanilla vertex. Note: transformed values not buffered locally, like some DOOM-alikes (\"wt\", \"WebView\") did.", "kind": "struct", "line": 67, "name": "vertex_t"}, {"doc": "Each sector has a degenmobj_t in its center for sound origin purposes. I suppose this does not handle sound from moving objects (doppler), because position is prolly just buffered, not updated.", "kind": "struct", "line": 84, "name": "degenmobj_t"}, {"doc": "The SECTORS record, at runtime. Stores things/mobjs.", "kind": "struct", "line": 97, "name": "sector_t"}, {"kind": "struct", "line": 140, "name": "side_t"}, {"doc": "The LineSeg.", "kind": "struct", "line": 236, "name": "seg_t"}, {"doc": "BSP node.", "kind": "struct", "line": 261, "name": "node_t"}, {"doc": "Sprites are patches with a special naming convention so they can be recognized by R_InitSprites. The base name is NNNNFx or NNNNFxFx, with x indicating the rotation, x = 0, 1-7. The sprite and frame specified by a thing_t is range checked at run time. A sprite is a patch_t that is assumed to represent a three dimensional object and may have multiple rotations pre drawn. Horizontal flipping is used to save space, thus NNNNF2F5 defines a mirrored patch. Some sprites will only have one picture used for all views: NNNNF0", "kind": "struct", "line": 390, "name": "spriteframe_t"}, {"doc": "A sprite definition: a number of animation frames.", "kind": "struct", "line": 411, "name": "spritedef_t"}, {"doc": "Now what is a visplane, anyway?", "kind": "struct", "line": 423, "name": "visplane_t"}, {"kind": "type_alias", "line": 172, "name": "v1", "signature": "typedef struct line_s { // Vertices, from v1 to v2. vertex_t* v1;"}, {"doc": "A SubSector. References a Sector. Basically, this is a list of LineSegs, indicating the visible walls that define (all or some) sides of a convex BSP leaf.", "kind": "type_alias", "line": 223, "name": "sector", "signature": "typedef struct subsector_s { sector_t* sector;"}, {"doc": "This could be wider for >8 bit display. Indeed, true color support is posibble precalculating 24bpp lightmap/colormap LUT. from darkening PLAYPAL to all black. Could even us emore than 32 levels.", "kind": "type_alias", "line": 298, "name": "lighttable_t", "signature": "typedef byte lighttable_t;"}, {"doc": "?", "kind": "type_alias", "line": 306, "name": "curline", "signature": "typedef struct drawseg_s { seg_t* curline;"}, {"doc": "A vissprite_t is a thing that will be drawn during a refresh. I.e. a sprite object that is partly visible.", "kind": "type_alias", "line": 338, "name": "prev", "signature": "typedef struct vissprite_s { // Doubly linked list. struct vissprite_s* prev;"}, {"kind": "macro", "line": 21, "name": "__R_DEFS__", "signature": "#define __R_DEFS__"}, {"kind": "macro", "line": 46, "name": "SIL_NONE", "signature": "#define SIL_NONE"}, {"kind": "macro", "line": 47, "name": "SIL_BOTTOM", "signature": "#define SIL_BOTTOM"}, {"kind": "macro", "line": 48, "name": "SIL_TOP", "signature": "#define SIL_TOP"}, {"kind": "macro", "line": 49, "name": "SIL_BOTH", "signature": "#define SIL_BOTH"}, {"kind": "macro", "line": 51, "name": "MAXDRAWSEGS", "signature": "#define MAXDRAWSEGS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The actual span/column drawing functions. Here find the main potential for optimization, e.g. inline assembly, different algorithms.", "id": "progs/doomgeneric/r_draw.c", "kind": "module", "label": "r_draw.c", "language": "c", "sha256": "b79e3f4967ece801", "symbol_count": 20, "symbols": [{"doc": "A column is a vertical slice/span from a wall texture that, given the DOOM style restrictions on the view orientation, will always have constant z depth. Thus a special case loop for very fast rendering can be used. It has also been used with Wolfenstein 3D.", "kind": "function", "line": 102, "name": "R_DrawColumn", "signature": "void R_DrawColumn (void)"}, {"doc": "UNUSED. Loop unrolled. if 0", "kind": "function", "line": 152, "name": "R_DrawColumn", "signature": "void R_DrawColumn (void)"}, {"kind": "function", "line": 208, "name": "R_DrawColumnLow", "signature": "void R_DrawColumnLow (void)"}, {"doc": "Framebuffer postprocessing. Creates a fuzzy image by copying pixels from adjacent ones to left and right. Used with an all black colormap, this could create the SHADOW effect, i.e. spectres and invisible players.", "kind": "function", "line": 283, "name": "R_DrawFuzzColumn", "signature": "void R_DrawFuzzColumn (void)"}, {"kind": "function", "line": 342, "name": "R_DrawFuzzColumnLow", "signature": "void R_DrawFuzzColumnLow (void)"}, {"kind": "function", "line": 424, "name": "R_DrawTranslatedColumn", "signature": "void R_DrawTranslatedColumn (void)"}, {"kind": "function", "line": 468, "name": "R_DrawTranslatedColumnLow", "signature": "void R_DrawTranslatedColumnLow (void)"}, {"doc": "R_InitTranslationTables Creates the translation tables to map the green color ramp to gray, brown, red. Assumes a given structure of the PLAYPAL. Could be read from a lump instead.", "kind": "function", "line": 530, "name": "R_InitTranslationTables", "signature": "void R_InitTranslationTables (void)"}, {"doc": "Draws the actual span.", "kind": "function", "line": 590, "name": "R_DrawSpan", "signature": "void R_DrawSpan (void)"}, {"doc": "UNUSED. Loop unrolled by 4. if 0", "kind": "function", "line": 646, "name": "R_DrawSpan", "signature": "void R_DrawSpan (void)"}, {"doc": "Again..", "kind": "function", "line": 719, "name": "R_DrawSpanLow", "signature": "void R_DrawSpanLow (void)"}, {"kind": "function", "line": 777, "name": "R_InitBuffer", "signature": "void\nR_InitBuffer\n( int\t\twidth,\n  int\t\theight )"}, {"doc": "R_FillBackScreen Fills the back screen with a pattern for variable screen sizes Also draws a beveled edge.", "kind": "function", "line": 812, "name": "R_FillBackScreen", "signature": "void R_FillBackScreen (void)"}, {"kind": "function", "line": 919, "name": "R_VideoErase", "signature": "void\nR_VideoErase\n( unsigned\tofs,\n  int\t\tcount )"}, {"doc": "R_DrawViewBorder Draws the border around the view for different size windows?", "kind": "function", "line": 941, "name": "R_DrawViewBorder", "signature": "void R_DrawViewBorder (void)"}, {"kind": "macro", "line": 41, "name": "MAXWIDTH", "signature": "#define MAXWIDTH"}, {"kind": "macro", "line": 42, "name": "MAXHEIGHT", "signature": "#define MAXHEIGHT"}, {"kind": "macro", "line": 45, "name": "SBARHEIGHT", "signature": "#define SBARHEIGHT"}, {"kind": "macro", "line": 257, "name": "FUZZTABLE", "signature": "#define FUZZTABLE"}, {"kind": "macro", "line": 258, "name": "FUZZOFF", "signature": "#define FUZZOFF"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.", "id": "progs/doomgeneric/r_draw.h", "kind": "module", "label": "r_draw.h", "language": "h", "sha256": "e2f1007b60431104", "symbol_count": 32, "symbols": [{"doc": "The span blitting interface. Hook in assembler or system specific BLT here.", "kind": "function", "line": 40, "name": "R_DrawColumn", "signature": "void R_DrawColumn (void);"}, {"kind": "function", "line": 41, "name": "R_DrawColumnLow", "signature": "void R_DrawColumnLow (void);"}, {"doc": "The Spectre/Invisibility effect.", "kind": "function", "line": 44, "name": "R_DrawFuzzColumn", "signature": "void R_DrawFuzzColumn (void);"}, {"kind": "function", "line": 45, "name": "R_DrawFuzzColumnLow", "signature": "void R_DrawFuzzColumnLow (void);"}, {"doc": "Draw with color translation tables, for player sprite rendering, Green/Red/Blue/Indigo shirts.", "kind": "function", "line": 50, "name": "R_DrawTranslatedColumn", "signature": "void R_DrawTranslatedColumn (void);"}, {"kind": "function", "line": 51, "name": "R_DrawTranslatedColumnLow", "signature": "void R_DrawTranslatedColumnLow (void);"}, {"kind": "function", "line": 54, "name": "R_VideoErase", "signature": "void R_VideoErase ( unsigned ofs, int count );"}, {"doc": "Span blitting for rows, floor/ceiling. No Sepctre effect needed.", "kind": "function", "line": 78, "name": "R_DrawSpan", "signature": "void R_DrawSpan (void);"}, {"doc": "Low resolution mode, 160x200?", "kind": "function", "line": 81, "name": "R_DrawSpanLow", "signature": "void R_DrawSpanLow (void);"}, {"kind": "function", "line": 85, "name": "R_InitBuffer", "signature": "void R_InitBuffer ( int width, int height );"}, {"doc": "Initialize color translation tables, for player rendering etc.", "kind": "function", "line": 92, "name": "R_InitTranslationTables", "signature": "void R_InitTranslationTables (void);"}, {"doc": "Rendering function.", "kind": "function", "line": 97, "name": "R_FillBackScreen", "signature": "void R_FillBackScreen (void);"}, {"doc": "If the view size is not full screen, draws a border around it.", "kind": "function", "line": 100, "name": "R_DrawViewBorder", "signature": "void R_DrawViewBorder (void);"}, {"kind": "variable", "line": 26, "name": "dc_colormap", "signature": "extern lighttable_t* dc_colormap;"}, {"kind": "variable", "line": 27, "name": "dc_x", "signature": "extern int dc_x;"}, {"kind": "variable", "line": 28, "name": "dc_yl", "signature": "extern int dc_yl;"}, {"kind": "variable", "line": 29, "name": "dc_yh", "signature": "extern int dc_yh;"}, {"kind": "variable", "line": 30, "name": "dc_iscale", "signature": "extern fixed_t dc_iscale;"}, {"kind": "variable", "line": 31, "name": "dc_texturemid", "signature": "extern fixed_t dc_texturemid;"}, {"doc": "first pixel in a column", "kind": "variable", "line": 34, "name": "dc_source", "signature": "extern byte* dc_source;"}, {"kind": "variable", "line": 58, "name": "ds_y", "signature": "extern int ds_y;"}, {"kind": "variable", "line": 59, "name": "ds_x1", "signature": "extern int ds_x1;"}, {"kind": "variable", "line": 60, "name": "ds_x2", "signature": "extern int ds_x2;"}, {"kind": "variable", "line": 62, "name": "ds_colormap", "signature": "extern lighttable_t* ds_colormap;"}, {"kind": "variable", "line": 64, "name": "ds_xfrac", "signature": "extern fixed_t ds_xfrac;"}, {"kind": "variable", "line": 65, "name": "ds_yfrac", "signature": "extern fixed_t ds_yfrac;"}, {"kind": "variable", "line": 66, "name": "ds_xstep", "signature": "extern fixed_t ds_xstep;"}, {"kind": "variable", "line": 67, "name": "ds_ystep", "signature": "extern fixed_t ds_ystep;"}, {"doc": "start of a 64*64 tile image", "kind": "variable", "line": 70, "name": "ds_source", "signature": "extern byte* ds_source;"}, {"kind": "variable", "line": 72, "name": "translationtables", "signature": "extern byte* translationtables;"}, {"kind": "variable", "line": 73, "name": "dc_translation", "signature": "extern byte* dc_translation;"}, {"kind": "macro", "line": 21, "name": "__R_DRAW__", "signature": "#define __R_DRAW__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh (R_*) module, global header. All the rendering/drawing stuff is here.    Binary Angles, sine/cosine/atan lookups.  Screen size related parameters.  Include the refresh/render data structs.", "id": "progs/doomgeneric/r_local.h", "kind": "module", "label": "r_local.h", "language": "h", "sha256": "e957f7e74dcbff58", "symbol_count": 1, "symbols": [{"kind": "macro", "line": 21, "name": "__R_LOCAL__", "signature": "#define __R_LOCAL__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Rendering main loop and setup functions, utility functions (BSP, geometry, trigonometry). See tables.c, too.", "id": "progs/doomgeneric/r_main.c", "kind": "module", "label": "r_main.c", "language": "c", "sha256": "48a35e73bc9c71c5", "symbol_count": 20, "symbols": [{"kind": "function", "line": 123, "name": "R_AddPointToBox", "signature": "void\nR_AddPointToBox\n( int\t\tx,\n  int\t\ty,\n  fixed_t*\tbox )"}, {"kind": "function", "line": 146, "name": "R_PointOnSide", "signature": "int\nR_PointOnSide\n( fixed_t\tx,\n  fixed_t\ty,\n  node_t*\tnode )"}, {"kind": "function", "line": 199, "name": "R_PointOnSegSide", "signature": "int\nR_PointOnSegSide\n( fixed_t\tx,\n  fixed_t\ty,\n  seg_t*\tline )"}, {"kind": "function", "line": 276, "name": "R_PointToAngle", "signature": "angle_t\nR_PointToAngle\n( fixed_t\tx,\n  fixed_t\ty )"}, {"kind": "function", "line": 362, "name": "R_PointToAngle2", "signature": "angle_t\nR_PointToAngle2\n( fixed_t\tx1,\n  fixed_t\ty1,\n  fixed_t\tx2,\n  fixed_t\ty2 )"}, {"kind": "function", "line": 376, "name": "R_PointToDist", "signature": "fixed_t\nR_PointToDist\n( fixed_t\tx,\n  fixed_t\ty )"}, {"doc": "R_InitPointToAngle", "kind": "function", "line": 422, "name": "R_InitPointToAngle", "signature": "void R_InitPointToAngle (void)"}, {"doc": "R_ScaleFromGlobalAngle Returns the texture mapping scale for the current line (horizontal span) at the given angle. rw_distance must be calculated first.", "kind": "function", "line": 449, "name": "R_ScaleFromGlobalAngle", "signature": "fixed_t R_ScaleFromGlobalAngle (angle_t visangle)"}, {"doc": "R_InitTables", "kind": "function", "line": 505, "name": "R_InitTables", "signature": "void R_InitTables (void)"}, {"doc": "R_InitTextureMapping", "kind": "function", "line": 540, "name": "R_InitTextureMapping", "signature": "void R_InitTextureMapping (void)"}, {"kind": "function", "line": 610, "name": "R_InitLightTables", "signature": "void R_InitLightTables (void)"}, {"kind": "function", "line": 654, "name": "R_SetViewSize", "signature": "void\nR_SetViewSize\n( int\t\tblocks,\n  int\t\tdetail )"}, {"doc": "R_ExecuteSetViewSize", "kind": "function", "line": 667, "name": "R_ExecuteSetViewSize", "signature": "void R_ExecuteSetViewSize (void)"}, {"kind": "function", "line": 767, "name": "R_Init", "signature": "void R_Init (void)"}, {"kind": "function", "line": 794, "name": "R_PointInSubsector", "signature": "subsector_t*\nR_PointInSubsector\n( fixed_t\tx,\n  fixed_t\ty )"}, {"doc": "R_SetupFrame", "kind": "function", "line": 823, "name": "R_SetupFrame", "signature": "void R_SetupFrame (player_t* player)"}, {"doc": "R_RenderView", "kind": "function", "line": 863, "name": "R_RenderPlayerView", "signature": "void R_RenderPlayerView (player_t* player)"}, {"kind": "variable", "line": 54, "name": "walllights", "signature": "extern lighttable_t** walllights;"}, {"kind": "macro", "line": 43, "name": "FIELDOFVIEW", "signature": "#define FIELDOFVIEW"}, {"kind": "macro", "line": 608, "name": "DISTMAP", "signature": "#define DISTMAP"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.          POV related.", "id": "progs/doomgeneric/r_main.h", "kind": "module", "label": "r_main.h", "language": "h", "sha256": "0938bde8c2599487", "symbol_count": 36, "symbols": [{"doc": "Function pointers to switch refresh/drawing functions. Used to select shadow mode etc.", "kind": "function", "line": 92, "name": "void", "signature": "extern void (*colfunc) (void);"}, {"kind": "function", "line": 103, "name": "R_PointOnSide", "signature": "int R_PointOnSide ( fixed_t x, fixed_t y, node_t* node );"}, {"kind": "function", "line": 109, "name": "R_PointOnSegSide", "signature": "int R_PointOnSegSide ( fixed_t x, fixed_t y, seg_t* line );"}, {"kind": "function", "line": 115, "name": "R_PointToAngle", "signature": "angle_t R_PointToAngle ( fixed_t x, fixed_t y );"}, {"kind": "function", "line": 120, "name": "R_PointToAngle2", "signature": "angle_t R_PointToAngle2 ( fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2 );"}, {"kind": "function", "line": 127, "name": "R_PointToDist", "signature": "fixed_t R_PointToDist ( fixed_t x, fixed_t y );"}, {"kind": "function", "line": 132, "name": "R_ScaleFromGlobalAngle", "signature": "fixed_t R_ScaleFromGlobalAngle (angle_t visangle);"}, {"kind": "function", "line": 135, "name": "R_PointInSubsector", "signature": "subsector_t* R_PointInSubsector ( fixed_t x, fixed_t y );"}, {"kind": "function", "line": 140, "name": "R_AddPointToBox", "signature": "void R_AddPointToBox ( int x, int y, fixed_t* box );"}, {"doc": "Called by G_Drawer.", "kind": "function", "line": 152, "name": "R_RenderPlayerView", "signature": "void R_RenderPlayerView (player_t *player);"}, {"doc": "Called by startup code.", "kind": "function", "line": 155, "name": "R_Init", "signature": "void R_Init (void);"}, {"doc": "Called by M_Responder.", "kind": "function", "line": 158, "name": "R_SetViewSize", "signature": "void R_SetViewSize (int blocks, int detail);"}, {"doc": "POV related.", "kind": "variable", "line": 32, "name": "viewcos", "signature": "extern fixed_t viewcos;"}, {"kind": "variable", "line": 33, "name": "viewsin", "signature": "extern fixed_t viewsin;"}, {"kind": "variable", "line": 35, "name": "viewwindowx", "signature": "extern int viewwindowx;"}, {"kind": "variable", "line": 36, "name": "viewwindowy", "signature": "extern int viewwindowy;"}, {"kind": "variable", "line": 40, "name": "centerx", "signature": "extern int centerx;"}, {"kind": "variable", "line": 41, "name": "centery", "signature": "extern int centery;"}, {"kind": "variable", "line": 43, "name": "centerxfrac", "signature": "extern fixed_t centerxfrac;"}, {"kind": "variable", "line": 44, "name": "centeryfrac", "signature": "extern fixed_t centeryfrac;"}, {"kind": "variable", "line": 45, "name": "projection", "signature": "extern fixed_t projection;"}, {"kind": "variable", "line": 47, "name": "validcount", "signature": "extern int validcount;"}, {"kind": "variable", "line": 49, "name": "linecount", "signature": "extern int linecount;"}, {"kind": "variable", "line": 50, "name": "loopcount", "signature": "extern int loopcount;"}, {"kind": "variable", "line": 70, "name": "scalelightfixed", "signature": "extern lighttable_t* scalelightfixed[MAXLIGHTSCALE];"}, {"kind": "variable", "line": 73, "name": "extralight", "signature": "extern int extralight;"}, {"kind": "variable", "line": 74, "name": "fixedcolormap", "signature": "extern lighttable_t* fixedcolormap;"}, {"doc": "Blocky/low detail mode. B remove this? 0 = high, 1 = low", "kind": "variable", "line": 85, "name": "detailshift", "signature": "extern int detailshift;"}, {"kind": "macro", "line": 21, "name": "__R_MAIN__", "signature": "#define __R_MAIN__"}, {"kind": "macro", "line": 61, "name": "LIGHTLEVELS", "signature": "#define LIGHTLEVELS"}, {"kind": "macro", "line": 62, "name": "LIGHTSEGSHIFT", "signature": "#define LIGHTSEGSHIFT"}, {"kind": "macro", "line": 64, "name": "MAXLIGHTSCALE", "signature": "#define MAXLIGHTSCALE"}, {"kind": "macro", "line": 65, "name": "LIGHTSCALESHIFT", "signature": "#define LIGHTSCALESHIFT"}, {"kind": "macro", "line": 66, "name": "MAXLIGHTZ", "signature": "#define MAXLIGHTZ"}, {"kind": "macro", "line": 67, "name": "LIGHTZSHIFT", "signature": "#define LIGHTZSHIFT"}, {"kind": "macro", "line": 79, "name": "NUMCOLORMAPS", "signature": "#define NUMCOLORMAPS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Here is a core component: drawing the floors and ceilings, while maintaining a per column clipping list only. Moreover, the sky areas have to be determined.", "id": "progs/doomgeneric/r_plane.c", "kind": "module", "label": "r_plane.c", "language": "c", "sha256": "19295b2052790f3a", "symbol_count": 9, "symbols": [{"doc": "R_InitPlanes Only at game startup.", "kind": "function", "line": 94, "name": "R_InitPlanes", "signature": "void R_InitPlanes (void)"}, {"kind": "function", "line": 114, "name": "R_MapPlane", "signature": "void\nR_MapPlane\n( int\t\ty,\n  int\t\tx1,\n  int\t\tx2 )"}, {"doc": "R_ClearPlanes At begining of frame.", "kind": "function", "line": 178, "name": "R_ClearPlanes", "signature": "void R_ClearPlanes (void)"}, {"kind": "function", "line": 211, "name": "R_FindPlane", "signature": "visplane_t*\nR_FindPlane\n( fixed_t\theight,\n  int\t\tpicnum,\n  int\t\tlightlevel )"}, {"kind": "function", "line": 259, "name": "R_CheckPlane", "signature": "visplane_t*\nR_CheckPlane\n( visplane_t*\tpl,\n  int\t\tstart,\n  int\t\tstop )"}, {"kind": "function", "line": 324, "name": "R_MakeSpans", "signature": "void\nR_MakeSpans\n( int\t\tx,\n  int\t\tt1,\n  int\t\tb1,\n  int\t\tt2,\n  int\t\tb2 )"}, {"doc": "R_DrawPlanes At the end of each frame.", "kind": "function", "line": 360, "name": "R_DrawPlanes", "signature": "void R_DrawPlanes (void)"}, {"kind": "macro", "line": 45, "name": "MAXVISPLANES", "signature": "#define MAXVISPLANES"}, {"kind": "macro", "line": 52, "name": "MAXOPENINGS", "signature": "#define MAXOPENINGS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh, visplane stuff (floor, ceilings).         Visplane related.", "id": "progs/doomgeneric/r_plane.h", "kind": "module", "label": "r_plane.h", "language": "h", "sha256": "766e89765316993a", "symbol_count": 15, "symbols": [{"kind": "function", "line": 43, "name": "R_InitPlanes", "signature": "void R_InitPlanes (void);"}, {"kind": "function", "line": 44, "name": "R_ClearPlanes", "signature": "void R_ClearPlanes (void);"}, {"kind": "function", "line": 47, "name": "R_MapPlane", "signature": "void R_MapPlane ( int y, int x1, int x2 );"}, {"kind": "function", "line": 53, "name": "R_MakeSpans", "signature": "void R_MakeSpans ( int x, int t1, int b1, int t2, int b2 );"}, {"kind": "function", "line": 60, "name": "R_DrawPlanes", "signature": "void R_DrawPlanes (void);"}, {"kind": "function", "line": 63, "name": "R_FindPlane", "signature": "visplane_t* R_FindPlane ( fixed_t height, int picnum, int lightlevel );"}, {"kind": "function", "line": 69, "name": "R_CheckPlane", "signature": "visplane_t* R_CheckPlane ( visplane_t* pl, int start, int stop );"}, {"doc": "Visplane related.", "kind": "variable", "line": 29, "name": "lastopening", "signature": "extern short* lastopening;"}, {"kind": "variable", "line": 34, "name": "floorfunc", "signature": "extern planefunction_t floorfunc;"}, {"kind": "variable", "line": 35, "name": "ceilingfunc_t", "signature": "extern planefunction_t ceilingfunc_t;"}, {"kind": "variable", "line": 37, "name": "floorclip", "signature": "extern short floorclip[SCREENWIDTH];"}, {"kind": "variable", "line": 38, "name": "ceilingclip", "signature": "extern short ceilingclip[SCREENWIDTH];"}, {"kind": "variable", "line": 40, "name": "yslope", "signature": "extern fixed_t yslope[SCREENHEIGHT];"}, {"kind": "variable", "line": 41, "name": "distscale", "signature": "extern fixed_t distscale[SCREENWIDTH];"}, {"kind": "macro", "line": 21, "name": "__R_PLANE__", "signature": "#define __R_PLANE__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: All the clipping: columns, horizontal spans, sky columns.", "id": "progs/doomgeneric/r_segs.c", "kind": "module", "label": "r_segs.c", "language": "c", "sha256": "92afcd82ccb3b602", "symbol_count": 5, "symbols": [{"kind": "function", "line": 96, "name": "R_RenderMaskedSegRange", "signature": "void\nR_RenderMaskedSegRange\n( drawseg_t*\tds,\n  int\t\tx1,\n  int\t\tx2 )"}, {"kind": "function", "line": 199, "name": "R_RenderSegLoop", "signature": "void R_RenderSegLoop (void)"}, {"kind": "function", "line": 372, "name": "R_StoreWallRange", "signature": "void\nR_StoreWallRange\n( int\tstart,\n  int\tstop )"}, {"kind": "macro", "line": 196, "name": "HEIGHTBITS", "signature": "#define HEIGHTBITS"}, {"kind": "macro", "line": 197, "name": "HEIGHTUNIT", "signature": "#define HEIGHTUNIT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh module, drawing LineSegs from BSP.", "id": "progs/doomgeneric/r_segs.h", "kind": "module", "label": "r_segs.h", "language": "h", "sha256": "90bebfde358f5312", "symbol_count": 2, "symbols": [{"kind": "function", "line": 27, "name": "R_RenderMaskedSegRange", "signature": "void R_RenderMaskedSegRange ( drawseg_t* ds, int x1, int x2 );"}, {"kind": "macro", "line": 21, "name": "__R_SEGS__", "signature": "#define __R_SEGS__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Sky rendering. The DOOM sky is a texture map like any wall, wrapping around. A 1024 columns equal 360 degrees. The default sky map is 256 columns and repeats 4 times on a 320 screen?      Needed for FRACUNIT.  Needed for Flat retrieval.", "id": "progs/doomgeneric/r_sky.c", "kind": "module", "label": "r_sky.c", "language": "c", "sha256": "2ad5474b2387d51b", "symbol_count": 1, "symbols": [{"doc": "R_InitSkyMap Called whenever the view size changes.", "kind": "function", "line": 47, "name": "R_InitSkyMap", "signature": "void R_InitSkyMap (void)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Sky rendering.       SKY, store the number for name.  The sky map is 256*128*4 maps.", "id": "progs/doomgeneric/r_sky.h", "kind": "module", "label": "r_sky.h", "language": "h", "sha256": "03805143d3e5d601", "symbol_count": 6, "symbols": [{"doc": "Called whenever the view size changes.", "kind": "function", "line": 35, "name": "R_InitSkyMap", "signature": "void R_InitSkyMap (void);"}, {"kind": "variable", "line": 31, "name": "skytexture", "signature": "extern int skytexture;"}, {"kind": "variable", "line": 32, "name": "skytexturemid", "signature": "extern int skytexturemid;"}, {"kind": "macro", "line": 21, "name": "__R_SKY__", "signature": "#define __R_SKY__"}, {"kind": "macro", "line": 26, "name": "SKYFLATNAME", "signature": "#define\t\t\tSKYFLATNAME"}, {"kind": "macro", "line": 29, "name": "ANGLETOSKYSHIFT", "signature": "#define ANGLETOSKYSHIFT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh/render internal state variables (global).     Need data structure definitions.", "id": "progs/doomgeneric/r_state.h", "kind": "module", "label": "r_state.h", "language": "h", "sha256": "0778640d51a6815f", "symbol_count": 45, "symbols": [{"doc": "needed for texture pegging", "kind": "variable", "line": 38, "name": "textureheight", "signature": "extern fixed_t* textureheight;"}, {"doc": "needed for pre rendering (fracs)", "kind": "variable", "line": 41, "name": "spritewidth", "signature": "extern fixed_t* spritewidth;"}, {"kind": "variable", "line": 43, "name": "spriteoffset", "signature": "extern fixed_t* spriteoffset;"}, {"kind": "variable", "line": 44, "name": "spritetopoffset", "signature": "extern fixed_t* spritetopoffset;"}, {"kind": "variable", "line": 46, "name": "colormaps", "signature": "extern lighttable_t* colormaps;"}, {"kind": "variable", "line": 48, "name": "viewwidth", "signature": "extern int viewwidth;"}, {"kind": "variable", "line": 49, "name": "scaledviewwidth", "signature": "extern int scaledviewwidth;"}, {"kind": "variable", "line": 50, "name": "viewheight", "signature": "extern int viewheight;"}, {"kind": "variable", "line": 52, "name": "firstflat", "signature": "extern int firstflat;"}, {"doc": "for global animation", "kind": "variable", "line": 55, "name": "flattranslation", "signature": "extern int* flattranslation;"}, {"kind": "variable", "line": 56, "name": "texturetranslation", "signature": "extern int* texturetranslation;"}, {"doc": "Sprite....", "kind": "variable", "line": 60, "name": "firstspritelump", "signature": "extern int firstspritelump;"}, {"kind": "variable", "line": 61, "name": "lastspritelump", "signature": "extern int lastspritelump;"}, {"kind": "variable", "line": 62, "name": "numspritelumps", "signature": "extern int numspritelumps;"}, {"doc": "Lookup tables for map data.", "kind": "variable", "line": 69, "name": "numsprites", "signature": "extern int numsprites;"}, {"kind": "variable", "line": 70, "name": "sprites", "signature": "extern spritedef_t* sprites;"}, {"kind": "variable", "line": 72, "name": "numvertexes", "signature": "extern int numvertexes;"}, {"kind": "variable", "line": 73, "name": "vertexes", "signature": "extern vertex_t* vertexes;"}, {"kind": "variable", "line": 75, "name": "numsegs", "signature": "extern int numsegs;"}, {"kind": "variable", "line": 76, "name": "segs", "signature": "extern seg_t* segs;"}, {"kind": "variable", "line": 78, "name": "numsectors", "signature": "extern int numsectors;"}, {"kind": "variable", "line": 79, "name": "sectors", "signature": "extern sector_t* sectors;"}, {"kind": "variable", "line": 81, "name": "numsubsectors", "signature": "extern int numsubsectors;"}, {"kind": "variable", "line": 82, "name": "subsectors", "signature": "extern subsector_t* subsectors;"}, {"kind": "variable", "line": 84, "name": "numnodes", "signature": "extern int numnodes;"}, {"kind": "variable", "line": 85, "name": "nodes", "signature": "extern node_t* nodes;"}, {"kind": "variable", "line": 87, "name": "numlines", "signature": "extern int numlines;"}, {"kind": "variable", "line": 88, "name": "lines", "signature": "extern line_t* lines;"}, {"kind": "variable", "line": 90, "name": "numsides", "signature": "extern int numsides;"}, {"kind": "variable", "line": 91, "name": "sides", "signature": "extern side_t* sides;"}, {"doc": "POV data.", "kind": "variable", "line": 97, "name": "viewx", "signature": "extern fixed_t viewx;"}, {"kind": "variable", "line": 98, "name": "viewy", "signature": "extern fixed_t viewy;"}, {"kind": "variable", "line": 99, "name": "viewz", "signature": "extern fixed_t viewz;"}, {"kind": "variable", "line": 101, "name": "viewangle", "signature": "extern angle_t viewangle;"}, {"kind": "variable", "line": 102, "name": "viewplayer", "signature": "extern player_t* viewplayer;"}, {"doc": "?", "kind": "variable", "line": 106, "name": "clipangle", "signature": "extern angle_t clipangle;"}, {"kind": "variable", "line": 108, "name": "viewangletox", "signature": "extern int viewangletox[FINEANGLES/2];"}, {"kind": "variable", "line": 109, "name": "xtoviewangle", "signature": "extern angle_t xtoviewangle[SCREENWIDTH+1];"}, {"kind": "variable", "line": 112, "name": "rw_distance", "signature": "extern fixed_t rw_distance;"}, {"kind": "variable", "line": 113, "name": "rw_normalangle", "signature": "extern angle_t rw_normalangle;"}, {"doc": "angle to line origin", "kind": "variable", "line": 118, "name": "rw_angle1", "signature": "extern int rw_angle1;"}, {"doc": "Segs count?", "kind": "variable", "line": 121, "name": "sscount", "signature": "extern int sscount;"}, {"kind": "variable", "line": 123, "name": "floorplane", "signature": "extern visplane_t* floorplane;"}, {"kind": "variable", "line": 124, "name": "ceilingplane", "signature": "extern visplane_t* ceilingplane;"}, {"kind": "macro", "line": 21, "name": "__R_STATE__", "signature": "#define __R_STATE__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh of things, i.e. objects represented by sprites.", "id": "progs/doomgeneric/r_things.c", "kind": "module", "label": "r_things.c", "language": "c", "sha256": "c9fea2b898d4e1a8", "symbol_count": 17, "symbols": [{"kind": "struct", "line": 48, "name": "maskdraw_t"}, {"kind": "function", "line": 100, "name": "R_InstallSpriteLump", "signature": "void\nR_InstallSpriteLump\n( int\t\tlump,\n  unsigned\tframe,\n  unsigned\trotation,\n  boolean\tflipped )"}, {"doc": "R_InitSpriteDefs Pass a null terminated list of sprite names (4 chars exactly) to be used. Builds the sprite rotation matrixes to account for horizontally flipped sprites. Will report an error if the lumps are inconsistant. Only called at startup.  Sprite lump names are 4 characters for the actor, a letter for the frame, and a number for the rotation. A sprite that is flippable will have an additional letter/number appended. The rotation character can be 0 to signify no rotations.", "kind": "function", "line": 171, "name": "R_InitSpriteDefs", "signature": "void R_InitSpriteDefs (char** namelist)"}, {"doc": "R_InitSprites Called at program start.", "kind": "function", "line": 291, "name": "R_InitSprites", "signature": "void R_InitSprites (char** namelist)"}, {"doc": "R_ClearSprites Called at frame start.", "kind": "function", "line": 309, "name": "R_ClearSprites", "signature": "void R_ClearSprites (void)"}, {"kind": "function", "line": 320, "name": "R_NewVisSprite", "signature": "vissprite_t* R_NewVisSprite (void)"}, {"kind": "function", "line": 343, "name": "R_DrawMaskedColumn", "signature": "void R_DrawMaskedColumn (column_t* column)"}, {"kind": "function", "line": 389, "name": "R_DrawVisSprite", "signature": "void\nR_DrawVisSprite\n( vissprite_t*\t\tvis,\n  int\t\t\tx1,\n  int\t\t\tx2 )"}, {"doc": "R_ProjectSprite Generates a vissprite for a thing if it might be visible.", "kind": "function", "line": 444, "name": "R_ProjectSprite", "signature": "void R_ProjectSprite (mobj_t* thing)"}, {"doc": "R_AddSprites During BSP traversal, this adds sprites by sector.", "kind": "function", "line": 605, "name": "R_AddSprites", "signature": "void R_AddSprites (sector_t* sec)"}, {"doc": "R_DrawPSprite", "kind": "function", "line": 638, "name": "R_DrawPSprite", "signature": "void R_DrawPSprite (pspdef_t* psp)"}, {"doc": "R_DrawPlayerSprites", "kind": "function", "line": 738, "name": "R_DrawPlayerSprites", "signature": "void R_DrawPlayerSprites (void)"}, {"kind": "function", "line": 779, "name": "R_SortVisSprites", "signature": "void R_SortVisSprites (void)"}, {"kind": "function", "line": 837, "name": "R_DrawSprite", "signature": "void R_DrawSprite (vissprite_t* spr)"}, {"doc": "R_DrawMasked", "kind": "function", "line": 951, "name": "R_DrawMasked", "signature": "void R_DrawMasked (void)"}, {"kind": "macro", "line": 40, "name": "MINZ", "signature": "#define MINZ"}, {"kind": "macro", "line": 41, "name": "BASEYCENTER", "signature": "#define BASEYCENTER"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Rendering of moving objects, sprites.", "id": "progs/doomgeneric/r_things.h", "kind": "module", "label": "r_things.h", "language": "h", "sha256": "e42430dcb5255351", "symbol_count": 22, "symbols": [{"kind": "function", "line": 46, "name": "R_DrawMaskedColumn", "signature": "void R_DrawMaskedColumn (column_t* column);"}, {"kind": "function", "line": 49, "name": "R_SortVisSprites", "signature": "void R_SortVisSprites (void);"}, {"kind": "function", "line": 51, "name": "R_AddSprites", "signature": "void R_AddSprites (sector_t* sec);"}, {"kind": "function", "line": 52, "name": "R_AddPSprites", "signature": "void R_AddPSprites (void);"}, {"kind": "function", "line": 53, "name": "R_DrawSprites", "signature": "void R_DrawSprites (void);"}, {"kind": "function", "line": 54, "name": "R_InitSprites", "signature": "void R_InitSprites (char** namelist);"}, {"kind": "function", "line": 55, "name": "R_ClearSprites", "signature": "void R_ClearSprites (void);"}, {"kind": "function", "line": 56, "name": "R_DrawMasked", "signature": "void R_DrawMasked (void);"}, {"kind": "function", "line": 59, "name": "R_ClipVisSprite", "signature": "void R_ClipVisSprite ( vissprite_t* vis, int xl, int xh );"}, {"kind": "variable", "line": 27, "name": "vissprites", "signature": "extern vissprite_t vissprites[MAXVISSPRITES];"}, {"kind": "variable", "line": 28, "name": "vissprite_p", "signature": "extern vissprite_t* vissprite_p;"}, {"kind": "variable", "line": 29, "name": "vsprsortedhead", "signature": "extern vissprite_t vsprsortedhead;"}, {"doc": "Constant arrays used for psprite clipping and initializing clipping.", "kind": "variable", "line": 33, "name": "negonearray", "signature": "extern short negonearray[SCREENWIDTH];"}, {"kind": "variable", "line": 34, "name": "screenheightarray", "signature": "extern short screenheightarray[SCREENWIDTH];"}, {"doc": "vars for R_DrawMaskedColumn", "kind": "variable", "line": 37, "name": "mfloorclip", "signature": "extern short* mfloorclip;"}, {"kind": "variable", "line": 38, "name": "mceilingclip", "signature": "extern short* mceilingclip;"}, {"kind": "variable", "line": 39, "name": "spryscale", "signature": "extern fixed_t spryscale;"}, {"kind": "variable", "line": 40, "name": "sprtopscreen", "signature": "extern fixed_t sprtopscreen;"}, {"kind": "variable", "line": 42, "name": "pspritescale", "signature": "extern fixed_t pspritescale;"}, {"kind": "variable", "line": 43, "name": "pspriteiscale", "signature": "extern fixed_t pspriteiscale;"}, {"kind": "macro", "line": 21, "name": "__R_THINGS__", "signature": "#define __R_THINGS__"}, {"kind": "macro", "line": 25, "name": "MAXVISSPRITES", "signature": "#define MAXVISSPRITES"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none", "id": "progs/doomgeneric/s_sound.c", "kind": "module", "label": "s_sound.c", "language": "c", "sha256": "687c9ee8b66f9012", "symbol_count": 25, "symbols": [{"kind": "struct", "line": 66, "name": "channel_t"}, {"kind": "function", "line": 114, "name": "S_Init", "signature": "void S_Init(int sfxVolume, int musicVolume)"}, {"kind": "function", "line": 146, "name": "S_Shutdown", "signature": "void S_Shutdown(void)"}, {"kind": "function", "line": 152, "name": "S_StopChannel", "signature": "static void S_StopChannel(int cnum)"}, {"kind": "function", "line": 191, "name": "S_Start", "signature": "void S_Start(void)"}, {"kind": "function", "line": 243, "name": "S_StopSound", "signature": "void S_StopSound(mobj_t *origin)"}, {"kind": "function", "line": 262, "name": "S_GetChannel", "signature": "static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo)"}, {"kind": "function", "line": 323, "name": "S_AdjustSoundParams", "signature": "static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,\n                               i..."}, {"kind": "function", "line": 391, "name": "S_StartSound", "signature": "void S_StartSound(void *origin_p, int sfx_id)"}, {"kind": "function", "line": 482, "name": "S_PauseSound", "signature": "void S_PauseSound(void)"}, {"kind": "function", "line": 491, "name": "S_ResumeSound", "signature": "void S_ResumeSound(void)"}, {"kind": "function", "line": 504, "name": "S_UpdateSounds", "signature": "void S_UpdateSounds(mobj_t *listener)"}, {"kind": "function", "line": 571, "name": "S_SetMusicVolume", "signature": "void S_SetMusicVolume(int volume)"}, {"kind": "function", "line": 582, "name": "S_SetSfxVolume", "signature": "void S_SetSfxVolume(int volume)"}, {"kind": "function", "line": 596, "name": "S_StartMusic", "signature": "void S_StartMusic(int m_id)"}, {"kind": "function", "line": 601, "name": "S_ChangeMusic", "signature": "void S_ChangeMusic(int musicnum, int looping)"}, {"kind": "function", "line": 649, "name": "S_MusicPlaying", "signature": "boolean S_MusicPlaying(void)"}, {"kind": "function", "line": 654, "name": "S_StopMusic", "signature": "void S_StopMusic(void)"}, {"kind": "macro", "line": 44, "name": "S_CLIPPING_DIST", "signature": "#define S_CLIPPING_DIST"}, {"kind": "macro", "line": 52, "name": "S_CLOSE_DIST", "signature": "#define S_CLOSE_DIST"}, {"kind": "macro", "line": 56, "name": "S_ATTENUATOR", "signature": "#define S_ATTENUATOR"}, {"kind": "macro", "line": 60, "name": "S_STEREO_SWING", "signature": "#define S_STEREO_SWING"}, {"kind": "macro", "line": 62, "name": "NORM_PITCH", "signature": "#define NORM_PITCH"}, {"kind": "macro", "line": 63, "name": "NORM_PRIORITY", "signature": "#define NORM_PRIORITY"}, {"kind": "macro", "line": 64, "name": "NORM_SEP", "signature": "#define NORM_SEP"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The not so system specific sound interface.       Initializes sound stuff, including volume Sets channels, SFX and music volume, allocates channel buffer, sets S_sfx lookup.", "id": "progs/doomgeneric/s_sound.h", "kind": "module", "label": "s_sound.h", "language": "h", "sha256": "ae05ca9bc2170b54", "symbol_count": 15, "symbols": [{"kind": "function", "line": 32, "name": "S_Init", "signature": "void S_Init(int sfxVolume, int musicVolume);"}, {"kind": "function", "line": 37, "name": "S_Shutdown", "signature": "void S_Shutdown(void);"}, {"kind": "function", "line": 47, "name": "S_Start", "signature": "void S_Start(void);"}, {"kind": "function", "line": 54, "name": "S_StartSound", "signature": "void S_StartSound(void *origin, int sound_id);"}, {"doc": "Stop sound for thing at <origin>", "kind": "function", "line": 57, "name": "S_StopSound", "signature": "void S_StopSound(mobj_t *origin);"}, {"doc": "Start music using <music_id> from sounds.h", "kind": "function", "line": 61, "name": "S_StartMusic", "signature": "void S_StartMusic(int music_id);"}, {"doc": "Start music using <music_id> from sounds.h, and set whether looping", "kind": "function", "line": 65, "name": "S_ChangeMusic", "signature": "void S_ChangeMusic(int music_id, int looping);"}, {"doc": "Stops the music fer sure.", "kind": "function", "line": 71, "name": "S_StopMusic", "signature": "void S_StopMusic(void);"}, {"doc": "Stop and resume music, during game PAUSE.", "kind": "function", "line": 74, "name": "S_PauseSound", "signature": "void S_PauseSound(void);"}, {"kind": "function", "line": 75, "name": "S_ResumeSound", "signature": "void S_ResumeSound(void);"}, {"doc": "Updates music & sounds", "kind": "function", "line": 81, "name": "S_UpdateSounds", "signature": "void S_UpdateSounds(mobj_t *listener);"}, {"kind": "function", "line": 83, "name": "S_SetMusicVolume", "signature": "void S_SetMusicVolume(int volume);"}, {"kind": "function", "line": 84, "name": "S_SetSfxVolume", "signature": "void S_SetSfxVolume(int volume);"}, {"kind": "variable", "line": 86, "name": "snd_channels", "signature": "extern int snd_channels;"}, {"kind": "macro", "line": 21, "name": "__S_SOUND__", "signature": "#define __S_SOUND__"}]}, {"doc": "sha1.c - SHA1 hash function", "id": "progs/doomgeneric/sha1.c", "kind": "module", "label": "sha1.c", "language": "c", "sha256": "6dd3c3831615b8e7", "symbol_count": 19, "symbols": [{"kind": "function", "line": 40, "name": "SHA1_Init", "signature": "void SHA1_Init(sha1_context_t *hd)"}, {"doc": "Transform the message X which consists of 16 32-bit-words", "kind": "function", "line": 55, "name": "Transform", "signature": "static void Transform(sha1_context_t *hd, byte *data)"}, {"doc": "Update the message digest with the contents of INBUF with length INLEN.", "kind": "function", "line": 198, "name": "SHA1_Update", "signature": "void SHA1_Update(sha1_context_t *hd, byte *inbuf, size_t inlen)"}, {"kind": "function", "line": 238, "name": "SHA1_Final", "signature": "void SHA1_Final(sha1_digest_t digest, sha1_context_t *hd)"}, {"kind": "function", "line": 303, "name": "SHA1_UpdateInt32", "signature": "void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val)"}, {"kind": "function", "line": 315, "name": "SHA1_UpdateString", "signature": "void SHA1_UpdateString(sha1_context_t *context, char *str)"}, {"kind": "macro", "line": 84, "name": "K1", "signature": "#define K1"}, {"kind": "macro", "line": 85, "name": "K2", "signature": "#define K2"}, {"kind": "macro", "line": 86, "name": "K3", "signature": "#define K3"}, {"kind": "macro", "line": 87, "name": "K4", "signature": "#define K4"}, {"kind": "macro", "line": 88, "name": "F1", "signature": "#define F1(x,y,z)"}, {"kind": "macro", "line": 89, "name": "F2", "signature": "#define F2(x,y,z)"}, {"kind": "macro", "line": 90, "name": "F3", "signature": "#define F3(x,y,z)"}, {"kind": "macro", "line": 91, "name": "F4", "signature": "#define F4(x,y,z)"}, {"kind": "macro", "line": 93, "name": "rol", "signature": "#define rol(x,n)"}, {"kind": "macro", "line": 95, "name": "M", "signature": "#define M(i)"}, {"kind": "macro", "line": 99, "name": "R", "signature": "#define R(a,b,c,d,e,f,k,m)"}, {"kind": "macro", "line": 288, "name": "X", "signature": "#define X(a)"}, {"kind": "macro", "line": 290, "name": "X", "signature": "#define X(a)"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: SHA-1 digest.", "id": "progs/doomgeneric/sha1.h", "kind": "module", "label": "sha1.h", "language": "h", "sha256": "80273e50ac3b1907", "symbol_count": 9, "symbols": [{"kind": "struct", "line": 26, "name": "sha1_context_s"}, {"doc": "include \"doomtype.h\"", "kind": "type_alias", "line": 22, "name": "sha1_context_t", "signature": "typedef struct sha1_context_s sha1_context_t;"}, {"kind": "type_alias", "line": 24, "name": "sha1_digest_t", "signature": "typedef byte sha1_digest_t[20];"}, {"kind": "function", "line": 33, "name": "SHA1_Init", "signature": "void SHA1_Init(sha1_context_t *context);"}, {"kind": "function", "line": 34, "name": "SHA1_Update", "signature": "void SHA1_Update(sha1_context_t *context, byte *buf, size_t len);"}, {"kind": "function", "line": 35, "name": "SHA1_Final", "signature": "void SHA1_Final(sha1_digest_t digest, sha1_context_t *context);"}, {"kind": "function", "line": 36, "name": "SHA1_UpdateInt32", "signature": "void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val);"}, {"kind": "function", "line": 37, "name": "SHA1_UpdateString", "signature": "void SHA1_UpdateString(sha1_context_t *context, char *str);"}, {"kind": "macro", "line": 19, "name": "__SHA1_H__", "signature": "#define __SHA1_H__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Created by a sound utility. Kept as a sample, DOOM2 sounds.        Information about all the music", "id": "progs/doomgeneric/sounds.c", "kind": "module", "label": "sounds.c", "language": "c", "sha256": "cc955e6f5679ae53", "symbol_count": 3, "symbols": [{"kind": "macro", "line": 31, "name": "MUSIC", "signature": "#define MUSIC(name)"}, {"kind": "macro", "line": 111, "name": "SOUND", "signature": "#define SOUND(name, priority)"}, {"kind": "macro", "line": 113, "name": "SOUND_LINK", "signature": "#define SOUND_LINK(name, priority, link_id, pitch, volume)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Created by the sound utility written by Dave Taylor. Kept as a sample, DOOM2  sounds. Frozen.     the complete set of sound effects", "id": "progs/doomgeneric/sounds.h", "kind": "module", "label": "sounds.h", "language": "h", "sha256": "11d2c0a233fe8a99", "symbol_count": 3, "symbols": [{"doc": "the complete set of sound effects", "kind": "variable", "line": 26, "name": "S_sfx", "signature": "extern sfxinfo_t S_sfx[];"}, {"doc": "the complete set of music", "kind": "variable", "line": 29, "name": "S_music", "signature": "extern musicinfo_t S_music[];"}, {"kind": "macro", "line": 21, "name": "__SOUNDS__", "signature": "#define __SOUNDS__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The status bar widget code.", "id": "progs/doomgeneric/st_lib.c", "kind": "module", "label": "st_lib.c", "language": "c", "sha256": "ecdd1b524fc4ac8d", "symbol_count": 11, "symbols": [{"kind": "function", "line": 51, "name": "STlib_init", "signature": "void STlib_init(void)"}, {"kind": "function", "line": 59, "name": "STlib_initNum", "signature": "void\nSTlib_initNum\n( st_number_t*\t\tn,\n  int\t\t\tx,\n  int\t\t\ty,\n  patch_t**\t\tpl,\n  int*\t\t\tnum,\n  bool..."}, {"kind": "function", "line": 84, "name": "STlib_drawNum", "signature": "void\nSTlib_drawNum\n( st_number_t*\tn,\n  boolean\trefresh )"}, {"kind": "function", "line": 146, "name": "STlib_updateNum", "signature": "void\nSTlib_updateNum\n( st_number_t*\t\tn,\n  boolean\t\trefresh )"}, {"kind": "function", "line": 156, "name": "STlib_initPercent", "signature": "void\nSTlib_initPercent\n( st_percent_t*\t\tp,\n  int\t\t\tx,\n  int\t\t\ty,\n  patch_t**\t\tpl,\n  int*\t\t\tnum,\n ..."}, {"kind": "function", "line": 173, "name": "STlib_updatePercent", "signature": "void\nSTlib_updatePercent\n( st_percent_t*\t\tper,\n  int\t\t\trefresh )"}, {"kind": "function", "line": 186, "name": "STlib_initMultIcon", "signature": "void\nSTlib_initMultIcon\n( st_multicon_t*\ti,\n  int\t\t\tx,\n  int\t\t\ty,\n  patch_t**\t\til,\n  int*\t\t\tinum,..."}, {"kind": "function", "line": 205, "name": "STlib_updateMultIcon", "signature": "void\nSTlib_updateMultIcon\n( st_multicon_t*\tmi,\n  boolean\t\trefresh )"}, {"kind": "function", "line": 236, "name": "STlib_initBinIcon", "signature": "void\nSTlib_initBinIcon\n( st_binicon_t*\t\tb,\n  int\t\t\tx,\n  int\t\t\ty,\n  patch_t*\t\ti,\n  boolean*\t\tval,\n..."}, {"kind": "function", "line": 255, "name": "STlib_updateBinIcon", "signature": "void\nSTlib_updateBinIcon\n( st_binicon_t*\t\tbi,\n  boolean\t\trefresh )"}, {"doc": "in AM_map.c", "kind": "variable", "line": 40, "name": "automapactive", "signature": "extern boolean automapactive;"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The status bar widget code.     We are referring to patches.   Typedefs of widgets   Number widget", "id": "progs/doomgeneric/st_lib.h", "kind": "module", "label": "st_lib.h", "language": "h", "sha256": "b4b351b3ccbe30cd", "symbol_count": 14, "symbols": [{"kind": "struct", "line": 32, "name": "st_number_t"}, {"doc": "Percent widget (\"child\" of number widget, or, more precisely, contains a number widget.)", "kind": "struct", "line": 64, "name": "st_percent_t"}, {"doc": "Multiple Icon widget", "kind": "struct", "line": 77, "name": "st_multicon_t"}, {"kind": "struct", "line": 106, "name": "st_binicon_t"}, {"doc": "Initializes widget library. More precisely, initialize STMINUS, everything else is done somewhere else.", "kind": "function", "line": 138, "name": "STlib_init", "signature": "void STlib_init(void);"}, {"kind": "function", "line": 144, "name": "STlib_initNum", "signature": "void STlib_initNum ( st_number_t* n, int x, int y, patch_t** pl, int* num, boolean* on, int width );"}, {"kind": "function", "line": 154, "name": "STlib_updateNum", "signature": "void STlib_updateNum ( st_number_t* n, boolean refresh );"}, {"kind": "function", "line": 161, "name": "STlib_initPercent", "signature": "void STlib_initPercent ( st_percent_t* p, int x, int y, patch_t** pl, int* num, boolean* on, patch_t* percent );"}, {"kind": "function", "line": 172, "name": "STlib_updatePercent", "signature": "void STlib_updatePercent ( st_percent_t* per, int refresh );"}, {"kind": "function", "line": 179, "name": "STlib_initMultIcon", "signature": "void STlib_initMultIcon ( st_multicon_t* mi, int x, int y, patch_t** il, int* inum, boolean* on );"}, {"kind": "function", "line": 189, "name": "STlib_updateMultIcon", "signature": "void STlib_updateMultIcon ( st_multicon_t* mi, boolean refresh );"}, {"kind": "function", "line": 196, "name": "STlib_initBinIcon", "signature": "void STlib_initBinIcon ( st_binicon_t* b, int x, int y, patch_t* i, boolean* val, boolean* on );"}, {"kind": "function", "line": 205, "name": "STlib_updateBinIcon", "signature": "void STlib_updateBinIcon ( st_binicon_t* bi, boolean refresh );"}, {"kind": "macro", "line": 20, "name": "__STLIB__", "signature": "#define __STLIB__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Status bar code. Does the face/direction indicator animatin. Does palette indicators as well (red pain/berserk, bright pickup)", "id": "progs/doomgeneric/st_stuff.c", "kind": "module", "label": "st_stuff.c", "language": "c", "sha256": "d22d1bd40509c02c", "symbol_count": 137, "symbols": [{"kind": "function", "line": 416, "name": "ST_refreshBackground", "signature": "void ST_refreshBackground(void)"}, {"kind": "function", "line": 439, "name": "ST_Responder", "signature": "boolean\nST_Responder (event_t* ev)"}, {"kind": "function", "line": 665, "name": "ST_calcPainOffset", "signature": "int ST_calcPainOffset(void)"}, {"doc": "This is a not-very-pretty routine which handles the face states and their timing. the precedence of expressions is: dead > evil grin > turned head > straight ahead", "kind": "function", "line": 688, "name": "ST_updateFaceWidget", "signature": "void ST_updateFaceWidget(void)"}, {"kind": "function", "line": 860, "name": "ST_updateWidgets", "signature": "void ST_updateWidgets(void)"}, {"kind": "function", "line": 924, "name": "ST_Ticker", "signature": "void ST_Ticker (void)"}, {"kind": "function", "line": 936, "name": "ST_doPaletteStuff", "signature": "void ST_doPaletteStuff(void)"}, {"kind": "function", "line": 1001, "name": "ST_drawWidgets", "signature": "void ST_drawWidgets(boolean refresh)"}, {"kind": "function", "line": 1036, "name": "ST_doRefresh", "signature": "void ST_doRefresh(void)"}, {"kind": "function", "line": 1049, "name": "ST_diffDraw", "signature": "void ST_diffDraw(void)"}, {"kind": "function", "line": 1055, "name": "ST_Drawer", "signature": "void ST_Drawer (boolean fullscreen, boolean refresh)"}, {"kind": "function", "line": 1076, "name": "ST_loadUnloadGraphics", "signature": "static void ST_loadUnloadGraphics(load_callback_t callback)"}, {"kind": "function", "line": 1162, "name": "ST_loadCallback", "signature": "static void ST_loadCallback(char *lumpname, patch_t **variable)"}, {"kind": "function", "line": 1167, "name": "ST_loadGraphics", "signature": "void ST_loadGraphics(void)"}, {"kind": "function", "line": 1172, "name": "ST_loadData", "signature": "void ST_loadData(void)"}, {"kind": "function", "line": 1178, "name": "ST_unloadCallback", "signature": "static void ST_unloadCallback(char *lumpname, patch_t **variable)"}, {"kind": "function", "line": 1184, "name": "ST_unloadGraphics", "signature": "void ST_unloadGraphics(void)"}, {"kind": "function", "line": 1189, "name": "ST_unloadData", "signature": "void ST_unloadData(void)"}, {"kind": "function", "line": 1194, "name": "ST_initData", "signature": "void ST_initData(void)"}, {"kind": "function", "line": 1227, "name": "ST_createWidgets", "signature": "void ST_createWidgets(void)"}, {"kind": "function", "line": 1389, "name": "ST_Start", "signature": "void ST_Start (void)"}, {"kind": "function", "line": 1401, "name": "ST_Stop", "signature": "void ST_Stop (void)"}, {"kind": "function", "line": 1411, "name": "ST_Init", "signature": "void ST_Init (void)"}, {"kind": "macro", "line": 68, "name": "STARTREDPALS", "signature": "#define STARTREDPALS"}, {"kind": "macro", "line": 69, "name": "STARTBONUSPALS", "signature": "#define STARTBONUSPALS"}, {"kind": "macro", "line": 70, "name": "NUMREDPALS", "signature": "#define NUMREDPALS"}, {"kind": "macro", "line": 71, "name": "NUMBONUSPALS", "signature": "#define NUMBONUSPALS"}, {"kind": "macro", "line": 73, "name": "RADIATIONPAL", "signature": "#define RADIATIONPAL"}, {"kind": "macro", "line": 77, "name": "ST_FACEPROBABILITY", "signature": "#define ST_FACEPROBABILITY"}, {"kind": "macro", "line": 80, "name": "ST_TOGGLECHAT", "signature": "#define ST_TOGGLECHAT"}, {"kind": "macro", "line": 83, "name": "ST_X", "signature": "#define ST_X"}, {"kind": "macro", "line": 84, "name": "ST_X2", "signature": "#define ST_X2"}, {"kind": "macro", "line": 86, "name": "ST_FX", "signature": "#define ST_FX"}, {"kind": "macro", "line": 87, "name": "ST_FY", "signature": "#define ST_FY"}, {"kind": "macro", "line": 91, "name": "ST_TALLNUMWIDTH", "signature": "#define ST_TALLNUMWIDTH"}, {"kind": "macro", "line": 94, "name": "ST_NUMPAINFACES", "signature": "#define ST_NUMPAINFACES"}, {"kind": "macro", "line": 95, "name": "ST_NUMSTRAIGHTFACES", "signature": "#define ST_NUMSTRAIGHTFACES"}, {"kind": "macro", "line": 96, "name": "ST_NUMTURNFACES", "signature": "#define ST_NUMTURNFACES"}, {"kind": "macro", "line": 97, "name": "ST_NUMSPECIALFACES", "signature": "#define ST_NUMSPECIALFACES"}, {"kind": "macro", "line": 99, "name": "ST_FACESTRIDE", "signature": "#define ST_FACESTRIDE"}, {"kind": "macro", "line": 102, "name": "ST_NUMEXTRAFACES", "signature": "#define ST_NUMEXTRAFACES"}, {"kind": "macro", "line": 104, "name": "ST_NUMFACES", "signature": "#define ST_NUMFACES"}, {"kind": "macro", "line": 107, "name": "ST_TURNOFFSET", "signature": "#define ST_TURNOFFSET"}, {"kind": "macro", "line": 108, "name": "ST_OUCHOFFSET", "signature": "#define ST_OUCHOFFSET"}, {"kind": "macro", "line": 109, "name": "ST_EVILGRINOFFSET", "signature": "#define ST_EVILGRINOFFSET"}, {"kind": "macro", "line": 110, "name": "ST_RAMPAGEOFFSET", "signature": "#define ST_RAMPAGEOFFSET"}, {"kind": "macro", "line": 111, "name": "ST_GODFACE", "signature": "#define ST_GODFACE"}, {"kind": "macro", "line": 112, "name": "ST_DEADFACE", "signature": "#define ST_DEADFACE"}, {"kind": "macro", "line": 114, "name": "ST_FACESX", "signature": "#define ST_FACESX"}, {"kind": "macro", "line": 115, "name": "ST_FACESY", "signature": "#define ST_FACESY"}, {"kind": "macro", "line": 117, "name": "ST_EVILGRINCOUNT", "signature": "#define ST_EVILGRINCOUNT"}, {"kind": "macro", "line": 118, "name": "ST_STRAIGHTFACECOUNT", "signature": "#define ST_STRAIGHTFACECOUNT"}, {"kind": "macro", "line": 119, "name": "ST_TURNCOUNT", "signature": "#define ST_TURNCOUNT"}, {"kind": "macro", "line": 120, "name": "ST_OUCHCOUNT", "signature": "#define ST_OUCHCOUNT"}, {"kind": "macro", "line": 121, "name": "ST_RAMPAGEDELAY", "signature": "#define ST_RAMPAGEDELAY"}, {"kind": "macro", "line": 123, "name": "ST_MUCHPAIN", "signature": "#define ST_MUCHPAIN"}, {"kind": "macro", "line": 135, "name": "ST_AMMOWIDTH", "signature": "#define ST_AMMOWIDTH"}, {"kind": "macro", "line": 136, "name": "ST_AMMOX", "signature": "#define ST_AMMOX"}, {"kind": "macro", "line": 137, "name": "ST_AMMOY", "signature": "#define ST_AMMOY"}, {"kind": "macro", "line": 140, "name": "ST_HEALTHWIDTH", "signature": "#define ST_HEALTHWIDTH"}, {"kind": "macro", "line": 141, "name": "ST_HEALTHX", "signature": "#define ST_HEALTHX"}, {"kind": "macro", "line": 142, "name": "ST_HEALTHY", "signature": "#define ST_HEALTHY"}, {"kind": "macro", "line": 145, "name": "ST_ARMSX", "signature": "#define ST_ARMSX"}, {"kind": "macro", "line": 146, "name": "ST_ARMSY", "signature": "#define ST_ARMSY"}, {"kind": "macro", "line": 147, "name": "ST_ARMSBGX", "signature": "#define ST_ARMSBGX"}, {"kind": "macro", "line": 148, "name": "ST_ARMSBGY", "signature": "#define ST_ARMSBGY"}, {"kind": "macro", "line": 149, "name": "ST_ARMSXSPACE", "signature": "#define ST_ARMSXSPACE"}, {"kind": "macro", "line": 150, "name": "ST_ARMSYSPACE", "signature": "#define ST_ARMSYSPACE"}, {"kind": "macro", "line": 153, "name": "ST_FRAGSX", "signature": "#define ST_FRAGSX"}, {"kind": "macro", "line": 154, "name": "ST_FRAGSY", "signature": "#define ST_FRAGSY"}, {"kind": "macro", "line": 155, "name": "ST_FRAGSWIDTH", "signature": "#define ST_FRAGSWIDTH"}, {"kind": "macro", "line": 158, "name": "ST_ARMORWIDTH", "signature": "#define ST_ARMORWIDTH"}, {"kind": "macro", "line": 159, "name": "ST_ARMORX", "signature": "#define ST_ARMORX"}, {"kind": "macro", "line": 160, "name": "ST_ARMORY", "signature": "#define ST_ARMORY"}, {"kind": "macro", "line": 163, "name": "ST_KEY0WIDTH", "signature": "#define ST_KEY0WIDTH"}, {"kind": "macro", "line": 164, "name": "ST_KEY0HEIGHT", "signature": "#define ST_KEY0HEIGHT"}, {"kind": "macro", "line": 165, "name": "ST_KEY0X", "signature": "#define ST_KEY0X"}, {"kind": "macro", "line": 166, "name": "ST_KEY0Y", "signature": "#define ST_KEY0Y"}, {"kind": "macro", "line": 167, "name": "ST_KEY1WIDTH", "signature": "#define ST_KEY1WIDTH"}, {"kind": "macro", "line": 168, "name": "ST_KEY1X", "signature": "#define ST_KEY1X"}, {"kind": "macro", "line": 169, "name": "ST_KEY1Y", "signature": "#define ST_KEY1Y"}, {"kind": "macro", "line": 170, "name": "ST_KEY2WIDTH", "signature": "#define ST_KEY2WIDTH"}, {"kind": "macro", "line": 171, "name": "ST_KEY2X", "signature": "#define ST_KEY2X"}, {"kind": "macro", "line": 172, "name": "ST_KEY2Y", "signature": "#define ST_KEY2Y"}, {"kind": "macro", "line": 175, "name": "ST_AMMO0WIDTH", "signature": "#define ST_AMMO0WIDTH"}, {"kind": "macro", "line": 176, "name": "ST_AMMO0HEIGHT", "signature": "#define ST_AMMO0HEIGHT"}, {"kind": "macro", "line": 177, "name": "ST_AMMO0X", "signature": "#define ST_AMMO0X"}, {"kind": "macro", "line": 178, "name": "ST_AMMO0Y", "signature": "#define ST_AMMO0Y"}, {"kind": "macro", "line": 179, "name": "ST_AMMO1WIDTH", "signature": "#define ST_AMMO1WIDTH"}, {"kind": "macro", "line": 180, "name": "ST_AMMO1X", "signature": "#define ST_AMMO1X"}, {"kind": "macro", "line": 181, "name": "ST_AMMO1Y", "signature": "#define ST_AMMO1Y"}, {"kind": "macro", "line": 182, "name": "ST_AMMO2WIDTH", "signature": "#define ST_AMMO2WIDTH"}, {"kind": "macro", "line": 183, "name": "ST_AMMO2X", "signature": "#define ST_AMMO2X"}, {"kind": "macro", "line": 184, "name": "ST_AMMO2Y", "signature": "#define ST_AMMO2Y"}, {"kind": "macro", "line": 185, "name": "ST_AMMO3WIDTH", "signature": "#define ST_AMMO3WIDTH"}, {"kind": "macro", "line": 186, "name": "ST_AMMO3X", "signature": "#define ST_AMMO3X"}, {"kind": "macro", "line": 187, "name": "ST_AMMO3Y", "signature": "#define ST_AMMO3Y"}, {"kind": "macro", "line": 191, "name": "ST_MAXAMMO0WIDTH", "signature": "#define ST_MAXAMMO0WIDTH"}, {"kind": "macro", "line": 192, "name": "ST_MAXAMMO0HEIGHT", "signature": "#define ST_MAXAMMO0HEIGHT"}, {"kind": "macro", "line": 193, "name": "ST_MAXAMMO0X", "signature": "#define ST_MAXAMMO0X"}, {"kind": "macro", "line": 194, "name": "ST_MAXAMMO0Y", "signature": "#define ST_MAXAMMO0Y"}, {"kind": "macro", "line": 195, "name": "ST_MAXAMMO1WIDTH", "signature": "#define ST_MAXAMMO1WIDTH"}, {"kind": "macro", "line": 196, "name": "ST_MAXAMMO1X", "signature": "#define ST_MAXAMMO1X"}, {"kind": "macro", "line": 197, "name": "ST_MAXAMMO1Y", "signature": "#define ST_MAXAMMO1Y"}, {"kind": "macro", "line": 198, "name": "ST_MAXAMMO2WIDTH", "signature": "#define ST_MAXAMMO2WIDTH"}, {"kind": "macro", "line": 199, "name": "ST_MAXAMMO2X", "signature": "#define ST_MAXAMMO2X"}, {"kind": "macro", "line": 200, "name": "ST_MAXAMMO2Y", "signature": "#define ST_MAXAMMO2Y"}, {"kind": "macro", "line": 201, "name": "ST_MAXAMMO3WIDTH", "signature": "#define ST_MAXAMMO3WIDTH"}, {"kind": "macro", "line": 202, "name": "ST_MAXAMMO3X", "signature": "#define ST_MAXAMMO3X"}, {"kind": "macro", "line": 203, "name": "ST_MAXAMMO3Y", "signature": "#define ST_MAXAMMO3Y"}, {"kind": "macro", "line": 206, "name": "ST_WEAPON0X", "signature": "#define ST_WEAPON0X"}, {"kind": "macro", "line": 207, "name": "ST_WEAPON0Y", "signature": "#define ST_WEAPON0Y"}, {"kind": "macro", "line": 210, "name": "ST_WEAPON1X", "signature": "#define ST_WEAPON1X"}, {"kind": "macro", "line": 211, "name": "ST_WEAPON1Y", "signature": "#define ST_WEAPON1Y"}, {"kind": "macro", "line": 214, "name": "ST_WEAPON2X", "signature": "#define ST_WEAPON2X"}, {"kind": "macro", "line": 215, "name": "ST_WEAPON2Y", "signature": "#define ST_WEAPON2Y"}, {"kind": "macro", "line": 218, "name": "ST_WEAPON3X", "signature": "#define ST_WEAPON3X"}, {"kind": "macro", "line": 219, "name": "ST_WEAPON3Y", "signature": "#define ST_WEAPON3Y"}, {"kind": "macro", "line": 222, "name": "ST_WEAPON4X", "signature": "#define ST_WEAPON4X"}, {"kind": "macro", "line": 223, "name": "ST_WEAPON4Y", "signature": "#define ST_WEAPON4Y"}, {"kind": "macro", "line": 226, "name": "ST_WEAPON5X", "signature": "#define ST_WEAPON5X"}, {"kind": "macro", "line": 227, "name": "ST_WEAPON5Y", "signature": "#define ST_WEAPON5Y"}, {"kind": "macro", "line": 230, "name": "ST_WPNSX", "signature": "#define ST_WPNSX"}, {"kind": "macro", "line": 231, "name": "ST_WPNSY", "signature": "#define ST_WPNSY"}, {"kind": "macro", "line": 234, "name": "ST_DETHX", "signature": "#define ST_DETHX"}, {"kind": "macro", "line": 235, "name": "ST_DETHY", "signature": "#define ST_DETHY"}, {"kind": "macro", "line": 241, "name": "ST_MSGTEXTX", "signature": "#define ST_MSGTEXTX"}, {"kind": "macro", "line": 242, "name": "ST_MSGTEXTY", "signature": "#define ST_MSGTEXTY"}, {"kind": "macro", "line": 244, "name": "ST_MSGWIDTH", "signature": "#define ST_MSGWIDTH"}, {"kind": "macro", "line": 246, "name": "ST_MSGHEIGHT", "signature": "#define ST_MSGHEIGHT"}, {"kind": "macro", "line": 248, "name": "ST_OUTTEXTX", "signature": "#define ST_OUTTEXTX"}, {"kind": "macro", "line": 249, "name": "ST_OUTTEXTY", "signature": "#define ST_OUTTEXTY"}, {"kind": "macro", "line": 252, "name": "ST_OUTWIDTH", "signature": "#define ST_OUTWIDTH"}, {"kind": "macro", "line": 254, "name": "ST_OUTHEIGHT", "signature": "#define ST_OUTHEIGHT"}, {"kind": "macro", "line": 256, "name": "ST_MAPTITLEX", "signature": "#define ST_MAPTITLEX"}, {"kind": "macro", "line": 259, "name": "ST_MAPTITLEY", "signature": "#define ST_MAPTITLEY"}, {"kind": "macro", "line": 260, "name": "ST_MAPHEIGHT", "signature": "#define ST_MAPHEIGHT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Status bar code. Does the face/direction indicator animatin. Does palette indicators as well (red pain/berserk, bright pickup)     Size of statusbar. Now sensitive for scaling.", "id": "progs/doomgeneric/st_stuff.h", "kind": "module", "label": "st_stuff.h", "language": "h", "sha256": "00c12d7ad00b8d50", "symbol_count": 19, "symbols": [{"doc": "Called by main loop.", "kind": "function", "line": 43, "name": "ST_Ticker", "signature": "void ST_Ticker (void);"}, {"doc": "Called by main loop.", "kind": "function", "line": 46, "name": "ST_Drawer", "signature": "void ST_Drawer (boolean fullscreen, boolean refresh);"}, {"doc": "Called when the console player is spawned on each level.", "kind": "function", "line": 49, "name": "ST_Start", "signature": "void ST_Start (void);"}, {"doc": "Called by startup code.", "kind": "function", "line": 52, "name": "ST_Init", "signature": "void ST_Init (void);"}, {"kind": "variable", "line": 76, "name": "st_backing_screen", "signature": "extern byte *st_backing_screen;"}, {"kind": "variable", "line": 77, "name": "cheat_mus", "signature": "extern cheatseq_t cheat_mus;"}, {"kind": "variable", "line": 78, "name": "cheat_god", "signature": "extern cheatseq_t cheat_god;"}, {"kind": "variable", "line": 79, "name": "cheat_ammo", "signature": "extern cheatseq_t cheat_ammo;"}, {"kind": "variable", "line": 80, "name": "cheat_ammonokey", "signature": "extern cheatseq_t cheat_ammonokey;"}, {"kind": "variable", "line": 81, "name": "cheat_noclip", "signature": "extern cheatseq_t cheat_noclip;"}, {"kind": "variable", "line": 82, "name": "cheat_commercial_noclip", "signature": "extern cheatseq_t cheat_commercial_noclip;"}, {"kind": "variable", "line": 83, "name": "cheat_powerup", "signature": "extern cheatseq_t cheat_powerup[7];"}, {"kind": "variable", "line": 84, "name": "cheat_choppers", "signature": "extern cheatseq_t cheat_choppers;"}, {"kind": "variable", "line": 85, "name": "cheat_clev", "signature": "extern cheatseq_t cheat_clev;"}, {"kind": "variable", "line": 86, "name": "cheat_mypos", "signature": "extern cheatseq_t cheat_mypos;"}, {"kind": "macro", "line": 22, "name": "__STSTUFF_H__", "signature": "#define __STSTUFF_H__"}, {"kind": "macro", "line": 30, "name": "ST_HEIGHT", "signature": "#define ST_HEIGHT"}, {"kind": "macro", "line": 31, "name": "ST_WIDTH", "signature": "#define ST_WIDTH"}, {"kind": "macro", "line": 32, "name": "ST_Y", "signature": "#define ST_Y"}]}, {"id": "progs/doomgeneric/statdump.c", "kind": "module", "label": "statdump.c", "language": "c", "sha256": "af1299bfda45515d", "symbol_count": 11, "symbols": [{"kind": "function", "line": 71, "name": "DiscoverGamemode", "signature": "static void DiscoverGamemode(wbstartstruct_t *stats, int num_stats)"}, {"kind": "function", "line": 130, "name": "GetNumPlayers", "signature": "static int GetNumPlayers(wbstartstruct_t *stats)"}, {"kind": "function", "line": 150, "name": "PrintBanner", "signature": "static void PrintBanner(FILE *stream)"}, {"kind": "function", "line": 155, "name": "PrintPercentage", "signature": "static void PrintPercentage(FILE *stream, int amount, int total)"}, {"kind": "function", "line": 180, "name": "PrintPlayerStats", "signature": "static void PrintPlayerStats(FILE *stream, wbstartstruct_t *stats,\n        int player_num)"}, {"kind": "function", "line": 213, "name": "PrintFragsTable", "signature": "static void PrintFragsTable(FILE *stream, wbstartstruct_t *stats)"}, {"kind": "function", "line": 272, "name": "PrintLevelName", "signature": "static void PrintLevelName(FILE *stream, int episode, int level)"}, {"kind": "function", "line": 301, "name": "PrintStats", "signature": "static void PrintStats(FILE *stream, wbstartstruct_t *stats)"}, {"kind": "function", "line": 333, "name": "StatCopy", "signature": "void StatCopy(wbstartstruct_t *stats)"}, {"kind": "function", "line": 343, "name": "StatDump", "signature": "void StatDump(void)"}, {"kind": "macro", "line": 56, "name": "MAX_CAPTURES", "signature": "#define MAX_CAPTURES"}]}, {"id": "progs/doomgeneric/statdump.h", "kind": "module", "label": "statdump.h", "language": "h", "sha256": "751e90ff887c601e", "symbol_count": 3, "symbols": [{"kind": "function", "line": 20, "name": "StatCopy", "signature": "void StatCopy(wbstartstruct_t *stats);"}, {"kind": "function", "line": 21, "name": "StatDump", "signature": "void StatDump(void);"}, {"kind": "macro", "line": 18, "name": "DOOM_STATDUMP_H", "signature": "#define DOOM_STATDUMP_H"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Lookup tables. Do not try to look them up :-). In the order of appearance:  int finetangent[4096]\t- Tangens LUT. Should work with BAM fairly well (12 of 16bit, effectively, by shifting).  int finesine[10240]\t\t- Sine lookup. Guess what, serves as cosine, too. Remarkable thing is, how to use BAMs with this?  int tantoangle[2049]\t- ArcTan LUT, maps tan(angle) to angle fast. Gotta search.", "id": "progs/doomgeneric/tables.c", "kind": "module", "label": "tables.c", "language": "c", "sha256": "01d3e7829691f4af", "symbol_count": 1, "symbols": [{"kind": "function", "line": 41, "name": "SlopeDiv", "signature": "int SlopeDiv(unsigned int num, unsigned int den)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Lookup tables. Do not try to look them up :-). In the order of appearance:  int finetangent[4096]\t- Tangens LUT. Should work with BAM fairly well (12 of 16bit, effectively, by shifting).  int finesine[10240]\t\t- Sine lookup. Guess what, serves as cosine, too. Remarkable thing is, how to use BAMs with this?  int tantoangle[2049]\t- ArcTan LUT, maps tan(angle) to angle fast. Gotta search.", "id": "progs/doomgeneric/tables.h", "kind": "module", "label": "tables.h", "language": "h", "sha256": "66fa027ccaa100e6", "symbol_count": 21, "symbols": [{"doc": "define SLOPERANGE\t\t2048 define SLOPEBITS\t\t11 define DBITS\t\t\t(FRACBITS-SLOPEBITS)", "kind": "type_alias", "line": 80, "name": "angle_t", "signature": "typedef unsigned angle_t;"}, {"doc": "Utility function, called by R_PointToAngle.", "kind": "function", "line": 92, "name": "SlopeDiv", "signature": "int SlopeDiv(unsigned int num, unsigned int den);"}, {"doc": "Effective size is 10240.", "kind": "variable", "line": 49, "name": "finesine", "signature": "extern const fixed_t finesine[5*FINEANGLES/4];"}, {"doc": "Re-use data, is just PI/2 pahse shift.", "kind": "variable", "line": 52, "name": "finecosine", "signature": "extern const fixed_t *finecosine;"}, {"doc": "Effective size is 4096.", "kind": "variable", "line": 56, "name": "finetangent", "signature": "extern const fixed_t finetangent[FINEANGLES/2];"}, {"doc": "Effective size is 2049; The +1 size is to handle the case when x==y without additional checking.", "kind": "variable", "line": 87, "name": "tantoangle", "signature": "extern const angle_t tantoangle[SLOPERANGE+1];"}, {"kind": "macro", "line": 35, "name": "__TABLES__", "signature": "#define __TABLES__"}, {"kind": "macro", "line": 41, "name": "FINEANGLES", "signature": "#define FINEANGLES"}, {"kind": "macro", "line": 42, "name": "FINEMASK", "signature": "#define FINEMASK"}, {"kind": "macro", "line": 46, "name": "ANGLETOFINESHIFT", "signature": "#define ANGLETOFINESHIFT"}, {"kind": "macro", "line": 63, "name": "ANG45", "signature": "#define ANG45"}, {"kind": "macro", "line": 64, "name": "ANG90", "signature": "#define ANG90"}, {"kind": "macro", "line": 65, "name": "ANG180", "signature": "#define ANG180"}, {"kind": "macro", "line": 66, "name": "ANG270", "signature": "#define ANG270"}, {"kind": "macro", "line": 67, "name": "ANG_MAX", "signature": "#define ANG_MAX"}, {"kind": "macro", "line": 69, "name": "ANG1", "signature": "#define ANG1"}, {"kind": "macro", "line": 70, "name": "ANG60", "signature": "#define ANG60"}, {"kind": "macro", "line": 75, "name": "ANG1_X", "signature": "#define ANG1_X"}, {"kind": "macro", "line": 77, "name": "SLOPERANGE", "signature": "#define SLOPERANGE"}, {"kind": "macro", "line": 78, "name": "SLOPEBITS", "signature": "#define SLOPEBITS"}, {"kind": "macro", "line": 79, "name": "DBITS", "signature": "#define DBITS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh/rendering module, shared data struct definitions.     Patches. A patch holds one or more columns. Patches are used for sprites and all masked pictures, and we compose textures from the TEXTURE1/2 lists of patches.", "id": "progs/doomgeneric/v_patch.h", "kind": "module", "label": "v_patch.h", "language": "h", "sha256": "8634ef248b385cd0", "symbol_count": 2, "symbols": [{"doc": "column_t is a list of 0 or more post_t, (byte)-1 terminated", "kind": "type_alias", "line": 47, "name": "column_t", "signature": "typedef post_t column_t;"}, {"kind": "macro", "line": 21, "name": "V_PATCH_H", "signature": "#define V_PATCH_H"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Gamma correction LUT stuff. Functions to draw patches (by post) directly to screen. Functions to blit a block to the screen.", "id": "progs/doomgeneric/v_video.c", "kind": "module", "label": "v_video.c", "language": "c", "sha256": "7b3938a3eebfe1fb", "symbol_count": 32, "symbols": [{"doc": "V_MarkRect", "kind": "function", "line": 69, "name": "V_MarkRect", "signature": "void V_MarkRect(int x, int y, int width, int height)"}, {"doc": "V_CopyRect", "kind": "function", "line": 85, "name": "V_CopyRect", "signature": "void V_CopyRect(int srcx, int srcy, byte *source,\n                int width, int height,\n        ..."}, {"doc": "V_SetPatchClipCallback  haleyjd 08/28/10: Added for Strife support. By calling this function, you can setup runtime error checking for patch clipping. Strife never caused errors by drawing patches partway off-screen. Some versions of vanilla DOOM also behaved differently than the default implementation, so this could possibly be extended to those as well for accurate emulation.", "kind": "function", "line": 129, "name": "V_SetPatchClipCallback", "signature": "void V_SetPatchClipCallback(vpatchclipfunc_t func)"}, {"kind": "function", "line": 139, "name": "V_DrawPatch", "signature": "void V_DrawPatch(int x, int y, patch_t *patch)"}, {"kind": "function", "line": 203, "name": "V_DrawPatchFlipped", "signature": "void V_DrawPatchFlipped(int x, int y, patch_t *patch)"}, {"kind": "function", "line": 268, "name": "V_DrawPatchDirect", "signature": "void V_DrawPatchDirect(int x, int y, patch_t *patch)"}, {"kind": "function", "line": 279, "name": "V_DrawTLPatch", "signature": "void V_DrawTLPatch(int x, int y, patch_t * patch)"}, {"kind": "function", "line": 329, "name": "V_DrawXlaPatch", "signature": "void V_DrawXlaPatch(int x, int y, patch_t * patch)"}, {"kind": "function", "line": 378, "name": "V_DrawAltTLPatch", "signature": "void V_DrawAltTLPatch(int x, int y, patch_t * patch)"}, {"kind": "function", "line": 428, "name": "V_DrawShadowedPatch", "signature": "void V_DrawShadowedPatch(int x, int y, patch_t *patch)"}, {"kind": "function", "line": 482, "name": "V_LoadTintTable", "signature": "void V_LoadTintTable(void)"}, {"kind": "function", "line": 493, "name": "V_LoadXlaTable", "signature": "void V_LoadXlaTable(void)"}, {"kind": "function", "line": 503, "name": "V_DrawBlock", "signature": "void V_DrawBlock(int x, int y, int width, int height, byte *src)"}, {"kind": "function", "line": 529, "name": "V_DrawFilledBox", "signature": "void V_DrawFilledBox(int x, int y, int w, int h, int c)"}, {"kind": "function", "line": 549, "name": "V_DrawHorizLine", "signature": "void V_DrawHorizLine(int x, int y, int w, int c)"}, {"kind": "function", "line": 562, "name": "V_DrawVertLine", "signature": "void V_DrawVertLine(int x, int y, int h, int c)"}, {"kind": "function", "line": 576, "name": "V_DrawBox", "signature": "void V_DrawBox(int x, int y, int w, int h, int c)"}, {"kind": "function", "line": 589, "name": "V_DrawRawScreen", "signature": "void V_DrawRawScreen(byte *raw)"}, {"doc": "V_Init", "kind": "function", "line": 597, "name": "V_Init", "signature": "void V_Init (void)"}, {"kind": "function", "line": 606, "name": "V_UseBuffer", "signature": "void V_UseBuffer(byte *buffer)"}, {"kind": "function", "line": 613, "name": "V_RestoreBuffer", "signature": "void V_RestoreBuffer(void)"}, {"kind": "function", "line": 653, "name": "WritePCXfile", "signature": "void WritePCXfile(char *filename, byte *data,\n                  int width, int height,\n          ..."}, {"kind": "function", "line": 711, "name": "error_fn", "signature": "static void error_fn(png_structp p, png_const_charp s)"}, {"kind": "function", "line": 716, "name": "warning_fn", "signature": "static void warning_fn(png_structp p, png_const_charp s)"}, {"kind": "function", "line": 721, "name": "WritePNGfile", "signature": "void WritePNGfile(char *filename, byte *data,\n                  int width, int height,\n          ..."}, {"kind": "function", "line": 791, "name": "V_ScreenShot", "signature": "void V_ScreenShot(char *format)"}, {"kind": "function", "line": 846, "name": "V_DrawMouseSpeedBox", "signature": "void V_DrawMouseSpeedBox(int speed)"}, {"doc": "ifdef HAVE_LIBPNG", "kind": "variable", "line": 800, "name": "png_screenshots", "signature": "extern int png_screenshots;"}, {"kind": "variable", "line": 848, "name": "usemouse", "signature": "extern int usemouse;"}, {"kind": "macro", "line": 46, "name": "RANGECHECK", "signature": "#define RANGECHECK"}, {"kind": "macro", "line": 843, "name": "MOUSE_SPEED_BOX_WIDTH", "signature": "#define MOUSE_SPEED_BOX_WIDTH"}, {"kind": "macro", "line": 844, "name": "MOUSE_SPEED_BOX_HEIGHT", "signature": "#define MOUSE_SPEED_BOX_HEIGHT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Gamma correction LUT. Functions to draw patches (by post) directly to screen. Functions to blit a block to the screen.      Needed because we are refering to patches.", "id": "progs/doomgeneric/v_video.h", "kind": "module", "label": "v_video.h", "language": "h", "sha256": "16d6585767d8f8eb", "symbol_count": 27, "symbols": [{"kind": "function", "line": 45, "name": "V_SetPatchClipCallback", "signature": "void V_SetPatchClipCallback(vpatchclipfunc_t func);"}, {"doc": "Allocates buffer screens, call before R_Init.", "kind": "function", "line": 49, "name": "V_Init", "signature": "void V_Init (void);"}, {"kind": "function", "line": 53, "name": "V_CopyRect", "signature": "void V_CopyRect(int srcx, int srcy, byte *source, int width, int height, int destx, int desty);"}, {"kind": "function", "line": 57, "name": "V_DrawPatch", "signature": "void V_DrawPatch(int x, int y, patch_t *patch);"}, {"kind": "function", "line": 58, "name": "V_DrawPatchFlipped", "signature": "void V_DrawPatchFlipped(int x, int y, patch_t *patch);"}, {"kind": "function", "line": 59, "name": "V_DrawTLPatch", "signature": "void V_DrawTLPatch(int x, int y, patch_t *patch);"}, {"kind": "function", "line": 60, "name": "V_DrawAltTLPatch", "signature": "void V_DrawAltTLPatch(int x, int y, patch_t * patch);"}, {"kind": "function", "line": 61, "name": "V_DrawShadowedPatch", "signature": "void V_DrawShadowedPatch(int x, int y, patch_t *patch);"}, {"kind": "function", "line": 62, "name": "V_DrawXlaPatch", "signature": "void V_DrawXlaPatch(int x, int y, patch_t * patch);"}, {"kind": "function", "line": 63, "name": "V_DrawPatchDirect", "signature": "void V_DrawPatchDirect(int x, int y, patch_t *patch);"}, {"kind": "function", "line": 67, "name": "V_DrawBlock", "signature": "void V_DrawBlock(int x, int y, int width, int height, byte *src);"}, {"kind": "function", "line": 69, "name": "V_MarkRect", "signature": "void V_MarkRect(int x, int y, int width, int height);"}, {"kind": "function", "line": 71, "name": "V_DrawFilledBox", "signature": "void V_DrawFilledBox(int x, int y, int w, int h, int c);"}, {"kind": "function", "line": 72, "name": "V_DrawHorizLine", "signature": "void V_DrawHorizLine(int x, int y, int w, int c);"}, {"kind": "function", "line": 73, "name": "V_DrawVertLine", "signature": "void V_DrawVertLine(int x, int y, int h, int c);"}, {"kind": "function", "line": 74, "name": "V_DrawBox", "signature": "void V_DrawBox(int x, int y, int w, int h, int c);"}, {"kind": "function", "line": 78, "name": "V_DrawRawScreen", "signature": "void V_DrawRawScreen(byte *raw);"}, {"kind": "function", "line": 82, "name": "V_UseBuffer", "signature": "void V_UseBuffer(byte *buffer);"}, {"kind": "function", "line": 86, "name": "V_RestoreBuffer", "signature": "void V_RestoreBuffer(void);"}, {"kind": "function", "line": 92, "name": "V_ScreenShot", "signature": "void V_ScreenShot(char *format);"}, {"kind": "function", "line": 97, "name": "V_LoadTintTable", "signature": "void V_LoadTintTable(void);"}, {"kind": "function", "line": 103, "name": "V_LoadXlaTable", "signature": "void V_LoadXlaTable(void);"}, {"kind": "function", "line": 105, "name": "V_DrawMouseSpeedBox", "signature": "void V_DrawMouseSpeedBox(int speed);"}, {"kind": "variable", "line": 37, "name": "dirtybox", "signature": "extern int dirtybox[4];"}, {"kind": "variable", "line": 39, "name": "tinttable", "signature": "extern byte *tinttable;"}, {"kind": "macro", "line": 23, "name": "__V_VIDEO__", "signature": "#define __V_VIDEO__"}, {"kind": "macro", "line": 34, "name": "CENTERY", "signature": "#define CENTERY"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Generate a checksum of the WAD directory.", "id": "progs/doomgeneric/w_checksum.c", "kind": "module", "label": "w_checksum.c", "language": "c", "sha256": "51785b9bfaedd06b", "symbol_count": 3, "symbols": [{"kind": "function", "line": 31, "name": "GetFileNumber", "signature": "static int GetFileNumber(wad_file_t *handle)"}, {"kind": "function", "line": 57, "name": "ChecksumAddLump", "signature": "static void ChecksumAddLump(sha1_context_t *sha1_context, lumpinfo_t *lump)"}, {"kind": "function", "line": 68, "name": "W_Checksum", "signature": "void W_Checksum(sha1_digest_t digest)"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Generate a checksum of the WAD directory.", "id": "progs/doomgeneric/w_checksum.h", "kind": "module", "label": "w_checksum.h", "language": "h", "sha256": "a38a2efbd83629a8", "symbol_count": 2, "symbols": [{"kind": "function", "line": 24, "name": "W_Checksum", "signature": "extern void W_Checksum(sha1_digest_t digest);"}, {"kind": "macro", "line": 20, "name": "W_CHECKSUM_H", "signature": "#define W_CHECKSUM_H"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.", "id": "progs/doomgeneric/w_file.c", "kind": "module", "label": "w_file.c", "language": "c", "sha256": "2acf906087fb61e3", "symbol_count": 6, "symbols": [{"kind": "function", "line": 53, "name": "W_OpenFile", "signature": "wad_file_t *W_OpenFile(char *path)"}, {"kind": "function", "line": 85, "name": "W_CloseFile", "signature": "void W_CloseFile(wad_file_t *wad)"}, {"kind": "function", "line": 90, "name": "W_Read", "signature": "size_t W_Read(wad_file_t *wad, unsigned int offset,\n              void *buffer, size_t buffer_len)"}, {"kind": "variable", "line": 28, "name": "stdc_wad_file", "signature": "extern wad_file_class_t stdc_wad_file;"}, {"doc": "ifdef _WIN32", "kind": "variable", "line": 32, "name": "win32_wad_file", "signature": "extern wad_file_class_t win32_wad_file;"}, {"doc": "ifdef HAVE_MMAP", "kind": "variable", "line": 37, "name": "posix_wad_file", "signature": "extern wad_file_class_t posix_wad_file;"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.", "id": "progs/doomgeneric/w_file.h", "kind": "module", "label": "w_file.h", "language": "h", "sha256": "06188e02e1d567a9", "symbol_count": 7, "symbols": [{"kind": "struct", "line": 46, "name": "_wad_file_s"}, {"kind": "struct", "line": 28, "name": "wad_file_class_t"}, {"doc": "include <stdio.h> include \"doomtype.h\"", "kind": "type_alias", "line": 25, "name": "wad_file_t", "signature": "typedef struct _wad_file_s wad_file_t;"}, {"kind": "function", "line": 65, "name": "W_OpenFile", "signature": "wad_file_t *W_OpenFile(char *path);"}, {"kind": "function", "line": 69, "name": "W_CloseFile", "signature": "void W_CloseFile(wad_file_t *wad);"}, {"kind": "function", "line": 75, "name": "W_Read", "signature": "size_t W_Read(wad_file_t *wad, unsigned int offset, void *buffer, size_t buffer_len);"}, {"kind": "macro", "line": 21, "name": "__W_FILE__", "signature": "#define __W_FILE__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.", "id": "progs/doomgeneric/w_file_stdc.c", "kind": "module", "label": "w_file_stdc.c", "language": "c", "sha256": "838aab7c3d023e57", "symbol_count": 5, "symbols": [{"kind": "struct", "line": 25, "name": "stdc_wad_file_t"}, {"kind": "function", "line": 33, "name": "W_StdC_OpenFile", "signature": "static wad_file_t *W_StdC_OpenFile(char *path)"}, {"kind": "function", "line": 56, "name": "W_StdC_CloseFile", "signature": "static void W_StdC_CloseFile(wad_file_t *wad)"}, {"kind": "function", "line": 69, "name": "W_StdC_Read", "signature": "size_t W_StdC_Read(wad_file_t *wad, unsigned int offset,\n                   void *buffer, size_t ..."}, {"kind": "variable", "line": 31, "name": "stdc_wad_file", "signature": "extern wad_file_class_t stdc_wad_file;"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Common code to parse command line, identifying WAD files to load.    Parse the command line, merging WAD files that are sppecified. Returns true if at least one file was added.", "id": "progs/doomgeneric/w_main.c", "kind": "module", "label": "w_main.c", "language": "c", "sha256": "57cd2756e669dc68", "symbol_count": 1, "symbols": [{"kind": "function", "line": 30, "name": "W_ParseCommandLine", "signature": "boolean W_ParseCommandLine(void)"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Common code to parse command line, identifying WAD files to load.", "id": "progs/doomgeneric/w_main.h", "kind": "module", "label": "w_main.h", "language": "h", "sha256": "dc99ae306d83540d", "symbol_count": 1, "symbols": [{"kind": "macro", "line": 19, "name": "W_MAIN_H", "signature": "#define W_MAIN_H"}]}, {"doc": "Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handles merging of PWADs, similar to deutex's -merge option  Ideally this should work exactly the same as in deutex, but trying to read the deutex source code made my brain hurt.     Add a new WAD and merge it into the main directory", "id": "progs/doomgeneric/w_merge.h", "kind": "module", "label": "w_merge.h", "language": "h", "sha256": "976fba40db874b57", "symbol_count": 7, "symbols": [{"kind": "function", "line": 29, "name": "W_MergeFile", "signature": "void W_MergeFile(char *filename);"}, {"kind": "function", "line": 33, "name": "W_NWTMergeFile", "signature": "void W_NWTMergeFile(char *filename, int flags);"}, {"kind": "function", "line": 37, "name": "W_NWTDashMerge", "signature": "void W_NWTDashMerge(char *filename);"}, {"kind": "function", "line": 41, "name": "W_PrintDirectory", "signature": "void W_PrintDirectory(void);"}, {"kind": "macro", "line": 22, "name": "W_MERGE_H", "signature": "#define W_MERGE_H"}, {"kind": "macro", "line": 24, "name": "W_NWT_MERGE_SPRITES", "signature": "#define W_NWT_MERGE_SPRITES"}, {"kind": "macro", "line": 25, "name": "W_NWT_MERGE_FLATS", "signature": "#define W_NWT_MERGE_FLATS"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handles WAD file header, directory, lump I/O.", "id": "progs/doomgeneric/w_wad.c", "kind": "module", "label": "w_wad.c", "language": "c", "sha256": "ec7713a25f7b6cbc", "symbol_count": 16, "symbols": [{"kind": "function", "line": 72, "name": "W_LumpNameHash", "signature": "unsigned int W_LumpNameHash(const char *s)"}, {"doc": "Increase the size of the lumpinfo[] array to the specified size.", "kind": "function", "line": 89, "name": "ExtendLumpInfo", "signature": "static void ExtendLumpInfo(int newnumlumps)"}, {"kind": "function", "line": 141, "name": "W_AddFile", "signature": "wad_file_t *W_AddFile (char *filename)"}, {"doc": "W_NumLumps", "kind": "function", "line": 246, "name": "W_NumLumps", "signature": "int W_NumLumps (void)"}, {"kind": "function", "line": 258, "name": "W_CheckNumForName", "signature": "int W_CheckNumForName (char* name)"}, {"doc": "W_GetNumForName Calls W_CheckNumForName, but bombs out if not found.", "kind": "function", "line": 308, "name": "W_GetNumForName", "signature": "int W_GetNumForName (char* name)"}, {"doc": "W_LumpLength Returns the buffer size needed to load the given lump.", "kind": "function", "line": 327, "name": "W_LumpLength", "signature": "int W_LumpLength (unsigned int lump)"}, {"doc": "W_ReadLump Loads the lump into the given buffer, which must be >= W_LumpLength().", "kind": "function", "line": 344, "name": "W_ReadLump", "signature": "void W_ReadLump(unsigned int lump, void *dest)"}, {"kind": "function", "line": 384, "name": "W_CacheLumpNum", "signature": "void *W_CacheLumpNum(int lumpnum, int tag)"}, {"doc": "W_CacheLumpName", "kind": "function", "line": 431, "name": "W_CacheLumpName", "signature": "void *W_CacheLumpName(char *name, int tag)"}, {"kind": "function", "line": 446, "name": "W_ReleaseLumpNum", "signature": "void W_ReleaseLumpNum(int lumpnum)"}, {"kind": "function", "line": 467, "name": "W_ReleaseLumpName", "signature": "void W_ReleaseLumpName(char *name)"}, {"kind": "function", "line": 480, "name": "W_Profile", "signature": "void W_Profile (void)"}, {"kind": "function", "line": 541, "name": "W_GenerateHashTable", "signature": "void W_GenerateHashTable(void)"}, {"kind": "function", "line": 588, "name": "W_CheckCorrectIWAD", "signature": "void W_CheckCorrectIWAD(GameMission_t mission)"}, {"kind": "function", "line": 39, "name": "I_EndRead", "signature": "void I_EndRead (void);"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.", "id": "progs/doomgeneric/w_wad.h", "kind": "module", "label": "w_wad.h", "language": "h", "sha256": "fb34bdb0a8c3f9a1", "symbol_count": 17, "symbols": [{"kind": "struct", "line": 41, "name": "lumpinfo_s"}, {"doc": "WADFILE I/O related stuff.", "kind": "type_alias", "line": 38, "name": "lumpinfo_t", "signature": "typedef struct lumpinfo_s lumpinfo_t;"}, {"kind": "function", "line": 58, "name": "W_AddFile", "signature": "wad_file_t *W_AddFile (char *filename);"}, {"kind": "function", "line": 60, "name": "W_CheckNumForName", "signature": "int W_CheckNumForName (char* name);"}, {"kind": "function", "line": 61, "name": "W_GetNumForName", "signature": "int W_GetNumForName (char* name);"}, {"kind": "function", "line": 63, "name": "W_LumpLength", "signature": "int W_LumpLength (unsigned int lump);"}, {"kind": "function", "line": 64, "name": "W_ReadLump", "signature": "void W_ReadLump (unsigned int lump, void *dest);"}, {"kind": "function", "line": 66, "name": "W_CacheLumpNum", "signature": "void* W_CacheLumpNum (int lump, int tag);"}, {"kind": "function", "line": 67, "name": "W_CacheLumpName", "signature": "void* W_CacheLumpName (char* name, int tag);"}, {"kind": "function", "line": 69, "name": "W_GenerateHashTable", "signature": "void W_GenerateHashTable(void);"}, {"kind": "function", "line": 71, "name": "W_LumpNameHash", "signature": "extern unsigned int W_LumpNameHash(const char *s);"}, {"kind": "function", "line": 73, "name": "W_ReleaseLumpNum", "signature": "void W_ReleaseLumpNum(int lump);"}, {"kind": "function", "line": 74, "name": "W_ReleaseLumpName", "signature": "void W_ReleaseLumpName(char *name);"}, {"kind": "function", "line": 76, "name": "W_CheckCorrectIWAD", "signature": "void W_CheckCorrectIWAD(GameMission_t mission);"}, {"kind": "variable", "line": 55, "name": "lumpinfo", "signature": "extern lumpinfo_t *lumpinfo;"}, {"kind": "variable", "line": 56, "name": "numlumps", "signature": "extern unsigned int numlumps;"}, {"kind": "macro", "line": 21, "name": "__W_WAD__", "signature": "#define __W_WAD__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Intermission screens.", "id": "progs/doomgeneric/wi_stuff.c", "kind": "module", "label": "wi_stuff.c", "language": "c", "sha256": "0e610899b0e67dd1", "symbol_count": 68, "symbols": [{"kind": "struct", "line": 117, "name": "point_t"}, {"doc": "Animation. There is another anim_t used in p_spec.", "kind": "struct", "line": 129, "name": "anim_t"}, {"doc": "slam background", "kind": "function", "line": 402, "name": "WI_slamBackground", "signature": "void WI_slamBackground(void)"}, {"doc": "The ticker is used to detect keys because of timing issues in netgames.", "kind": "function", "line": 409, "name": "WI_Responder", "signature": "boolean WI_Responder(event_t* ev)"}, {"doc": "Draws \"<Levelname> Finished!\"", "kind": "function", "line": 416, "name": "WI_drawLF", "signature": "void WI_drawLF(void)"}, {"doc": "Draws \"Entering <LevelName>\"", "kind": "function", "line": 452, "name": "WI_drawEL", "signature": "void WI_drawEL(void)"}, {"kind": "function", "line": 471, "name": "WI_drawOnLnode", "signature": "void\nWI_drawOnLnode\n( int\t\tn,\n  patch_t*\tc[] )"}, {"kind": "function", "line": 519, "name": "WI_initAnimatedBack", "signature": "void WI_initAnimatedBack(void)"}, {"kind": "function", "line": 548, "name": "WI_updateAnimatedBack", "signature": "void WI_updateAnimatedBack(void)"}, {"kind": "function", "line": 599, "name": "WI_drawAnimatedBack", "signature": "void WI_drawAnimatedBack(void)"}, {"kind": "function", "line": 628, "name": "WI_drawNum", "signature": "int\nWI_drawNum\n( int\t\tx,\n  int\t\ty,\n  int\t\tn,\n  int\t\tdigits )"}, {"kind": "function", "line": 685, "name": "WI_drawPercent", "signature": "void\nWI_drawPercent\n( int\t\tx,\n  int\t\ty,\n  int\t\tp )"}, {"kind": "function", "line": 704, "name": "WI_drawTime", "signature": "void\nWI_drawTime\n( int\t\tx,\n  int\t\ty,\n  int\t\tt )"}, {"kind": "function", "line": 740, "name": "WI_End", "signature": "void WI_End(void)"}, {"kind": "function", "line": 746, "name": "WI_initNoState", "signature": "void WI_initNoState(void)"}, {"kind": "function", "line": 753, "name": "WI_updateNoState", "signature": "void WI_updateNoState(void)"}, {"kind": "function", "line": 772, "name": "WI_initShowNextLoc", "signature": "void WI_initShowNextLoc(void)"}, {"kind": "function", "line": 781, "name": "WI_updateShowNextLoc", "signature": "void WI_updateShowNextLoc(void)"}, {"kind": "function", "line": 791, "name": "WI_drawShowNextLoc", "signature": "void WI_drawShowNextLoc(void)"}, {"kind": "function", "line": 832, "name": "WI_drawNoState", "signature": "void WI_drawNoState(void)"}, {"kind": "function", "line": 838, "name": "WI_fragSum", "signature": "int WI_fragSum(int playernum)"}, {"kind": "function", "line": 869, "name": "WI_initDeathmatchStats", "signature": "void WI_initDeathmatchStats(void)"}, {"kind": "function", "line": 898, "name": "WI_updateDeathmatchStats", "signature": "void WI_updateDeathmatchStats(void)"}, {"kind": "function", "line": 1001, "name": "WI_drawDeathmatchStats", "signature": "void WI_drawDeathmatchStats(void)"}, {"kind": "function", "line": 1089, "name": "WI_initNetgameStats", "signature": "void WI_initNetgameStats(void)"}, {"kind": "function", "line": 1117, "name": "WI_updateNetgameStats", "signature": "void WI_updateNetgameStats(void)"}, {"kind": "function", "line": 1272, "name": "WI_drawNetgameStats", "signature": "void WI_drawNetgameStats(void)"}, {"kind": "function", "line": 1329, "name": "WI_initStats", "signature": "void WI_initStats(void)"}, {"kind": "function", "line": 1341, "name": "WI_updateStats", "signature": "void WI_updateStats(void)"}, {"kind": "function", "line": 1447, "name": "WI_drawStats", "signature": "void WI_drawStats(void)"}, {"kind": "function", "line": 1481, "name": "WI_checkForAccelerate", "signature": "void WI_checkForAccelerate(void)"}, {"doc": "Updates stuff each tick", "kind": "function", "line": 1514, "name": "WI_Ticker", "signature": "void WI_Ticker(void)"}, {"kind": "function", "line": 1554, "name": "WI_loadUnloadData", "signature": "static void WI_loadUnloadData(load_callback_t callback)"}, {"kind": "function", "line": 1704, "name": "WI_loadCallback", "signature": "static void WI_loadCallback(char *name, patch_t **variable)"}, {"kind": "function", "line": 1709, "name": "WI_loadData", "signature": "void WI_loadData(void)"}, {"kind": "function", "line": 1735, "name": "WI_unloadCallback", "signature": "static void WI_unloadCallback(char *name, patch_t **variable)"}, {"kind": "function", "line": 1741, "name": "WI_unloadData", "signature": "void WI_unloadData(void)"}, {"kind": "function", "line": 1752, "name": "WI_Drawer", "signature": "void WI_Drawer (void)"}, {"kind": "function", "line": 1776, "name": "WI_initVariables", "signature": "void WI_initVariables(wbstartstruct_t* wbstartstruct)"}, {"kind": "function", "line": 1818, "name": "WI_Start", "signature": "void WI_Start(wbstartstruct_t* wbstartstruct)"}, {"kind": "macro", "line": 61, "name": "NUMEPISODES", "signature": "#define NUMEPISODES"}, {"kind": "macro", "line": 62, "name": "NUMMAPS", "signature": "#define NUMMAPS"}, {"kind": "macro", "line": 75, "name": "WI_TITLEY", "signature": "#define WI_TITLEY"}, {"kind": "macro", "line": 76, "name": "WI_SPACINGY", "signature": "#define WI_SPACINGY"}, {"kind": "macro", "line": 79, "name": "SP_STATSX", "signature": "#define SP_STATSX"}, {"kind": "macro", "line": 80, "name": "SP_STATSY", "signature": "#define SP_STATSY"}, {"kind": "macro", "line": 82, "name": "SP_TIMEX", "signature": "#define SP_TIMEX"}, {"kind": "macro", "line": 83, "name": "SP_TIMEY", "signature": "#define SP_TIMEY"}, {"kind": "macro", "line": 87, "name": "NG_STATSY", "signature": "#define NG_STATSY"}, {"kind": "macro", "line": 88, "name": "NG_STATSX", "signature": "#define NG_STATSX"}, {"kind": "macro", "line": 90, "name": "NG_SPACINGX", "signature": "#define NG_SPACINGX"}, {"kind": "macro", "line": 94, "name": "DM_MATRIXX", "signature": "#define DM_MATRIXX"}, {"kind": "macro", "line": 95, "name": "DM_MATRIXY", "signature": "#define DM_MATRIXY"}, {"kind": "macro", "line": 97, "name": "DM_SPACINGX", "signature": "#define DM_SPACINGX"}, {"kind": "macro", "line": 99, "name": "DM_TOTALSX", "signature": "#define DM_TOTALSX"}, {"kind": "macro", "line": 101, "name": "DM_KILLERSX", "signature": "#define DM_KILLERSX"}, {"kind": "macro", "line": 102, "name": "DM_KILLERSY", "signature": "#define DM_KILLERSY"}, {"kind": "macro", "line": 103, "name": "DM_VICTIMSX", "signature": "#define DM_VICTIMSX"}, {"kind": "macro", "line": 104, "name": "DM_VICTIMSY", "signature": "#define DM_VICTIMSY"}, {"kind": "macro", "line": 222, "name": "ANIM", "signature": "#define ANIM(type, period, nanims, x, y, nexttic)"}, {"kind": "macro", "line": 288, "name": "SP_KILLS", "signature": "#define SP_KILLS"}, {"kind": "macro", "line": 289, "name": "SP_ITEMS", "signature": "#define SP_ITEMS"}, {"kind": "macro", "line": 290, "name": "SP_SECRET", "signature": "#define SP_SECRET"}, {"kind": "macro", "line": 291, "name": "SP_FRAGS", "signature": "#define SP_FRAGS"}, {"kind": "macro", "line": 292, "name": "SP_TIME", "signature": "#define SP_TIME"}, {"kind": "macro", "line": 293, "name": "SP_PAR", "signature": "#define SP_PAR"}, {"kind": "macro", "line": 295, "name": "SP_PAUSE", "signature": "#define SP_PAUSE"}, {"kind": "macro", "line": 298, "name": "SHOWNEXTLOCDELAY", "signature": "#define SHOWNEXTLOCDELAY"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Intermission.    #include \"v_video.h\"   States for the intermission", "id": "progs/doomgeneric/wi_stuff.h", "kind": "module", "label": "wi_stuff.h", "language": "h", "sha256": "a4f6e9e22c710099", "symbol_count": 5, "symbols": [{"doc": "Called by main loop, animate the intermission.", "kind": "function", "line": 36, "name": "WI_Ticker", "signature": "void WI_Ticker (void);"}, {"doc": "Called by main loop, draws the intermission directly into the screen buffer.", "kind": "function", "line": 40, "name": "WI_Drawer", "signature": "void WI_Drawer (void);"}, {"doc": "Setup for an intermission screen.", "kind": "function", "line": 43, "name": "WI_Start", "signature": "void WI_Start(wbstartstruct_t* wbstartstruct);"}, {"doc": "Shut down the intermission screen", "kind": "function", "line": 46, "name": "WI_End", "signature": "void WI_End(void);"}, {"kind": "macro", "line": 20, "name": "__WI_STUFF__", "signature": "#define __WI_STUFF__"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Zone Memory Allocation. Neat.       ZONE MEMORY ALLOCATION  There is never any space between memblocks, and there will never be two contiguous free memblocks. The rover can be left pointing at a non-empty block.", "id": "progs/doomgeneric/z_zone.c", "kind": "module", "label": "z_zone.c", "language": "c", "sha256": "031f2455f114e1d7", "symbol_count": 18, "symbols": [{"kind": "struct", "line": 39, "name": "memblock_s"}, {"kind": "struct", "line": 50, "name": "memzone_t"}, {"doc": "define MEM_ALIGN sizeof(void *) define ZONEID\t0x1d4a11", "kind": "type_alias", "line": 38, "name": "size", "signature": "typedef struct memblock_s { int size;"}, {"doc": "Z_ClearZone", "kind": "function", "line": 71, "name": "Z_ClearZone", "signature": "void Z_ClearZone (memzone_t* zone)"}, {"doc": "Z_Init", "kind": "function", "line": 97, "name": "Z_Init", "signature": "void Z_Init (void)"}, {"doc": "Z_Free", "kind": "function", "line": 126, "name": "Z_Free", "signature": "void Z_Free (void* ptr)"}, {"kind": "function", "line": 185, "name": "Z_Malloc", "signature": "void*\nZ_Malloc\n( int\t\tsize,\n  int\t\ttag,\n  void*\t\tuser )"}, {"kind": "function", "line": 298, "name": "Z_FreeTags", "signature": "void\nZ_FreeTags\n( int\t\tlowtag,\n  int\t\thightag )"}, {"kind": "function", "line": 328, "name": "Z_DumpHeap", "signature": "void\nZ_DumpHeap\n( int\t\tlowtag,\n  int\t\thightag )"}, {"doc": "Z_FileDumpHeap", "kind": "function", "line": 367, "name": "Z_FileDumpHeap", "signature": "void Z_FileDumpHeap (FILE* f)"}, {"doc": "Z_CheckHeap", "kind": "function", "line": 400, "name": "Z_CheckHeap", "signature": "void Z_CheckHeap (void)"}, {"doc": "Z_ChangeTag", "kind": "function", "line": 429, "name": "Z_ChangeTag2", "signature": "void Z_ChangeTag2(void *ptr, int tag, char *file, int line)"}, {"kind": "function", "line": 446, "name": "Z_ChangeUser", "signature": "void Z_ChangeUser(void *ptr, void **user)"}, {"doc": "Z_FreeMemory", "kind": "function", "line": 466, "name": "Z_FreeMemory", "signature": "int Z_FreeMemory (void)"}, {"kind": "function", "line": 484, "name": "Z_ZoneSize", "signature": "unsigned int Z_ZoneSize(void)"}, {"kind": "macro", "line": 36, "name": "MEM_ALIGN", "signature": "#define MEM_ALIGN"}, {"kind": "macro", "line": 37, "name": "ZONEID", "signature": "#define ZONEID"}, {"kind": "macro", "line": 181, "name": "MINFRAGMENT", "signature": "#define MINFRAGMENT"}]}, {"doc": "Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Zone Memory Allocation, perhaps NeXT ObjectiveC inspired. Remark: this was the only stuff that, according to John Carmack, might have been useful for Quake.        ZONE MEMORY", "id": "progs/doomgeneric/z_zone.h", "kind": "module", "label": "z_zone.h", "language": "h", "sha256": "5075045fd434b971", "symbol_count": 13, "symbols": [{"kind": "function", "line": 53, "name": "Z_Init", "signature": "void Z_Init (void);"}, {"kind": "function", "line": 54, "name": "Z_Malloc", "signature": "void* Z_Malloc (int size, int tag, void *ptr);"}, {"kind": "function", "line": 55, "name": "Z_Free", "signature": "void Z_Free (void *ptr);"}, {"kind": "function", "line": 56, "name": "Z_FreeTags", "signature": "void Z_FreeTags (int lowtag, int hightag);"}, {"kind": "function", "line": 57, "name": "Z_DumpHeap", "signature": "void Z_DumpHeap (int lowtag, int hightag);"}, {"kind": "function", "line": 58, "name": "Z_FileDumpHeap", "signature": "void Z_FileDumpHeap (FILE *f);"}, {"kind": "function", "line": 59, "name": "Z_CheckHeap", "signature": "void Z_CheckHeap (void);"}, {"kind": "function", "line": 60, "name": "Z_ChangeTag2", "signature": "void Z_ChangeTag2 (void *ptr, int tag, char *file, int line);"}, {"kind": "function", "line": 61, "name": "Z_ChangeUser", "signature": "void Z_ChangeUser(void *ptr, void **user);"}, {"kind": "function", "line": 62, "name": "Z_FreeMemory", "signature": "int Z_FreeMemory (void);"}, {"kind": "function", "line": 63, "name": "Z_ZoneSize", "signature": "unsigned int Z_ZoneSize(void);"}, {"kind": "macro", "line": 25, "name": "__Z_ZONE__", "signature": "#define __Z_ZONE__"}, {"kind": "macro", "line": 69, "name": "Z_ChangeTag", "signature": "#define Z_ChangeTag(p,t)"}]}, {"doc": "Docstring: MiniOS file browser (Nuklear ring-3 app, MiniFS: file/file.elf).", "id": "progs/file/file.c", "kind": "module", "label": "file.c", "language": "c", "sha256": "a948d0f6793925b1", "symbol_count": 65, "symbols": [{"kind": "struct", "line": 76, "name": "file_assoc"}, {"doc": "static unsigned char file_icon_mask[FILE_ICON_N][FILE_ICON_MAX * FILE_ICON_MAX]; static struct nk_minios_img file_icon_img[FILE_ICON_N]; static int file_icons_ok; static char file_cwd[FILE_MAX_PATH]; static char file_entries[FILE_LIST_CAP]; static long file_entry_count; static char file_status[FILE_STATUS_MAX]; static char file_preview_path[FILE_MAX_PATH]; static unsigned char file_preview_px[FILE_PREVIEW_W * FILE_PREVIEW_H]; static int file_preview_w; static int file_preview_h; static int file_preview_on; /** Raw DIR_LIST syscall (241): names land NUL-separated in buf.", "kind": "function", "line": 101, "name": "file_sys_dir_list", "signature": "static long file_sys_dir_list(const char *path, char *buf, long cap)"}, {"doc": "static int file_preview_h; static int file_preview_on; /** Raw DIR_LIST syscall (241): names land NUL-separated in buf. static long file_sys_dir_list(const char *path, char *buf, long cap) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_DIR_LIST), \"D\"(path), \"S\"(buf), \"d\"(cap) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Raw SPAWN syscall (215) preserving this app across the child.", "kind": "function", "line": 111, "name": "file_sys_spawn", "signature": "static long file_sys_spawn(const char *path, int argc, const char **argv)"}, {"doc": "} /** Raw SPAWN syscall (215) preserving this app across the child. static long file_sys_spawn(const char *path, int argc, const char **argv) { long ret; register long r10 __asm__(\"r10\") = (long)argv; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_SPAWN), \"D\"(path), \"S\"(0), \"d\"((long)argc), \"r\"(r10) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Lowercase the extension of fname into dst (no dot, empty when none).", "kind": "function", "line": 122, "name": "file_ext_of", "signature": "static void file_ext_of(const char *fname, char *dst, unsigned cap)"}, {"doc": "Icon kind for an entry: folder for dirs, image for .png, object for .o/.elf/.cvm, files for the text kinds (.c/.h/.lisp/.lua/.py/.txt/.s) and for anything else. The extension arrives lowercased from * file_ext_of, so every comparison is exact.", "kind": "function", "line": 146, "name": "file_icon_kind", "signature": "static int file_icon_kind(const char *fname, int isdir)"}, {"doc": "and for anything else. The extension arrives lowercased from * file_ext_of, so every comparison is exact. static int file_icon_kind(const char *fname, int isdir) { char ext[FILE_EXT_MAX + 1]; if (isdir) return FILE_ICON_FOLDER; file_ext_of(fname, ext, sizeof(ext)); if (strcmp(ext, \"png\") == 0) return FILE_ICON_IMAGE; if (strcmp(ext, \"o\") == 0 || strcmp(ext, \"elf\") == 0 || strcmp(ext, \"cvm\") == 0) return FILE_ICON_OBJECT; return FILE_ICON_FILES; } /** Live icon edge: 32 in big mode, 16 in small mode.", "kind": "function", "line": 158, "name": "file_icon_sz", "signature": "static int file_icon_sz(void)"}, {"doc": "Decode one RGBA icon into indexed pixels plus an alpha mask, scaled to the live size. Fail closed: any bound or decode error returns -1 and * leaves the slot untouched.", "kind": "function", "line": 165, "name": "file_icon_decode", "signature": "static int file_icon_decode(const char *path, unsigned char *px,\n                            unsi..."}, {"doc": "Load the four kind icons; all-or-nothing so the UI never mixes icon * and text rows. Returns 1 when every icon is live.", "kind": "function", "line": 213, "name": "file_icons_load", "signature": "static int file_icons_load(void)"}, {"doc": "Flip the icon size and reload the four kind icons. Returns 1 when the new size is live, 0 when the reload failed (flag stays flipped so the * next toggle retries the other size instead of sticking).", "kind": "function", "line": 238, "name": "file_toggle_icons", "signature": "static int file_toggle_icons(void)"}, {"doc": "Flip the icon size and reload the four kind icons. Returns 1 when the new size is live, 0 when the reload failed (flag stays flipped so the * next toggle retries the other size instead of sticking). static int file_toggle_icons(void) { file_icon_big = !file_icon_big; file_icons_ok = file_icons_load(); return file_icons_ok; } /** Join dir + name into dst, fail closed on overflow.", "kind": "function", "line": 245, "name": "file_join", "signature": "static int file_join(const char *dir, const char *name, char *dst, unsigned cap)"}, {"doc": "static int file_join(const char *dir, const char *name, char *dst, unsigned cap) { unsigned a = 0; unsigned b = 0; while (dir[a] && a < cap) a++; while (name[b] && b < FILE_NAME_MAX) b++; if (a + 1 + b + 1 > cap) return -1; memcpy(dst, dir, a); if (a > 0 && dst[a - 1] != '/') dst[a++] = '/'; memcpy(dst + a, name, b); dst[a + b] = 0; return 0; } /** Parent of an absolute path, root stays root.", "kind": "function", "line": 259, "name": "file_parent", "signature": "static void file_parent(char *path)"}, {"doc": "return 0; } /** Parent of an absolute path, root stays root. static void file_parent(char *path) { unsigned n = 0; while (path[n]) n++; while (n > 1 && path[n - 1] == '/') path[--n] = 0; while (n > 1 && path[n - 1] != '/') n--; if (n <= 1) { path[0] = '/'; path[1] = 0; return; } path[n - 1] = 0; } /** Validate one association line: ext|program, fail closed.", "kind": "function", "line": 269, "name": "file_assoc_line", "signature": "static int file_assoc_line(const char *line, char *ext, char *prog)"}, {"doc": "} if (line[p + k] && line[p + k] != '\\n' && line[p + k] != '\\r') return -1; while (p > 0 && (prog[p - 1] == ' ' || prog[p - 1] == '\\t')) p--; prog[p] = 0; } ext[m] = 0; if (!prog[0]) return -1; if (strcmp(prog, FILE_ACTION_SHELL) != 0 && strcmp(prog, FILE_ACTION_INTERNAL) != 0 && prog[0] != '/') return -1; return 0; } /** Load the association table, builtins on failure.", "kind": "function", "line": 302, "name": "file_assoc_load", "signature": "static void file_assoc_load(void)"}, {"doc": "char line[FILE_LOG_LINE]; char ext[FILE_EXT_MAX + 1]; char prog[FILE_PROG_MAX + 1]; fassoc_clear(&file_assocs); f = fopen(FILE_ASSOC_PATH, \"r\"); if (!f) return; while (fgets(line, sizeof(line), f)) { if (file_assoc_line(line, ext, prog) != 0) continue; if (fassoc_push(&file_assocs, ext, prog) != 0) break; } fclose(f); } /** Program for an extension, empty when unmapped.", "kind": "function", "line": 318, "name": "file_assoc_lookup", "signature": "static const char *file_assoc_lookup(const char *ext)"}, {"doc": "if (!f) return; while (fgets(line, sizeof(line), f)) { if (file_assoc_line(line, ext, prog) != 0) continue; if (fassoc_push(&file_assocs, ext, prog) != 0) break; } fclose(f); } /** Program for an extension, empty when unmapped. static const char *file_assoc_lookup(const char *ext) { return fassoc_lookup(&file_assocs, ext); } /** Dispatch kind for a file name through the association table.", "kind": "function", "line": 323, "name": "file_action_of", "signature": "static int file_action_of(const char *fname, const char **prog_out)"}, {"doc": "/** Dispatch kind for a file name through the association table. static int file_action_of(const char *fname, const char **prog_out) { char ext[FILE_EXT_MAX + 1]; const char *prog; file_ext_of(fname, ext, sizeof(ext)); prog = file_assoc_lookup(ext); if (prog_out) *prog_out = prog; if (!prog[0]) return FILE_ACT_UNKNOWN; if (strcmp(prog, FILE_ACTION_SHELL) == 0) return FILE_ACT_SHELL; if (strcmp(prog, FILE_ACTION_INTERNAL) == 0) return FILE_ACT_INTERNAL; return FILE_ACT_TEXT; } /** Refresh the entry list for the cwd, fail closed with a status.", "kind": "function", "line": 336, "name": "file_refresh", "signature": "static void file_refresh(void)"}, {"doc": "long rc = file_sys_dir_list(file_cwd, file_entries, FILE_LIST_CAP); if (rc < 0) { file_entry_count = 0; file_entries[0] = 0; snprintf(file_status, sizeof(file_status), \"cannot list %s (%ld)\", file_cwd, rc); return; } file_entry_count = rc; snprintf(file_status, sizeof(file_status), \"%s (%ld entries)\", file_cwd, rc); } /** Decode a png file into the preview buffer, nearest-neighbor downscale.", "kind": "function", "line": 351, "name": "file_preview_load", "signature": "static int file_preview_load(const char *path)"}, {"doc": "Blit the preview buffer into the NK back-buffer after rasterize (and its * RGB twin when the kernel maps it).", "kind": "function", "line": 385, "name": "file_preview_blit", "signature": "static void file_preview_blit(int ox, int oy)"}, {"doc": "int dx = ox + x; int dy = oy + y; unsigned char r, g, b; volatile uint8_t *d; if (dx < 0 || dx >= NK_W || dy < 0 || dy >= NK_H) continue; fb[dy * NK_W + dx] = file_preview_px[y * FILE_PREVIEW_W + x]; if (!rgb) continue; nk_idx_to_rgb(file_preview_px[y * FILE_PREVIEW_W + x], &r, &g, &b); d = NK_RGB_BUF + ((dy * NK_W) + dx) * 3; d[0] = r; d[1] = g; d[2] = b; } } /** Run a program with the display released so output lands on console.", "kind": "function", "line": 407, "name": "file_spawn_visible", "signature": "static long file_spawn_visible(const char *tool, int argc, const char **argv,\n                   ..."}, {"doc": "printf(\"file: %s exit code: %ld\\n\", label, rc); fflush(stdout); nk_sys_vga_mode(1); nk_build_palette(pal768); nk_sys_palette(pal768); nk_sys_kbd_raw(1); if (rc != 0) snprintf(file_status, sizeof(file_status), \"%s exit %ld\", label, rc); else snprintf(file_status, sizeof(file_status), \"%s ok\", label); return rc; } /** Open a text file in vedit, preserving this browser.", "kind": "function", "line": 430, "name": "file_open_text", "signature": "static void file_open_text(const char *path)"}, {"doc": "} /** Open a text file in vedit, preserving this browser. static void file_open_text(const char *path) { const char *args[3]; char label[FILE_LOG_LINE]; args[0] = FILE_TOOL_VEDIT; args[1] = path; args[2] = 0; snprintf(label, sizeof(label), \"vedit %s\", path); file_spawn_visible(FILE_TOOL_VEDIT, 2, args, label); } /** Run a shell-kind file: elf/o directly, cvm through the interpreter.", "kind": "function", "line": 441, "name": "file_run_shell", "signature": "static void file_run_shell(const char *path)"}, {"doc": "if (strcmp(ext, \"cvm\") == 0) { args[0] = path; args[1] = 0; snprintf(label, sizeof(label), \"run %s\", path); file_spawn_visible(FILE_TOOL_CVM, 1, args, label); return; } args[0] = path; args[1] = 0; snprintf(label, sizeof(label), \"run %s\", path); file_spawn_visible(path, 1, args, label); } /** Dispatch one file name through the association table.", "kind": "function", "line": 480, "name": "file_activate", "signature": "static void file_activate(const char *dir, const char *name)"}, {"doc": "snprintf(file_preview_path, sizeof(file_preview_path), \"%s\", path); snprintf(file_status, sizeof(file_status), \"preview %s\", path); } else { file_preview_on = 0; snprintf(file_status, sizeof(file_status), \"cannot preview %s\", path); } } else { file_preview_on = 0; snprintf(file_status, sizeof(file_status), \"no handler for %s\", name); } } /** Immediate-mode frame: breadcrumb, places, content grid, status.", "kind": "function", "line": 511, "name": "file_ui_build", "signature": "static void file_ui_build(struct nk_context *ctx)"}, {"doc": "Headless selftest for BDD: assoc vectors plus a live listing. The live set must drain to its entry baseline: every icon decode, preview decode and assoc push in this body frees what it borrows, so a * regression in the file -> vedit open path fails here first.", "kind": "function", "line": 613, "name": "file_selftest", "signature": "static int file_selftest(void)"}, {"kind": "function", "line": 779, "name": "file_gui_run", "signature": "static void file_gui_run(void)"}, {"kind": "function", "line": 838, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 24, "name": "STB_IMAGE_IMPLEMENTATION", "signature": "#define STB_IMAGE_IMPLEMENTATION"}, {"kind": "macro", "line": 25, "name": "STBI_ONLY_PNG", "signature": "#define STBI_ONLY_PNG"}, {"kind": "macro", "line": 26, "name": "STBI_NO_STDIO", "signature": "#define STBI_NO_STDIO"}, {"kind": "macro", "line": 28, "name": "MINIOS_LEAKCHECK_IMPL", "signature": "#define MINIOS_LEAKCHECK_IMPL"}, {"kind": "macro", "line": 29, "name": "MINIOS_LK_ENABLE", "signature": "#define MINIOS_LK_ENABLE"}, {"kind": "macro", "line": 33, "name": "FILE_MAX_PATH", "signature": "#define FILE_MAX_PATH"}, {"kind": "macro", "line": 34, "name": "FILE_MAX_ENTRIES", "signature": "#define FILE_MAX_ENTRIES"}, {"kind": "macro", "line": 35, "name": "FILE_NAME_MAX", "signature": "#define FILE_NAME_MAX"}, {"kind": "macro", "line": 36, "name": "FILE_LIST_CAP", "signature": "#define FILE_LIST_CAP"}, {"kind": "macro", "line": 37, "name": "FILE_ASSOC_PATH", "signature": "#define FILE_ASSOC_PATH"}, {"kind": "macro", "line": 38, "name": "FILE_EXT_MAX", "signature": "#define FILE_EXT_MAX"}, {"kind": "macro", "line": 39, "name": "FILE_PROG_MAX", "signature": "#define FILE_PROG_MAX"}, {"kind": "macro", "line": 40, "name": "FILE_TOOL_VEDIT", "signature": "#define FILE_TOOL_VEDIT"}, {"kind": "macro", "line": 41, "name": "FILE_TOOL_CVM", "signature": "#define FILE_TOOL_CVM"}, {"kind": "macro", "line": 42, "name": "FILE_STATUS_MAX", "signature": "#define FILE_STATUS_MAX"}, {"kind": "macro", "line": 43, "name": "FILE_UI_MEMORY", "signature": "#define FILE_UI_MEMORY"}, {"kind": "macro", "line": 44, "name": "FILE_PREVIEW_W", "signature": "#define FILE_PREVIEW_W"}, {"kind": "macro", "line": 45, "name": "FILE_PREVIEW_H", "signature": "#define FILE_PREVIEW_H"}, {"kind": "macro", "line": 46, "name": "FILE_PREVIEW_FILE_MAX", "signature": "#define FILE_PREVIEW_FILE_MAX"}, {"kind": "macro", "line": 47, "name": "FILE_TITLE", "signature": "#define FILE_TITLE"}, {"kind": "macro", "line": 48, "name": "FILE_ACTION_SHELL", "signature": "#define FILE_ACTION_SHELL"}, {"kind": "macro", "line": 49, "name": "FILE_ACTION_INTERNAL", "signature": "#define FILE_ACTION_INTERNAL"}, {"kind": "macro", "line": 50, "name": "FILE_LOG_LINE", "signature": "#define FILE_LOG_LINE"}, {"kind": "macro", "line": 57, "name": "FILE_ICON_SMALL", "signature": "#define FILE_ICON_SMALL"}, {"kind": "macro", "line": 58, "name": "FILE_ICON_BIG", "signature": "#define FILE_ICON_BIG"}, {"kind": "macro", "line": 59, "name": "FILE_ICON_MAX", "signature": "#define FILE_ICON_MAX"}, {"kind": "macro", "line": 60, "name": "FILE_ICON_N", "signature": "#define FILE_ICON_N"}, {"kind": "macro", "line": 61, "name": "FILE_ICON_FOLDER", "signature": "#define FILE_ICON_FOLDER"}, {"kind": "macro", "line": 62, "name": "FILE_ICON_FILES", "signature": "#define FILE_ICON_FILES"}, {"kind": "macro", "line": 63, "name": "FILE_ICON_IMAGE", "signature": "#define FILE_ICON_IMAGE"}, {"kind": "macro", "line": 64, "name": "FILE_ICON_OBJECT", "signature": "#define FILE_ICON_OBJECT"}, {"kind": "macro", "line": 65, "name": "FILE_ICON_PATH_FOLDER", "signature": "#define FILE_ICON_PATH_FOLDER"}, {"kind": "macro", "line": 66, "name": "FILE_ICON_PATH_FILES", "signature": "#define FILE_ICON_PATH_FILES"}, {"kind": "macro", "line": 67, "name": "FILE_ICON_PATH_IMAGE", "signature": "#define FILE_ICON_PATH_IMAGE"}, {"kind": "macro", "line": 68, "name": "FILE_ICON_PATH_OBJECT", "signature": "#define FILE_ICON_PATH_OBJECT"}, {"kind": "macro", "line": 71, "name": "FILE_ACT_TEXT", "signature": "#define FILE_ACT_TEXT"}, {"kind": "macro", "line": 72, "name": "FILE_ACT_SHELL", "signature": "#define FILE_ACT_SHELL"}, {"kind": "macro", "line": 73, "name": "FILE_ACT_INTERNAL", "signature": "#define FILE_ACT_INTERNAL"}, {"kind": "macro", "line": 74, "name": "FILE_ACT_UNKNOWN", "signature": "#define FILE_ACT_UNKNOWN"}]}, {"doc": "Docstring: dynamic association table for the MiniOS file browser.", "id": "progs/file/file_assoc.h", "kind": "module", "label": "file_assoc.h", "language": "h", "sha256": "af3bef2e5eed1ae0", "symbol_count": 17, "symbols": [{"doc": "#ifndef FASSOC_HARD_MAX #define FASSOC_HARD_MAX 512 #endif #ifndef FASSOC_GROW_NUM #define FASSOC_GROW_NUM 2 #endif #ifndef FASSOC_GROW_DEN #define FASSOC_GROW_DEN 1 #endif /** Docstring: one validated association entry, ext without dot.", "kind": "struct", "line": 46, "name": "fassoc_entry"}, {"doc": "#define FASSOC_GROW_NUM 2 #endif #ifndef FASSOC_GROW_DEN #define FASSOC_GROW_DEN 1 #endif /** Docstring: one validated association entry, ext without dot. struct fassoc_entry { char ext[FASSOC_EXT_MAX + 1]; char prog[FASSOC_PROG_MAX + 1]; }; /** Docstring: dynamic table state, zero init is valid.", "kind": "struct", "line": 52, "name": "fassoc_table"}, {"doc": "/** Docstring: one validated association entry, ext without dot. struct fassoc_entry { char ext[FASSOC_EXT_MAX + 1]; char prog[FASSOC_PROG_MAX + 1]; }; /** Docstring: dynamic table state, zero init is valid. struct fassoc_table { struct fassoc_entry *p; size_t cnt; size_t cap; }; /** Docstring: validate ext against the assoc line charset and bound.", "kind": "function", "line": 59, "name": "fassoc_ext_ok", "signature": "static int fassoc_ext_ok(const char *ext)"}, {"doc": "static int fassoc_ext_ok(const char *ext) { size_t n = 0; size_t k = 0; if (ext == NULL) return 0; while (ext[n] != 0) n++; if (n == 0 || n > (size_t)FASSOC_EXT_MAX) return 0; for (k = 0; k < n; k++) { char c = ext[k]; if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))) return 0; } return 1; } /** Docstring: validate prog against shell, internal, or absolute path.", "kind": "function", "line": 73, "name": "fassoc_prog_ok", "signature": "static int fassoc_prog_ok(const char *prog)"}, {"doc": "size_t k = 0; if (prog == NULL) return 0; while (prog[n] != 0) n++; if (n == 0 || n > (size_t)FASSOC_PROG_MAX) return 0; if (strcmp(prog, \"shell\") == 0) return 1; if (strcmp(prog, \"internal\") == 0) return 1; if (prog[0] != '/') return 0; for (k = 0; k < n; k++) { if (prog[k] == '|') return 0; } return 1; } /** Docstring: reset table to empty without releasing capacity.", "kind": "function", "line": 89, "name": "fassoc_clear", "signature": "static void fassoc_clear(struct fassoc_table *t)"}, {"doc": "if (prog[0] != '/') return 0; for (k = 0; k < n; k++) { if (prog[k] == '|') return 0; } return 1; } /** Docstring: reset table to empty without releasing capacity. static void fassoc_clear(struct fassoc_table *t) { if (t == NULL) return; t->cnt = 0; } /** Docstring: release backing store and reset to zero init state.", "kind": "function", "line": 95, "name": "fassoc_free", "signature": "static void fassoc_free(struct fassoc_table *t)"}, {"doc": "if (t == NULL) return; t->cnt = 0; } /** Docstring: release backing store and reset to zero init state. static void fassoc_free(struct fassoc_table *t) { if (t == NULL) return; free(t->p); t->p = NULL; t->cnt = 0; t->cap = 0; } /** Docstring: ensure capacity for want entries, old data kept on failure.", "kind": "function", "line": 104, "name": "fassoc_reserve", "signature": "static int fassoc_reserve(struct fassoc_table *t, size_t want)"}, {"doc": "while (ncap < want) { size_t nxt = ncap * (size_t)FASSOC_GROW_NUM / (size_t)FASSOC_GROW_DEN + 1; if (nxt <= ncap) return -1; if (nxt > (size_t)FASSOC_HARD_MAX) nxt = (size_t)FASSOC_HARD_MAX; ncap = nxt; } np = (struct fassoc_entry *)realloc(t->p, ncap * sizeof(*np)); if (np == NULL) return -1; t->p = np; t->cap = ncap; return 0; } /** Docstring: append one validated entry, fail closed without mutation.", "kind": "function", "line": 125, "name": "fassoc_push", "signature": "static int fassoc_push(struct fassoc_table *t, const char *ext, const char *prog)"}, {"doc": "if (t == NULL) return -1; if (!fassoc_ext_ok(ext)) return -1; if (!fassoc_prog_ok(prog)) return -1; if (t->cnt >= (size_t)FASSOC_HARD_MAX) return -1; if (t->cnt >= t->cap) { if (fassoc_reserve(t, t->cnt + 1) != 0) return -1; } strcpy(t->p[t->cnt].ext, ext); strcpy(t->p[t->cnt].prog, prog); t->cnt++; return 0; } /** Docstring: program for ext in file order, empty string when unmapped.", "kind": "function", "line": 140, "name": "fassoc_lookup", "signature": "static const char *fassoc_lookup(const struct fassoc_table *t, const char *ext)"}, {"doc": "return 0; } /** Docstring: program for ext in file order, empty string when unmapped. static const char *fassoc_lookup(const struct fassoc_table *t, const char *ext) { size_t k = 0; if (t == NULL || ext == NULL || ext[0] == 0) return \"\"; for (k = 0; k < t->cnt; k++) { if (strcmp(t->p[k].ext, ext) == 0) return t->p[k].prog; } return \"\"; } /** Docstring: logical entry count, zero for null table.", "kind": "function", "line": 150, "name": "fassoc_count", "signature": "static size_t fassoc_count(const struct fassoc_table *t)"}, {"kind": "macro", "line": 15, "name": "MINIOS_FILE_ASSOC_H", "signature": "#define MINIOS_FILE_ASSOC_H"}, {"kind": "macro", "line": 22, "name": "FASSOC_EXT_MAX", "signature": "#define FASSOC_EXT_MAX"}, {"kind": "macro", "line": 26, "name": "FASSOC_PROG_MAX", "signature": "#define FASSOC_PROG_MAX"}, {"kind": "macro", "line": 30, "name": "FASSOC_INIT_CAP", "signature": "#define FASSOC_INIT_CAP"}, {"kind": "macro", "line": 34, "name": "FASSOC_HARD_MAX", "signature": "#define FASSOC_HARD_MAX"}, {"kind": "macro", "line": 38, "name": "FASSOC_GROW_NUM", "signature": "#define FASSOC_GROW_NUM"}, {"kind": "macro", "line": 42, "name": "FASSOC_GROW_DEN", "signature": "#define FASSOC_GROW_DEN"}]}, {"doc": "freedomui_minios - Real FreeDom browser on MiniOS, DOOM/Q2G pattern.", "id": "progs/freedomui/freedomui_minios.c", "kind": "module", "label": "freedomui_minios.c", "language": "c", "sha256": "ef3de8a94f5560e7", "symbol_count": 44, "symbols": [{"doc": "#define FUI_NET_BUF 768L #define FUI_REQ_MAX 768L #define FUI_HOST_MAX 64L #define FUI_PATH_MAX 128L #define FUI_URL_MAX 512L #define FUI_HOPS_MAX 3L #define FUI_FONT_W 8L #define FUI_FONT_H 8L #define FUI_TITLE_MAX 31L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Centralized configuration for the MiniOS backend.", "kind": "struct", "line": 69, "name": "FreedomUiConfig"}, {"doc": "#define FUI_NET_BUF 768L #define FUI_REQ_MAX 768L #define FUI_HOST_MAX 64L #define FUI_PATH_MAX 128L #define FUI_URL_MAX 512L #define FUI_HOPS_MAX 3L #define FUI_FONT_W 8L #define FUI_FONT_H 8L #define FUI_TITLE_MAX 31L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Centralized configuration for the MiniOS backend.", "kind": "type_alias", "line": 69, "name": "present_buf", "signature": "typedef struct FreedomUiConfig { long present_buf;"}, {"doc": "long path_max; long url_max; long hops_max; long font_w; long font_h; long port_http; long port_https; long ink_bg; long ink_fg; long bar_bg; long bar_fg; } FreedomUiConfig; /** Default configuration derived from the ABI header.", "kind": "function", "line": 97, "name": "freedomui_default", "signature": "static FreedomUiConfig freedomui_default(void)"}, {"doc": "Shared hybrid palette, one table for every NK-window app (progs/nk_palette.h); this wrapper keeps the historic name and fail-closed contract the host suite pins.", "kind": "function", "line": 130, "name": "freedomui_build_palette", "signature": "static long freedomui_build_palette(unsigned char *pal, long cap)"}, {"doc": "Parse a fetched body through the real engine into owned title and text.  Runs hp_parse with secure defaults (scripts stripped, handlers stripped) then hp_get_title and hp_extract_text. Both out pointers are owned buffers the caller releases with hp_free; either may be NULL when the document carries no title or no text. Returns element count, or -1 on parse failure. Fail-closed on every bound.", "kind": "function", "line": 145, "name": "freedomui_engine_text", "signature": "static long freedomui_engine_text(char *body, long n, char **title, char **text)"}, {"doc": "static char f_path[FUI_PATH_MAX]; static char f_loc[FUI_URL_MAX]; static char f_hdr[FUI_HDR_MAX]; static char f_body[FUI_BODY_CAP]; static char *f_text; static ui_layout f_lay; static long f_elems; static long f_nbytes; static long f_secure; static long f_port; static long f_status; static long f_truncated; /** Present syscall wrapper for the NK buffer path.", "kind": "function", "line": 193, "name": "freedomui_sys_present", "signature": "static long freedomui_sys_present(long buf, long origin)"}, {"doc": "static long f_nbytes; static long f_secure; static long f_port; static long f_status; static long f_truncated; /** Present syscall wrapper for the NK buffer path. static long freedomui_sys_present(long buf, long origin) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_PRESENT), \"D\"(buf), \"S\"(origin) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Set window title through the generic title syscall.", "kind": "function", "line": 200, "name": "freedomui_sys_title", "signature": "static long freedomui_sys_title(char *t)"}, {"doc": "static long freedomui_sys_present(long buf, long origin) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_PRESENT), \"D\"(buf), \"S\"(origin) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Set window title through the generic title syscall. static long freedomui_sys_title(char *t) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_SET_TITLE), \"D\"(t) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels.", "kind": "function", "line": 207, "name": "freedomui_sys_palette", "signature": "static long freedomui_sys_palette(unsigned char *pal)"}, {"doc": "static long freedomui_sys_title(char *t) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_SET_TITLE), \"D\"(t) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels. static long freedomui_sys_palette(unsigned char *pal) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_PALETTE), \"D\"(pal) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Read desktop mouse state into a four word buffer.", "kind": "function", "line": 214, "name": "freedomui_sys_mouse", "signature": "static long freedomui_sys_mouse(long *m)"}, {"doc": "static long freedomui_sys_palette(unsigned char *pal) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_PALETTE), \"D\"(pal) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Read desktop mouse state into a four word buffer. static long freedomui_sys_mouse(long *m) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_MOUSE), \"D\"(m) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Poll one raw keyboard scancode, negative when idle.", "kind": "function", "line": 221, "name": "freedomui_sys_kbd", "signature": "static long freedomui_sys_kbd(void)"}, {"doc": "static long freedomui_sys_mouse(long *m) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_MOUSE), \"D\"(m) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Poll one raw keyboard scancode, negative when idle. static long freedomui_sys_kbd(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD), \"D\"(0) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Tell the kernel a graphics program owns the display.", "kind": "function", "line": 228, "name": "freedomui_sys_vga_mode", "signature": "static long freedomui_sys_vga_mode(long on)"}, {"doc": "static long freedomui_sys_kbd(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD), \"D\"(0) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Tell the kernel a graphics program owns the display. static long freedomui_sys_vga_mode(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_VGA_MODE), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Switch the console into raw scancode mode.", "kind": "function", "line": 235, "name": "freedomui_sys_kbd_raw", "signature": "static long freedomui_sys_kbd_raw(long on)"}, {"doc": "static long freedomui_sys_vga_mode(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_VGA_MODE), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Switch the console into raw scancode mode. static long freedomui_sys_kbd_raw(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD_RAW), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Voluntary yield to the scheduler.", "kind": "function", "line": 242, "name": "freedomui_sys_yield", "signature": "static long freedomui_sys_yield(void)"}, {"doc": "static long freedomui_sys_kbd_raw(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD_RAW), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Voluntary yield to the scheduler. static long freedomui_sys_yield(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_SCHED_YIELD), \"D\"(0) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Bounded append of src at dst[pos].", "kind": "function", "line": 249, "name": "fui_append", "signature": "static long fui_append(char *dst, long pos, char *src, long cap)"}, {"doc": "} i = 0L; while (src[i] != 0) { if (pos + i + 1L >= cap) { return -1L; } dst[pos + i] = src[i]; i++; } dst[pos + i] = 0; return pos + i; } /** Bounded string length.", "kind": "function", "line": 267, "name": "fui_strlen", "signature": "static long fui_strlen(char *s, long cap)"}, {"doc": "Nonzero when the target starts with the given scheme (case-insensitive). RFC 3986 says the scheme is case-insensitive, so * \"HTTP://host\" and \"http://host\" are the same target.", "kind": "function", "line": 285, "name": "fui_has_scheme", "signature": "static int fui_has_scheme(const char *s, const char *scheme)"}, {"doc": "Nonzero when the target starts with the explicit \"http://\" scheme (case-insensitive). The FreeDom omnibox upgrades every http:// target to https; the MiniOS contract keeps an explicit http:// on http, so * the browser has to tell the two apart before the omnibox sees it.", "kind": "function", "line": 309, "name": "fui_is_http_scheme", "signature": "static int fui_is_http_scheme(const char *s)"}, {"doc": "Nonzero when the target starts with the explicit \"http://\" scheme (case-insensitive). The FreeDom omnibox upgrades every http:// target to https; the MiniOS contract keeps an explicit http:// on http, so * the browser has to tell the two apart before the omnibox sees it. static int fui_is_http_scheme(const char *s) { return fui_has_scheme(s, \"http://\"); } /** Split an http(s) URL into host, path, port and secure flag.", "kind": "function", "line": 314, "name": "fui_split_url", "signature": "static long fui_split_url(FreedomUiConfig *c, char *url, char *host, char *path, long *port, long..."}, {"doc": "return 0L; } path[k] = p[hl + k]; k++; } path[k] = 0; } else { path[0] = '/'; path[1] = 0; } return 1L; } /** Parse response headers into status, length, encoding and routing.", "kind": "function", "line": 383, "name": "fui_parse_headers", "signature": "static long fui_parse_headers(FreedomUiConfig *c, char *hdr, long *status, long *clen, long *hasc..."}, {"doc": "} k++; } } } line++; while (hdr[i] == '\\r' || hdr[i] == '\\n') { i++; } } return 0L; } /** Fetch one response body into the page buffer.", "kind": "function", "line": 501, "name": "fui_fetch_raw", "signature": "static long fui_fetch_raw(FreedomUiConfig *c, char *host, char *path, long port, long secure)"}, {"doc": "if (got < c->body_cap) { f_body[got] = (char)ch; got++; } else { f_truncated = 1L; } } } } tls_close((int)fd); return got; } /** Render the engine text window at the given scroll offset.", "kind": "function", "line": 729, "name": "fui_render", "signature": "static long fui_render(FreedomUiConfig *c, size_t off)"}, {"doc": "long ink; if (bits & (0x80 >> px)) { ink = c->bar_fg; } else { ink = c->bar_bg; } fb[((size_t)c->text_rows * (size_t)c->font_h + (size_t)row) * (size_t)c->surface_w + (size_t)col * (size_t)c->font_w + (size_t)px] = (unsigned char)ink; } } } return freedomui_sys_present(c->present_buf, 0L); } /** Interactive scroll loop until q or ESC quits.", "kind": "function", "line": 848, "name": "fui_browse", "signature": "static long fui_browse(FreedomUiConfig *c)"}, {"doc": "} off = ui_clamp_scroll((size_t)want, f_lay.count, (size_t)c->text_rows); changed = 1L; } if (changed) { if (fui_render(c, off) < 0L) { return 1L; } } freedomui_sys_yield(); } } /** Guest selftest entry mirroring the Nuklear frame contract.", "kind": "function", "line": 927, "name": "freedomui_selftest", "signature": "static long freedomui_selftest(void)"}, {"doc": "return 1L; } if (freedomui_sys_kbd() > 0x7FFFFFFFL) { printf(\"freedomui: kbd out of range\\n\"); return 1L; } freedomui_sys_title(\"FreeDom\"); printf(\"freedomui: frame ok (%ldx%ld)\\n\", c.surface_w, c.surface_h); return 0L; } #endif #ifdef FREEDOMUI_HOST_TEST /** Host harness probe for pure backend logic plus engine linkage.", "kind": "function", "line": 1015, "name": "freedomui_host_probe", "signature": "static long freedomui_host_probe(FreedomUiConfig *c)"}, {"doc": "if (title) { hp_free(title); } return -1L; } ui_layout_free(&lay); hp_free(text); if (title) { hp_free(title); } return 0L; } /** Host harness entry for pure backend logic plus engine linkage.", "kind": "function", "line": 1098, "name": "freedomui_host_entry", "signature": "int freedomui_host_entry(FreedomUiConfig *c)"}, {"doc": "ui_layout_free(&lay); hp_free(text); if (title) { hp_free(title); } return 0L; } /** Host harness entry for pure backend logic plus engine linkage. int freedomui_host_entry(FreedomUiConfig *c) { return (int)freedomui_host_probe(c); } #else /** Guest entry point shared by the MiniFS binary.", "kind": "function", "line": 1103, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 44, "name": "net_dns_resolve", "signature": "int net_dns_resolve(const char *host);"}, {"kind": "function", "line": 45, "name": "tls_handshake", "signature": "int tls_handshake(int fd, char *host);"}, {"kind": "function", "line": 46, "name": "tls_send", "signature": "int tls_send(int fd, char *buf, int len);"}, {"kind": "function", "line": 47, "name": "tls_recv", "signature": "int tls_recv(int fd, char *buf, int len);"}, {"kind": "function", "line": 48, "name": "tls_close", "signature": "void tls_close(int fd);"}, {"kind": "macro", "line": 51, "name": "FUI_COLS", "signature": "#define FUI_COLS"}, {"kind": "macro", "line": 52, "name": "FUI_TEXT_ROWS", "signature": "#define FUI_TEXT_ROWS"}, {"kind": "macro", "line": 53, "name": "FUI_BODY_CAP", "signature": "#define FUI_BODY_CAP"}, {"kind": "macro", "line": 54, "name": "FUI_HDR_MAX", "signature": "#define FUI_HDR_MAX"}, {"kind": "macro", "line": 55, "name": "FUI_NET_BUF", "signature": "#define FUI_NET_BUF"}, {"kind": "macro", "line": 56, "name": "FUI_REQ_MAX", "signature": "#define FUI_REQ_MAX"}, {"kind": "macro", "line": 57, "name": "FUI_HOST_MAX", "signature": "#define FUI_HOST_MAX"}, {"kind": "macro", "line": 58, "name": "FUI_PATH_MAX", "signature": "#define FUI_PATH_MAX"}, {"kind": "macro", "line": 59, "name": "FUI_URL_MAX", "signature": "#define FUI_URL_MAX"}, {"kind": "macro", "line": 60, "name": "FUI_HOPS_MAX", "signature": "#define FUI_HOPS_MAX"}, {"kind": "macro", "line": 61, "name": "FUI_FONT_W", "signature": "#define FUI_FONT_W"}, {"kind": "macro", "line": 62, "name": "FUI_FONT_H", "signature": "#define FUI_FONT_H"}, {"kind": "macro", "line": 63, "name": "FUI_TITLE_MAX", "signature": "#define FUI_TITLE_MAX"}]}, {"doc": "media_unavailable.c - FreeDom media decoder entry points for a build", "id": "progs/freedomui/media_unavailable.c", "kind": "module", "label": "media_unavailable.c", "language": "c", "sha256": "92153c5f3f65ba13", "symbol_count": 2, "symbols": [{"doc": "closed: no decoder process is ever started, and a direct --media-decoder invocation answers with one MD_ERROR and exits.  #include <errno.h> #include <stdint.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include \"media_decoder.h\" static const char media_unavailable_msg[] = \"media decoding is not available on MiniOS\"; /** Writes all of buf, retrying on short writes; stops on error.", "kind": "function", "line": 20, "name": "write_all", "signature": "static void write_all(int fd, const void *buf, size_t len)"}, {"doc": "Refuses to start a decoder: the caller reports the failure and stays * responsive (browser_ui video_play already handles a failed spawn). int media_decoder_spawn(pid_t *pid, int *out_fd, int *cmd_fd) { (void)pid; (void)out_fd; (void)cmd_fd; errno = ENOSYS; return -1; } /** --media-decoder entry: one non-fatal MD_ERROR, then exit.", "kind": "function", "line": 41, "name": "media_decoder_run", "signature": "void media_decoder_run(int out_fd, int cmd_fd)"}]}, {"doc": "platform_minios.c - MiniOS implementation of FreeDom's gui/platform.h.", "id": "progs/freedomui/platform_minios.c", "kind": "module", "label": "platform_minios.c", "language": "c", "sha256": "0752792187a9ee86", "symbol_count": 44, "symbols": [{"kind": "struct", "line": 56, "name": "pf_window"}, {"kind": "struct", "line": 68, "name": "pf_display"}, {"doc": "Run as a process, never in the shell's pid-0 exec frame: the browser's fetch threads, renderer fork and /proc/self/exe tab workers need real * process semantics (minios_abi.h, process note).", "kind": "struct", "line": 124, "name": "minios_process_note"}, {"kind": "function", "line": 83, "name": "sys_fb_info_rgb", "signature": "static long sys_fb_info_rgb(int *rgb)"}, {"kind": "function", "line": 94, "name": "now_ms", "signature": "static long now_ms(void)"}, {"kind": "function", "line": 98, "name": "set_title", "signature": "static void set_title(const char *title)"}, {"kind": "function", "line": 137, "name": "pf_display_open", "signature": "pf_status pf_display_open(pf_display **out)"}, {"kind": "function", "line": 153, "name": "pf_display_close", "signature": "void pf_display_close(pf_display *d)"}, {"kind": "function", "line": 162, "name": "pf_display_flush", "signature": "void pf_display_flush(pf_display *d)"}, {"kind": "function", "line": 166, "name": "pf_display_set_cursor", "signature": "void pf_display_set_cursor(pf_display *d, pf_cursor c)"}, {"kind": "function", "line": 173, "name": "deliver_pending", "signature": "static int deliver_pending(pf_display *d)"}, {"kind": "function", "line": 183, "name": "key_event", "signature": "static void key_event(pf_display *d, const ps2_key *k, int kind)"}, {"kind": "function", "line": 210, "name": "pump_keyboard", "signature": "static int pump_keyboard(pf_display *d)"}, {"kind": "function", "line": 224, "name": "pump_mouse", "signature": "static int pump_mouse(pf_display *d)"}, {"kind": "function", "line": 268, "name": "pf_display_wait", "signature": "int pf_display_wait(pf_display *d, struct pollfd *extra, int n, int timeout_ms)"}, {"kind": "function", "line": 293, "name": "pf_clipboard_available", "signature": "int pf_clipboard_available(const pf_display *d)"}, {"kind": "function", "line": 297, "name": "pf_clipboard_set_text", "signature": "pf_status pf_clipboard_set_text(pf_display *d, const char *text)"}, {"kind": "function", "line": 304, "name": "pf_clipboard_get_text", "signature": "pf_status pf_clipboard_get_text(pf_display *d, char **out, size_t *out_len)"}, {"kind": "function", "line": 320, "name": "pf_window_open", "signature": "pf_status pf_window_open(pf_display *d, const pf_window_opts *o,\n                         const p..."}, {"kind": "function", "line": 342, "name": "pf_window_close", "signature": "void pf_window_close(pf_window *w)"}, {"kind": "function", "line": 359, "name": "pf_window_surface", "signature": "cairo_surface_t *pf_window_surface(pf_window *w, int width, int height)"}, {"kind": "function", "line": 374, "name": "pf_window_present", "signature": "void pf_window_present(pf_window *w)"}, {"kind": "function", "line": 408, "name": "pf_window_set_title", "signature": "void pf_window_set_title(pf_window *w, const char *title)"}, {"kind": "function", "line": 414, "name": "set_zoom_state", "signature": "static void set_zoom_state(pf_window *w, unsigned bit, int on)"}, {"kind": "function", "line": 424, "name": "pf_window_set_maximized", "signature": "void pf_window_set_maximized(pf_window *w, int on)"}, {"kind": "function", "line": 428, "name": "pf_window_set_fullscreen", "signature": "void pf_window_set_fullscreen(pf_window *w, int on)"}, {"kind": "function", "line": 432, "name": "pf_window_minimize", "signature": "void pf_window_minimize(pf_window *w)"}, {"kind": "function", "line": 436, "name": "pf_window_begin_move", "signature": "void pf_window_begin_move(pf_window *w)"}, {"kind": "function", "line": 440, "name": "pf_window_begin_resize", "signature": "void pf_window_begin_resize(pf_window *w, pf_edge edge)"}, {"kind": "macro", "line": 11, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 27, "name": "FREEDOM_GUI_TICK_MS", "signature": "#define FREEDOM_GUI_TICK_MS"}, {"kind": "macro", "line": 29, "name": "FREEDOM_GUI_KBD_DRAIN_MAX", "signature": "#define FREEDOM_GUI_KBD_DRAIN_MAX"}, {"kind": "macro", "line": 31, "name": "FREEDOM_GUI_TITLE_MAX", "signature": "#define FREEDOM_GUI_TITLE_MAX"}, {"kind": "macro", "line": 33, "name": "FREEDOM_GUI_CLIP_MAX", "signature": "#define FREEDOM_GUI_CLIP_MAX"}, {"kind": "macro", "line": 35, "name": "FREEDOM_GUI_MALLOC_ARENAS", "signature": "#define FREEDOM_GUI_MALLOC_ARENAS"}, {"kind": "macro", "line": 38, "name": "FREEDOM_GUI_MOUSE_WORDS", "signature": "#define FREEDOM_GUI_MOUSE_WORDS"}, {"kind": "macro", "line": 39, "name": "FREEDOM_GUI_MOUSE_X", "signature": "#define FREEDOM_GUI_MOUSE_X"}, {"kind": "macro", "line": 40, "name": "FREEDOM_GUI_MOUSE_Y", "signature": "#define FREEDOM_GUI_MOUSE_Y"}, {"kind": "macro", "line": 41, "name": "FREEDOM_GUI_MOUSE_BUTTONS", "signature": "#define FREEDOM_GUI_MOUSE_BUTTONS"}, {"kind": "macro", "line": 42, "name": "FREEDOM_GUI_MOUSE_WHEEL", "signature": "#define FREEDOM_GUI_MOUSE_WHEEL"}, {"kind": "macro", "line": 44, "name": "FREEDOM_GUI_BUTTONS", "signature": "#define FREEDOM_GUI_BUTTONS"}, {"kind": "macro", "line": 46, "name": "FREEDOM_GUI_KEY_F4", "signature": "#define FREEDOM_GUI_KEY_F4"}, {"kind": "macro", "line": 48, "name": "FREEDOM_GUI_RGB_BPP", "signature": "#define FREEDOM_GUI_RGB_BPP"}, {"kind": "macro", "line": 50, "name": "FREEDOM_GUI_RGB_PRESENT", "signature": "#define FREEDOM_GUI_RGB_PRESENT"}]}, {"doc": "ps2_keymap.c - pure PS/2 set 1 scancode to keysym translator (US layout).", "id": "progs/freedomui/ps2_keymap.c", "kind": "module", "label": "ps2_keymap.c", "language": "c", "sha256": "4bf5fc9e108c3796", "symbol_count": 82, "symbols": [{"doc": "[0x07] = '^', [0x08] = '&', [0x09] = '*', [0x0A] = '(', [0x0B] = ')', [0x0C] = '_', [0x0D] = '+', [0x10] = 'Q', [0x11] = 'W', [0x12] = 'E', [0x13] = 'R', [0x14] = 'T', [0x15] = 'Y', [0x16] = 'U', [0x17] = 'I', [0x18] = 'O', [0x19] = 'P', [0x1A] = '{', [0x1B] = '}', [0x1E] = 'A', [0x1F] = 'S', [0x20] = 'D', [0x21] = 'F', [0x22] = 'G', [0x23] = 'H', [0x24] = 'J', [0x25] = 'K', [0x26] = 'L', [0x27] = ':', [0x28] = '\"', [0x29] = '~', [0x2B] = '|', [0x2C] = 'Z', [0x2D] = 'X', [0x2E] = 'C', [0x2F] = 'V', [0x30] = 'B', [0x31] = 'N', [0x32] = 'M', [0x33] = '<', [0x34] = '>', [0x35] = '?', [0x39] = ' ', }; /* Keypad 0x47..0x53: keysym and text with Num Lock on, keysym with it off.", "kind": "struct", "line": 122, "name": "ps2_keypad"}, {"doc": "[0x07] = '^', [0x08] = '&', [0x09] = '*', [0x0A] = '(', [0x0B] = ')', [0x0C] = '_', [0x0D] = '+', [0x10] = 'Q', [0x11] = 'W', [0x12] = 'E', [0x13] = 'R', [0x14] = 'T', [0x15] = 'Y', [0x16] = 'U', [0x17] = 'I', [0x18] = 'O', [0x19] = 'P', [0x1A] = '{', [0x1B] = '}', [0x1E] = 'A', [0x1F] = 'S', [0x20] = 'D', [0x21] = 'F', [0x22] = 'G', [0x23] = 'H', [0x24] = 'J', [0x25] = 'K', [0x26] = 'L', [0x27] = ':', [0x28] = '\"', [0x29] = '~', [0x2B] = '|', [0x2C] = 'Z', [0x2D] = 'X', [0x2E] = 'C', [0x2F] = 'V', [0x30] = 'B', [0x31] = 'N', [0x32] = 'M', [0x33] = '<', [0x34] = '>', [0x35] = '?', [0x39] = ' ', }; /* Keypad 0x47..0x53: keysym and text with Num Lock on, keysym with it off.", "kind": "type_alias", "line": 122, "name": "num_sym", "signature": "typedef struct ps2_keypad { uint32_t num_sym;"}, {"kind": "function", "line": 144, "name": "ps2_init", "signature": "void ps2_init(ps2_state *s)"}, {"kind": "function", "line": 150, "name": "held_mods", "signature": "static unsigned held_mods(const ps2_state *s)"}, {"kind": "function", "line": 158, "name": "set_text", "signature": "static void set_text(ps2_key *k, char c)"}, {"kind": "function", "line": 164, "name": "is_letter", "signature": "static int is_letter(char c)"}, {"doc": "return m; } static void set_text(ps2_key *k, char c) { k->text[0] = c; k->text[1] = '\\0'; k->text_len = 1; } static int is_letter(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } /* Modifier and lock keys: update the held state; returns the keysym or 0.", "kind": "function", "line": 169, "name": "modifier_key", "signature": "static uint32_t modifier_key(ps2_state *s, unsigned code, int extended, int make)"}, {"doc": "if (make) s->caps_lock = !s->caps_lock; return KE_KEY_Caps_Lock; } else if (!extended && code == SC_NUMLOCK) { if (make) s->num_lock = !s->num_lock; return KS_NUM_LOCK; } else { return 0; } if (make) s->held |= bit; else      s->held &= ~bit; return sym; } /* Keys behind E0 that are not modifiers.", "kind": "function", "line": 195, "name": "extended_key", "signature": "static uint32_t extended_key(unsigned code, ps2_key *k)"}, {"doc": "case SC_E0_RIGHT:  return KE_KEY_Right; case SC_E0_END:    return KE_KEY_End; case SC_E0_DOWN:   return KE_KEY_Down; case SC_E0_NEXT:   return KE_KEY_Page_Down; case SC_E0_INSERT: return KS_INSERT; case SC_E0_DELETE: set_text(k, (char)ASCII_DEL); return KE_KEY_Delete; case SC_E0_SUPERL: return KS_SUPER_L; case SC_E0_SUPERR: return KS_SUPER_R; case SC_E0_MENU:   return KS_MENU; default:           return 0; } } /* Keys without a prefix that are not modifiers.", "kind": "function", "line": 218, "name": "plain_key", "signature": "static uint32_t plain_key(const ps2_state *s, unsigned code, ps2_key *k)"}, {"kind": "function", "line": 253, "name": "ps2_feed", "signature": "int ps2_feed(ps2_state *s, uint8_t byte, ps2_key *out)"}, {"kind": "macro", "line": 13, "name": "PS2_PREFIX_EXTENDED", "signature": "#define PS2_PREFIX_EXTENDED"}, {"kind": "macro", "line": 14, "name": "PS2_PREFIX_PAUSE", "signature": "#define PS2_PREFIX_PAUSE"}, {"kind": "macro", "line": 15, "name": "PS2_PAUSE_TAIL", "signature": "#define PS2_PAUSE_TAIL"}, {"kind": "macro", "line": 16, "name": "PS2_BREAK_BIT", "signature": "#define PS2_BREAK_BIT"}, {"kind": "macro", "line": 17, "name": "PS2_CODE_MASK", "signature": "#define PS2_CODE_MASK"}, {"kind": "macro", "line": 18, "name": "PS2_TABLE_SIZE", "signature": "#define PS2_TABLE_SIZE"}, {"kind": "macro", "line": 20, "name": "PS2_HELD_LSHIFT", "signature": "#define PS2_HELD_LSHIFT"}, {"kind": "macro", "line": 21, "name": "PS2_HELD_RSHIFT", "signature": "#define PS2_HELD_RSHIFT"}, {"kind": "macro", "line": 22, "name": "PS2_HELD_LCTRL", "signature": "#define PS2_HELD_LCTRL"}, {"kind": "macro", "line": 23, "name": "PS2_HELD_RCTRL", "signature": "#define PS2_HELD_RCTRL"}, {"kind": "macro", "line": 24, "name": "PS2_HELD_LALT", "signature": "#define PS2_HELD_LALT"}, {"kind": "macro", "line": 25, "name": "PS2_HELD_RALT", "signature": "#define PS2_HELD_RALT"}, {"kind": "macro", "line": 27, "name": "SC_ESCAPE", "signature": "#define SC_ESCAPE"}, {"kind": "macro", "line": 28, "name": "SC_BACKSPACE", "signature": "#define SC_BACKSPACE"}, {"kind": "macro", "line": 29, "name": "SC_TAB", "signature": "#define SC_TAB"}, {"kind": "macro", "line": 30, "name": "SC_RETURN", "signature": "#define SC_RETURN"}, {"kind": "macro", "line": 31, "name": "SC_CTRL", "signature": "#define SC_CTRL"}, {"kind": "macro", "line": 32, "name": "SC_LSHIFT", "signature": "#define SC_LSHIFT"}, {"kind": "macro", "line": 33, "name": "SC_RSHIFT", "signature": "#define SC_RSHIFT"}, {"kind": "macro", "line": 34, "name": "SC_KP_MUL", "signature": "#define SC_KP_MUL"}, {"kind": "macro", "line": 35, "name": "SC_ALT", "signature": "#define SC_ALT"}, {"kind": "macro", "line": 36, "name": "SC_CAPS", "signature": "#define SC_CAPS"}, {"kind": "macro", "line": 37, "name": "SC_F1", "signature": "#define SC_F1"}, {"kind": "macro", "line": 38, "name": "SC_F10", "signature": "#define SC_F10"}, {"kind": "macro", "line": 39, "name": "SC_NUMLOCK", "signature": "#define SC_NUMLOCK"}, {"kind": "macro", "line": 40, "name": "SC_SCROLL", "signature": "#define SC_SCROLL"}, {"kind": "macro", "line": 41, "name": "SC_KP_FIRST", "signature": "#define SC_KP_FIRST"}, {"kind": "macro", "line": 42, "name": "SC_KP_LAST", "signature": "#define SC_KP_LAST"}, {"kind": "macro", "line": 43, "name": "SC_F11", "signature": "#define SC_F11"}, {"kind": "macro", "line": 44, "name": "SC_F12", "signature": "#define SC_F12"}, {"kind": "macro", "line": 45, "name": "SC_E0_KP_DIV", "signature": "#define SC_E0_KP_DIV"}, {"kind": "macro", "line": 46, "name": "SC_E0_PRINT", "signature": "#define SC_E0_PRINT"}, {"kind": "macro", "line": 47, "name": "SC_E0_HOME", "signature": "#define SC_E0_HOME"}, {"kind": "macro", "line": 48, "name": "SC_E0_UP", "signature": "#define SC_E0_UP"}, {"kind": "macro", "line": 49, "name": "SC_E0_PRIOR", "signature": "#define SC_E0_PRIOR"}, {"kind": "macro", "line": 50, "name": "SC_E0_LEFT", "signature": "#define SC_E0_LEFT"}, {"kind": "macro", "line": 51, "name": "SC_E0_RIGHT", "signature": "#define SC_E0_RIGHT"}, {"kind": "macro", "line": 52, "name": "SC_E0_END", "signature": "#define SC_E0_END"}, {"kind": "macro", "line": 53, "name": "SC_E0_DOWN", "signature": "#define SC_E0_DOWN"}, {"kind": "macro", "line": 54, "name": "SC_E0_NEXT", "signature": "#define SC_E0_NEXT"}, {"kind": "macro", "line": 55, "name": "SC_E0_INSERT", "signature": "#define SC_E0_INSERT"}, {"kind": "macro", "line": 56, "name": "SC_E0_DELETE", "signature": "#define SC_E0_DELETE"}, {"kind": "macro", "line": 57, "name": "SC_E0_SUPERL", "signature": "#define SC_E0_SUPERL"}, {"kind": "macro", "line": 58, "name": "SC_E0_SUPERR", "signature": "#define SC_E0_SUPERR"}, {"kind": "macro", "line": 59, "name": "SC_E0_MENU", "signature": "#define SC_E0_MENU"}, {"kind": "macro", "line": 61, "name": "KS_F1", "signature": "#define KS_F1"}, {"kind": "macro", "line": 62, "name": "KS_F11", "signature": "#define KS_F11"}, {"kind": "macro", "line": 63, "name": "KS_INSERT", "signature": "#define KS_INSERT"}, {"kind": "macro", "line": 64, "name": "KS_PRINT", "signature": "#define KS_PRINT"}, {"kind": "macro", "line": 65, "name": "KS_MENU", "signature": "#define KS_MENU"}, {"kind": "macro", "line": 66, "name": "KS_SCROLL_LOCK", "signature": "#define KS_SCROLL_LOCK"}, {"kind": "macro", "line": 67, "name": "KS_NUM_LOCK", "signature": "#define KS_NUM_LOCK"}, {"kind": "macro", "line": 68, "name": "KS_SUPER_L", "signature": "#define KS_SUPER_L"}, {"kind": "macro", "line": 69, "name": "KS_SUPER_R", "signature": "#define KS_SUPER_R"}, {"kind": "macro", "line": 70, "name": "KS_KP_HOME", "signature": "#define KS_KP_HOME"}, {"kind": "macro", "line": 71, "name": "KS_KP_LEFT", "signature": "#define KS_KP_LEFT"}, {"kind": "macro", "line": 72, "name": "KS_KP_UP", "signature": "#define KS_KP_UP"}, {"kind": "macro", "line": 73, "name": "KS_KP_RIGHT", "signature": "#define KS_KP_RIGHT"}, {"kind": "macro", "line": 74, "name": "KS_KP_DOWN", "signature": "#define KS_KP_DOWN"}, {"kind": "macro", "line": 75, "name": "KS_KP_PRIOR", "signature": "#define KS_KP_PRIOR"}, {"kind": "macro", "line": 76, "name": "KS_KP_NEXT", "signature": "#define KS_KP_NEXT"}, {"kind": "macro", "line": 77, "name": "KS_KP_END", "signature": "#define KS_KP_END"}, {"kind": "macro", "line": 78, "name": "KS_KP_BEGIN", "signature": "#define KS_KP_BEGIN"}, {"kind": "macro", "line": 79, "name": "KS_KP_INSERT", "signature": "#define KS_KP_INSERT"}, {"kind": "macro", "line": 80, "name": "KS_KP_MULTIPLY", "signature": "#define KS_KP_MULTIPLY"}, {"kind": "macro", "line": 81, "name": "KS_KP_DECIMAL", "signature": "#define KS_KP_DECIMAL"}, {"kind": "macro", "line": 82, "name": "KS_KP_DIVIDE", "signature": "#define KS_KP_DIVIDE"}, {"kind": "macro", "line": 84, "name": "ASCII_BS", "signature": "#define ASCII_BS"}, {"kind": "macro", "line": 85, "name": "ASCII_TAB", "signature": "#define ASCII_TAB"}, {"kind": "macro", "line": 86, "name": "ASCII_CR", "signature": "#define ASCII_CR"}, {"kind": "macro", "line": 87, "name": "ASCII_ESC", "signature": "#define ASCII_ESC"}, {"kind": "macro", "line": 88, "name": "ASCII_DEL", "signature": "#define ASCII_DEL"}]}, {"doc": "ps2_keymap.h - pure PS/2 set 1 scancode to keysym translator (US layout).", "id": "progs/freedomui/ps2_keymap.h", "kind": "module", "label": "ps2_keymap.h", "language": "h", "sha256": "d5402c105ba35ff4", "symbol_count": 13, "symbols": [{"doc": "#define PS2_EV_NONE    0 #define PS2_EV_PRESS   1 #define PS2_EV_RELEASE 2 /** Bit set in ps2_key.code for keys sent behind the E0 prefix. #define PS2_CODE_EXTENDED 0x100u /** Upper bound of ps2_key.code, for callers that track held keys. #define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes.", "kind": "struct", "line": 29, "name": "ps2_state"}, {"doc": "#define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes. typedef struct ps2_state { unsigned held;      /* PS2_HELD_* bits int      caps_lock; int      num_lock; int      extended;  /* an E0 prefix is pending int      skip;      /* bytes of an E1 sequence still to swallow } ps2_state; /** One translated key event.", "kind": "struct", "line": 38, "name": "ps2_key"}, {"doc": "#define PS2_EV_NONE    0 #define PS2_EV_PRESS   1 #define PS2_EV_RELEASE 2 /** Bit set in ps2_key.code for keys sent behind the E0 prefix. #define PS2_CODE_EXTENDED 0x100u /** Upper bound of ps2_key.code, for callers that track held keys. #define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes.", "kind": "type_alias", "line": 29, "name": "held", "signature": "typedef struct ps2_state { unsigned held;"}, {"doc": "#define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes. typedef struct ps2_state { unsigned held;      /* PS2_HELD_* bits int      caps_lock; int      num_lock; int      extended;  /* an E0 prefix is pending int      skip;      /* bytes of an E1 sequence still to swallow } ps2_state; /** One translated key event.", "kind": "type_alias", "line": 38, "name": "sym", "signature": "typedef struct ps2_key { uint32_t sym;"}, {"doc": "int      extended;  /* an E0 prefix is pending int      skip;      /* bytes of an E1 sequence still to swallow } ps2_state; /** One translated key event. typedef struct ps2_key { uint32_t sym;                /* X11/xkb keysym uint32_t code;               /* make code, PS2_CODE_EXTENDED for E0 keys char     text[PS2_TEXT_MAX]; /* UTF-8 produced by a press, NUL-terminated int      text_len; unsigned mods;               /* KE_MOD_* held when the key changed } ps2_key; /** Resets the state: nothing held, Caps Lock off, Num Lock on.", "kind": "function", "line": 47, "name": "ps2_init", "signature": "void ps2_init(ps2_state *s);"}, {"kind": "function", "line": 51, "name": "arguments", "signature": "* arguments (out is then left untouched). */ int ps2_feed(ps2_state *s, uint8_t byte, ps2_key *out);"}, {"kind": "macro", "line": 10, "name": "MINIOS_PS2_KEYMAP_H", "signature": "#define MINIOS_PS2_KEYMAP_H"}, {"kind": "macro", "line": 16, "name": "PS2_EV_NONE", "signature": "#define PS2_EV_NONE"}, {"kind": "macro", "line": 17, "name": "PS2_EV_PRESS", "signature": "#define PS2_EV_PRESS"}, {"kind": "macro", "line": 18, "name": "PS2_EV_RELEASE", "signature": "#define PS2_EV_RELEASE"}, {"kind": "macro", "line": 21, "name": "PS2_CODE_EXTENDED", "signature": "#define PS2_CODE_EXTENDED"}, {"kind": "macro", "line": 24, "name": "PS2_CODE_LIMIT", "signature": "#define PS2_CODE_LIMIT"}, {"kind": "macro", "line": 26, "name": "PS2_TEXT_MAX", "signature": "#define PS2_TEXT_MAX"}]}, {"id": "progs/lisp/lisp.c", "kind": "module", "label": "lisp.c", "language": "c", "sha256": "0ea572689618ffe9", "symbol_count": 105, "symbols": [{"doc": "Runtime value node with one payload per type.", "kind": "struct", "line": 113, "name": "Node"}, {"doc": "Single name binding inside an environment frame.", "kind": "struct", "line": 140, "name": "Binding"}, {"doc": "Lexical environment frame with a parent chain.", "kind": "struct", "line": 149, "name": "Env"}, {"doc": "Allocation record so the whole heap frees at exit.", "kind": "struct", "line": 157, "name": "AllocTracker"}, {"doc": "Interpreter runtime with globals, streams and resource tables.", "kind": "struct", "line": 165, "name": "Runtime"}, {"doc": "Result of a single read step with a bounded diagnostic.", "kind": "struct", "line": 104, "name": "ParseResult"}, {"doc": "Character cursor over an immutable source buffer.", "kind": "struct", "line": 181, "name": "Reader"}, {"doc": "Growable byte buffer for tokens and strings.", "kind": "struct", "line": 192, "name": "StringBuilder"}, {"doc": "========================================================================= Primitive registry ========================================================================= A flat name -> function table instead of ~30 repeated bind_primitive() calls. Adding a builtin is now one row here; init_env() itself never needs to change again to register it. * =========================================================================", "kind": "struct", "line": 1960, "name": "PrimEntry"}, {"doc": "Central configuration for every bound in the interpreter.  No other literal below controls a limit, a port, a syscall number or a user-visible string twice; edits happen here. Every array sized by one of these constants below (open_files[], argv[], message[]) MUST spell the constant, not the number, so this enum stays the single source of truth it claims to be.", "kind": "enum", "line": 41, "name": "LispConfig"}, {"kind": "type_alias", "line": 65, "name": "Runtime", "signature": "typedef struct Runtime Runtime;"}, {"kind": "type_alias", "line": 67, "name": "Node", "signature": "typedef struct Node Node;"}, {"kind": "type_alias", "line": 68, "name": "Env", "signature": "typedef struct Env Env;"}, {"kind": "type_alias", "line": 69, "name": "Binding", "signature": "typedef struct Binding Binding;"}, {"kind": "type_alias", "line": 70, "name": "AllocTracker", "signature": "typedef struct AllocTracker AllocTracker;"}, {"doc": "Version string printed by --version and the REPL banner.", "kind": "function", "line": 62, "name": "lisp_version", "signature": "static const char *lisp_version(void)"}, {"doc": "Raw 3-argument syscall through the x86-64 Linux ABI.", "kind": "function", "line": 205, "name": "msys", "signature": "static long msys(long n, long a1, long a2, long a3)"}, {"doc": "Raw 5-argument syscall for SYS_SPAWN with path, redirect, argc, argv.", "kind": "function", "line": 218, "name": "msys5", "signature": "static long msys5(long n, long a1, long a2, long a3, long a4, long a5)"}, {"doc": "Report a fatal internal failure and terminate the process.", "kind": "function", "line": 233, "name": "fatal", "signature": "static void fatal(Runtime *rt, const char *message)"}, {"doc": "Allocate zeroed tracked memory that frees with the runtime.", "kind": "function", "line": 242, "name": "xalloc", "signature": "static void *xalloc(Runtime *rt, size_t size)"}, {"doc": "Duplicate a string into tracked memory.", "kind": "function", "line": 266, "name": "xstrdup", "signature": "static char *xstrdup(Runtime *rt, const char *source)"}, {"doc": "Allocate a node of the given type in tracked memory.", "kind": "function", "line": 284, "name": "make_node", "signature": "static Node *make_node(Runtime *rt, NodeType type)"}, {"doc": "Build an error value carrying a diagnostic message.", "kind": "function", "line": 293, "name": "make_error", "signature": "static Node *make_error(Runtime *rt, const char *message)"}, {"doc": "Build a numeric value node.", "kind": "function", "line": 302, "name": "make_num", "signature": "static Node *make_num(Runtime *rt, int64_t value)"}, {"doc": "Build a string value node from a NUL-terminated source.", "kind": "function", "line": 311, "name": "make_str", "signature": "static Node *make_str(Runtime *rt, const char *value)"}, {"doc": "Build a symbol value node from a NUL-terminated name.", "kind": "function", "line": 320, "name": "make_sym", "signature": "static Node *make_sym(Runtime *rt, const char *value)"}, {"doc": "Build a primitive function value node.", "kind": "function", "line": 329, "name": "make_prim", "signature": "static Node *make_prim(Runtime *rt, PrimFn function)"}, {"doc": "Build a cons cell from two values.", "kind": "function", "line": 338, "name": "cons", "signature": "static Node *cons(Runtime *rt, Node *car, Node *cdr)"}, {"doc": "Test whether a node is the empty list in any of its spellings.", "kind": "function", "line": 348, "name": "is_nil", "signature": "static bool is_nil(Runtime *rt, const Node *node)"}, {"doc": "Register an open FILE handle and wrap it in a file value node.", "kind": "function", "line": 355, "name": "make_file", "signature": "static Node *make_file(Runtime *rt, FILE *handle)"}, {"doc": "Close every tracked file and release every tracked allocation.", "kind": "function", "line": 377, "name": "cleanup", "signature": "static void cleanup(Runtime *rt)"}, {"doc": "Initialize a runtime with streams, constants and empty tables.", "kind": "function", "line": 399, "name": "runtime_init", "signature": "static void runtime_init(Runtime *rt)"}, {"doc": "Allocate a new environment frame with an optional parent.", "kind": "function", "line": 411, "name": "env_new", "signature": "static Env *env_new(Runtime *rt, Env *parent)"}, {"doc": "Bind a symbol to a value in the innermost frame.", "kind": "function", "line": 421, "name": "env_bind", "signature": "static void env_bind(Runtime *rt, Env *env, Node *symbol, Node *value)"}, {"doc": "Update the nearest visible binding of a symbol.", "kind": "function", "line": 432, "name": "env_set", "signature": "static bool env_set(Env *env, Node *symbol, Node *value)"}, {"doc": "Resolve the nearest visible binding of a symbol.", "kind": "function", "line": 454, "name": "env_lookup", "signature": "static Node *env_lookup(Env *env, Node *symbol)"}, {"doc": "Peek at the current reader character without consuming it.", "kind": "function", "line": 475, "name": "reader_peek", "signature": "static char reader_peek(const Reader *reader)"}, {"doc": "Consume one reader character and track line and column.", "kind": "function", "line": 482, "name": "reader_next", "signature": "static char reader_next(Reader *reader)"}, {"doc": "Test whether the reader reached the end of its buffer.", "kind": "function", "line": 500, "name": "reader_at_end", "signature": "static bool reader_at_end(const Reader *reader)"}, {"doc": "Skip whitespace and line comments starting with a semicolon.", "kind": "function", "line": 507, "name": "skip_space_and_comments", "signature": "static void skip_space_and_comments(Reader *reader)"}, {"doc": "Initialize a string builder with a bounded initial capacity.", "kind": "function", "line": 523, "name": "sb_init", "signature": "static void sb_init(StringBuilder *builder)"}, {"doc": "Append one byte to a string builder with overflow-checked growth.", "kind": "function", "line": 536, "name": "sb_push", "signature": "static void sb_push(StringBuilder *builder, char value)"}, {"doc": "Build a successful parse result.", "kind": "function", "line": 562, "name": "parse_ok", "signature": "static ParseResult parse_ok(Node *value)"}, {"doc": "Build an end-of-input parse result.", "kind": "function", "line": 573, "name": "parse_eof", "signature": "static ParseResult parse_eof(void)"}, {"doc": "Build a parse error result with a bounded message.", "kind": "function", "line": 584, "name": "parse_error", "signature": "static ParseResult parse_error(const char *message)"}, {"doc": "Read a parenthesized list terminated by a closing paren.", "kind": "function", "line": 596, "name": "read_list", "signature": "static ParseResult read_list(Runtime *rt, Reader *reader)"}, {"doc": "Read a double-quoted string with backslash escapes.", "kind": "function", "line": 626, "name": "read_string", "signature": "static ParseResult read_string(Runtime *rt, Reader *reader)"}, {"doc": "Test whether a character terminates an atom token.", "kind": "function", "line": 677, "name": "token_delimiter", "signature": "static bool token_delimiter(char c)"}, {"doc": "Read a number, nil, t or symbol token.", "kind": "function", "line": 685, "name": "read_atom", "signature": "static ParseResult read_atom(Runtime *rt, Reader *reader)"}, {"doc": "Read one expression, skipping whitespace and comments first.", "kind": "function", "line": 721, "name": "read_expr", "signature": "static ParseResult read_expr(Runtime *rt, Reader *reader)"}, {"doc": "Count proper list elements and report whether the spine is proper.", "kind": "function", "line": 750, "name": "list_count", "signature": "static size_t list_count(Runtime *rt, Node *list, bool *proper)"}, {"doc": "Test whether an argument list has exactly the expected length.", "kind": "function", "line": 767, "name": "has_arity", "signature": "static bool has_arity(Runtime *rt, Node *args, size_t expected)"}, {"doc": "Fetch the positional argument at an index or NULL when absent.", "kind": "function", "line": 775, "name": "arg_at", "signature": "static Node *arg_at(Runtime *rt, Node *args, size_t index)"}, {"doc": "Test whether an already-fetched argument matches one ArgKind.", "kind": "function", "line": 815, "name": "arg_matches", "signature": "static bool arg_matches(const Node *value, ArgKind kind)"}, {"doc": "Validate that args is a proper list of exactly n elements whose types match kinds[0..n), writing each fetched argument into out[0..n).  Returns false (out[] left untouched) on any mismatch; the caller's one job on failure is to pick the error message, since that is the only part that legitimately differs between primitives.", "kind": "function", "line": 841, "name": "check_args", "signature": "static bool check_args(Runtime *rt, Node *args, const ArgKind *kinds,\n    size_t n, Node **out)"}, {"doc": "Validate that args is the empty argument list.", "kind": "function", "line": 861, "name": "arity0", "signature": "static bool arity0(Runtime *rt, Node *args)"}, {"doc": "Add two numbers with overflow reported as an error value.", "kind": "function", "line": 869, "name": "prim_add", "signature": "static Node *prim_add(Runtime *rt, Node *args)"}, {"doc": "Subtract two numbers with overflow reported as an error value.", "kind": "function", "line": 885, "name": "prim_sub", "signature": "static Node *prim_sub(Runtime *rt, Node *args)"}, {"doc": "Multiply two numbers with overflow reported as an error value.", "kind": "function", "line": 901, "name": "prim_mul", "signature": "static Node *prim_mul(Runtime *rt, Node *args)"}, {"doc": "Divide two numbers with zero and overflow reported as errors.", "kind": "function", "line": 917, "name": "prim_div", "signature": "static Node *prim_div(Runtime *rt, Node *args)"}, {"doc": "Compare two numbers for equality.", "kind": "function", "line": 939, "name": "prim_eq", "signature": "static Node *prim_eq(Runtime *rt, Node *args)"}, {"doc": "Compare two numbers with less-than.", "kind": "function", "line": 951, "name": "prim_lt", "signature": "static Node *prim_lt(Runtime *rt, Node *args)"}, {"doc": "Return the first element of a cons cell or nil.", "kind": "function", "line": 963, "name": "prim_car", "signature": "static Node *prim_car(Runtime *rt, Node *args)"}, {"doc": "Return the rest of a cons cell or nil.", "kind": "function", "line": 975, "name": "prim_cdr", "signature": "static Node *prim_cdr(Runtime *rt, Node *args)"}, {"doc": "Build a cons cell from two values.", "kind": "function", "line": 987, "name": "prim_cons", "signature": "static Node *prim_cons(Runtime *rt, Node *args)"}, {"doc": "Concatenate two strings with an overflow-checked allocation.", "kind": "function", "line": 999, "name": "prim_string_concat", "signature": "static Node *prim_string_concat(Runtime *rt, Node *args)"}, {"doc": "Compare two strings for equality.", "kind": "function", "line": 1026, "name": "prim_string_eq", "signature": "static Node *prim_string_eq(Runtime *rt, Node *args)"}, {"doc": "Return the byte length of a string.", "kind": "function", "line": 1038, "name": "prim_string_length", "signature": "static Node *prim_string_length(Runtime *rt, Node *args)"}, {"doc": "Return the one-character string at a byte index or nil when out of range.", "kind": "function", "line": 1050, "name": "prim_string_at", "signature": "static Node *prim_string_at(Runtime *rt, Node *args)"}, {"doc": "Convert between a one-character string and its byte value.", "kind": "function", "line": 1072, "name": "prim_char_code", "signature": "static Node *prim_char_code(Runtime *rt, Node *args)"}, {"doc": "Print a value without a trailing newline.", "kind": "function", "line": 1094, "name": "prim_print", "signature": "static Node *prim_print(Runtime *rt, Node *args)"}, {"doc": "Print a value with a trailing newline.", "kind": "function", "line": 1108, "name": "prim_println", "signature": "static Node *prim_println(Runtime *rt, Node *args)"}, {"doc": "Test whether a file mode string belongs to the safe whitelist.", "kind": "function", "line": 1123, "name": "file_mode_allowed", "signature": "static bool file_mode_allowed(const char *mode)"}, {"doc": "Read one byte from a file or nil at end of file.", "kind": "function", "line": 1183, "name": "prim_read_char", "signature": "static Node *prim_read_char(Runtime *rt, Node *args)"}, {"doc": "Write a string or byte value to an open file.", "kind": "function", "line": 1200, "name": "prim_write", "signature": "static Node *prim_write(Runtime *rt, Node *args)"}, {"doc": "Close an open file and release its runtime slot.", "kind": "function", "line": 1224, "name": "prim_close_file", "signature": "static Node *prim_close_file(Runtime *rt, Node *args)"}, {"doc": "Test whether a value is nil.", "kind": "function", "line": 1249, "name": "prim_null_p", "signature": "static Node *prim_null_p(Runtime *rt, Node *args)"}, {"doc": "Test whether a value is a number.", "kind": "function", "line": 1261, "name": "prim_number_p", "signature": "static Node *prim_number_p(Runtime *rt, Node *args)"}, {"doc": "Test whether a value is a string.", "kind": "function", "line": 1273, "name": "prim_string_p", "signature": "static Node *prim_string_p(Runtime *rt, Node *args)"}, {"doc": "Return the message of an error value or nil for other values.", "kind": "function", "line": 1285, "name": "prim_error_message", "signature": "static Node *prim_error_message(Runtime *rt, Node *args)"}, {"doc": "Terminate the process with a numeric exit status.  Variable arity (0 or 1); stays outside check_args() for the same reason open-file does.", "kind": "function", "line": 1303, "name": "prim_exit", "signature": "static Node *prim_exit(Runtime *rt, Node *args)"}, {"doc": "Return milliseconds since boot through the kernel time service.", "kind": "function", "line": 1330, "name": "prim_time_ms", "signature": "static Node *prim_time_ms(Runtime *rt, Node *args)"}, {"doc": "Return the clock time as a three-element list or nil when unavailable.", "kind": "function", "line": 1340, "name": "prim_rtc", "signature": "static Node *prim_rtc(Runtime *rt, Node *args)"}, {"doc": "Return framebuffer width, height and pitch or nil when unavailable.", "kind": "function", "line": 1357, "name": "prim_fb_info", "signature": "static Node *prim_fb_info(Runtime *rt, Node *args)"}, {"doc": "Read or set the speaker volume, clamped to the valid range.  Variable arity (0 or 1); stays outside check_args() for the same reason open-file does.", "kind": "function", "line": 1377, "name": "prim_vol", "signature": "static Node *prim_vol(Runtime *rt, Node *args)"}, {"doc": "Load a 768-byte VGA palette from a string value.", "kind": "function", "line": 1405, "name": "prim_pal", "signature": "static Node *prim_pal(Runtime *rt, Node *args)"}, {"doc": "Play a speaker tone for a bounded millisecond duration.", "kind": "function", "line": 1421, "name": "prim_pcspeaker", "signature": "static Node *prim_pcspeaker(Runtime *rt, Node *args)"}, {"doc": "Run a program through SYS_SPAWN and return its exit code.", "kind": "function", "line": 1465, "name": "prim_minios_run", "signature": "static Node *prim_minios_run(Runtime *rt, Node *args)"}, {"doc": "Evaluate every element of a list into a fresh proper list.  Error results travel as ordinary values so programs can inspect them with error-message; only a hard evaluation failure aborts the walk.", "kind": "function", "line": 1527, "name": "eval_list", "signature": "static Node *eval_list(Runtime *rt, Node *list, Env *env)"}, {"doc": "Evaluate a body sequence and return the last value.", "kind": "function", "line": 1551, "name": "eval_sequence", "signature": "static Node *eval_sequence(Runtime *rt, Node *body, Env *env)"}, {"doc": "Test whether a parameter list holds only symbols.", "kind": "function", "line": 1569, "name": "valid_params", "signature": "static bool valid_params(Runtime *rt, Node *params)"}, {"doc": "Evaluate an expression with tail-call reuse and a bounded depth.", "kind": "function", "line": 1583, "name": "eval", "signature": "static Node *eval(Runtime *rt, Node *expression, Env *env)"}, {"doc": "Write a string with escape sequences for readable output.", "kind": "function", "line": 1846, "name": "print_escaped_string", "signature": "static void print_escaped_string(FILE *out, const char *value)"}, {"doc": "Print a value in readable or display form with a bounded depth.", "kind": "function", "line": 1877, "name": "print_node", "signature": "static void print_node(Runtime *rt, Node *node, bool readable)"}, {"doc": "Register one named primitive in an environment frame.", "kind": "function", "line": 1948, "name": "bind_primitive", "signature": "static void bind_primitive(Runtime *rt, Env *env, const char *name,\n    PrimFn function)"}, {"doc": "Build the global environment with arithmetic, strings, files and MiniOS.", "kind": "function", "line": 2004, "name": "init_env", "signature": "static Env *init_env(Runtime *rt)"}, {"doc": "Expose the script argument vector as a proper list of strings.", "kind": "function", "line": 2017, "name": "bind_argv", "signature": "static void bind_argv(Runtime *rt, Env *env, int argc, char **argv, int first)"}, {"doc": "Read a whole file into memory with a hard size cap.", "kind": "function", "line": 2029, "name": "read_all_file", "signature": "static char *read_all_file(const char *filename, size_t max_bytes)"}, {"doc": "Evaluate every form in a source buffer and report the first failure.", "kind": "function", "line": 2087, "name": "process_source", "signature": "static int process_source(Runtime *rt, const char *source,\n    const char *source_name, bool echo)"}, {"doc": "Evaluate one inline expression from the -e flag.", "kind": "function", "line": 2129, "name": "process_inline", "signature": "static int process_inline(Runtime *rt, const char *code)"}, {"doc": "Print usage for the command line interface.", "kind": "function", "line": 2136, "name": "print_usage", "signature": "static void print_usage(Runtime *rt)"}, {"doc": "Run the interactive read-eval loop on the runtime input stream.", "kind": "function", "line": 2143, "name": "repl", "signature": "static int repl(Runtime *rt)"}, {"doc": "Entry point with -e, script and REPL modes plus bounded arguments.", "kind": "function", "line": 2190, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 9, "name": "numbers", "signature": "* * Language surface: numbers (int64), strings, symbols, cons cells, closures * with lexical scope, and the special forms quote, if, begin, define, set!, * lambda and let. Diagnostics go to stderr, va"}, {"kind": "function", "line": 1300, "name": "arity", "signature": "* * Variable arity (0 or 1);"}]}, {"id": "progs/lisp/tin.c", "kind": "module", "label": "tin.c", "language": "c", "sha256": "d69dd0f3784f4cf0", "symbol_count": 1, "symbols": [{"kind": "function", "line": 1, "name": "main", "signature": "int main()"}]}, {"id": "progs/lua/lua_main.c", "kind": "module", "label": "lua_main.c", "language": "c", "sha256": "59395b1eac4b1f42", "symbol_count": 7, "symbols": [{"kind": "function", "line": 22, "name": "luaL_require_global", "signature": "static void luaL_require_global(lua_State *L, const char *name,\n                                l..."}, {"kind": "function", "line": 28, "name": "set_arg_table", "signature": "static void set_arg_table(lua_State *L, int argc, char **argv, int first)"}, {"kind": "function", "line": 41, "name": "docode", "signature": "static int docode(lua_State *L, const char *code)"}, {"kind": "function", "line": 51, "name": "dofile", "signature": "static int dofile(lua_State *L, const char *name)"}, {"kind": "function", "line": 61, "name": "repl", "signature": "static int repl(lua_State *L)"}, {"kind": "function", "line": 105, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 5, "name": "module", "signature": "* C module (minios.c) can be registered globally before any script runs: * `minios.run(...)`, `minios.time_ms()`, etc. are available as a plain global * table, exactly like `import minios` in MicroPyt"}]}, {"id": "progs/lua/minios.c", "kind": "module", "label": "minios.c", "language": "c", "sha256": "633653288561a337", "symbol_count": 17, "symbols": [{"doc": "/* ── raw syscall helpers (x86-64 Linux ABI) ─────────────────────────── static long msys(long n, long a1, long a2, long a3) { long ret; __asm__ volatile( \"syscall\" : \"=a\"(ret) : \"a\"(n), \"D\"(a1), \"S\"(a2), \"d\"(a3) : \"rcx\", \"r11\", \"memory\" ); return ret; } /* 5-argument syscall (SYS_SPAWN needs path, redirect, argc, argv).", "kind": "function", "line": 37, "name": "msys5", "signature": "static long msys5(long n, long a1, long a2, long a3, long a4, long a5)"}, {"doc": "} /* ── MiniOS syscall numbers (canonical table from minios_abi.h) ─────── #include \"minios_abi.h\" #define SYS_TIME_MS     MINIOS_SYS_TIME #define SYS_PALETTE     MINIOS_SYS_PALETTE #define SYS_PCSPK_INIT  MINIOS_SYS_PCSPK_INIT #define SYS_PCSPK_TONE  MINIOS_SYS_PCSPK_TONE #define SYS_RTC         MINIOS_SYS_RTC #define SYS_FB_INFO     MINIOS_SYS_FB_INFO #define SYS_PCSPK_VOL   MINIOS_SYS_PCSPK_VOL #define SYS_SPAWN       MINIOS_SYS_SPAWN /* ── minios.time_ms() ────────────────────────────────────────────────", "kind": "function", "line": 62, "name": "minios_time_ms", "signature": "static int minios_time_ms(lua_State *L)"}, {"doc": "#define SYS_PCSPK_INIT  MINIOS_SYS_PCSPK_INIT #define SYS_PCSPK_TONE  MINIOS_SYS_PCSPK_TONE #define SYS_RTC         MINIOS_SYS_RTC #define SYS_FB_INFO     MINIOS_SYS_FB_INFO #define SYS_PCSPK_VOL   MINIOS_SYS_PCSPK_VOL #define SYS_SPAWN       MINIOS_SYS_SPAWN /* ── minios.time_ms() ──────────────────────────────────────────────── static int minios_time_ms(lua_State *L) { lua_pushinteger(L, (lua_Integer)msys(SYS_TIME_MS, 0, 0, 0)); return 1; } /* ── minios.rtc() -> hour, minute, second ────────────────────────────", "kind": "function", "line": 68, "name": "minios_rtc", "signature": "static int minios_rtc(lua_State *L)"}, {"doc": "static int minios_rtc(lua_State *L) { int h, m, s; if (msys(SYS_RTC, (long)&h, (long)&m, (long)&s) < 0) { lua_pushnil(L); lua_pushstring(L, \"rtc read failed\"); return 2; } lua_pushinteger(L, h); lua_pushinteger(L, m); lua_pushinteger(L, s); return 3; } /* ── minios.fb_info() -> width, height, pitch ────────────────────────", "kind": "function", "line": 82, "name": "minios_fb_info", "signature": "static int minios_fb_info(lua_State *L)"}, {"doc": "static int minios_fb_info(lua_State *L) { int w, h, p; if (msys(SYS_FB_INFO, (long)&w, (long)&h, (long)&p) < 0) { lua_pushnil(L); lua_pushstring(L, \"fb_info failed\"); return 2; } lua_pushinteger(L, w); lua_pushinteger(L, h); lua_pushinteger(L, p); return 3; } /* ── minios.vol([v]) -> current volume ───────────────────────────────", "kind": "function", "line": 96, "name": "minios_vol", "signature": "static int minios_vol(lua_State *L)"}, {"doc": "/* ── minios.vol([v]) -> current volume ─────────────────────────────── static int minios_vol(lua_State *L) { if (lua_gettop(L) >= 1 && !lua_isnil(L, 1)) { int v = (int)luaL_checkinteger(L, 1); if (v < 0 || v > 100) return luaL_error(L, \"volume must be 0..100\"); lua_pushinteger(L, (lua_Integer)msys(SYS_PCSPK_VOL, v, 0, 0)); } else { lua_pushinteger(L, (lua_Integer)msys(SYS_PCSPK_VOL, -1, 0, 0)); } return 1; } /* ── minios.pal(buf) -- load a 768-byte VGA DAC palette ──────────────", "kind": "function", "line": 109, "name": "minios_pal", "signature": "static int minios_pal(lua_State *L)"}, {"doc": "return 1; } /* ── minios.pal(buf) -- load a 768-byte VGA DAC palette ────────────── static int minios_pal(lua_State *L) { size_t len; const char *buf = luaL_checklstring(L, 1, &len); if (len < 768) return luaL_error(L, \"palette must be 768 bytes\"); msys(SYS_PALETTE, (long)buf, 0, 0); return 0; } /* ── minios.pcspeaker(freq, ms) ──────────────────────────────────────", "kind": "function", "line": 119, "name": "minios_pcspeaker", "signature": "static int minios_pcspeaker(lua_State *L)"}, {"doc": "── minios.run(path[, args][, redirect]) -> exit code ─────────────── Runs a program through SYS_SPAWN (215), preserving the caller (Lua) so it can chain toolchain commands.  args is an optional Lua table of strings; * redirect is an optional output file path that captures the console output.", "kind": "function", "line": 136, "name": "minios_run", "signature": "static int minios_run(lua_State *L)"}, {"kind": "function", "line": 192, "name": "luaopen_minios", "signature": "int luaopen_minios(lua_State *L)"}, {"kind": "macro", "line": 52, "name": "SYS_TIME_MS", "signature": "#define SYS_TIME_MS"}, {"kind": "macro", "line": 53, "name": "SYS_PALETTE", "signature": "#define SYS_PALETTE"}, {"kind": "macro", "line": 54, "name": "SYS_PCSPK_INIT", "signature": "#define SYS_PCSPK_INIT"}, {"kind": "macro", "line": 55, "name": "SYS_PCSPK_TONE", "signature": "#define SYS_PCSPK_TONE"}, {"kind": "macro", "line": 56, "name": "SYS_RTC", "signature": "#define SYS_RTC"}, {"kind": "macro", "line": 57, "name": "SYS_FB_INFO", "signature": "#define SYS_FB_INFO"}, {"kind": "macro", "line": 58, "name": "SYS_PCSPK_VOL", "signature": "#define SYS_PCSPK_VOL"}, {"kind": "macro", "line": 59, "name": "SYS_SPAWN", "signature": "#define SYS_SPAWN"}]}, {"doc": "MiniOS frozen library package.", "id": "progs/micropython/variants/minios/lib/__init__.py", "kind": "module", "label": "__init__.py", "language": "py", "sha256": "51f3b511a54d6d26", "symbol_count": 0, "symbols": []}, {"doc": "hello.py -- frozen demo: runs at import time as a smoke test.", "id": "progs/micropython/variants/minios/lib/hello.py", "kind": "module", "label": "hello.py", "language": "py", "sha256": "1e22dbf31982b6fd", "symbol_count": 0, "symbols": []}, {"doc": "mip.py -- MiniOS package installer (frozen module).  Minimal pip for the MiniOS MicroPython port: fetches one .py module over HTTP (or HTTPS through the ring-3 TLS engine) and installs it into a directory on sys.path. Frozen with the port (lib/manifest freeze), so it is always importable.  Policy, fail closed:  - http and https only. Inside MiniOS, https runs `bin/tlsget` (the userspace TLS stack with pinned roots) through SYS_SPAWN and reads the captured response; on host CPython https raises OSError (no minios module), so host tests cover the http and refusal paths. - one module per URL and the file name must be a bare identifier plus .py ([A-Za-z_][A-Za-z0-9_]*), so a hostile server cannot write outside dest (no traversal, subdirectories, percent escapes or dots). - the download is written to <dest>/<name>.py.part and renamed on success: a failed fetch never leaves a half module on sys.path. - HTTP/1.0 + Connection: close; chunked responses and mismatched Content-Length are refused; MAX_BODY caps the download. - a successful install appends dest to sys.path so the module imports in the same session.  Usage inside MiniOS::  import mip mip.install('http://host:8899/pkg.py')          # into ./lib mip.install('https://host/pkg.py', 'mylib')     # TLS through tlsget micropython -c \"import mip; raise SystemExit(mip.main())\" install <url>", "id": "progs/micropython/variants/minios/lib/mip.py", "kind": "module", "label": "mip.py", "language": "py", "sha256": "45003d4874cf9cf0", "symbol_count": 15, "symbols": [{"doc": "Split an http/https URL into (scheme, host, port, path).\n\nRaises ValueError for any other scheme, a missing or malformed\nauthority, a port outside 1..65535, or control characters in the\nhost or path (request-line injection).", "kind": "function", "line": 49, "name": "parse_url", "signature": "def parse_url(url)"}, {"doc": "Parse host[:port][/path] after the scheme prefix.", "kind": "function", "line": 67, "name": "_split_authority_path", "signature": "def _split_authority_path(url, rest, default_port)"}, {"doc": "Split an http URL into (host, port, path); https is refused here.", "kind": "function", "line": 98, "name": "split_url", "signature": "def split_url(url)"}, {"doc": "Split an https URL into (host, port, path); http is refused here.", "kind": "function", "line": 106, "name": "split_https_url", "signature": "def split_https_url(url)"}, {"doc": "Return the .py file name a URL installs, validating it is bare.\n\nThe last path segment (query and fragment dropped) must be\n[A-Za-z_][A-Za-z0-9_]*.py and no path segment may be \".\" or \"..\";\nanything else raises ValueError so a hostile URL cannot escape the\ndestination directory.", "kind": "function", "line": 114, "name": "module_name", "signature": "def module_name(url)"}, {"doc": "True when stem is an ASCII MicroPython module identifier.", "kind": "function", "line": 136, "name": "_is_module_stem", "signature": "def _is_module_stem(stem)"}, {"doc": "Split one HTTP/1.x response into (status, headers, body).\n\nHeaders are lowercased keys with stripped values. Fails closed:\na missing terminator, malformed status line or header, a chunked\ntransfer-encoding, or a Content-Length that disagrees with the body\nall raise ValueError.", "kind": "function", "line": 150, "name": "parse_response", "signature": "def parse_response(data)"}, {"doc": "Extract the numeric status from an HTTP status line.", "kind": "function", "line": 191, "name": "_status_code", "signature": "def _status_code(line)"}, {"doc": "Resolve a redirect Location against base; http and https survive.\n\nAbsolute locations pass through unchanged (re-validated by the\ncaller's next parse_url), path-absolute locations keep base's scheme\nand authority; truly relative locations raise ValueError.", "kind": "function", "line": 202, "name": "absolute_url", "signature": "def absolute_url(base, location)"}, {"doc": "Fetch http://host:port/path, returning the raw response bytes.\n\nOne HTTP/1.0 request with Connection: close, read to EOF over a\ntimed socket; the response is capped at MAX_BODY + MAX_HEAD_BYTES.", "kind": "function", "line": 222, "name": "http_get", "signature": "def http_get(host, port, path)"}, {"doc": "Best-effort remove; the following call reports the real error.", "kind": "function", "line": 268, "name": "_unlink_quiet", "signature": "def _unlink_quiet(path)"}, {"doc": "Create path and its parents; existing directories are fine.\n\nThe final write reports real errors, so a mkdir refusal here is not\nfatal (the directory may already exist).", "kind": "function", "line": 276, "name": "ensure_dir", "signature": "def ensure_dir(path)"}, {"doc": "Fetch https://host:port/path through the ring-3 TLS engine.\n\nSpawns bin/tlsget (the userspace TLS stack with pinned roots, the\nsame engine freedom uses) through the minios module's SYS_SPAWN and\nreads the response from the capture file. -q keeps tlsget's success\ndiagnostic out of the capture, so the file holds exactly the raw\nHTTP response. This is MiniOS-only: on host CPython there is no\nminios module and OSError says so.", "kind": "function", "line": 298, "name": "https_get", "signature": "def https_get(host, port, path)"}, {"doc": "Fetch url and write it as <dest>/<module>.py; returns the path.\n\nFollows up to MAX_REDIRECTS redirects across http and https;\nrefuses non-200 answers, unsafe module names and chunked responses.\nThe file appears atomically (write to .part, then rename) and dest\njoins sys.path so the module imports in the same session.", "kind": "function", "line": 336, "name": "install", "signature": "def install(url, dest)"}, {"doc": "CLI entry point: install <url> [dest]; returns the exit code.\n\nMicroPython's -c puts the code first in sys.argv and every argument\nafter it next, so the shell form is::\n\n    micropython -c \"import mip; raise SystemExit(mip.main())\" install <url> [dest]", "kind": "function", "line": 394, "name": "main", "signature": "def main(argv)"}]}, {"doc": "manifest.py -- frozen modules for the MiniOS MicroPython variant. Scripts listed here are compiled to .mpy by mpy-cross and embedded in the firmware binary, so they are available as frozen imports without touching the filesystem.", "id": "progs/micropython/variants/minios/manifest.py", "kind": "module", "label": "manifest.py", "language": "py", "sha256": "c1e5f0994826444a", "symbol_count": 0, "symbols": []}, {"id": "progs/micropython/variants/minios/minios_module.c", "kind": "module", "label": "minios_module.c", "language": "c", "sha256": "01944d8854bbe3f9", "symbol_count": 21, "symbols": [{"doc": "/* ── raw syscall helper (x86-64 Linux ABI) ─────────────────────────── static long msys(long n, long a1, long a2, long a3) { long ret; __asm__ volatile( \"syscall\" : \"=a\"(ret) : \"a\"(n), \"D\"(a1), \"S\"(a2), \"d\"(a3) : \"rcx\", \"r11\", \"memory\" ); return ret; } /* 5-argument syscall (SYS_SPAWN needs path, redirect, argc, argv, status).", "kind": "function", "line": 26, "name": "msys5", "signature": "static long msys5(long n, long a1, long a2, long a3, long a4, long a5)"}, {"kind": "function", "line": 52, "name": "minios_time_ms", "signature": "static mp_obj_t minios_time_ms(void)"}, {"kind": "function", "line": 59, "name": "minios_rtc", "signature": "static mp_obj_t minios_rtc(void)"}, {"kind": "function", "line": 76, "name": "minios_fb_info", "signature": "static mp_obj_t minios_fb_info(void)"}, {"kind": "function", "line": 111, "name": "minios_pal", "signature": "static mp_obj_t minios_pal(mp_obj_t buf_in)"}, {"kind": "function", "line": 127, "name": "minios_pcspeaker", "signature": "static mp_obj_t minios_pcspeaker(mp_obj_t freq_in, mp_obj_t ms_in)"}, {"kind": "function", "line": 149, "name": "minios_run", "signature": "static mp_obj_t minios_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args)"}, {"kind": "function", "line": 55, "name": "MP_DEFINE_CONST_FUN_OBJ_0", "signature": "static MP_DEFINE_CONST_FUN_OBJ_0(minios_time_ms_obj, minios_time_ms);"}, {"kind": "function", "line": 107, "name": "MP_DEFINE_CONST_FUN_OBJ_VAR", "signature": "static MP_DEFINE_CONST_FUN_OBJ_VAR(minios_vol_obj, 0, minios_vol);"}, {"kind": "function", "line": 123, "name": "MP_DEFINE_CONST_FUN_OBJ_1", "signature": "static MP_DEFINE_CONST_FUN_OBJ_1(minios_pal_obj, minios_pal);"}, {"kind": "function", "line": 140, "name": "MP_DEFINE_CONST_FUN_OBJ_2", "signature": "static MP_DEFINE_CONST_FUN_OBJ_2(minios_pcspeaker_obj, minios_pcspeaker);"}, {"kind": "function", "line": 193, "name": "MP_DEFINE_CONST_FUN_OBJ_KW", "signature": "static MP_DEFINE_CONST_FUN_OBJ_KW(minios_run_obj, 1, minios_run);"}, {"kind": "function", "line": 207, "name": "MP_DEFINE_CONST_DICT", "signature": "static MP_DEFINE_CONST_DICT(minios_module_globals, minios_module_globals_table);"}, {"kind": "macro", "line": 41, "name": "SYS_TIME_MS", "signature": "#define SYS_TIME_MS"}, {"kind": "macro", "line": 42, "name": "SYS_PALETTE", "signature": "#define SYS_PALETTE"}, {"kind": "macro", "line": 43, "name": "SYS_PCSPK_INIT", "signature": "#define SYS_PCSPK_INIT"}, {"kind": "macro", "line": 44, "name": "SYS_PCSPK_TONE", "signature": "#define SYS_PCSPK_TONE"}, {"kind": "macro", "line": 45, "name": "SYS_RTC", "signature": "#define SYS_RTC"}, {"kind": "macro", "line": 46, "name": "SYS_FB_INFO", "signature": "#define SYS_FB_INFO"}, {"kind": "macro", "line": 47, "name": "SYS_PCSPK_VOL", "signature": "#define SYS_PCSPK_VOL"}, {"kind": "macro", "line": 48, "name": "SYS_SPAWN", "signature": "#define SYS_SPAWN"}]}, {"id": "progs/micropython/variants/minios/mpconfigvariant.h", "kind": "module", "label": "mpconfigvariant.h", "language": "h", "sha256": "7fcace5159fefc07", "symbol_count": 46, "symbols": [{"kind": "macro", "line": 11, "name": "MICROPY_CONFIG_ROM_LEVEL", "signature": "#define MICROPY_CONFIG_ROM_LEVEL"}, {"kind": "macro", "line": 14, "name": "MICROPY_FLOAT_IMPL", "signature": "#define MICROPY_FLOAT_IMPL"}, {"kind": "macro", "line": 15, "name": "MICROPY_LONGINT_IMPL", "signature": "#define MICROPY_LONGINT_IMPL"}, {"kind": "macro", "line": 18, "name": "MICROPY_ERROR_REPORTING", "signature": "#define MICROPY_ERROR_REPORTING"}, {"kind": "macro", "line": 19, "name": "MICROPY_WARNINGS", "signature": "#define MICROPY_WARNINGS"}, {"kind": "macro", "line": 20, "name": "MICROPY_DEBUG_PRINTERS", "signature": "#define MICROPY_DEBUG_PRINTERS"}, {"kind": "macro", "line": 23, "name": "MICROPY_USE_READLINE", "signature": "#define MICROPY_USE_READLINE"}, {"kind": "macro", "line": 30, "name": "MICROPY_KBD_EXCEPTION", "signature": "#define MICROPY_KBD_EXCEPTION"}, {"kind": "macro", "line": 31, "name": "MICROPY_ASYNC_KBD_INTR", "signature": "#define MICROPY_ASYNC_KBD_INTR"}, {"kind": "macro", "line": 34, "name": "MICROPY_HELPER_REPL", "signature": "#define MICROPY_HELPER_REPL"}, {"kind": "macro", "line": 35, "name": "MICROPY_PY_SYS_PS1", "signature": "#define MICROPY_PY_SYS_PS1"}, {"kind": "macro", "line": 36, "name": "MICROPY_PY_SYS_PS2", "signature": "#define MICROPY_PY_SYS_PS2"}, {"kind": "macro", "line": 37, "name": "MICROPY_PY_SYS_ATEXIT", "signature": "#define MICROPY_PY_SYS_ATEXIT"}, {"kind": "macro", "line": 38, "name": "MICROPY_PY_SYS_EXC_INFO", "signature": "#define MICROPY_PY_SYS_EXC_INFO"}, {"kind": "macro", "line": 39, "name": "MICROPY_PY_SYS_STDFILES", "signature": "#define MICROPY_PY_SYS_STDFILES"}, {"kind": "macro", "line": 42, "name": "MICROPY_PY_OS", "signature": "#define MICROPY_PY_OS"}, {"kind": "macro", "line": 43, "name": "MICROPY_PY_OS_INCLUDEFILE", "signature": "#define MICROPY_PY_OS_INCLUDEFILE"}, {"kind": "macro", "line": 44, "name": "MICROPY_PY_OS_ERRNO", "signature": "#define MICROPY_PY_OS_ERRNO"}, {"kind": "macro", "line": 45, "name": "MICROPY_PY_OS_GETENV_PUTENV_UNSETENV", "signature": "#define MICROPY_PY_OS_GETENV_PUTENV_UNSETENV"}, {"kind": "macro", "line": 46, "name": "MICROPY_PY_OS_SYSTEM", "signature": "#define MICROPY_PY_OS_SYSTEM"}, {"kind": "macro", "line": 47, "name": "MICROPY_PY_OS_URANDOM", "signature": "#define MICROPY_PY_OS_URANDOM"}, {"kind": "macro", "line": 60, "name": "MICROPY_PY_SELECT", "signature": "#define MICROPY_PY_SELECT"}, {"kind": "macro", "line": 61, "name": "MICROPY_PY_SELECT_POSIX_OPTIMISATIONS", "signature": "#define MICROPY_PY_SELECT_POSIX_OPTIMISATIONS"}, {"kind": "macro", "line": 62, "name": "MICROPY_PY_SELECT_SELECT", "signature": "#define MICROPY_PY_SELECT_SELECT"}, {"kind": "macro", "line": 65, "name": "MICROPY_PY_ASYNCIO", "signature": "#define MICROPY_PY_ASYNCIO"}, {"kind": "macro", "line": 70, "name": "MICROPY_STREAMS_NON_BLOCK", "signature": "#define MICROPY_STREAMS_NON_BLOCK"}, {"kind": "macro", "line": 73, "name": "MICROPY_PY_ERRNO", "signature": "#define MICROPY_PY_ERRNO"}, {"kind": "macro", "line": 76, "name": "MICROPY_PY_TIME", "signature": "#define MICROPY_PY_TIME"}, {"kind": "macro", "line": 77, "name": "MICROPY_PY_TIME_INCLUDEFILE", "signature": "#define MICROPY_PY_TIME_INCLUDEFILE"}, {"kind": "macro", "line": 78, "name": "MICROPY_PY_TIME_TIME_TIME_NS", "signature": "#define MICROPY_PY_TIME_TIME_TIME_NS"}, {"kind": "macro", "line": 79, "name": "MICROPY_PY_TIME_CUSTOM_SLEEP", "signature": "#define MICROPY_PY_TIME_CUSTOM_SLEEP"}, {"kind": "macro", "line": 82, "name": "MICROPY_PY_SSL", "signature": "#define MICROPY_PY_SSL"}, {"kind": "macro", "line": 83, "name": "MICROPY_PY_FFI", "signature": "#define MICROPY_PY_FFI"}, {"kind": "macro", "line": 84, "name": "MICROPY_PY_THREAD", "signature": "#define MICROPY_PY_THREAD"}, {"kind": "macro", "line": 85, "name": "MICROPY_PY_MACHINE", "signature": "#define MICROPY_PY_MACHINE"}, {"kind": "macro", "line": 86, "name": "MICROPY_PY_WEBSOCKET", "signature": "#define MICROPY_PY_WEBSOCKET"}, {"kind": "macro", "line": 89, "name": "MICROPY_PERSISTENT_CODE_LOAD", "signature": "#define MICROPY_PERSISTENT_CODE_LOAD"}, {"kind": "macro", "line": 92, "name": "MICROPY_REPL_EMACS_WORDS_MOVE", "signature": "#define MICROPY_REPL_EMACS_WORDS_MOVE"}, {"kind": "macro", "line": 93, "name": "MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE", "signature": "#define MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE"}, {"kind": "macro", "line": 94, "name": "MICROPY_USE_READLINE_HISTORY", "signature": "#define MICROPY_USE_READLINE_HISTORY"}, {"kind": "macro", "line": 99, "name": "MICROPY_OPT_COMPUTED_GOTO", "signature": "#define MICROPY_OPT_COMPUTED_GOTO"}, {"kind": "macro", "line": 102, "name": "MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF", "signature": "#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF"}, {"kind": "macro", "line": 103, "name": "MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE", "signature": "#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE"}, {"kind": "macro", "line": 106, "name": "MICROPY_PY_GC_COLLECT_RETVAL", "signature": "#define MICROPY_PY_GC_COLLECT_RETVAL"}, {"kind": "macro", "line": 109, "name": "MICROPY_VFS_ROM", "signature": "#define MICROPY_VFS_ROM"}, {"kind": "macro", "line": 110, "name": "MICROPY_VFS_ROM_IOCTL", "signature": "#define MICROPY_VFS_ROM_IOCTL"}]}, {"doc": "minicraft.c - Minecraft-like voxel walker for MiniOS (ring 3, static ELF).", "id": "progs/minicraft/minicraft.c", "kind": "module", "label": "minicraft.c", "language": "c", "sha256": "852b1e9fd4e967dc", "symbol_count": 237, "symbols": [{"kind": "struct", "line": 216, "name": "Recipe"}, {"kind": "struct", "line": 295, "name": "Pig"}, {"kind": "struct", "line": 1650, "name": "RayHit"}, {"doc": "snprintf(last_act, sizeof(last_act), \"+%s\", mc_block_name(nb)); } last_act_ms = now; beep(440, 50); } } last_edit_ms = now; } } } prev_buttons = m[2]; } /* Frozen v3 header (saves already on disk); v4 appends mobs_n.", "kind": "struct", "line": 2878, "name": "SaveHeaderV3"}, {"kind": "struct", "line": 2892, "name": "SaveHeader"}, {"kind": "struct", "line": 2907, "name": "ChunkHeader"}, {"kind": "function", "line": 231, "name": "best_tool_for", "signature": "static int best_tool_for(unsigned char b)"}, {"kind": "function", "line": 250, "name": "break_time_ms", "signature": "static long break_time_ms(unsigned char b, int tool)"}, {"kind": "function", "line": 275, "name": "break_beep_for", "signature": "static long break_beep_for(unsigned char b)"}, {"kind": "function", "line": 316, "name": "mc_toggle_zoom", "signature": "static void mc_toggle_zoom(void)"}, {"kind": "function", "line": 337, "name": "s_time_ms", "signature": "static long s_time_ms(void)"}, {"kind": "function", "line": 342, "name": "s_kbd", "signature": "static long s_kbd(void)"}, {"kind": "function", "line": 347, "name": "s_kbd_raw", "signature": "static long s_kbd_raw(long on)"}, {"doc": "Serial fallback for menus: SYS_KBD in raw mode carries PS/2 only, so a serial console can never drive a scancode menu (Enter, digits and arrows never arrive). GETC_RAW serves the serial side with no line buffering; translate its bytes to the scancode the menu already handles, -1 when idle. Menu-only: gameplay keeps the raw * scancode path untouched.", "kind": "function", "line": 359, "name": "s_getc_raw", "signature": "static long s_getc_raw(void)"}, {"kind": "function", "line": 373, "name": "ser_get", "signature": "static long ser_get(void)"}, {"kind": "function", "line": 386, "name": "ser_unget", "signature": "static void ser_unget(unsigned char b)"}, {"kind": "function", "line": 391, "name": "menu_ser_key", "signature": "static long menu_ser_key(long b)"}, {"doc": "Drain stale scancodes (typematic repeats, a release that arrived with * its press) before leaving a menu, so they never retrigger on return.", "kind": "function", "line": 428, "name": "kbd_drain", "signature": "static void kbd_drain(void)"}, {"kind": "function", "line": 433, "name": "s_vga", "signature": "static long s_vga(long on)"}, {"kind": "function", "line": 438, "name": "s_pal", "signature": "static long s_pal(const unsigned char *p)"}, {"kind": "function", "line": 443, "name": "s_present", "signature": "static long s_present(void)"}, {"kind": "function", "line": 448, "name": "s_title", "signature": "static long s_title(const char *t)"}, {"kind": "function", "line": 453, "name": "s_mouse", "signature": "static long s_mouse(int *m)"}, {"kind": "function", "line": 458, "name": "s_zoom", "signature": "static long s_zoom(long on)"}, {"kind": "function", "line": 463, "name": "s_yield", "signature": "static void s_yield(void)"}, {"kind": "function", "line": 468, "name": "s_pcspk_init", "signature": "static long s_pcspk_init(void)"}, {"kind": "function", "line": 473, "name": "__attribute__", "signature": "static long __attribute__((unused)) s_tone(long f)"}, {"kind": "function", "line": 478, "name": "beep", "signature": "static void beep(long freq, long dur_ms)"}, {"kind": "function", "line": 497, "name": "pal_set", "signature": "static void pal_set(int i, int r, int g, int b)"}, {"kind": "function", "line": 503, "name": "build_palette", "signature": "static void build_palette(void)"}, {"kind": "function", "line": 562, "name": "in_world", "signature": "static int in_world(int x, int y, int z)"}, {"doc": "(void)x; (void)y; return z >= 0 && z < MC_H; } static unsigned int hash2(int x, int y); static unsigned int hash2_seed(int x, int y, unsigned int seed); static void gen_terrain_chunk(int slot); static void decorate_chunk(int slot); static void chunk_build_meta(int slot); static int save_chunk_file(int slot); static int load_chunk_file(int slot, int cx, int cy); /* Chunk math on unbounded coords: floor division so negatives land right.", "kind": "function", "line": 577, "name": "chunk_of", "signature": "static int chunk_of(int v)"}, {"kind": "function", "line": 581, "name": "chunk_local", "signature": "static int chunk_local(int v)"}, {"kind": "function", "line": 586, "name": "chunk_lidx", "signature": "static int chunk_lidx(int lx, int ly, int z)"}, {"doc": "O(1) fast path: DDA walks neighbours, so the last chunk almost always * hits; the 49-slot scan is the rare slow path, never the hot loop.", "kind": "function", "line": 592, "name": "chunk_find", "signature": "static int chunk_find(int cx, int cy)"}, {"kind": "function", "line": 606, "name": "world_max_recompute", "signature": "static void world_max_recompute(void)"}, {"kind": "function", "line": 615, "name": "chunk_evict_slot", "signature": "static int chunk_evict_slot(int cx, int cy)"}, {"kind": "function", "line": 635, "name": "chunk_ensure", "signature": "static int chunk_ensure(int cx, int cy)"}, {"kind": "function", "line": 658, "name": "chunk_build_meta", "signature": "static void chunk_build_meta(int slot)"}, {"kind": "function", "line": 703, "name": "col_recompute", "signature": "static void col_recompute(int x, int y)"}, {"kind": "function", "line": 728, "name": "col_top_at", "signature": "static int col_top_at(int x, int y)"}, {"kind": "function", "line": 735, "name": "light_recompute_col", "signature": "static void light_recompute_col(int x, int y)"}, {"kind": "function", "line": 764, "name": "get_b", "signature": "static unsigned char get_b(int x, int y, int z)"}, {"kind": "function", "line": 774, "name": "set_b", "signature": "static void set_b(int x, int y, int z, unsigned char b)"}, {"kind": "function", "line": 790, "name": "set_b_raw", "signature": "static void set_b_raw(int x, int y, int z, unsigned char b)"}, {"doc": "world_dirty = 1; } static void set_b_raw(int x, int y, int z, unsigned char b) { int s; if (z < 0 || z >= MC_H) return; s = chunk_find(chunk_of(x), chunk_of(y)); if (s < 0) return; ch_blocks[s][chunk_lidx(chunk_local(x), chunk_local(y), z)] = b; } /* skylight 1.0 at surface fading to 0.22 deep: O(1) via chunk light", "kind": "function", "line": 801, "name": "sky_light", "signature": "static float sky_light(int x, int y, int z)"}, {"kind": "function", "line": 811, "name": "is_solid", "signature": "static int is_solid(unsigned char b)"}, {"kind": "function", "line": 814, "name": "in_water_at", "signature": "static int in_water_at(float x, float y, float z)"}, {"kind": "function", "line": 819, "name": "is_visible", "signature": "static int is_visible(unsigned char b)"}, {"kind": "function", "line": 823, "name": "hash2", "signature": "static unsigned int hash2(int x, int y)"}, {"kind": "function", "line": 830, "name": "hash2_seed", "signature": "static unsigned int hash2_seed(int x, int y, unsigned int seed)"}, {"kind": "function", "line": 839, "name": "mc_smoothstep", "signature": "static float mc_smoothstep(float t)"}, {"doc": "Voronoi biome lattice: floor division so negatives land right. A smoothed (bilinear) field must NOT be thresholded here: averaging 4 uniforms * collapses the distribution and kills every biome but forest.", "kind": "function", "line": 846, "name": "biome_fdiv", "signature": "static int biome_fdiv(int v, int c)"}, {"kind": "function", "line": 861, "name": "voro_site", "signature": "static void voro_site(int cx, int cy, unsigned int seed, int cell,\n    int *sx, int *sy)"}, {"kind": "function", "line": 869, "name": "biome_voro", "signature": "static int biome_voro(int x, int y, unsigned int seed, int cell,\n    int ox, int oy, unsigned int..."}, {"kind": "function", "line": 893, "name": "biome_desert", "signature": "static int biome_desert(int x, int y, unsigned int seed)"}, {"kind": "function", "line": 897, "name": "biome_snow", "signature": "static int biome_snow(int x, int y, unsigned int seed)"}, {"kind": "function", "line": 901, "name": "is_cave", "signature": "static int is_cave(int x, int y, int z, unsigned int seed)"}, {"kind": "function", "line": 909, "name": "ground_h_seed", "signature": "static int ground_h_seed(int x, int y, unsigned int seed)"}, {"kind": "function", "line": 931, "name": "inv_add", "signature": "static int inv_add(int b, int n)"}, {"kind": "function", "line": 945, "name": "inv_remove", "signature": "static int inv_remove(int b, int n)"}, {"kind": "function", "line": 995, "name": "decorate_column", "signature": "static void decorate_column(int x, int y, unsigned int seed)"}, {"kind": "function", "line": 1034, "name": "gen_terrain_chunk", "signature": "static void gen_terrain_chunk(int slot)"}, {"kind": "function", "line": 1043, "name": "decorate_chunk", "signature": "static void decorate_chunk(int slot)"}, {"doc": "Keep a (2R+1)^2 ring of terrain around the player, an inner ring decorated, drop the rest (dirty chunks hit disk first). Runs every frame: pure cache hits when standing still, a few chunk gens on border * crossings. Coordinates are unbounded: no edge, no wall, no wrap.", "kind": "function", "line": 1056, "name": "ensure_around_px", "signature": "static void ensure_around_px(float px, float py)"}, {"kind": "function", "line": 1090, "name": "ensure_around", "signature": "static void ensure_around(void)"}, {"doc": "save_chunk_file(i); ch_used[i] = 0; if (ch_cache == i) ch_cache = -1; } } world_max_recompute(); } static void ensure_around(void) { ensure_around_px(pl_x, pl_y); } /* World gen phases: 1 terrain ring 2 decor ring 3 spawn 4 mobs.", "kind": "function", "line": 1095, "name": "new_world", "signature": "static void new_world(unsigned int seed)"}, {"kind": "function", "line": 1191, "name": "mob_spawn_one", "signature": "static void mob_spawn_one(Pig *m, int id, int hp, long now)"}, {"kind": "function", "line": 1243, "name": "pig_collides", "signature": "static int pig_collides(float x, float y, float z)"}, {"kind": "function", "line": 1257, "name": "creeper_explode", "signature": "static void creeper_explode(Pig *c, long now)"}, {"doc": "Creeper perception in 3D: planar delta, eye-height delta and full distance. The old code used planar distance only, so a player flying * 10 blocks overhead still lit the fuse.", "kind": "function", "line": 1325, "name": "creep_sense", "signature": "static void creep_sense(Pig *c, float *pdx, float *pdy, float *pdz, float *pd3)"}, {"doc": "Voxel line of sight between creeper eyes and player eyes, sampled every half block. Walls blind the chase; open field keeps the old * behaviour byte for byte. Bounded steps, no allocation.", "kind": "function", "line": 1337, "name": "creep_has_los", "signature": "static int creep_has_los(Pig *c)"}, {"doc": "Herd separation: creepers inside MC_CREEP_SEP_D push apart so the pack * never stacks on one tile and every one of the 3 does not arrive glued.", "kind": "function", "line": 1361, "name": "creep_separate", "signature": "static void creep_separate(Pig *p, int id, float dt)"}, {"kind": "function", "line": 1386, "name": "tick_mob", "signature": "static void tick_mob(Pig *p, int id, float dt, long now)"}, {"kind": "function", "line": 1512, "name": "tick_pigs", "signature": "static void tick_pigs(float dt, long now)"}, {"kind": "function", "line": 1520, "name": "face_color", "signature": "static unsigned char face_color(unsigned char b, int face)"}, {"kind": "function", "line": 1569, "name": "sky_color", "signature": "static unsigned char sky_color(float dz, float sun_dot, int x, int y, float tsec)"}, {"kind": "function", "line": 1602, "name": "shade_block", "signature": "static unsigned char shade_block(unsigned char b, int face, int bx, int by, int bz,\n             ..."}, {"kind": "function", "line": 1659, "name": "cast_ray", "signature": "static RayHit cast_ray(float ox, float oy, float oz, float dx, float dy, float dz, float maxd)"}, {"kind": "function", "line": 1750, "name": "eye_z", "signature": "static float eye_z(void)"}, {"kind": "function", "line": 1817, "name": "mc_glyph", "signature": "static int mc_glyph(char ch)"}, {"kind": "function", "line": 1825, "name": "mc_pixel", "signature": "static void mc_pixel(int x, int y, unsigned char c)"}, {"kind": "function", "line": 1831, "name": "mc_text", "signature": "static void mc_text(int x, int y, const char *s, unsigned char fg)"}, {"kind": "function", "line": 1844, "name": "mc_text_bg", "signature": "static void mc_text_bg(int x, int y, const char *s, unsigned char fg, unsigned char bg)"}, {"kind": "function", "line": 1857, "name": "mc_block_name", "signature": "static const char *mc_block_name(unsigned char b)"}, {"kind": "function", "line": 1877, "name": "mc_facing", "signature": "static char mc_facing(void)"}, {"kind": "function", "line": 1892, "name": "cam_build", "signature": "static void cam_build(void)"}, {"kind": "function", "line": 1910, "name": "render_terrain", "signature": "static void render_terrain(RayHit tgt, float cyaw, float syaw, float cpit,\n                      ..."}, {"kind": "function", "line": 1945, "name": "mob_pixel", "signature": "static unsigned char mob_pixel(Pig *m, int id, int px, int py, int x0, int x1, int y0, int y1)"}, {"kind": "function", "line": 1979, "name": "render_mob_array", "signature": "static void render_mob_array(Pig *arr, int n, float fx, float fy, float fz,\n    float rx, float r..."}, {"kind": "function", "line": 2030, "name": "render_pigs", "signature": "static void render_pigs(float cyaw, float syaw, float cpit, float spit, float ez)"}, {"kind": "function", "line": 2038, "name": "render_frame", "signature": "static void render_frame(void)"}, {"kind": "function", "line": 2151, "name": "sc_hist_push", "signature": "static void sc_hist_push(unsigned char b)"}, {"kind": "function", "line": 2162, "name": "poll_kbd", "signature": "static void poll_kbd(void)"}, {"kind": "function", "line": 2355, "name": "player_collides", "signature": "static int player_collides(float x, float y, float z)"}, {"kind": "function", "line": 2379, "name": "move_x", "signature": "static void move_x(float nx)"}, {"kind": "function", "line": 2384, "name": "move_y", "signature": "static void move_y(float ny)"}, {"kind": "function", "line": 2389, "name": "move_z_abs", "signature": "static MoveResult move_z_abs(float nz)"}, {"kind": "function", "line": 2404, "name": "block_intersects_player", "signature": "static int block_intersects_player(int bx, int by, int bz)"}, {"kind": "function", "line": 2413, "name": "try_autostep", "signature": "static void try_autostep(float tx, float ty)"}, {"kind": "function", "line": 2424, "name": "hurt", "signature": "static void hurt(int dmg, const char *why)"}, {"kind": "function", "line": 2449, "name": "tick_player", "signature": "static void tick_player(float dt)"}, {"kind": "function", "line": 2548, "name": "tick_water", "signature": "static void tick_water(long now)"}, {"kind": "function", "line": 2596, "name": "tick_hunger", "signature": "static void tick_hunger(long now)"}, {"kind": "function", "line": 2608, "name": "goal_text", "signature": "static const char *goal_text(void)"}, {"kind": "function", "line": 2619, "name": "tick_goals", "signature": "static void tick_goals(void)"}, {"kind": "function", "line": 2630, "name": "tick_discover", "signature": "static void tick_discover(long now)"}, {"kind": "function", "line": 2668, "name": "tick_interact", "signature": "static void tick_interact(void)"}, {"kind": "function", "line": 2919, "name": "mc_crc32", "signature": "static uint32_t mc_crc32(const void *data, size_t len, uint32_t crc)"}, {"kind": "function", "line": 2932, "name": "save_compute_crc", "signature": "static uint32_t save_compute_crc(const SaveHeader *hd)"}, {"kind": "function", "line": 2938, "name": "chunk_path", "signature": "static void chunk_path(int cx, int cy, char *out, size_t n)"}, {"kind": "function", "line": 2942, "name": "save_chunk_file", "signature": "static int save_chunk_file(int slot)"}, {"kind": "function", "line": 2974, "name": "load_chunk_file", "signature": "static int load_chunk_file(int slot, int cx, int cy)"}, {"kind": "function", "line": 3056, "name": "save_validate_loaded", "signature": "static int save_validate_loaded(void)"}, {"kind": "function", "line": 3075, "name": "load_reset_runtime", "signature": "static void load_reset_runtime(void)"}, {"doc": "Import a 64x64x32 legacy blob into chunks (0..3, 0..3), then dirty so * region files persist it. Old saves keep their world, new code owns it.", "kind": "function", "line": 3108, "name": "carve_blob", "signature": "static void carve_blob(const unsigned char *blob)"}, {"doc": "Legacy raw save: fixed old_inv[12] layout is fragile if B_COUNT grows; * kept read-only for ancient saves, never written. Do not extend.", "kind": "function", "line": 3137, "name": "load_world_legacy", "signature": "static int load_world_legacy(FILE *f)"}, {"kind": "function", "line": 3175, "name": "load_apply_player", "signature": "static void load_apply_player(const SaveHeader *hd)"}, {"kind": "function", "line": 3194, "name": "load_world_v3", "signature": "static int load_world_v3(FILE *f, SaveHeader *hd)"}, {"kind": "function", "line": 3234, "name": "load_world_v2", "signature": "static int load_world_v2(FILE *f, SaveHeader *hd)"}, {"kind": "function", "line": 3271, "name": "load_world", "signature": "static int load_world(void)"}, {"kind": "function", "line": 3345, "name": "selftest", "signature": "static int selftest(void)"}, {"doc": "128x128 columns (64 biome cells): a 64-wide patch covers too few * 16-block biome cells and the desert rate fluctuates wildly by area.", "kind": "function", "line": 3606, "name": "census", "signature": "static int census(void)"}, {"kind": "function", "line": 3670, "name": "dumpstats", "signature": "static int dumpstats(void)"}, {"kind": "function", "line": 3754, "name": "title_menu", "signature": "static int title_menu(int have_save, int *seed_io)"}, {"doc": "Pause menu on ESC (Alt+F4 still kills the process kernel-side): * 0 = resume, 1 = new world with *seed_io, 2 = save + quit to shell.", "kind": "function", "line": 3922, "name": "pause_menu", "signature": "static int pause_menu(int *seed_io)"}, {"kind": "function", "line": 4095, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 330, "name": "save_world", "signature": "static int save_world(void);"}, {"kind": "macro", "line": 34, "name": "MC_H", "signature": "#define MC_H"}, {"kind": "macro", "line": 35, "name": "MC_CHUNK", "signature": "#define MC_CHUNK"}, {"kind": "macro", "line": 36, "name": "MC_LOAD_R", "signature": "#define MC_LOAD_R"}, {"kind": "macro", "line": 37, "name": "MC_CHUNKS", "signature": "#define MC_CHUNKS"}, {"kind": "macro", "line": 38, "name": "MC_CVOL", "signature": "#define MC_CVOL"}, {"kind": "macro", "line": 39, "name": "MC_COLS", "signature": "#define MC_COLS"}, {"kind": "macro", "line": 41, "name": "FB_W", "signature": "#define FB_W"}, {"kind": "macro", "line": 42, "name": "FB_H", "signature": "#define FB_H"}, {"kind": "macro", "line": 45, "name": "BACKBUF", "signature": "#define BACKBUF"}, {"kind": "macro", "line": 47, "name": "BACKBUF", "signature": "#define BACKBUF"}, {"kind": "macro", "line": 50, "name": "SAVE_PATH", "signature": "#define SAVE_PATH"}, {"kind": "macro", "line": 51, "name": "SAVE_TMP_PATH", "signature": "#define SAVE_TMP_PATH"}, {"kind": "macro", "line": 52, "name": "MC_SAVE_MAGIC", "signature": "#define MC_SAVE_MAGIC"}, {"kind": "macro", "line": 53, "name": "MC_SAVE_VERSION", "signature": "#define MC_SAVE_VERSION"}, {"kind": "macro", "line": 54, "name": "MC_SAVE_CRC_SEED", "signature": "#define MC_SAVE_CRC_SEED"}, {"kind": "macro", "line": 55, "name": "MC_CHUNK_MAGIC", "signature": "#define MC_CHUNK_MAGIC"}, {"kind": "macro", "line": 56, "name": "MC_CHUNK_VERSION", "signature": "#define MC_CHUNK_VERSION"}, {"kind": "macro", "line": 59, "name": "MC_EYE", "signature": "#define MC_EYE"}, {"kind": "macro", "line": 60, "name": "MC_GRAV", "signature": "#define MC_GRAV"}, {"kind": "macro", "line": 61, "name": "MC_JUMP", "signature": "#define MC_JUMP"}, {"kind": "macro", "line": 62, "name": "MC_MAXFALL", "signature": "#define MC_MAXFALL"}, {"kind": "macro", "line": 63, "name": "MC_SPEED", "signature": "#define MC_SPEED"}, {"kind": "macro", "line": 64, "name": "MC_FLY_SPEED", "signature": "#define MC_FLY_SPEED"}, {"kind": "macro", "line": 65, "name": "MC_SPRINT", "signature": "#define MC_SPRINT"}, {"kind": "macro", "line": 66, "name": "MC_MOUSE", "signature": "#define MC_MOUSE"}, {"kind": "macro", "line": 67, "name": "MC_REACH", "signature": "#define MC_REACH"}, {"kind": "macro", "line": 68, "name": "MC_VIEW", "signature": "#define MC_VIEW"}, {"kind": "macro", "line": 69, "name": "MC_DDA_STEPS", "signature": "#define MC_DDA_STEPS"}, {"kind": "macro", "line": 70, "name": "MC_BREAK_MS", "signature": "#define MC_BREAK_MS"}, {"kind": "macro", "line": 71, "name": "MC_BREAK_GRACE_MS", "signature": "#define MC_BREAK_GRACE_MS"}, {"kind": "macro", "line": 72, "name": "MC_PLACE_MS", "signature": "#define MC_PLACE_MS"}, {"kind": "macro", "line": 73, "name": "MC_WATER_GRAV", "signature": "#define MC_WATER_GRAV"}, {"kind": "macro", "line": 74, "name": "MC_WATER_SINK", "signature": "#define MC_WATER_SINK"}, {"kind": "macro", "line": 75, "name": "MC_WATER_SWIM", "signature": "#define MC_WATER_SWIM"}, {"kind": "macro", "line": 76, "name": "MC_INV_MAX", "signature": "#define MC_INV_MAX"}, {"kind": "macro", "line": 77, "name": "MC_PITCH_MAX", "signature": "#define MC_PITCH_MAX"}, {"kind": "macro", "line": 78, "name": "MC_AUTOSTEP", "signature": "#define MC_AUTOSTEP"}, {"kind": "macro", "line": 79, "name": "MC_HP_MAX", "signature": "#define MC_HP_MAX"}, {"kind": "macro", "line": 80, "name": "MC_PIGS", "signature": "#define MC_PIGS"}, {"kind": "macro", "line": 81, "name": "MC_CREEPS_MAX", "signature": "#define MC_CREEPS_MAX"}, {"kind": "macro", "line": 82, "name": "MC_CREEPS_DEF", "signature": "#define MC_CREEPS_DEF"}, {"kind": "macro", "line": 83, "name": "MC_CREEP_HP", "signature": "#define MC_CREEP_HP"}, {"kind": "macro", "line": 84, "name": "MC_FUSE_MS", "signature": "#define MC_FUSE_MS"}, {"kind": "macro", "line": 85, "name": "MC_BOOM_R", "signature": "#define MC_BOOM_R"}, {"kind": "macro", "line": 88, "name": "MC_CREEP_SENSE", "signature": "#define MC_CREEP_SENSE"}, {"kind": "macro", "line": 89, "name": "MC_CREEP_DZ_MAX", "signature": "#define MC_CREEP_DZ_MAX"}, {"kind": "macro", "line": 90, "name": "MC_CREEP_FUSE_D", "signature": "#define MC_CREEP_FUSE_D"}, {"kind": "macro", "line": 91, "name": "MC_CREEP_DEFUSE_D", "signature": "#define MC_CREEP_DEFUSE_D"}, {"kind": "macro", "line": 98, "name": "MC_RESPAWN_MS", "signature": "#define MC_RESPAWN_MS"}, {"kind": "macro", "line": 99, "name": "MC_CREEP_NIGHT_MS", "signature": "#define MC_CREEP_NIGHT_MS"}, {"kind": "macro", "line": 100, "name": "MC_PIG_DAY_MS", "signature": "#define MC_PIG_DAY_MS"}, {"kind": "macro", "line": 101, "name": "MC_NIGHT_LIGHT", "signature": "#define MC_NIGHT_LIGHT"}, {"kind": "macro", "line": 102, "name": "MC_CREEP_SEP_D", "signature": "#define MC_CREEP_SEP_D"}, {"kind": "macro", "line": 103, "name": "MC_PORK_HEAL", "signature": "#define MC_PORK_HEAL"}, {"kind": "macro", "line": 104, "name": "MC_HUNGER_MAX", "signature": "#define MC_HUNGER_MAX"}, {"kind": "macro", "line": 105, "name": "MC_HUNGER_MS", "signature": "#define MC_HUNGER_MS"}, {"kind": "macro", "line": 106, "name": "MC_PIG_HP", "signature": "#define MC_PIG_HP"}, {"kind": "macro", "line": 107, "name": "MC_PIG_HURT_MS", "signature": "#define MC_PIG_HURT_MS"}, {"kind": "macro", "line": 108, "name": "MC_DAY_MS", "signature": "#define MC_DAY_MS"}, {"kind": "macro", "line": 109, "name": "MC_SAVE_SECS", "signature": "#define MC_SAVE_SECS"}, {"kind": "macro", "line": 110, "name": "MC_BAYER_N", "signature": "#define MC_BAYER_N"}, {"kind": "macro", "line": 111, "name": "MC_H_BASE", "signature": "#define MC_H_BASE"}, {"kind": "macro", "line": 112, "name": "MC_H_WT_DET", "signature": "#define MC_H_WT_DET"}, {"kind": "macro", "line": 113, "name": "MC_H_WT_MID", "signature": "#define MC_H_WT_MID"}, {"kind": "macro", "line": 114, "name": "MC_H_WT_COARSE", "signature": "#define MC_H_WT_COARSE"}, {"kind": "macro", "line": 117, "name": "SC_ESC", "signature": "#define SC_ESC"}, {"kind": "macro", "line": 118, "name": "SC_1", "signature": "#define SC_1"}, {"kind": "macro", "line": 119, "name": "SC_9", "signature": "#define SC_9"}, {"kind": "macro", "line": 120, "name": "SC_Q", "signature": "#define SC_Q"}, {"kind": "macro", "line": 121, "name": "SC_W", "signature": "#define SC_W"}, {"kind": "macro", "line": 122, "name": "SC_E", "signature": "#define SC_E"}, {"kind": "macro", "line": 123, "name": "SC_R", "signature": "#define SC_R"}, {"kind": "macro", "line": 124, "name": "SC_T", "signature": "#define SC_T"}, {"kind": "macro", "line": 125, "name": "SC_U", "signature": "#define SC_U"}, {"kind": "macro", "line": 126, "name": "SC_I", "signature": "#define SC_I"}, {"kind": "macro", "line": 127, "name": "SC_O", "signature": "#define SC_O"}, {"kind": "macro", "line": 128, "name": "SC_P", "signature": "#define SC_P"}, {"kind": "macro", "line": 129, "name": "SC_J", "signature": "#define SC_J"}, {"kind": "macro", "line": 130, "name": "SC_A", "signature": "#define SC_A"}, {"kind": "macro", "line": 131, "name": "SC_S", "signature": "#define SC_S"}, {"kind": "macro", "line": 132, "name": "SC_D", "signature": "#define SC_D"}, {"kind": "macro", "line": 133, "name": "SC_F", "signature": "#define SC_F"}, {"kind": "macro", "line": 134, "name": "SC_G", "signature": "#define SC_G"}, {"kind": "macro", "line": 135, "name": "SC_K", "signature": "#define SC_K"}, {"kind": "macro", "line": 136, "name": "SC_L", "signature": "#define SC_L"}, {"kind": "macro", "line": 137, "name": "SC_C", "signature": "#define SC_C"}, {"kind": "macro", "line": 138, "name": "SC_V", "signature": "#define SC_V"}, {"kind": "macro", "line": 139, "name": "SC_B", "signature": "#define SC_B"}, {"kind": "macro", "line": 140, "name": "SC_N", "signature": "#define SC_N"}, {"kind": "macro", "line": 141, "name": "SC_ENTER", "signature": "#define SC_ENTER"}, {"kind": "macro", "line": 142, "name": "SC_BACK", "signature": "#define SC_BACK"}, {"kind": "macro", "line": 143, "name": "SC_0", "signature": "#define SC_0"}, {"kind": "macro", "line": 144, "name": "MC_SEED_MAX", "signature": "#define MC_SEED_MAX"}, {"kind": "macro", "line": 145, "name": "MC_KBD_SEQ_SPINS", "signature": "#define MC_KBD_SEQ_SPINS"}, {"kind": "macro", "line": 146, "name": "SC_SPACE", "signature": "#define SC_SPACE"}, {"kind": "macro", "line": 147, "name": "SC_LSHIFT", "signature": "#define SC_LSHIFT"}, {"kind": "macro", "line": 148, "name": "SC_RSHIFT", "signature": "#define SC_RSHIFT"}, {"kind": "macro", "line": 149, "name": "SC_CTRL", "signature": "#define SC_CTRL"}, {"kind": "macro", "line": 150, "name": "EXT_UP", "signature": "#define EXT_UP"}, {"kind": "macro", "line": 151, "name": "EXT_DOWN", "signature": "#define EXT_DOWN"}, {"kind": "macro", "line": 152, "name": "EXT_LEFT", "signature": "#define EXT_LEFT"}, {"kind": "macro", "line": 153, "name": "EXT_RIGHT", "signature": "#define EXT_RIGHT"}, {"kind": "macro", "line": 154, "name": "EXT_F11", "signature": "#define EXT_F11"}, {"kind": "macro", "line": 308, "name": "MOB_PIG", "signature": "#define MOB_PIG"}, {"kind": "macro", "line": 309, "name": "MOB_CREEP", "signature": "#define MOB_CREEP"}, {"kind": "macro", "line": 369, "name": "SER_STASH_CAP", "signature": "#define SER_STASH_CAP"}, {"kind": "macro", "line": 858, "name": "MC_VORO_DESERT_CELL", "signature": "#define MC_VORO_DESERT_CELL"}, {"kind": "macro", "line": 859, "name": "MC_VORO_SNOW_CELL", "signature": "#define MC_VORO_SNOW_CELL"}, {"kind": "macro", "line": 2916, "name": "MC_LEGACY_WORLD", "signature": "#define MC_LEGACY_WORLD"}]}, {"doc": "minios_abi.h -- Single source of truth for the MiniOS user-kernel ABI.", "id": "progs/minios_abi.h", "kind": "module", "label": "minios_abi.h", "language": "h", "sha256": "6391a503aceba405", "symbol_count": 156, "symbols": [{"kind": "function", "line": 133, "name": "DOOM_BACKBUF_ADDR", "signature": "* * All three sit in the reserved tail above DOOM_BACKBUF_ADDR (the brk cap), * so a growing heap or mmap region can never reach them. NK_BACKBUF sits * HIGHER than the framebuffer's maximum span: at "}, {"kind": "function", "line": 334, "name": "range", "signature": "* number inside the MiniOS window and outside the pcm2 range (246-248). */ #define MINIOS_SYS_LZ4_DECOMPRESS 255 #define MINIOS_SYS_MOUSE 219 #define MINIOS_SYS_NK_FRAME 220 #define MINIOS_SYS_SB16_OP"}, {"kind": "macro", "line": 2, "name": "MINIOS_ABI_H", "signature": "#define MINIOS_ABI_H"}, {"kind": "macro", "line": 44, "name": "MINIOS_ABI_VERSION", "signature": "#define MINIOS_ABI_VERSION"}, {"kind": "macro", "line": 48, "name": "MINIOS_ABI_CHECKSUM", "signature": "#define MINIOS_ABI_CHECKSUM"}, {"kind": "macro", "line": 118, "name": "MINIOS_USER_LOAD_BASE", "signature": "#define MINIOS_USER_LOAD_BASE"}, {"kind": "macro", "line": 119, "name": "MINIOS_USER_LOAD_END", "signature": "#define MINIOS_USER_LOAD_END"}, {"kind": "macro", "line": 120, "name": "MINIOS_USER_STACK_SIZE", "signature": "#define MINIOS_USER_STACK_SIZE"}, {"kind": "macro", "line": 121, "name": "MINIOS_USER_STACK_TOP", "signature": "#define MINIOS_USER_STACK_TOP"}, {"kind": "macro", "line": 122, "name": "MINIOS_USER_STACK_BASE", "signature": "#define MINIOS_USER_STACK_BASE"}, {"kind": "macro", "line": 123, "name": "MINIOS_USER_BRK_END", "signature": "#define MINIOS_USER_BRK_END"}, {"kind": "macro", "line": 140, "name": "MINIOS_DOOM_BACKBUF_ADDR", "signature": "#define MINIOS_DOOM_BACKBUF_ADDR"}, {"kind": "macro", "line": 141, "name": "MINIOS_DOOM_W", "signature": "#define MINIOS_DOOM_W"}, {"kind": "macro", "line": 142, "name": "MINIOS_DOOM_H", "signature": "#define MINIOS_DOOM_H"}, {"kind": "macro", "line": 143, "name": "MINIOS_FB_ADDR", "signature": "#define MINIOS_FB_ADDR"}, {"kind": "macro", "line": 144, "name": "MINIOS_NK_BACKBUF_ADDR", "signature": "#define MINIOS_NK_BACKBUF_ADDR"}, {"kind": "macro", "line": 145, "name": "MINIOS_NK_W", "signature": "#define MINIOS_NK_W"}, {"kind": "macro", "line": 146, "name": "MINIOS_NK_H", "signature": "#define MINIOS_NK_H"}, {"kind": "macro", "line": 161, "name": "MINIOS_LDSO_BASE", "signature": "#define MINIOS_LDSO_BASE"}, {"kind": "macro", "line": 162, "name": "MINIOS_LDSO_SIZE", "signature": "#define MINIOS_LDSO_SIZE"}, {"kind": "macro", "line": 163, "name": "MINIOS_LDSO_END", "signature": "#define MINIOS_LDSO_END"}, {"kind": "macro", "line": 171, "name": "MINIOS_NK_RGB_ADDR", "signature": "#define MINIOS_NK_RGB_ADDR"}, {"kind": "macro", "line": 172, "name": "MINIOS_NK_RGB_BYTES", "signature": "#define MINIOS_NK_RGB_BYTES"}, {"kind": "macro", "line": 177, "name": "MINIOS_HEAP_BASE", "signature": "#define MINIOS_HEAP_BASE"}, {"kind": "macro", "line": 183, "name": "MINIOS_HEAP_SIZE", "signature": "#define MINIOS_HEAP_SIZE"}, {"kind": "macro", "line": 207, "name": "MINIOS_PCI_MMIO_SIZE", "signature": "#define MINIOS_PCI_MMIO_SIZE"}, {"kind": "macro", "line": 219, "name": "MINIOS_DEV_MMIO_VBASE", "signature": "#define MINIOS_DEV_MMIO_VBASE"}, {"kind": "macro", "line": 224, "name": "MINIOS_FB_WIDTH_MAX", "signature": "#define MINIOS_FB_WIDTH_MAX"}, {"kind": "macro", "line": 225, "name": "MINIOS_FB_HEIGHT_MAX", "signature": "#define MINIOS_FB_HEIGHT_MAX"}, {"kind": "macro", "line": 243, "name": "MINIOS_SYS_READ", "signature": "#define MINIOS_SYS_READ"}, {"kind": "macro", "line": 244, "name": "MINIOS_SYS_WRITE", "signature": "#define MINIOS_SYS_WRITE"}, {"kind": "macro", "line": 245, "name": "MINIOS_SYS_OPEN", "signature": "#define MINIOS_SYS_OPEN"}, {"kind": "macro", "line": 246, "name": "MINIOS_SYS_CLOSE", "signature": "#define MINIOS_SYS_CLOSE"}, {"kind": "macro", "line": 247, "name": "MINIOS_SYS_FSTAT", "signature": "#define MINIOS_SYS_FSTAT"}, {"kind": "macro", "line": 248, "name": "MINIOS_SYS_POLL", "signature": "#define MINIOS_SYS_POLL"}, {"kind": "macro", "line": 249, "name": "MINIOS_SYS_LSEEK", "signature": "#define MINIOS_SYS_LSEEK"}, {"kind": "macro", "line": 250, "name": "MINIOS_SYS_MMAP", "signature": "#define MINIOS_SYS_MMAP"}, {"kind": "macro", "line": 251, "name": "MINIOS_SYS_MPROTECT", "signature": "#define MINIOS_SYS_MPROTECT"}, {"kind": "macro", "line": 252, "name": "MINIOS_SYS_MUNMAP", "signature": "#define MINIOS_SYS_MUNMAP"}, {"kind": "macro", "line": 253, "name": "MINIOS_SYS_BRK", "signature": "#define MINIOS_SYS_BRK"}, {"kind": "macro", "line": 254, "name": "MINIOS_SYS_RT_SIGACTION", "signature": "#define MINIOS_SYS_RT_SIGACTION"}, {"kind": "macro", "line": 255, "name": "MINIOS_SYS_RT_SIGPROCMASK", "signature": "#define MINIOS_SYS_RT_SIGPROCMASK"}, {"kind": "macro", "line": 256, "name": "MINIOS_SYS_IOCTL", "signature": "#define MINIOS_SYS_IOCTL"}, {"kind": "macro", "line": 257, "name": "MINIOS_SYS_WRITEV", "signature": "#define MINIOS_SYS_WRITEV"}, {"kind": "macro", "line": 258, "name": "MINIOS_SYS_ACCESS", "signature": "#define MINIOS_SYS_ACCESS"}, {"kind": "macro", "line": 259, "name": "MINIOS_SYS_SCHED_YIELD", "signature": "#define MINIOS_SYS_SCHED_YIELD"}, {"kind": "macro", "line": 260, "name": "MINIOS_SYS_GETPID", "signature": "#define MINIOS_SYS_GETPID"}, {"kind": "macro", "line": 261, "name": "MINIOS_SYS_SOCKET", "signature": "#define MINIOS_SYS_SOCKET"}, {"kind": "macro", "line": 262, "name": "MINIOS_SYS_CONNECT", "signature": "#define MINIOS_SYS_CONNECT"}, {"kind": "macro", "line": 263, "name": "MINIOS_SYS_SENDTO", "signature": "#define MINIOS_SYS_SENDTO"}, {"kind": "macro", "line": 264, "name": "MINIOS_SYS_RECVFROM", "signature": "#define MINIOS_SYS_RECVFROM"}, {"kind": "macro", "line": 265, "name": "MINIOS_SYS_SHUTDOWN", "signature": "#define MINIOS_SYS_SHUTDOWN"}, {"kind": "macro", "line": 266, "name": "MINIOS_SYS_FORK", "signature": "#define MINIOS_SYS_FORK"}, {"kind": "macro", "line": 267, "name": "MINIOS_SYS_VFORK", "signature": "#define MINIOS_SYS_VFORK"}, {"kind": "macro", "line": 268, "name": "MINIOS_SYS_EXECVE", "signature": "#define MINIOS_SYS_EXECVE"}, {"kind": "macro", "line": 269, "name": "MINIOS_SYS_EXIT", "signature": "#define MINIOS_SYS_EXIT"}, {"kind": "macro", "line": 270, "name": "MINIOS_SYS_WAIT4", "signature": "#define MINIOS_SYS_WAIT4"}, {"kind": "macro", "line": 271, "name": "MINIOS_SYS_KILL", "signature": "#define MINIOS_SYS_KILL"}, {"kind": "macro", "line": 272, "name": "MINIOS_SYS_UNAME", "signature": "#define MINIOS_SYS_UNAME"}, {"kind": "macro", "line": 273, "name": "MINIOS_SYS_UNLINK", "signature": "#define MINIOS_SYS_UNLINK"}, {"kind": "macro", "line": 274, "name": "MINIOS_SYS_RENAME", "signature": "#define MINIOS_SYS_RENAME"}, {"kind": "macro", "line": 275, "name": "MINIOS_SYS_READLINK", "signature": "#define MINIOS_SYS_READLINK"}, {"kind": "macro", "line": 276, "name": "MINIOS_SYS_GETTID", "signature": "#define MINIOS_SYS_GETTID"}, {"kind": "macro", "line": 280, "name": "MINIOS_SYS_FLOCK", "signature": "#define MINIOS_SYS_FLOCK"}, {"kind": "macro", "line": 281, "name": "MINIOS_SYS_FSYNC", "signature": "#define MINIOS_SYS_FSYNC"}, {"kind": "macro", "line": 282, "name": "MINIOS_SYS_FDATASYNC", "signature": "#define MINIOS_SYS_FDATASYNC"}, {"kind": "macro", "line": 283, "name": "MINIOS_SYS_GETCWD", "signature": "#define MINIOS_SYS_GETCWD"}, {"kind": "macro", "line": 284, "name": "MINIOS_SYS_GETTIMEOFDAY", "signature": "#define MINIOS_SYS_GETTIMEOFDAY"}, {"kind": "macro", "line": 285, "name": "MINIOS_SYS_ARCH_PRCTL", "signature": "#define MINIOS_SYS_ARCH_PRCTL"}, {"kind": "macro", "line": 286, "name": "MINIOS_SYS_OPENAT", "signature": "#define MINIOS_SYS_OPENAT"}, {"kind": "macro", "line": 287, "name": "MINIOS_SYS_NEWFSTATAT", "signature": "#define MINIOS_SYS_NEWFSTATAT"}, {"kind": "macro", "line": 290, "name": "MINIOS_SYS_STATX", "signature": "#define MINIOS_SYS_STATX"}, {"kind": "macro", "line": 294, "name": "MINIOS_SYS_SET_ROBUST_LIST", "signature": "#define MINIOS_SYS_SET_ROBUST_LIST"}, {"kind": "macro", "line": 298, "name": "MINIOS_SYS_PRLIMIT64", "signature": "#define MINIOS_SYS_PRLIMIT64"}, {"kind": "macro", "line": 299, "name": "MINIOS_SYS_GETRANDOM", "signature": "#define MINIOS_SYS_GETRANDOM"}, {"kind": "macro", "line": 300, "name": "MINIOS_SYS_RSEQ", "signature": "#define MINIOS_SYS_RSEQ"}, {"kind": "macro", "line": 301, "name": "MINIOS_SYS_EXIT_GROUP", "signature": "#define MINIOS_SYS_EXIT_GROUP"}, {"kind": "macro", "line": 302, "name": "MINIOS_SYS_SET_TID_ADDRESS", "signature": "#define MINIOS_SYS_SET_TID_ADDRESS"}, {"kind": "macro", "line": 303, "name": "MINIOS_SYS_CLOCK_GETTIME", "signature": "#define MINIOS_SYS_CLOCK_GETTIME"}, {"kind": "macro", "line": 304, "name": "MINIOS_SYS_TGKILL", "signature": "#define MINIOS_SYS_TGKILL"}, {"kind": "macro", "line": 307, "name": "MINIOS_SYS_DNS", "signature": "#define MINIOS_SYS_DNS"}, {"kind": "macro", "line": 313, "name": "MINIOS_SYS_TLS_HANDSHAKE", "signature": "#define MINIOS_SYS_TLS_HANDSHAKE"}, {"kind": "macro", "line": 314, "name": "MINIOS_SYS_TLS_SEND", "signature": "#define MINIOS_SYS_TLS_SEND"}, {"kind": "macro", "line": 315, "name": "MINIOS_SYS_TLS_RECV", "signature": "#define MINIOS_SYS_TLS_RECV"}, {"kind": "macro", "line": 318, "name": "MINIOS_SYS_TIME", "signature": "#define MINIOS_SYS_TIME"}, {"kind": "macro", "line": 319, "name": "MINIOS_SYS_KBD", "signature": "#define MINIOS_SYS_KBD"}, {"kind": "macro", "line": 320, "name": "MINIOS_SYS_PALETTE", "signature": "#define MINIOS_SYS_PALETTE"}, {"kind": "macro", "line": 321, "name": "MINIOS_SYS_KBD_RAW", "signature": "#define MINIOS_SYS_KBD_RAW"}, {"kind": "macro", "line": 322, "name": "MINIOS_SYS_VGA_MODE", "signature": "#define MINIOS_SYS_VGA_MODE"}, {"kind": "macro", "line": 323, "name": "MINIOS_SYS_PCSPK_INIT", "signature": "#define MINIOS_SYS_PCSPK_INIT"}, {"kind": "macro", "line": 324, "name": "MINIOS_SYS_PCSPK_TONE", "signature": "#define MINIOS_SYS_PCSPK_TONE"}, {"kind": "macro", "line": 325, "name": "MINIOS_SYS_DOOM_FRAME", "signature": "#define MINIOS_SYS_DOOM_FRAME"}, {"kind": "macro", "line": 326, "name": "MINIOS_SYS_RTC", "signature": "#define MINIOS_SYS_RTC"}, {"kind": "macro", "line": 327, "name": "MINIOS_SYS_FB_INFO", "signature": "#define MINIOS_SYS_FB_INFO"}, {"kind": "macro", "line": 328, "name": "MINIOS_SYS_PCSPK_VOL", "signature": "#define MINIOS_SYS_PCSPK_VOL"}, {"kind": "macro", "line": 329, "name": "MINIOS_SYS_SPAWN", "signature": "#define MINIOS_SYS_SPAWN"}, {"kind": "macro", "line": 330, "name": "MINIOS_SYS_LZ4_COMPRESS", "signature": "#define MINIOS_SYS_LZ4_COMPRESS"}, {"kind": "macro", "line": 335, "name": "MINIOS_SYS_LZ4_DECOMPRESS", "signature": "#define MINIOS_SYS_LZ4_DECOMPRESS"}, {"kind": "macro", "line": 336, "name": "MINIOS_SYS_MOUSE", "signature": "#define MINIOS_SYS_MOUSE"}, {"kind": "macro", "line": 337, "name": "MINIOS_SYS_NK_FRAME", "signature": "#define MINIOS_SYS_NK_FRAME"}, {"kind": "macro", "line": 338, "name": "MINIOS_SYS_SB16_OPEN", "signature": "#define MINIOS_SYS_SB16_OPEN"}, {"kind": "macro", "line": 339, "name": "MINIOS_SYS_SB16_SUBMIT", "signature": "#define MINIOS_SYS_SB16_SUBMIT"}, {"kind": "macro", "line": 340, "name": "MINIOS_SYS_GFX_SET_TITLE", "signature": "#define MINIOS_SYS_GFX_SET_TITLE"}, {"kind": "macro", "line": 341, "name": "MINIOS_SYS_SB16_PUMP", "signature": "#define MINIOS_SYS_SB16_PUMP"}, {"kind": "macro", "line": 344, "name": "MINIOS_SYS_SB16_STREAM_OPEN", "signature": "#define MINIOS_SYS_SB16_STREAM_OPEN"}, {"kind": "macro", "line": 345, "name": "MINIOS_SYS_SB16_STREAM_CLOSE", "signature": "#define MINIOS_SYS_SB16_STREAM_CLOSE"}, {"kind": "macro", "line": 346, "name": "MINIOS_SYS_SB16_STREAM_SUBMIT", "signature": "#define MINIOS_SYS_SB16_STREAM_SUBMIT"}, {"kind": "macro", "line": 347, "name": "MINIOS_SYS_SB16_STREAM_VOLUME", "signature": "#define MINIOS_SYS_SB16_STREAM_VOLUME"}, {"kind": "macro", "line": 348, "name": "MINIOS_SYS_THREAD_SPAWN", "signature": "#define MINIOS_SYS_THREAD_SPAWN"}, {"kind": "macro", "line": 349, "name": "MINIOS_SYS_FUTEX_WAIT", "signature": "#define MINIOS_SYS_FUTEX_WAIT"}, {"kind": "macro", "line": 350, "name": "MINIOS_SYS_FUTEX_WAKE", "signature": "#define MINIOS_SYS_FUTEX_WAKE"}, {"kind": "macro", "line": 351, "name": "MINIOS_SYS_SUBMIT_BATCH", "signature": "#define MINIOS_SYS_SUBMIT_BATCH"}, {"kind": "macro", "line": 352, "name": "MINIOS_SYS_GETC_RAW", "signature": "#define MINIOS_SYS_GETC_RAW"}, {"kind": "macro", "line": 353, "name": "MINIOS_SYS_GFX_PRESENT", "signature": "#define MINIOS_SYS_GFX_PRESENT"}, {"kind": "macro", "line": 354, "name": "MINIOS_SYS_SECCOMP", "signature": "#define MINIOS_SYS_SECCOMP"}, {"kind": "macro", "line": 355, "name": "MINIOS_SYS_NICE", "signature": "#define MINIOS_SYS_NICE"}, {"kind": "macro", "line": 356, "name": "MINIOS_SYS_RLIMIT", "signature": "#define MINIOS_SYS_RLIMIT"}, {"kind": "macro", "line": 357, "name": "MINIOS_SYS_DIR_LIST", "signature": "#define MINIOS_SYS_DIR_LIST"}, {"kind": "macro", "line": 358, "name": "MINIOS_SYS_GFX_ZOOM", "signature": "#define MINIOS_SYS_GFX_ZOOM"}, {"kind": "macro", "line": 363, "name": "MINIOS_SYS_WL_ATTACH", "signature": "#define MINIOS_SYS_WL_ATTACH"}, {"kind": "macro", "line": 364, "name": "MINIOS_SYS_WL_COMMIT", "signature": "#define MINIOS_SYS_WL_COMMIT"}, {"kind": "macro", "line": 365, "name": "MINIOS_SYS_WL_INPUT", "signature": "#define MINIOS_SYS_WL_INPUT"}, {"kind": "macro", "line": 371, "name": "MINIOS_SYS_PCM2_OPEN", "signature": "#define MINIOS_SYS_PCM2_OPEN"}, {"kind": "macro", "line": 372, "name": "MINIOS_SYS_PCM2_WRITE", "signature": "#define MINIOS_SYS_PCM2_WRITE"}, {"kind": "macro", "line": 373, "name": "MINIOS_SYS_PCM2_CLOSE", "signature": "#define MINIOS_SYS_PCM2_CLOSE"}, {"kind": "macro", "line": 381, "name": "MINIOS_SYS_CLIP_SET", "signature": "#define MINIOS_SYS_CLIP_SET"}, {"kind": "macro", "line": 382, "name": "MINIOS_SYS_CLIP_GET", "signature": "#define MINIOS_SYS_CLIP_GET"}, {"kind": "macro", "line": 399, "name": "MINIOS_SYS_MINFO", "signature": "#define MINIOS_SYS_MINFO"}, {"kind": "macro", "line": 400, "name": "MINIOS_PCM2_NONBLOCK", "signature": "#define MINIOS_PCM2_NONBLOCK"}, {"kind": "macro", "line": 404, "name": "MINIOS_PCM2_RATE", "signature": "#define MINIOS_PCM2_RATE"}, {"kind": "macro", "line": 405, "name": "MINIOS_PCM2_FRAG", "signature": "#define MINIOS_PCM2_FRAG"}, {"kind": "macro", "line": 407, "name": "MINIOS_SYS_CLONE", "signature": "#define MINIOS_SYS_CLONE"}, {"kind": "macro", "line": 416, "name": "MINIOS_GFX_BUF_GAME", "signature": "#define MINIOS_GFX_BUF_GAME"}, {"kind": "macro", "line": 417, "name": "MINIOS_GFX_BUF_NK", "signature": "#define MINIOS_GFX_BUF_NK"}, {"kind": "macro", "line": 418, "name": "MINIOS_GFX_BUF_NK_RGB", "signature": "#define MINIOS_GFX_BUF_NK_RGB"}, {"kind": "macro", "line": 419, "name": "MINIOS_SYS_FRAMEBUFFER_COMMIT", "signature": "#define MINIOS_SYS_FRAMEBUFFER_COMMIT"}, {"kind": "macro", "line": 420, "name": "MINIOS_SYS_WINDOW_PRESENT", "signature": "#define MINIOS_SYS_WINDOW_PRESENT"}, {"kind": "macro", "line": 421, "name": "MINIOS_SYS_WINDOW_TITLE", "signature": "#define MINIOS_SYS_WINDOW_TITLE"}, {"kind": "macro", "line": 428, "name": "MINIOS_GFX_ZOOM_NATIVE", "signature": "#define MINIOS_GFX_ZOOM_NATIVE"}, {"kind": "macro", "line": 429, "name": "MINIOS_GFX_ZOOM_2X", "signature": "#define MINIOS_GFX_ZOOM_2X"}, {"kind": "macro", "line": 430, "name": "MINIOS_GFX_ZOOM_FULLSCREEN", "signature": "#define MINIOS_GFX_ZOOM_FULLSCREEN"}, {"kind": "macro", "line": 431, "name": "MINIOS_GFX_ZOOM_WINDOWED", "signature": "#define MINIOS_GFX_ZOOM_WINDOWED"}, {"kind": "macro", "line": 434, "name": "SYS_TIME_MS", "signature": "#define SYS_TIME_MS"}, {"kind": "macro", "line": 435, "name": "SYS_PALETTE", "signature": "#define SYS_PALETTE"}, {"kind": "macro", "line": 436, "name": "SYS_PCSPK_INIT", "signature": "#define SYS_PCSPK_INIT"}, {"kind": "macro", "line": 437, "name": "SYS_PCSPK_TONE", "signature": "#define SYS_PCSPK_TONE"}, {"kind": "macro", "line": 438, "name": "SYS_RTC", "signature": "#define SYS_RTC"}, {"kind": "macro", "line": 439, "name": "SYS_FB_INFO", "signature": "#define SYS_FB_INFO"}, {"kind": "macro", "line": 440, "name": "SYS_PCSPK_VOL", "signature": "#define SYS_PCSPK_VOL"}, {"kind": "macro", "line": 441, "name": "SYS_SPAWN", "signature": "#define SYS_SPAWN"}, {"kind": "macro", "line": 442, "name": "SYS_TIME", "signature": "#define SYS_TIME"}, {"kind": "macro", "line": 443, "name": "SYS_WRITE", "signature": "#define SYS_WRITE"}, {"kind": "macro", "line": 450, "name": "MINIOS_EABI_MISMATCH", "signature": "#define MINIOS_EABI_MISMATCH"}, {"kind": "macro", "line": 463, "name": "MINIOS_NOTE_NAME", "signature": "#define MINIOS_NOTE_NAME"}, {"kind": "macro", "line": 464, "name": "MINIOS_NOTE_PROCESS", "signature": "#define MINIOS_NOTE_PROCESS"}, {"kind": "macro", "line": 465, "name": "MINIOS_NOTE_SIGN", "signature": "#define MINIOS_NOTE_SIGN"}]}, {"doc": "Docstring: shared ring-3 PNG helpers for MiniOS apps (progs/minios_png.h).", "id": "progs/minios_png.h", "kind": "module", "label": "minios_png.h", "language": "h", "sha256": "76eed27e46da8a92", "symbol_count": 21, "symbols": [{"doc": "static const char *mpng_left_candidates[MPNG_LEFT_N] = { \"/icons/doom.png\", \"/icons/doomedit.png\", \"/icons/quake2.png\", \"/icons/piano.png\", \"/icons/nuklear.png\", \"/icons/vedit.png\", \"/icons/file.png\", \"/icons/shell.png\", \"/icons/paint.png\", \"/icons/minicraft.png\" }; /** Docstring: direct 3-3-2 index for one RGB triple, the pokemon ramp.", "kind": "function", "line": 58, "name": "mpng_332_idx", "signature": "static int mpng_332_idx(unsigned r, unsigned g, unsigned b)"}, {"doc": "\"/icons/nuklear.png\", \"/icons/vedit.png\", \"/icons/file.png\", \"/icons/shell.png\", \"/icons/paint.png\", \"/icons/minicraft.png\" }; /** Docstring: direct 3-3-2 index for one RGB triple, the pokemon ramp. static int mpng_332_idx(unsigned r, unsigned g, unsigned b) { return (int)(((r & 0xE0u)) | (((g & 0xE0u) >> 3)) | (((b & 0xC0u) >> 6))); } /** Docstring: nearest palette index by squared RGB distance, fail closed.", "kind": "function", "line": 63, "name": "mpng_nearest", "signature": "static int mpng_nearest(const unsigned char *pal, long pal_n, unsigned r,\n                       ..."}, {"doc": "for (k = 0; k < pal_n; k++) { long dr = (long)pal[k * 3] - (long)r; long dg = (long)pal[k * 3 + 1] - (long)g; long db = (long)pal[k * 3 + 2] - (long)b; long d = dr * dr + dg * dg + db * db; if (d < bd) { bd = d; best = k; } } return (int)best; } /** Docstring: centered offset of inner inside outer, negative when unfit.", "kind": "function", "line": 84, "name": "mpng_center", "signature": "static int mpng_center(int outer, int inner)"}, {"doc": "} return (int)best; } /** Docstring: centered offset of inner inside outer, negative when unfit. static int mpng_center(int outer, int inner) { if (outer < 0 || inner < 0) return -1; if (inner > outer) return -1; return (outer - inner) / 2; } /** Docstring: integer scale that fits src inside a box, at least 1.", "kind": "function", "line": 93, "name": "mpng_fit_scale", "signature": "static int mpng_fit_scale(int sw, int sh, int boxw, int boxh)"}, {"doc": "int s = 1; int best = 1; if (sw <= 0 || sh <= 0 || boxw <= 0 || boxh <= 0) return -1; for (s = 1; s <= boxw && s <= boxh; s++) { if (sw * s <= boxw && sh * s <= boxh) best = s; else break; } return best; } /** Docstring: scale RGB into indexed dst with nearest neighbour.", "kind": "function", "line": 108, "name": "mpng_rgb_to_idx_scaled", "signature": "static int mpng_rgb_to_idx_scaled(const unsigned char *rgb, int sw, int sh,\n                     ..."}, {"kind": "function", "line": 140, "name": "bound", "signature": "* its 512 source bound (pinned by the host suite), so icon and policy\n * art never grow through t..."}, {"doc": "int sy = y * sh / dh; for (x = 0; x < dw; x++) { int sx = x * sw / dw; const unsigned char *p = rgb + (sy * sw + sx) * 3; int v = mpng_nearest(pal, pal_n, p[0], p[1], p[2]); if (v < 0) return MPNG_ERR_BOUND; dst[y * dw + x] = (unsigned char)v; } } return MPNG_ERR_OK; } /** Docstring: scale RGB into 3-3-2 indexed dst with nearest neighbour.", "kind": "function", "line": 172, "name": "mpng_rgb_to_332_scaled", "signature": "static int mpng_rgb_to_332_scaled(const unsigned char *rgb, int sw, int sh,\n                     ..."}, {"doc": "if (dw > MPNG_MAX_DIM || dh > MPNG_MAX_DIM) return MPNG_ERR_BOUND; for (y = 0; y < dh; y++) { int sy = y * sh / dh; for (x = 0; x < dw; x++) { int sx = x * sw / dw; const unsigned char *p = rgb + (sy * sw + sx) * 3; dst[y * dw + x] = (unsigned char)mpng_332_idx(p[0], p[1], p[2]); } } return MPNG_ERR_OK; } /** Docstring: blit an indexed tile into an indexed frame, clipped.", "kind": "function", "line": 196, "name": "mpng_blit_idx", "signature": "static int mpng_blit_idx(unsigned char *fb, int fw, int fh,\n                         const unsign..."}, {"doc": "int dy = oy + y; if (dy < 0 || dy >= fh) continue; for (x = 0; x < tw; x++) { int dx = ox + x; if (dx < 0 || dx >= fw) continue; fb[dy * fw + dx] = tile[y * tw + x]; } } return MPNG_ERR_OK; } /** Docstring: bounded whole-file read, malloced, caller frees.", "kind": "function", "line": 222, "name": "mpng_load_file", "signature": "static int mpng_load_file(const char *path, unsigned char **out, long *out_n,\n                   ..."}, {"kind": "macro", "line": 22, "name": "MINIOS_PNG_H", "signature": "#define MINIOS_PNG_H"}, {"kind": "macro", "line": 28, "name": "MPNG_FILE_MAX", "signature": "#define MPNG_FILE_MAX"}, {"kind": "macro", "line": 29, "name": "MPNG_MAX_DIM", "signature": "#define MPNG_MAX_DIM"}, {"kind": "macro", "line": 33, "name": "MPNG_BIG_DIM", "signature": "#define MPNG_BIG_DIM"}, {"kind": "macro", "line": 34, "name": "MPNG_PAL_N", "signature": "#define MPNG_PAL_N"}, {"kind": "macro", "line": 35, "name": "MPNG_PAL_BYTES", "signature": "#define MPNG_PAL_BYTES"}, {"kind": "macro", "line": 36, "name": "MPNG_PATH_MAX", "signature": "#define MPNG_PATH_MAX"}, {"kind": "macro", "line": 37, "name": "MPNG_RIGHT_PATH", "signature": "#define MPNG_RIGHT_PATH"}, {"kind": "macro", "line": 38, "name": "MPNG_LEFT_N", "signature": "#define MPNG_LEFT_N"}, {"kind": "macro", "line": 39, "name": "MPNG_ERR_OK", "signature": "#define MPNG_ERR_OK"}, {"kind": "macro", "line": 40, "name": "MPNG_ERR_BOUND", "signature": "#define MPNG_ERR_BOUND"}, {"kind": "macro", "line": 41, "name": "MPNG_ERR_EMPTY", "signature": "#define MPNG_ERR_EMPTY"}]}, {"doc": "nk_palette.h - one shared hybrid palette for every NK-window app.", "id": "progs/nk_palette.h", "kind": "module", "label": "nk_palette.h", "language": "h", "sha256": "6d8656a6a2c1808b", "symbol_count": 9, "symbols": [{"kind": "function", "line": 22, "name": "nk_palette_build", "signature": "static int nk_palette_build(unsigned char *pal, long cap)"}, {"kind": "macro", "line": 12, "name": "NK_PALETTE_H", "signature": "#define NK_PALETTE_H"}, {"kind": "macro", "line": 14, "name": "NK_PAL_BYTES", "signature": "#define NK_PAL_BYTES"}, {"kind": "macro", "line": 15, "name": "NK_PAL_DESK", "signature": "#define NK_PAL_DESK"}, {"kind": "macro", "line": 16, "name": "NK_PAL_CUBE", "signature": "#define NK_PAL_CUBE"}, {"kind": "macro", "line": 17, "name": "NK_PAL_GRAYS", "signature": "#define NK_PAL_GRAYS"}, {"kind": "macro", "line": 18, "name": "NK_PAL_ACCENTS", "signature": "#define NK_PAL_ACCENTS"}, {"kind": "macro", "line": 19, "name": "NK_PAL_ERR_OK", "signature": "#define NK_PAL_ERR_OK"}, {"kind": "macro", "line": 20, "name": "NK_PAL_ERR_BOUND", "signature": "#define NK_PAL_ERR_BOUND"}]}, {"doc": "cvm_emit.c — node-graph to CVM bytecode compiler.", "id": "progs/nuklear/cvm_emit.c", "kind": "module", "label": "cvm_emit.c", "language": "c", "sha256": "e7b7158ee3180a43", "symbol_count": 56, "symbols": [{"kind": "struct", "line": 73, "name": "codebuf"}, {"kind": "function", "line": 8, "name": "code", "signature": "* exit code (OP_HALT leaves the operand-stack top as the exit status, which\n * the shell reports ..."}, {"kind": "function", "line": 79, "name": "cb_push", "signature": "static int cb_push(struct codebuf *cb, unsigned char c)"}, {"kind": "function", "line": 91, "name": "cb_u32", "signature": "static int cb_u32(struct codebuf *cb, unsigned long v)"}, {"kind": "function", "line": 97, "name": "cb_i64", "signature": "static int cb_i64(struct codebuf *cb, long long v)"}, {"kind": "function", "line": 103, "name": "cb_patch_u32", "signature": "static void cb_patch_u32(struct codebuf *cb, size_t pos, unsigned long v)"}, {"doc": "static int cb_i64(struct codebuf *cb, long long v) { for (int i = 0; i < 8; i++) if (cb_push(cb, (unsigned char)(v >> (8 * i))) < 0) return -1; return 0; } static void cb_patch_u32(struct codebuf *cb, size_t pos, unsigned long v) { cb->b[pos + 0] = (unsigned char)(v & 255); cb->b[pos + 1] = (unsigned char)((v >> 8) & 255); cb->b[pos + 2] = (unsigned char)((v >> 16) & 255); cb->b[pos + 3] = (unsigned char)((v >> 24) & 255); } /* Push an integer literal with the shortest encoding.", "kind": "function", "line": 111, "name": "cb_imm", "signature": "static int cb_imm(struct codebuf *cb, long long v)"}, {"doc": "if (v >= -128 && v <= 127) { if (cb_push(cb, OP_PUSH_IMM8) < 0) return -1; if (cb_push(cb, (unsigned char)(v & 0xFF)) < 0) return -1; } else if (v >= -2147483648LL && v <= 2147483647LL) { if (cb_push(cb, OP_PUSH_IMM32) < 0) return -1; if (cb_u32(cb, (unsigned long)(unsigned long long)v) < 0) return -1; } else { if (cb_push(cb, OP_PUSH_IMM64) < 0) return -1; if (cb_i64(cb, v) < 0) return -1; } return 0; } /* Number of required inputs for a node type.", "kind": "function", "line": 126, "name": "req_inputs", "signature": "static int req_inputs(enum cvm_node_type t)"}, {"kind": "function", "line": 145, "name": "is_sink", "signature": "static int is_sink(enum cvm_node_type t)"}, {"doc": "case NODE_EXIT: return 1; case NODE_IF: return 3; default: return 2; } } static int is_sink(enum cvm_node_type t) { return t == NODE_PRINT || t == NODE_PRINTS || t == NODE_EXIT; } /* ---- topological sort (Kahn, stable) ----", "kind": "function", "line": 150, "name": "topo_sort", "signature": "static int topo_sort(const struct cvm_node *nodes, int n,\n                     int *order, char *..."}, {"doc": "Emit one operand: the wired local slot or the fallback literal. The caller * guarantees validation passed, so an open input always has use_lit set.", "kind": "function", "line": 213, "name": "emit_operand", "signature": "static int emit_operand(struct codebuf *code, const struct cvm_node *nodes,\n                     ..."}, {"kind": "function", "line": 224, "name": "emit_jz", "signature": "static int emit_jz(struct codebuf *code, size_t *rel_pos)"}, {"kind": "function", "line": 230, "name": "emit_jmp", "signature": "static int emit_jmp(struct codebuf *code, size_t *rel_pos)"}, {"kind": "function", "line": 236, "name": "cvm_compile", "signature": "int cvm_compile(const struct cvm_node *nodes, int n,\n                unsigned char **out, size_t ..."}, {"doc": "size_t ft = (size_t)nf * CVM_FUNC_ENTRY_SIZE; size_t gt = (size_t)ng * CVM_GLOBAL_ENTRY_SIZE; size_t nt = (size_t)nn * CVM_NATIVE_ENTRY_SIZE; size_t st = (size_t)ns * 8; size_t code_off = CVM_MODULE_HEADER_SIZE + ft + gt + nt + st; size_t total = code_off + (size_t)cs + ds.len + (size_t)sp; unsigned char *mod = (unsigned char *)calloc(1, total); if (!mod) goto oom; mod[0] = CVM_MAGIC_0; mod[1] = CVM_MAGIC_1; mod[2] = CVM_MAGIC_2; mod[3] = CVM_MAGIC_3; mod[4] = (unsigned char)CVM_VERSION_MAJOR; mod[5] = 0;                      /* minor", "kind": "function", "line": 491, "name": "w32", "signature": "void w32(void *p, unsigned v)"}, {"kind": "function", "line": 3, "name": "module", "signature": "* * Emits a cvm2 module (format v2) from a dataflow graph. Nodes are * topologically sorted (a true DAG order, so the editor can connect nodes in * any sequence);"}, {"kind": "macro", "line": 29, "name": "CVM_MAGIC_0", "signature": "#define CVM_MAGIC_0"}, {"kind": "macro", "line": 30, "name": "CVM_MAGIC_1", "signature": "#define CVM_MAGIC_1"}, {"kind": "macro", "line": 31, "name": "CVM_MAGIC_2", "signature": "#define CVM_MAGIC_2"}, {"kind": "macro", "line": 32, "name": "CVM_MAGIC_3", "signature": "#define CVM_MAGIC_3"}, {"kind": "macro", "line": 33, "name": "CVM_VERSION_MAJOR", "signature": "#define CVM_VERSION_MAJOR"}, {"kind": "macro", "line": 34, "name": "CVM_MODULE_HEADER_SIZE", "signature": "#define CVM_MODULE_HEADER_SIZE"}, {"kind": "macro", "line": 35, "name": "CVM_FUNC_ENTRY_SIZE", "signature": "#define CVM_FUNC_ENTRY_SIZE"}, {"kind": "macro", "line": 36, "name": "CVM_GLOBAL_ENTRY_SIZE", "signature": "#define CVM_GLOBAL_ENTRY_SIZE"}, {"kind": "macro", "line": 37, "name": "CVM_NATIVE_ENTRY_SIZE", "signature": "#define CVM_NATIVE_ENTRY_SIZE"}, {"kind": "macro", "line": 40, "name": "OP_PUSH_IMM64", "signature": "#define OP_PUSH_IMM64"}, {"kind": "macro", "line": 41, "name": "OP_PUSH_IMM32", "signature": "#define OP_PUSH_IMM32"}, {"kind": "macro", "line": 42, "name": "OP_PUSH_IMM8", "signature": "#define OP_PUSH_IMM8"}, {"kind": "macro", "line": 43, "name": "OP_PUSH_ZERO", "signature": "#define OP_PUSH_ZERO"}, {"kind": "macro", "line": 44, "name": "OP_PUSH_LOCAL", "signature": "#define OP_PUSH_LOCAL"}, {"kind": "macro", "line": 45, "name": "OP_STORE_LOCAL", "signature": "#define OP_STORE_LOCAL"}, {"kind": "macro", "line": 46, "name": "OP_ADD", "signature": "#define OP_ADD"}, {"kind": "macro", "line": 47, "name": "OP_SUB", "signature": "#define OP_SUB"}, {"kind": "macro", "line": 48, "name": "OP_MUL", "signature": "#define OP_MUL"}, {"kind": "macro", "line": 49, "name": "OP_DIV", "signature": "#define OP_DIV"}, {"kind": "macro", "line": 50, "name": "OP_MOD", "signature": "#define OP_MOD"}, {"kind": "macro", "line": 51, "name": "OP_NEG", "signature": "#define OP_NEG"}, {"kind": "macro", "line": 52, "name": "OP_AND", "signature": "#define OP_AND"}, {"kind": "macro", "line": 53, "name": "OP_OR", "signature": "#define OP_OR"}, {"kind": "macro", "line": 54, "name": "OP_XOR", "signature": "#define OP_XOR"}, {"kind": "macro", "line": 55, "name": "OP_NOT", "signature": "#define OP_NOT"}, {"kind": "macro", "line": 56, "name": "OP_SHL", "signature": "#define OP_SHL"}, {"kind": "macro", "line": 57, "name": "OP_SHR", "signature": "#define OP_SHR"}, {"kind": "macro", "line": 58, "name": "OP_CMP_EQ", "signature": "#define OP_CMP_EQ"}, {"kind": "macro", "line": 59, "name": "OP_CMP_NE", "signature": "#define OP_CMP_NE"}, {"kind": "macro", "line": 60, "name": "OP_CMP_LT", "signature": "#define OP_CMP_LT"}, {"kind": "macro", "line": 61, "name": "OP_CMP_LE", "signature": "#define OP_CMP_LE"}, {"kind": "macro", "line": 62, "name": "OP_CMP_GT", "signature": "#define OP_CMP_GT"}, {"kind": "macro", "line": 63, "name": "OP_CMP_GE", "signature": "#define OP_CMP_GE"}, {"kind": "macro", "line": 64, "name": "OP_LNOT", "signature": "#define OP_LNOT"}, {"kind": "macro", "line": 65, "name": "OP_JMP", "signature": "#define OP_JMP"}, {"kind": "macro", "line": 66, "name": "OP_JZ", "signature": "#define OP_JZ"}, {"kind": "macro", "line": 67, "name": "OP_CALL_NATIVE", "signature": "#define OP_CALL_NATIVE"}, {"kind": "macro", "line": 68, "name": "OP_LEA_DATA", "signature": "#define OP_LEA_DATA"}, {"kind": "macro", "line": 69, "name": "OP_HALT", "signature": "#define OP_HALT"}, {"kind": "macro", "line": 71, "name": "CVM_MAX_NODES", "signature": "#define CVM_MAX_NODES"}]}, {"doc": "cvm_emit.h — node-graph compiler for CVM (cvm2 module format v2).", "id": "progs/nuklear/cvm_emit.h", "kind": "module", "label": "cvm_emit.h", "language": "h", "sha256": "29435b6185e81455", "symbol_count": 6, "symbols": [{"doc": "One node in the graph. Inputs are indices of other nodes; a negative input means open, in which case the per-input literal is used when use_lit[k] is set, otherwise compilation fails with a node-context diagnostic. Output nodes (PRINT/PRINTS/EXIT) terminate the compiled program and can never be * used as an input source.", "kind": "struct", "line": 56, "name": "cvm_node"}, {"doc": "into a self-contained .cvm module: a single entry function whose bytecode computes every node value into a local slot and prints/exits at the output nodes. The emitted module is loadable by the CVM interpreter (objects/cvm.o) exactly like one produced by `ld -f cvm`, so `run` can execute it. Output uses the `printf`/`puts` natives (registered by cvm_host.c); exit codes come from the operand stack via OP_HALT.  #include <stddef.h> /* String payload bound for STR constants and PRINT formats. #define CVM_NODE_STR_MAX 128 /* Node types the graph compiler understands.", "kind": "enum", "line": 22, "name": "cvm_node_type"}, {"kind": "function", "line": 6, "name": "graph", "signature": "* * A node graph (constants, arithmetic, bitwise, comparisons, a conditional * select, and string constants feeding PRINT/PRINTS/EXIT sinks) is compiled * into a self-contained .cvm module: a single e"}, {"kind": "function", "line": 67, "name": "err", "signature": "* err (err_cap bytes). The module is heap-allocated and owned by the caller * (free it). */ int cvm_compile(const struct cvm_node *nodes, int n, unsigned char **out, size_t *out_size, char *err, size_"}, {"kind": "macro", "line": 2, "name": "CVM_EMIT_H", "signature": "#define CVM_EMIT_H"}, {"kind": "macro", "line": 19, "name": "CVM_NODE_STR_MAX", "signature": "#define CVM_NODE_STR_MAX"}]}, {"doc": "font8x8 - shared 8x8 bitmap font for MiniOS ring-3 graphics programs.", "id": "progs/nuklear/font8x8.c", "kind": "module", "label": "font8x8.c", "language": "c", "sha256": "df9ee1b0204fd419", "symbol_count": 0, "symbols": []}, {"doc": "node_editor.c — visual low-code editor that compiles to CVM bytecode.", "id": "progs/nuklear/node_editor.c", "kind": "module", "label": "node_editor.c", "language": "c", "sha256": "facdf984288e4ca3", "symbol_count": 34, "symbols": [{"kind": "struct", "line": 44, "name": "gnode"}, {"doc": "G_COUNT }; struct gnode { int kind; long long ival; char sval[STR_MAX]; int in[3]; long long lit[3]; int use_lit[3]; float x, y; }; /* Single registry: name, text-format word, inputs, outputs, color.", "kind": "struct", "line": 55, "name": "nodedef"}, {"kind": "function", "line": 96, "name": "node_inputs", "signature": "static int node_inputs(int k)"}, {"kind": "function", "line": 101, "name": "node_outputs", "signature": "static int node_outputs(int k)"}, {"kind": "function", "line": 106, "name": "kind_name", "signature": "static const char *kind_name(int k)"}, {"kind": "function", "line": 111, "name": "kind_color", "signature": "static struct nk_color kind_color(int k)"}, {"kind": "function", "line": 116, "name": "graph_clear", "signature": "static void graph_clear(void)"}, {"kind": "function", "line": 122, "name": "graph_add", "signature": "static int graph_add(int kind)"}, {"kind": "function", "line": 136, "name": "graph_del", "signature": "static void graph_del(int idx)"}, {"doc": "g_count--; for (int i = 0; i < g_count; i++) for (int k = 0; k < 3; k++) { if (g_nodes[i].in[k] == idx) { g_nodes[i].in[k] = -1; } else if (g_nodes[i].in[k] > idx) { g_nodes[i].in[k]--; } } if (g_selected == idx) g_selected = -1; else if (g_selected > idx) g_selected--; } /* Map the graph into the compiler's node array. Returns node count or <0.", "kind": "function", "line": 154, "name": "graph_to_compiler", "signature": "static int graph_to_compiler(struct cvm_node *out, int cap)"}, {"doc": "Pre-compile pass: repair every open data input with a const 0 fallback (an open PrStr prints an empty line), so Compile always writes a module instead of refusing. Repairs are loud (rep), and *bad selects the first touched node. Only unrepairable problems (herr: bad type, dangling wire, * sink used as a source, PrStr wired to a non-string) still refuse.", "kind": "function", "line": 176, "name": "repair_graph", "signature": "static int repair_graph(char *rep, size_t repcap, char *herr, size_t herrcap,\n                   ..."}, {"kind": "function", "line": 183, "name": "addrep", "signature": "void addrep(const char *s)"}, {"kind": "function", "line": 193, "name": "adderr", "signature": "void adderr(const char *s)"}, {"doc": "Compile the current graph to a file. Returns 0 on success. Open inputs are auto-repaired (const 0 / empty line) and reported, so this refuses * only on unrepairable problems.", "kind": "function", "line": 283, "name": "compile_to", "signature": "static int compile_to(const char *path)"}, {"doc": "--- Headless graph text format (v2, backward compatible) ---- num a 5          str s \"hi\"       add b a c      add c a #5 neg n a          if r c t e       print p e      print p e \"%d ms\\n\" prints s2 s      exit x e Inputs are earlier-defined node names or #integer literals (wire or const). Forward references are rejected. A quoted \"...\" token carries * C-like escapes (\\\\ \\\" \\n \\t). The print format is an optional 4th token.", "kind": "function", "line": 339, "name": "write_quoted", "signature": "static void write_quoted(FILE *f, const char *s)"}, {"kind": "function", "line": 392, "name": "save_graph_file", "signature": "static int save_graph_file(const char *path)"}, {"kind": "function", "line": 430, "name": "parse_graph_file", "signature": "static int parse_graph_file(const char *path)"}, {"kind": "function", "line": 437, "name": "resolve", "signature": "int resolve(const char *nme, int upto)"}, {"doc": "static int parse_graph_file(const char *path) { FILE *f = fopen(path, \"r\"); if (!f) return -1; graph_clear(); static char names[MAX_NODES][16]; char line[512]; int rc = 0; int resolve(const char *nme, int upto) { for (int k = 0; k < upto; k++) if (strcmp(names[k], nme) == 0) return k; return -2; } /* Parse one input token: name, #literal, or #- (open, no literal).", "kind": "function", "line": 443, "name": "parse_input", "signature": "int parse_input(const char *tok, int idx, int k)"}, {"doc": "/* Link-drag state: click an output pin, drag to an input pin. static int linking_active; static int linking_src_node; static int linking_src_slot; /* Node geometry constants. #define NODE_W       130.0f #define TITLE_H      20.0f #define PIN_R        5 #define PIN_DIAM     (PIN_R * 2 + 1) #define BEZIER_PAD   50.0f #define GRID_SIZE    32.0f /* Compute the Y positions of input and output pins for a node.", "kind": "function", "line": 522, "name": "pin_y", "signature": "static float pin_y(struct gnode *n, int slot, int is_output)"}, {"kind": "function", "line": 534, "name": "node_h", "signature": "static float node_h(struct gnode *n)"}, {"kind": "function", "line": 542, "name": "ui_inspector", "signature": "static void ui_inspector(struct nk_context *ctx)"}, {"kind": "function", "line": 622, "name": "ui_build", "signature": "static void ui_build(struct nk_context *ctx, float win_w, float win_h)"}, {"doc": "circle.y = pin_y(n, k, 0) - PIN_R + oy; circle.w = PIN_DIAM; circle.h = PIN_DIAM; nk_fill_circle(canvas, circle, n->in[k] >= 0 ? nk_rgb(80, 200, 80) : nk_rgb(100, 100, 100)); } } nk_layout_space_end(ctx); nk_end(ctx); } } /* ---- main loop ----", "kind": "function", "line": 931, "name": "gui_run", "signature": "static void gui_run(void)"}, {"kind": "function", "line": 983, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 33, "name": "MAX_NODES", "signature": "#define MAX_NODES"}, {"kind": "macro", "line": 34, "name": "STR_MAX", "signature": "#define STR_MAX"}, {"kind": "macro", "line": 500, "name": "UI_MEMORY", "signature": "#define UI_MEMORY"}, {"kind": "macro", "line": 514, "name": "NODE_W", "signature": "#define NODE_W"}, {"kind": "macro", "line": 515, "name": "TITLE_H", "signature": "#define TITLE_H"}, {"kind": "macro", "line": 516, "name": "PIN_R", "signature": "#define PIN_R"}, {"kind": "macro", "line": 517, "name": "PIN_DIAM", "signature": "#define PIN_DIAM"}, {"kind": "macro", "line": 518, "name": "BEZIER_PAD", "signature": "#define BEZIER_PAD"}, {"kind": "macro", "line": 519, "name": "GRID_SIZE", "signature": "#define GRID_SIZE"}]}, {"doc": "nuklear_minios.c — MiniOS platform layer for Nuklear.", "id": "progs/nuklear/nuklear_minios.c", "kind": "module", "label": "nuklear_minios.c", "language": "c", "sha256": "dba4bf06bf2a4aa8", "symbol_count": 52, "symbols": [{"doc": "#include <string.h> #include <stdio.h> #include <math.h> #include \"nuklear_minios.h\" /* glibc program name for the mailbox box (GNU extension). extern char *program_invocation_short_name; #include \"nk_palette.h\" #include \"wl/wl_mbox.h\" #include \"wl/wl_client.h\" /* ---- MiniOS syscalls (canonical table from minios_abi.h) ----", "kind": "function", "line": 33, "name": "nk_sys_time_ms", "signature": "long nk_sys_time_ms(void)"}, {"kind": "function", "line": 38, "name": "nk_sys_kbd", "signature": "long nk_sys_kbd(void)"}, {"kind": "function", "line": 43, "name": "nk_sys_palette", "signature": "long nk_sys_palette(const unsigned char *pal)"}, {"kind": "function", "line": 48, "name": "nk_sys_kbd_raw", "signature": "long nk_sys_kbd_raw(int on)"}, {"kind": "function", "line": 53, "name": "nk_sys_getpid", "signature": "long nk_sys_getpid(void)"}, {"kind": "function", "line": 72, "name": "nk_client_probe", "signature": "static int nk_client_probe(void)"}, {"kind": "function", "line": 114, "name": "nk_sys_vga_mode", "signature": "long nk_sys_vga_mode(int on)"}, {"kind": "function", "line": 121, "name": "nk_sys_fb_info", "signature": "long nk_sys_fb_info(int *w, int *h, int *pitch)"}, {"kind": "function", "line": 137, "name": "nk_sys_fb_info_rgb", "signature": "static long nk_sys_fb_info_rgb(int *w, int *h, int *pitch, int *rgb)"}, {"kind": "function", "line": 147, "name": "nk_rgb_available", "signature": "int nk_rgb_available(void)"}, {"kind": "function", "line": 162, "name": "rgb256_prepare", "signature": "static void rgb256_prepare(void)"}, {"kind": "function", "line": 170, "name": "nk_idx_to_rgb", "signature": "void nk_idx_to_rgb(int idx, unsigned char *r, unsigned char *g,\n                   unsigned char *b)"}, {"kind": "function", "line": 186, "name": "cur_set", "signature": "static void cur_set(struct nk_color c)"}, {"kind": "function", "line": 190, "name": "cur_bg_set", "signature": "static void cur_bg_set(struct nk_color c)"}, {"kind": "function", "line": 193, "name": "nk_sys_mouse", "signature": "long nk_sys_mouse(int *xybw)"}, {"kind": "function", "line": 198, "name": "nk_sys_mouse_badptr", "signature": "long nk_sys_mouse_badptr(void)"}, {"kind": "function", "line": 216, "name": "nk_client_hash", "signature": "static unsigned nk_client_hash(const unsigned char *p, unsigned n)"}, {"kind": "function", "line": 227, "name": "nk_client_publish", "signature": "static int nk_client_publish(void)"}, {"kind": "function", "line": 280, "name": "nk_sys_nk_frame", "signature": "long nk_sys_nk_frame(int *origin)"}, {"kind": "function", "line": 314, "name": "nk_mirror_box", "signature": "static void nk_mirror_box(char *dst, int cap)"}, {"kind": "function", "line": 335, "name": "nk_mirror_emit", "signature": "static int nk_mirror_emit(const char *box, unsigned seq,\n        const unsigned char *msg, int mlen)"}, {"kind": "function", "line": 352, "name": "nk_mirror_tick", "signature": "static void nk_mirror_tick(void)"}, {"kind": "function", "line": 409, "name": "nk_sys_gfx_set_title", "signature": "long nk_sys_gfx_set_title(const char *t)"}, {"doc": "The desktop-exact hybrid palette lives once in progs/nk_palette.h; * this wrapper keeps the platform signature while sharing the table.", "kind": "function", "line": 418, "name": "nk_build_palette", "signature": "void nk_build_palette(unsigned char *pal768)"}, {"kind": "function", "line": 427, "name": "pal_prepare", "signature": "static void pal_prepare(void)"}, {"kind": "function", "line": 438, "name": "col_to_idx", "signature": "static int col_to_idx(struct nk_color c)"}, {"kind": "function", "line": 469, "name": "set_clip", "signature": "static void set_clip(int x, int y, int w, int h)"}, {"kind": "function", "line": 479, "name": "px", "signature": "static void px(int x, int y, int c)"}, {"doc": "static void px(int x, int y, int c) { volatile uint8_t *d; if (x < clip_x || x >= clip_x + clip_w) return; if (y < clip_y || y >= clip_y + clip_h) return; if (x < 0 || x >= NK_W || y < 0 || y >= NK_H) return; fb[y * NK_W + x] = (uint8_t)c; if (nk_rgb_on == 1) { d = fbrgb + ((y * NK_W) + x) * 3; d[0] = (uint8_t)cur_r; d[1] = (uint8_t)cur_g; d[2] = (uint8_t)cur_b; } } /* Text-background twin: same pixel, the command's background color.", "kind": "function", "line": 492, "name": "px_bg", "signature": "static void px_bg(int x, int y, int c)"}, {"doc": "Index-owned pixels (IMAGE commands): RGB resolves through the exact * rgb256 table, so both buffers agree without a nearest search.", "kind": "function", "line": 506, "name": "px_idx", "signature": "static void px_idx(int x, int y, int c)"}, {"kind": "function", "line": 522, "name": "fill_rect", "signature": "static void fill_rect(int x, int y, int w, int h, int c)"}, {"kind": "function", "line": 529, "name": "draw_line", "signature": "static void draw_line(int x0, int y0, int x1, int y1, int th, int c)"}, {"kind": "function", "line": 547, "name": "fill_circle", "signature": "static void fill_circle(int cx, int cy, int r, int c)"}, {"kind": "function", "line": 553, "name": "stroke_circle", "signature": "static void stroke_circle(int cx, int cy, int r, int th, int c)"}, {"doc": "draw_line(cx + x, cy - y, cx - x, cy - y, th, c); draw_line(cx - x, cy + y, cx - x, cy - y, th, c); draw_line(cx + x, cy + y, cx - x, cy - y, th, c); draw_line(cx - y, cy - x, cx - x, cy - y, th, c); draw_line(cx + y, cy - x, cx - x, cy - y, th, c); draw_line(cx - y, cy + x, cx - x, cy - y, th, c); draw_line(cx + y, cy + x, cx - x, cy - y, th, c); y++; if (err <= 0) { err += 2*y + 1; } if (err > 0)  { x--; err -= 2*x + 1; } } } /* Fill a convex polygon (x[], y[]).", "kind": "function", "line": 571, "name": "fill_poly", "signature": "static void fill_poly(int *xs, int *ys, int n, int c)"}, {"kind": "function", "line": 594, "name": "stroke_poly", "signature": "static void stroke_poly(int *xs, int *ys, int n, int th, int c)"}, {"kind": "function", "line": 601, "name": "draw_text", "signature": "static void draw_text(int x, int y, const char *s, int len, int fg, int bg)"}, {"kind": "function", "line": 615, "name": "draw_arc", "signature": "static void draw_arc(int cx, int cy, int r, float a0, float a1,\n                     int filled, ..."}, {"kind": "function", "line": 636, "name": "nk_rasterize", "signature": "void nk_rasterize(struct nk_context *ctx)"}, {"kind": "function", "line": 641, "name": "nk_foreach", "signature": "nk_foreach(cmd, ctx)"}, {"doc": "im->px[iy * im->w + ix]); } } break; } case NK_COMMAND_CUSTOM: break; default: break; } } } /* ---- Font (8x8 monospace) ----", "kind": "function", "line": 813, "name": "nk_minios_font_width", "signature": "static float nk_minios_font_width(nk_handle handle, float height,\n                               ..."}, {"kind": "function", "line": 819, "name": "nk_minios_font", "signature": "struct nk_user_font nk_minios_font(void)"}, {"kind": "function", "line": 854, "name": "feed_key", "signature": "static void feed_key(struct nk_context *ctx, enum nk_keys key, int down)"}, {"kind": "function", "line": 861, "name": "nk_set_scancode_hook", "signature": "void nk_set_scancode_hook(nk_scancode_cb cb, void *ud)"}, {"kind": "function", "line": 866, "name": "handle_scancode", "signature": "static void handle_scancode(struct nk_context *ctx, unsigned char sc)"}, {"doc": "Client input pump: feed the pending .ev batch when its seq advanced, else hold the last state. Never touches PS/2; the * server owns the port while the desktop runs.", "kind": "function", "line": 914, "name": "nk_client_poll", "signature": "static void nk_client_poll(struct nk_context *ctx)"}, {"kind": "function", "line": 961, "name": "nk_poll_input", "signature": "void nk_poll_input(struct nk_context *ctx)"}, {"kind": "function", "line": 1000, "name": "nk_set_window_origin", "signature": "void nk_set_window_origin(int x, int y)"}, {"doc": "WM quit gesture latch: ESC or Alt+F4 pressed since the last poll. Returns 1 once per gesture, then clears. Every NK app polls this per * frame so no window depends on the tiny title-bar X to close.", "kind": "function", "line": 1008, "name": "nk_quit_requested", "signature": "int nk_quit_requested(void)"}, {"kind": "function", "line": 4, "name": "list", "signature": "* abstract draw command list (nk__begin/nk__next);"}, {"doc": "wheel. All MiniOS-specific syscalls go through the Linux syscall ABI, so this compiles into a normal static ring-3 ELF.  #define NK_IMPLEMENTATION #include \"nuklear.h\" #include <string.h> #include <stdio.h> #include <math.h> #include \"nuklear_minios.h\" /* glibc program name for the mailbox box (GNU extension).", "kind": "variable", "line": 27, "name": "program_invocation_short_name", "signature": "extern char *program_invocation_short_name;"}, {"kind": "macro", "line": 17, "name": "NK_IMPLEMENTATION", "signature": "#define NK_IMPLEMENTATION"}]}, {"doc": "nuklear_minios.h — MiniOS platform layer for Nuklear.", "id": "progs/nuklear/nuklear_minios.h", "kind": "module", "label": "nuklear_minios.h", "language": "h", "sha256": "22a3193063a41d92", "symbol_count": 29, "symbols": [{"doc": "Forward declarations so this header is self-contained when included * without nuklear.h first (font8x8.c does exactly that).", "kind": "struct", "line": 20, "name": "nk_context"}, {"kind": "struct", "line": 21, "name": "nk_user_font"}, {"kind": "struct", "line": 22, "name": "nk_command_buffer"}, {"doc": "Caller-owned image for NK_COMMAND_IMAGE: palette-indexed pixels plus a 0/1 alpha mask (mask 0 skips the pixel, so icons keep transparency). The app keeps the buffers alive while the image is used; the backend only reads. Bounds are fail closed: a null descriptor, a null plane or * a non-positive/excessive extent draws nothing. define NK_MINIOS_IMG_MAX 64", "kind": "struct", "line": 74, "name": "nk_minios_img"}, {"doc": "RGB companion buffer (R,G,B byte order, NK_W x NK_H). Mapped only by ABI-v7 kernels; nk_rgb_available() probes it once via the fb_info 4th * word, so old kernels keep the indexed path without ever faulting. #define NK_RGB_BUF      ((volatile uint8_t *)MINIOS_NK_RGB_ADDR) /* 1 when the kernel maps NK_RGB_BUF (cached probe, 0 on old kernels).", "kind": "function", "line": 33, "name": "nk_rgb_available", "signature": "int nk_rgb_available(void);"}, {"doc": "Resolve one hybrid palette index to its exact RGB triple (canvas and preview mirrors that own indexed pixels reuse the same table the * rasterizer draws through, so both buffers agree pixel for pixel).", "kind": "function", "line": 37, "name": "nk_idx_to_rgb", "signature": "void nk_idx_to_rgb(int idx, unsigned char *r, unsigned char *g, unsigned char *b);"}, {"doc": "Resolve one hybrid palette index to its exact RGB triple (canvas and preview mirrors that own indexed pixels reuse the same table the * rasterizer draws through, so both buffers agree pixel for pixel). void nk_idx_to_rgb(int idx, unsigned char *r, unsigned char *g, unsigned char *b); /* MiniOS syscalls used by the platform.", "kind": "function", "line": 41, "name": "nk_sys_time_ms", "signature": "long nk_sys_time_ms(void);"}, {"kind": "function", "line": 42, "name": "nk_sys_kbd", "signature": "long nk_sys_kbd(void);"}, {"kind": "function", "line": 43, "name": "nk_sys_palette", "signature": "long nk_sys_palette(const unsigned char *pal768);"}, {"kind": "function", "line": 44, "name": "nk_sys_kbd_raw", "signature": "long nk_sys_kbd_raw(int on);"}, {"kind": "function", "line": 45, "name": "nk_sys_vga_mode", "signature": "long nk_sys_vga_mode(int on);"}, {"kind": "function", "line": 46, "name": "nk_sys_fb_info", "signature": "long nk_sys_fb_info(int *w, int *h, int *pitch);"}, {"kind": "function", "line": 47, "name": "nk_sys_mouse", "signature": "long nk_sys_mouse(int *xybw);"}, {"doc": "Call SYS_MOUSE with a pointer that is NOT in the user window; the kernel must reject it with -EFAULT. Used by --selftest to prove the pointer * validation, so a mutant that drops the bounds check is killed.", "kind": "function", "line": 51, "name": "nk_sys_mouse_badptr", "signature": "long nk_sys_mouse_badptr(void);"}, {"kind": "function", "line": 52, "name": "nk_sys_nk_frame", "signature": "long nk_sys_nk_frame(int *origin);"}, {"doc": "Call SYS_MOUSE with a pointer that is NOT in the user window; the kernel must reject it with -EFAULT. Used by --selftest to prove the pointer * validation, so a mutant that drops the bounds check is killed. long nk_sys_mouse_badptr(void); long nk_sys_nk_frame(int *origin);     /* int[2]: window content origin", "kind": "function", "line": 53, "name": "nk_sys_gfx_set_title", "signature": "long nk_sys_gfx_set_title(const char *t);"}, {"doc": "Hybrid palette: indices 0-14 are the desktop colors (kept so the desktop * behind the window never recolors); 15-255 are the UI ramp.", "kind": "function", "line": 57, "name": "nk_build_palette", "signature": "void nk_build_palette(unsigned char *pal768);"}, {"doc": "Hybrid palette: indices 0-14 are the desktop colors (kept so the desktop * behind the window never recolors); 15-255 are the UI ramp. void nk_build_palette(unsigned char *pal768); /* 8x8 bitmap font (ASCII 32..127), shared with the rasterizer. extern const uint8_t nk_font8x8[96][8]; /* The nk_user_font for this backend: 8x8 monospace.", "kind": "function", "line": 63, "name": "nk_minios_font", "signature": "struct nk_user_font nk_minios_font(void);"}, {"doc": "Hybrid palette: indices 0-14 are the desktop colors (kept so the desktop * behind the window never recolors); 15-255 are the UI ramp. void nk_build_palette(unsigned char *pal768); /* 8x8 bitmap font (ASCII 32..127), shared with the rasterizer. extern const uint8_t nk_font8x8[96][8]; /* The nk_user_font for this backend: 8x8 monospace. struct nk_user_font nk_minios_font(void); /* Rasterize the Nuklear command list into the back-buffer.", "kind": "function", "line": 66, "name": "nk_rasterize", "signature": "void nk_rasterize(struct nk_context *ctx);"}, {"kind": "function", "line": 85, "name": "SYS_NK_FRAME", "signature": "* SYS_NK_FRAME (nk_set_window_origin). */ void nk_set_window_origin(int x, int y);"}, {"kind": "function", "line": 87, "name": "nk_poll_input", "signature": "void nk_poll_input(struct nk_context *ctx);"}, {"doc": "WM quit gesture: ESC or Alt+F4 since the last poll (1 once, then clears). Every NK app checks this per frame so closing never depends * on the title-bar X alone.", "kind": "function", "line": 92, "name": "nk_quit_requested", "signature": "int nk_quit_requested(void);"}, {"kind": "function", "line": 101, "name": "nk_set_scancode_hook", "signature": "void nk_set_scancode_hook(nk_scancode_cb cb, void *ud);"}, {"kind": "macro", "line": 2, "name": "NUKLEAR_MINIOS_H", "signature": "#define NUKLEAR_MINIOS_H"}, {"kind": "macro", "line": 24, "name": "NK_W", "signature": "#define NK_W"}, {"kind": "macro", "line": 25, "name": "NK_H", "signature": "#define NK_H"}, {"kind": "macro", "line": 26, "name": "NK_BACKBUF", "signature": "#define NK_BACKBUF"}, {"kind": "macro", "line": 30, "name": "NK_RGB_BUF", "signature": "#define NK_RGB_BUF"}, {"kind": "macro", "line": 73, "name": "NK_MINIOS_IMG_MAX", "signature": "#define NK_MINIOS_IMG_MAX"}]}, {"doc": "Docstring: shared Nuklear theme loader, linked by every NK app.", "id": "progs/nuklear/nuklear_theme.c", "kind": "module", "label": "nuklear_theme.c", "language": "c", "sha256": "48ea85264bffb6ae", "symbol_count": 7, "symbols": [{"kind": "struct", "line": 15, "name": "nk_theme_slot"}, {"kind": "function", "line": 37, "name": "nk_theme_name_ok", "signature": "static int nk_theme_name_ok(const char *name)"}, {"kind": "function", "line": 49, "name": "nk_theme_active", "signature": "int nk_theme_active(char *dst, int cap)"}, {"kind": "function", "line": 73, "name": "nk_theme_parse_line", "signature": "static int nk_theme_parse_line(const char *line,\n                               unsigned char rgb..."}, {"kind": "function", "line": 105, "name": "nk_theme_probe", "signature": "int nk_theme_probe(const char *name, unsigned char rgb[NK_THEME_KEY_COUNT][3])"}, {"kind": "function", "line": 141, "name": "nk_theme_apply", "signature": "int nk_theme_apply(struct nk_context *ctx, const char *name)"}, {"kind": "macro", "line": 21, "name": "X", "signature": "#define X(k, i)"}]}, {"doc": "Docstring: shared Nuklear theme contract for every MiniOS NK app.", "id": "progs/nuklear/nuklear_theme.h", "kind": "module", "label": "nuklear_theme.h", "language": "h", "sha256": "bc777e2584499eaa", "symbol_count": 13, "symbols": [{"kind": "struct", "line": 59, "name": "nk_context"}, {"doc": "X(scrollbar_cursor, 24) \\ X(scrollbar_cursor_hover, 25) \\ X(scrollbar_cursor_active, 26) \\ X(tab_header, 27) \\ X(knob, 28) \\ X(knob_cursor, 29) \\ X(knob_cursor_hover, 30) \\ X(knob_cursor_active, 31) #define NK_THEME_KEY_COUNT 32 struct nk_context; /** Resolve the active theme name (current file, else the default).", "kind": "function", "line": 62, "name": "nk_theme_active", "signature": "int nk_theme_active(char *dst, int cap);"}, {"doc": "X(tab_header, 27) \\ X(knob, 28) \\ X(knob_cursor, 29) \\ X(knob_cursor_hover, 30) \\ X(knob_cursor_active, 31) #define NK_THEME_KEY_COUNT 32 struct nk_context; /** Resolve the active theme name (current file, else the default). int nk_theme_active(char *dst, int cap); /** Load name (or active when 0) into rgb[32][3]; 0 ok, <0 fallback used.", "kind": "function", "line": 65, "name": "nk_theme_probe", "signature": "int nk_theme_probe(const char *name, unsigned char rgb[NK_THEME_KEY_COUNT][3]);"}, {"doc": "X(knob_cursor_hover, 30) \\ X(knob_cursor_active, 31) #define NK_THEME_KEY_COUNT 32 struct nk_context; /** Resolve the active theme name (current file, else the default). int nk_theme_active(char *dst, int cap); /** Load name (or active when 0) into rgb[32][3]; 0 ok, <0 fallback used. int nk_theme_probe(const char *name, unsigned char rgb[NK_THEME_KEY_COUNT][3]); /** Apply name (or active when 0) to ctx; 0 ok, <0 fallback applied.", "kind": "function", "line": 68, "name": "nk_theme_apply", "signature": "int nk_theme_apply(struct nk_context *ctx, const char *name);"}, {"kind": "macro", "line": 2, "name": "NUKLEAR_THEME_H", "signature": "#define NUKLEAR_THEME_H"}, {"kind": "macro", "line": 15, "name": "NK_THEME_NAME_MAX", "signature": "#define NK_THEME_NAME_MAX"}, {"kind": "macro", "line": 16, "name": "NK_THEME_KEY_MAX", "signature": "#define NK_THEME_KEY_MAX"}, {"kind": "macro", "line": 17, "name": "NK_THEME_LINE_MAX", "signature": "#define NK_THEME_LINE_MAX"}, {"kind": "macro", "line": 18, "name": "NK_THEME_PATH_DIR", "signature": "#define NK_THEME_PATH_DIR"}, {"kind": "macro", "line": 19, "name": "NK_THEME_PATH_CURRENT", "signature": "#define NK_THEME_PATH_CURRENT"}, {"kind": "macro", "line": 20, "name": "NK_THEME_DEFAULT", "signature": "#define NK_THEME_DEFAULT"}, {"kind": "macro", "line": 23, "name": "NK_THEME_KEY_LIST", "signature": "#define NK_THEME_KEY_LIST"}, {"kind": "macro", "line": 57, "name": "NK_THEME_KEY_COUNT", "signature": "#define NK_THEME_KEY_COUNT"}]}, {"doc": "Docstring: MiniOS paint program (Nuklear ring-3 app, MiniFS: paint/paint.elf).", "id": "progs/paint/paint.c", "kind": "module", "label": "paint.c", "language": "c", "sha256": "9cca6cd15da170b8", "symbol_count": 53, "symbols": [{"doc": "static int paint_size = 0; static int paint_down = 0; static int paint_lastx; static int paint_lasty; static int paint_anchorx; static int paint_anchory; static float paint_rectx; static float paint_recty; static char paint_path[PAINT_PATH_MAX] = PAINT_DEFAULT_PATH; static char paint_status[PAINT_STATUS_MAX]; static int paint_quit; static int paint_autoload; /** Clamp v into [lo, hi].", "kind": "function", "line": 92, "name": "paint_clamp", "signature": "static int paint_clamp(int v, int lo, int hi)"}, {"doc": "static float paint_recty; static char paint_path[PAINT_PATH_MAX] = PAINT_DEFAULT_PATH; static char paint_status[PAINT_STATUS_MAX]; static int paint_quit; static int paint_autoload; /** Clamp v into [lo, hi]. static int paint_clamp(int v, int lo, int hi) { if (v < lo) return lo; if (v > hi) return hi; return v; } /** Bound-checked pixel plot, fail closed outside the canvas.", "kind": "function", "line": 99, "name": "paint_plot", "signature": "static int paint_plot(unsigned char *buf, int w, int h, int x, int y,\n                      unsig..."}, {"doc": "if (v > hi) return hi; return v; } /** Bound-checked pixel plot, fail closed outside the canvas. static int paint_plot(unsigned char *buf, int w, int h, int x, int y, unsigned char c) { if (!buf || w <= 0 || h <= 0) return -1; if (x < 0 || y < 0 || x >= w || y >= h) return -1; buf[y * w + x] = c; return 0; } /** Filled square dab of side s centered on (x, y).", "kind": "function", "line": 108, "name": "paint_dab", "signature": "static void paint_dab(unsigned char *buf, int w, int h, int x, int y,\n                      unsig..."}, {"doc": "} /** Filled square dab of side s centered on (x, y). static void paint_dab(unsigned char *buf, int w, int h, int x, int y, unsigned char c, int s) { int half = s / 2; int dx; int dy; for (dy = -half; dy < s - half; dy++) for (dx = -half; dx < s - half; dx++) paint_plot(buf, w, h, x + dx, y + dy, c); } /** Bresenham line with brush dabs, returns plotted points (not dabs).", "kind": "function", "line": 119, "name": "paint_line", "signature": "static int paint_line(unsigned char *buf, int w, int h, int x0, int y0,\n                      int..."}, {"doc": "paint_dab(buf, w, h, x0, y0, c, s); n++; } if (x0 == x1 && y0 == y1) break; { int e2 = 2 * err; if (e2 > -dy) { err -= dy; x0 += sx; } if (e2 < dx) { err += dx; y0 += sy; } } } return n; } /** Filled rectangle, corners normalized, returns painted pixels.", "kind": "function", "line": 144, "name": "paint_rect_fill", "signature": "static int paint_rect_fill(unsigned char *buf, int w, int h, int x0, int y0,\n                    ..."}, {"doc": "int xb = x0 < x1 ? x1 : x0; int ya = y0 < y1 ? y0 : y1; int yb = y0 < y1 ? y1 : y0; int x; int y; int n = 0; if (!buf || w <= 0 || h <= 0) return -1; for (y = ya; y <= yb; y++) for (x = xa; x <= xb; x++) if (paint_plot(buf, w, h, x, y, c) == 0) n++; return n; } /** Filled midpoint circle of radius r, returns painted pixels.", "kind": "function", "line": 161, "name": "paint_circle_fill", "signature": "static int paint_circle_fill(unsigned char *buf, int w, int h, int cx,\n                          ..."}, {"doc": "Bounded flood fill with mark-on-push: every cell is marked once, so * the explicit stack never exceeds the canvas size.", "kind": "function", "line": 179, "name": "paint_flood", "signature": "static int paint_flood(unsigned char *buf, int w, int h, int x, int y,\n                       uns..."}, {"doc": "} if (cy + 1 < h && buf[(cy + 1) * w + cx] == oc) { buf[(cy + 1) * w + cx] = nc; sx[top] = cx; sy[top] = cy + 1; top++; n++; } if (cy - 1 >= 0 && buf[(cy - 1) * w + cx] == oc) { buf[(cy - 1) * w + cx] = nc; sx[top] = cx; sy[top] = cy - 1; top++; n++; } } return n; } /** Nearest hybrid-palette index by squared RGB distance.", "kind": "function", "line": 223, "name": "paint_nearest", "signature": "static int paint_nearest(const unsigned char *pal, unsigned r, unsigned g,\n                      ..."}, {"doc": "unsigned long bd = 0xFFFFFFFFUL; unsigned k; if (!pal) return -1; for (k = 0; k < 256; k++) { long dr = (long)pal[k * 3] - (long)r; long dg = (long)pal[k * 3 + 1] - (long)g; long db = (long)pal[k * 3 + 2] - (long)b; unsigned long d = (unsigned long)(dr * dr + dg * dg + db * db); if (d < bd) { bd = d; best = k; } } return (int)best; } /** Cached hybrid palette: built once, shared by picker, save and load.", "kind": "function", "line": 240, "name": "paint_pal", "signature": "static const unsigned char *paint_pal(void)"}, {"doc": "} /** Cached hybrid palette: built once, shared by picker, save and load. static const unsigned char *paint_pal(void) { static unsigned char pal768[768]; static int ready = 0; if (!ready) { nk_build_palette(pal768); ready = 1; } return pal768; } /** Save-path gate: printable ASCII, bounded, .png suffix, no traversal.", "kind": "function", "line": 251, "name": "paint_path_ok", "signature": "static int paint_path_ok(const char *p)"}, {"kind": "function", "line": 272, "name": "paint_crc_init", "signature": "static void paint_crc_init(void)"}, {"kind": "function", "line": 285, "name": "paint_crc_update", "signature": "static unsigned long paint_crc_update(unsigned long c,\n                                      cons..."}, {"doc": "paint_crc_ready = 1; } static unsigned long paint_crc_update(unsigned long c, const unsigned char *p, unsigned long n) { unsigned long k; paint_crc_init(); for (k = 0; k < n; k++) c = paint_crc_tab[(c ^ p[k]) & 0xFF] ^ (c >> 8); return c; } /** Adler-32 over one buffer (the zlib trailer of a single IDAT).", "kind": "function", "line": 296, "name": "paint_adler", "signature": "static unsigned long paint_adler(const unsigned char *p, unsigned long n)"}, {"doc": "/** Adler-32 over one buffer (the zlib trailer of a single IDAT). static unsigned long paint_adler(const unsigned char *p, unsigned long n) { unsigned long a = 1; unsigned long b = 0; unsigned long k; for (k = 0; k < n; k++) { a = (a + p[k]) % 65521; b = (b + a) % 65521; } return (b << 16) | a; } /** Bound-checked big-endian u32 store for the PNG writer.", "kind": "function", "line": 308, "name": "paint_put_u32", "signature": "static int paint_put_u32(unsigned char *dst, unsigned long cap,\n                         unsigned..."}, {"doc": "/** Bound-checked big-endian u32 store for the PNG writer. static int paint_put_u32(unsigned char *dst, unsigned long cap, unsigned long *pos, unsigned long v) { if (!dst || !pos || *pos + 4 > cap) return -1; dst[*pos] = (unsigned char)((v >> 24) & 0xFF); dst[*pos + 1] = (unsigned char)((v >> 16) & 0xFF); dst[*pos + 2] = (unsigned char)((v >> 8) & 0xFF); dst[*pos + 3] = (unsigned char)(v & 0xFF); pos += 4; return 0; } /** Bound-checked raw copy for the PNG writer.", "kind": "function", "line": 320, "name": "paint_put_bytes", "signature": "static int paint_put_bytes(unsigned char *dst, unsigned long cap,\n                           unsi..."}, {"doc": "Encode indexed pixels as 8-bit truecolor PNG (stored deflate blocks). * Returns the byte count or a negative code on any bound violation.", "kind": "function", "line": 333, "name": "paint_png_encode", "signature": "static long paint_png_encode(unsigned char *dst, unsigned long cap,\n                             ..."}, {"doc": "Decode a PNG file into the canvas (top-left, clamped, nearest-mapped). * Reports through the status line, never a partial silent canvas.", "kind": "function", "line": 461, "name": "paint_load_file", "signature": "static int paint_load_file(const char *path)"}, {"doc": "for (x = 0; x < cw; x++) { int v = paint_nearest(pal768, px[(y * w + x) * 3], px[(y * w + x) * 3 + 1], px[(y * w + x) * 3 + 2]); paint_px[y * PAINT_W + x] = (unsigned char)v; } snprintf(paint_status, sizeof(paint_status), \"loaded %s (%dx%d)\", path, w, h); } stbi_image_free(px); return 0; } /** Encode the canvas and write it to path, fail closed on any shortfall.", "kind": "function", "line": 514, "name": "paint_save_file", "signature": "static int paint_save_file(const char *path)"}, {"doc": "Blit the canvas into the NK back-buffer after rasterize (and its RGB * twin when the kernel maps it, so the canvas shows full color too).", "kind": "function", "line": 549, "name": "paint_blit", "signature": "static void paint_blit(int ox, int oy)"}, {"doc": "int dx = ox + x; int dy = oy + y; unsigned char r, g, b; volatile uint8_t *d; if (dx < 0 || dx >= NK_W || dy < 0 || dy >= NK_H) continue; fb[dy * NK_W + dx] = paint_px[y * PAINT_W + x]; if (!rgb) continue; nk_idx_to_rgb(paint_px[y * PAINT_W + x], &r, &g, &b); d = NK_RGB_BUF + ((dy * NK_W) + dx) * 3; d[0] = r; d[1] = g; d[2] = b; } } /** Current drawing color index (eraser paints the canvas background).", "kind": "function", "line": 570, "name": "paint_ink", "signature": "static unsigned char paint_ink(void)"}, {"doc": "nk_idx_to_rgb(paint_px[y * PAINT_W + x], &r, &g, &b); d = NK_RGB_BUF + ((dy * NK_W) + dx) * 3; d[0] = r; d[1] = g; d[2] = b; } } /** Current drawing color index (eraser paints the canvas background). static unsigned char paint_ink(void) { if (paint_tool == PAINT_TOOL_ERASER) return paint_colors[PAINT_NCOLORS - 1]; return paint_colors[paint_swatch % PAINT_NCOLORS]; } /** Drive the active stroke from the Nuklear input state.", "kind": "function", "line": 577, "name": "paint_handle_input", "signature": "static void paint_handle_input(struct nk_context *ctx)"}, {"doc": "Build the file row, the exact-size canvas beside the tool panel, and the status row. The canvas cell is PAINT_W wide so every white pixel shown is paintable; tools, colors and buttons live in the side * panel instead of above an oversized slot.", "kind": "function", "line": 636, "name": "paint_ui_build", "signature": "static void paint_ui_build(struct nk_context *ctx)"}, {"doc": "Scan the whole framebuffer for the canvas marker run (first four swatches consecutive). Position-independent: it holds whatever video mode the boot picked and wherever the compositor centered the window. No console output inside: serial prints take milliseconds and open * windows for the 25 Hz desktop tick between present and scan.", "kind": "function", "line": 720, "name": "paint_pattern_present", "signature": "static int paint_pattern_present(int fw, int fh, int fp, int *ox, int *oy)"}, {"doc": "break; } } if (hit) { ox = x; oy = y; return 1; } } } return 0; } /** Headless selftest for BDD: core vectors, PNG roundtrip, one frame.", "kind": "function", "line": 755, "name": "paint_selftest", "signature": "static int paint_selftest(void)"}, {"doc": "printf(\"paint: composite did not land (canvas %d,%d origin %d,%d)\\n\", (int)paint_rectx, (int)paint_recty, origin[0], origin[1]); return 1; } nk_free(&ctx); nk_sys_kbd_raw(0); nk_sys_vga_mode(0); printf(\"paint: frame ok (%dx%d)\\n\", NK_W, NK_H); return 0; } static unsigned char paint_ui_memory[PAINT_UI_MEMORY]; /** Interactive GUI loop: toolbar, canvas strokes, blit, present.", "kind": "function", "line": 942, "name": "paint_gui_run", "signature": "static void paint_gui_run(void)"}, {"kind": "function", "line": 992, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 26, "name": "STB_IMAGE_IMPLEMENTATION", "signature": "#define STB_IMAGE_IMPLEMENTATION"}, {"kind": "macro", "line": 27, "name": "STBI_ONLY_PNG", "signature": "#define STBI_ONLY_PNG"}, {"kind": "macro", "line": 28, "name": "STBI_NO_STDIO", "signature": "#define STBI_NO_STDIO"}, {"kind": "macro", "line": 32, "name": "PAINT_W", "signature": "#define PAINT_W"}, {"kind": "macro", "line": 33, "name": "PAINT_H", "signature": "#define PAINT_H"}, {"kind": "macro", "line": 34, "name": "PAINT_N", "signature": "#define PAINT_N"}, {"kind": "macro", "line": 35, "name": "PAINT_PATH_MAX", "signature": "#define PAINT_PATH_MAX"}, {"kind": "macro", "line": 36, "name": "PAINT_FILE_MAX", "signature": "#define PAINT_FILE_MAX"}, {"kind": "macro", "line": 37, "name": "PAINT_STATUS_MAX", "signature": "#define PAINT_STATUS_MAX"}, {"kind": "macro", "line": 38, "name": "PAINT_UI_MEMORY", "signature": "#define PAINT_UI_MEMORY"}, {"kind": "macro", "line": 39, "name": "PAINT_PNG_MAX", "signature": "#define PAINT_PNG_MAX"}, {"kind": "macro", "line": 40, "name": "PAINT_PNG_MAX_DIM", "signature": "#define PAINT_PNG_MAX_DIM"}, {"kind": "macro", "line": 41, "name": "PAINT_TITLE", "signature": "#define PAINT_TITLE"}, {"kind": "macro", "line": 42, "name": "PAINT_DEFAULT_PATH", "signature": "#define PAINT_DEFAULT_PATH"}, {"kind": "macro", "line": 43, "name": "PAINT_PANEL_TITLE", "signature": "#define PAINT_PANEL_TITLE"}, {"kind": "macro", "line": 44, "name": "PAINT_FILE_BTN_W", "signature": "#define PAINT_FILE_BTN_W"}, {"kind": "macro", "line": 45, "name": "PAINT_FRAME_MS", "signature": "#define PAINT_FRAME_MS"}, {"kind": "macro", "line": 46, "name": "PAINT_FRAME_ATTEMPTS", "signature": "#define PAINT_FRAME_ATTEMPTS"}, {"kind": "macro", "line": 47, "name": "PAINT_NCOLORS", "signature": "#define PAINT_NCOLORS"}, {"kind": "macro", "line": 48, "name": "PAINT_NSIZES", "signature": "#define PAINT_NSIZES"}, {"kind": "macro", "line": 49, "name": "PAINT_NTOOLS", "signature": "#define PAINT_NTOOLS"}, {"kind": "macro", "line": 52, "name": "PAINT_TOOL_BRUSH", "signature": "#define PAINT_TOOL_BRUSH"}, {"kind": "macro", "line": 53, "name": "PAINT_TOOL_LINE", "signature": "#define PAINT_TOOL_LINE"}, {"kind": "macro", "line": 54, "name": "PAINT_TOOL_RECT", "signature": "#define PAINT_TOOL_RECT"}, {"kind": "macro", "line": 55, "name": "PAINT_TOOL_CIRCLE", "signature": "#define PAINT_TOOL_CIRCLE"}, {"kind": "macro", "line": 56, "name": "PAINT_TOOL_FILL", "signature": "#define PAINT_TOOL_FILL"}, {"kind": "macro", "line": 57, "name": "PAINT_TOOL_ERASER", "signature": "#define PAINT_TOOL_ERASER"}]}, {"doc": "piano.c — a Nuklear piano that plays FM sound through the SB16 driver.", "id": "progs/piano/piano.c", "kind": "module", "label": "piano.c", "language": "c", "sha256": "de499b59231849b5", "symbol_count": 65, "symbols": [{"kind": "function", "line": 93, "name": "sys_pcm_open", "signature": "static long sys_pcm_open(long flags)"}, {"doc": "Returns bytes taken (NONBLOCK short count on backpressure, never a * stall), or negative on a dead path.", "kind": "function", "line": 98, "name": "sys_pcm_write", "signature": "static long sys_pcm_write(const void *buf, long len)"}, {"kind": "function", "line": 101, "name": "sys_pcm_close", "signature": "static void sys_pcm_close(void)"}, {"kind": "function", "line": 104, "name": "sys_yield", "signature": "static void sys_yield(void)"}, {"doc": "Indexed present (buffer id 1): the 288 KB indexed copy instead of the 864 KB RGB twin. Piano inks are flat UI colors that survive the palette mapping, so the RGB path buys nothing here and costs ~3x in the kernel blit under TCG. nk_sys_nk_frame would pick RGB whenever the kernel maps * it; piano bypasses it on purpose. Origin reporting matches.", "kind": "function", "line": 112, "name": "sys_present_idx", "signature": "static long sys_present_idx(int *origin)"}, {"kind": "function", "line": 127, "name": "o3_op", "signature": "static int o3_op(int ch, int is_car)"}, {"kind": "function", "line": 131, "name": "o3_opreg", "signature": "static void o3_opreg(int ch, int is_car, int regbase, int val)"}, {"kind": "function", "line": 135, "name": "o3_chreg", "signature": "static void o3_chreg(int ch, int regbase, int val)"}, {"kind": "function", "line": 173, "name": "o3_note", "signature": "static void o3_note(int ch, int midi, int on)"}, {"kind": "function", "line": 211, "name": "midi_to_key", "signature": "static int midi_to_key(int midi)"}, {"kind": "function", "line": 234, "name": "clamp_midi", "signature": "static int clamp_midi(int m)"}, {"doc": "pressed scancode owns its channel until release.  Indexed by 7-bit code. static int sc_chan[128]; static int sustain_pedal; static int octave;                    /* -2..+2, note shifted by 12*octave static int volume;                    /* 0..100 master, applied on the mix static int clamp_midi(int m) { if (m < 0) m = 0; if (m > 127) m = 127; return m; } /* Release every voice the pedal is holding (pedal lifted).", "kind": "function", "line": 241, "name": "pedal_set", "signature": "static void pedal_set(int on)"}, {"kind": "function", "line": 255, "name": "voice_alloc", "signature": "static int voice_alloc(void)"}, {"kind": "function", "line": 268, "name": "note_off_key", "signature": "static void note_off_key(int key)"}, {"kind": "function", "line": 281, "name": "note_on_key", "signature": "static void note_on_key(int key, int midi, int vel)"}, {"doc": "── PC-keyboard MIDI map (Fruity Loops style) ───────────────────────── PS/2 set-1 scancodes (7-bit code, E0 clear) to semitone offsets from the UI base: A-row whites, Q-row blacks between them, Z-row bass whites, digits aliasing the upper blacks.  Comma/period are octave down/up and * are handled in the hook, not here.  Returns -100 for \"not a note\". define KBD_NO_NOTE (-100)", "kind": "function", "line": 298, "name": "kbd_semitone", "signature": "static int kbd_semitone(int code)"}, {"kind": "function", "line": 333, "name": "kbd_all_off", "signature": "static void kbd_all_off(void)"}, {"kind": "function", "line": 339, "name": "note_on_sc", "signature": "static void note_on_sc(int code, int vel)"}, {"kind": "function", "line": 353, "name": "note_off_sc", "signature": "static void note_off_sc(int code)"}, {"doc": "Raw scancode hook (registered with nk_set_scancode_hook): note on/off * plus comma/period octave shift.  Extended (E0) keys are ignored.", "kind": "function", "line": 369, "name": "piano_scancode", "signature": "static void piano_scancode(int code, int make, int e0, void *ud)"}, {"doc": "#define FX_DELAY_CAP (RATE)           /* 1 s of delay at 22050 Hz #define FX_DELAY_MAX_MS 800 #define FX_FEEDBACK 0.35f #define FX_WET      0.55f #define FX_TREM_FREQ 5.0f static float fx_delay_buf[FX_DELAY_CAP]; static int   fx_delay_len;            /* samples, 0 = echo off static int   fx_delay_pos; static int   fx_tremolo_pct;          /* 0..100, 0 = tremolo off static float fx_trem_phase; static int   fx_softclip; /* (Re)configure every FX stage; also used by the selftest.", "kind": "function", "line": 421, "name": "fx_configure", "signature": "static void fx_configure(int delay_ms, int tremolo_pct, int clip, int vol)"}, {"kind": "function", "line": 440, "name": "fx_process", "signature": "static float fx_process(float x)"}, {"doc": "Flush held bytes to the low-latency ring. A short NONBLOCK write is backpressure, not loss: the remainder stays held (fill < PCM_BUF) and the next frame retries it, and the event is counted so `sb16` shows whether the synth outruns the engine. Only a negative return * (dead path) drops the buffer, fail-loud instead of spinning on it.", "kind": "function", "line": 469, "name": "sb_flush", "signature": "static void sb_flush(void)"}, {"kind": "function", "line": 484, "name": "render_audio", "signature": "static void render_audio(long ms)"}, {"kind": "function", "line": 511, "name": "key_rect", "signature": "static void key_rect(int key, int *x, int *y, int *w, int *h)"}, {"kind": "function", "line": 518, "name": "hit_key", "signature": "static int hit_key(int mx, int my)"}, {"doc": "Velocity 1..100 from the click's vertical position inside a key: the very * top is soft, the bottom is loud.", "kind": "function", "line": 535, "name": "hit_velocity", "signature": "static int hit_velocity(int key, int my)"}, {"kind": "function", "line": 563, "name": "ctrl_hit", "signature": "static int ctrl_hit(int id, int mx, int my)"}, {"kind": "function", "line": 567, "name": "ctrl_active", "signature": "static int ctrl_active(int id)"}, {"kind": "function", "line": 577, "name": "ctrl_press", "signature": "static void ctrl_press(int id)"}, {"doc": "case 1: if (octave < 2) octave++; break; case 2: if (volume > 0) volume -= 5; break; case 3: if (volume < 100) volume += 5; break; case 4: pedal_set(sustain_pedal ? 0 : 1); break; case 5: fx_configure(fx_delay_len > 0 ? 0 : 220, fx_tremolo_pct, fx_softclip, volume); break; case 6: fx_configure(fx_delay_len > 0 ? fx_delay_len * 1000 / (int)RATE : 0, fx_tremolo_pct > 0 ? 0 : 70, fx_softclip, volume); break; case 7: fx_configure(fx_delay_len > 0 ? fx_delay_len * 1000 / (int)RATE : 0, fx_tremolo_pct, fx_softclip ? 0 : 1, volume); break; default: break; } } /* ── UI ───────────────────────────────────────────────────────────────", "kind": "function", "line": 594, "name": "ui_run", "signature": "static void ui_run(int bench_ms)"}, {"kind": "function", "line": 818, "name": "rate", "signature": "* wait below caps the frame rate (bench mode skips it so the\n         * benchmark still measures ..."}, {"doc": "sys_yield(); } else { sys_yield(); } } nk_set_scancode_hook(0, 0); nk_free(&ctx); nk_sys_kbd_raw(0); nk_sys_vga_mode(0); sys_pcm_close(); } /* ── Headless selftest (BDD hook) ─────────────────────────────────────", "kind": "function", "line": 836, "name": "run_selftest", "signature": "static int run_selftest(void)"}, {"doc": "Headless pcm2 plumbing probe (BDD hook): open NONBLOCK, stream one 2048-byte pattern, close, reopen (release symmetry), close. Passes on any backend: a draining engine accepts everything, a stalled one (null backend, no IRQ, no DMA progress) still accepts the first kernel ring (1024 B) without blocking. Prints `pcm2: probe ok (accepted=N)` or a diagnostic; needs no SB16 IRQ * and no GUI.", "kind": "function", "line": 1015, "name": "run_pcm2_probe", "signature": "static int run_pcm2_probe(void)"}, {"kind": "function", "line": 1042, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 54, "name": "UI_MEMORY", "signature": "#define UI_MEMORY"}, {"kind": "macro", "line": 57, "name": "SYS_PCM2_OPEN", "signature": "#define SYS_PCM2_OPEN"}, {"kind": "macro", "line": 58, "name": "SYS_PCM2_WRITE", "signature": "#define SYS_PCM2_WRITE"}, {"kind": "macro", "line": 59, "name": "SYS_PCM2_CLOSE", "signature": "#define SYS_PCM2_CLOSE"}, {"kind": "macro", "line": 61, "name": "RATE", "signature": "#define RATE"}, {"kind": "macro", "line": 62, "name": "PCM_FRAG", "signature": "#define PCM_FRAG"}, {"kind": "macro", "line": 63, "name": "PCM_BUF", "signature": "#define PCM_BUF"}, {"kind": "macro", "line": 76, "name": "MAX_AUDIO_MS", "signature": "#define MAX_AUDIO_MS"}, {"kind": "macro", "line": 84, "name": "PIANO_FRAME_MS", "signature": "#define PIANO_FRAME_MS"}, {"kind": "macro", "line": 91, "name": "PIANO_FRAME_PERIOD", "signature": "#define PIANO_FRAME_PERIOD"}, {"kind": "macro", "line": 190, "name": "KEY_W", "signature": "#define KEY_W"}, {"kind": "macro", "line": 191, "name": "KEY_H", "signature": "#define KEY_H"}, {"kind": "macro", "line": 192, "name": "BK_W", "signature": "#define BK_W"}, {"kind": "macro", "line": 193, "name": "BK_H", "signature": "#define BK_H"}, {"kind": "macro", "line": 194, "name": "KEY_Y", "signature": "#define KEY_Y"}, {"kind": "macro", "line": 195, "name": "PIANO_BASE_MIDI", "signature": "#define PIANO_BASE_MIDI"}, {"kind": "macro", "line": 196, "name": "PIANO_OCTAVES", "signature": "#define PIANO_OCTAVES"}, {"kind": "macro", "line": 209, "name": "NKEYS", "signature": "#define NKEYS"}, {"kind": "macro", "line": 221, "name": "MAX_VOICES", "signature": "#define MAX_VOICES"}, {"kind": "macro", "line": 297, "name": "KBD_NO_NOTE", "signature": "#define KBD_NO_NOTE"}, {"kind": "macro", "line": 407, "name": "FX_DELAY_CAP", "signature": "#define FX_DELAY_CAP"}, {"kind": "macro", "line": 408, "name": "FX_DELAY_MAX_MS", "signature": "#define FX_DELAY_MAX_MS"}, {"kind": "macro", "line": 409, "name": "FX_FEEDBACK", "signature": "#define FX_FEEDBACK"}, {"kind": "macro", "line": 410, "name": "FX_WET", "signature": "#define FX_WET"}, {"kind": "macro", "line": 411, "name": "FX_TREM_FREQ", "signature": "#define FX_TREM_FREQ"}, {"kind": "macro", "line": 545, "name": "CTRL_Y", "signature": "#define CTRL_Y"}, {"kind": "macro", "line": 546, "name": "CTRL_H", "signature": "#define CTRL_H"}, {"kind": "macro", "line": 547, "name": "BTN_W", "signature": "#define BTN_W"}, {"kind": "macro", "line": 548, "name": "BTN_GAP", "signature": "#define BTN_GAP"}, {"kind": "macro", "line": 561, "name": "NCTRLS", "signature": "#define NCTRLS"}]}, {"doc": "fetch.sh - clone the gb-recompiled tool into progs/pokemon/upstream.  The upstream project ships the recompiler + runtime, but no ROMs and no pre-generated game code (see its README). You generate a project from a ROM you legally own, then point the MiniOS build at it. See README.md.  Usage: ./fetch.sh   (safe to re-run; never touches an existing checkout)", "id": "progs/pokemon/fetch.sh", "kind": "module", "label": "fetch.sh", "language": "sh", "sha256": "f799a72d603f6a93", "symbol_count": 0, "symbols": []}, {"doc": "SDL.h stub for MiniOS cross-compilation", "id": "progs/pokemon/minios_stubs/SDL.h", "kind": "module", "label": "SDL.h", "language": "h", "sha256": "4c7da4b5dca34653", "symbol_count": 10, "symbols": [{"doc": "/* SDL.h stub for MiniOS cross-compilation ifndef SDL_H_STUB_MINIOS define SDL_H_STUB_MINIOS include <stdint.h>", "kind": "type_alias", "line": 5, "name": "Uint64", "signature": "typedef uint64_t Uint64;"}, {"kind": "type_alias", "line": 6, "name": "Uint32", "signature": "typedef uint32_t Uint32;"}, {"kind": "type_alias", "line": 7, "name": "Sint32", "signature": "typedef int32_t Sint32;"}, {"kind": "type_alias", "line": 8, "name": "Sint16", "signature": "typedef int16_t Sint16;"}, {"kind": "type_alias", "line": 9, "name": "Uint8", "signature": "typedef uint8_t Uint8;"}, {"kind": "function", "line": 11, "name": "SDL_GetPerformanceCounter", "signature": "static inline Uint64 SDL_GetPerformanceCounter(void)"}, {"kind": "function", "line": 12, "name": "SDL_GetPerformanceFrequency", "signature": "static inline Uint64 SDL_GetPerformanceFrequency(void)"}, {"kind": "function", "line": 13, "name": "SDL_GetTicks", "signature": "static inline Uint32 SDL_GetTicks(void)"}, {"kind": "function", "line": 14, "name": "SDL_Delay", "signature": "static inline void SDL_Delay(Uint32 ms)"}, {"kind": "macro", "line": 3, "name": "SDL_H_STUB_MINIOS", "signature": "#define SDL_H_STUB_MINIOS"}]}, {"id": "progs/pokemon/platform_minios.c", "kind": "module", "label": "platform_minios.c", "language": "c", "sha256": "3067370e5b683bed", "symbol_count": 111, "symbols": [{"kind": "struct", "line": 302, "name": "gb_voice_t"}, {"kind": "function", "line": 70, "name": "sys_time_ms", "signature": "static long sys_time_ms(void)"}, {"kind": "function", "line": 76, "name": "sys_kbd", "signature": "static long sys_kbd(void)"}, {"kind": "function", "line": 82, "name": "sys_nk_frame", "signature": "static long sys_nk_frame(int *origin)"}, {"kind": "function", "line": 88, "name": "sys_mouse", "signature": "static long sys_mouse(int *xybw)"}, {"kind": "function", "line": 94, "name": "sys_vga_mode", "signature": "static long sys_vga_mode(int on)"}, {"kind": "function", "line": 100, "name": "sys_kbd_raw", "signature": "static long sys_kbd_raw(int on)"}, {"kind": "function", "line": 106, "name": "sys_palette", "signature": "static long sys_palette(const unsigned char *pal)"}, {"kind": "function", "line": 112, "name": "sys_gfx_title", "signature": "static long sys_gfx_title(const char *t)"}, {"kind": "function", "line": 118, "name": "sys_tone", "signature": "static long sys_tone(unsigned f)"}, {"kind": "function", "line": 124, "name": "sys_pcm2_open", "signature": "static long sys_pcm2_open(long flags)"}, {"kind": "function", "line": 130, "name": "sys_pcm2_write", "signature": "static long sys_pcm2_write(const void *buf, long len)"}, {"kind": "function", "line": 136, "name": "sys_pcm2_close", "signature": "static void sys_pcm2_close(void)"}, {"kind": "function", "line": 143, "name": "gain", "signature": "* timing gain (overshoot is microseconds against millisecond waits).\n * Difference-based, so it s..."}, {"kind": "function", "line": 191, "name": "gb_platform_set_debug", "signature": "void gb_platform_set_debug(bool enabled)"}, {"kind": "function", "line": 198, "name": "_dl_argv", "signature": "* usable _dl_argv (it bound to unrelated storage and strcmp faulted).\n * DO NOT reintroduce argv ..."}, {"kind": "function", "line": 263, "name": "minios_audio_sample", "signature": "static void minios_audio_sample(GBContext *ctx, int16_t left, int16_t right)"}, {"kind": "function", "line": 307, "name": "gb_voice_in_range", "signature": "static bool gb_voice_in_range(unsigned f)"}, {"kind": "function", "line": 311, "name": "sample_apu_voices", "signature": "static void sample_apu_voices(gb_voice_t *v)"}, {"kind": "function", "line": 331, "name": "minios_audio_play", "signature": "static void minios_audio_play(const gb_voice_t *v, bool pcm_audible,\n                            ..."}, {"kind": "function", "line": 403, "name": "rebuild_joypad", "signature": "static void rebuild_joypad(void)"}, {"kind": "function", "line": 417, "name": "poll_keyboard", "signature": "static void poll_keyboard(void)"}, {"doc": "3-3-2 RGB palette ramp, pushed ONCE at init (not per frame). * Pixel index = (R & 0xE0) | ((G & 0xE0) >> 3) | ((B & 0xC0) >> 6).", "kind": "function", "line": 456, "name": "push_332_palette", "signature": "static void push_332_palette(void)"}, {"kind": "function", "line": 621, "name": "ui_fringe_dirty", "signature": "static bool ui_fringe_dirty(uint32_t now)"}, {"kind": "function", "line": 627, "name": "ui_fringe_sync", "signature": "static void ui_fringe_sync(uint32_t now)"}, {"kind": "function", "line": 633, "name": "menu_fill", "signature": "static void menu_fill(int x0, int y0, int w, int h, uint8_t idx)"}, {"kind": "function", "line": 646, "name": "menu_text", "signature": "static void menu_text(int x, int y, const char *s, uint8_t fg)"}, {"kind": "function", "line": 665, "name": "menu_osd", "signature": "static void menu_osd(const char *s)"}, {"kind": "function", "line": 671, "name": "menu_draw", "signature": "static void menu_draw(void)"}, {"kind": "function", "line": 701, "name": "menu_item_at", "signature": "static int menu_item_at(int lx, int ly)"}, {"kind": "function", "line": 708, "name": "menu_do_save", "signature": "static void menu_do_save(void)"}, {"kind": "function", "line": 724, "name": "menu_do_load", "signature": "static void menu_do_load(void)"}, {"kind": "function", "line": 743, "name": "menu_activate", "signature": "static void menu_activate(int it)"}, {"doc": "Esc toggles, Up/Down move, Enter activates; the mouse is a bonus. * PS/2 Set 1: Esc = 0x01, Up = 0x48, Down = 0x50, Enter = 0x1C.", "kind": "function", "line": 777, "name": "poll_menu", "signature": "static void poll_menu(void)"}, {"kind": "function", "line": 845, "name": "pokemon_art_load_one", "signature": "static int pokemon_art_load_one(const char *path, unsigned char **rgb,\n                          ..."}, {"kind": "function", "line": 870, "name": "pokemon_art_load", "signature": "static void pokemon_art_load(void)"}, {"kind": "function", "line": 888, "name": "pokemon_art_draw_one", "signature": "static void pokemon_art_draw_one(const unsigned char *rgb, int sw, int sh,\n                      ..."}, {"kind": "function", "line": 926, "name": "pokemon_art_draw", "signature": "static void pokemon_art_draw(void)"}, {"kind": "function", "line": 957, "name": "px_to_idx", "signature": "static uint8_t px_to_idx(uint32_t pixel)"}, {"kind": "function", "line": 976, "name": "upload_frame", "signature": "static void upload_frame(const uint32_t *framebuffer)"}, {"kind": "function", "line": 1057, "name": "gb_platform_init", "signature": "bool gb_platform_init(int scale)"}, {"kind": "function", "line": 1089, "name": "minios_persist_path", "signature": "static void minios_persist_path(char *out, size_t n, const GBContext *ctx,\n                      ..."}, {"doc": "Legacy ramdisk path (pre-MiniFS fix wrote bin/<id>.* onto volatile ramdisk). Loads still probe it as a fallback so a checkpoint saved * in the same session before an upgrade is not invisible.", "kind": "function", "line": 1098, "name": "minios_legacy_path", "signature": "static void minios_legacy_path(char *out, size_t n, const GBContext *ctx,\n                       ..."}, {"kind": "function", "line": 1104, "name": "minios_load_helper", "signature": "static bool minios_load_helper(const char *path, void *data, size_t size,\n                       ..."}, {"kind": "function", "line": 1122, "name": "minios_save_helper", "signature": "static bool minios_save_helper(const char *path, const void *data, size_t size)"}, {"kind": "function", "line": 1133, "name": "minios_load_battery_ram", "signature": "static bool minios_load_battery_ram(GBContext *ctx, const char *rom_name,\n                       ..."}, {"kind": "function", "line": 1148, "name": "minios_save_battery_ram", "signature": "static bool minios_save_battery_ram(GBContext *ctx, const char *rom_name,\n                       ..."}, {"kind": "function", "line": 1158, "name": "minios_load_rtc_data", "signature": "static bool minios_load_rtc_data(GBContext *ctx, const char *rom_name,\n                          ..."}, {"kind": "function", "line": 1171, "name": "minios_save_rtc_data", "signature": "static bool minios_save_rtc_data(GBContext *ctx, const char *rom_name,\n                          ..."}, {"kind": "function", "line": 1209, "name": "minios_fast_forward", "signature": "static inline bool minios_fast_forward(void)"}, {"kind": "function", "line": 1213, "name": "minios_state_path", "signature": "static void minios_state_path(char *out, size_t n, const GBContext *ctx)"}, {"kind": "function", "line": 1218, "name": "minios_legacy_state_path", "signature": "static void minios_legacy_state_path(char *out, size_t n, const GBContext *ctx)"}, {"kind": "function", "line": 1223, "name": "minios_autosave", "signature": "static void minios_autosave(uint32_t now)"}, {"doc": "PS/2 Set 1: F5 = 0x3F, F8 = 0x42, Ctrl = 0x1D, S = 0x1F, L = 0x26, SPACE = 0x39, Shift = 0x2A/0x36. SPACE held is momentary turbo; * Ctrl+Space latches it (sticky), Ctrl+Shift+Space releases it.", "kind": "function", "line": 1237, "name": "poll_hotkeys", "signature": "static void poll_hotkeys(void)"}, {"kind": "function", "line": 1289, "name": "gb_platform_register_context", "signature": "void gb_platform_register_context(GBContext *ctx)"}, {"kind": "function", "line": 1311, "name": "gb_platform_shutdown", "signature": "void gb_platform_shutdown(void)"}, {"kind": "function", "line": 1322, "name": "gb_platform_poll_events", "signature": "bool gb_platform_poll_events(GBContext *ctx)"}, {"kind": "function", "line": 1331, "name": "gb_platform_render_frame", "signature": "void gb_platform_render_frame(const uint32_t *framebuffer)"}, {"kind": "function", "line": 1367, "name": "frames", "signature": "* frames (menu bar not on screen yet) and any frame after the\n         * LCD-off path zeroed the ..."}, {"kind": "function", "line": 1400, "name": "gb_platform_present_framebuffer", "signature": "void gb_platform_present_framebuffer(const uint32_t *framebuffer)"}, {"kind": "function", "line": 1412, "name": "gb_platform_render_lcd_off_frame", "signature": "void gb_platform_render_lcd_off_frame(void)"}, {"kind": "function", "line": 1434, "name": "gb_platform_vsync", "signature": "void gb_platform_vsync(uint32_t frame_cycles)"}, {"kind": "function", "line": 1451, "name": "gb_platform_set_benchmark_mode", "signature": "void gb_platform_set_benchmark_mode(bool enabled)"}, {"kind": "function", "line": 1455, "name": "gb_platform_set_input_script", "signature": "bool gb_platform_set_input_script(const char *script)"}, {"kind": "function", "line": 1461, "name": "gb_platform_set_input_record_file", "signature": "void gb_platform_set_input_record_file(const char *path)"}, {"kind": "function", "line": 1466, "name": "gb_platform_set_persistence_dir", "signature": "bool gb_platform_set_persistence_dir(const char *path)"}, {"kind": "function", "line": 1475, "name": "gb_platform_set_dump_frames", "signature": "void gb_platform_set_dump_frames(const char *frames)"}, {"kind": "function", "line": 1497, "name": "gb_platform_set_dump_present_frames", "signature": "void gb_platform_set_dump_present_frames(const char *frames)"}, {"kind": "function", "line": 1518, "name": "gb_platform_set_screenshot_prefix", "signature": "void gb_platform_set_screenshot_prefix(const char *prefix)"}, {"kind": "function", "line": 1524, "name": "gb_platform_get_timing_info", "signature": "void gb_platform_get_timing_info(GBPlatformTimingInfo *out)"}, {"kind": "function", "line": 1531, "name": "gb_platform_get_joypad", "signature": "uint8_t gb_platform_get_joypad(void)"}, {"kind": "function", "line": 1535, "name": "gb_platform_set_title", "signature": "void gb_platform_set_title(const char *title)"}, {"kind": "function", "line": 1541, "name": "gb_platform_get_smooth_lcd_transitions", "signature": "bool gb_platform_get_smooth_lcd_transitions(void)"}, {"kind": "function", "line": 1545, "name": "gb_platform_set_smooth_lcd_transitions", "signature": "void gb_platform_set_smooth_lcd_transitions(bool enabled)"}, {"kind": "function", "line": 1549, "name": "gb_platform_set_launcher_return_enabled", "signature": "void gb_platform_set_launcher_return_enabled(bool enabled)"}, {"kind": "function", "line": 1553, "name": "gb_platform_get_exit_action", "signature": "GBPlatformExitAction gb_platform_get_exit_action(void)"}, {"kind": "function", "line": 1557, "name": "gb_platform_submit_port_frame", "signature": "void gb_platform_submit_port_frame(void *user, const GBPortFrame *frame)"}, {"doc": "void gb_platform_set_launcher_return_enabled(bool enabled) { (void)enabled; } GBPlatformExitAction gb_platform_get_exit_action(void) { return g_exit_action; } void gb_platform_submit_port_frame(void *user, const GBPortFrame *frame) { (void)user; (void)frame; } /* Test-hook stubs (no-ops on MiniOS)", "kind": "function", "line": 1563, "name": "gb_platform_test_audio_concurrency", "signature": "bool gb_platform_test_audio_concurrency(uint32_t frames,\n                                        ..."}, {"kind": "function", "line": 1572, "name": "gb_platform_test_inject_persistence_fault", "signature": "void gb_platform_test_inject_persistence_fault(\n    GBPersistenceTestTarget target,\n    GBPersist..."}, {"kind": "function", "line": 219, "name": "audio", "signature": "* PC speaker audio (DOOM-style: sparse syscalls from poll points) * * Per rendered frame, live voice frequencies come from gb_audio_voice() * (runtime accessor over internal channel state: enabled, DA"}, {"kind": "function", "line": 572, "name": "menu", "signature": "* FILE menu (no Nuklear on purpose) * * A 16 px menu bar lives in the top margin the 2x GB image never touches * (it starts at GB_DST_Y0 = 36). Clicking FILE (or pressing Esc) drops a * 5-item menu: S"}, {"kind": "macro", "line": 61, "name": "STB_IMAGE_IMPLEMENTATION", "signature": "#define STB_IMAGE_IMPLEMENTATION"}, {"kind": "macro", "line": 62, "name": "STBI_ONLY_PNG", "signature": "#define STBI_ONLY_PNG"}, {"kind": "macro", "line": 63, "name": "STBI_NO_STDIO", "signature": "#define STBI_NO_STDIO"}, {"kind": "macro", "line": 161, "name": "FB_ADDR", "signature": "#define FB_ADDR"}, {"kind": "macro", "line": 162, "name": "FB_W", "signature": "#define FB_W"}, {"kind": "macro", "line": 163, "name": "FB_H", "signature": "#define FB_H"}, {"kind": "macro", "line": 165, "name": "GB_SCALE", "signature": "#define GB_SCALE"}, {"kind": "macro", "line": 166, "name": "GB_DST_W", "signature": "#define GB_DST_W"}, {"kind": "macro", "line": 167, "name": "GB_DST_H", "signature": "#define GB_DST_H"}, {"kind": "macro", "line": 168, "name": "GB_DST_X0", "signature": "#define GB_DST_X0"}, {"kind": "macro", "line": 169, "name": "GB_DST_Y0", "signature": "#define GB_DST_Y0"}, {"kind": "macro", "line": 234, "name": "MINIOS_AUDIO_RATE", "signature": "#define MINIOS_AUDIO_RATE"}, {"kind": "macro", "line": 235, "name": "MINIOS_AUDIO_SILENCE_E", "signature": "#define MINIOS_AUDIO_SILENCE_E"}, {"kind": "macro", "line": 236, "name": "MINIOS_AUDIO_MIN_HZ", "signature": "#define MINIOS_AUDIO_MIN_HZ"}, {"kind": "macro", "line": 237, "name": "MINIOS_AUDIO_MAX_HZ", "signature": "#define MINIOS_AUDIO_MAX_HZ"}, {"kind": "macro", "line": 238, "name": "MINIOS_ARP_BASS_MS", "signature": "#define MINIOS_ARP_BASS_MS"}, {"kind": "macro", "line": 239, "name": "MINIOS_ARP_MEL_MS", "signature": "#define MINIOS_ARP_MEL_MS"}, {"kind": "macro", "line": 587, "name": "MENU_BAR_H", "signature": "#define MENU_BAR_H"}, {"kind": "macro", "line": 588, "name": "MENU_FILE_X0", "signature": "#define MENU_FILE_X0"}, {"kind": "macro", "line": 589, "name": "MENU_FILE_X1", "signature": "#define MENU_FILE_X1"}, {"kind": "macro", "line": 590, "name": "MENU_DROP_X0", "signature": "#define MENU_DROP_X0"}, {"kind": "macro", "line": 591, "name": "MENU_DROP_W", "signature": "#define MENU_DROP_W"}, {"kind": "macro", "line": 592, "name": "MENU_ITEM_H", "signature": "#define MENU_ITEM_H"}, {"kind": "macro", "line": 593, "name": "MENU_NITEMS", "signature": "#define MENU_NITEMS"}, {"kind": "macro", "line": 596, "name": "MENU_BG", "signature": "#define MENU_BG"}, {"kind": "macro", "line": 597, "name": "MENU_FG", "signature": "#define MENU_FG"}, {"kind": "macro", "line": 598, "name": "MENU_HOVER", "signature": "#define MENU_HOVER"}, {"kind": "macro", "line": 599, "name": "MENU_OSD_BG", "signature": "#define MENU_OSD_BG"}, {"kind": "macro", "line": 1194, "name": "MINIOS_AUTOSAVE_MS", "signature": "#define MINIOS_AUTOSAVE_MS"}, {"kind": "macro", "line": 1206, "name": "MINIOS_FF_FRAMESKIP", "signature": "#define MINIOS_FF_FRAMESKIP"}]}, {"doc": "q2generic_minios.c - MiniOS platform layer for quake2generic.", "id": "progs/quake2generic/q2generic_minios.c", "kind": "module", "label": "q2generic_minios.c", "language": "c", "sha256": "0b4fe74782404ba7", "symbol_count": 34, "symbols": [{"kind": "function", "line": 5, "name": "MINIOS_GFX_BUF_GAME", "signature": "* MINIOS_SYS_GFX_PRESENT with MINIOS_GFX_BUF_GAME (211 stays as a kernel\n * compat alias) and the..."}, {"kind": "function", "line": 30, "name": "sys_kbd", "signature": "static long sys_kbd(void)"}, {"kind": "function", "line": 36, "name": "sys_palette", "signature": "static long sys_palette(const unsigned char *pal)"}, {"kind": "function", "line": 42, "name": "sys_kbd_raw", "signature": "static long sys_kbd_raw(int on)"}, {"kind": "function", "line": 48, "name": "sys_vga_mode", "signature": "static long sys_vga_mode(int on)"}, {"kind": "function", "line": 54, "name": "sys_doom_frame", "signature": "static long sys_doom_frame(void)"}, {"kind": "function", "line": 60, "name": "sys_mouse", "signature": "static long sys_mouse(int *buf)"}, {"kind": "function", "line": 66, "name": "sys_set_title", "signature": "static long sys_set_title(const char *t)"}, {"kind": "function", "line": 72, "name": "sys_gfx_zoom", "signature": "static long sys_gfx_zoom(long mode)"}, {"kind": "function", "line": 86, "name": "q2g_parse_windowed", "signature": "static void q2g_parse_windowed(int argc, char **argv)"}, {"kind": "function", "line": 121, "name": "q2g_parse_autoframes", "signature": "static void q2g_parse_autoframes(int argc, char **argv)"}, {"kind": "function", "line": 154, "name": "QG_GetMouseDiff", "signature": "void QG_GetMouseDiff(int *dx, int *dy)"}, {"kind": "function", "line": 168, "name": "QG_CaptureMouse", "signature": "void QG_CaptureMouse(void)"}, {"kind": "function", "line": 172, "name": "QG_ReleaseMouse", "signature": "void QG_ReleaseMouse(void)"}, {"kind": "function", "line": 175, "name": "QG_Mkdir", "signature": "void QG_Mkdir(const char *path)"}, {"kind": "function", "line": 179, "name": "scancode_to_q2key", "signature": "static unsigned char scancode_to_q2key(unsigned char raw)"}, {"kind": "function", "line": 262, "name": "extended_to_q2key", "signature": "static unsigned char extended_to_q2key(unsigned char sc)"}, {"kind": "function", "line": 280, "name": "kbd_poll", "signature": "static void kbd_poll(void)"}, {"kind": "function", "line": 310, "name": "SWimp_SetPalette", "signature": "void SWimp_SetPalette(const unsigned char *palette)"}, {"kind": "function", "line": 320, "name": "SWimp_SetMode", "signature": "rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)"}, {"kind": "function", "line": 337, "name": "SWimp_Init", "signature": "int SWimp_Init(void *hInstance, void *wndProc)"}, {"kind": "function", "line": 346, "name": "SWimp_Shutdown", "signature": "void SWimp_Shutdown(void)"}, {"kind": "function", "line": 349, "name": "SWimp_BeginFrame", "signature": "void SWimp_BeginFrame(float camera_separation)"}, {"kind": "function", "line": 352, "name": "SWimp_EndFrame", "signature": "void SWimp_EndFrame(void)"}, {"kind": "function", "line": 381, "name": "SWimp_AppActivate", "signature": "void SWimp_AppActivate(qboolean active)"}, {"kind": "function", "line": 385, "name": "QG_Milliseconds", "signature": "int QG_Milliseconds(void)"}, {"kind": "function", "line": 389, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 4, "name": "MINIOS_DOOM_BACKBUF_ADDR", "signature": "* MINIOS_DOOM_BACKBUF_ADDR (minios_abi.h);"}, {"doc": "Sys_Quit lives in the engine's system driver (other/q_system.c); not pulled * in through quake2.h, so declare it here for the autoquit hook below.", "kind": "function", "line": 99, "name": "Sys_Quit", "signature": "extern void Sys_Quit(void);"}, {"doc": "Sys_Quit lives in the engine's system driver (other/q_system.c); not pulled * in through quake2.h, so declare it here for the autoquit hook below. extern void Sys_Quit(void); /* Command buffer (other/cmd.c) for the in-game sound test hook below.", "kind": "function", "line": 102, "name": "Cbuf_AddText", "signature": "extern void Cbuf_AddText(char *text);"}, {"doc": "Sound backend probe (snddma_minios.c): headless proof the DMA layer * reaches the pcm2 path, run with `quake2generic.elf --pcm2-probe`.", "kind": "function", "line": 106, "name": "q2snd_probe", "signature": "extern int q2snd_probe(void);"}, {"kind": "macro", "line": 21, "name": "Q2G_FB_W", "signature": "#define Q2G_FB_W"}, {"kind": "macro", "line": 22, "name": "Q2G_FB_H", "signature": "#define Q2G_FB_H"}, {"kind": "macro", "line": 78, "name": "Q2G_BACKBUF", "signature": "#define Q2G_BACKBUF"}]}, {"doc": "snddma_minios.c - Quake 2 DMA sound backend over the MiniOS pcm2 path.", "id": "progs/quake2generic/snddma_minios.c", "kind": "module", "label": "snddma_minios.c", "language": "c", "sha256": "703ada9edbf18f75", "symbol_count": 16, "symbols": [{"kind": "function", "line": 67, "name": "sys_pcm2_open", "signature": "static long sys_pcm2_open(long flags)"}, {"kind": "function", "line": 75, "name": "sys_pcm2_write", "signature": "static long sys_pcm2_write(const void *buf, long len)"}, {"kind": "function", "line": 83, "name": "sys_pcm2_close", "signature": "static void sys_pcm2_close(void)"}, {"kind": "function", "line": 89, "name": "sys_time_ms", "signature": "static long sys_time_ms(void)"}, {"doc": "Push the freshly painted range [q2_dma_written, end) in ring order with NONBLOCK writes that take what the kernel ring has room for. The mixer ring is 16-bit mono; each frame is downconverted to 8-bit unsigned for pcm2 in bounded sub-chunks. A short count is not loss: the frames wait in dma.buffer (the engine only wraps far behind the paint lead) and go out on the next Submit. Returns the number of frames handed to the * device.", "kind": "function", "line": 104, "name": "q2_dma_push", "signature": "static int q2_dma_push(int end)"}, {"kind": "function", "line": 138, "name": "SNDDMA_Init", "signature": "qboolean SNDDMA_Init(void)"}, {"kind": "function", "line": 182, "name": "SNDDMA_GetDMAPos", "signature": "int SNDDMA_GetDMAPos(void)"}, {"kind": "function", "line": 190, "name": "SNDDMA_Shutdown", "signature": "void SNDDMA_Shutdown(void)"}, {"kind": "function", "line": 202, "name": "SNDDMA_BeginPainting", "signature": "void SNDDMA_BeginPainting(void)"}, {"kind": "function", "line": 205, "name": "SNDDMA_Submit", "signature": "void SNDDMA_Submit(void)"}, {"doc": "Headless plumbing probe (BDD hook): open pcm2, stream one pattern, close, report. Needs no game data, so it runs on a bare boot with the SB16 attached and is the serial proof that the Quake 2 backend reaches the * low-latency path.", "kind": "function", "line": 222, "name": "q2snd_probe", "signature": "int q2snd_probe(void)"}, {"kind": "macro", "line": 48, "name": "Q2SND_RATE", "signature": "#define Q2SND_RATE"}, {"kind": "macro", "line": 49, "name": "Q2SND_SAMPLES", "signature": "#define Q2SND_SAMPLES"}, {"kind": "macro", "line": 50, "name": "Q2SND_SILENCE", "signature": "#define Q2SND_SILENCE"}, {"kind": "macro", "line": 54, "name": "Q2SND_AHEAD", "signature": "#define Q2SND_AHEAD"}, {"kind": "macro", "line": 56, "name": "Q2SND_BUF_BYTES", "signature": "#define Q2SND_BUF_BYTES"}]}, {"doc": "aes.c - command path AES-256-CTR encryption tools: aes and unaes.", "id": "progs/src/aes.c", "kind": "module", "label": "aes.c", "language": "c", "sha256": "29b864f193679ecc", "symbol_count": 54, "symbols": [{"kind": "function", "line": 69, "name": "aes_read_all", "signature": "static char *aes_read_all(const char *name, int *len)"}, {"kind": "function", "line": 86, "name": "aes_write_all", "signature": "static int aes_write_all(const char *name, char *data, int len)"}, {"kind": "function", "line": 96, "name": "aes_has", "signature": "static int aes_has(const char *s, const char *needle)"}, {"kind": "function", "line": 110, "name": "hex_val", "signature": "static int hex_val(int c)"}, {"kind": "function", "line": 117, "name": "aes_parse_hex", "signature": "static int aes_parse_hex(const char *s, int want, int *out)"}, {"doc": "static int aes_parse_hex(const char *s, int want, int *out) { int i, hi, lo; if ((int)strlen(s) != want) return 0; for (i = 0; i < want; i += 2) { hi = hex_val(s[i]); lo = hex_val(s[i + 1]); if (hi < 0 || lo < 0) return 0; out[i / 2] = hi * 16 + lo; } return 1; } /* Multiply in GF(2^8) modulo the AES polynomial; both operands are 0..255.", "kind": "function", "line": 130, "name": "aes_gf_mul", "signature": "static int aes_gf_mul(int a, int b)"}, {"kind": "function", "line": 142, "name": "aes_xtime", "signature": "static int aes_xtime(int x)"}, {"kind": "function", "line": 148, "name": "aes_rotl8", "signature": "static int aes_rotl8(int x, int n)"}, {"doc": "Build the S-box from first principles: multiplicative inverse in GF(2^8) composed with the FIPS-197 affine transform.  Zero maps straight to the * affine constant because 0 has no inverse.", "kind": "function", "line": 155, "name": "aes_init_tables", "signature": "static void aes_init_tables(void)"}, {"doc": "Expand the 32-byte key into AES_RK_LEN round-key bytes (FIPS-197 for Nk=8, Nr=14: RotWord plus SubWord every Nk words, an extra SubWord pass * every Nk/2 words).", "kind": "function", "line": 174, "name": "aes_key_expand", "signature": "static void aes_key_expand(const int *key)"}, {"kind": "function", "line": 209, "name": "aes_add_round_key", "signature": "static void aes_add_round_key(int round)"}, {"kind": "function", "line": 215, "name": "aes_sub_bytes", "signature": "static void aes_sub_bytes(void)"}, {"kind": "function", "line": 220, "name": "aes_shift_rows", "signature": "static void aes_shift_rows(void)"}, {"kind": "function", "line": 228, "name": "aes_mix_columns", "signature": "static void aes_mix_columns(void)"}, {"kind": "function", "line": 248, "name": "aes_cipher", "signature": "static void aes_cipher(void)"}, {"doc": "int r; aes_add_round_key(0); for (r = 1; r < AES_ROUNDS; r++) { aes_sub_bytes(); aes_shift_rows(); aes_mix_columns(); aes_add_round_key(r); } aes_sub_bytes(); aes_shift_rows(); aes_add_round_key(AES_ROUNDS); } /* Big-endian increment of the whole counter block (SP 800-38A CTR).", "kind": "function", "line": 263, "name": "aes_iv_increment", "signature": "static void aes_iv_increment(void)"}, {"doc": "aes_add_round_key(AES_ROUNDS); } /* Big-endian increment of the whole counter block (SP 800-38A CTR). static void aes_iv_increment(void) { int b; for (b = AES_BLOCK - 1; b >= 0; b--) { aes_iv[b] = aes_iv[b] + 1; if (aes_iv[b] <= 255) break; aes_iv[b] = 0; } } /* XOR data in place with the keystream Cipher(nonce), Cipher(nonce+1)...", "kind": "function", "line": 273, "name": "aes_ctr_crypt", "signature": "static void aes_ctr_crypt(char *data, int len)"}, {"kind": "function", "line": 288, "name": "aes_hdr_put", "signature": "static void aes_hdr_put(char *h, int size)"}, {"kind": "function", "line": 299, "name": "aes_hdr_get", "signature": "static int aes_hdr_get(char *h)"}, {"kind": "function", "line": 307, "name": "aes_tool_name", "signature": "static const char *aes_tool_name(int decode)"}, {"kind": "function", "line": 312, "name": "aes_run", "signature": "static int aes_run(int decode, const char *keyhex, const char *noncehex,\n                   const..."}, {"kind": "function", "line": 384, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 8, "name": "GF", "signature": "* generated procedurally from the GF(2^8) multiplicative inverse plus the * FIPS-197 affine transform, so the file carries no magic tables. The mode * is CTR (NIST SP 800-38A): no padding, encrypt and"}, {"kind": "function", "line": 25, "name": "putchar", "signature": "int putchar();"}, {"kind": "function", "line": 26, "name": "strcmp", "signature": "int strcmp();"}, {"kind": "function", "line": 27, "name": "strlen", "signature": "int strlen();"}, {"kind": "function", "line": 28, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 29, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 30, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 31, "name": "fwrite", "signature": "int fwrite();"}, {"kind": "function", "line": 32, "name": "fseek", "signature": "int fseek();"}, {"kind": "function", "line": 33, "name": "ftell", "signature": "int ftell();"}, {"kind": "function", "line": 34, "name": "rewind", "signature": "void rewind();"}, {"kind": "function", "line": 35, "name": "malloc", "signature": "void *malloc();"}, {"kind": "function", "line": 36, "name": "free", "signature": "void free();"}, {"kind": "macro", "line": 38, "name": "AES_MAGIC0", "signature": "#define AES_MAGIC0"}, {"kind": "macro", "line": 39, "name": "AES_MAGIC1", "signature": "#define AES_MAGIC1"}, {"kind": "macro", "line": 40, "name": "AES_MAGIC2", "signature": "#define AES_MAGIC2"}, {"kind": "macro", "line": 41, "name": "AES_MAGIC3", "signature": "#define AES_MAGIC3"}, {"kind": "macro", "line": 42, "name": "AES_HDR_SIZE", "signature": "#define AES_HDR_SIZE"}, {"kind": "macro", "line": 44, "name": "AES_BLOCK", "signature": "#define AES_BLOCK"}, {"kind": "macro", "line": 45, "name": "AES_KEY_BYTES", "signature": "#define AES_KEY_BYTES"}, {"kind": "macro", "line": 46, "name": "AES_NONCE_BYTES", "signature": "#define AES_NONCE_BYTES"}, {"kind": "macro", "line": 47, "name": "AES_ROUNDS", "signature": "#define AES_ROUNDS"}, {"kind": "macro", "line": 48, "name": "AES_RK_LEN", "signature": "#define AES_RK_LEN"}, {"kind": "macro", "line": 49, "name": "AES_SBOX_SIZE", "signature": "#define AES_SBOX_SIZE"}, {"kind": "macro", "line": 50, "name": "AES_RCON_SIZE", "signature": "#define AES_RCON_SIZE"}, {"kind": "macro", "line": 52, "name": "AES_POLY", "signature": "#define AES_POLY"}, {"kind": "macro", "line": 53, "name": "AES_AFFINE_C", "signature": "#define AES_AFFINE_C"}, {"kind": "macro", "line": 54, "name": "AES_RCON_PAD", "signature": "#define AES_RCON_PAD"}, {"kind": "macro", "line": 56, "name": "HEX_KEY_LEN", "signature": "#define HEX_KEY_LEN"}, {"kind": "macro", "line": 57, "name": "HEX_NONCE_LEN", "signature": "#define HEX_NONCE_LEN"}, {"kind": "macro", "line": 59, "name": "AES_SEEK_END", "signature": "#define AES_SEEK_END"}, {"kind": "macro", "line": 61, "name": "AES_EXIT_FAIL", "signature": "#define AES_EXIT_FAIL"}]}, {"doc": "apsse.c - SSE in glibc threads on every CPU (docs/spec/smp-sched.md,", "id": "progs/src/apsse.c", "kind": "module", "label": "apsse.c", "language": "c", "sha256": "a7e9a64f868252fb", "symbol_count": 15, "symbols": [{"kind": "struct", "line": 42, "name": "apsse_job"}, {"doc": "SSE2 integer lanes, a double accumulator and an SSE2 memchr per round; the folded value depends on every lane, so a corrupted XMM register * changes it.", "kind": "function", "line": 49, "name": "apsse_grind", "signature": "static uint64_t apsse_grind(int id)"}, {"kind": "function", "line": 75, "name": "apsse_worker", "signature": "static void *apsse_worker(void *arg)"}, {"kind": "function", "line": 81, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 23, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 31, "name": "APSSE_THREADS", "signature": "#define APSSE_THREADS"}, {"kind": "macro", "line": 32, "name": "APSSE_ROUNDS", "signature": "#define APSSE_ROUNDS"}, {"kind": "macro", "line": 33, "name": "APSSE_SEED", "signature": "#define APSSE_SEED"}, {"kind": "macro", "line": 34, "name": "APSSE_BUF", "signature": "#define APSSE_BUF"}, {"kind": "macro", "line": 35, "name": "APSSE_NEEDLE", "signature": "#define APSSE_NEEDLE"}, {"kind": "macro", "line": 36, "name": "APSSE_MAP_ROUNDS", "signature": "#define APSSE_MAP_ROUNDS"}, {"kind": "macro", "line": 37, "name": "APSSE_MAP_BYTES", "signature": "#define APSSE_MAP_BYTES"}, {"kind": "macro", "line": 38, "name": "APSSE_MAP_FILL", "signature": "#define APSSE_MAP_FILL"}, {"kind": "macro", "line": 39, "name": "APSSE_OK", "signature": "#define APSSE_OK"}, {"kind": "macro", "line": 40, "name": "APSSE_BAD", "signature": "#define APSSE_BAD"}]}, {"doc": "aslr -- userspace ASLR probe (self-exec chain).", "id": "progs/src/aslr.c", "kind": "module", "label": "aslr.c", "language": "c", "sha256": "7258c2a17980dcd9", "symbol_count": 10, "symbols": [{"doc": "aslr -- userspace ASLR probe (self-exec chain).  gen0 (no args) prints its stack pointer, brk and first-mmap address, then execve()s itself carrying those three values. gen1 compares its own addresses against the parent's: stack top slides per exec, brk starts past a random pad, the mmap cursor starts slid down. Any one dimension differing proves fresh entropy; identical triples mean the mixer is dead. Prints \"aslr: ok\" (exit 0) or \"aslr: SAME\" (exit 1). * Built as a static Linux ELF like execho.elf.", "kind": "function", "line": 10, "name": "as_sc", "signature": "static long as_sc(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 18, "name": "as_mmap", "signature": "static long as_mmap(void)"}, {"kind": "function", "line": 31, "name": "as_write", "signature": "static void as_write(const char *s, unsigned long len)"}, {"kind": "function", "line": 35, "name": "as_exit", "signature": "static void as_exit(long code)"}, {"kind": "function", "line": 40, "name": "as_execve", "signature": "static void as_execve(const char *path, const char **argv)"}, {"kind": "function", "line": 47, "name": "as_putu", "signature": "static void as_putu(unsigned long v)"}, {"kind": "function", "line": 59, "name": "as_atou", "signature": "static unsigned long as_atou(const char *s)"}, {"kind": "function", "line": 68, "name": "as_rsp", "signature": "static unsigned long as_rsp(void)"}, {"kind": "function", "line": 74, "name": "as_fail", "signature": "static void as_fail(int step)"}, {"kind": "function", "line": 82, "name": "lmain", "signature": "int lmain(long argc, char **argv)"}]}, {"id": "progs/src/audio.c", "kind": "module", "label": "audio.c", "language": "c", "sha256": "ecb75e055301ddd8", "symbol_count": 17, "symbols": [{"kind": "function", "line": 3, "name": "syscall1", "signature": "static long syscall1(long n, long a1)"}, {"kind": "function", "line": 9, "name": "syscall2", "signature": "static long syscall2(long n, long a1, long a2)"}, {"kind": "function", "line": 15, "name": "syscall3", "signature": "static long syscall3(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 21, "name": "syscall0", "signature": "static long syscall0(long n)"}, {"kind": "function", "line": 27, "name": "audio_init", "signature": "int audio_init(void)"}, {"kind": "function", "line": 31, "name": "audio_tone", "signature": "void audio_tone(unsigned freq)"}, {"kind": "function", "line": 35, "name": "audio_pcm_open", "signature": "int audio_pcm_open(unsigned rate, unsigned channels, unsigned format)"}, {"kind": "function", "line": 40, "name": "audio_pcm_submit", "signature": "int audio_pcm_submit(const void *buf, unsigned len)"}, {"kind": "function", "line": 44, "name": "audio_pcm_pump", "signature": "void audio_pcm_pump(void)"}, {"kind": "function", "line": 48, "name": "audio_pcm_close", "signature": "void audio_pcm_close(void)"}, {"kind": "function", "line": 52, "name": "audio_set_volume", "signature": "void audio_set_volume(unsigned volume)"}, {"kind": "function", "line": 56, "name": "audio_get_volume", "signature": "unsigned audio_get_volume(void)"}, {"kind": "function", "line": 60, "name": "audio_sb16_present", "signature": "int audio_sb16_present(void)"}, {"kind": "function", "line": 64, "name": "audio_stream_open", "signature": "int audio_stream_open(void)"}, {"kind": "function", "line": 68, "name": "audio_stream_close", "signature": "void audio_stream_close(int id)"}, {"kind": "function", "line": 72, "name": "audio_stream_submit", "signature": "int audio_stream_submit(int id, const void *buf, unsigned len)"}, {"kind": "function", "line": 76, "name": "audio_stream_volume", "signature": "void audio_stream_volume(int id, unsigned char vol)"}]}, {"doc": "burn -- SMP mixed-workload probe: brk plus mmap plus CPU burn with", "id": "progs/src/burn.c", "kind": "module", "label": "burn.c", "language": "c", "sha256": "d9445b730dbdd5a1", "symbol_count": 7, "symbols": [{"doc": "burn -- SMP mixed-workload probe: brk plus mmap plus CPU burn with a deterministic checksum. Concurrent isolated copies must all print the same sum and exit 0; a corrupted brk view, an aliased mmap or a torn page changes the sum or faults before it prints. Built as a * static Linux ELF like aslr.elf.", "kind": "function", "line": 6, "name": "bn_sc", "signature": "static long bn_sc(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 14, "name": "bn_mmap", "signature": "static long bn_mmap(unsigned long len)"}, {"kind": "function", "line": 27, "name": "bn_write", "signature": "static void bn_write(const char *s, unsigned long len)"}, {"kind": "function", "line": 31, "name": "bn_exit", "signature": "static void bn_exit(long code)"}, {"kind": "function", "line": 36, "name": "bn_putu", "signature": "static void bn_putu(unsigned long v)"}, {"kind": "function", "line": 48, "name": "bn_fail", "signature": "static void bn_fail(void)"}, {"kind": "function", "line": 53, "name": "lmain", "signature": "int lmain(void)"}]}, {"id": "progs/src/cp.c", "kind": "module", "label": "cp.c", "language": "c", "sha256": "acc13c6f9b324af7", "symbol_count": 8, "symbols": [{"kind": "function", "line": 10, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 1, "name": "printf", "signature": "int printf();"}, {"kind": "function", "line": 2, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 3, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 4, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 5, "name": "fwrite", "signature": "int fwrite();"}, {"kind": "macro", "line": 7, "name": "CP_BUF_SIZE", "signature": "#define CP_BUF_SIZE"}, {"kind": "macro", "line": 8, "name": "CP_EXIT_FAIL", "signature": "#define CP_EXIT_FAIL"}]}, {"doc": "Ring-3 privilege probe. Reads the CS selector at runtime and exits with", "id": "progs/src/cpl.c", "kind": "module", "label": "cpl.c", "language": "c", "sha256": "9790692541f70cba", "symbol_count": 3, "symbols": [{"doc": "Ring-3 privilege probe. Reads the CS selector at runtime and exits with the CPL it is executing at. Under the isolation contract a Linux ELF runs at ring 3, so CS is the user code selector (0x23) and the exit code is 3; a regression to ring-0 execution would report 0. Built as a * static Linux ELF like lxhello.elf and run through the syscall ABI.", "kind": "function", "line": 6, "name": "read_cpl", "signature": "static long read_cpl(void)"}, {"kind": "function", "line": 12, "name": "exit_now", "signature": "static void exit_now(long code)"}, {"kind": "function", "line": 16, "name": "_start", "signature": "void _start(void)"}]}, {"doc": "cvmfmt.c - CVM formatting probe.", "id": "progs/src/cvmfmt.c", "kind": "module", "label": "cvmfmt.c", "language": "c", "sha256": "5f71cbe6005b43f2", "symbol_count": 1, "symbols": [{"kind": "function", "line": 19, "name": "main", "signature": "int main(void)"}]}, {"doc": "execho -- fork(57) + execve(59) + wait4(61) probe.", "id": "progs/src/execho.c", "kind": "module", "label": "execho.c", "language": "c", "sha256": "c5110ee3f7a61bf9", "symbol_count": 6, "symbols": [{"kind": "function", "line": 7, "name": "path", "signature": "* execs a ghost path (must fail -2, exits 42). The parent checks\n * both wait4 results with Linux..."}, {"kind": "function", "line": 20, "name": "ex_write", "signature": "static void ex_write(const char *s, unsigned long len)"}, {"kind": "function", "line": 24, "name": "ex_exit", "signature": "static void ex_exit(long code)"}, {"kind": "function", "line": 29, "name": "ex_fail", "signature": "static void ex_fail(int step)"}, {"kind": "function", "line": 37, "name": "lmain", "signature": "int lmain(void)"}, {"kind": "function", "line": 5, "name": "program", "signature": "* * Proves the UNIX process composition the kernel lacked: a child * produced by fork replaces its image with execve and the parent * reaps the REPLACED program (not a clone). First child execs * bin/"}]}, {"doc": "execthr -- execve kills sibling threads (Linux semantics).", "id": "progs/src/execthr.c", "kind": "module", "label": "execthr.c", "language": "c", "sha256": "1a5af16ded04c312", "symbol_count": 4, "symbols": [{"doc": "execthr -- execve kills sibling threads (Linux semantics).  Main spawns one thread that spins forever, then execve()s bin/lxhello.elf. The thread must die with the old image: lxhello prints Hello and exits 2, mrun reports it, and no fault or hang follows. A kernel that frees the old window under the live thread faults or wedges instead. The dead thread stays a zombie of the exec'd program (no reparenting in v1), so each run costs one proc slot; test-only, never a server pattern. Built as a static Linux * ELF like execho.elf.", "kind": "function", "line": 11, "name": "et_sc", "signature": "static long et_sc(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 19, "name": "et_exit", "signature": "static void et_exit(long code)"}, {"kind": "function", "line": 27, "name": "et_thread", "signature": "static void et_thread(void)"}, {"kind": "function", "line": 33, "name": "lmain", "signature": "int lmain(void)"}]}, {"id": "progs/src/fib.c", "kind": "module", "label": "fib.c", "language": "c", "sha256": "6d8b63c30e4febf7", "symbol_count": 2, "symbols": [{"kind": "function", "line": 1, "name": "fib", "signature": "int fib(int n)"}, {"kind": "function", "line": 6, "name": "main", "signature": "int main(void)"}]}, {"id": "progs/src/forktest.c", "kind": "module", "label": "forktest.c", "language": "c", "sha256": "eacc6b67d2e8e38d", "symbol_count": 14, "symbols": [{"kind": "function", "line": 17, "name": "fx_syscall6", "signature": "static long fx_syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)"}, {"kind": "function", "line": 41, "name": "fx_strlen", "signature": "static unsigned long fx_strlen(const char *s)"}, {"kind": "function", "line": 47, "name": "fx_write", "signature": "static void fx_write(const char *s)"}, {"kind": "function", "line": 51, "name": "fx_exit", "signature": "static void fx_exit(long code)"}, {"kind": "function", "line": 56, "name": "_start", "signature": "void _start(void)"}, {"kind": "function", "line": 115, "name": "this", "signature": "* this (and the child's closes must survive below). */ fx_syscall6(SYS_close, pfd[1], 0, 0, 0, 0, 0);"}, {"kind": "macro", "line": 30, "name": "SYS_read", "signature": "#define SYS_read"}, {"kind": "macro", "line": 31, "name": "SYS_write", "signature": "#define SYS_write"}, {"kind": "macro", "line": 32, "name": "SYS_close", "signature": "#define SYS_close"}, {"kind": "macro", "line": 33, "name": "SYS_pipe", "signature": "#define SYS_pipe"}, {"kind": "macro", "line": 34, "name": "SYS_yield", "signature": "#define SYS_yield"}, {"kind": "macro", "line": 35, "name": "SYS_fork", "signature": "#define SYS_fork"}, {"kind": "macro", "line": 36, "name": "SYS_exit", "signature": "#define SYS_exit"}, {"kind": "macro", "line": 37, "name": "SYS_wait4", "signature": "#define SYS_wait4"}]}, {"doc": "fptest.c -- FPU/SSE context-switch probe (Phase 0.1, ADR-0014).", "id": "progs/src/fptest.c", "kind": "module", "label": "fptest.c", "language": "c", "sha256": "856a67729b21e6e0", "symbol_count": 9, "symbols": [{"kind": "struct", "line": 56, "name": "fp_slot_t"}, {"kind": "function", "line": 42, "name": "read_mxcsr", "signature": "static unsigned int read_mxcsr(void)"}, {"kind": "function", "line": 48, "name": "raw_gettid", "signature": "static long raw_gettid(void)"}, {"kind": "function", "line": 52, "name": "raw_getrandom", "signature": "static long raw_getrandom(void *buf, unsigned long n)"}, {"doc": "Stack-alignment canary: an aligned SSE store to a stack slot faults with #GP unless the thread entry stack satisfies SysV (rsp%16==8 at entry, 16-aligned after the call prologue). Compiler spills would only sometimes touch the misaligned area; this faults deterministically. A fault kills the worker with -14, which the join * reports instead of a silent wrong answer.", "kind": "function", "line": 78, "name": "stack_align_canary", "signature": "static void stack_align_canary(void)"}, {"kind": "function", "line": 84, "name": "worker", "signature": "static void *worker(void *p)"}, {"kind": "function", "line": 148, "name": "main", "signature": "int main(void)"}, {"kind": "function", "line": 21, "name": "gettid", "signature": "* * The same run smokes gettid (Phase 0.4: the two workers must observe * distinct tids, never the constant 1) and getrandom (Phase 0.5: it * must fill the buffer and report the count, never EFAULT). "}, {"kind": "macro", "line": 38, "name": "FP_ITERS", "signature": "#define FP_ITERS"}]}, {"doc": "freedom - a headless text browser for MiniOS.", "id": "progs/src/freedom.c", "kind": "module", "label": "freedom.c", "language": "c", "sha256": "41a89b821464e203", "symbol_count": 61, "symbols": [{"doc": "Session-aware close (frees the TLS session for fd, no-op when none): every fetch path must use this, never raw close(), or the next fetch reuses the recycled fd number onto a live slot and its handshake fails with \"session already exists\" (redirects and linked stylesheets * hit this on their second fetch). void tls_close(int fd); #else int socket(int domain, int type, int proto); int connect(int fd, void *addr, int addrlen); int sendto(int fd, char *buf, int len, int flags, void *to, int tolen); int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen); int close(int fd); /* miniGCC twin: no TLS engine linked, so no session can exist.", "kind": "function", "line": 58, "name": "tls_close", "signature": "static int tls_close(int fd)"}, {"doc": "static char f_dom[FREEDOM_DOM_BUF]; static int  f_domlen; static char f_css[FREEDOM_CSS_BUF]; static int  f_csslen; static char f_linkhost[FREEDOM_CSS_MAX][64]; static char f_linkpath[FREEDOM_CSS_MAX][128]; static int  f_linkn; static int  f_cstage; static int  f_csize; static int  f_crem; static int  f_bdone; /* Decimal string to int (the ld stub set has no atol).", "kind": "function", "line": 151, "name": "atoi", "signature": "static int atoi(char *s)"}, {"doc": "Append src to dst at pos; returns the new length or -1 when it does not fit. A negative pos (a previous append in the chain failed) stays -1 without touching dst, so chained callers like classify_tag cannot * walk to dst-1.", "kind": "function", "line": 166, "name": "append", "signature": "static int append(char *dst, int pos, char *src, int cap)"}, {"kind": "function", "line": 176, "name": "ci_lower", "signature": "static int ci_lower(int c)"}, {"doc": "if (pos < 0) return -1; n = strlen(src); if (pos + n >= cap) return -1; memcpy(dst + pos, src, n); dst[pos + n] = 0; return pos + n; } static int ci_lower(int c) { if (c >= 'A' && c <= 'Z') return c + ('a' - 'A'); return c; } /* Case-insensitive starts-with.", "kind": "function", "line": 182, "name": "ci_starts", "signature": "static int ci_starts(char *s, char *pre)"}, {"doc": "} /* Case-insensitive starts-with. static int ci_starts(char *s, char *pre) { while (*pre) { if (!*s) return 0; if (ci_lower(*s) != ci_lower(*pre)) return 0; s++; pre++; } return 1; } /* Case-insensitive equality.", "kind": "function", "line": 193, "name": "ci_eq", "signature": "static int ci_eq(char *a, char *b)"}, {"doc": "return 1; } /* Case-insensitive equality. static int ci_eq(char *a, char *b) { while (*a && *b) { if (ci_lower(*a) != ci_lower(*b)) return 0; a++; b++; } return *a == 0 && *b == 0; } /* Case-insensitive index of needle in haystack, or -1.", "kind": "function", "line": 203, "name": "ci_index", "signature": "static int ci_index(char *s, char *needle)"}, {"doc": "} return *a == 0 && *b == 0; } /* Case-insensitive index of needle in haystack, or -1. static int ci_index(char *s, char *needle) { int i; for (i = 0; s[i]; i++) { if (ci_starts(s + i, needle)) return i; } return -1; } /* Does the input look like an URL (no spaces, contains a dot)?", "kind": "function", "line": 212, "name": "looks_like_url", "signature": "static int looks_like_url(char *s)"}, {"doc": "Does s begin with \"<scheme>:\" per RFC 3986 (ALPHA *(ALPHA/DIGIT/+/-/.) \":\")? Any such prefix makes the string a scheme, * and the omnibox policy is: only http:// and https:// are executed.", "kind": "function", "line": 226, "name": "has_scheme", "signature": "static int has_scheme(char *s)"}, {"doc": "char c; c = s[0]; if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))) return 0; for (i = 1; s[i]; i++) { c = s[i]; if (c == ':') return 1; if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '+' || c == '-' || c == '.')) return 0; } return 0; } /* Encode a query for the DuckDuckGo HTML endpoint (no-JS).", "kind": "function", "line": 242, "name": "make_search", "signature": "static void make_search(char *out, char *query, int cap)"}, {"doc": "Split an http:// or https:// URL into f_host, f_path, f_port and f_secure. Returns 0 on failure. The input buffer is never modified: the parse is index-only, so it stays valid when the compiler widens * dereferenced stores.", "kind": "function", "line": 266, "name": "split_url", "signature": "static int split_url(char *url)"}, {"doc": "Recompute f_host/f_path/f_port/f_secure from the last Location value. Returns 1 when the chase may continue, 0 when it must stop * (diagnostic already printed).", "kind": "function", "line": 313, "name": "resolve_redirect", "signature": "static int resolve_redirect(void)"}, {"kind": "function", "line": 366, "name": "put_ws", "signature": "static void put_ws(void)"}, {"doc": "Print one text byte through the UTF-8 gate. Remote pages are hostile data: bytes outside a valid UTF-8 sequence (overlong, surrogate, out of range) are replaced with '?' (FreeDom policy). * Sequence state is kept in f_utbuf/f_utlen/f_utrem.", "kind": "function", "line": 377, "name": "put_utf", "signature": "static void put_utf(int c)"}, {"doc": "Print one text byte: whitespace collapses, everything else goes * through the UTF-8 gate. Dump modes suppress the page text.", "kind": "function", "line": 427, "name": "put_text", "signature": "static void put_text(int c)"}, {"kind": "function", "line": 483, "name": "css_append", "signature": "static void css_append(char *s, int n)"}, {"kind": "function", "line": 489, "name": "css_line", "signature": "static void css_line(char *s)"}, {"kind": "function", "line": 494, "name": "dom_append", "signature": "static void dom_append(char *s, int n)"}, {"kind": "function", "line": 500, "name": "dom_space", "signature": "static void dom_space(void)"}, {"kind": "function", "line": 504, "name": "dom_nl", "signature": "static void dom_nl(void)"}, {"doc": "int i; for (i = 0; i < n && f_domlen < FREEDOM_DOM_BUF - 1; i++) f_dom[f_domlen++] = s[i]; } static void dom_space(void) { if (f_domlen < FREEDOM_DOM_BUF - 1) f_dom[f_domlen++] = ' '; } static void dom_nl(void) { if (f_domlen < FREEDOM_DOM_BUF - 1) f_dom[f_domlen++] = '\\n'; } /* Record the finished attribute in its place.", "kind": "function", "line": 509, "name": "record_attr", "signature": "static void record_attr(void)"}, {"doc": "f_hreflen = f_vallen < 127 ? f_vallen : 127; memcpy(f_href, f_val, f_hreflen); f_href[f_hreflen] = 0; } else if (ci_eq(f_attr, \"style\")) { f_stylelen = f_vallen < (FREEDOM_ATTR_MAX - 1) ? f_vallen : (FREEDOM_ATTR_MAX - 1); memcpy(f_styleattr, f_val, f_stylelen); f_styleattr[f_stylelen] = 0; } else if (ci_eq(f_attr, \"rel\")) { f_rel_ss = ci_index(f_val, \"stylesheet\") >= 0; } } /* Is tagname a void element (no closing tag, no children)?", "kind": "function", "line": 534, "name": "is_void_tag", "signature": "static int is_void_tag(void)"}, {"doc": "A tag was fully collected into f_tagn (+ attributes). Decide what it * does to the stream and the dumps.", "kind": "function", "line": 546, "name": "classify_tag", "signature": "static void classify_tag(void)"}, {"doc": "} dom_nl(); if (!is_void_tag()) f_depth++; } if (ci_eq(f_tagn, \"br\") || ci_eq(f_tagn, \"p\") || ci_eq(f_tagn, \"div\") || ci_eq(f_tagn, \"h1\") || ci_eq(f_tagn, \"h2\") || ci_eq(f_tagn, \"h3\") || ci_eq(f_tagn, \"h4\") || ci_eq(f_tagn, \"h5\") || ci_eq(f_tagn, \"h6\") || ci_eq(f_tagn, \"li\") || ci_eq(f_tagn, \"tr\")) { if (f_mode == 0) putchar('\\n'); f_ws = 1; } } /* Feed one body byte into the filter.", "kind": "function", "line": 631, "name": "body_byte", "signature": "static void body_byte(int c)"}, {"doc": "f_rel_ss = 0; return; } if (c == '&') { f_entlen = 1; f_ent[0] = 0; return; } put_text(c); } /* --- HTTP ---------------------------------------------------------- /* Classify one header line (NUL-terminated).", "kind": "function", "line": 796, "name": "head_line", "signature": "static void head_line(char *line)"}, {"doc": "Parse the collected header block f_hdr[0..f_hlen-1] (the last four * bytes are the terminating CRLF CRLF).", "kind": "function", "line": 821, "name": "parse_head", "signature": "static void parse_head(void)"}, {"doc": "f_hdr[lend] = 0; if (i == 0) { char *sp; sp = strchr(f_hdr, ' '); if (sp) f_status = atoi(sp + 1); } else if (lend > i) { head_line(f_hdr + i); } f_hdr[lend] = '\\r'; i = lend + 2; } } /* Receive body bytes: TLS for f_secure, plain TCP otherwise.", "kind": "function", "line": 843, "name": "recv_body", "signature": "static int recv_body(int fd, char *buf, int len)"}, {"doc": "head_line(f_hdr + i); } f_hdr[lend] = '\\r'; i = lend + 2; } } /* Receive body bytes: TLS for f_secure, plain TCP otherwise. static int recv_body(int fd, char *buf, int len) { if (f_secure) return tls_recv(fd, buf, len); return recvfrom(fd, buf, len, 0, 0, 0); } /* Send the whole request: TLS for f_secure, plain TCP otherwise.", "kind": "function", "line": 849, "name": "send_all", "signature": "static int send_all(int fd, char *buf, int len)"}, {"doc": "Send one HTTP request and process the response body. Returns the status code, or 0 on transport failure. Sets f_redir when a * Location header was seen.", "kind": "function", "line": 860, "name": "fetch", "signature": "static int fetch(char *host, char *path, int port)"}, {"doc": "Fetch a linked stylesheet and print its raw body (through the UTF-8 * gate). No redirect chasing: the bound is one request.", "kind": "function", "line": 1031, "name": "fetch_css", "signature": "static void fetch_css(char *host, char *path)"}, {"doc": "} continue; } f_ws = 0; put_utf(c); got++; } } tls_close(fd); putchar('\\n'); printf(\"freedom: %s (%d bytes)\\n\", host, got); } /* Print the collected CSS dump.", "kind": "function", "line": 1113, "name": "print_css_dump", "signature": "static void print_css_dump(void)"}, {"doc": "putchar('\\n'); printf(\"freedom: %s (%d bytes)\\n\", host, got); } /* Print the collected CSS dump. static void print_css_dump(void) { int i; puts(\"=== freedom css ===\"); for (i = 0; i < f_csslen; i++) put_utf(f_css[i]); if (f_csslen == 0) puts(\"(no css)\"); if (f_linkn > 0) putchar('\\n'); } /* Print the collected DOM outline.", "kind": "function", "line": 1122, "name": "print_dom_dump", "signature": "static void print_dom_dump(void)"}, {"kind": "function", "line": 1129, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 4, "name": "curlfree", "signature": "* spirit of curlfree (http.c + htmlfilter.c): a bounded header phase, * Content-Length or EOF body reading, Transfer-Encoding: chunked * decoding, redirect chasing with a hop bound, and a filter that "}, {"doc": "Ring-3 TLS build (phase 2 of docs/TLS_MIGRATION.md): host libc for sockets/stdio/strings (identical ABI numbers inside the guest); net_dns_resolve and tls_* link from the shared ring-3 TLS objects (progs/tls_u) instead of trapping kernel syscalls 200-203. stdlib.h * is deliberately absent: this file defines its own static atoi. include <stdio.h> include <string.h> include <unistd.h> include <sys/socket.h>", "kind": "function", "line": 41, "name": "net_dns_resolve", "signature": "int net_dns_resolve(const char *host);"}, {"kind": "function", "line": 42, "name": "tls_handshake", "signature": "int tls_handshake(int fd, char *host);"}, {"kind": "function", "line": 43, "name": "tls_send", "signature": "int tls_send(int fd, char *buf, int len);"}, {"kind": "function", "line": 44, "name": "tls_recv", "signature": "int tls_recv(int fd, char *buf, int len);"}, {"doc": "else", "kind": "function", "line": 52, "name": "socket", "signature": "int socket(int domain, int type, int proto);"}, {"kind": "function", "line": 53, "name": "connect", "signature": "int connect(int fd, void *addr, int addrlen);"}, {"kind": "function", "line": 54, "name": "sendto", "signature": "int sendto(int fd, char *buf, int len, int flags, void *to, int tolen);"}, {"kind": "function", "line": 55, "name": "recvfrom", "signature": "int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen);"}, {"kind": "function", "line": 56, "name": "close", "signature": "int close(int fd);"}, {"kind": "function", "line": 63, "name": "printf", "signature": "int printf(char *fmt, ...);"}, {"kind": "function", "line": 64, "name": "puts", "signature": "int puts(char *s);"}, {"kind": "function", "line": 65, "name": "strlen", "signature": "int strlen(char *s);"}, {"kind": "function", "line": 66, "name": "strchr", "signature": "char *strchr(char *s, int c);"}, {"kind": "function", "line": 67, "name": "strcmp", "signature": "int strcmp(char *a, char *b);"}, {"kind": "function", "line": 68, "name": "strncmp", "signature": "int strncmp(char *a, char *b, int n);"}, {"kind": "function", "line": 69, "name": "memcpy", "signature": "int memcpy(char *dst, char *src, int n);"}, {"kind": "function", "line": 70, "name": "memset", "signature": "int memset(char *dst, int c, int n);"}, {"kind": "function", "line": 71, "name": "putchar", "signature": "int putchar(int c);"}, {"kind": "macro", "line": 74, "name": "FREEDOM_HOPS_MAX", "signature": "#define FREEDOM_HOPS_MAX"}, {"kind": "macro", "line": 75, "name": "FREEDOM_HDR_MAX", "signature": "#define FREEDOM_HDR_MAX"}, {"kind": "macro", "line": 76, "name": "FREEDOM_BUF", "signature": "#define FREEDOM_BUF"}, {"kind": "macro", "line": 77, "name": "FREEDOM_CHUNK_MAX", "signature": "#define FREEDOM_CHUNK_MAX"}, {"kind": "macro", "line": 78, "name": "FREEDOM_CSS_MAX", "signature": "#define FREEDOM_CSS_MAX"}, {"kind": "macro", "line": 79, "name": "FREEDOM_CSS_BUF", "signature": "#define FREEDOM_CSS_BUF"}, {"kind": "macro", "line": 80, "name": "FREEDOM_DOM_BUF", "signature": "#define FREEDOM_DOM_BUF"}, {"kind": "macro", "line": 81, "name": "FREEDOM_ATTR_MAX", "signature": "#define FREEDOM_ATTR_MAX"}, {"kind": "macro", "line": 82, "name": "FREEDOM_LINE_MAX", "signature": "#define FREEDOM_LINE_MAX"}]}, {"doc": "freedom_wl - Wayland to MiniOS intermediate layer for FreeDom.", "id": "progs/src/freedom_wl.c", "kind": "module", "label": "freedom_wl.c", "language": "c", "sha256": "c0e8f3a4a7d9e919", "symbol_count": 62, "symbols": [{"doc": "#define WL_FONT_W 8L #define WL_FONT_H 8L #define WL_TAG_MAX 16L #define WL_ENT_MAX 10L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Well-known network endpoints. static const char WL_SEARCH_HOST[] = \"html.duckduckgo.com\"; static const char WL_SEARCH_PREFIX[] = \"/html/?q=\"; static const char WL_USER_AGENT[] = \"freedom_wl/1.0 (MiniOS)\"; /** Centralized configuration for the Wayland to MiniOS mapping.", "kind": "struct", "line": 76, "name": "FreedomWlConfig"}, {"doc": "#define WL_FONT_W 8L #define WL_FONT_H 8L #define WL_TAG_MAX 16L #define WL_ENT_MAX 10L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Well-known network endpoints. static const char WL_SEARCH_HOST[] = \"html.duckduckgo.com\"; static const char WL_SEARCH_PREFIX[] = \"/html/?q=\"; static const char WL_USER_AGENT[] = \"freedom_wl/1.0 (MiniOS)\"; /** Centralized configuration for the Wayland to MiniOS mapping.", "kind": "type_alias", "line": 76, "name": "present_buf", "signature": "typedef struct FreedomWlConfig { long present_buf;"}, {"doc": "Logical Wayland-mini surface id for this client (ADR-0024). The present path still uses GFX_PRESENT BUF_NK; the id names the * client side of the wlcomp mapping and is bounds-checked.", "kind": "function", "line": 114, "name": "freedom_wl_surface_id", "signature": "static long freedom_wl_surface_id(void)"}, {"doc": "Attach this client to the wlcomp mapping: encode an attach message for the first pool and a commit for our surface, decode both back and require the roundtrip. The present path is unchanged; this call * proves the client speaks the wire before it ever draws.", "kind": "function", "line": 129, "name": "freedom_wl_surface_attach", "signature": "static long freedom_wl_surface_attach(FreedomWlConfig *c)"}, {"doc": "if (pool != WL_ID_POOL_BASE || w != (int)c->surface_w || h != (int)c->surface_h) return -1L; n = wl_commit_encode(msg, WL_MAX_MSG, (unsigned int)c->wl_surface); if (n != WL_COMMIT_SZ) return -1L; if (wl_commit_decode(msg, n, &id) != WL_ERR_OK) return -1L; if (id != (unsigned int)c->wl_surface) return -1L; return 0L; } /** Default configuration derived from the ABI header.", "kind": "function", "line": 158, "name": "freedom_wl_default", "signature": "static FreedomWlConfig freedom_wl_default(void)"}, {"doc": "c.hops_max = WL_HOPS_MAX; c.font_w = WL_FONT_W; c.font_h = WL_FONT_H; c.port_http = 80L; c.port_https = 443L; c.ink_bg = (long)COL_TERMINAL; c.ink_fg = (long)COL_TERM_TXT; c.bar_bg = (long)COL_TITLEBAR; c.bar_fg = (long)COL_TITLE_TXT; c.wl_surface = freedom_wl_surface_id(); return c; } /** Clamp a dirty rect into the surface bounds.", "kind": "function", "line": 196, "name": "freedom_wl_clip_rect", "signature": "static long freedom_wl_clip_rect(FreedomWlConfig *c, long *x, long *y, long *w, long *h)"}, {"doc": "} if (*x + *w > c->surface_w) { w = c->surface_w - *x; } if (*y + *h > c->surface_h) { h = c->surface_h - *y; } if (*w <= 0L || *h <= 0L) { return -1L; } return 0L; } /** Expected byte size of the shared-memory frame for given geometry.", "kind": "function", "line": 227, "name": "freedom_wl_frame_bytes", "signature": "static long freedom_wl_frame_bytes(FreedomWlConfig *c, long w, long h)"}, {"doc": "if (w <= 0L || h <= 0L) { return -1L; } if (w > c->surface_w || h > c->surface_h) { return -1L; } bytes_per_pixel = 1L; if (w > 0x7FFFFFFFL / (h * bytes_per_pixel)) { return -1L; } return w * h * bytes_per_pixel; } /** Translate a PS/2 Set 1 scancode base into a keysym.", "kind": "function", "line": 246, "name": "freedom_wl_keysym", "signature": "static long freedom_wl_keysym(FreedomWlConfig *c, long sc)"}, {"doc": "} if (make == 0x39L) { return 32L; } if (make == 0x0EL) { return 8L; } if (make == 0x0FL) { return 9L; } return -1L; } /** Rewrite a buffer in place to well-formed UTF-8.", "kind": "function", "line": 286, "name": "freedom_wl_sanitize_utf8", "signature": "static long freedom_wl_sanitize_utf8(char *s, long cap)"}, {"doc": "i++; } if (o >= cap - 1L) { break; } } if (o >= cap) { return -1L; } s[o] = 0; return o; } /** Validate a window title against the kernel title bound.", "kind": "function", "line": 359, "name": "freedom_wl_title_ok", "signature": "static long freedom_wl_title_ok(FreedomWlConfig *c, char *t, long n)"}, {"doc": "} /** Validate a window title against the kernel title bound. static long freedom_wl_title_ok(FreedomWlConfig *c, char *t, long n) { if (!c || !t) { return -1L; } if (n < 0L || n > c->title_max) { return -1L; } return 0L; } /** Bounded string copy with NUL termination.", "kind": "function", "line": 370, "name": "wl_copy", "signature": "static long wl_copy(char *dst, char *src, long cap)"}, {"doc": "} i = 0L; while (src[i] != 0) { if (i + 1L >= cap) { return -1L; } dst[i] = src[i]; i++; } dst[i] = 0; return 0L; } /** Bounded string length.", "kind": "function", "line": 388, "name": "wl_strlen", "signature": "static long wl_strlen(char *s, long cap)"}, {"doc": "if (!s || cap <= 0L) { return -1L; } i = 0L; while (i < cap && s[i] != 0) { i++; } if (i >= cap) { return -1L; } return i; } /** Bounded append of src at dst[pos].", "kind": "function", "line": 404, "name": "wl_append", "signature": "static long wl_append(char *dst, long pos, char *src, long cap)"}, {"doc": "} if (pos + n >= cap) { return -1L; } i = 0L; while (i < n) { dst[pos + i] = src[i]; i++; } dst[pos + n] = 0; return pos + n; } /** ASCII lowercase fold.", "kind": "function", "line": 427, "name": "wl_ci_lower", "signature": "static long wl_ci_lower(long ch)"}, {"doc": "} dst[pos + n] = 0; return pos + n; } /** ASCII lowercase fold. static long wl_ci_lower(long ch) { if (ch >= 'A' && ch <= 'Z') { return ch + ('a' - 'A'); } return ch; } /** Case-insensitive prefix match.", "kind": "function", "line": 435, "name": "wl_ci_starts", "signature": "static long wl_ci_starts(char *s, char *pre)"}, {"doc": "while (*pre) { if (*s == 0) { return 0L; } if (wl_ci_lower(*s) != wl_ci_lower(*pre)) { return 0L; } s++; pre++; } return 1L; } /** Case-insensitive substring search.", "kind": "function", "line": 453, "name": "wl_ci_contains", "signature": "static long wl_ci_contains(char *s, char *needle)"}, {"doc": "static long wl_ci_contains(char *s, char *needle) { if (!s || !needle) { return 0L; } while (*s) { if (wl_ci_starts(s, needle)) { return 1L; } s++; } return 0L; } /** RFC 3986 scheme probe: ALPHA *(ALPHA/DIGIT/+/-/.) then colon.", "kind": "function", "line": 467, "name": "wl_has_scheme", "signature": "static long wl_has_scheme(char *s)"}, {"doc": "ch = s[i]; if (ch == ':') { return 1L; } if (!((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.')) { return 0L; } i++; } return 0L; } /** Omnibox URL probe: no spaces and at least one dot.", "kind": "function", "line": 493, "name": "wl_looks_like_url", "signature": "static long wl_looks_like_url(char *s)"}, {"doc": "dot = 0L; while (*s) { if (*s == ' ' || *s == '\\t') { return 0L; } if (*s == '.') { dot = 1L; } s++; } return dot; } /** Encode a query for the no-JS search endpoint.", "kind": "function", "line": 512, "name": "wl_make_search", "signature": "static long wl_make_search(char *out, char *query, long cap)"}, {"doc": "} else { out[pos] = *query; pos++; out[pos] = 0; } if (pos < 0L) { return -1L; } query++; } return pos; } /** Split an http(s) URL into host, path, port and secure flag.", "kind": "function", "line": 544, "name": "wl_split_url", "signature": "static long wl_split_url(FreedomWlConfig *c, char *url, char *host, char *path, long *port, long ..."}, {"doc": "if (plen < 0L) { return 0L; } if (wl_copy(path, p + hl, c->path_max) < 0L) { return 0L; } } else { path[0] = '/'; path[1] = 0; } return 1L; } /** Recompute host/path/port/secure from a Location value.", "kind": "function", "line": 609, "name": "wl_resolve_redirect", "signature": "static long wl_resolve_redirect(FreedomWlConfig *c, char *loc, long secure, char *host, char *pat..."}, {"doc": "if (last + 1L + l >= c->path_max) { return 0L; } i = 0L; while (i < l) { path[last + 1L + i] = loc[i]; i++; } path[last + 1L + l] = 0; } return 1L; } /** Clamp a scroll offset into the page range.", "kind": "function", "line": 689, "name": "wl_scroll_clamp", "signature": "static long wl_scroll_clamp(FreedomWlConfig *c, long off, long nlines)"}, {"doc": "if (nlines <= c->text_rows) { return 0L; } maxoff = nlines - c->text_rows; if (off < 0L) { return 0L; } if (off > maxoff) { return maxoff; } return off; } /** HTML to wrapped text lines over a flat line array.", "kind": "function", "line": 708, "name": "wl_filter_wrap", "signature": "static long wl_filter_wrap(FreedomWlConfig *c, char *body, long n, char *lines, long maxlines, lo..."}, {"doc": "lines[li * linelen + co] = (char)ch; co++; lines[li * linelen + co] = 0; } if (co > 0L) { return li + 1L; } if (li == 0L) { return 1L; } return li; } /** Compose the status bar line for the bottom row.", "kind": "function", "line": 951, "name": "wl_status_text", "signature": "static long wl_status_text(FreedomWlConfig *c, char *host, long nbytes, long off, long nlines, ch..."}, {"doc": "Shared hybrid palette, one table for every NK-window app (progs/nk_palette.h); this wrapper keeps the historic name and * fail-closed contract the host suite pins.", "kind": "function", "line": 1039, "name": "freedom_wl_build_palette", "signature": "static long freedom_wl_build_palette(unsigned char *pal, long cap)"}, {"doc": "static char w_host[WL_HOST_MAX]; static char w_path[WL_PATH_MAX]; static char w_loc[WL_URL_MAX]; static char w_hdr[WL_HDR_MAX]; static char w_body[WL_BODY_CAP]; static char w_lines[WL_LINES_MAX][WL_LINE_LEN]; static long w_nlines; static long w_nbytes; static long w_secure; static long w_port; static long w_status; static long w_truncated; /** Present syscall wrapper for the NK buffer path.", "kind": "function", "line": 1062, "name": "freedom_wl_sys_present", "signature": "static long freedom_wl_sys_present(long buf, long origin)"}, {"doc": "static long w_nbytes; static long w_secure; static long w_port; static long w_status; static long w_truncated; /** Present syscall wrapper for the NK buffer path. static long freedom_wl_sys_present(long buf, long origin) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_PRESENT), \"D\"(buf), \"S\"(origin) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Set window title through the generic title syscall.", "kind": "function", "line": 1069, "name": "freedom_wl_sys_title", "signature": "static long freedom_wl_sys_title(char *t)"}, {"doc": "static long freedom_wl_sys_present(long buf, long origin) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_PRESENT), \"D\"(buf), \"S\"(origin) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Set window title through the generic title syscall. static long freedom_wl_sys_title(char *t) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_SET_TITLE), \"D\"(t) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels.", "kind": "function", "line": 1076, "name": "freedom_wl_sys_palette", "signature": "static long freedom_wl_sys_palette(unsigned char *pal)"}, {"doc": "static long freedom_wl_sys_title(char *t) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_SET_TITLE), \"D\"(t) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels. static long freedom_wl_sys_palette(unsigned char *pal) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_PALETTE), \"D\"(pal) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Read desktop mouse state into a four word buffer.", "kind": "function", "line": 1083, "name": "freedom_wl_sys_mouse", "signature": "static long freedom_wl_sys_mouse(long *m)"}, {"doc": "static long freedom_wl_sys_palette(unsigned char *pal) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_PALETTE), \"D\"(pal) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Read desktop mouse state into a four word buffer. static long freedom_wl_sys_mouse(long *m) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_MOUSE), \"D\"(m) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Poll one raw keyboard scancode, negative when idle.", "kind": "function", "line": 1090, "name": "freedom_wl_sys_kbd", "signature": "static long freedom_wl_sys_kbd(void)"}, {"doc": "static long freedom_wl_sys_mouse(long *m) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_MOUSE), \"D\"(m) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Poll one raw keyboard scancode, negative when idle. static long freedom_wl_sys_kbd(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD), \"D\"(0) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Tell the kernel a graphics program owns the display.", "kind": "function", "line": 1097, "name": "freedom_wl_sys_vga_mode", "signature": "static long freedom_wl_sys_vga_mode(long on)"}, {"doc": "static long freedom_wl_sys_kbd(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD), \"D\"(0) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Tell the kernel a graphics program owns the display. static long freedom_wl_sys_vga_mode(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_VGA_MODE), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Switch the console into raw scancode mode.", "kind": "function", "line": 1104, "name": "freedom_wl_sys_kbd_raw", "signature": "static long freedom_wl_sys_kbd_raw(long on)"}, {"doc": "static long freedom_wl_sys_vga_mode(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_VGA_MODE), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Switch the console into raw scancode mode. static long freedom_wl_sys_kbd_raw(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD_RAW), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Voluntary yield to the scheduler.", "kind": "function", "line": 1111, "name": "freedom_wl_sys_yield", "signature": "static long freedom_wl_sys_yield(void)"}, {"doc": "static long freedom_wl_sys_kbd_raw(long on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD_RAW), \"D\"(on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Voluntary yield to the scheduler. static long freedom_wl_sys_yield(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_SCHED_YIELD), \"D\"(0) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Parse response headers into status, length, encoding and routing.", "kind": "function", "line": 1118, "name": "wl_parse_headers", "signature": "static long wl_parse_headers(FreedomWlConfig *c, char *hdr, long *status, long *clen, long *hascl..."}, {"doc": "if (!wl_ci_starts(hdr + k, \"text\")) { istext = 0L; } } } line++; while (hdr[i] == '\\r' || hdr[i] == '\\n') { i++; } } return 0L; } /** Fetch one response body into the page buffer.", "kind": "function", "line": 1210, "name": "wl_fetch_raw", "signature": "static long wl_fetch_raw(FreedomWlConfig *c, char *host, char *path, long port, long secure)"}, {"doc": "if (got < c->body_cap) { w_body[got] = (char)ch; got++; } else { w_truncated = 1L; } } } } tls_close((int)fd); return got; } /** Render the page window at the given scroll offset.", "kind": "function", "line": 1445, "name": "wl_render", "signature": "static long wl_render(FreedomWlConfig *c, long off)"}, {"doc": "long ink; if (bits & (0x80 >> px)) { ink = c->bar_fg; } else { ink = c->bar_bg; } fb[(c->text_rows * c->font_h + row) * c->surface_w + col * c->font_w + px] = (unsigned char)ink; } } } return freedom_wl_sys_present(c->present_buf, 0L); } /** Interactive scroll loop until q or ESC quits.", "kind": "function", "line": 1532, "name": "wl_browse", "signature": "static long wl_browse(FreedomWlConfig *c)"}, {"doc": "off = off + (long)m[3] * c->scroll_step; changed = 1L; } if (changed) { off = wl_scroll_clamp(c, off, w_nlines); if (wl_render(c, off) < 0L) { return 1L; } } freedom_wl_sys_yield(); } } /** Guest selftest entry mirroring the Nuklear frame contract.", "kind": "function", "line": 1613, "name": "freedom_wl_selftest", "signature": "static long freedom_wl_selftest(void)"}, {"doc": "return 1L; } if (freedom_wl_sys_kbd() > 0x7FFFFFFFL) { printf(\"freedom_wl: kbd out of range\\n\"); return 1L; } freedom_wl_sys_title(\"FreeDom\"); printf(\"freedom_wl: frame ok (%ldx%ld)\\n\", c.surface_w, c.surface_h); return 0L; } #endif #ifdef FREEDOM_WL_HOST_TEST /** Host harness entry for the pure mapping logic.", "kind": "function", "line": 1696, "name": "freedom_wl_host_probe", "signature": "int freedom_wl_host_probe(FreedomWlConfig *c)"}, {"doc": "} buf[0] = 'h'; buf[1] = 'i'; buf[2] = 0; if (freedom_wl_sanitize_utf8(buf, 16L) != 2L) { return 1; } if (freedom_wl_surface_attach(c) != 0L) { return 1; } return 0; } #else /** Guest entry point shared by the MiniFS binary.", "kind": "function", "line": 1731, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 42, "name": "net_dns_resolve", "signature": "int net_dns_resolve(const char *host);"}, {"kind": "function", "line": 43, "name": "tls_handshake", "signature": "int tls_handshake(int fd, char *host);"}, {"kind": "function", "line": 44, "name": "tls_send", "signature": "int tls_send(int fd, char *buf, int len);"}, {"kind": "function", "line": 45, "name": "tls_recv", "signature": "int tls_recv(int fd, char *buf, int len);"}, {"kind": "function", "line": 46, "name": "tls_close", "signature": "void tls_close(int fd);"}, {"kind": "macro", "line": 49, "name": "WL_COLS", "signature": "#define WL_COLS"}, {"kind": "macro", "line": 50, "name": "WL_ROWS", "signature": "#define WL_ROWS"}, {"kind": "macro", "line": 51, "name": "WL_TEXT_ROWS", "signature": "#define WL_TEXT_ROWS"}, {"kind": "macro", "line": 52, "name": "WL_LINES_MAX", "signature": "#define WL_LINES_MAX"}, {"kind": "macro", "line": 53, "name": "WL_LINE_LEN", "signature": "#define WL_LINE_LEN"}, {"kind": "macro", "line": 54, "name": "WL_BODY_CAP", "signature": "#define WL_BODY_CAP"}, {"kind": "macro", "line": 55, "name": "WL_HDR_MAX", "signature": "#define WL_HDR_MAX"}, {"kind": "macro", "line": 56, "name": "WL_NET_BUF", "signature": "#define WL_NET_BUF"}, {"kind": "macro", "line": 57, "name": "WL_REQ_MAX", "signature": "#define WL_REQ_MAX"}, {"kind": "macro", "line": 58, "name": "WL_HOST_MAX", "signature": "#define WL_HOST_MAX"}, {"kind": "macro", "line": 59, "name": "WL_PATH_MAX", "signature": "#define WL_PATH_MAX"}, {"kind": "macro", "line": 60, "name": "WL_URL_MAX", "signature": "#define WL_URL_MAX"}, {"kind": "macro", "line": 61, "name": "WL_HOPS_MAX", "signature": "#define WL_HOPS_MAX"}, {"kind": "macro", "line": 62, "name": "WL_FONT_W", "signature": "#define WL_FONT_W"}, {"kind": "macro", "line": 63, "name": "WL_FONT_H", "signature": "#define WL_FONT_H"}, {"kind": "macro", "line": 64, "name": "WL_TAG_MAX", "signature": "#define WL_TAG_MAX"}, {"kind": "macro", "line": 65, "name": "WL_ENT_MAX", "signature": "#define WL_ENT_MAX"}]}, {"doc": "Exercises the kernel libc surface used by loaded .o programs:", "id": "progs/src/ftest.c", "kind": "module", "label": "ftest.c", "language": "c", "sha256": "d62976e0e0f60325", "symbol_count": 9, "symbols": [{"kind": "function", "line": 13, "name": "main", "signature": "int main(int argc, char **argv)"}, {"doc": "Exercises the kernel libc surface used by loaded .o programs: fprintf to stdout/stderr, snprintf into a buffer, errno on a failed * open, and exit().", "kind": "function", "line": 4, "name": "fprintf", "signature": "extern int fprintf(void *stream, const char *fmt, ...);"}, {"kind": "function", "line": 5, "name": "snprintf", "signature": "extern int snprintf(char *buf, unsigned long size, const char *fmt, ...);"}, {"kind": "function", "line": 6, "name": "printf", "signature": "extern int printf(const char *fmt, ...);"}, {"kind": "function", "line": 7, "name": "exit", "signature": "extern void exit(int code);"}, {"kind": "function", "line": 11, "name": "fopen", "signature": "extern void *fopen(const char *path, const char *mode);"}, {"kind": "variable", "line": 8, "name": "stdout", "signature": "extern void *stdout;"}, {"kind": "variable", "line": 9, "name": "stderr", "signature": "extern void *stderr;"}, {"kind": "variable", "line": 10, "name": "errno", "signature": "extern int errno;"}]}, {"doc": "MiniOS test program — compiled as relocatable .o, loaded by kernel ELF loader", "id": "progs/src/hello.c", "kind": "module", "label": "hello.c", "language": "c", "sha256": "6da45bdffa720e50", "symbol_count": 2, "symbols": [{"kind": "function", "line": 4, "name": "main", "signature": "int main(int argc, char **argv)"}, {"doc": "/* MiniOS test program — compiled as relocatable .o, loaded by kernel ELF loader", "kind": "function", "line": 2, "name": "printf", "signature": "extern int printf(const char *fmt, ...);"}]}, {"id": "progs/src/hello.py", "kind": "module", "label": "hello.py", "language": "py", "sha256": "72135c0623db3173", "symbol_count": 0, "symbols": []}, {"doc": "Minimal HTTP/1.0 GET through the Linux socket syscalls.", "id": "progs/src/http.c", "kind": "module", "label": "http.c", "language": "c", "sha256": "6e5f7e894d0d33ba", "symbol_count": 13, "symbols": [{"doc": "int socket(int domain, int type, int proto); int connect(int fd, void *addr, int addrlen); int sendto(int fd, char *buf, int len, int flags, void *to, int tolen); int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen); int shutdown(int fd, int how); int close(int fd); int net_dns_resolve(const char *host); int puts(char *s); int printf(char *fmt, ...); int strlen(char *s); int putchar(int c); /* Decimal string to int (the ld stub set has no atol).", "kind": "function", "line": 18, "name": "atoi", "signature": "int atoi(char *s)"}, {"kind": "function", "line": 29, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 3, "name": "kernel", "signature": "* Hostnames are resolved by the kernel (net_dns_resolve syscall). */ int socket(int domain, int type, int proto);"}, {"kind": "function", "line": 6, "name": "connect", "signature": "int connect(int fd, void *addr, int addrlen);"}, {"kind": "function", "line": 7, "name": "sendto", "signature": "int sendto(int fd, char *buf, int len, int flags, void *to, int tolen);"}, {"kind": "function", "line": 8, "name": "recvfrom", "signature": "int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen);"}, {"kind": "function", "line": 9, "name": "shutdown", "signature": "int shutdown(int fd, int how);"}, {"kind": "function", "line": 10, "name": "close", "signature": "int close(int fd);"}, {"kind": "function", "line": 11, "name": "net_dns_resolve", "signature": "int net_dns_resolve(const char *host);"}, {"kind": "function", "line": 12, "name": "puts", "signature": "int puts(char *s);"}, {"kind": "function", "line": 13, "name": "printf", "signature": "int printf(char *fmt, ...);"}, {"kind": "function", "line": 14, "name": "strlen", "signature": "int strlen(char *s);"}, {"kind": "function", "line": 15, "name": "putchar", "signature": "int putchar(int c);"}]}, {"doc": "json.c - command path JSON tool: validate, pretty-print and query.", "id": "progs/src/json.c", "kind": "module", "label": "json.c", "language": "c", "sha256": "00207670a4b467f6", "symbol_count": 41, "symbols": [{"kind": "function", "line": 58, "name": "js_read_all", "signature": "static char *js_read_all(const char *name, int *len)"}, {"kind": "function", "line": 76, "name": "js_new", "signature": "static int js_new(void)"}, {"kind": "function", "line": 81, "name": "js_skip_ws", "signature": "static void js_skip_ws(void)"}, {"kind": "function", "line": 89, "name": "js_peek", "signature": "static int js_peek(void)"}, {"kind": "function", "line": 97, "name": "js_parse_string", "signature": "static int js_parse_string(void)"}, {"kind": "function", "line": 133, "name": "js_parse_number", "signature": "static int js_parse_number(void)"}, {"kind": "function", "line": 143, "name": "js_key_match", "signature": "static int js_key_match(int child, const char *key)"}, {"kind": "function", "line": 147, "name": "js_parse_object", "signature": "static int js_parse_object(void)"}, {"kind": "function", "line": 182, "name": "js_parse_array", "signature": "static int js_parse_array(void)"}, {"kind": "function", "line": 211, "name": "js_parse_value", "signature": "static int js_parse_value(void)"}, {"kind": "function", "line": 281, "name": "js_indent", "signature": "static void js_indent(int n)"}, {"kind": "function", "line": 286, "name": "js_print_str", "signature": "static void js_print_str(const char *s)"}, {"kind": "function", "line": 303, "name": "js_print_value", "signature": "static void js_print_value(int node, int depth)"}, {"kind": "function", "line": 347, "name": "js_find_member", "signature": "static int js_find_member(int obj, const char *key)"}, {"kind": "function", "line": 357, "name": "js_array_at", "signature": "static int js_array_at(int arr, int idx)"}, {"kind": "function", "line": 369, "name": "js_query", "signature": "static int js_query(int root, const char *path)"}, {"kind": "function", "line": 401, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 5, "name": "js_str", "signature": "* members keep their key in js_str (the member value node) and their value * in the node itself, and object members / array elements are chained with * js_next. * * Usage: json <file> validate and pre"}, {"kind": "function", "line": 14, "name": "free", "signature": "void free();"}, {"kind": "function", "line": 15, "name": "printf", "signature": "int printf();"}, {"kind": "function", "line": 16, "name": "putchar", "signature": "int putchar();"}, {"kind": "function", "line": 17, "name": "puts", "signature": "int puts();"}, {"kind": "function", "line": 18, "name": "strlen", "signature": "int strlen();"}, {"kind": "function", "line": 19, "name": "strcmp", "signature": "int strcmp();"}, {"kind": "function", "line": 20, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 21, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 22, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 23, "name": "fseek", "signature": "int fseek();"}, {"kind": "function", "line": 24, "name": "ftell", "signature": "int ftell();"}, {"kind": "function", "line": 25, "name": "rewind", "signature": "void rewind();"}, {"kind": "macro", "line": 27, "name": "JS_MAX_NODES", "signature": "#define JS_MAX_NODES"}, {"kind": "macro", "line": 28, "name": "JS_POOL", "signature": "#define JS_POOL"}, {"kind": "macro", "line": 30, "name": "JS_NULL", "signature": "#define JS_NULL"}, {"kind": "macro", "line": 31, "name": "JS_BOOL", "signature": "#define JS_BOOL"}, {"kind": "macro", "line": 32, "name": "JS_NUM", "signature": "#define JS_NUM"}, {"kind": "macro", "line": 33, "name": "JS_STR", "signature": "#define JS_STR"}, {"kind": "macro", "line": 34, "name": "JS_OBJ", "signature": "#define JS_OBJ"}, {"kind": "macro", "line": 35, "name": "JS_ARR", "signature": "#define JS_ARR"}, {"kind": "macro", "line": 37, "name": "JS_SEEK_END", "signature": "#define JS_SEEK_END"}, {"kind": "macro", "line": 38, "name": "JS_EXIT_OK", "signature": "#define JS_EXIT_OK"}, {"kind": "macro", "line": 39, "name": "JS_EXIT_FAIL", "signature": "#define JS_EXIT_FAIL"}]}, {"doc": "Kernel-pointer rejection probe. Passes a supervisor-only address", "id": "progs/src/kmem.c", "kind": "module", "label": "kmem.c", "language": "c", "sha256": "3965ee5e6a1dde8f", "symbol_count": 3, "symbols": [{"doc": "Kernel-pointer rejection probe. Passes a supervisor-only address (0x0C100000, inside the kernel heap at 0x0C000000) to write(2). The hardened syscall boundary must reject it with -EFAULT; the program exits 0 when the write was refused and 1 when the kernel wrongly dereferenced a kernel pointer on its behalf. Built as a static Linux * ELF like lxhello.elf.", "kind": "function", "line": 7, "name": "syscall3", "signature": "static long syscall3(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 14, "name": "exit_now", "signature": "static void exit_now(long code)"}, {"kind": "function", "line": 18, "name": "_start", "signature": "void _start(void)"}]}, {"id": "progs/src/ldhello.c", "kind": "module", "label": "ldhello.c", "language": "c", "sha256": "e91d56eec84e6fa5", "symbol_count": 1, "symbols": [{"kind": "function", "line": 1, "name": "main", "signature": "int main(void)"}]}, {"doc": "lxabi.c - Linux process, thread and descriptor ABI probe (FreeDom", "id": "progs/src/lxabi.c", "kind": "module", "label": "lxabi.c", "language": "c", "sha256": "788ce788d467497c", "symbol_count": 61, "symbols": [{"kind": "struct", "line": 195, "name": "thread_result"}, {"kind": "type_alias", "line": 194, "name": "tls_seen", "signature": "typedef struct thread_result { long tls_seen;"}, {"kind": "function", "line": 65, "name": "report", "signature": "static void report(const char *name, int ok, const char *detail)"}, {"kind": "function", "line": 75, "name": "now_ms", "signature": "static long now_ms(void)"}, {"kind": "function", "line": 81, "name": "busy_wait_ms", "signature": "static void busy_wait_ms(long ms)"}, {"doc": "Raw clone(SIGCHLD) with known values in every callee-saved register and in * the argument registers; both sides store what they see after the syscall.", "kind": "function", "line": 95, "name": "fork_probe", "signature": "static void fork_probe(uint64_t *out)"}, {"kind": "function", "line": 132, "name": "regs_match", "signature": "static int regs_match(const uint64_t *r)"}, {"kind": "function", "line": 138, "name": "check_fork_registers", "signature": "static void check_fork_registers(void)"}, {"kind": "function", "line": 160, "name": "check_fork_cow_kernel_write", "signature": "static void check_fork_cow_kernel_write(void)"}, {"kind": "function", "line": 201, "name": "worker", "signature": "static void *worker(void *arg)"}, {"kind": "function", "line": 215, "name": "check_threads", "signature": "static void check_threads(void)"}, {"kind": "function", "line": 245, "name": "detached_worker", "signature": "static void *detached_worker(void *arg)"}, {"kind": "function", "line": 251, "name": "check_detached_reaped", "signature": "static void check_detached_reaped(void)"}, {"kind": "function", "line": 275, "name": "signaller", "signature": "static void *signaller(void *arg)"}, {"kind": "function", "line": 285, "name": "check_condvar", "signature": "static void check_condvar(void)"}, {"kind": "function", "line": 307, "name": "check_pipe2_flags", "signature": "static void check_pipe2_flags(void)"}, {"kind": "function", "line": 334, "name": "check_pipe_blocking", "signature": "static void check_pipe_blocking(void)"}, {"kind": "function", "line": 356, "name": "check_pipe_epipe", "signature": "static void check_pipe_epipe(void)"}, {"kind": "function", "line": 382, "name": "check_writev_pipe", "signature": "static void check_writev_pipe(void)"}, {"kind": "function", "line": 394, "name": "check_poll", "signature": "static void check_poll(void)"}, {"kind": "function", "line": 418, "name": "check_eventfd", "signature": "static void check_eventfd(void)"}, {"kind": "function", "line": 443, "name": "check_close_range", "signature": "static void check_close_range(void)"}, {"kind": "function", "line": 455, "name": "check_time", "signature": "static void check_time(void)"}, {"kind": "function", "line": 464, "name": "check_mkdir", "signature": "static void check_mkdir(void)"}, {"doc": "The answers glibc sizes memory from: a finite stack limit (thread stacks default to it) and a CPU count that matches the affinity mask * (malloc allows 8 arenas per CPU, each reserving 64 MB of address space).", "kind": "function", "line": 478, "name": "check_limits", "signature": "static void check_limits(void)"}, {"kind": "function", "line": 491, "name": "mono_us", "signature": "static long mono_us(void)"}, {"doc": "Sleeps really wait: nanosleep for a relative interval, clock_nanosleep until an absolute monotonic deadline, and a malformed interval is * EINVAL instead of a silent zero-length sleep.", "kind": "function", "line": 500, "name": "check_sleep", "signature": "static void check_sleep(void)"}, {"doc": "rc = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &abs_t, NULL); waited = mono_us() - t0; report(\"clock-nanosleep-abstime\", rc == 0 && waited >= (LXABI_SLEEP_MS - 1) * 1000L, \"absolute clock_nanosleep returned before its deadline\"); errno = 0; rc = nanosleep(&bad, NULL); report(\"nanosleep-einval\", rc == -1 && errno == EINVAL, \"tv_nsec of one second accepted\"); struct timespec res = { -1, -1 }; rc = clock_getres(CLOCK_MONOTONIC, &res); report(\"clock-getres\", rc == 0 && res.tv_sec == 0 && res.tv_nsec > 0 && res.tv_nsec <= 1000000L, \"monotonic resolution missing or coarser than 1 ms\"); } /* A worker thread that sleeps forever: only a group-wide exit ends it.", "kind": "function", "line": 527, "name": "lxabi_sleeper", "signature": "static void *lxabi_sleeper(void *arg)"}, {"doc": "Fork a child that runs body, wait for it with a bounded spin and return * its wait status, or -1 when it never ended (the group outlived it).", "kind": "function", "line": 535, "name": "child_status", "signature": "static int child_status(void (*body)(void))"}, {"kind": "function", "line": 555, "name": "abort_from_worker_body", "signature": "static void abort_from_worker_body(void)"}, {"kind": "function", "line": 561, "name": "lxabi_exit_group_worker", "signature": "static void *lxabi_exit_group_worker(void *arg)"}, {"kind": "function", "line": 567, "name": "exit_group_from_worker_body", "signature": "static void exit_group_from_worker_body(void)"}, {"kind": "function", "line": 573, "name": "wild_jump_body", "signature": "static void wild_jump_body(void)"}, {"kind": "function", "line": 581, "name": "process", "signature": "* process (never a kernel panic), and kill(pid, 0) or a harmless signal\n * leaves the target aliv..."}, {"doc": "Every process runs as root (uid/gid 0); glibc and CPython's startup * read these, and -ENOSYS made them answer (uid_t)-1.", "kind": "function", "line": 642, "name": "check_uid_gid", "signature": "static void check_uid_gid(void)"}, {"doc": "Directory rename within one parent: Linux allows it, and pip's * uninstall stashes a whole dist-info/pycache directory this way.", "kind": "function", "line": 649, "name": "check_rename_dir", "signature": "static void check_rename_dir(void)"}, {"doc": "getdents64 (217): a directory fd enumerates MiniFS entries with the right d_type and resumes across calls; a regular file fd answers * ENOTDIR. CPython's os.scandir/FileFinder ride exactly this.", "kind": "function", "line": 715, "name": "copy_dentry_name", "signature": "static void copy_dentry_name(char *dst, size_t cap, const char *src)"}, {"kind": "function", "line": 722, "name": "check_getdents64", "signature": "static void check_getdents64(void)"}, {"kind": "function", "line": 789, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 41, "name": "LXABI_CHILD_DELAY_MS", "signature": "#define LXABI_CHILD_DELAY_MS"}, {"kind": "macro", "line": 42, "name": "LXABI_THREADS", "signature": "#define LXABI_THREADS"}, {"kind": "macro", "line": 43, "name": "LXABI_THREAD_ITERS", "signature": "#define LXABI_THREAD_ITERS"}, {"kind": "macro", "line": 44, "name": "LXABI_DETACHED", "signature": "#define LXABI_DETACHED"}, {"kind": "macro", "line": 45, "name": "LXABI_WAIT_SPINS", "signature": "#define LXABI_WAIT_SPINS"}, {"kind": "macro", "line": 46, "name": "LXABI_GROUP_EXIT_CODE", "signature": "#define LXABI_GROUP_EXIT_CODE"}, {"kind": "macro", "line": 47, "name": "LXABI_SLEEP_MS", "signature": "#define LXABI_SLEEP_MS"}, {"kind": "macro", "line": 48, "name": "LXABI_MAX_SANE_CPUS", "signature": "#define LXABI_MAX_SANE_CPUS"}, {"kind": "macro", "line": 49, "name": "LXABI_TIMEDWAIT_MS", "signature": "#define LXABI_TIMEDWAIT_MS"}, {"kind": "macro", "line": 50, "name": "LXABI_EPOCH_2023", "signature": "#define LXABI_EPOCH_2023"}, {"kind": "macro", "line": 51, "name": "LXABI_CLOCK_SKEW_S", "signature": "#define LXABI_CLOCK_SKEW_S"}, {"kind": "macro", "line": 52, "name": "LXABI_REG_PROBE_WORDS", "signature": "#define LXABI_REG_PROBE_WORDS"}, {"kind": "macro", "line": 53, "name": "LXABI_CLONE_NR", "signature": "#define LXABI_CLONE_NR"}, {"kind": "macro", "line": 54, "name": "LXABI_SIGCHLD", "signature": "#define LXABI_SIGCHLD"}, {"kind": "macro", "line": 55, "name": "LXABI_A6_MAGIC", "signature": "#define LXABI_A6_MAGIC"}, {"kind": "macro", "line": 56, "name": "LXABI_CHILD_BAD", "signature": "#define LXABI_CHILD_BAD"}, {"kind": "macro", "line": 57, "name": "LXABI_MKDIR_PATH", "signature": "#define LXABI_MKDIR_PATH"}, {"kind": "macro", "line": 58, "name": "LXABI_MKDIR_FILE", "signature": "#define LXABI_MKDIR_FILE"}, {"kind": "macro", "line": 59, "name": "LXABI_CLOSE_RANGE_NR", "signature": "#define LXABI_CLOSE_RANGE_NR"}, {"kind": "macro", "line": 60, "name": "LXABI_PAGE", "signature": "#define LXABI_PAGE"}, {"kind": "macro", "line": 61, "name": "LXABI_COW_WORD", "signature": "#define LXABI_COW_WORD"}]}, {"id": "progs/src/lxhello.c", "kind": "module", "label": "lxhello.c", "language": "c", "sha256": "690645d50101aafa", "symbol_count": 7, "symbols": [{"kind": "function", "line": 11, "name": "lx_syscall3", "signature": "static long lx_syscall3(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 23, "name": "lx_strlen", "signature": "static unsigned long lx_strlen(const char *s)"}, {"kind": "function", "line": 29, "name": "lx_write", "signature": "static void lx_write(const char *s)"}, {"kind": "function", "line": 33, "name": "lx_write_int", "signature": "static void lx_write_int(long v)"}, {"doc": "static void lx_write_int(long v) { char buf[24]; int i = (int)sizeof(buf); int neg = 0; buf[--i] = 0; if (v < 0) { neg = 1; v = -v; } if (v == 0) buf[--i] = '0'; while (v > 0 && i > 0) { buf[--i] = (char)('0' + v % 10); v /= 10; } if (neg && i > 0) buf[--i] = '-'; lx_write(&buf[i]); } /* Entry called by _start with the real argc/argv pulled off the stack.", "kind": "function", "line": 46, "name": "lmain", "signature": "int lmain(long argc, char **argv)"}, {"kind": "macro", "line": 20, "name": "SYS_write", "signature": "#define SYS_write"}, {"kind": "macro", "line": 21, "name": "SYS_exit", "signature": "#define SYS_exit"}]}, {"doc": "lxnet.c - Linux socket ABI probe (FreeDom readiness step 6,", "id": "progs/src/lxnet.c", "kind": "module", "label": "lxnet.c", "language": "c", "sha256": "53b56398f8bc3f72", "symbol_count": 16, "symbols": [{"kind": "function", "line": 49, "name": "report", "signature": "static void report(const char *name, int ok, const char *detail)"}, {"kind": "function", "line": 55, "name": "wait_for", "signature": "static int wait_for(int fd, short events)"}, {"doc": "static void report(const char *name, int ok, const char *detail) { if (ok) printf(\"lxnet: %s ok\\n\", name); else { printf(\"lxnet: %s FAIL %s\\n\", name, detail ? detail : \"\"); failures++; } fflush(stdout); } static int wait_for(int fd, short events) { struct pollfd p = { fd, events, 0 }; int r = poll(&p, 1, LXNET_WAIT_MS); return r == 1 && (p.revents & events); } /* Read exactly len bytes or fail (waits through poll between chunks).", "kind": "function", "line": 62, "name": "read_all", "signature": "static int read_all(int fd, char *buf, size_t len)"}, {"kind": "function", "line": 73, "name": "check_udp", "signature": "static void check_udp(const struct sockaddr_in *peer)"}, {"doc": "A non-blocking connect to a port nobody listens on fails through poll * (POLLERR) with SO_ERROR = ECONNREFUSED, cleared once read.", "kind": "function", "line": 150, "name": "check_refused", "signature": "static void check_refused(const struct sockaddr_in *peer)"}, {"kind": "function", "line": 174, "name": "check_tcp", "signature": "static void check_tcp(const struct sockaddr_in *peer)"}, {"kind": "function", "line": 217, "name": "check_misc", "signature": "static void check_misc(void)"}, {"doc": "if (fd >= 0) close(fd); struct addrinfo hints, *res = NULL; memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; int rc = getaddrinfo(\"localhost\", \"80\", &hints, &res); int ok = rc == 0 && res && res->ai_family == AF_INET && ((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr == inet_addr(LXNET_LOOPBACK); report(\"getaddrinfo-hosts\", ok, rc ? gai_strerror(rc) : \"wrong address\"); if (res) freeaddrinfo(res); } /* Resolve host and dial port the way libcurl does; 0 when connected.", "kind": "function", "line": 236, "name": "dial", "signature": "static int dial(const char *host, const char *port)"}, {"kind": "function", "line": 280, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 24, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 40, "name": "LXNET_WAIT_MS", "signature": "#define LXNET_WAIT_MS"}, {"kind": "macro", "line": 41, "name": "LXNET_BUF", "signature": "#define LXNET_BUF"}, {"kind": "macro", "line": 42, "name": "LXNET_UDP_MSG", "signature": "#define LXNET_UDP_MSG"}, {"kind": "macro", "line": 43, "name": "LXNET_TCP_MSG", "signature": "#define LXNET_TCP_MSG"}, {"kind": "macro", "line": 44, "name": "LXNET_LOOPBACK", "signature": "#define LXNET_LOOPBACK"}, {"kind": "macro", "line": 45, "name": "LXNET_IP_UNKNOWN", "signature": "#define LXNET_IP_UNKNOWN"}]}, {"doc": "lxproc.c - foreground process-note probe (docs/spec/shell-fs.md, \"Process", "id": "progs/src/lxproc.c", "kind": "module", "label": "lxproc.c", "language": "c", "sha256": "d800b2daf9c244ea", "symbol_count": 9, "symbols": [{"doc": "#include <sys/wait.h> #include <unistd.h> #include \"minios_abi.h\" /** Bytes kept from the /proc/self/exe answer. #define LXPROC_EXE_MAX 128 /** Exit status the forked child reports, so the reap proves it ran. #define LXPROC_CHILD_CODE 7 #define LXPROC_OK 0 #define LXPROC_BAD 1 #ifdef LXPROC_PROCESS_NOTE /** MiniOS process note: name, 4-byte descriptor, both 4-byte padded.", "kind": "struct", "line": 35, "name": "lxproc_note"}, {"doc": "uint32_t namesz; uint32_t descsz; uint32_t type; char     name[sizeof MINIOS_NOTE_NAME]; uint32_t desc; }; __attribute__((section(\".note.minios.process\"), used, aligned(4))) static const struct lxproc_note lxproc_process_note = { sizeof MINIOS_NOTE_NAME, sizeof(uint32_t), MINIOS_NOTE_PROCESS, MINIOS_NOTE_NAME, 1u }; #endif /** Print the image path the kernel reports; 0 on success.", "kind": "function", "line": 50, "name": "report_exe", "signature": "static int report_exe(void)"}, {"doc": "Fork a child that exits with LXPROC_CHILD_CODE and reap it; 0 when the * outcome is one of the two the contract allows.", "kind": "function", "line": 64, "name": "report_fork", "signature": "static int report_fork(void)"}, {"kind": "function", "line": 91, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 27, "name": "LXPROC_EXE_MAX", "signature": "#define LXPROC_EXE_MAX"}, {"kind": "macro", "line": 29, "name": "LXPROC_CHILD_CODE", "signature": "#define LXPROC_CHILD_CODE"}, {"kind": "macro", "line": 30, "name": "LXPROC_OK", "signature": "#define LXPROC_OK"}, {"kind": "macro", "line": 31, "name": "LXPROC_BAD", "signature": "#define LXPROC_BAD"}]}, {"doc": "lxsecc.c - Linux seccomp-bpf, prctl and /proc/self/exe probe (FreeDom", "id": "progs/src/lxsecc.c", "kind": "module", "label": "lxsecc.c", "language": "c", "sha256": "f606e99b96582694", "symbol_count": 30, "symbols": [{"kind": "function", "line": 44, "name": "report", "signature": "static void report(const char *name, int ok, const char *detail)"}, {"doc": "Exit code of a reaped child under both encodings: Linux's status word (code << 8, signal in the low bits) and MiniOS's raw code. A signal death * reads as its nonzero signal number.", "kind": "function", "line": 53, "name": "exit_code_of", "signature": "static int exit_code_of(int st)"}, {"kind": "function", "line": 58, "name": "run_child", "signature": "static int run_child(void (*body)(void))"}, {"doc": "Filter: arch guard, getpid -> ERRNO(err_getpid), write/exit/exit_group/ * rt_sigreturn/mprotect(no PROT_EXEC)/fork paths allowed, all else KILL.", "kind": "function", "line": 72, "name": "install_filter", "signature": "static int install_filter(unsigned getpid_action)"}, {"kind": "function", "line": 100, "name": "child_errno_action", "signature": "static void child_errno_action(void)"}, {"kind": "function", "line": 107, "name": "child_kill_action", "signature": "static void child_kill_action(void)"}, {"doc": "The page is the child's own anonymous mapping, made before the filter (which forbids mmap): a copy-on-write page shared with the parent would * test the kernel's CoW rules instead of the filter's argument check.", "kind": "function", "line": 116, "name": "child_wx", "signature": "static void child_wx(void)"}, {"kind": "function", "line": 127, "name": "grandchild_inherits", "signature": "static void grandchild_inherits(void)"}, {"kind": "function", "line": 133, "name": "child_inherit", "signature": "static void child_inherit(void)"}, {"kind": "function", "line": 142, "name": "child_stacked", "signature": "static void child_stacked(void)"}, {"kind": "function", "line": 150, "name": "child_strict", "signature": "static void child_strict(void)"}, {"kind": "function", "line": 157, "name": "child_no_nnp", "signature": "static void child_no_nnp(void)"}, {"kind": "function", "line": 165, "name": "child_bad_program", "signature": "static void child_bad_program(void)"}, {"kind": "function", "line": 177, "name": "check_prctl_flags", "signature": "static void check_prctl_flags(void)"}, {"kind": "function", "line": 197, "name": "check_proc_self_exe", "signature": "static void check_proc_self_exe(const char *argv0)"}, {"kind": "function", "line": 215, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 13, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 28, "name": "LXSECC_EXEC_FLAG", "signature": "#define LXSECC_EXEC_FLAG"}, {"kind": "macro", "line": 29, "name": "LXSECC_EXEC_CODE", "signature": "#define LXSECC_EXEC_CODE"}, {"kind": "macro", "line": 30, "name": "LXSECC_OK_CODE", "signature": "#define LXSECC_OK_CODE"}, {"kind": "macro", "line": 31, "name": "LXSECC_BAD_CODE", "signature": "#define LXSECC_BAD_CODE"}, {"kind": "macro", "line": 32, "name": "LXSECC_EXE_MAX", "signature": "#define LXSECC_EXE_MAX"}, {"kind": "macro", "line": 33, "name": "LXSECC_NAME", "signature": "#define LXSECC_NAME"}, {"kind": "macro", "line": 34, "name": "LXSECC_NAME_MAX", "signature": "#define LXSECC_NAME_MAX"}, {"kind": "macro", "line": 35, "name": "LXSECC_ERRNO_A", "signature": "#define LXSECC_ERRNO_A"}, {"kind": "macro", "line": 36, "name": "LXSECC_ERRNO_B", "signature": "#define LXSECC_ERRNO_B"}, {"kind": "macro", "line": 37, "name": "LXSECC_PAGE", "signature": "#define LXSECC_PAGE"}, {"kind": "macro", "line": 38, "name": "LXSECC_STATUS_MASK", "signature": "#define LXSECC_STATUS_MASK"}, {"kind": "macro", "line": 39, "name": "LXSECC_STATUS_SHIFT", "signature": "#define LXSECC_STATUS_SHIFT"}, {"kind": "macro", "line": 40, "name": "LXSECC_STATUS_BYTE", "signature": "#define LXSECC_STATUS_BYTE"}]}, {"doc": "lxsel.c -- select(2)/pselect6(2) ABI probe (docs/spec/python.md).", "id": "progs/src/lxsel.c", "kind": "module", "label": "lxsel.c", "language": "c", "sha256": "488595e77b133d76", "symbol_count": 11, "symbols": [{"kind": "function", "line": 36, "name": "report", "signature": "static void report(const char *name, int ok)"}, {"kind": "function", "line": 45, "name": "raw_select", "signature": "static long raw_select(long nfds, fd_set *r, fd_set *w, fd_set *e,\n                       struct ..."}, {"kind": "function", "line": 50, "name": "raw_pselect6", "signature": "static long raw_pselect6(long nfds, fd_set *r, fd_set *w, fd_set *e,\n                         str..."}, {"kind": "function", "line": 55, "name": "elapsed_ms", "signature": "static long elapsed_ms(struct timespec *a, struct timespec *b)"}, {"kind": "function", "line": 60, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "_GNU_SOURCE", "signature": "#define _GNU_SOURCE"}, {"kind": "macro", "line": 28, "name": "LXSEL_NFDS_OUT_OF_RANGE", "signature": "#define LXSEL_NFDS_OUT_OF_RANGE"}, {"kind": "macro", "line": 29, "name": "LXSEL_BAD_FD", "signature": "#define LXSEL_BAD_FD"}, {"kind": "macro", "line": 30, "name": "LXSEL_TIMEOUT_US", "signature": "#define LXSEL_TIMEOUT_US"}, {"kind": "macro", "line": 31, "name": "LXSEL_TIMEOUT_MS_MIN", "signature": "#define LXSEL_TIMEOUT_MS_MIN"}, {"kind": "macro", "line": 32, "name": "LXSEL_PSELECT_TIMEOUT_NS", "signature": "#define LXSEL_PSELECT_TIMEOUT_NS"}]}, {"doc": "lxtls.c - libcurl/OpenSSL fetch probe (FreeDom readiness step 6,", "id": "progs/src/lxtls.c", "kind": "module", "label": "lxtls.c", "language": "c", "sha256": "199ed04b9969b3a9", "symbol_count": 10, "symbols": [{"doc": "Count the body without storing it: the probe proves transport, not * content.", "kind": "function", "line": 39, "name": "lxtls_sink", "signature": "static size_t lxtls_sink(char *data, size_t size, size_t nmemb, void *user)"}, {"doc": "Count the body without storing it: the probe proves transport, not * content. static size_t lxtls_sink(char *data, size_t size, size_t nmemb, void *user) { (void)data; (size_t *)user += size * nmemb; return size * nmemb; } /* Echo libcurl's informational and header lines, one prefixed line each.", "kind": "function", "line": 46, "name": "lxtls_debug", "signature": "static int lxtls_debug(CURL *h, curl_infotype type, char *data, size_t size, void *user)"}, {"doc": "return 0; for (i = 0; i <= size; i++) { if (i == size || data[i] == '\\n') { size_t len = i - start; if (len > 0 && data[start + len - 1] == '\\r') len--; if (len > 0) printf(\"lxtls| %.*s\\n\", (int)len, data + start); start = i + 1; } } fflush(stdout); return 0; } /* Report one RAND step and, on failure, OpenSSL's error queue.", "kind": "function", "line": 65, "name": "lxtls_step", "signature": "static int lxtls_step(const char *name, int ok)"}, {"doc": "} fflush(stdout); return 0; } /* Report one RAND step and, on failure, OpenSSL's error queue. static int lxtls_step(const char *name, int ok) { printf(\"lxtls: rand %s %s\\n\", name, ok ? \"ok\" : \"FAIL\"); if (!ok) ERR_print_errors_fp(stdout); fflush(stdout); return ok; } /* lxtls --rand: every layer RAND_status depends on, bottom up.", "kind": "function", "line": 73, "name": "lxtls_rand", "signature": "static int lxtls_rand(void)"}, {"kind": "function", "line": 87, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 31, "name": "LXTLS_TIMEOUT_S", "signature": "#define LXTLS_TIMEOUT_S"}, {"kind": "macro", "line": 32, "name": "LXTLS_CONNECT_S", "signature": "#define LXTLS_CONNECT_S"}, {"kind": "macro", "line": 33, "name": "LXTLS_MAX_REDIRECTS", "signature": "#define LXTLS_MAX_REDIRECTS"}, {"kind": "macro", "line": 34, "name": "LXTLS_CA_BUNDLE", "signature": "#define LXTLS_CA_BUNDLE"}, {"kind": "macro", "line": 35, "name": "LXTLS_RAND_BYTES", "signature": "#define LXTLS_RAND_BYTES"}]}, {"doc": "lz4.c - command path LZ4 (de)compression tools: lz4 and unlz4.", "id": "progs/src/lz4.c", "kind": "module", "label": "lz4.c", "language": "c", "sha256": "42f602d559c33103", "symbol_count": 26, "symbols": [{"kind": "function", "line": 39, "name": "lz4_has", "signature": "static int lz4_has(const char *s, const char *needle)"}, {"kind": "function", "line": 53, "name": "lz4_read_all", "signature": "static char *lz4_read_all(const char *name, int *len)"}, {"kind": "function", "line": 70, "name": "lz4_write_all", "signature": "static int lz4_write_all(const char *name, char *data, int len)"}, {"kind": "function", "line": 80, "name": "lz4_compress_file", "signature": "static int lz4_compress_file(const char *src, const char *dst)"}, {"kind": "function", "line": 117, "name": "lz4_decompress_file", "signature": "static int lz4_decompress_file(const char *src, const char *dst)"}, {"kind": "function", "line": 164, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 6, "name": "kernel", "signature": "* * The codec lives in the kernel (lz4_kernel.c, the same one MiniFS uses), so * these tools are thin front-ends over the two MiniOS syscalls 216 * (lz4_compress) and 255 (lz4_decompress), which mirro"}, {"kind": "function", "line": 15, "name": "free", "signature": "void free();"}, {"kind": "function", "line": 16, "name": "printf", "signature": "int printf();"}, {"kind": "function", "line": 17, "name": "strcmp", "signature": "int strcmp();"}, {"kind": "function", "line": 18, "name": "strlen", "signature": "int strlen();"}, {"kind": "function", "line": 19, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 20, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 21, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 22, "name": "fwrite", "signature": "int fwrite();"}, {"kind": "function", "line": 23, "name": "fseek", "signature": "int fseek();"}, {"kind": "function", "line": 24, "name": "ftell", "signature": "int ftell();"}, {"kind": "function", "line": 25, "name": "rewind", "signature": "void rewind();"}, {"kind": "function", "line": 27, "name": "lz4_compress", "signature": "int lz4_compress(char *src, int srclen, char *dst, int dstcap);"}, {"kind": "function", "line": 28, "name": "lz4_decompress", "signature": "int lz4_decompress(char *src, int srclen, char *dst, int dstcap);"}, {"kind": "macro", "line": 30, "name": "LZ4_HDR_SIZE", "signature": "#define LZ4_HDR_SIZE"}, {"kind": "macro", "line": 31, "name": "LZ4_BOUND_DEN", "signature": "#define LZ4_BOUND_DEN"}, {"kind": "macro", "line": 32, "name": "LZ4_BOUND_SLACK", "signature": "#define LZ4_BOUND_SLACK"}, {"kind": "macro", "line": 33, "name": "LZ4_MAX_BLOCK", "signature": "#define LZ4_MAX_BLOCK"}, {"kind": "macro", "line": 35, "name": "LZ4_SEEK_END", "signature": "#define LZ4_SEEK_END"}, {"kind": "macro", "line": 37, "name": "LZ4_EXIT_FAIL", "signature": "#define LZ4_EXIT_FAIL"}]}, {"doc": "lzss.c - command path LZSS (de)compression tools: lzss and unlzss.", "id": "progs/src/lzss.c", "kind": "module", "label": "lzss.c", "language": "c", "sha256": "58aef6feee125a0f", "symbol_count": 48, "symbols": [{"kind": "function", "line": 64, "name": "lz_in_getc", "signature": "static int lz_in_getc(void)"}, {"kind": "function", "line": 69, "name": "lz_out_put", "signature": "static void lz_out_put(int c)"}, {"kind": "function", "line": 74, "name": "lz_putbit1", "signature": "static void lz_putbit1(void)"}, {"kind": "function", "line": 84, "name": "lz_putbit0", "signature": "static void lz_putbit0(void)"}, {"kind": "function", "line": 93, "name": "lz_flush_bits", "signature": "static void lz_flush_bits(void)"}, {"kind": "function", "line": 97, "name": "lz_out_literal", "signature": "static void lz_out_literal(int c)"}, {"kind": "function", "line": 105, "name": "lz_out_pair", "signature": "static void lz_out_pair(int x, int y)"}, {"kind": "function", "line": 118, "name": "lz_encode", "signature": "static int lz_encode(void)"}, {"kind": "function", "line": 173, "name": "lz_getbit", "signature": "static int lz_getbit(int n)"}, {"kind": "function", "line": 189, "name": "lz_decode", "signature": "static int lz_decode(void)"}, {"kind": "function", "line": 218, "name": "lz_hdr_put", "signature": "static void lz_hdr_put(char *h, int size)"}, {"kind": "function", "line": 229, "name": "lz_hdr_get", "signature": "static int lz_hdr_get(char *h)"}, {"kind": "function", "line": 237, "name": "lz_has", "signature": "static int lz_has(const char *s, const char *needle)"}, {"kind": "function", "line": 251, "name": "lz_read_all", "signature": "static char *lz_read_all(const char *name, int *len)"}, {"kind": "function", "line": 268, "name": "lz_write_all", "signature": "static int lz_write_all(const char *name, char *data, int len)"}, {"kind": "function", "line": 278, "name": "lz_compress", "signature": "static int lz_compress(const char *src, const char *dst)"}, {"kind": "function", "line": 325, "name": "lz_decompress", "signature": "static int lz_decompress(const char *src, const char *dst)"}, {"kind": "function", "line": 397, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 13, "name": "malloc", "signature": "void *malloc();"}, {"kind": "function", "line": 14, "name": "free", "signature": "void free();"}, {"kind": "function", "line": 15, "name": "printf", "signature": "int printf();"}, {"kind": "function", "line": 16, "name": "strcmp", "signature": "int strcmp();"}, {"kind": "function", "line": 17, "name": "strlen", "signature": "int strlen();"}, {"kind": "function", "line": 18, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 19, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 20, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 21, "name": "fwrite", "signature": "int fwrite();"}, {"kind": "function", "line": 22, "name": "fseek", "signature": "int fseek();"}, {"kind": "function", "line": 23, "name": "ftell", "signature": "int ftell();"}, {"kind": "function", "line": 24, "name": "rewind", "signature": "void rewind();"}, {"kind": "macro", "line": 26, "name": "LZSS_EI", "signature": "#define LZSS_EI"}, {"kind": "macro", "line": 27, "name": "LZSS_EJ", "signature": "#define LZSS_EJ"}, {"kind": "macro", "line": 28, "name": "LZSS_P", "signature": "#define LZSS_P"}, {"kind": "macro", "line": 29, "name": "LZSS_N", "signature": "#define LZSS_N"}, {"kind": "macro", "line": 30, "name": "LZSS_F", "signature": "#define LZSS_F"}, {"kind": "macro", "line": 31, "name": "LZSS_WIN", "signature": "#define LZSS_WIN"}, {"kind": "macro", "line": 33, "name": "LZSS_MAGIC0", "signature": "#define LZSS_MAGIC0"}, {"kind": "macro", "line": 34, "name": "LZSS_MAGIC1", "signature": "#define LZSS_MAGIC1"}, {"kind": "macro", "line": 35, "name": "LZSS_MAGIC2", "signature": "#define LZSS_MAGIC2"}, {"kind": "macro", "line": 36, "name": "LZSS_MAGIC3", "signature": "#define LZSS_MAGIC3"}, {"kind": "macro", "line": 37, "name": "LZSS_HDR_SIZE", "signature": "#define LZSS_HDR_SIZE"}, {"kind": "macro", "line": 39, "name": "LZSS_ENC_SLACK", "signature": "#define LZSS_ENC_SLACK"}, {"kind": "macro", "line": 40, "name": "LZSS_EXPAND_NUM", "signature": "#define LZSS_EXPAND_NUM"}, {"kind": "macro", "line": 41, "name": "LZSS_EXPAND_DEN", "signature": "#define LZSS_EXPAND_DEN"}, {"kind": "macro", "line": 43, "name": "LZSS_SEEK_END", "signature": "#define LZSS_SEEK_END"}, {"kind": "macro", "line": 45, "name": "LZSS_ERR_NONE", "signature": "#define LZSS_ERR_NONE"}, {"kind": "macro", "line": 46, "name": "LZSS_ERR_OVERFLOW", "signature": "#define LZSS_ERR_OVERFLOW"}, {"kind": "macro", "line": 48, "name": "LZSS_EXIT_FAIL", "signature": "#define LZSS_EXIT_FAIL"}]}, {"doc": "mmap/munmap reclaim stress test.  Repeatedly maps and unmaps a large", "id": "progs/src/mmreuse.c", "kind": "module", "label": "mmreuse.c", "language": "c", "sha256": "7c52f82deab187c2", "symbol_count": 5, "symbols": [{"doc": "mmap/munmap reclaim stress test.  Repeatedly maps and unmaps a large region.  On a kernel whose munmap never returns address space, the downward mmap cursor drains until a map fails with ENOMEM (-12); with reclaim the freed region is reused and no map ever fails.  Exit code 0 = pass, 1 = a map failed (the leak it guards against).  Built as a static * Linux ELF like cpl.elf and run through the raw syscall ABI.", "kind": "function", "line": 7, "name": "mmap_anon", "signature": "static long mmap_anon(long len)"}, {"kind": "function", "line": 21, "name": "munmap", "signature": "static long munmap(long addr, long len)"}, {"kind": "function", "line": 31, "name": "exit_now", "signature": "static void exit_now(long code)"}, {"kind": "function", "line": 35, "name": "_start", "signature": "void _start(void)"}, {"kind": "function", "line": 3, "name": "ENOMEM", "signature": "* downward mmap cursor drains until a map fails with ENOMEM (-12);"}]}, {"doc": "mprotect probe. Maps two anonymous regions and walks the protection", "id": "progs/src/mprot.c", "kind": "module", "label": "mprot.c", "language": "c", "sha256": "1c970ee77abe8840", "symbol_count": 5, "symbols": [{"kind": "function", "line": 11, "name": "mmap_anon", "signature": "static long mmap_anon(long len)"}, {"kind": "function", "line": 25, "name": "mprotect_sys", "signature": "static long mprotect_sys(long addr, long len, long prot)"}, {"kind": "function", "line": 36, "name": "write_str", "signature": "static long write_str(const char *s, long n)"}, {"kind": "function", "line": 44, "name": "exit_now", "signature": "static void exit_now(long code)"}, {"kind": "function", "line": 48, "name": "_start", "signature": "void _start(void)"}]}, {"doc": "mthreads.h -- Minimal pthread-like threads for MiniOS ELFs (roadmap", "id": "progs/src/mthreads.h", "kind": "module", "label": "mthreads.h", "language": "h", "sha256": "310acc024ecb478e", "symbol_count": 20, "symbols": [{"kind": "struct", "line": 38, "name": "mmutex_t"}, {"kind": "struct", "line": 42, "name": "mthread_slot_t"}, {"doc": "define MMUTEX_FREE 0 define MMUTEX_HELD 1 define MMUTEX_CONTENDED 2 define MMUTEX_SPINS 100", "kind": "type_alias", "line": 35, "name": "mthread_t", "signature": "typedef int mthread_t;"}, {"kind": "function", "line": 50, "name": "m_syscall6", "signature": "static inline long m_syscall6(long n, long a, long b, long c)"}, {"kind": "function", "line": 59, "name": "myield", "signature": "static inline void myield(void)"}, {"kind": "function", "line": 63, "name": "mfutex_wait", "signature": "static inline long mfutex_wait(volatile int *addr, int val)"}, {"kind": "function", "line": 67, "name": "mfutex_wake", "signature": "static inline long mfutex_wake(volatile int *addr, int n)"}, {"kind": "function", "line": 71, "name": "mmutex_init", "signature": "static inline void mmutex_init(mmutex_t *m)"}, {"kind": "function", "line": 75, "name": "mmutex_lock", "signature": "static inline void mmutex_lock(mmutex_t *m)"}, {"kind": "function", "line": 90, "name": "mmutex_unlock", "signature": "static inline void mmutex_unlock(mmutex_t *m)"}, {"doc": "Thread entry trampoline: runs fn(arg), stores the return, exits 0. * The exit code is always 0; join reads retval from the shared slot.", "kind": "function", "line": 98, "name": "mthread_entry", "signature": "static void mthread_entry(void *p)"}, {"kind": "function", "line": 117, "name": "mthread_create", "signature": "static int mthread_create(mthread_t *t, void *(*fn)(void *), void *arg)"}, {"doc": "Join: wait4 (Linux semantics) answers the reaped pid and stores the status word; the thread always exits 0, so a join succeeds only when the pid it reaped is this thread's and the status says exit 0. Returns 0, * the negative errno from wait4, or -1 for any other outcome.", "kind": "function", "line": 144, "name": "mthread_join", "signature": "static int mthread_join(mthread_t t, void **retval)"}, {"kind": "macro", "line": 24, "name": "MTHREADS_H", "signature": "#define MTHREADS_H"}, {"kind": "macro", "line": 28, "name": "MTHREAD_STACK_SZ", "signature": "#define MTHREAD_STACK_SZ"}, {"kind": "macro", "line": 29, "name": "MTHREAD_MAX", "signature": "#define MTHREAD_MAX"}, {"kind": "macro", "line": 31, "name": "MMUTEX_FREE", "signature": "#define MMUTEX_FREE"}, {"kind": "macro", "line": 32, "name": "MMUTEX_HELD", "signature": "#define MMUTEX_HELD"}, {"kind": "macro", "line": 33, "name": "MMUTEX_CONTENDED", "signature": "#define MMUTEX_CONTENDED"}, {"kind": "macro", "line": 34, "name": "MMUTEX_SPINS", "signature": "#define MMUTEX_SPINS"}]}, {"doc": "mtop.c - ASCII real-time system monitor for MiniOS.", "id": "progs/src/mtop.c", "kind": "module", "label": "mtop.c", "language": "c", "sha256": "37400b9e1fd5bf02", "symbol_count": 39, "symbols": [{"kind": "function", "line": 63, "name": "sc3", "signature": "static long sc3(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 72, "name": "mtop_time", "signature": "static long mtop_time(void)"}, {"kind": "function", "line": 76, "name": "mtop_rtc", "signature": "static long mtop_rtc(int *h, int *m, int *s)"}, {"kind": "function", "line": 80, "name": "mtop_key", "signature": "static long mtop_key(void)"}, {"kind": "function", "line": 84, "name": "mtop_minfo", "signature": "static long mtop_minfo(long sel, long *o1, long *o2)"}, {"kind": "function", "line": 90, "name": "emit", "signature": "static void emit(char *s)"}, {"kind": "function", "line": 94, "name": "mtop_quit_key", "signature": "static int mtop_quit_key(long k)"}, {"kind": "function", "line": 103, "name": "mtop_clear_ansi", "signature": "static void mtop_clear_ansi(void)"}, {"kind": "function", "line": 113, "name": "mtop_clear", "signature": "static void mtop_clear(void)"}, {"kind": "function", "line": 117, "name": "mtop_atoi", "signature": "static int mtop_atoi(char *s)"}, {"kind": "function", "line": 136, "name": "mtop_putu", "signature": "static void mtop_putu(long v)"}, {"kind": "function", "line": 158, "name": "mtop_put2", "signature": "static void mtop_put2(int v)"}, {"kind": "function", "line": 163, "name": "mtop_put_kb", "signature": "static void mtop_put_kb(long kb)"}, {"kind": "function", "line": 179, "name": "mtop_bar", "signature": "static void mtop_bar(long v, long max, int w)"}, {"kind": "function", "line": 194, "name": "mtop_hist_max", "signature": "static long mtop_hist_max(long *h, int n)"}, {"kind": "function", "line": 204, "name": "mtop_hist_push", "signature": "static void mtop_hist_push(long *h, long v)"}, {"kind": "function", "line": 214, "name": "mtop_spark", "signature": "static void mtop_spark(long *h, int n)"}, {"kind": "function", "line": 242, "name": "mtop_mem", "signature": "static long mtop_mem(long *used, long *freeb, long *total)"}, {"kind": "function", "line": 253, "name": "mtop_cpu", "signature": "static long mtop_cpu(long *count, long *busy)"}, {"kind": "function", "line": 289, "name": "mtop_disk_open", "signature": "static void mtop_disk_open(void)"}, {"kind": "function", "line": 313, "name": "mtop_disk_read", "signature": "static long mtop_disk_read(long *bytes)"}, {"kind": "function", "line": 337, "name": "mtop_net_probe", "signature": "static long mtop_net_probe(long *dns_ms, long *sock_ok)"}, {"kind": "function", "line": 355, "name": "mtop_frame", "signature": "static void mtop_frame(int n)"}, {"kind": "function", "line": 531, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 12, "name": "syscall", "signature": "* * All system figures come from the MINFO syscall (251): heap used / * free, ramdisk used / cap, MiniFS free / total blocks, cpu total / * idle 100 Hz ticks, cpu count / uptime. CPU busy percent is *"}, {"kind": "function", "line": 35, "name": "putchar", "signature": "int putchar();"}, {"kind": "function", "line": 36, "name": "strlen", "signature": "int strlen();"}, {"kind": "function", "line": 37, "name": "strcmp", "signature": "int strcmp();"}, {"kind": "function", "line": 38, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 39, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 40, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 41, "name": "rewind", "signature": "void rewind();"}, {"kind": "function", "line": 42, "name": "socket", "signature": "int socket();"}, {"kind": "function", "line": 43, "name": "close", "signature": "int close();"}, {"kind": "function", "line": 44, "name": "net_dns_resolve", "signature": "int net_dns_resolve();"}, {"kind": "macro", "line": 46, "name": "MTOP_HIST", "signature": "#define MTOP_HIST"}, {"kind": "macro", "line": 47, "name": "MTOP_DISK_BUF", "signature": "#define MTOP_DISK_BUF"}, {"kind": "macro", "line": 48, "name": "MTOP_DISK_MAX", "signature": "#define MTOP_DISK_MAX"}, {"kind": "macro", "line": 49, "name": "MTOP_MINFO", "signature": "#define MTOP_MINFO"}]}, {"doc": "mvrn -- rename(82) syscall probe.", "id": "progs/src/mvrn.c", "kind": "module", "label": "mvrn.c", "language": "c", "sha256": "c8f4d37f60146d78", "symbol_count": 5, "symbols": [{"doc": "mvrn -- rename(82) syscall probe.  Exercises the rename path a ring-3 program sees: create a file through open/write/close, move it with rename(82), then pin the fail-closed edges (missing src is -ENOENT, a kernel-space pointer is -EFAULT) and clean up with unlink. Prints \"mvrn: ok\" and exits 0 only when every step behaves; any deviation prints \"mvrn: FAIL <step>\" and exits 1. * Built as a static Linux ELF like lxhello.elf (no libc, raw syscalls).", "kind": "function", "line": 9, "name": "mvrn_sc3", "signature": "static long mvrn_sc3(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 16, "name": "mvrn_write", "signature": "static void mvrn_write(const char *s, unsigned long len)"}, {"kind": "function", "line": 20, "name": "mvrn_exit", "signature": "static void mvrn_exit(long code)"}, {"kind": "function", "line": 24, "name": "mvrn_fail", "signature": "static void mvrn_fail(int step)"}, {"kind": "function", "line": 32, "name": "lmain", "signature": "int lmain(void)"}]}, {"doc": "NX probe. Under the isolation contract every user page starts", "id": "progs/src/nx.c", "kind": "module", "label": "nx.c", "language": "c", "sha256": "4efcbe9a0124639d", "symbol_count": 3, "symbols": [{"kind": "function", "line": 11, "name": "write_str", "signature": "static long write_str(const char *s, long n)"}, {"kind": "function", "line": 19, "name": "exit_now", "signature": "static void exit_now(long code)"}, {"kind": "function", "line": 23, "name": "_start", "signature": "void _start(void)"}]}, {"id": "progs/src/opl3.c", "kind": "module", "label": "opl3.c", "language": "c", "sha256": "40d232923b81ad7e", "symbol_count": 18, "symbols": [{"kind": "struct", "line": 102, "name": "note_t"}, {"kind": "function", "line": 36, "name": "sys_time", "signature": "static long sys_time(void)"}, {"kind": "function", "line": 39, "name": "sys_open", "signature": "static long sys_open(long on)"}, {"kind": "function", "line": 42, "name": "sys_submit", "signature": "static long sys_submit(const void *buf, long len)"}, {"kind": "function", "line": 46, "name": "busy_ms", "signature": "static void busy_ms(long ms)"}, {"doc": "} static long sys_open(long on) { long r; __asm__ volatile(\"syscall\":\"=a\"(r):\"a\"(SYS_SB16_OPEN),\"D\"(on):\"rcx\",\"r11\",\"memory\"); return r; } static long sys_submit(const void *buf, long len) { long r; __asm__ volatile(\"syscall\":\"=a\"(r):\"a\"(SYS_SB16_SUBMIT),\"D\"((long)buf),\"S\"(len):\"rcx\",\"r11\",\"memory\"); return r; } static void busy_ms(long ms) { long t0 = sys_time(); while (sys_time() - t0 < ms) __asm__ volatile(\"pause\"); } /* 2-op FM instrument, channel 0 (modulator op0, carrier op1).", "kind": "function", "line": 52, "name": "opl3_set_instrument", "signature": "static void opl3_set_instrument(opl3_chip *chip)"}, {"kind": "function", "line": 69, "name": "opl3_note", "signature": "static void opl3_note(opl3_chip *chip, unsigned block, unsigned fnum, int on)"}, {"doc": "Render `ms` of the current note and stream it to the SB16.  Each submit is one DMA buffer of MONO_BYTES; submissions are paced to real-time audio * (BUF_MS each) so the kernel ring stays full without overflowing.", "kind": "function", "line": 77, "name": "render", "signature": "static void render(opl3_chip *chip, long ms, long *fail)"}, {"kind": "function", "line": 107, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 21, "name": "SYS_TIME", "signature": "#define SYS_TIME"}, {"kind": "macro", "line": 22, "name": "SYS_SB16_OPEN", "signature": "#define SYS_SB16_OPEN"}, {"kind": "macro", "line": 23, "name": "SYS_SB16_SUBMIT", "signature": "#define SYS_SB16_SUBMIT"}, {"kind": "macro", "line": 24, "name": "SYS_WRITE", "signature": "#define SYS_WRITE"}, {"kind": "macro", "line": 28, "name": "SAMPLE_RATE", "signature": "#define SAMPLE_RATE"}, {"kind": "macro", "line": 29, "name": "STEREO_FRAMES", "signature": "#define STEREO_FRAMES"}, {"kind": "macro", "line": 30, "name": "MONO_BYTES", "signature": "#define MONO_BYTES"}, {"kind": "macro", "line": 32, "name": "BUF_MS", "signature": "#define BUF_MS"}, {"kind": "macro", "line": 34, "name": "F_NUM_FACTOR", "signature": "#define F_NUM_FACTOR"}]}, {"doc": "pcmap probe: file-backed MAP_PRIVATE mmap shares text.", "id": "progs/src/pcmap.c", "kind": "module", "label": "pcmap.c", "language": "c", "sha256": "d9ad5f6a15c258b9", "symbol_count": 8, "symbols": [{"doc": "pcmap probe: file-backed MAP_PRIVATE mmap shares text.  Maps 17 pages of lisp.c (65933 bytes on MiniFS) plus a second mapping of page 1 at file offset 4096, checksums the content and cross-checks the overlap: the offset mapping must read exactly what the base mapping holds 4096 bytes in. Both mappings stay resident (no munmap) so the `mem` pcache count proves one shared copy, and exit tears the window down through the ref-drop walk. Built as a static Linux ELF like mprot.elf; run twice under mrun for the cross-process share. Pinned hash and page count assume * the current lisp.c size; drift fails loudly, never silently.", "kind": "function", "line": 12, "name": "sc_open", "signature": "static long sc_open(const char *p)"}, {"kind": "function", "line": 21, "name": "sc_mmap", "signature": "static long sc_mmap(long len, long prot, long flags, long fd, long off)"}, {"kind": "function", "line": 34, "name": "sc_write", "signature": "static long sc_write(long fd, const char *s, long n)"}, {"kind": "function", "line": 42, "name": "sc_exit", "signature": "static void sc_exit(long code)"}, {"kind": "function", "line": 46, "name": "sc_fnv", "signature": "static unsigned long sc_fnv(const char *p, long n)"}, {"kind": "function", "line": 56, "name": "sc_hex8", "signature": "static void sc_hex8(unsigned long v, char *out)"}, {"kind": "function", "line": 65, "name": "sc_munmap", "signature": "static long sc_munmap(long addr, long len)"}, {"kind": "function", "line": 75, "name": "_start", "signature": "void _start(void)"}]}, {"doc": "pip -- launcher for `python3 -m pip`, and pip3 as a copy of this image.", "id": "progs/src/pip.c", "kind": "module", "label": "pip.c", "language": "c", "sha256": "c6da64536cc61acd", "symbol_count": 7, "symbols": [{"doc": "#include \"minios_abi.h\" /** Interpreter path inside the guest; cwd independent. #define PIP_PYTHON_PATH \"/python3\" /** Python arguments that select the pip module. #define PIP_MODULE_FLAG \"-m\" #define PIP_MODULE_NAME \"pip\" /** Prefix words added in front of the caller's arguments. #define PIP_PREFIX_WORDS 3 /** Exit status for a failed execve. #define PIP_EXEC_FAILED 127 #ifdef PIP_PROCESS_NOTE /** MiniOS process note: name, 4-byte descriptor, both 4-byte padded.", "kind": "struct", "line": 30, "name": "pip_note"}, {"doc": "uint32_t namesz; uint32_t descsz; uint32_t type; char     name[sizeof MINIOS_NOTE_NAME]; uint32_t desc; }; __attribute__((section(\".note.minios.process\"), used, aligned(4))) static const struct pip_note pip_process_note = { sizeof MINIOS_NOTE_NAME, sizeof(uint32_t), MINIOS_NOTE_PROCESS, MINIOS_NOTE_NAME, 1u }; #endif /** Build argv and exec the interpreter; returns only on failure.", "kind": "function", "line": 45, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 19, "name": "PIP_PYTHON_PATH", "signature": "#define PIP_PYTHON_PATH"}, {"kind": "macro", "line": 21, "name": "PIP_MODULE_FLAG", "signature": "#define PIP_MODULE_FLAG"}, {"kind": "macro", "line": 22, "name": "PIP_MODULE_NAME", "signature": "#define PIP_MODULE_NAME"}, {"kind": "macro", "line": 24, "name": "PIP_PREFIX_WORDS", "signature": "#define PIP_PREFIX_WORDS"}, {"kind": "macro", "line": 26, "name": "PIP_EXEC_FAILED", "signature": "#define PIP_EXEC_FAILED"}]}, {"id": "progs/src/pollready.c", "kind": "module", "label": "pollready.c", "language": "c", "sha256": "3082e54fbb94f31b", "symbol_count": 6, "symbols": [{"kind": "function", "line": 26, "name": "p_write", "signature": "static long p_write(long fd, const char *s, long n)"}, {"kind": "function", "line": 30, "name": "p_strlen", "signature": "static unsigned long p_strlen(const char *s)"}, {"kind": "function", "line": 36, "name": "p_puts", "signature": "static void p_puts(long fd, const char *s)"}, {"kind": "function", "line": 40, "name": "p_atoi", "signature": "static int p_atoi(const char *s)"}, {"kind": "function", "line": 46, "name": "p_parse_ip", "signature": "static int p_parse_ip(const char *s, unsigned char out[4])"}, {"doc": "int v = 0; int digits = 0; while (*s >= '0' && *s <= '9') { v = v * 10 + (*s - '0'); s++; digits++; } if (!digits || v > 255) return -1; out[i] = (unsigned char)v; if (i < 3) { if (*s != '.') return -1; s++; } } return *s ? -1 : 0; } /* Entry called by _start with argc/argv off the initial stack.", "kind": "function", "line": 63, "name": "lmain", "signature": "int lmain(long argc, char **argv)"}]}, {"doc": "sbtone.c — headless SB16 diagnostic (ring-3, no GUI).", "id": "progs/src/sbtone.c", "kind": "module", "label": "sbtone.c", "language": "c", "sha256": "1176355ec8699a34", "symbol_count": 8, "symbols": [{"kind": "function", "line": 14, "name": "buffers", "signature": "*\n * Exit code is the number of submitted buffers (0 on failure to open).\n */\n\n#include <stdio.h>..."}, {"kind": "function", "line": 36, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 21, "name": "SYS_SB16_OPEN", "signature": "#define SYS_SB16_OPEN"}, {"kind": "macro", "line": 22, "name": "SYS_SB16_SUBMIT", "signature": "#define SYS_SB16_SUBMIT"}, {"kind": "macro", "line": 23, "name": "SYS_TIME", "signature": "#define SYS_TIME"}, {"kind": "macro", "line": 25, "name": "RATE", "signature": "#define RATE"}, {"kind": "macro", "line": 26, "name": "BUF", "signature": "#define BUF"}, {"kind": "macro", "line": 27, "name": "WINDOW_MS", "signature": "#define WINDOW_MS"}]}, {"doc": "scfuzz: deterministic syscall fuzzer (syzkaller spirit, BDD scale).", "id": "progs/src/scfuzz.c", "kind": "module", "label": "scfuzz.c", "language": "c", "sha256": "9c4f7b495db45651", "symbol_count": 19, "symbols": [{"kind": "function", "line": 7, "name": "guest", "signature": "* the guest (the BDD timeout then talks). All fuzz maps stay inside\n * one private 4 MB arena (pa..."}, {"kind": "function", "line": 38, "name": "sc_mprotect", "signature": "static long sc_mprotect(long addr, long len, long prot)"}, {"kind": "function", "line": 49, "name": "sc_munmap", "signature": "static long sc_munmap(long addr, long len)"}, {"kind": "function", "line": 53, "name": "sc_write", "signature": "static long sc_write(long fd, const char *s, long n)"}, {"kind": "function", "line": 61, "name": "sc_exit", "signature": "static void sc_exit(long code)"}, {"kind": "function", "line": 67, "name": "sc_rng", "signature": "static unsigned long sc_rng(unsigned long *s)"}, {"kind": "function", "line": 76, "name": "sc_fold", "signature": "static unsigned long sc_fold(unsigned long h, unsigned long v)"}, {"kind": "function", "line": 88, "name": "sc_hex8", "signature": "static void sc_hex8(unsigned long v, char *out)"}, {"kind": "function", "line": 97, "name": "sc_worker", "signature": "static unsigned long sc_worker(int me, unsigned long seed)"}, {"kind": "function", "line": 161, "name": "sc_thread1", "signature": "static void *sc_thread1(void *arg)"}, {"kind": "function", "line": 167, "name": "_start", "signature": "void _start(void)"}, {"kind": "macro", "line": 15, "name": "SC_OPS", "signature": "#define SC_OPS"}, {"kind": "macro", "line": 16, "name": "SC_ARENA", "signature": "#define SC_ARENA"}, {"kind": "macro", "line": 17, "name": "SC_PAGE", "signature": "#define SC_PAGE"}, {"kind": "macro", "line": 18, "name": "SC_PAGES", "signature": "#define SC_PAGES"}, {"kind": "macro", "line": 19, "name": "SC_T0_BASE", "signature": "#define SC_T0_BASE"}, {"kind": "macro", "line": 20, "name": "SC_T0_N", "signature": "#define SC_T0_N"}, {"kind": "macro", "line": 21, "name": "SC_T1_BASE", "signature": "#define SC_T1_BASE"}, {"kind": "macro", "line": 22, "name": "SC_T1_N", "signature": "#define SC_T1_N"}]}, {"doc": "shell.py -- pybash: a Python shell layer on top of MiniOS's C shell.  The C shell is untouched. This is an additional capability layer that gives MiniOS pipelines, variables and control flow in Python, so new behaviour no longer requires recompiling kernel.c. The core primitive is minios.run(), which invokes any ramdisk program through SYS_SPAWN while preserving the interpreter, and minios.run(..., redirect=file) to capture a program's console output for composition.  Usage (inside MiniOS): micropython src/shell.py", "id": "progs/src/shell.py", "kind": "module", "label": "shell.py", "language": "py", "sha256": "6efe8d3c7a270710", "symbol_count": 3, "symbols": [{"kind": "function", "line": 20, "name": "run_capture", "signature": "def run_capture(cmd, args)"}, {"kind": "function", "line": 30, "name": "expand", "signature": "def expand(line, env)"}, {"kind": "function", "line": 36, "name": "main", "signature": "def main()"}]}, {"doc": "sign.c - in-OS Ed25519 code signer for MiniOS secure boot.", "id": "progs/src/sign.c", "kind": "module", "label": "sign.c", "language": "c", "sha256": "07b141859ac3dc27", "symbol_count": 83, "symbols": [{"doc": "static unsigned int sign_k[160]; static unsigned int sign_h[16]; static unsigned int sign_w[160]; static char sign_buf[128]; static int sign_used; static unsigned int sign_nlo; static unsigned int sign_nhi; static unsigned int sign_q4[8]; static unsigned int sign_l8[8]; static unsigned int sign_gb[32]; static unsigned int sign_ga[32]; /** Docstring: Hex digit value, 0 outside hex.", "kind": "function", "line": 89, "name": "sign_hexval", "signature": "static unsigned int sign_hexval(char c)"}, {"doc": "static unsigned int sign_ga[32]; /** Docstring: Hex digit value, 0 outside hex. static unsigned int sign_hexval(char c) { if (c >= 48 && c <= 57) return (unsigned int)(c - 48); if (c >= 97 && c <= 102) return (unsigned int)(c - 97 + 10); if (c >= 65 && c <= 70) return (unsigned int)(c - 65 + 10); return 0; } /** Docstring: Decode 2*n hex chars into n bytes.", "kind": "function", "line": 100, "name": "sign_unhex", "signature": "static void sign_unhex(char *out, char *in, int n)"}, {"doc": "} /** Docstring: Decode 2*n hex chars into n bytes. static void sign_unhex(char *out, char *in, int n) { int i = 0; while (i < n) { unsigned int hi = sign_hexval(in[2 * i]); unsigned int lo = sign_hexval(in[2 * i + 1]); out[i] = (char)((hi << 4) | lo); i++; } } /** Docstring: Unsigned byte at index, the aes.c masking idiom.", "kind": "function", "line": 111, "name": "sign_byte", "signature": "static unsigned int sign_byte(char *p, int i)"}, {"doc": "out[i] = (char)((hi << 4) | lo); i++; } } /** Docstring: Unsigned byte at index, the aes.c masking idiom. static unsigned int sign_byte(char *p, int i) { int v = p[i]; if (v < 0) v = v + 256; return (unsigned int)v; } /** Docstring: Copy n bytes.", "kind": "function", "line": 119, "name": "sign_copy", "signature": "static void sign_copy(char *dst, char *src, int n)"}, {"doc": "v = v + 256; return (unsigned int)v; } /** Docstring: Copy n bytes. static void sign_copy(char *dst, char *src, int n) { int i = 0; while (i < n) { dst[i] = src[i]; i++; } } /** Docstring: String length.", "kind": "function", "line": 128, "name": "sign_strlen", "signature": "static int sign_strlen(char *s)"}, {"doc": "dst[i] = src[i]; i++; } } /** Docstring: String length. static int sign_strlen(char *s) { int n = 0; while (s[n] != 0) n = n + 1; return n; } /** Docstring: Little-endian u16 at offset.", "kind": "function", "line": 136, "name": "sign_le16", "signature": "static unsigned int sign_le16(char *p, int off)"}, {"doc": "/** Docstring: String length. static int sign_strlen(char *s) { int n = 0; while (s[n] != 0) n = n + 1; return n; } /** Docstring: Little-endian u16 at offset. static unsigned int sign_le16(char *p, int off) { return sign_byte(p, off) | (sign_byte(p, off + 1) << 8); } /** Docstring: Little-endian u32 at offset.", "kind": "function", "line": 141, "name": "sign_le32", "signature": "static unsigned int sign_le32(char *p, int off)"}, {"doc": "} /** Docstring: Little-endian u16 at offset. static unsigned int sign_le16(char *p, int off) { return sign_byte(p, off) | (sign_byte(p, off + 1) << 8); } /** Docstring: Little-endian u32 at offset. static unsigned int sign_le32(char *p, int off) { return sign_byte(p, off) | (sign_byte(p, off + 1) << 8) | (sign_byte(p, off + 2) << 16) | (sign_byte(p, off + 3) << 24); } /** Docstring: Store u32 little-endian.", "kind": "function", "line": 147, "name": "sign_put32", "signature": "static void sign_put32(char *p, int off, unsigned int v)"}, {"doc": "if (hi < 10) out[2 * i] = (char)(48 + hi); else out[2 * i] = (char)(87 + hi); if (lo < 10) out[2 * i + 1] = (char)(48 + lo); else out[2 * i + 1] = (char)(87 + lo); i = i + 1; } out[2 * n] = 0; } /** Docstring: Load a file offset field, refusing high parts.", "kind": "function", "line": 180, "name": "sign_offok", "signature": "static int sign_offok(char *p, int off, int *lo)"}, {"kind": "function", "line": 195, "name": "below", "signature": "* every other op below (`|`, `<<`) is low-32 exact. */\nstatic void sign_rotr(unsigned int *lo, un..."}, {"doc": "Docstring: Borrow out of x minus y into s, without comparisons. * Same miniGCC rationale as sign_carry2: sanitize before shifting.", "kind": "function", "line": 230, "name": "sign_borrow2", "signature": "static unsigned int sign_borrow2(unsigned int x, unsigned int y, unsigned int s)"}, {"doc": "Docstring: Borrow out of x minus y into s, without comparisons. * Same miniGCC rationale as sign_carry2: sanitize before shifting. static unsigned int sign_borrow2(unsigned int x, unsigned int y, unsigned int s) { unsigned int t = (~x & y) | ((~(x ^ y)) & s); t = (t << 32) >> 32; return (t >> 31) & 1; } /** Docstring: Add three words with carry, returning the new carry.", "kind": "function", "line": 237, "name": "sign_add3", "signature": "static unsigned int sign_add3(unsigned int *s, unsigned int a, unsigned int b, unsigned int c)"}, {"doc": "return (t >> 31) & 1; } /** Docstring: Add three words with carry, returning the new carry. static unsigned int sign_add3(unsigned int *s, unsigned int a, unsigned int b, unsigned int c) { unsigned int t = a + b; unsigned int cy = sign_carry2(a, b, t); unsigned int u = t + c; cy = cy + sign_carry2(t, c, u); s = u; return cy; } /** Docstring: Big-endian u32 at byte offset.", "kind": "function", "line": 247, "name": "sign_be32", "signature": "static unsigned int sign_be32(char *p, int off)"}, {"doc": "unsigned int cy = sign_carry2(a, b, t); unsigned int u = t + c; cy = cy + sign_carry2(t, c, u); s = u; return cy; } /** Docstring: Big-endian u32 at byte offset. static unsigned int sign_be32(char *p, int off) { return (sign_byte(p, off) << 24) | (sign_byte(p, off + 1) << 16) | (sign_byte(p, off + 2) << 8) | sign_byte(p, off + 3); } /** Docstring: One SHA-512 compression over the 128-byte buffer.", "kind": "function", "line": 253, "name": "sign_block", "signature": "static void sign_block(void)"}, {"doc": "i = 0; while (i < 16) { unsigned int n = sign_h[i] + st[i]; unsigned int cy = 0; cy = sign_carry2(sign_h[i], st[i], n); sign_h[i] = n; i++; n = sign_h[i] + st[i] + cy; sign_h[i] = n; i++; } } /** Docstring: Start a SHA-512 digest.", "kind": "function", "line": 387, "name": "sign_sha_init", "signature": "static void sign_sha_init(void)"}, {"doc": "sign_h[8] = 0xade682d1; sign_h[9] = 0x510e527f; sign_h[10] = 0x2b3e6c1f; sign_h[11] = 0x9b05688c; sign_h[12] = 0xfb41bd6b; sign_h[13] = 0x1f83d9ab; sign_h[14] = 0x137e2179; sign_h[15] = 0x5be0cd19; sign_nlo = 0; sign_nhi = 0; sign_used = 0; } /** Docstring: Feed bytes into the running digest.", "kind": "function", "line": 410, "name": "sign_sha_update", "signature": "static void sign_sha_update(char *data, int len)"}, {"doc": "Docstring: Finish the digest into 64 bytes.  The bit counter never exceeds 2^27 (files cap at 16 MB), so the high length word is constant zero and only safe sub-32 shifts * appear below.", "kind": "function", "line": 442, "name": "sign_sha_final", "signature": "static void sign_sha_final(char *out)"}, {"doc": "while (s < 8) { int ww = 0; if (s < 4) ww = (int)((sign_h[2 * i + 1] >> (24 - 8 * s)) & 255); else ww = (int)((sign_h[2 * i] >> (56 - 8 * s)) & 255); out[b + s] = (char)ww; s = s + 1; } i = i + 1; } } /** Docstring: Feed a u32 into the digest little-endian.", "kind": "function", "line": 490, "name": "sign_feed32", "signature": "static void sign_feed32(unsigned int v)"}, {"doc": "} } /** Docstring: Feed a u32 into the digest little-endian. static void sign_feed32(unsigned int v) { char b[4]; b[0] = (char)(v & 255); b[1] = (char)((v >> 8) & 255); b[2] = (char)((v >> 16) & 255); b[3] = (char)((v >> 24) & 255); sign_sha_update(b, 4); } /** Docstring: Decode the K table chunks into 160 words.", "kind": "function", "line": 500, "name": "sign_key_init", "signature": "static void sign_key_init(void)"}, {"doc": "sign_q4[5] = 4294967295; sign_q4[6] = 4294967295; sign_q4[7] = 2147483647; sign_l8[0] = 1559614445; sign_l8[1] = 1477600026; sign_l8[2] = 2734136534; sign_l8[3] = 350157278; sign_l8[4] = 0; sign_l8[5] = 0; sign_l8[6] = 0; sign_l8[7] = 268435456; } /** Docstring: Copy eight limbs.", "kind": "function", "line": 549, "name": "fe_copy", "signature": "static void fe_copy(unsigned int *r, unsigned int *a)"}, {"doc": "sign_l8[6] = 0; sign_l8[7] = 268435456; } /** Docstring: Copy eight limbs. static void fe_copy(unsigned int *r, unsigned int *a) { int i = 0; while (i < 8) { r[i] = a[i]; i = i + 1; } } /** Docstring: Zero eight limbs.", "kind": "function", "line": 558, "name": "fe_zero", "signature": "static void fe_zero(unsigned int *r)"}, {"doc": "i = i + 1; } } /** Docstring: Zero eight limbs. static void fe_zero(unsigned int *r) { int i = 0; while (i < 8) { r[i] = 0; i = i + 1; } } /** Docstring: One as eight limbs.", "kind": "function", "line": 567, "name": "fe_one", "signature": "static void fe_one(unsigned int *r)"}, {"doc": "int i = 0; while (i < 8) { r[i] = 0; i = i + 1; } } /** Docstring: One as eight limbs. static void fe_one(unsigned int *r) { fe_zero(r); r[0] = 1; } /** Docstring: Masked select between limb arrays, no secret branches.", "kind": "function", "line": 573, "name": "fe_cmov", "signature": "static void fe_cmov(unsigned int *r, unsigned int *b, unsigned int flag)"}, {"doc": "Docstring: 1 when a holds at least b, else 0.  Runs the subtraction limb by limb and returns the inverted final * borrow, so no ordering comparison touches full-range limbs.", "kind": "function", "line": 586, "name": "fe_ge", "signature": "static unsigned int fe_ge(unsigned int *a, unsigned int *b)"}, {"doc": "unsigned int borrow = 0; int i = 0; while (i < 8) { unsigned int t1 = a[i] - borrow; unsigned int c0 = sign_borrow2(a[i], borrow, t1); unsigned int t2 = t1 - b[i]; unsigned int c1 = sign_borrow2(t1, b[i], t2); borrow = c0 | c1; i = i + 1; } return borrow ^ 1; } /** Docstring: Raw subtract, caller guarantees no borrow out.", "kind": "function", "line": 601, "name": "fe_rawsub", "signature": "static void fe_rawsub(unsigned int *r, unsigned int *a, unsigned int *b)"}, {"doc": "int i = 0; while (i < 8) { unsigned int ai = a[i]; unsigned int t1 = ai - borrow; unsigned int c0 = sign_borrow2(ai, borrow, t1); unsigned int t2 = t1 - b[i]; unsigned int c1 = sign_borrow2(t1, b[i], t2); r[i] = t2; borrow = c0 | c1; i = i + 1; } } /** Docstring: Add mod q with one conditional subtract.", "kind": "function", "line": 617, "name": "fe_add", "signature": "static void fe_add(unsigned int *r, unsigned int *a, unsigned int *b)"}, {"doc": "unsigned int s1 = a[i] + b[i]; unsigned int c0 = sign_carry2(a[i], b[i], s1); unsigned int s2 = s1 + carry; unsigned int c1 = sign_carry2(s1, carry, s2); t[i] = s2; carry = c0 | c1; i = i + 1; } if (carry == 1 || fe_ge(t, sign_q4) == 1) fe_rawsub(t, t, sign_q4); fe_copy(r, t); } /** Docstring: Subtract mod q with borrow folded back.", "kind": "function", "line": 636, "name": "fe_sub", "signature": "static void fe_sub(unsigned int *r, unsigned int *a, unsigned int *b)"}, {"kind": "function", "line": 672, "name": "bits", "signature": "* values here always fit 32 bits (limbs below 2^16, carries and\n * products below 2^32), so the s..."}, {"doc": "unsigned int carry = 0; carry = (v << 32) >> 32; while (i < 32 && carry != 0) { unsigned int rv = 0; unsigned int s = 0; rv = (row[i] << 32) >> 32; s = rv + carry; row[i] = s & 65535; carry = s >> 16; i = i + 1; } } /** Docstring: Fold 38 times a sub-2^16 limb into a 16-bit row.", "kind": "function", "line": 690, "name": "fe_foldadd", "signature": "static void fe_foldadd(unsigned int *row, int at, unsigned int x)"}, {"doc": "s = rv + carry; row[i] = s & 65535; carry = s >> 16; i = i + 1; } } /** Docstring: Fold 38 times a sub-2^16 limb into a 16-bit row. static void fe_foldadd(unsigned int *row, int at, unsigned int x) { unsigned int v = (x << 5) + (x << 2) + (x << 1); fe_rowadd(row, at, v); } /** Docstring: Multiply mod q through 16-bit rows and 38-folds.", "kind": "function", "line": 696, "name": "fe_mul", "signature": "static void fe_mul(unsigned int *r, unsigned int *a, unsigned int *b)"}, {"doc": "fe_zero(back); back[0] = acc[16] * 38; fe_add(t, t, back); k = 0; while (k < 3) { if (fe_ge(t, sign_q4) == 1) fe_rawsub(t, t, sign_q4); k = k + 1; } fe_copy(r, t); } } /** Docstring: Square mod q.", "kind": "function", "line": 766, "name": "fe_sq", "signature": "static void fe_sq(unsigned int *r, unsigned int *a)"}, {"doc": "if (fe_ge(t, sign_q4) == 1) fe_rawsub(t, t, sign_q4); k = k + 1; } fe_copy(r, t); } } /** Docstring: Square mod q. static void fe_sq(unsigned int *r, unsigned int *a) { fe_mul(r, a, a); } /** Docstring: Power with the q-minus-2 bit pattern, always square.", "kind": "function", "line": 771, "name": "fe_inv", "signature": "static void fe_inv(unsigned int *r, unsigned int *a)"}, {"doc": "while (i < 255) { unsigned int bit = 1; if (i == 252 || i == 250) bit = 0; fe_sq(tmp, acc); fe_copy(acc, tmp); fe_mul(tmp, acc, a); fe_cmov(acc, tmp, bit); i = i + 1; } fe_copy(r, acc); } /** Docstring: Load 32 bytes into eight limbs.", "kind": "function", "line": 790, "name": "fe_frombytes", "signature": "static void fe_frombytes(unsigned int *r, char *b)"}, {"doc": "fe_copy(r, acc); } /** Docstring: Load 32 bytes into eight limbs. static void fe_frombytes(unsigned int *r, char *b) { int i = 0; while (i < 8) { r[i] = sign_byte(b, 4 * i) | (sign_byte(b, 4 * i + 1) << 8) | (sign_byte(b, 4 * i + 2) << 16) | (sign_byte(b, 4 * i + 3) << 24); i = i + 1; } } /** Docstring: Store eight limbs as 32 bytes.", "kind": "function", "line": 800, "name": "fe_tobytes", "signature": "static void fe_tobytes(char *b, unsigned int *a)"}, {"doc": "/** Docstring: Store eight limbs as 32 bytes. static void fe_tobytes(char *b, unsigned int *a) { int i = 0; while (i < 8) { b[4 * i] = (char)(a[i] & 255); b[4 * i + 1] = (char)((a[i] >> 8) & 255); b[4 * i + 2] = (char)((a[i] >> 16) & 255); b[4 * i + 3] = (char)((a[i] >> 24) & 255); i = i + 1; } } /** Docstring: Recover d from minus 121665 over 121666.", "kind": "function", "line": 812, "name": "fe_curved", "signature": "static void fe_curved(unsigned int *d, unsigned int *d2)"}, {"doc": "unsigned int inv[8]; unsigned int zero[8]; fe_zero(num); fe_zero(den); num[0] = 121665; den[0] = 121666; fe_inv(inv, den); fe_mul(d, num, inv); fe_zero(zero); fe_sub(d, zero, d); fe_add(d2, d, d); } /** Docstring: Copy one extended point of 32 limbs.", "kind": "function", "line": 829, "name": "ge_copy", "signature": "static void ge_copy(unsigned int *r, unsigned int *a)"}, {"doc": "Docstring: Address of limb n from a limb base.  miniGCC scales `a[i]` by 8 (its `unsigned int` slot) but adds raw bytes for `p + N`, and parses `&p[N]` on a pointer as `(&p) + 8N` (the address of the pointer variable, caught by a wild-rsp crash in `ge_scalarmult`). `&arr[N]` on arrays happens to work, but this helper is the only sanctioned limb addressing: `p + n * 8` is byte * addition of an exact scaled offset. Never use it on `char *`.", "kind": "function", "line": 845, "name": "fe_off", "signature": "static unsigned int *fe_off(unsigned int *p, int n)"}, {"doc": "Docstring: Address of limb n from a limb base.  miniGCC scales `a[i]` by 8 (its `unsigned int` slot) but adds raw bytes for `p + N`, and parses `&p[N]` on a pointer as `(&p) + 8N` (the address of the pointer variable, caught by a wild-rsp crash in `ge_scalarmult`). `&arr[N]` on arrays happens to work, but this helper is the only sanctioned limb addressing: `p + n * 8` is byte * addition of an exact scaled offset. Never use it on `char *`. static unsigned int *fe_off(unsigned int *p, int n) { return p + n * 8; } /** Docstring: Masked point select, no secret branches.", "kind": "function", "line": 850, "name": "ge_cmov", "signature": "static void ge_cmov(unsigned int *r, unsigned int *b, unsigned int flag)"}, {"doc": "return p + n * 8; } /** Docstring: Masked point select, no secret branches. static void ge_cmov(unsigned int *r, unsigned int *b, unsigned int flag) { unsigned int m = 0 - (flag & 1); int i = 0; while (i < 32) { r[i] = r[i] ^ (m & (r[i] ^ b[i])); i = i + 1; } } /** Docstring: Complete twisted-Edwards addition.", "kind": "function", "line": 860, "name": "ge_add", "signature": "static void ge_add(unsigned int *r, unsigned int *p, unsigned int *q, unsigned int *d2)"}, {"doc": "fe_mul(c, t0, d2); fe_add(t0, fe_off(p, 16), fe_off(p, 16)); fe_mul(d, t0, fe_off(q, 16)); fe_sub(e, b, a); fe_sub(f, d, c); fe_add(g, d, c); fe_add(h, b, a); fe_mul(r, e, f); fe_mul(fe_off(r, 8), g, h); fe_mul(fe_off(r, 16), f, g); fe_mul(fe_off(r, 24), e, h); } /** Docstring: Twisted-Edwards doubling for a fixed at minus one.", "kind": "function", "line": 892, "name": "ge_double", "signature": "static void ge_double(unsigned int *r, unsigned int *p)"}, {"doc": "fe_zero(na); fe_sub(na, na, a); fe_add(g, na, b); fe_sub(f, g, c); fe_zero(nb); fe_sub(nb, nb, b); fe_add(h, na, nb); fe_mul(r, e, f); fe_mul(fe_off(r, 8), g, h); fe_mul(fe_off(r, 16), f, g); fe_mul(fe_off(r, 24), e, h); } /** Docstring: Multiply a point by a 32-byte scalar.", "kind": "function", "line": 926, "name": "ge_scalarmult", "signature": "static void ge_scalarmult(unsigned int *r, unsigned int *p, char *s, unsigned int *d2)"}, {"doc": "while (i >= 0) { unsigned int bit = 0; if (((sign_byte(s, i >> 3) >> (i & 7)) & 1) == 1) bit = 1; ge_double(dbl, qq); ge_copy(qq, dbl); ge_add(dbl, qq, p, d2); ge_cmov(qq, dbl, bit); i = i - 1; } ge_copy(r, qq); } /** Docstring: Reduce sixteen limbs mod L by binary long division.", "kind": "function", "line": 951, "name": "sc_mod_l", "signature": "static void sc_mod_l(unsigned int *r, unsigned int *t16)"}, {"doc": "rem[8] = rem[8] - borrow; } s = s + 1; } b = b + 1; } k = 0; while (k < 8) { r[k] = rem[k]; k = k + 1; } } /** Docstring: Multiply two scalars with r added, all mod L.", "kind": "function", "line": 1013, "name": "sc_mul_add", "signature": "static void sc_mul_add(unsigned int *r, unsigned int *a, unsigned int *b, unsigned int *c)"}, {"doc": "carry = c0 | c1; i = i + 1; } while (i < 16) { unsigned int s = t16[i] + carry; carry = sign_carry2(t16[i], carry, s); t16[i] = s; i = i + 1; } } sc_mod_l(r, t16); } /** Docstring: Reverse 32 bytes in place, big-endian hex to limbs.", "kind": "function", "line": 1070, "name": "sign_rev32", "signature": "static void sign_rev32(char *b)"}, {"doc": "} /** Docstring: Reverse 32 bytes in place, big-endian hex to limbs. static void sign_rev32(char *b) { int i = 0; while (i < 16) { char t = b[i]; b[i] = b[31 - i]; b[31 - i] = t; i = i + 1; } } /** Docstring: Load the embedded base and key points.", "kind": "function", "line": 1081, "name": "sign_points_init", "signature": "static void sign_points_init(void)"}, {"doc": "fe_copy(fe_off(sign_gb, 8), t); fe_one(fe_off(sign_gb, 16)); fe_mul(t, sign_gb, fe_off(sign_gb, 8)); fe_copy(fe_off(sign_gb, 24), t); fe_frombytes(t, ax); fe_copy(sign_ga, t); fe_frombytes(t, ay); fe_copy(fe_off(sign_ga, 8), t); fe_one(fe_off(sign_ga, 16)); fe_mul(t, sign_ga, fe_off(sign_ga, 8)); fe_copy(fe_off(sign_ga, 24), t); } /** Docstring: Sign a 64-byte digest with the embedded seed.", "kind": "function", "line": 1112, "name": "sign_digest", "signature": "static void sign_digest(char *sig, char *digest)"}, {"doc": "while (i < 16) { t16[i] = sign_byte(hrambytes, 4 * i) | (sign_byte(hrambytes, 4 * i + 1) << 8) | (sign_byte(hrambytes, 4 * i + 2) << 16) | (sign_byte(hrambytes, 4 * i + 3) << 24); i = i + 1; } sc_mod_l(hram, t16); fe_tobytes(h32, hram); sc_mul_add(ss, hram, a, rr); sign_copy(sig, renc, 32); fe_tobytes(abuf, ss); sign_copy(sig + 32, abuf, 32); } /** Docstring: Read a whole file, capped, returning its bytes or zero.", "kind": "function", "line": 1232, "name": "sign_read", "signature": "static char *sign_read(char *name, int *len)"}, {"doc": "len = 1; buf = malloc(*len); if (buf == 0) { fclose(f); return 0; } got = fread(buf, 1, *len, f); fclose(f); if (got != *len) return 0; return buf; } /** Docstring: Write a whole file, 0 on success.", "kind": "function", "line": 1260, "name": "sign_write", "signature": "static int sign_write(char *name, char *data, int len)"}, {"doc": "/** Docstring: Write a whole file, 0 on success. static int sign_write(char *name, char *data, int len) { void *f = fopen(name, \"w\"); int got = 0; if (f == 0) return 1; got = fwrite(data, 1, len, f); fclose(f); if (got != len) return 1; return 0; } /** Docstring: Scan one PT_NOTE span for the signature descriptor.", "kind": "function", "line": 1273, "name": "sign_note_span", "signature": "static int sign_note_span(char *img, int off, int len, int *desc)"}, {"doc": "Docstring: Build the canonical digest over entry plus PT_LOADs.  File bytes below the ELF header size are excluded from the segment feeds while the entry stays bound as a value, matching * the kernel gate and tools/sign_elf.py.", "kind": "function", "line": 1307, "name": "sign_digest_of", "signature": "static int sign_digest_of(char *img, int size, int entry, char *ph, int phnum, char *digest)"}, {"doc": "sign_feed32(0); start = poff; if (start < SIGN_EHDR_SIZE) start = SIGN_EHDR_SIZE; end = poff + pfilesz; if (start < end) sign_sha_update(img + start, end - start); i = i + 1; } sign_sha_final(digest); return 0; } /** Docstring: Patch an own-key PT_NOTE slot, 1 when patched.", "kind": "function", "line": 1356, "name": "sign_patch_notes", "signature": "static int sign_patch_notes(char *img, int size, char *ph, int phnum, char *desc)"}, {"doc": "rc = sign_note_span(img, poff, pfilesz, &slot); if (rc == 1 && img[slot] == SIGN_KEY_ID) { while (k < SIGN_DESC_BYTES) { img[slot + k] = desc[k]; k = k + 1; } patched = 1; } n = n + 1; } return patched; } /** Docstring: Append a fresh signature section, 0 on success.", "kind": "function", "line": 1393, "name": "sign_append", "signature": "static int sign_append(char *name, char *img, int size, int shoff, int shnum, int shentsize,\n    ..."}, {"doc": "int sn = shnum + 1; out[60] = (char)(sn & 255); out[61] = (char)((sn >> 8) & 255); } } if (sign_write(name, out, newsize) != 0) { printf(\"sign: cannot write %s\\n\", name); return 1; } printf(\"sign: %s: signed (key %d)\\n\", name, SIGN_KEY_ID); return 0; } /** Docstring: Sign one file in place, returning an exit-style code.", "kind": "function", "line": 1529, "name": "sign_file", "signature": "static int sign_file(char *name)"}, {"doc": "Docstring: In-OS differential selftest, pinned by BDD.  Prints the SHA-512 of \"abc\" and an Ed25519 signature of the 64-zero-byte digest under the embedded development key. The BDD suite pins both lines byte-exact against python/PyNaCl oracles, so any miniGCC codegen regression in the SHA, field, curve or digest paths fails the boot suite instead of shipping bad signatures (every primitive below was differential-tested during * bringup; see the file header for the constraints they pin).", "kind": "function", "line": 1637, "name": "sign_selftest", "signature": "static int sign_selftest(void)"}, {"kind": "function", "line": 1657, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 28, "name": "printf", "signature": "int printf();"}, {"kind": "function", "line": 29, "name": "strcmp", "signature": "int strcmp();"}, {"kind": "function", "line": 30, "name": "fopen", "signature": "void *fopen();"}, {"kind": "function", "line": 31, "name": "fclose", "signature": "int fclose();"}, {"kind": "function", "line": 32, "name": "fread", "signature": "int fread();"}, {"kind": "function", "line": 33, "name": "fwrite", "signature": "int fwrite();"}, {"kind": "function", "line": 34, "name": "fseek", "signature": "int fseek();"}, {"kind": "function", "line": 35, "name": "ftell", "signature": "int ftell();"}, {"kind": "function", "line": 36, "name": "malloc", "signature": "void *malloc();"}, {"kind": "function", "line": 37, "name": "free", "signature": "void free();"}, {"kind": "macro", "line": 39, "name": "SIGN_KEY_ID", "signature": "#define SIGN_KEY_ID"}, {"kind": "macro", "line": 40, "name": "SIGN_EXIT_FAIL", "signature": "#define SIGN_EXIT_FAIL"}, {"kind": "macro", "line": 42, "name": "SIGN_ET_EXEC", "signature": "#define SIGN_ET_EXEC"}, {"kind": "macro", "line": 43, "name": "SIGN_ET_DYN", "signature": "#define SIGN_ET_DYN"}, {"kind": "macro", "line": 44, "name": "SIGN_EM_X86_64", "signature": "#define SIGN_EM_X86_64"}, {"kind": "macro", "line": 45, "name": "SIGN_PT_LOAD", "signature": "#define SIGN_PT_LOAD"}, {"kind": "macro", "line": 46, "name": "SIGN_PT_NOTE", "signature": "#define SIGN_PT_NOTE"}, {"kind": "macro", "line": 47, "name": "SIGN_SHT_NOTE", "signature": "#define SIGN_SHT_NOTE"}, {"kind": "macro", "line": 48, "name": "SIGN_EHDR_SIZE", "signature": "#define SIGN_EHDR_SIZE"}, {"kind": "macro", "line": 49, "name": "SIGN_PHDR_SIZE", "signature": "#define SIGN_PHDR_SIZE"}, {"kind": "macro", "line": 50, "name": "SIGN_SHDR_SIZE", "signature": "#define SIGN_SHDR_SIZE"}, {"kind": "macro", "line": 51, "name": "SIGN_NOTE_HDR", "signature": "#define SIGN_NOTE_HDR"}, {"kind": "macro", "line": 52, "name": "SIGN_DESC_BYTES", "signature": "#define SIGN_DESC_BYTES"}, {"kind": "macro", "line": 53, "name": "SIGN_SIG_BYTES", "signature": "#define SIGN_SIG_BYTES"}, {"kind": "macro", "line": 54, "name": "SIGN_NOTE_TOTAL", "signature": "#define SIGN_NOTE_TOTAL"}, {"kind": "macro", "line": 55, "name": "SIGN_NOTE_TYPE", "signature": "#define SIGN_NOTE_TYPE"}, {"kind": "macro", "line": 56, "name": "SIGN_MAX_FILE", "signature": "#define SIGN_MAX_FILE"}, {"kind": "macro", "line": 57, "name": "SIGN_SEEK_END", "signature": "#define SIGN_SEEK_END"}]}, {"id": "progs/src/spin.c", "kind": "module", "label": "spin.c", "language": "c", "sha256": "4c8f1ba61166963f", "symbol_count": 19, "symbols": [{"kind": "function", "line": 11, "name": "lx_syscall3", "signature": "static long lx_syscall3(long n, long a1, long a2, long a3)"}, {"kind": "function", "line": 20, "name": "lx_strlen", "signature": "static unsigned long lx_strlen(const char *s)"}, {"kind": "function", "line": 26, "name": "lx_write", "signature": "static void lx_write(const char *s)"}, {"kind": "function", "line": 30, "name": "lx_write_int", "signature": "static void lx_write_int(long v)"}, {"kind": "function", "line": 42, "name": "lx_atoi", "signature": "static long lx_atoi(const char *s)"}, {"kind": "function", "line": 66, "name": "spin_u32", "signature": "static void spin_u32(unsigned char *d, unsigned long v)"}, {"kind": "function", "line": 73, "name": "spin_hdr", "signature": "static void spin_hdr(unsigned char *d, unsigned long id, unsigned long op,\n        unsigned long ..."}, {"kind": "function", "line": 82, "name": "spin_box_ok", "signature": "static int spin_box_ok(const char *box)"}, {"kind": "function", "line": 95, "name": "spin_hex8", "signature": "static void spin_hex8(unsigned int v, char *dst)"}, {"kind": "function", "line": 104, "name": "spin_write_all", "signature": "static long spin_write_all(long fd, const unsigned char *buf, long len)"}, {"kind": "function", "line": 114, "name": "spin_emit", "signature": "static int spin_emit(const char *box, unsigned int seq,\n        const unsigned char *msg, long mlen)"}, {"kind": "function", "line": 145, "name": "spin_raw_file", "signature": "static int spin_raw_file(const char *box)"}, {"kind": "function", "line": 169, "name": "spin_pixels", "signature": "static void spin_pixels(long off)"}, {"kind": "function", "line": 181, "name": "spin_wl", "signature": "static int spin_wl(const char *box, const char *narg)"}, {"kind": "function", "line": 225, "name": "lmain", "signature": "int lmain(long argc, char **argv)"}, {"kind": "macro", "line": 56, "name": "SPIN_WLW", "signature": "#define SPIN_WLW"}, {"kind": "macro", "line": 57, "name": "SPIN_WLH", "signature": "#define SPIN_WLH"}, {"kind": "macro", "line": 58, "name": "SPIN_WLA", "signature": "#define SPIN_WLA"}, {"kind": "macro", "line": 59, "name": "SPIN_WLB", "signature": "#define SPIN_WLB"}]}, {"id": "progs/src/test.c", "kind": "module", "label": "test.c", "language": "c", "sha256": "6884c669dd0f450d", "symbol_count": 2, "symbols": [{"kind": "function", "line": 1, "name": "add", "signature": "int add(int a, int b)"}, {"kind": "function", "line": 2, "name": "main", "signature": "int main(void)"}]}, {"id": "progs/src/test.lua", "kind": "module", "label": "test.lua", "language": "lua", "sha256": "8cbb472b6e359f60", "symbol_count": 20, "symbols": [{"kind": "function", "line": 12, "name": "check"}, {"kind": "function", "line": 22, "name": "write_file"}, {"kind": "function", "line": 30, "name": "read_file"}, {"kind": "function", "line": 40, "name": "test_module_bindings"}, {"kind": "function", "line": 53, "name": "test_filesystem"}, {"kind": "function", "line": 70, "name": "test_xxhash"}, {"kind": "function", "line": 75, "name": "test_stb"}, {"kind": "function", "line": 80, "name": "test_dlmalloc"}, {"kind": "function", "line": 85, "name": "test_hello"}, {"kind": "function", "line": 90, "name": "test_ftest"}, {"kind": "function", "line": 95, "name": "test_minigcc"}, {"kind": "function", "line": 100, "name": "test_ld"}, {"kind": "function", "line": 112, "name": "test_toolchain_roundtrip"}, {"kind": "function", "line": 122, "name": "test_spawn_preserves_interpreter"}, {"kind": "function", "line": 135, "name": "test_bin_cp"}, {"kind": "function", "line": 141, "name": "test_bin_lz4"}, {"kind": "function", "line": 158, "name": "test_bin_lzss"}, {"kind": "function", "line": 175, "name": "test_bin_aes"}, {"kind": "function", "line": 194, "name": "test_bin_json"}, {"kind": "function", "line": 205, "name": "test_bin_freedom"}]}, {"doc": "test.py -- in-OS test suite for MiniOS, driven by MicroPython.  Tests every available binary sorted by size (smallest first). Graphical programs excluded: DOOM, Quake2, Nuklear, Piano, TopoGPT.  Usage (inside MiniOS): micropython src/test.py", "id": "progs/src/test.py", "kind": "module", "label": "test.py", "language": "py", "sha256": "c742ae87c3744001", "symbol_count": 20, "symbols": [{"kind": "function", "line": 15, "name": "check", "signature": "def check(name, cond, detail)"}, {"kind": "function", "line": 25, "name": "safe_run", "signature": "def safe_run()"}, {"kind": "function", "line": 38, "name": "test_module_bindings", "signature": "def test_module_bindings()"}, {"kind": "function", "line": 56, "name": "test_filesystem", "signature": "def test_filesystem()"}, {"kind": "function", "line": 72, "name": "test_xxhash", "signature": "def test_xxhash()"}, {"kind": "function", "line": 77, "name": "test_stb", "signature": "def test_stb()"}, {"kind": "function", "line": 82, "name": "test_dlmalloc", "signature": "def test_dlmalloc()"}, {"kind": "function", "line": 87, "name": "test_hello", "signature": "def test_hello()"}, {"kind": "function", "line": 92, "name": "test_ftest", "signature": "def test_ftest()"}, {"kind": "function", "line": 97, "name": "test_minigcc", "signature": "def test_minigcc()"}, {"kind": "function", "line": 102, "name": "test_ld", "signature": "def test_ld()"}, {"kind": "function", "line": 119, "name": "test_toolchain_roundtrip", "signature": "def test_toolchain_roundtrip()"}, {"kind": "function", "line": 134, "name": "test_spawn_preserves_interpreter", "signature": "def test_spawn_preserves_interpreter()"}, {"kind": "function", "line": 148, "name": "test_bin_cp", "signature": "def test_bin_cp()"}, {"kind": "function", "line": 153, "name": "test_bin_lz4", "signature": "def test_bin_lz4()"}, {"kind": "function", "line": 181, "name": "test_bin_lzss", "signature": "def test_bin_lzss()"}, {"kind": "function", "line": 209, "name": "test_bin_aes", "signature": "def test_bin_aes()"}, {"kind": "function", "line": 239, "name": "test_bin_json", "signature": "def test_bin_json()"}, {"kind": "function", "line": 253, "name": "test_bin_freedom", "signature": "def test_bin_freedom()"}, {"kind": "function", "line": 261, "name": "main", "signature": "def main()"}]}, {"doc": "test_all.sh -- comprehensive non-interactive test suite for MiniOS.  Run with:  sh src/test_all.sh  Every test prints a PASS: or FAIL: marker.  The host-side runner greps the QEMU serial log for these markers. No interactive commands, no external server dependencies.  === HELP & CLEAR ===", "id": "progs/src/test_all.sh", "kind": "module", "label": "test_all.sh", "language": "sh", "sha256": "2949ea79a98379d5", "symbol_count": 0, "symbols": []}, {"doc": "test_py.py -- in-OS Python checks for src/test_all.sh (docs/spec/python.md).  Every check prints a PASS: or FAIL: marker the host runner greps. Runs from the ramdisk with the frozen mip module and the socket-enabled MicroPython build; no network is touched (mip vectors are the offline refusals; the live install is tests/test_mip.py on the host).", "id": "progs/src/test_py.py", "kind": "module", "label": "test_py.py", "language": "py", "sha256": "ada509bc73c1a643", "symbol_count": 5, "symbols": [{"kind": "function", "line": 12, "name": "check", "signature": "def check(name, cond)"}, {"kind": "function", "line": 79, "name": "_asyncio_double", "signature": "def _asyncio_double(n, ms)"}, {"kind": "function", "line": 84, "name": "_asyncio_main", "signature": "def _asyncio_main()"}, {"kind": "function", "line": 88, "name": "_asyncio_wire_check", "signature": "def _asyncio_wire_check(host, port)"}, {"kind": "function", "line": 89, "name": "_one", "signature": "def _one()"}]}, {"doc": "thdemo.c -- Producer-consumer over mthreads (roadmap Phase 1, M1).", "id": "progs/src/thdemo.c", "kind": "module", "label": "thdemo.c", "language": "c", "sha256": "5f2cea41fb81c62c", "symbol_count": 10, "symbols": [{"kind": "function", "line": 36, "name": "producer", "signature": "static void *producer(void *p)"}, {"kind": "function", "line": 57, "name": "consumer", "signature": "static void *consumer(void *p)"}, {"kind": "function", "line": 82, "name": "main", "signature": "int main(void)"}, {"kind": "function", "line": 3, "name": "threads", "signature": "* * Ten threads (1 main + 5 producers + 4 consumers) share one address * space through thread_spawn (MiniOS syscall 225): a bounded buffer, * a spin mutex and Mesa-style spin-waits. Workers never touc"}, {"kind": "macro", "line": 21, "name": "NPROD", "signature": "#define NPROD"}, {"kind": "macro", "line": 22, "name": "NCONS", "signature": "#define NCONS"}, {"kind": "macro", "line": 23, "name": "PER_PROD", "signature": "#define PER_PROD"}, {"kind": "macro", "line": 24, "name": "BUFSZ", "signature": "#define BUFSZ"}, {"kind": "macro", "line": 26, "name": "EXPECTED_N", "signature": "#define EXPECTED_N"}, {"kind": "macro", "line": 27, "name": "EXPECTED_SUM", "signature": "#define EXPECTED_SUM"}]}, {"id": "progs/src/w1.c", "kind": "module", "label": "w1.c", "language": "c", "sha256": "af9c29beb3c5456a", "symbol_count": 2, "symbols": [{"kind": "function", "line": 3, "name": "main", "signature": "int main(void)"}, {"kind": "function", "line": 1, "name": "write", "signature": "int write(int fd, char *buf, int n);"}]}, {"doc": "tlsget - minimal HTTPS GET over the ring-3 TLS stack.", "id": "progs/tls_u/tls_u_main.c", "kind": "module", "label": "tls_u_main.c", "language": "c", "sha256": "d07870e40b8a0e32", "symbol_count": 5, "symbols": [{"kind": "function", "line": 10, "name": "syscall", "signature": "* the MiniOS DNS syscall (200, sig 0: error-check only, sends nothing).\n * The kernel keeps servi..."}, {"doc": "Strict port parser (clang-tidy cert-err34-c: atoi reports no errors, so \"abc\" and overflow both become 0 and fail open into the * default 443). All digits, at least one, value 1..65535, else -1.", "kind": "function", "line": 47, "name": "parse_port", "signature": "static int parse_port(const char *s)"}, {"kind": "function", "line": 61, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 14, "name": "_POSIX_C_SOURCE", "signature": "#define _POSIX_C_SOURCE"}, {"kind": "macro", "line": 15, "name": "_DEFAULT_SOURCE", "signature": "#define _DEFAULT_SOURCE"}]}, {"doc": "tls_u_port.c - ring-3 transport for the shared TLS stack (TLS_RING3).", "id": "progs/tls_u/tls_u_port.c", "kind": "module", "label": "tls_u_port.c", "language": "c", "sha256": "ad57ddd860cbcf0c", "symbol_count": 15, "symbols": [{"kind": "function", "line": 5, "name": "sockets", "signature": "* sockets: on the host they are host sockets (used by the\n * openssl-s_server interop test), insi..."}, {"kind": "function", "line": 39, "name": "tls_u_recv", "signature": "int tls_u_recv(int fd, char *buf, int len)"}, {"kind": "function", "line": 44, "name": "tls_u_recv_timeout", "signature": "int tls_u_recv_timeout(int fd, char *buf, int len, unsigned long ms)"}, {"kind": "function", "line": 55, "name": "tls_u_close", "signature": "void tls_u_close(int fd)"}, {"doc": "Session-aware close for multi-fetch processes (freedom follows redirects and linked stylesheets, reusing the lowest free fd number every time). The engine keys sessions by raw fd and only clears the slot on handshake error; a successful session lives until someone frees it, so plain close() leaks the slot and the next handshake on the recycled fd number fails with \"session already exists\". Freeing * an fd with no session is a safe no-op. void tls_free_fd(int fd); /* session table owner: net/tls.c", "kind": "function", "line": 67, "name": "tls_close", "signature": "void tls_close(int fd)"}, {"kind": "function", "line": 72, "name": "tls_now_days", "signature": "long tls_now_days(void)"}, {"kind": "function", "line": 78, "name": "tls_random", "signature": "void tls_random(unsigned char *out, unsigned len)"}, {"kind": "function", "line": 99, "name": "u_raw_syscall3", "signature": "static long u_raw_syscall3(long n, long a1, long a2, long a3)"}, {"doc": "Strict dotted-quad parser (clang-tidy cert-err34-c: sscanf %u has undefined overflow and accepts whitespace/sign, so \"9999999999.1.1.1\" is UB before the <256 check ever runs). Digits and dots only, four * octets 0..255, full-string consumption, else -1.", "kind": "function", "line": 122, "name": "parse_quad", "signature": "static int parse_quad(const char *s, unsigned *ip_out)"}, {"kind": "function", "line": 147, "name": "tls_u_resolve", "signature": "int tls_u_resolve(const char *host, unsigned *ip_out)"}, {"doc": "freedom's resolver name: kernel DNS value semantics (u32 host order, * -1 on failure).", "kind": "function", "line": 183, "name": "net_dns_resolve", "signature": "int net_dns_resolve(const char *host)"}, {"doc": "Session-aware close for multi-fetch processes (freedom follows redirects and linked stylesheets, reusing the lowest free fd number every time). The engine keys sessions by raw fd and only clears the slot on handshake error; a successful session lives until someone frees it, so plain close() leaks the slot and the next handshake on the recycled fd number fails with \"session already exists\". Freeing * an fd with no session is a safe no-op.", "kind": "function", "line": 66, "name": "tls_free_fd", "signature": "void tls_free_fd(int fd);"}, {"kind": "function", "line": 163, "name": "answer", "signature": "* answer (some resolvers go IPv6-only on the first query). */ memset(&hints, 0, sizeof(hints));"}, {"kind": "macro", "line": 12, "name": "_POSIX_C_SOURCE", "signature": "#define _POSIX_C_SOURCE"}, {"kind": "macro", "line": 13, "name": "_DEFAULT_SOURCE", "signature": "#define _DEFAULT_SOURCE"}]}, {"id": "progs/topogpt3/topogpt3.c", "kind": "module", "label": "topogpt3.c", "language": "c", "sha256": "2486bd152479c356", "symbol_count": 128, "symbols": [{"doc": "topogpt3 -p \"prompt\" [-n N] [-t T]   Headless mode topogpt3 -i                          Interactive mode topogpt3 -f file.txt                 Read prompt from file  #pragma GCC diagnostic ignored \"-Wunused-function\" #ifdef __has_include #if __has_include(<stdio.h>) #include <stdio.h> #include <string.h> #include <stdlib.h> #else /* MiniOS standalone: declare stdio from ld stubs", "kind": "struct", "line": 24, "name": "FILE"}, {"kind": "struct", "line": 176, "name": "LayerWeights"}, {"kind": "struct", "line": 224, "name": "ModelWeights"}, {"kind": "function", "line": 114, "name": "tg_exp", "signature": "static float tg_exp(float x)"}, {"kind": "function", "line": 128, "name": "tg_tanh", "signature": "static float tg_tanh(float x)"}, {"kind": "function", "line": 135, "name": "tg_sin", "signature": "static float tg_sin(float x)"}, {"kind": "function", "line": 144, "name": "tg_cos", "signature": "static float tg_cos(float x)"}, {"kind": "function", "line": 148, "name": "tg_fabs", "signature": "static float tg_fabs(float x)"}, {"kind": "function", "line": 152, "name": "tg_log", "signature": "static float tg_log(float x)"}, {"kind": "function", "line": 164, "name": "tg_fmax", "signature": "static float tg_fmax(float a, float b)"}, {"kind": "function", "line": 168, "name": "tg_fmin", "signature": "static float tg_fmin(float a, float b)"}, {"kind": "function", "line": 255, "name": "load_vocab", "signature": "static void load_vocab(const char *path)"}, {"kind": "function", "line": 296, "name": "build_torus_graph", "signature": "static void build_torus_graph(void)"}, {"kind": "function", "line": 327, "name": "precompute_rope", "signature": "static void precompute_rope(void)"}, {"kind": "function", "line": 359, "name": "matvec", "signature": "static void matvec(const float *W, const float *x, float *y, int rows, int cols)"}, {"kind": "function", "line": 370, "name": "matvec_bias", "signature": "static void matvec_bias(const float *W, const float *b, const float *x, float *y,\n               ..."}, {"kind": "function", "line": 382, "name": "rmsnorm", "signature": "static void rmsnorm(const float *x, const float *w, float *y, int d)"}, {"kind": "function", "line": 391, "name": "softmax", "signature": "static void softmax(float *x, int n)"}, {"kind": "function", "line": 400, "name": "gelu", "signature": "static void gelu(float *x, int n)"}, {"kind": "function", "line": 410, "name": "silu", "signature": "static void silu(float *x, int n)"}, {"kind": "function", "line": 418, "name": "swiglu", "signature": "static void swiglu(const float *gate_w, const float *up_w, const float *down_w,\n                 ..."}, {"kind": "function", "line": 435, "name": "quat_normalize", "signature": "static void quat_normalize(float *q)"}, {"kind": "function", "line": 440, "name": "quat_hamilton", "signature": "static void quat_hamilton(const float *a, const float *b, float *c)"}, {"doc": "static void quat_normalize(float *q) { float n = tg_sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]); if (n > 1e-8f) { q[0]/=n; q[1]/=n; q[2]/=n; q[3]/=n; } } static void quat_hamilton(const float *a, const float *b, float *c) { c[0] = a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]; c[1] = a[0]*b[1] + a[1]*b[0] + a[2]*b[3] - a[3]*b[2]; c[2] = a[0]*b[2] - a[1]*b[3] + a[2]*b[0] + a[3]*b[1]; c[3] = a[0]*b[3] + a[1]*b[2] - a[2]*b[1] + a[3]*b[0]; } /* QuaternionLinear: x[w,x,y,z] -> y[w,x,y,z]", "kind": "function", "line": 448, "name": "quat_linear", "signature": "static void quat_linear(const float *Ww, const float *Wx, const float *Wy, const float *Wz,\n     ..."}, {"kind": "function", "line": 505, "name": "ifft_radix2", "signature": "static void ifft_radix2(float *real, float *imag, int n)"}, {"doc": "cur_r = nr; } } } } static void ifft_radix2(float *real, float *imag, int n) { int i; for (i = 0; i < n; i++) imag[i] = -imag[i]; fft_radix2(real, imag, n); for (i = 0; i < n; i++) { real[i] /= (float)n; imag[i] = -imag[i] / (float)n; } } /* Real FFT: x[n] -> X[n/2+1] complex", "kind": "function", "line": 513, "name": "rfft", "signature": "static void rfft(const float *x, float *Xr, float *Xi, int n)"}, {"doc": "fft_radix2(real, imag, n); for (i = 0; i < n; i++) { real[i] /= (float)n; imag[i] = -imag[i] / (float)n; } } /* Real FFT: x[n] -> X[n/2+1] complex static void rfft(const float *x, float *Xr, float *Xi, int n) { float re[n], im[n]; int i; for (i = 0; i < n; i++) { re[i] = x[i]; im[i] = 0.0f; } fft_radix2(re, im, n); for (i = 0; i <= n/2; i++) { Xr[i] = re[i]; Xi[i] = im[i]; } } /* Inverse real FFT: X[n/2+1] complex -> x[n]", "kind": "function", "line": 522, "name": "irfft", "signature": "static void irfft(const float *Xr, const float *Xi, float *x, int n)"}, {"kind": "function", "line": 537, "name": "filter1d", "signature": "static void filter1d(const float *x, const float *kr, const float *ki,\n                      floa..."}, {"kind": "function", "line": 580, "name": "ifft2d", "signature": "static void ifft2d(float *data_r, float *data_i, int h, int w)"}, {"doc": "ifft_radix2(row_re, row_im, w); for (c = 0; c < w; c++) { re[r*w+c] = row_re[c]; im[r*w+c] = row_im[c]; } } /* IFFT columns float col_re[h], col_im[h]; for (c = 0; c < w; c++) { for (r = 0; r < h; r++) { col_re[r] = re[r*w+c]; col_im[r] = im[r*w+c]; } ifft_radix2(col_re, col_im, h); for (r = 0; r < h; r++) { re[r*w+c] = col_re[r]; im[r*w+c] = col_im[r]; } } for (i = 0; i < h * w; i++) { data_r[i] = re[i]; data_i[i] = im[i]; } } /* RFFT2: 2D real FFT, output is [h][w/2+1] complex", "kind": "function", "line": 602, "name": "rfft2d_real", "signature": "static void rfft2d_real(const float *data, float *out_r, float *out_i,\n                         i..."}, {"doc": "for (r = 0; r < h; r++) { col_re[r] = re[r*w+c]; col_im[r] = im[r*w+c]; } fft_radix2(col_re, col_im, h); for (r = 0; r < h; r++) { re[r*w+c] = col_re[r]; im[r*w+c] = col_im[r]; } } int fw = w / 2 + 1; for (r = 0; r < h; r++) { for (c = 0; c < fw; c++) { out_r[r * fw + c] = re[r * w + c]; out_i[r * fw + c] = im[r * w + c]; } } } /* IRFFT2: inverse of rfft2d_real", "kind": "function", "line": 629, "name": "irfft2d", "signature": "static void irfft2d(const float *in_r, const float *in_i, float *out,\n                     int h,..."}, {"doc": "====================================================================== SECTION 11: QUATERNION SPECTRAL LAYER 2D * ====================================================================== /* Complex multiply: (ar+bi)(cr+di) = (ac-bd)+(ad+bc)i", "kind": "function", "line": 664, "name": "cmul", "signature": "static void cmul(float ar, float ai, float cr, float di, float *rr, float *ri)"}, {"doc": "====================================================================== SECTION 11: QUATERNION SPECTRAL LAYER 2D * ====================================================================== /* Complex multiply: (ar+bi)(cr+di) = (ac-bd)+(ad+bc)i static void cmul(float ar, float ai, float cr, float di, float *rr, float *ri) { rr = ar*cr - ai*di; ri = ar*di + ai*cr; } /* Contract: Y[o,h,w] = sum_i W[i,o,h,w] * X[b,i,h,w] (complex)", "kind": "function", "line": 670, "name": "spectral_contract", "signature": "static void spectral_contract(const float *Wr, const float *Wi,\n                               co..."}, {"kind": "function", "line": 695, "name": "quat_spectral_layer_2d", "signature": "static void quat_spectral_layer_2d(\n    const float *x, float *y,\n    const float *kr_w, const fl..."}, {"kind": "function", "line": 785, "name": "spectral_ae_encode", "signature": "static void spectral_ae_encode(const float *x, float *z, const LayerWeights *lw)"}, {"kind": "function", "line": 793, "name": "spectral_ae_decode", "signature": "static void spectral_ae_decode(const float *z, float *x, const LayerWeights *lw)"}, {"kind": "function", "line": 800, "name": "process_torus_grid", "signature": "static void process_torus_grid(const float *grid, float *out, const LayerWeights *lw)"}, {"kind": "function", "line": 821, "name": "torus_soft_assign", "signature": "static void torus_soft_assign(const float *phi1, const float *phi2,\n                             ..."}, {"kind": "function", "line": 843, "name": "message_passing", "signature": "static void message_passing(const float *node_feat, float *out,\n                             cons..."}, {"kind": "function", "line": 888, "name": "torus_brain_forward", "signature": "static void torus_brain_forward(const float *x, float *out, float *recon_loss,\n                  ..."}, {"kind": "function", "line": 978, "name": "attention_forward", "signature": "static void attention_forward(const float *x, float *out, int layer_idx, int pos, int total_kv_co..."}, {"kind": "function", "line": 1078, "name": "moe_forward", "signature": "static void moe_forward(const float *x, float *out, const LayerWeights *lw)"}, {"kind": "function", "line": 1128, "name": "forward", "signature": "static void forward(const int *token_ids, int seq_len, float *logits_out)"}, {"kind": "function", "line": 1195, "name": "tokenize_string", "signature": "static int tokenize_string(const char *text, int *tokens, int max_tokens)"}, {"kind": "function", "line": 1210, "name": "apply_temperature", "signature": "static void apply_temperature(float *logits, int n, float temp)"}, {"kind": "function", "line": 1216, "name": "apply_repetition_penalty", "signature": "static void apply_repetition_penalty(float *logits, int n, const int *tokens,\n                   ..."}, {"kind": "function", "line": 1229, "name": "apply_top_k", "signature": "static void apply_top_k(float *logits, int n, int k)"}, {"kind": "function", "line": 1248, "name": "sample", "signature": "static int sample(const float *logits, int n)"}, {"kind": "function", "line": 1282, "name": "load_weights", "signature": "static int load_weights(const char *path)"}, {"kind": "function", "line": 1452, "name": "load_weights_fp16", "signature": "static int load_weights_fp16(const char *path)"}, {"doc": "printf(\"  Layer %d loaded\\n\", i); } READ_TENSOR16(W.final_norm, D_MODEL); #undef SKIP_TENSOR16 #undef READ_TENSOR16 fclose(f); printf(\"Weights loaded successfully (fp16).\\n\"); return 0; } /* Auto-detect format and load weights", "kind": "function", "line": 1583, "name": "load_weights_auto", "signature": "static int load_weights_auto(const char *path)"}, {"doc": "====================================================================== SECTION 20: TIMING * ====================================================================== /* Portable wall-clock timer using rdtsc where available, else microseconds", "kind": "function", "line": 1600, "name": "time_now_ms", "signature": "static double time_now_ms(void)"}, {"kind": "function", "line": 1614, "name": "decode_token", "signature": "static void decode_token(int tid)"}, {"doc": "if (tid < 256) { /* Map GPT-2 byte-level encoding back to original byte int n = tid; if (n < 94) n += 33; else if (n < 163) n += 161 - 94; else n += 173 - 163; putchar(n); } else { /* Multi-byte token: output placeholder or skip putchar('?'); } } /* Load pre-tokenized binary file (format: \"TKID\" + uint32 count + int32 ids[])", "kind": "function", "line": 1629, "name": "load_token_file", "signature": "static int load_token_file(const char *path, int *out_ids, int max_ids)"}, {"doc": "if (fread(&n, 4, 1, f) != 1) { fclose(f); return 0; } if (n > (unsigned)max_ids) n = max_ids; int count = (int)n; int i; for (i = 0; i < count; i++) { int id; if (fread(&id, 4, 1, f) != 1) break; out_ids[i] = id; } fclose(f); return count; } /* Decode token ID using loaded vocabulary", "kind": "function", "line": 1652, "name": "decode_token_tiktoken", "signature": "static void decode_token_tiktoken(int tid)"}, {"kind": "function", "line": 1661, "name": "generate_tokens", "signature": "static void generate_tokens(int *prompt_tokens, int n_prompt, int max_new_tokens,\n               ..."}, {"kind": "function", "line": 1725, "name": "generate", "signature": "static void generate(const char *prompt, int max_new_tokens, float temperature,\n                 ..."}, {"kind": "function", "line": 1736, "name": "interactive_mode", "signature": "static void interactive_mode(void)"}, {"kind": "function", "line": 1850, "name": "print_help", "signature": "static void print_help(void)"}, {"kind": "function", "line": 1885, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 28, "name": "printf", "signature": "extern int printf(const char *, ...);"}, {"kind": "function", "line": 29, "name": "fprintf", "signature": "extern int fprintf(FILE *, const char *, ...);"}, {"kind": "function", "line": 30, "name": "sprintf", "signature": "extern int sprintf(char *, const char *, ...);"}, {"kind": "function", "line": 31, "name": "snprintf", "signature": "extern int snprintf(char *, unsigned long, const char *, ...);"}, {"kind": "function", "line": 32, "name": "puts", "signature": "extern int puts(const char *);"}, {"kind": "function", "line": 33, "name": "putchar", "signature": "extern int putchar(int);"}, {"kind": "function", "line": 34, "name": "fputc", "signature": "extern int fputc(int, FILE *);"}, {"kind": "function", "line": 35, "name": "fputs", "signature": "extern int fputs(const char *, FILE *);"}, {"kind": "function", "line": 36, "name": "fopen", "signature": "extern FILE *fopen(const char *, const char *);"}, {"kind": "function", "line": 37, "name": "fclose", "signature": "extern int fclose(FILE *);"}, {"kind": "function", "line": 38, "name": "fread", "signature": "extern unsigned long fread(void *, unsigned long, unsigned long, FILE *);"}, {"kind": "function", "line": 39, "name": "fwrite", "signature": "extern unsigned long fwrite(const void *, unsigned long, unsigned long, FILE *);"}, {"kind": "function", "line": 40, "name": "fseek", "signature": "extern int fseek(FILE *, long, int);"}, {"kind": "function", "line": 41, "name": "ftell", "signature": "extern long ftell(FILE *);"}, {"kind": "function", "line": 42, "name": "fflush", "signature": "extern int fflush(FILE *);"}, {"doc": "define NULL ((void*)0) define SEEK_SET 0 define SEEK_CUR 1 define SEEK_END 2", "kind": "function", "line": 47, "name": "malloc", "signature": "extern void *malloc(unsigned long);"}, {"kind": "function", "line": 48, "name": "free", "signature": "extern void free(void *);"}, {"kind": "function", "line": 49, "name": "memcpy", "signature": "extern void *memcpy(void *, const void *, unsigned long);"}, {"kind": "function", "line": 50, "name": "memset", "signature": "extern void *memset(void *, int, unsigned long);"}, {"kind": "function", "line": 51, "name": "strcmp", "signature": "extern int strcmp(const char *, const char *);"}, {"kind": "function", "line": 52, "name": "strncmp", "signature": "extern int strncmp(const char *, const char *, unsigned long);"}, {"kind": "function", "line": 53, "name": "strlen", "signature": "extern unsigned long strlen(const char *);"}, {"kind": "function", "line": 54, "name": "strstr", "signature": "extern char *strstr(const char *, const char *);"}, {"kind": "variable", "line": 25, "name": "stdin", "signature": "extern FILE *stdin;"}, {"kind": "variable", "line": 26, "name": "stdout", "signature": "extern FILE *stdout;"}, {"kind": "variable", "line": 27, "name": "stderr", "signature": "extern FILE *stderr;"}, {"kind": "macro", "line": 43, "name": "NULL", "signature": "#define NULL"}, {"kind": "macro", "line": 44, "name": "SEEK_SET", "signature": "#define SEEK_SET"}, {"kind": "macro", "line": 45, "name": "SEEK_CUR", "signature": "#define SEEK_CUR"}, {"kind": "macro", "line": 46, "name": "SEEK_END", "signature": "#define SEEK_END"}, {"kind": "macro", "line": 65, "name": "VOCAB_SIZE", "signature": "#define VOCAB_SIZE"}, {"kind": "macro", "line": 66, "name": "D_MODEL", "signature": "#define D_MODEL"}, {"kind": "macro", "line": 67, "name": "N_HEADS", "signature": "#define N_HEADS"}, {"kind": "macro", "line": 68, "name": "N_KV_HEADS", "signature": "#define N_KV_HEADS"}, {"kind": "macro", "line": 69, "name": "GQA_GROUPS", "signature": "#define GQA_GROUPS"}, {"kind": "macro", "line": 70, "name": "D_HEAD", "signature": "#define D_HEAD"}, {"kind": "macro", "line": 71, "name": "D_QUAT", "signature": "#define D_QUAT"}, {"kind": "macro", "line": 72, "name": "N_LAYERS", "signature": "#define N_LAYERS"}, {"kind": "macro", "line": 73, "name": "MAX_SEQ_LEN", "signature": "#define MAX_SEQ_LEN"}, {"kind": "macro", "line": 74, "name": "N_EXPERTS", "signature": "#define N_EXPERTS"}, {"kind": "macro", "line": 75, "name": "MOE_TOP_K", "signature": "#define MOE_TOP_K"}, {"kind": "macro", "line": 76, "name": "N_NODES", "signature": "#define N_NODES"}, {"kind": "macro", "line": 77, "name": "N_RADIAL", "signature": "#define N_RADIAL"}, {"kind": "macro", "line": 78, "name": "N_ANGULAR", "signature": "#define N_ANGULAR"}, {"kind": "macro", "line": 79, "name": "N_EDGE_TYPES", "signature": "#define N_EDGE_TYPES"}, {"kind": "macro", "line": 80, "name": "N_EDGES", "signature": "#define N_EDGES"}, {"kind": "macro", "line": 81, "name": "SPECTRAL_LATENT_DIM", "signature": "#define SPECTRAL_LATENT_DIM"}, {"kind": "macro", "line": 82, "name": "D_LAT_Q", "signature": "#define D_LAT_Q"}, {"kind": "macro", "line": 83, "name": "TORUS_GRID_H", "signature": "#define TORUS_GRID_H"}, {"kind": "macro", "line": 84, "name": "TORUS_GRID_W", "signature": "#define TORUS_GRID_W"}, {"kind": "macro", "line": 85, "name": "FREQ_W", "signature": "#define FREQ_W"}, {"kind": "macro", "line": 86, "name": "N_SPECTRAL_LAYERS", "signature": "#define N_SPECTRAL_LAYERS"}, {"kind": "macro", "line": 87, "name": "EXPERT_INNER", "signature": "#define EXPERT_INNER"}, {"kind": "macro", "line": 88, "name": "READOUT_INNER", "signature": "#define READOUT_INNER"}, {"kind": "macro", "line": 89, "name": "EOS_TOKEN", "signature": "#define EOS_TOKEN"}, {"kind": "macro", "line": 90, "name": "EMBED_INNER", "signature": "#define EMBED_INNER"}, {"kind": "macro", "line": 91, "name": "PI", "signature": "#define PI"}, {"kind": "macro", "line": 92, "name": "EPS_RMS", "signature": "#define EPS_RMS"}, {"kind": "macro", "line": 93, "name": "TORUS_TEMP", "signature": "#define TORUS_TEMP"}, {"kind": "macro", "line": 94, "name": "MAX_TOKENS", "signature": "#define MAX_TOKENS"}, {"kind": "macro", "line": 95, "name": "MAX_PROMPT_LEN", "signature": "#define MAX_PROMPT_LEN"}, {"kind": "macro", "line": 96, "name": "MAX_LINE", "signature": "#define MAX_LINE"}, {"kind": "macro", "line": 97, "name": "TOK_TAB_SIZE", "signature": "#define TOK_TAB_SIZE"}, {"kind": "macro", "line": 98, "name": "TOK_VOCAB_SIZE", "signature": "#define TOK_VOCAB_SIZE"}, {"kind": "macro", "line": 1300, "name": "SKIP_TENSOR", "signature": "#define SKIP_TENSOR()"}, {"kind": "macro", "line": 1310, "name": "READ_TENSOR", "signature": "#define READ_TENSOR(dest, count)"}, {"kind": "macro", "line": 1470, "name": "SKIP_TENSOR16", "signature": "#define SKIP_TENSOR16()"}, {"kind": "macro", "line": 1480, "name": "READ_TENSOR16", "signature": "#define READ_TENSOR16(dest, count)"}]}, {"doc": "vedit IDE build and run contract.", "id": "progs/vedit/vedit.c", "kind": "module", "label": "vedit.c", "language": "c", "sha256": "71688400de97ee6a", "symbol_count": 245, "symbols": [{"doc": "#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <sys/stat.h> #include \"nuklear.h\" #include \"nuklear_minios.h\" #include \"nuklear_theme.h\" #define MINIOS_LEAKCHECK_IMPL #define MINIOS_LK_ENABLE #include \"leakcheck.h\" /** Platform syscalls vedit needs beyond the platform layer.", "kind": "function", "line": 38, "name": "vedit_getc_raw", "signature": "static long vedit_getc_raw(long blocking)"}, {"doc": "#define MINIOS_LEAKCHECK_IMPL #define MINIOS_LK_ENABLE #include \"leakcheck.h\" /** Platform syscalls vedit needs beyond the platform layer. static long vedit_getc_raw(long blocking) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GETC_RAW), \"D\"(blocking) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Set the graphics window title.", "kind": "function", "line": 47, "name": "vedit_set_title", "signature": "static long vedit_set_title(const char *t)"}, {"doc": ": \"rcx\", \"r11\", \"memory\"); return ret; } /** Set the graphics window title. static long vedit_set_title(const char *t) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_GFX_SET_TITLE), \"D\"(t) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Run a program through SYS_SPAWN, preserving the IDE across the child.", "kind": "function", "line": 56, "name": "vedit_spawn", "signature": "static long vedit_spawn(const char *path, const char *redir, int argc,\n                        co..."}, {"doc": "/** Run a program through SYS_SPAWN, preserving the IDE across the child. static long vedit_spawn(const char *path, const char *redir, int argc, const char **argv) { long ret; register long r10 __asm__(\"r10\") = (long)argv; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_SPAWN), \"D\"(path), \"S\"(redir), \"d\"((long)argc), \"r\"(r10) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Release or reclaim the display so toolchain output stays on the terminal.", "kind": "function", "line": 68, "name": "vedit_vga", "signature": "static long vedit_vga(int on)"}, {"doc": "Force cooked keyboard mode: GETC_RAW (this editor's only key source) starves while raw mode diverts PS/2 bytes to the raw queue, so vedit asserts its requirement at startup instead of inheriting the * launcher's mode (a file-browser spawn left raw on and all keys died).", "kind": "function", "line": 80, "name": "vedit_kbd_raw", "signature": "static long vedit_kbd_raw(int on)"}, {"doc": "Force cooked keyboard mode: GETC_RAW (this editor's only key source) starves while raw mode diverts PS/2 bytes to the raw queue, so vedit asserts its requirement at startup instead of inheriting the * launcher's mode (a file-browser spawn left raw on and all keys died). static long vedit_kbd_raw(int on) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_KBD_RAW), \"D\"((long)on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Wall-clock milliseconds for the cross-frame ESC-sequence timeout.", "kind": "function", "line": 89, "name": "vedit_time_ms", "signature": "static unsigned long vedit_time_ms(void)"}, {"doc": ": \"a\"(MINIOS_SYS_KBD_RAW), \"D\"((long)on) : \"rcx\", \"r11\", \"memory\"); return ret; } /** Wall-clock milliseconds for the cross-frame ESC-sequence timeout. static unsigned long vedit_time_ms(void) { long ret; __asm__ volatile(\"syscall\" : \"=a\"(ret) : \"a\"(MINIOS_SYS_TIME) : \"rcx\", \"r11\", \"memory\"); return (unsigned long)ret; } /** Shared clipboard: SET copies in (249), GET copies out (250).", "kind": "function", "line": 97, "name": "vedit_clip_set", "signature": "static long vedit_clip_set(const char *s, long len)"}, {"kind": "function", "line": 105, "name": "vedit_clip_get", "signature": "static long vedit_clip_get(char *out, long cap)"}, {"doc": "/* ---- Decoded keys above any byte ---- #define VEDIT_KEY_UP 1000 #define VEDIT_KEY_DOWN 1001 #define VEDIT_KEY_LEFT 1002 #define VEDIT_KEY_RIGHT 1003 #define VEDIT_KEY_HOME 1004 #define VEDIT_KEY_END 1005 #define VEDIT_KEY_PGUP 1006 #define VEDIT_KEY_PGDN 1007 #define VEDIT_KEY_DEL 1008 #define VEDIT_KEY_ESC 1009 /* ---- Theme: every ink named once, used everywhere ----", "kind": "function", "line": 183, "name": "vedit_c_bg", "signature": "static struct nk_color vedit_c_bg(void)"}, {"kind": "function", "line": 184, "name": "vedit_c_gutter", "signature": "static struct nk_color vedit_c_gutter(void)"}, {"kind": "function", "line": 185, "name": "vedit_c_default", "signature": "static struct nk_color vedit_c_default(void)"}, {"kind": "function", "line": 186, "name": "vedit_c_keyword", "signature": "static struct nk_color vedit_c_keyword(void)"}, {"kind": "function", "line": 187, "name": "vedit_c_string", "signature": "static struct nk_color vedit_c_string(void)"}, {"kind": "function", "line": 188, "name": "vedit_c_comment", "signature": "static struct nk_color vedit_c_comment(void)"}, {"kind": "function", "line": 189, "name": "vedit_c_number", "signature": "static struct nk_color vedit_c_number(void)"}, {"kind": "function", "line": 190, "name": "vedit_c_preproc", "signature": "static struct nk_color vedit_c_preproc(void)"}, {"kind": "function", "line": 191, "name": "vedit_c_header", "signature": "static struct nk_color vedit_c_header(void)"}, {"kind": "function", "line": 192, "name": "vedit_c_headtxt", "signature": "static struct nk_color vedit_c_headtxt(void)"}, {"kind": "function", "line": 193, "name": "vedit_c_status", "signature": "static struct nk_color vedit_c_status(void)"}, {"kind": "function", "line": 194, "name": "vedit_c_cursor", "signature": "static struct nk_color vedit_c_cursor(void)"}, {"kind": "function", "line": 196, "name": "vedit_ink", "signature": "static struct nk_color vedit_ink(int col)"}, {"kind": "function", "line": 361, "name": "vedit_set_msg", "signature": "static void vedit_set_msg(const char *s)"}, {"kind": "function", "line": 368, "name": "vedit_is_alpha", "signature": "static int vedit_is_alpha(int c)"}, {"kind": "function", "line": 372, "name": "vedit_is_digit", "signature": "static int vedit_is_digit(int c)"}, {"kind": "function", "line": 376, "name": "vedit_is_wordc", "signature": "static int vedit_is_wordc(int c)"}, {"kind": "function", "line": 380, "name": "vedit_is_kw", "signature": "static int vedit_is_kw(const char *table, const char *word, int wlen)"}, {"kind": "function", "line": 403, "name": "separators", "signature": "* allow_quote exists because C digit separators (1'000'000) are not\n * valid in Python/Lua number..."}, {"kind": "function", "line": 426, "name": "vedit_parse_number", "signature": "static int vedit_parse_number(const char *t, int len, int i, int allow_quote)"}, {"kind": "function", "line": 441, "name": "vedit_parse_keyword", "signature": "static int vedit_parse_keyword(const char *t, int len, int i,\n                               cons..."}, {"doc": "int wl = 0; int j = i; int k; while (j < len && vedit_is_wordc((unsigned char)t[j])) { if (wl < VEDIT_WORD_MAX - 1) w[wl++] = t[j]; j++; } if (vedit_is_kw(kw_table, w, wl)) { for (k = i; k < j; k++) vedit_cell[k] = VEDIT_COL_KEYWORD; } return j; } /** Map a file name to its highlight language.", "kind": "function", "line": 458, "name": "vedit_lang_of", "signature": "static int vedit_lang_of(const char *fname)"}, {"kind": "function", "line": 479, "name": "vedit_lang_name", "signature": "static const char *vedit_lang_name(int lang)"}, {"doc": "} /** Name a highlight language for the status row. static const char *vedit_lang_name(int lang) { if (lang == VEDIT_LANG_C) return \"C\"; if (lang == VEDIT_LANG_PY) return \"Python\"; if (lang == VEDIT_LANG_LUA) return \"Lua\"; if (lang == VEDIT_LANG_ASM) return \"Asm\"; if (lang == VEDIT_LANG_LISP) return \"Lisp\"; return \"text\"; } /* Paint one line into vedit_cell; returns the state for the next line.", "kind": "function", "line": 489, "name": "vedit_scan_line", "signature": "static int vedit_scan_line(const char *t, int len, int st)"}, {"doc": "} else if (c == '\"' || c == '\\'') { i = vedit_parse_string(t, len, i); } else if (vedit_is_digit(c)) { i = vedit_parse_number(t, len, i, 0); } else if (vedit_is_alpha(c)) { i = vedit_parse_keyword(t, len, i, vedit_kw_lua); } else { i++; } } return 0; } /* Multi-line state at the start of a row: replay earlier lines.", "kind": "function", "line": 760, "name": "vedit_state_at", "signature": "static int vedit_state_at(int row)"}, {"kind": "function", "line": 769, "name": "vedit_row_ptr", "signature": "static char *vedit_row_ptr(int idx)"}, {"kind": "function", "line": 773, "name": "vedit_clamp", "signature": "static void vedit_clamp(void)"}, {"kind": "function", "line": 785, "name": "vedit_follow", "signature": "static void vedit_follow(void)"}, {"kind": "function", "line": 798, "name": "vedit_insert_char", "signature": "static void vedit_insert_char(int c)"}, {"kind": "function", "line": 836, "name": "vedit_delete_line_at", "signature": "static void vedit_delete_line_at(int idx)"}, {"kind": "function", "line": 847, "name": "vedit_backspace", "signature": "static void vedit_backspace(void)"}, {"kind": "function", "line": 883, "name": "vedit_delete_char", "signature": "static void vedit_delete_char(void)"}, {"kind": "function", "line": 916, "name": "vedit_split", "signature": "static void vedit_split(void)"}, {"kind": "function", "line": 969, "name": "vedit_tab", "signature": "static void vedit_tab(void)"}, {"doc": "Upper/lower/capitalize a NUL string in place; mode 1=upper, 2=lower, * 3=capitalize. Pure: the host suite mirrors it byte for byte.", "kind": "function", "line": 1005, "name": "vedit_str_case", "signature": "static void vedit_str_case(char *s, int mode)"}, {"doc": "new_word = 0; } else { if (new_word) { if (c >= 'a' && c <= 'z') s[i] = (char)(c - 32); new_word = 0; } else { if (c >= 'A' && c <= 'Z') s[i] = (char)(c + 32); } } i++; } } /** Transpose two adjacent bytes around dot; pure string core of ^T.", "kind": "function", "line": 1032, "name": "vedit_str_transpose", "signature": "static void vedit_str_transpose(char *s, int len, int pos)"}, {"doc": "Minimal magic matcher (uemacs search.c subset): '.' any, '*' repeat, '^'/'$' anchors, '[...]' classes with ranges and '^' negation. Returns 1 on a match of pat against the prefix of text, with *mlen set to the * matched length. Pure: host suite pins every vector.", "kind": "function", "line": 1044, "name": "vedit_magic_class", "signature": "static int vedit_magic_class(int c, const char *cls)"}, {"kind": "function", "line": 1066, "name": "vedit_magic_atom", "signature": "static int vedit_magic_atom(const char *pat, int c, int *atom_len)"}, {"kind": "function", "line": 1089, "name": "vedit_magic_here", "signature": "static int vedit_magic_here(const char *text, const char *pat, int *mlen)"}, {"doc": "if (vedit_magic_here(text + k, rest, &sub)) { mlen = total + k + sub; return 1; } if (k == 0) break; } return 0; } } mlen = total; return 1; } /** Match pat anywhere in text; anchored when pat starts with '^'.", "kind": "function", "line": 1150, "name": "vedit_magic_match", "signature": "static int vedit_magic_match(const char *text, const char *pat, int *mlen)"}, {"kind": "function", "line": 1179, "name": "vedit_buf_alloc", "signature": "static int vedit_buf_alloc(int idx)"}, {"kind": "function", "line": 1207, "name": "vedit_next_buffer", "signature": "static int vedit_next_buffer(void)"}, {"kind": "function", "line": 1221, "name": "vedit_hist_push", "signature": "static void vedit_hist_push(const char *fname)"}, {"kind": "function", "line": 1240, "name": "vedit_set_mark", "signature": "static void vedit_set_mark(void)"}, {"doc": "for (k = 0; k < VEDIT_HIST_N - 1; k++) memcpy(vedit_hist[k], vedit_hist[k + 1], VEDIT_FNAME_MAX); memcpy(vedit_hist[VEDIT_HIST_N - 1], fname, n + 1); } } static void vedit_set_mark(void) { vedit_mark_on = 1; vedit_mark_y = vedit_cy; vedit_mark_x = vedit_cx; vedit_set_msg(\"mark set\"); } /** Region bounds in buffer order; returns 0 when no usable region.", "kind": "function", "line": 1248, "name": "vedit_region", "signature": "static int vedit_region(int *y0, int *x0, int *y1, int *x1)"}, {"doc": "int t = *y0; y0 = *y1; y1 = t; t = *x0; x0 = *x1; x1 = t; } if (*y0 == *y1 && *x0 == *x1) return 0; if (*y0 >= vedit_count) return 0; if (*y1 >= vedit_count) *y1 = vedit_count - 1; return 1; } /** Copy the region into the kill ring head (uemacs copy-region).", "kind": "function", "line": 1269, "name": "vedit_copy_region", "signature": "static int vedit_copy_region(void)"}, {"doc": "if (a > vedit_used[y]) a = vedit_used[y]; if (b > vedit_used[y]) b = vedit_used[y]; for (k = a; k < b && pos < VEDIT_KILL_MAX - 1; k++) vedit_kill[vedit_kill_head][pos++] = vedit_row_ptr(y)[k]; if (y < y1 && pos < VEDIT_KILL_MAX - 1) vedit_kill[vedit_kill_head][pos++] = '\\n'; } vedit_kill[vedit_kill_head][pos] = 0; vedit_kill_len[vedit_kill_head] = pos; vedit_set_msg(\"copied\"); return 0; } /** Delete the region after copying it (uemacs kill-region).", "kind": "function", "line": 1299, "name": "vedit_kill_region", "signature": "static int vedit_kill_region(void)"}, {"doc": "} for (k = 0; k < tail; k++) first[x0 + k] = last[x1 + k]; vedit_used[y0] = x0 + tail; for (y = y1; y > y0; y--) vedit_delete_line_at(y); vedit_cy = y0; vedit_cx = x0; } vedit_mark_on = 0; vedit_dirty = 1; vedit_set_msg(\"killed\"); return 0; } /** Kill to end of line, or the newline itself when already at it.", "kind": "function", "line": 1345, "name": "vedit_kill_line", "signature": "static int vedit_kill_line(void)"}, {"doc": "vedit_kill[vedit_kill_head][0] = '\\n'; vedit_kill[vedit_kill_head][1] = 0; vedit_kill_len[vedit_kill_head] = 1; vedit_delete_char(); vedit_set_msg(\"killed\"); vedit_dirty = 1; return 0; } vedit_dirty = 1; vedit_set_msg(\"killed\"); return 0; } /** Yank the ring head at dot (uemacs yank).", "kind": "function", "line": 1383, "name": "vedit_yank", "signature": "static int vedit_yank(void)"}, {"doc": "vedit_row_ptr(vedit_cy)[vedit_cx] = s[k]; vedit_cx++; vedit_dirty = 1; } else { vedit_insert_char((unsigned char)s[k]); if (vedit_msg[0]) return -1; } } } vedit_msg[0] = 0; return 0; } /** Word motion core: dir +1 forward, -1 back.", "kind": "function", "line": 1416, "name": "vedit_word_move", "signature": "static int vedit_word_move(int dir)"}, {"doc": "vedit_cx = vedit_used[vedit_cy]; return 0; } while (vedit_cx > 0 && !vedit_is_wordc((unsigned char)l[vedit_cx - 1])) vedit_cx--; while (vedit_cx > 0 && vedit_is_wordc((unsigned char)l[vedit_cx - 1])) vedit_cx--; return 0; } } /** Apply case mode to the word at/after dot (uemacs word.c).", "kind": "function", "line": 1451, "name": "vedit_case_word", "signature": "static int vedit_case_word(int mode)"}, {"doc": "if (mode == 1 && c >= 'a' && c <= 'z') l[k] = (char)(c - 32); else if (mode == 2 && c >= 'A' && c <= 'Z') l[k] = (char)(c + 32); else if (mode == 3) { if (k == start && c >= 'a' && c <= 'z') l[k] = (char)(c - 32); if (k > start && c >= 'A' && c <= 'Z') l[k] = (char)(c + 32); } } vedit_cx = end; vedit_dirty = 1; vedit_msg[0] = 0; return 0; } /** Transpose the two characters around dot (uemacs random.c).", "kind": "function", "line": 1490, "name": "vedit_transpose", "signature": "static int vedit_transpose(void)"}, {"doc": "vedit_set_msg(\"nothing to transpose\"); return -1; } if (vedit_cx <= 0) vedit_cx = 1; if (vedit_cx >= vedit_used[vedit_cy]) vedit_cx = vedit_used[vedit_cy] - 1; vedit_str_transpose(l, vedit_used[vedit_cy], vedit_cx); if (vedit_cx < vedit_used[vedit_cy]) vedit_cx++; vedit_dirty = 1; vedit_msg[0] = 0; return 0; } /** Jump to the fence matching the one under dot (uemacs random.c).", "kind": "function", "line": 1513, "name": "vedit_goto_fence", "signature": "static int vedit_goto_fence(void)"}, {"doc": "vedit_cy = y; vedit_cx = x; vedit_msg[0] = 0; return 0; } depth--; } } } vedit_set_msg(\"no match\"); return -1; } /** Count words/lines/chars from dot to end, emacs-style, into msg.", "kind": "function", "line": 1579, "name": "vedit_count_words", "signature": "static void vedit_count_words(void)"}, {"doc": "printf(\"vedit: %s\\n\", nb); } /* ---- uemacs F2: magic search, isearch, replace, fill ---- #define VEDIT_FILL_COL 72 static int vedit_isearch_oy; static int vedit_isearch_ox; static int vedit_isearch_dir; static int vedit_qrep_on; static char vedit_qrep_old[VEDIT_MAGIC_MAX]; static char vedit_qrep_new[VEDIT_LINE_MAX]; /** Match needle at line/col; magic when flag set. Returns match length.", "kind": "function", "line": 1622, "name": "vedit_match_at", "signature": "static int vedit_match_at(int row, int col, const char *needle, int magic,\n                      ..."}, {"doc": "if (avail > VEDIT_LINE_MAX) avail = VEDIT_LINE_MAX; for (k = 0; k < avail; k++) tmp[k] = l[col + k]; tmp[avail] = 0; if (!vedit_magic_match(tmp, needle, &m)) return 0; if (m == 0) { mlen = 0; return 1; } mlen = m; return 1; } } /** Forward search from (row,col); wraps once. Moves dot, returns 0.", "kind": "function", "line": 1659, "name": "vedit_search_fwd", "signature": "static int vedit_search_fwd(int row, int col, const char *needle, int magic,\n                    ..."}, {"kind": "function", "line": 1691, "name": "vedit_search_rev", "signature": "static int vedit_search_rev(int row, int col, const char *needle, int magic)"}, {"kind": "function", "line": 1714, "name": "vedit_isearch_step", "signature": "static void vedit_isearch_step(void)"}, {"doc": "vedit_set_msg(\"wrapped\"); else vedit_msg[0] = 0; } else { if (vedit_search_rev(vedit_isearch_oy, vedit_isearch_ox, vedit_prompt_buf, 0) != 0) vedit_set_msg(\"failing\"); else vedit_msg[0] = 0; } memcpy(vedit_last_find, vedit_prompt_buf, VEDIT_LINE_MAX); } /** Replace one occurrence at (row,col); returns new cursor col or -1.", "kind": "function", "line": 1741, "name": "vedit_replace_at", "signature": "static int vedit_replace_at(int row, int col, const char *old_s,\n                            cons..."}, {"doc": "if (!vedit_match_at(row, col, old_s, magic, &mlen) || mlen <= 0) return -1; l = vedit_row_ptr(row); nlen = (int)strlen(new_s); if (vedit_used[row] - mlen + nlen > VEDIT_LINE_USED) return -1; for (k = vedit_used[row] - 1; k >= col + mlen; k--) l[k - mlen + nlen] = l[k]; for (k = 0; k < nlen; k++) l[col + k] = new_s[k]; vedit_used[row] += nlen - mlen; vedit_dirty = 1; return col + nlen; } /** Replace all, forward from dot with wrap; reports count, fail closed.", "kind": "function", "line": 1761, "name": "vedit_replace_all", "signature": "static int vedit_replace_all(const char *old_s, const char *new_s,\n                             i..."}, {"doc": "r++; c = 0; if (r >= vedit_count) break; } } { char nb[64]; snprintf(nb, sizeof(nb), \"replaced %d\", count); vedit_set_msg(nb); } return 0; } /** Refill the blank-line-delimited paragraph at dot (uemacs word.c).", "kind": "function", "line": 1814, "name": "vedit_fill_paragraph", "signature": "static int vedit_fill_paragraph(void)"}, {"kind": "function", "line": 1898, "name": "vedit_find", "signature": "static void vedit_find(const char *needle)"}, {"kind": "function", "line": 1988, "name": "vedit_save", "signature": "static int vedit_save(void)"}, {"kind": "function", "line": 2051, "name": "vedit_load", "signature": "static int vedit_load(void)"}, {"doc": "{ struct stat st; if (stat(vedit_fname, &st) == 0) { vedit_sizes[vedit_cur] = (long)st.st_size; vedit_mtimes[vedit_cur] = (long)st.st_mtime; } else { vedit_sizes[vedit_cur] = -1; vedit_mtimes[vedit_cur] = -1; } } return 1; } /** Open a file in a free buffer (or reuse the pristine untitled one).", "kind": "function", "line": 2122, "name": "vedit_open_in_buffer", "signature": "static int vedit_open_in_buffer(const char *fname, int ro)"}, {"doc": "Insert scratch arena: one reusable block serves every insert-file and shell-capture load, reset per call and grown only when the file outgrows it. Repeated Ctrl+R builds and M-! captures stop churning * one malloc/free pair per run; the block frees once at IDE exit. static char *vedit_insert_scratch; static size_t vedit_insert_cap; /** Docstring: borrow size bytes of insert scratch, growing it when short.", "kind": "function", "line": 2183, "name": "vedit_insert_buf", "signature": "static char *vedit_insert_buf(long size)"}, {"doc": "/** Docstring: borrow size bytes of insert scratch, growing it when short. static char *vedit_insert_buf(long size) { char *grown; if (size <= 0 || (unsigned long)size > VEDIT_FILE_MAX) return 0; if (vedit_insert_scratch && (unsigned long)size <= vedit_insert_cap) return vedit_insert_scratch; grown = realloc(vedit_insert_scratch, (size_t)size); if (!grown) return 0; vedit_insert_scratch = grown; vedit_insert_cap = (size_t)size; return grown; } /** Insert a file at dot, char by char through the fail-closed ops.", "kind": "function", "line": 2196, "name": "vedit_insert_file", "signature": "static int vedit_insert_file(const char *fname)"}, {"doc": "vedit_split(); } else { vedit_insert_char((unsigned char)data[k]); } if (vedit_msg[0]) { vedit_set_msg(\"insert stopped: buffer full\"); return -1; } } vedit_msg[0] = 0; return 0; } /** Report whether a file name ends with the given extension.", "kind": "function", "line": 2257, "name": "vedit_has_ext", "signature": "static int vedit_has_ext(const char *fname, const char *ext)"}, {"doc": "/** Report whether a file name ends with the given extension. static int vedit_has_ext(const char *fname, const char *ext) { size_t n = strlen(fname); size_t e = strlen(ext); size_t k; if (e == 0 || e > n) return 0; for (k = 0; k < e; k++) { if (fname[n - e + k] != ext[k]) return 0; } return 1; } /** Copy the base name without directories or extension into dst.", "kind": "function", "line": 2269, "name": "vedit_base_of", "signature": "static int vedit_base_of(const char *fname, char *dst, size_t cap)"}, {"doc": "if (fname[k] == '/') s = k + 1; } for (k = s; k < n; k++) { if (fname[k] == '.') e = k; } if (e <= s) e = n; len = e - s; if (len == 0 || len + 1 > cap || len >= VEDIT_BASE_MAX) return -1; for (k = 0; k < len; k++) dst[k] = fname[s + k]; dst[len] = 0; return 0; } /** Join dir + base + ext into dst with bounds checking.", "kind": "function", "line": 2290, "name": "vedit_join", "signature": "static int vedit_join(const char *dir, const char *base, const char *ext,\n                      c..."}, {"doc": "size_t b = strlen(base); size_t e = strlen(ext); size_t k = 0; size_t i; if (d + b + e + 1 > cap) return -1; if (d + b + e + 1 > VEDIT_PATH_MAX) return -1; for (i = 0; i < d; i++) dst[k++] = dir[i]; for (i = 0; i < b; i++) dst[k++] = base[i]; for (i = 0; i < e; i++) dst[k++] = ext[i]; dst[k] = 0; return 0; } /** Accept only the two linker formats, rejecting anything else.", "kind": "function", "line": 2307, "name": "vedit_link_fmt", "signature": "static int vedit_link_fmt(const char *s)"}, {"doc": "/** Accept only the two linker formats, rejecting anything else. static int vedit_link_fmt(const char *s) { size_t k = 0; const char *e = VEDIT_LINK_ELF; const char *c = VEDIT_LINK_CVM; while (e[k] && s[k] == e[k]) k++; if (e[k] == 0 && s[k] == 0) return 1; k = 0; while (c[k] && s[k] == c[k]) k++; if (c[k] == 0 && s[k] == 0) return 2; return 0; } /** Print a captured toolchain log to the console in bounded chunks.", "kind": "function", "line": 2320, "name": "vedit_print_log", "signature": "static void vedit_print_log(const char *path)"}, {"doc": "size_t n; if (!f) { printf(\"vedit: no output captured (%s missing)\\n\", path); return; } while ((n = fread(buf, 1, sizeof(buf), f)) > 0) { size_t k; for (k = 0; k < n; k++) putchar(buf[k]); } fclose(f); fflush(stdout); } /** Drop the display, run one child, echo its log, then resume the IDE.", "kind": "function", "line": 2337, "name": "vedit_spawn_visible", "signature": "static long vedit_spawn_visible(const char *tool, const char *redir, int argc,\n                  ..."}, {"doc": "if (rc < 0) { snprintf(nb, sizeof(nb), \"%s failed (%ld)\", label, rc); vedit_set_msg(nb); } else if (rc != 0) { snprintf(nb, sizeof(nb), \"%s exit %ld\", label, rc); vedit_set_msg(nb); } else { snprintf(nb, sizeof(nb), \"%s ok\", label); vedit_set_msg(nb); } return rc; } /** Sign a freshly linked ELF so the kernel signature gate runs it.", "kind": "function", "line": 2366, "name": "vedit_sign_elf", "signature": "static void vedit_sign_elf(const char *out)"}, {"doc": "} /** Sign a freshly linked ELF so the kernel signature gate runs it. static void vedit_sign_elf(const char *out) { const char *args[3]; char label[VEDIT_MSG_MAX]; snprintf(label, sizeof(label), \"sign %s\", out); args[0] = VEDIT_TOOL_SIGN; args[1] = out; args[2] = 0; vedit_spawn_visible(VEDIT_TOOL_SIGN, 0, 2, args, label); } /** Run a freshly linked artifact so its output lands on the console.", "kind": "function", "line": 2377, "name": "vedit_cmd_exec", "signature": "static void vedit_cmd_exec(const char *out, int kind)"}, {"doc": "/** Run a freshly linked artifact so its output lands on the console. static void vedit_cmd_exec(const char *out, int kind) { const char *args[2]; char label[VEDIT_MSG_MAX]; snprintf(label, sizeof(label), \"run %s\", out); args[0] = out; args[1] = 0; if (kind == 1) vedit_spawn_visible(out, 0, 1, args, label); else vedit_spawn_visible(VEDIT_TOOL_CVM, 0, 1, args, label); } /** Decide the ^R tool for a file: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp.", "kind": "function", "line": 2390, "name": "vedit_run_kind", "signature": "static int vedit_run_kind(const char *fname)"}, {"doc": "vedit_spawn_visible(VEDIT_TOOL_CVM, 0, 1, args, label); } /** Decide the ^R tool for a file: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp. static int vedit_run_kind(const char *fname) { if (vedit_has_ext(fname, \".c\") || vedit_has_ext(fname, \".h\")) return 1; if (vedit_has_ext(fname, \".lua\")) return 2; if (vedit_has_ext(fname, \".py\")) return 3; if (vedit_has_ext(fname, \".s\")) return 4; if (vedit_has_ext(fname, \".lisp\")) return 5; return 0; } /** Save, then compile or run the current buffer by extension.", "kind": "function", "line": 2400, "name": "vedit_cmd_run", "signature": "static void vedit_cmd_run(void)"}, {"doc": "vedit_set_msg(\"usage: save as .c, .s, .lua, .py or .lisp first\"); return; } args[0] = tool; args[1] = vedit_fname; args[2] = 0; for (k = 0; k < sizeof(label) - 1 && vedit_fname[k]; k++) label[k] = vedit_fname[k]; label[k] = 0; redir = VEDIT_BUILD_LOG; vedit_spawn_visible(tool, redir, 2, args, label); } /** Save, then link asm/<base>.s into bin/<base>.elf or cvm/<base>.cvm.", "kind": "function", "line": 2478, "name": "vedit_cmd_link", "signature": "static void vedit_cmd_link(const char *fmt)"}, {"doc": "Headless build contract check: no display, no syscalls, exit status only. Mirror contract with tests/test_vedit_build.c: any vector added here * must gain a host CHECK there too, so spec drift fails the build.", "kind": "function", "line": 2532, "name": "vedit_selftest_build", "signature": "static int vedit_selftest_build(void)"}, {"doc": "Headless leak contract: the insert scratch arena and one buffer lifecycle must net zero live blocks. Exercises exactly the reuse * path every Ctrl+R / Ctrl+L build walks, with no display syscalls.", "kind": "function", "line": 2725, "name": "vedit_selftest_leak", "signature": "static int vedit_selftest_leak(void)"}, {"kind": "function", "line": 2785, "name": "vedit_pane_save", "signature": "static void vedit_pane_save(int p)"}, {"kind": "function", "line": 2793, "name": "vedit_first_open", "signature": "static int vedit_first_open(void)"}, {"kind": "function", "line": 2801, "name": "vedit_pane_load", "signature": "static void vedit_pane_load(int p)"}, {"kind": "function", "line": 2813, "name": "vedit_count_open", "signature": "static int vedit_count_open(void)"}, {"kind": "function", "line": 2822, "name": "vedit_split_set", "signature": "static void vedit_split_set(int on)"}, {"kind": "function", "line": 2841, "name": "vedit_next_pane", "signature": "static void vedit_next_pane(void)"}, {"kind": "function", "line": 2873, "name": "vedit_cmd_lookup", "signature": "static int vedit_cmd_lookup(const char *name)"}, {"doc": "Parse a key description into a decoded key code: ^A..^Z ^@ ^[ ^\\ ^] ^^ ^_, M-<c>, or Up Down Left Right Home End PgUp PgDn Del Esc. * Pure: host suite pins every vector.", "kind": "function", "line": 2889, "name": "vedit_parse_key", "signature": "static int vedit_parse_key(const char *s)"}, {"kind": "function", "line": 2941, "name": "vedit_cmd_bind", "signature": "static int vedit_cmd_bind(int key, int cmd)"}, {"kind": "function", "line": 2957, "name": "vedit_cmd_bound", "signature": "static int vedit_cmd_bound(int key)"}, {"kind": "function", "line": 2965, "name": "vedit_list_buffers", "signature": "static void vedit_list_buffers(void)"}, {"kind": "function", "line": 2984, "name": "vedit_hist_show", "signature": "static void vedit_hist_show(void)"}, {"kind": "function", "line": 2992, "name": "vedit_help_text", "signature": "static void vedit_help_text(void)"}, {"doc": "printf(\"arrows/Home/End/PgUp/PgDn move, ^U arg, ^A/^E bol/eol\\n\"); printf(\"M-f/M-b word, M-c/M-l/M-u case word, ^@/M-SP mark, M-w copy\\n\"); printf(\"M-k kill region, ^K kill line, ^Y yank, ^T transpose\\n\"); printf(\"^] goto fence, M-s/M-r isearch, M-n hunt, M-%% query\\n\"); printf(\"M-q fill, M-1/M-2/M-o windows, M-x command, M-! shell\\n\"); printf(\"M-# filter, M-( M-) M-e macro, ^W find, ^G goto\\n\"); printf(\"M-v paste, M-W region to clipboard, drag selects to clipboard\\n\"); printf(\"^O/^S save, ^N name, ^R run, ^L link, ^D dump, ^X done\\n\"); printf(\"M-x help names every command; vedit.rc runs at startup\\n\"); fflush(stdout); vedit_set_msg(\"see console for key list\"); } /** Execute a named command id; arg carries an rc-file argument or 0.", "kind": "function", "line": 3008, "name": "vedit_cmd_exec_id", "signature": "static void vedit_cmd_exec_id(int id, const char *arg, int *quit,\n                              i..."}, {"kind": "function", "line": 3196, "name": "strcmp", "signature": "strcmp(name, \"describe-bindings\") == 0)"}, {"doc": "Run the startup script: `bind <key> <cmd>` plus bare commands with * an optional trailing argument. Unknown lines are reported, never fatal.", "kind": "function", "line": 3214, "name": "vedit_run_rc", "signature": "static void vedit_run_rc(const char *path)"}, {"kind": "function", "line": 3292, "name": "vedit_sel_clear", "signature": "static void vedit_sel_clear(void)"}, {"kind": "function", "line": 3297, "name": "vedit_sel_norm", "signature": "static void vedit_sel_norm(void)"}, {"doc": "static void vedit_sel_norm(void) { if (vedit_sy0 > vedit_sy1 || (vedit_sy0 == vedit_sy1 && vedit_sx0 > vedit_sx1)) { int t = vedit_sy0; vedit_sy0 = vedit_sy1; vedit_sy1 = t; t = vedit_sx0; vedit_sx0 = vedit_sx1; vedit_sx1 = t; } } /** Copy the mouse selection into the kernel clipboard; 0 ok.", "kind": "function", "line": 3310, "name": "vedit_sel_copy", "signature": "static int vedit_sel_copy(void)"}, {"doc": "} if (vedit_clip_set(vedit_clipbuf, pos) != 0) { vedit_set_msg(\"clipboard refused\"); return -1; } { char nb[64]; snprintf(nb, sizeof(nb), \"copied %d byte(s)\", pos); vedit_set_msg(nb); } return 0; } /** Paste the kernel clipboard at dot; fail closed, never truncated.", "kind": "function", "line": 3353, "name": "vedit_clip_paste", "signature": "static int vedit_clip_paste(void)"}, {"doc": "vedit_split(); else vedit_insert_char((unsigned char)vedit_clipbuf[k]); if (vedit_msg[0]) { vedit_set_msg(\"paste stopped: buffer full\"); return -1; } } vedit_sel_clear(); vedit_msg[0] = 0; return 0; } /** Copy the emacs region (not the mouse) into the clipboard.", "kind": "function", "line": 3383, "name": "vedit_region_to_clip", "signature": "static int vedit_region_to_clip(void)"}, {"doc": "} if (pos <= 0) { vedit_set_msg(\"nothing selected\"); return -1; } if (vedit_clip_set(vedit_clipbuf, pos) != 0) { vedit_set_msg(\"clipboard refused\"); return -1; } vedit_set_msg(\"copied to clipboard\"); return 0; } /** Split a shell line into argv; returns argc or -1 on overflow.", "kind": "function", "line": 3428, "name": "vedit_sh_split", "signature": "static int vedit_sh_split(const char *line, char *buf, const char **argv)"}, {"doc": "if (!*line) break; if (argc >= VEDIT_SH_ARGS) return -1; argv[argc++] = buf + k; while (*line && *line != ' ' && *line != '\\t') { if (k >= VEDIT_SH_LINE - 1) return -1; buf[k++] = *line++; } buf[k++] = 0; } argv[argc] = 0; return argc; } /** Run a shell line, capturing stdout into the *shell* buffer.", "kind": "function", "line": 3448, "name": "vedit_shell_command", "signature": "static void vedit_shell_command(const char *line)"}, {"doc": "idx = vedit_open_in_buffer(\"*shell*\", 0); if (idx < 0) return; vedit_count = 0; vedit_cx = 0; vedit_cy = 0; vedit_top = 0; vedit_insert_file(VEDIT_TMP_OUT); vedit_cx = 0; vedit_cy = 0; vedit_top = 0; vedit_set_msg(\"see *shell* buffer\"); } /** Write the region (or whole buffer) to path; 0 ok.", "kind": "function", "line": 3477, "name": "vedit_write_region", "signature": "static int vedit_write_region(const char *path, int *y0o, int *x0o, int *y1o,\n                   ..."}, {"doc": "if (y < y1) putc('\\n', f); } if (fclose(f) != 0) { vedit_set_msg(\"cannot write temp file\"); return -1; } if (y0o) *y0o = y0; if (x0o) *x0o = x0; if (y1o) *y1o = y1; if (x1o) *x1o = x1; return 0; } /** Pipe the region (or buffer) through an external program.", "kind": "function", "line": 3521, "name": "vedit_filter_buffer", "signature": "static void vedit_filter_buffer(const char *prog)"}, {"doc": "vedit_cx = x1; vedit_mark_y = y0; vedit_mark_x = x0; vedit_mark_on = 1; if (vedit_kill_region() != 0) return; if (vedit_insert_file(VEDIT_TMP_F) != 0) { vedit_set_msg(\"filter output did not fit\"); return; } vedit_mark_on = 0; vedit_set_msg(\"filtered\"); } /** Magic grep of the current buffer into the *grep* buffer.", "kind": "function", "line": 3581, "name": "vedit_grep", "signature": "static void vedit_grep(const char *pat)"}, {"doc": "} vedit_switch_buffer(idx); vedit_grep_src = src; vedit_cx = 0; vedit_cy = 0; vedit_top = 0; { char nb[64]; snprintf(nb, sizeof(nb), \"%d match(es)\", hits); vedit_set_msg(nb); } } /** Jump to the match under dot in *grep* (\"N: text\" -> src buffer line N).", "kind": "function", "line": 3644, "name": "vedit_next_error", "signature": "static void vedit_next_error(void)"}, {"kind": "function", "line": 3692, "name": "vedit_read_key_poll", "signature": "static int vedit_read_key_poll(void)"}, {"doc": "vedit_esc_state = 3; vedit_esc_t0 = now; return -1; } return VEDIT_KEY_ESC; } vedit_esc_state = 0; if (c != '~') return VEDIT_KEY_ESC; if (vedit_esc_p1 == '3') return VEDIT_KEY_DEL; if (vedit_esc_p1 == '5') return VEDIT_KEY_PGUP; return VEDIT_KEY_PGDN; } /** Serial ANSI mirror: the UI itself is pixels.", "kind": "function", "line": 3746, "name": "vedit_ansi_for", "signature": "static void vedit_ansi_for(int col)"}, {"kind": "function", "line": 3754, "name": "vedit_console_dump", "signature": "static void vedit_console_dump(void)"}, {"doc": "vedit_ansi_for(vedit_cell[c]); cur = vedit_cell[c]; } putchar(l[c]); } if (cur != VEDIT_COL_DEFAULT) printf(\"\\033[0m\"); putchar('\\n'); } fflush(stdout); } /* ---- Nuklear UI ---- /** Prompt openers (state lives at the top with the other IDE state).", "kind": "function", "line": 3784, "name": "vedit_prompt_open", "signature": "static void vedit_prompt_open(const char *label, int mode)"}, {"kind": "function", "line": 3795, "name": "vedit_prompt_find", "signature": "static void vedit_prompt_find(void)"}, {"kind": "function", "line": 3799, "name": "vedit_prompt_isearch", "signature": "static void vedit_prompt_isearch(int dir)"}, {"doc": "static void vedit_prompt_find(void) { vedit_prompt_open(\"find: \", VEDIT_PROMPT_FIND); } static void vedit_prompt_isearch(int dir) { vedit_isearch_oy = vedit_cy; vedit_isearch_ox = vedit_cx; vedit_isearch_dir = dir; vedit_prompt_open(dir > 0 ? \"I-search: \" : \"reverse-I-search: \", dir > 0 ? VEDIT_PROMPT_ISEARCH_F : VEDIT_PROMPT_ISEARCH_R); } /** Step the pending query-replace from (r,c); prompts or finishes.", "kind": "function", "line": 3809, "name": "vedit_qrep_next", "signature": "static void vedit_qrep_next(int r, int c)"}, {"kind": "function", "line": 3821, "name": "vedit_qrep_answer", "signature": "static void vedit_qrep_answer(int key)"}, {"kind": "function", "line": 3860, "name": "vedit_prompt_saveas", "signature": "static void vedit_prompt_saveas(void)"}, {"kind": "function", "line": 3870, "name": "vedit_draw_row", "signature": "static void vedit_draw_row(struct nk_command_buffer *canvas,\n                           struct nk..."}, {"doc": "if (a < 0) a = 0; if (b > len) b = len; for (c = a; c < b; c++) { int vc = c - vedit_hoff; if (vc < 0 || vc >= textw) continue; nk_draw_text(canvas, nk_rect((float)(x + vc * vedit_cw), (float)y, (float)vedit_cw, (float)vedit_ch), l + c, 1, font, vedit_c_cursor(), vedit_c_bg()); } } } /** Draw the IDE window: menu buttons, code rows, status and help.", "kind": "function", "line": 3968, "name": "vedit_draw_ui", "signature": "static void vedit_draw_ui(struct nk_context *ctx, struct nk_user_font *font,\n                    ..."}, {"doc": "vedit_cw), (float)(vedit_status_y + 2), (float)vedit_cw, (float)vedit_ch), 0, vedit_c_cursor()); } nk_draw_text(canvas, nk_rect((float)vedit_cw, (float)vedit_help_y, (float)(NK_W - 2 * vedit_cw), (float)vedit_ch), help, (int)strlen(help), font, vedit_c_bg(), vedit_c_gutter()); nk_end(ctx); } /** Route one decoded key while a prompt is open.", "kind": "function", "line": 4248, "name": "vedit_prompt_key", "signature": "static void vedit_prompt_key(int key)"}, {"doc": "vedit_isearch_step(); } return; } if (key >= 32 && key < 127 && vedit_prompt_pos < VEDIT_LINE_MAX - 1) { vedit_prompt_buf[vedit_prompt_pos++] = (char)key; vedit_prompt_buf[vedit_prompt_pos] = 0; if (vedit_prompt_mode == VEDIT_PROMPT_ISEARCH_F || vedit_prompt_mode == VEDIT_PROMPT_ISEARCH_R) vedit_isearch_step(); } } /** Route one decoded key when no prompt is open.", "kind": "function", "line": 4422, "name": "vedit_key", "signature": "static void vedit_key(int key, int *quit, int *save_and_quit)"}, {"kind": "function", "line": 4662, "name": "vedit_sync_title", "signature": "static void vedit_sync_title(void)"}, {"kind": "function", "line": 4672, "name": "vedit_gui_run", "signature": "static void vedit_gui_run(void)"}, {"kind": "function", "line": 4763, "name": "vedit_selftest", "signature": "static int vedit_selftest(void)"}, {"kind": "function", "line": 4839, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "function", "line": 268, "name": "definitions", "signature": "* definitions (C99, one file, no headers). */ static void vedit_str_case(char *s, int mode);"}, {"kind": "macro", "line": 33, "name": "MINIOS_LEAKCHECK_IMPL", "signature": "#define MINIOS_LEAKCHECK_IMPL"}, {"kind": "macro", "line": 34, "name": "MINIOS_LK_ENABLE", "signature": "#define MINIOS_LK_ENABLE"}, {"kind": "macro", "line": 114, "name": "VEDIT_MAX_LINES", "signature": "#define VEDIT_MAX_LINES"}, {"kind": "macro", "line": 115, "name": "VEDIT_LINE_MAX", "signature": "#define VEDIT_LINE_MAX"}, {"kind": "macro", "line": 116, "name": "VEDIT_LINE_USED", "signature": "#define VEDIT_LINE_USED"}, {"kind": "macro", "line": 117, "name": "VEDIT_FILE_MAX", "signature": "#define VEDIT_FILE_MAX"}, {"kind": "macro", "line": 118, "name": "VEDIT_FNAME_MAX", "signature": "#define VEDIT_FNAME_MAX"}, {"kind": "macro", "line": 119, "name": "VEDIT_DEFAULT_FILE", "signature": "#define VEDIT_DEFAULT_FILE"}, {"kind": "macro", "line": 120, "name": "VEDIT_MSG_MAX", "signature": "#define VEDIT_MSG_MAX"}, {"kind": "macro", "line": 121, "name": "VEDIT_WORD_MAX", "signature": "#define VEDIT_WORD_MAX"}, {"kind": "macro", "line": 122, "name": "VEDIT_TAB_W", "signature": "#define VEDIT_TAB_W"}, {"kind": "macro", "line": 123, "name": "VEDIT_ESC_MS", "signature": "#define VEDIT_ESC_MS"}, {"kind": "macro", "line": 124, "name": "VEDIT_FRAME_MS", "signature": "#define VEDIT_FRAME_MS"}, {"kind": "macro", "line": 125, "name": "VEDIT_UI_MEMORY", "signature": "#define VEDIT_UI_MEMORY"}, {"kind": "macro", "line": 126, "name": "VEDIT_KEY_RUN", "signature": "#define VEDIT_KEY_RUN"}, {"kind": "macro", "line": 127, "name": "VEDIT_KEY_LINK", "signature": "#define VEDIT_KEY_LINK"}, {"kind": "macro", "line": 128, "name": "VEDIT_KEY_DUMP", "signature": "#define VEDIT_KEY_DUMP"}, {"kind": "macro", "line": 129, "name": "VEDIT_TOOL_MINIGCC", "signature": "#define VEDIT_TOOL_MINIGCC"}, {"kind": "macro", "line": 130, "name": "VEDIT_TOOL_LD", "signature": "#define VEDIT_TOOL_LD"}, {"kind": "macro", "line": 131, "name": "VEDIT_TOOL_SIGN", "signature": "#define VEDIT_TOOL_SIGN"}, {"kind": "macro", "line": 132, "name": "VEDIT_TOOL_CVM", "signature": "#define VEDIT_TOOL_CVM"}, {"kind": "macro", "line": 133, "name": "VEDIT_TOOL_LUA", "signature": "#define VEDIT_TOOL_LUA"}, {"kind": "macro", "line": 134, "name": "VEDIT_TOOL_PY", "signature": "#define VEDIT_TOOL_PY"}, {"kind": "macro", "line": 135, "name": "VEDIT_TOOL_LISP", "signature": "#define VEDIT_TOOL_LISP"}, {"kind": "macro", "line": 136, "name": "VEDIT_DIR_ASM", "signature": "#define VEDIT_DIR_ASM"}, {"kind": "macro", "line": 137, "name": "VEDIT_DIR_BIN", "signature": "#define VEDIT_DIR_BIN"}, {"kind": "macro", "line": 138, "name": "VEDIT_DIR_CVM", "signature": "#define VEDIT_DIR_CVM"}, {"kind": "macro", "line": 139, "name": "VEDIT_BUILD_LOG", "signature": "#define VEDIT_BUILD_LOG"}, {"kind": "macro", "line": 140, "name": "VEDIT_LINK_ELF", "signature": "#define VEDIT_LINK_ELF"}, {"kind": "macro", "line": 141, "name": "VEDIT_LINK_CVM", "signature": "#define VEDIT_LINK_CVM"}, {"kind": "macro", "line": 142, "name": "VEDIT_STATUS_MAX", "signature": "#define VEDIT_STATUS_MAX"}, {"kind": "macro", "line": 143, "name": "VEDIT_BASE_MAX", "signature": "#define VEDIT_BASE_MAX"}, {"kind": "macro", "line": 144, "name": "VEDIT_PATH_MAX", "signature": "#define VEDIT_PATH_MAX"}, {"kind": "macro", "line": 145, "name": "VEDIT_LOG_TAIL", "signature": "#define VEDIT_LOG_TAIL"}, {"kind": "macro", "line": 148, "name": "VEDIT_LANG_TEXT", "signature": "#define VEDIT_LANG_TEXT"}, {"kind": "macro", "line": 149, "name": "VEDIT_LANG_C", "signature": "#define VEDIT_LANG_C"}, {"kind": "macro", "line": 150, "name": "VEDIT_LANG_PY", "signature": "#define VEDIT_LANG_PY"}, {"kind": "macro", "line": 151, "name": "VEDIT_LANG_LUA", "signature": "#define VEDIT_LANG_LUA"}, {"kind": "macro", "line": 152, "name": "VEDIT_LANG_ASM", "signature": "#define VEDIT_LANG_ASM"}, {"kind": "macro", "line": 153, "name": "VEDIT_LANG_LISP", "signature": "#define VEDIT_LANG_LISP"}, {"kind": "macro", "line": 156, "name": "VEDIT_COL_DEFAULT", "signature": "#define VEDIT_COL_DEFAULT"}, {"kind": "macro", "line": 157, "name": "VEDIT_COL_KEYWORD", "signature": "#define VEDIT_COL_KEYWORD"}, {"kind": "macro", "line": 158, "name": "VEDIT_COL_STRING", "signature": "#define VEDIT_COL_STRING"}, {"kind": "macro", "line": 159, "name": "VEDIT_COL_COMMENT", "signature": "#define VEDIT_COL_COMMENT"}, {"kind": "macro", "line": 160, "name": "VEDIT_COL_NUMBER", "signature": "#define VEDIT_COL_NUMBER"}, {"kind": "macro", "line": 161, "name": "VEDIT_COL_PREPROC", "signature": "#define VEDIT_COL_PREPROC"}, {"kind": "macro", "line": 164, "name": "VEDIT_ST_BLOCK", "signature": "#define VEDIT_ST_BLOCK"}, {"kind": "macro", "line": 165, "name": "VEDIT_ST_PY3S", "signature": "#define VEDIT_ST_PY3S"}, {"kind": "macro", "line": 166, "name": "VEDIT_ST_PY3D", "signature": "#define VEDIT_ST_PY3D"}, {"kind": "macro", "line": 167, "name": "VEDIT_ST_LUABLK", "signature": "#define VEDIT_ST_LUABLK"}, {"kind": "macro", "line": 168, "name": "VEDIT_ST_LUASTR", "signature": "#define VEDIT_ST_LUASTR"}, {"kind": "macro", "line": 171, "name": "VEDIT_KEY_UP", "signature": "#define VEDIT_KEY_UP"}, {"kind": "macro", "line": 172, "name": "VEDIT_KEY_DOWN", "signature": "#define VEDIT_KEY_DOWN"}, {"kind": "macro", "line": 173, "name": "VEDIT_KEY_LEFT", "signature": "#define VEDIT_KEY_LEFT"}, {"kind": "macro", "line": 174, "name": "VEDIT_KEY_RIGHT", "signature": "#define VEDIT_KEY_RIGHT"}, {"kind": "macro", "line": 175, "name": "VEDIT_KEY_HOME", "signature": "#define VEDIT_KEY_HOME"}, {"kind": "macro", "line": 176, "name": "VEDIT_KEY_END", "signature": "#define VEDIT_KEY_END"}, {"kind": "macro", "line": 177, "name": "VEDIT_KEY_PGUP", "signature": "#define VEDIT_KEY_PGUP"}, {"kind": "macro", "line": 178, "name": "VEDIT_KEY_PGDN", "signature": "#define VEDIT_KEY_PGDN"}, {"kind": "macro", "line": 179, "name": "VEDIT_KEY_DEL", "signature": "#define VEDIT_KEY_DEL"}, {"kind": "macro", "line": 180, "name": "VEDIT_KEY_ESC", "signature": "#define VEDIT_KEY_ESC"}, {"kind": "macro", "line": 251, "name": "VEDIT_NBUF", "signature": "#define VEDIT_NBUF"}, {"kind": "macro", "line": 252, "name": "VEDIT_KILL_N", "signature": "#define VEDIT_KILL_N"}, {"kind": "macro", "line": 253, "name": "VEDIT_KILL_MAX", "signature": "#define VEDIT_KILL_MAX"}, {"kind": "macro", "line": 254, "name": "VEDIT_MACRO_MAX", "signature": "#define VEDIT_MACRO_MAX"}, {"kind": "macro", "line": 255, "name": "VEDIT_HIST_N", "signature": "#define VEDIT_HIST_N"}, {"kind": "macro", "line": 256, "name": "VEDIT_CMD_MAX", "signature": "#define VEDIT_CMD_MAX"}, {"kind": "macro", "line": 257, "name": "VEDIT_MAGIC_MAX", "signature": "#define VEDIT_MAGIC_MAX"}, {"kind": "macro", "line": 258, "name": "VEDIT_KEY_META", "signature": "#define VEDIT_KEY_META(c)"}, {"kind": "macro", "line": 259, "name": "VEDIT_KEY_ARG", "signature": "#define VEDIT_KEY_ARG"}, {"kind": "macro", "line": 260, "name": "VEDIT_KEY_MARK", "signature": "#define VEDIT_KEY_MARK"}, {"kind": "macro", "line": 261, "name": "VEDIT_KEY_KILL_LINE", "signature": "#define VEDIT_KEY_KILL_LINE"}, {"kind": "macro", "line": 262, "name": "VEDIT_KEY_YANK", "signature": "#define VEDIT_KEY_YANK"}, {"kind": "macro", "line": 263, "name": "VEDIT_KEY_TRANSPOSE", "signature": "#define VEDIT_KEY_TRANSPOSE"}, {"kind": "macro", "line": 264, "name": "VEDIT_KEY_FENCE", "signature": "#define VEDIT_KEY_FENCE"}, {"kind": "macro", "line": 265, "name": "VEDIT_KEY_BOL", "signature": "#define VEDIT_KEY_BOL"}, {"kind": "macro", "line": 266, "name": "VEDIT_KEY_EOL", "signature": "#define VEDIT_KEY_EOL"}, {"kind": "macro", "line": 293, "name": "vedit_pool", "signature": "#define vedit_pool"}, {"kind": "macro", "line": 294, "name": "vedit_used", "signature": "#define vedit_used"}, {"kind": "macro", "line": 295, "name": "vedit_count", "signature": "#define vedit_count"}, {"kind": "macro", "line": 296, "name": "vedit_cx", "signature": "#define vedit_cx"}, {"kind": "macro", "line": 297, "name": "vedit_cy", "signature": "#define vedit_cy"}, {"kind": "macro", "line": 298, "name": "vedit_top", "signature": "#define vedit_top"}, {"kind": "macro", "line": 299, "name": "vedit_hoff", "signature": "#define vedit_hoff"}, {"kind": "macro", "line": 300, "name": "vedit_dirty", "signature": "#define vedit_dirty"}, {"kind": "macro", "line": 301, "name": "vedit_trunc", "signature": "#define vedit_trunc"}, {"kind": "macro", "line": 302, "name": "vedit_lang", "signature": "#define vedit_lang"}, {"kind": "macro", "line": 303, "name": "vedit_fname", "signature": "#define vedit_fname"}, {"kind": "macro", "line": 304, "name": "vedit_msg", "signature": "#define vedit_msg"}, {"kind": "macro", "line": 313, "name": "VEDIT_PROMPT_FIND", "signature": "#define VEDIT_PROMPT_FIND"}, {"kind": "macro", "line": 314, "name": "VEDIT_PROMPT_GOTO", "signature": "#define VEDIT_PROMPT_GOTO"}, {"kind": "macro", "line": 315, "name": "VEDIT_PROMPT_NAME", "signature": "#define VEDIT_PROMPT_NAME"}, {"kind": "macro", "line": 316, "name": "VEDIT_PROMPT_LINK", "signature": "#define VEDIT_PROMPT_LINK"}, {"kind": "macro", "line": 317, "name": "VEDIT_PROMPT_CMD", "signature": "#define VEDIT_PROMPT_CMD"}, {"kind": "macro", "line": 318, "name": "VEDIT_PROMPT_ISEARCH_F", "signature": "#define VEDIT_PROMPT_ISEARCH_F"}, {"kind": "macro", "line": 319, "name": "VEDIT_PROMPT_ISEARCH_R", "signature": "#define VEDIT_PROMPT_ISEARCH_R"}, {"kind": "macro", "line": 320, "name": "VEDIT_PROMPT_REP_OLD", "signature": "#define VEDIT_PROMPT_REP_OLD"}, {"kind": "macro", "line": 321, "name": "VEDIT_PROMPT_REP_NEW", "signature": "#define VEDIT_PROMPT_REP_NEW"}, {"kind": "macro", "line": 322, "name": "VEDIT_PROMPT_QREP", "signature": "#define VEDIT_PROMPT_QREP"}, {"kind": "macro", "line": 323, "name": "VEDIT_PROMPT_SHELLCMD", "signature": "#define VEDIT_PROMPT_SHELLCMD"}, {"kind": "macro", "line": 324, "name": "VEDIT_PROMPT_FILTER", "signature": "#define VEDIT_PROMPT_FILTER"}, {"kind": "macro", "line": 325, "name": "VEDIT_PROMPT_SELECT", "signature": "#define VEDIT_PROMPT_SELECT"}, {"kind": "macro", "line": 326, "name": "VEDIT_PROMPT_GREP", "signature": "#define VEDIT_PROMPT_GREP"}, {"kind": "macro", "line": 327, "name": "VEDIT_PROMPT_BINDKEY", "signature": "#define VEDIT_PROMPT_BINDKEY"}, {"kind": "macro", "line": 328, "name": "VEDIT_PROMPT_BINDCMD", "signature": "#define VEDIT_PROMPT_BINDCMD"}, {"kind": "macro", "line": 1612, "name": "VEDIT_FILL_COL", "signature": "#define VEDIT_FILL_COL"}, {"kind": "macro", "line": 3273, "name": "VEDIT_TMP_OUT", "signature": "#define VEDIT_TMP_OUT"}, {"kind": "macro", "line": 3274, "name": "VEDIT_TMP_IN", "signature": "#define VEDIT_TMP_IN"}, {"kind": "macro", "line": 3275, "name": "VEDIT_TMP_F", "signature": "#define VEDIT_TMP_F"}, {"kind": "macro", "line": 3276, "name": "VEDIT_SH_ARGS", "signature": "#define VEDIT_SH_ARGS"}, {"kind": "macro", "line": 3277, "name": "VEDIT_SH_LINE", "signature": "#define VEDIT_SH_LINE"}, {"kind": "macro", "line": 3278, "name": "VEDIT_CLIP_MAX", "signature": "#define VEDIT_CLIP_MAX"}]}, {"doc": "wl_client.h - Thin mailbox client for Wayland-mini (ADR-0026).", "id": "progs/wl/wl_client.h", "kind": "module", "label": "wl_client.h", "language": "h", "sha256": "d808777ea7878f5d", "symbol_count": 5, "symbols": [{"doc": "N tiled windows with real multitasking under the existing preemptive scheduler. File bytes stay here (stdio); names, frames and wire encoding stay in wl_mbox.h and wl_mini.h. Every bound fails closed, never truncates.  #ifndef WL_CLIENT_H #define WL_CLIENT_H #include \"wl/wl_mbox.h\" #define WL_CLIENT_MSGS 6 /** Write one framed session message as its own mailbox file.", "kind": "function", "line": 21, "name": "wl_client_emit_file", "signature": "static inline int wl_client_emit_file(const char *box, unsigned int seq,\n        const unsigned c..."}, {"doc": "Write the pixel blob the next attach sizes. Pixels first so the * server never attaches a surface whose raw file is missing.", "kind": "function", "line": 48, "name": "wl_client_raw_file", "signature": "static inline int wl_client_raw_file(const char *box,\n        const unsigned char *px, int w, int h)"}, {"doc": "Attach one surface: pixels first, then display, bind, create, pool, attach and commit, each sequenced from seq0. Returns * WL_ERR_OK when all six messages landed.", "kind": "function", "line": 75, "name": "wl_client_attach", "signature": "static inline int wl_client_attach(const char *box, unsigned int seq0,\n        const unsigned cha..."}, {"kind": "macro", "line": 14, "name": "WL_CLIENT_H", "signature": "#define WL_CLIENT_H"}, {"kind": "macro", "line": 18, "name": "WL_CLIENT_MSGS", "signature": "#define WL_CLIENT_MSGS"}]}, {"doc": "wl_mbox.h - Mailbox file transport for Wayland-mini (ADR-0026).", "id": "progs/wl/wl_mbox.h", "kind": "module", "label": "wl_mbox.h", "language": "h", "sha256": "eed9d1775f0ff923", "symbol_count": 26, "symbols": [{"kind": "struct", "line": 30, "name": "wl_mbox_box_t"}, {"kind": "function", "line": 36, "name": "wl_mbox_init", "signature": "static inline void wl_mbox_init(wl_mbox_box_t *boxes)"}, {"doc": "Box names are lowercase alphanumerics so they can never escape the * directory through dot or slash tricks.", "kind": "function", "line": 51, "name": "wl_mbox_box_ok", "signature": "static inline int wl_mbox_box_ok(const char *box)"}, {"doc": "if (ch >= '0' && ch <= '9') ok = 1; if (!ok) return WL_ERR_STR; n++; if (n >= WL_MBOX_BOX_MAX) return WL_ERR_STR; } if (n == 0) return WL_ERR_STR; return WL_ERR_OK; } /** Sequence as fixed 8 lowercase hex so names sort chronologically.", "kind": "function", "line": 74, "name": "wl_mbox_hex", "signature": "static inline int wl_mbox_hex(unsigned int v, char *dst)"}, {"kind": "function", "line": 87, "name": "wl_mbox_unhex", "signature": "static inline int wl_mbox_unhex(char ch, unsigned int *v)"}, {"doc": "Build WL_MBOX_DIR/box-seq.msg. Returns the length, never a prefix * of it, so a short buffer reads as an error and not a stray file.", "kind": "function", "line": 103, "name": "wl_mbox_name", "signature": "static inline int wl_mbox_name(char *dst, int cap, const char *box,\n        unsigned int seq)"}, {"doc": "Parse a mailbox path back into box plus sequence. Only exact * matches pass; a renamed stray or a foreign suffix never dispatches.", "kind": "function", "line": 147, "name": "wl_mbox_parse", "signature": "static inline int wl_mbox_parse(const char *path, char *box, int boxcap,\n        unsigned int *seq)"}, {"doc": "path += WL_MBOX_SEQ_HEX; i = 0; while (suf[i] != '\\0') { if (path[i] != suf[i]) return WL_ERR_STR; i++; } if (path[i] != '\\0') return WL_ERR_STR; seq = v; return WL_ERR_OK; } /** Raw pixel path beside the mailbox, sized w*h by the last attach.", "kind": "function", "line": 194, "name": "wl_mbox_raw_name", "signature": "static inline int wl_mbox_raw_name(char *dst, int cap, const char *box)"}, {"doc": "return WL_ERR_BOUND; dst[di++] = box[i++]; } i = 0; while (suf[i] != '\\0') { if (di >= cap - 1) return WL_ERR_BOUND; dst[di++] = suf[i++]; } dst[di] = '\\0'; return di; } /** Event path beside the mailbox, one fixed frame per focused box.", "kind": "function", "line": 225, "name": "wl_mbox_ev_name", "signature": "static inline int wl_mbox_ev_name(char *dst, int cap, const char *box)"}, {"doc": "Client box name: lowercase alnum program plus decimal pid, so two * instances of one app never share a mailbox. Pure, host-tested.", "kind": "function", "line": 257, "name": "wl_client_box", "signature": "static inline int wl_client_box(const char *prog, long pid, char *dst,\n        int cap)"}, {"doc": "Frame one wire message: magic plus sequence plus the raw message. The reader refuses anything short, anything foreign and anything * with trailing bytes, so a torn write waits for the next poll.", "kind": "function", "line": 310, "name": "wl_mbox_frame_encode", "signature": "static inline int wl_mbox_frame_encode(unsigned char *dst, int cap,\n        unsigned int seq, con..."}, {"kind": "function", "line": 332, "name": "wl_mbox_frame_decode", "signature": "static inline int wl_mbox_frame_decode(const unsigned char *src, int len,\n        unsigned int *s..."}, {"doc": "Claim the slot a box owns, stable across polls, fail-closed when * the server is full or the name is wild.", "kind": "function", "line": 358, "name": "wl_mbox_assign", "signature": "static inline int wl_mbox_assign(wl_mbox_box_t *boxes, const char *box)"}, {"doc": "Freshness of an arriving sequence: a repeat of the last accepted one is a duplicate the server already consumed, anything else is * new work. Fail-closed on wild slots.", "kind": "function", "line": 394, "name": "wl_mbox_fresh", "signature": "static inline int wl_mbox_fresh(const wl_mbox_box_t *boxes, int slot,\n        unsigned int seq)"}, {"doc": "Route one mailbox message to the compositor state. The box owns its slot, so a client id is only checked for range, never for global meaning: each connection speaks its own id space exactly like a real Wayland client, and the slot is the server resource. Attach reports w/h for the pixel load, commit reports -1 for no * change, anything else that validates reports the slot too.", "kind": "function", "line": 409, "name": "wl_mbox_route", "signature": "static inline int wl_mbox_route(wl_comp_t *c, wl_mbox_box_t *boxes,\n        const char *box, unsi..."}, {"kind": "macro", "line": 15, "name": "WL_MBOX_H", "signature": "#define WL_MBOX_H"}, {"kind": "macro", "line": 19, "name": "WL_MBOX_DIR", "signature": "#define WL_MBOX_DIR"}, {"kind": "macro", "line": 20, "name": "WL_MBOX_SUFFIX", "signature": "#define WL_MBOX_SUFFIX"}, {"kind": "macro", "line": 21, "name": "WL_MBOX_RAW_SUFFIX", "signature": "#define WL_MBOX_RAW_SUFFIX"}, {"kind": "macro", "line": 22, "name": "WL_MBOX_EV_SUFFIX", "signature": "#define WL_MBOX_EV_SUFFIX"}, {"kind": "macro", "line": 23, "name": "WL_MBOX_BOX_MAX", "signature": "#define WL_MBOX_BOX_MAX"}, {"kind": "macro", "line": 24, "name": "WL_MBOX_NAME_MAX", "signature": "#define WL_MBOX_NAME_MAX"}, {"kind": "macro", "line": 25, "name": "WL_MBOX_MAGIC", "signature": "#define WL_MBOX_MAGIC"}, {"kind": "macro", "line": 26, "name": "WL_MBOX_FRAME_HEAD", "signature": "#define WL_MBOX_FRAME_HEAD"}, {"kind": "macro", "line": 27, "name": "WL_MBOX_POLL_MAX", "signature": "#define WL_MBOX_POLL_MAX"}, {"kind": "macro", "line": 28, "name": "WL_MBOX_SEQ_HEX", "signature": "#define WL_MBOX_SEQ_HEX"}]}, {"doc": "wl_mini.h - Wayland-mini subset contract (header-only, ADR-0024).", "id": "progs/wl/wl_mini.h", "kind": "module", "label": "wl_mini.h", "language": "h", "sha256": "2fccbaaaade82086", "symbol_count": 111, "symbols": [{"kind": "struct", "line": 57, "name": "wl_hdr_t"}, {"kind": "struct", "line": 63, "name": "wl_cfg_t"}, {"kind": "struct", "line": 251, "name": "wl_surface_t"}, {"kind": "struct", "line": 264, "name": "wl_comp_t"}, {"kind": "struct", "line": 968, "name": "wl_ev_t"}, {"kind": "struct", "line": 1086, "name": "wl_client_t"}, {"kind": "struct", "line": 1124, "name": "wl_stream_t"}, {"doc": "Interface descriptor table, the hand-written wl_interface subset. request and event counts name what wl_dispatch answers, nothing * more; a scanner earns its place only if the subset grows.", "kind": "struct", "line": 1179, "name": "wl_iface_t"}, {"kind": "function", "line": 71, "name": "wl_hdr_encode", "signature": "static inline int wl_hdr_encode(unsigned char *dst, int cap,\n        unsigned int id, unsigned in..."}, {"kind": "function", "line": 99, "name": "wl_hdr_decode", "signature": "static inline int wl_hdr_decode(const unsigned char *src, int len,\n        wl_hdr_t *out)"}, {"kind": "function", "line": 128, "name": "wl_u32_encode", "signature": "static inline int wl_u32_encode(unsigned char *dst, int cap, int off,\n        unsigned int v)"}, {"kind": "function", "line": 139, "name": "wl_u32_decode", "signature": "static inline int wl_u32_decode(const unsigned char *src, int len, int off,\n        unsigned int *v)"}, {"kind": "function", "line": 150, "name": "wl_strlen_bounded", "signature": "static inline int wl_strlen_bounded(const char *s)"}, {"doc": "static inline int wl_strlen_bounded(const char *s) { int n = 0; if (!s) return WL_ERR_STR; while (s[n] != '\\0') { n++; if (n >= WL_MAX_STR) return WL_ERR_STR; } return n; } /* String arg: u32 len (incl. NUL) + bytes + pad to 4. Returns total or err.", "kind": "function", "line": 163, "name": "wl_str_encode", "signature": "static inline int wl_str_encode(unsigned char *dst, int cap, int off,\n        const char *s)"}, {"kind": "function", "line": 188, "name": "wl_str_decode", "signature": "static inline int wl_str_decode(const unsigned char *src, int len, int off,\n        char *dst, in..."}, {"kind": "function", "line": 214, "name": "wl_surface_id_valid", "signature": "static inline int wl_surface_id_valid(unsigned int id)"}, {"kind": "function", "line": 219, "name": "wl_pool_id_valid", "signature": "static inline int wl_pool_id_valid(unsigned int id)"}, {"kind": "function", "line": 223, "name": "wl_pool_fit", "signature": "static inline int wl_pool_fit(int w, int h)"}, {"kind": "function", "line": 271, "name": "wl_comp_init", "signature": "static inline void wl_comp_init(wl_comp_t *c)"}, {"doc": "Refresh the active flag from z-order: only the top-most mapped, non-minimized surface reads active. Single place so focus, add and * remove can never disagree on which title paints bright.", "kind": "function", "line": 289, "name": "wl_comp_refresh_active", "signature": "static inline void wl_comp_refresh_active(wl_comp_t *c)"}, {"kind": "function", "line": 309, "name": "wl_comp_add", "signature": "static inline int wl_comp_add(wl_comp_t *c, unsigned int id, int w, int h)"}, {"kind": "function", "line": 345, "name": "wl_comp_remove", "signature": "static inline int wl_comp_remove(wl_comp_t *c, unsigned int id)"}, {"kind": "function", "line": 372, "name": "wl_comp_focus", "signature": "static inline int wl_comp_focus(wl_comp_t *c, unsigned int id)"}, {"kind": "function", "line": 397, "name": "wl_comp_hit", "signature": "static inline int wl_comp_hit(const wl_comp_t *c, int x, int y)"}, {"doc": "Classify a point inside one surface: close button first, then title drag strip, then the resize rim, else body. Points outside fail closed with HIT_NONE. Geometry mirrors wlcomp_blit_chrome so * clicks and pixels can never disagree.", "kind": "function", "line": 415, "name": "wl_surface_hit_zone", "signature": "static inline int wl_surface_hit_zone(const wl_surface_t *s, int x, int y)"}, {"doc": "Slot of the top-most mapped, non-minimized surface, or -1. This is the window that owns keyboard input: the raw top of the z-order can * be a minimized surface, which must never receive keys it cannot show.", "kind": "function", "line": 441, "name": "wl_comp_top_visible", "signature": "static inline int wl_comp_top_visible(const wl_comp_t *c)"}, {"doc": "Minimize/restore one surface. Minimized surfaces keep their slot and geometry but skip hit testing, tiling and compositing until restored. Minimizing sinks the surface to the bottom of the z-order and hands focus to the top-most visible surface, so the next key or * Alt+M lands on a window the user can see.", "kind": "function", "line": 460, "name": "wl_comp_set_minimized", "signature": "static inline int wl_comp_set_minimized(wl_comp_t *c, unsigned int id,\n        int minimized)"}, {"kind": "function", "line": 487, "name": "wl_comp_set_color", "signature": "static inline int wl_comp_set_color(wl_comp_t *c, unsigned int id, int color)"}, {"kind": "function", "line": 512, "name": "wlcomp_render", "signature": "static inline int wlcomp_render(const wl_comp_t *c, unsigned char *fb,\n        int fb_w, int fb_h)"}, {"doc": "Move and resize a mapped surface. Geometry validates through wl_pool_fit; positions allow a one-screen negative margin so a drag * can park a surface partly offscreen, anything beyond fails closed.", "kind": "function", "line": 550, "name": "wl_comp_set_rect", "signature": "static inline int wl_comp_set_rect(wl_comp_t *c, unsigned int id,\n        int x, int y, int w, in..."}, {"doc": "Tile every mapped surface over the frame in z-order. One surface fills the frame, two split it vertically, three or more form a rows-by-columns grid with the last row and column absorbing the integer remainder. Returns the tiled count, fail-closed when there * is nothing mapped or the frame is degenerate.", "kind": "function", "line": 577, "name": "wl_comp_layout_tile", "signature": "static inline int wl_comp_layout_tile(wl_comp_t *c, int fb_w, int fb_h)"}, {"doc": "Composite the surface stack with real client pixels. px, pw and ph are slot-indexed tables over items[]; a null slot entry renders the surface solid color exactly like wlcomp_render, which keeps single color clients working. A present pixel table whose dimensions differ * from the surface fails closed. Null table means all solid.", "kind": "function", "line": 637, "name": "wlcomp_blit", "signature": "static inline int wlcomp_blit(const wl_comp_t *c, unsigned char *fb,\n        int fb_w, int fb_h, ..."}, {"kind": "function", "line": 698, "name": "body", "signature": "* resampled into the body (inside the 1 px border, below the title),\n * the exact rect wl_ev_map ..."}, {"doc": "Nearest-neighbour scale of an indexed frame, the compositor side of a client buffer meeting a layout cell of another size. A real compositor scales or clips; refusing would unmap every client the moment it tiles, so the resample stays exact and bounded instead. Fail-closed on null or degenerate geometry and on arithmetic the * frame cannot hold.", "kind": "function", "line": 793, "name": "wl_scale_nearest", "signature": "static inline int wl_scale_nearest(unsigned char *dst, int dw, int dh,\n        const unsigned cha..."}, {"doc": "Attach payload: u32 pool id, u32 width, u32 height. The client speaks it over the mailbox transport; the compositor decodes it before touching any pixel, so a wild pool or an oversized frame never * reaches layout.", "kind": "function", "line": 823, "name": "wl_attach_encode", "signature": "static inline int wl_attach_encode(unsigned char *dst, int cap,\n        unsigned int pool, int w,..."}, {"kind": "function", "line": 842, "name": "wl_attach_decode", "signature": "static inline int wl_attach_decode(const unsigned char *src, int len,\n        unsigned int *pool,..."}, {"doc": "Commit payload: u32 surface id naming the surface whose attached * buffer becomes visible. Wild ids fail closed, never focus a stranger.", "kind": "function", "line": 870, "name": "wl_commit_encode", "signature": "static inline int wl_commit_encode(unsigned char *dst, int cap,\n        unsigned int id)"}, {"kind": "function", "line": 883, "name": "wl_commit_decode", "signature": "static inline int wl_commit_decode(const unsigned char *src, int len,\n        unsigned int *id)"}, {"kind": "function", "line": 907, "name": "wl_clip_encode", "signature": "static inline int wl_clip_encode(unsigned char *dst, int cap,\n        const unsigned char *text, ..."}, {"kind": "function", "line": 930, "name": "wl_clip_decode", "signature": "static inline int wl_clip_decode(const unsigned char *src, int len,\n        unsigned char *dst, i..."}, {"kind": "function", "line": 978, "name": "wl_ev_encode", "signature": "static inline int wl_ev_encode(unsigned char *dst, int cap,\n        const wl_ev_t *ev)"}, {"kind": "function", "line": 1008, "name": "wl_ev_decode", "signature": "static inline int wl_ev_decode(const unsigned char *src, int len,\n        wl_ev_t *ev)"}, {"doc": "Map a frame point into a client's raw buffer coords. The content area starts below the 1px border plus the title bar; the scale covers layout cells differing from attach dims. Outside maps to * (-1,-1) with 0, never a clamped edge that would warp clicks.", "kind": "function", "line": 1051, "name": "wl_ev_map", "signature": "static inline int wl_ev_map(int fx, int fy, int sx, int sy, int sw,\n        int sh, int rw, int r..."}, {"kind": "function", "line": 1092, "name": "wl_client_init", "signature": "static inline void wl_client_init(wl_client_t *cl)"}, {"kind": "function", "line": 1100, "name": "wl_client_surface", "signature": "static inline int wl_client_surface(wl_client_t *cl, unsigned int *id)"}, {"kind": "function", "line": 1109, "name": "wl_client_pool", "signature": "static inline int wl_client_pool(wl_client_t *cl, unsigned int *id)"}, {"kind": "function", "line": 1129, "name": "wl_stream_init", "signature": "static inline void wl_stream_init(wl_stream_t *s)"}, {"kind": "function", "line": 1135, "name": "wl_stream_feed", "signature": "static inline int wl_stream_feed(wl_stream_t *s, const unsigned char *src,\n        int n)"}, {"kind": "function", "line": 1150, "name": "wl_stream_next", "signature": "static inline int wl_stream_next(wl_stream_t *s, int *size)"}, {"kind": "function", "line": 1166, "name": "wl_stream_consume", "signature": "static inline int wl_stream_consume(wl_stream_t *s, int n)"}, {"kind": "function", "line": 1187, "name": "wl_iface_find", "signature": "static inline int wl_iface_find(const char *name)"}, {"doc": "Bind an attached buffer to a surface, keeping its position. The pool id stands in for the passed fd miniOS cannot carry, validated * here before any pixel is ever addressed through it.", "kind": "function", "line": 1218, "name": "wl_comp_attach_buf", "signature": "static inline int wl_comp_attach_buf(wl_comp_t *c, unsigned int id,\n        unsigned int pool, in..."}, {"doc": "Route one framed request to the compositor state, the protocol.c plus server.c shape collapsed into one pure function. Unknown ids name strangers, unknown opcodes name unimplemented verbs, short * payloads never reach the surface they address.", "kind": "function", "line": 1245, "name": "wl_dispatch", "signature": "static inline int wl_dispatch(wl_comp_t *c, wl_client_t *cl,\n        unsigned int id, unsigned in..."}, {"kind": "function", "line": 959, "name": "coords", "signature": "* coords (mapped by wl_ev_map, -1 when outside), wheel is a * monotonic total the client diffs, scancodes are raw Set-1 bytes * (E0 prefixes included) the client's own translator consumes. * A slow cl"}, {"kind": "macro", "line": 18, "name": "WL_MINI_H", "signature": "#define WL_MINI_H"}, {"kind": "macro", "line": 20, "name": "WL_MAX_MSG", "signature": "#define WL_MAX_MSG"}, {"kind": "macro", "line": 21, "name": "WL_MAX_STR", "signature": "#define WL_MAX_STR"}, {"kind": "macro", "line": 22, "name": "WL_MAX_SURFACES", "signature": "#define WL_MAX_SURFACES"}, {"kind": "macro", "line": 23, "name": "WL_MAX_POOLS", "signature": "#define WL_MAX_POOLS"}, {"kind": "macro", "line": 24, "name": "WL_SURF_MAX_W", "signature": "#define WL_SURF_MAX_W"}, {"kind": "macro", "line": 25, "name": "WL_SURF_MAX_H", "signature": "#define WL_SURF_MAX_H"}, {"kind": "macro", "line": 26, "name": "WL_POOL_MAX", "signature": "#define WL_POOL_MAX"}, {"kind": "macro", "line": 27, "name": "WL_HDR_SZ", "signature": "#define WL_HDR_SZ"}, {"kind": "macro", "line": 28, "name": "WL_ATTACH_SZ", "signature": "#define WL_ATTACH_SZ"}, {"kind": "macro", "line": 29, "name": "WL_COMMIT_SZ", "signature": "#define WL_COMMIT_SZ"}, {"kind": "macro", "line": 31, "name": "WL_ERR_OK", "signature": "#define WL_ERR_OK"}, {"kind": "macro", "line": 32, "name": "WL_ERR_BOUND", "signature": "#define WL_ERR_BOUND"}, {"kind": "macro", "line": 33, "name": "WL_ERR_TRUNC", "signature": "#define WL_ERR_TRUNC"}, {"kind": "macro", "line": 34, "name": "WL_ERR_SIZE", "signature": "#define WL_ERR_SIZE"}, {"kind": "macro", "line": 35, "name": "WL_ERR_ID", "signature": "#define WL_ERR_ID"}, {"kind": "macro", "line": 36, "name": "WL_ERR_STR", "signature": "#define WL_ERR_STR"}, {"kind": "macro", "line": 37, "name": "WL_ERR_MORE", "signature": "#define WL_ERR_MORE"}, {"kind": "macro", "line": 39, "name": "WL_ID_DISPLAY", "signature": "#define WL_ID_DISPLAY"}, {"kind": "macro", "line": 40, "name": "WL_ID_REGISTRY", "signature": "#define WL_ID_REGISTRY"}, {"kind": "macro", "line": 41, "name": "WL_ID_COMPOSITOR", "signature": "#define WL_ID_COMPOSITOR"}, {"kind": "macro", "line": 42, "name": "WL_ID_SHM", "signature": "#define WL_ID_SHM"}, {"kind": "macro", "line": 43, "name": "WL_ID_XDG_BASE", "signature": "#define WL_ID_XDG_BASE"}, {"kind": "macro", "line": 44, "name": "WL_ID_SURFACE_BASE", "signature": "#define WL_ID_SURFACE_BASE"}, {"kind": "macro", "line": 45, "name": "WL_ID_POOL_BASE", "signature": "#define WL_ID_POOL_BASE"}, {"kind": "macro", "line": 46, "name": "WL_ID_BUFFER_BASE", "signature": "#define WL_ID_BUFFER_BASE"}, {"kind": "macro", "line": 48, "name": "WL_OP_DISPLAY_GET_REGISTRY", "signature": "#define WL_OP_DISPLAY_GET_REGISTRY"}, {"kind": "macro", "line": 49, "name": "WL_OP_REGISTRY_BIND", "signature": "#define WL_OP_REGISTRY_BIND"}, {"kind": "macro", "line": 50, "name": "WL_OP_COMPOSITOR_CREATE_SURFACE", "signature": "#define WL_OP_COMPOSITOR_CREATE_SURFACE"}, {"kind": "macro", "line": 51, "name": "WL_OP_SHM_CREATE_POOL", "signature": "#define WL_OP_SHM_CREATE_POOL"}, {"kind": "macro", "line": 52, "name": "WL_OP_POOL_CREATE_BUFFER", "signature": "#define WL_OP_POOL_CREATE_BUFFER"}, {"kind": "macro", "line": 53, "name": "WL_OP_SURFACE_ATTACH", "signature": "#define WL_OP_SURFACE_ATTACH"}, {"kind": "macro", "line": 54, "name": "WL_OP_SURFACE_COMMIT", "signature": "#define WL_OP_SURFACE_COMMIT"}, {"kind": "macro", "line": 55, "name": "WL_OP_XDG_GET_TOPLEVEL", "signature": "#define WL_OP_XDG_GET_TOPLEVEL"}, {"kind": "macro", "line": 69, "name": "WL_CFG_DEFAULT", "signature": "#define WL_CFG_DEFAULT"}, {"kind": "macro", "line": 238, "name": "WL_TITLE_H", "signature": "#define WL_TITLE_H"}, {"kind": "macro", "line": 239, "name": "WL_CLOSE_W", "signature": "#define WL_CLOSE_W"}, {"kind": "macro", "line": 240, "name": "WL_RESIZE_EDGE", "signature": "#define WL_RESIZE_EDGE"}, {"kind": "macro", "line": 241, "name": "WL_TITLE_ACTIVE", "signature": "#define WL_TITLE_ACTIVE"}, {"kind": "macro", "line": 242, "name": "WL_TITLE_INACTIVE", "signature": "#define WL_TITLE_INACTIVE"}, {"kind": "macro", "line": 243, "name": "WL_CLOSE_INK", "signature": "#define WL_CLOSE_INK"}, {"kind": "macro", "line": 245, "name": "WL_HIT_NONE", "signature": "#define WL_HIT_NONE"}, {"kind": "macro", "line": 246, "name": "WL_HIT_BODY", "signature": "#define WL_HIT_BODY"}, {"kind": "macro", "line": 247, "name": "WL_HIT_TITLE", "signature": "#define WL_HIT_TITLE"}, {"kind": "macro", "line": 248, "name": "WL_HIT_CLOSE", "signature": "#define WL_HIT_CLOSE"}, {"kind": "macro", "line": 249, "name": "WL_HIT_RESIZE", "signature": "#define WL_HIT_RESIZE"}, {"kind": "macro", "line": 509, "name": "WLCOMP_BG", "signature": "#define WLCOMP_BG"}, {"kind": "macro", "line": 510, "name": "WLCOMP_BORDER", "signature": "#define WLCOMP_BORDER"}, {"kind": "macro", "line": 902, "name": "WL_ID_CLIPBOARD", "signature": "#define WL_ID_CLIPBOARD"}, {"kind": "macro", "line": 903, "name": "WL_OP_CLIPBOARD_SET", "signature": "#define WL_OP_CLIPBOARD_SET"}, {"kind": "macro", "line": 904, "name": "WL_OP_CLIPBOARD_GET", "signature": "#define WL_OP_CLIPBOARD_GET"}, {"kind": "macro", "line": 905, "name": "WL_CLIP_MAX", "signature": "#define WL_CLIP_MAX"}, {"kind": "macro", "line": 964, "name": "WL_EV_MAGIC", "signature": "#define WL_EV_MAGIC"}, {"kind": "macro", "line": 965, "name": "WL_EV_SC_MAX", "signature": "#define WL_EV_SC_MAX"}, {"kind": "macro", "line": 966, "name": "WL_EV_SZ", "signature": "#define WL_EV_SZ"}, {"kind": "macro", "line": 1122, "name": "WL_STREAM_CAP", "signature": "#define WL_STREAM_CAP"}, {"kind": "macro", "line": 1185, "name": "WL_IFACE_COUNT", "signature": "#define WL_IFACE_COUNT"}]}, {"doc": "Docstring: heap pixel store for the Wayland-mini server.", "id": "progs/wl/wl_pixbuf.h", "kind": "module", "label": "wl_pixbuf.h", "language": "h", "sha256": "49a04e307d807e83", "symbol_count": 18, "symbols": [{"doc": "#ifndef WPIX_MAX_H #define WPIX_MAX_H WL_SURF_MAX_H #endif #ifndef WPIX_SLOT_MAX #define WPIX_SLOT_MAX WL_POOL_MAX #endif #ifndef WPIX_BUDGET_MAX #define WPIX_BUDGET_MAX (WL_MAX_SURFACES * WL_POOL_MAX) #endif /** Docstring: one slot cache, empty when p is null or w*h is zero.", "kind": "struct", "line": 48, "name": "wpix_slot"}, {"doc": "#endif #ifndef WPIX_BUDGET_MAX #define WPIX_BUDGET_MAX (WL_MAX_SURFACES * WL_POOL_MAX) #endif /** Docstring: one slot cache, empty when p is null or w*h is zero. struct wpix_slot { unsigned char *p; int w; int h; }; /** Docstring: slot caches plus one reusable raw/decode scratch pair.", "kind": "struct", "line": 55, "name": "wpix_store"}, {"doc": "unsigned char *p; int w; int h; }; /** Docstring: slot caches plus one reusable raw/decode scratch pair. struct wpix_store { struct wpix_slot slots[WPIX_MAX_SLOTS]; unsigned char *tmp_raw; unsigned char *tmp_dst; size_t tmp_cap; }; /** Docstring: zero init every slot and scratch pointer.", "kind": "function", "line": 63, "name": "wpix_init", "signature": "static int wpix_init(struct wpix_store *s)"}, {"doc": "size_t k = 0; if (s == NULL) return -1; for (k = 0; k < (size_t)WPIX_MAX_SLOTS; k++) { s->slots[k].p = NULL; s->slots[k].w = 0; s->slots[k].h = 0; } s->tmp_raw = NULL; s->tmp_dst = NULL; s->tmp_cap = 0; return 0; } /** Docstring: release every slot and scratch buffer, back to zero init.", "kind": "function", "line": 78, "name": "wpix_free", "signature": "static void wpix_free(struct wpix_store *s)"}, {"doc": "for (k = 0; k < (size_t)WPIX_MAX_SLOTS; k++) { free(s->slots[k].p); s->slots[k].p = NULL; s->slots[k].w = 0; s->slots[k].h = 0; } free(s->tmp_raw); free(s->tmp_dst); s->tmp_raw = NULL; s->tmp_dst = NULL; s->tmp_cap = 0; } /** Docstring: live pixel bytes held across all slots.", "kind": "function", "line": 95, "name": "wpix_used", "signature": "static size_t wpix_used(const struct wpix_store *s)"}, {"doc": "/** Docstring: live pixel bytes held across all slots. static size_t wpix_used(const struct wpix_store *s) { size_t k = 0; size_t n = 0; if (s == NULL) return 0; for (k = 0; k < (size_t)WPIX_MAX_SLOTS; k++) { if (s->slots[k].p != NULL && s->slots[k].w > 0 && s->slots[k].h > 0) n += (size_t)s->slots[k].w * (size_t)s->slots[k].h; } return n; } /** Docstring: readable pixels for slot idx, null when empty or wild.", "kind": "function", "line": 107, "name": "wpix_ptr", "signature": "static unsigned char *wpix_ptr(struct wpix_store *s, int idx)"}, {"doc": "n += (size_t)s->slots[k].w * (size_t)s->slots[k].h; } return n; } /** Docstring: readable pixels for slot idx, null when empty or wild. static unsigned char *wpix_ptr(struct wpix_store *s, int idx) { if (s == NULL || idx < 0 || idx >= WPIX_MAX_SLOTS) return NULL; if (s->slots[idx].p == NULL || s->slots[idx].w <= 0 || s->slots[idx].h <= 0) return NULL; return s->slots[idx].p; } /** Docstring: raw scratch for mailbox file reads, null below capacity.", "kind": "function", "line": 115, "name": "wpix_raw", "signature": "static unsigned char *wpix_raw(struct wpix_store *s)"}, {"doc": "static unsigned char *wpix_ptr(struct wpix_store *s, int idx) { if (s == NULL || idx < 0 || idx >= WPIX_MAX_SLOTS) return NULL; if (s->slots[idx].p == NULL || s->slots[idx].w <= 0 || s->slots[idx].h <= 0) return NULL; return s->slots[idx].p; } /** Docstring: raw scratch for mailbox file reads, null below capacity. static unsigned char *wpix_raw(struct wpix_store *s) { if (s == NULL) return NULL; return s->tmp_raw; } /** Docstring: decode scratch for resampled cells, null below capacity.", "kind": "function", "line": 121, "name": "wpix_dst", "signature": "static unsigned char *wpix_dst(struct wpix_store *s)"}, {"doc": "/** Docstring: raw scratch for mailbox file reads, null below capacity. static unsigned char *wpix_raw(struct wpix_store *s) { if (s == NULL) return NULL; return s->tmp_raw; } /** Docstring: decode scratch for resampled cells, null below capacity. static unsigned char *wpix_dst(struct wpix_store *s) { if (s == NULL) return NULL; return s->tmp_dst; } /** Docstring: drop slot pixels and release its memory to the budget.", "kind": "function", "line": 127, "name": "wpix_drop", "signature": "static void wpix_drop(struct wpix_store *s, int idx)"}, {"doc": "if (s == NULL) return NULL; return s->tmp_dst; } /** Docstring: drop slot pixels and release its memory to the budget. static void wpix_drop(struct wpix_store *s, int idx) { if (s == NULL || idx < 0 || idx >= WPIX_MAX_SLOTS) return; free(s->slots[idx].p); s->slots[idx].p = NULL; s->slots[idx].w = 0; s->slots[idx].h = 0; } /** Docstring: grow both scratch buffers to need bytes, old kept on failure.", "kind": "function", "line": 136, "name": "wpix_tmp", "signature": "static int wpix_tmp(struct wpix_store *s, size_t need)"}, {"doc": "if (s == NULL) return -1; if (need == 0 || need > (size_t)WPIX_SLOT_MAX) return -1; if (s->tmp_cap >= need) return 0; nr = (unsigned char *)realloc(s->tmp_raw, need); if (nr == NULL) return -1; s->tmp_raw = nr; nd = (unsigned char *)realloc(s->tmp_dst, need); if (nd == NULL) return -1; s->tmp_dst = nd; s->tmp_cap = need; return 0; } /** Docstring: size slot idx for w*h cells inside bounds and budget.", "kind": "function", "line": 153, "name": "wpix_ensure", "signature": "static int wpix_ensure(struct wpix_store *s, int idx, int w, int h)"}, {"doc": "if (s->slots[idx].p != NULL && s->slots[idx].w == w && s->slots[idx].h == h) return 0; if (s->slots[idx].p != NULL && s->slots[idx].w > 0 && s->slots[idx].h > 0) old = (size_t)s->slots[idx].w * (size_t)s->slots[idx].h; if (wpix_used(s) - old + cells > (size_t)WPIX_BUDGET_MAX) return -1; np = (unsigned char *)realloc(s->slots[idx].p, cells); if (np == NULL) return -1; s->slots[idx].p = np; s->slots[idx].w = w; s->slots[idx].h = h; return 0; } /** Docstring: copy cells into a matching slot, fail closed on mismatch.", "kind": "function", "line": 175, "name": "wpix_commit", "signature": "static int wpix_commit(struct wpix_store *s, int idx, const unsigned char *src, int w, int h)"}, {"kind": "macro", "line": 17, "name": "MINIOS_WL_PIXBUF_H", "signature": "#define MINIOS_WL_PIXBUF_H"}, {"kind": "macro", "line": 28, "name": "WPIX_MAX_SLOTS", "signature": "#define WPIX_MAX_SLOTS"}, {"kind": "macro", "line": 32, "name": "WPIX_MAX_W", "signature": "#define WPIX_MAX_W"}, {"kind": "macro", "line": 36, "name": "WPIX_MAX_H", "signature": "#define WPIX_MAX_H"}, {"kind": "macro", "line": 40, "name": "WPIX_SLOT_MAX", "signature": "#define WPIX_SLOT_MAX"}, {"kind": "macro", "line": 44, "name": "WPIX_BUDGET_MAX", "signature": "#define WPIX_BUDGET_MAX"}]}, {"doc": "wlcomp - Wayland-mini ring-3 compositor (ADR-0024, ADR-0026).", "id": "progs/wl/wlcomp.c", "kind": "module", "label": "wlcomp.c", "language": "c", "sha256": "9f0586c82d49a22e", "symbol_count": 47, "symbols": [{"doc": "#include <string.h> #include <unistd.h> #include \"minios_abi.h\" #include \"nk_palette.h\" #include \"wl_mini.h\" #include \"wl/wl_mbox.h\" #include \"wl/wl_client.h\" #include \"wl/wl_pixbuf.h\" #define WLCOMP_W 800 #define WLCOMP_H 360 /** Centralized compositor configuration, no magic numbers at call sites.", "kind": "struct", "line": 43, "name": "wlcomp_cfg_t"}, {"kind": "struct", "line": 406, "name": "wlserv_t"}, {"doc": "wlserv_drop(s, idx); s->rw[idx] = w; s->rh[idx] = h; } s->raw_dirty[idx] = 1; } changed = 1; } if (changed) wlserv_recolor(&s->comp); return changed; } /** Client pattern table, one row per attachable demo client.", "kind": "struct", "line": 995, "name": "wlclient_pat_t"}, {"kind": "function", "line": 57, "name": "wlcomp_sys_title", "signature": "static long wlcomp_sys_title(const char *t)"}, {"kind": "function", "line": 65, "name": "wlcomp_sys_present", "signature": "static long wlcomp_sys_present(long buf)"}, {"kind": "function", "line": 73, "name": "wlcomp_sys_present_origin", "signature": "static long wlcomp_sys_present_origin(long buf, int *origin)"}, {"kind": "function", "line": 81, "name": "wlcomp_sys_palette", "signature": "static long wlcomp_sys_palette(unsigned char *pal)"}, {"kind": "function", "line": 89, "name": "wlcomp_sys_mouse", "signature": "static long wlcomp_sys_mouse(int *m)"}, {"kind": "function", "line": 97, "name": "wlcomp_sys_kbd", "signature": "static long wlcomp_sys_kbd(void)"}, {"kind": "function", "line": 105, "name": "wlcomp_sys_kbd_raw", "signature": "static long wlcomp_sys_kbd_raw(long on)"}, {"kind": "function", "line": 113, "name": "wlcomp_sys_vga_mode", "signature": "static long wlcomp_sys_vga_mode(long on)"}, {"kind": "function", "line": 121, "name": "wlcomp_sys_yield", "signature": "static long wlcomp_sys_yield(void)"}, {"kind": "function", "line": 129, "name": "wlcomp_sys_dir_list", "signature": "static long wlcomp_sys_dir_list(const char *path, char *buf, long cap)"}, {"doc": "Upload the shared hybrid palette so indexed pixels expand through * desktop-exact colors on every VBE mode instead of the gray ramp.", "kind": "function", "line": 139, "name": "wlcomp_palette", "signature": "static int wlcomp_palette(void)"}, {"doc": "Paint a deterministic test pattern so the demo proves real pixels * travelled the blit path instead of solid fills.", "kind": "function", "line": 150, "name": "wlcomp_pattern", "signature": "static void wlcomp_pattern(unsigned char *dst, int w, int h,\n        unsigned char a, unsigned ch..."}, {"kind": "function", "line": 189, "name": "wlcomp_demo", "signature": "static int wlcomp_demo(wl_comp_t *c)"}, {"doc": "if (wl_comp_add(c, s1, 320, 200) != WL_ERR_OK) return 1; if (wl_comp_set_color(c, s0, 4) != WL_ERR_OK) return 1; if (wl_comp_set_color(c, s1, 6) != WL_ERR_OK) return 1; if (wl_comp_layout_tile(c, WLCOMP_W, WLCOMP_H) != 2) return 1; if (wl_comp_focus(c, s0) != WL_ERR_OK) return 1; return 0; } /** Composite the tiled demo with real client pixels into the frame.", "kind": "function", "line": 214, "name": "wlcomp_demo_blit", "signature": "static int wlcomp_demo_blit(wl_comp_t *c, unsigned char *fb)"}, {"doc": "wlcomp_pattern(p1, w1, h1, cfg.check_a, cfg.check_b, 1); px[c->order[0]] = p0; pw[c->order[0]] = w0; ph[c->order[0]] = h0; px[c->order[1]] = p1; pw[c->order[1]] = w1; ph[c->order[1]] = h1; rc = wlcomp_blit(c, fb, WLCOMP_W, WLCOMP_H, px, pw, ph); free(p0); free(p1); return rc != WL_ERR_OK; } /** Append one header-only request to a session buffer.", "kind": "function", "line": 260, "name": "wlcomp_emit", "signature": "static int wlcomp_emit(unsigned char *s, int cap, int o, unsigned int id,\n        unsigned int op..."}, {"doc": "Drive a full client session through stream plus dispatch. The byte * feed splits mid-header so reassembly is proven, not assumed.", "kind": "function", "line": 272, "name": "wlcomp_session", "signature": "static int wlcomp_session(wl_comp_t *c, wl_client_t *cl)"}, {"kind": "function", "line": 345, "name": "wlcomp_selftest", "signature": "static int wlcomp_selftest(void)"}, {"kind": "function", "line": 418, "name": "wlserv_init", "signature": "static void wlserv_init(wlserv_t *s)"}, {"doc": "wpix_init(&wlserv_raw); for (i = 0; i < WL_MAX_SURFACES; i++) { s->pw[i] = 0; s->ph[i] = 0; s->rw[i] = 0; s->rh[i] = 0; s->raw_dirty[i] = 1; } s->origin[0] = 0; s->origin[1] = 0; s->last_count = 0; } /** Items index owning a surface id, or -1 for a stranger.", "kind": "function", "line": 437, "name": "wlserv_slot", "signature": "static int wlserv_slot(const wl_comp_t *c, unsigned int id)"}, {"doc": "Paint every mapped slot a distinct desktop-exact ink so clients * without pixels still read as separate windows.", "kind": "function", "line": 450, "name": "wlserv_recolor", "signature": "static void wlserv_recolor(wl_comp_t *c)"}, {"doc": "Composite the cached pixels and present with palette uploaded, capturing the content origin for pointer translation. Chrome (title bar plus close box plus active focus) paints here so every * frame carries real window decorations.", "kind": "function", "line": 467, "name": "wlserv_present", "signature": "static int wlserv_present(wlserv_t *s)"}, {"doc": "Reload the raw copy of one slot from its box .raw file. Returns 0 on success; any short file, size lie or allocation failure returns -1 * and leaves the caller to drop the slot.", "kind": "function", "line": 502, "name": "wlserv_load_raw", "signature": "static int wlserv_load_raw(wlserv_t *s, int b, int idx)"}, {"doc": "Fit every mapped surface to its laid-out size: reload the box raw copy only when the client published since the last fit, then resample into the live cell only when the pixels or the cell changed. Heap slots size on geometry change only, so steady frames allocate nothing and a move or resize never touches the disk; any short file or size lie drops that cache, never a neighbour, so one * hostile client cannot blank the desktop.", "kind": "function", "line": 547, "name": "wlserv_fit", "signature": "static void wlserv_fit(wlserv_t *s)"}, {"doc": "Unlink stray .msg files no client owns: names that fail the exact mailbox parse can never dispatch, so they are dead weight from a * crashed client. The mirror flag carries no suffix and is kept.", "kind": "function", "line": 609, "name": "wlserv_gc_strays", "signature": "static void wlserv_gc_strays(void)"}, {"doc": "Server-to-client input delivery (ADR-0026 live step). The server owns PS/2 while it owns the display, so it forwards raw scancodes plus mapped pointer state to the focused box through its .ev file. Queues are static (never malloc): a full queue drops the oldest * byte, a slow client loses middle batches by seq design. static unsigned char wlserv_ev_pend[WL_MAX_SURFACES][WL_EV_SC_MAX]; static unsigned wlserv_ev_npend[WL_MAX_SURFACES]; static unsigned wlserv_ev_seq[WL_MAX_SURFACES]; static unsigned wlserv_ev_wheel = 0; /** Focused box slot, or -1 when no mapped window holds input.", "kind": "function", "line": 664, "name": "wlserv_focus_box", "signature": "static int wlserv_focus_box(const wlserv_t *s)"}, {"doc": "Queue one raw byte for the focused client. Bytes nobody owns are * dropped, never buffered: input without a window is noise.", "kind": "function", "line": 686, "name": "wlserv_key", "signature": "static void wlserv_key(wlserv_t *s, unsigned char byte)"}, {"doc": "b = wlserv_focus_box(s); if (b < 0) return; n = wlserv_ev_npend[b]; if (n >= WL_EV_SC_MAX) { for (i = 0; i + 1 < WL_EV_SC_MAX; i++) wlserv_ev_pend[b][i] = wlserv_ev_pend[b][i + 1]; n = WL_EV_SC_MAX - 1; } wlserv_ev_pend[b][n] = byte; wlserv_ev_npend[b] = n + 1; } /** Drop a slot queue without serving it.", "kind": "function", "line": 706, "name": "wlserv_ev_clear", "signature": "static void wlserv_ev_clear(wlserv_t *s, int b)"}, {"doc": "Push the current input state to the focused box. Frame coords map into the client's raw buffer through wl_ev_map; outside is (-1,-1) so the client never warps a click. The queue clears after write, * which is what keeps batches from replaying.", "kind": "function", "line": 717, "name": "wlserv_push_ev", "signature": "static void wlserv_push_ev(wlserv_t *s, int fx, int fy, int buttons)"}, {"doc": "Unlink every stale .ev file so no dead input replays after a restart. Runs once at server start; live files are rewritten by * their owners from then on.", "kind": "function", "line": 765, "name": "wlserv_clean_ev", "signature": "static void wlserv_clean_ev(void)"}, {"doc": "Close one surface by id: remove it, free its box slot for the next client, drop its cache and unlink its raw pixels. Returns 1 when something closed. A live client re-attaches on its next frame, so closing a live window also wants the client's job killed from the * shell; the box name carries the client pid for exactly that.", "kind": "function", "line": 798, "name": "wlserv_close", "signature": "static int wlserv_close(wlserv_t *s, unsigned int id)"}, {"doc": "if (s->boxes[b].used) { if (wl_mbox_raw_name(path, sizeof path, s->boxes[b].box) > 0) unlink(path); if (wl_mbox_ev_name(path, sizeof path, s->boxes[b].box) > 0) unlink(path); s->boxes[b].used = 0; s->boxes[b].box[0] = '\\0'; s->boxes[b].seq_last = 0; } wlserv_recolor(&s->comp); return 1; } /** 1 when a box name already owns a server slot.", "kind": "function", "line": 830, "name": "wlserv_box_known", "signature": "static int wlserv_box_known(const wlserv_t *s, const char *box)"}, {"kind": "function", "line": 844, "name": "forever", "signature": "* one of the WL_MAX_SURFACES slots forever (eight bad names used to lock\n * every real client out..."}, {"doc": "Drain at most WL_MBOX_POLL_MAX mailbox files: validate every frame before dispatch, unlink what was consumed, and leave torn writes for the next poll. A box whose first message is torn or rejected never keeps the slot it was provisionally given. Every routed message marks the slot's raw pixels dirty (clients republish the .raw file before each attach/commit), so the next fit reloads them. * Returns 1 when pixels changed.", "kind": "function", "line": 933, "name": "wlserv_drain", "signature": "static int wlserv_drain(wlserv_t *s)"}, {"kind": "function", "line": 1005, "name": "wlclient_find", "signature": "static const wlclient_pat_t *wlclient_find(const char *name)"}, {"doc": "Attach one client surface from a second process through the shared wl_client.h transport: pixels first so the server never attaches a surface whose raw file is missing, then the six-message session, each sequenced. One-shot malloc is fine here; the server * hot loop is the path that must never allocate.", "kind": "function", "line": 1034, "name": "wlcomp_client", "signature": "static int wlcomp_client(const char *box, const char *pat)"}, {"doc": "Join WL_MBOX_DIR + '/' + name into dst. Returns 1 on success, 0 when the name is not NUL-terminated in bounds or the path would not fit: one helper for every directory scan in this file, so the * join logic cannot drift between call sites.", "kind": "function", "line": 1103, "name": "wlcomp_path", "signature": "static int wlcomp_path(char *dst, int cap, const char *name)"}, {"doc": "Tile, refit pixels and present. Returns 0 when the desktop shows the new layout, nonzero otherwise. Every mutate-then-show site *  funnels here so a missed present can never leave a stale frame.", "kind": "function", "line": 1123, "name": "wlserv_relayout_present", "signature": "static int wlserv_relayout_present(wlserv_t *s)"}, {"doc": "static int wlserv_relayout_present(wlserv_t *s) { if (!s) return 1; if (wl_comp_layout_tile(&s->comp, WLCOMP_W, WLCOMP_H) <= 0) return 1; s->last_count = s->comp.count; wlserv_recolor(&s->comp); wlserv_fit(s); if (wlserv_present(s) != 0) return 1; return 0; } /** Unlink every mailbox file so a new session starts clean.", "kind": "function", "line": 1137, "name": "wlcomp_clean", "signature": "static int wlcomp_clean(void)"}, {"doc": "Drain once and exit so scripts prove multiprocess composition * through the gfx frames counter without an interactive loop.", "kind": "function", "line": 1165, "name": "wlcomp_once", "signature": "static int wlcomp_once(void)"}, {"doc": "Interactive desktop: click focuses, title drag moves, rim drag resizes, close box closes, pure pointer motion re-presents so the kernel cursor painter follows every move, Alt+T re-tiles, Alt+M minimizes, Alt+U restores, Alt+Tab cycles focus, Alt+Q quits with the desktop redrawn behind it. ESC quits too when no window is mapped (an empty desktop owns the keyboard but has nobody to receive keys, so ESC must never trap the user there); with windows mapped ESC reaches the focused client through its .ev file. Plain keys always reach the focused client; only Alt-held combos act on the server, so typing never tiles. A /shm/wl/quit flag file quits cleanly too (the `desktop stop` path, which cannot send keystrokes to a * background job).", "kind": "function", "line": 1197, "name": "wlcomp_server", "signature": "static int wlcomp_server(void)"}, {"kind": "function", "line": 1467, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 39, "name": "WLCOMP_W", "signature": "#define WLCOMP_W"}, {"kind": "macro", "line": 40, "name": "WLCOMP_H", "signature": "#define WLCOMP_H"}, {"kind": "macro", "line": 53, "name": "WLCOMP_CFG_DEFAULT", "signature": "#define WLCOMP_CFG_DEFAULT"}]}, {"doc": "MiniOS QEMU guest agent (QGA).", "id": "qga.c", "kind": "module", "label": "qga.c", "language": "c", "sha256": "af9db4701f38a0aa", "symbol_count": 27, "symbols": [{"kind": "struct", "line": 49, "name": "qga_pair"}, {"kind": "function", "line": 27, "name": "qga_tx_ready", "signature": "static int qga_tx_ready(void)"}, {"kind": "function", "line": 28, "name": "qga_rx_ready", "signature": "static int qga_rx_ready(void)"}, {"kind": "function", "line": 30, "name": "qga_putc", "signature": "static void qga_putc(char c)"}, {"kind": "function", "line": 35, "name": "qga_init", "signature": "void qga_init(void)"}, {"kind": "function", "line": 56, "name": "qga_ws", "signature": "static int qga_ws(char c)"}, {"doc": "Parse a JSON object whose members are stored flat into out[*count..]: a nested object's members keep the parent key as a prefix (`arguments.id`). Only string/int/null/bool values are accepted; arrays and deeper nesting are rejected fail-closed. Returns 1 on success, 0 on malformed or * overflowing input.", "kind": "function", "line": 65, "name": "qga_parse_object", "signature": "static int qga_parse_object(const char **pp, struct qga_pair *out, int max,\n                     ..."}, {"doc": "Parse a request line into the flat pair table. Returns the number of pairs, * or -1 on malformed/overflowing input.", "kind": "function", "line": 147, "name": "qga_parse_flat", "signature": "static int qga_parse_flat(const char *s, struct qga_pair *out, int max)"}, {"kind": "function", "line": 158, "name": "qga_get_str", "signature": "static const char *qga_get_str(const struct qga_pair *pairs, int n, const char *key)"}, {"kind": "function", "line": 166, "name": "qga_get_int", "signature": "static int qga_get_int(const struct qga_pair *pairs, int n, const char *key, long *out)"}, {"kind": "function", "line": 184, "name": "qga_resp_reset", "signature": "static void qga_resp_reset(void)"}, {"kind": "function", "line": 186, "name": "qga_resp_puts", "signature": "static void qga_resp_puts(const char *s)"}, {"kind": "function", "line": 194, "name": "qga_resp_putc_enc", "signature": "static void qga_resp_putc_enc(char c)"}, {"doc": "Append the decimal form of v (a separate helper so no varargs forwarding is * needed; the kernel formatter is not re-entrant with a stored va_list).", "kind": "function", "line": 201, "name": "qga_resp_put_long", "signature": "static void qga_resp_put_long(long v)"}, {"kind": "function", "line": 210, "name": "qga_err", "signature": "static void qga_err(const char *klass, const char *desc)"}, {"kind": "function", "line": 218, "name": "qga_puts_resp", "signature": "static void qga_puts_resp(void)"}, {"kind": "function", "line": 231, "name": "qga_b64_encode", "signature": "static void qga_b64_encode(const unsigned char *in, int n)"}, {"kind": "function", "line": 281, "name": "qga_cmd_get_time", "signature": "static void qga_cmd_get_time(void)"}, {"doc": "guest-exec runs a shell command line; output goes to the console (the `>` redirect still captures it). Queued so the shell executes it at its next * loop top, which raw_blocking_getc forces by returning a newline.", "kind": "function", "line": 306, "name": "qga_cmd_exec", "signature": "static void qga_cmd_exec(const struct qga_pair *pairs, int n)"}, {"kind": "function", "line": 316, "name": "qga_cmd_shutdown", "signature": "static void qga_cmd_shutdown(const struct qga_pair *pairs, int n)"}, {"kind": "function", "line": 329, "name": "qga_file_size", "signature": "static int qga_file_size(const KFILE *f)"}, {"kind": "function", "line": 334, "name": "qga_cmd_file_open", "signature": "static void qga_cmd_file_open(const struct qga_pair *pairs, int n)"}, {"kind": "function", "line": 360, "name": "qga_cmd_file_read", "signature": "static void qga_cmd_file_read(const struct qga_pair *pairs, int n)"}, {"kind": "function", "line": 384, "name": "qga_cmd_file_close", "signature": "static void qga_cmd_file_close(const struct qga_pair *pairs, int n)"}, {"kind": "function", "line": 401, "name": "qga_dispatch", "signature": "static void qga_dispatch(struct qga_pair *pairs, int n)"}, {"doc": "Accumulate bytes until a complete line, then parse and answer it. Callers * call it once per idle spin of the shell's raw input loop.", "kind": "function", "line": 446, "name": "qga_poll", "signature": "void qga_poll(void)"}, {"kind": "function", "line": 10, "name": "channel", "signature": "* * Polled channel (no interrupt controller): qga_init sets up COM2 and * qga_poll, called from raw_blocking_getc, services one complete line per * call. Every input path is bounded and fail-closed: a"}]}, {"doc": "SMP application-processor bring-up.", "id": "smp.c", "kind": "module", "label": "smp.c", "language": "c", "sha256": "05d67838871ea5f4", "symbol_count": 43, "symbols": [{"kind": "function", "line": 88, "name": "lapic_read", "signature": "static unsigned lapic_read(unsigned off)"}, {"kind": "function", "line": 91, "name": "lapic_write", "signature": "static void lapic_write(unsigned off, unsigned val)"}, {"doc": "Broadcast an NMI to every other CPU (TLB shootdown, kernel/mm/tlb.c). Any CPU may call it: interrupts stay off across the two ICR writes so a tick on this CPU cannot interleave its own broadcast between them, and a * previous send still in flight is waited out first.", "kind": "function", "line": 113, "name": "smp_nmi_broadcast", "signature": "void smp_nmi_broadcast(void)"}, {"doc": "Map the LAPIC so the BSP can program the ICR, and the APs can read their id registers.  Extends stage 2's tables: PDPT slot 3 gains a new PD whose * entry covers the LAPIC's 2 MB window as uncached.  Returns 1 on success.", "kind": "function", "line": 128, "name": "map_lapic", "signature": "static int map_lapic(void)"}, {"kind": "function", "line": 141, "name": "ap_delay", "signature": "static void ap_delay(void)"}, {"kind": "function", "line": 170, "name": "lapic_calibrate", "signature": "static void lapic_calibrate(void)"}, {"doc": "ifdef MINIOS_AP_TIMER", "kind": "function", "line": 204, "name": "ap_lapic_timer_start", "signature": "static void ap_lapic_timer_start(void)"}, {"doc": "endif", "kind": "function", "line": 210, "name": "ap_lapic_timer_init", "signature": "static void ap_lapic_timer_init(void)"}, {"kind": "function", "line": 341, "name": "smp_init", "signature": "void smp_init(void)"}, {"doc": "Per-AP kernel stack for the idle loop entry (the 2 KB stub stack is * too shallow for the loop's C frames plus nested IPI ISRs). static char ap_idle_kstack[MAX_CPUS][8192] __attribute__((aligned(16))); /* The syscall trampoline lives in kernel.c (declared global there).", "kind": "function", "line": 86, "name": "syscall_entry", "signature": "extern void syscall_entry(void);"}, {"kind": "function", "line": 258, "name": "BSP", "signature": "* were programmed only on the BSP (syscall_init runs in kmain), so * an AP's first sysretq loaded SS from a zeroed STAR (selector 0x08, * kernel code, as SS) and died with #SS. The values mirror * sys"}, {"kind": "function", "line": 286, "name": "routine", "signature": "* routine (FreeDom's fetch threads, under -smp 2). */ cpu_enable_caches();"}, {"kind": "function", "line": 359, "name": "INIT", "signature": "* INIT (edge-triggered): resets APs to wait-for-SIPI state. * QEMU 11 drops level-triggered INIT (delivery status never clears), * so edge-triggered is used. Two SIPIs deliver the startup vector. */ l"}, {"kind": "macro", "line": 29, "name": "LAPIC_BASE", "signature": "#define LAPIC_BASE"}, {"kind": "macro", "line": 30, "name": "LAPIC_ID_OFF", "signature": "#define LAPIC_ID_OFF"}, {"kind": "macro", "line": 31, "name": "LAPIC_SVR_OFF", "signature": "#define LAPIC_SVR_OFF"}, {"kind": "macro", "line": 32, "name": "LAPIC_ICR_HI", "signature": "#define LAPIC_ICR_HI"}, {"kind": "macro", "line": 33, "name": "LAPIC_ICR_LO", "signature": "#define LAPIC_ICR_LO"}, {"kind": "macro", "line": 34, "name": "LAPIC_LVT_TIMER", "signature": "#define LAPIC_LVT_TIMER"}, {"kind": "macro", "line": 35, "name": "LAPIC_LVT_LINT0", "signature": "#define LAPIC_LVT_LINT0"}, {"kind": "macro", "line": 36, "name": "LAPIC_LVT_LINT1", "signature": "#define LAPIC_LVT_LINT1"}, {"kind": "macro", "line": 37, "name": "LAPIC_LVT_MASKED", "signature": "#define LAPIC_LVT_MASKED"}, {"kind": "macro", "line": 38, "name": "LAPIC_LVT_EXTINT", "signature": "#define LAPIC_LVT_EXTINT"}, {"kind": "macro", "line": 39, "name": "LAPIC_EOI_OFF", "signature": "#define LAPIC_EOI_OFF"}, {"kind": "macro", "line": 40, "name": "LAPIC_TIMER_DIV", "signature": "#define LAPIC_TIMER_DIV"}, {"kind": "macro", "line": 41, "name": "LAPIC_TIMER_INIT", "signature": "#define LAPIC_TIMER_INIT"}, {"kind": "macro", "line": 42, "name": "LAPIC_TIMER_CUR", "signature": "#define LAPIC_TIMER_CUR"}, {"kind": "macro", "line": 44, "name": "LAPIC_SVR_ENABLE", "signature": "#define LAPIC_SVR_ENABLE"}, {"kind": "macro", "line": 45, "name": "LAPIC_ICR_BUSY", "signature": "#define LAPIC_ICR_BUSY"}, {"kind": "macro", "line": 46, "name": "LAPIC_ICR_INIT", "signature": "#define LAPIC_ICR_INIT"}, {"kind": "macro", "line": 47, "name": "LAPIC_ICR_SIPI", "signature": "#define LAPIC_ICR_SIPI"}, {"kind": "macro", "line": 48, "name": "LAPIC_ICR_ALL_EXC", "signature": "#define LAPIC_ICR_ALL_EXC"}, {"kind": "macro", "line": 49, "name": "LAPIC_ICR_LEVEL", "signature": "#define LAPIC_ICR_LEVEL"}, {"kind": "macro", "line": 50, "name": "LAPIC_ICR_TRIGGER", "signature": "#define LAPIC_ICR_TRIGGER"}, {"kind": "macro", "line": 51, "name": "LAPIC_ICR_NMI", "signature": "#define LAPIC_ICR_NMI"}, {"kind": "macro", "line": 53, "name": "LAPIC_ICR_IDLE_SPINS", "signature": "#define LAPIC_ICR_IDLE_SPINS"}, {"kind": "macro", "line": 55, "name": "SIPI_VECTOR", "signature": "#define SIPI_VECTOR"}, {"kind": "macro", "line": 58, "name": "PIT_HZ", "signature": "#define PIT_HZ"}, {"kind": "macro", "line": 61, "name": "LAPIC_TIMER_DIVIDE_16", "signature": "#define LAPIC_TIMER_DIVIDE_16"}, {"kind": "macro", "line": 62, "name": "LAPIC_TIMER_PERIODIC", "signature": "#define LAPIC_TIMER_PERIODIC"}, {"kind": "macro", "line": 70, "name": "LAPIC_PD_ADDR", "signature": "#define LAPIC_PD_ADDR"}, {"kind": "macro", "line": 71, "name": "LAPIC_PDPT_SLOT", "signature": "#define LAPIC_PDPT_SLOT"}, {"kind": "macro", "line": 72, "name": "LAPIC_PD_IDX", "signature": "#define LAPIC_PD_IDX"}]}, {"doc": "host_aes.sh - host-side verification for the AES-256-CTR command tools.  The miniGCC-built tools are static Linux ELFs, so they run on the host. This script checks the cipher core against two independent references (NIST SP 800-38A F.5.5 CTR-AES256 and OpenSSL) plus roundtrip, dispatch, empty input and the fail-closed rejection paths.  Usage: tests/host_aes.sh <progs_dir>", "id": "tests/host_aes.sh", "kind": "module", "label": "host_aes.sh", "language": "sh", "sha256": "87ad4bd8743741ef", "symbol_count": 3, "symbols": [{"kind": "function", "line": 23, "name": "ok"}, {"kind": "function", "line": 24, "name": "bad"}, {"kind": "function", "line": 25, "name": "rd"}]}, {"doc": "host_codecs.sh - reusable host-side verification for the in-OS codec tools.  The miniGCC-compiled tools are static Linux ELFs (the kernel runs Linux binaries unmodified), so they execute on the host too.  This script drives them with a host file: roundtrip, fail-closed rejection, and (for lzss) bidirectional interop against the reference Okumura codec in $LZSS_REF_SRC.  LZ4 cannot interop on the host because it goes through MiniOS syscalls 216/217, so only its lzss-style roundtrip + reject paths are exercised here; the kernel LZ4 roundtrip is covered by test_lz4_kernel.  Usage: host_codecs.sh <progs_dir> <progs_dir>  the miniOS progs/ dir containing bin/lzss, bin/unlzss, ... Environment: LZSS_REF_SRC (default ../../CompressLoader/lzss.c)", "id": "tests/host_codecs.sh", "kind": "module", "label": "host_codecs.sh", "language": "sh", "sha256": "36d0a72d4d14bf42", "symbol_count": 5, "symbols": [{"kind": "function", "line": 22, "name": "ok"}, {"kind": "function", "line": 23, "name": "bad"}, {"kind": "function", "line": 27, "name": "gen_input"}, {"kind": "function", "line": 31, "name": "roundtrip"}, {"kind": "function", "line": 40, "name": "reject"}]}, {"doc": "Docstring: Host-test stand-in for headers/kernel.h (tests/stubs first on", "id": "tests/stubs/kernel.h", "kind": "module", "label": "kernel.h", "language": "h", "sha256": "609c7f75e26fb313", "symbol_count": 15, "symbols": [{"kind": "type_alias", "line": 77, "name": "irqflags_t", "signature": "typedef unsigned long irqflags_t;"}, {"kind": "function", "line": 8, "name": "observe", "signature": "* the tests must observe (fed scancodes, queued bytes, registered devices)\n * is recorded in vari..."}, {"doc": "Docstring: Aligned blocks from kmalloc_aligned are not freed by the * host tests, so no base-pointer recovery is needed here.", "kind": "function", "line": 30, "name": "__attribute__", "signature": "static __attribute__((unused)) void kfree(void *p)"}, {"kind": "function", "line": 34, "name": "__attribute__", "signature": "static __attribute__((unused)) void *kmalloc_aligned(unsigned long size, unsigned long align)"}, {"kind": "function", "line": 51, "name": "__attribute__", "signature": "static __attribute__((unused)) int kprintf(const char *fmt, ...)"}, {"kind": "function", "line": 60, "name": "__attribute__", "signature": "static __attribute__((unused)) int kmm_make_uncached(unsigned long phys, unsigned long len)"}, {"kind": "function", "line": 66, "name": "__attribute__", "signature": "static __attribute__((unused)) unsigned long kmm_map_device(unsigned long phys,\n                 ..."}, {"kind": "function", "line": 74, "name": "__attribute__", "signature": "static __attribute__((unused)) unsigned long ktime_ms(void)"}, {"kind": "function", "line": 80, "name": "__attribute__", "signature": "static __attribute__((unused)) irqflags_t spin_save_irq(void)"}, {"kind": "function", "line": 84, "name": "__attribute__", "signature": "static __attribute__((unused)) void spin_restore_irq(irqflags_t flags)"}, {"kind": "variable", "line": 72, "name": "stub_ms_now", "signature": "extern unsigned long stub_ms_now;"}, {"kind": "macro", "line": 14, "name": "TEST_STUB_KERNEL_H", "signature": "#define TEST_STUB_KERNEL_H"}, {"kind": "macro", "line": 22, "name": "PCI_MMIO_SIZE", "signature": "#define PCI_MMIO_SIZE"}, {"kind": "macro", "line": 48, "name": "kmemset", "signature": "#define kmemset"}, {"kind": "macro", "line": 49, "name": "kmemcpy", "signature": "#define kmemcpy"}]}, {"doc": "Docstring: tests/test_abi.c -- Host test for the ABI manifest gate.", "id": "tests/test_abi.c", "kind": "module", "label": "test_abi.c", "language": "c", "sha256": "72a6124e7df57f4f", "symbol_count": 2, "symbols": [{"kind": "function", "line": 16, "name": "expect", "signature": "static void expect(const char *name, const char *manifest, int want)"}, {"kind": "function", "line": 25, "name": "main", "signature": "int main(void)"}]}, {"doc": "Docstring: host test for the bump arena (make test-arena).", "id": "tests/test_arena.c", "kind": "module", "label": "test_arena.c", "language": "c", "sha256": "c53a2c0e1e8c4528", "symbol_count": 2, "symbols": [{"kind": "function", "line": 23, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 14, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for kernel/batch.c (make test-batch).", "id": "tests/test_batch.c", "kind": "module", "label": "test_batch.c", "language": "c", "sha256": "986a17e3d512c0e8", "symbol_count": 3, "symbols": [{"kind": "function", "line": 24, "name": "stub_dispatch", "signature": "static long stub_dispatch(uint32_t opcode)"}, {"kind": "function", "line": 31, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "test_doom_pwad.py - host contract suite for tools/doom_pwad.py.  Runs the grid compiler and the PWAD checker against fixed vectors: a known room builds to a pinned byte layout, the output passes the checker, and every malformed input or mutated file is refused with a diagnostic instead of a partial artifact.", "id": "tests/test_doom_pwad.py", "kind": "module", "label": "test_doom_pwad.py", "language": "py", "sha256": "e4b94a450836c296", "symbol_count": 44, "symbols": [{"doc": "Grid parsing refuses malformed rooms before any byte is emitted.", "kind": "class", "line": 29, "name": "GridValidationTests", "signature": "class GridValidationTests(TestCase)"}, {"doc": "The emitted PWAD keeps the vanilla lump contract byte-exact.", "kind": "class", "line": 82, "name": "PwadLayoutTests", "signature": "class PwadLayoutTests(TestCase)"}, {"doc": "Single-byte and structural mutations of a good file all fail.", "kind": "class", "line": 181, "name": "PwadMutationTests", "signature": "class PwadMutationTests(TestCase)"}, {"doc": "Every palette letter compiles to its engine thing id.", "kind": "class", "line": 255, "name": "ExtendedLegendTests", "signature": "class ExtendedLegendTests(TestCase)"}, {"doc": "Slice one lump payload out of a built image by directory order.", "kind": "function", "line": 310, "name": "lump_blob", "signature": "def lump_blob(blob, idx)"}, {"doc": "Doors, dark rooms and nukage pits compile to real sectors.", "kind": "class", "line": 317, "name": "MultiSectorTests", "signature": "class MultiSectorTests(TestCase)"}, {"doc": "Broken tags, specials and sidedef pairs fail closed.", "kind": "class", "line": 388, "name": "MultiSectorMutationTests", "signature": "class MultiSectorMutationTests(TestCase)"}, {"doc": "A closed room with player and exit parses to five rows.", "kind": "method", "line": 32, "name": "test_valid_room_parses", "signature": "def test_valid_room_parses(self)"}, {"doc": "Rows of uneven length are rejected, never padded silently.", "kind": "method", "line": 36, "name": "test_ragged_rows_refused", "signature": "def test_ragged_rows_refused(self)"}, {"doc": "A room without a player start cannot build.", "kind": "method", "line": 41, "name": "test_missing_player_refused", "signature": "def test_missing_player_refused(self)"}, {"doc": "A room without an exit marker cannot build.", "kind": "method", "line": 46, "name": "test_missing_exit_refused", "signature": "def test_missing_exit_refused(self)"}, {"doc": "Characters outside the legend are rejected outright.", "kind": "method", "line": 51, "name": "test_illegal_char_refused", "signature": "def test_illegal_char_refused(self)"}, {"doc": "An exit sealed behind walls is refused instead of unplayable.", "kind": "method", "line": 56, "name": "test_unreachable_exit_refused", "signature": "def test_unreachable_exit_refused(self)"}, {"doc": "An exit marker floating mid-floor has no switch edge to mark.", "kind": "method", "line": 66, "name": "test_exit_needs_wall", "signature": "def test_exit_needs_wall(self)"}, {"doc": "A built room passes the checker with a sane lump census.", "kind": "method", "line": 85, "name": "test_roundtrip_check", "signature": "def test_roundtrip_check(self)"}, {"doc": "Magic, lump count and label lump stay pinned for the fixture.", "kind": "method", "line": 96, "name": "test_header_pin", "signature": "def test_header_pin(self)"}, {"doc": "Lumps follow the ML_LABEL..ML_BLOCKMAP order the engine walks.", "kind": "method", "line": 103, "name": "test_lump_order_pin", "signature": "def test_lump_order_pin(self)"}, {"doc": "Player and exit-adjacent layout land on expected coordinates.", "kind": "method", "line": 115, "name": "test_things_pin", "signature": "def test_things_pin(self)"}, {"doc": "Exactly one linedef carries the exit special after a build.", "kind": "method", "line": 129, "name": "test_exit_switch_pin", "signature": "def test_exit_switch_pin(self)"}, {"doc": "An exit against any of the four walls builds a closed room.", "kind": "method", "line": 141, "name": "test_exit_on_every_side", "signature": "def test_exit_on_every_side(self)"}, {"doc": "Interior wall blocks add loops without opening the boundary.", "kind": "method", "line": 154, "name": "test_pillar_room_stays_closed", "signature": "def test_pillar_room_stays_closed(self)"}, {"doc": "Retargeting one endpoint unbalances two vertexes, refused.", "kind": "method", "line": 168, "name": "test_open_boundary_dies", "signature": "def test_open_boundary_dies(self)"}, {"doc": "Build one known-good image shared by every mutation case.", "kind": "method", "line": 184, "name": "setUp", "signature": "def setUp(self)"}, {"doc": "An IWAD magic on a custom file is refused, never trusted.", "kind": "method", "line": 188, "name": "test_bad_magic_dies", "signature": "def test_bad_magic_dies(self)"}, {"doc": "A file cut mid-directory is refused instead of half-parsed.", "kind": "method", "line": 193, "name": "test_truncated_file_dies", "signature": "def test_truncated_file_dies(self)"}, {"doc": "Swapping two directory names breaks the order contract.", "kind": "method", "line": 198, "name": "test_swapped_lumps_die", "signature": "def test_swapped_lumps_die(self)"}, {"doc": "A THINGS lump with a torn record is refused, never rounded.", "kind": "method", "line": 212, "name": "test_partial_record_dies", "signature": "def test_partial_record_dies(self)"}, {"doc": "A linedef pointing past the vertex list is refused.", "kind": "method", "line": 221, "name": "test_wild_vertex_dies", "signature": "def test_wild_vertex_dies(self)"}, {"doc": "Clearing the exit special leaves a file with no way out.", "kind": "method", "line": 230, "name": "test_missing_exit_dies", "signature": "def test_missing_exit_dies(self)"}, {"doc": "A blockmap list without a terminator is refused, never scanned.", "kind": "method", "line": 243, "name": "test_unterminated_blockmap_dies", "signature": "def test_unterminated_blockmap_dies(self)"}, {"doc": "A room holding the whole palette passes the checker.", "kind": "method", "line": 273, "name": "test_every_legend_char_builds", "signature": "def test_every_legend_char_builds(self)"}, {"doc": "Each letter lands on the doomednum the engine spawns.", "kind": "method", "line": 278, "name": "test_every_thing_id_matches_engine", "signature": "def test_every_thing_id_matches_engine(self)"}, {"doc": "A door cell splits one room into two sectors with a tag.", "kind": "method", "line": 320, "name": "test_door_room_builds_two_sectors", "signature": "def test_door_room_builds_two_sectors(self)"}, {"doc": "Both door faces carry D1 open with the door sector tag.", "kind": "method", "line": 327, "name": "test_door_lines_are_tagged_openers", "signature": "def test_door_lines_are_tagged_openers(self)"}, {"doc": "Dark rooms dim the light, nukage drops the floor and stings.", "kind": "method", "line": 355, "name": "test_dark_and_nukage_sector_props", "signature": "def test_dark_and_nukage_sector_props(self)"}, {"doc": "REJECT holds exactly the bit table for the sector count.", "kind": "method", "line": 374, "name": "test_reject_scales_with_sector_count", "signature": "def test_reject_scales_with_sector_count(self)"}, {"doc": "Door, dark and nukage tiles pass the checker in one room.", "kind": "method", "line": 382, "name": "test_new_legend_chars_build", "signature": "def test_new_legend_chars_build(self)"}, {"doc": "Build one known-good door image shared by every case.", "kind": "method", "line": 391, "name": "setUp", "signature": "def setUp(self)"}, {"doc": "Return the good image with one linedef field replaced.", "kind": "method", "line": 395, "name": "mutate_line", "signature": "def mutate_line(self, idx, field, value)"}, {"doc": "Index of the first D1 door line in the fixture image.", "kind": "method", "line": 406, "name": "door_line", "signature": "def door_line(self)"}, {"doc": "A door opener without a tag is refused, never miswired.", "kind": "method", "line": 418, "name": "test_door_tag_zero_dies", "signature": "def test_door_tag_zero_dies(self)"}, {"doc": "A linedef special the writer never emits is refused.", "kind": "method", "line": 423, "name": "test_unknown_special_dies", "signature": "def test_unknown_special_dies(self)"}, {"doc": "A one-sided line smuggling a back sidedef is refused.", "kind": "method", "line": 428, "name": "test_onesided_with_back_dies", "signature": "def test_onesided_with_back_dies(self)"}, {"doc": "The exit switch must stay untagged like the writer emits it.", "kind": "method", "line": 433, "name": "test_exit_tagged_dies", "signature": "def test_exit_tagged_dies(self)"}]}, {"doc": "test_driver.c -- Host test for the Strategy-pattern device registry.", "id": "tests/test_driver.c", "kind": "module", "label": "test_driver.c", "language": "c", "sha256": "fb218a5c798c7d00", "symbol_count": 5, "symbols": [{"kind": "function", "line": 15, "name": "test_read", "signature": "static int test_read(device_t *d, unsigned lba, unsigned count, void *buf)"}, {"kind": "function", "line": 28, "name": "test_pcm_open", "signature": "static void test_pcm_open(device_t *d)"}, {"kind": "function", "line": 33, "name": "test_pcm_submit", "signature": "static int test_pcm_submit(device_t *d, const unsigned char *pcm, unsigned len)"}, {"kind": "function", "line": 39, "name": "test_tone", "signature": "static void test_tone(device_t *d, unsigned freq)"}, {"kind": "function", "line": 65, "name": "main", "signature": "int main(void)"}]}, {"doc": "Docstring: Host test for the ext4 loopback driver (make test-ext4).", "id": "tests/test_ext4.c", "kind": "module", "label": "test_ext4.c", "language": "c", "sha256": "60d3030dd2551707", "symbol_count": 31, "symbols": [{"kind": "function", "line": 24, "name": "kmalloc", "signature": "void *kmalloc(unsigned long size)"}, {"kind": "function", "line": 28, "name": "kfree", "signature": "void kfree(void *ptr)"}, {"kind": "function", "line": 32, "name": "kstrlen", "signature": "unsigned long kstrlen(const char *s)"}, {"kind": "function", "line": 36, "name": "kstrncmp", "signature": "int kstrncmp(const char *a, const char *b, unsigned long n)"}, {"kind": "function", "line": 40, "name": "kstrncpy", "signature": "char *kstrncpy(char *dst, const char *src, unsigned long n)"}, {"kind": "function", "line": 47, "name": "kmemcpy", "signature": "void *kmemcpy(void *dst, const void *src, unsigned long n)"}, {"kind": "function", "line": 51, "name": "kstrchr", "signature": "char *kstrchr(const char *s, int c)"}, {"kind": "function", "line": 55, "name": "fs_resolve", "signature": "int fs_resolve(const char *path, char *out, unsigned cap)"}, {"kind": "function", "line": 68, "name": "ramdisk_open", "signature": "RDFile *ramdisk_open(const char *name)"}, {"kind": "function", "line": 73, "name": "ramdisk_read", "signature": "int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)"}, {"kind": "function", "line": 81, "name": "minifs_is_mounted", "signature": "int minifs_is_mounted(void)"}, {"kind": "function", "line": 85, "name": "minifs_resolve_path", "signature": "int minifs_resolve_path(const char *path)"}, {"kind": "function", "line": 90, "name": "minifs_stat", "signature": "int minifs_stat(int ino, MiniFSInode *out)"}, {"kind": "function", "line": 96, "name": "minifs_read", "signature": "int minifs_read(int ino, void *buf, unsigned off, unsigned len)"}, {"kind": "function", "line": 104, "name": "ide_present", "signature": "int ide_present(void)"}, {"kind": "function", "line": 108, "name": "ide_total_sectors", "signature": "unsigned int ide_total_sectors(void)"}, {"kind": "function", "line": 112, "name": "ide_read_sectors", "signature": "int ide_read_sectors(unsigned int lba, unsigned int count, void *buf)"}, {"kind": "function", "line": 119, "name": "block_disk_sectors", "signature": "unsigned long block_disk_sectors(void)"}, {"kind": "function", "line": 123, "name": "block_read_sectors", "signature": "int block_read_sectors(unsigned lba, unsigned count, void *buf)"}, {"kind": "function", "line": 143, "name": "e16", "signature": "static void e16(unsigned char *p, unsigned v)"}, {"kind": "function", "line": 148, "name": "e32", "signature": "static void e32(unsigned char *p, unsigned long v)"}, {"doc": "static void e16(unsigned char *p, unsigned v) { p[0] = (unsigned char)(v & 255); p[1] = (unsigned char)((v >> 8) & 255); } static void e32(unsigned char *p, unsigned long v) { p[0] = (unsigned char)(v & 255); p[1] = (unsigned char)((v >> 8) & 255); p[2] = (unsigned char)((v >> 16) & 255); p[3] = (unsigned char)((v >> 24) & 255); } /* Append one directory entry at off; returns the next offset.", "kind": "function", "line": 156, "name": "ext_fix_de", "signature": "static unsigned ext_fix_de(unsigned char *d, unsigned off, const char *nm,\n                      ..."}, {"kind": "function", "line": 168, "name": "ext_fix_inode", "signature": "static void ext_fix_inode(unsigned ino, unsigned mode, unsigned long size,\n                      ..."}, {"doc": "} static void ext_fix_inode(unsigned ino, unsigned mode, unsigned long size, unsigned flags, const unsigned char *iblk) { unsigned char *ib = ext_fix_img + 5 * 1024 + (ino - 1) * 128; e16(ib + 0, mode); e32(ib + 4, (unsigned)(size & 0xFFFFFFFFUL)); e16(ib + 26, 1); e32(ib + 32, flags); memcpy(ib + 40, iblk, 60); e32(ib + 108, (unsigned)(size >> 32)); } /* One single-extent leaf: logical l0 runs len blocks from phys p0.", "kind": "function", "line": 180, "name": "ext_fix_x1", "signature": "static void ext_fix_x1(unsigned char *iblk, unsigned l0, unsigned p0,\n                       unsi..."}, {"kind": "function", "line": 192, "name": "ext_fix_build", "signature": "static void ext_fix_build(void)"}, {"kind": "function", "line": 305, "name": "test_image", "signature": "static void test_image(void)"}, {"kind": "function", "line": 412, "name": "test_bad_magic", "signature": "static void test_bad_magic(void)"}, {"kind": "function", "line": 421, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 62, "name": "EXT_FIX_BLOCKS", "signature": "#define EXT_FIX_BLOCKS"}, {"kind": "macro", "line": 63, "name": "EXT_FIX_SIZE", "signature": "#define EXT_FIX_SIZE"}, {"kind": "macro", "line": 135, "name": "CHECK", "signature": "#define CHECK(cond)"}]}, {"doc": "Docstring: Host test for the FAT32 loopback driver (make test-fat).", "id": "tests/test_fat32.c", "kind": "module", "label": "test_fat32.c", "language": "c", "sha256": "925c599955fd3f4c", "symbol_count": 29, "symbols": [{"kind": "function", "line": 24, "name": "kmalloc", "signature": "void *kmalloc(unsigned long size)"}, {"kind": "function", "line": 28, "name": "kfree", "signature": "void kfree(void *ptr)"}, {"kind": "function", "line": 32, "name": "kstrlen", "signature": "unsigned long kstrlen(const char *s)"}, {"kind": "function", "line": 36, "name": "kstrncmp", "signature": "int kstrncmp(const char *a, const char *b, unsigned long n)"}, {"kind": "function", "line": 40, "name": "kstrncpy", "signature": "char *kstrncpy(char *dst, const char *src, unsigned long n)"}, {"kind": "function", "line": 47, "name": "kmemcpy", "signature": "void *kmemcpy(void *dst, const void *src, unsigned long n)"}, {"kind": "function", "line": 51, "name": "fs_resolve", "signature": "int fs_resolve(const char *path, char *out, unsigned cap)"}, {"kind": "function", "line": 66, "name": "ramdisk_open", "signature": "RDFile *ramdisk_open(const char *name)"}, {"kind": "function", "line": 71, "name": "ramdisk_read", "signature": "int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)"}, {"kind": "function", "line": 79, "name": "minifs_is_mounted", "signature": "int minifs_is_mounted(void)"}, {"kind": "function", "line": 83, "name": "minifs_resolve_path", "signature": "int minifs_resolve_path(const char *path)"}, {"kind": "function", "line": 88, "name": "minifs_stat", "signature": "int minifs_stat(int ino, MiniFSInode *out)"}, {"kind": "function", "line": 94, "name": "minifs_read", "signature": "int minifs_read(int ino, void *buf, unsigned off, unsigned len)"}, {"kind": "function", "line": 102, "name": "ide_present", "signature": "int ide_present(void)"}, {"kind": "function", "line": 106, "name": "ide_total_sectors", "signature": "unsigned int ide_total_sectors(void)"}, {"kind": "function", "line": 110, "name": "ide_read_sectors", "signature": "int ide_read_sectors(unsigned int lba, unsigned int count, void *buf)"}, {"kind": "function", "line": 117, "name": "kstrcmp", "signature": "int kstrcmp(const char *a, const char *b)"}, {"kind": "function", "line": 121, "name": "block_disk_sectors", "signature": "unsigned long block_disk_sectors(void)"}, {"kind": "function", "line": 125, "name": "block_read_sectors", "signature": "int block_read_sectors(unsigned lba, unsigned count, void *buf)"}, {"kind": "function", "line": 145, "name": "st16", "signature": "static void st16(unsigned char *p, unsigned v)"}, {"kind": "function", "line": 150, "name": "st32", "signature": "static void st32(unsigned char *p, unsigned long v)"}, {"kind": "function", "line": 157, "name": "fat_fix_build", "signature": "static void fat_fix_build(void)"}, {"kind": "function", "line": 236, "name": "test_units", "signature": "static void test_units(void)"}, {"kind": "function", "line": 258, "name": "test_image", "signature": "static void test_image(void)"}, {"kind": "function", "line": 320, "name": "test_bad_magic", "signature": "static void test_bad_magic(void)"}, {"kind": "function", "line": 329, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 58, "name": "FAT_FIX_SECTORS", "signature": "#define FAT_FIX_SECTORS"}, {"kind": "macro", "line": 59, "name": "FAT_FIX_SIZE", "signature": "#define FAT_FIX_SIZE"}, {"kind": "macro", "line": 137, "name": "CHECK", "signature": "#define CHECK(cond)"}]}, {"doc": "test_fault.c -- fault-injection suite (boyscout gap #10).", "id": "tests/test_fault.c", "kind": "module", "label": "test_fault.c", "language": "c", "sha256": "383bce12935e0a8d", "symbol_count": 11, "symbols": [{"kind": "function", "line": 35, "name": "range_ok", "signature": "static int range_ok(unsigned long p, unsigned long len)"}, {"doc": "cannot report is itself a failure. #define CHECK(c, m) do { if (!(c)) { failures++; if (fprintf(stderr, \"FAIL: %s:%d: %s\\n\", __FILE__, __LINE__, m) < 0) failures++; } } while (0) /* ---- Mirror of kernel/syscalls.c user window ---- #define U_BASE ((unsigned long)0x00400000ul) #define U_END  ((unsigned long)0x0C000000ul) static unsigned char umem[64]; static int range_ok(unsigned long p, unsigned long len) { if (p < U_BASE) return 0; if (len > U_END - p) return 0; return p + len <= U_END; } /* Mirror of user_str_ok: NUL must land inside [p, p+maxlen).", "kind": "function", "line": 41, "name": "str_ok", "signature": "static int str_ok(const unsigned char *mem, unsigned long p,\n                  unsigned long maxlen)"}, {"doc": "Minimal mirror of fs/vfs.c fs_resolve (cwd-relative, cap 64): * collapses \".\", pops \"..\", skips empty components.", "kind": "function", "line": 52, "name": "normalize", "signature": "static void normalize(const char *path, char *out, unsigned cap)"}, {"doc": "define TRUSTED_DIR \"objects/\" define TRUSTED_LEN 8", "kind": "function", "line": 83, "name": "path_trusted", "signature": "static int path_trusted(const char *full)"}, {"kind": "function", "line": 94, "name": "main", "signature": "int main(void)"}, {"kind": "function", "line": 10, "name": "against", "signature": "* after bounding against (END-BASE)/elemsz, so the product cannot * wrap past the range check);"}, {"kind": "macro", "line": 28, "name": "CHECK", "signature": "#define CHECK(c, m)"}, {"kind": "macro", "line": 31, "name": "U_BASE", "signature": "#define U_BASE"}, {"kind": "macro", "line": 32, "name": "U_END", "signature": "#define U_END"}, {"kind": "macro", "line": 81, "name": "TRUSTED_DIR", "signature": "#define TRUSTED_DIR"}, {"kind": "macro", "line": 82, "name": "TRUSTED_LEN", "signature": "#define TRUSTED_LEN"}]}, {"doc": "Docstring: host test for the file browser assoc contract (make test-file).", "id": "tests/test_file_assoc.c", "kind": "module", "label": "test_file_assoc.c", "language": "c", "sha256": "308a25e5e911664f", "symbol_count": 10, "symbols": [{"kind": "function", "line": 26, "name": "t_ext_of", "signature": "static void t_ext_of(const char *fname, char *dst, unsigned cap)"}, {"kind": "function", "line": 46, "name": "t_assoc_line", "signature": "static int t_assoc_line(const char *line, char *ext, char *prog)"}, {"doc": "Mirror of file_icon_kind in progs/file/file.c (0 folder, 1 files, * 2 image, 3 object).", "kind": "function", "line": 80, "name": "t_icon_kind", "signature": "static int t_icon_kind(const char *fname, int isdir)"}, {"kind": "function", "line": 95, "name": "t_icon_sz", "signature": "static int t_icon_sz(void)"}, {"kind": "function", "line": 99, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}, {"kind": "macro", "line": 23, "name": "T_EXT_MAX", "signature": "#define T_EXT_MAX"}, {"kind": "macro", "line": 24, "name": "T_PROG_MAX", "signature": "#define T_PROG_MAX"}, {"kind": "macro", "line": 92, "name": "T_ICON_SMALL", "signature": "#define T_ICON_SMALL"}, {"kind": "macro", "line": 93, "name": "T_ICON_BIG", "signature": "#define T_ICON_BIG"}]}, {"doc": "test_freedom_wl - host suite for the Wayland to MiniOS mapping.", "id": "tests/test_freedom_wl.c", "kind": "module", "label": "test_freedom_wl.c", "language": "c", "sha256": "5c422d3c95ff7ca3", "symbol_count": 3, "symbols": [{"doc": "test_freedom_wl - host suite for the Wayland to MiniOS mapping.  Exercises the pure logic of progs/src/freedom_wl without syscalls. Fail-closed on every bound. Exit nonzero on first failure.  #include <stdio.h> #define FREEDOM_WL_HOST_TEST 1 #include \"../progs/src/freedom_wl.c\" /** Report helper for single check lines.", "kind": "function", "line": 12, "name": "check_host", "signature": "static int check_host(int cond, const char *name)"}, {"doc": "#define FREEDOM_WL_HOST_TEST 1 #include \"../progs/src/freedom_wl.c\" /** Report helper for single check lines. static int check_host(int cond, const char *name) { if (!cond) { printf(\"FAIL: %s\\n\", name); return 1; } printf(\"PASS: %s\\n\", name); return 0; } /** Entry point running all mapping checks.", "kind": "function", "line": 22, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 8, "name": "FREEDOM_WL_HOST_TEST", "signature": "#define FREEDOM_WL_HOST_TEST"}]}, {"doc": "test_freedomui - host suite for the real FreeDom MiniOS backend.", "id": "tests/test_freedomui.c", "kind": "module", "label": "test_freedomui.c", "language": "c", "sha256": "cd55cb6586c7ff58", "symbol_count": 2, "symbols": [{"doc": "#define FREEDOMUI_HOST_TEST 1 #include \"../progs/freedomui/freedomui_minios.c\" /** Report helper for single check lines. static int check_ui(int cond, const char *name) { if (!cond) { printf(\"FAIL: %s\\n\", name); return 1; } printf(\"PASS: %s\\n\", name); return 0; } /** Entry point running all backend checks.", "kind": "function", "line": 24, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 10, "name": "FREEDOMUI_HOST_TEST", "signature": "#define FREEDOMUI_HOST_TEST"}]}, {"doc": "Docstring: Host test for kernel/futex.c (make test-futex).", "id": "tests/test_futex.c", "kind": "module", "label": "test_futex.c", "language": "c", "sha256": "a90d1f6f8ff393a6", "symbol_count": 7, "symbols": [{"kind": "function", "line": 18, "name": "proc_get", "signature": "proc_t *proc_get(int pid)"}, {"kind": "function", "line": 26, "name": "schedule", "signature": "void schedule(void)"}, {"kind": "function", "line": 39, "name": "fresh_proc", "signature": "static void fresh_proc(int pid)"}, {"kind": "function", "line": 48, "name": "fresh_all", "signature": "static void fresh_all(void)"}, {"kind": "function", "line": 60, "name": "main", "signature": "int main(void)"}, {"kind": "function", "line": 153, "name": "masked", "signature": "* with PRIVATE and CLOCK_REALTIME masked (393 = 9|128|256). */ CHECK(futex_linux_cmd(9) == LINUX_FUTEX_WAIT_BITSET, \"WAIT_BITSET decodes\");"}, {"kind": "macro", "line": 32, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for headers/vga_fx.h (make test-fx).", "id": "tests/test_fx.c", "kind": "module", "label": "test_fx.c", "language": "c", "sha256": "406760930ec521f6", "symbol_count": 2, "symbols": [{"kind": "function", "line": 23, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for arch/x86/hal_io.h (make test-hal).", "id": "tests/test_hal_io.c", "kind": "module", "label": "test_hal_io.c", "language": "c", "sha256": "fbf37cabfa70a0ba", "symbol_count": 3, "symbols": [{"kind": "function", "line": 30, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 11, "name": "HAL_IO_HOST_TEST", "signature": "#define HAL_IO_HOST_TEST"}, {"kind": "macro", "line": 23, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for headers/httpd.h (make test-httpd).", "id": "tests/test_httpd.c", "kind": "module", "label": "test_httpd.c", "language": "c", "sha256": "f22482585d2b0b5f", "symbol_count": 2, "symbols": [{"kind": "function", "line": 25, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 18, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "test_ktime.c -- host test for the pure conversion math in ktime.h", "id": "tests/test_ktime.c", "kind": "module", "label": "test_ktime.c", "language": "c", "sha256": "e0006c3738056072", "symbol_count": 2, "symbols": [{"kind": "function", "line": 16, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 14, "name": "CHECK", "signature": "#define CHECK(c, m)"}]}, {"doc": "Docstring: host test for the ld.so pure parser (make test-ldso).", "id": "tests/test_ldso.c", "kind": "module", "label": "test_ldso.c", "language": "c", "sha256": "6d3730ca0c733544", "symbol_count": 12, "symbols": [{"kind": "function", "line": 27, "name": "w16", "signature": "static void w16(unsigned char *p, unsigned v)"}, {"kind": "function", "line": 32, "name": "w32", "signature": "static void w32(unsigned char *p, unsigned long v)"}, {"kind": "function", "line": 39, "name": "w64", "signature": "static void w64(unsigned char *p, unsigned long long v)"}, {"kind": "function", "line": 92, "name": "build_tables", "signature": "static void build_tables(unsigned char *img, int rela_type)"}, {"kind": "function", "line": 127, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 20, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}, {"kind": "macro", "line": 53, "name": "IMG_SZ", "signature": "#define IMG_SZ"}, {"kind": "macro", "line": 54, "name": "DYN_OFF", "signature": "#define DYN_OFF"}, {"kind": "macro", "line": 55, "name": "STR_OFF", "signature": "#define STR_OFF"}, {"kind": "macro", "line": 56, "name": "SYM_OFF", "signature": "#define SYM_OFF"}, {"kind": "macro", "line": 57, "name": "HASH_OFF", "signature": "#define HASH_OFF"}, {"kind": "macro", "line": 58, "name": "RELA_OFF", "signature": "#define RELA_OFF"}]}, {"doc": "Docstring: host test for the leak tracker (make test-leakcheck).", "id": "tests/test_leakcheck.c", "kind": "module", "label": "test_leakcheck.c", "language": "c", "sha256": "04627b995ae7ac9a", "symbol_count": 4, "symbols": [{"kind": "function", "line": 27, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 10, "name": "MINIOS_LEAKCHECK_IMPL", "signature": "#define MINIOS_LEAKCHECK_IMPL"}, {"kind": "macro", "line": 11, "name": "MINIOS_LK_ENABLE", "signature": "#define MINIOS_LK_ENABLE"}, {"kind": "macro", "line": 20, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Host suite for the MiniFS image tools (docs/spec/shell-fs.md).  tools/mkfs.minifs.py builds the MiniFS image the kernel mounts and tools/minifs_fsck.py gates it in the build. These cases pin the two contracts the kernel cannot see at boot:  - the superblock free counters equal the bitmaps, and fsck rejects an image whose counters drift; - same-named directories from several roots merge into one, and any other duplicate name is a build error.  Usage: python3 tests/test_minifs_tools.py -v", "id": "tests/test_minifs_tools.py", "kind": "module", "label": "test_minifs_tools.py", "language": "py", "sha256": "f6797c0d2d0bf8e4", "symbol_count": 12, "symbols": [{"doc": "Every tunable of the suite in one place.", "kind": "class", "line": 23, "name": "Config", "signature": "class Config"}, {"doc": "Run a tool under the current interpreter; returns the process.", "kind": "function", "line": 35, "name": "run", "signature": "def run(args)"}, {"doc": "mkfs.minifs.py and minifs_fsck.py agree on a consistent image.", "kind": "class", "line": 40, "name": "MiniFSToolsTest", "signature": "class MiniFSToolsTest(TestCase)"}, {"kind": "method", "line": 43, "name": "setUp", "signature": "def setUp(self)"}, {"kind": "method", "line": 47, "name": "tearDown", "signature": "def tearDown(self)"}, {"doc": "Create file root/rel holding data and return the root path.", "kind": "method", "line": 50, "name": "tree", "signature": "def tree(self, root, rel, data)"}, {"doc": "Build an image from paths; returns (process, image path).", "kind": "method", "line": 58, "name": "mkfs", "signature": "def mkfs(self)"}, {"kind": "method", "line": 64, "name": "superblock_word", "signature": "def superblock_word(self, image, off)"}, {"kind": "method", "line": 69, "name": "test_counters_match_bitmaps", "signature": "def test_counters_match_bitmaps(self)"}, {"kind": "method", "line": 79, "name": "test_fsck_rejects_drifted_counters", "signature": "def test_fsck_rejects_drifted_counters(self)"}, {"kind": "method", "line": 93, "name": "test_same_named_directories_merge", "signature": "def test_same_named_directories_merge(self)"}, {"kind": "method", "line": 107, "name": "test_duplicate_file_is_an_error", "signature": "def test_duplicate_file_is_an_error(self)"}]}, {"doc": "Docstring: host test for the shared ring-3 PNG helpers (make test-png).", "id": "tests/test_minios_png.c", "kind": "module", "label": "test_minios_png.c", "language": "c", "sha256": "b51c24aad40ef030", "symbol_count": 10, "symbols": [{"doc": "#include <stdlib.h> #include \"progs/minios_png.h\" static int failures = 0; #define CHECK(cond, msg) do { \\ if (!(cond)) { \\ failures++; \\ fprintf(stderr, \"FAIL: %s (line %d)\\n\", (msg), __LINE__); \\ } \\ } while (0) /** Docstring: 3-3-2 quantize matches the manual bit packing.", "kind": "function", "line": 24, "name": "t_332", "signature": "static void t_332(void)"}, {"doc": "fprintf(stderr, \"FAIL: %s (line %d)\\n\", (msg), __LINE__); \\ } \\ } while (0) /** Docstring: 3-3-2 quantize matches the manual bit packing. static void t_332(void) { CHECK(mpng_332_idx(255, 0, 0) == 0xE0, \"332 red\"); CHECK(mpng_332_idx(0, 255, 0) == 0x1C, \"332 green\"); CHECK(mpng_332_idx(0, 0, 255) == 0x03, \"332 blue\"); CHECK(mpng_332_idx(0, 0, 0) == 0x00, \"332 black\"); CHECK(mpng_332_idx(255, 255, 255) == 0xFF, \"332 white\"); } /** Docstring: nearest search hits exact entries and rejects bad input.", "kind": "function", "line": 33, "name": "t_nearest", "signature": "static void t_nearest(void)"}, {"doc": "pal[7] = 0; pal[8] = 255; CHECK(mpng_nearest(pal, 3, 255, 0, 0) == 0, \"nearest red\"); CHECK(mpng_nearest(pal, 3, 0, 255, 0) == 1, \"nearest green\"); CHECK(mpng_nearest(pal, 3, 0, 0, 255) == 2, \"nearest blue\"); CHECK(mpng_nearest(0, 3, 0, 0, 0) < 0, \"nearest null pal\"); CHECK(mpng_nearest(pal, 0, 0, 0, 0) < 0, \"nearest empty pal\"); CHECK(mpng_nearest(pal, 9999, 0, 0, 0) < 0, \"nearest oversize pal\"); for (k = 0; k < 768; k++) pal[k] = 0; CHECK(mpng_nearest(pal, 256, 10, 20, 30) == 0, \"nearest first wins\"); } /** Docstring: center and fit-scale geometry with fail-closed edges.", "kind": "function", "line": 58, "name": "t_geom", "signature": "static void t_geom(void)"}, {"doc": "/** Docstring: center and fit-scale geometry with fail-closed edges. static void t_geom(void) { CHECK(mpng_center(800, 320) == 240, \"center 800/320\"); CHECK(mpng_center(360, 360) == 0, \"center exact\"); CHECK(mpng_center(100, 200) < 0, \"center unfit\"); CHECK(mpng_center(-1, 10) < 0, \"center negative\"); CHECK(mpng_fit_scale(32, 32, 240, 344) == 7, \"fit 32 in 240x344\"); CHECK(mpng_fit_scale(512, 512, 240, 344) == 1, \"fit large keeps 1\"); CHECK(mpng_fit_scale(0, 32, 240, 344) < 0, \"fit zero src\"); CHECK(mpng_fit_scale(32, 32, 0, 10) < 0, \"fit zero box\"); } /** Docstring: scaled conversion preserves corners and rejects bounds.", "kind": "function", "line": 70, "name": "t_scale", "signature": "static void t_scale(void)"}, {"doc": "CHECK(dst[0] == 242, \"scale corner keeps red\"); CHECK(mpng_rgb_to_332_scaled(rgb, 2, 2, dst332, 4, 4) == 0, \"scale332 ok\"); CHECK(dst332[0] == (unsigned char)mpng_332_idx(255, 0, 0), \"scale332 corner\"); CHECK(mpng_rgb_to_idx_scaled(0, 2, 2, pal, 256, dst, 4, 4) < 0, \"scale null rgb\"); CHECK(mpng_rgb_to_idx_scaled(rgb, 9999, 2, pal, 256, dst, 4, 4) < 0, \"scale oversize src\"); CHECK(mpng_rgb_to_idx_scaled(rgb, 2, 2, pal, 256, dst, 9999, 4) < 0, \"scale oversize dst\"); } /** Docstring: large-source twin accepts wallpaper geometry, same bounds.", "kind": "function", "line": 99, "name": "t_scale_big", "signature": "static void t_scale_big(void)"}, {"doc": "free(big); } else { CHECK(0, \"big wallpaper alloc\"); } } CHECK(mpng_rgb_to_idx_scaled_big(0, 2, 2, pal, 256, dst, 4, 4) < 0, \"big null rgb\"); CHECK(mpng_rgb_to_idx_scaled_big(rgb, 99999, 2, pal, 256, dst, 4, 4) < 0, \"big oversize src\"); CHECK(mpng_rgb_to_idx_scaled_big(rgb, 2, 2, pal, 256, dst, 9999, 4) < 0, \"big oversize dst\"); } /** Docstring: clipped blit lands inside and ignores outside.", "kind": "function", "line": 139, "name": "t_blit", "signature": "static void t_blit(void)"}, {"doc": "tile[0] = 1; tile[1] = 2; tile[2] = 3; tile[3] = 4; CHECK(mpng_blit_idx(fb, 4, 4, tile, 2, 2, 1, 1) == 0, \"blit ok\"); CHECK(fb[1 * 4 + 1] == 1 && fb[1 * 4 + 2] == 2, \"blit row0\"); CHECK(fb[2 * 4 + 1] == 3 && fb[2 * 4 + 2] == 4, \"blit row1\"); CHECK(fb[0] == 7, \"blit outside untouched\"); CHECK(mpng_blit_idx(0, 4, 4, tile, 2, 2, 0, 0) < 0, \"blit null fb\"); CHECK(mpng_blit_idx(fb, 4, 4, tile, 9999, 2, 0, 0) < 0, \"blit oversize tile\"); } /** Docstring: bounded load fails closed on bad paths and caps.", "kind": "function", "line": 157, "name": "t_load", "signature": "static void t_load(void)"}, {"doc": "CHECK(mpng_load_file(\"\", &out, &n, MPNG_FILE_MAX) < 0, \"load empty\"); CHECK(mpng_load_file(0, &out, &n, MPNG_FILE_MAX) < 0, \"load null\"); CHECK(mpng_load_file(\"/no/such/file.png\", 0, &n, MPNG_FILE_MAX) < 0, \"load null out\"); CHECK(mpng_load_file(\"tests/test_minios_png.c\", &out, &n, 4) < 0, \"load tiny cap\"); CHECK(mpng_load_file(\"tests/test_minios_png.c\", &out, &n, MPNG_FILE_MAX) == 0, \"load self\"); CHECK(out != 0 && n > 0, \"load content\"); if (out) free(out); } /** Docstring: side-art policy pins right pokemon and no cgoblin left.", "kind": "function", "line": 176, "name": "t_policy", "signature": "static void t_policy(void)"}, {"kind": "function", "line": 191, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "test_mip.py -- host test for the frozen MicroPython installer (make test-mip).  Two layers:  1. Pure vectors: URL split, module-name validation, HTTP response parsing, redirect resolution and the write path, all loaded straight from progs/micropython/variants/minios/lib/mip.py under CPython (the module imports nothing at top level that the host lacks).  2. Live install: drives progs/bin/micropython.elf (a static Linux ELF, same artifact MiniOS runs) against a local http.server and asserts real files land on disk for plain fetch, redirect and the CLI, while https, chunked responses and traversal names are refused. Skipped until the ELF is rebuilt with MICROPY_PY_SOCKET=1.", "id": "tests/test_mip.py", "kind": "module", "label": "test_mip.py", "language": "py", "sha256": "88c783451b954b74", "symbol_count": 44, "symbols": [{"doc": "Import lib/mip.py as a standalone module under CPython.", "kind": "function", "line": 36, "name": "load_mip", "signature": "def load_mip()"}, {"doc": "Vectors for the pure helpers; no sockets, no subprocesses.", "kind": "class", "line": 44, "name": "MipPureTests", "signature": "class MipPureTests(TestCase)"}, {"doc": "Serve HELLO script plus redirect, chunked and 404 responses.", "kind": "class", "line": 212, "name": "_Handler", "signature": "class _Handler(BaseHTTPRequestHandler)"}, {"doc": "Install for real through the static MicroPython ELF on localhost.", "kind": "class", "line": 242, "name": "MipLiveTests", "signature": "class MipLiveTests(TestCase)"}, {"kind": "method", "line": 48, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 51, "name": "test_split_url_default_port", "signature": "def test_split_url_default_port(self)"}, {"kind": "method", "line": 57, "name": "test_split_url_explicit_port_and_query", "signature": "def test_split_url_explicit_port_and_query(self)"}, {"kind": "method", "line": 63, "name": "test_split_url_path_defaults_to_root", "signature": "def test_split_url_path_defaults_to_root(self)"}, {"kind": "method", "line": 66, "name": "test_split_url_refuses_https", "signature": "def test_split_url_refuses_https(self)"}, {"kind": "method", "line": 70, "name": "test_split_https_url_default_port", "signature": "def test_split_https_url_default_port(self)"}, {"kind": "method", "line": 76, "name": "test_split_https_url_explicit_port", "signature": "def test_split_https_url_explicit_port(self)"}, {"kind": "method", "line": 82, "name": "test_split_https_url_refuses_plain_http", "signature": "def test_split_https_url_refuses_plain_http(self)"}, {"kind": "method", "line": 86, "name": "test_parse_url_reports_scheme", "signature": "def test_parse_url_reports_scheme(self)"}, {"kind": "method", "line": 96, "name": "test_split_url_refuses_other_schemes", "signature": "def test_split_url_refuses_other_schemes(self)"}, {"kind": "method", "line": 101, "name": "test_split_url_refuses_bad_authority", "signature": "def test_split_url_refuses_bad_authority(self)"}, {"kind": "method", "line": 107, "name": "test_split_url_refuses_control_chars", "signature": "def test_split_url_refuses_control_chars(self)"}, {"kind": "method", "line": 112, "name": "test_module_name_accepts_plain_module", "signature": "def test_module_name_accepts_plain_module(self)"}, {"kind": "method", "line": 116, "name": "test_module_name_strips_query", "signature": "def test_module_name_strips_query(self)"}, {"kind": "method", "line": 119, "name": "test_module_name_refuses_unsafe_names", "signature": "def test_module_name_refuses_unsafe_names(self)"}, {"kind": "method", "line": 135, "name": "test_parse_response_crlf", "signature": "def test_parse_response_crlf(self)"}, {"kind": "method", "line": 144, "name": "test_parse_response_bare_lf", "signature": "def test_parse_response_bare_lf(self)"}, {"kind": "method", "line": 151, "name": "test_parse_response_rejects_garbage", "signature": "def test_parse_response_rejects_garbage(self)"}, {"kind": "method", "line": 157, "name": "test_parse_response_rejects_content_length_mismatch", "signature": "def test_parse_response_rejects_content_length_mismatch(self)"}, {"kind": "method", "line": 167, "name": "test_parse_response_refuses_chunked", "signature": "def test_parse_response_refuses_chunked(self)"}, {"kind": "method", "line": 173, "name": "test_https_get_needs_minios_on_host", "signature": "def test_https_get_needs_minios_on_host(self)"}, {"kind": "method", "line": 177, "name": "test_absolute_url_resolves_path_location", "signature": "def test_absolute_url_resolves_path_location(self)"}, {"kind": "method", "line": 187, "name": "test_absolute_url_keeps_absolute_location", "signature": "def test_absolute_url_keeps_absolute_location(self)"}, {"kind": "method", "line": 197, "name": "test_absolute_url_keeps_base_scheme", "signature": "def test_absolute_url_keeps_base_scheme(self)"}, {"kind": "method", "line": 207, "name": "test_absolute_url_refuses_relative_location", "signature": "def test_absolute_url_refuses_relative_location(self)"}, {"kind": "method", "line": 217, "name": "log_message", "signature": "def log_message(self, fmt)"}, {"kind": "method", "line": 220, "name": "do_GET", "signature": "def do_GET(self)"}, {"kind": "method", "line": 246, "name": "setUpClass", "signature": "def setUpClass(cls)"}, {"kind": "method", "line": 261, "name": "tearDownClass", "signature": "def tearDownClass(cls)"}, {"kind": "method", "line": 266, "name": "setUp", "signature": "def setUp(self)"}, {"kind": "method", "line": 270, "name": "run_in_elf", "signature": "def run_in_elf(self, code)"}, {"kind": "method", "line": 277, "name": "combined", "signature": "def combined(self, proc)"}, {"kind": "method", "line": 280, "name": "test_install_plain_and_load", "signature": "def test_install_plain_and_load(self)"}, {"kind": "method", "line": 290, "name": "test_install_follows_redirect", "signature": "def test_install_follows_redirect(self)"}, {"kind": "method", "line": 300, "name": "test_install_404_fails", "signature": "def test_install_404_fails(self)"}, {"kind": "method", "line": 308, "name": "test_install_https_needs_minios", "signature": "def test_install_https_needs_minios(self)"}, {"kind": "method", "line": 319, "name": "test_install_refuses_chunked", "signature": "def test_install_refuses_chunked(self)"}, {"kind": "method", "line": 327, "name": "test_install_refuses_traversal_name", "signature": "def test_install_refuses_traversal_name(self)"}, {"kind": "method", "line": 334, "name": "test_install_twice_succeeds", "signature": "def test_install_twice_succeeds(self)"}, {"kind": "method", "line": 344, "name": "test_cli_install", "signature": "def test_cli_install(self)"}]}, {"doc": "Docstring: Designated initializers, so adding a member cannot silently", "id": "tests/test_modifiers.c", "kind": "module", "label": "test_modifiers.c", "language": "c", "sha256": "520f3b8a8da5ec83", "symbol_count": 2, "symbols": [{"kind": "function", "line": 24, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"id": "tests/test_notify.c", "kind": "module", "label": "test_notify.c", "language": "c", "sha256": "11842983c58cbf60", "symbol_count": 3, "symbols": [{"kind": "function", "line": 16, "name": "probe_handler", "signature": "static void probe_handler(const wm_notify_event_t *e)"}, {"kind": "function", "line": 22, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 9, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: host test for the paint canvas/PNG contract (make test-paint).", "id": "tests/test_paint.c", "kind": "module", "label": "test_paint.c", "language": "c", "sha256": "aed54660955a5303", "symbol_count": 21, "symbols": [{"kind": "function", "line": 30, "name": "t_clamp", "signature": "static int t_clamp(int v, int lo, int hi)"}, {"kind": "function", "line": 36, "name": "t_plot", "signature": "static int t_plot(unsigned char *buf, int w, int h, int x, int y,\n                  unsigned char c)"}, {"kind": "function", "line": 44, "name": "t_line", "signature": "static int t_line(unsigned char *buf, int w, int h, int x0, int y0, int x1,\n                  int..."}, {"kind": "function", "line": 70, "name": "t_flood", "signature": "static int t_flood(unsigned char *buf, int w, int h, int x, int y,\n                   unsigned ch..."}, {"kind": "function", "line": 116, "name": "t_crc_init", "signature": "static void t_crc_init(void)"}, {"kind": "function", "line": 129, "name": "t_crc", "signature": "static unsigned long t_crc(const unsigned char *p, unsigned long n)"}, {"kind": "function", "line": 138, "name": "t_path_ok", "signature": "static int t_path_ok(const char *p)"}, {"kind": "function", "line": 155, "name": "t_nearest", "signature": "static int t_nearest(const unsigned char *pal, unsigned r, unsigned g,\n                     unsig..."}, {"kind": "function", "line": 171, "name": "test_plot", "signature": "static void test_plot(void)"}, {"kind": "function", "line": 188, "name": "test_line", "signature": "static void test_line(void)"}, {"kind": "function", "line": 207, "name": "test_flood", "signature": "static void test_flood(void)"}, {"kind": "function", "line": 228, "name": "test_png_codec", "signature": "static void test_png_codec(void)"}, {"kind": "function", "line": 259, "name": "test_png_layout", "signature": "static void test_png_layout(void)"}, {"kind": "function", "line": 273, "name": "test_path", "signature": "static void test_path(void)"}, {"kind": "function", "line": 287, "name": "test_nearest", "signature": "static void test_nearest(void)"}, {"kind": "function", "line": 300, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}, {"kind": "macro", "line": 23, "name": "T_W", "signature": "#define T_W"}, {"kind": "macro", "line": 24, "name": "T_H", "signature": "#define T_H"}, {"kind": "macro", "line": 25, "name": "T_N", "signature": "#define T_N"}, {"kind": "macro", "line": 26, "name": "T_PATH_MAX", "signature": "#define T_PATH_MAX"}]}, {"doc": "Docstring: Host test for headers/panic.h (make test-panic).", "id": "tests/test_panic.c", "kind": "module", "label": "test_panic.c", "language": "c", "sha256": "d1feb53a6b16ce76", "symbol_count": 5, "symbols": [{"kind": "function", "line": 23, "name": "always_valid", "signature": "static int always_valid(unsigned long addr)"}, {"kind": "function", "line": 28, "name": "never_valid", "signature": "static int never_valid(unsigned long addr)"}, {"kind": "function", "line": 35, "name": "deny_valid", "signature": "static int deny_valid(unsigned long addr)"}, {"kind": "function", "line": 39, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: host test for the page cache store (make test-pcache).", "id": "tests/test_pcache.c", "kind": "module", "label": "test_pcache.c", "language": "c", "sha256": "22d914342a008878", "symbol_count": 5, "symbols": [{"kind": "function", "line": 19, "name": "kmalloc", "signature": "void *kmalloc(unsigned long size)"}, {"kind": "function", "line": 23, "name": "kfree", "signature": "void kfree(void *ptr)"}, {"kind": "function", "line": 27, "name": "kprintf", "signature": "int kprintf(const char *fmt, ...)"}, {"kind": "function", "line": 43, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 36, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for headers/drivers/pci.h (make test-pci).", "id": "tests/test_pci.c", "kind": "module", "label": "test_pci.c", "language": "c", "sha256": "43f13920436a2a8d", "symbol_count": 7, "symbols": [{"kind": "function", "line": 39, "name": "fake_outl", "signature": "static void fake_outl(unsigned short port, unsigned val)"}, {"kind": "function", "line": 60, "name": "fake_inl", "signature": "static unsigned fake_inl(unsigned short port)"}, {"kind": "function", "line": 73, "name": "set_dev", "signature": "static void set_dev(unsigned bus, unsigned dev, unsigned func,\n                    unsigned id, u..."}, {"kind": "function", "line": 79, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 26, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}, {"kind": "macro", "line": 33, "name": "FAKE_BUSES", "signature": "#define FAKE_BUSES"}, {"kind": "macro", "line": 34, "name": "FAKE_REGS", "signature": "#define FAKE_REGS"}]}, {"doc": "Host-side unit test for the PCM ring buffer (headers/pcm_ring.h).", "id": "tests/test_pcm.c", "kind": "module", "label": "test_pcm.c", "language": "c", "sha256": "4e5055cf4b3195fa", "symbol_count": 9, "symbols": [{"kind": "function", "line": 28, "name": "t_roundtrip", "signature": "static void t_roundtrip(void)"}, {"kind": "function", "line": 44, "name": "t_wrap", "signature": "static void t_wrap(void)"}, {"kind": "function", "line": 61, "name": "t_overrun", "signature": "static void t_overrun(void)"}, {"kind": "function", "line": 75, "name": "t_underrun", "signature": "static void t_underrun(void)"}, {"kind": "function", "line": 91, "name": "t_zero_cap", "signature": "static void t_zero_cap(void)"}, {"kind": "function", "line": 104, "name": "lcg_next", "signature": "static unsigned lcg_next(void)"}, {"kind": "function", "line": 109, "name": "t_model", "signature": "static void t_model(void)"}, {"kind": "function", "line": 144, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 21, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for kernel/percpu_rq.c (make test-percpu-rq).", "id": "tests/test_percpu_rq.c", "kind": "module", "label": "test_percpu_rq.c", "language": "c", "sha256": "3b8acf4401168df0", "symbol_count": 2, "symbols": [{"kind": "function", "line": 24, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for headers/pipe.h (make test-pipe).", "id": "tests/test_pipe.c", "kind": "module", "label": "test_pipe.c", "language": "c", "sha256": "6f0a02d5b43937aa", "symbol_count": 2, "symbols": [{"kind": "function", "line": 23, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "test_ps2_keymap - host suite for the PS/2 set 1 to keysym translator.", "id": "tests/test_ps2_keymap.c", "kind": "module", "label": "test_ps2_keymap.c", "language": "c", "sha256": "dc7f59de424b6123", "symbol_count": 15, "symbols": [{"doc": "keys, Ctrl/Alt chords without text, extended (E0) keys, the keypad under both Num Lock states, the fake shifts of Print Screen, the E1 Pause sequence, release events and fail-closed arguments. Exit nonzero on the first failure.  #include <stdio.h> #include <string.h> #include <xkbcommon/xkbcommon-keysyms.h> #include \"../progs/freedomui/ps2_keymap.h\" static int fails; /** Report helper for single check lines.", "kind": "function", "line": 19, "name": "check", "signature": "static void check(int cond, const char *name)"}, {"doc": "static int fails; /** Report helper for single check lines. static void check(int cond, const char *name) { if (!cond) { printf(\"FAIL: %s\\n\", name); fails++; return; } printf(\"PASS: %s\\n\", name); } /** Feeds a byte sequence and returns the kind of the last event.", "kind": "function", "line": 29, "name": "feed_seq", "signature": "static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out)"}, {"doc": "fails++; return; } printf(\"PASS: %s\\n\", name); } /** Feeds a byte sequence and returns the kind of the last event. static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out) { int kind = PS2_EV_NONE; for (int i = 0; i < n; i++) kind = ps2_feed(s, seq[i], out); return kind; } /** Presses one non-extended make code and returns the event kind.", "kind": "function", "line": 36, "name": "press", "signature": "static int press(ps2_state *s, unsigned char code, ps2_key *out)"}, {"doc": "/** Feeds a byte sequence and returns the kind of the last event. static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out) { int kind = PS2_EV_NONE; for (int i = 0; i < n; i++) kind = ps2_feed(s, seq[i], out); return kind; } /** Presses one non-extended make code and returns the event kind. static int press(ps2_state *s, unsigned char code, ps2_key *out) { return ps2_feed(s, code, out); } /** Releases one non-extended code (break = make | 0x80).", "kind": "function", "line": 41, "name": "release", "signature": "static int release(ps2_state *s, unsigned char code, ps2_key *out)"}, {"kind": "function", "line": 45, "name": "test_letters_and_shift", "signature": "static void test_letters_and_shift(void)"}, {"kind": "function", "line": 69, "name": "test_caps_lock", "signature": "static void test_caps_lock(void)"}, {"kind": "function", "line": 90, "name": "test_punctuation", "signature": "static void test_punctuation(void)"}, {"kind": "function", "line": 111, "name": "test_control_key_text", "signature": "static void test_control_key_text(void)"}, {"kind": "function", "line": 128, "name": "test_chords_have_no_text", "signature": "static void test_chords_have_no_text(void)"}, {"kind": "function", "line": 150, "name": "test_extended_keys", "signature": "static void test_extended_keys(void)"}, {"kind": "function", "line": 202, "name": "test_function_keys", "signature": "static void test_function_keys(void)"}, {"kind": "function", "line": 218, "name": "test_keypad_num_lock", "signature": "static void test_keypad_num_lock(void)"}, {"kind": "function", "line": 263, "name": "test_prefix_sequences", "signature": "static void test_prefix_sequences(void)"}, {"kind": "function", "line": 280, "name": "test_fail_closed", "signature": "static void test_fail_closed(void)"}, {"doc": "static void test_fail_closed(void) { ps2_state s; ps2_key k; ps2_init(&s); check(ps2_feed(NULL, 0x1E, &k) == PS2_EV_NONE, \"null state\"); check(ps2_feed(&s, 0x1E, NULL) == PS2_EV_NONE, \"null out\"); check(ps2_feed(&s, 0x00, &k) == PS2_EV_NONE, \"code zero ignored\"); check(ps2_feed(&s, 0x7F, &k) == PS2_EV_NONE, \"unmapped code ignored\"); check(ps2_feed(&s, 0xFA, &k) == PS2_EV_NONE, \"controller ack ignored\"); check(press(&s, 0x1E, &k) == PS2_EV_PRESS && k.sym == XKB_KEY_a, \"stream usable after junk\"); } /** Entry point running all translator checks.", "kind": "function", "line": 293, "name": "main", "signature": "int main(void)"}]}, {"doc": "test_randmix.c -- host test for the getrandom mixer in randmix.h", "id": "tests/test_randmix.c", "kind": "module", "label": "test_randmix.c", "language": "c", "sha256": "53aa4a94bd969a97", "symbol_count": 3, "symbols": [{"kind": "function", "line": 18, "name": "popcount64", "signature": "static int popcount64(unsigned long x)"}, {"kind": "function", "line": 24, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(c, m)"}]}, {"doc": "Docstring: Host test for kernel/rcu.c (make test-rcu).", "id": "tests/test_rcu.c", "kind": "module", "label": "test_rcu.c", "language": "c", "sha256": "8ec20a6399f3842d", "symbol_count": 4, "symbols": [{"kind": "function", "line": 19, "name": "rcu_host_cpu", "signature": "cpu_t *rcu_host_cpu(void)"}, {"kind": "function", "line": 23, "name": "test_cb", "signature": "static void test_cb(void *arg)"}, {"kind": "function", "line": 37, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 30, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "test_rtc.c -- host test for the pure date math in drivers/rtc.c", "id": "tests/test_rtc.c", "kind": "module", "label": "test_rtc.c", "language": "c", "sha256": "356423ff924b717a", "symbol_count": 2, "symbols": [{"kind": "function", "line": 18, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(c, m)"}]}, {"doc": "Docstring: Host test for sanitize.h (make test-sanitize).", "id": "tests/test_sanitize.c", "kind": "module", "label": "test_sanitize.c", "language": "c", "sha256": "1632610bc85d8384", "symbol_count": 9, "symbols": [{"kind": "function", "line": 20, "name": "user_range_ok", "signature": "int user_range_ok(unsigned long p, unsigned long len)"}, {"kind": "function", "line": 26, "name": "user_str_ok", "signature": "int user_str_ok(unsigned long p, unsigned long maxlen)"}, {"kind": "function", "line": 32, "name": "kmemcpy", "signature": "void *kmemcpy(void *dst, const void *src, unsigned long n)"}, {"kind": "function", "line": 48, "name": "range_probe", "signature": "static long range_probe(unsigned long p, long len)"}, {"kind": "function", "line": 54, "name": "str_probe", "signature": "static long str_probe(unsigned long p)"}, {"kind": "function", "line": 61, "name": "copy_probe", "signature": "static long copy_probe(unsigned long uptr, long count, unsigned long elemsz)"}, {"kind": "function", "line": 67, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 13, "name": "EFAULT", "signature": "#define EFAULT"}, {"kind": "macro", "line": 41, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for kernel/seccomp_bpf.c (make test-seccomp-bpf).", "id": "tests/test_seccomp_bpf.c", "kind": "module", "label": "test_seccomp_bpf.c", "language": "c", "sha256": "da3f9517cc47a484", "symbol_count": 17, "symbols": [{"kind": "function", "line": 34, "name": "data_for", "signature": "static sbpf_data data_for(int nr, unsigned long long a2)"}, {"kind": "function", "line": 43, "name": "test_freedom_shape", "signature": "static void test_freedom_shape(void)"}, {"kind": "function", "line": 88, "name": "test_check_refusals", "signature": "static void test_check_refusals(void)"}, {"kind": "function", "line": 130, "name": "test_scratch_flow", "signature": "static void test_scratch_flow(void)"}, {"kind": "function", "line": 150, "name": "test_alu_and_jumps", "signature": "static void test_alu_and_jumps(void)"}, {"kind": "function", "line": 199, "name": "test_action_rank", "signature": "static void test_action_rank(void)"}, {"kind": "function", "line": 210, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}, {"kind": "macro", "line": 21, "name": "STMT", "signature": "#define STMT(c, k)"}, {"kind": "macro", "line": 22, "name": "JUMP", "signature": "#define JUMP(c, k, t, f)"}, {"kind": "macro", "line": 24, "name": "NR_READ", "signature": "#define NR_READ"}, {"kind": "macro", "line": 25, "name": "NR_WRITE", "signature": "#define NR_WRITE"}, {"kind": "macro", "line": 26, "name": "NR_OPEN", "signature": "#define NR_OPEN"}, {"kind": "macro", "line": 27, "name": "NR_MMAP", "signature": "#define NR_MMAP"}, {"kind": "macro", "line": 28, "name": "NR_MPROTECT", "signature": "#define NR_MPROTECT"}, {"kind": "macro", "line": 29, "name": "PROT_EXEC", "signature": "#define PROT_EXEC"}, {"kind": "macro", "line": 30, "name": "ARGS2_OFF", "signature": "#define ARGS2_OFF"}]}, {"doc": "Docstring: Host test for headers/select_map.h (make test-select-map).", "id": "tests/test_select_map.c", "kind": "module", "label": "test_select_map.c", "language": "c", "sha256": "5b0cce1cbe1ffb89", "symbol_count": 9, "symbols": [{"kind": "function", "line": 25, "name": "test_bit_ops", "signature": "static void test_bit_ops(void)"}, {"kind": "function", "line": 50, "name": "test_count_and_build", "signature": "static void test_count_and_build(void)"}, {"kind": "function", "line": 72, "name": "test_union_events", "signature": "static void test_union_events(void)"}, {"kind": "function", "line": 90, "name": "test_result_classes", "signature": "static void test_result_classes(void)"}, {"kind": "function", "line": 123, "name": "test_result_only_requested", "signature": "static void test_result_only_requested(void)"}, {"kind": "function", "line": 142, "name": "test_result_hup_read_only", "signature": "static void test_result_hup_read_only(void)"}, {"kind": "function", "line": 160, "name": "test_badfd", "signature": "static void test_badfd(void)"}, {"kind": "function", "line": 169, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 18, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for kernel/ed25519.c plus headers/sign.h.", "id": "tests/test_sign.c", "kind": "module", "label": "test_sign.c", "language": "c", "sha256": "ab72381a84409158", "symbol_count": 4, "symbols": [{"kind": "function", "line": 27, "name": "hexval", "signature": "static unsigned hexval(char c)"}, {"kind": "function", "line": 33, "name": "unhex", "signature": "static void unhex(unsigned char *out, const char *in, unsigned n)"}, {"kind": "function", "line": 51, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 20, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Host-side unit test for the blocking sync primitives (kernel/sync.c).", "id": "tests/test_sync.c", "kind": "module", "label": "test_sync.c", "language": "c", "sha256": "ae75c014ae606504", "symbol_count": 6, "symbols": [{"kind": "function", "line": 24, "name": "proc_get", "signature": "proc_t *proc_get(int pid)"}, {"kind": "function", "line": 30, "name": "schedule", "signature": "void schedule(void)"}, {"kind": "function", "line": 44, "name": "fresh_proc", "signature": "static void fresh_proc(int pid)"}, {"kind": "function", "line": 52, "name": "fresh_all", "signature": "static void fresh_all(void)"}, {"kind": "function", "line": 63, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 37, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: host test for the shared Nuklear theme contract.", "id": "tests/test_theme.c", "kind": "module", "label": "test_theme.c", "language": "c", "sha256": "81345604d527045a", "symbol_count": 8, "symbols": [{"kind": "struct", "line": 23, "name": "tslot"}, {"kind": "function", "line": 34, "name": "t_name_ok", "signature": "static int t_name_ok(const char *name)"}, {"kind": "function", "line": 46, "name": "t_parse_line", "signature": "static int t_parse_line(const char *line, int *idx, long v[3])"}, {"kind": "function", "line": 74, "name": "cube_exact", "signature": "static int cube_exact(long v)"}, {"kind": "function", "line": 78, "name": "check_theme_file", "signature": "static void check_theme_file(const char *path)"}, {"kind": "function", "line": 107, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 16, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}, {"kind": "macro", "line": 29, "name": "X", "signature": "#define X(k, i)"}]}, {"doc": "Docstring: Host test for kernel/tick.c (make test-tick).", "id": "tests/test_tick.c", "kind": "module", "label": "test_tick.c", "language": "c", "sha256": "f30539ff721093d0", "symbol_count": 6, "symbols": [{"kind": "function", "line": 24, "name": "rec_a", "signature": "static void rec_a(void *ctx)"}, {"kind": "function", "line": 31, "name": "rec_b", "signature": "static void rec_b(void *ctx)"}, {"kind": "function", "line": 38, "name": "rec_d", "signature": "static void rec_d(void *ctx)"}, {"kind": "function", "line": 47, "name": "dummy", "signature": "static void dummy(void *ctx)"}, {"kind": "function", "line": 52, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 17, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for the USB mass-storage driver (make test-usbblk).", "id": "tests/test_usbblk.c", "kind": "module", "label": "test_usbblk.c", "language": "c", "sha256": "0b17bc7a71e35f2b", "symbol_count": 4, "symbols": [{"kind": "function", "line": 20, "name": "device_register", "signature": "int device_register(device_t *dev)"}, {"kind": "function", "line": 26, "name": "device_find", "signature": "device_t *device_find(const char *name)"}, {"kind": "function", "line": 43, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 36, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for the USB HID driver (make test-usbhid).", "id": "tests/test_usbhid.c", "kind": "module", "label": "test_usbhid.c", "language": "c", "sha256": "5bbff14bb7b11ab1", "symbol_count": 5, "symbols": [{"kind": "function", "line": 22, "name": "kbd_feed_scancode", "signature": "int kbd_feed_scancode(unsigned char sc)"}, {"kind": "function", "line": 30, "name": "kbd_q_push", "signature": "void kbd_q_push(unsigned char c)"}, {"kind": "function", "line": 48, "name": "check_usage", "signature": "static void check_usage(unsigned usage, unsigned char want_sc, int want_e0,\n                     ..."}, {"kind": "function", "line": 59, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 41, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for the vedit IDE build contract (make test-vedit).", "id": "tests/test_vedit_build.c", "kind": "module", "label": "test_vedit_build.c", "language": "c", "sha256": "410e9cef28834483", "symbol_count": 16, "symbols": [{"kind": "function", "line": 40, "name": "t_has_ext", "signature": "static int t_has_ext(const char *fname, const char *ext)"}, {"kind": "function", "line": 51, "name": "t_base_of", "signature": "static int t_base_of(const char *fname, char *dst, size_t cap)"}, {"kind": "function", "line": 71, "name": "t_join", "signature": "static int t_join(const char *dir, const char *base, const char *ext,\n                  char *dst..."}, {"kind": "function", "line": 87, "name": "t_link_fmt", "signature": "static int t_link_fmt(const char *s)"}, {"doc": "Mirror of vedit_lang_of: 1=C, 2=PY, 3=LUA, 4=ASM, 5=LISP. Unknown * defaults to C, exactly like the guest (untitled highlights as C).", "kind": "function", "line": 101, "name": "t_lang_of", "signature": "static int t_lang_of(const char *fname)"}, {"doc": "} if (n >= 3 && fname[n - 3] == '.' && fname[n - 2] == 'p' && fname[n - 1] == 'y') return 2; if (n >= 4 && fname[n - 4] == '.' && fname[n - 3] == 'l' && fname[n - 2] == 'u' && fname[n - 1] == 'a') return 3; if (n >= 5 && fname[n - 5] == '.' && fname[n - 4] == 'l' && fname[n - 3] == 'i' && fname[n - 2] == 's' && fname[n - 1] == 'p') return 5; return 1; } /* Mirror of vedit_run_kind: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp, else 0.", "kind": "function", "line": 121, "name": "t_run_kind", "signature": "static int t_run_kind(const char *fname)"}, {"doc": "return 1; } /* Mirror of vedit_run_kind: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp, else 0. static int t_run_kind(const char *fname) { if (t_has_ext(fname, \".c\") || t_has_ext(fname, \".h\")) return 1; if (t_has_ext(fname, \".lua\")) return 2; if (t_has_ext(fname, \".py\")) return 3; if (t_has_ext(fname, \".s\")) return 4; if (t_has_ext(fname, \".lisp\")) return 5; return 0; } /* Mirror of vedit_str_case.", "kind": "function", "line": 131, "name": "t_str_case", "signature": "static void t_str_case(char *s, int mode)"}, {"kind": "function", "line": 157, "name": "t_transpose", "signature": "static void t_transpose(char *s, int len, int pos)"}, {"doc": "} i++; } } static void t_transpose(char *s, int len, int pos) { char t; if (!s || len < 2 || pos < 1 || pos >= len) return; t = s[pos - 1]; s[pos - 1] = s[pos]; s[pos] = t; } /* Mirror of vedit_magic_match (subset: ./star/anchors/classes).", "kind": "function", "line": 166, "name": "t_mclass", "signature": "static int t_mclass(int c, const char *cls)"}, {"kind": "function", "line": 188, "name": "t_matom", "signature": "static int t_matom(const char *pat, int c, int *atom_len)"}, {"kind": "function", "line": 211, "name": "t_mhere", "signature": "static int t_mhere(const char *text, const char *pat, int *mlen)"}, {"kind": "function", "line": 268, "name": "t_magic", "signature": "static int t_magic(const char *text, const char *pat, int *mlen)"}, {"kind": "function", "line": 299, "name": "t_cmd", "signature": "static int t_cmd(const char *name)"}, {"kind": "function", "line": 312, "name": "t_parse_key", "signature": "static int t_parse_key(const char *s)"}, {"kind": "function", "line": 345, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 33, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Host-side unit test for the VMA red-black tree (vma.c).", "id": "tests/test_vma.c", "kind": "module", "label": "test_vma.c", "language": "c", "sha256": "26eaf392607ab792", "symbol_count": 10, "symbols": [{"kind": "function", "line": 27, "name": "black_height", "signature": "static int black_height(const vma_node_t *n)"}, {"kind": "function", "line": 38, "name": "tree_valid", "signature": "static int tree_valid(const vma_node_t *root)"}, {"kind": "function", "line": 75, "name": "count_nodes", "signature": "static int count_nodes(const vma_node_t *root)"}, {"kind": "function", "line": 89, "name": "test_insert_find_delete", "signature": "static void test_insert_find_delete(void)"}, {"kind": "function", "line": 136, "name": "test_pool_exhaustion", "signature": "static void test_pool_exhaustion(void)"}, {"kind": "function", "line": 153, "name": "test_full_drain", "signature": "static void test_full_drain(void)"}, {"kind": "function", "line": 167, "name": "test_file_tags_and_containing", "signature": "static void test_file_tags_and_containing(void)"}, {"doc": "Deleted nodes are recycled: a process that maps and unmaps far more * than VMA_MAX times never runs the pool dry.", "kind": "function", "line": 201, "name": "test_node_recycling", "signature": "static void test_node_recycling(void)"}, {"kind": "function", "line": 231, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 20, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "test_vma_bench.c -- RB-tree vs sorted-list benchmark (boyscout gap #9).", "id": "tests/test_vma_bench.c", "kind": "module", "label": "test_vma_bench.c", "language": "c", "sha256": "72ec9f36f0c1614c", "symbol_count": 6, "symbols": [{"kind": "function", "line": 13, "name": "now_us", "signature": "static long now_us(void)"}, {"kind": "function", "line": 23, "name": "l_insert", "signature": "static void l_insert(unsigned long b)"}, {"kind": "function", "line": 28, "name": "l_find", "signature": "static int l_find(unsigned long b)"}, {"kind": "function", "line": 34, "name": "bench", "signature": "static void bench(int n)"}, {"kind": "function", "line": 54, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 20, "name": "LIST_MAX", "signature": "#define LIST_MAX"}]}, {"doc": "Host test for progs/wl/wl_mini.h (make test-wl).", "id": "tests/test_wl.c", "kind": "module", "label": "test_wl.c", "language": "c", "sha256": "310ebe0ba588a46a", "symbol_count": 2, "symbols": [{"kind": "function", "line": 27, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 20, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for wm_geom.h and wm_events.h (make test-wm).", "id": "tests/test_wm.c", "kind": "module", "label": "test_wm.c", "language": "c", "sha256": "85a7e1687360b779", "symbol_count": 2, "symbols": [{"kind": "function", "line": 29, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 22, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "Docstring: Host test for the xHCI controller driver (make test-xhci).", "id": "tests/test_xhci.c", "kind": "module", "label": "test_xhci.c", "language": "c", "sha256": "dd87cef9d0a54ad0", "symbol_count": 2, "symbols": [{"kind": "function", "line": 30, "name": "main", "signature": "int main(void)"}, {"kind": "macro", "line": 23, "name": "CHECK", "signature": "#define CHECK(cond, msg)"}]}, {"doc": "tls_test.c - host-side tests for the kernel TLS stack.", "id": "tls_test.c", "kind": "module", "label": "tls_test.c", "language": "c", "sha256": "eb2b2337e54b71e2", "symbol_count": 23, "symbols": [{"kind": "function", "line": 26, "name": "tls_test_send", "signature": "int tls_test_send(int fd, const char *buf, int len)"}, {"kind": "function", "line": 36, "name": "tls_test_recv", "signature": "int tls_test_recv(int fd, char *buf, int len)"}, {"kind": "function", "line": 41, "name": "tls_test_recv_timeout", "signature": "int tls_test_recv_timeout(int fd, char *buf, int len, unsigned long ms)"}, {"kind": "function", "line": 54, "name": "tls_test_close", "signature": "void tls_test_close(int fd)"}, {"kind": "function", "line": 67, "name": "hexdigit", "signature": "static int hexdigit(int c)"}, {"kind": "function", "line": 74, "name": "unhex", "signature": "static void unhex(const char *hex, unsigned char *out, int n)"}, {"kind": "function", "line": 80, "name": "bytes_eq", "signature": "static int bytes_eq(const unsigned char *a, const unsigned char *b, int n)"}, {"kind": "function", "line": 88, "name": "test_sha256", "signature": "static void test_sha256(void)"}, {"kind": "function", "line": 103, "name": "test_sha384", "signature": "static void test_sha384(void)"}, {"kind": "function", "line": 114, "name": "test_gcm", "signature": "static void test_gcm(void)"}, {"kind": "function", "line": 154, "name": "test_p256", "signature": "static void test_p256(void)"}, {"kind": "function", "line": 200, "name": "test_rsa_ecdsa_vectors", "signature": "static void test_rsa_ecdsa_vectors(void)"}, {"kind": "function", "line": 249, "name": "tcp_connect", "signature": "static int tcp_connect(int port)"}, {"doc": "int fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) return -1; memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_port = htons((unsigned short)port); sa.sin_addr.s_addr = htonl(0x7f000001UL); if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) { close(fd); return -1; } return fd; } /* Full handshake + one HTTP round trip. Returns 0 on success.", "kind": "function", "line": 265, "name": "http_over_tls", "signature": "static int http_over_tls(int port, const char *host)"}, {"kind": "function", "line": 290, "name": "scenario_good", "signature": "static int scenario_good(int port)"}, {"doc": "total += n; printed = 1; } tls_free_fd(fd); close(fd); if (!printed) return -1; return 0; } static int scenario_good(int port) { return http_over_tls(port, \"localhost\") == 0 ? 0 : -1; } /* \"*.example.com\" matches exactly one label.", "kind": "function", "line": 295, "name": "scenario_wild_good", "signature": "static int scenario_wild_good(int port)"}, {"kind": "function", "line": 299, "name": "scenario_wild_root", "signature": "static int scenario_wild_root(int port)"}, {"kind": "function", "line": 309, "name": "scenario_wild_deep", "signature": "static int scenario_wild_deep(int port)"}, {"kind": "function", "line": 319, "name": "scenario_bad_host", "signature": "static int scenario_bad_host(int port)"}, {"kind": "function", "line": 329, "name": "scenario_bad_ca", "signature": "static int scenario_bad_ca(int port)"}, {"kind": "function", "line": 339, "name": "scenario_expired", "signature": "static int scenario_expired(int port)"}, {"kind": "function", "line": 349, "name": "main", "signature": "int main(int argc, char **argv)"}, {"kind": "macro", "line": 62, "name": "CHECK", "signature": "#define CHECK(name, cond)"}]}, {"doc": "Docstring: tools/abi_stamp.c -- Build-time ABI manifest generator.", "id": "tools/abi_stamp.c", "kind": "module", "label": "abi_stamp.c", "language": "c", "sha256": "4960d0db78ada604", "symbol_count": 1, "symbols": [{"kind": "function", "line": 14, "name": "main", "signature": "int main(void)"}]}, {"doc": "boot_run.sh -- boot the MiniOS image in QEMU and drive the shell over the serial console with a list of commands, capturing the full transcript.  This is the reusable harness behind the one-shot manual checks (lua in-OS suite, DOOM/Quake 2 autoquit render tests, toolchain compile/link/run) so a future run does not hand-roll a QEMU launch.  The guest powers itself off through the ACPI port; the timeout is only a safety net for hangs.  Usage: tools/boot_run.sh \"cmd1\" \"cmd2\" ... [--timeout N] [--log FILE]  - every non-option argument is a shell command sent to the guest in order - --timeout N   per-run timeout in seconds (default 200) - --log FILE    write the console transcript to FILE (default ./boot_run.log)  Examples: tools/boot_run.sh \"lua src/test.lua\" tools/boot_run.sh \"gfx frames\" \"run doomgeneric.elf mini_autoframes 150\" \\ \"gfx frames\" --timeout 200 tools/boot_run.sh \"gfx frames\" \\ \"run bin/quake2generic.elf +set basedir . +set minios_autoframes 400\" \\ \"gfx frames\" --timeout 300", "id": "tools/boot_run.sh", "kind": "module", "label": "boot_run.sh", "language": "sh", "sha256": "baec5c17565afd1b", "symbol_count": 0, "symbols": []}, {"doc": "boot_wl.py - boot the miniOS Wayland-mini desktop in one step.  Builds nothing; `make wl` owns the build. Boots os.img, waits for the shell prompt over a pty serial console, types the desktop setup (mailbox clean, mirror flag, three real app frames via their selftests run strictly sequentially, one terminal-pattern client, server in background) with paced bytes and an echo backstop, then either proxies the user terminal to the guest for interactive use or, with WL_HEADLESS=1, screendumps the framebuffer over QMP, powers off and reports the shot path. Setup steps never overlap: each program runs alone and the harness waits for the shell prompt before the next starts, which is the reliable configuration while concurrent heavyweights are under diagnosis (see the honest-limits note in CLAUDE.md).  Usage: python3 tools/boot_wl.py WL_HEADLESS=1 WL_SHOT=/tmp/wl.png python3 tools/boot_wl.py  Every tunable lives in WlBootConfig; no host assumption beyond the QEMU binary name, which WL_QEMU overrides. Failure paths report and release the child; a stuck prompt fails after WL_BOOT_TIMEOUT instead of hanging the make run.", "id": "tools/boot_wl.py", "kind": "module", "label": "boot_wl.py", "language": "py", "sha256": "e8981cbfd5a341fc", "symbol_count": 15, "symbols": [{"kind": "class", "line": 40, "name": "WlBootConfig", "signature": "class WlBootConfig"}, {"kind": "class", "line": 67, "name": "WlBoot", "signature": "class WlBoot"}, {"kind": "function", "line": 226, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 68, "name": "__init__", "signature": "def __init__(self, cfg)"}, {"kind": "method", "line": 75, "name": "fail", "signature": "def fail(self, msg)"}, {"kind": "method", "line": 80, "name": "close", "signature": "def close(self)"}, {"kind": "method", "line": 91, "name": "boot", "signature": "def boot(self)"}, {"kind": "method", "line": 107, "name": "snapshot", "signature": "def snapshot(self, timeout)"}, {"kind": "method", "line": 124, "name": "wait_prompt", "signature": "def wait_prompt(self)"}, {"kind": "method", "line": 135, "name": "send", "signature": "def send(self, line)"}, {"kind": "method", "line": 142, "name": "send_wait", "signature": "def send_wait(self, line, timeout)"}, {"kind": "method", "line": 154, "name": "setup", "signature": "def setup(self)"}, {"kind": "method", "line": 165, "name": "qmp", "signature": "def qmp(self, obj)"}, {"kind": "method", "line": 182, "name": "headless", "signature": "def headless(self)"}, {"kind": "method", "line": 195, "name": "proxy", "signature": "def proxy(self)"}]}, {"doc": "check_abi_numbers.py -- MiniOS syscall numbers vs Linux x86-64 truth.  Phase 0.6 of the FreeDom readiness plan: a browser is the first program that depends on syscalls telling the truth, and several MiniOS numbers drifted from the Linux table (the class that bit us at [74] = flock while Linux x86-64 74 = fsync, 73 = flock). A static host-compiled ELF traps the Linux number and gets whatever MiniOS registered there.  Ground truth is Linux arch/x86/entry/syscalls/syscall_64.tbl (x86-64 common range), frozen here so the gate needs no kernel headers. Two checks, both fail-closed (exit 1) on undocumented drift:  Rule A -- compat claims in progs/minios_abi.h: a MINIOS_SYS_FOO whose normalized name exists in the Linux table and whose value is < 200 must equal the Linux number exactly. Rule B -- MiniOS-wins shadows: a MiniOS number that collides with a *different* Linux syscall must be listed in DEVIATIONS with the ADR that justifies it (fix or documented deviation, never silence). Rule C -- dispatch site in kernel/syscalls.c: every `[N] = { fn, \"name\" }` entry of linux_syscall_table and every `case N:` fall-through in ksyscall_dispatch must resolve N to the Linux number for \"name\". Rule D -- MiniOS-internal collisions: two MINIOS_SYS_* names must never share a number. The dispatch table is indexed by number, so a second name silently overwrites the first (lz4_decompress vs pcm2_close both claimed 248 and only the last entry survived). Rule E -- toolchain stubs: the sibling `ld` links every miniGCC program with a built-in libc whose MiniOS stubs hardcode syscall numbers. A stale stub number sends the program to the wrong handler, so every", "id": "tools/check_abi_numbers.py", "kind": "module", "label": "check_abi_numbers.py", "language": "py", "sha256": "8bfd89d3343fdb4e", "symbol_count": 5, "symbols": [{"kind": "function", "line": 142, "name": "normalize", "signature": "def normalize(minios_name)"}, {"kind": "function", "line": 146, "name": "parse_abi", "signature": "def parse_abi(path)"}, {"doc": "Read the sibling ld's built-in libc stubs: symbol -> syscall number.", "kind": "function", "line": 157, "name": "parse_ld_stubs", "signature": "def parse_ld_stubs(path)"}, {"kind": "function", "line": 164, "name": "parse_dispatch", "signature": "def parse_dispatch(path)"}, {"kind": "function", "line": 177, "name": "main", "signature": "def main()"}]}, {"doc": "check_addons.py -- validate the MiniOS addon marketplace index.  Loads every addons/*.yaml through the strict stdlib-only parser in mcp/minios_addons.py (no PyYAML) and reports each addon's kind. Any unparseable file, failed validation or installer refusal for a guest addon fails closed with a diagnostic and a nonzero exit, so the index can never drift from the dialect the MCP server speaks.  Usage: python3 tools/check_addons.py [--addons-dir DIR]  Exit status: 0 when every file validates, 1 otherwise.", "id": "tools/check_addons.py", "kind": "module", "label": "check_addons.py", "language": "py", "sha256": "93379f4c2cd698b5", "symbol_count": 2, "symbols": [{"kind": "function", "line": 22, "name": "load_parser", "signature": "def load_parser()"}, {"kind": "function", "line": 31, "name": "main", "signature": "def main()"}]}, {"doc": "check_cohesion.py -- Architectural cohesion gate for MiniOS CI.  Parses the CPG JSON-LD output from readmenator and fails the build if any root community's cohesion drops below the configured threshold.  Usage: python3 tools/check_cohesion.py [cpg.jsonld] [--threshold 0.25]  Exit codes: 0 -- all communities above threshold 1 -- cohesion regression detected 2 -- input file missing or malformed", "id": "tools/check_cohesion.py", "kind": "module", "label": "check_cohesion.py", "language": "py", "sha256": "b12a28a7077255df", "symbol_count": 4, "symbols": [{"doc": "Load and parse the CPG JSON-LD file.", "kind": "function", "line": 23, "name": "load_cpg", "signature": "def load_cpg(path)"}, {"doc": "Compute cohesion as internal_edges / max_possible_edges.", "kind": "function", "line": 31, "name": "compute_cohesion", "signature": "def compute_cohesion(community_nodes, community_edges)"}, {"doc": "Extract communities and their internal edges from CPG.", "kind": "function", "line": 42, "name": "extract_communities", "signature": "def extract_communities(cpg)"}, {"kind": "function", "line": 58, "name": "main", "signature": "def main()"}]}, {"doc": "check_complexity.py -- Kernel complexity gate for MiniOS CI.  Validates that kernel.c does not exceed the configured symbol count threshold without explicit approval in ARCH_POLICY.yaml.  Usage: python3 tools/check_complexity.py [--threshold 350] [--policy ARCH_POLICY.yaml]  Exit codes: 0 -- within threshold or explicitly approved 1 -- complexity exceeded without approval 2 -- input files missing", "id": "tools/check_complexity.py", "kind": "module", "label": "check_complexity.py", "language": "py", "sha256": "5f47be84232f031d", "symbol_count": 3, "symbols": [{"doc": "Count top-level function and global variable definitions.", "kind": "function", "line": 24, "name": "count_symbols", "signature": "def count_symbols(filepath)"}, {"doc": "Load explicit complexity approval from ARCH_POLICY.yaml.", "kind": "function", "line": 46, "name": "load_approval", "signature": "def load_approval(policy_path)"}, {"kind": "function", "line": 61, "name": "main", "signature": "def main()"}]}, {"doc": "Fail-closed stub gate for unimplemented process syscalls.  vfork has no implementation in this kernel. A stub that answers success lets userland believe a child exists when none does, so it must answer Linux ENOSYS. execve used to be in this set; it is implemented now (do_execve in kernel/sched.c, fork+exec proven by the execho BDD scenario), so the gate no longer scans it: a stub regression there fails the execho scenario instead of this gate. fork() is implemented (do_fork with copy-on-write pages, kernel/sched.c) and is checked by the fork BDD scenario instead. The check scans the handler definitions and fails on any success return.", "id": "tools/check_fork_stubs.py", "kind": "module", "label": "check_fork_stubs.py", "language": "py", "sha256": "794a162d8e0d2f4c", "symbol_count": 4, "symbols": [{"doc": "Centralized tunable values for the stub gate.", "kind": "class", "line": 18, "name": "Config", "signature": "class Config"}, {"doc": "Return the body of the named handler or empty string when absent.", "kind": "function", "line": 27, "name": "handler_body", "signature": "def handler_body(text, name)"}, {"doc": "Collect failure strings for stubs that do not fail closed.", "kind": "function", "line": 37, "name": "check_stubs", "signature": "def check_stubs(text, cfg)"}, {"doc": "Entry point used by lint and CI.", "kind": "function", "line": 52, "name": "main", "signature": "def main()"}]}, {"doc": "check_kb_sync.py -- Verify KNOWLEDGE_BASE.md is in sync with code.  Runs readmenator to regenerate the knowledge base, then checks if the output differs from the committed version.  Used in CI to prevent drift.  Usage: python3 tools/check_kb_sync.py [--kb KNOWLEDGE_BASE.md] [--regenerate]  Exit codes: 0 -- KB is in sync 1 -- KB is out of sync 2 -- readmenator not available", "id": "tools/check_kb_sync.py", "kind": "module", "label": "check_kb_sync.py", "language": "py", "sha256": "5e2ba708097f369f", "symbol_count": 2, "symbols": [{"doc": "Attempt to regenerate KNOWLEDGE_BASE.md using readmenator.", "kind": "function", "line": 24, "name": "regenerate_kb", "signature": "def regenerate_kb()"}, {"kind": "function", "line": 43, "name": "main", "signature": "def main()"}]}, {"doc": "Verify every mutate.sh mutant anchor matches its target file.  A mutant whose sed expression matches nothing is reported BROKEN by mutate.sh instead of killed, so a stale anchor silently weakens the mutation gate. Ground truth is sed itself: each expression is applied to a scratch copy of its target and a no-change result is breakage.  Usage: python3 tools/check_mutant_anchors.py", "id": "tools/check_mutant_anchors.py", "kind": "module", "label": "check_mutant_anchors.py", "language": "py", "sha256": "5856c80905bbdeba", "symbol_count": 6, "symbols": [{"doc": "Central configuration for the anchor check.", "kind": "class", "line": 17, "name": "Config", "signature": "class Config"}, {"doc": "Collapse the escapes bash applies inside the MUTATIONS string.", "kind": "function", "line": 26, "name": "bash_unquote", "signature": "def bash_unquote(expr)"}, {"doc": "True when expr holds a double quote bash would not keep.\n\nThe table is one double-quoted bash string: a bare \" closes it, so sed\nreceives the expression with that quote stripped and matches nothing at\nrun time even though the raw text matches here.", "kind": "function", "line": 41, "name": "unescaped_quote", "signature": "def unescaped_quote(expr)"}, {"doc": "Extract (name, expression, target) triples from the MUTATIONS block.\n\nBounds derive from the block markers, never from line numbers, so\nadding a mutant cannot silently push rows out of the checked range.", "kind": "function", "line": 58, "name": "parse_mutations", "signature": "def parse_mutations(text)"}, {"doc": "Apply the sed expression to a scratch copy; True when it changes it.", "kind": "function", "line": 84, "name": "anchor_matches", "signature": "def anchor_matches(repo, target, expr)"}, {"doc": "Entry point: report anchors that change nothing and exit nonzero.", "kind": "function", "line": 105, "name": "main", "signature": "def main()"}]}, {"doc": "Check spinlock call-site discipline across kernel C sources.  Rules, derived from the headers/spinlock.h contract: S1  No orphaned acquire or release: a function using spin_lock must reach a spin_unlock on some path (and vice versa); same for the irqsave/irqrestore pair. Early-return style (one acquire, many releases) is idiomatic here, so exact counts are not enforced. Functions using spin_trylock follow the conditional-unlock idiom and are exempt from pairing. S2  No plain spin_lock inside interrupt context: isr_dispatch and any function whose name carries isr/irq may only use the irqsave form, because spin_unlock re-enables interrupts unconditionally.  Usage: python3 tools/check_spin_discipline.py [dir ...] Exit 1 with a diagnostic on the first violation, else prints ok.", "id": "tools/check_spin_discipline.py", "kind": "module", "label": "check_spin_discipline.py", "language": "py", "sha256": "2cd2996fc708ef5a", "symbol_count": 4, "symbols": [{"kind": "class", "line": 23, "name": "Config", "signature": "class Config"}, {"doc": "Yield (name, first_line, body_lines) with a brace-depth split.", "kind": "function", "line": 38, "name": "iter_functions", "signature": "def iter_functions(path)"}, {"doc": "Return a list of violation strings for one translation unit.", "kind": "function", "line": 64, "name": "check_file", "signature": "def check_file(path)"}, {"doc": "Walk the configured roots and fail closed on any violation.", "kind": "function", "line": 99, "name": "main", "signature": "def main(argv)"}]}, {"doc": "check_surprising.py -- Detect surprising architectural connections.  Parses the CPG JSON-LD output from readmenator and flags new connections of N or more hops between distinct communities.  These represent coupling debt that should be visible and prioritizable.  Usage: python3 tools/check_surprising.py [cpg.jsonld] [--min-hops 5]  Exit codes: 0 -- no surprising connections 1 -- new surprising connections detected 2 -- input file missing or malformed", "id": "tools/check_surprising.py", "kind": "module", "label": "check_surprising.py", "language": "py", "sha256": "1549709fae6152f1", "symbol_count": 5, "symbols": [{"doc": "Load and parse the CPG JSON-LD file.", "kind": "function", "line": 25, "name": "load_cpg", "signature": "def load_cpg(path)"}, {"doc": "Build adjacency list from CPG nodes and edges.", "kind": "function", "line": 33, "name": "build_graph", "signature": "def build_graph(cpg)"}, {"doc": "BFS from source to any node in target_community, returning hop count.", "kind": "function", "line": 56, "name": "bfs_min_hops", "signature": "def bfs_min_hops(nodes, edges, source, target_community, max_hops)"}, {"doc": "Find connections of min_hops or more between distinct communities.", "kind": "function", "line": 87, "name": "find_surprising_connections", "signature": "def find_surprising_connections(nodes, edges, min_hops)"}, {"kind": "function", "line": 118, "name": "main", "signature": "def main()"}]}, {"doc": "Scoped audit gate for syscall user-pointer sanitization.  Every ring-3 pointer that reaches a syscall handler as a1..a6 must pass a SANITIZE_* macro or user_range_ok/user_str_ok check before its first dereference. The discipline allows one delegation shape: an unchecked pointer may flow only into a callee that sanitizes internally (Config.delegated_callees); anything else is a fail-closed violation.  The analysis is textual and conservative: it over-reports, and Config records each triaged outcome, so a new unsanitized dereference fails the build instead of shipping silently.", "id": "tools/check_syscall_sanitize.py", "kind": "module", "label": "check_syscall_sanitize.py", "language": "py", "sha256": "6ff35258808f649c", "symbol_count": 8, "symbols": [{"doc": "Centralized tunable values for the sanitize audit.", "kind": "class", "line": 18, "name": "Config", "signature": "class Config"}, {"doc": "Yield (name, start, body_lines) triples using brace depth.", "kind": "function", "line": 70, "name": "split_functions", "signature": "def split_functions(lines)"}, {"doc": "Return identifiers named inside sanitizer checks in a body.", "kind": "function", "line": 113, "name": "checked_names", "signature": "def checked_names(body)"}, {"doc": "Decide whether an alias flows only into sanitizing callees.", "kind": "function", "line": 123, "name": "delegated_only", "signature": "def delegated_only(body, alias)"}, {"doc": "Split a call argument list on top-level commas only.", "kind": "function", "line": 144, "name": "split_top_args", "signature": "def split_top_args(argtext)"}, {"doc": "Return violation strings for one function body.", "kind": "function", "line": 163, "name": "audit_body", "signature": "def audit_body(name, body)"}, {"doc": "Audit every handler in one file, return violation strings.", "kind": "function", "line": 218, "name": "audit_file", "signature": "def audit_file(path)"}, {"doc": "Entry point used by lint and CI.", "kind": "function", "line": 229, "name": "main", "signature": "def main()"}]}, {"doc": "Host to MiniOS clipboard bridge plan builder.  Builds the exact shell lines that carry a host text file into the guest through the shared 4 KB clipboard slot (syscalls 249/250) or, for multi-line input, through the kernel line editor upload path the MCP ``minios_write`` tool already drives. This module never talks to QEMU itself: it prints a plan the operator pastes into a live serial session or feeds to ``minios_send`` line by line, so there is no host assumption beyond the serial console both paths already require.  Single-line printable input within the clipboard cap travels as one ``clip <text>`` line and lands ready to paste with Ctrl+V at any prompt or in vedit. Anything else (embedded newlines, overlong lines, non-printable bytes) travels as an editor script (``edit <dst>`` plus one ``a <line>`` per line plus ``x``), which is the only guest path that preserves newlines: the ``clip`` builtin joins argv with spaces.  Every bound is fail-closed. A destination outside the character whitelist, a line the kernel readline cannot carry, or content past the clipboard cap is refused before a single plan line is printed, never silently truncated.", "id": "tools/clip_bridge.py", "kind": "module", "label": "clip_bridge.py", "language": "py", "sha256": "572b2f287b683ee5", "symbol_count": 5, "symbols": [{"doc": "Centralized bounds for the bridge plan.", "kind": "class", "line": 30, "name": "ClipBridgeConfig", "signature": "class ClipBridgeConfig"}, {"doc": "True when name is a safe guest path.", "kind": "function", "line": 41, "name": "valid_dst", "signature": "def valid_dst(name, cfg)"}, {"doc": "True when every char survives the kernel readline.", "kind": "function", "line": 52, "name": "printable_line", "signature": "def printable_line(line, cfg)"}, {"doc": "Return (ok, lines, diagnostic) for carrying text to dst.", "kind": "function", "line": 59, "name": "build_plan", "signature": "def build_plan(text, dst, cfg)"}, {"doc": "Entry point: clip_bridge.py <src-file> <dst-name>.", "kind": "function", "line": 84, "name": "main", "signature": "def main(argv)"}]}, {"doc": "doom_pwad.py - grid map to vanilla Doom PWAD writer and checker.  Converts a text grid map into a single-level PWAD that replaces E1M1 in the shareware IWAD, and validates PWAD files produced by any tool. The generated level is multi-sector: each same-style floor region and each door block is its own sector, so rooms can differ in light, floor height and flats, and doors genuinely open. The BSP stays trivially correct: every linedef becomes one seg, all segs form one subsector, and the root node points at that same subsector on both children. One subsector needs no ordering, so no external node builder is required; sight, collision and clipping all work off the line/sector lists.  Usage: doom_pwad.py build <grid.txt> <out.wad> doom_pwad.py check <file.wad> doom_pwad.py info <file.wad>  Grid legend: '#' wall, '.' floor, 'P' player 1 start, 'E' exit switch marker, '+' door cell, ',' dark floor, '~' nukage pit, enemies 'i' imp, 'd' demon, 'z' zombieman, 'g' shotgun guy, 'v' spectre, 'b' baron, weapons 's' shotgun, 'h' chaingun, 'r' rocket launcher, 'w' chainsaw, ammo 'a' shells, 'u' clip, 'o' bullet box, 'k' rockets, 'x' rocket box, 'T' shell box, health 'm' medikit, 'q' stimpack, 'y' soulsphere, 'n' health bonus, armor 'f' armor bonus, 'G' green armor, 'U' blue armor, keys '1' blue, '2' red, '3' yellow, powerups 'V' invisibility, 'R' radiation suit, 'C' computer map, 'L' light amp, gear 'D' backpack, 'B' barrel, decor '0' pillar. A '+' cell is its own door sector (low ceiling, tagged) whose edges to neighbouring rooms are two-sided D1 open-door lines, usable from either side. A ',' region is the same room at low light; a '~' region is a", "id": "tools/doom_pwad.py", "kind": "module", "label": "doom_pwad.py", "language": "py", "sha256": "efe1c72be47754ed", "symbol_count": 25, "symbols": [{"doc": "Centralized tunables for the grid compiler and the PWAD checker.", "kind": "class", "line": 52, "name": "DoomPwadConfig", "signature": "class DoomPwadConfig"}, {"doc": "Fail-closed diagnostic raised for any invalid grid or PWAD.", "kind": "class", "line": 161, "name": "PwadError", "signature": "class PwadError(Exception)"}, {"doc": "Return a texture or flat name padded to its 8-byte field.", "kind": "function", "line": 165, "name": "pad_tex", "signature": "def pad_tex(raw)"}, {"doc": "Parse grid text into rows, refusing empty or ragged input.", "kind": "function", "line": 172, "name": "parse_grid", "signature": "def parse_grid(text)"}, {"doc": "Return coordinate bounds of the lattice in map units.", "kind": "function", "line": 195, "name": "grid_extents", "signature": "def grid_extents(rows)"}, {"doc": "Treat out-of-bounds cells as solid wall so maps stay closed.", "kind": "function", "line": 203, "name": "is_wall", "signature": "def is_wall(rows, row, col)"}, {"doc": "Return the walkable set reachable from the player start tile.", "kind": "function", "line": 210, "name": "flood_reachable", "signature": "def flood_reachable(rows)"}, {"doc": "Enforce single player, single exit, and full reachability.", "kind": "function", "line": 240, "name": "validate_grid", "signature": "def validate_grid(rows)"}, {"doc": "Return cell corners as (x0, x1, y_top, y_bottom) in map units.", "kind": "function", "line": 269, "name": "cell_corners", "signature": "def cell_corners(row, col)"}, {"doc": "Classify a walkable cell: doors stand alone, styles never merge.", "kind": "function", "line": 279, "name": "cell_class", "signature": "def cell_class(cell)"}, {"doc": "Flood same-class walkable cells into region ids; walls stay -1.", "kind": "function", "line": 291, "name": "label_regions", "signature": "def label_regions(rows)"}, {"doc": "Map a labelled region to its sector record fields and wall skin.", "kind": "function", "line": 326, "name": "region_sector", "signature": "def region_sector(region, door_tag)"}, {"doc": "Compile edges into vertexes, two-sided rooms and tagged doors.\n\nReturns vertexes, linedefs as (v1, v2, flags, special, tag, s0, s1),\nsidedefs as (xoff, yoff, upper, lower, mid, sector) and the exit edge.\nEdges against walls are one-sided; room-to-room and room-to-door\nedges are two-sided with the front on the cell being compiled.", "kind": "function", "line": 371, "name": "compile_geometry", "signature": "def compile_geometry(rows, exit_pos, wall_side)"}, {"doc": "Compile thing stamps into mapthing records in scan order.", "kind": "function", "line": 485, "name": "compile_things", "signature": "def compile_things(rows)"}, {"doc": "Return the stored short angle for a seg direction vector.", "kind": "function", "line": 506, "name": "seg_angle", "signature": "def seg_angle(dx, dy)"}, {"doc": "Compile a validated grid into the eleven E1M1 lump payloads.", "kind": "function", "line": 516, "name": "build_lumps", "signature": "def build_lumps(rows)"}, {"doc": "Assemble lump payloads into a complete PWAD byte string.", "kind": "function", "line": 597, "name": "build_pwad", "signature": "def build_pwad(rows)"}, {"doc": "Split PWAD bytes into header fields and an ordered lump table.", "kind": "function", "line": 616, "name": "read_pwad", "signature": "def read_pwad(data)"}, {"doc": "Validate lump order, record sizes and cross-lump references.", "kind": "function", "line": 639, "name": "check_pwad", "signature": "def check_pwad(data)"}, {"doc": "Build a PWAD from a grid file, refusing to write on any error.", "kind": "function", "line": 816, "name": "cmd_build", "signature": "def cmd_build(grid_path, out_path)"}, {"doc": "Validate a PWAD file and report its lump census on success.", "kind": "function", "line": 826, "name": "cmd_check", "signature": "def cmd_check(path)"}, {"doc": "Dispatch the build, check and info verbs with host-safe errors.", "kind": "function", "line": 834, "name": "main", "signature": "def main(argv)"}, {"doc": "Deduplicate lattice points shared by adjacent edges.", "kind": "function", "line": 386, "name": "vertex", "signature": "def vertex(x, y)"}, {"doc": "Slice one lump payload out of the file image.", "kind": "function", "line": 650, "name": "payload", "signature": "def payload(name)"}, {"doc": "Require the lump length to hold whole records only.", "kind": "function", "line": 655, "name": "check_multiple", "signature": "def check_multiple(name, fmt)"}]}, {"doc": "tools/extract_shell.py -- Plan for Phase 6.1 shell extraction.  This script documents the shell extraction plan. The actual extraction requires careful handling of cross-dependencies between shell code and kernel internals.  DEPENDENCIES (shell -> kernel): VFS:       kfopen, kfclose, kfread, kfwrite, kfgets, kfputs, kfseek, kftell FS:        fs_resolve, fs_dir_exists, fs_is_dir Ramdisk:   ramdisk_open, ramdisk_read, ramdisk_list, ramdisk_create MiniFS:    minifs_resolve_path, minifs_stat, minifs_read, minifs_mkdir_p, minifs_create, minifs_write, minifs_sync, minifs_is_mounted, minifs_list Process:   k_exec_user, k_run_rel, k_spawn, k_register_program, k_register_process, k_register_symbol, elf_load, load_exec_elf Audio:     pcspk_tone, pcspk_set_volume, pcspk_get_volume Graphics:  vga_fb_* functions (desktop, WM, GFX_SET_TITLE syscall) Hashing:   xxh64_* functions Network:   net_*, tls_* functions Compress:  lzss_*, lz4_*, zip_* functions Crypto:    aes_* functions Editor:    edit_* functions Other:     kprintf, kmemset, kmemcpy, kstrlen, kstrcmp, kstrncmp, kstrcpy, kstrncpy, kstrchr, kstrstr, kstrncat, redirect_begin, redirect_commit, redirect_suspend, redirect_resume  FUNCTIONS TO EXTRACT (38 functions, ~2070 lines): Shell core:    shell_init, shell_run, shell_prompt, shell_parse, shell_exec_builtin, shell_report_exit, shell_report Line editing:  shell_readline, shell_readline_buf, shell_readline_hist,", "id": "tools/extract_shell.py", "kind": "module", "label": "extract_shell.py", "language": "py", "sha256": "d28fc6bdf497f27f", "symbol_count": 0, "symbols": []}, {"doc": "gdb_repro.py — drive a graphics-program sequence under the GDB stub.  Boots MiniOS with the gdb server (-s), a QMP socket for keyboard/mouse injection and a pty serial console, attaches gdb with a conditional breakpoint on the page-fault handler (isr_dispatch, vector 14), then drives a sequence of graphics programs. When a page fault fires, gdb dumps the trap frame (rip/rsp/cr2 = faulting address = FS base + offset) and exits.", "id": "tools/gdb_repro.py", "kind": "module", "label": "gdb_repro.py", "language": "py", "sha256": "58cc2eb76b8596b4", "symbol_count": 4, "symbols": [{"kind": "function", "line": 23, "name": "rs", "signature": "def rs(m, t)"}, {"kind": "function", "line": 27, "name": "main", "signature": "def main()"}, {"kind": "function", "line": 65, "name": "send", "signature": "def send(line)"}, {"kind": "function", "line": 70, "name": "quit_doom", "signature": "def quit_doom()"}]}, {"doc": "gen_desktop_pngs.py -- build MiniOS desktop art from user-supplied PNGs.  Sources (images/ by default, overridable with --src-dir): paint.png              paint icon source cgoblin.png            wallpaper source (any size, RGB/RGBA) doom.png               DOOM icon source doomedit.png           doomedit map-editor icon source quake2.png             Quake 2 icon source piano.png              piano icon source nuklear.png            Nuklear icon source vedit.png              vedit editor icon source pokemon.png            Pokemon icon source (Pikachu art, not pixel art) freedom.png            FreeDom browser icon source  Outputs (under the MiniOS repo): progs/icons/doom.png, doomedit.png, quake2.png, piano.png, nuklear.png, vedit.png, pokemon.png, file.png, shell.png, paint.png, minicraft.png, freedom.png, folder.png, files.png, image.png, object.png  32x32 RGBA (folder/files/image/object are the file-browser kind icons). progs/wall/wallpaper.png                                   800x600 RGB  The kernel runs in an 8-bit palette mode, so it maps icon pixels to the 16-entry icon palette and wallpaper pixels to a fixed 6x6x6 colour cube at boot; these files only need the right dimensions. Icons keep alpha (the kernel treats fully transparent pixels as transparent). The wallpaper is cover-scaled (aspect-preserving fill + centre crop) so a square source like cgoblin.png never looks stretched.  Fail-closed: a missing source aborts with a diagnostic and nonzero exit", "id": "tools/gen_desktop_pngs.py", "kind": "module", "label": "gen_desktop_pngs.py", "language": "py", "sha256": "d21cfa8c748591f2", "symbol_count": 2, "symbols": [{"kind": "function", "line": 71, "name": "write_atomic", "signature": "def write_atomic(img, path)"}, {"kind": "function", "line": 77, "name": "main", "signature": "def main()"}]}, {"doc": "gen_icons.py -- generate 32x32 RGBA PNG icon files for the MiniOS desktop.  Each icon is defined as a 32-line string of hex characters (0-F), where each char maps to a colour in the icon palette.  The script writes minimal valid PNG files (no zlib import needed -- raw deflate via the stored method).  Usage:  python3 tools/gen_icons.py progs/icons/", "id": "tools/gen_icons.py", "kind": "module", "label": "gen_icons.py", "language": "py", "sha256": "8ccde6cbc615ac9d", "symbol_count": 3, "symbols": [{"doc": "Create a minimal indexed-colour PNG from pixel indices and a palette.", "kind": "function", "line": 179, "name": "make_png", "signature": "def make_png(pixels, palette, width, height)"}, {"kind": "function", "line": 209, "name": "make_chunk", "signature": "def make_chunk(chunk_type, data)"}, {"kind": "function", "line": 214, "name": "main", "signature": "def main()"}]}, {"doc": "Generate minifs.c for MiniOS.", "id": "tools/gen_minifs.py", "kind": "module", "label": "gen_minifs.py", "language": "py", "sha256": "39e5253af1b66130", "symbol_count": 0, "symbols": []}, {"doc": "gen_zip_fixtures.py -- generate the zip test fixtures shipped on the ramdisk.  Two small ZIP archives, built with the host's standard zipfile so the in-OS extractor is tested against bytes produced by a reference implementation, not just by its own writer:  host.zip    a well-formed archive with a directory and two files, proving the in-OS extractor interops with host-produced ZIPs.  hostile.zip an archive whose entry names try to escape the extraction root: a traversal (\"../escape.txt\"), an absolute path (\"/abs.txt\") and a directory marker (\"dir/\") beside one plain file.  The in-OS extractor must create only good.txt, dir/ and abs.txt (the absolute name is sanitized to relative) and must never create escape.txt.  Timestamps are fixed so the build is reproducible.", "id": "tools/gen_zip_fixtures.py", "kind": "module", "label": "gen_zip_fixtures.py", "language": "py", "sha256": "d9443f8f14b7f4a9", "symbol_count": 2, "symbols": [{"doc": "entries: list of (name, data_or_None).  data None marks a directory.", "kind": "function", "line": 28, "name": "write_zip", "signature": "def write_zip(path, entries)"}, {"kind": "function", "line": 42, "name": "main", "signature": "def main()"}]}, {"id": "tools/install.sh", "kind": "module", "label": "install.sh", "language": "sh", "sha256": "7aece79ca12e8871", "symbol_count": 0, "symbols": []}, {"doc": "kernel_feature_survey.py - verify which C features the MiniOS kernel needs.  Scans kernel and ring-3 sources for constructs miniGCC must support before it can compile them: function pointers, extended-asm constraints, wide calls, unions, long long, bitfields, privileged mnemonics and section attributes. Every claim the SDD specs make about a gap must reproduce through this tool first, so plans never rest on hallucinated file paths.  Usage: kernel_feature_survey.py [root] [--format text|md] Exit 0 always; findings print to stdout.", "id": "tools/kernel_feature_survey.py", "kind": "module", "label": "kernel_feature_survey.py", "language": "py", "sha256": "ab8258449ccd456f", "symbol_count": 8, "symbols": [{"doc": "Centralized tunables for the survey.", "kind": "class", "line": 18, "name": "SurveyConfig", "signature": "class SurveyConfig"}, {"doc": "Yield C source paths under root, skipping vendored and cache dirs.", "kind": "function", "line": 34, "name": "iter_sources", "signature": "def iter_sources(root)"}, {"doc": "Return line numbers declaring function pointers.", "kind": "function", "line": 43, "name": "find_fnptr_hits", "signature": "def find_fnptr_hits(path, text)"}, {"doc": "Return sorted constraint letters used in extended asm.", "kind": "function", "line": 49, "name": "find_asm_constraints", "signature": "def find_asm_constraints(path, text)"}, {"doc": "Count parameters, treating void and empty as zero.", "kind": "function", "line": 59, "name": "count_params", "signature": "def count_params(params)"}, {"doc": "Collect findings per category across all sources.", "kind": "function", "line": 67, "name": "survey", "signature": "def survey(root)"}, {"doc": "Render findings as plain text.", "kind": "function", "line": 103, "name": "render_text", "signature": "def render_text(findings)"}, {"doc": "Entry point for the survey tool.", "kind": "function", "line": 122, "name": "main", "signature": "def main(argv)"}]}, {"doc": "Docstring: Scoped Lisp validation for the MiniOS interpreter contract. Builds the ring-3 static ELF with zero warnings, runs the host suite, and asserts each scoped mutant dies. Fails closed on first gap.", "id": "tools/lisp_scoped.sh", "kind": "module", "label": "lisp_scoped.sh", "language": "sh", "sha256": "da665676531f65ab", "symbol_count": 5, "symbols": [{"kind": "function", "line": 8, "name": "say"}, {"kind": "function", "line": 9, "name": "die"}, {"kind": "function", "line": 20, "name": "mutant"}, {"kind": "function", "line": 41, "name": "lisp_mut"}, {"kind": "function", "line": 63, "name": "mut_usage"}]}, {"doc": "Build the MiniOS bootable USB image and optionally write it to a device.  Wraps the Makefile targets so there is a single source of truth for the layout (os.usb.img), the distribution copy (os.iso) and the write safety checks (make usb): this script only orchestrates, it never writes bytes itself.  Usage: tools/make_usb.sh [--list] [--device /dev/sdX] [--yes] [--vdi]  With no arguments and a terminal on stdin, runs an interactive wizard that asks for every needed value step by step and ends with a bootable USB stick. With no arguments and no terminal (pipe, CI), builds the image, lists candidate devices and exits without writing anything.  Inputs: --list            print candidate target devices and exit. --device DEV      write the image to DEV after building it. --yes             answer the Makefile YES confirmation non-interactively. System-disk and size refusals still apply, they are never skipped. --vdi             also build os.vdi for VirtualBox (hard disk attach). --help            print this help and exit. USB=/dev/sdX      environment fallback for --device.  Outputs: os.usb.img, os.iso (and os.vdi with --vdi) in the repository root.  Failure modes:", "id": "tools/make_usb.sh", "kind": "module", "label": "make_usb.sh", "language": "sh", "sha256": "efa46cf209467b3e", "symbol_count": 2, "symbols": [{"kind": "function", "line": 40, "name": "usage"}, {"kind": "function", "line": 56, "name": "wizard"}]}, {"doc": "minifs_dump.py - Dump/inspect a MiniFS filesystem image.", "id": "tools/minifs_dump.py", "kind": "module", "label": "minifs_dump.py", "language": "py", "sha256": "1d302e0e3ec5e405", "symbol_count": 12, "symbols": [{"kind": "function", "line": 13, "name": "u16", "signature": "def u16(d, o)"}, {"kind": "function", "line": 14, "name": "u32", "signature": "def u32(d, o)"}, {"kind": "function", "line": 16, "name": "mode_str", "signature": "def mode_str(m)"}, {"kind": "class", "line": 25, "name": "FS", "signature": "class FS"}, {"kind": "function", "line": 105, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 26, "name": "__init__", "signature": "def __init__(self, fn)"}, {"kind": "method", "line": 29, "name": "blk", "signature": "def blk(self, n)"}, {"kind": "method", "line": 30, "name": "_sb", "signature": "def _sb(self)"}, {"kind": "method", "line": 38, "name": "inode", "signature": "def inode(self, i)"}, {"kind": "method", "line": 47, "name": "read", "signature": "def read(self, ino)"}, {"kind": "method", "line": 67, "name": "resolve", "signature": "def resolve(self, path)"}, {"kind": "method", "line": 86, "name": "ls", "signature": "def ls(self, ino, prefix)"}]}, {"doc": "minifs_fsck.py - Check MiniFS filesystem consistency.", "id": "tools/minifs_fsck.py", "kind": "module", "label": "minifs_fsck.py", "language": "py", "sha256": "f72e838a1beb8c25", "symbol_count": 19, "symbols": [{"kind": "function", "line": 13, "name": "u16", "signature": "def u16(d, o)"}, {"kind": "function", "line": 14, "name": "u32", "signature": "def u32(d, o)"}, {"kind": "function", "line": 15, "name": "crc32", "signature": "def crc32(data)"}, {"kind": "class", "line": 23, "name": "FSCK", "signature": "class FSCK"}, {"kind": "function", "line": 173, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 24, "name": "__init__", "signature": "def __init__(self, fn)"}, {"kind": "method", "line": 31, "name": "_find_base", "signature": "def _find_base(self)"}, {"kind": "method", "line": 49, "name": "blk", "signature": "def blk(self, n)"}, {"kind": "method", "line": 52, "name": "_sb", "signature": "def _sb(self)"}, {"kind": "method", "line": 58, "name": "inode", "signature": "def inode(self, i)"}, {"kind": "method", "line": 65, "name": "inode_crc_ok", "signature": "def inode_crc_ok(self, i)"}, {"kind": "method", "line": 71, "name": "read", "signature": "def read(self, ino)"}, {"kind": "method", "line": 86, "name": "err", "signature": "def err(self, msg)"}, {"kind": "method", "line": 88, "name": "mark_block", "signature": "def mark_block(self, n)"}, {"kind": "method", "line": 93, "name": "scan_inode", "signature": "def scan_inode(self, i)"}, {"kind": "method", "line": 105, "name": "scan_dir", "signature": "def scan_dir(self, ino)"}, {"doc": "Clear bits among the first count bits of the bitmap at block start.", "kind": "method", "line": 137, "name": "bitmap_free", "signature": "def bitmap_free(self, start, count)"}, {"doc": "The superblock free counters must match the bitmaps, or every\nfree-space report (and the kernel's own decrement) starts wrong.", "kind": "method", "line": 146, "name": "check_counters", "signature": "def check_counters(self)"}, {"kind": "method", "line": 161, "name": "run", "signature": "def run(self)"}]}, {"doc": "minifs_saves.py - preserve the guest's saves/ dir across image rebuilds.  Regenerating minifs.bin from scratch wipes everything the guest wrote at runtime (Pokemon battery .sav/.rtc and .state savestates live in saves/ on MiniFS). Before mkfs runs, this tool extracts the live saves/ tree out of the previous os.img into a staging dir; the Makefile then passes that dir back into mkfs, so a rebuild carries the saves forward instead of wiping them. Only doom maps and Pokemon saves persist (PERSIST_SUFFIXES); minicraft chunks are skipped with a log line, never packed.  Usage: minifs_saves.py backup <os.img|minifs.bin> <stagedir>  The saves land in <stagedir>/saves/... (nothing is created when the image is missing or carries no saves/ dir). Guest files are written raw by minifs_write, never compressed, so extraction is byte-exact; a file found with the compressed flag set or with double-indirect blocks (both outside what the guest write path produces) aborts with a nonzero exit instead of backing up corrupt data.", "id": "tools/minifs_saves.py", "kind": "module", "label": "minifs_saves.py", "language": "py", "sha256": "bcfd1199c5fc036a", "symbol_count": 21, "symbols": [{"kind": "function", "line": 53, "name": "u16", "signature": "def u16(d, o)"}, {"kind": "function", "line": 57, "name": "u32", "signature": "def u32(d, o)"}, {"doc": "Random-access MiniFS partition inside a host file.", "kind": "class", "line": 61, "name": "Image", "signature": "class Image"}, {"kind": "class", "line": 85, "name": "FS", "signature": "class FS"}, {"kind": "function", "line": 216, "name": "valid_name", "signature": "def valid_name(nm)"}, {"kind": "function", "line": 224, "name": "strict_name", "signature": "def strict_name(nm)"}, {"doc": "Locate the MiniFS partition inside a host image file.\n\nReturns the byte offset of the partition, or None. Prefers the exact\nlayout the build produces (kernel at LBA 9, partition 2048-sector\naligned after it); falls back to a magic scan.", "kind": "function", "line": 233, "name": "find_partition_base", "signature": "def find_partition_base(fn)"}, {"kind": "function", "line": 271, "name": "cmd_backup", "signature": "def cmd_backup(img_path, stage)"}, {"kind": "function", "line": 343, "name": "main", "signature": "def main(argv)"}, {"kind": "method", "line": 64, "name": "__init__", "signature": "def __init__(self, fn, base)"}, {"kind": "method", "line": 72, "name": "close", "signature": "def close(self)"}, {"kind": "method", "line": 75, "name": "blk", "signature": "def blk(self, n)"}, {"kind": "method", "line": 86, "name": "__init__", "signature": "def __init__(self, img)"}, {"kind": "method", "line": 95, "name": "inode", "signature": "def inode(self, i)"}, {"kind": "method", "line": 110, "name": "is_dir", "signature": "def is_dir(self, st)"}, {"kind": "method", "line": 113, "name": "read_file", "signature": "def read_file(self, ino)"}, {"kind": "method", "line": 146, "name": "listdir", "signature": "def listdir(self, ino)"}, {"kind": "method", "line": 165, "name": "read_file_dir", "signature": "def read_file_dir(self, ino)"}, {"kind": "method", "line": 173, "name": "read_file_raw", "signature": "def read_file_raw(self, st)"}, {"kind": "method", "line": 197, "name": "resolve", "signature": "def resolve(self, path)"}, {"kind": "function", "line": 293, "name": "walk", "signature": "def walk(dir_ino, rel)"}]}, {"doc": "minios_cli.py — drive MiniOS through the MCP bridge, not by hand.  Starts mcp/minios_mcp.py (which owns the QEMU child and the serial console) over stdio JSON-RPC and executes a sequence of actions in one session, then powers the machine off. This is the hammer the minios skill wants: never boot QEMU by hand; every shell interaction goes through the bridge.  Usage: python3 tools/minios_cli.py ACTION [ARG] [ACTION [ARG] ...]  Actions: boot             boot the image, wait for the shell prompt status           {booted, pid, log_bytes} send LINE        send one shell line, wait for the next prompt, print output cat PATH         print a ramdisk file snapshot         print the unconsumed console tail expect MARKER    wait for a marker; print matched: true/false write PATH       send lines from stdin through minios_write poweroff         power off and assert QEMU exit  Example: python3 tools/minios_cli.py boot send \"help\" send \"ls etc/\" poweroff", "id": "tools/minios_cli.py", "kind": "module", "label": "minios_cli.py", "language": "py", "sha256": "9e740e4a986c5b9c", "symbol_count": 6, "symbols": [{"kind": "class", "line": 38, "name": "Client", "signature": "class Client"}, {"kind": "function", "line": 100, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 39, "name": "__init__", "signature": "def __init__(self)"}, {"kind": "method", "line": 56, "name": "request", "signature": "def request(self, method, params)"}, {"kind": "method", "line": 77, "name": "tool", "signature": "def tool(self, name, params)"}, {"kind": "method", "line": 87, "name": "close", "signature": "def close(self)"}]}, {"doc": "minios_gui.py — inject VGA-mode input and capture the framebuffer.  Boots MiniOS with the emulated std VGA device (the linear framebuffer the kernel's desktop renders into), a QMP socket to inject PS/2 mouse motion, clicks and keyboard, and a pty serial console to drive the shell. After each action it saves the current VGA framebuffer to a PNG via QMP `screendump`, so a desktop crash, a vanished mouse cursor or a corrupted window is visible without a physical display.  This is the tool for the VGA-mode bugs (mouse cursor vanishing, desktop crash after a ring-3 program): it triggers real input events in the VGA desktop and captures what the guest drew.  Usage: python3 tools/minios_gui.py [actions...]  Environment: MEM       guest RAM (default 1G, like boot_run.sh: the kernel heap alone ends at 384 MB, so a smaller guest never reaches the prompt) DISPLAY   X display for the SDL window (run under xvfb-run to stay headless)  Actions: send  LINE         send a shell line, wait for prompt mouse DX DY        inject relative mouse motion click              inject a left-button press+release key QCODE [up]     inject a keyboard key (qemu keycode, e.g. esc, return) dump NAME          screendump the VGA to $TMPDIR/gui_*/NAME.png sleep SECS         pause", "id": "tools/minios_gui.py", "kind": "module", "label": "minios_gui.py", "language": "py", "sha256": "7fe575e71fdbdbd3", "symbol_count": 9, "symbols": [{"kind": "function", "line": 50, "name": "read_serial", "signature": "def read_serial(master, timeout)"}, {"kind": "class", "line": 66, "name": "QMP", "signature": "class QMP"}, {"kind": "function", "line": 118, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 67, "name": "__init__", "signature": "def __init__(self, path)"}, {"kind": "method", "line": 79, "name": "cmd", "signature": "def cmd(self, obj)"}, {"kind": "method", "line": 83, "name": "_recv", "signature": "def _recv(self)"}, {"kind": "method", "line": 98, "name": "mouse", "signature": "def mouse(self, dx, dy, click)"}, {"kind": "method", "line": 108, "name": "key", "signature": "def key(self, qcode, up)"}, {"kind": "method", "line": 114, "name": "screendump", "signature": "def screendump(self, path)"}]}, {"doc": "minios_hyper.py -- host-side ring-minus-one debugger for MiniOS.  QEMU already runs in host root mode above the guest kernel, so this tool does not implement a hypervisor. It fuses the three introspection channels QEMU exposes into one console: the serial shell, the QMP control socket and the gdb remote stub. From the host it can drive shell commands, trace syscalls, snapshot the VGA framebuffer and peek guest memory without any guest cooperation beyond the existing builtins.  Purpose: debug the whole system (VGA desktop, syscalls, hangs) from the host where qemu runs, with reproducible scripted checks instead of eyeballs.  Usage: python3 tools/minios_hyper.py --selftest python3 tools/minios_hyper.py --boot --check vga_idle [--check vga_cursor] [--check gfx_frames] [--check pixel_oob] [--shell \"trace verbose\"] [--hold] python3 tools/minios_hyper.py --boot --interactive  Inputs: --boot runs os.img from the repository root with display none. --check names one scripted VGA/syscall probe; repeatable. --shell sends one extra guest line after boot. --selftest runs host-only unit vectors, no QEMU needed. --interactive drops into a tiny repl (help lists commands).  Outputs: PASS/FAIL lines on stdout plus screendump PNGs in a mkdtemp work dir.", "id": "tools/minios_hyper.py", "kind": "module", "label": "minios_hyper.py", "language": "py", "sha256": "2739b6dcf07b7d50", "symbol_count": 51, "symbols": [{"doc": "Central tunable set for the host debugger, no magic numbers elsewhere.", "kind": "class", "line": 50, "name": "HyperConfig", "signature": "class HyperConfig"}, {"doc": "Encode and decode gdb remote serial protocol packets.", "kind": "class", "line": 73, "name": "RspCodec", "signature": "class RspCodec"}, {"doc": "Minimal QMP client over a unix socket.", "kind": "class", "line": 96, "name": "QmpChannel", "signature": "class QmpChannel"}, {"doc": "Tiny gdb RSP client for QEMU -s, enough to read regs and memory.", "kind": "class", "line": 152, "name": "GdbChannel", "signature": "class GdbChannel"}, {"doc": "Owns the QEMU child plus its serial, QMP and gdb channels.", "kind": "class", "line": 211, "name": "Guest", "signature": "class Guest"}, {"doc": "Host-side pixel math over QMP screendumps.", "kind": "class", "line": 339, "name": "FrameDiff", "signature": "class FrameDiff"}, {"doc": "Scripted bug-hunting probes, each returns (ok, detail).", "kind": "class", "line": 409, "name": "HyperChecks", "signature": "class HyperChecks"}, {"doc": "Host-only vectors for the packet codec and pixel math, no QEMU.", "kind": "function", "line": 491, "name": "run_selftest", "signature": "def run_selftest()"}, {"doc": "Boot the guest and run the requested scripted checks.", "kind": "function", "line": 523, "name": "run_boot", "signature": "def run_boot(checks, extra_shell, interactive)"}, {"doc": "Tiny interactive loop joining shell, QMP and gdb reads.", "kind": "function", "line": 561, "name": "repl", "signature": "def repl(guest)"}, {"doc": "Parse argv and dispatch to selftest, boot checks or repl.", "kind": "function", "line": 591, "name": "main", "signature": "def main(argv)"}, {"doc": "Wrap raw payload bytes into a $...#cs frame.", "kind": "method", "line": 77, "name": "encode", "signature": "def encode(payload)"}, {"doc": "Extract payload from a $...#cs frame, empty bytes on malformed.", "kind": "method", "line": 85, "name": "decode", "signature": "def decode(frame)"}, {"kind": "method", "line": 99, "name": "__init__", "signature": "def __init__(self, path)"}, {"kind": "method", "line": 109, "name": "_roundtrip", "signature": "def _roundtrip(self, obj)"}, {"doc": "Send one QMP object and return the raw reply bytes.", "kind": "method", "line": 117, "name": "raw", "signature": "def raw(self, obj)"}, {"doc": "Ask QEMU to write the VGA frame to path.", "kind": "method", "line": 121, "name": "screendump", "signature": "def screendump(self, path)"}, {"doc": "Inject relative mouse motion.", "kind": "method", "line": 126, "name": "rel", "signature": "def rel(self, dx, dy)"}, {"doc": "Tap one qemu keycode down and up.", "kind": "method", "line": 132, "name": "key", "signature": "def key(self, qcode)"}, {"doc": "Query the VM run state.", "kind": "method", "line": 141, "name": "status", "signature": "def status(self)"}, {"kind": "method", "line": 145, "name": "close", "signature": "def close(self)"}, {"kind": "method", "line": 155, "name": "__init__", "signature": "def __init__(self, port)"}, {"kind": "method", "line": 162, "name": "_drain", "signature": "def _drain(self)"}, {"kind": "method", "line": 168, "name": "_cmd", "signature": "def _cmd(self, payload)"}, {"doc": "Return raw g-packet bytes, empty on failure.", "kind": "method", "line": 181, "name": "regs", "signature": "def regs(self)"}, {"doc": "Read length bytes at addr, None on failure or malformed reply.", "kind": "method", "line": 185, "name": "read_mem", "signature": "def read_mem(self, addr, length)"}, {"kind": "method", "line": 195, "name": "halt", "signature": "def halt(self)"}, {"kind": "method", "line": 201, "name": "cont", "signature": "def cont(self)"}, {"kind": "method", "line": 204, "name": "close", "signature": "def close(self)"}, {"kind": "method", "line": 214, "name": "__init__", "signature": "def __init__(self, with_gdb)"}, {"kind": "method", "line": 248, "name": "_ser", "signature": "def _ser(self)"}, {"kind": "method", "line": 260, "name": "_reader", "signature": "def _reader(self)"}, {"kind": "method", "line": 276, "name": "snapshot", "signature": "def snapshot(self)"}, {"kind": "method", "line": 280, "name": "wait_for", "signature": "def wait_for(self, marker, timeout)"}, {"kind": "method", "line": 288, "name": "send", "signature": "def send(self, line, settle)"}, {"kind": "method", "line": 298, "name": "qmp_chan", "signature": "def qmp_chan(self)"}, {"kind": "method", "line": 303, "name": "gdb_chan", "signature": "def gdb_chan(self)"}, {"kind": "method", "line": 308, "name": "dump", "signature": "def dump(self, name)"}, {"kind": "method", "line": 314, "name": "stop", "signature": "def stop(self)"}, {"doc": "Mean absolute grey difference above the taskbar strip.", "kind": "method", "line": 343, "name": "mean_diff", "signature": "def mean_diff(a_path, b_path)"}, {"doc": "Clustered arrow-template hit positions, static-safe.", "kind": "method", "line": 356, "name": "cursor_positions", "signature": "def cursor_positions(shot_path)"}, {"doc": "Clustered arrow-sprite count for one frame.", "kind": "method", "line": 394, "name": "count_cursors", "signature": "def count_cursors(shot_path)"}, {"doc": "Hits in after with no neighbour in before, the live pointer.", "kind": "method", "line": 399, "name": "moved_cursors", "signature": "def moved_cursors(before_path, after_path)"}, {"kind": "method", "line": 412, "name": "__init__", "signature": "def __init__(self, guest)"}, {"doc": "Two idle frames must match, no unsolicited redraw or flicker.", "kind": "method", "line": 415, "name": "vga_idle", "signature": "def vga_idle(self)"}, {"doc": "One live pointer must move, static template hits are ignored.", "kind": "method", "line": 427, "name": "vga_cursor", "signature": "def vga_cursor(self)"}, {"doc": "The composited-frame counter must climb across a real present.", "kind": "method", "line": 439, "name": "gfx_frames", "signature": "def gfx_frames(self)"}, {"doc": "Out-of-range pixel probes must diagnose, never wrap or crash.", "kind": "method", "line": 452, "name": "pixel_oob", "signature": "def pixel_oob(self)"}, {"doc": "Verbose trace must show a named syscall for a real program.", "kind": "method", "line": 465, "name": "sys_trace", "signature": "def sys_trace(self)"}, {"kind": "method", "line": 476, "name": "_last_frames", "signature": "def _last_frames(self)"}, {"kind": "function", "line": 495, "name": "check", "signature": "def check(ok, msg)"}]}, {"doc": "mkcpyzip.py -- pack a CPython Lib tree into a zipimport stdlib.  Usage: mkcpyzip.py <lib_dir> <out_zip> [skip_dir ...]  CPython's sys.path already names <prefix>/lib/python312.zip, so one stored (uncompressed) zip carries the whole pure-Python standard library onto MiniFS as a single inode, and zipimport needs no zlib module inside the guest for stored entries. Directories named in skip (typically test, idlelib, tkinter, ensurepip, venv) and every __pycache__ are pruned; compiled .py/.pyo files are not shipped (zipimport compiles on the fly).  Exit 0 with one summary line on success; a missing input or an empty result exits 1 with the reason on stderr.", "id": "tools/mkcpyzip.py", "kind": "module", "label": "mkcpyzip.py", "language": "py", "sha256": "1925d096e3fe7022", "symbol_count": 2, "symbols": [{"doc": "Write out_zip with the Lib tree minus skip dirs; return file count.", "kind": "function", "line": 22, "name": "build_zip", "signature": "def build_zip(lib_dir, out_zip, skip)"}, {"kind": "function", "line": 41, "name": "main", "signature": "def main()"}]}, {"doc": "mkfs.minifs.py - Create a MiniFS filesystem image for MiniOS.  Usage: python3 mkfs.minifs.py <output_file> <total_blocks> [files...] python3 mkfs.minifs.py minifs.bin 32768 python3 mkfs.minifs.py minifs.bin 32768 -d files/", "id": "tools/mkfs.minifs.py", "kind": "module", "label": "mkfs.minifs.py", "language": "py", "sha256": "77b014a37e6ff200", "symbol_count": 23, "symbols": [{"kind": "function", "line": 28, "name": "roundup4", "signature": "def roundup4(v)"}, {"kind": "function", "line": 31, "name": "div_round_up", "signature": "def div_round_up(n, d)"}, {"kind": "function", "line": 34, "name": "crc16", "signature": "def crc16(data)"}, {"kind": "function", "line": 42, "name": "crc32", "signature": "def crc32(data)"}, {"doc": "Clear bits among the first count bits of bitmap: the superblock free\ncounters must equal what the kernel allocator sees in the bitmaps.", "kind": "function", "line": 50, "name": "count_free", "signature": "def count_free(bitmap, count)"}, {"kind": "class", "line": 56, "name": "MiniFS", "signature": "class MiniFS"}, {"kind": "function", "line": 280, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 57, "name": "__init__", "signature": "def __init__(self, total_blocks)"}, {"kind": "method", "line": 80, "name": "mark_inodes_used", "signature": "def mark_inodes_used(self, start, count)"}, {"kind": "method", "line": 84, "name": "mark_blocks_used", "signature": "def mark_blocks_used(self, start, count)"}, {"kind": "method", "line": 88, "name": "alloc_inode", "signature": "def alloc_inode(self)"}, {"kind": "method", "line": 94, "name": "alloc_block", "signature": "def alloc_block(self)"}, {"kind": "method", "line": 100, "name": "create_root", "signature": "def create_root(self)"}, {"doc": "Store the inode checksum over its first 124 bytes; every\nmutation reseals, or the kernel rejects the inode on read.", "kind": "method", "line": 108, "name": "seal_inode", "signature": "def seal_inode(self, ino)"}, {"kind": "method", "line": 113, "name": "create_inode", "signature": "def create_inode(self, mode, links)"}, {"kind": "method", "line": 120, "name": "inode_set_size", "signature": "def inode_set_size(self, ino, size)"}, {"kind": "method", "line": 124, "name": "inode_set_block", "signature": "def inode_set_block(self, ino, logblk, phys)"}, {"kind": "method", "line": 154, "name": "add_dir_entry", "signature": "def add_dir_entry(self, dir_ino, name, child_ino, ftype)"}, {"doc": "Record name in parent_ino. Returns the inode of an existing\ndirectory when a directory of the same name is packed again (two\nsource trees merge, e.g. several etc/ roots); any other collision\nis a build error, never a duplicate entry that shadows a file.", "kind": "method", "line": 192, "name": "claim_name", "signature": "def claim_name(self, parent_ino, name, is_dir)"}, {"kind": "method", "line": 205, "name": "write_file", "signature": "def write_file(self, parent_ino, name, data)"}, {"kind": "method", "line": 224, "name": "write_dir", "signature": "def write_dir(self, parent_ino, name)"}, {"kind": "method", "line": 236, "name": "serialize", "signature": "def serialize(self)"}, {"kind": "function", "line": 310, "name": "pack_tree", "signature": "def pack_tree(parent_ino, path, rel)"}]}, {"doc": "Build baseq2/pak1.pak carrying the player model.  The Quake 2 shareware pak0.pak omits the player model (players/male/tris.md2, grunt.pcx, weapon.md2, grunt_i.pcx are loose files in the retail game).  The q2generic client must find them in a pak, so this script packages the loose player model (from the Quake 2 install, held under progs/quake2generic/players) into a small second pak the game loads after pak0.pak.  Quake 2 pak format: 4-byte \"PACK\", u32 directory offset, u32 directory length, then 64-byte directory entries (56-byte NUL-padded name, u32 filepos, u32 filelen), then the concatenated file data.", "id": "tools/mkpak1.py", "kind": "module", "label": "mkpak1.py", "language": "py", "sha256": "fab85fa41f389803", "symbol_count": 1, "symbols": [{"kind": "function", "line": 29, "name": "main", "signature": "def main()"}]}, {"doc": "Build a MiniOS ramdisk image from files in a directory tree.  Each packed file is named by its path relative to the shared parent of all inputs, so progs/src/cp.c ships as src/cp.c and directories are carried as slashes inside flat names. Names longer than NAME_MAX or two inputs mapping to the same name are hard errors: a silently truncated or overwritten name would make every later lookup miss.  Payloads are deflate compressed (a zlib stream, exactly what the kernel miniz mz_uncompress consumes). The kernel decompresses every entry once at boot into its working ramdisk area, so runtime reads and writes see plain bytes and lose no performance; only the on-disk/embedded image shrinks. A payload that does not compress (tiny or incompressible) is stored raw and flagged so.  Layout (little endian): u32 magic, u32 count count * { char name[RAMDISK_FNAME_LEN]; u32 raw_size; u32 stored_size; u32 data_offset; u32 flags } payload area (concatenated, offsets relative to its start) flags bit 0: stored_size bytes are a zlib stream, else raw.  The name slot width is RAMDISK_FNAME_LEN parsed from headers/kernel.h (the single source of truth): the kernel's RDFile table reads the same width, and a mismatch silently misaligns every entry; changing the constant there and rebuilding is the only way to move it.", "id": "tools/mkramdisk.py", "kind": "module", "label": "mkramdisk.py", "language": "py", "sha256": "41eb4066d7274871", "symbol_count": 3, "symbols": [{"doc": "Parse RAMDISK_FNAME_LEN from headers/kernel.h; fail closed.", "kind": "function", "line": 41, "name": "read_fname_bytes", "signature": "def read_fname_bytes(kernel_h_path)"}, {"kind": "function", "line": 64, "name": "pack_name", "signature": "def pack_name(path, common)"}, {"kind": "function", "line": 74, "name": "main", "signature": "def main()"}]}, {"doc": "mkroots.sh - regenerate tls_roots.h from the DER files in tls_roots_src/.  Provenance of each root (2026 web PKI reality; everything a real site chains to is one of these):  isrg_root_x1.der          Let's Encrypt ISRG Root X1 (RSA, older chains) https://letsencrypt.org/certs/isrg-root-x1.pem isrg_root_x2.der          Let's Encrypt ISRG Root X2 (ECDSA P-384, current) https://letsencrypt.org/certs/isrg-root-x2.pem digicert_global_root_g2.der  DigiCert Global Root G2 (RSA) https://cacerts.digicert.com/DigiCertGlobalRootG2.crt globalsign_root_r3.der    GlobalSign Root CA R3 (RSA) https://secure.globalsign.com/cacert/root-r3.crt gts_root_r4.der           Google Trust Services Root R4 (ECDSA P-384) https://pki.goog/repo/certs/gtsr4.pem sslcom_ecc_2022.der       SSL.com TLS ECC Root CA 2022 (Cloudflare ECC chains) sslcom_rsa_2022.der       SSL.com TLS RSA Root CA 2022 (Cloudflare RSA chains)  The two SSL.com roots have no stable public URL; they are extracted from the certificate chain example.com serves (openssl s_client -showcerts, ECDHE-ECDSA and ECDHE-RSA respectively). The build never runs this script: tls_roots.h is a committed input, regenerated only when the root set changes.", "id": "tools/mkroots.sh", "kind": "module", "label": "mkroots.sh", "language": "sh", "sha256": "8df4930446042f4c", "symbol_count": 0, "symbols": []}, {"doc": "Build progs/topogpt3/vocab.bin from the GPT-2 encoder.json.  Output format (little-endian, read by load_vocab in topogpt3.c): magic \"VOCB\", u32 token count, then per token: u16 byte length followed by the raw token bytes.  GPT-2 encoder keys are unicode strings using the bytes_to_unicode mapping, so each token is decoded back to raw bytes through the inverse map. Token 0-255 become the single bytes 0x00-0xFF.", "id": "tools/mkvocab.py", "kind": "module", "label": "mkvocab.py", "language": "py", "sha256": "f1cad1033ab3562b", "symbol_count": 2, "symbols": [{"doc": "Reversible byte to unicode map used by the GPT-2 encoder.", "kind": "function", "line": 18, "name": "bytes_to_unicode", "signature": "def bytes_to_unicode()"}, {"doc": "Convert encoder.json to the VOCB binary vocabulary.\n\nArgs:\n    encoder_path: Path to the GPT-2 encoder.json file.\n    vocab_path: Destination path for the vocab.bin file.", "kind": "function", "line": 35, "name": "main", "signature": "def main(encoder_path, vocab_path)"}]}, {"doc": "Mutation testing for MiniOS.  Each mutation is applied to the source in place, the disk image is rebuilt and the behavioural suite is run in fail-fast mode. A mutant that survives a full green suite exposes a gap that must be closed by adding a scenario, never by deleting the mutant.  The sources are backed up before the first mutation and restored on every exit path, including interrupts. A mutation whose expression matches nothing is reported as broken rather than surviving: `sed -i` exits zero when it changes nothing, which would otherwise rebuild pristine sources and look like a test gap.  Progress is persisted to a state file (default .mutate-state in the repo root, overridable with --state or MINIOS_MUTATE_STATE). A run therefore RESUMES where it left off: mutants already recorded are skipped, so a timed-out run can be picked up without re-running the finished ones. The state file is just a list of \"name outcome\" lines and can be edited by hand to re-target work.  Usage: mutate.sh                     full run, resuming from the first mutant not yet recorded in the state file mutate.sh --from NAME         force-run from the mutant NAME onward, ignoring recorded state for those mutants mutate.sh --match REGEX       only run mutants whose name matches REGEX mutate.sh --limit N           run at most N mutants this invocation mutate.sh --state FILE        use FILE as the progress file mutate.sh --reset             clear the state file and run the full suite", "id": "tools/mutate.sh", "kind": "module", "label": "mutate.sh", "language": "sh", "sha256": "f1a659c53db990a4", "symbol_count": 5, "symbols": [{"kind": "function", "line": 51, "name": "usage"}, {"kind": "function", "line": 137, "name": "restore_sources"}, {"kind": "function", "line": 144, "name": "cleanup"}, {"kind": "function", "line": 536, "name": "record"}, {"doc": "Locate a mutant by name.", "kind": "function", "line": 542, "name": "find_index"}]}, {"doc": "Docstring: VGA liveness probe during CPU-bound ring-3 compute. Boots os.img headless, runs a command, moves the PS/2 mouse through QMP mid-run and screendumps. A live guest repaints cursor and clock even while a ring-3 loop never blocks: consecutive dumps must differ. Usage: tools/probe_compute_vga.py \"<guest cmd>\" [settle_secs]", "id": "tools/probe_compute_vga.py", "kind": "module", "label": "probe_compute_vga.py", "language": "py", "sha256": "a98d896ad55e7d2b", "symbol_count": 6, "symbols": [{"kind": "function", "line": 22, "name": "main", "signature": "def main()"}, {"kind": "function", "line": 55, "name": "send", "signature": "def send(line)"}, {"kind": "function", "line": 61, "name": "poll", "signature": "def poll(timeout)"}, {"kind": "function", "line": 88, "name": "qmp", "signature": "def qmp(obj)"}, {"kind": "function", "line": 97, "name": "rel", "signature": "def rel(dx, dy)"}, {"kind": "function", "line": 104, "name": "dump", "signature": "def dump(name)"}]}, {"doc": "probe_minicraft.py -- numeric minicraft probe without any PNG.  Boots os.img headless (display none), runs minicraft in the background so the shell stays usable, and verifies rendering + movement purely through serial-observable numbers:  - `gfx frames` must climb (real compositing, like DOOM autoframes) - `wm list` gives the gfx window rect; `gfx rect` over the upper and lower content halves reports histograms (sky vs ground orientation) - QMP holds `w` for 2s, then the `P` key tap makes minicraft print `minicraft: pos X Y Z ... wood N`; X must have advanced vs before  No PIL, no screendump, no PNG: everything is parsed serial text.  Usage: python3 tools/probe_minicraft.py [--hold SECS]", "id": "tools/probe_minicraft.py", "kind": "module", "label": "probe_minicraft.py", "language": "py", "sha256": "41810ec91b432826", "symbol_count": 6, "symbols": [{"kind": "function", "line": 34, "name": "main", "signature": "def main()"}, {"kind": "function", "line": 68, "name": "send", "signature": "def send(line)"}, {"kind": "function", "line": 74, "name": "poll", "signature": "def poll(timeout)"}, {"kind": "function", "line": 85, "name": "grab", "signature": "def grab(pat, timeout)"}, {"kind": "function", "line": 143, "name": "qkey", "signature": "def qkey(qcode, down)"}, {"kind": "function", "line": 154, "name": "pos", "signature": "def pos(tag)"}]}, {"doc": "Minimal QEMU guest agent client for MiniOS.  Connects to the guest agent socket (a QEMU chardev mapped to the kernel's COM2 agent port), sends one QGA JSON request per line, and prints the JSON reply. Also drives the same protocol QEMU's own QMP guest-agent-command uses, because the framing is whitespace-delimited.  Usage: qga_client.py <command> [arguments_json] qga_client.py --sock <path> <command> [arguments_json]  Examples: qga_client.py guest-ping qga_client.py guest-exec '{\"path\":\"echo hi > /tmp/x\"}' qga_client.py guest-file-read '{\"handle\":0,\"count\":100}'  The socket path defaults to /tmp/minios-ga.sock and can be overridden with --sock or the MINIOS_GA_SOCK environment variable.", "id": "tools/qga_client.py", "kind": "module", "label": "qga_client.py", "language": "py", "sha256": "2208211af09491b5", "symbol_count": 4, "symbols": [{"kind": "function", "line": 33, "name": "send_command", "signature": "def send_command(sock, cmd, args)"}, {"doc": "Read one newline-terminated JSON object from the agent.", "kind": "function", "line": 41, "name": "read_reply", "signature": "def read_reply(sock, timeout)"}, {"kind": "function", "line": 57, "name": "connect", "signature": "def connect(path)"}, {"kind": "function", "line": 74, "name": "main", "signature": "def main(argv)"}]}, {"doc": "Quick standalone smoke test for the QEMU guest agent: boots os.img once with the agent socket chardev, waits for the shell prompt, drives qga_client.py against the socket, and asserts the replies. Exits nonzero on any failure.  This is the low-cost (single boot) check used during development; the full end-to-end coverage lives as a scenario in test_bdd.sh.  Env overrides: QEMU, IMAGE, MEM, TMO, MINIOS_GA_SOCK.", "id": "tools/qga_test.sh", "kind": "module", "label": "qga_test.sh", "language": "sh", "sha256": "9d23383e2e3b9f0f", "symbol_count": 3, "symbols": [{"kind": "function", "line": 25, "name": "cleanup"}, {"kind": "function", "line": 31, "name": "check"}, {"kind": "function", "line": 43, "name": "expect_in"}]}, {"doc": "repro_gui.py — reproduce the VGA/mouse state bug after ring-3 programs.  Boots MiniOS with a QMP socket (to inject PS/2 mouse motion into the guest) and a pty serial console (to drive the shell), then runs a sequence of shell commands and reports the mouse_state visible through `gfx` plus any kernel EXCEPTION dump on the serial line. This is how the GUI-only bug (mouse cursor vanishing / VGA crash after DOOM, SYS_SPAWN, etc.) is observed without a physical display: the kernel desktop tick runs on the guest framebuffer, and its failures surface on serial.  Usage: python3 tools/repro_gui.py send \"micropython src/test.py\" [send ...]", "id": "tools/repro_gui.py", "kind": "module", "label": "repro_gui.py", "language": "py", "sha256": "27982b2f23ea1537", "symbol_count": 10, "symbols": [{"kind": "function", "line": 30, "name": "read_serial", "signature": "def read_serial(master, timeout)"}, {"kind": "class", "line": 46, "name": "QMP", "signature": "class QMP"}, {"kind": "function", "line": 92, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 47, "name": "__init__", "signature": "def __init__(self, path)"}, {"kind": "method", "line": 59, "name": "cmd", "signature": "def cmd(self, obj)"}, {"kind": "method", "line": 63, "name": "_recv", "signature": "def _recv(self)"}, {"kind": "method", "line": 78, "name": "mouse", "signature": "def mouse(self, dx, dy, left)"}, {"kind": "method", "line": 87, "name": "key", "signature": "def key(self, qcode, down)"}, {"kind": "function", "line": 113, "name": "send", "signature": "def send(line)"}, {"kind": "function", "line": 118, "name": "mouse_state", "signature": "def mouse_state()"}]}, {"doc": "Sign MiniOS user binaries with Ed25519 (development key). . Usage: python3 tools/sign_elf.py [--check] [--key-id N] FILE [FILE ...] python3 tools/sign_elf.py [--check] [--key-id N] --walk DIR [DIR ...] . Inputs: ET_EXEC/ET_DYN ELF files. Other files are skipped, never modified. Outputs: the same files with a signature note carrying one key id byte plus the 64-byte signature, either patched into an existing PT_NOTE/SHT_NOTE slot or appended as a new non-allocated .note.minios.sign section. With --check nothing is written; unsigned or badly signed images are reported and the exit status is 1. . Failure modes: non-ELF input skips silently; truncated headers, missing section tables on images without a note slot, and unknown key ids fail loudly with a non-zero exit. Signing is idempotent: an image whose current bytes already verify under the requested key is left untouched, so rebuilds stay mtime-stable. . The development seed below is a published test key for dogfood builds only (docs/spec/kernel.md). Production images use key id 1 with a key file passed through MINIOS_SIGN_KEY.", "id": "tools/sign_elf.py", "kind": "module", "label": "sign_elf.py", "language": "py", "sha256": "89e0f288718677d3", "symbol_count": 23, "symbols": [{"doc": "Central configuration, no magic numbers outside this class.", "kind": "class", "line": 31, "name": "Config", "signature": "class Config"}, {"doc": "One-shot SHA-512.", "kind": "function", "line": 61, "name": "sha512", "signature": "def sha512(data)"}, {"doc": "Encode affine (x, y) to 32 bytes.", "kind": "function", "line": 66, "name": "encodepoint_raw", "signature": "def encodepoint_raw(x, y)"}, {"doc": "Add two extended points, all math mod field_p.", "kind": "function", "line": 71, "name": "edwards_add", "signature": "def edwards_add(p, q)"}, {"doc": "Multiply extended point p by scalar e.", "kind": "function", "line": 88, "name": "scalarmult", "signature": "def scalarmult(p, e)"}, {"doc": "Recompute the base point from y = 4/5.", "kind": "function", "line": 99, "name": "base_point", "signature": "def base_point()"}, {"doc": "Derive the 32-byte public key from a 32-byte seed.", "kind": "function", "line": 112, "name": "publickey", "signature": "def publickey(seed)"}, {"doc": "Sign a 64-byte canonical digest, returning 64 signature bytes.", "kind": "function", "line": 121, "name": "sign_digest", "signature": "def sign_digest(digest, seed)"}, {"doc": "Pad blob with zero bytes up to alignment.", "kind": "function", "line": 135, "name": "pad_to", "signature": "def pad_to(blob, alignment)"}, {"doc": "Unpack the ELF header, raising ValueError when truncated.", "kind": "function", "line": 143, "name": "parse_ehdr", "signature": "def parse_ehdr(data)"}, {"doc": "Unpack the program headers, raising ValueError when out of range.", "kind": "function", "line": 158, "name": "parse_phdrs", "signature": "def parse_phdrs(data, ehdr)"}, {"doc": "Build the kernel-agreed digest: entry plus PT_LOAD segments.\n\nFile bytes below 64 (the ELF header) are excluded from the\nsegment feeds while the entry stays bound as a value: appending\nthe signature section rewrites the section index there, and a\ndigest covering it would invalidate its own signature.", "kind": "function", "line": 172, "name": "canonical_digest", "signature": "def canonical_digest(data, ehdr, phdrs)"}, {"doc": "Locate patchable signature slots, returning file offsets of descs.", "kind": "function", "line": 199, "name": "find_note_slots", "signature": "def find_note_slots(data, ehdr, phdrs)"}, {"doc": "Locate the .note.minios.sign section descriptor, else -1.", "kind": "function", "line": 222, "name": "find_section_slot", "signature": "def find_section_slot(data, ehdr)"}, {"doc": "Append a .note.minios.sign section, returning the new image.", "kind": "function", "line": 257, "name": "append_section", "signature": "def append_section(data, ehdr, desc)"}, {"doc": "Resolve the trusted public key for checking without secrets.", "kind": "function", "line": 305, "name": "pub_for_key", "signature": "def pub_for_key(key_id)"}, {"doc": "Resolve the signing seed and public key for a key id.", "kind": "function", "line": 321, "name": "key_material", "signature": "def key_material(key_id)"}, {"doc": "Sign or verify one file, returning (action, detail).", "kind": "function", "line": 341, "name": "process", "signature": "def process(path, key_id, check_only)"}, {"doc": "Verify with PyNaCl when present, else the local fallback.", "kind": "function", "line": 395, "name": "verify_external", "signature": "def verify_external(sig, digest, pub)"}, {"doc": "Pure-python Ed25519 verify for hosts without PyNaCl.", "kind": "function", "line": 408, "name": "fallback_verify", "signature": "def fallback_verify(sig, digest, pub)"}, {"doc": "Decode a point encoding to extended coordinates.", "kind": "function", "line": 429, "name": "decode_point", "signature": "def decode_point(raw)"}, {"doc": "Compare extended points by cross-multiplied coordinates.", "kind": "function", "line": 447, "name": "points_equal", "signature": "def points_equal(p, q)"}, {"doc": "Drive signing or checking over files and directory walks.", "kind": "function", "line": 454, "name": "main", "signature": "def main(argv)"}]}, {"doc": "BDD suite for MiniOS: boots the disk image in QEMU and drives the shell over the serial console (COM1). Every scenario sends a script of shell commands, then asserts that the expected markers appear in the console log.  The guest powers itself off through the ACPI port at the end of each scenario, which makes QEMU exit; the timeout is only a safety net for hangs. A stale-qemu guard prevents image-lock cascades between runs.  Environment overrides: QEMU, TMO (per-scenario timeout), KEEP_LOG=1 to keep the console log of the last scenario for inspection.", "id": "tools/test_bdd.sh", "kind": "module", "label": "test_bdd.sh", "language": "sh", "sha256": "98ea9229e32bc12a", "symbol_count": 16, "symbols": [{"doc": "MATCH filter: skip scenarios whose name lacks the substring (and make the following expects no-ops so a skipped boot can't fail on a stale log).", "kind": "function", "line": 35, "name": "should_run"}, {"kind": "function", "line": 43, "name": "cleanup_stale_qemu"}, {"doc": "scenario <name> <script of shell commands> [timeout-seconds] The optional third argument overrides TMO for scenarios that boot the full interpreter several times (pip is slow under emulation).", "kind": "function", "line": 56, "name": "scenario"}, {"doc": "scenario_smp <name> <script> -- same as scenario but with -smp 2", "kind": "function", "line": 77, "name": "scenario_smp"}, {"doc": "expect <marker> The marker is a grep BRE pattern, not a literal: never write [...] in one (a \"[pid]\" matches one char of {p,i,d}, never the brackets).", "kind": "function", "line": 100, "name": "expect"}, {"doc": "expect_min <count> <marker>: the marker must appear at least that many times in the log. Used where the exact count depends on how much history the console holds (a scrollback view echoes the whole viewport, so the same line can show up once per page).", "kind": "function", "line": 123, "name": "expect_min"}, {"doc": "expect_count <count> <marker>: the marker must appear exactly that many times in the log. Used where a single occurrence would also match the echoed command line, so only the output can prove the behaviour.", "kind": "function", "line": 148, "name": "expect_count"}, {"doc": "refute <marker>: the marker must NOT appear (suppressed hostile content).", "kind": "function", "line": 171, "name": "refute"}, {"kind": "function", "line": 196, "name": "scenario_uefi"}, {"doc": "A FAT32 data stick on xHCI becomes the block backend and reads through BOT: partition discovery, directory listing and file bytes all come off USB. The stick image is built on demand with the host tools (sfdisk, mkfs.vfat, mcopy) and the scenario skips cleanly when they are absent (same doctrine as the QEMU-absent and OVMF skips).", "kind": "function", "line": 672, "name": "usb_stick_ready"}, {"kind": "function", "line": 1487, "name": "http_server_start"}, {"kind": "function", "line": 1494, "name": "http_server_stop"}, {"kind": "function", "line": 1499, "name": "http_fixture_start"}, {"kind": "function", "line": 1506, "name": "http_fixture_stop"}, {"kind": "function", "line": 1511, "name": "net_fixture_start"}, {"kind": "function", "line": 1518, "name": "net_fixture_stop"}]}, {"doc": "test_call_align.py - verify stack alignment at call sites, both parities.  Compiles a probe with miniGCC whose callees read %rsp in their body and report rsp & 15. A System V callee entered with a correct call sequence sees (entry_rsp - 8 - frame) where frame is a multiple of 16, so the reported value is always 8 regardless of arity. An inverted spill pad or a missing align dance shows up as 0. No gcc reference is needed: the assertion is the ABI constant itself, which makes this probe immune to the host compiler's frame choices.  Covers 6-arg (no spill, even), 7-arg (spill, odd) and 8-arg (spill, even) callees through direct and indirect calls.  Usage: test_call_align.py [--minigcc DIR] [--keep] Exit 0 when every probe reports 0.", "id": "tools/test_call_align.py", "kind": "module", "label": "test_call_align.py", "language": "py", "sha256": "2e27702719e9b7e3", "symbol_count": 4, "symbols": [{"doc": "Centralized tunables for the alignment probe.", "kind": "class", "line": 24, "name": "AlignConfig", "signature": "class AlignConfig"}, {"doc": "Locate the miniGCC checkout without host assumptions.", "kind": "function", "line": 59, "name": "find_minigcc", "signature": "def find_minigcc(explicit)"}, {"doc": "Run a subprocess, returning CompletedProcess.", "kind": "function", "line": 74, "name": "run", "signature": "def run(argv)"}, {"doc": "Build the probe with miniGCC and assert every report is eight.", "kind": "function", "line": 79, "name": "main", "signature": "def main(argv)"}]}, {"doc": "test_codecs.sh -- exercise the lzss/lz4/aes command-pair tools inside the OS.  The interpreter in-OS suites (test.lua / test.py) cannot run these ET_EXEC tools: SYS_SPAWN of an ET_EXEC child from inside an interpreter must save the parent's user window, which cannot fit the heap (a pre-existing limitation), so minios.run() returns nil and those tests report FAIL.  The shell CAN run ET_EXEC binaries, so this harness drives the real compress/decompress and encrypt/decrypt roundtrips through the serial console instead.  Usage: tools/test_codecs.sh  Exits 0 when every roundtrip checks out, 1 otherwise.", "id": "tools/test_codecs.sh", "kind": "module", "label": "test_codecs.sh", "language": "sh", "sha256": "51a06fec11138cfa", "symbol_count": 0, "symbols": []}, {"doc": "test_gui_fashion.py -- GUI proof for the cursor/flicker/quit fixes.  Boots the real image and judges pixels over QMP screendumps:  1. `run file &` (bg): two dumps 3s apart with zero input must be identical above the taskbar (single cursor owner: no trails, no present-vs-tick flicker). 2. Jiggle the mouse across the window, then idle: frames converge again (no stranded cursor sprites on hitboxes). 3. `run file` (fg) + QMP ESC: the shell prompt returns (ESC quit, no title-bar X needed). 4. `wm state` reports the active theme (`wm: theme dark`).  Fails loudly (exit 1) with the mean-abs-diff numbers. Dumps stay in the printed work dir for eyeballing.", "id": "tools/test_gui_fashion.py", "kind": "module", "label": "test_gui_fashion.py", "language": "py", "sha256": "96fd238e74f641d4", "symbol_count": 18, "symbols": [{"kind": "function", "line": 39, "name": "note", "signature": "def note(ok, msg)"}, {"kind": "class", "line": 45, "name": "Guest", "signature": "class Guest"}, {"kind": "function", "line": 190, "name": "meandiff", "signature": "def meandiff(a_path, b_path)"}, {"doc": "Cursor sprites by template: every arrow-white pixel near-white,\nand at least half the arrow-black pixels non-white (rejects text).\nA single owner paints exactly 1; a cursor race strands 2+.", "kind": "function", "line": 206, "name": "count_arrows", "signature": "def count_arrows(shot_path)"}, {"kind": "function", "line": 239, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 46, "name": "__init__", "signature": "def __init__(self)"}, {"kind": "method", "line": 70, "name": "_ser", "signature": "def _ser(self)"}, {"kind": "method", "line": 82, "name": "_reader", "signature": "def _reader(self)"}, {"kind": "method", "line": 98, "name": "snapshot", "signature": "def snapshot(self)"}, {"kind": "method", "line": 102, "name": "wait_prompt", "signature": "def wait_prompt(self, timeout)"}, {"kind": "method", "line": 110, "name": "wait_for", "signature": "def wait_for(self, marker, timeout)"}, {"kind": "method", "line": 118, "name": "send", "signature": "def send(self, line, settle)"}, {"kind": "method", "line": 128, "name": "qmp_cmd", "signature": "def qmp_cmd(self, obj)"}, {"kind": "method", "line": 141, "name": "_qmp", "signature": "def _qmp(self, obj)"}, {"kind": "method", "line": 149, "name": "key", "signature": "def key(self, qcode, down, up)"}, {"kind": "method", "line": 161, "name": "rel", "signature": "def rel(self, dx, dy)"}, {"kind": "method", "line": 168, "name": "dump", "signature": "def dump(self, name)"}, {"kind": "method", "line": 175, "name": "stop", "signature": "def stop(self)"}]}, {"doc": "test_gui_freedom.py -- GUI proof that freedom-gui takes real input.  The BDD scenario proves the full FreeDom GUI presents a frame; it cannot prove that keys, chords, the clipboard and the mouse reach the browser through the MiniOS platform layer (progs/freedomui/platform_minios.c and ps2_keymap.c, docs/spec/network.md). This boots the real image headless (-display none), drives the shell over a unix-socket serial, injects PS/2 through QMP and judges pixels with PIL plus the kernel clipboard:  0. foreground run, the way a user (or the dock) starts it: the pointer parks on the wallpaper, bare `freedom-gui` runs as a process (process note), then the pointer moves over the idle browser -> the arrow follows (the desktop tick moves it while the app presents nothing) -> no dead arrow stays where it was parked serial Ctrl+C                          -> `exit code: 130`, prompt back 1. `clip abc`, then `run freedom-gui &` until `freedom: frame ok` 2. type `x` into the focused URL bar      -> URL bar pixels change 3. Ctrl+V pastes the kernel clipboard     -> bar holds `xabc` Ctrl+C copies the bar back             -> `clip` prints `xabc` 4. click the toolbar menu button          -> the menu panel paints  Usage: python3 tools/test_gui_freedom.py  Inputs: os.img in the repository root (built with freedom-gui on MiniFS). Outputs: PASS/FAIL lines, the work dir with every dump, exit 0 when all", "id": "tools/test_gui_freedom.py", "kind": "module", "label": "test_gui_freedom.py", "language": "py", "sha256": "36ffcddda0e61d1a", "symbol_count": 30, "symbols": [{"doc": "Every tunable of the proof in one place.", "kind": "class", "line": 45, "name": "Config", "signature": "class Config"}, {"doc": "Print one PASS/FAIL line and remember failures.", "kind": "function", "line": 98, "name": "note", "signature": "def note(ok, msg)"}, {"doc": "QEMU guest with a unix-socket serial console and a QMP socket.", "kind": "class", "line": 105, "name": "Guest", "signature": "class Guest"}, {"doc": "Mean absolute luminance difference of one region of two dumps.", "kind": "function", "line": 256, "name": "region_diff", "signature": "def region_diff(a_path, b_path, box)"}, {"doc": "Parse `wm list` for the gfx window's content origin (cx, cy).", "kind": "function", "line": 264, "name": "content_origin", "signature": "def content_origin(listing)"}, {"doc": "Pixels of one region that differ between two dumps.", "kind": "function", "line": 273, "name": "changed_pixels", "signature": "def changed_pixels(a_path, b_path, box)"}, {"doc": "Square region of Config.POINTER_BOX pixels from a pointer's tip.", "kind": "function", "line": 283, "name": "around", "signature": "def around(point)"}, {"doc": "Move the pointer by a screen-pixel delta in MOUSE_STEPS slices.", "kind": "function", "line": 289, "name": "walk", "signature": "def walk(g, delta)"}, {"doc": "Bare `freedom-gui` in the foreground with the pointer in use: the\narrow follows over the idle window, leaves no dead sprite on the\nwallpaper, and serial Ctrl+C ends the run with the prompt back. The\npointer ends at the screen centre, where move_to expects it.", "kind": "function", "line": 300, "name": "foreground_phase", "signature": "def foreground_phase(g)"}, {"kind": "function", "line": 332, "name": "screen_box", "signature": "def screen_box(origin, box)"}, {"doc": "Walk the pointer from the screen centre (where it starts) to target.", "kind": "function", "line": 337, "name": "move_to", "signature": "def move_to(g, frame_size, target)"}, {"doc": "Walk by an fb delta from a tracked position, then update the tracker.", "kind": "function", "line": 343, "name": "fb_move", "signature": "def fb_move(g, pos, target)"}, {"kind": "function", "line": 350, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 108, "name": "__init__", "signature": "def __init__(self, work)"}, {"kind": "method", "line": 132, "name": "_connect", "signature": "def _connect(self, path)"}, {"kind": "method", "line": 141, "name": "_serial", "signature": "def _serial(self)"}, {"kind": "method", "line": 146, "name": "_reader", "signature": "def _reader(self)"}, {"kind": "method", "line": 157, "name": "snapshot", "signature": "def snapshot(self)"}, {"doc": "Wait for text in the console output past offset `since`.", "kind": "method", "line": 161, "name": "wait_for", "signature": "def wait_for(self, text, timeout, since)"}, {"doc": "Pace bytes so the 16-byte UART FIFO never drops a line head.", "kind": "method", "line": 170, "name": "send", "signature": "def send(self, line, settle)"}, {"kind": "method", "line": 181, "name": "qmp_cmd", "signature": "def qmp_cmd(self, obj)"}, {"kind": "method", "line": 188, "name": "_qmp", "signature": "def _qmp(self, obj)"}, {"doc": "events: list of (qcode, down) pairs sent in one batch each.", "kind": "method", "line": 196, "name": "keys", "signature": "def keys(self, events)"}, {"kind": "method", "line": 204, "name": "tap", "signature": "def tap(self, qcode)"}, {"kind": "method", "line": 207, "name": "chord", "signature": "def chord(self, mod, qcode)"}, {"kind": "method", "line": 210, "name": "rel", "signature": "def rel(self, dx, dy)"}, {"kind": "method", "line": 215, "name": "button", "signature": "def button(self, down)"}, {"doc": "One wheel tick; qemu maps the button pair to the PS/2 z axis.", "kind": "method", "line": 221, "name": "wheel", "signature": "def wheel(self, up)"}, {"kind": "method", "line": 231, "name": "dump", "signature": "def dump(self, name)"}, {"kind": "method", "line": 237, "name": "stop", "signature": "def stop(self)"}]}, {"doc": "test_gui_gfxview.py -- pixel + serial proof of the graphics view contract.  Purpose Proves that the tiling WM governs graphics apps (headers/wm_gfxview.h, kernel/vga_fb.c): DOOM starts in true fullscreen (scaled to the whole display, aspect kept, taskbar hidden), Alt+Enter returns it to a floating window, `wm tile` places it in a layout cell scaled to fit beside the terminal, `wm minimize` hides it to the taskbar while it keeps running, `wm focus 2` restores it, and the title-bar close request still ends it with exit code 130.  Usage python3 tools/test_gui_gfxview.py Needs qemu-system-x86_64, Pillow and a built os.img (make).  Inputs os.img next to tools/, driven through the Guest harness of tools/test_gui_wm.py (QMP screendumps, unix-socket serial console).  Outputs PASS/FAIL lines per assertion, then GFXVIEW OK (exit 0) or GFXVIEW FAIL (exit 1). Screendumps land in the harness temp dir.  Failure modes No boot prompt, DOOM never composites, a `wm list` view that does not match the requested mode, or pixels that contradict it (a fullscreen frame that still shows the taskbar row, a floating frame that shows no desktop around the window).", "id": "tools/test_gui_gfxview.py", "kind": "module", "label": "test_gui_gfxview.py", "language": "py", "sha256": "e648103ceab050f9", "symbol_count": 7, "symbols": [{"doc": "Every tunable of the run in one place.", "kind": "class", "line": 39, "name": "Config", "signature": "class Config"}, {"doc": "Record one assertion.", "kind": "function", "line": 55, "name": "note", "signature": "def note(ok, msg)"}, {"doc": "Last serial line starting with prefix, or an empty string.", "kind": "function", "line": 62, "name": "last_line", "signature": "def last_line(g, prefix)"}, {"doc": "Fresh `win gfx` line from `wm list` as a dict of key=value fields.", "kind": "function", "line": 72, "name": "gfx_row", "signature": "def gfx_row(g)"}, {"doc": "Fraction of near-black pixels inside box (x0, y0, x1, y1).", "kind": "function", "line": 84, "name": "dark_share", "signature": "def dark_share(img, box)"}, {"doc": "Poll `gfx frames` until the counter reaches want.", "kind": "function", "line": 94, "name": "wait_frames", "signature": "def wait_frames(g, want)"}, {"kind": "function", "line": 109, "name": "main", "signature": "def main()"}]}, {"doc": "test_gui_icon_cwd.py -- GUI proof that dock launches ignore shell cwd.  Boots the real image, `cd cvm` over serial (the exact trap from the bug report: `+set basedir .` resolving against the shell cwd), then clicks the Quake 2 dock icon with a real relative-mouse walk. The icon target is found by template-matching progs/icons/quake2.png in the dock strip of a screendump, so no layout math can drift.  PASS: serial shows the engine loading (ref_soft / Map:) with no `colormap.pcx` error. FAIL: the old `Couldn't load pics/colormap.pcx`. Dumps stay in the printed work dir for eyeballing.", "id": "tools/test_gui_icon_cwd.py", "kind": "module", "label": "test_gui_icon_cwd.py", "language": "py", "sha256": "effabe978b237a17", "symbol_count": 17, "symbols": [{"kind": "function", "line": 36, "name": "note", "signature": "def note(ok, msg)"}, {"kind": "class", "line": 42, "name": "Guest", "signature": "class Guest"}, {"doc": "Center of the dock icon: global best template match, strict bar.", "kind": "function", "line": 180, "name": "find_icon", "signature": "def find_icon(shot_path, icon_path)"}, {"doc": "Relative walk from screen center (guest 2px per host unit).", "kind": "function", "line": 213, "name": "walk", "signature": "def walk(g, tx, ty, fw, fh)"}, {"kind": "function", "line": 228, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 43, "name": "__init__", "signature": "def __init__(self)"}, {"kind": "method", "line": 67, "name": "_ser", "signature": "def _ser(self)"}, {"kind": "method", "line": 79, "name": "_reader", "signature": "def _reader(self)"}, {"kind": "method", "line": 95, "name": "snapshot", "signature": "def snapshot(self)"}, {"kind": "method", "line": 99, "name": "wait_prompt", "signature": "def wait_prompt(self, timeout)"}, {"kind": "method", "line": 107, "name": "send", "signature": "def send(self, line, settle)"}, {"kind": "method", "line": 117, "name": "qmp_cmd", "signature": "def qmp_cmd(self, obj)"}, {"kind": "method", "line": 130, "name": "_qmp", "signature": "def _qmp(self, obj)"}, {"kind": "method", "line": 138, "name": "rel", "signature": "def rel(self, dx, dy)"}, {"kind": "method", "line": 145, "name": "click", "signature": "def click(self)"}, {"kind": "method", "line": 155, "name": "dump", "signature": "def dump(self, name)"}, {"kind": "method", "line": 162, "name": "stop", "signature": "def stop(self)"}]}, {"doc": "test_gui_menu.py -- serial proof that the minicraft pause menu works.  ESC must open the pause menu even when QMP delivers down+up inside one guest frame (the old esc_prev edge dropped those); navigating to CREEPS and pressing right must print \"creeps 4\" via mobs_sync; ESC, up-wrap to QUIT and Enter must return to the shell prompt.  Usage: python3 tools/test_gui_menu.py Exits 0 printing MENU OK, 1 otherwise.", "id": "tools/test_gui_menu.py", "kind": "module", "label": "test_gui_menu.py", "language": "py", "sha256": "be79b64b2588cbe7", "symbol_count": 1, "symbols": [{"kind": "function", "line": 20, "name": "main", "signature": "def main()"}]}, {"doc": "test_gui_wm.py -- GUI proof that graphics windows survive the WM.  Serial `wm` commands call the same functions as the real paths, but they cannot prove what the user sees: a program blocked in read (vedit) stops compositing, so any desktop redraw used to bury it until the next keypress. This boots the real image headless (-display none), drives the shell over stdio pipes, injects PS/2 through QMP and judges pixels with PIL. Work dir (sockets, dumps) is a mkdtemp, printed at start for eyeballing.  1. split terminals, run vedit (foreground, shell blocked) 2. Alt+Tab -> vedit still painted (was: wiped until next key) 3. Super+Tab -> vedit still painted after tiling 4. quit, run vedit in background, click its taskbar button -> serial `wm state` reports focus 2 (the buried app comes back)  Fails loudly (exit 1) with the mean-abs-diff numbers. Dumps stay in the printed work dir for eyeballing.", "id": "tools/test_gui_wm.py", "kind": "module", "label": "test_gui_wm.py", "language": "py", "sha256": "b005c8de0ab360df", "symbol_count": 17, "symbols": [{"kind": "function", "line": 40, "name": "note", "signature": "def note(ok, msg)"}, {"kind": "class", "line": 46, "name": "Guest", "signature": "class Guest"}, {"kind": "function", "line": 204, "name": "meandiff", "signature": "def meandiff(a_path, b_path)"}, {"kind": "function", "line": 214, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 47, "name": "__init__", "signature": "def __init__(self)"}, {"kind": "method", "line": 75, "name": "_ser", "signature": "def _ser(self)"}, {"kind": "method", "line": 87, "name": "_reader", "signature": "def _reader(self)"}, {"kind": "method", "line": 103, "name": "snapshot", "signature": "def snapshot(self)"}, {"kind": "method", "line": 107, "name": "wait_prompt", "signature": "def wait_prompt(self, timeout)"}, {"kind": "method", "line": 115, "name": "send", "signature": "def send(self, line, settle)"}, {"kind": "method", "line": 130, "name": "qmp_cmd", "signature": "def qmp_cmd(self, obj)"}, {"kind": "method", "line": 143, "name": "_qmp", "signature": "def _qmp(self, obj)"}, {"kind": "method", "line": 151, "name": "key", "signature": "def key(self, qcode, down, up)"}, {"kind": "method", "line": 163, "name": "rel", "signature": "def rel(self, dx, dy)"}, {"kind": "method", "line": 170, "name": "btn", "signature": "def btn(self, down)"}, {"kind": "method", "line": 176, "name": "dump", "signature": "def dump(self, name)"}, {"kind": "method", "line": 183, "name": "stop", "signature": "def stop(self)"}]}, {"doc": "test_gui_zoom.py -- pixel proof that GFX_ZOOM doubles the game window.  Boots MiniOS headless (display none, QMP screendump), runs minicraft in the foreground with a fresh seed, dumps the 1:1 window, presses F11, dumps again and diffs the two frames. A working 2x zoom changes a ~648x416 bounding box; a dead toggle only moves pigs/the clock.  Usage: python3 tools/test_gui_zoom.py Exits 0 printing ZOOM OK, 1 otherwise.", "id": "tools/test_gui_zoom.py", "kind": "module", "label": "test_gui_zoom.py", "language": "py", "sha256": "728553efd9afbfc4", "symbol_count": 1, "symbols": [{"kind": "function", "line": 22, "name": "main", "signature": "def main()"}]}, {"doc": "Host-side HTTP fixture for the freedom BDD scenarios.  Serves behaviours that python -m http.server cannot produce:  /chunked      Transfer-Encoding: chunked body split into three chunks /redirect302  302 with Location: /final (absolute-path redirect) /final        200 with Content-Length; the connection is then held open far beyond the BDD timeout, so a client that waits for EOF instead of honouring Content-Length stalls the scenario.  Usage: python3 test_http_server.py <port>", "id": "tools/test_http_server.py", "kind": "module", "label": "test_http_server.py", "language": "py", "sha256": "fc4b8f711a6afaf9", "symbol_count": 3, "symbols": [{"kind": "class", "line": 21, "name": "Handler", "signature": "class Handler(BaseHTTPRequestHandler)"}, {"kind": "method", "line": 24, "name": "do_GET", "signature": "def do_GET(self)"}, {"kind": "method", "line": 114, "name": "log_message", "signature": "def log_message(self, fmt)"}]}, {"doc": "Host test suite for the MiniOS Lisp interpreter.  Builds progs/lisp/lisp.c with the host toolchain and drives the resulting binary through assertion vectors covering arithmetic, fail-closed errors, closures, strings, files, predicates, CLI flags and the in-OS suite file in language-only mode. Kernel-backed primitives (minios-run, time-ms, vol) are exercised for shape only: without a kernel they fail closed instead of crashing.  Usage: python3 tools/test_lisp.py [--binary PATH] [--lisp SRC]", "id": "tools/test_lisp.py", "kind": "module", "label": "test_lisp.py", "language": "py", "sha256": "771a383af1a826a2", "symbol_count": 16, "symbols": [{"doc": "Central configuration for paths, flags and match expectations.", "kind": "class", "line": 28, "name": "LispConfig", "signature": "class LispConfig"}, {"doc": "Builds the interpreter once and asserts vectors against it.", "kind": "class", "line": 37, "name": "LispTest", "signature": "class LispTest"}, {"doc": "Compile the interpreter with warnings promoted to errors.", "kind": "function", "line": 308, "name": "build_binary", "signature": "def build_binary(source, output)"}, {"doc": "Parse arguments, build the binary and drive the suite.", "kind": "function", "line": 321, "name": "main", "signature": "def main()"}, {"kind": "method", "line": 40, "name": "__init__", "signature": "def __init__(self, binary, suite)"}, {"doc": "Assert one observed value equals the expectation.", "kind": "method", "line": 47, "name": "check", "signature": "def check(self, name, actual, expected)"}, {"doc": "Evaluate one inline expression and capture output.", "kind": "method", "line": 58, "name": "run_expr", "signature": "def run_expr(self, code)"}, {"doc": "Assert an inline expression prints exactly the expectation.", "kind": "method", "line": 65, "name": "check_eval", "signature": "def check_eval(self, name, code, stdout)"}, {"doc": "Assert an inline expression fails closed with a diagnostic.", "kind": "method", "line": 70, "name": "check_error", "signature": "def check_error(self, name, code, fragment)"}, {"doc": "Drive every assertion vector in sequence.", "kind": "method", "line": 76, "name": "run_all", "signature": "def run_all(self)"}, {"doc": "Assert a file write and read roundtrip through the interpreter.", "kind": "method", "line": 121, "name": "check_file_roundtrip", "signature": "def check_file_roundtrip(self)"}, {"doc": "Assert a nonzero exit status survives the cleanup path.", "kind": "method", "line": 135, "name": "check_exit_code", "signature": "def check_exit_code(self)"}, {"doc": "Assert version, help, unknown flag and missing file behaviors.", "kind": "method", "line": 142, "name": "check_cli", "signature": "def check_cli(self)"}, {"doc": "Assert the shipped in-OS suite passes its language section.", "kind": "method", "line": 159, "name": "check_suite_language_only", "signature": "def check_suite_language_only(self)"}, {"doc": "Assert the Lisp subset compiler covers expr codegen end to end.\n\nEach vector compiles one tiny C source through minigcc.lisp, then\nassembles and links the output with the host toolchain and checks\nthe process exit code. Vectors that need `as`/`ld` skip cleanly\nwhen the host lacks them; the fail-closed vectors need no linker.", "kind": "method", "line": 177, "name": "check_minigcc_subset", "signature": "def check_minigcc_subset(self)"}, {"doc": "Print the totals and return the process exit status.", "kind": "method", "line": 300, "name": "report", "signature": "def report(self)"}]}, {"doc": "test_net_fixture.py -- host-side UDP and TCP echo fixture for lxnet.  The lxnet probe (progs/src/lxnet.c, docs/spec/network.md \"Linux socket ABI\") proves the guest's datagram and stream sockets against something the guest can reach through QEMU slirp (10.0.2.2 is the host). python -m http.server cannot echo datagrams or hold a raw stream, so this fixture serves both:  UDP <port>   echoes every datagram back to its sender, byte for byte TCP <port>   echoes every byte back on each accepted connection until the peer closes  Usage: python3 tools/test_net_fixture.py <port>  Inputs: one port number, used for both the UDP and the TCP listener. Outputs: none on success; runs until killed (the BDD harness stops it). Failure modes: exits 2 on a bad argument and 1 when either port cannot be bound (already in use).", "id": "tools/test_net_fixture.py", "kind": "module", "label": "test_net_fixture.py", "language": "py", "sha256": "1a05352dede21d88", "symbol_count": 5, "symbols": [{"doc": "Every tunable of the fixture in one place.", "kind": "class", "line": 26, "name": "Config", "signature": "class Config"}, {"doc": "Echo each datagram back to its sender.", "kind": "function", "line": 34, "name": "serve_udp", "signature": "def serve_udp(port)"}, {"doc": "Echo one accepted stream until the peer closes it.", "kind": "function", "line": 43, "name": "echo_stream", "signature": "def echo_stream(conn)"}, {"doc": "Accept streams forever, one echo thread each.", "kind": "function", "line": 53, "name": "serve_tcp", "signature": "def serve_tcp(port)"}, {"kind": "function", "line": 64, "name": "main", "signature": "def main()"}]}, {"doc": "test_sb16.sh — targeted BDD harness for the SB16 audio path.  Boots the disk image once with the SB16 device attached (headless, null audio backend) and drives the shell over the serial console:  run sbtone    streams 440 Hz PCM and reports how many buffers the ring actually accepted over a 3 s guest window; sb16          prints the driver's re-arm and submit/drop counters.  A healthy driver must drain the 7-slot ring via the timer watchdog (the null backend never raises a completion IRQ), so sbtone must accept ~32 of ~33 buffers and the counters must show poll arms > 0 and drops of 0.  This is the regression test for the wedge where the ring filled once and every later submit was refused.  Exits nonzero on any failed assertion.", "id": "tools/test_sb16.sh", "kind": "module", "label": "test_sb16.sh", "language": "sh", "sha256": "3af3f2064dfed1df", "symbol_count": 1, "symbols": [{"kind": "function", "line": 45, "name": "fail_msg"}]}, {"doc": "Host-side TLS test driver for the MiniOS kernel TLS client.  Generates a throwaway CA and server certificates with openssl (bounded, offline), emits tls_test_roots.h (test CA DER + RSA/ECDSA verify vectors) next to them under build/tls_test_work, then runs the compiled tls_test binary against python ssl servers: positive handshakes (RSA chain, ECDSA P-256 leaf over a P-384 CA) and the negative set (wrong hostname, unknown CA, expired cert).  The roots header lives in the same directory as the certificates on purpose: the binary embeds the roots while the servers use the certificates, so both must be generated together or the suite fails with an \"unknown CA\" that looks like a flaky test.", "id": "tools/tls_test.py", "kind": "module", "label": "tls_test.py", "language": "py", "sha256": "3341b4aeb524ad31", "symbol_count": 16, "symbols": [{"kind": "function", "line": 32, "name": "run", "signature": "def run(cmd)"}, {"kind": "function", "line": 36, "name": "check", "signature": "def check(cmd)"}, {"kind": "function", "line": 43, "name": "gen_certs", "signature": "def gen_certs()"}, {"kind": "function", "line": 160, "name": "der_bytes", "signature": "def der_bytes(pem_path)"}, {"kind": "function", "line": 168, "name": "rsa_params", "signature": "def rsa_params(key_path)"}, {"kind": "function", "line": 178, "name": "ec_pub", "signature": "def ec_pub(key_path)"}, {"kind": "function", "line": 189, "name": "c_bytes", "signature": "def c_bytes(data, name)"}, {"kind": "function", "line": 197, "name": "gen_header", "signature": "def gen_header(p)"}, {"kind": "class", "line": 247, "name": "Server", "signature": "class Server(Thread)"}, {"kind": "function", "line": 286, "name": "serve", "signature": "def serve(cert, key)"}, {"kind": "function", "line": 294, "name": "serve_openssl", "signature": "def serve_openssl(cert, key, chain)"}, {"kind": "function", "line": 312, "name": "expect", "signature": "def expect(bin_path, args, want_zero, marker)"}, {"kind": "function", "line": 325, "name": "main", "signature": "def main()"}, {"kind": "function", "line": 67, "name": "server_cert", "signature": "def server_cert(name, algo, curve, ca_name, ca_algo, curve_ca, extra, subj)"}, {"kind": "method", "line": 248, "name": "__init__", "signature": "def __init__(self, cert, key, tls13_ok)"}, {"kind": "method", "line": 254, "name": "run", "signature": "def run(self)"}]}, {"doc": "Update the sibling source checkouts MiniOS builds against.  MiniOS is built from this repository plus one checkout per external source: the toolchain trio (miniGCC, ld, cvm), the browser (FreeDom), the interpreters (micropython, cpython, lua), the UI and audio libraries (nuklear, nuked-opl3) and the reference sources (raycastlib, quake2generic, the gameboy recompiler). This tool refreshes any subset of them in place.  Safety contract (never violated):  - Local work is never discarded. A dirty worktree is reported and skipped, never reset, never stashed, never force-updated. - History is never rewritten and local commits are never dropped. A checkout that carries local commits is merged with the upstream tip; a merge that conflicts is aborted and reported, so the checkout stays clean. - Pinned checkouts stay pinned. A checkout bound to a release tag is verified against that tag and restored to it when it drifted. - Every update records the pre-update revision, so `make update-rollback` can put the fleet back exactly where it was.  Usage: python3 tools/update_sources.py [options] [NAME ...]  With no NAME every managed checkout is updated. With one or more NAMEs (or --only NAME) only those checkouts are touched.  Options: --status         report the state of every checkout, no network access --list           list the managed checkouts and exit", "id": "tools/update_sources.py", "kind": "module", "label": "update_sources.py", "language": "py", "sha256": "8f6e0268503d218a", "symbol_count": 33, "symbols": [{"doc": "A managed external checkout.", "kind": "class", "line": 96, "name": "Repo", "signature": "class Repo"}, {"doc": "Outcome of one git invocation.", "kind": "class", "line": 203, "name": "GitResult", "signature": "class GitResult"}, {"doc": "Result of handling one checkout.", "kind": "class", "line": 216, "name": "Outcome", "signature": "class Outcome"}, {"doc": "Raised when git fails in a way the caller cannot recover from.", "kind": "class", "line": 232, "name": "GitError", "signature": "class GitError(RuntimeError)"}, {"doc": "Run git in a directory and capture its output.", "kind": "function", "line": 236, "name": "run_git", "signature": "def run_git(git, cwd)"}, {"doc": "Run git and return stdout, or the empty string on failure.", "kind": "function", "line": 253, "name": "git_out", "signature": "def git_out(git, cwd)"}, {"doc": "Return the checked-out revision, or the empty string.", "kind": "function", "line": 261, "name": "head_sha", "signature": "def head_sha(git, path)"}, {"doc": "Shorten a revision for display.", "kind": "function", "line": 266, "name": "short_sha", "signature": "def short_sha(sha)"}, {"doc": "Return the checked-out branch name, empty when detached.", "kind": "function", "line": 271, "name": "current_branch", "signature": "def current_branch(git, path)"}, {"doc": "Report whether the worktree carries uncommitted changes.", "kind": "function", "line": 276, "name": "is_dirty", "signature": "def is_dirty(git, path)"}, {"doc": "Report whether the checkout is a shallow clone.", "kind": "function", "line": 281, "name": "is_shallow", "signature": "def is_shallow(git, path)"}, {"doc": "Resolve a checkout directory against the repository root.", "kind": "function", "line": 286, "name": "resolve_path", "signature": "def resolve_path(directory)"}, {"doc": "Fetch the upstream branch, optionally with a bounded depth.", "kind": "function", "line": 294, "name": "fetch_upstream", "signature": "def fetch_upstream(git, path, branch, shallow_depth)"}, {"doc": "Deepen a shallow checkout so a fast-forward becomes provable.", "kind": "function", "line": 306, "name": "deepen_upstream", "signature": "def deepen_upstream(git, path, branch, commits)"}, {"doc": "Return the revision the upstream branch points at.", "kind": "function", "line": 316, "name": "upstream_target", "signature": "def upstream_target(git, path, branch)"}, {"doc": "Return the (ahead, behind) commit counts against the upstream branch.", "kind": "function", "line": 325, "name": "ahead_behind", "signature": "def ahead_behind(git, path, branch)"}, {"doc": "Merge an upstream revision, refusing anything but a fast-forward.", "kind": "function", "line": 339, "name": "fast_forward", "signature": "def fast_forward(git, path, target)"}, {"doc": "Integrate an upstream revision into a branch that carries local commits.", "kind": "function", "line": 344, "name": "reconcile", "signature": "def reconcile(git, path, target, strategy)"}, {"doc": "Undo a failed reconciliation so the checkout stays clean.", "kind": "function", "line": 351, "name": "abort_reconcile", "signature": "def abort_reconcile(git, path, strategy)"}, {"doc": "List the files a failed reconciliation left unmerged.", "kind": "function", "line": 359, "name": "conflicted_files", "signature": "def conflicted_files(git, path)"}, {"doc": "Initialize and refresh the submodules of a checkout.", "kind": "function", "line": 365, "name": "update_submodules", "signature": "def update_submodules(git, path, submodules)"}, {"doc": "Bring a tracked checkout to the upstream tip, keeping local commits.", "kind": "function", "line": 375, "name": "handle_tracked", "signature": "def handle_tracked(git, repo, path, dry_run, fetch_enabled, strategy)"}, {"doc": "Hold a checkout at the release tag it is pinned to.", "kind": "function", "line": 446, "name": "handle_pinned", "signature": "def handle_pinned(git, repo, path, dry_run, fetch_enabled)"}, {"doc": "Dispatch one checkout to the handler its mode asks for.", "kind": "function", "line": 493, "name": "handle_repo", "signature": "def handle_repo(git, repo, directory, dry_run, fetch_enabled, strategy)"}, {"doc": "Record the pre-update revision of every checkout that moved.", "kind": "function", "line": 513, "name": "write_snapshot", "signature": "def write_snapshot(path, outcomes)"}, {"doc": "Restore the revisions recorded by the last update.", "kind": "function", "line": 535, "name": "rollback", "signature": "def rollback(git, snapshot_path, directories)"}, {"doc": "Print the revision of every managed checkout.", "kind": "function", "line": 572, "name": "print_status", "signature": "def print_status(git, selected, directories)"}, {"doc": "Print one checkout result.", "kind": "function", "line": 594, "name": "print_outcome", "signature": "def print_outcome(outcome)"}, {"doc": "Resolve the requested repository names, failing on unknown ones.", "kind": "function", "line": 599, "name": "select_repos", "signature": "def select_repos(names)"}, {"doc": "Split the --repo overrides into directory and URL maps.", "kind": "function", "line": 614, "name": "parse_overrides", "signature": "def parse_overrides(pairs)"}, {"doc": "Run the updater and report what happened.", "kind": "function", "line": 634, "name": "main", "signature": "def main(argv)"}, {"kind": "method", "line": 211, "name": "ok", "signature": "def ok(self)"}, {"kind": "method", "line": 228, "name": "changed", "signature": "def changed(self)"}]}, {"doc": "Docstring: Scoped Wayland-mini validation for the tiled ring-3 compositor. Runs host wire, mailbox and palette tests, rebuilds the guest wlcomp binary with zero warnings, and asserts scoped mutants die. Fails closed.", "id": "tools/wl_scoped.sh", "kind": "module", "label": "wl_scoped.sh", "language": "sh", "sha256": "0f79a5d02912bdaa", "symbol_count": 4, "symbols": [{"kind": "function", "line": 8, "name": "say"}, {"kind": "function", "line": 9, "name": "die"}, {"kind": "function", "line": 77, "name": "mut"}, {"kind": "function", "line": 84, "name": "mutm"}]}, {"doc": "Docstring: Synchronize the WM layout manifest from source truth.  I read wm_layout.h and tests/test_wm.c and regenerate docs/wm_layout_manifest.md so documentation never drifts from code. I fail closed with nonzero exit on missing contracts or mode gaps.", "id": "tools/wm_layout_sync.py", "kind": "module", "label": "wm_layout_sync.py", "language": "py", "sha256": "7b5bb8ad93cfe2d4", "symbol_count": 17, "symbols": [{"doc": "Docstring: Centralized paths and bounds for layout sync.", "kind": "class", "line": 17, "name": "WmLayoutSyncConfig", "signature": "class WmLayoutSyncConfig"}, {"doc": "Docstring: Outcome of one manifest synchronization.", "kind": "class", "line": 36, "name": "WmLayoutSyncResult", "signature": "class WmLayoutSyncResult"}, {"doc": "Docstring: Manifest builder driven only by source files.", "kind": "class", "line": 46, "name": "WmLayoutSync", "signature": "class WmLayoutSync"}, {"doc": "Docstring: Parse CLI flags for check or write modes.", "kind": "function", "line": 151, "name": "parse_args", "signature": "def parse_args(argv)"}, {"doc": "Docstring: Run discovery and write or verify the manifest.", "kind": "function", "line": 159, "name": "main", "signature": "def main(argv)"}, {"doc": "Docstring: Bind all paths to one repository root.", "kind": "method", "line": 20, "name": "__init__", "signature": "def __init__(self, root)"}, {"doc": "Docstring: Store discovered modes, symbols and check count.", "kind": "method", "line": 39, "name": "__init__", "signature": "def __init__(self, modes, symbols, checks)"}, {"doc": "Docstring: Hold config as the sole tunable source.", "kind": "method", "line": 49, "name": "__init__", "signature": "def __init__(self, config)"}, {"doc": "Docstring: Extract modes, symbols and test checks from sources.", "kind": "method", "line": 53, "name": "discover", "signature": "def discover(self)"}, {"doc": "Docstring: Build manifest markdown from discovery result.", "kind": "method", "line": 66, "name": "render", "signature": "def render(self, result)"}, {"doc": "Docstring: Discover, render and optionally write the manifest.", "kind": "method", "line": 101, "name": "synchronize", "signature": "def synchronize(self, write)"}, {"doc": "Docstring: Read one source file or fail with a clear error.", "kind": "method", "line": 110, "name": "_read_text", "signature": "def _read_text(self, path)"}, {"doc": "Docstring: Collect layout mode names from the mode table.", "kind": "method", "line": 116, "name": "_extract_modes", "signature": "def _extract_modes(self, header_text)"}, {"doc": "Docstring: Collect required public symbols present in header.", "kind": "method", "line": 125, "name": "_extract_symbols", "signature": "def _extract_symbols(self, header_text)"}, {"doc": "Docstring: Count layout assertions guarding the contract.", "kind": "method", "line": 133, "name": "_count_layout_checks", "signature": "def _count_layout_checks(self, tests_text)"}, {"doc": "Docstring: Refuse a header missing any required mode.", "kind": "method", "line": 138, "name": "_require_modes", "signature": "def _require_modes(self, modes)"}, {"doc": "Docstring: Refuse a header missing any required symbol.", "kind": "method", "line": 144, "name": "_require_symbols", "signature": "def _require_symbols(self, symbols)"}]}, {"doc": "Docstring: Scoped WM validation for Alt-Tab and tile across all windows. Runs host WM unit tests, rebuilds touched kernel objects with zero warnings, and asserts scoped mutants die. Fails closed on first gap.", "id": "tools/wm_scoped.sh", "kind": "module", "label": "wm_scoped.sh", "language": "sh", "sha256": "59639d3f8badd080", "symbol_count": 2, "symbols": [{"kind": "function", "line": 8, "name": "say"}, {"kind": "function", "line": 9, "name": "die"}]}, {"id": "vma.c", "kind": "module", "label": "vma.c", "language": "c", "sha256": "4e23764eb885a31d", "symbol_count": 18, "symbols": [{"kind": "function", "line": 37, "name": "vma_ctx_init", "signature": "void vma_ctx_init(vma_ctx_t *c, vma_node_t *pool)"}, {"kind": "function", "line": 52, "name": "vma_ctx_bind", "signature": "void vma_ctx_bind(vma_ctx_t *c)"}, {"kind": "function", "line": 64, "name": "vma_ctx_save", "signature": "void vma_ctx_save(vma_ctx_t *c)"}, {"kind": "function", "line": 74, "name": "vma_view_save", "signature": "void vma_view_save(vma_view_t *v)"}, {"kind": "function", "line": 86, "name": "vma_view_load", "signature": "void vma_view_load(const vma_view_t *v)"}, {"kind": "function", "line": 98, "name": "vma_tree_init", "signature": "void vma_tree_init(void)"}, {"kind": "function", "line": 113, "name": "vma_alloc_node", "signature": "static vma_node_t *vma_alloc_node(void)"}, {"kind": "function", "line": 124, "name": "vma_rotate_left", "signature": "static void vma_rotate_left(vma_node_t **root, vma_node_t *x)"}, {"kind": "function", "line": 136, "name": "vma_rotate_right", "signature": "static void vma_rotate_right(vma_node_t **root, vma_node_t *x)"}, {"kind": "function", "line": 148, "name": "vma_insert_fixup", "signature": "static void vma_insert_fixup(vma_node_t **root, vma_node_t *z)"}, {"kind": "function", "line": 187, "name": "vma_tree_insert", "signature": "vma_node_t *vma_tree_insert(vma_node_t **root, unsigned long base, unsigned long len)"}, {"doc": "1 when node n hangs in the tree rooted at root (live and free trees * share one pool and one cache, so a cached node must prove its tree).", "kind": "function", "line": 215, "name": "vma_node_in_tree", "signature": "static int vma_node_in_tree(vma_node_t *root, vma_node_t *n)"}, {"kind": "function", "line": 220, "name": "vma_tree_find", "signature": "vma_node_t *vma_tree_find(vma_node_t *root, unsigned long base)"}, {"doc": "Docstring: Find the live node containing va (base <= va < base+len), or VMA_NIL. The fault path needs interior hits; the exact-base find above cannot serve it. Pure tree walk, no MRU (the MRU keys exact * bases only). Overflow-closed: a wrapping range never contains.", "kind": "function", "line": 238, "name": "vma_tree_find_containing", "signature": "vma_node_t *vma_tree_find_containing(vma_node_t *root, unsigned long va)"}, {"kind": "function", "line": 252, "name": "vma_transplant", "signature": "static void vma_transplant(vma_node_t **root, vma_node_t *u, vma_node_t *v)"}, {"kind": "function", "line": 259, "name": "vma_tree_minimum", "signature": "static vma_node_t *vma_tree_minimum(vma_node_t *x)"}, {"kind": "function", "line": 264, "name": "vma_delete_fixup", "signature": "static void vma_delete_fixup(vma_node_t **root, vma_node_t *x)"}, {"kind": "function", "line": 319, "name": "vma_tree_delete", "signature": "int vma_tree_delete(vma_node_t **root, unsigned long base)"}]}], "type": "CodePropertyGraph", "version": "1.0"}
```

---

## Architecture Reference

### C (288 files)

#### `uefi_stub.c`
**Path:** `boot/uefi_stub.c`
**File Doc:** *Docstring: boot/uefi_stub.c -- Minimal MiniOS UEFI stub (Phase 1).*

**Functions:**
- `com1_putc` (line 188) `static void com1_putc(char c)`
- `puts_both` (line 197) `static void puts_both(const char *s)`
- `puts_con` (line 205) `static void puts_con(const u16 *s)`
- `put_u64` (line 210) `static void put_u64(u64 v)`
- `put_hex` (line 227) `static void put_hex(u64 v)`
- `w_u16` (line 350) `static void w_u16(unsigned long addr, unsigned v)`
- `w_u32` (line 356) `static void w_u32(unsigned long addr, unsigned long v)`
- `w_u64` (line 364) `static void w_u64(unsigned long addr, unsigned long long v)`
- `boot_kernel` (line 371) `static void boot_kernel(unsigned long src, unsigned long len)`
- `efi_main` (line 416) `efi_status EFIABI efi_main(efi_handle image, efi_system_table *systab)`

**Macros:**
- `EFIABI` (line 41) `#define EFIABI`
- `EFI_SUCCESS` (line 43) `#define EFI_SUCCESS`
- `EFI_LOADER_DATA` (line 267) `#define EFI_LOADER_DATA`
- `EFI_FILE_MODE_READ` (line 268) `#define EFI_FILE_MODE_READ`
- `EFI_BUFFER_TOO_SMALL` (line 269) `#define EFI_BUFFER_TOO_SMALL`
- `UEFI_KERNEL_MAX` (line 270) `#define UEFI_KERNEL_MAX`
- `UBOOT_LOW_PAGES` (line 316) `#define UBOOT_LOW_PAGES`
- `UBOOT_KERN_PAGES` (line 317) `#define UBOOT_KERN_PAGES`
- `UBOOT_KERN_SPAN` (line 318) `#define UBOOT_KERN_SPAN`
- `UBOOT_KERN_BASE` (line 319) `#define UBOOT_KERN_BASE`
- `UBOOT_TRAMP` (line 320) `#define UBOOT_TRAMP`
- `TRAMP_LGDT_OFF` (line 321) `#define TRAMP_LGDT_OFF`
- `TRAMP_LEN` (line 322) `#define TRAMP_LEN`
- `UBOOT_GDT` (line 323) `#define UBOOT_GDT`
- `UBOOT_GDT_DESC` (line 324) `#define UBOOT_GDT_DESC`

**Structs:**
- `efi_simple_text_output` (line 61)
- `efi_gop` (line 100)
- `efi_file` (line 288)
- `efi_table_header` (line 45)
- `efi_input_key` (line 53)
- `efi_pixel_bitmask` (line 74)
- `efi_gop_mode_info` (line 81)
- `efi_gop_mode` (line 90)
- `efi_mem_desc` (line 107)
- `efi_boot_services` (line 115)
- `efi_system_table` (line 171)
- `efi_block_io` (line 240) - *Block I/O protocol (boot disk proof): Revision, Media pointer, Reset, ReadBlocks, WriteBlocks, FlushBlocks. Only Media->BlockSize * and a one-block read are touched.*
- `efi_block_media` (line 250)
- `efi_loaded_image` (line 272)
- `efi_sfs` (line 302)

**Type_Aliases:**
- `u64` (line 26) `typedef unsigned long long u64;` - *and a missing header turns the first call into a jump at the "BOOTSERV" magic itself).  Phase 2a (landed): SimpleFileSystem reads kernel.bin whole, ExitBootServices, then a 64-bit entry prints the handoff block over serial and halts (load + exit + jump with no kernel changes). Slices (b) dynamic framebuffer and (c) full boot to shell stay future work; VESA/VGA text is the fallback, INT 13h paths untouched.  Hand-rolled GUIDs are byte-checked against EDK2, never memory: LoadedImage is 5B1B31A1 (not B1) and SFS Data2 is 0x6459 (not 0x52); each wrong byte is a silent EFI_NOT_FOUND with no hint which nibble lied.*
- `u32` (line 28) `typedef unsigned int u32;`
- `u16` (line 29) `typedef unsigned short u16;`
- `u8` (line 30) `typedef unsigned char u8;`
- `efi_status` (line 31) `typedef u64 efi_status;`
- `efi_physical_addr` (line 33) `typedef u64 efi_physical_addr;`
- `efi_virtual_addr` (line 34) `typedef u64 efi_virtual_addr;`
- `efi_simple_text_output` (line 57) `typedef struct efi_simple_text_output efi_simple_text_output;`
- `efi_gop` (line 98) `typedef struct efi_gop efi_gop;`
- `efi_file` (line 279) `typedef struct efi_file efi_file;`

#### `bootloader.c`
**Path:** `bootloader.c`

**Functions:**
- `main` (line 21) `void main(void)`

**Macros:**
- `KSECTORS` (line 19) `#define KSECTORS`

#### `block.c`
**Path:** `drivers/block.c`
**File Doc:** *Block device layer for MiniFS.*

**Functions:**
- `bc_index` (line 64) `static unsigned int bc_index(unsigned int block_num)`
- `bc_invalidate_locked` (line 68) `static void bc_invalidate_locked(unsigned int block_num)`
- `bc_invalidate` (line 73) `static void bc_invalidate(unsigned int block_num)`
- `block_init` (line 80) `void block_init(void)`
- `block_set_base` (line 113) `void block_set_base(unsigned int lba_base)`
- `block_dev_read` (line 128) `static int block_dev_read(unsigned lba, unsigned count, void *buf)` - *Strategy consumer: sector I/O goes through the registered block device's ops table (dev->ops->read/write), never straight at the hardware. The virtio queue wins when block_init preferred it (same image as IDE, or IDE absent on virtio-only hardware); IDE stays as the fallback, and the direct ide_* call covers the window between block_init's probe and the registry publish, plus images whose IDE probe found no disk * (registry still publishes, present() says 0).*
- `block_dev_write` (line 146) `static int block_dev_write(unsigned lba, unsigned count, const void *buf)`
- `block_read` (line 164) `int block_read(unsigned int block_num, void *buf)`
- `block_write` (line 205) `int block_write(unsigned int block_num, const void *buf)`
- `block_read_multi` (line 214) `int block_read_multi(unsigned int block_num, unsigned int count, void *buf)`
- `block_write_multi` (line 219) `int block_write_multi(unsigned int block_num, unsigned int count, const void *buf)`
- `block_flush` (line 234) `void block_flush(void)`
- `block_total` (line 236) `unsigned int block_total(void)`
- `block_read_sectors` (line 244) `int block_read_sectors(unsigned lba, unsigned count, void *buf)` - *Docstring: Absolute sector read on the active backend, with no cache and no base offset: partition tables and foreign filesystems address the * whole disk, not the MiniFS window.*
- `block_disk_sectors` (line 255) `unsigned long block_disk_sectors(void)` - *Docstring: Size of the active backend in sectors, so scanners fence to * the USB stick when it is the backend and not to the IDE disk.*
- `table` (line 122) `* ops table (dev->ops->read/write), never straight at the hardware. The * virtio queue wins when block_init preferred it (same image as IDE, or * IDE absent on virtio-only hardware);`

**Macros:**
- `BC_WAYS` (line 53) `#define BC_WAYS`
- `BC_MASK` (line 54) `#define BC_MASK`
- `BC_LINE` (line 62) `#define BC_LINE(idx)`

#### `driver.c`
**Path:** `drivers/driver.c`
**File Doc:** *driver.c -- Device registry for the Strategy-pattern driver layer.*

**Functions:**
- `dev_len` (line 14) `static unsigned dev_len(const char *s)`
- `dev_copy` (line 20) `static void dev_copy(char *dst, const char *src, unsigned cap)`
- `dev_eq` (line 27) `static int dev_eq(const char *a, const char *b)`
- `device_reset` (line 32) `void device_reset(void)`
- `device_register` (line 44) `int device_register(device_t *dev)`
- `device_find` (line 66) `device_t *device_find(const char *name)`
- `device_find_by_type` (line 76) `device_t *device_find_by_type(int type)`
- `device_count` (line 85) `int device_count(void)`

#### `ide.c`
**Path:** `drivers/ide.c`
**File Doc:** *IDE/ATA PIO driver for MiniOS.*

**Functions:**
- `ide_delay` (line 13) `static void ide_delay(void)`
- `ide_read_status` (line 23) `static unsigned char ide_read_status(void)`
- `ide_wait_not_busy` (line 27) `static int ide_wait_not_busy(unsigned int timeout)`
- `ide_wait_drq` (line 40) `static int ide_wait_drq(unsigned int timeout)`
- `ide_select_drive` (line 53) `static void ide_select_drive(unsigned char drive)`
- `ide_soft_reset` (line 59) `static void ide_soft_reset(void)`
- `ide_identify` (line 66) `static int ide_identify(void)`
- `ide_init` (line 91) `void ide_init(void)`
- `ide_present` (line 110) `int ide_present(void)`
- `ide_total_sectors` (line 111) `unsigned int ide_total_sectors(void)`
- `ide_ops_read` (line 113) `static int ide_ops_read(device_t *dev, unsigned lba, unsigned count, void *buf)`
- `ide_ops_write` (line 118) `static int ide_ops_write(device_t *dev, unsigned lba, unsigned count, const void *buf)`
- `ide_ops_total` (line 123) `static unsigned ide_ops_total(device_t *dev)`
- `ide_ops_present` (line 128) `static int ide_ops_present(device_t *dev)`
- `ide_register_device` (line 148) `void ide_register_device(void)`
- `ide_read_sectors` (line 152) `int ide_read_sectors(unsigned int lba, unsigned int count, void *buf)`
- `ide_write_sectors` (line 184) `int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf)`
- `ide_read_sector` (line 214) `int ide_read_sector(unsigned int lba, void *buf)`
- `ide_write_sector` (line 218) `int ide_write_sector(unsigned int lba, const void *buf)`

#### `kbd.c`
**Path:** `drivers/kbd.c`
**File Doc:** *================================================================*

**Functions:**
- `kbd_get_layout` (line 100) `int kbd_get_layout(void)`
- `kbd_set_layout` (line 101) `void kbd_set_layout(int layout)`
- `kbd_toggle_layout` (line 105) `void kbd_toggle_layout(void)`
- `kbd_drop_counts` (line 132) `void kbd_drop_counts(unsigned long *cooked, unsigned long *raw)` - *#define kbd_super (kbd_mods.super) #define kbd_altgr (kbd_mods.altgr) #define KBD_QUEUE_LEN 8 #define KBD_SCAN_DEL 0x53 static unsigned char kbd_queue[KBD_QUEUE_LEN]; static int kbd_q_head, kbd_q_tail; static int kbd_e0; /** Docstring: Full-queue drop counters observable via wm state. static unsigned long kbd_drop_cooked; static unsigned long kbd_drop_raw; /** Docstring: Report cooked and raw queue drop counters.*
- `kbd_q_push` (line 146) `void kbd_q_push(unsigned char c)`
- `kbd_raw_push_internal` (line 156) `static void kbd_raw_push_internal(unsigned char c)`
- `kbd_q_empty` (line 166) `int kbd_q_empty(void)`
- `kbd_q_pop` (line 168) `int kbd_q_pop(void)`
- `kbd_available` (line 175) `int kbd_available(void)`
- `kbd_raw_mode_get` (line 181) `int kbd_raw_mode_get(void)`
- `kbd_raw_mode_set` (line 182) `void kbd_raw_mode_set(int on)`
- `kbd_raw_empty` (line 183) `int kbd_raw_empty(void)`
- `kbd_raw_pop` (line 184) `int kbd_raw_pop(void)`
- `kbd_raw_push_byte` (line 190) `void kbd_raw_push_byte(unsigned char c)`
- `kbd_e0_get` (line 191) `int kbd_e0_get(void)`
- `kbd_e0_set` (line 192) `void kbd_e0_set(int v)`
- `kbd_flush_all` (line 193) `void kbd_flush_all(void)`
- `kbd_raw_flush` (line 200) `void kbd_raw_flush(void)` - *Drop queued raw scancodes (shell-typed while a terminal owned PS/2) so a * newly focused game never replays them as input. Cooked shell keys stay.*
- `raw_track_mods` (line 221) `static int raw_track_mods(int code, int brk, int e0)`
- `wm_combo_dispatch` (line 226) `static int wm_combo_dispatch(int action, int zone)` - *wm_raw_combo performs the WM action and reports 1 when the byte must be swallowed. Deliberately narrower than the cooked set: bare keys (Tab, F11/F5, arrows) always reach the game, and Alt+arrows stay with the game too (DOOM strafes with Alt+arrows); Super is never a game key, so the full Super set plus Alt+Tab / Alt+Enter / Alt+M,X,Q / Alt+[/]-/=/0 work raw. A swallowed Tab make also swallows its break (same flag as cooked * would need, kept here beside the consumer). static int wm_raw_swallow_tab_break; static int raw_track_mods(int code, int brk, int e0) { return modifiers_update(&kbd_keys, &kbd_mods, code, brk, e0); } /** Docstring: Dispatch one looked-up WM combo to the window manager.*
- `wm_raw_combo` (line 278) `static int wm_raw_combo(int code, int e0)`
- `bare` (line 297) `* second byte is not a WM combo is delivered bare (keypad alias): games map
 * both, so play surv...`
- `key` (line 333) `* navigation key (which is pushed to the cooked queue as an escape sequence
 * instead) or a key ...`
- `kbd_read` (line 449) `int kbd_read(void)`
- `kbd_reset_for_shell` (line 463) `void kbd_reset_for_shell(void)`
- `paths` (line 210) `* keeps the modifier state in sync on both paths (the old raw branch never * tracked Alt/Super, so a modifier held across raw mode stuck forever);`
- `too` (line 215) `* too (DOOM strafes with Alt+arrows);`

**Macros:**
- `kbd_shift` (line 115) `#define kbd_shift`
- `kbd_ctrl` (line 116) `#define kbd_ctrl`
- `kbd_alt` (line 117) `#define kbd_alt`
- `kbd_super` (line 118) `#define kbd_super`
- `kbd_altgr` (line 119) `#define kbd_altgr`
- `KBD_QUEUE_LEN` (line 121) `#define KBD_QUEUE_LEN`
- `KBD_SCAN_DEL` (line 122) `#define KBD_SCAN_DEL`
- `KBD_RAW_LEN` (line 141) `#define KBD_RAW_LEN`

#### `mouse.c`
**Path:** `drivers/mouse.c`
**File Doc:** *Docstring: PS/2 mouse device driver (drivers/mouse.c).*

**Functions:**
- `mouse_wait_data` (line 20) `static void mouse_wait_data(void)`
- `mouse_write` (line 24) `static void mouse_write(unsigned char data)`
- `mouse_read` (line 31) `static unsigned char mouse_read(void)`
- `mouse_hw_init` (line 36) `void mouse_hw_init(void)`
- `mouse_disable` (line 112) `void mouse_disable(void)`
- `mouse_enable` (line 113) `void mouse_enable(void)`
- `wrong` (line 83) `* later packet is framed wrong (a left press reads back as bit 1, * motion warps), permanently. */ mouse_write(HAL_MOUSE_CMD_RESET);`

#### `nvme.c`
**Path:** `drivers/nvme.c`

**Functions:**
- `xnv_outl` (line 48) `static void xnv_outl(unsigned short port, unsigned val)`
- `xnv_inl` (line 52) `static unsigned xnv_inl(unsigned short port)`
- `nvme_present` (line 58) `int nvme_present(void)`
- `nvme_version` (line 62) `unsigned nvme_version(void)`
- `nvme_note` (line 66) `const char *nvme_note(void)`
- `xnv_r32` (line 89) `static unsigned xnv_r32(unsigned off)`
- `xnv_w32` (line 93) `static void xnv_w32(unsigned off, unsigned val)`
- `xnv_r64` (line 97) `static unsigned long long xnv_r64(unsigned off)`
- `xnv_w64` (line 102) `static void xnv_w64(unsigned off, unsigned long long val)`
- `xnv_put16` (line 106) `static void xnv_put16(unsigned char *p, unsigned short v)`
- `xnv_put32` (line 111) `static void xnv_put32(unsigned char *p, unsigned long v)`
- `xnv_put64` (line 118) `static void xnv_put64(unsigned char *p, unsigned long long v)`
- `xnv_get32` (line 124) `static unsigned long xnv_get32(const unsigned char *p)`
- `xnv_wait_rdy` (line 129) `static int xnv_wait_rdy(unsigned want)`
- `xnv_next_cid` (line 139) `static unsigned short xnv_next_cid(void)`
- `xnv_poll` (line 145) `static int xnv_poll(unsigned char *cq, unsigned cq_db, unsigned short *head,
        unsigned sho...`
- `xnv_cmd` (line 169) `static int xnv_cmd(unsigned char *sq, unsigned sq_db, unsigned char *cq,
        unsigned cq_db, ...`
- `xnv_queues` (line 196) `static int xnv_queues(void)`
- `nvme_sectors` (line 286) `unsigned long nvme_sectors(void)`
- `nvme_read_sectors` (line 290) `int nvme_read_sectors(unsigned lba, unsigned count, void *buf)`
- `nvme_init` (line 310) `int nvme_init(void)`

**Macros:**
- `NVME_CLASS_BASE` (line 6) `#define NVME_CLASS_BASE`
- `NVME_CLASS_SUB` (line 7) `#define NVME_CLASS_SUB`
- `NVME_CLASS_PI` (line 8) `#define NVME_CLASS_PI`
- `NVME_REG_VS` (line 10) `#define NVME_REG_VS`
- `NVME_REG_CAP` (line 11) `#define NVME_REG_CAP`
- `NVME_REG_CC` (line 12) `#define NVME_REG_CC`
- `NVME_REG_CSTS` (line 13) `#define NVME_REG_CSTS`
- `NVME_REG_AQA` (line 14) `#define NVME_REG_AQA`
- `NVME_REG_ASQ` (line 15) `#define NVME_REG_ASQ`
- `NVME_REG_ACQ` (line 16) `#define NVME_REG_ACQ`
- `NVME_DB_BASE` (line 17) `#define NVME_DB_BASE`
- `NVME_CC_EN` (line 19) `#define NVME_CC_EN`
- `NVME_CC_IOSQES` (line 20) `#define NVME_CC_IOSQES`
- `NVME_CC_IOCQES` (line 21) `#define NVME_CC_IOCQES`
- `NVME_CSTS_RDY` (line 22) `#define NVME_CSTS_RDY`
- `NVME_QSIZE` (line 24) `#define NVME_QSIZE`
- `NVME_SQE_LEN` (line 25) `#define NVME_SQE_LEN`
- `NVME_CQE_LEN` (line 26) `#define NVME_CQE_LEN`
- `NVME_QPAGES` (line 27) `#define NVME_QPAGES`
- `NVME_OPC_CREATE_IOSQ` (line 29) `#define NVME_OPC_CREATE_IOSQ`
- `NVME_OPC_READ` (line 30) `#define NVME_OPC_READ`
- `NVME_OPC_CREATE_IOCQ` (line 31) `#define NVME_OPC_CREATE_IOCQ`
- `NVME_OPC_IDENTIFY` (line 32) `#define NVME_OPC_IDENTIFY`
- `NVME_NSID` (line 33) `#define NVME_NSID`
- `NVME_CNS_NS` (line 34) `#define NVME_CNS_NS`
- `NVME_LBADS_512` (line 35) `#define NVME_LBADS_512`
- `NVME_MAX_SECTORS` (line 37) `#define NVME_MAX_SECTORS`
- `NVME_SECTOR` (line 38) `#define NVME_SECTOR`
- `NVME_TMO_MS` (line 39) `#define NVME_TMO_MS`

#### `pcm2.c`
**Path:** `drivers/pcm2.c`
**File Doc:** *drivers/pcm2.c -- low-latency PCM audio over SB16 single-cycle DMA.*

**Functions:**
- `pcm2_dma` (line 79) `static unsigned char *pcm2_dma(void)`
- `pcm2_wait_write` (line 83) `static int pcm2_wait_write(void)`
- `pcm2_cmd` (line 90) `static void pcm2_cmd(unsigned char c)`
- `pcm2_dma_program` (line 95) `static void pcm2_dma_program(void)`
- `pcm2_dma_stop` (line 108) `static void pcm2_dma_stop(void)`
- `pcm2_dsp_play` (line 112) `static void pcm2_dsp_play(void)`
- `pcm2_wake_owner` (line 122) `static void pcm2_wake_owner(void)`
- `pcm2_arm_block` (line 135) `static void pcm2_arm_block(void)` - *Fill the DMA block from the ring (silence on underrun) and arm one single-cycle transfer. Runs under pcm2_lock, so a single in-flight * block means no double arm and no lost wakeup.*
- `loop` (line 150) `* loop (the auto-init livelock is structurally impossible here). The IRQ
 * path rejects a stray ...`
- `pcm2_active` (line 179) `int pcm2_active(void)`
- `pcm2_open` (line 183) `int pcm2_open(unsigned flags, int owner)`
- `pcm2_owner_live` (line 221) `static int pcm2_owner_live(void)`
- `pcm2_release_locked` (line 226) `static void pcm2_release_locked(void)`
- `pcm2_write` (line 235) `int pcm2_write(const unsigned char *user, unsigned len, int owner)`
- `pcm2_close` (line 282) `void pcm2_close(int owner)`
- `pcm2_irq` (line 293) `void pcm2_irq(void)`
- `pcm2_poll` (line 306) `void pcm2_poll(void)`
- `pcm2_counters` (line 318) `void pcm2_counters(pcm2_counters_t *out)`

**Macros:**
- `PCM2_BASE_PORT` (line 26) `#define PCM2_BASE_PORT`
- `PCM2_DSP_RESET` (line 27) `#define PCM2_DSP_RESET`
- `PCM2_DSP_WRITE_DATA` (line 28) `#define PCM2_DSP_WRITE_DATA`
- `PCM2_DSP_STATUS` (line 29) `#define PCM2_DSP_STATUS`
- `PCM2_IRQ_ACK` (line 30) `#define PCM2_IRQ_ACK`
- `PCM2_CMD_SET_FREQ` (line 32) `#define PCM2_CMD_SET_FREQ`
- `PCM2_CMD_SPK_ON` (line 33) `#define PCM2_CMD_SPK_ON`
- `PCM2_CMD_PLAY8` (line 34) `#define PCM2_CMD_PLAY8`
- `PCM2_CMD_STOP_NOW` (line 35) `#define PCM2_CMD_STOP_NOW`
- `PCM2_DMA_MODE_PORT` (line 42) `#define PCM2_DMA_MODE_PORT`
- `PCM2_DMA_CH1_SINGLE` (line 43) `#define PCM2_DMA_CH1_SINGLE`
- `PCM2_DMA_CH1_ADDR` (line 44) `#define PCM2_DMA_CH1_ADDR`
- `PCM2_DMA_CH1_CNT` (line 45) `#define PCM2_DMA_CH1_CNT`
- `PCM2_DMA_CH1_PAGE` (line 46) `#define PCM2_DMA_CH1_PAGE`
- `PCM2_DMA_MASK` (line 47) `#define PCM2_DMA_MASK`
- `PCM2_DMA_FF_CLR` (line 48) `#define PCM2_DMA_FF_CLR`
- `PCM2_DMA_CH1_MASK` (line 49) `#define PCM2_DMA_CH1_MASK`
- `PCM2_DMA_CH1_UNMASK` (line 50) `#define PCM2_DMA_CH1_UNMASK`
- `PCM2_DMA_ADDR` (line 52) `#define PCM2_DMA_ADDR`
- `PCM2_DMA_COUNT` (line 53) `#define PCM2_DMA_COUNT`
- `PCM2_READY_MASK` (line 54) `#define PCM2_READY_MASK`
- `PCM2_PROBE_WAIT` (line 55) `#define PCM2_PROBE_WAIT`
- `PCM2_SILENCE` (line 56) `#define PCM2_SILENCE`
- `PCM2_BLOCK_MS` (line 59) `#define PCM2_BLOCK_MS`
- `PCM2_BLOCK_SLACK_MS` (line 60) `#define PCM2_BLOCK_SLACK_MS`

#### `pcspk.c`
**Path:** `drivers/pcspk.c`
**File Doc:** *PC speaker driver with a software master volume. The speaker has no*

**Functions:**
- `pcspk_ops_tone` (line 33) `static void pcspk_ops_tone(device_t *dev, unsigned freq)`
- `pcspk_ops_off` (line 38) `static void pcspk_ops_off(device_t *dev)`
- `pcspk_ops_set_volume` (line 43) `static void pcspk_ops_set_volume(device_t *dev, unsigned vol)`
- `pcspk_ops_get_volume` (line 48) `static unsigned pcspk_ops_get_volume(device_t *dev)`
- `pcspk_init` (line 72) `void pcspk_init(void)`
- `pcspk_set_volume` (line 78) `void pcspk_set_volume(unsigned volume)`
- `pcspk_get_volume` (line 82) `unsigned pcspk_get_volume(void)`
- `pcspk_tone` (line 86) `void pcspk_tone(unsigned freq)`
- `pcspk_off` (line 104) `void pcspk_off(void)`

**Macros:**
- `PIT_CH2_DATA` (line 14) `#define PIT_CH2_DATA`
- `PIT_CH2_CMD` (line 15) `#define PIT_CH2_CMD`
- `SPEAKER_PORT` (line 16) `#define SPEAKER_PORT`
- `PIT_FREQ` (line 17) `#define PIT_FREQ`
- `PCSPK_MIN_FREQ` (line 19) `#define PCSPK_MIN_FREQ`
- `PCSPK_MAX_FREQ` (line 20) `#define PCSPK_MAX_FREQ`
- `SPEAKER_DATA_BIT` (line 22) `#define SPEAKER_DATA_BIT`
- `SPEAKER_GATE_BIT` (line 23) `#define SPEAKER_GATE_BIT`
- `SPEAKER_ENABLE_BITS` (line 24) `#define SPEAKER_ENABLE_BITS`

#### `rtc.c`
**Path:** `drivers/rtc.c`
**File Doc:** *CMOS RTC time-of-day reader. The desktop clock and the shell `date` builtin*

**Functions:**
- `rtc_cmos_read` (line 35) `static inline unsigned char rtc_cmos_read(unsigned char reg)`
- `rtc_from_bcd` (line 40) `static int rtc_from_bcd(unsigned char v)`
- `rtc_read_tod` (line 44) `int rtc_read_tod(int *hour, int *min, int *sec)`
- `rtc_month_len` (line 68) `static int rtc_month_len(long full_year, long mon)`
- `rtc_read_date` (line 78) `int rtc_read_date(int *year, int *mon, int *day)`
- `rtc_wall_seconds` (line 102) `int rtc_wall_seconds(unsigned long *out)`

**Macros:**
- `RTC_CMOS_ADDR` (line 9) `#define RTC_CMOS_ADDR`
- `RTC_CMOS_DATA` (line 10) `#define RTC_CMOS_DATA`
- `RTC_REG_SEC` (line 12) `#define RTC_REG_SEC`
- `RTC_REG_MIN` (line 13) `#define RTC_REG_MIN`
- `RTC_REG_HOUR` (line 14) `#define RTC_REG_HOUR`
- `RTC_REG_DAY` (line 15) `#define RTC_REG_DAY`
- `RTC_REG_MON` (line 16) `#define RTC_REG_MON`
- `RTC_REG_YEAR` (line 17) `#define RTC_REG_YEAR`
- `RTC_REG_STATUS_A` (line 18) `#define RTC_REG_STATUS_A`
- `RTC_REG_STATUS_B` (line 19) `#define RTC_REG_STATUS_B`
- `RTC_UPDATE_IN_PROGRESS` (line 21) `#define RTC_UPDATE_IN_PROGRESS`
- `RTC_BCD_FLAG` (line 22) `#define RTC_BCD_FLAG`
- `RTC_HOUR_MIN` (line 24) `#define RTC_HOUR_MIN`
- `RTC_HOUR_MAX` (line 25) `#define RTC_HOUR_MAX`
- `RTC_MIN_MIN` (line 26) `#define RTC_MIN_MIN`
- `RTC_MIN_MAX` (line 27) `#define RTC_MIN_MAX`
- `RTC_SEC_MIN` (line 28) `#define RTC_SEC_MIN`
- `RTC_SEC_MAX` (line 29) `#define RTC_SEC_MAX`
- `RTC_UPDATE_WAIT` (line 33) `#define RTC_UPDATE_WAIT`

#### `sb16.c`
**Path:** `drivers/sb16.c`
**File Doc:** *Sound Blaster 16 DMA audio driver.*

**Functions:**
- `sb16_kring_reset` (line 118) `static void sb16_kring_reset(void)` - *Mixer stream id backing the legacy sb16_pcm_open/submit API (WQ_NONE when closed).  The legacy path forwards into the mixer so submitted PCM actually reaches the DMA ring through sb16_mix_all; a dedicated * kernel-side ring here would be a second, never-drained copy. static int legacy_stream = WQ_NONE; /* Reset the legacy kernel-side audio ring to empty.*
- `sb16_slot` (line 130) `static unsigned char *sb16_slot(unsigned i)`
- `sb16_stream_open` (line 138) `int sb16_stream_open(void)`
- `sb16_stream_close` (line 154) `void sb16_stream_close(int id)`
- `sb16_stream_submit` (line 162) `int sb16_stream_submit(int id, const unsigned char *pcm, unsigned len)`
- `sb16_stream_volume` (line 177) `void sb16_stream_volume(int id, unsigned char vol)`
- `sb16_stream_count` (line 183) `int sb16_stream_count(void)`
- `sb16_mix_all` (line 194) `static void sb16_mix_all(void)`
- `sb16_pump` (line 236) `void sb16_pump(void)`
- `sb16_wait_write` (line 278) `static int sb16_wait_write(void)` - *DSP write-ready: bit 7 of the status port clear means the DSP accepts a command or data byte.  Bounded so a dead DSP can never hang the kernel; the byte is still issued after the timeout (the DSP takes it * once it catches up after a reset).*
- `sb16_cmd` (line 282) `static void sb16_cmd(unsigned char c)`
- `sb16_read_data` (line 287) `static int sb16_read_data(unsigned char *out)`
- `sb16_reset_dsp` (line 297) `static int sb16_reset_dsp(void)`
- `sb16_dma_play` (line 323) `static void sb16_dma_play(unsigned addr, unsigned len)`
- `sb16_refill` (line 339) `static void sb16_refill(int slot_index)`
- `sb16_arm` (line 355) `static void sb16_arm(int from_irq)`
- `sb16_present` (line 380) `int sb16_present(void)`
- `sb16_tone` (line 382) `void sb16_tone(unsigned freq)`
- `sb16_pcm_open` (line 398) `void sb16_pcm_open(void)`
- `sb16_pcm_close` (line 422) `void sb16_pcm_close(void)`
- `sb16_pcm_submit` (line 431) `int sb16_pcm_submit(const unsigned char *pcm, unsigned len)`
- `sb16_irq` (line 449) `void sb16_irq(void)`
- `sb16_poll` (line 457) `void sb16_poll(void)`
- `sb16_ring_free` (line 466) `unsigned sb16_ring_free(void)`
- `sb16_mode_active` (line 467) `int sb16_mode_active(void)`
- `sb16_legacy_busy` (line 472) `int sb16_legacy_busy(void)` - *Audible legacy ownership for the pcm2 mutual exclusion: a PCM stream is always audible-by-contract, a tone only when sounding. * Silent/idle legacy state (probe-only, tone(0)) never blocks pcm2.*
- `sb16_counters` (line 479) `void sb16_counters(sb16_counters_t *out)`
- `sb16_ops_present` (line 484) `static int sb16_ops_present(device_t *dev)` - *stream is always audible-by-contract, a tone only when sounding. * Silent/idle legacy state (probe-only, tone(0)) never blocks pcm2. int sb16_legacy_busy(void) { if (legacy_stream != WQ_NONE) return 1; if (sb16_inflight && sb16_mode == SB16_MODE_PCM) return 1; if (sb16_inflight && sb16_freq != 0) return 1; return 0; } void sb16_counters(sb16_counters_t *out) { if (out) *out = sb16_stat; } /** Docstring: Strategy verbs publishing the PCM sink to the registry.*
- `sb16_ops_pcm_open` (line 491) `static void sb16_ops_pcm_open(device_t *dev)` - *} void sb16_counters(sb16_counters_t *out) { if (out) *out = sb16_stat; } /** Docstring: Strategy verbs publishing the PCM sink to the registry. static int sb16_ops_present(device_t *dev) { (void)dev; return sb16_present(); } /** Docstring: Strategy verb for PCM open.*
- `sb16_ops_pcm_close` (line 498) `static void sb16_ops_pcm_close(device_t *dev)` - *static int sb16_ops_present(device_t *dev) { (void)dev; return sb16_present(); } /** Docstring: Strategy verb for PCM open. static void sb16_ops_pcm_open(device_t *dev) { (void)dev; sb16_pcm_open(); } /** Docstring: Strategy verb for PCM close.*
- `sb16_ops_pcm_submit` (line 505) `static int sb16_ops_pcm_submit(device_t *dev, const unsigned char *pcm, unsigned len)` - *static void sb16_ops_pcm_open(device_t *dev) { (void)dev; sb16_pcm_open(); } /** Docstring: Strategy verb for PCM close. static void sb16_ops_pcm_close(device_t *dev) { (void)dev; sb16_pcm_close(); } /** Docstring: Strategy verb for PCM submit.*
- `sb16_init` (line 530) `int sb16_init(void)`
- `IRQ` (line 22) `* QEMU audio backends never raise the completion IRQ (they only consume once * their engine buffer drains, which a stalled host backend never does), and * without a fallback the 7-slot ring fills once`
- `pending` (line 535) `* reading without it eats whatever byte happens to be pending (or * times out), so the probe used to fail or misread here. */ sb16_cmd(SB16_CMD_READ_VER);`

**Macros:**
- `SB16_BASE_PORT` (line 48) `#define SB16_BASE_PORT`
- `SB16_DSP_RESET` (line 49) `#define SB16_DSP_RESET`
- `SB16_DSP_READ_DATA` (line 50) `#define SB16_DSP_READ_DATA`
- `SB16_DSP_WRITE_DATA` (line 51) `#define SB16_DSP_WRITE_DATA`
- `SB16_DSP_STATUS` (line 52) `#define SB16_DSP_STATUS`
- `SB16_IRQ_ACK` (line 53) `#define SB16_IRQ_ACK`
- `SB16_CMD_READ_VER` (line 55) `#define SB16_CMD_READ_VER`
- `SB16_CMD_SET_FREQ` (line 56) `#define SB16_CMD_SET_FREQ`
- `SB16_CMD_PLAY8` (line 57) `#define SB16_CMD_PLAY8`
- `SB16_CMD_SPK_ON` (line 58) `#define SB16_CMD_SPK_ON`
- `SB16_CMD_SPK_OFF` (line 59) `#define SB16_CMD_SPK_OFF`
- `SB16_DSP_RDSTATUS` (line 61) `#define SB16_DSP_RDSTATUS`
- `DMA_MODE_PORT` (line 67) `#define DMA_MODE_PORT`
- `DMA_CH1_SINGLE_READ` (line 68) `#define DMA_CH1_SINGLE_READ`
- `SB16_FREQ_LO` (line 70) `#define SB16_FREQ_LO`
- `SB16_FREQ_HI` (line 71) `#define SB16_FREQ_HI`
- `SB16_DSP_READY_MASK` (line 73) `#define SB16_DSP_READY_MASK`
- `DMA_CH1_ADDR` (line 75) `#define DMA_CH1_ADDR`
- `DMA_CH1_CNT` (line 76) `#define DMA_CH1_CNT`
- `DMA_CH1_PAGE` (line 77) `#define DMA_CH1_PAGE`
- `DMA_MASK` (line 78) `#define DMA_MASK`
- `DMA_FF_CLR` (line 79) `#define DMA_FF_CLR`
- `DMA_CH1_UNMASK` (line 80) `#define DMA_CH1_UNMASK`
- `DMA_CH1_MASK` (line 81) `#define DMA_CH1_MASK`
- `SB16_DMA_BUF0` (line 83) `#define SB16_DMA_BUF0`
- `SB16_SILENCE_SLOT` (line 84) `#define SB16_SILENCE_SLOT`
- `SB16_BUF` (line 85) `#define SB16_BUF`
- `SB16_MODE_TONE` (line 88) `#define SB16_MODE_TONE`
- `SB16_MODE_PCM` (line 89) `#define SB16_MODE_PCM`
- `SB16_SQ_CYCLE` (line 91) `#define SB16_SQ_CYCLE`

#### `usbblk.c`
**Path:** `drivers/usbblk.c`
**File Doc:** *usbblk.c -- USB mass storage, Bulk-Only Transport over SCSI.*

**Imported by:** `test_usbblk.c`

**Functions:**
- `ubk_counters` (line 72) `void ubk_counters(ubk_counters_t *out)`
- `ubk_cdb10` (line 80) `static void ubk_cdb10(unsigned char *cdb, unsigned char opcode,
                      unsigned lo...` - *Docstring: Ten-byte SCSI CDB at the CBW command block: opcode, LBA big-endian, transfer length big-endian. READ(10) and WRITE(10) are ten-byte * commands, and a six-byte block with the same opcode is rejected. define UBK_CDB_LEN 10u*
- `ubk_build_cbw` (line 92) `void ubk_build_cbw(unsigned char *out, unsigned tag, unsigned long lba,
                   unsign...`
- `ubk_check_csw` (line 121) `int ubk_check_csw(const unsigned char *csw, unsigned tag, unsigned expect_len)`
- `ubk_command_raw` (line 187) `static int ubk_command_raw(unsigned char *cdb, unsigned cdb_len,
                           unsig...` - *Docstring: Issue one command with an optional data stage and check the status wrapper. cdb carries cdb_len bytes (6 or 10), data is null for a command with no data stage. Returns 1 only when every stage completed * and the CSW agreed with the CBW.*
- `ubk_sense` (line 262) `static void ubk_sense(void)` - *Docstring: REQUEST SENSE after a failure, so a unit attention clears instead of failing every later command, and the key lands in the log. Six-byte command, eighteen bytes of sense. Best-effort: its own failure * changes nothing. define UBK_SENSE_LEN 18u*
- `ubk_command` (line 279) `static int ubk_command(unsigned char *cdb, unsigned cdb_len,
                       unsigned char...` - *Docstring: One command with a single recovery: on a transport failure the pipe is reset and cleared and the command runs once more, because real silicon stalls commands an emulator accepts. A second failure, or * a CSW that disagrees, is reported as-is.*
- `ubk_unit_ready` (line 294) `static int ubk_unit_ready(void)` - *Docstring: Wait for the medium with TEST UNIT READY. Real devices answer CHECK CONDITION until the media is up; without this the first capacity read runs against a device that is not there yet. Bounded, so a dead * device costs tries, never the boot. define UBK_READY_TRIES 5u*
- `ubk_read_capacity` (line 311) `static int ubk_read_capacity(unsigned long *sectors)` - *Docstring: Read the sector count with READ CAPACITY(10). Returns 1 on a successful command with a plausible count. Both fields arrive big-endian, * so a little-endian read reports a capacity the medium does not have.*
- `ubk_present` (line 336) `int ubk_present(void)`
- `ubk_sectors` (line 340) `unsigned long ubk_sectors(void)`
- `ubk_xfer` (line 347) `static int ubk_xfer(unsigned long lba, unsigned count, void *buf, int read)` - *Docstring: Move whole sectors. Every refusal is checked before the command is built, so a bad range never reaches the device, and a failed CSW never * leaves a buffer described as valid.*
- `ubk_read_sectors` (line 365) `int ubk_read_sectors(unsigned long lba, unsigned count, void *buf)`
- `ubk_write_sectors` (line 370) `int ubk_write_sectors(unsigned long lba, unsigned count, const void *buf)`
- `ubk_claim_eps` (line 377) `static int ubk_claim_eps(int device, const xhc_iface_t *iface)` - *Docstring: Take a bulk OUT and a bulk IN endpoint from a claimed interface * and program them. Returns 1 on success.*
- `ubk_blk_read` (line 421) `static int ubk_blk_read(device_t *dev, unsigned lba, unsigned count,
                        void...` - *Docstring: Block-ops adapters so the disk registers with the existing block layer instead of growing a parallel one. The device argument is unused: a second USB disk is not supported and the bound is enforced in ubk_init, so routing the registry through a device pointer would be a parameter that cannot carry a distinction. Every call is a refusal unless the range is * inside the disk, which keeps a bad LBA from the page cache off the device.*
- `ubk_blk_write` (line 427) `static int ubk_blk_write(device_t *dev, unsigned lba, unsigned count,
                         co...`
- `ubk_blk_sectors` (line 433) `static unsigned ubk_blk_sectors(device_t *dev)`
- `ubk_blk_present` (line 438) `static int ubk_blk_present(device_t *dev)`
- `ubk_init` (line 457) `int ubk_init(void)`

**Macros:**
- `UBK_CBW_LEN` (line 22) `#define UBK_CBW_LEN`
- `UBK_CBW_SIG` (line 23) `#define UBK_CBW_SIG`
- `UBK_CBW_FLAG_IN` (line 24) `#define UBK_CBW_FLAG_IN`
- `UBK_CSW_LEN` (line 27) `#define UBK_CSW_LEN`
- `UBK_CSW_SIG` (line 28) `#define UBK_CSW_SIG`
- `UBK_CSW_STATUS_PASSED` (line 29) `#define UBK_CSW_STATUS_PASSED`
- `UBK_CSW_STATUS_FAILED` (line 30) `#define UBK_CSW_STATUS_FAILED`
- `UBK_SCSI_TEST_UNIT_READY` (line 33) `#define UBK_SCSI_TEST_UNIT_READY`
- `UBK_SCSI_REQUEST_SENSE` (line 34) `#define UBK_SCSI_REQUEST_SENSE`
- `UBK_SCSI_INQUIRY` (line 35) `#define UBK_SCSI_INQUIRY`
- `UBK_SCSI_READ_CAPACITY` (line 36) `#define UBK_SCSI_READ_CAPACITY`
- `UBK_SCSI_READ10` (line 37) `#define UBK_SCSI_READ10`
- `UBK_SCSI_WRITE10` (line 38) `#define UBK_SCSI_WRITE10`
- `UBK_BULK_INTERVAL` (line 63) `#define UBK_BULK_INTERVAL`
- `UBK_BULK_BURST` (line 64) `#define UBK_BULK_BURST`
- `UBK_MAX_XFER_BLOCKS` (line 70) `#define UBK_MAX_XFER_BLOCKS`
- `UBK_CDB_LEN` (line 79) `#define UBK_CDB_LEN`
- `UBK_MS_RESET` (line 148) `#define UBK_MS_RESET`
- `UBK_CLEAR_FEATURE` (line 149) `#define UBK_CLEAR_FEATURE`
- `UBK_ENDP_HALT` (line 150) `#define UBK_ENDP_HALT`
- `UBK_CDB6_LEN` (line 181) `#define UBK_CDB6_LEN`
- `UBK_SENSE_LEN` (line 261) `#define UBK_SENSE_LEN`
- `UBK_READY_TRIES` (line 293) `#define UBK_READY_TRIES`

**Structs:**
- `ubk_disk_t` (line 44) - *Docstring: One registered disk: its device record, the OUT and IN endpoint indices, the sector count, and the tag counter that pairs each CBW with its CSW. The transfer buffers are heap, because the controller cannot reach * .bss under KASLR.*

#### `usbhid.c`
**Path:** `drivers/usbhid.c`
**File Doc:** *usbhid.c -- USB HID boot-protocol keyboard and mouse.*

**Imported by:** `test_usbhid.c`

**Functions:**
- `usbhid_set1_from_usage` (line 117) `int usbhid_set1_from_usage(unsigned usage, unsigned char *sc, int *e0)`
- `usbhid_usage_make` (line 128) `static int usbhid_usage_make(unsigned usage, unsigned char *sc, int *e0)` - *Docstring: Set-1 make code for any usage, 0x04..0xDD. Returns 0 when the usage has no set-1 equivalent so the caller drops it rather than inventing * a scancode.*
- `usbhid_report_has` (line 138) `static int usbhid_report_has(const unsigned char report[HID_KBD_REPORT_LEN],
                    ...` - *Docstring: True when a report lists a usage in any slot but the given one. The array is not ordered -- a device may reorder it at any report -- so a naive slot-by-slot compare would emit a break for a key that merely moved position, which the keyboard layer sees as the user releasing and * re-pressing it.*
- `usbhid_put` (line 153) `static int usbhid_put(unsigned char *out, int max, int n, unsigned char sc)` - *Docstring: Append one scancode or return USBHID_TRUNCATED.  Truncation is a hard signal, not a silent clamp: a half-emitted key event leaves the keyboard layer with a make and no break, which wedges the modifier state for the next report. The buffer is sized so this cannot happen for a legal report, so a report that does reach it is a bug worth * seeing.*
- `usbhid_emit_mod` (line 165) `static int usbhid_emit_mod(unsigned char *out, int max, int n, unsigned bit,
                    ...` - *Docstring: Append the make or break bytes for one modifier bit.  A press is prefix, then make. A release is break, then the prefix break. That asymmetry is not cosmetic: the keyboard decode path treats a break with a pending prefix as "finish the pair", so releasing this way leaves no * dangling 0xE0 for the next report to complete by accident.*
- `usbhid_emit_usage` (line 183) `static int usbhid_emit_usage(unsigned char *out, int max, int n,
                             uns...` - *if (pressed) { if (e0) { n = usbhid_put(out, max, n, 0xE0); if (n < 0) return n; } return usbhid_put(out, max, n, sc); } n = usbhid_put(out, max, n, (unsigned char)(sc | 0x80u)); if (n < 0) return n; if (e0) n = usbhid_put(out, max, n, 0xE0 | 0x80u); return n; } /** Docstring: Append the make or break bytes for one usage.*
- `usbhid_kbd_scancodes` (line 206) `int usbhid_kbd_scancodes(const unsigned char prev[HID_KBD_REPORT_LEN],
                         c...`
- `usbhid_mouse_decode` (line 241) `void usbhid_mouse_decode(const unsigned char prev[HID_MOUSE_REPORT_LEN],
                        ...`
- `usbhid_keyboard_present` (line 256) `int usbhid_keyboard_present(void)`
- `usbhid_mouse_present` (line 263) `int usbhid_mouse_present(void)`
- `usbhid_counters` (line 270) `void usbhid_counters(usbhid_counters_t *out)`
- `usbhid_press_kbd_report` (line 274) `int usbhid_press_kbd_report(const unsigned char report[HID_KBD_REPORT_LEN])`
- `usbhid_set_boot_protocol` (line 295) `static int usbhid_set_boot_protocol(int device, int iface)` - *Docstring: Ask a HID device for boot protocol, so its reports use the fixed layout this driver decodes. Without it a keyboard may answer with the report-descriptor-defined layout, whose key order and size are arbitrary, * and every decode above would be a guess.*
- `usbhid_ep_taken` (line 312) `static int usbhid_ep_taken(int ep_index)` - *Docstring: True when an endpoint index is already spoken for. Two HID devices cannot share one endpoint context, so the second claim walks past the first one's index instead of reconfiguring it under the controller's * feet.*
- `usbhid_take_ep` (line 325) `static int usbhid_take_ep(int device, const xhc_iface_t *iface,
                          int *maxp)` - *Docstring: Take an interrupt IN endpoint from a claimed interface and program it, at the first free endpoint index. Returns the index, or -1 * when the interface has no interrupt IN endpoint or none can be configured.*
- `usbhid_claim` (line 353) `static int usbhid_claim(int device, const xhc_iface_t *iface, int is_mouse)` - *Docstring: Claim a HID interface as a keyboard or a mouse.  Which one it is comes from the endpoint's packet size, not from a guess on the device name or vendor: a boot keyboard endpoint is eight bytes and a boot mouse endpoint is three or four, and the reports are fixed-length by * the boot protocol, so the size is the type.*
- `usbhid_is_mouse_maxp` (line 380) `static int usbhid_is_mouse_maxp(int maxp)` - *Docstring: Endpoint packet size that distinguishes a boot keyboard (eight bytes) from a boot mouse (three or four). Anything else is a HID device * this driver does not speak, and is left alone rather than misread.*
- `usbhid_init` (line 384) `int usbhid_init(void)`
- `usbhid_poll_one` (line 422) `static int usbhid_poll_one(usbhid_dev_t *d)` - *Docstring: One interrupt-in report from a device and hand it to a decoder. The request is exactly the boot report size, because xHCI reports no byte count for a non-isochronous transfer: asking for the endpoint's maximum and accepting whatever length came back would be unsound, and asking for the report size is what the boot protocol specifies.  Never waits: at most one transfer is outstanding per device, posted on one poll and collected on a later one. An endpoint with nothing to say NAKs, which is not an event but continued silence, so a pending transfer simply stays out until it completes or ages past the budget. Either way this * function returns immediately, which is what makes it safe from the tick.*
- `usbhid_poll_keyboard` (line 485) `int usbhid_poll_keyboard(void)`
- `usbhid_poll_mouse` (line 493) `int usbhid_poll_mouse(void)`
- `usbhid_poll` (line 501) `int usbhid_poll(void)`

**Macros:**
- `USBHID_MAX_DEVS` (line 35) `#define USBHID_MAX_DEVS`
- `USBHID_INTERVAL` (line 55) `#define USBHID_INTERVAL`
- `USBHID_MAX_SCANCODES` (line 204) `#define USBHID_MAX_SCANCODES`

**Structs:**
- `usbhid_dev_t` (line 40) - *Docstring: A claimed HID interface: the device record, the endpoint index that serves it, and the previous report so the next one can be * differenced against it.*

#### `virtio_blk.c`
**Path:** `drivers/virtio_blk.c`
**File Doc:** *Docstring: drivers/virtio_blk.c -- Polled legacy virtio-blk driver.*

**Functions:**
- `vblk_outl` (line 71) `static void vblk_outl(unsigned short port, unsigned val)`
- `vblk_inl` (line 75) `static unsigned vblk_inl(unsigned short port)`
- `vblk_outb` (line 81) `static void vblk_outb(unsigned short port, unsigned char val)`
- `vblk_inb` (line 85) `static unsigned char vblk_inb(unsigned short port)`
- `vblk_inw` (line 89) `static unsigned short vblk_inw(unsigned short port)`
- `vblk_outw` (line 93) `static void vblk_outw(unsigned short port, unsigned short val)`
- `vblk_init` (line 100) `int vblk_init(void)` - *Docstring: Probe PCI for a virtio-blk device and bring queue 0 up. Idempotent: a second call reuses the live queue. Returns 1 when the * device is ready, 0 when absent or unusable (fail-closed, IDE stays).*
- `vblk_present` (line 158) `int vblk_present(void)` - *{ unsigned long cap_lo = vblk_inl(vblk_iobase + 0x14); unsigned long cap_hi = vblk_inl(vblk_iobase + 0x18); (void)cap_hi; vblk_capacity = cap_lo; } vblk_outb(vblk_iobase + 0x12, VBLK_F_ACK | VBLK_F_DRIVER | VBLK_F_OK | VBLK_F_DRIVER_OK); vblk_last_used = 0; vblk_on = 1; return 1; } /** Docstring: True once vblk_init brought the queue up.*
- `vblk_sectors` (line 163) `unsigned long vblk_sectors(void)` - *} vblk_outb(vblk_iobase + 0x12, VBLK_F_ACK | VBLK_F_DRIVER | VBLK_F_OK | VBLK_F_DRIVER_OK); vblk_last_used = 0; vblk_on = 1; return 1; } /** Docstring: True once vblk_init brought the queue up. int vblk_present(void) { return vblk_on; } /** Docstring: Device capacity in 512-byte sectors (0 when absent).*
- `vblk_desc` (line 167) `static void vblk_desc(unsigned idx, unsigned long addr, unsigned len,
        unsigned short flag...`
- `vblk_avail_idx` (line 183) `static unsigned short vblk_avail_idx(void)`
- `vblk_avail_push` (line 188) `static void vblk_avail_push(unsigned short head)`
- `vblk_used_idx` (line 199) `static unsigned short vblk_used_idx(void)`
- `vblk_request` (line 212) `static int vblk_request(unsigned dir, unsigned long sector,
        unsigned char *buf, unsigned ...` - *Docstring: One synchronous request. dir 0 reads sectors into buf, 1 writes them out. Single head descriptor reused every call (one in flight at a time: the shell and the block cache never overlap device access on one CPU, and SMP callers serialize on fs_lock upstream). The header and status byte live in the heap alongside the queue: stale statics would sit in the KASLR-slid image where VA != PA, and the device would DMA to the wrong RAM while the guest polls a status byte that never changes. Bounded poll, * fail-closed past the deadline.*
- `vblk_write_sectors` (line 266) `int vblk_write_sectors(unsigned lba, unsigned count, const void *buf)` - *Docstring: Write count sectors from buf at lba. The caller buffer is DMA-safe by construction (identity-mapped heap/user pages), so it is handed to the device directly, never bounced. Chunks like * the read path past 16 sectors.*
- `vblk_ops_read` (line 282) `static int vblk_ops_read(device_t *dev, unsigned lba, unsigned count,
        void *buf)` - *Docstring: Registry ops for the block layer dispatch. Same shape as * the ide0 table, so block_dev_read/write resolve vblk0 by name.*
- `vblk_ops_write` (line 289) `static int vblk_ops_write(device_t *dev, unsigned lba, unsigned count,
        const void *buf)` - *Docstring: Registry ops for the block layer dispatch. Same shape as * the ide0 table, so block_dev_read/write resolve vblk0 by name. static int vblk_ops_read(device_t *dev, unsigned lba, unsigned count, void *buf) { (void)dev; return vblk_read_sectors(lba, count, buf); } /** Docstring: Registry write op, const buffer through the queue.*
- `vblk_ops_total` (line 296) `static unsigned vblk_ops_total(device_t *dev)` - *static int vblk_ops_read(device_t *dev, unsigned lba, unsigned count, void *buf) { (void)dev; return vblk_read_sectors(lba, count, buf); } /** Docstring: Registry write op, const buffer through the queue. static int vblk_ops_write(device_t *dev, unsigned lba, unsigned count, const void *buf) { (void)dev; return vblk_write_sectors(lba, count, buf); } /** Docstring: Registry capacity op, sectors behind the queue.*
- `vblk_ops_present` (line 302) `static int vblk_ops_present(device_t *dev)` - */** Docstring: Registry write op, const buffer through the queue. static int vblk_ops_write(device_t *dev, unsigned lba, unsigned count, const void *buf) { (void)dev; return vblk_write_sectors(lba, count, buf); } /** Docstring: Registry capacity op, sectors behind the queue. static unsigned vblk_ops_total(device_t *dev) { (void)dev; return (unsigned)vblk_sectors(); } /** Docstring: Registry presence op, true once the queue is up.*
- `vblk_register_device` (line 327) `void vblk_register_device(void)` - *Docstring: Publish vblk0 for the block layer preference. Boot-time only, before sti, like the ide0 registration; re-registration is a * no-op (duplicate refused).*

**Macros:**
- `VBLK_VENDOR` (line 28) `#define VBLK_VENDOR`
- `VBLK_DEV_LEGACY` (line 29) `#define VBLK_DEV_LEGACY`
- `VBLK_DEV_TRANS` (line 30) `#define VBLK_DEV_TRANS`
- `VBLK_F_ACK` (line 32) `#define VBLK_F_ACK`
- `VBLK_F_DRIVER` (line 33) `#define VBLK_F_DRIVER`
- `VBLK_F_OK` (line 34) `#define VBLK_F_OK`
- `VBLK_F_DRIVER_OK` (line 35) `#define VBLK_F_DRIVER_OK`
- `VBLK_QNUM` (line 37) `#define VBLK_QNUM`
- `VBLK_DESC_SZ` (line 38) `#define VBLK_DESC_SZ`
- `VBLK_AVAIL_OFF` (line 43) `#define VBLK_AVAIL_OFF`
- `VBLK_USED_OFF` (line 44) `#define VBLK_USED_OFF`
- `VBLK_QAREA` (line 45) `#define VBLK_QAREA`
- `VBLK_DESC_NEXT` (line 47) `#define VBLK_DESC_NEXT`
- `VBLK_DESC_WRITE` (line 48) `#define VBLK_DESC_WRITE`
- `VBLK_REQ_IN` (line 50) `#define VBLK_REQ_IN`
- `VBLK_REQ_OUT` (line 51) `#define VBLK_REQ_OUT`
- `VBLK_TMO_MS` (line 53) `#define VBLK_TMO_MS`
- `VBLK_SECTOR` (line 54) `#define VBLK_SECTOR`

**Structs:**
- `vblk_req_t` (line 56)

#### `virtio_net.c`
**Path:** `drivers/virtio_net.c`
**File Doc:** *Docstring: drivers/virtio_net.c -- Polled legacy virtio-net driver.*

**Functions:**
- `vnet_outb` (line 81) `static void vnet_outb(unsigned short port, unsigned char v)`
- `vnet_outw` (line 85) `static void vnet_outw(unsigned short port, unsigned short v)`
- `vnet_outl` (line 89) `static void vnet_outl(unsigned short port, unsigned v)`
- `vnet_inb` (line 93) `static unsigned char vnet_inb(unsigned short port)`
- `vnet_inw` (line 99) `static unsigned short vnet_inw(unsigned short port)`
- `vnet_inl` (line 105) `static unsigned vnet_inl(unsigned short port)`
- `vnet_queue_up` (line 114) `static unsigned vnet_queue_up(unsigned qsel)` - *Docstring: Bring one queue up: negotiate no features, size it, publish its page area, return its depth. Shared by RX and TX so * the two setups cannot drift apart.*
- `vnet_desc` (line 144) `static void vnet_desc(unsigned char *page, unsigned idx, unsigned long addr,
        unsigned len...` - *vnet_outl(vnet_io + 0x08, (unsigned)pfn); if (qsel == VNET_Q_RX) { vnet_rx_page = page; vnet_rx_used = page + VNET_USED_OFF; vnet_rx_qnum = qmax; } else { vnet_tx_page = page; vnet_tx_used = page + VNET_USED_OFF; vnet_tx_qnum = qmax; } return qmax; } /** Docstring: Write one descriptor into the given queue area.*
- `vnet_avail_push` (line 161) `static void vnet_avail_push(unsigned char *page, unsigned qnum,
        unsigned short head)` - *unsigned i; for (i = 0; i < 8; i++) d[i] = (unsigned char)((addr >> (i * 8)) & 0xFFu); d[8] = (unsigned char)(len & 0xFFu); d[9] = (unsigned char)((len >> 8) & 0xFFu); d[10] = (unsigned char)((len >> 16) & 0xFFu); d[11] = (unsigned char)((len >> 24) & 0xFFu); d[12] = (unsigned char)(flags & 0xFFu); d[13] = (unsigned char)((flags >> 8) & 0xFFu); d[14] = (unsigned char)(next & 0xFFu); d[15] = (unsigned char)((next >> 8) & 0xFFu); } /** Docstring: Push one head descriptor index onto a queue avail ring.*
- `vnet_used_idx` (line 174) `static unsigned short vnet_used_idx(unsigned char *used)` - */** Docstring: Push one head descriptor index onto a queue avail ring. static void vnet_avail_push(unsigned char *page, unsigned qnum, unsigned short head) { unsigned char *a = page + VNET_AVAIL_OFF; unsigned short idx = (unsigned short)(a[2] | (a[3] << 8)); unsigned off = 4u + (unsigned)(idx % (unsigned short)qnum) * 2u; a[off] = (unsigned char)(head & 0xFFu); a[off + 1] = (unsigned char)((head >> 8) & 0xFFu); idx++; a[2] = (unsigned char)(idx & 0xFFu); a[3] = (unsigned char)((idx >> 8) & 0xFFu); } /** Docstring: Read the used-ring index of a queue area.*
- `unusable` (line 181) `* unusable (fail-closed, rtl8139 stays). */
int vnet_init(void)`
- `vnet_present` (line 223) `int vnet_present(void)` - *vnet_desc(vnet_rx_page, i, (unsigned long)(vnet_rx_bufs + i * VNET_RX_SIZE), VNET_RX_SIZE, VNET_DESC_WRITE, 0u); vnet_avail_push(vnet_rx_page, vnet_rx_qnum, (unsigned short)i); } vnet_outb(vnet_io + 0x12, VNET_F_ACK | VNET_F_DRIVER | VNET_F_OK | VNET_F_DRIVER_OK); vnet_rx_last = 0; vnet_tx_last = 0; vnet_on = 1; return 1; } /** Docstring: True once vnet_init brought the queues up.*
- `vnet_get_mac` (line 228) `void vnet_get_mac(unsigned char out[6])` - *vnet_outb(vnet_io + 0x12, VNET_F_ACK | VNET_F_DRIVER | VNET_F_OK | VNET_F_DRIVER_OK); vnet_rx_last = 0; vnet_tx_last = 0; vnet_on = 1; return 1; } /** Docstring: True once vnet_init brought the queues up. int vnet_present(void) { return vnet_on; } /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes).*
- `vnet_iobase` (line 234) `unsigned short vnet_iobase(void)` - *} /** Docstring: True once vnet_init brought the queues up. int vnet_present(void) { return vnet_on; } /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]) { unsigned i; for (i = 0; i < 6; i++) out[i] = vnet_mac[i]; } /** Docstring: The NIC I/O base, or 0 when the device is absent.*
- `vnet_counters` (line 239) `void vnet_counters(unsigned int *tx_frames, unsigned int *rx_frames)` - *} /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]) { unsigned i; for (i = 0; i < 6; i++) out[i] = vnet_mac[i]; } /** Docstring: The NIC I/O base, or 0 when the device is absent. unsigned short vnet_iobase(void) { return vnet_io; } /** Docstring: Frame-level TX/RX counters.*
- `vnet_link_up` (line 277) `int vnet_link_up(void)` - *vnet_avail_push(vnet_tx_page, vnet_tx_qnum, 0u); vnet_outw(vnet_io + 0x10, (unsigned short)VNET_Q_TX); deadline = ktime_ms() + VNET_TMO_MS; while (vnet_used_idx(vnet_tx_used) == vnet_tx_last) { if (ktime_ms() > deadline) return 0; __asm__ volatile("pause"); } vnet_tx_last = vnet_used_idx(vnet_tx_used); (void)vnet_inb(vnet_io + 0x13); vnet_tx_packets++; return 1; } /** Docstring: Link-up status from the config space.*
- `vnet_poll` (line 287) `void vnet_poll(void)` - *Docstring: Drain completed RX buffers into net_rx_handle_frame, reposting every descriptor. The 10-byte device header is skipped; frames outside 14..1514 payload bytes are dropped and counted, * exactly like the rtl8139 path. Bounded per call, never blocks.*

**Macros:**
- `VNET_VENDOR` (line 29) `#define VNET_VENDOR`
- `VNET_DEV_LEGACY` (line 30) `#define VNET_DEV_LEGACY`
- `VNET_DEV_TRANS` (line 31) `#define VNET_DEV_TRANS`
- `VNET_F_ACK` (line 33) `#define VNET_F_ACK`
- `VNET_F_DRIVER` (line 34) `#define VNET_F_DRIVER`
- `VNET_F_OK` (line 35) `#define VNET_F_OK`
- `VNET_F_DRIVER_OK` (line 36) `#define VNET_F_DRIVER_OK`
- `VNET_QNUM` (line 38) `#define VNET_QNUM`
- `VNET_DESC_SZ` (line 39) `#define VNET_DESC_SZ`
- `VNET_AVAIL_OFF` (line 40) `#define VNET_AVAIL_OFF`
- `VNET_USED_OFF` (line 41) `#define VNET_USED_OFF`
- `VNET_QAREA` (line 42) `#define VNET_QAREA`
- `VNET_DESC_NEXT` (line 44) `#define VNET_DESC_NEXT`
- `VNET_DESC_WRITE` (line 45) `#define VNET_DESC_WRITE`
- `VNET_Q_RX` (line 47) `#define VNET_Q_RX`
- `VNET_Q_TX` (line 48) `#define VNET_Q_TX`
- `VNET_HDR_LEN` (line 50) `#define VNET_HDR_LEN`
- `VNET_RX_BUFS` (line 51) `#define VNET_RX_BUFS`
- `VNET_RX_SIZE` (line 52) `#define VNET_RX_SIZE`
- `VNET_TX_SIZE` (line 53) `#define VNET_TX_SIZE`
- `VNET_MIN_FRAME` (line 54) `#define VNET_MIN_FRAME`
- `VNET_MAX_FRAME` (line 55) `#define VNET_MAX_FRAME`
- `VNET_TMO_MS` (line 56) `#define VNET_TMO_MS`
- `VNET_POLL_MAX` (line 57) `#define VNET_POLL_MAX`
- `VNET_CFG_MAC` (line 59) `#define VNET_CFG_MAC`
- `VNET_CFG_STATUS` (line 60) `#define VNET_CFG_STATUS`
- `VNET_ST_LINK_UP` (line 61) `#define VNET_ST_LINK_UP`

#### `xhci.c`
**Path:** `drivers/xhci.c`
**File Doc:** *xhci.c -- xHCI host controller driver, polled event ring.*

**Imported by:** `test_usbblk.c`, `test_usbhid.c`, `test_xhci.c`

**Functions:**
- `xhc_ep_b` (line 296) `static unsigned xhc_ep_b(void)`
- `xhc_stride` (line 300) `static unsigned xhc_stride(void)`
- `xhc_put32` (line 327) `static void xhc_put32(unsigned char *base, unsigned off, unsigned val)`
- `xhc_get32` (line 334) `static unsigned xhc_get32(const unsigned char *base, unsigned off)`
- `xhc_put64` (line 339) `static void xhc_put64(unsigned char *base, unsigned off,
                      unsigned long long...`
- `xhc_put16` (line 345) `static void xhc_put16(unsigned char *base, unsigned off, unsigned val)`
- `xhc_puttrb` (line 350) `static void xhc_puttrb(xhc_trb_t *trb, unsigned long long param,
                       unsigned ...`
- `xhc_op_read32` (line 359) `static unsigned xhc_op_read32(unsigned off)`
- `xhc_op_write32` (line 363) `static void xhc_op_write32(unsigned off, unsigned val)`
- `xhc_run_write32` (line 367) `static void xhc_run_write32(unsigned off, unsigned val)`
- `xhc_run_read32` (line 371) `static unsigned xhc_run_read32(unsigned off)`
- `xhc_now_ms` (line 375) `static unsigned long xhc_now_ms(void)`
- `xhc_flush` (line 386) `static void xhc_flush(const void *p, unsigned long len)` - *Docstring: Write back and invalidate the cache lines covering a range the controller can reach. QEMU (and non-coherent silicon) reads device memory out of RAM rather than out of the CPU's caches, so a TRB that is still dirty in a write-back line is invisible to the controller, and an event TRB the controller just wrote is invisible to a guest that holds a stale cached copy. Flushing both hands the buffer over explicitly. On coherent * hardware this is a cheap no-op for correctness, never a requirement.*
- `xhc_idle` (line 393) `static void xhc_idle(unsigned spin)`
- `xhc_slot_ctx` (line 400) `static unsigned char *xhc_slot_ctx(int slot)` - *--- Context addressing ---- * Device context N lives at xhc_ctx + N * stride; slot 0 is unused.*
- `xhc_ep_ctx` (line 404) `static unsigned char *xhc_ep_ctx(int slot, int ep)`
- `xhc_in_slot` (line 409) `static unsigned char *xhc_in_slot(void)`
- `xhc_in_ep` (line 413) `static unsigned char *xhc_in_ep(int ci)`
- `xhc_ep_ctx_build` (line 418) `static void xhc_ep_ctx_build(unsigned char *ep, unsigned type,
                             unsig...` - *static unsigned char *xhc_ep_ctx(int slot, int ep) { return xhc_slot_ctx(slot) + xhc_ep_b() + (unsigned long)(unsigned)ep * xhc_ep_b(); } static unsigned char *xhc_in_slot(void) { return xhc_in_ctx + xhc_ep_b(); } static unsigned char *xhc_in_ep(int ci) { return xhc_in_slot() + xhc_ep_b() + (unsigned long)(unsigned)ci * xhc_ep_b(); } /** Docstring: Build one 32-byte endpoint context per spec Table 140.*
- `xhc_slot_ctx_build` (line 439) `static void xhc_slot_ctx_build(unsigned char *sc, unsigned speed,
                               ...` - *dw0 = ((mult & 0x3u) << XHC_EP_MULT_SHIFT) | ((interval & 0xFFu) << XHC_EP_INTERVAL_SHIFT); dw1 = (XHC_EP_CERR & 0x3u) | ((type & 0x7u) << XHC_EP_TYPE_SHIFT) | ((burst & 0xFFu) << XHC_EP_BURST_SHIFT) | ((maxp & 0xFFFFu) << XHC_EP_MAXP_SHIFT); xhc_put32(ep, XHC_EP_DW0_OFF, dw0); xhc_put32(ep, XHC_EP_DW1_OFF, dw1); xhc_put64(ep, XHC_EP_DEQ_OFF, (dequeue & ~0xFu) | (dcs ? XHC_EP_DCS_BIT : 0u)); xhc_put32(ep, XHC_EP_AVG_OFF, 8u); } /** Docstring: Build one 32-byte slot context: speed, entries and root port.*
- `xhc_arm_link_trb` (line 458) `static void xhc_arm_link_trb(xhc_trb_t *ring, unsigned gen)` - *Docstring: Toggle-cycle bit of a Link TRB. Set, so the controller toggles its expected cycle when it follows the link instead of reading the next * generation as stale. #define XF_LINK_TC 2u /** Docstring: Arm the link TRB with the current generation.*
- `xhc_arm_link` (line 465) `static void xhc_arm_link(void)`
- `xhc_cmd_wrap` (line 477) `static void xhc_cmd_wrap(void)`
- `xhc_cmd_maybe_arm` (line 483) `static void xhc_cmd_maybe_arm(void)`
- `xhc_cmd_slot` (line 494) `static xhc_trb_t *xhc_cmd_slot(void)` - *Docstring: Fill one command-ring slot without ringing the doorbell. The caller batches its TRBs and rings once. Wraps instead of refusing: a ring that goes deaf after 1023 commands turns a long-lived machine * into a hang.*
- `xhc_cmd_ring_doorbell` (line 506) `static void xhc_cmd_ring_doorbell(void)` - *Docstring: Ring the command doorbell. Per spec section 5.4 the host controller doorbell is array entry 0 written with target 0: the controller * tracks the ring itself and any other value is undefined.*
- `xhc_slot_doorbell` (line 519) `static void xhc_slot_doorbell(int slot, int ep)` - *Docstring: Ring a slot doorbell for endpoint context index ep: DCI is the * index plus one, and EP0 rings target 1.*
- `xhc_evt_next` (line 535) `static xhc_trb_t *xhc_evt_next(void)` - *Docstring: Next event TRB, or 0 when the ring is empty.  The cycle bit separates generations, so a slot the controller has not written reads as "not mine" and the drain stops without needing a count. The read is fenced before the slot is released, or the next poll re-reads * a stale cached copy as a fresh event.*
- `xhc_evt_trb_ptr` (line 552) `static xhc_trb_t *xhc_evt_trb_ptr(xhc_trb_t *ev)` - *Docstring: The TRB a completion names, as a host pointer. The value is a physical address and the kernel is identity mapped there, which is the * reason every ring here is a heap object.*
- `xhc_evt_advance` (line 559) `static void xhc_evt_advance(void)` - *Docstring: Tell the controller the event ring was drained: ERDP advances to the dequeue pointer with EHB set to clear the handler-busy latch, so a * poll that never reports back stalls the ring after one segment.*
- `xhc_pending_claim_len` (line 570) `static int xhc_pending_claim_len(xhc_trb_t *trb, unsigned len)`
- `xhc_pending_claim` (line 586) `static int xhc_pending_claim(xhc_trb_t *trb)`
- `xhc_pending_drop` (line 590) `static void xhc_pending_drop(int token)`
- `xhc_poll` (line 595) `int xhc_poll(void)`
- `xhc_wait` (line 638) `static int xhc_wait(int token, unsigned budget_ms)` - *Docstring: Wait for a pending transfer to complete. Returns 1 on completion, 0 on timeout, and drops the claim either way so a timed-out * waiter cannot hold the table shut forever.*
- `xhc_status` (line 654) `static int xhc_status(int token)` - *if (token < 1 || token > XHC_MAX_PENDING) return 0; end = xhc_now_ms() + budget_ms; for (;;) { xhc_poll(); if (xhc_pending[token - 1].done) return 1; if ((long)(xhc_now_ms() - end) >= 0) { xhc_pending_drop(token); return 0; } xhc_idle(256); } } /** Docstring: Outcome of a completed transfer.*
- `xhc_cmd_run_ep` (line 663) `static int xhc_cmd_run_ep(unsigned type, unsigned long long param,
                            un...` - *Docstring: Submit one command TRB and wait for its completion, by TRB pointer so a completion for anything else is counted rather than handed to the wrong waiter. Returns 1 when the controller reported success, 0 * otherwise, with the raw completion code and any returned slot id.*
- `xhc_cmd_run` (line 709) `static int xhc_cmd_run(unsigned type, unsigned long long param, unsigned slot,
                  ...`
- `xhc_ep_command` (line 719) `static int xhc_ep_command(unsigned type, int slot, int dci)` - *Docstring: Stop, reset and re-point one endpoint's transfer ring. Stop works from any state and drops whatever the endpoint was chewing on; reset clears a halt; set-dequeue hands the ring back at the producer's current position with its generation, so a Bulk-Only recovery can * continue on the same ring instead of rebuilding the endpoint.*
- `xhc_reset_endpoint` (line 723) `int xhc_reset_endpoint(int index, int ep_index)`
- `xhc_port_count` (line 749) `int xhc_port_count(void)`
- `xhc_port_state` (line 753) `int xhc_port_state(int port, xhc_port_t *out)`
- `xhc_port_reset` (line 776) `int xhc_port_reset(int port)` - *Docstring: Ask a port to reset, and wait for it to settle. Per spec the reset bit is PORTSC bit 4: set it with the W1C change bits written clear, * then wait for PED set and PR clear. Returns 1 on a connected device.*
- `xhc_device_count` (line 806) `int xhc_device_count(void)`
- `xhc_device_info` (line 814) `int xhc_device_info(int index, xhc_dev_t *out)`
- `xhc_dev_alloc` (line 833) `static int xhc_dev_alloc(void)` - *out->address = 0; } if (index < 0 || index >= XHC_MAX_DEVICES) return 0; if (!xhc_devs[index].used) return 0; if (out) { out->slot = xhc_devs[index].slot; out->port = xhc_devs[index].port; out->speed = xhc_devs[index].speed; out->address = xhc_devs[index].address; } return 1; } /** Docstring: Allocate a free device record, or -1.*
- `xhc_dev_release` (line 843) `static void xhc_dev_release(int index)` - *Docstring: Release one device record after a failed enumeration: its EP0 ring and cached descriptor go back, so a retry starts clean instead of * refusing on its own leftover ring.*
- `xhc_open_interface` (line 863) `int xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto,
                   ...`
- `xhc_ring_wrap` (line 936) `static void xhc_ring_wrap(int index, xhc_ring_t *ring, int ep)` - *Docstring: Wrap a transfer ring instead of refusing after a thousand transfers: the producer goes back to slot zero with the toggled generation and the endpoint context DCS follows it at once, while the link keeps the old generation until the producer is halfway round (see xhc_cmd_rearm: re-arming at the wrap itself races the controller * into reading the link stale and the ring stops forever).*
- `xhc_ring_maybe_arm` (line 949) `static void xhc_ring_maybe_arm(xhc_ring_t *ring)`
- `xhc_ep0_slot` (line 959) `static xhc_trb_t *xhc_ep0_slot(int index)` - *Docstring: Post one TRB on a device EP0 transfer ring, wrapping instead of refusing. The gate is the ring, not the used flag: control transfers * run during enumeration, before the record is marked used.*
- `xhc_ep0_bump` (line 971) `static void xhc_ep0_bump(int index)`
- `xhc_control_stage` (line 979) `static int xhc_control_stage(int index, const unsigned char setup[8],
                           ...` - *Docstring: One control transfer on the device EP0 transfer ring: a setup TRB with IDT, an optional data TRB and a status TRB with IOC, behind one * slot doorbell. Only the status stage is waited on.*
- `xhc_control` (line 1048) `int xhc_control(int index, const unsigned char setup[8], void *data,
                unsigned len...` - *Docstring: USB is lossy and emulated controllers occasionally drop a completion, so a control transfer retries its whole setup-data-status stage up to three times before reporting failure. A stall or a refused * stage is not retried: only a missing or failed completion is. define XHC_CONTROL_TRIES 3u*
- `xhc_setup_nodata` (line 1069) `static void xhc_setup_nodata(unsigned char *setup, unsigned char type,
                          ...` - *Docstring: Pack a standard request with no data stage: bmRequestType, * bRequest, wValue, wIndex.*
- `xhc_setup_data` (line 1082) `static void xhc_setup_data(unsigned char *setup, unsigned char type,
                           u...` - *Docstring: Pack a standard request with a data stage of a known length: * same as above with wLength filled in.*
- `xhc_dci` (line 1093) `static int xhc_dci(int ep_addr)` - *Docstring: Endpoint context index for a USB endpoint address: DCI is one * plus twice the endpoint number plus the direction, with EP0 at DCI 1.*
- `xhc_configure_endpoint` (line 1100) `int xhc_configure_endpoint(int index, int ep_index, int ep_addr, int ep_type,
                   ...`
- `xhc_ep_post` (line 1162) `static int xhc_ep_post(int index, int ep_index, void *buf, unsigned len)` - *Docstring: Post one Normal TRB with IOC on an endpoint's ring and ring its * slot doorbell. Returns the pending token, or 0 on refusal.*
- `xhc_got` (line 1197) `static int xhc_got(int token)` - *len & 0x1FFFFu, (unsigned)(XHC_TRB_MAKE_TYPE(XHC_TRB_TYPE_NORMAL) | ring->gen | XHC_TRB_IOC)); xhc_flush(trb, sizeof(*trb)); if (ring->is_out) xhc_flush(buf, len); slot = xhc_devs[index].slot; hal_mmio_wmb(); hal_mmio_write32( (volatile unsigned *)(xhc_db + (unsigned)slot * XHC_DB_STRIDE), (unsigned)ring->dci); return token; } /** Docstring: Actual bytes moved, for short-packet honesty.*
- `xhc_transfer` (line 1202) `int xhc_transfer(int index, int ep_index, void *buf, unsigned len, int *got)`
- `xhc_transfer_async` (line 1222) `int xhc_transfer_async(int index, int ep_index, void *buf, unsigned len)` - *Docstring: Post one endpoint transfer without waiting: the completion arrives on the event ring and is collected by xhc_poll_token. Returns the * token, or 0 on refusal.*
- `xhc_poll_token_limit` (line 1233) `int xhc_poll_token_limit(int token, unsigned budget_ms)` - *Docstring: Non-blocking completion check for xhc_transfer_async. Drains the ring, then reports 1 on success, -1 on a failed completion, -2 on a wait past the budget, and 0 while still outstanding. Consumed tokens are dropped, so a caller that polls to completion never leaks the table. A zero budget never expires: an interrupt endpoint with nothing to say answers NAK rather than an event, and expiring its only transfer orphans * the report it eventually delivers to a token nobody holds.*
- `xhc_poll_token` (line 1252) `int xhc_poll_token(int token)`
- `xhc_address` (line 1261) `static int xhc_address(int index, int slot, int port, int speed)` - *Docstring: Enable a slot and build its device context with a working control endpoint on its own transfer ring. The input context adds the slot * and EP0; the DCBAA entry points at the output device context.*
- `xhc_get_device_desc` (line 1316) `static int xhc_get_device_desc(int index, unsigned char *buf)` - *Docstring: Fetch the device descriptor. wValue packs the descriptor type * above the index: a device descriptor is type 1, so 0x0100, not zero.*
- `xhc_get_config_desc` (line 1333) `static int xhc_get_config_desc(int index, unsigned char *buf, unsigned *len)` - *Docstring: Fetch the configuration descriptor.  The first request is for nine bytes, which is the fixed prefix every USB configuration descriptor starts with and the only place wTotalLength lives. Asking for the maximum on the first request instead is the classic mistake: a device with a longer descriptor set answers with wTotalLength bytes, and one with a shorter set answers a short packet, so either way the caller cannot tell how much it got without reading the length back first. The second request asks for that length, capped at XHC_MAX_CONFIG_DESC, and the length reported back is re-read from the device so a truncated copy is * never described as complete.*
- `xhc_enumerate` (line 1358) `int xhc_enumerate(int port)`
- `xhc_enumerate_all` (line 1444) `int xhc_enumerate_all(void)`
- `xhc_outl` (line 1454) `static void xhc_outl(unsigned short port, unsigned val)`
- `xhc_inl` (line 1458) `static unsigned xhc_inl(unsigned short port)`
- `xhc_free_all` (line 1464) `static void xhc_free_all(void)`
- `xhc_alloc_all` (line 1494) `static int xhc_alloc_all(unsigned max_slots)` - *Docstring: Allocate the command ring, the event ring, the ERST, the DCBAA and the context array. Returns 1 on success; on any failure everything allocated so far is released, so a controller that runs out of memory * leaves no half-built rings behind.*
- `xhc_start` (line 1593) `static int xhc_start(unsigned contexts)` - *Docstring: Reset the controller, program its ring state, and bring it to run. Returns 1 when it leaves reset and reports itself un-halted, 0 on a reset or run timeout. Both waits are bounded: an unbounded spin here is an unusable machine, not a slow one.  The order is the whole trick, and getting it backwards produces a driver that appears to hang forever: HCRESET clears the command ring pointer, the DCBAA pointer, CONFIG and every interrupter register, so a sequence that programs the rings first and then resets leaves the controller running with nothing programmed and no command ever completing. Reset, then program, then * Run.*
- `xhc_init` (line 1658) `int xhc_init(void)`
- `xhc_counters` (line 1790) `void xhc_counters(xhc_counters_t *out)`
- `xhc_probe_note` (line 1794) `const char *xhc_probe_note(void)`
- `xhc_info` (line 1798) `int xhc_info(unsigned *version, unsigned *slots, unsigned *ports,
             unsigned *caplength)`

**Macros:**
- `XHC_CAP_OFF` (line 55) `#define XHC_CAP_OFF`
- `XHC_OP_USBCMD` (line 58) `#define XHC_OP_USBCMD`
- `XHC_OP_USBSTS` (line 59) `#define XHC_OP_USBSTS`
- `XHC_OP_PAGESIZE` (line 60) `#define XHC_OP_PAGESIZE`
- `XHC_OP_CRCR` (line 61) `#define XHC_OP_CRCR`
- `XHC_OP_DCBAAP` (line 62) `#define XHC_OP_DCBAAP`
- `XHC_OP_CONFIG` (line 63) `#define XHC_OP_CONFIG`
- `XHC_OP_PORTSC` (line 64) `#define XHC_OP_PORTSC`
- `XHC_PORT_STRIDE` (line 65) `#define XHC_PORT_STRIDE`
- `XHC_RUN_INTR0` (line 71) `#define XHC_RUN_INTR0`
- `XHC_RUN_IMAN` (line 72) `#define XHC_RUN_IMAN`
- `XHC_RUN_IMOD` (line 73) `#define XHC_RUN_IMOD`
- `XHC_RUN_ERSTSZ` (line 74) `#define XHC_RUN_ERSTSZ`
- `XHC_RUN_ERSTBA` (line 75) `#define XHC_RUN_ERSTBA`
- `XHC_RUN_ERDP` (line 76) `#define XHC_RUN_ERDP`
- `XHC_IMAN_IP` (line 77) `#define XHC_IMAN_IP`
- `XHC_IMAN_IE` (line 78) `#define XHC_IMAN_IE`
- `XHC_ERDP_EHB` (line 79) `#define XHC_ERDP_EHB`
- `XHC_CAP_HCSP1` (line 82) `#define XHC_CAP_HCSP1`
- `XHC_CAP_HCSP2` (line 83) `#define XHC_CAP_HCSP2`
- `XHC_CAP_HCSP3` (line 84) `#define XHC_CAP_HCSP3`
- `XHC_CAP_HCCP1` (line 85) `#define XHC_CAP_HCCP1`
- `XHC_CAP_DBOFF` (line 86) `#define XHC_CAP_DBOFF`
- `XHC_CAP_RTSOFF` (line 87) `#define XHC_CAP_RTSOFF`
- `XHC_HCC_AC64` (line 88) `#define XHC_HCC_AC64`
- `XHC_HCC_CSZ` (line 89) `#define XHC_HCC_CSZ`
- `XHC_CMD_RUN` (line 92) `#define XHC_CMD_RUN`
- `XHC_CMD_RESET` (line 93) `#define XHC_CMD_RESET`
- `XHC_STS_HALTED` (line 96) `#define XHC_STS_HALTED`
- `XHC_STS_ATE` (line 97) `#define XHC_STS_ATE`
- `XHC_PORT_CCS` (line 100) `#define XHC_PORT_CCS`
- `XHC_PORT_PED` (line 101) `#define XHC_PORT_PED`
- `XHC_PORT_PR` (line 102) `#define XHC_PORT_PR`
- `XHC_PORT_PP` (line 103) `#define XHC_PORT_PP`
- `XHC_PORT_SPEED_SHIFT` (line 104) `#define XHC_PORT_SPEED_SHIFT`
- `XHC_PORT_SPEED_MASK` (line 105) `#define XHC_PORT_SPEED_MASK`
- `XHC_PORT_CHG_MASK` (line 106) `#define XHC_PORT_CHG_MASK`
- `XHC_TRB_TYPE` (line 109) `#define XHC_TRB_TYPE(t)`
- `XHC_TRB_CYCLE` (line 110) `#define XHC_TRB_CYCLE(t)`
- `XHC_TRB_MAKE_TYPE` (line 111) `#define XHC_TRB_MAKE_TYPE(v)`
- `XHC_TRB_TYPE_NORMAL` (line 113) `#define XHC_TRB_TYPE_NORMAL`
- `XHC_TRB_TYPE_SETUP` (line 114) `#define XHC_TRB_TYPE_SETUP`
- `XHC_TRB_TYPE_DATA` (line 115) `#define XHC_TRB_TYPE_DATA`
- `XHC_TRB_TYPE_STATUS` (line 116) `#define XHC_TRB_TYPE_STATUS`
- `XHC_TRB_TYPE_LINK` (line 117) `#define XHC_TRB_TYPE_LINK`
- `XHC_TRB_TYPE_NOOP_TRB` (line 118) `#define XHC_TRB_TYPE_NOOP_TRB`
- `XHC_TRB_TYPE_ENABLE_SLOT` (line 119) `#define XHC_TRB_TYPE_ENABLE_SLOT`
- `XHC_TRB_TYPE_ADDRESS_DEVICE` (line 120) `#define XHC_TRB_TYPE_ADDRESS_DEVICE`
- `XHC_TRB_TYPE_CONFIGURE_ENDPOINT` (line 121) `#define XHC_TRB_TYPE_CONFIGURE_ENDPOINT`
- `XHC_TRB_TYPE_RESET_ENDPOINT` (line 122) `#define XHC_TRB_TYPE_RESET_ENDPOINT`
- `XHC_TRB_TYPE_STOP_ENDPOINT` (line 123) `#define XHC_TRB_TYPE_STOP_ENDPOINT`
- `XHC_TRB_TYPE_SET_DEQUEUE` (line 124) `#define XHC_TRB_TYPE_SET_DEQUEUE`
- `XHC_TRB_TYPE_NOOP_CMD` (line 125) `#define XHC_TRB_TYPE_NOOP_CMD`
- `XHC_TRB_TYPE_TRANSFER_EVENT` (line 126) `#define XHC_TRB_TYPE_TRANSFER_EVENT`
- `XHC_TRB_TYPE_CMD_COMPLETION` (line 127) `#define XHC_TRB_TYPE_CMD_COMPLETION`
- `XHC_TRB_TYPE_PORT_STATUS` (line 128) `#define XHC_TRB_TYPE_PORT_STATUS`
- `XHC_CC_SUCCESS` (line 131) `#define XHC_CC_SUCCESS`
- `XHC_CC_SHORT_PACKET` (line 132) `#define XHC_CC_SHORT_PACKET`
- `XHC_EVT_TYPE` (line 135) `#define XHC_EVT_TYPE(e)`
- `XHC_EVT_CC` (line 136) `#define XHC_EVT_CC(e)`
- `XHC_EVT_SLOT` (line 137) `#define XHC_EVT_SLOT(e)`
- `XHC_EVT_LEN` (line 138) `#define XHC_EVT_LEN(e)`
- `XHC_EVT_TRANSFER` (line 139) `#define XHC_EVT_TRANSFER`
- `XHC_EVT_CMD_COMPLETION` (line 140) `#define XHC_EVT_CMD_COMPLETION`
- `XHC_EP_DW0_OFF` (line 150) `#define XHC_EP_DW0_OFF`
- `XHC_EP_DW1_OFF` (line 151) `#define XHC_EP_DW1_OFF`
- `XHC_EP_DEQ_OFF` (line 152) `#define XHC_EP_DEQ_OFF`
- `XHC_EP_AVG_OFF` (line 153) `#define XHC_EP_AVG_OFF`
- `XHC_EP_MULT_SHIFT` (line 154) `#define XHC_EP_MULT_SHIFT`
- `XHC_EP_INTERVAL_SHIFT` (line 155) `#define XHC_EP_INTERVAL_SHIFT`
- `XHC_EP_TYPE_SHIFT` (line 156) `#define XHC_EP_TYPE_SHIFT`
- `XHC_EP_BURST_SHIFT` (line 157) `#define XHC_EP_BURST_SHIFT`
- `XHC_EP_MAXP_SHIFT` (line 158) `#define XHC_EP_MAXP_SHIFT`
- `XHC_EP_DCS_BIT` (line 159) `#define XHC_EP_DCS_BIT`
- `XHC_EPT_CONTROL` (line 162) `#define XHC_EPT_CONTROL`
- `XHC_EPT_ISO_OUT` (line 163) `#define XHC_EPT_ISO_OUT`
- `XHC_EPT_BULK_OUT` (line 164) `#define XHC_EPT_BULK_OUT`
- `XHC_EPT_INT_OUT` (line 165) `#define XHC_EPT_INT_OUT`
- `XHC_EPT_ISO_IN` (line 166) `#define XHC_EPT_ISO_IN`
- `XHC_EPT_BULK_IN` (line 167) `#define XHC_EPT_BULK_IN`
- `XHC_EPT_INT_IN` (line 168) `#define XHC_EPT_INT_IN`
- `XHC_EP_CERR` (line 169) `#define XHC_EP_CERR`
- `XHC_CTX_SLOT_STRIDE` (line 173) `#define XHC_CTX_SLOT_STRIDE`
- `XHC_CTX_SLOT_STRIDE64` (line 174) `#define XHC_CTX_SLOT_STRIDE64`
- `XHC_CTX_DEVICE_BYTES` (line 175) `#define XHC_CTX_DEVICE_BYTES`
- `XHC_CTX_EP_BYTES` (line 176) `#define XHC_CTX_EP_BYTES`
- `XHC_ICTX_BYTES` (line 177) `#define XHC_ICTX_BYTES`
- `XHC_SLOT_DW0_OFF` (line 181) `#define XHC_SLOT_DW0_OFF`
- `XHC_SLOT_DW1_OFF` (line 182) `#define XHC_SLOT_DW1_OFF`
- `XHC_SLOT_ADDR_OFF` (line 183) `#define XHC_SLOT_ADDR_OFF`
- `XHC_SLOT_SPEED_SHIFT` (line 184) `#define XHC_SLOT_SPEED_SHIFT`
- `XHC_SLOT_ENTRIES_SHIFT` (line 185) `#define XHC_SLOT_ENTRIES_SHIFT`
- `XHC_SLOT_RHPORT_SHIFT` (line 186) `#define XHC_SLOT_RHPORT_SHIFT`
- `XHC_ICTX_DROP_OFF` (line 189) `#define XHC_ICTX_DROP_OFF`
- `XHC_ICTX_ADD_OFF` (line 190) `#define XHC_ICTX_ADD_OFF`
- `XHC_DCBAA_ENTRIES` (line 193) `#define XHC_DCBAA_ENTRIES`
- `XHC_ERST_RING_LO` (line 196) `#define XHC_ERST_RING_LO`
- `XHC_ERST_RING_HI` (line 197) `#define XHC_ERST_RING_HI`
- `XHC_ERST_SIZE` (line 198) `#define XHC_ERST_SIZE`
- `XHC_ERST_CYCLE` (line 199) `#define XHC_ERST_CYCLE`
- `XHC_ERST_BYTES` (line 200) `#define XHC_ERST_BYTES`
- `XHC_DMA_ALIGN` (line 212) `#define XHC_DMA_ALIGN`
- `XHC_RING_USABLE` (line 215) `#define XHC_RING_USABLE`
- `XHC_DT_DEVICE` (line 218) `#define XHC_DT_DEVICE`
- `XHC_DT_CONFIG` (line 219) `#define XHC_DT_CONFIG`
- `XHC_DT_INTERFACE` (line 220) `#define XHC_DT_INTERFACE`
- `XHC_DT_ENDPOINT` (line 221) `#define XHC_DT_ENDPOINT`
- `XHC_DEV_DESC_LEN_OFF` (line 224) `#define XHC_DEV_DESC_LEN_OFF`
- `XHC_DEV_DESC_TYPE_OFF` (line 225) `#define XHC_DEV_DESC_TYPE_OFF`
- `XHC_DEV_DESC_NUM_CFG_OFF` (line 226) `#define XHC_DEV_DESC_NUM_CFG_OFF`
- `XHC_CFG_TOTAL_LEN_OFF` (line 227) `#define XHC_CFG_TOTAL_LEN_OFF`
- `XHC_IFACE_OFF` (line 228) `#define XHC_IFACE_OFF`
- `XHC_IFACE_CLASS_OFF` (line 229) `#define XHC_IFACE_CLASS_OFF`
- `XHC_IFACE_SUBCLASS_OFF` (line 230) `#define XHC_IFACE_SUBCLASS_OFF`
- `XHC_IFACE_PROTO_OFF` (line 231) `#define XHC_IFACE_PROTO_OFF`
- `XHC_EP_DESC_ADDR_OFF` (line 232) `#define XHC_EP_DESC_ADDR_OFF`
- `XHC_EP_DESC_TYPE_OFF` (line 233) `#define XHC_EP_DESC_TYPE_OFF`
- `XHC_EP_DESC_MAXP_OFF` (line 234) `#define XHC_EP_DESC_MAXP_OFF`
- `XF_LINK_TC` (line 455) `#define XF_LINK_TC`
- `XHC_DB_STRIDE` (line 514) `#define XHC_DB_STRIDE`
- `XHC_DB_COMMAND` (line 515) `#define XHC_DB_COMMAND`
- `XHC_TRB_IOC` (line 924) `#define XHC_TRB_IOC`
- `XHC_TRB_IDT` (line 925) `#define XHC_TRB_IDT`
- `XHC_TRB_DIR` (line 926) `#define XHC_TRB_DIR`
- `XHC_TRT_OUT` (line 927) `#define XHC_TRT_OUT`
- `XHC_TRT_IN` (line 928) `#define XHC_TRT_IN`
- `XHC_CONTROL_TRIES` (line 1047) `#define XHC_CONTROL_TRIES`

**Structs:**
- `xhc_trb_t` (line 239) - *Docstring: A Transfer Request Block, 16 bytes per spec: 8-byte parameter, 4-byte status, 4-byte control. This size is load-bearing: a 24-byte struct * spaces the ring wrong and the controller walks garbage.*
- `xhc_ring_t` (line 250) - *Docstring: A non-control endpoint's transfer ring plus the producer's place in it. dci is the doorbell target and context index plus one. rearm requests a link re-arm once the producer is halfway round the new lap (see xhc_cmd_rearm: re-arming at the wrap itself races the * controller into reading the link stale).*
- `xhc_pending_t` (line 264) - *Docstring: A transfer waiting for its event. The caller-visible token is the index plus one, so 0 is always "refused" and never a valid token. since dates the post for the async reap budget. len is the asked length * and got the bytes the device actually moved, from the event's residue.*
- `xhc_devrec_t` (line 276) - *Docstring: One enumerated device, with its cached configuration * descriptor on the heap.*

#### `ext4.c`
**Path:** `fs/ext4.c`
**File Doc:** *================================================================*

**Imported by:** `test_ext4.c`

**Functions:**
- `ext_ld16` (line 32) `static unsigned ext_ld16(const unsigned char *p)`
- `ext_ld32` (line 36) `static unsigned long ext_ld32(const unsigned char *p)`
- `ext_parse_sb` (line 55) `static int ext_parse_sb(const fsimg_t *img, ext_geo_t *g)`
- `ext_inode_off` (line 92) `static int ext_inode_off(const fsimg_t *img, const ext_geo_t *g,
                         unsigne...` - *Byte offset of an inode. Group and index arithmetic is 64-bit and * fenced to the image before any read.*
- `ext_read_inode` (line 122) `static int ext_read_inode(const fsimg_t *img, const ext_geo_t *g,
                          unsig...`
- `ext_map` (line 171) `static int ext_map(const fsimg_t *img, const ext_geo_t *g,
                   const unsigned char...`
- `ext_map_leaf` (line 211) `static int ext_map_leaf(const fsimg_t *img, const ext_geo_t *g,
                        const uns...` - *} r = ext_map_down(img, g, root, nent, lblk, node); if (r <= 0) break; for (d = 0; d < 60 && d < g->bs; d++) root[d] = node[d]; r = -1; continue; } } } kfree(node); return r; } /* One leaf level: find the extent covering lblk.*
- `ext_resolve` (line 356) `static int ext_resolve(const fsimg_t *img, const ext_geo_t *g,
                       const char ...`
- `ext_file_block` (line 464) `static int ext_file_block(const fsimg_t *img, const ext_geo_t *g,
                          const...` - *Read one logical file block of an open inode into blk (block * sized). Holes and uninitialized extents come back zeroed.*
- `ext4_list` (line 485) `int ext4_list(const char *imgpath, const char *dirpath,
              char names[][EXT4_NAME_MAX ...`
- `ext_split` (line 580) `static int ext_split(const char *path, char *img, char *extp)` - *Split "imgpath:extpath" (first ':' wins; image names never carry * one). ext paths run deeper than FAT, hence the wider right side.*
- `ext4_vfs_open` (line 585) `int ext4_vfs_open(const char *path, int mode, void **handle)`
- `ext4_vfs_read` (line 626) `int ext4_vfs_read(void *handle, void *buf, unsigned long pos,
                  unsigned long len)`
- `ext4_vfs_write` (line 666) `int ext4_vfs_write(void *handle, const void *buf, unsigned long pos,
                   unsigned ...`
- `ext4_vfs_close` (line 675) `int ext4_vfs_close(void *handle)`
- `ext4_vfs_fstat` (line 680) `int ext4_vfs_fstat(void *handle, unsigned long *size_out)`
- `ext4_vfs_truncate` (line 687) `int ext4_vfs_truncate(void *handle, unsigned long size)`
- `ext4_vfs_readdir` (line 696) `static int ext4_vfs_readdir(const char *path, vfs_dirent_t *ents,
        int cap)` - *Docstring: List one ext4 directory through the VFS verb. Same split-and-wrap shape as the FAT twin: bounded heap arrays behind * the existing list helper, names copied verbatim.*
- `ext_mbr_entry` (line 745) `static int ext_mbr_entry(const unsigned char *mbr, int idx,
                         unsigned lon...` - *First Linux-native partition: MBR 0x83 first (proven by a superblock read), then a magic scan for superfloppy layouts. * Bounds and overflow discipline match the FAT prober.*
- `ext_scan_dev` (line 770) `static int ext_scan_dev(unsigned long total_sec,
                        unsigned long *base_out)`
- `ext_dev_base` (line 791) `long ext_dev_base(void)`
- `ext_map_down` (line 168) `static int ext_map_down(const fsimg_t *img, const ext_geo_t *g, const unsigned char *root, unsigned nent, unsigned long lblk, unsigned char *node);`
- `only` (line 352) `* listings only ('.' skipped, '..' refused). "" or "/" is root (2). */ static int ext_file_block(const fsimg_t *img, const ext_geo_t *g, const ext_ino_t *st, unsigned long lblk, unsigned char *blk, un`

**Macros:**
- `EXT4_SUPER_OFF` (line 18) `#define EXT4_SUPER_OFF`
- `EXT4_MAGIC` (line 19) `#define EXT4_MAGIC`
- `EXT4_EXT_MAGIC` (line 20) `#define EXT4_EXT_MAGIC`
- `EXT4_S_IFMT` (line 21) `#define EXT4_S_IFMT`
- `EXT4_S_IFREG` (line 22) `#define EXT4_S_IFREG`
- `EXT4_S_IFDIR` (line 23) `#define EXT4_S_IFDIR`
- `EXT4_S_IFLNK` (line 24) `#define EXT4_S_IFLNK`
- `EXT4_EXTENTS_FL` (line 25) `#define EXT4_EXTENTS_FL`
- `EXT4_INDEX_FL` (line 26) `#define EXT4_INDEX_FL`
- `EXT4_ENCRYPT_FL` (line 27) `#define EXT4_ENCRYPT_FL`
- `EXT4_INLINE_FL` (line 28) `#define EXT4_INLINE_FL`
- `EXT4_EXT_UNINIT` (line 29) `#define EXT4_EXT_UNINIT`
- `EXT4_MBR_LINUX` (line 30) `#define EXT4_MBR_LINUX`

**Structs:**
- `ext_geo_t` (line 44) - *Filesystem geometry from the superblock. 64-bit block counts ride along (real disks use them) but every byte offset is fenced to * the image size before use.*
- `ext_ino_t` (line 115) - *Decoded inode: kind (0 file, 1 dir), size, extent root or legacy * block list (copied, so later reads never re-parse the inode).*

#### `fat32.c`
**Path:** `fs/fat32.c`
**File Doc:** *================================================================*

**Imported by:** `test_fat32.c`

**Functions:**
- `fat_ld16` (line 18) `static unsigned fat_ld16(const unsigned char *p)`
- `fat_ld32` (line 22) `static unsigned fat_ld32(const unsigned char *p)`
- `fat_img_open` (line 29) `static int fat_img_open(const char *resolved, fsimg_t *img)` - *Open by resolved path: files first (a real file named hd0 keeps * working), the hd0 disk device only as a fallback.*
- `fat_parse_bpb` (line 62) `static int fat_parse_bpb(const fsimg_t *img, fat_geo_t *g)`
- `fat_mbr_is_fat` (line 120) `static int fat_mbr_is_fat(unsigned char t)`
- `fat_dev_base` (line 192) `long fat_dev_base(void)`
- `fat_clus_ok` (line 224) `static int fat_clus_ok(const fat_geo_t *g, unsigned c)`
- `fat_entry` (line 231) `static int fat_entry(const fsimg_t *img, const fat_geo_t *g,
                     unsigned clus, ...` - *One FAT32 entry (low 28 bits). Reads the 512 B sector holding it; the entry offset can never leave the image because the cluster is * range-checked first and the FAT region precedes data_off.*
- `fat_eoc` (line 248) `static int fat_eoc(unsigned v)`
- `fat_badch` (line 262) `static int fat_badch(char c)` - *FAT 8.3 forbids these in a query word (plus '/' and extra dots, handled by the splitter). Lowercase folds to upper like the * on-disk short names mtools writes.*
- `fat_qword` (line 274) `static int fat_qword(const char *q, unsigned qlen, char name8[8],
                     char ext3[3])` - *Uppercase one 8.3 query word ("name.ext", "name", never ".ext") into * padded 8+3 for raw comparison. Refuses overlong parts and paths.*
- `fat_match` (line 305) `static int fat_match(const unsigned char *de, const char name8[8],
                     const cha...` - *Match one 32-byte directory entry against padded 8+3. Skips * end/deleted/LFN/volume entries; the caller checks the subdir bit.*
- `fat_resolve` (line 321) `static int fat_resolve(const fsimg_t *img, const fat_geo_t *g,
                       const char ...` - *Resolve a FAT path to its first cluster, size and subdir bit. Iterative over '/'-separated 8.3 words, depth-capped; '..' and * empty middles refuse. "" or "/" is the root directory itself.*
- `fat32_list` (line 421) `int fat32_list(const char *imgpath, const char *dirpath,
               char names[][FAT32_NAME_M...`
- `fat32_vfs_open` (line 496) `int fat32_vfs_open(const char *path, int mode, void **handle)`
- `fat_views` (line 537) `static void fat_views(const fat32_handle_t *h, fsimg_t *img,
                      fat_geo_t *g)` - *h->sec_per_clus = g.sec_per_clus; h->rsvd_sec = g.rsvd_sec; h->num_fats = g.num_fats; h->fatsz_sec = g.fatsz_sec; h->root_clus = g.root_clus; h->data_off = (unsigned)g.data_off; h->nclus = g.nclus; h->start_clus = sc; h->file_size = sz; handle = h; return 0; } /* Fill the loopback backend and geometry views of an open handle.*
- `fat_seek` (line 556) `static int fat_seek(const fat32_handle_t *h, unsigned long pos,
                    unsigned *clu...` - *Advance from the file's first cluster to the one holding `pos`, * step-bounded by the cluster count so a cyclic FAT terminates.*
- `fat32_vfs_read` (line 581) `int fat32_vfs_read(void *handle, void *buf, unsigned long pos,
                   unsigned long len)`
- `fat32_vfs_write` (line 621) `int fat32_vfs_write(void *handle, const void *buf, unsigned long pos,
                    unsigne...`
- `fat32_vfs_close` (line 630) `int fat32_vfs_close(void *handle)`
- `fat32_vfs_fstat` (line 635) `int fat32_vfs_fstat(void *handle, unsigned long *size_out)`
- `fat32_vfs_truncate` (line 642) `int fat32_vfs_truncate(void *handle, unsigned long size)`

**Macros:**
- `FAT_MBR_SIG_OFF` (line 111) `#define FAT_MBR_SIG_OFF`
- `FAT_MBR_TAB_OFF` (line 112) `#define FAT_MBR_TAB_OFF`
- `FAT_MBR_ENTRY_SZ` (line 113) `#define FAT_MBR_ENTRY_SZ`
- `FAT_MBR_NENTRY` (line 114) `#define FAT_MBR_NENTRY`
- `FAT_MBR_TYPE_OFF` (line 115) `#define FAT_MBR_TYPE_OFF`
- `FAT_MBR_START_OFF` (line 116) `#define FAT_MBR_START_OFF`
- `FAT_MBR_COUNT_OFF` (line 117) `#define FAT_MBR_COUNT_OFF`
- `FAT_MBR_GPT_PROT` (line 118) `#define FAT_MBR_GPT_PROT`

**Structs:**
- `fat_geo_t` (line 51) - *Parsed BPB plus derived geometry. secs = total data clusters + 2 (cluster numbers 0/1 are reserved), so a valid cluster is * 2 <= c < nclus + 2.*

#### `fsimg.c`
**Path:** `fs/fsimg.c`
**File Doc:** *================================================================*

**Imported by:** `test_ext4.c`, `test_fat32.c`

**Functions:**
- `fsimg_open_file` (line 15) `int fsimg_open_file(const char *resolved, fsimg_t *img)`
- `fsimg_open_dev` (line 51) `int fsimg_open_dev(unsigned long base_lba, unsigned long nsec,
                   fsimg_t *img)`
- `fsimg_dev_read` (line 72) `static int fsimg_dev_read(const fsimg_t *img, unsigned long off,
                          void *...` - *Docstring: Sector reads off the active backend through the block layer, so a device image on USB reads from USB. The scratch is heap, never the caller's stack: the USB backend hands the buffer to the controller as a * physical address, which a stack address is not.*
- `fsimg_read` (line 96) `int fsimg_read(const fsimg_t *img, unsigned long off, void *buf,
               unsigned long len)`
- `fsimg_split` (line 112) `int fsimg_split(const char *path, char *left, unsigned llen,
                char *right, unsigne...`

#### `kfile.c`
**Path:** `fs/kfile.c`
**File Doc:** *================================================================*

**Functions:**
- `kfile_stdin` (line 15) `KFILE *kfile_stdin(void)`
- `kfile_stdout` (line 16) `KFILE *kfile_stdout(void)`
- `kfile_stderr` (line 17) `KFILE *kfile_stderr(void)`
- `recovery` (line 28) `* halts the machine with no recovery (the DOOM ABI-drift black screen),
 * so every public KFILE ...`
- `kfile_corrupt` (line 33) `static int kfile_corrupt(const KFILE *f)`
- `fs_take` (line 66) `static inline void fs_take(irqflags_t *flags)`
- `fs_drop` (line 70) `static inline void fs_drop(irqflags_t flags)`
- `kpipe_pair` (line 78) `int kpipe_pair(KFILE **rend_out, KFILE **wend_out)` - *Docstring: Create a connected pipe pair sharing one ring. The read end drains, the write end appends; the ring (and its refcount) dies with the last closed end. Fail-closed: any allocation failure frees * what was taken and returns -1 with both outs zeroed.*
- `kpipe_state` (line 130) `int kpipe_state(KFILE *f, unsigned *avail, unsigned *space, int *wopen, int *ropen)` - *open (retry later, EAGAIN-style), false on EOF, on the write end, or on any non-pipe file. Lets the syscall layer tell "empty" from EOF, * which kfread alone reports as 0 items in both cases. int kpipe_empty_wopen(KFILE *f) { irqflags_t flags; int r = 0; if (!f || !f->is_pipe || f->pipe_write || !f->pring) return 0; fs_take(&flags); r = (f->pring->count == 0u && f->pring->wopen) ? 1 : 0; fs_drop(flags); return r; } /** Docstring: Snapshot a pipe's ring under fs_lock (see kernel.h).*
- `kevent_create` (line 148) `KFILE *kevent_create(unsigned long long initval, int semaphore)` - *Docstring: New eventfd description with counter initval. NULL on OOM * or an initial value past KEVENT_MAX.*
- `kevent_read` (line 163) `long kevent_read(KFILE *f, unsigned long long *out)` - *KFILE *f; if (initval > KEVENT_MAX) return 0; f = kmalloc(sizeof(KFILE)); if (!f) return 0; kmemset(f, 0, sizeof(KFILE)); f->is_eventfd = 1; f->efd_semaphore = semaphore ? 1 : 0; f->efd_count = initval; f->minifs_ino = -1; f->ref = 1; return f; } /** Docstring: Take the counter (or 1 in semaphore mode). -EAGAIN at 0.*
- `kevent_readable` (line 199) `int kevent_readable(KFILE *f)` - *irqflags_t flags; long rc = -11; if (!f || !f->is_eventfd) return -22; if (v == ~0ULL) return -22; fs_take(&flags); if (v <= KEVENT_MAX - f->efd_count) { f->efd_count += v; rc = 0; } fs_drop(flags); return rc; } /** Docstring: 1 when a read would not block.*
- `kevent_writable` (line 204) `int kevent_writable(KFILE *f)` - *if (v <= KEVENT_MAX - f->efd_count) { f->efd_count += v; rc = 0; } fs_drop(flags); return rc; } /** Docstring: 1 when a read would not block. int kevent_readable(KFILE *f) { return f && f->is_eventfd && f->efd_count != 0ULL; } /** Docstring: 1 when a write of 1 would not block.*
- `kpipe_is_write_end` (line 209) `int kpipe_is_write_end(KFILE *f)` - *return rc; } /** Docstring: 1 when a read would not block. int kevent_readable(KFILE *f) { return f && f->is_eventfd && f->efd_count != 0ULL; } /** Docstring: 1 when a write of 1 would not block. int kevent_writable(KFILE *f) { return f && f->is_eventfd && f->efd_count < KEVENT_MAX; } /** Docstring: True when f is the write end of a pipe.*
- `kpipe_grow` (line 216) `static int kpipe_grow(pipe_ring_t *ring)` - *Docstring: Grow a pipe ring buffer, linearizing wrapped bytes first. Returns 0 on success, -1 past PIPE_CAP_MAX or on OOM. The ring keeps * its readable bytes in order; only the capacity changes.*
- `kfopen_dir` (line 243) `KFILE *kfopen_dir(const char *resolved)` - *Directory open for getdents64 (kernel/syscalls.c 217): kfopen refuses directories, so open(2) on one lands here. The handle stores the resolved path (with the trailing slash the listing walks) and the * next-entry index; everything else is enumerated on demand.*
- `kfopen` (line 264) `KFILE *kfopen(const char *path, const char *mode)`
- `fs_rename_on_minifs` (line 361) `static int fs_rename_on_minifs(const char *dst)` - *True when `dst` can live on MiniFS: no directory part (root), or its * parent resolves there.*
- `directory` (line 379) `* empty directory by a directory (-20/-21 for a kind mismatch, -39 for a
 * non-empty directory)....`
- `kfclose` (line 432) `int kfclose(KFILE *f)`
- `kfgetc` (line 477) `int kfgetc(KFILE *f)`
- `kfgets` (line 518) `char *kfgets(char *buf, int size, KFILE *f)`
- `kfungetc` (line 532) `int kfungetc(int c, KFILE *f)`
- `kfread` (line 539) `unsigned long kfread(void *ptr, unsigned long size, unsigned long n, KFILE *f)`
- `kfwrite` (line 585) `unsigned long kfwrite(const void *ptr, unsigned long size, unsigned long n, KFILE *f)`
- `kfseek` (line 651) `int kfseek(KFILE *f, long offset, int whence)`
- `kftell` (line 672) `long kftell(KFILE *f)`
- `kfflush` (line 676) `int kfflush(KFILE *f)`
- `kfputs` (line 702) `int kfputs(const char *s, KFILE *f)`
- `kfputc` (line 708) `int kfputc(int c, KFILE *f)`
- `krewind` (line 713) `void krewind(KFILE *f)`

#### `minifs.c`
**Path:** `fs/minifs.c`
**File Doc:** *MiniFS: minimal Unix-like filesystem for MiniOS.*

**Functions:**
- `minifs_compress` (line 35) `unsigned int minifs_compress(const void *src, unsigned int src_len,
                             ...` - *unsigned int *phys_block); static unsigned char *blk_new(void); static void blk_free(unsigned char *b); static unsigned int minifs_crc32(const void *data, unsigned int len); int minifs_resolve_path(const char *path); static MiniFSSuper fs_sb; static unsigned char *fs_ibitmap; static unsigned char *fs_bbitmap; static unsigned int fs_lba_start; static unsigned int fs_next_txn; static int fs_mounted; /* ---- Compression wrappers ----*
- `minifs_decompress` (line 46) `unsigned int minifs_decompress(const void *src, unsigned int src_len,
                           ...`
- `minifs_crc16` (line 57) `static unsigned short minifs_crc16(const void *data, unsigned int len)`
- `minifs_crc32` (line 69) `static unsigned int minifs_crc32(const void *data, unsigned int len)`
- `roundup4` (line 81) `static unsigned int roundup4(unsigned int v)`
- `div_round_up` (line 83) `static unsigned int div_round_up(unsigned int n, unsigned int d)`
- `returns` (line 92) `* overflowed the slot and smashed returns (measured ring-0 #UD on
 * lua->lua->cp). Every scratch...`
- `blk_free` (line 100) `static void blk_free(unsigned char *b)`
- `fs_write_super` (line 107) `static int fs_write_super(void)`
- `instead` (line 127) `* kernel stored the same crc at offset 76 instead (byte order the old
 * write path used), so a r...`
- `fs_inode_check` (line 142) `static int fs_inode_check(const MiniFSInode *in)`
- `fs_read_inode` (line 167) `static int fs_read_inode(unsigned int num, MiniFSInode *out)`
- `fs_write_inode` (line 179) `static int fs_write_inode(unsigned int num, const MiniFSInode *in)`
- `bm_test` (line 201) `static int bm_test(unsigned char *bm, unsigned int bit)`
- `bm_set` (line 205) `static void bm_set(unsigned char *bm, unsigned int bit)`
- `bm_clear` (line 209) `static void bm_clear(unsigned char *bm, unsigned int bit)`
- `minifs_alloc_block` (line 215) `int minifs_alloc_block(void)`
- `minifs_free_block` (line 232) `void minifs_free_block(unsigned int block)`
- `minifs_alloc_inode` (line 240) `int minifs_alloc_inode(void)`
- `minifs_free_inode` (line 252) `void minifs_free_inode(int num)`
- `minifs_inode_get_block` (line 260) `int minifs_inode_get_block(MiniFSInode *inode, unsigned int logblk,
                           un...`
- `fs_inode_set_block` (line 289) `static int fs_inode_set_block(MiniFSInode *inode, unsigned int logblk,
                          ...`
- `minifs_inode_alloc_block` (line 343) `int minifs_inode_alloc_block(MiniFSInode *inode, unsigned int logblk)`
- `fs_inode_free_all_blocks` (line 364) `static void fs_inode_free_all_blocks(MiniFSInode *inode)`
- `journal_load_super` (line 446) `static void journal_load_super(void)`
- `journal_save_super` (line 464) `static void journal_save_super(unsigned int state)`
- `journal_save_entries` (line 478) `static void journal_save_entries(void)`
- `minifs_journal_begin` (line 495) `void minifs_journal_begin(unsigned int txn_id)`
- `minifs_journal_add_block` (line 504) `void minifs_journal_add_block(unsigned int block)` - *Deprecated alias: historically took an inode number (wrong layer). * Takes a physical block now; prefer minifs_journal_touch.*
- `minifs_journal_commit` (line 511) `int minifs_journal_commit(unsigned int txn_id)` - *Pre-write barrier: persist the entry array and mark the journal DIRTY before any protected data block is modified. A crash after this * point replays the undo log in minifs_journal_recover.*
- `minifs_journal_clear` (line 521) `void minifs_journal_clear(void)` - *Post-write barrier: the protected writes are all on disk, so the undo * log is no longer needed.*
- `minifs_journal_abort` (line 531) `void minifs_journal_abort(void)` - *Error path after the DIRTY barrier: restore every snapshotted block from the journal data area, then clear. Only undoes blocks recorded * in the live in-RAM entry array.*
- `first` (line 556) `* keep the first (oldest) snapshot. */
void minifs_journal_touch(unsigned int phys)`
- `minifs_journal_recover` (line 597) `void minifs_journal_recover(void)` - *Mount-time recovery: replays the undo log left by a crash between the DIRTY barrier and the CLEAN mark. Every on-disk field is hostile data (a crafted image must not cause arbitrary block overwrites): super checksum, entry count bound, per-entry checksum and the target block range are all validated; invalid entries are skipped and * counted, never applied.*
- `fs_namecmp` (line 683) `static int fs_namecmp(const char *a, unsigned char alen, const char *b)`
- `minifs_dir_lookup` (line 692) `int minifs_dir_lookup(int dir_ino, const char *name)`
- `minifs_dir_add_entry` (line 722) `int minifs_dir_add_entry(int dir_ino, const char *name, int child_ino,
                          ...`
- `minifs_dir_remove_entry` (line 860) `int minifs_dir_remove_entry(int dir_ino, const char *name)`
- `minifs_dir_read` (line 891) `int minifs_dir_read(int dir_ino, int index, MiniFSDirEntry *out, char *name_out)`
- `minifs_resolve_path` (line 941) `int minifs_resolve_path(const char *path)`
- `minifs_create` (line 974) `int minifs_create(const char *path, unsigned short mode)`
- `minifs_mkdir` (line 1027) `int minifs_mkdir(const char *path, unsigned short mode)`
- `minifs_unlink` (line 1076) `int minifs_unlink(const char *path)`
- `minifs_split_parent` (line 1119) `static int minifs_split_parent(const char *path, char *parent_out,
                              ...` - *Split a resolved path into its parent directory path ("" for root) and its leaf name. Single copy for minifs_rename; create/mkdir/unlink keep * their inline splits untouched.*
- `minifs_dir_is_empty` (line 1148) `static int minifs_dir_is_empty(int dir_ino)` - *An entry removal only clears the record in place, so a directory's size never shrinks. Emptiness must therefore be decided by scanning for a live inode; trusting size kept every directory that ever held a * file non-empty and broke nested shutil.rmtree.*
- `minifs_rename` (line 1175) `int minifs_rename(const char *oldpath, const char *newpath)`
- `minifs_rmdir` (line 1225) `int minifs_rmdir(const char *path)`
- `minifs_read` (line 1266) `int minifs_read(int inode_num, void *buf, unsigned int offset, unsigned int len)`
- `minifs_write` (line 1337) `int minifs_write(int inode_num, const void *buf, unsigned int offset,
                 unsigned i...`
- `minifs_truncate` (line 1424) `int minifs_truncate(int inode_num, unsigned int new_size)`
- `minifs_stat` (line 1441) `int minifs_stat(int inode_num, MiniFSInode *out)`
- `minifs_access` (line 1445) `int minifs_access(const char *path)`
- `minifs_init` (line 1451) `void minifs_init(void)`
- `minifs_get_lba_start` (line 1459) `unsigned int minifs_get_lba_start(void)`
- `minifs_is_mounted` (line 1460) `int minifs_is_mounted(void)`
- `minifs_mount` (line 1468) `int minifs_mount(void)` - *Boot-time exemption from the -Wframe-larger-than=2048 gate: mount and mkfs run once on deep boot stacks, never on 16 KB proc slots, so their single 4 KB probe scratch is safe and keeps heap pressure off the * early boot path. pragma GCC diagnostic push pragma GCC diagnostic ignored "-Wframe-larger-than="*
- `minifs_sync` (line 1618) `int minifs_sync(void)`
- `minifs_file_open` (line 1633) `MiniFSFile *minifs_file_open(int inode_num, int flags)`
- `minifs_file_close` (line 1647) `int minifs_file_close(MiniFSFile *f)`
- `minifs_get_total_blocks` (line 1654) `unsigned int minifs_get_total_blocks(void)`
- `minifs_usage` (line 1659) `void minifs_usage(unsigned int *free_b, unsigned int *total_b,
                  unsigned int *fr...` - *} int minifs_file_close(MiniFSFile *f) { if (!f) return 0; if (f->inode_cache) kfree(f->inode_cache); kfree(f); return 0; } unsigned int minifs_get_total_blocks(void) { return fs_sb.total_blocks; } /** Docstring: Filesystem usage snapshot for the mem builtin.*
- `minifs_journal_touch` (line 16) `void minifs_journal_touch(unsigned int phys);`
- `blk_new` (line 22) `static unsigned char *blk_new(void);`
- `blocks` (line 555) `* blocks (self-protection);`

**Macros:**
- `DE_NAME` (line 13) `#define DE_NAME(de)`
- `DE_NAME_W` (line 14) `#define DE_NAME_W(de)`
- `MINIFS_INODE_CRC_OFF` (line 130) `#define MINIFS_INODE_CRC_OFF`

#### `pcache.c`
**Path:** `fs/pcache.c`
**File Doc:** *Docstring: fs/pcache.c -- page cache store for MiniFS (T5 slice 1).*

**Imported by:** `test_pcache.c`

**Functions:**
- `pcache_init` (line 42) `void pcache_init(void)`
- `pcache_lookup` (line 54) `int pcache_lookup(int ino, unsigned index)`
- `pcache_get` (line 71) `int pcache_get(int ino, unsigned index, int *is_new)`
- `pcache_publish` (line 128) `int pcache_publish(int ino, unsigned index, const unsigned char *data)` - *Docstring: Publish a privately filled page into the cache atomically. Copies data into a reserved slot and marks it valid under one lock hold, or refs the slot a racing publisher won first; either way the returned slot is complete before any other holder can see it. Returns the slot (ref 1 for this mapping) or -1 when no slot is free, in which case the caller maps its * private page and takes no ref.*
- `pcache_put` (line 179) `void pcache_put(int slot)`
- `pcache_ref` (line 192) `int pcache_ref(int ino, unsigned index)` - *Docstring: Take one more ref on a cached page without allocating. Fork uses this for every file-backed page the child inherits, so the child teardown drops exactly what the copy added. Returns the * slot or -1 when the page is not cached.*
- `pcache_unmap` (line 216) `void pcache_unmap(int ino, unsigned index)` - *Docstring: Drop the ref a mapping holds on one cached page. The munmap and teardown walks derive (ino, index) from the VMA node and call this per page; unknown pages are a silent no-op so a partially populated mapping unmaps cleanly. Prefer put_if below wherever the PTE is at hand: blind drops can steal another * mapping's ref after a private fallback.*
- `pcache_slot_phys` (line 222) `static unsigned long pcache_slot_phys(int slot)` - *Docstring: Drop the ref a mapping holds on one cached page. The munmap and teardown walks derive (ino, index) from the VMA node and call this per page; unknown pages are a silent no-op so a partially populated mapping unmaps cleanly. Prefer put_if below wherever the PTE is at hand: blind drops can steal another * mapping's ref after a private fallback. void pcache_unmap(int ino, unsigned index) { int slot = pcache_lookup(ino, index); if (slot >= 0) pcache_put(slot); } /** Docstring: Slot base address for phys comparisons.*
- `match` (line 230) `* a phys match (owned, ref dropped unless already zero), 0
 * otherwise. */
int pcache_put_if(int...`
- `pcache_ref_if` (line 255) `int pcache_ref_if(int ino, unsigned index, unsigned long phys)` - *Docstring: Take one more ref only when the cached page is the exact phys the caller shares. Fork proves sharing through the parent PTE before inheriting, so a stale VMA tag never pins a * recycled slot. Returns the slot or -1.*
- `pcache_owns_phys` (line 277) `int pcache_owns_phys(unsigned long phys)` - *Docstring: True when phys is a cache pool page. The teardown sweeper skips those instead of freeing pool memory as if it were * a private data page.*
- `pcache_data` (line 285) `unsigned char *pcache_data(int slot)`
- `pcache_mark_dirty` (line 291) `void pcache_mark_dirty(int slot)`
- `pcache_invalidate_ino` (line 299) `void pcache_invalidate_ino(int ino)`
- `pcache_stats` (line 314) `void pcache_stats(unsigned long *pages_out, unsigned long *hits_out,
        unsigned long *miss_...`

**Structs:**
- `pcache_slot_t` (line 17)

#### `ramdisk.c`
**Path:** `fs/ramdisk.c`
**File Doc:** *================================================================*

**Functions:**
- `ramdisk_reserve` (line 37) `static int ramdisk_reserve(unsigned long want)`
- `ramdisk_setup_from` (line 55) `void ramdisk_setup_from(void *data, unsigned size)`
- `ramdisk_init` (line 128) `void ramdisk_init(void)`
- `ramdisk_open` (line 145) `RDFile *ramdisk_open(const char *name)`
- `ramdisk_read` (line 155) `int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)`
- `ramdisk_write` (line 163) `int ramdisk_write(RDFile *f, const void *buf, unsigned offset, unsigned len)`
- `ramdisk_create` (line 171) `RDFile *ramdisk_create(const char *name, unsigned size)`
- `ramdisk_resize` (line 185) `int ramdisk_resize(RDFile *f, unsigned newsize)`
- `ramdisk_list` (line 222) `int ramdisk_list(RDFile **out, int max)`
- `ramdisk_count` (line 230) `int ramdisk_count(void)`
- `ramdisk_usage` (line 236) `void ramdisk_usage(unsigned *used, unsigned *cap, unsigned *max)` - *int ramdisk_list(RDFile **out, int max) { if (!rd) return 0; int n = (int)rd->count < max ? (int)rd->count : max; unsigned i; for (i = 0; i < (unsigned)n; i++) out[i] = &rd->files[i]; return n; } int ramdisk_count(void) { if (!rd) return 0; return (int)rd->count; } /** Docstring: Ramdisk usage snapshot for the mem builtin.*
- `ramdisk_file_name` (line 242) `const char *ramdisk_file_name(int idx)`
- `ramdisk_delete` (line 247) `int ramdisk_delete(RDFile *f)`
- `ramdisk_rename` (line 269) `int ramdisk_rename(const char *oldname, const char *newname)`

**Macros:**
- `RD_MAGIC` (line 15) `#define RD_MAGIC`
- `RD_HEADER_SIZE` (line 16) `#define RD_HEADER_SIZE`
- `RD_ENTRY_SIZE` (line 17) `#define RD_ENTRY_SIZE`
- `RD_DATA_MIN` (line 18) `#define RD_DATA_MIN`
- `RD_DATA_SPARE` (line 19) `#define RD_DATA_SPARE`
- `RD_ENTRY_RAW_OFF` (line 20) `#define RD_ENTRY_RAW_OFF`
- `RD_ENTRY_STO_OFF` (line 21) `#define RD_ENTRY_STO_OFF`
- `RD_ENTRY_OFF_OFF` (line 22) `#define RD_ENTRY_OFF_OFF`
- `RD_ENTRY_FLG_OFF` (line 23) `#define RD_ENTRY_FLG_OFF`
- `RD_FLAG_DEFLATE` (line 24) `#define RD_FLAG_DEFLATE`

**Structs:**
- `RDSuper` (line 26)

#### `vfs.c`
**Path:** `fs/vfs.c`
**File Doc:** *================================================================*

**Functions:**
- `vfs_init` (line 22) `void vfs_init(void)`
- `vfs_register` (line 27) `int vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver)`
- `vfs_unregister` (line 62) `int vfs_unregister(const char *prefix)`
- `vfs_open` (line 106) `int vfs_open(const char *path, int mode, vfs_file_t *f)`
- `taken` (line 160) `* refcount is taken (ops tables are static, never freed), so a
 * listing can never pin an unmoun...`
- `ramdisk_vfs_open` (line 212) `static int ramdisk_vfs_open(const char *path, int mode, void **handle)`
- `ramdisk_vfs_read` (line 238) `static int ramdisk_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)`
- `ramdisk_vfs_write` (line 247) `static int ramdisk_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)`
- `ramdisk_vfs_close` (line 255) `static int ramdisk_vfs_close(void *handle)`
- `ramdisk_vfs_fstat` (line 261) `static int ramdisk_vfs_fstat(void *handle, unsigned long *size_out)`
- `ramdisk_vfs_truncate` (line 268) `static int ramdisk_vfs_truncate(void *handle, unsigned long size)`
- `ramdisk_vfs_readdir` (line 278) `static int ramdisk_vfs_readdir(const char *path, vfs_dirent_t *ents,
        int cap)` - *Docstring: List ramdisk leaves under dir ("" or "/" is root). Flat names with "/" as data split into leaves and first-level subdirectories, deduplicated, so "src/sub/x" contributes "sub" * once and "src/" contributes "src" as a directory.*
- `minifs_vfs_open` (line 351) `static int minifs_vfs_open(const char *path, int mode, void **handle)`
- `minifs_vfs_read` (line 379) `static int minifs_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len)`
- `minifs_vfs_write` (line 388) `static int minifs_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len)`
- `minifs_vfs_close` (line 396) `static int minifs_vfs_close(void *handle)`
- `minifs_vfs_fstat` (line 402) `static int minifs_vfs_fstat(void *handle, unsigned long *size_out)`
- `minifs_vfs_truncate` (line 409) `static int minifs_vfs_truncate(void *handle, unsigned long size)`
- `mem_lookup` (line 470) `static int mem_lookup(const char *path)`
- `mem_open` (line 478) `static int mem_open(const char *path, int mode, void **handle)`
- `mem_slot` (line 498) `static int mem_slot(void *handle)`
- `mem_read` (line 505) `static int mem_read(void *handle, void *buf, unsigned long pos, unsigned long len)`
- `mem_write` (line 515) `static int mem_write(void *handle, const void *buf, unsigned long pos, unsigned long len)`
- `mem_close` (line 526) `static int mem_close(void *handle)`
- `mem_fstat` (line 530) `static int mem_fstat(void *handle, unsigned long *size_out)`
- `mem_truncate` (line 537) `static int mem_truncate(void *handle, unsigned long size)`
- `mem_readdir` (line 548) `static int mem_readdir(const char *path, vfs_dirent_t *ents, int cap)` - *Docstring: List the flat mem: namespace (root only, files only). * Anything below root refuses: there are no directories here.*
- `fs_resolve` (line 580) `int fs_resolve(const char *path, char *out, unsigned cap)`
- `fs_dir_exists` (line 613) `int fs_dir_exists(const char *dir)`
- `fs_is_dir` (line 638) `int fs_is_dir(const char *resolved)`
- `minifs_mkdir_p` (line 651) `int minifs_mkdir_p(const char *resolved)`
- `vfs_register_builtins` (line 674) `void vfs_register_builtins(void)`
- `open` (line 688) `* open (loopback image file plus in-image path), so one registration
 * serves every image. */
in...`
- `vfs_read` (line 709) `int vfs_read(vfs_file_t *f, void *buf, unsigned long len)`
- `vfs_write` (line 718) `int vfs_write(vfs_file_t *f, const void *buf, unsigned long len)`
- `vfs_close` (line 734) `int vfs_close(vfs_file_t *f)`
- `vfs_fstat` (line 752) `int vfs_fstat(vfs_file_t *f, unsigned long *size_out)`

**Macros:**
- `MEM_FILES` (line 457) `#define MEM_FILES`
- `MEM_FNAME` (line 458) `#define MEM_FNAME`
- `MEM_FSIZE` (line 459) `#define MEM_FSIZE`

**Structs:**
- `vfs_mount_t` (line 10)
- `ramdisk_handle_t` (line 196)
- `minifs_handle_t` (line 346)
- `mem_file_t` (line 461)

#### `zip.c`
**Path:** `fs/zip.c`
**File Doc:** *zip.c — the unzip/zip shell builtins over the miniz zip library.*

**Functions:**
- `zip_read_whole` (line 25) `static unsigned char *zip_read_whole(const char *path, unsigned long *size)` - *Read a whole file (ramdisk first, MiniFS fallback) into a fresh kernel buffer, growing until the read stops making progress. The buffer is bounded by the file size, so a hostile file cannot drive an oversized * allocation. Returns 0 on failure.*
- `marker` (line 50) `* marker (trailing '/') is preserved by the caller, not here. */
static int zip_sanitize_name(con...`
- `zip_build_path` (line 79) `static int zip_build_path(const char *destdir, const char *name, char *out)` - *Build the combined extraction path: destdir (already resolved, may be "") joined with the sanitized entry name. Returns 1 and fills `out` when the * path fits.*
- `zip_ensure_dir_tree` (line 95) `static int zip_ensure_dir_tree(const char *dir)` - *Create every directory component of `dir` (a resolved, slash-separated name with no trailing '/'), including `dir` itself, as ramdisk directory * markers. Returns 1 on success; the root (empty) always succeeds.*
- `zip_do_entry` (line 117) `static int zip_do_entry(mz_zip_archive *zip, mz_uint idx, const char *destdir)` - *Extract one archive entry under destdir. Junk entries (empty or '.'-only * names) are skipped and count as success. Returns 1 on success.*
- `shell_cmd_unzip` (line 176) `void shell_cmd_unzip(int argc, char **argv)` - *if (!data) return 0; if (n != usize) { mz_free(data); return 0; } f = kfopen(resolved, "w"); if (!f) { mz_free(data); return 0; } rc = (kfwrite(data, 1, usize, f) == usize) ? 0 : -1; if (kfclose(f) != 0) rc = -1; mz_free(data); if (rc != 0) return 0; kprintf("  %-24s %lu bytes\n", resolved, usize); } return 1; } /* unzip <archive.zip> [dir]  — extract;  unzip -l <archive.zip> — list.*
- `shell_cmd_zip` (line 254) `void shell_cmd_zip(int argc, char **argv)` - *zip <out.zip> <file...> — store each file (under its sanitized name) into * a new archive.*
- `root` (line 8) `* names are hostile data: each is normalized to forward slashes and rejected * when it escapes the extraction root (absolute paths, '.'/'..' components, * empty names), so a crafted archive can never `
- `mz_zip_writer_mem_ptr` (line 18) `void *mz_zip_writer_mem_ptr(mz_zip_archive *pZip);`
- `mz_zip_writer_mem_size` (line 19) `size_t mz_zip_writer_mem_size(mz_zip_archive *pZip);`

#### `abi.c`
**Path:** `kernel/abi.c`
**File Doc:** *Docstring: kernel/abi.c -- Boot-time ABI manifest gate.*

**Functions:**
- `abi_parse_num` (line 20) `static int abi_parse_num(const char **pp, const char *end, unsigned long *out)` - *order, junk, overflow, missing newline) fails closed as BAD_FORMAT. Number parsing carries its own overflow guard so a hostile manifest can never wrap into a false match. The file has no kernel dependency beyond the manifest check itself, so the host test compiles it with ABI_HOST_TEST and covers every branch without a QEMU boot.  #include "abi.h" #ifndef ABI_HOST_TEST #include "kernel.h" #endif /** Docstring: Parse one decimal field, overflow-guarded.*
- `abi_verify` (line 38) `int abi_verify(const char *text, long version, unsigned long checksum)` - *return 0; while (p < end && *p >= '0' && *p <= '9') { unsigned digit = (unsigned)(*p - '0'); if (v > (0xFFFFFFFFFFFFFFFFUL - digit) / 10) return 0; v = v * 10 + digit; p++; } pp = p; out = v; return 1; } /** Docstring: Verify manifest text against the running ABI.*
- `abi_check_manifest` (line 74) `int abi_check_manifest(void)` - *p += 2; if (!abi_parse_num(&p, end, &c)) return ABI_BAD_FORMAT; if (p + 1 != end || *p != '\n') return ABI_BAD_FORMAT; if ((long)v != version) return ABI_VERSION_MISMATCH; if (c != checksum) return ABI_CHECKSUM_MISMATCH; return ABI_OK; } #ifndef ABI_HOST_TEST /** Docstring: Read etc/abi from the ramdisk and verify the running ABI.*

#### `batch.c`
**Path:** `kernel/batch.c`
**File Doc:** *Docstring: kernel/batch.c -- Ordered batch executor.*

**Functions:**
- `batch_exec` (line 19) `long batch_exec(const batch_op_t *ops, long *results, int count,
                int *completed, ...` - *Docstring: Run ops in order, storing one result per index.  Returns BATCH_OK when every operation dispatched without a negative result. On the first negative dispatch result, stops immediately and returns that error. completed always reports the number of successful operations, including on early refusal (zero). A null dispatch table entry for a known opcode is treated as BATCH_ERR_OPCODE, never called.*

#### `clip.c`
**Path:** `kernel/clip.c`
**File Doc:** *Docstring: kernel/clip.c -- Shared text clipboard.*

**Functions:**
- `clip_set` (line 25) `int clip_set(const char *data, unsigned long len)` - *Docstring: Replace the clipboard with len bytes from data. Refused * (return -1) on null data or past CLIP_MAX; empty clears.*
- `clip_clear` (line 48) `void clip_clear(void)` - *Docstring: Copy the clipboard into out (cap bytes). Returns the length, or -1 when empty/cleared. Fail-closed on an undersize * buffer (refuse, never a silently truncated paste). int clip_get(char *out, unsigned long cap) { unsigned long i; if (!out || cap == 0u) return -1; if (!clip_valid || clip_len == 0u) return -1; if ((unsigned long)clip_len > cap) return -1; for (i = 0u; i < clip_len; i++) out[i] = clip_buf[i]; return (int)clip_len; } /** Docstring: Empty the clipboard. Reads then report -1 (empty).*
- `clip_len_get` (line 55) `int clip_len_get(void)` - *Docstring: Current length, or -1 when empty. Lets callers size the * read buffer before getting.*

**Macros:**
- `CLIP_MAX` (line 17) `#define CLIP_MAX`

#### `console.c`
**Path:** `kernel/console.c`
**File Doc:** *console.c -- Execution-context output: text console, capture, libc names.*

**Functions:**
- `vga_get_x` (line 18) `int vga_get_x(void)`
- `vga_get_y` (line 19) `int vga_get_y(void)`
- `vga_set_xy` (line 20) `void vga_set_xy(int x, int y)`
- `vga_get_color` (line 21) `char vga_get_color(void)`
- `vga_offset` (line 23) `static inline unsigned vga_offset(int x, int y)`
- `vga_clear` (line 25) `void vga_clear(void)`
- `vga_set_cursor` (line 36) `void vga_set_cursor(int x, int y)`
- `vga_scroll` (line 56) `void vga_scroll(void)`
- `vga_newline` (line 75) `void vga_newline(void)`
- `vga_cursor_enable` (line 81) `void vga_cursor_enable(int on)`
- `vga_raw_space` (line 88) `static void vga_raw_space(void)`
- `redir_grow` (line 110) `static int redir_grow(void)`
- `redirect_active` (line 120) `int redirect_active(void)`
- `redirect_putc` (line 122) `static int redirect_putc(char c)`
- `redirect_suspend` (line 129) `int redirect_suspend(void)`
- `redirect_resume` (line 135) `void redirect_resume(int was)`
- `redirect_begin` (line 139) `int redirect_begin(void)`
- `redirect_commit` (line 147) `int redirect_commit(const char *path, int append_mode)`
- `redirect_pending` (line 185) `unsigned long redirect_pending(void)` - *Docstring: Bytes waiting in the capture, 0 when idle or overflowed. Lets a caller size one arena block for the whole capture instead of * taking a throwaway heap copy first.*
- `redirect_take_into` (line 196) `unsigned long redirect_take_into(char *dst, unsigned long cap,
        unsigned long *len_out)` - *Docstring: Drain the capture into the caller's arena memory instead of a fresh heap block. Copies at most cap bytes, deactivates the capture and resets the ring exactly like redirect_take, but the caller owns dst so a pipeline stage assembles its output with one kmalloc instead of three. Reports the copied count in len_out; * 0 with len 0 on empty capture or overflow.*
- `redirect_discard` (line 216) `void redirect_discard(void)` - *Docstring: Drop the capture without any allocation. The ring keeps its backing block for the next Ctrl+R / Ctrl+L build, so repeated toolchain runs reuse one persistent bump buffer instead of churning * the heap.*
- `vga_line_feed` (line 231) `static void vga_line_feed(void)` - *Text-mode console line buffer. The framebuffer terminal owns its own history; this is the text-mode half of the same history, so the boot log * (printed before the desktop comes up) is still reachable with PageUp. #define VGA_LINE_MAX 256 static char vga_line[VGA_LINE_MAX]; static int  vga_line_len; /** Docstring: Push the buffered text-mode line into the terminal history.*
- `vga_putc` (line 237) `void vga_putc(char c)`
- `vga_puts` (line 283) `void vga_puts(const char *s)`
- `register_libc_symbols` (line 287) `void register_libc_symbols(void)`

**Macros:**
- `XXH_STATIC_LINKING_ONLY` (line 4) `#define XXH_STATIC_LINKING_ONLY`
- `REDIR_INITIAL_CAP` (line 96) `#define REDIR_INITIAL_CAP`
- `REDIR_MAX_BYTES` (line 97) `#define REDIR_MAX_BYTES`
- `VGA_LINE_MAX` (line 226) `#define VGA_LINE_MAX`

#### `console_in.c`
**Path:** `kernel/console_in.c`
**File Doc:** *Docstring: Console input device (kernel/console_in.c).*

**Functions:**
- `console_stdin_push` (line 32) `int console_stdin_push(const char *data, unsigned long len)` - *Pipeline stdin override (see console_in.h): heap buffer served ahead of every live source while set. Drained means EOF (-1), never a block on hardware, so `grep x` at a pipe tail terminates instead of hanging * on the keyboard. Single-owner (the shell runner), never nested. static unsigned char *pipe_stdin_buf; static unsigned long pipe_stdin_len; static unsigned long pipe_stdin_pos; static int pipe_stdin_on; /** Docstring: Install a pipeline stdin buffer (see header).*
- `console_stdin_clear` (line 46) `void console_stdin_clear(void)` - *int console_stdin_push(const char *data, unsigned long len) { unsigned long i; if (!data || len == 0u || len > PIPE_CAP_MAX) return 0; console_stdin_clear(); pipe_stdin_buf = kmalloc(len); if (!pipe_stdin_buf) return 0; for (i = 0u; i < len; i++) pipe_stdin_buf[i] = (unsigned char)data[i]; pipe_stdin_len = len; pipe_stdin_pos = 0u; pipe_stdin_on = 1; return 1; } /** Docstring: Release the pipeline stdin buffer, back to live console.*
- `console_stdin_active` (line 56) `int console_stdin_active(void)` - *Docstring: True while a pipeline stdin buffer is installed (drained * or not). Lets sys_read tell piped EOF from a live block.*
- `pb_empty` (line 60) `static int pb_empty(void)`
- `pb_count` (line 61) `static int pb_count(void)`
- `pb_push_back` (line 62) `static void pb_push_back(unsigned char c)`
- `pb_push_front` (line 67) `static void pb_push_front(unsigned char c)`
- `pb_pop` (line 72) `static int pb_pop(void)`
- `pb_peek` (line 78) `static int pb_peek(void)`
- `console_ungetc` (line 85) `void console_ungetc(unsigned char c)` - *Docstring: Push one byte back into the console FIFO; the next * console_getc/console_peek serves it first. Drops the byte when full.*
- `console_poll_usb` (line 93) `static void console_poll_usb(void)` - *Docstring: Service the polled USB input path: drain the controller's event ring, then take one report from each claimed HID endpoint. Both keyboard sources share the cooked queue downstream, so a report that produces a byte * is visible to the very next kbd_q_pop.*
- `console_ps2_live` (line 106) `static int console_ps2_live(void)` - *Docstring: True when the PS/2 data port should be read.  On a machine with no 8042 -- every PC since roughly 2012, and anything with a USB keyboard -- port 0x64 reads back as 0xFF, which kbd_available reads as "output buffer full" and port 0x60 as 0xFF, which the decode path reads as a break code. Left unguarded, a shell prompt would spin forever swallowing 0xFF and never accept a character. So the PS/2 port is skipped entirely * once a USB keyboard is driving the path.*
- `raw_blocking_getc` (line 118) `static int raw_blocking_getc(void)` - *Docstring: Next raw byte (kbd queue, then serial, then USB, then PS/2) without touching the pushback FIFO; blocks until one is available.  USB is serviced here, not only on the tick, because the shell prompt is a spin loop: polling it in place gives a keystroke the next iteration rather than up to ten milliseconds later, which is the difference between typing * and feeling the machine lag.*
- `raw_try_getc` (line 139) `static int raw_try_getc(void)` - *} console_poll_usb(); if (!kbd_q_empty()) return kbd_q_pop(); if (console_ps2_live()) { int c = kbd_read(); if (c >= 0) return c; } if (vga_fb_active && (++mouse_tick_cnt & 0xFF) == 0) vga_fb_mouse_tick(); __asm__ volatile("pause"); } } /** Docstring: Non-blocking variant of the above for sequence lookahead.*
- `ESC` (line 157) `* The bound keeps a bare ESC (never completed into a sequence) from
 * hanging the reader. */
#de...`
- `consume_page_after_esc` (line 178) `static int consume_page_after_esc(void)` - *Docstring: Called after an ESC byte has been read. Pulls the remainder of the sequence non-blocking and classifies it. Returns 1 (PageUp), 2 (PageDown), or 0 for "not a page key" — in which case every byte pulled EXCEPT the leading ESC is re-injected into the pushback FIFO so the caller can hand them back to the readline layer exactly as it would * a raw escape.*
- `console_history_page` (line 204) `void console_history_page(int dir)` - *Docstring: Page the console history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring, the text-mode console the legacy VGA scrollback ring; this picks the one that is up * and is the single entry point for the page keys.*
- `console_getc` (line 217) `int console_getc(void)` - *Docstring: Blocking read from either the PS/2 keyboard or COM1 serial line. Recognises the PageUp/PageDown escape sequences and detours into the scrollback view; the view re-injects any terminating key into the pushback FIFO, so once it returns console_getc() simply serves the FIFO * again.*
- `console_peek` (line 247) `int console_peek(void)` - *Docstring: Next buffered byte without consuming it, or -1 when nothing is available right now. Used to tell an ESC prefix from a complete escape sequence, which always arrives in one burst. Global so SYS_SPAWN waits in spawn.c can poll for Ctrl+C exactly like the shell foreground * wait does.*
- `console_raw_try` (line 260) `int console_raw_try(void)` - *Docstring: Raw console multiplexer for the GETC_RAW syscall. The same serial + PS/2 sources console_getc funnels, but without the line buffering, echo or scrollback detour: a ring-3 fullscreen program reads keystrokes byte by byte. Blocking spins with a pause (and the desktop tick, as the shell idle loop does); the try variant returns -1 when * nothing is available so user space can implement its own timeout.*
- `console_raw_get` (line 264) `int console_raw_get(void)`
- `console_job_try` (line 271) `int console_job_try(void)` - *Docstring: GETC_RAW source for ring-3 background jobs. Serves the USB path too, so a ring-3 program that owns the keyboard on modern hardware is * not handed a dead 8042.*
- `console_job_get` (line 281) `int console_job_get(void)` - *Docstring: GETC_RAW source for ring-3 background jobs. Serves the USB path too, so a ring-3 program that owns the keyboard on modern hardware is * not handed a dead 8042. int console_job_try(void) { console_poll_usb(); if (console_ps2_live()) { int c = kbd_read(); if (c >= 0) return c; } return -1; } /** Docstring: Blocking PS/2-only GETC_RAW source for background jobs.*
- `scrollback_render` (line 297) `static void scrollback_render(int voff, int total, const unsigned char *saved)`
- `sb_next` (line 325) `static int sb_next(void)` - *Docstring: Reads the next scrollback key event: PageUp/PageDown navigate; any other key (or a non-page escape sequence) is re-injected * and reported as SB_EXIT.*
- `scrollback_view` (line 335) `static void scrollback_view(int initial_dir)`

**Macros:**
- `PB_LEN` (line 18) `#define PB_LEN`
- `MAX_SEQ_POLL` (line 159) `#define MAX_SEQ_POLL`
- `SB_LEN` (line 295) `#define SB_LEN`
- `SB_PGUP` (line 318) `#define SB_PGUP`
- `SB_PGDN` (line 319) `#define SB_PGDN`
- `SB_EXIT` (line 320) `#define SB_EXIT`

#### `cvm_host.c`
**Path:** `kernel/cvm_host.c`

**Functions:**
- `n_strcmp` (line 22) `static int64_t n_strcmp(void *vm, int ac, uint64_t *av)`
- `n_strncmp` (line 28) `static int64_t n_strncmp(void *vm, int ac, uint64_t *av)`
- `n_strcpy` (line 35) `static int64_t n_strcpy(void *vm, int ac, uint64_t *av)`
- `n_strncpy` (line 41) `static int64_t n_strncpy(void *vm, int ac, uint64_t *av)`
- `n_memcpy` (line 48) `static int64_t n_memcpy(void *vm, int ac, uint64_t *av)`
- `n_memset` (line 55) `static int64_t n_memset(void *vm, int ac, uint64_t *av)`
- `n_memmove` (line 61) `static int64_t n_memmove(void *vm, int ac, uint64_t *av)`
- `n_memcmp` (line 68) `static int64_t n_memcmp(void *vm, int ac, uint64_t *av)`
- `n_strchr` (line 75) `static int64_t n_strchr(void *vm, int ac, uint64_t *av)`
- `n_strstr` (line 81) `static int64_t n_strstr(void *vm, int ac, uint64_t *av)`
- `n_malloc` (line 88) `static int64_t n_malloc(void *vm, int ac, uint64_t *av)`
- `n_free` (line 93) `static int64_t n_free(void *vm, int ac, uint64_t *av)`
- `n_calloc` (line 98) `static int64_t n_calloc(void *vm, int ac, uint64_t *av)`
- `n_realloc` (line 106) `static int64_t n_realloc(void *vm, int ac, uint64_t *av)`
- `n_exit` (line 114) `static int64_t n_exit(void *vm, int ac, uint64_t *av)`
- `n_fopen` (line 121) `static int64_t n_fopen(void *vm, int ac, uint64_t *av)`
- `n_fclose` (line 128) `static int64_t n_fclose(void *vm, int ac, uint64_t *av)`
- `n_fread` (line 134) `static int64_t n_fread(void *vm, int ac, uint64_t *av)`
- `n_fwrite` (line 141) `static int64_t n_fwrite(void *vm, int ac, uint64_t *av)`
- `n_fseek` (line 148) `static int64_t n_fseek(void *vm, int ac, uint64_t *av)`
- `n_ftell` (line 154) `static int64_t n_ftell(void *vm, int ac, uint64_t *av)`
- `n_rewind` (line 160) `static int64_t n_rewind(void *vm, int ac, uint64_t *av)`
- `n_fputs` (line 167) `static int64_t n_fputs(void *vm, int ac, uint64_t *av)`
- `n_fputc` (line 173) `static int64_t n_fputc(void *vm, int ac, uint64_t *av)`
- `n_fgetc` (line 179) `static int64_t n_fgetc(void *vm, int ac, uint64_t *av)`
- `n_ungetc` (line 185) `static int64_t n_ungetc(void *vm, int ac, uint64_t *av)`
- `n_fflush` (line 191) `static int64_t n_fflush(void *vm, int ac, uint64_t *av)`
- `n_putchar` (line 197) `static int64_t n_putchar(void *vm, int ac, uint64_t *av)`
- `n_write` (line 204) `static int64_t n_write(void *vm, int ac, uint64_t *av)`
- `n_read` (line 213) `static int64_t n_read(void *vm, int ac, uint64_t *av)`
- `n_puts` (line 228) `static int64_t n_puts(void *vm, int ac, uint64_t *av)`
- `n_atol` (line 236) `static int64_t n_atol(void *vm, int ac, uint64_t *av)`
- `n_strtol` (line 249) `static int64_t n_strtol(void *vm, int ac, uint64_t *av)`
- `n_stderr_addr` (line 262) `static int64_t n_stderr_addr(void *vm, int ac, uint64_t *av)`
- `n_stdout_addr` (line 267) `static int64_t n_stdout_addr(void *vm, int ac, uint64_t *av)`
- `n_stdin_addr` (line 272) `static int64_t n_stdin_addr(void *vm, int ac, uint64_t *av)`
- `kout_char` (line 288) `static void kout_char(void *ctx, char c)`
- `kout_uint` (line 300) `static void kout_uint(void *ctx, unsigned long long v, int base, int upper)`
- `kformat` (line 313) `static void kformat(void *ctx, const char *fmt, uint64_t *argv, int argc)`
- `n_fprintf` (line 390) `static int64_t n_fprintf(void *vm, int ac, uint64_t *av)` - *Docstring: fprintf native. The stream is the first argument, the format the second, the variadic values follow in the CVM argument * vector.*
- `n_printf` (line 403) `static int64_t n_printf(void *vm, int ac, uint64_t *av)` - *vector. static int64_t n_fprintf(void *vm, int ac, uint64_t *av) { (void)vm; if (ac < 2) return -1; kout_sink k; k.f = (FILE *)(uintptr_t)av[0]; k.buf = 0; k.cap = 0; k.len = 0; kformat(&k, (const char *)(uintptr_t)av[1], av + 2, ac - 2); return 0; } /* Docstring: printf native. Writes to the standard output.*
- `n_sprintf` (line 418) `static int64_t n_sprintf(void *vm, int ac, uint64_t *av)` - *Docstring: sprintf native. Formats into the caller's buffer and returns the number of characters written. The buffer is the first * argument, the format the second, the variadic values follow.*
- `register_host_natives` (line 452) `static void register_host_natives(CvmState *vm)`
- `cvm_main` (line 497) `int cvm_main(int argc, char **argv)`

**Structs:**
- `kout_sink` (line 281) - *Output sink for kformat: a stream (FILE*) or a bounded buffer. The buffer form follows the C library: at most cap-1 characters plus a terminating NUL are stored, while len keeps the length the whole * format would have produced (what sprintf and snprintf return).*

#### `ed25519.c`
**Path:** `kernel/ed25519.c`
**File Doc:** *Docstring: kernel/ed25519.c -- Ed25519 signature verification.*

**Functions:**
- `ed_rotr` (line 84) `static ed_u64 ed_rotr(ed_u64 x, unsigned n)`
- `ed_sha_block` (line 89) `static void ed_sha_block(ed_sha *c, const unsigned char *p)` - */** Docstring: Compressed base point: 0x58 then thirty-one 0x66. static const unsigned char ed_braw[32] = { 0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66 }; static ed_u64 ed_rotr(ed_u64 x, unsigned n) { return (x >> n) | (x << (64u - n)); } /** Docstring: One SHA-512 compression over a 128-byte block.*
- `ed_sha512_init` (line 147) `void ed_sha512_init(ed_sha *c)` - *b = a; a = t1 + t2; } c->h[0] += a; c->h[1] += b; c->h[2] += cc; c->h[3] += d; c->h[4] += e; c->h[5] += f; c->h[6] += g; c->h[7] += h; } /** Docstring: Start a SHA-512 digest.*
- `ed_sha512_update` (line 162) `void ed_sha512_update(ed_sha *c, const unsigned char *data, unsigned long len)` - *c->h[0] = 0x6a09e667f3bcc908ULL; c->h[1] = 0xbb67ae8584caa73bULL; c->h[2] = 0x3c6ef372fe94f82bULL; c->h[3] = 0xa54ff53a5f1d36f1ULL; c->h[4] = 0x510e527fade682d1ULL; c->h[5] = 0x9b05688c2b3e6c1fULL; c->h[6] = 0x1f83d9abfb41bd6bULL; c->h[7] = 0x5be0cd19137e2179ULL; c->lo = 0; c->hi = 0; c->used = 0; } /** Docstring: Feed bytes into a running SHA-512 digest.*
- `ed_sha512_final` (line 188) `void ed_sha512_final(ed_sha *c, unsigned char out[64])` - *if ((unsigned long)take > left) take = (unsigned)left; for (k = 0; k < take; k++) c->buf[c->used + k] = data[i + k]; c->used += take; i += take; if (c->used == 128u) { ed_sha_block(c, c->buf); c->used = 0; } } } /** Docstring: Finish a SHA-512 digest into 64 bytes, big-endian length.*
- `ed_fe_copy` (line 214) `static void ed_fe_copy(ed_fe *r, const ed_fe *a)` - *for (k = 0; k < 8u; k++) c->buf[112u + k] = (unsigned char)(c->hi >> (56u - 8u * k)); for (k = 0; k < 8u; k++) c->buf[120u + k] = (unsigned char)(c->lo >> (56u - 8u * k)); ed_sha_block(c, c->buf); for (i = 0; i < 8u; i++) { unsigned b = i * 8u; unsigned s; for (s = 0; s < 8u; s++) out[b + s] = (unsigned char)(c->h[i] >> (56u - 8u * s)); } } /** Docstring: Copy one field element.*
- `ed_fe_zero` (line 222) `static void ed_fe_zero(ed_fe *r)` - *for (s = 0; s < 8u; s++) out[b + s] = (unsigned char)(c->h[i] >> (56u - 8u * s)); } } /** Docstring: Copy one field element. static void ed_fe_copy(ed_fe *r, const ed_fe *a) { r->v[0] = a->v[0]; r->v[1] = a->v[1]; r->v[2] = a->v[2]; r->v[3] = a->v[3]; } /** Docstring: Zero one field element.*
- `ed_fe_one` (line 230) `static void ed_fe_one(ed_fe *r)` - *r->v[1] = a->v[1]; r->v[2] = a->v[2]; r->v[3] = a->v[3]; } /** Docstring: Zero one field element. static void ed_fe_zero(ed_fe *r) { r->v[0] = 0; r->v[1] = 0; r->v[2] = 0; r->v[3] = 0; } /** Docstring: One as a field element.*
- `ed_fe_cmov` (line 238) `static void ed_fe_cmov(ed_fe *r, const ed_fe *b, unsigned flag)` - *r->v[1] = 0; r->v[2] = 0; r->v[3] = 0; } /** Docstring: One as a field element. static void ed_fe_one(ed_fe *r) { r->v[0] = 1; r->v[1] = 0; r->v[2] = 0; r->v[3] = 0; } /** Docstring: Constant-time select between two field elements.*
- `ed_fe_ge` (line 247) `static unsigned ed_fe_ge(const ed_fe *a, const ed_fe *b)` - *r->v[2] = 0; r->v[3] = 0; } /** Docstring: Constant-time select between two field elements. static void ed_fe_cmov(ed_fe *r, const ed_fe *b, unsigned flag) { ed_u64 m = 0ULL - (ed_u64)(flag & 1u); r->v[0] ^= m & (r->v[0] ^ b->v[0]); r->v[1] ^= m & (r->v[1] ^ b->v[1]); r->v[2] ^= m & (r->v[2] ^ b->v[2]); r->v[3] ^= m & (r->v[3] ^ b->v[3]); } /** Docstring: 1 when a is at least b as 256-bit integers, else 0.*
- `ed_fe_rawsub` (line 258) `static void ed_fe_rawsub(ed_fe *r, const ed_fe *a, const ed_fe *b)` - *} /** Docstring: 1 when a is at least b as 256-bit integers, else 0. static unsigned ed_fe_ge(const ed_fe *a, const ed_fe *b) { if (a->v[3] != b->v[3]) return (a->v[3] > b->v[3]) ? 1u : 0u; if (a->v[2] != b->v[2]) return (a->v[2] > b->v[2]) ? 1u : 0u; if (a->v[1] != b->v[1]) return (a->v[1] > b->v[1]) ? 1u : 0u; return (a->v[0] >= b->v[0]) ? 1u : 0u; } /** Docstring: r holds a minus b, caller guarantees a above b.*
- `ed_fe_add` (line 280) `static void ed_fe_add(ed_fe *r, const ed_fe *a, const ed_fe *b)` - *ed_u64 d2 = a->v[2] - bw1; ed_u64 c3 = (d2 > a->v[2]) ? 1u : 0u; ed_u64 t2 = d2 - b->v[2]; ed_u64 c4 = (t2 > d2) ? 1u : 0u; ed_u64 bw2 = c3 | c4; ed_u64 d3 = a->v[3] - bw2; ed_u64 t3 = d3 - b->v[3]; r->v[0] = t0; r->v[1] = t1; r->v[2] = t2; r->v[3] = t3; } /** Docstring: r holds a plus b mod q with one conditional subtract.*
- `ed_fe_sub` (line 302) `static void ed_fe_sub(ed_fe *r, const ed_fe *a, const ed_fe *b)` - *c = (__uint128_t)a->v[2] + b->v[2] + (ed_u64)(c >> 64); t.v[2] = (ed_u64)c; c = (__uint128_t)a->v[3] + b->v[3] + (ed_u64)(c >> 64); t.v[3] = (ed_u64)c; q.v[0] = ed_qq[0]; q.v[1] = ed_qq[1]; q.v[2] = ed_qq[2]; q.v[3] = ed_qq[3]; if ((ed_u64)(c >> 64) || ed_fe_ge(&t, &q)) ed_fe_rawsub(&t, &t, &q); ed_fe_copy(r, &t); } /** Docstring: r holds a minus b mod q with borrow folded back.*
- `ed_fe_fold` (line 344) `static void ed_fe_fold(ed_fe *r, ed_u64 w[8])` - *q.v[2] = ed_qq[2]; q.v[3] = ed_qq[3]; c = (__uint128_t)t.v[0] + q.v[0]; t.v[0] = (ed_u64)c; c = (__uint128_t)t.v[1] + q.v[1] + (ed_u64)(c >> 64); t.v[1] = (ed_u64)c; c = (__uint128_t)t.v[2] + q.v[2] + (ed_u64)(c >> 64); t.v[2] = (ed_u64)c; t.v[3] = t.v[3] + q.v[3] + (ed_u64)(c >> 64); } ed_fe_copy(r, &t); } /** Docstring: Fold eight limbs mod q with three 38-fold passes.*
- `ed_fe_mul` (line 387) `static void ed_fe_mul(ed_fe *r, const ed_fe *a, const ed_fe *b)` - *back.v[0] = w[4] * 38u; back.v[1] = 0; back.v[2] = 0; back.v[3] = 0; ed_fe_add(&t, &t, &back); if (ed_fe_ge(&t, &q)) ed_fe_rawsub(&t, &t, &q); if (ed_fe_ge(&t, &q)) ed_fe_rawsub(&t, &t, &q); } ed_fe_copy(r, &t); } /** Docstring: r holds a times b mod q, schoolbook over 128-bit lanes.*
- `ed_fe_sq` (line 416) `static void ed_fe_sq(ed_fe *r, const ed_fe *a)` - *} carry = acc; k = i + 4u; while (carry && k < 8u) { __uint128_t s = (__uint128_t)t[k] + (ed_u64)carry; t[k] = (ed_u64)s; carry = s >> 64; k++; } } ed_fe_fold(r, t); } /** Docstring: r holds a squared mod q.*
- `ed_fe_pow` (line 421) `static void ed_fe_pow(ed_fe *r, const ed_fe *a, const unsigned char *bits, unsigned nbits)` - *t[k] = (ed_u64)s; carry = s >> 64; k++; } } ed_fe_fold(r, t); } /** Docstring: r holds a squared mod q. static void ed_fe_sq(ed_fe *r, const ed_fe *a) { ed_fe_mul(r, a, a); } /** Docstring: r holds a to the e mod q, MSB first, always square.*
- `ed_fe_inv` (line 438) `static void ed_fe_inv(ed_fe *r, const ed_fe *a)` - *Docstring: r holds one over a mod q via Fermat, exponent q minus 2.  * q minus 2 keeps bits 0, 1, 3 and 5..254 set with 2 and 4 clear.*
- `ed_fe_frombytes` (line 449) `static void ed_fe_frombytes(ed_fe *r, const unsigned char b[32])` - *Docstring: r holds one over a mod q via Fermat, exponent q minus 2.  * q minus 2 keeps bits 0, 1, 3 and 5..254 set with 2 and 4 clear. static void ed_fe_inv(ed_fe *r, const ed_fe *a) { unsigned char bits[255]; unsigned i; for (i = 0; i < 255u; i++) bits[i] = 1; bits[252u] = 0; bits[250u] = 0; ed_fe_pow(r, a, bits, 255u); } /** Docstring: Load 32 little-endian bytes into a field element.*
- `ed_fe_tobytes` (line 461) `static void ed_fe_tobytes(unsigned char b[32], const ed_fe *a)` - */** Docstring: Load 32 little-endian bytes into a field element. static void ed_fe_frombytes(ed_fe *r, const unsigned char b[32]) { unsigned i; unsigned k; for (i = 0; i < 4u; i++) { ed_u64 w = 0; for (k = 0; k < 8u; k++) w |= (ed_u64)b[i * 8u + k] << (8u * k); r->v[i] = w; } } /** Docstring: Store a field element as 32 little-endian bytes.*
- `ed_fe_eq` (line 470) `static unsigned ed_fe_eq(const ed_fe *a, const ed_fe *b)` - *r->v[i] = w; } } /** Docstring: Store a field element as 32 little-endian bytes. static void ed_fe_tobytes(unsigned char b[32], const ed_fe *a) { unsigned i; unsigned k; for (i = 0; i < 4u; i++) for (k = 0; k < 8u; k++) b[i * 8u + k] = (unsigned char)(a->v[i] >> (8u * k)); } /** Docstring: 1 when a equals b limb-wise, else 0.*
- `ed_bytes_lt_q` (line 477) `static unsigned ed_bytes_lt_q(const unsigned char b[32])` - *unsigned k; for (i = 0; i < 4u; i++) for (k = 0; k < 8u; k++) b[i * 8u + k] = (unsigned char)(a->v[i] >> (8u * k)); } /** Docstring: 1 when a equals b limb-wise, else 0. static unsigned ed_fe_eq(const ed_fe *a, const ed_fe *b) { ed_u64 d = (a->v[0] ^ b->v[0]) | (a->v[1] ^ b->v[1]) | (a->v[2] ^ b->v[2]) | (a->v[3] ^ b->v[3]); return (d == 0u) ? 1u : 0u; } /** Docstring: 1 when the 32-byte value is canonical, below q.*
- `ed_scalar_lt_l` (line 495) `static unsigned ed_scalar_lt_l(const unsigned char b[32])` - *i--; if (i == 31u) qb = 0x7f; else if (i == 0u) qb = 0xed; else qb = 0xff; if (b[i] != qb) return (b[i] < qb) ? 1u : 0u; } return 1u; } /** Docstring: 1 when the 32-byte scalar is canonical, below L.*
- `ed_rem_sub` (line 517) `static void ed_rem_sub(ed_u64 r[5], const ed_u64 a[5], const ed_u64 b[5])` - *lb = (unsigned char)(ed_ll[1] >> (8u * (i - 8u))); else if (i < 24u) lb = 0; else if (i < 31u) lb = 0; else lb = 0x10; if (b[i] != lb) return (b[i] < lb) ? 1u : 0u; } return 1u; } /** Docstring: Subtract the 320-bit order from a 320-bit remainder.*
- `ed_rem_ge` (line 545) `static unsigned ed_rem_ge(const ed_u64 a[5], const ed_u64 b[5])` - *ed_u64 c5 = (d3 > a[3]) ? 1u : 0u; ed_u64 t3 = d3 - b[3]; ed_u64 c6 = (t3 > d3) ? 1u : 0u; ed_u64 bw3 = c5 | c6; ed_u64 d4 = a[4] - bw3; ed_u64 t4 = d4 - b[4]; r[0] = t0; r[1] = t1; r[2] = t2; r[3] = t3; r[4] = t4; } /** Docstring: 1 when the 320-bit a holds at least b, else 0.*
- `ed_mod_l` (line 557) `static void ed_mod_l(ed_fe *r, const unsigned char h[64])` - */** Docstring: 1 when the 320-bit a holds at least b, else 0. static unsigned ed_rem_ge(const ed_u64 a[5], const ed_u64 b[5]) { if (a[4] != b[4]) return (a[4] > b[4]) ? 1u : 0u; if (a[3] != b[3]) return (a[3] > b[3]) ? 1u : 0u; if (a[2] != b[2]) return (a[2] > b[2]) ? 1u : 0u; if (a[1] != b[1]) return (a[1] > b[1]) ? 1u : 0u; return (a[0] >= b[0]) ? 1u : 0u; } /** Docstring: Reduce a 64-byte digest mod L by binary long division.*
- `ed_ge_copy` (line 596) `static void ed_ge_copy(ed_ge *r, const ed_ge *a)` - *if (ed_rem_ge(rem, lv)) { ed_rem_sub(tmp, rem, lv); for (nk = 0; nk < 5u; nk++) rem[nk] = tmp[nk]; } } } r->v[0] = rem[0]; r->v[1] = rem[1]; r->v[2] = rem[2]; r->v[3] = rem[3]; } /** Docstring: Copy one extended point.*
- `ed_ge_cmov` (line 604) `static void ed_ge_cmov(ed_ge *r, const ed_ge *b, unsigned flag)` - *r->v[1] = rem[1]; r->v[2] = rem[2]; r->v[3] = rem[3]; } /** Docstring: Copy one extended point. static void ed_ge_copy(ed_ge *r, const ed_ge *a) { ed_fe_copy(&r->x, &a->x); ed_fe_copy(&r->y, &a->y); ed_fe_copy(&r->z, &a->z); ed_fe_copy(&r->t, &a->t); } /** Docstring: Constant-time point select for the scalar multiply.*
- `ed_ge_add` (line 612) `static void ed_ge_add(ed_ge *r, const ed_ge *p, const ed_ge *q, const ed_fe *d2)` - *ed_fe_copy(&r->y, &a->y); ed_fe_copy(&r->z, &a->z); ed_fe_copy(&r->t, &a->t); } /** Docstring: Constant-time point select for the scalar multiply. static void ed_ge_cmov(ed_ge *r, const ed_ge *b, unsigned flag) { ed_fe_cmov(&r->x, &b->x, flag); ed_fe_cmov(&r->y, &b->y, flag); ed_fe_cmov(&r->z, &b->z, flag); ed_fe_cmov(&r->t, &b->t, flag); } /** Docstring: Complete twisted-Edwards addition, valid for all inputs.*
- `ed_ge_double` (line 644) `static void ed_ge_double(ed_ge *r, const ed_ge *p)` - *ed_fe_mul(&c, &t0, d2); ed_fe_add(&t0, &p->z, &p->z); ed_fe_mul(&d, &t0, &q->z); ed_fe_sub(&e, &b, &a); ed_fe_sub(&f, &d, &c); ed_fe_add(&g, &d, &c); ed_fe_add(&h, &b, &a); ed_fe_mul(&r->x, &e, &f); ed_fe_mul(&r->y, &g, &h); ed_fe_mul(&r->z, &f, &g); ed_fe_mul(&r->t, &e, &h); } /** Docstring: Twisted-Edwards doubling for a fixed at minus one.*
- `ed_ge_scalarmult` (line 686) `static void ed_ge_scalarmult(ed_ge *r, const ed_ge *p, const unsigned char s[32],
               ...` - *ed_fe nb; ed_fe_zero(&na); ed_fe_zero(&nb); ed_fe_sub(&na, &na, &a); ed_fe_sub(&nb, &nb, &b); ed_fe_add(&h, &na, &nb); } ed_fe_mul(&r->x, &e, &f); ed_fe_mul(&r->y, &g, &h); ed_fe_mul(&r->z, &f, &g); ed_fe_mul(&r->t, &e, &h); } /** Docstring: r holds p times the 32-byte little-endian scalar.*
- `ed_curve_d` (line 706) `static void ed_curve_d(ed_fe *d)` - *ed_fe_one(&q.y); ed_fe_one(&q.z); ed_fe_zero(&q.t); for (i = 254; i >= 0; i--) { unsigned bit = (unsigned)((s[i >> 3] >> (i & 7)) & 1u); ed_ge_double(&dbl, &q); ed_ge_copy(&q, &dbl); ed_ge_add(&dbl, &q, p, d2); ed_ge_cmov(&q, &dbl, bit); } ed_ge_copy(r, &q); } /** Docstring: Recover the curve constant d from minus 121665 over 121666.*
- `ed25519_verify` (line 810) `int ed25519_verify(const unsigned char sig[64], const unsigned char *msg,
                   unsi...` - *Docstring: Verify an Ed25519 signature, 1 valid else 0 fail-closed.  Rejects S at or above L and non-canonical R/A encodings before any curve work, then checks [S]B minus [h]A against R by cross-multiplied projective comparison, so no inversion touches * the hot path. Null inputs refuse.*

**Structs:**
- `ed_fe` (line 28)
- `ed_ge` (line 32)

**Type_Aliases:**
- `ed_u64` (line 23) `typedef unsigned long long ed_u64;` - *Field elements are four little-endian 64-bit limbs. Products use __uint128_t schoolbook multiply with repeated 38-folds, and scalars reduce mod L by binary long division, so no transcription-risk prime multiple tables are needed. Point decoding recovers x by exponentiation with a sqrt(-1) adjustment computed at run time, so the only transcribed constants are the base point encoding, L, q and the SHA-512 table, all generated by script and pinned by tests/test_sign.c.  Every input to verification is public (signature, message, key), so variable-time field arithmetic is acceptable here; the scalar multiply still uses double-and-add-always out of hygiene.*

#### `editor.c`
**Path:** `kernel/editor.c`
**File Doc:** *================================================================*

**Functions:**
- `edit_alloc` (line 38) `static EditBuf *edit_alloc(const char *fname)`
- `edit_free` (line 55) `static void edit_free(EditBuf *e)`
- `edit_load` (line 61) `static int edit_load(EditBuf *e)`
- `edit_save` (line 99) `static int edit_save(EditBuf *e)`
- `edit_print` (line 113) `static void edit_print(EditBuf *e, int idx)`
- `edit_list` (line 123) `static void edit_list(EditBuf *e, int start, int end)` - *List a (possibly empty) range [start, end], both 1-based inclusive.  A * single argument lists from that line; no argument lists everything.*
- `edit_set_line` (line 135) `static int edit_set_line(EditBuf *e, int idx, const char *text)`
- `edit_insert` (line 144) `static int edit_insert(EditBuf *e, int idx, const char *text)`
- `edit_delete` (line 154) `static int edit_delete(EditBuf *e, int idx)`
- `edit_line_cstr` (line 166) `static void edit_line_cstr(EditLine *l, char *out)` - *Copy a line into a NUL-terminated scratch buffer (lines are otherwise * stored length-prefixed without a terminator).*
- `edit_search` (line 171) `static void edit_search(EditBuf *e, const char *needle)`
- `edit_status` (line 188) `static void edit_status(EditBuf *e)`
- `edit_usage` (line 196) `static void edit_usage(void)`
- `edit_refuse_save` (line 207) `static int edit_refuse_save(EditBuf *e)` - *A buffer that did not hold the whole file must never be written back: * saving it would drop the part that was never loaded.*
- `edit_arg_line` (line 213) `static int edit_arg_line(int argc, char **argv, EditBuf *e, int *out)`
- `edit_loop` (line 224) `static void edit_loop(EditBuf *e)`
- `shell_cmd_edit` (line 329) `void shell_cmd_edit(int argc, char **argv)`

**Macros:**
- `EDIT_MAX_LINES` (line 20) `#define EDIT_MAX_LINES`
- `EDIT_LINE_MAX` (line 21) `#define EDIT_LINE_MAX`
- `EDIT_FILE_MAX` (line 22) `#define EDIT_FILE_MAX`

**Structs:**
- `EditLine` (line 24)
- `EditBuf` (line 29)

#### `exec.c`
**Path:** `kernel/exec.c`
**File Doc:** *exec.c - Process execution: setjmp/longjmp, k_exec_user, k_run_rel, kexit.*

**Functions:**
- `vga_mode_set` (line 61) `void vga_mode_set(int on)`
- `vga_mode_is_active` (line 62) `int  vga_mode_is_active(void)`
- `vga_gfx_ran_set` (line 63) `void vga_gfx_ran_set(int on)`
- `k_user_fault_return` (line 66) `void k_user_fault_return(void)` - *VGA mode tracking: set/cleared by k_exec_user and k_run_rel when a * graphics program owns the display. static int vga_mode13h; static int graphics_program_ran; void vga_mode_set(int on)       { vga_mode13h = on; } int  vga_mode_is_active(void)   { return vga_mode13h; } void vga_gfx_ran_set(int on)    { graphics_program_ran = on; } /* Called from the ISR exception handler when a ring-3 user program faults.*
- `setup_user_stack` (line 83) `unsigned long *setup_user_stack(char *sbase, unsigned long ssize,
                               ...`
- `k_run_rel` (line 233) `int k_run_rel(prog_entry_t entry, int argc, char **argv)`
- `kexit` (line 284) `void kexit(int code)`

**Macros:**
- `EXEC_KSTACK_SZ` (line 124) `#define EXEC_KSTACK_SZ`
- `ETREL_CHILD_STACK_SZ` (line 133) `#define ETREL_CHILD_STACK_SZ`

**Variables:**
- `syscall_kstack` (line 116) `extern unsigned long syscall_kstack;` - *unsigned long sp = ((unsigned long)p - (unsigned long)nwords * 8) & ~15UL; unsigned long *w = (unsigned long *)sp; int idx = 0; w[idx++] = (unsigned long)argc; for (i = 0; i < argc; i++) w[idx++] = (unsigned long)argp[i]; w[idx++] = 0; w[idx++] = 0; w[idx++] = 6;  w[idx++] = 4096; w[idx++] = 25; w[idx++] = (unsigned long)randp; w[idx++] = 0;  w[idx++] = 0; return w; } /* Enter a ring-3 program via iretq.*

#### `futex.c`
**Path:** `kernel/futex.c`
**File Doc:** *Docstring: kernel/futex.c -- Kernel side of the futex contract.*

**Functions:**
- `futex_hash` (line 23) `static unsigned long futex_hash(unsigned long uaddr)`
- `futex_bucket` (line 31) `static futex_bucket_t *futex_bucket(unsigned long uaddr)`
- `futex_init` (line 36) `void futex_init(void)` - *static unsigned long futex_hash(unsigned long uaddr) { unsigned long word = uaddr >> 2; word ^= word >> 16; word *= FUTEX_HASH_GOLDEN; word ^= word >> 13; return word & FUTEX_BUCKET_MASK; } static futex_bucket_t *futex_bucket(unsigned long uaddr) { return &futex_table.buckets[futex_hash(uaddr)]; } /** Docstring: Initialize every bucket queue and clear the awaited table.*
- `futex_unlink_locked` (line 50) `static void futex_unlink_locked(futex_bucket_t *b, int pid)` - *Unlink pid from bucket b's queue (bucket lock held). The walk is bounded by MAX_PROCS: a queue longer than the process table is corrupt, * and walking it forever with interrupts off froze the machine.*
- `futex_forget` (line 76) `void futex_forget(int pid)` - *Docstring: Drop pid from the futex queues (see futex.h). A thread that dies or is killed while waiting stays queued; once its slot is reused the stale node aliases the new thread, and the new thread queueing behind itself linked tail -> tail, a cycle futex_wake spun on forever. * Called before every wait and when a slot is reaped.*
- `futex_linux_cmd` (line 128) `int futex_linux_cmd(long op)` - *futex_table.awaited[cur->pid] = uaddr; if (b->head == WQ_NONE) { b->head = cur->pid; b->tail = cur->pid; } else { procs[b->tail].wq_next = cur->pid; b->tail = cur->pid; } spin_unlock_irqrestore(&b->lock, flags); schedule(); return FUTEX_OK; } /** Docstring: Decode a Linux futex(2) op to WAIT/WAKE.*
- `futex_timeout_remaining_us` (line 139) `long futex_timeout_remaining_us(int cmd, long sec, long nsec, unsigned long now_us)` - *} /** Docstring: Decode a Linux futex(2) op to WAIT/WAKE. int futex_linux_cmd(long op) { long cmd; if (op < 0) return -1; cmd = op & ~(long)(LINUX_FUTEX_PRIVATE_FLAG | LINUX_FUTEX_CLOCK_REALTIME); if (cmd == LINUX_FUTEX_WAIT || cmd == LINUX_FUTEX_WAKE || cmd == LINUX_FUTEX_WAIT_BITSET || cmd == LINUX_FUTEX_WAKE_BITSET) return (int)cmd; return -1; } /** Docstring: Microseconds left before a futex timeout (see futex.h).*
- `futex_wake` (line 158) `long futex_wake(unsigned long uaddr, int n)` - *Docstring: Wake up to n sleepers waiting on uaddr.  Only entries whose recorded address equals uaddr change state; hash collisions sleep through. Entries that no longer sleep (a waiter that died or was killed in the queue) are unlinked on the way. The walk is bounded by MAX_PROCS. Returns the number of threads woken, zero when the bucket holds no waiter for this address. Never sleeps.*

**Structs:**
- `futex_table_t` (line 16)

**Variables:**
- `t_cur_pid` (line 13) `extern int t_cur_pid;` - *ifdef SYNC_HOST_CURRENT_PID*

#### `klog.c`
**Path:** `kernel/klog.c`
**File Doc:** *klog.c - Structured kernel logging with levels and subsystems.*

**Functions:**
- `klog_set_level` (line 29) `void klog_set_level(log_level_t level)`
- `klog_set_subsys_level` (line 33) `void klog_set_subsys_level(log_subsystem_t subsys, log_level_t level)`
- `klog_disable` (line 38) `void klog_disable(void)`
- `klog_enable` (line 39) `void klog_enable(void)`
- `klog` (line 41) `void klog(log_level_t level, log_subsystem_t subsys,
          const char *fmt, ...)`
- `klog_hexdump` (line 119) `void klog_hexdump(log_level_t level, log_subsystem_t subsys,
                  const void *data, ...`

#### `ldso_parse.c`
**Path:** `kernel/ldso_parse.c`
**File Doc:** *Docstring: kernel/ldso_parse.c -- pure dynamic-table parsing (T8 ld.so).*

**Imported by:** `test_ldso.c`

**Functions:**
- `ldso_rd16` (line 18) `static unsigned ldso_rd16(const unsigned char *p)`
- `ldso_rd32` (line 22) `static unsigned long ldso_rd32(const unsigned char *p)`
- `ldso_rd64` (line 27) `static unsigned long long ldso_rd64(const unsigned char *p)`
- `ldso_slice` (line 32) `static int ldso_slice(const unsigned char *file, unsigned long long fsize,
        unsigned long ...`
- `ldso_valid_ehdr` (line 40) `static int ldso_valid_ehdr(const unsigned char *file,
        unsigned long long fsize)`
- `ldso_vaddr_to_offset` (line 54) `int ldso_vaddr_to_offset(const unsigned char *file,
        unsigned long long fsize, unsigned lo...`
- `ldso_segments` (line 86) `int ldso_segments(const unsigned char *file, unsigned long long fsize,
        LdsoSeg *segs, uns...`
- `ldso_find_dynamic` (line 120) `int ldso_find_dynamic(const unsigned char *file, unsigned long long fsize,
        unsigned long ...`
- `ldso_scan_dynamic` (line 150) `int ldso_scan_dynamic(const unsigned char *file, unsigned long long fsize,
        unsigned long ...`
- `ldso_sym_count` (line 213) `int ldso_sym_count(const unsigned char *file, unsigned long long fsize,
        unsigned long lon...`
- `ldso_copy_str` (line 227) `int ldso_copy_str(const unsigned char *file, unsigned long long fsize,
        unsigned long long...`
- `ldso_name_eq` (line 250) `static int ldso_name_eq(const unsigned char *tab, unsigned long long strsz,
        unsigned long...`
- `ldso_sym_lookup` (line 263) `int ldso_sym_lookup(const unsigned char *file, unsigned long long fsize,
        unsigned long lo...`
- `ldso_rela_count` (line 296) `int ldso_rela_count(const LdsoDynInfo *info, unsigned *nrela)`
- `ldso_read_rela` (line 309) `int ldso_read_rela(const unsigned char *file, unsigned long long fsize,
        unsigned long lon...`
- `ldso_basename` (line 331) `void ldso_basename(char *out, const char *src)`

**Macros:**
- `LDSO_EHSIZE` (line 13) `#define LDSO_EHSIZE`
- `LDSO_PHENTSZ` (line 14) `#define LDSO_PHENTSZ`
- `LDSO_DYN_ENT` (line 15) `#define LDSO_DYN_ENT`
- `LDSO_HASH_HDR` (line 16) `#define LDSO_HASH_HDR`

#### `loader.c`
**Path:** `kernel/loader.c`
**File Doc:** *================================================================*

**Functions:**
- `elf_name_copy` (line 114) `static void elf_name_copy(char *out, unsigned out_cap, const char *tab,
                         ...`
- `elf_load_fail` (line 128) `static void elf_load_fail(void *base, void **sec_addrs, const char *why)`
- `elf_load` (line 136) `void *elf_load(void *data, unsigned size, void **base_out)`
- `ldso_pseudo_stat` (line 402) `int ldso_pseudo_stat(int ino, unsigned long *size_out)`
- `ldso_pseudo_read` (line 416) `int ldso_pseudo_read(int ino, void *dst, unsigned long off, unsigned len)`
- `ldso_read_file` (line 441) `static int ldso_read_file(const char *name, unsigned char **out,
        unsigned *size_out)` - *Read a whole library file by DT_NEEDED name: exact path first, then the basename, ramdisk before MiniFS (the shell's own search order). * The buffer is heap-owned; every failure releases it.*
- `ldso_ensure_slot` (line 483) `static int ldso_ensure_slot(const char *needed, int *slot_out)` - *Resolve a DT_NEEDED name to a registry slot, loading and reserving on first use. Validates the full dynamic contract (tables present, 24-byte symbols, hash-sized count, load span inside the region) * before publishing anything.*
- `consistent` (line 579) `* consistent (the next exec forgets them, a dying window frees them),
 * and only reports. */
sta...`
- `ldso_bind_into` (line 794) `int ldso_bind_into(void *data, unsigned size, unsigned long base,
        unsigned long cr3, vma_...` - *Bind one executable image with DT_NEEDED libraries: map every library into the target window, then resolve each GLOB_DAT row. Static images (no dynamic section, or none needed) return 0 at once, so the legacy paths never observe a difference. Live callers pass cr3 0 and vma 0 (current tables, legacy view already bound); * isolated callers pass the child's tables and context.*
- `apply_exec_relocs` (line 984) `static void apply_exec_relocs(void *data, unsigned size, unsigned long base,
                    ...`
- `elf_note_pad` (line 1072) `static unsigned long elf_note_pad(unsigned long n)` - *case R_X86_64_GLOB_DAT: case R_X86_64_JUMP_SLOT: PP = S; break; } } } } #define SHT_NOTE    7 #define SIGN_NOTE_NAME ".note.minios.sign" /* Size of one note field rounded up to ELF_NOTE_ALIGN.*
- `elf_sign_note_span` (line 1083) `static int elf_sign_note_span(const unsigned char *img, unsigned long off,
                      ...` - *Docstring: Pull the signature descriptor out of one PT_NOTE span.  Walks notes with the same pad math as the process-note probe. A candidate carries name MINIOS_NOTE_NAME, type MINIOS_NOTE_SIGN and a SIGN_DESC_BYTES descriptor holding one key id byte plus the 64-byte Ed25519 signature. Reports 1 with the descriptor address, * else 0.*
- `elf_sign_note_find` (line 1108) `static int elf_sign_note_find(const unsigned char *img, unsigned size,
                          ...` - *Docstring: Find a signature note across the PT_NOTE segments. * Reports 1 with the first descriptor found, else 0.*
- `elf_sign_section_find` (line 1132) `static int elf_sign_section_find(const unsigned char *img, unsigned size,
                       ...` - *Docstring: Find a signature note in the SHT_NOTE section table.  Post-link signing (tools/sign_elf.py) appends a non-allocated .note.minios.sign section, so binaries whose link never carried the note still verify. Bounds discipline mirrors the ET_REL loader: table extent, per-section ranges and the string table are all checked before any byte is read. Reports 1 with the * descriptor address, else 0.*
- `elf_sign_u64` (line 1172) `static void elf_sign_u64(ed_sha *c, unsigned long v)` - *elf_note_pad(SIGN_DESC_BYTES)) continue; elf_name_copy(secname, sizeof(secname), shstrtab, shstr->sh_size, shdrs[i].sh_name); if (kstrcmp(secname, SIGN_NOTE_NAME) != 0) continue; desc_out = img + shdrs[i].sh_offset + ELF_NOTE_HDR + elf_note_pad(sizeof(MINIOS_NOTE_NAME)); return 1; } return 0; } /** Docstring: Feed one little-endian u64 into the image digest.*
- `elf_sign_u32` (line 1181) `static void elf_sign_u32(ed_sha *c, unsigned v)` - *} return 0; } /** Docstring: Feed one little-endian u64 into the image digest. static void elf_sign_u64(ed_sha *c, unsigned long v) { unsigned char b[8]; unsigned k; for (k = 0; k < 8u; k++) b[k] = (unsigned char)(v >> (8u * k)); ed_sha512_update(c, b, 8ul); } /** Docstring: Feed one little-endian u32 into the image digest.*
- `load_exec_elf` (line 1262) `void *load_exec_elf(void *data, unsigned size)`
- `base_out` (line 1395) `* the link base via base_out (0 when the caller runs static images
 * only: the dynamic binder ne...`
- `elf_wants_process` (line 1432) `int elf_wants_process(const void *data, unsigned size)` - *Does an ET_EXEC/ET_DYN image ask to run as a process (minios_abi.h, process note)? Header and program-header table are bounds checked like load_exec_elf_into; any malformed table answers 0 and leaves the load * itself to report it.*
- `load_exec_elf_into` (line 1456) `void *load_exec_elf_into(void *data, unsigned size, unsigned long cr3,
                         u...`
- `inodes` (line 381) `* Pseudo inodes (LDSO_INO_BASE + slot) keep registry pages apart from * MiniFS inodes in the shared cache. No unload in v1: slots and file * copies live for the machine's life, and the refcount names `
- `images` (line 790) `* Static images (no dynamic section, or none needed) return 0 at * once, so the legacy paths never observe a difference. Live callers * pass cr3 0 and vma 0 (current tables, legacy view already bound)`
- `process` (line 1288) `* atomic section: a 100 Hz tick between two segments would switch * CR3 into another process (copies landing in its pages, NX marks * and brk carved from its view) and corrupt whoever loses. The * iso`
- `time` (line 1520) `* time (with the failing offset);`

**Macros:**
- `ELF64_R_SYM` (line 62) `#define ELF64_R_SYM(i)`
- `ELF64_R_TYPE` (line 63) `#define ELF64_R_TYPE(i)`
- `SHN_UNDEF` (line 64) `#define SHN_UNDEF`
- `ETREL_IMAGE_MAX` (line 71) `#define ETREL_IMAGE_MAX`
- `SHT_SYMTAB` (line 73) `#define SHT_SYMTAB`
- `SHT_STRTAB` (line 74) `#define SHT_STRTAB`
- `SHT_RELA` (line 75) `#define SHT_RELA`
- `SHT_PROGBITS` (line 76) `#define SHT_PROGBITS`
- `SHT_NOBITS` (line 77) `#define SHT_NOBITS`
- `SHF_ALLOC` (line 78) `#define SHF_ALLOC`
- `SHF_EXECINSTR` (line 79) `#define SHF_EXECINSTR`
- `EM_X86_64` (line 81) `#define EM_X86_64`
- `PT_LOAD` (line 82) `#define PT_LOAD`
- `PT_NOTE` (line 83) `#define PT_NOTE`
- `ELF_NOTE_HDR` (line 87) `#define ELF_NOTE_HDR`
- `ELF_NOTE_ALIGN` (line 88) `#define ELF_NOTE_ALIGN`
- `R_X86_64_64` (line 90) `#define R_X86_64_64`
- `R_X86_64_PC32` (line 91) `#define R_X86_64_PC32`
- `R_X86_64_PLT32` (line 92) `#define R_X86_64_PLT32`
- `R_X86_64_GLOB_DAT` (line 93) `#define R_X86_64_GLOB_DAT`
- `R_X86_64_JUMP_SLOT` (line 94) `#define R_X86_64_JUMP_SLOT`
- `R_X86_64_RELATIVE` (line 95) `#define R_X86_64_RELATIVE`
- `R_X86_64_32` (line 96) `#define R_X86_64_32`
- `R_X86_64_32S` (line 97) `#define R_X86_64_32S`
- `R_X86_64_IRELATIVE` (line 98) `#define R_X86_64_IRELATIVE`
- `PF_X` (line 100) `#define PF_X`
- `ELF_MAX_SEGMENTS` (line 101) `#define ELF_MAX_SEGMENTS`
- `ELF_NAME_MAX` (line 102) `#define ELF_NAME_MAX`
- `SHT_NOTE` (line 1067) `#define SHT_NOTE`
- `SIGN_NOTE_NAME` (line 1069) `#define SIGN_NOTE_NAME`

**Structs:**
- `exec_range` (line 104)
- `Elf64_Shdr` (line 23)
- `Elf64_Sym` (line 36)
- `Elf64_Rela` (line 45)
- `Elf64_Phdr` (line 51)
- `LdsoLibEnt` (line 388)

#### `lz4_kernel.c`
**Path:** `kernel/lz4_kernel.c`

**Functions:**
- `LZ4_read32` (line 7) `static inline unsigned int LZ4_read32(const unsigned char *p)`
- `LZ4_read16` (line 14) `static inline unsigned int LZ4_read16(const unsigned char *p)`
- `LZ4_write16` (line 21) `static inline void LZ4_write16(unsigned char *dst, unsigned short v)`
- `LZ4_hash` (line 26) `static unsigned int LZ4_hash(const unsigned char *p)`
- `LZ4_compressBound` (line 33) `int LZ4_compressBound(int inputSize)`
- `LZ4_compress_default` (line 40) `int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity)`
- `LZ4_decompress_safe` (line 176) `int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity)`
- `slots` (line 43) `* runs from file writes on 16 KB proc slots (stack discipline, * CLAUDE.md). OOM returns 0 and the caller stores uncompressed. */ int *hash_table = (int *)kmalloc(sizeof(int) * HASH_SIZE);`

**Macros:**
- `HASH_BITS` (line 4) `#define HASH_BITS`
- `HASH_SIZE` (line 5) `#define HASH_SIZE`

#### `minifetch.c`
**Path:** `kernel/minifetch.c`
**File Doc:** *Docstring: kernel/minifetch.c -- neofetch-style system screen.*

**Functions:**
- `minifetch_row` (line 57) `static void minifetch_row(const unsigned char *img, int w, int h, int row,
                      ...` - *"       DOOM  ready.           ", "                              ", "                              ", "                              ", "                              ", "                              ", "                              ", "                              ", "                              ", "                              ", "                              ", }; /** Docstring: Render one logo row into out from RGBA pixels.*
- `minifetch_logo` (line 81) `static void minifetch_logo(char rows[16][33])` - *const unsigned char *p1 = img + ((y1 * w) + sx) * 4; unsigned lum; if (p0[3] < 128 && p1[3] < 128) { out[x] = ' '; continue; } lum = (unsigned)(p0[0] + p0[1] + p0[2] + p1[0] + p1[1] + p1[2]) / 6; c = (int)(lum * (unsigned)(ramp_len - 1) / 255); out[x] = mf_cfg.ramp[c]; } out[mf_cfg.logo_cols] = 0; } /** Docstring: Fill rows with the live logo or the fallback text.*
- `minifetch_specs` (line 101) `static int minifetch_specs(char lines[20][96])` - *stbi_image_free(img); for (r = 0; r < mf_cfg.logo_rows; r++) { for (i = 0; i < mf_cfg.logo_cols; i++) rows[r][i] = mf_fallback[r][i]; rows[r][mf_cfg.logo_cols] = 0; } return; } for (r = 0; r < mf_cfg.logo_rows; r++) minifetch_row(img, w, h, r, rows[r]); stbi_image_free(img); } /** Docstring: Print the spec column into lines, return line count.*
- `shell_cmd_minifetch` (line 156) `void shell_cmd_minifetch(void)` - *ksprintf(lines[n++], "Display: %dx%dx%d", fb_width, fb_height, fb_bpp); ksprintf(lines[n++], "Net: %02x:%02x:%02x:%02x:%02x:%02x %u.%u.%u.%u", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ip[0], ip[1], ip[2], ip[3]); if (ok) ksprintf(lines[n++], "Date: %02d:%02d:%02d CMOS", hh, mm, ss); else ksprintf(lines[n++], "Date: unavailable"); ksprintf(lines[n++], "Toolchain: minigcc.o + ld.o + cvm.o"); ksprintf(lines[n++], "Shell: minios sh + lua + micropython"); return n; } /** Docstring: Print the two-column fetch screen.*
- `frame` (line 159) `* frame (stack discipline, CLAUDE.md). Fail-closed on OOM. */ char (*specs)[96] = (char (*)[96])kmalloc(20 * 96);`

**Structs:**
- `minifetch_cfg` (line 21)

#### `cow.c`
**Path:** `kernel/mm/cow.c`
**File Doc:** *Docstring: kernel/mm/cow.c -- Copy-on-write fork support.*

**Functions:**
- `cow_slot` (line 68) `static unsigned long cow_slot(unsigned long phys)`
- `cow_find` (line 73) `static int cow_find(unsigned long phys)` - *unsigned long phys; int ref; } cow_entry_t; static cow_entry_t *cow_tab; static unsigned long cow_live; static unsigned long cow_tombs; static int cow_drops; static unsigned long cow_slot(unsigned long phys) { return ((phys >> 12) * COW_HASH_MUL) >> (64 - COW_BITS); } /* Index of phys's live entry, or -1. Caller holds cow_lock.*
- `cow_remove` (line 85) `static void cow_remove(int idx)` - *Retire entry idx: a tombstone keeps later probe chains intact; an empty * table drops every tombstone at once. Caller holds cow_lock.*
- `cow_table_ensure` (line 98) `static void cow_table_ensure(void)` - *Create the table on first use, outside cow_lock (allocation). Fork * without a table copies pages eagerly, as before.*
- `cow_rehash` (line 110) `static void cow_rehash(void)` - *Reinsert the live entries in place when tombstones lengthen the probe chains: lift each live entry out and insert it again. Caller holds * cow_lock.*
- `cow_page_shared` (line 132) `int cow_page_shared(unsigned long phys)` - *Docstring: True when phys is still shared copy-on-write. mprotect consults this before setting a writable bit: upgrading a shared page in place would let one window write another's bytes without ever faulting into cow_resolve. Pure scan, no allocation, safe * under the caller's mm_lock (cow_lock is a leaf here).*
- `cow_copy_demand` (line 166) `static void cow_copy_demand(unsigned long pcr3, unsigned long ccr3)` - *Copy the parent's demand-paging reservations (non-present PTEs carrying PTE_DEMAND) into the child: a reserved, never-touched page is part of * the address space fork duplicates, and the child faults it in fresh.*
- `cow_track` (line 191) `static int cow_track(unsigned long phys)`
- `cow_walk` (line 221) `static void cow_walk(unsigned long cr3, cow_walk_fn fn)`
- `cow_fork_one` (line 255) `static void cow_fork_one(unsigned long pcr3, unsigned long va,
        volatile unsigned long *ppte)`
- `CPU` (line 287) `* address space down on every other CPU (tlb_shootdown in do_fork_ex). */
unsigned long cow_fork_...`
- `cow_resolve` (line 356) `int cow_resolve(unsigned long cr3, unsigned long va)` - *Docstring: Resolve a write fault on a CoW page: last sharer gets a permission upgrade, otherwise the faulting window gets a private copy. invlpg keeps the local TLB honest and, once the PTE names the private copy, tlb_shootdown drops the shared frame from every sibling thread's TLB on other CPUs (they would keep reading the old bytes). Returns 0 resolved (resume), * -1 not a CoW page (existing fault handling runs).*
- `cow_release_window` (line 421) `void cow_release_window(unsigned long cr3)` - *Docstring: Drop one window's CoW shares before its pages are freed: multi-shared pages are unmapped here (phys survives for the other window), last-shared pages are forgotten so pt_free_user frees them * normally. Runs at the head of pt_free_user.*
- `cow_shared` (line 464) `int cow_shared(void)` - *idx = cow_find(phys); if (idx < 0) continue; if (cow_tab[idx].ref > 1) { cow_tab[idx].ref--; pt[k] = 0; } else { cow_remove(idx); } } } spin_unlock_irqrestore(&cow_lock, cow_irq); } /** Docstring: Live shared-page refs, for the `mem` pressure readout.*
- `alternative` (line 20) `* window is one instruction wide and the alternative (no CoW) is * documented, so the trade stands. */ #include "kernel.h" #include "bootdefs.h" #include "vga_fb.h" #include "sched.h" #include "tlb.h"`
- `private` (line 217) `* for every present page in a private (non-graphics) slot. Shared * graphics slots are never CoW: the compositor owns them. */ typedef void (*cow_walk_fn)(unsigned long cr3, unsigned long va, volatile`

**Macros:**
- `COW_BITS` (line 34) `#define COW_BITS`
- `COW_CAP` (line 35) `#define COW_CAP`
- `COW_MASK` (line 36) `#define COW_MASK`
- `COW_LOAD_MAX` (line 37) `#define COW_LOAD_MAX`
- `COW_TOMB_MAX` (line 38) `#define COW_TOMB_MAX`
- `COW_EMPTY` (line 39) `#define COW_EMPTY`
- `COW_TOMB` (line 40) `#define COW_TOMB`
- `COW_HASH_MUL` (line 41) `#define COW_HASH_MUL`
- `PT_USER_RO` (line 46) `#define PT_USER_RO`
- `PT_USER_RW_ENTRY` (line 47) `#define PT_USER_RW_ENTRY`
- `PT_PTE_RW` (line 48) `#define PT_PTE_RW`

**Structs:**
- `cow_entry_t` (line 58)

#### `paging.c`
**Path:** `kernel/mm/paging.c`
**File Doc:** *paging.c - Page table management for the user window and per-process KPTI.*

**Functions:**
- `mm_page_aligned_alloc` (line 32) `static unsigned char *mm_page_aligned_alloc(unsigned size,
                                      ...` - *Page-align a kmalloc'd region. The framebuffer/back-buffer PTEs are built once per 4 KB page from the buffer's base address, and x86 masks the low 12 bits of a PTE into flags, so a 16-byte-aligned `kmalloc` pointer would make the first mapped page start at `buf & ~0xFFF` — i.e. up to 4095 bytes BEFORE the buffer. A guest writing its frame to the mapped VA then overwrote the heap chunk in front of the buffer (a live KFILE), which is the corrupt-handle black screen. The block is page aligned through kmalloc_aligned, so the raw pointer travels in * the word below the base and kfree_aligned releases it safely.*
- `mm_setup_protections` (line 41) `void mm_setup_protections(void)`
- `kmm_ensure_pt` (line 235) `static volatile unsigned long *kmm_ensure_pt(unsigned long phys)` - *Docstring: Return the 4 KB page table backing a 2 MB identity slot, splitting the boot leaf if needed.  A 2 MB leaf cannot be refined in place, so the slot is replaced by a freshly allocated page table whose entries reproduce the leaf's identity mapping and rights. Returns the table, or 0 when the slot is empty (a hole in the boot identity map is a boot bug, not something to paper over) or * out of memory.*
- `coherent` (line 259) `* for memory a device reads and writes by DMA: a controller that is not cache
 * coherent (and an...`
- `kmm_map_device` (line 296) `unsigned long kmm_map_device(unsigned long phys, unsigned long len)`
- `mm_user_pte_update` (line 336) `void mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3)`
- `mm_user_set_exec` (line 356) `void mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3)`
- `pt_owned_index` (line 374) `static int pt_owned_index(unsigned long phys, unsigned long *byte, unsigned *bit)`
- `pt_page_owned` (line 385) `int pt_page_owned(unsigned long phys)` - *#define PT_OWNED_BYTES (HEAP_SIZE / 0x1000UL / 8UL) static unsigned char *pt_owned; static int pt_owned_index(unsigned long phys, unsigned long *byte, unsigned *bit) { unsigned long idx; if (phys & 0xFFFUL) return 0; if (phys < HEAP_BASE || phys >= HEAP_BASE + HEAP_SIZE) return 0; idx = (phys - HEAP_BASE) / 0x1000UL; byte = idx / 8UL; bit = (unsigned)(idx % 8UL); return 1; } /* 1 when phys is a page pt_page_alloc handed out and nobody freed.*
- `pt_page_alloc` (line 392) `void *pt_page_alloc(void)`
- `pt_page_free` (line 411) `void pt_page_free(void *ptr)`
- `pt_clone_user` (line 420) `uint64_t pt_clone_user(uint64_t parent_cr3)`
- `mt_shared_slot` (line 549) `static int mt_shared_slot(unsigned long pd_idx)` - *The legacy path identity-maps the user window (VA == PA), so every CR3 built by pt_clone_user aliases the same physical pages. That is why only one ET_EXEC can run at a time today. The helpers below build an EMPTY user window instead: fresh page tables with no user data pages mapped, except the kernel-owned graphics slots (FB, DOOM/NK back-buffers) which stay shared on purpose. Data pages come from the kernel heap via pt_page_alloc, so each process owns its bytes and switch_to's CR3 swap already isolates them. Pages are freed by the extended pt_free_user below, which releases heap-owned data pages in private slots and never touches identity pages or * the shared graphics slots. /* 1 when this PD slot holds kernel-shared graphics mappings.*
- `pt_clone_user_empty` (line 568) `unsigned long pt_clone_user_empty(void)` - *Fresh user window: kernel mappings copied, every user PT zeroed, graphics slots re-shared from the boot tables. Returns PML4 phys * (usable as CR3), or 0 on OOM. No user data page is mapped.*
- `mm_user_ensure_page` (line 625) `int mm_user_ensure_page(unsigned long cr3, unsigned long va)` - *Ensure one 4 KB user page at va inside cr3 exists (heap-owned). * Returns 0 on success, -1 on OOM or when va leaves the user window.*
- `honest` (line 655) `* and invlpg keeps the local TLB honest (cross-CPU shootdown rides
 * the documented T5 follow-up...`
- `mm_demand_pte` (line 704) `unsigned long mm_demand_pte(unsigned long prot)` - *Docstring: PTE walker shared by the fault, fork and teardown * paths (forward declaration; documented at the definition). static volatile unsigned long *mm_file_pte(unsigned long cr3, unsigned long va); /* Encode a Linux prot as a demand-paging reservation PTE.*
- `mm_anon_frame` (line 715) `static int mm_anon_frame(unsigned long phys)` - *Heap-owned anonymous frame: the only kind an unmap may free (the shared pid-0 window and graphics slots map fixed frames outside the heap, and * file pages belong to the page cache).*
- `mm_anon_fault` (line 779) `int mm_anon_fault(unsigned long cr3, unsigned long va, int write)` - *Resolve a fault on a reservation: map a zeroed page with the reserved protection. Returns 0 when mapped or when another CPU mapped it first (the faulting access retries through the fresh PTE), -1 when va is no reservation, the reservation is PROT_NONE, the access is a write to a read-only one, or the heap is exhausted (the caller kills like any * unresolved fault).*
- `mm_file_page_phys` (line 861) `unsigned long mm_file_page_phys(unsigned long cr3, unsigned long va)` - *Docstring: Read the mapped phys for va in cr3, 0 when the PTE is absent or non-present. Fork and teardown prove sharing through * the tables before taking or dropping cache refs.*
- `mm_file_pte` (line 880) `static volatile unsigned long *mm_file_pte(unsigned long cr3,
        unsigned long va)` - *Docstring: Locate the PTE for va in cr3 without allocating. Returns 0 for any missing level, huge page or out-of-window address. Read-only walk for the fault path (use mm_user_map_page * to change bits).*
- `PTE` (line 1015) `* PTE (a cache page stays cached, but no stale writer may reach it).
 * Never allocates. */
void ...`
- `mm_file_break` (line 1070) `int mm_file_break(unsigned long cr3, unsigned long va)` - *Docstring: Break a write fault on a cache-shared file page into a private copy (fail-closed). Fires after cow_resolve refuses (a file page is never in the cow table outside fork, and fork-shared ones resolve there first). The PTE must be present, read-only and pointing at the cached page the VMA node names; anything else (recycled slot, truncated file, mprotect-RO anon) returns -1 for the kill path. The mapping keeps its cache ref until munmap or * teardown, so the accounting stays balanced. Returns 0 resumed.*
- `mm_copy_user_page` (line 1149) `int mm_copy_user_page(unsigned long dst_cr3, unsigned long src_cr3, unsigned long va)` - *Copy one present user page from src_cr3 to the same VA in dst_cr3, allocating the destination page. Used by fork-style clones. The executable bit rides along: ensure_page maps NX, so an exec source left as-is would fault the clone's fetch with #PF/NX (seen as * err=15 on the child's entry rip).*
- `pt_free_user` (line 1227) `void pt_free_user(uint64_t cr3)`
- `tables` (line 1010) `* tables (munmap/mremap in caller context, under their mm_lock);`
- `explicitly` (line 1011) `* teardown passes the dying window explicitly (zombie-exclusive, no * lock needed). unmap == 0 drops refs only (teardown, whose tables * die next);`

**Macros:**
- `KMM_DEVICE_MAX` (line 200) `#define KMM_DEVICE_MAX`
- `KMM_MAX_IDENTITY` (line 204) `#define KMM_MAX_IDENTITY`
- `KMM_DEVICE_FLAGS` (line 211) `#define KMM_DEVICE_FLAGS`
- `PT_OWNED_BYTES` (line 371) `#define PT_OWNED_BYTES`

**Variables:**
- `_kernel_end` (line 49) `extern char _kernel_end[];`
- `mm_lock` (line 696) `extern spinlock_t mm_lock;`

#### `swap.c`
**Path:** `kernel/mm/swap.c`
**File Doc:** *swap.c - Swap-out/swap-in for the user window (LZ4-compressed disk swap).*

**Functions:**
- `swap_ensure` (line 28) `static int swap_ensure(void)` - *#include "ide.h" #include "lz4_kernel.h" #define SWAP_CHUNK_RAW     65536 #define SWAP_CHUNK_CMP     (SWAP_CHUNK_RAW + 1024) #define SWAP_CHUNK_SECTORS 128 #define SWAP_HDR_SECTORS   1 #define SWAP_MAX_SECTORS   131072 #define SWAP_MAGIC         0x53574150 static unsigned char *swap_buf_raw = 0; static unsigned char *swap_buf_cmp = 0; /** Docstring: Lazily own both scratch buffers. Returns 0 on OOM.*
- `swap_lba` (line 41) `static unsigned long swap_lba(void)`
- `swap_out` (line 47) `int swap_out(unsigned long window_sz)`
- `swap_in` (line 97) `int swap_in(void)`
- `unwired` (line 7) `* * Currently unwired (the isolated-window spawn path superseded the * swap-out design);`

**Macros:**
- `SWAP_CHUNK_RAW` (line 17) `#define SWAP_CHUNK_RAW`
- `SWAP_CHUNK_CMP` (line 18) `#define SWAP_CHUNK_CMP`
- `SWAP_CHUNK_SECTORS` (line 19) `#define SWAP_CHUNK_SECTORS`
- `SWAP_HDR_SECTORS` (line 20) `#define SWAP_HDR_SECTORS`
- `SWAP_MAX_SECTORS` (line 21) `#define SWAP_MAX_SECTORS`
- `SWAP_MAGIC` (line 22) `#define SWAP_MAGIC`

#### `tlb.c`
**Path:** `kernel/mm/tlb.c`
**File Doc:** *tlb.c - cross-CPU TLB shootdown (docs/spec/smp-sched.md, "TLB shootdown").*

**Functions:**
- `tlb_others_on` (line 36) `static int tlb_others_on(unsigned long cr3)` - *1 when another online CPU is running address space cr3 right now. The read races with switches harmlessly: the PTEs are already cleared, so a CPU that loads cr3 after this check starts with a flushed TLB, and one * leaving it is about to reload CR3 anyway.*
- `tlb_shootdown` (line 49) `void tlb_shootdown(unsigned long cr3)`
- `tlb_shootdown_count` (line 71) `unsigned long tlb_shootdown_count(void)`
- `tlb_shootdown_timeouts` (line 75) `unsigned long tlb_shootdown_timeouts(void)`

**Macros:**
- `TLB_SHOOT_SPIN_MAX` (line 24) `#define TLB_SHOOT_SPIN_MAX`

#### `mm.c`
**Path:** `kernel/mm.c`
**File Doc:** *================================================================*

**Functions:**
- `kheap_ram_top` (line 19) `static unsigned long kheap_ram_top(void)` - *RAM top from the CMOS extended-memory count (the identity map covers the first gigabyte; nothing else reports the installed size). 0 when * the firmware left the count empty.*
- `kallocator_init` (line 32) `void kallocator_init(void)` - *Build the heap over [HEAP_BASE, HEAP_BASE + kheap_size): the layout maximum, never past the installed RAM (a smaller machine must not be * handed memory that does not exist).*
- `kmalloc_report_failure` (line 53) `static void kmalloc_report_failure(unsigned long size)`
- `kmalloc` (line 66) `void *kmalloc(unsigned long size)`
- `kmalloc_page` (line 81) `void *kmalloc_page(void)` - *One page-aligned heap page (the page-table and user-page allocator's backing). memalign keeps the cost at one page plus a chunk header, where over-allocating to align cost two pages per page and halved the user memory the heap could back. Same fault injection and reporting as * kmalloc.*
- `kfree` (line 90) `void kfree(void *ptr)`
- `kcalloc` (line 111) `void *kcalloc(unsigned long nmemb, unsigned long size)`
- `krealloc` (line 115) `void *krealloc(void *ptr, unsigned long size)`
- `kmalloc_aligned` (line 127) `void *kmalloc_aligned(unsigned long size, unsigned long align)` - *Docstring: Aligned allocation with a recoverable raw pointer.  Reserves size bytes at the requested power-of-two alignment and stores the original kmalloc pointer in the word below the aligned base, so kfree_aligned releases exactly what the allocator returned. Fail-closed * on zero size, non-power-of-two alignment and size arithmetic overflow.*
- `kfree_aligned` (line 143) `void kfree_aligned(void *ptr)` - *Docstring: Release a kmalloc_aligned block. A null pointer is a no-op; * a pointer outside the heap halts through kfree, never silently.*

**Macros:**
- `KMALLOC_REPORT_EVERY` (line 50) `#define KMALLOC_REPORT_EVERY`

#### `panic.c`
**Path:** `kernel/panic.c`
**File Doc:** *Docstring: kernel/panic.c -- Kernel panic screen.*

**Functions:**
- `panic_hex` (line 23) `static void panic_hex(unsigned long v, int digits)`
- `panic_fb_puts` (line 30) `static void panic_fb_puts(const char *s)`
- `panic_fb_hex` (line 61) `static void panic_fb_hex(unsigned long v, int digits)`
- `panic_screen` (line 98) `void panic_screen(unsigned long vector, unsigned long err,
        unsigned long rip, unsigned lo...` - *Docstring: Paint the panic screen for an unrecoverable fault and halt when asked. vector/err/rip/rsp come from the trap frame, rbp is the faulting frame pointer. halt != 0 ends in hlt (real faults); halt == 0 returns (the `panic` builtin demo). Re-entry halts * silently: the banner path itself faulted, nothing more can print.*

#### `percpu_rq.c`
**Path:** `kernel/percpu_rq.c`
**File Doc:** *Docstring: kernel/percpu_rq.c -- Per-CPU runqueue hints and stealing.*

**Functions:**
- `rq_cpu_valid` (line 14) `static int rq_cpu_valid(int cpu)`
- `rq_init` (line 19) `void rq_init(void)` - *topology and on spinlock.h for the ring locks, which keeps it host-testable (tests/test_percpu_rq.c, make test-percpu-rq) with a stub topology of fake CPUs.  #include "percpu_rq.h" static percpu_rq_t rqueues[MAX_CPUS]; static int rq_cpu_valid(int cpu) { return cpu >= 0 && cpu < MAX_CPUS && cpu < cpu_count; } /** Docstring: Clear every ring and counter. Called once from sched_init.*
- `rq_enqueue` (line 41) `void rq_enqueue(int cpu, int pid)` - *Docstring: Record pid as READY work for cpu.  Lossy by contract: a full ring drops the hint and counts the drop. The global scan remains the fallback, so a drop costs one rescan period of latency at most, never correctness. Pids outside the table are refused.*
- `rq_pop_local` (line 61) `int rq_pop_local(int cpu)` - *return; spin_lock_irqsave(&rqueues[cpu].lock, &flags); if (rqueues[cpu].count >= RQ_DEPTH) { rqueues[cpu].drops++; spin_unlock_irqrestore(&rqueues[cpu].lock, flags); return; } slot = (rqueues[cpu].head + rqueues[cpu].count) % RQ_DEPTH; rqueues[cpu].ring[slot] = pid; rqueues[cpu].count++; spin_unlock_irqrestore(&rqueues[cpu].lock, flags); } /** Docstring: Pop one hint from the local ring, WQ_NONE_HINT when empty.*
- `rq_steal_once` (line 89) `int rq_steal_once(int self_cpu, int *from_cpu)` - *Docstring: Non-blocking steal of one hint from another CPU's ring.  Tries every remote ring once with spin_trylock and returns the first hint found, reporting the donor through from_cpu. Rings that are busy are skipped, never waited on. Returns WQ_NONE_HINT when nothing could be stolen without blocking. The thief's steal counter is owner-written but updated under the donor's lock, so it uses an atomic add (the same pattern as smp_dispatches) instead of relying on the donor's lock.*
- `rq_empty` (line 115) `int rq_empty(int cpu)` - *pid = rqueues[c].ring[rqueues[c].head]; rqueues[c].ring[rqueues[c].head] = WQ_NONE_HINT; rqueues[c].head = (rqueues[c].head + 1) % RQ_DEPTH; rqueues[c].count--; __sync_fetch_and_add(&rqueues[self_cpu].steals, 1); spin_unlock(&rqueues[c].lock); if (from_cpu) from_cpu = c; return pid; } return WQ_NONE_HINT; } /** Docstring: True when cpu holds no hint. Lock-protected peek.*
- `rq_note_poll` (line 127) `void rq_note_poll(int cpu)` - */** Docstring: True when cpu holds no hint. Lock-protected peek. int rq_empty(int cpu) { irqflags_t flags; int empty; if (!rq_cpu_valid(cpu)) return 1; spin_lock_irqsave(&rqueues[cpu].lock, &flags); empty = (rqueues[cpu].count <= 0); spin_unlock_irqrestore(&rqueues[cpu].lock, flags); return empty; } /** Docstring: Count an unsuccessful claim poll for the rescan schedule.*
- `rq_should_rescan` (line 137) `int rq_should_rescan(int cpu)` - *return empty; } /** Docstring: Count an unsuccessful claim poll for the rescan schedule. void rq_note_poll(int cpu) { irqflags_t flags; if (!rq_cpu_valid(cpu)) return; spin_lock_irqsave(&rqueues[cpu].lock, &flags); rqueues[cpu].polls++; spin_unlock_irqrestore(&rqueues[cpu].lock, flags); } /** Docstring: True every RQ_RESCAN_PERIOD polls, bounding hint staleness.*
- `rq_stats` (line 152) `void rq_stats(int cpu, unsigned long *hits, unsigned long *steals,
              unsigned long *d...` - *irqflags_t flags; int due = 0; if (!rq_cpu_valid(cpu)) return 1; spin_lock_irqsave(&rqueues[cpu].lock, &flags); if (rqueues[cpu].polls >= RQ_RESCAN_PERIOD) { rqueues[cpu].polls = 0; due = 1; } spin_unlock_irqrestore(&rqueues[cpu].lock, flags); return due; } /** Docstring: Snapshot hits, steals and drops for diagnostics.*

#### `printf.c`
**Path:** `kernel/printf.c`
**File Doc:** *================================================================*

**Functions:**
- `putc_buf` (line 7) `static void putc_buf(char c, void *ctx, int *written)`
- `putc_file` (line 13) `static void putc_file(char c, void *ctx, int *written)`
- `putc_str` (line 19) `static void putc_str(char c, void *ctx, int *written)`
- `emit_num` (line 26) `static void emit_num(void (*emit)(char, void *, int *), void *ctx, int *written,
                ...`
- `kformat` (line 44) `static void kformat(void (*emit)(char, void *, int *), void *ctx,
                    int *writte...`
- `kfprintf` (line 157) `int kfprintf(KFILE *f, const char *fmt, ...)`
- `ksprintf` (line 166) `int ksprintf(char *buf, const char *fmt, ...)`
- `putc_snbuf` (line 178) `static void putc_snbuf(char c, void *ctx, int *written)`
- `ksnprintf` (line 184) `int ksnprintf(char *buf, unsigned long size, const char *fmt, ...)`

**Structs:**
- `snctx` (line 177)

#### `proc_sec.c`
**Path:** `kernel/proc_sec.c`
**File Doc:** *Docstring: proc_sec.c -- per-process security state: the Linux seccomp*

**Functions:**
- `pid_ok` (line 74) `static int pid_ok(int pid)`
- `chain_put` (line 78) `static void chain_put(sec_filter_t *f)`
- `proc_sec_inherit` (line 87) `void proc_sec_inherit(int child, int parent)`
- `proc_sec_release` (line 101) `void proc_sec_release(int pid)`
- `proc_sec_exec` (line 115) `void proc_sec_exec(int pid)` - *execve keeps the filters and no_new_privs (Linux) and makes the fresh * image dumpable again.*
- `proc_sec_set_exe` (line 119) `void proc_sec_set_exe(int pid, const char *resolved)`
- `proc_sec_exe` (line 125) `const char *proc_sec_exe(int pid)`
- `sec_kill` (line 130) `static void sec_kill(long n, int whole_group)` - *if (pid_ok(pid)) sec_undumpable[pid] = 0; } void proc_sec_set_exe(int pid, const char *resolved) { if (!pid_ok(pid) || !resolved) return; kstrncpy(sec_exe[pid], resolved, RAMDISK_FNAME_LEN - 1); sec_exe[pid][RAMDISK_FNAME_LEN - 1] = 0; } const char *proc_sec_exe(int pid) { return pid_ok(pid) ? sec_exe[pid] : ""; } /* Kill per the action: the calling thread, or its whole thread group.*
- `proc_sec_filter` (line 136) `int proc_sec_filter(long n, long a1, long a2, long a3, long a4, long a5, long a6, long *ret)`
- `sec_install` (line 191) `static long sec_install(const sbpf_insn *prog, unsigned len, int strict)` - *Validate and push one program onto the caller's chain. strict skips the * no_new_privs requirement, as Linux strict mode does.*
- `sec_install_user` (line 224) `static long sec_install_user(long ufprog)` - *return ERR_EINVAL; } kfree(scratch); node->ref = 1; node->len = len; node->depth = depth; node->prev = head; sec_chain[pid] = node; if (sec_mode[pid] != LINUX_SECCOMP_MODE_FILTER) sec_mode[pid] = strict ? LINUX_SECCOMP_MODE_STRICT : LINUX_SECCOMP_MODE_FILTER; return 0; } /* Copy a user struct sock_fprog and install it.*
- `proc_sec_prctl` (line 235) `long proc_sec_prctl(long option, long a2, long a3, long a4, long a5)`
- `proc_sec_seccomp` (line 290) `long proc_sec_seccomp(long op, long flags, long uargs)`

**Macros:**
- `LINUX_PR_GET_DUMPABLE` (line 18) `#define LINUX_PR_GET_DUMPABLE`
- `LINUX_PR_SET_DUMPABLE` (line 19) `#define LINUX_PR_SET_DUMPABLE`
- `LINUX_PR_SET_NAME` (line 20) `#define LINUX_PR_SET_NAME`
- `LINUX_PR_GET_NAME` (line 21) `#define LINUX_PR_GET_NAME`
- `LINUX_PR_GET_SECCOMP` (line 22) `#define LINUX_PR_GET_SECCOMP`
- `LINUX_PR_SET_SECCOMP` (line 23) `#define LINUX_PR_SET_SECCOMP`
- `LINUX_PR_SET_NO_NEW_PRIVS` (line 24) `#define LINUX_PR_SET_NO_NEW_PRIVS`
- `LINUX_PR_GET_NO_NEW_PRIVS` (line 25) `#define LINUX_PR_GET_NO_NEW_PRIVS`
- `LINUX_SECCOMP_MODE_DISABLED` (line 26) `#define LINUX_SECCOMP_MODE_DISABLED`
- `LINUX_SECCOMP_MODE_STRICT` (line 27) `#define LINUX_SECCOMP_MODE_STRICT`
- `LINUX_SECCOMP_MODE_FILTER` (line 28) `#define LINUX_SECCOMP_MODE_FILTER`
- `LINUX_SECCOMP_SET_MODE_STRICT` (line 29) `#define LINUX_SECCOMP_SET_MODE_STRICT`
- `LINUX_SECCOMP_SET_MODE_FILTER` (line 30) `#define LINUX_SECCOMP_SET_MODE_FILTER`
- `LINUX_SECCOMP_GET_ACTION_AVAIL` (line 31) `#define LINUX_SECCOMP_GET_ACTION_AVAIL`
- `LINUX_NR_READ` (line 32) `#define LINUX_NR_READ`
- `LINUX_NR_WRITE` (line 33) `#define LINUX_NR_WRITE`
- `LINUX_NR_RT_SIGRETURN` (line 34) `#define LINUX_NR_RT_SIGRETURN`
- `LINUX_NR_EXIT` (line 35) `#define LINUX_NR_EXIT`
- `LINUX_ERRNO_MAX` (line 36) `#define LINUX_ERRNO_MAX`
- `LINUX_TASK_COMM_LEN` (line 37) `#define LINUX_TASK_COMM_LEN`
- `SOCK_FPROG_SIZE` (line 39) `#define SOCK_FPROG_SIZE`
- `SOCK_FPROG_FILTER_OFF` (line 40) `#define SOCK_FPROG_FILTER_OFF`
- `ERR_ENOMEM` (line 42) `#define ERR_ENOMEM`
- `ERR_EACCES` (line 43) `#define ERR_EACCES`
- `ERR_EINVAL` (line 44) `#define ERR_EINVAL`
- `ERR_ENOSYS` (line 45) `#define ERR_ENOSYS`
- `ERR_EOPNOTSUPP` (line 46) `#define ERR_EOPNOTSUPP`
- `SEC_STRICT_LEN` (line 72) `#define SEC_STRICT_LEN`

**Structs:**
- `sec_filter` (line 48)

**Type_Aliases:**
- `ref` (line 47) `typedef struct sec_filter { int ref;` - *define ERR_ENOMEM  (-12) define ERR_EACCES  (-13) define ERR_EINVAL  (-22) define ERR_ENOSYS  (-38) define ERR_EOPNOTSUPP (-95)*

#### `rcu.c`
**Path:** `kernel/rcu.c`
**File Doc:** *Docstring: kernel/rcu.c -- Epoch grace periods over scheduler ticks.*

**Functions:**
- `rcu_me` (line 13) `static cpu_t *rcu_me(void)`
- `rcu_me` (line 17) `static cpu_t *rcu_me(void)` - *else*
- `rcu_cpu_valid` (line 40) `static int rcu_cpu_valid(int cpu)`
- `rcu_init` (line 45) `void rcu_init(void)` - *unsigned long qs[MAX_CPUS]; unsigned long depth[MAX_CPUS]; rcu_slot_t pending[RCU_CB_MAX]; int pending_count; unsigned long completed; } rcu_state_t; static rcu_state_t rcu_state; static int rcu_cpu_valid(int cpu) { return cpu >= 0 && cpu < MAX_CPUS && cpu < cpu_count; } /** Docstring: Reset epoch, quiescent marks, depths and callbacks.*
- `rcu_read_lock` (line 63) `void rcu_read_lock(void)` - *for (i = 0; i < MAX_CPUS; i++) { rcu_state.qs[i] = 0; rcu_state.depth[i] = 0; } for (i = 0; i < RCU_CB_MAX; i++) { rcu_state.pending[i].fn = 0; rcu_state.pending[i].arg = 0; rcu_state.pending[i].epoch = 0; } rcu_state.pending_count = 0; rcu_state.completed = 0; } /** Docstring: Enter a read section on the current CPU. Nests.*
- `rcu_read_unlock` (line 75) `void rcu_read_unlock(void)` - */** Docstring: Enter a read section on the current CPU. Nests. void rcu_read_lock(void) { cpu_t *me = rcu_me(); int cpu = me->cpu_id; irqflags_t flags; if (!rcu_cpu_valid(cpu)) return; spin_lock_irqsave(&rcu_state.lock, &flags); rcu_state.depth[cpu]++; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Leave a read section. Underflow is clamped, never wraps.*
- `rcu_deref` (line 88) `void *rcu_deref(void *volatile *pp)` - */** Docstring: Leave a read section. Underflow is clamped, never wraps. void rcu_read_unlock(void) { cpu_t *me = rcu_me(); int cpu = me->cpu_id; irqflags_t flags; if (!rcu_cpu_valid(cpu)) return; spin_lock_irqsave(&rcu_state.lock, &flags); if (rcu_state.depth[cpu] > 0) rcu_state.depth[cpu]--; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Load a published pointer inside a read section.*
- `rcu_publish` (line 94) `void rcu_publish(void *volatile *pp, void *v)` - *return; spin_lock_irqsave(&rcu_state.lock, &flags); if (rcu_state.depth[cpu] > 0) rcu_state.depth[cpu]--; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Load a published pointer inside a read section. void *rcu_deref(void *volatile *pp) { __sync_synchronize(); return *pp; } /** Docstring: Publish a new pointer value with release ordering.*
- `rcu_note_tick` (line 126) `void rcu_note_tick(int cpu)` - *if (rcu_state.pending_count >= RCU_CB_MAX) { r = RCU_ERR_FULL; } else { rcu_slot_t *s = &rcu_state.pending[rcu_state.pending_count]; s->fn = fn; s->arg = arg; s->epoch = rcu_state.epoch; rcu_state.pending_count++; } spin_unlock_irqrestore(&rcu_state.lock, flags); return r; } /** Docstring: Record a quiescent state for cpu at the current epoch.*
- `rcu_note_idle` (line 137) `void rcu_note_idle(int cpu)` - *} /** Docstring: Record a quiescent state for cpu at the current epoch. void rcu_note_tick(int cpu) { irqflags_t flags; if (!rcu_cpu_valid(cpu)) return; spin_lock_irqsave(&rcu_state.lock, &flags); if (rcu_state.depth[cpu] == 0) rcu_state.qs[cpu] = rcu_state.epoch; spin_unlock_irqrestore(&rcu_state.lock, flags); } /** Docstring: Idle CPUs are always quiescent.*
- `rcu_poll` (line 152) `void rcu_poll(void)` - *Docstring: Advance the epoch and run due callbacks.  A grace period closes when every online CPU reported quiescence at the current epoch. Callbacks stamped with an older epoch then run inline and the epoch advances. Runs from the timer tick; never blocks.*
- `expires` (line 193) `* expires (ticks stalled, never a hang). No completion assert is
 * possible here by design: a re...`

**Structs:**
- `rcu_slot_t` (line 22)
- `rcu_state_t` (line 28)

#### `redirect.c`
**Path:** `kernel/redirect.c`
**File Doc:** *================================================================*

**Functions:**
- `shell_report_exit` (line 11) `void shell_report_exit(int code)`
- `shell_report` (line 17) `void shell_report(const char *what, const char *detail)`
- `shell_take_redirect` (line 25) `int shell_take_redirect(int *argc, char **argv, char **path, int *append_mode)`

#### `sched.c`
**Path:** `kernel/sched.c`

**Functions:**
- `sched_tick_audio` (line 26) `static void sched_tick_audio(void *ctx)` - *#include "rcu.h" #include "proc_sec.h" #include "bootdefs.h" #include "vga_fb.h" #include "sb16.h" #include "pcm2.h" #include "tick.h" #include "arch/x86/hal_io.h" #include "arch/x86/msr.h" #include "drivers/mouse.h" #include "drivers/xhci.h" #include "tlb.h" /** Docstring: Audio tick adapter, forwards the bus dispatch to sb16_poll.*
- `sched_tick_desktop` (line 32) `static void sched_tick_desktop(void *ctx)` - *#include "tick.h" #include "arch/x86/hal_io.h" #include "arch/x86/msr.h" #include "drivers/mouse.h" #include "drivers/xhci.h" #include "tlb.h" /** Docstring: Audio tick adapter, forwards the bus dispatch to sb16_poll. static void sched_tick_audio(void *ctx) { (void)ctx; sb16_poll(); } /** Docstring: Desktop tick adapter, forwards the bus dispatch to the compositor tick.*
- `sched_tick_usb` (line 43) `static void sched_tick_usb(void *ctx)` - *Docstring: USB tick adapter. The xHCI event ring is polled by decision rather than interrupt-driven, so this is the polling trigger: it drains the ring and nothing else. Transfers are never issued here: an interrupt endpoint with nothing to say answers NAK instead of an event, and waiting for one with the tick held takes the machine with it. HID polling lives in * the console input spin, where a missing report is just silence.*
- `read_cr3` (line 74) `static inline unsigned long read_cr3(void)`
- `__attribute__` (line 109) `typedef struct __attribute__((packed))` - *--- TSS (one per CPU) ----  Every CPU that runs ring-3 code needs a private TSS: a timer tick that preempts ring 3 switches to TSS.rsp0, so two CPUs sharing one TSS would run their ISRs on the same stack.  The runtime GDT grows from 7 entries (5 from stage 2 + 1 TSS descriptor of 2 slots) to 5 + 2*MAX_CPUS entries; CPU 0 keeps selector 0x28 exactly as before.  The GDT lives at 0x8000 with 4 KB reserved up to stage 2 at 0x9000, so 21 entries * (168 bytes) fit with room to spare.*
- `__attribute__` (line 143) `typedef struct __attribute__((packed))` - *Per-CPU idle ticks at 100 Hz: isr_dispatch bumps the current CPU's slot whenever the tick arrives with current_pid == -1 (the per-CPU idle context). Sibling of smp_idle_polls, which counts idle-loop passes instead of time; the MINFO cpu selector reports the sum so ring 3 can compute busy percent between two reads. Increment-only, * read without a lock like the other ISR counters. volatile unsigned long cpu_idle_ticks[MAX_CPUS]; static volatile int ser_e_reported; /* ---- IDT ----*
- `kstack_paint` (line 171) `static void kstack_paint(uint64_t top, unsigned long size)`
- `kstack_usage` (line 180) `static int kstack_usage(uint64_t top, unsigned long size,
                        unsigned long *...` - *allocation rate only, never in the ISR path; the report is fail-closed * (a dead canary prints OVERFLOW, never a forged number). #define KSTACK_PAINT   0xA5A5A5A5A5A5A5A5ULL #define KSTACK_CANARY  0x4B535441434B3735ULL static void kstack_paint(uint64_t top, unsigned long size) { unsigned long long *p = (unsigned long long *)(top - size); unsigned long n = size / 8; unsigned long i; for (i = 1; i < n; i++) p[i] = (unsigned long long)KSTACK_PAINT; p[0] = (unsigned long long)KSTACK_CANARY; } /* 0 = intact (used_out = high-water bytes), -1 = canary dead.*
- `kstack_is_slot_end` (line 199) `static int kstack_is_slot_end(uint64_t v)` - *pid of a live process still standing on the stack slot ending at top (its kernel stack, or the stack its open syscall entered on), -1 when * none: a slot is free only when nobody can resume on it. /* 1 when v is the end of a kstack_pool slot (a kernel stack top).*
- `kstack_of` (line 209) `static uint64_t kstack_of(int j)` - *The stack slot process j stands on: PCB.kstack between syscalls, the entry's saved top while a syscall is open (the entry parked the user * rsp in PCB.kstack). 0 when j has no stack (a slot being created).*
- `kstack_owner` (line 216) `static int kstack_owner(uint64_t top)`
- `kstack_scan_serial` (line 231) `static void kstack_scan_serial(void)` - *Serial-only stack census for the exception dump: every pool slot in use, its owner and high-water mark, and "CANARY DEAD" when its bottom word was overwritten (an overflow into the slot below). A kernel stack overflow corrupts the neighbouring slot's saved frames, which surface later as another process returning to user space with garbage * registers; this names the overflowing slot at the moment it matters.*
- `alloc_kstack` (line 262) `static uint64_t alloc_kstack(void)`
- `live` (line 286) `* every reap leaked its own stack and released a neighbour that could
 * still be live (two procs...`
- `MXCSR` (line 306) `* A fresh image is explicit zeros plus the default MXCSR (0x1F80, all
 * exceptions masked): fxsa...`
- `fpu_restore_from` (line 314) `static inline void fpu_restore_from(void *area)`
- `fpu_alloc_clean` (line 318) `static void *fpu_alloc_clean(void)`
- `fpu_free_proc` (line 336) `static void fpu_free_proc(proc_t *p)`
- `vma_ctx_alloc` (line 342) `vma_ctx_t *vma_ctx_alloc(void)` - *Per-process VMA contexts (vma.h contract; defined here so vma.c stays * host-testable). A private pool is VMA_MAX nodes from the kernel heap.*
- `vma_ctx_free` (line 352) `void vma_ctx_free(vma_ctx_t *c)`
- `copy` (line 362) `* copy (fail closed, fork refuses) instead of forging pointers. */
/* Name the link a fork could ...`
- `vma_ctx_copy` (line 371) `static vma_ctx_t *vma_ctx_copy(vma_ctx_t *src)`
- `vma_owned` (line 446) `static int vma_owned(proc_t *p)`
- `vma_save_proc` (line 454) `static void vma_save_proc(proc_t *p)` - *Rebind the global VMA view alongside the brk/mmap view. Callers already hold sched_lock (+mm_lock at the swap sites); the bind itself is a few * stores. Shared (VM/legacy) contexts make this a semantic no-op.*
- `vma_load_proc` (line 458) `static void vma_load_proc(proc_t *p)`
- `mm_owner` (line 472) `static proc_t *mm_owner(proc_t *p)` - *The process whose brk/mmap/VMA view an address space lives in: p itself unless p is a CLONE_VM thread, then the non-CLONE_VM process sharing its VMA context (the context is the address space's identity; a pid-0 run's page tables are not recorded in procs[0], so CR3 cannot tell). Threads of the legacy window belong to pid 0. A thread whose owner is gone * shares the held view when it is its own, else keeps its copies.*
- `mm_view_enter` (line 494) `static void mm_view_enter(proc_t *nxt)` - *Make the globals describe nxt's address space before nxt runs, from any entry path (a switch, the timer, or the idle loop claiming after the running process died, where there is no outgoing process to name). A task of the address space already held keeps the view; any other saves it into its holder and loads the new owner's, so a thread scheduled after an unrelated process, or a parent resumed from idle after its child died, never allocates from someone else's view. Callers hold * sched_lock and mm_lock.*
- `mm_view_claim_current` (line 513) `void mm_view_claim_current(void)` - *The running process installed a fresh view itself (execve, spawn * restore): it is the holder from now on.*
- `kstack_report` (line 520) `void kstack_report(void)` - *Serial-observable stack health: per-proc high-water marks plus the legacy 32 KB syscall stack, ending in `kstack: ok` or * `kstack: OVERFLOW`. The shell `kstack` builtin calls this.*
- `schedtop_report` (line 563) `void schedtop_report(void)` - *`schedtop` -- one screenful of scheduler state: uptime from the 100 Hz tick, per-CPU current pid, then one row per live proc (thread group, thread/process flag, state, nice, virtual runtime, consumed ticks). Threads are CLONE_VM procs sharing an address space: the T/P column names them, and tgid is the lowest pid sharing the same VMA view (the group leader), so `thdemo`'s ten threads read as one group with ten per-thread tick counters. Snapshot under sched_lock, print * after release so console I/O never runs with the scheduler held.*
- `irqstat_report` (line 631) `void irqstat_report(void)` - *`irqstat` -- interrupt arrivals per source. Timer ticks come from sys_ticks (PIT 100 Hz on the BSP, broadcast as IPIs to APs); kbd/mouse/ sb16 are counted at the top of their isr_dispatch arms. NIC and audio queue health ride along from rtl/sb16 counters so one screen answers * "is the hardware talking and is the guest keeping up".*
- `stub` (line 650) `* gdb stub (`make gdb`, then `target remote :1234` from the host). These
 * helpers are the seria...`
- `gdb_dump_report` (line 697) `void gdb_dump_report(unsigned long addr, unsigned long len)`
- `sched_idle_on_kernel_cr3` (line 723) `int sched_idle_on_kernel_cr3(int cpu)` - *1 when cpu's idle context runs on the kernel tables (the `smp` builtin * reports it as idle_cr3=kernel|stale).*
- `idt_set` (line 745) `static void idt_set(int vec, void (*h)(void))` - *Parked trap frames for preempted ring-3 contexts, one slot per pid. The ISR copies the preempted frame here (never onto a live stack: the TSS stack is reused by the next tick and a thread's own kstack may be mid-syscall), points ctx at the copy and resumes it later through resume_iretq + iretq.  Dedicated slots mean parking can never clobber * live kernel state. static trap_frame_t isr_park[MAX_PROCS]; /* ---- IDT init ----*
- `idt_init` (line 756) `static void idt_init(void)`
- `pic_init` (line 772) `static void pic_init(void)` - *NMI is the TLB shootdown (kernel/mm/tlb.c): its own gate, its own * IST stack, never the trap-frame path. idt_set(NMI_VECTOR, tlb_nmi_entry); idt[NMI_VECTOR].ist = NMI_IST_SLOT; bsp_idtr.limit = sizeof(idt) - 1; bsp_idtr.base = (uint64_t)&idt; __asm__ volatile("lidt %0" :: "m"(bsp_idtr)); } /* ---- PIC ----*
- `pit_init` (line 807) `static void pit_init(void)` - *Master: unmask IRQ0 (timer) + IRQ1 (keyboard) + IRQ2 (cascade) + IRQ4 (COM1, UART IER stays 0 so it never fires) + IRQ5 (Sound Blaster 16 DMA done).  In the mask register a bit set means masked, so 0xC8 masks only IRQ3, IRQ6 and IRQ7.  Masking IRQ5 here starves the SB16 completion interrupt and leaves audio on the * timer watchdog alone (audible as jitter); keep it unmasked. hal_outb(HAL_PIC1_DATA, 0xC8); /* Slave: unmask IRQ12 (mouse) only. 0xEF = ~bit4. hal_outb(HAL_PIC2_DATA, 0xEF); } /* ---- PIT channel 0: 100 Hz ----*
- `pic_eoi` (line 814) `static void pic_eoi(int irq)`
- `tss_write_desc` (line 821) `static void tss_write_desc(int cpu)`
- `tss_init` (line 838) `static void tss_init(void)`
- `tss_init_ap` (line 870) `void tss_init_ap(int cpu)` - *Load this AP's task register.  The BSP wrote every descriptor in tss_init before the APs were woken, so the AP only points its TR at its own slot; its ring-3 preempts then land on its private rsp0 * stack instead of the BSP's.*
- `context` (line 888) `* context (anything entered via k_exec_user) is inside a syscall
 * (entry swapped 0 in), and a c...`
- `point` (line 901) `* return address as the resume point ("continue the ISR"), which
 * required the stranded ISR fra...`
- `sched_next_locked` (line 930) `static int sched_next_locked(int start, int vm_only)` - *Fair-share scan with sched_lock HELD.  Returns a claimed (PROC_RUNNING) pid or -1.  vm_only restricts the pick to CLONE_VM threads, which is what APs run: same CR3, no brk/mmap view switch, no TLB work. Boyscout fix for static round-robin starvation: every READY candidate is compared by vruntime (plus nice bias), the minimum wins, and the winner is charged one quantum weighted by its nice. A CPU-bound nice-0 task can no longer starve an interactive nice--10 task; equal nice degrades to * round-robin order via the rotating start.*
- `sched_set_nice` (line 948) `int sched_set_nice(int pid, int nice)` - *for (t = 0; t < MAX_PROCS; t++) { int cand = (start + 1 + t) % MAX_PROCS; unsigned long key; if (procs[cand].state != PROC_READY) continue; if (vm_only && !(procs[cand].clone_flags & CLONE_VM)) continue; key = procs[cand].vruntime + (unsigned long)(procs[cand].nice + SCHED_NICE_OFFSET) * SCHED_NICE_MULT_KEY; if (best < 0 || key < best_key) { best = cand; best_key = key; } } if (best < 0) return -1; procs[best].state = PROC_RUNNING; procs[best].vruntime += SCHED_BASE_QUANTUM + (unsigned long)(procs[best].nice + SCHED_NICE_OFFSET) * SCHED_NICE_MULT_CHARGE; return best; } /* Set scheduling niceness for pid (-20..19, clamped). Returns 0 or -1.*
- `seccomp_deny_one` (line 957) `int seccomp_deny_one(int pid, int n)` - *procs[best].state = PROC_RUNNING; procs[best].vruntime += SCHED_BASE_QUANTUM + (unsigned long)(procs[best].nice + SCHED_NICE_OFFSET) * SCHED_NICE_MULT_CHARGE; return best; } /* Set scheduling niceness for pid (-20..19, clamped). Returns 0 or -1. int sched_set_nice(int pid, int nice) { if (pid < 0 || pid >= MAX_PROCS) return -1; if (procs[pid].state == PROC_FREE) return -1; if (nice < NICE_MIN) nice = NICE_MIN; if (nice > NICE_MAX) nice = NICE_MAX; procs[pid].nice = nice; return 0; } /* Seccomp-basic helpers: deny/allow one MiniOS syscall for pid.*
- `seccomp_allow_one` (line 964) `int seccomp_allow_one(int pid, int n)`
- `seccomp_denied` (line 971) `int seccomp_denied(int pid, int n)`
- `smp_try_claim_hint` (line 980) `static int smp_try_claim_hint(int pid, int vm_only)` - *Claim one READY thread for this CPU's idle loop (the AP only claims CLONE_VM threads): marks it RUNNING under lock and installs it as the * CPU's current pid.  Returns the pid, or -1 when nothing is ready.*
- `smp_claim_thread_v` (line 996) `static int smp_claim_thread_v(int vm_only)`
- `smp_ap_idle_loop` (line 1042) `void smp_ap_idle_loop(void)` - *AP idle loop: hlt until a CLONE_VM thread is ready, run it, repeat. Entered once from smp_ap_entry on the AP stub stack; the first switch_to out of here saves these registers into ap_idle_proc[cpu], so every return to idle resumes this loop.  Interrupts stay OFF from the claim through the switch: a LAPIC tick landing in between would park this half-switched state over the incoming thread's ctx.  Threads enter with their own rflags (IF=1); a resume back to idle restores IF=0, so sti runs after every * switch_to return.  The hlt itself needs IF=1 to wake.*
- `sched_ap_preempt` (line 1076) `static void sched_ap_preempt(trap_frame_t *frame)` - *AP timer preemption: time-slice the AP's current CLONE_VM thread with the next READY one.  An idle AP (cur_pid -1) needs nothing: its idle loop polls.  The park/unclaim discipline is the same as the BSP tick: park the trap frame (complete ctx), publish READY, claim the next, switch NOTRAP (load-only) so a stealing CPU always resumes a valid context.  A non-VM proc can never run here by construction; if one is * ever observed, leave it alone (fail safe, never migrate it).*
- `smp_any_ap_idle` (line 1146) `static int smp_any_ap_idle(void)` - *True when some AP is idle.  The BSP tick uses this to leave freshly parked CLONE_VM threads unclaimed: the idle AP's next poll (IPI wake) picks them up, which keeps thread execution biased to the APs * instead of the BSP winning every claim race.*
- `rlimit_cpu_exceeded` (line 1182) `int rlimit_cpu_exceeded(int pid)`
- `isr_dispatch` (line 1203) `void isr_dispatch(int vector, trap_frame_t *frame)`
- `BSP` (line 1780) `* CPU believe it is the BSP (wrong per-CPU identity, two CPUs
         * running the shell contex...`
- `proc_get` (line 1821) `proc_t *proc_get(int pid)`
- `proc_create` (line 1827) `int proc_create(const char *name, int parent_pid)`
- `proc_spawn_elf_inner` (line 1945) `static int proc_spawn_elf_inner(const char *name, void *data, unsigned size,
                   i...` - *Spawn body: runs with the timer held off by the wrapper below, so page-table construction, heap allocation and the READY publish are one atomic section against the 100 Hz preempt. A spawn that interleaves with a running process's brk/mmap/page-table syscalls otherwise shares every allocator and table writer with no fencing except per-call locks, and the newcomer is the one that pays (wild #UD/#PF in early init, a different page each boot). The window is RAM-speed only (file PIO stays outside in the caller); ticks coalesce across it, which is the documented cost of correctness, same trade as the fs_lock leaf. Never blocks: no schedule, yield, * wait or sleep on any path below.*
- `proc_spawn_elf` (line 2105) `int proc_spawn_elf(const char *name, void *data, unsigned size,
                   int argc, char...` - *Atomic spawn wrapper: the whole construction (page tables, image copy, stack, publish) runs with the timer held off, so a running process's syscalls can never interleave the newcomer's heap and table writes. See the inner note for why the newcomer paid. Flags saved/restored (not bare cli/sti) so a caller that entered with IF=0 keeps it; scheduler-structure protection inside is spin_lock_irqsave on sched_lock/mm_lock, the CR3 windows save * theirs locally.*
- `schedule` (line 2147) `* that keeps schedule()'s own rbp runs the caller's frame accesses
 * (locals, leave/ret) on the ...`
- `schedule` (line 2154) `void schedule(void)`
- `yield` (line 2235) `void yield(void)`
- `do_exit` (line 2250) `void do_exit(int code)`
- `do_thread_spawn` (line 2314) `long do_thread_spawn(unsigned long fn, unsigned long stack,
                     unsigned long arg)` - *frame is ambiguous, this one starts cleanly at fn(arg) on the given stack:  child RIP = fn, child RSP = stack, child RDI = arg (SysV first arg), entered through the same user_trampoline + iretq path as proc_create.  The caller (pthread-like user code) owns the stack: it must be allocated before the call (8 KB each per the roadmap) with its TOP passed here, and must stay alive until the thread is joined.  fn and stack must lie in the user window (checked by the syscall wrapper).  The thread shares CR3, the fd view and (by the schedule() CLONE_VM rule) the live brk/mmap view with its parent; the parent joins it with do_waitpid, which reaps the exit code without freeing the shared page tables. * Returns the child PID, or -1 when no slot or stack is usable.*
- `itself` (line 2514) `* the shell itself (use mrun first), and a CLONE_VM thread forking
 * would duplicate shared stat...`
- `ctx_from_frame` (line 2537) `static void ctx_from_frame(ctx_regs_t *c, const syscall_frame_t *f)` - *Every register Linux preserves across a syscall, copied into a child's * PCB so it resumes after the syscall exactly like the caller.*
- `fork_child_settid` (line 2555) `void fork_child_settid(void)` - *First code a fork or clone child runs (fork_trampoline, its own window live): store its tid at the CLONE_CHILD_SETTID address. A copy-on-write * page privatizes through the #PF path, never touching the parent's.*
- `do_fork` (line 2564) `long do_fork(void)`
- `fork_report` (line 2570) `static void fork_report(const char *what)` - *A fork that fails names the resource that ran out (failure paths * report): -ENOMEM alone cannot tell a heap leak from a full stack pool.*
- `do_fork_ex` (line 2577) `long do_fork_ex(uint64_t set_tid, uint64_t clear_tid)`
- `do_clone_thread` (line 2724) `static long do_clone_thread(unsigned long flags, unsigned long newsp,
                           ...` - *NPTL thread (clone with CLONE_VM|CLONE_SIGHAND|CLONE_THREAD): same window and fd view, resumes after the syscall on newsp with the caller's registers, FSBASE = tls, joins the caller's thread group and is reaped * automatically. *parent_tid is written before the child is published.*
- `kill_group_threads_locked` (line 2838) `static void kill_group_threads_locked(int tgid, int except)` - *Zombify every live CLONE_THREAD member of a group except one pid. Caller * holds sched_lock; the slots are reclaimed by the auto-reap sweep.*
- `do_group_exit` (line 2859) `void do_group_exit(int code)` - *Linux exit_group(2) and fatal-signal semantics, minus the caller's own exit (the caller follows with do_exit or do_proc_exit): every other thread of the group dies, and when the caller is a worker thread the leader dies too with code, so its parent's wait reports the group's fate instead of waiting on a leader that would never end. A foreground leader (pid 0) is the shell context and cannot be zombified; its * workers die and the leader keeps running, as before.*
- `aslr_mix` (line 2887) `static unsigned long aslr_mix(unsigned long salt)`
- `aslr_stack_bytes` (line 2896) `unsigned long aslr_stack_bytes(void)`
- `aslr_brk_pages` (line 2897) `unsigned long aslr_brk_pages(void)`
- `aslr_mmap_pages` (line 2898) `unsigned long aslr_mmap_pages(void)`
- `aslr_dyn_base` (line 2899) `unsigned long aslr_dyn_base(void)`
- `do_execve` (line 2926) `long do_execve(char *kpath, int kargc, char **kargv)` - *Scope, fail-closed: the caller must be an isolated non-CLONE_VM ring-3 proc (pid 0 has no own window; a thread calling execve would keep CLONE_VM on a private window, which the view switch does not serve, so it refuses with -ENOSYS). Sibling threads die with the old image like Linux: at adopt, every CLONE_VM sharer of the old window becomes a zombie for its parent. ET_REL refuses with -ENOEXEC (ring-0 extensions load only through SPAWN's trust gate). OOM at any pre-adopt step releases what was claimed and returns -12 with the caller byte-identical. CLOEXEC fds close at adopt (armed by Linux O_CLOEXEC on open); the rest survive like fork. envp is not carried: setup_user_stack builds argc/argv only, so every execve starts with an empty * environment.*
- `proc_running_anywhere` (line 3159) `static int proc_running_anywhere(int pid)` - *A zombie may still be finishing its exit tail (schedule()'s save and switch) on its own kernel stack on some CPU; its slot is reclaimable * only once no CPU runs it any more.*
- `reap_autoreap_locked` (line 3168) `static void reap_autoreap_locked(int tgid)` - *Reclaim every auto-reaped (CLONE_THREAD) zombie, or only those of one * thread group when tgid >= 0. Caller holds sched_lock.*
- `alloc_pid_locked` (line 3180) `static int alloc_pid_locked(void)` - *First free pid slot after reclaiming finished threads, or -1. Caller * holds sched_lock.*
- `group_threads_live_locked` (line 3192) `static int group_threads_live_locked(int tgid)` - *1 while a thread of group tgid has not finished exiting: still alive, or a zombie some CPU is still running on. Its leader's page tables and VMA context are the thread's too, so the leader is not reapable yet * (Linux likewise reports a group only once every thread is gone).*
- `waitpid_scan` (line 3203) `static int waitpid_scan(int pid, int *found)`
- `do_waitpid` (line 3224) `int do_waitpid(int pid)`
- `waitpid_has_child` (line 3241) `static int waitpid_has_child(int pid)` - *1 when the caller has a waitable child matching pid (-1 = any): one that is not an auto-reaped thread, in any state but free. Caller holds * sched_lock.*
- `do_waitpid_linux` (line 3255) `int do_waitpid_linux(int pid, int nohang, int *found)` - *Linux wait4 core (docs/spec/smp-sched.md): reap one matching child and report its pid through *found and its raw exit code as the result; WAITPID_NOCHILD when there is nothing to wait for, WAITPID_NONE when * nohang and nothing has exited yet.*
- `shell_reap_nb` (line 3272) `int shell_reap_nb(int *pid_out, int *code_out)` - *Reap one zombie child for `jobs`/auto-reap messages: returns 1 with * pid+code, or 0 when none is ready. Never blocks.*
- `shell_reap_one` (line 3286) `int shell_reap_one(int pid, int *code_out)` - *Reap one specific zombie child (foreground wait). Returns 1 with the * code, or 0 when that pid is not a reaped zombie right now.*
- `shell_nchildren` (line 3298) `int shell_nchildren(void)` - *Reap one specific zombie child (foreground wait). Returns 1 with the * code, or 0 when that pid is not a reaped zombie right now. int shell_reap_one(int pid, int *code_out) { int code, found = -1; if (!proc_get(current_pid)) return 0; spin_lock(&sched_lock); code = waitpid_scan(pid, &found); spin_unlock(&sched_lock); if (code == WAITPID_NONE) return 0; if (code_out) *code_out = code; return 1; } /* Live non-free children of the caller (shell job table size).*
- `do_kill` (line 3324) `int do_kill(int pid)` - *True kill: the TARGET becomes a zombie for its parent to reap (its stack/tables free in do_waitpid, never here). Killing self keeps the old do_exit path. A zombie on an AP is abandoned by the AP preempt * path, so a kill never leaves a corpse running.*
- `do_kill_code` (line 3330) `int do_kill_code(int pid, int code)` - *End pid with exit code (negative: killed by signal -code, as wait4 * reports it). Killing the caller is a group exit.*
- `timer_tick` (line 3357) `void timer_tick(void)`
- `sched_init` (line 3362) `void sched_init(void)`
- `user_trampoline` (line 66) `extern void user_trampoline(void);`
- `fork_trampoline` (line 67) `extern void fork_trampoline(void);`
- `exec_enter` (line 72) `extern void exec_enter(unsigned long frame);`
- `PROC_KSTACK_OFF` (line 82) `* PROC_KSTACK_OFF (it cannot use C here). The asm derives both * immediates from headers/syscall_asm.h, so this assert is the single * check: if it fires, the struct changed and the macros in sched.h `
- `descriptor` (line 97) `* descriptor (two slots) per CPU past the 5 stage-2 entries. */ _Static_assert((5 + 2 * MAX_CPUS) * 8 == GDT64_SMP_BYTES, "GDT SMP size");`
- `here` (line 128) `* smp_ap_idle_loop here (idle_proc ctx.rsp points at the top). */ static char ap_idle_stack[MAX_CPUS][4096] __attribute__((aligned(16)));`
- `sched_lock` (line 452) `* hold sched_lock (+mm_lock at the swap sites);`
- `slot` (line 567) `* must not eat a quarter of a 16 KB slot (see the stack discipline * contract in CLAUDE.md). Fail-closed on OOM. */ struct stop_row *snap = (struct stop_row *)kmalloc(sizeof(struct stop_row) * MAX_PRO`
- `sys_ticks` (line 627) `* sys_ticks (PIT 100 Hz on the BSP, broadcast as IPIs to APs);`
- `rtl_counters` (line 634) `extern void rtl_counters(unsigned int *tx_frames, unsigned int *rx_frames);`
- `rtl_present` (line 636) `extern int rtl_present(void);`
- `IRQ4` (line 796) `* IRQ4 (COM1, UART IER stays 0 so it never fires) + * IRQ5 (Sound Blaster 16 DMA done). In the mask register a bit set * means masked, so 0xC8 masks only IRQ3, IRQ6 and IRQ7. Masking IRQ5 * here starv`
- `FSBASE` (line 913) `* for FSBASE (per-proc TLS): a thread preempted after arch_prctl * would otherwise resume with whatever base the next thread left * behind. GSBASE is deliberately untouched (live kernel per-CPU). */ i`
- `syscall` (line 1320) `* outgoing syscall (see sched_rearm_kgs). Without * this the next entry swapgs puts garbage under GS * and the pid math faults. */ sched_rearm_kgs();`
- `PROC_SWITCHING` (line 2180) `* while the thread is still PROC_SWITCHING (never claimable), * then set the resume point and publish. A BLOCKED/ZOMBIE * thread keeps its state (no one claims it until a wake). */ switch_save_only(cu`
- `returns` (line 2243) `* that returns (and the resumed thread returns with IF=1). */ __asm__ volatile("cli");`
- `registers` (line 2345) `* registers (float args would need XMM inheritance, which the * arg-passing contract does not carry: fn takes one integer arg). */ child->fpu_save = fpu_alloc_clean();`
- `shares` (line 2595) `* thread on another CPU kept its writable translation and wrote straight * into frames the child now shares (the forked FreeDom renderer read the * parent's later pointers as garbage), so its TLB is s`
- `MSR` (line 2633) `* in the MSR (the PCB field refreshes on switch-out) and its FPU * regs live in the CPU (the PCB image refreshes on switch-out). * The child resumes user code directly, never through glibc init, * so `
- `cli` (line 2908) `* cli (disk PIO must never run with the timer held off);`
- `adopt` (line 2922) `* adopt (armed by Linux O_CLOEXEC on open);`
- `it` (line 3370) `* it (SPAWN/exec point proc 0 here transiently);`
- `park` (line 3422) `* an image its live FPU registers would be dropped by the preempt * park (the save path skips a null area). */ procs[0].fpu_save = fpu_alloc_clean();`
- `zeroed` (line 3433) `* still zeroed (kmemset happens inside idt_init) faults through a * null gate. Handlers for 32/33/44 are safe pre-mouse-init. */ idt_init();`

**Macros:**
- `MY_SYS_KSTK_TOP` (line 53) `#define MY_SYS_KSTK_TOP`
- `MY_USER_STACK_TOP` (line 54) `#define MY_USER_STACK_TOP`
- `MY_USER_LOAD_BASE` (line 55) `#define MY_USER_LOAD_BASE`
- `NMI_IST_STACK_SZ` (line 123) `#define NMI_IST_STACK_SZ`
- `NMI_VECTOR` (line 124) `#define NMI_VECTOR`
- `NMI_IST_SLOT` (line 125) `#define NMI_IST_SLOT`
- `KSTACK_SZ` (line 155) `#define KSTACK_SZ`
- `KSTACK_PAINT` (line 168) `#define KSTACK_PAINT`
- `KSTACK_CANARY` (line 169) `#define KSTACK_CANARY`

**Structs:**
- `stop_row` (line 564)
- `trap_frame_t` (line 729) - *1 when cpu's idle context runs on the kernel tables (the `smp` builtin * reports it as idle_cr3=kernel|stale). int sched_idle_on_kernel_cr3(int cpu) { if (cpu < 0 || cpu >= MAX_CPUS) return 0; return ap_idle_proc[cpu].ctx.cr3 == sched_idle_cr3; } /* ---- Trap frame (must match isr_stubs.S) ----*

**Type_Aliases:**
- `res0` (line 109) `typedef struct __attribute__((packed)) { uint32_t res0;` - *--- TSS (one per CPU) ----  Every CPU that runs ring-3 code needs a private TSS: a timer tick that preempts ring 3 switches to TSS.rsp0, so two CPUs sharing one TSS would run their ISRs on the same stack.  The runtime GDT grows from 7 entries (5 from stage 2 + 1 TSS descriptor of 2 slots) to 5 + 2*MAX_CPUS entries; CPU 0 keeps selector 0x28 exactly as before.  The GDT lives at 0x8000 with 4 KB reserved up to stage 2 at 0x9000, so 21 entries * (168 bytes) fit with room to spare.*
- `off_lo` (line 143) `typedef struct __attribute__((packed)) { uint16_t off_lo;` - *Per-CPU idle ticks at 100 Hz: isr_dispatch bumps the current CPU's slot whenever the tick arrives with current_pid == -1 (the per-CPU idle context). Sibling of smp_idle_polls, which counts idle-loop passes instead of time; the MINFO cpu selector reports the sum so ring 3 can compute busy percent between two reads. Increment-only, * read without a lock like the other ISR counters. volatile unsigned long cpu_idle_ticks[MAX_CPUS]; static volatile int ser_e_reported; /* ---- IDT ----*

**Variables:**
- `sc_top_save` (line 69) `extern unsigned long sc_top_save[];` - *#define MY_USER_LOAD_BASE USER_LOAD_BASE proc_t procs[MAX_PROCS]; int    proc_count; cpu_t  cpus[MAX_CPUS]; int    cpu_count = 1; volatile uint64_t sys_ticks; volatile int user_program_active; volatile int sched_ready; spinlock_t sched_lock = SPINLOCK_INIT; extern void user_trampoline(void); extern void fork_trampoline(void); /* Per-pid kernel-stack tops the syscall entry saves (syscall_entry.S).*
- `isr_stub_table` (line 152) `extern void *isr_stub_table[];`
- `net_rx_dropped` (line 635) `extern unsigned int net_rx_dropped;`
- `mm_lock` (line 882) `extern spinlock_t mm_lock;` - *Guards the shared g_brk/g_brk_limit/user_mmap_cur view and the VMA trees against concurrent brk/mmap/munmap syscalls from threads on different CPUs.  Defined in kernel/syscalls.c; always taken INSIDE sched_lock (lock order: sched_lock -> mm_lock), never alone in the * scheduler paths.*

#### `scrollback.c`
**Path:** `kernel/scrollback.c`
**File Doc:** *scrollback.c - Console scrollback ring buffer.*

**Functions:**
- `sb_init` (line 17) `void sb_init(void)`
- `sb_capture_row0` (line 23) `void sb_capture_row0(void)`
- `sb_reset` (line 34) `void sb_reset(void)`
- `sb_get_count` (line 38) `int sb_get_count(void)`
- `sb_get_head` (line 39) `int sb_get_head(void)`
- `sb_get_char` (line 41) `char sb_get_char(int row, int col)`
- `vga_scroll` (line 4) `* Captured lazily from vga_scroll();`

**Macros:**
- `SCROLLBACK_ROWS` (line 12) `#define SCROLLBACK_ROWS`

#### `seccomp_bpf.c`
**Path:** `kernel/seccomp_bpf.c`
**File Doc:** *Docstring: seccomp_bpf.c -- classic BPF checker and interpreter for Linux*

**Functions:**
- `sbpf_opcode_ok` (line 17) `static int sbpf_opcode_ok(const sbpf_insn *in)` - *Freestanding: no libc, no kernel state; the same object links into the kernel and into the host test.  #include "seccomp_bpf.h" #define SBPF_OP_MASK   0xf0u #define SBPF_SRC_MASK  0x08u #define SBPF_SIZE_MASK 0x18u #define SBPF_MODE_MASK 0xe0u #define SBPF_RVAL_MASK 0x18u #define SBPF_MISC_MASK 0xf8u #define SBPF_MEM_ALL   0xffffu /* Is code one of the classic opcodes Linux accepts in a seccomp filter?*
- `sbpf_check` (line 69) `int sbpf_check(const sbpf_insn *prog, unsigned len, unsigned short *scratch)`
- `sbpf_load_word` (line 114) `static unsigned int sbpf_load_word(const sbpf_data *d, unsigned off)` - *scratch[pc + 1u + in->k] &= (unsigned short)memvalid; } else { scratch[pc + 1u + in->jt] &= (unsigned short)memvalid; scratch[pc + 1u + in->jf] &= (unsigned short)memvalid; } memvalid = SBPF_MEM_ALL; } else if (cls == SBPF_RET) { memvalid = SBPF_MEM_ALL; } } return 0; } /* 32-bit word of seccomp_data at a checked, aligned offset.*
- `sbpf_run` (line 120) `unsigned int sbpf_run(const sbpf_insn *prog, unsigned len, const sbpf_data *d)`
- `sbpf_action_rank` (line 194) `int sbpf_action_rank(unsigned int action)`

**Macros:**
- `SBPF_OP_MASK` (line 8) `#define SBPF_OP_MASK`
- `SBPF_SRC_MASK` (line 9) `#define SBPF_SRC_MASK`
- `SBPF_SIZE_MASK` (line 10) `#define SBPF_SIZE_MASK`
- `SBPF_MODE_MASK` (line 11) `#define SBPF_MODE_MASK`
- `SBPF_RVAL_MASK` (line 12) `#define SBPF_RVAL_MASK`
- `SBPF_MISC_MASK` (line 13) `#define SBPF_MISC_MASK`
- `SBPF_MEM_ALL` (line 14) `#define SBPF_MEM_ALL`

#### `serial.c`
**Path:** `kernel/serial.c`
**File Doc:** *serial.c -- COM1 16550 UART driver.*

**Functions:**
- `serial_init` (line 20) `void serial_init(void)`
- `serial_tx_ready` (line 30) `static int serial_tx_ready(void)`
- `serial_rx_ready` (line 31) `static int serial_rx_ready(void)`
- `serial_putc` (line 33) `void serial_putc(char c)`
- `serial_e_count` (line 38) `unsigned long serial_e_count(void)`
- `serial_puts` (line 40) `void serial_puts(const char *s)`
- `serial_available` (line 42) `int serial_available(void)`
- `serial_getc` (line 44) `int serial_getc(void)`

**Macros:**
- `COM1` (line 18) `#define COM1`

#### `shell.c`
**Path:** `kernel/shell.c`

**Functions:**
- `shell_queue_launch` (line 87) `void shell_queue_launch(const char *cmd)` - *Queue a desktop-icon command to run after the current user program exits. Overwrites any earlier pending launch; safe to call from the ISR (it only * copies into a kernel buffer).*
- `shell_readline_active` (line 115) `int shell_readline_active(void)`
- `shell_focus_park` (line 116) `void shell_focus_park(void)`
- `shell_focus_restore` (line 121) `void shell_focus_restore(void)`
- `shell_prompt` (line 148) `static void shell_prompt(void)`
- `shell_parse_vol` (line 158) `static int shell_parse_vol(const char *s, unsigned *out)` - *Strict decimal parse for the `vol` builtin: delegates the digit and overflow work to shell_parse_long and clamps the result to the * speaker's valid range. Garbage is rejected, never silently zero.*
- `shell_readline_buf` (line 184) `void shell_readline_buf(char *buf, int size)` - *Read one line into buf (at most size-1 chars). Echoes input and * honours backspace. Shared by the shell prompt and the editor.*
- `shell_name_base` (line 213) `static const char *shell_name_base(const char *path)` - *The component of a ramdisk path after the last '/', or the whole path when * there is no '/'. Used to match a bare command word against a file's name.*
- `shell_complete_tier` (line 238) `static int shell_complete_tier(const char *nm)` - *Runnable tier of a file name for first-word TAB completion: 0=.elf, 1=.cvm, 2=.o, 3=anything else. A bare command word completes toward the highest-priority non-empty tier, so `poke` offers the game binary instead * of its icon PNG.*
- `shell_complete_replace` (line 250) `static void shell_complete_replace(char *buf, int size, int *pos,
                               ...`
- `shell_complete_minifs_arg` (line 271) `static void shell_complete_minifs_arg(const char *word, unsigned long wlen,
                     ...` - *Complete an argument word from MiniFS (the ramdisk loop at the call site covers the ramdisk half). The word's directory part resolves against the cwd; entries of that MiniFS directory matching the leaf prefix are offered as full word-relative paths, directories with a trailing '/'. At most 8 entries in static storage, never truncated, * duplicates of ramdisk offers skipped.*
- `shell_readline` (line 338) `static void shell_readline(void)`
- `shell_hist_show` (line 346) `static void shell_hist_show(char *buf, int size, int *pos, const char *text)` - *Redraw the edit line: erase what is shown, then write `text` into buf and onto the console, leaving the text cursor at `*pos`. The cursor is drawn on the framebuffer terminal; on the serial console the text is rewritten * and the reader's position is implied by the console cursor.*
- `shell_line_repaint` (line 368) `static void shell_line_repaint(char *buf, int size, int pos)` - *Repaint the edit line after a cursor move or mid-line edit: erase the whole visible line, rewrite buf, then back the console cursor up to `pos` and redraw the framebuffer text cursor there. `shell_cur` holds the on-screen cursor column, so the erase backs up to the line start before blanking it * (a serial backspace alone does not clear a character).*
- `shell_line_insert` (line 381) `static void shell_line_insert(char *buf, int size, int *pos, char c)` - *Insert character c into buf at `pos`, shifting the tail right. Bounds * checked; the caller repaints afterwards.*
- `shell_line_backspace` (line 390) `static void shell_line_backspace(char *buf, int size, int *pos)` - *Insert character c into buf at `pos`, shifting the tail right. Bounds * checked; the caller repaints afterwards. static void shell_line_insert(char *buf, int size, int *pos, char c) { int len = (int)kstrlen(buf); if (len >= size - 1) return; kmemmove(buf + *pos + 1, buf + *pos, (unsigned long)(len - *pos + 1)); buf[*pos] = c; (*pos)++; } /* Delete the character before the cursor (backspace).*
- `shell_line_delete` (line 398) `static void shell_line_delete(char *buf, int size, int *pos)` - *kmemmove(buf + *pos + 1, buf + *pos, (unsigned long)(len - *pos + 1)); buf[*pos] = c; (*pos)++; } /* Delete the character before the cursor (backspace). static void shell_line_backspace(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); if (*pos <= 0) return; kmemmove(buf + *pos - 1, buf + *pos, (unsigned long)(len - *pos + 1)); (*pos)--; } /* Delete the character at the cursor (Delete key).*
- `shell_line_kill_front` (line 405) `static void shell_line_kill_front(char *buf, int size, int *pos)` - *int len = (int)kstrlen(buf); if (*pos <= 0) return; kmemmove(buf + *pos - 1, buf + *pos, (unsigned long)(len - *pos + 1)); (*pos)--; } /* Delete the character at the cursor (Delete key). static void shell_line_delete(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); if (*pos >= len) return; kmemmove(buf + *pos, buf + *pos + 1, (unsigned long)(len - *pos)); } /* Delete from the cursor to the start of the line (Ctrl+U).*
- `shell_line_kill_tail` (line 412) `static void shell_line_kill_tail(char *buf, int size, int *pos)` - *static void shell_line_delete(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); if (*pos >= len) return; kmemmove(buf + *pos, buf + *pos + 1, (unsigned long)(len - *pos)); } /* Delete from the cursor to the start of the line (Ctrl+U). static void shell_line_kill_front(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); kmemmove(buf, buf + *pos, (unsigned long)(len - *pos + 1)); pos = 0; } /* Delete from the cursor to the end of the line (Ctrl+K).*
- `shell_line_kill_word` (line 417) `static void shell_line_kill_word(char *buf, int size, int *pos)` - */* Delete from the cursor to the start of the line (Ctrl+U). static void shell_line_kill_front(char *buf, int size, int *pos) { int len = (int)kstrlen(buf); kmemmove(buf, buf + *pos, (unsigned long)(len - *pos + 1)); pos = 0; } /* Delete from the cursor to the end of the line (Ctrl+K). static void shell_line_kill_tail(char *buf, int size, int *pos) { buf[*pos] = '\0'; } /* Delete the word before the cursor (Ctrl+W): skip spaces, then non-spaces.*
- `shell_hist_newest_match` (line 429) `static int shell_hist_newest_match(const char *prefix, unsigned long plen)` - *Most recent history entry starting with `prefix` (of length plen) that is strictly longer than the prefix, or -1 when there is none. The suggestion * for a typed prefix is always the newest match, zsh-style.*
- `line` (line 446) `* to the live line (handled by the caller resetting shell_hist_idx). */
static void shell_hist_na...`
- `shell_readline_hist` (line 491) `static void shell_readline_hist(char *buf, int size)` - *Shell prompt readline: like shell_readline_buf plus command history. Up arrow (ESC [ A) recalls the previous command starting with the typed prefix (empty prefix recalls everything), down arrow moves forward. Right arrow at end of line accepts the newest history match for the prefix; TAB completes programs, files and recent history words. Any * editing key while scrolling returns to the live line.*
- `shell_parse` (line 826) `int shell_parse(char *line, char **argv, int max_args)`
- `shell_run_init` (line 855) `static void shell_run_init(void)` - *Startup commands from etc/init: one shell command per line, `#` comments and blank lines skipped. Runs once at boot before the first prompt; a missing file means a plain boot. Each line goes through the same parse + redirect + builtin dispatch as an * interactive command, so init stays a plain command list.*
- `shell_run` (line 894) `void shell_run(void)`
- `shell_load` (line 966) `static int shell_load(const char *fname, char *progname_out, void **entry_out)`
- `outw_port` (line 1029) `static inline void outw_port(unsigned short port, unsigned short val)`
- `shell_cmd_poweroff` (line 1035) `static void shell_cmd_poweroff(void)`
- `shell_run_dir_for` (line 1051) `static const ShellRunDir *shell_run_dir_for(const char *name)` - *The toolchain directory that owns `name`, chosen by suffix. Bare names with * no recognised suffix fall through to the command path bin/.*
- `shell_file_is_real` (line 1069) `static int shell_file_is_real(const char *resolved)` - *Is `resolved` (already normalised against the cwd) a real ramdisk file? A * directory name or a non-existent path is rejected, never run.*
- `shell_resolve_run` (line 1081) `static int shell_resolve_run(const char *name, char *out, unsigned cap)` - *Resolve `name` to a full ramdisk path suitable for running. A bare name is tried first against the cwd, then through the suffix-picked toolchain directory, then through the remaining directories as fallback. Returns 1 and fills `out` (cap bytes) on success, 0 when no candidate is a real file. A candidate that cannot fit `cap` is skipped like a missing file, never * truncated.*
- `etrel_path_trusted` (line 1123) `static int etrel_path_trusted(const char *full)` - *ET_REL trust gate (boyscout fix for ring-0 .o without validation): relocatables execute as kernel extensions, so only the toolchain directory (ETREL_TRUSTED_DIR in kernel.h) owns them. `full` is already normalised by fs_resolve (".."/"."/"//" collapsed, no symlinks on MiniFS), so a prefix match is a containment proof, not a string hope. TOCTOU note: the bytes are snapshotted into a kernel buffer at open time and the gate checks the same resolved path the bytes were read from; swapping the file between resolve and open only changes WHICH bytes load, and hostile bytes still face the ELF/reloc validators plus * the ETREL_IMAGE_MAX cap. ET_EXEC/ET_DYN/CVM are unaffected.*
- `shell_run_elf_buf_path` (line 1163) `static int shell_run_elf_buf_path(const char *data, unsigned size, int argc,
                    ...` - *Run a raw ELF image (ET_REL, ET_EXEC or ET_DYN) already read into `data`. argv[0] is the program name the program sees. Returns the exit code, or -1 when the buffer is not a loadable ELF. The image is not registered; it is * relocated and executed fresh, then dropped.*
- `shell_run_elf_file` (line 1196) `static int shell_run_elf_file(const char *full, int argc, char **argv)` - *Load the ramdisk file at `full` and run it as an ELF. Returns the exit * code, or -1 when the file cannot be read or loaded.*
- `shell_run_elf_minifs` (line 1209) `static int shell_run_elf_minifs(const char *name, int argc, char **argv)` - *Load a Linux ELF from the MiniFS disk and run it (preserves the historical * `run` fallback when a name is not on the ramdisk).*
- `shell_run_cvm` (line 1266) `static int shell_run_cvm(const char *full, int argc, char **argv)` - *Run a `.cvm` module at the resolved path `full`. The interpreter is loaded from the ramdisk on first use and cached. argv[0] is the module name the module sees; the interpreter passes it and the remaining words through as * a Linux-style argv.*
- `shell_run_file` (line 1302) `static int shell_run_file(const char *name, int argc, char **argv)` - *Run `name` as a ramdisk/MiniFS file: `.cvm` modules through the interpreter, ELF files by content through the matching loader. Returns the * exit code, or -1 when the name resolves to nothing runnable.*
- `shell_read_elf_bytes` (line 1346) `static int shell_read_elf_bytes(const char *name, unsigned char **out,
                          ...` - *--- Multitask run (mrun): concurrent isolated ELFs ----  `mrun a.elf b.elf ...` loads each ET_EXEC/ET_DYN into its own user window (proc_spawn_elf) and waits for all of them. The 100 Hz timer preempts the BSP across the READY set, so small programs overlap in time instead of running one after another. ET_REL is refused (ring-0 extensions are not multitask-safe); `.cvm` keeps the `run` path. Best-effort limits of this revision: no mmap/VMA isolation between the children (programs that mmap concurrently share the global VMA * tree) and one shared fd table; exit codes print per program.*
- `code` (line 1412) `* the last exit code (130 when interrupted). */
static int shell_wait_fg(int *pids, int n, int ki...`
- `shell_cmd_mrun` (line 1466) `static void shell_cmd_mrun(int argc, char **argv)`
- `shell_run_bg` (line 1514) `static void shell_run_bg(const char *name, int argc, char **argv)` - *`run <elf> &`: background a single isolated ELF (same spawn path as mrun). ET_REL and .cvm stay foreground-only: ring-0 extensions and the * single cached interpreter cannot run detached.*
- `desktop_path` (line 1557) `static void desktop_path(const char *name, char *dst, unsigned cap)`
- `desktop_flag` (line 1566) `static void desktop_flag(const char *name)`
- `desktop_flag_on` (line 1576) `static int desktop_flag_on(const char *name)`
- `flows` (line 1590) `* and external flows (make wl) set it themselves. */
static void desktop_unflag(const char *name)`
- `desktop_srv_alive` (line 1598) `static int desktop_srv_alive(void)`
- `shell_cmd_desktop` (line 1614) `static void shell_cmd_desktop(int argc, char **argv)`
- `shell_run_any` (line 1678) `int shell_run_any(const char *name, int argc, char **argv)` - *Unified dispatcher used by `run` and by bare commands: a registered program wins, then the runnable-file resolver. argv[0] is the command/program name * as typed. Returns the exit code, or -1 when the name cannot be run.*
- `gfx_parse_int` (line 1751) `static int gfx_parse_int(const char *s, int *out)` - *--- Graphics debugging (`gfx` builtin) ----  The serial console is the observability surface the BDD suite drives, but a framebuffer program's output never reaches it. `gfx` lifts the graphics side onto the console: state, single-pixel sampling, region statistics and a PPM screenshot are all reported as text, so the desktop and the windowed graphics programs are testable from the shell exactly like `date`/`vol` are. Every coordinate is clamped to the framebuffer and every parse is * strict, so a malformed invocation is a usage diagnostic, never a crash.*
- `gfx_read_palette` (line 1771) `static void gfx_read_palette(unsigned char pal[768])` - *Read the current 256-entry VGA DAC palette (3x6-bit per entry, read at 8-bit precision by the kernel's normalisation). Used by `gfx shot` to turn the * indexed framebuffer into an RGB PPM.*
- `shell_cmd_gfx` (line 1778) `static void shell_cmd_gfx(int argc, char **argv)`
- `shell_cmd_wm` (line 1930) `static void shell_cmd_wm(int argc, char **argv)` - *`wm <op>` — window-manager operations, exposed as a shell builtin so the tiling-WM behaviour is observable and testable over the serial console exactly like `date`/`vol`. The operations are the same functions the title-bar buttons, the Alt/Super shortcuts and the mouse tick call, so * the framebuffer and the shell can never disagree.*
- `tree` (line 2065) `* tree (mmap-heavy jobs stay best-effort), legacy blocking `run` ignores
 * Ctrl+C (it never poll...`
- `shell_cmd_jobs` (line 2078) `static void shell_cmd_jobs(void)`
- `shell_has_child` (line 2107) `static int shell_has_child(int pid)` - *Live-child check for one pid: a slot that is neither FREE nor reparented still belongs to this shell. Waiting on anything else (an already reaped job, a stranger's pid) must fail fast: the old code fell into shell_wait_fg for a pid that can never exit again and yield-looped forever with the console wedged (only Ctrl+C * escaped), which read exactly like a dead machine.*
- `shell_cmd_wait` (line 2117) `static void shell_cmd_wait(int argc, char **argv)`
- `shell_cmd_kill` (line 2152) `static void shell_cmd_kill(int argc, char **argv)`
- `shell_cmd_mem` (line 2175) `static void shell_cmd_mem(void)` - *`mem` — memory and disk pressure in one screenful: kernel heap use (dlmalloc), ramdisk use versus its cap, MiniFS free blocks/inodes and live processes. The demo-scale failure mode is a silent exhaustion (a big Zone alloc or a ramdisk write fails closed far from its cause), * so this is the first thing to read when a load stops loading.*
- `VMA` (line 2208) `* plus the live VMA (mmap) tree. The walk is bounded (64-deep explicit
 * stack, 128 regions prin...`
- `to` (line 2281) `* actually trap to (brk/mmap/munmap/mprotect) and says so up front. */
static void shell_cmd_trac...`
- `shell_parse_u64` (line 2350) `static int shell_parse_u64(const char *s, unsigned long *out)` - *Strict unsigned parse for debugger/inspector operands: `0x`-prefixed hex or plain decimal, no signs, no trailing garbage, fail-closed on overflow or empty input. katol is decimal-only, so `gdb dump 0x400000` used to parse as 0; this is the single choke point for numeric * inspector arguments.*
- `shell_parse_long` (line 2366) `int shell_parse_long(const char *s, long *out)` - *Strict signed decimal twin of shell_parse_u64: optional sign, at least one digit, whole string consumed, overflow fail-closed. The bound comes from the compiler's __LONG_MAX__ (freestanding-safe, no libc header needed); a negative sign allows one extra unit of magnitude for LONG_MIN. Shared through shell.h so the editor's line * numbers use the same choke point instead of a second copy.*
- `shell_parse_pid` (line 2387) `int shell_parse_pid(const char *s, int min_pid, int *out)` - *Bounded pid parse shared by wait/kill/vmmap: one range check instead of three open-coded copies. min_pid is 1 for job commands (pid 0 is the * shell view, never a job) and 0 for inspectors like vmmap.*
- `shell_cmd_gdb` (line 2402) `static void shell_cmd_gdb(int argc, char **argv)` - *`gdb <op>` -- in-OS inspector half of the debugger story. Full register-level debugging (breakpoints, single-step, live register edit) stays on the QEMU gdb stub: `make gdb`, then from the host `gdb -ex 'target remote :1234' -ex 'add-symbol-file kernel.elf 0x100000'`. Here: `gdb regs [pid]` dumps the stored context (LIVE sampled registers for the running pid), `gdb dump <addr> <len>` hexdumps 1..256 bytes * (decimal or 0x-hex), `gdb qemu` prints the remote hookup.*
- `shell_cmd_hash` (line 2445) `static void shell_cmd_hash(int argc, char **argv)` - *`hash <file>` — XXH64 (64-bit, seed 0) of a ramdisk/MiniFS file, streamed in bounded chunks so a large MiniFS file never needs a whole-file buffer. This is the integrity tool for CVM modules and any ramdisk payload: an image built from source is compared against a recorded hash, and a module * that drifted is detected before it is trusted.*
- `shell_resolve_arg` (line 2464) `static int shell_resolve_arg(const char *cmd, const char *arg,
                             const...` - *Docstring: Resolve `arg` against the cwd into `out` (`RAMDISK_FNAME_LEN` bytes); on failure print `<cmd>: <arg>: <reason>` and return 0. Unifies the resolve-or-diagnose prelude every path-taking * builtin repeats.*
- `shell_httpd_one` (line 2570) `static void shell_httpd_one(int child, const char *root)` - *Serve one accepted connection: read one request, map GET path onto the VFS mounts under root, stream head + body, close. Every failure is a status code, never a hang: the request read is deadline * bounded and every oversize/shortfall path answers 4xx.*
- `shell_httpd_serve` (line 2655) `static void shell_httpd_serve(unsigned short port, const char *root,
        int max_conn)` - *Accept loop: one connection at a time, Ctrl+C quits. The accept poll is non-blocking with a yield so the desktop tick and the console stay live while waiting for peers. max_conn < 0 serves forever; otherwise the loop exits after that many connections * (--once scripts a single fetch from the host with -hostfwd).*
- `shell_cross_ls` (line 2822) `static void shell_cross_ls(const char *drv, const char *imgarg,
                           const ...` - *List one directory from a cross-filesystem VFS driver (fat:, ext4:) to the console: same "drv:/img:path" addressing as the cat twin, served by the readdir verb so the builtin never names the * backing driver. Shared by the fat and ext4 builtins. define SHELL_LS_CAP 64*
- `shell_cross_cat` (line 2863) `static void shell_cross_cat(const char *drv, const char *imgarg,
                            cons...` - *Stream one file from a cross-filesystem VFS driver (fat:, ext4:) to the console: "drv:/img:path" per open (the prefix match needs '/' after "drv:", stripped before the driver splits img from path), 4 KB heap chunks so a hostile size can never drive an oversized alloc. Shared by the fat and ext4 builtins instead of * one copy each.*
- `shell_exec_builtin` (line 2905) `void shell_exec_builtin(int argc, char **argv)`
- `driver` (line 3331) `* stream through the fat: VFS driver ("img:fatpath" per open,
     * registered at boot beside me...`
- `shell_is_pipe_tok` (line 4105) `static int shell_is_pipe_tok(const char *a)`
- `shell_run_stage` (line 4144) `static char *shell_run_stage(char **sargv, int sargc,
        const char *input, unsigned long in...` - *Run one pipeline stage with stdin/out doors installed. input may be 0 (first stage reads the live console). Returns the stage output (caller frees) with its length; on any setup failure prints a diagnostic and returns 0 with len 0. not_last selects the stdout * pipe override for ET_EXEC children.*
- `shell_run_pipeline` (line 151) `static int shell_run_pipeline(char **argv, int argc, const char *redir_path, int redir_append, int redirected);`
- `text` (line 594) `* swallowed the sequence as plain text ("5~" in the * line) and the history was unreachable from the * prompt. */ console_getc();`
- `root` (line 665) `* MiniFS root (where the big ELFs live under bare names), * and only the highest-priority non-empty tier is kept. An * explicit path or an argument word keeps every match, so * navigating to data file`
- `desktop_unflag` (line 848) `static void desktop_unflag(const char *name);`
- `window` (line 1339) `* window (proc_spawn_elf) and waits for all of them. The 100 Hz timer * preempts the BSP across the READY set, so small programs overlap in * time instead of running one after another. ET_REL is refus`
- `this` (line 1544) `* boot into the tiled Wayland desktop: every NK app started after * this (paint, vedit, file, nuklear, doomedit, piano) runs as a * Wayland client (pixels to its pid-unique mailbox, input from its * .`
- `context` (line 1705) `* ISR context (which corrupts the running program's state) or * nesting a second foreground run inside the wait. */ shell_queue_launch(cmd);`
- `terminal` (line 2980) `* sequence clears serial consoles and is swallowed without * garbage by the framebuffer terminal (vedit pattern). */ if (vga_fb_active) term_clear();`
- `frame` (line 3725) `* not live in this frame (stack discipline, CLAUDE.md). */ struct ps_row *snap = (struct ps_row *)kmalloc(sizeof(struct ps_row) * MAX_PROCS);`
- `stdout` (line 4093) `* the pipe exactly like stdout (`2>` is an alias of `>`). * Per-stage `exit code:` lines report to the console, never into the * pipe (shell_report suspends the capture), so `run x | cat` shows the * `

**Macros:**
- `XXH_STATIC_LINKING_ONLY` (line 25) `#define XXH_STATIC_LINKING_ONLY`
- `SHELL_CVM_INTERP` (line 53) `#define SHELL_CVM_INTERP`
- `SHELL_RUN_DIRS` (line 72) `#define SHELL_RUN_DIRS`
- `SHELL_HIST_MAX` (line 98) `#define SHELL_HIST_MAX`
- `SHELL_BUILTIN_COUNT` (line 232) `#define SHELL_BUILTIN_COUNT`
- `QEMU_PM_PORT` (line 1033) `#define QEMU_PM_PORT`
- `HTTPD_REQ_CAP` (line 2563) `#define HTTPD_REQ_CAP`
- `HTTPD_IO_CHUNK` (line 2564) `#define HTTPD_IO_CHUNK`
- `SHELL_LS_CAP` (line 2821) `#define SHELL_LS_CAP`
- `PIPE_HOP_MAX` (line 4103) `#define PIPE_HOP_MAX`

**Structs:**
- `job_row` (line 2079)
- `ps_row` (line 3723)
- `ShellRunDir` (line 61) - *Runnable-file lookup: a bare name is mapped to a toolchain directory by its suffix, so `ld.o` finds objects/ld.o, `fib.elf` finds bin/fib.elf and `w1.cvm` finds cvm/w1.cvm. A bare name with no recognised suffix (cp, freedom, ...) resolves through bin/, the command path. Every candidate is checked for existence before it is run, so a name can never be truncated * into a path it does not own.*

#### `spawn.c`
**Path:** `kernel/spawn.c`
**File Doc:** *Docstring: Save the caller shared-window view into ctx.*

**Functions:**
- `spawn_backup` (line 11) `int spawn_backup(spawn_ctx_t *ctx)` - *#include "kernel.h" #include "sched.h" #include "vma.h" #include "spawn.h" #include "arena.h" #include "minifs.h" #include "vga_fb.h" #include "arch/x86/msr.h" /** Docstring: Save the caller shared-window view into ctx.*
- `spawn_restore` (line 38) `void spawn_restore(spawn_ctx_t *ctx)` - *if (!ctx->pool_copy) return 0; for (i = 0; i < vma_pool_n; i++) ctx->pool_copy[i] = vma_pool[i]; } ctx->live_root = vma_live_root; ctx->free_root = vma_free_root; ctx->pool_n = vma_pool_n; ctx->spare = vma_spare; for (i = 0; i < KFD_MAX; i++) ctx->kfd[i] = kfd_get(i); return 1; } /** Docstring: Restore a view previously saved by spawn_backup.*
- `spawn_free_argv` (line 87) `void spawn_free_argv(char **kargv, int argc)` - *Docstring: Release a copy produced by spawn_copy_argv. The copy is one arena block holding the pointer vector plus every word, so one kfree * releases the whole scope; argc only sizes the legacy contract.*
- `spawn_copy_argv` (line 99) `char **spawn_copy_argv(int argc, const char **uargv)` - *Docstring: Copy user argv into kernel memory, zero terminated. One kmalloc serves the pointer vector plus every word through a bump arena, so a Ctrl+R / Ctrl+L spawn costs a single heap block and frees it with a single kfree instead of argc+1 round trips that fragment * the heap and leak one word per missed free. Fail-closed with 0.*
- `spawn_validate_argv` (line 143) `int spawn_validate_argv(int argc, const char **uargv)` - *slen = (unsigned long)kstrlen(uargv[i]) + 1; dst = (char *)arena_alloc(&a, (size_t)slen, 1); if (!dst) { kfree(kargv); return 0; } kmemcpy(dst, uargv[i], slen); kargv[i] = dst; } kargv[argc] = 0; return kargv; } /** Docstring: Validate user argv words against the user window.*
- `spawn_load_image` (line 161) `unsigned char *spawn_load_image(const char *resolved, unsigned *size_out)` - *if (!user_range_ok((unsigned long)uargv, (unsigned long)(argc + 1) * sizeof(char *))) return 0; for (i = 0; i < argc; i++) { unsigned long s; if (!uargv[i]) break; s = (unsigned long)uargv[i]; if (s < USER_LOAD_BASE || s >= USER_LOAD_END) return 0; if (!user_str_ok(s, USER_LOAD_END - s)) return 0; } return 1; } /** Docstring: Snapshot a resolved path into a kernel buffer.*
- `spawn_run_rel` (line 196) `static int spawn_run_rel(const char *resolved, const char *redirect,
                         uns...` - *MiniFSInode mi; if (minifs_stat(ino, &mi) >= 0 && mi.size > 0) { data_size = mi.size; data = (unsigned char *)kmalloc(data_size); if (data) minifs_read(ino, data, 0, data_size); } } } if (!data) return 0; size_out = data_size; return data; } /** Docstring: Run one ET_REL child through the ring-0 loader.*
- `spawn_run_exec` (line 222) `static int spawn_run_exec(const char *resolved, const char *redirect,
                           ...` - *return EFAULT; } entry = elf_load((void *)data, data_size, &base); if (redirect && redirect[0]) did_redirect = redirect_begin(); rc = EFAULT; if (entry) rc = k_run_rel(entry, argc, kargv ? kargv : (char **)uargv_fallback); kfree(base); if (did_redirect && redirect_commit(redirect, 0) != 0) kprintf("SPAWN: redirect to %s failed, output dropped", redirect); return rc; } /** Docstring: Run one ET_EXEC child in an isolated window.*
- `spawn_execute` (line 268) `int spawn_execute(const char *resolved, const char *redirect,
                  unsigned char *da...` - *do_kill(pid); do_waitpid(pid); rc = 130; break; } yield(); } } if (did_redirect && redirect_commit(redirect, 0) != 0) kprintf("SPAWN: redirect to %s failed, output dropped", redirect); return rc; } /** Docstring: Run a loaded image by ELF type, return child status.*

#### `string.c`
**Path:** `kernel/string.c`
**File Doc:** *string.c -- Kernel string and memory functions.*

**Functions:**
- `kstrlen` (line 17) `unsigned long kstrlen(const char *s)`
- `kstrcpy` (line 23) `char *kstrcpy(char *dst, const char *src)`
- `kstrncpy` (line 29) `char *kstrncpy(char *dst, const char *src, unsigned long n)`
- `kstrncat` (line 35) `char *kstrncat(char *dst, const char *src, unsigned long n)`
- `kstrcmp` (line 43) `int kstrcmp(const char *a, const char *b)`
- `kstrncmp` (line 48) `int kstrncmp(const char *a, const char *b, unsigned long n)`
- `kstrchr` (line 53) `char *kstrchr(const char *s, int c)`
- `kstrstr` (line 58) `char *kstrstr(const char *hay, const char *ndl)`
- `kmemcpy` (line 68) `void *kmemcpy(void *dst, const void *src, unsigned long n)`
- `kmemset` (line 75) `void *kmemset(void *dst, int c, unsigned long n)`
- `kmemcmp` (line 81) `int kmemcmp(const void *a, const void *b, unsigned long n)`
- `kmemmove` (line 87) `void *kmemmove(void *dst, const void *src, unsigned long n)`
- `katol` (line 95) `long katol(const char *s)`

#### `symtab.c`
**Path:** `kernel/symtab.c`
**File Doc:** *================================================================*

**Functions:**
- `k_register_symbol` (line 10) `void k_register_symbol(const char *name, void *addr)`
- `ksym_resolve` (line 18) `void *ksym_resolve(const char *name)`
- `kprog_slot` (line 34) `KProg *kprog_slot(const char *name)`
- `kprog_lookup` (line 42) `KProg *kprog_lookup(const char *name)`
- `k_register_program` (line 49) `void k_register_program(const char *name, prog_entry_t entry)`
- `k_register_process` (line 57) `void k_register_process(const char *name, void *proc_entry)`
- `k_spawn` (line 65) `int k_spawn(const char *name, int argc, char **argv)`

#### `sync.c`
**Path:** `kernel/sync.c`
**File Doc:** *sync.c -- Blocking synchronization primitives (roadmap Phase 3.1).*

**Functions:**
- `wq_init` (line 29) `void wq_init(wait_queue_t *q)`
- `sleep_on` (line 35) `void sleep_on(wait_queue_t *q)`
- `wake_up` (line 56) `int wake_up(wait_queue_t *q)`
- `wake_up_all` (line 72) `int wake_up_all(wait_queue_t *q)`
- `mutex_init` (line 78) `void mutex_init(mutex_t *m)`
- `pi_valid` (line 95) `static int pi_valid(int pid)`
- `pi_set_base` (line 101) `void pi_set_base(int pid, int prio)`
- `pi_get_eff` (line 110) `int pi_get_eff(int pid)`
- `pi_recompute` (line 115) `static void pi_recompute(int pid)`
- `pi_boost` (line 126) `static void pi_boost(int waiter, int owner)`
- `mutex_lock` (line 152) `void mutex_lock(mutex_t *m)`
- `mutex_trylock` (line 172) `int mutex_trylock(mutex_t *m)`
- `mutex_unlock` (line 188) `void mutex_unlock(mutex_t *m)`
- `sem_init` (line 209) `void sem_init(sem_t *s, int value)`
- `sem_wait` (line 215) `void sem_wait(sem_t *s)`
- `sem_post` (line 229) `void sem_post(sem_t *s)`
- `cond_init` (line 237) `void cond_init(cond_t *c)`
- `cond_wait` (line 241) `void cond_wait(cond_t *c, mutex_t *m)`
- `cond_signal` (line 247) `void cond_signal(cond_t *c)`
- `cond_broadcast` (line 251) `void cond_broadcast(cond_t *c)`
- `rwlock_init` (line 255) `void rwlock_init(rwlock_t *rw)`
- `rwlock_read_trylock` (line 263) `int rwlock_read_trylock(rwlock_t *rw)`
- `rwlock_write_trylock` (line 277) `int rwlock_write_trylock(rwlock_t *rw)`
- `rwlock_read_lock` (line 289) `void rwlock_read_lock(rwlock_t *rw)`
- `rwlock_read_unlock` (line 296) `void rwlock_read_unlock(rwlock_t *rw)`
- `rwlock_write_lock` (line 306) `void rwlock_write_lock(rwlock_t *rw)`
- `rwlock_write_unlock` (line 328) `void rwlock_write_unlock(rwlock_t *rw)`

**Variables:**
- `t_cur_pid` (line 26) `extern int t_cur_pid;` - *Host unit-test hook (tests/test_sync.c, `make test-sync`): current_pid * is mapped to this test global by -Dcurrent_pid=t_cur_pid.*

#### `syscalls.c`
**Path:** `kernel/syscalls.c`
**File Doc:** *syscalls.c - Linux x86-64 syscall dispatcher and SYS_SPAWN.*

**Functions:**
- `kfd_view_current` (line 61) `static kfd_view_t *kfd_view_current(void)` - *Docstring: View owning the caller's fds: its own on isolated procs * and threads, the root on pid 0 and any pid without one.*
- `kfd_view_root` (line 71) `kfd_view_t *kfd_view_root(void)` - *Docstring: Static root view (shell pid 0, pids without their own): * entries are the historical shared table, never freed.*
- `kfd_get` (line 90) `KFILE *kfd_get(int fd)`
- `kfd_put` (line 103) `void kfd_put(KFILE *f)`
- `kfd_view_count` (line 115) `static int kfd_view_count(kfd_view_t *v)` - *} void kfd_put(KFILE *f) { irqflags_t flags; int drop = 0; if (!f) return; spin_lock_irqsave(&fd_lock, &flags); f->ref--; if (f->ref <= 0) drop = 1; spin_unlock_irqrestore(&fd_lock, flags); if (drop) kfclose(f); } /** Docstring: Count live entries in a view (fd accounting source).*
- `untouched` (line 139) `* child untouched (caller refuses fail-closed). */
int kfd_view_copy(proc_t *child, proc_t *parent)`
- `NULL` (line 166) `* on NULL (already released or never owned). */
void kfd_view_release(proc_t *p)`
- `kfd_view_cloexec` (line 197) `void kfd_view_cloexec(void)` - *Docstring: Close every CLOEXEC fd in the caller's own view (execve: the image is replaced, marked descriptors must not survive). Runs on * the live view entries with the same ref discipline as close.*
- `wall_us_now` (line 256) `unsigned long wall_us_now(void)` - *wall_us_now: RTC-anchored wall clock in microseconds (Phase 0.2/0.3). The RTC gives whole seconds; the fraction is the free-running ktime_us rebased at every RTC second edge, so successive reads order correctly across the edge. Shared by gettimeofday (96), clock_gettime (228) and the shell `clock` builtin: one source, never three disagreeing clocks. On RTC failure the base stays 0 and time reads as small uptime-like * values; callers that need an epoch treat 0 as "no clock".*
- `sys_minios_dns` (line 266) `static long sys_minios_dns(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_tls_retired` (line 271) `static long sys_minios_tls_retired(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_time` (line 284) `static long sys_linux_time(long a1, long a2, long a3, long a4, long a5, long a6)` - *time (201): the retired kernel-TLS handshake number now serves Linux time(2), exactly as 202 serves futex (ADR-0014 record in tools/check_abi_numbers.py). Static glibc calls it when there is no vDSO; -ENOSYS made OpenSSL and libcurl check certificate lifetimes against * (time_t)-1. Answers RTC-anchored wall seconds, stored at a1 when set.*
- `sys_linux_futex` (line 293) `static long sys_linux_futex(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_time` (line 342) `static long sys_minios_time(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_kbd` (line 346) `static long sys_minios_kbd(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_palette` (line 366) `static long sys_minios_palette(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_kbd_raw` (line 378) `static long sys_minios_kbd_raw(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_vga_mode` (line 384) `static long sys_minios_vga_mode(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_pcspk_init` (line 391) `static long sys_minios_pcspk_init(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_pcspk_tone` (line 395) `static long sys_minios_pcspk_tone(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_doom_frame` (line 409) `static long sys_minios_doom_frame(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_gfx_zoom` (line 420) `static long sys_minios_gfx_zoom(long a1, long a2, long a3, long a4, long a5, long a6)` - *Graphics window scale request (a1): 0 native, 1 2x nearest-neighbour zoom for the 320x200 game window, 2 true fullscreen (aspect-fit to the whole display, the WM view contract in wm_gfxview.h), 3 leave fullscreen. Scalar only, no pointer to validate; anything else is EINVAL, and 2/3 without a graphics program are EINVAL too, so an old * caller probing the call keeps its windowed behaviour.*
- `sys_minios_rtc` (line 429) `static long sys_minios_rtc(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_fb_info` (line 442) `static long sys_minios_fb_info(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_pcspk_vol` (line 462) `static long sys_minios_pcspk_vol(long a1, long a2, long a3, long a4, long a5, long a6)`
- `minfo_sleep_init` (line 486) `void minfo_sleep_init(int tick_ok)`
- `minfo_tick_wake` (line 491) `void minfo_tick_wake(void *ctx)`
- `view` (line 503) `* view (same as the `clear` builtin). Anything else is -EINVAL. Each
 * out-word is range-checked...`
- `sys_minios_spawn` (line 594) `static long sys_minios_spawn(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_lz4_compress` (line 605) `static long sys_minios_lz4_compress(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_lz4_decompress` (line 618) `static long sys_minios_lz4_decompress(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_mouse` (line 632) `static long sys_minios_mouse(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_nk_frame` (line 656) `static long sys_minios_nk_frame(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sb16_audio_device` (line 669) `static device_t *sb16_audio_device(void)` - *} static long sys_minios_nk_frame(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a2; (void)a3; (void)a4; (void)a5; (void)a6; if (a1) SANITIZE_RANGE(a1, 2 * sizeof(int)); gfx_note_compositor(); vga_fb_blit_nk_window(); if (a1) { int *o = (int *)(unsigned long)a1; vga_fb_gfx_origin(&o[0], &o[1]); } return 0; } /** Docstring: Resolve the registered PCM sink, 0 when absent.*
- `sys_minios_sb16_open` (line 675) `static long sys_minios_sb16_open(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_sb16_submit` (line 687) `static long sys_minios_sb16_submit(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_gfx_title` (line 698) `static long sys_minios_gfx_title(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_sb16_pump` (line 712) `static long sys_minios_sb16_pump(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_sb16_stream_open` (line 716) `static long sys_minios_sb16_stream_open(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_sb16_stream_close` (line 720) `static long sys_minios_sb16_stream_close(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_sb16_stream_submit` (line 724) `static long sys_minios_sb16_stream_submit(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_pcm2_open` (line 737) `static long sys_minios_pcm2_open(long a1, long a2, long a3, long a4, long a5, long a6)` - *Low-latency PCM path (pcm2, syscalls 246-248): OPEN takes flags, WRITE returns bytes taken (blocking unless NONBLOCK), CLOSE releases. Pointer/length validated at the boundary like every other dispatcher case; the driver copies in fragment chunks and * blocks with the scheduler, never with a spin.*
- `sys_minios_pcm2_write` (line 742) `static long sys_minios_pcm2_write(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_pcm2_close` (line 750) `static long sys_minios_pcm2_close(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_clip_set` (line 760) `static long sys_minios_clip_set(long a1, long a2, long a3, long a4, long a5, long a6)` - *Shared text clipboard (syscalls 249-250): SET copies len bytes in (refused past 4096, never truncated), GET copies out up to cap (refused when empty or undersize, never a partial paste). All pointers validated at the boundary; kernel addresses fail with * -EFAULT before entry.*
- `sys_minios_clip_get` (line 770) `static long sys_minios_clip_get(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_sb16_stream_vol` (line 786) `static long sys_minios_sb16_stream_vol(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_futex_wait` (line 799) `static long sys_minios_futex_wait(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_futex_wake` (line 805) `static long sys_minios_futex_wake(long a1, long a2, long a3, long a4, long a5, long a6)`
- `batch_kdispatch` (line 814) `static long batch_kdispatch(uint32_t opcode)`
- `DOOM_FRAME` (line 829) `* DOOM_FRAME (211) and NK_FRAME (220) stay as compat aliases. */
static long sys_minios_gfx_prese...`
- `sys_minios_getc_raw` (line 863) `static long sys_minios_getc_raw(long a1, long a2, long a3, long a4, long a5, long a6)` - *Raw keystroke read for fullscreen ring-3 programs (vedit): one byte from the serial + PS/2 multiplexer with no line buffering, no echo and no scrollback detour. a1 == 0 polls (-1 when idle, so user space can bound its own escape-sequence timeout); otherwise blocks until a byte. * Bytes are the same CSI form both consoles carry, PS/2 included.*
- `sys_minios_submit_batch` (line 874) `static long sys_minios_submit_batch(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_rlimit` (line 897) `static long sys_minios_rlimit(long a1, long a2, long a3, long a4, long a5, long a6)` - *RLIMIT/cgroups-lite (240): a1 = op (SET/GET), a2 = resource (AS/CPU/NOFILE), a3 = value for SET. Values are bytes, ticks, count; 0 clears (unlimited). Only lowers... no: any non-negative value sets (raising allowed; the threat model is cooperative containment, not * privilege). Returns the old value on SET, current on GET.*
- `sys_linux_getdents64` (line 976) `static long sys_linux_getdents64(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_dir_list` (line 1069) `static long sys_minios_dir_list(long a1, long a2, long a3, long a4, long a5, long a6)`
- `syscall_trace_enabled` (line 1241) `long syscall_trace_enabled(void)`
- `syscall_trace_set` (line 1242) `void syscall_trace_set(int on)`
- `syscall_trace_verbose_enabled` (line 1243) `long syscall_trace_verbose_enabled(void)`
- `syscall_trace_verbose_set` (line 1244) `void syscall_trace_verbose_set(int on)`
- `syscall_trace_shown` (line 1245) `unsigned long syscall_trace_shown(void)`
- `sys_linux_read` (line 1271) `static long sys_linux_read(long a1, long a2, long a3, long a4, long a5, long a6)`
- `fd_write` (line 1327) `static long fd_write(long fd, const char *buf, long cnt)` - *Write cnt validated user bytes to fd: a dup2/pipe override on fd 1/2 (pipeline stage stdout) is served instead of the console, no override means the historical console path byte for byte, and every other * description goes through kfile_user_write.*
- `sys_linux_write` (line 1351) `static long sys_linux_write(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_writev` (line 1358) `static long sys_linux_writev(long a1, long a2, long a3, long a4, long a5, long a6)`
- `kfd_install` (line 1403) `static long kfd_install(KFILE *f, int cloexec)` - *Install an open description as the lowest free fd (>= 3), honouring * close-on-exec; shared by do_open_path's file and directory branches.*
- `do_open_kpath` (line 1426) `static long do_open_kpath(const char *path, long flags)` - *Trusted core: `path` is already a kernel string (syscall argument that * passed SANITIZE_STR, or an *at(2) join built in kernel memory).*
- `do_open_path` (line 1452) `static long do_open_path(const char *path, long flags)`
- `sys_linux_open` (line 1457) `static long sys_linux_open(long a1, long a2, long a3, long a4, long a5, long a6)`
- `cwd` (line 1466) `* ENAMETOOLONG instead of silently resolving against the cwd (the bug
 * that broke shutil.rmtree...`
- `kfd_claim_from` (line 1529) `static long kfd_claim_from(KFILE *f, long minfd, int cloexec)` - *Claim the lowest free fd slot >= minfd for an already-opened KFILE (pipes, dup, eventfd), arming close-on-exec when asked. The slot scan and publish re-check under fd_lock like do_open_path; the caller keeps * ownership on failure. Slots 0..2 stay the console's.*
- `kfd_claim` (line 1554) `static long kfd_claim(KFILE *f)`
- `sys_linux_pipe2` (line 1578) `static long sys_linux_pipe2(long a1, long a2, long a3, long a4, long a5, long a6)` - *pipe2 (293): O_CLOEXEC arms close-on-exec on both ends, O_NONBLOCK makes * both descriptions non-blocking; O_DIRECT packet pipes are refused.*
- `sys_linux_pipe` (line 1606) `static long sys_linux_pipe(long a1, long a2, long a3, long a4, long a5, long a6)`
- `kfd_cloexec_get` (line 1612) `static int kfd_cloexec_get(long fd)` - *kfclose(w); return wfd; } ufd[0] = (int)rfd; ufd[1] = (int)wfd; return 0; } static long sys_linux_pipe(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a2; return sys_linux_pipe2(a1, 0, a3, a4, a5, a6); } /* close-on-exec bit of fd in the caller's view (fd < KFD_MAX).*
- `kfd_cloexec_set` (line 1622) `static void kfd_cloexec_set(long fd, int on)`
- `kfile_status_flags` (line 1633) `static long kfile_status_flags(KFILE *f)` - *Linux open-file status flags of a description: access mode from its * kind plus O_APPEND and O_NONBLOCK.*
- `sys_linux_dup3` (line 1684) `static long sys_linux_dup3(long a1, long a2, long a3, long a4, long a5, long a6)` - *break; case LINUX_F_SETFL: if (f) f->nonblock = (a3 & LINUX_O_NONBLOCK) ? 1 : 0; r = 0; break; default: r = -22; break; } if (f) kfd_put(f); return r; } /* dup3 (292): dup2 with O_CLOEXEC as the only flag; old == new is EINVAL.*
- `sys_linux_close_range` (line 1694) `static long sys_linux_close_range(long a1, long a2, long a3, long a4, long a5, long a6)` - *return r; } /* dup3 (292): dup2 with O_CLOEXEC as the only flag; old == new is EINVAL. static long sys_linux_dup3(long a1, long a2, long a3, long a4, long a5, long a6) { long r; if (a3 & ~(long)LINUX_O_CLOEXEC) return -22; if (a1 == a2) return -22; r = sys_linux_dup2(a1, a2, 0, a4, a5, a6); if (r >= 0 && r < KFD_MAX) kfd_cloexec_set(r, (a3 & LINUX_O_CLOEXEC) ? 1 : 0); return r; } /* close_range (436): mark [first, last] close-on-exec, or close it.*
- `sys_linux_eventfd2` (line 1718) `static long sys_linux_eventfd2(long a1, long a2, long a3, long a4, long a5, long a6)` - *spin_lock_irqsave(&fd_lock, &flags_irq); for (fd = lo; fd <= hi && fd < KFD_MAX; fd++) if (v->f[fd]) v->cloexec |= (1u << (unsigned)fd); spin_unlock_irqrestore(&fd_lock, flags_irq); return 0; } for (fd = lo; fd <= hi && fd < KFD_MAX; fd++) if (fd >= FD_STD_COUNT) sys_linux_close((long)fd, 0, 0, 0, 0, 0); for (fd = NET_FD_BASE; fd < (unsigned long)(NET_UDP_FD_BASE + NET_UDP_SOCKETS); fd++) if (fd >= lo && fd <= hi && net_sys_is_socket((long)fd)) net_sys_close((long)fd); return 0; } /* eventfd2 (290) / eventfd (284): a counter description (kevent_*).*
- `sys_linux_eventfd` (line 1731) `static long sys_linux_eventfd(long a1, long a2, long a3, long a4, long a5, long a6)`
- `kfd_poll_revents` (line 1739) `int kfd_poll_revents(int fd)` - *Docstring: poll(2) readiness of a non-socket descriptor (pipes, eventfds, files, console), masked by nothing: the caller keeps the * requested bits plus POLLERR/POLLHUP/POLLNVAL. POLLNVAL for a closed fd.*
- `kfile_user_read` (line 1774) `static long kfile_user_read(KFILE *f, char *buf, long cnt)` - *Linux read on a description: an eventfd takes its counter, a pipe read end blocks (yielding) while empty with the writer open unless O_NONBLOCK (-EAGAIN), and reports EOF once the writer closed; every * other file reads through kfread.*
- `kfile_user_write` (line 1804) `static long kfile_user_write(KFILE *f, const char *buf, long cnt)` - *Linux write on a description: an eventfd adds to its counter, a pipe write end blocks (yielding) while full unless O_NONBLOCK and answers -EPIPE once the reader closed; every other file writes through * kfwrite.*
- `sys_linux_dup` (line 1833) `static long sys_linux_dup(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_dup2` (line 1848) `static long sys_linux_dup2(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_close` (line 1882) `static long sys_linux_close(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_lseek` (line 1905) `static long sys_linux_lseek(long a1, long a2, long a3, long a4, long a5, long a6)`
- `mm_ensure_cur` (line 1923) `static int mm_ensure_cur(unsigned long start, unsigned long end)` - *Back isolated user windows (mrun/proc_spawn_elf): their page tables start with only segments + stack mapped, so heap/mmap growth must materialize pages. Shared-window PTEs are already present and the call * below is a no-op there: zero behavior change on the legacy path.*
- `sys_linux_brk` (line 1932) `static long sys_linux_brk(long a1, long a2, long a3, long a4, long a5, long a6)`
- `mmap_tag_file` (line 1973) `static int mmap_tag_file(unsigned long base, int ino, unsigned long off)` - *Docstring: Tag a freshly carved live node as file-backed. The node was just inserted at base, so the exact find hits; failure * leaves it anonymous and fails the call, never half-tagged.*
- `mmap_range_free` (line 1988) `static int mmap_range_free(unsigned long base, unsigned long len)` - *Invariant guard for every range mmap hands out: it must not overlap a live mapping or reach below the brk heap. A hit means the VMA trees or the bump pointer are corrupt; handing the range out would give one page * two owners, so the mapping is refused and the defect reported.*
- `sys_linux_mmap` (line 1997) `static long sys_linux_mmap(long a1, long a2, long a3, long a4, long a5, long a6)`
- `vma_live_first_overlap` (line 2095) `static vma_node_t *vma_live_first_overlap(unsigned long base, unsigned long end)` - *Lowest live mapping overlapping [base, end), or VMA_NIL. Bounded * explicit-stack walk like the mmap best-fit search.*
- `vma_live_remainder` (line 2112) `static int vma_live_remainder(unsigned long base, unsigned long len,
        int file, int ino, u...` - *int sp = 0; vma_node_t *x = vma_live_root; while (x != VMA_NIL || sp > 0) { while (x != VMA_NIL) { if (sp < 64) stack[sp++] = x; x = x->left; } x = stack[--sp]; if (x->base < end && x->base + x->len > base && (best == VMA_NIL || x->base < best->base)) best = x; x = x->right; } return best; } /* Insert a live remainder of a split mapping, keeping its file identity.*
- `split` (line 2126) `* hold a split (the mapping is restored untouched). */
static long sys_linux_munmap(long a1, long...`
- `mprotect_pte` (line 2176) `static volatile unsigned long *mprotect_pte(unsigned long cr3,
        unsigned long va)` - *Docstring: Locate the PTE for a user address in the caller's live tables (syscall entry keeps the caller CR3 loaded, so no KPTI swap is needed). Mirrors the cow_resolve walk exactly: PML4 entry 0, PDPT entry 0, 4 KB PT pages only. Returns 0 for any missing level or huge page; the caller turns that into -ENOMEM without touching * a single bit, so a half-mapped range never applies half.*
- `first` (line 2200) `* passes under mm_lock: validate every page first (present, user,
 * private), then apply, so a h...`
- `vma_free_cover` (line 2281) `static vma_node_t *vma_free_cover(unsigned long base, unsigned long len)` - *Free-tree node covering [base, base+len) entirely, or VMA_NIL. Bounded * explicit-stack walk like the mmap best-fit search above.*
- `vma_live_overlap` (line 2300) `static int vma_live_overlap(unsigned long base, unsigned long len)` - *while (x != VMA_NIL || sp > 0) { while (x != VMA_NIL) { if (sp < 64) stack[sp++] = x; x = x->left; } x = stack[--sp]; if (x->base <= base && end - x->base <= x->len) return x; x = x->right; } return VMA_NIL; } /* 1 when any live node intersects [base, base+len). Bounded walk.*
- `sys_linux_mremap` (line 2327) `static long sys_linux_mremap(long a1, long a2, long a3, long a4, long a5, long a6)` - *Linux mremap(25): resize or move one mmap region. glibc's realloc calls it when growing large mmap'd chunks (the file-browser PNG preview hits it three times per wallpaper decode), so ENOSYS here silently breaks every big realloc even though malloc has no fallback left. The old mapping is one exact live VMA node (what mmap inserts); anything else is EFAULT, never a partial move. Shrink splits precisely, grow extends in place when the adjacent pages are free, otherwise MAYMOVE relocates (copy + free old, old untouched on ENOMEM) and FIXED relocates only to * a free-covered target. new_size 0 unmaps like munmap.*
- `sys_linux_sigaction` (line 2593) `static long sys_linux_sigaction(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_sigprocmask` (line 2598) `static long sys_linux_sigprocmask(long a1, long a2, long a3, long a4, long a5, long a6)`
- `kfile_readable_bytes` (line 2617) `static int kfile_readable_bytes(KFILE *f)` - *#define LINUX_TCGETS     0x5401 #define LINUX_TIOCGWINSZ 0x5413 #define LINUX_FIONREAD   0x541B #define LINUX_FIONBIO    0x5421 #define LINUX_FIONCLEX   0x5450 #define LINUX_FIOCLEX    0x5451 #define LINUX_TCGETS2    0x802C542AL #define LINUX_ENOTTY     25 #define LINUX_WINSIZE_LEN 8 #define LINUX_TERMIOS_LEN  36 #define LINUX_TERMIOS2_LEN 44 #define LINUX_IOCTL_INT  ((unsigned long)sizeof(int)) /* Bytes a read of f would return now (FIONREAD).*
- `FIONREAD` (line 2633) `* descriptor answers FIONREAD (bytes readable now), FIONBIO (O_NONBLOCK),
 * FIOCLEX/FIONCLEX (FD...`
- `sys_linux_access` (line 2673) `static long sys_linux_access(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_socket` (line 2695) `static long sys_linux_socket(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_connect` (line 2700) `static long sys_linux_connect(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_bind` (line 2706) `static long sys_linux_bind(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_listen` (line 2712) `static long sys_linux_listen(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_accept` (line 2717) `static long sys_linux_accept(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_sendto` (line 2723) `static long sys_linux_sendto(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_recvfrom` (line 2728) `static long sys_linux_recvfrom(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_shutdown` (line 2733) `static long sys_linux_shutdown(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_prlimit64` (line 2768) `static long sys_linux_prlimit64(long a1, long a2, long a3, long a4, long a5, long a6)` - *prlimit64(pid, resource, new, old): pid 0 or a live pid. Setting NOFILE (at most KFD_MAX), AS and CPU updates the MiniOS limit; the stack is fixed by the window layout, so only a value at or below it is accepted * (and changes nothing).*
- `sys_linux_sched_getaffinity` (line 2801) `static long sys_linux_sched_getaffinity(long a1, long a2, long a3, long a4, long a5, long a6)` - *sched_getaffinity(pid, size, mask): every task may run on every CPU, so the mask has the low cpu_count bits set; the return value is the * mask size written, as Linux reports it.*
- `linux_timespec_us` (line 2823) `static long linux_timespec_us(long ts)` - *Microseconds of a user timespec, or -EINVAL when it is malformed * (negative, or tv_nsec outside [0, 1e9)); huge intervals saturate.*
- `sys_linux_pause` (line 2840) `static long sys_linux_pause(long a1, long a2, long a3, long a4, long a5, long a6)` - *pause(34): wait for a signal. MiniOS installs no handlers, so the only * signal that ends the wait is a fatal one, which ends the caller.*
- `sys_linux_nanosleep` (line 2848) `static long sys_linux_nanosleep(long a1, long a2, long a3, long a4, long a5, long a6)` - *nanosleep(35): sleep the relative interval at *req on the monotonic * clock; -EINVAL for a malformed interval, -EFAULT for a bad pointer.*
- `clock_gettime` (line 2863) `* clock_gettime(1) reads. */
static long sys_linux_clock_nanosleep(long a1, long a2, long a3, lon...`
- `sys_linux_setsockopt` (line 2880) `static long sys_linux_setsockopt(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_getsockopt` (line 2887) `static long sys_linux_getsockopt(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_getsockname` (line 2894) `static long sys_linux_getsockname(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_getpeername` (line 2900) `static long sys_linux_getpeername(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_sendmsg` (line 2906) `static long sys_linux_sendmsg(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_sendmmsg` (line 2912) `static long sys_linux_sendmmsg(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_poll` (line 2920) `static long sys_linux_poll(long a1, long a2, long a3, long a4, long a5, long a6)`
- `select_timeout_ms` (line 2946) `static int select_timeout_ms(const long *t, int pselect, long *out)` - *Convert a sanitized timeval/timespec to a net_sys_poll budget: 0 polls once, -1 waits forever (net_sys_poll's negative timeout). Sub-millisecond fractions round up so a sleep never returns early. * Returns 0 on success, -1 on a negative or out-of-range field.*
- `sys_linux_select` (line 3031) `static long sys_linux_select(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_pselect6` (line 3036) `static long sys_linux_pselect6(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_flock` (line 3041) `static long sys_linux_flock(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_fsync` (line 3050) `static long sys_linux_fsync(long a1, long a2, long a3, long a4, long a5, long a6)` - *fsync/fdatasync: the ramdisk is memory (always durable) and MiniFS persists through kfclose/minifs_sync, so there is nothing to flush that close would not already flush. Success is truthful here, not a * lie: no write-back cache sits between the caller and the medium.*
- `sys_linux_fdatasync` (line 3055) `static long sys_linux_fdatasync(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_getcwd` (line 3060) `static long sys_linux_getcwd(long a1, long a2, long a3, long a4, long a5, long a6)`
- `unlink_kpath` (line 3073) `static long unlink_kpath(const char *path)` - *static long sys_linux_getcwd(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a3; (void)a4; (void)a5; (void)a6; char *buf = (char *)a1; unsigned long sz = (unsigned long)a2; if (!buf || sz == 0) return -22; SANITIZE_RANGE(buf, sz); unsigned long cwd_len = (unsigned long)kstrlen(fs_cwd); if (sz < cwd_len + 1) return -34; for (unsigned long i = 0; i <= cwd_len; i++) buf[i] = fs_cwd[i]; return (long)(cwd_len + 1); } /* Trusted core: `path` is already a kernel string.*
- `sys_linux_unlink` (line 3089) `static long sys_linux_unlink(long a1, long a2, long a3, long a4, long a5, long a6)`
- `readlink_path` (line 3101) `static long readlink_path(const char *path, char *buf, long bufsz)` - *readlink of /proc/self/exe answers the caller's image path (absolute, no NUL, truncated to the buffer like Linux); MiniOS has no other links, * so every other path is -EINVAL.*
- `sys_linux_readlink` (line 3117) `static long sys_linux_readlink(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_prctl` (line 3123) `static long sys_linux_prctl(long a1, long a2, long a3, long a4, long a5, long a6)` - *if (!exe[0]) return -2; len = (long)kstrlen(exe) + 1; if (len > bufsz) len = bufsz; buf[0] = '/'; for (i = 1; i < len; i++) buf[i] = exe[i - 1]; return len; } static long sys_linux_readlink(long a1, long a2, long a3, long a4, long a5, long a6) { (void)a4; (void)a5; (void)a6; return readlink_path((const char *)a1, (char *)a2, a3); } /* prctl (157): no_new_privs, dumpable, name and seccomp (proc_sec.c).*
- `sys_linux_rename` (line 3132) `static long sys_linux_rename(long a1, long a2, long a3, long a4, long a5, long a6)` - *rename(82): same-filesystem file move through fs_rename (ramdisk in-place, MiniFS entry move). Both paths sanitize as user strings and resolve against the shell cwd like unlink; directories, existing dst * and cross-filesystem dsts refuse with their errno, never half-moved.*
- `sys_linux_fstat` (line 3146) `static long sys_linux_fstat(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_gettimeofday` (line 3171) `static long sys_linux_gettimeofday(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_arch_prctl` (line 3194) `static long sys_linux_arch_prctl(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_uname` (line 3206) `static long sys_linux_uname(long a1, long a2, long a3, long a4, long a5, long a6)`
- `answer` (line 3230) `* made glibc answer (uid_t)-1, which CPython's startup reads. */
#define LINUX_UID_GID_ROOT 0

st...`
- `sys_linux_getgid` (line 3238) `static long sys_linux_getgid(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_geteuid` (line 3243) `static long sys_linux_geteuid(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_getegid` (line 3248) `static long sys_linux_getegid(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_madvise` (line 3255) `static long sys_linux_madvise(long a1, long a2, long a3, long a4, long a5, long a6)` - *madvise (28): advice only; glibc frees thread stacks with it and * ignores the result, MiniOS keeps the pages, so 0 is truthful.*
- `sys_linux_mkdir` (line 3263) `static long sys_linux_mkdir(long a1, long a2, long a3, long a4, long a5, long a6)` - *mkdir (83): a MiniFS directory. The parent must exist (-ENOENT), an existing name is -EEXIST, the mode is accepted and ignored (MiniFS has * no permission bits). Runs under fs_lock like unlink.*
- `rmdir_kpath` (line 3299) `static long rmdir_kpath(const char *path)` - *rmdir (84): remove one empty MiniFS directory (the ramdisk carries no directories of its own; its prefixes come from files). Missing paths are ENOENT, a non-directory is ENOTDIR and a non-empty directory or the root is ENOTEMPTY, like Linux. pip's tempdir cleanup * (shutil.rmtree) is the main caller. /* Trusted core: `path` is already a kernel string.*
- `sys_linux_rmdir` (line 3320) `static long sys_linux_rmdir(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_umask` (line 3334) `static long sys_linux_umask(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_fchmod` (line 3357) `static long sys_linux_fchmod(long a1, long a2, long a3, long a4, long a5, long a6)`
- `trace_is_noisy` (line 3443) `static int trace_is_noisy(long n)`
- `syscall_name` (line 3472) `const char *syscall_name(long n)` - *define SC_EXTRA_COUNT (sizeof(sc_extra_names) / sizeof(sc_extra_names[0]))*
- `trace_hint_print` (line 3513) `static void trace_hint_print(long n, int kind, const char *path,
                             lon...`
- `sc_record` (line 3537) `static void sc_record(long n, long a1, long a2, long a3, long ret)`
- `sc_hex` (line 3557) `static void sc_hex(unsigned long v)`
- `sc_record_dump` (line 3567) `void sc_record_dump(int pid)` - *e->a3 = a3; e->ret = ret; } static void sc_hex(unsigned long v) { static const char digits[] = "0123456789abcdef"; char h[17]; int i; for (i = 15; i >= 0; i--) { h[i] = digits[v & 0xF]; v >>= 4; } h[16] = 0; serial_puts(h); } /* Serial-only, safe from the exception path: pid's log, oldest first.*
- `ksyscall` (line 3585) `long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6)`
- `user_range_ok` (line 3624) `int user_range_ok(unsigned long p, unsigned long len)`
- `products` (line 3641) `* products (writev cnt*sizeof, poll a2*8, spawn (argc+1)*sizeof) are
 * pre-bounded against (END-...`
- `ksyscall_dispatch` (line 3654) `static long ksyscall_dispatch(long n, long a1, long a2, long a3, long a4, long a5, long a6)`
- `k_syscall_spawn` (line 3932) `static int k_syscall_spawn(const char *path, const char *redirect,
                             i...`
- `by` (line 225) `* is indexed by (syscall_number - 200). New syscalls are added by: * 1. Adding a MINIOS_SYS_* constant to progs/minios_abi.h * 2. Implementing a static long sys_*(long a1, ..., long a6) function here `
- `boot` (line 479) `* boot (minfo_sleep_init from sched_init);`
- `unchanged` (line 1260) `* unchanged (same code, same order of checks). Numbers >= 200 that * overlap real Linux ABIs stay in the switch as documented * fall-throughs, as do out-of-range numbers (e.g. 334) and the * default E`
- `EAGAIN` (line 1287) `* writer open is EAGAIN (-11, retry);`
- `EOF` (line 1288) `* is EOF (0). */ KFILE *o = kfd_get(0);`
- `node` (line 2322) `* mapping is one exact live VMA node (what mmap inserts);`
- `clock` (line 2859) `* clock (the monotonic TSC clock times it, as Linux does: glibc sends * every nanosleep here as a relative CLOCK_REALTIME sleep);`
- `long` (line 2865) `unsigned long (*now)(void);`
- `Discipline` (line 3637) `* * Discipline (audit 2026-09, kept as comment, not a deprecation: both * primitives are legitimate): user_range_ok is ONLY for exact-size * buffers (sizeof(int), 144-byte stat, fixed PCM length);`
- `readlink` (line 3801) `* readlink (89). */ return readlink_path((const char *)a2, (char *)a3, a4);`
- `proc_spawn_elf` (line 3923) `* proc_spawn_elf (the same path mrun uses) and the caller blocks in * do_waitpid, so the parent address space is left intact. */ #include "spawn.h" static int k_syscall_spawn(const char *path, const c`

**Macros:**
- `KFD_MAX` (line 52) `#define KFD_MAX`
- `MINIOS_SYSCALL_BASE` (line 243) `#define MINIOS_SYSCALL_BASE`
- `MINIOS_SYSCALL_COUNT` (line 244) `#define MINIOS_SYSCALL_COUNT`
- `LINUX_DT_DIR` (line 947) `#define LINUX_DT_DIR`
- `LINUX_DT_REG` (line 948) `#define LINUX_DT_REG`
- `GETDENTS64_NAME_OFF` (line 949) `#define GETDENTS64_NAME_OFF`
- `GETDENTS64_ALIGN` (line 950) `#define GETDENTS64_ALIGN`
- `SYSCALL_TRACE` (line 1231) `#define SYSCALL_TRACE`
- `SYS_NOISY_TIME` (line 1251) `#define SYS_NOISY_TIME`
- `SYS_NOISY_KBD` (line 1252) `#define SYS_NOISY_KBD`
- `SYS_NOISY_MOUSE` (line 1253) `#define SYS_NOISY_MOUSE`
- `SYS_NOISY_GETC_RAW` (line 1254) `#define SYS_NOISY_GETC_RAW`
- `LINUX_AT_FDCWD` (line 1468) `#define LINUX_AT_FDCWD`
- `LINUX_O_RDONLY` (line 1503) `#define LINUX_O_RDONLY`
- `LINUX_O_WRONLY` (line 1504) `#define LINUX_O_WRONLY`
- `LINUX_O_RDWR` (line 1505) `#define LINUX_O_RDWR`
- `LINUX_O_APPEND` (line 1506) `#define LINUX_O_APPEND`
- `LINUX_O_NONBLOCK` (line 1507) `#define LINUX_O_NONBLOCK`
- `LINUX_O_DIRECT` (line 1508) `#define LINUX_O_DIRECT`
- `LINUX_O_CLOEXEC` (line 1509) `#define LINUX_O_CLOEXEC`
- `LINUX_FD_CLOEXEC` (line 1510) `#define LINUX_FD_CLOEXEC`
- `LINUX_F_DUPFD` (line 1511) `#define LINUX_F_DUPFD`
- `LINUX_F_GETFD` (line 1512) `#define LINUX_F_GETFD`
- `LINUX_F_SETFD` (line 1513) `#define LINUX_F_SETFD`
- `LINUX_F_GETFL` (line 1514) `#define LINUX_F_GETFL`
- `LINUX_F_SETFL` (line 1515) `#define LINUX_F_SETFL`
- `LINUX_F_DUPFD_CLOEXEC` (line 1516) `#define LINUX_F_DUPFD_CLOEXEC`
- `LINUX_CLOSE_RANGE_UNSHARE` (line 1517) `#define LINUX_CLOSE_RANGE_UNSHARE`
- `LINUX_CLOSE_RANGE_CLOEXEC` (line 1518) `#define LINUX_CLOSE_RANGE_CLOEXEC`
- `LINUX_EFD_SEMAPHORE` (line 1519) `#define LINUX_EFD_SEMAPHORE`
- `LINUX_EFD_NONBLOCK` (line 1520) `#define LINUX_EFD_NONBLOCK`
- `LINUX_EFD_CLOEXEC` (line 1521) `#define LINUX_EFD_CLOEXEC`
- `LINUX_EVENTFD_WORD` (line 1522) `#define LINUX_EVENTFD_WORD`
- `FD_STD_COUNT` (line 1523) `#define FD_STD_COUNT`
- `LINUX_MAP_SHARED` (line 1965) `#define LINUX_MAP_SHARED`
- `LINUX_MAP_PRIVATE` (line 1966) `#define LINUX_MAP_PRIVATE`
- `LINUX_MAP_FIXED` (line 1967) `#define LINUX_MAP_FIXED`
- `LINUX_MAP_ANONYMOUS` (line 1968) `#define LINUX_MAP_ANONYMOUS`
- `LINUX_MREMAP_MAYMOVE` (line 2276) `#define LINUX_MREMAP_MAYMOVE`
- `LINUX_MREMAP_FIXED` (line 2277) `#define LINUX_MREMAP_FIXED`
- `LINUX_TCGETS` (line 2603) `#define LINUX_TCGETS`
- `LINUX_TIOCGWINSZ` (line 2604) `#define LINUX_TIOCGWINSZ`
- `LINUX_FIONREAD` (line 2605) `#define LINUX_FIONREAD`
- `LINUX_FIONBIO` (line 2606) `#define LINUX_FIONBIO`
- `LINUX_FIONCLEX` (line 2607) `#define LINUX_FIONCLEX`
- `LINUX_FIOCLEX` (line 2608) `#define LINUX_FIOCLEX`
- `LINUX_TCGETS2` (line 2609) `#define LINUX_TCGETS2`
- `LINUX_ENOTTY` (line 2610) `#define LINUX_ENOTTY`
- `LINUX_WINSIZE_LEN` (line 2611) `#define LINUX_WINSIZE_LEN`
- `LINUX_TERMIOS_LEN` (line 2612) `#define LINUX_TERMIOS_LEN`
- `LINUX_TERMIOS2_LEN` (line 2613) `#define LINUX_TERMIOS2_LEN`
- `LINUX_IOCTL_INT` (line 2614) `#define LINUX_IOCTL_INT`
- `LINUX_RLIMIT_CPU` (line 2738) `#define LINUX_RLIMIT_CPU`
- `LINUX_RLIMIT_STACK` (line 2739) `#define LINUX_RLIMIT_STACK`
- `LINUX_RLIMIT_NOFILE` (line 2740) `#define LINUX_RLIMIT_NOFILE`
- `LINUX_RLIMIT_AS` (line 2741) `#define LINUX_RLIMIT_AS`
- `LINUX_RLIMIT_NLIMITS` (line 2742) `#define LINUX_RLIMIT_NLIMITS`
- `LINUX_RLIM_INFINITY` (line 2743) `#define LINUX_RLIM_INFINITY`
- `LINUX_RLIMIT_PAIR` (line 2744) `#define LINUX_RLIMIT_PAIR`
- `LINUX_RLIMIT_TICKS_PER_S` (line 2746) `#define LINUX_RLIMIT_TICKS_PER_S`
- `LINUX_CPUMASK_BYTES` (line 2747) `#define LINUX_CPUMASK_BYTES`
- `LINUX_CLOCK_REALTIME` (line 2812) `#define LINUX_CLOCK_REALTIME`
- `LINUX_CLOCK_MONOTONIC` (line 2813) `#define LINUX_CLOCK_MONOTONIC`
- `LINUX_CLOCK_BOOTTIME` (line 2814) `#define LINUX_CLOCK_BOOTTIME`
- `LINUX_TIMER_ABSTIME` (line 2815) `#define LINUX_TIMER_ABSTIME`
- `LINUX_NS_PER_US` (line 2816) `#define LINUX_NS_PER_US`
- `LINUX_US_PER_S` (line 2817) `#define LINUX_US_PER_S`
- `LINUX_NS_PER_S` (line 2818) `#define LINUX_NS_PER_S`
- `LINUX_SLEEP_MAX_S` (line 2819) `#define LINUX_SLEEP_MAX_S`
- `SELECT_NFDS_MAX` (line 2935) `#define SELECT_NFDS_MAX`
- `SELECT_TIMEVAL_BYTES` (line 2936) `#define SELECT_TIMEVAL_BYTES`
- `SELECT_TIMESPEC_BYTES` (line 2937) `#define SELECT_TIMESPEC_BYTES`
- `SELECT_TIMEOUT_MS_MAX` (line 2940) `#define SELECT_TIMEOUT_MS_MAX`
- `PROC_SELF_EXE` (line 3096) `#define PROC_SELF_EXE`
- `LINUX_UID_GID_ROOT` (line 3231) `#define LINUX_UID_GID_ROOT`
- `LINUX_SYSCALL_COUNT` (line 3368) `#define LINUX_SYSCALL_COUNT`
- `SC_EXTRA_COUNT` (line 3471) `#define SC_EXTRA_COUNT`
- `TRACE_HINT_NONE` (line 3493) `#define TRACE_HINT_NONE`
- `TRACE_HINT_PATH` (line 3494) `#define TRACE_HINT_PATH`
- `SC_RECORD_LEN` (line 3532) `#define SC_RECORD_LEN`

**Structs:**
- `kiovec` (line 1229)
- `sc_extra_name` (line 3455) - *strace-style name resolver: Linux table first, then the MiniOS window, then the out-of-table Linux numbers the dispatcher answers (openat, newfstatat, clock_gettime, ...). The tail is a data table, not a switch: a `case N:` ladder would trip tools/check_abi_numbers.py (its CASE_RE parses every `case N:` in this file as a dispatch site) and forces a comment per number to satisfy Rule C. Unknown numbers stay numeric so a * new stub never prints a wrong name.*
- `sc_record` (line 3533) - *Syscall flight recorder: each process's last SC_RECORD_LEN syscalls (number, first three arguments, result), written on every call with no I/O so it never perturbs timing the way tracing does. Per process, so a busy poll loop elsewhere cannot flush a dying worker's history; kept after exit until the slot is reused. The exception dump prints the * faulting process's log and `sclog <pid>` any process's. Heap-owned. define SC_RECORD_LEN 32*
- `sc_log` (line 3534)
- `minios_syscall_entry_t` (line 238)

**Variables:**
- `gfx_zoom_2x` (line 422) `extern int gfx_zoom_2x;`
- `gfx_win_title` (line 703) `extern const char *gfx_win_title;`

#### `syscalls_proc.c`
**Path:** `kernel/syscalls_proc.c`
**File Doc:** *syscalls_proc.c - Process-management syscall handlers.*

**Functions:**
- `sys_minios_clone` (line 18) `long sys_minios_clone(long flags, long newsp, long a3, long a4, long a5, long a6)`
- `sys_minios_thread_spawn` (line 24) `long sys_minios_thread_spawn(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_minios_seccomp` (line 37) `long sys_minios_seccomp(long a1, long a2, long a3, long a4, long a5, long a6)` - *Seccomp-basic (238): a1 = op (1 deny-one, 2 allow-one, 3 deny-all), a2 = syscall number (ops 1-2). Applies to current_pid only; the * 200..231 window is filterable, Linux numbers never are.*
- `sys_minios_nice` (line 53) `long sys_minios_nice(long a1, long a2, long a3, long a4, long a5, long a6)` - *int pid = current_pid; if (a1 == SECCOMP_OP_DENY_ONE) return seccomp_deny_one(pid, (int)a2); if (a1 == SECCOMP_OP_ALLOW_ONE) return seccomp_allow_one(pid, (int)a2); if (a1 == SECCOMP_OP_DENY_ALL) { int n; if (pid < 0 || pid >= MAX_PROCS) return -1; if (procs[pid].state == PROC_FREE) return -1; for (n = SECCOMP_MIN; n <= SECCOMP_MAX; n++) procs[pid].seccomp_deny |= SECCOMP_BIT(n); return 0; } return -22; } /* Nice (239): a1 = new nice when a2 != 0, else query. Clamped NICE_MIN..NICE_MAX.*
- `sys_linux_yield` (line 66) `long sys_linux_yield(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_getpid` (line 75) `long sys_linux_getpid(long a1, long a2, long a3, long a4, long a5, long a6)` - *getpid answers the thread group: a CLONE_THREAD member reports its leader, a process its own pid. The pid-0 exec frame (a foreground `run`) and threads it created keep answering 1, the value programs saw before * there were real pids.*
- `sys_linux_clone` (line 83) `long sys_linux_clone(long a1, long a2, long a3, long a4, long a5, long a6)` - *getpid answers the thread group: a CLONE_THREAD member reports its leader, a process its own pid. The pid-0 exec frame (a foreground `run`) and threads it created keep answering 1, the value programs saw before * there were real pids. long sys_linux_getpid(long a1, long a2, long a3, long a4, long a5, long a6) { proc_t *p = proc_get(current_pid); (void)a1; (void)a2; (void)a3; (void)a4; (void)a5; (void)a6; if (p && p->autoreap) return p->tgid > 0 ? p->tgid : 1; return current_pid > 0 ? current_pid : 1; } /* Linux clone(2): (flags, newsp, parent_tid, child_tid, tls).*
- `sys_linux_fork` (line 89) `long sys_linux_fork(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_vfork` (line 94) `long sys_linux_vfork(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_execve` (line 99) `long sys_linux_execve(long a1, long a2, long a3, long a4, long a5, long a6)`
- `sys_linux_exit` (line 184) `long sys_linux_exit(long a1, long a2, long a3, long a4, long a5, long a6)`
- `kill` (line 192) `* historic kill (SIGKILL), -N is signal N (a seccomp kill is -SIGSYS). */
#define LINUX_WNOHANG  ...`
- `groups` (line 213) `* groups (pid 0 and < -1) are not modelled and wait for any child. */
long sys_linux_wait4(long a...`
- `sys_linux_kill` (line 248) `long sys_linux_kill(long a1, long a2, long a3, long a4, long a5, long a6)` - *kill(pid, sig): sig 0 only probes that pid exists; a fatal signal ends the target as killed by sig (wait4 reports WTERMSIG); any other signal is delivered to its default action, ignore. Process groups (pid <= 0) * are not modelled.*
- `sys_linux_gettid` (line 259) `long sys_linux_gettid(long a1, long a2, long a3, long a4, long a5, long a6)`
- `state` (line 5) `* touches only scheduler state (current_pid, procs[], do_* / * seccomp_* / yield) plus the kernel-wide user_range_ok validator, so * this TU includes only kernel.h and sched.h. The dispatch tables in `
- `sig` (line 245) `* the target as killed by sig (wait4 reports WTERMSIG);`

**Macros:**
- `LINUX_WNOHANG` (line 193) `#define LINUX_WNOHANG`
- `LINUX_SIGKILL` (line 194) `#define LINUX_SIGKILL`
- `LINUX_STATUS_SHIFT` (line 195) `#define LINUX_STATUS_SHIFT`
- `LINUX_STATUS_CODE` (line 196) `#define LINUX_STATUS_CODE`
- `LINUX_ECHILD` (line 197) `#define LINUX_ECHILD`
- `LINUX_EINVAL` (line 198) `#define LINUX_EINVAL`
- `LINUX_ESRCH` (line 199) `#define LINUX_ESRCH`

#### `tick.c`
**Path:** `kernel/tick.c`
**File Doc:** *Docstring: Tick listener bus implementation.*

**Functions:**
- `tick_reset` (line 34) `void tick_reset(void)` - */** Docstring: Audio listener table. static tick_slot_t tick_audio_slots[TICK_MAX_AUDIO_LISTENERS]; /** Docstring: Desktop listener table. static tick_slot_t tick_desktop_slots[TICK_MAX_DESKTOP_LISTENERS]; /** Docstring: USB listener table. static tick_slot_t tick_usb_slots[TICK_MAX_USB_LISTENERS]; /** Docstring: Active audio listener count. static int tick_audio_used; /** Docstring: Active desktop listener count. static int tick_desktop_used; /** Docstring: Active USB listener count. static int tick_usb_used; /** Docstring: Reset every listener list to empty.*
- `tick_register_audio` (line 58) `int tick_register_audio(tick_fn_t fn, void *ctx)` - *Docstring: Register an unconditional BSP audio effect.  Returns 0 on success, -1 when the handler is null or the audio table is full. A refusal changes nothing.*
- `tick_register_desktop` (line 76) `int tick_register_desktop(tick_fn_t fn, void *ctx)` - *Docstring: Register a gated desktop effect.  Returns 0 on success, -1 when the handler is null or the desktop table is full. A refusal changes nothing.*
- `tick_register_usb` (line 89) `int tick_register_usb(tick_fn_t fn, void *ctx)`
- `tick_run_usb` (line 103) `void tick_run_usb(void)` - *int tick_register_usb(tick_fn_t fn, void *ctx) { if (fn == NULL) { return -1; } if (tick_usb_used < 0 || tick_usb_used >= TICK_MAX_USB_LISTENERS) { return -1; } tick_usb_slots[tick_usb_used].fn = fn; tick_usb_slots[tick_usb_used].ctx = ctx; tick_usb_used++; return 0; } /** Docstring: Run USB listeners in registration order.*
- `tick_run_audio` (line 113) `void tick_run_audio(void)` - *return 0; } /** Docstring: Run USB listeners in registration order. void tick_run_usb(void) { int i; for (i = 0; i < tick_usb_used; i++) { if (tick_usb_slots[i].fn != NULL) { tick_usb_slots[i].fn(tick_usb_slots[i].ctx); } } } /** Docstring: Run audio listeners in registration order.*
- `tick_run_desktop` (line 123) `void tick_run_desktop(void)` - *} } /** Docstring: Run audio listeners in registration order. void tick_run_audio(void) { int i; for (i = 0; i < tick_audio_used; i++) { if (tick_audio_slots[i].fn != NULL) { tick_audio_slots[i].fn(tick_audio_slots[i].ctx); } } } /** Docstring: Run desktop listeners in registration order.*
- `tick_audio_count` (line 133) `int tick_audio_count(void)` - *} } /** Docstring: Run desktop listeners in registration order. void tick_run_desktop(void) { int i; for (i = 0; i < tick_desktop_used; i++) { if (tick_desktop_slots[i].fn != NULL) { tick_desktop_slots[i].fn(tick_desktop_slots[i].ctx); } } } /** Docstring: Count registered audio listeners.*
- `tick_desktop_count` (line 144) `int tick_desktop_count(void)` - *} /** Docstring: Count registered audio listeners. int tick_audio_count(void) { if (tick_audio_used < 0) { return 0; } if (tick_audio_used > TICK_MAX_AUDIO_LISTENERS) { return TICK_MAX_AUDIO_LISTENERS; } return tick_audio_used; } /** Docstring: Count registered desktop listeners.*
- `tick_desktop_due` (line 160) `int tick_desktop_due(unsigned long long ticks, unsigned interval)` - *Docstring: Pure desktop gating predicate.  Returns nonzero when the given tick count falls on a desktop tick for the given interval. A non-positive interval never fires. Holds for every tick value including zero.*

**Structs:**
- `tick_slot_t` (line 15) - *Docstring: Tick listener bus implementation.  Owns two fixed listener tables behind the tick.h contract. Tables are static storage, cleared by tick_reset, appended by the register calls and read by the run calls. No allocation, no locks, no user pointers. Registration is boot-time only; dispatch is ISR-safe because it only reads entries written before sti.  #include "tick.h" #include <stddef.h> /** Docstring: Single registered listener slot.*

#### `time.c`
**Path:** `kernel/time.c`
**File Doc:** *================================================================*

**Functions:**
- `ktime_rdtsc` (line 13) `static unsigned long ktime_rdtsc(void)`
- `ktime_init` (line 19) `static void ktime_init(void)`
- `ktime_ms` (line 33) `unsigned long ktime_ms(void)`
- `ktime_us` (line 41) `unsigned long ktime_us(void)` - *Microsecond resolution over the same calibrated ratio (Phase 0.2/0.3: clock_gettime nsec and gettimeofday usec both derive from here, so the * two clocks share one source and never disagree about ordering).*

#### `vga_cursor.c`
**Path:** `kernel/vga_cursor.c`
**File Doc:** *Docstring: Hardware pointer sprite layer (kernel/vga_cursor.c).*

**Functions:**
- `cursor_save_bg` (line 40) `static void cursor_save_bg(int mx, int my)` - *The cursor is drawn with its top-left corner at (mx, my), so the sprite spans down-right of the pointer. The caller clamps mx/my so the position stays inside the framebuffer; pixels outside the screen are clipped by the packed helpers, and the snapshot holds packed RGB so a restore is exact in * any color depth.*
- `cursor_is_set` (line 50) `static int cursor_is_set(int i, int j)` - *spans down-right of the pointer. The caller clamps mx/my so the position stays inside the framebuffer; pixels outside the screen are clipped by the packed helpers, and the snapshot holds packed RGB so a restore is exact in * any color depth. static void cursor_save_bg(int mx, int my) { int i, j; int x0 = mx - CURSOR_TIP_X; int y0 = my - CURSOR_TIP_Y; for (j = 0; j < 8; j++) for (i = 0; i < 8; i++) cursor_save[j][i] = fb_read_packed(x0 + i, y0 + j); } /** Docstring: True when the arrow bitmap sets pixel i,j.*
- `cursor_has_set_neighbour` (line 57) `static int cursor_has_set_neighbour(int i, int j)` - *int y0 = my - CURSOR_TIP_Y; for (j = 0; j < 8; j++) for (i = 0; i < 8; i++) cursor_save[j][i] = fb_read_packed(x0 + i, y0 + j); } /** Docstring: True when the arrow bitmap sets pixel i,j. static int cursor_is_set(int i, int j) { if (i < 0 || i >= 8 || j < 0 || j >= 8) return 0; return (cursor_bmp[j] & (0x80 >> i)) ? 1 : 0; } /** Docstring: True when an 8-neighbour of i,j belongs to the arrow.*
- `cursor_draw` (line 68) `static void cursor_draw(int mx, int my)`
- `cursor_restore` (line 81) `static void cursor_restore(int mx, int my)`
- `cursor_over` (line 96) `int cursor_over(int x0, int y0, int w, int h)` - *Docstring: True when the cursor sprite overlaps the given screen rectangle. Used to decide whether a partial repaint overwrote the cursor, in which case its saved background must be refreshed; otherwise the cursor keeps its saved background and moves without leaving a trail. The sprite is CURSOR_W x CURSOR_H with its top-left corner at * (mx, my).*
- `cursor_place` (line 106) `void cursor_place(int mx, int my)` - *Docstring: Paint the pointer at mx/my unconditionally: save the * background, draw the sprite, record the position.*
- `cursor_move` (line 116) `void cursor_move(int mx, int my)` - *Docstring: Desktop-tick pointer update: repaint only when the position * moved since the last paint, otherwise keep the saved background.*
- `cursor_erase` (line 133) `void cursor_erase(void)` - *Docstring: Restore the saved background when the pointer is up, then mark it hidden. A repaint that covered the sprite calls * cursor_invalidate instead: the background is gone, nothing to restore.*
- `cursor_invalidate` (line 141) `void cursor_invalidate(void)` - *Docstring: Mark the pointer hidden without touching the framebuffer. * Used after any repaint that may have covered the sprite.*
- `cursor_note_repaint` (line 147) `void cursor_note_repaint(int x0, int y0, int w, int h)` - *Docstring: Invalidate the pointer when it overlaps a repainted screen * rectangle, so the next move re-saves a fresh background.*

**Macros:**
- `CURSOR_TIP_X` (line 28) `#define CURSOR_TIP_X`
- `CURSOR_TIP_Y` (line 29) `#define CURSOR_TIP_Y`

#### `vga_fb.c`
**Path:** `kernel/vga_fb.c`

**Functions:**
- `wm_geom_cfg` (line 49) `static wm_geom_config_t wm_geom_cfg(void)` - */** Docstring: Focus ids share one space across terminals and graphics. _Static_assert(WM_FOCUS_GFX == WM_WINDOW_GFX_ID, "gfx focus id drifted from unified window contract"); /** Docstring: File-scope drag state shared by the tick and focus paths. static int wm_dragging; static int wm_grab_cx; static int wm_skip_drag; static int wm_gdrag; static int wm_ggx; static int wm_ggy; /** Docstring: Geometry config derived once from the font layout.*
- `wm_event_cfg` (line 60) `static wm_event_config_t wm_event_cfg(void)` - *static int wm_ggy; /** Docstring: Geometry config derived once from the font layout. static wm_geom_config_t wm_geom_cfg(void) { wm_geom_config_t cfg; cfg.font_w = FONT_W; cfg.font_h = FONT_H; cfg.scrollbar_w = SCROLLBAR_W; cfg.title_h = FONT_H; return cfg; } /** Docstring: Event config for the PS/2 mouse button mask.*
- `wm_drag_reset` (line 69) `static void wm_drag_reset(void)` - *cfg.title_h = FONT_H; return cfg; } /** Docstring: Event config for the PS/2 mouse button mask. static wm_event_config_t wm_event_cfg(void) { wm_event_config_t cfg; cfg.left_mask = 1; cfg.wheel_step = 3; return cfg; } /** Docstring: Reset terminal and graphics drag grabs on focus change.*
- `vga_fb_boot_config` (line 90) `void vga_fb_boot_config(void)`
- `fb_bytes_per_pixel` (line 117) `int fb_bytes_per_pixel(void)`
- `fb_copy_bytes` (line 151) `static void fb_copy_bytes(volatile void *dst, const volatile void *src, unsigned long n)` - *Docstring: Bulk copy through the string engine: quadwords first (rep movsq, an eighth of the iterations, which is what matters under an emulator that runs every string iteration as its own step), then * the byte tail. Source and destination never overlap here.*
- `fb_fill_u32` (line 169) `static void fb_fill_u32(volatile void *dst, unsigned int v, unsigned long n)` - *Docstring: Fill n 32-bit words with one value: pairs as quadwords * (rep stosq), then the odd word.*
- `fb_frame_bytes` (line 183) `static unsigned long fb_frame_bytes(void)` - *static void fb_fill_u32(volatile void *dst, unsigned int v, unsigned long n) { void *d = (void *)dst; unsigned long q = n >> 1; unsigned long pat = ((unsigned long)v << 32) | (unsigned long)v; __asm__ volatile("cld; rep stosq" : "+D"(d), "+c"(q) : "a"(pat) : "memory"); if (n & 1UL) (volatile unsigned int *)d = v; } /** Docstring: Bytes one framebuffer frame spans (pitch times height).*
- `fb_shadow_ready` (line 189) `static int fb_shadow_ready(void)` - *: "+D"(d), "+c"(q) : "a"(pat) : "memory"); if (n & 1UL) (volatile unsigned int *)d = v; } /** Docstring: Bytes one framebuffer frame spans (pitch times height). static unsigned long fb_frame_bytes(void) { return (unsigned long)fb_pitch * (unsigned long)fb_height; } /** Docstring: Ensure the shadow exists; 1 when it is usable.*
- `fb_present_shadow` (line 210) `static void fb_present_shadow(void)` - *return 1; } if (fb_shadow) { return 0; } fb_shadow = (uint8_t *)kmalloc(need); if (!fb_shadow) { return 0; } fb_shadow_bytes = need; return 1; } /** Docstring: Copy the whole shadow onto the visible framebuffer.*
- `fb_compose_begin` (line 221) `static int fb_compose_begin(void)` - *Docstring: Enter a composition. Returns 1 for the outermost owner that redirected drawing into the shadow, 0 for a nested or degraded * entry that must not present.*
- `fb_compose_end` (line 234) `static void fb_compose_end(int owner)` - *entry that must not present. static int fb_compose_begin(void) { if (fb_compose_depth++ > 0) { return 0; } if (!fb_shadow_ready()) { return 0; } fb_tgt = fb_shadow; return 1; } /** Docstring: Leave a composition; the owner presents unless held.*
- `lg_get` (line 305) `static const char *lg_get(int i)` - *Docstring: Completed-logical-lines ring, heap-owned since the .bss diet (256 x TERM_MAX_COLS). Null until vga_fb_init owns it; pushes before then are dropped and reads see an empty ring, so early boot * text still reaches the screen and serial without a scrollback entry. static char (*lg)[SB_LINE_MAX] = 0; #define LG_LINE(a) (lg[(a) % SB_MAX_LINES]) static int  lg_head, lg_tail, lg_count; static char act[SB_LINE_MAX];                /* in-progress line static int  act_len; static int  disp_off;                        /* scrollback rows above the bottom static int  term_cursor_col = -1;            /* text cursor column (-1 = hidden) static int  csi_state;                       /* ANSI CSI drop: 1 after ESC, 2 in params /* Ring accessor: logical line at age i (0 = oldest, count-1 = newest).*
- `lg_push` (line 312) `static void lg_push(const char *line, int len)` - *Append a completed logical line to the ring. The line is stored whole (no * width-dependent wrap), so it can be re-wrapped on any future resize.*
- `lg_alloc` (line 333) `static void lg_alloc(void)`
- `vga_fb_term_ring_init` (line 349) `void vga_fb_term_ring_init(void)` - *Docstring: Create the terminal history ring. Called once the heap is up, before the boot banner is printed, so the text-mode console has * somewhere to put the boot log.*
- `vga_fb_term_feed` (line 357) `void vga_fb_term_feed(const char *line, int len)` - *Docstring: Feed one completed console line into the terminal history. The text-mode console (the boot log, before the desktop comes up) has no other history, and the desktop terminal owns the ring afterwards, so the * ring is the one place both halves land.*
- `line_nrows` (line 364) `static int line_nrows(int len)` - *Docstring: Feed one completed console line into the terminal history. The text-mode console (the boot log, before the desktop comes up) has no other history, and the desktop terminal owns the ring afterwards, so the * ring is the one place both halves land. void vga_fb_term_feed(const char *line, int len) { if (!line || len <= 0) return; if (!lg_ready) return; lg_push(line, len); } /* Display rows a logical line of `len` characters occupies at term_cols.*
- `act_nrows` (line 371) `static int act_nrows(void)`
- `total_rows` (line 374) `static int total_rows(void)` - *lg_push(line, len); } /* Display rows a logical line of `len` characters occupies at term_cols. static int line_nrows(int len) { int w = term_cols > 0 ? term_cols : 1; int n = len / w + (len % w ? 1 : 0); if (n < 1) n = 1;   /* an empty line still shows as one row return n; } static int act_nrows(void) { return line_nrows(act_len); } /* Total display rows of the whole history (completed lines + active line).*
- `disp_clamp` (line 382) `static void disp_clamp(void)` - *return n; } static int act_nrows(void) { return line_nrows(act_len); } /* Total display rows of the whole history (completed lines + active line). static int total_rows(void) { int t = 0, i; for (i = 0; i < lg_count; i++) t += line_nrows((int)kstrlen(lg_get(i))); return t + act_nrows(); } /* Clamp disp_off to a legal scroll range.*
- `line_at` (line 400) `static const char *line_at(int abs, int *off)` - *Locate the logical line contributing the display row `abs`, and set *off to the character offset where that display row starts. Returns the line text, * or 0 when abs is beyond the history.*
- `first` (line 456) `* screen ever showing it whole first (the old flash-then-melt). */
static unsigned int *fx_start_...`
- `gfx_view_cfg` (line 572) `static wm_gfxview_config_t gfx_view_cfg(void)` - *Handshake between the present path and the desktop tick, the two painters of the graphics-mode pointer. A present announces itself and waits out a tick that is mid-paint; the tick announces itself and backs off when a present is running. Both sides are sequentially consistent, so at most one of them ever touches the sprite. The tick runs in the timer interrupt and never waits, so a present interrupted on its own * CPU cannot deadlock it. static volatile int gfx_presenting; static volatile int gfx_cursor_following; static volatile unsigned long gfx_last_present; /** Docstring: View configuration shared by every graphics path.*
- `gfx_covers_screen` (line 581) `static int gfx_covers_screen(void)` - *Docstring: 1 while a visible fullscreen graphics window owns every * pixel: the terminals, taskbar and dock must not paint through it.*
- `gfx_keep_save` (line 587) `static void gfx_keep_save(const volatile uint8_t *src, int kind, int sw, int sh)` - *Docstring: 1 while a visible fullscreen graphics window owns every * pixel: the terminals, taskbar and dock must not paint through it. static int gfx_covers_screen(void) { return vga_fb_gfx_mode && !gfx_hidden && gfx_view_mode == WM_GFXVIEW_FULL; } /** Docstring: Copy the presented source into the persistent layer.*
- `vga_fb_set_gfx_program` (line 613) `void vga_fb_set_gfx_program(const char *name)`
- `shcmd_base` (line 632) `static void shcmd_base(const char *cmd, char *out, unsigned long cap)` - *Basename of a shortcut command's program: first token after an optional `run`, then past the last '/'. "run quake2generic.elf +set basedir ." -> * "quake2generic.elf"; "nuklear" -> "nuklear".*
- `ci_eq` (line 649) `static int ci_eq(const char *a, const char *b)`
- `gfx_prog_icon` (line 662) `static const uint8_t *gfx_prog_icon(void)` - *Icon of the running program via the shortcuts config: whoever composited * last, resolved through its launch command. Zero hardcoded names.*
- `vga_fb_set_gfx_mode` (line 675) `void vga_fb_set_gfx_mode(int on)`
- `gfx_view_for` (line 726) `static int gfx_view_for(int sw, int sh, wm_gfxview_t *v)` - *Docstring: Compute the view for a sw x sh source under the current mode. A tiled mode without a usable cell, or any degenerate result, * falls back to floating so a frame is never dropped for geometry.*
- `gfx_view_publish` (line 738) `static void gfx_view_publish(const wm_gfxview_t *v)` - *mode. A tiled mode without a usable cell, or any degenerate result, * falls back to floating so a frame is never dropped for geometry. static int gfx_view_for(int sw, int sh, wm_gfxview_t *v) { wm_gfxview_config_t cfg = gfx_view_cfg(); int zoom = (gfx_zoom_2x && sw == DOOM_W && sh == DOOM_H) ? 2 : 1; if (wm_gfxview_compute(&cfg, gfx_view_mode, sw, sh, zoom, fb_width, fb_height, &gfx_cell, gfx_win_ox, gfx_win_oy, v)) return 1; return wm_gfxview_compute(&cfg, WM_GFXVIEW_FLOAT, sw, sh, zoom, fb_width, fb_height, &gfx_cell, gfx_win_ox, gfx_win_oy, v); } /** Docstring: Publish a view as the window geometry every reader uses.*
- `gfx_float_frame` (line 752) `static int gfx_float_frame(wm_gfxview_rect_t *out)` - *Docstring: Floating-mode frame of the current source, used by the * snap and drag math, which move the native window, never a tile.*
- `vga_fb_gfx_origin` (line 768) `void vga_fb_gfx_origin(int *x, int *y)` - *Docstring: Content origin of the graphics window (the point an app * subtracts from SYS_MOUSE coordinates), for the present syscalls.*
- `vga_fb_gfx_map_mouse` (line 785) `void vga_fb_gfx_map_mouse(int *x, int *y)` - *Docstring: Map a desktop pointer into the graphics app's back-buffer space when its view is scaled. A 1:1 view is left untouched so native windows keep the exact historical coordinates (including outside the window); a scaled view maps through the inverse transform so the app's * `mouse - origin` lands on the pixel under the arrow.*
- `vga_fb_gfx_cursor_erase` (line 800) `static void vga_fb_gfx_cursor_erase(void)` - *Restore the last composite's pointer before the new frame covers it. Only meaningful in graphics mode; the desktop path (vga_fb_mouse_tick) manages * its own cursor with the same functions.*
- `vga_fb_gfx_cursor_draw` (line 810) `static void vga_fb_gfx_cursor_draw(void)` - *Clamp the mouse into the framebuffer (the idle loop that normally clamps never runs in graphics mode) and draw the pointer at the current position. Over a fullscreen app the arrow hides after GFX_CURSOR_IDLE_TICKS without motion and reappears on the next move, so a game never plays with a * stray pointer parked in the middle of the screen.*
- `wm_focus_cursor_sync` (line 1001) `static void wm_focus_cursor_sync(const wm_notify_event_t *e)` - *char eline[WM_ELINE_SZ]; int epos, has_line; int prompted; } termwin_t; static termwin_t twins[WM_MAX_TERMS]; static int wm_nterms = 1; static int wm_focus; static int wm_term; static int wm_inited; /** Docstring: Single focus event bus owned by the desktop. static wm_notify_bus_t wm_bus; static int wm_bus_ready; /** Docstring: Focus listener clearing a possibly stale cursor sprite.*
- `wm_emit_focus_moved` (line 1008) `static void wm_emit_focus_moved(int before, int source)` - *static int wm_term; static int wm_inited; /** Docstring: Single focus event bus owned by the desktop. static wm_notify_bus_t wm_bus; static int wm_bus_ready; /** Docstring: Focus listener clearing a possibly stale cursor sprite. static void wm_focus_cursor_sync(const wm_notify_event_t *e) { (void)e; cursor_invalidate(); } /** Docstring: Emit one focus event when the id actually moved.*
- `vga_fb_focus_event` (line 1020) `const wm_notify_event_t *vga_fb_focus_event(void)` - */** Docstring: Emit one focus event when the id actually moved. static void wm_emit_focus_moved(int before, int source) { wm_notify_event_t e; if (before == wm_focus) return; e.type = WM_NOTIFY_FOCUS; e.old_focus = before; e.new_focus = wm_focus; e.source = source; wm_notify_emit(&wm_bus, &e); } /** Docstring: Last focus event for serial-observable state.*
- `vga_fb_focus_report` (line 1026) `void vga_fb_focus_report(int before, int source)` - *e.type = WM_NOTIFY_FOCUS; e.old_focus = before; e.new_focus = wm_focus; e.source = source; wm_notify_emit(&wm_bus, &e); } /** Docstring: Last focus event for serial-observable state. const wm_notify_event_t *vga_fb_focus_event(void) { return wm_notify_last(&wm_bus); } /** Docstring: Record a programmatic focus move from another unit.*
- `tw_park` (line 1035) `static void tw_park(int i)`
- `tw_unpark` (line 1065) `static void tw_unpark(int i)`
- `wm_init_once` (line 1100) `static void wm_init_once(void)`
- `tw_select` (line 1125) `static void tw_select(int i)` - *twins[k].has_line = 0; twins[k].eline[0] = '\0'; twins[k].epos = 0; twins[k].prompted = 0; } twins[0].lg = lg; if (!wm_bus_ready) { wm_bus_ready = 1; wm_notify_reset(&wm_bus); wm_notify_subscribe(&wm_bus, wm_focus_cursor_sync); } } /** Docstring: Select window i and drop any in-flight drag grab.*
- `vga_fb_focus_get` (line 1137) `int vga_fb_focus_get(void)`
- `vga_fb_nterms_get` (line 1138) `int vga_fb_nterms_get(void)`
- `wm_snapshot_state` (line 1141) `static void wm_snapshot_state(wm_focus_state_t *st)` - *if (!twins[i].present) return; if (shell_readline_active()) shell_focus_park(); tw_park(wm_term); wm_focus = i; wm_term = i; tw_unpark(i); wm_drag_reset(); if (shell_readline_active()) shell_focus_restore(); } int vga_fb_focus_get(void) { return wm_focus; } int vga_fb_nterms_get(void) { return wm_nterms; } /** Docstring: Single snapshot of every window for focus decisions.*
- `vga_fb_focus_next` (line 1154) `void vga_fb_focus_next(void)` - */** Docstring: Single snapshot of every window for focus decisions. static void wm_snapshot_state(wm_focus_state_t *st) { int i; wm_init_once(); st->focus = wm_focus; st->nterms = wm_nterms; st->gfx_active = vga_fb_gfx_mode ? 1 : 0; for (i = 0; i < 4; i++) st->present[i] = 0; for (i = 0; i < wm_nterms && i < 4; i++) st->present[i] = twins[i].present ? 1 : 0; } /** Docstring: Cycle focus across terminals plus graphics when active.*
- `wm_gfx_focus_sync` (line 1200) `static void wm_gfx_focus_sync(int on)` - *Docstring: Route WM focus with the graphics mode switch.  A program that enables the display owns the keyboard: without this, a gfx child spawned from another gfx app (file -> vedit) keeps the terminal focused, so its keys and wheel keep landing on the shell while the app looks hung. The enable arm mirrors the focus-gfx path (park shell line, flush stale raw bytes); the disable arm hands the * terminal back silently, never with the Alt-Tab nag.*
- `vga_fb_focus_id` (line 1219) `int vga_fb_focus_id(int id)` - *tw_park(wm_term); wm_focus = WM_FOCUS_GFX; kbd_raw_flush(); wm_emit_focus_moved(before, WM_FOCUS_SRC_MODE); } } else { if (wm_focus == WM_FOCUS_GFX) { tw_select(wm_term); wm_emit_focus_moved(before, WM_FOCUS_SRC_MODE); } } } /** Docstring: Focus window id directly, fail closed on invalid id.*
- `vga_fb_boot_history_to_active` (line 1254) `static void vga_fb_boot_history_to_active(void)` - *Docstring: Copy the boot-time history into the terminal that owns the screen after the desktop comes up. The boot log is printed in text mode, before the second window exists, so it lives in the first window's ring; the shell runs in the other one, and the page keys must reach the boot * banner from there.*
- `content` (line 1269) `* windows would share content (same prompt/output on both) and a park
 * would alias src == dst. ...`
- `vga_fb_layout_set` (line 1354) `int vga_fb_layout_set(int mode)` - *twins[1].lg = 0; twins[1].present = 0; twins[1].has_line = 0; twins[1].eline[0] = '\0'; twins[1].epos = 0; twins[1].prompted = 0; wm_nterms = 1; vga_fb_reset_default(); fx_finish_full(fx_old); return 1; } /** Docstring: Tile terminals through the tiling contract, graphics right. /** Docstring: Set active layout mode, fail closed on bad mode.*
- `vga_fb_layout_cycle` (line 1365) `void vga_fb_layout_cycle(void)` - */** Docstring: Tile terminals through the tiling contract, graphics right. /** Docstring: Set active layout mode, fail closed on bad mode. int vga_fb_layout_set(int mode) { if (!wm_layout_mode_valid(mode)) { return -1; } wm_layout_mode = mode; wm_last_n = -1; return 0; } /** Docstring: Cycle layout mode tile bsp cascade fibonacci.*
- `vga_fb_layout_get` (line 1381) `int vga_fb_layout_get(void)` - *if (wm_layout_mode == WM_LAYOUT_TILE) { wm_layout_mode = WM_LAYOUT_BSP; } else if (wm_layout_mode == WM_LAYOUT_BSP) { wm_layout_mode = WM_LAYOUT_CASCADE; } else if (wm_layout_mode == WM_LAYOUT_CASCADE) { wm_layout_mode = WM_LAYOUT_FIBONACCI; } else { wm_layout_mode = WM_LAYOUT_TILE; } wm_last_n = -1; vga_fb_tile_all(); } /** Docstring: Active layout mode id.*
- `vga_fb_layout_name` (line 1387) `const char *vga_fb_layout_name(void)` - *} else { wm_layout_mode = WM_LAYOUT_TILE; } wm_last_n = -1; vga_fb_tile_all(); } /** Docstring: Active layout mode id. int vga_fb_layout_get(void) { return wm_layout_mode; } /** Docstring: Active layout mode name, never null.*
- `alone` (line 1399) `* window alone (an unfocused graphics window minimizes to the taskbar,
 * exactly like the hidden...`
- `vga_fb_list_windows` (line 1526) `void vga_fb_list_windows(void)`
- `vga_fb_act_empty` (line 1584) `int vga_fb_act_empty(void)` - *vn ? vn : "floating", gfx_view_valid ? gfx_view.content.x : gfx_win_x, gfx_view_valid ? gfx_view.content.y : gfx_win_y, gfx_view_valid ? gfx_view.content.w : 0, gfx_view_valid ? gfx_view.content.h : 0); serial_puts(b); taskbar_layout(); ksprintf(b, "win gfxbtn x=%d w=%d %s\n", tb_gfx_x, tb_gfx_w, gfx_task_icon() ? "icon" : "text"); serial_puts(b); } } /* 1 when the focused window's active line is empty (fresh prompt spot).*
- `vga_fb_note_prompt` (line 1588) `void vga_fb_note_prompt(void)` - *The shell loop calls note after printing a prompt (it is live in the * focused window) and clear once the line is submitted for execution.*
- `vga_fb_clear_prompt` (line 1593) `void vga_fb_clear_prompt(void)`
- `vga_fb_prompted` (line 1598) `int vga_fb_prompted(void)`
- `vga_fb_prompt_live` (line 1607) `int vga_fb_prompt_live(void)` - *1 when the active line is empty or holds exactly a fresh prompt, so printing another one would stack duplicate `miniOS> ` lines on every * refocus. Compares the whole line, not a prefix.*
- `vga_fb_park_line` (line 1614) `void vga_fb_park_line(const char *b, int p)` - *1 when the active line is empty or holds exactly a fresh prompt, so printing another one would stack duplicate `miniOS> ` lines on every * refocus. Compares the whole line, not a prefix. int vga_fb_prompt_live(void) { if (act_len == 0) return 1; if (kstrcmp(act, "miniOS> ") == 0) return 1; return 0; } /* Park the shell's half-typed line into the focused window slot.*
- `vga_fb_unpark_line` (line 1629) `int vga_fb_unpark_line(char *b, int *p)` - *A fresh prompt parks empty: record no line, so `wm list` does not * claim a half-typed command that never existed. t->has_line = (b[0] != '\0' || p > 0) ? 1 : 0; } /* Restore the focused window's parked line. Returns 1 when one existed.*
- `tw_hit` (line 1644) `static int tw_hit(int i, int mx, int my)` - *termwin_t *t; int k; wm_init_once(); if (wm_focus < 0 || wm_focus >= WM_MAX_TERMS) return 0; t = &twins[wm_focus]; if (!t->has_line) return 0; for (k = 0; k < WM_ELINE_SZ - 1 && t->eline[k]; k++) b[k] = t->eline[k]; b[k] = '\0'; p = t->epos; return 1; } /* Hit-test: is (mx,my) inside terminal i's rectangle (title + content)? /** Docstring: True when point hits terminal window i including decorations.*
- `vga_fb_set_gfx_palette` (line 1750) `void vga_fb_set_gfx_palette(const unsigned char *pal)`
- `fb_pack_idx` (line 1765) `static unsigned long fb_pack_idx(unsigned idx)` - *--- True-color pixel layer ---- VBE true-color framebuffers store pixels natively as B,G,R(,X) bytes, so the DAC is bypassed entirely. Every index the desktop draws with resolves here: UI 0-14 through desk_pal, wallpaper 16-231 through the websafe cube, icons 240-255 through icon_pal. Indices with no owner (15, 232-239) are black. Graphics back-buffers never pass through this table; they expand * through gfx_pal at blit time.*
- `fb_write_packed` (line 1781) `void fb_write_packed(int x, int y, unsigned long rgb)`
- `fb_read_packed` (line 1801) `unsigned long fb_read_packed(int x, int y)`
- `vga_fb_read_rgb` (line 1825) `unsigned long vga_fb_read_rgb(int x, int y)`
- `fb_write_row_packed` (line 1830) `void fb_write_row_packed(int x, int y, const unsigned int *src, int n)` - *Docstring: Write n packed pixels (0x00RRGGBB, or raw indices in 8-bit mode) to row y from column x, clipped once. The row fast path the * melt and the snapshot restore use instead of one call per pixel.*
- `fb_read_row_packed` (line 1860) `void fb_read_row_packed(int x, int y, unsigned int *dst, int n)` - *Docstring: Read n packed pixels of row y from column x into dst, * clipped once; pixels outside the screen read as 0.*
- `fb_fill_run` (line 1882) `static void fb_fill_run(int x, int y, int n, unsigned long px)` - *int xx = x + i; if (xx < 0 || xx >= fb_width) continue; if (fb_bpp == 32) { dst[i] = *(volatile unsigned int *)(p + (unsigned)xx * 4u) & 0x00FFFFFFu; } else if (fb_bpp == 24) { const volatile uint8_t *q = p + (unsigned)xx * 3u; dst[i] = (unsigned int)q[0] | ((unsigned int)q[1] << 8) | ((unsigned int)q[2] << 16); } else { dst[i] = p[xx]; } } } /** Docstring: Fill a clipped horizontal run with one packed pixel.*
- `wall_level` (line 1908) `static int wall_level(int v)` - *for (i = 0; i < n; i++) { q[0] = (uint8_t)(px & 0xFF); q[1] = (uint8_t)((px >> 8) & 0xFF); q[2] = (uint8_t)((px >> 16) & 0xFF); q += 3; } } else { volatile uint8_t *q = p + (unsigned)x; for (i = 0; i < n; i++) q[i] = (uint8_t)(px & 0xFF); } } /* Nearest cube level for one 0-255 channel (boundaries at 25/76/127/178/229).*
- `vga_fb_set_palette` (line 1917) `static void vga_fb_set_palette(void)`
- `fb_glyph` (line 1970) `static const uint8_t *fb_glyph(unsigned char c)` - *Resolve one byte to its 8-row glyph: ASCII through font8x8, Spanish Latin-1 through the table above, anything else (including control codes) as a blank. Takes an unsigned value so Latin-1 bytes above 127 survive a * signed-char parameter.*
- `vga_fb_pixel` (line 1991) `void vga_fb_pixel(int x, int y, uint8_t color)` - *case 0xAC: return glyph_notsign; case 0xB4: return glyph_acute; case 0xB7: return glyph_middot; case 0xBA: return glyph_ord_masc; case 0xBF: return glyph_inv_quest; case 0xC7: return glyph_Ccedil; case 0xD1: return glyph_Ntilde; case 0xE7: return glyph_ccedil; case 0xF1: return glyph_ntilde; default: return font8x8[0]; } } /* ---- Drawing primitives ----*
- `vga_fb_clear` (line 2001) `void vga_fb_clear(void)` - *} } /* ---- Drawing primitives ---- void vga_fb_pixel(int x, int y, uint8_t color) { if (fb_bpp == 8) { if (x >= 0 && x < fb_width && y >= 0 && y < fb_height) FBT[(unsigned)y * (unsigned)fb_pitch + (unsigned)x] = color; return; } fb_write_packed(x, y, fb_pack_idx(color)); } /** Docstring: Clear the render target to black in bulk.*
- `vga_fb_rect` (line 2011) `void vga_fb_rect(int x, int y, int w, int h, uint8_t color)` - *Docstring: Solid rectangle: the color resolves once, every row is one * clipped run fill instead of a per-pixel palette lookup and call.*
- `vga_fb_pixel_rgb` (line 2026) `void vga_fb_pixel_rgb(int x, int y, uint8_t r, uint8_t g, uint8_t b)` - *Direct RGB pixel: full color depth in true-color modes, best-effort quantization in 8-bit mode. This is the primitive future UI (gradients, hover glows, selection blends) builds on instead of the 15-entry UI * palette. Packed order 0x00RRGGBB, same as fb_write_packed.*
- `vga_fb_rect_rgb` (line 2035) `void vga_fb_rect_rgb(int x, int y, int w, int h, uint8_t r, uint8_t g, uint8_t b)`
- `vga_fb_char` (line 2042) `void vga_fb_char(int col, int row, char c, uint8_t fg, uint8_t bg)`
- `vga_fb_str` (line 2056) `void vga_fb_str(int col, int row, const char *s, uint8_t fg, uint8_t bg)`
- `text_px` (line 2067) `static void text_px(int px, int py, const char *s, uint8_t fg, uint8_t bg)` - *Blit a text string at an absolute pixel position. Used for window chrome (title bar, taskbar) which lives outside the content-relative coordinate * space that vga_fb_char/str operate in.*
- `wm_draw_buttons` (line 2093) `static void wm_draw_buttons(int px, int py, int win_w, uint8_t fg, uint8_t bg)` - *--- Window controls ---- Three glyph buttons at the right end of a window's title bar: minimize (_), maximize (square) and close (X). They are shared by the terminal window and the composited graphics windows (DOOM/Nuklear), so hit-testing must work on * any titled window. Each button is FONT_W x FONT_H, separated by WM_BTN_PAD. static int wm_buttons_x0(int win_x, int win_w) { return win_x + win_w - 3 * (WM_BTN_W + WM_BTN_PAD); } /* Draw the three window-control glyphs at (px,py), the title bar's top-left.*
- `wm_buttons_hit` (line 2119) `static int wm_buttons_hit(int mx, int my, int win_x, int win_y, int win_w)` - *} for (i = 1; i < WM_BTN_H - 1; i++) { vga_fb_pixel(bx + 1, by + i, fg); vga_fb_pixel(bx + WM_BTN_W - 2, by + i, fg); } bx += WM_BTN_W + WM_BTN_PAD; /* close: two crossing diagonals. for (i = 1; i < WM_BTN_W - 1; i++) { vga_fb_pixel(bx + i, by + i, fg); vga_fb_pixel(bx + WM_BTN_W - 1 - i, by + i, fg); } } /* Return which window-control button is under (mx,my), or 0 for none.*
- `wm_close_pending` (line 2134) `int wm_close_pending(void)` - *Close request bridge: the syscall dispatcher polls this so a graphics * program's next syscall exits it on the child's own stack.*
- `wm_clear_close` (line 2135) `void wm_clear_close(void)`
- `wm_gfx_mode_active` (line 2136) `int wm_gfx_mode_active(void)`
- `vga_fb_ps2_owner` (line 2139) `int vga_fb_ps2_owner(int pid)` - *Close request bridge: the syscall dispatcher polls this so a graphics * program's next syscall exits it on the child's own stack. int wm_close_pending(void) { return wm_close_request; } void wm_clear_close(void) { wm_close_request = 0; } int wm_gfx_mode_active(void) { return vga_fb_gfx_mode; } /** Docstring: PS/2 owner check with pid range validation, focus routed.*
- `taskbar` (line 2159) `* minimize hides the app to the taskbar (it never closes it), maximize
 * toggles true fullscreen...`
- `directly` (line 2207) `* RGB sources pack directly (quantized to the wallpaper cube in 8-bit). */
static void gfx_scale_...`
- `gfx_letterbox` (line 2312) `static void gfx_letterbox(const wm_gfxview_t *v)` - *Docstring: Clear the frame area the content does not cover (the * letterbox bars of a tiled or fullscreen view) to black.*
- `gfx_title` (line 2331) `static void gfx_title(const wm_gfxview_t *v)` - *int ah = v->frame.h - v->title_h; const wm_gfxview_rect_t *c = &v->content; if (aw <= 0 || ah <= 0) return; if (c->y > ay) vga_fb_rect(ax, ay, aw, c->y - ay, COL_BLACK); if (c->y + c->h < ay + ah) vga_fb_rect(ax, c->y + c->h, aw, ay + ah - (c->y + c->h), COL_BLACK); if (c->x > ax) vga_fb_rect(ax, c->y, c->x - ax, c->h, COL_BLACK); if (c->x + c->w < ax + aw) vga_fb_rect(c->x + c->w, c->y, ax + aw - (c->x + c->w), c->h, COL_BLACK); } /** Docstring: Paint the title strip (title text plus window controls).*
- `gfx_compose` (line 2343) `static void gfx_compose(const volatile uint8_t *src, int kind, int sw, int sh,
                  ...` - *Docstring: Compose one graphics frame at a view into the render target: * title, letterbox (when full is set) and the scaled content.*
- `gfx_present` (line 2409) `static void gfx_present(const volatile uint8_t *bb, int kind, int sw, int sh)` - *Docstring: Present under the pointer handshake: wait out a desktop tick that is moving the sprite, composite, then stamp the present time the * tick's idle follow measures against.*
- `gfx_cursor_follow_idle` (line 2425) `static void gfx_cursor_follow_idle(void)` - *Docstring: Move the graphics-mode pointer from the desktop tick while the app is idle. The present path stays the pointer's painter whenever frames flow; only after GFX_CURSOR_FOLLOW_TICKS without one, with the pointer moved and no present or desktop composite in flight, does the tick restore the old sprite and draw it at the new position with the same * save/restore helpers the present uses.*
- `vga_fb_blit_gfx_window` (line 2438) `void vga_fb_blit_gfx_window(void)`
- `vga_fb_blit_nk_window` (line 2447) `void vga_fb_blit_nk_window(void)`
- `vga_fb_blit_nk_rgb_window` (line 2453) `void vga_fb_blit_nk_rgb_window(void)` - *Composite the Nuklear RGB back-buffer (NK_RGB_ADDR, NK_W x NK_H x 3 bytes) * through the same present path as the indexed buffers.*
- `term_recalc` (line 2462) `static void term_recalc(void)`
- `draw_title_win` (line 2488) `static void draw_title_win(int idx, int focused)` - *Preserve the current window position, clamping it into range so a * drag or Ctrl+arrow move is not undone by the next layout pass. if (term_x < 0) term_x = 0; if (term_y < 0) term_y = 0; if (term_x > max_cols - term_cols) term_x = max_cols - term_cols; if (term_y > max_rows - term_rows) term_y = max_rows - term_rows; } term_px_x = term_x * FONT_W; term_px_y = term_y * FONT_H; term_px_w = term_cols * FONT_W; term_px_h = term_rows * FONT_H; } /* ---- Desktop ----*
- `taskbar_layout` (line 2519) `static void taskbar_layout(void)`
- `draw_speaker_icon` (line 2550) `static void draw_speaker_icon(int x, int y, uint8_t color)` - *Running-app button right after it: mini icon + title while a graphics program owns the display. Clicking it focuses the app (brings it to * the front), so a window buried by Alt+Tab/tile is always reachable. tb_gfx_x = tb_restore_x + tb_restore_w + TASKBAR_PAD; tb_gfx_w = 0; if (vga_fb_gfx_mode) { int tl = (int)kstrlen(gfx_win_title); if (tl > TB_GFX_TITLE_MAX) tl = TB_GFX_TITLE_MAX; tb_gfx_w = FONT_W + 2 + tl * FONT_W; } } /* 8x8 speaker glyph: body on the left, two sound arcs to the right.*
- `taskbar_render` (line 2559) `static void taskbar_render(void)`
- `taskbar_tick` (line 2638) `static void taskbar_tick(void)` - *Redraw the clock only when the wall-clock second changes. Only the taskbar strip is repainted, so the cursor must be re-saved (invalidated) only when it actually sat over the taskbar; otherwise it keeps its saved * background and moves normally, which is what prevents pointer trails.*
- `vga_fb_theme_name` (line 2654) `int vga_fb_theme_name(char *dst, int cap)` - *Docstring: Active Nuklear theme name for the taskbar widget.  Reads etc/themes/current (ramdisk); a missing file, a bad name or an * overlong read falls back to "dark", never a stale or partial name.*
- `taskbar_theme_cycle` (line 2675) `static void taskbar_theme_cycle(void)` - *Cycle the active theme to the next etc/themes/ entry (ramdisk). Holds no locks; click context only. Writes the choice back to current so the * next app launch picks it up; running apps keep their theme.*
- `taskbar_handle_click` (line 2715) `static void taskbar_handle_click(int mx, int my)` - *Click handling for the keyboard widget, the speaker icon and -/+ buttons, plus the restore button that reappears while the terminal window is minimized. A click on "EN" switches to Spanish and a click on "ES" * switches back to English. A click on the theme name cycles etc/themes.*
- `draw_scrollbar` (line 2775) `static void draw_scrollbar(void)` - *return; } if (mx >= tb_minus_x && mx < tb_minus_x + TASKBAR_BTN_W) { v = pcspk_get_volume(); pcspk_set_volume(v > TASKBAR_VOL_STEP ? v - TASKBAR_VOL_STEP : 0); return; } if (mx >= tb_plus_x && mx < tb_plus_x + TASKBAR_BTN_W) { pcspk_set_volume(pcspk_get_volume() + TASKBAR_VOL_STEP); return; } } /* ---- Scrollbar (attached to the window's right edge) ----*
- `render_blank_row` (line 2810) `static void render_blank_row(int vrow)` - *Blank one viewport row: every cell is repainted with the terminal background. vga_fb_str with an empty string would draw nothing and leave * whatever pixels the previous content left behind, so blanking is explicit.*
- `render_row` (line 2820) `static void render_row(int vrow, int abs)` - *Render one display row at viewport row `vrow` for the absolute display row `abs`. Rows outside the history (above the oldest line, or below the active line) are blanked. When this is a row of the active line and a text cursor * is shown, the cursor cell is drawn inverted (COL_TERM_CUR background).*
- `term_render` (line 2855) `static void term_render(void)`
- `buffer` (line 2870) `* owns the buffer (indices reset, render reads an empty ring). */
void term_clear(void)`
- `term_render_active` (line 2887) `static void term_render_active(void)` - *Repaint only the bottom region that a live edit touches: from the active line's first visible display row to the bottom of the window. Used for a character append/backspace that does not change the number of display rows, * so typing stays cheap while remaining correct.*
- `line` (line 2930) `* display stale bytes left over from a longer previous line (e.g. the prompt
 * would show the ta...`
- `escapes` (line 2939) `* swallowing them here keeps the escapes (which the serial side needs)
     * from printing as li...`
- `vga_fb_puts_term` (line 2996) `void vga_fb_puts_term(const char *s)`
- `vga_fb_text_cursor` (line 3002) `void vga_fb_text_cursor(int col)` - *Show the text cursor at character column `col` of the active line, or hide * it with a negative column. The cursor is a block rendered by render_row.*
- `vga_fb_hide_text_cursor` (line 3010) `void vga_fb_hide_text_cursor(void)` - *Show the text cursor at character column `col` of the active line, or hide * it with a negative column. The cursor is a block rendered by render_row. void vga_fb_text_cursor(int col) { if (col < 0) { term_cursor_col = -1; } else { term_cursor_col = col; } disp_clamp(); term_render(); } /* Hide the text cursor (used when a live edit starts or the window redraws).*
- `vga_fb_draw_desktop` (line 3034) `void vga_fb_draw_desktop(void)` - *Docstring: Repaint the desktop through the shared render plan. The whole frame composes off-screen (see the render-target section) and is presented once, pointer included, so a redraw never flashes a cleared or half-painted screen. A pending graphics-close melt keeps the closing rect showing the old pixels in the presented frame and * then melts the fresh desktop over it on the visible framebuffer.*
- `gfx_view_in_rect` (line 3129) `static void gfx_view_in_rect(const wm_gfxview_rect_t *r, int titled, wm_gfxview_t *v)` - *Docstring: View of the persistent source inside an arbitrary frame, * titled when the frame is tall enough to carry a title strip.*
- `gfx_animate` (line 3148) `static void gfx_animate(const wm_gfxview_rect_t *from, const wm_gfxview_rect_t *to,
             ...` - *Docstring: Glide the persistent source frame from one rect to * another over the desktop, then settle with a plain redraw.*
- `gfx_taskbar_rect` (line 3198) `static void gfx_taskbar_rect(wm_gfxview_rect_t *r)` - *fb_tgt = fb_shadow; gfx_compose(gfx_keep, gfx_keep_kind, gfx_keep_sw, gfx_keep_sh, &v, 0); fb_tgt = 0; fb_compose_depth--; fb_present_shadow(); gfx_wait_until(t0 + (unsigned long)(t * cfg.anim_frame_ms)); } kfree(bg); cursor_invalidate(); gfx_frame_dirty = 1; vga_fb_draw_desktop(); } /** Docstring: Taskbar button rect of the running app (minimize target).*
- `gfx_drop_focus` (line 3235) `static void gfx_drop_focus(int source)` - *Docstring: Hand keyboard focus to the graphics window without a * redraw (callers repaint once afterwards). static void gfx_take_focus(int source) { int before = wm_focus; if (wm_focus == WM_FOCUS_GFX) return; if (shell_readline_active()) shell_focus_park(); tw_park(wm_term); wm_focus = WM_FOCUS_GFX; kbd_raw_flush(); wm_emit_focus_moved(before, source); } /** Docstring: Hand keyboard focus back to the last terminal.*
- `from` (line 3246) `* leaving returns to the view it came from (floating or tiled). Returns
 * 0 on success, -1 witho...`
- `vga_fb_gfx_set_hidden` (line 3280) `int vga_fb_gfx_set_hidden(int hide)` - *Docstring: Minimize (hide) or restore the graphics window. The app keeps running; a hidden window paints nothing, drops the keyboard to the terminal and glides into its taskbar button; a restore glides back * out and takes the keyboard. Returns 0, or -1 without a program.*
- `vga_fb_gfx_view_name` (line 3308) `const char *vga_fb_gfx_view_name(void)` - *if (gfx_view_valid) gfx_animate(&from, &btn, titled, 0); else vga_fb_draw_desktop(); return 0; } gfx_hidden = 0; gfx_take_focus(WM_FOCUS_SRC_TASKBAR); wm_last_n = -1; gfx_transition(&btn, 0); return 0; } /** Docstring: Graphics view state for `wm state`/`wm list`.*
- `term_toggle_fullscreen` (line 3320) `static void term_toggle_fullscreen(void)` - */** Docstring: Graphics view state for `wm state`/`wm list`. const char *vga_fb_gfx_view_name(void) { const char *n; if (!vga_fb_gfx_mode) return "none"; if (gfx_hidden) return "minimized"; n = wm_gfxview_mode_name(gfx_view_mode); return n ? n : "floating"; } /* ---- Keyboard shortcuts ---- /** Docstring: Toggle fullscreen of the focused terminal window.*
- `vga_fb_toggle_fullscreen` (line 3332) `void vga_fb_toggle_fullscreen(void)` - *Docstring: Toggle fullscreen on the focused window: the graphics * window scales to the whole display, a terminal fills the grid.*
- `term_toggle_minimize` (line 3343) `static void term_toggle_minimize(void)` - *Minimize/restore the terminal window. The content is not touched; the window is merely hidden and repainted on restore. Fullscreen and minimize * are mutually exclusive: entering fullscreen un-minimizes.*
- `vga_fb_toggle_minimize` (line 3353) `void vga_fb_toggle_minimize(void)` - *Minimize/restore the terminal window. The content is not touched; the window is merely hidden and repainted on restore. Fullscreen and minimize * are mutually exclusive: entering fullscreen un-minimizes. static void term_toggle_minimize(void) { unsigned int *fx_old = fx_start_full(); term_minimized = !term_minimized; if (term_minimized) term_fullscreen = 0; disp_off = 0; vga_fb_draw_desktop(); fx_finish_full(fx_old); } /** Docstring: Minimize/restore the focused window (graphics or terminal).*
- `vga_fb_is_minimized` (line 3361) `int vga_fb_is_minimized(void)`
- `vga_fb_is_fullscreen` (line 3362) `int vga_fb_is_fullscreen(void)`
- `gfx_snap` (line 3367) `static void gfx_snap(int zone)` - *Snap the focused graphics window into a screen region (halves place it against that edge, quadrants into that corner) at its native size: a * snap floats the window, it never scales it. Glides to the target.*
- `term_close_default` (line 3400) `static void term_close_default(void)` - *Docstring: Terminal close button: restore the default geometry (the * shell cannot be closed).*
- `vga_fb_close_active` (line 3416) `int vga_fb_close_active(void)` - *Close the focused window. For the graphics window (focused) this arms the close request that the syscall dispatcher honours on the child's next syscall; for a terminal it restores the default position (the shell cannot be closed). Returns 1 when a close was armed, 0 * otherwise.*
- `vga_fb_move_terminal` (line 3430) `void vga_fb_move_terminal(int dx, int dy)`
- `term_max_cols` (line 3475) `static int term_max_cols(void)` - *--- Tiling window operations (Alt = WM modifier) ---- Snap places the window in a screen half or quadrant and sizes it to that region; resize grows/shrinks the persisted size. Both exit fullscreen and * preserve the new size across redraws.*
- `term_max_rows` (line 3479) `static int term_max_rows(void)`
- `term_finish_layout` (line 3484) `static void term_finish_layout(void)`
- `vga_fb_snap_window` (line 3490) `void vga_fb_snap_window(int zone)`
- `vga_fb_resize` (line 3518) `void vga_fb_resize(int dcols, int drows)`
- `vga_fb_reset_default` (line 3538) `void vga_fb_reset_default(void)` - *int ncol = term_sz_cols + dcols; int nrow = term_sz_rows + drows; if (ncol < 1) ncol = 1; if (nrow < 1) nrow = 1; if (ncol > mc) ncol = mc; if (nrow > mr) nrow = mr; if (ncol == term_sz_cols && nrow == term_sz_rows && !term_fullscreen) return; term_fullscreen = 0; term_sz_cols = ncol; term_sz_rows = nrow; term_finish_layout(); } /** Docstring: Restore defaults on the focused window plus graphics offset.*
- `wallpaper_ensure` (line 3592) `static void wallpaper_ensure(void)`
- `wallpaper_usable` (line 3644) `static int wallpaper_usable(void)` - *d[2] = px[0]; if (bpx == 4) d[3] = 0; } } } stbi_image_free(img); wall_native = cache; wall_cw = fb_width; wall_ch = fb_height; wall_bpx = bpx; } /** Docstring: True when the native cache matches the live mode.*
- `wallpaper_draw` (line 3649) `static void wallpaper_draw(void)`
- `pipe_field` (line 3675) `static const char *pipe_field(const char *line, int idx, char *buf, int buflen)` - *--- Desktop shortcut icons ---- Shortcuts are defined in etc/shortcuts on the ramdisk, one per line: name|icon_path|command Icons are 32x32 PNG files decoded at boot via stbi_load_file and mapped to the icon palette (VGA DAC indices 240-255).  The cached palette-indexed * pixels are redrawn on every desktop paint; mouse clicks launch the command. static struct desktop_shortcut shortcuts[MAX_SHORTCUTS]; static int shortcut_count; static int shortcuts_loaded; /* Find a pipe-delimited field by index (0-based).*
- `icon_nearest` (line 3693) `static int icon_nearest(int r, int g, int b)` - *Nearest entry in the 16-colour icon palette (squared RGB distance, * integer-only: at most 3*255*255 per entry, far from overflow).*
- `icon_embedded` (line 3709) `static const uint8_t *icon_embedded(const char *name)` - *for (i = 0; i < ICON_PAL_SIZE; i++) { int dr = r - icon_pal[i][0]; int dg = g - icon_pal[i][1]; int db = b - icon_pal[i][2]; int d = dr * dr + dg * dg + db * db; if (d < best_d) { best_d = d; best = i; } } return best; } /* Embedded fallback when the shortcut's PNG is missing or undecodable.*
- `icon_decode` (line 3729) `static const uint8_t *icon_decode(const char *path)` - *Decode a shortcut's PNG to raw 32x32 RGBA pixels. Returns a heap buffer that lives until reboot, or 0 on any failure (missing file, undecodable image, exhausted heap); the caller then uses icon_embedded. Keeping the PNG's own colors (instead of mapping to the 16-entry icon palette) is what makes icons distinguishable on a true-color desktop; the 8-bit mode * quantizes back through icon_nearest at draw time.*
- `icon_embedded_rgba` (line 3763) `static const uint8_t *icon_embedded_rgba(const uint8_t *idx)` - *Expand an embedded index icon (desktop_icons.h, transparent 0) to RGBA through the icon palette, so fallback art follows the same draw path as * decoded PNGs. Returns a heap buffer or 0 when exhausted.*
- `dock_label_px` (line 3791) `static int dock_label_px(const struct desktop_shortcut *sc)` - *Width of the longest shortcut label in pixels (cached after load). Labels are centred under their icon and a dock column must be wide enough for one, * or neighbouring labels overlap. static int dock_cell_w; /* Width (px) one label occupies (FONT_W per character).*
- `shortcuts_layout` (line 3800) `static void shortcuts_layout(void)` - *Dock layout: one centred row just above the taskbar. Every shortcut owns a column `dock_cell_w` wide (enough for its label), the icon is centred in the column and the label centred beneath it, so long names never collide with a neighbour. Recomputed on every draw/hit-test from fb_width/fb_height so a * resolution change never leaves stale coordinates behind.*
- `shortcut_cell_left` (line 3818) `static int shortcut_cell_left(int i)` - *dock_h = ICON_H + DOCK_LABEL_GAP + ICON_LABEL_H + 2 * DOCK_PAD_Y; x0 = (fb_width - dock_w) / 2; if (x0 < 0) x0 = 0; y0 = fb_height - TASKBAR_H - DOCK_GAP - dock_h; if (y0 < 0) y0 = 0; cell_left = x0 + DOCK_PAD_X; for (i = 0; i < shortcut_count; i++) { shortcuts[i].x = cell_left + (dock_cell_w - ICON_W) / 2; shortcuts[i].y = y0 + DOCK_PAD_Y; cell_left += dock_cell_w; } } /* Left edge of shortcut i's column (used to centre its label under the icon).*
- `desktop_shortcuts_load` (line 3825) `void desktop_shortcuts_load(void)`
- `shortcut_draw_scaled` (line 3881) `static void shortcut_draw_scaled(const struct desktop_shortcut *sc,
                             ...` - *Blit one shortcut icon scaled to dw x dh at (dx, dy), nearest neighbour from the cached 32x32 RGBA source. Alpha below 128 stays * transparent; 8-bit mode quantizes through the icon palette.*
- `dock_hover_index` (line 3906) `static int dock_hover_index(int mx, int my)` - *Index of the shortcut column under (mx, my), or -1. Same column bounds * as the click hit test, so hover and click always agree.*
- `dock_bounce_counts` (line 3933) `void dock_bounce_counts(unsigned long *kicks, unsigned long *paints)`
- `dock_click_count` (line 3943) `void dock_click_count(unsigned long *edges)`
- `dock_bounce_elapsed` (line 3949) `static unsigned long dock_bounce_elapsed(void)` - *Ticks elapsed since the bounce click, capped so the subtraction can * never wrap on a late read.*
- `dock_bounce_live` (line 3957) `static int dock_bounce_live(void)` - *Ticks elapsed since the bounce click, capped so the subtraction can * never wrap on a late read. static unsigned long dock_bounce_elapsed(void) { unsigned long now = (unsigned long)sys_ticks; unsigned long el = now - dock_bounce_start; if (el > DOCK_BOUNCE_TICKS) el = DOCK_BOUNCE_TICKS; return el; } /* 1 while the bounce animation is live, 0 once it expired or is idle.*
- `dock_pending_active` (line 4007) `int dock_pending_active(void)`
- `dock_paint_icons` (line 4015) `static void dock_paint_icons(int hover)` - *Paint every shortcut icon and label at the given hover sizes. Shared by the full desktop paint and the flicker-free hover repaint, so the two can never diverge. Growth is bottom-aligned on the slot with no * relayout: it overlays upward and the strip erase restores it.*
- `desktop_shortcuts_draw` (line 4051) `void desktop_shortcuts_draw(void)`
- `wallpaper_rect` (line 4078) `static void wallpaper_rect(int x0, int y0, int w, int h)` - *Paint one wallpaper rectangle from the cache (solid fill when the cache * is absent or stale): the strip-erase primitive for the hover repaint.*
- `dock_paint_hover` (line 4109) `static void dock_paint_hover(int hover)` - *Hover repaint without the fullscreen flash: erase only the dock strip (bar plus the overflow the magnified icons rise into), restore the crystal and repaint the icons at the new hover sizes. No clear, no wallpaper rewrite, no terminal re-render, so there is no black frame; the strip is cheap (a few rows) and runs once per hover crossing. Terminals paint over the dock on a full desktop paint, so a terminal dragged across the dock is overpainted here until its next render; that drag case is rare and heals on the next paint. Fullscreen * terminals hide the dock, so the tick never calls this there.*
- `gfx_task_icon` (line 4145) `static const uint8_t *gfx_task_icon(void)` - *Icon for the taskbar running-app button. First the running program via its launch command (config-driven, covers apps that never set a window title); then the window title against the shortcut name as fallback (case-insensitive, "*" suffix ignored). Text-only button when nothing matches. Load is idempotent, so a click before the first desktop paint * still resolves.*
- `desktop_shortcuts_hit_test` (line 4166) `const char *desktop_shortcuts_hit_test(int mx, int my)`
- `mouse_focus_topmost` (line 4180) `static int mouse_focus_topmost(int mx, int my)` - *const char *desktop_shortcuts_hit_test(int mx, int my) { shortcuts_layout(); for (int i = 0; i < shortcut_count; i++) { struct desktop_shortcut *sc = &shortcuts[i]; int cl = shortcut_cell_left(i); if (mx >= cl && mx < cl + dock_cell_w && my >= sc->y && my < sc->y + ICON_H + ICON_LABEL_H) { return sc->cmd; } } return 0; } /** Docstring: Focus the topmost window at point, paint order.*
- `mouse_apply_wheel` (line 4206) `static void mouse_apply_wheel(int wheel, int step)` - *if (!twins[f].present) continue; if (tw_hit(f, mx, my)) { if (f == wm_focus) return 0; before = wm_focus; tw_select(f); vga_fb_draw_desktop(); wm_emit_focus_moved(before, WM_FOCUS_SRC_POINTER); return 1; } } return 0; } /** Docstring: Scroll the focused terminal from a wheel sample.*
- `mouse_drag_gfx` (line 4230) `static void mouse_drag_gfx(const wm_geom_config_t *gcfg, int mx, int my)` - *Docstring: Title-bar drag of the graphics window. Redraws on every offset change and once more on release, so the persistent layer moves with the pointer and no duplicated copy survives the drop. Grabbing a tiled window floats it at native size under the pointer (the grab point keeps its relative position along the title); a fullscreen window has * no title and never drags.*
- `mouse_drag_term` (line 4282) `static void mouse_drag_term(const wm_geom_config_t *gcfg, int win_w, int mx, int my, int gfx_cursor)` - *Docstring: Title-bar drag of the focused terminal window. The motion path already repaints per step; the release edge repaints once more so * the final coordinates settle with no duplicated copy left behind.*
- `mouse_scrollbar` (line 4305) `static void mouse_scrollbar(const wm_geom_config_t *gcfg, int mx, int my)` - *wm_grab_cx = (mx - term_px_x) / FONT_W; } } else { wm_dragging = 0; } if (wm_dragging) { vga_fb_drag_terminal(mx, my, wm_grab_cx); if (!gfx_cursor) cursor_invalidate(); } else if (was) { vga_fb_draw_desktop(); } } /** Docstring: Scrollbar drag of the focused terminal window.*
- `vga_fb_wait_tick` (line 4334) `void vga_fb_wait_tick(void)` - *Docstring: Drive the desktop from a kernel wait loop. While the shell waits for a foreground process nothing else runs vga_fb_mouse_tick: the timer ISR drives it only for the pid-0 exec frame (user_program_active) and the shell's input loop is not running, so the pointer, taskbar and window controls froze for the whole run. The loop calls this between yields; it ticks at the ISR's cadence and stands down whenever the ISR * owns the desktop, so the two never run the tick concurrently.*
- `vga_fb_mouse_tick` (line 4343) `void vga_fb_mouse_tick(void)` - *timer ISR drives it only for the pid-0 exec frame (user_program_active) and the shell's input loop is not running, so the pointer, taskbar and window controls froze for the whole run. The loop calls this between yields; it ticks at the ISR's cadence and stands down whenever the ISR * owns the desktop, so the two never run the tick concurrently. void vga_fb_wait_tick(void) { static unsigned long last; if (!vga_fb_active || user_program_active) return; if ((unsigned long)sys_ticks - last < DESKTOP_TICK_INTERVAL) return; last = (unsigned long)sys_ticks; vga_fb_mouse_tick(); } /** Docstring: Per-tick mouse dispatch over unified geometry and events.*
- `state` (line 4467) `* ignores the button state (the arming press is consumed) and settles
     * once on expiry, so t...`
- `vga_fb_mouse_init` (line 4545) `void vga_fb_mouse_init(void)`
- `vga_fb_history_page` (line 4599) `void vga_fb_history_page(int dir)` - *Docstring: Page the terminal history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring, so the page keys move that viewport; the legacy VGA scrollback ring only serves the * text-mode console, where the framebuffer terminal does not exist.*
- `vga_fb_init` (line 4611) `void vga_fb_init(void)`
- `compositions` (line 133) `* compositions (an ISR tick composing inside a syscall composition) draw * into the same shadow and leave the present to the outermost owner. * The shadow is allocated once on first use and never free`
- `flag` (line 533) `* is the minimized flag (the program keeps running, nothing composites);`
- `letterbox` (line 537) `* present to repaint chrome plus letterbox (after a desktop redraw or a * view change);`
- `coordinates` (line 782) `* windows keep the exact historical coordinates (including outside the * window);`
- `gfx_transition` (line 976) `static void gfx_transition(const wm_gfxview_rect_t *from, int from_titled);`
- `app` (line 1195) `* a gfx child spawned from another gfx app (file -> vedit) keeps the * terminal focused, so its keys and wheel keep landing on the shell * while the app looks hung. The enable arm mirrors the focus-gf`
- `title` (line 2569) `* 8px row plus its title (bright when focused). The hint line * starts after it instead of underneath. */ const uint8_t *ipx = gfx_task_icon();`
- `command` (line 4140) `* its launch command (config-driven, covers apps that never set a window * title);`
- `pointer` (line 4227) `* tiled window floats it at native size under the pointer (the grab point * keeps its relative position along the title);`
- `path` (line 4354) `* present path (blit_gfx_buf) is the sole cursor painter. The tick * used to share the sprite state with it and raced every present * (~60fps vs 25Hz): stale restores painted trails and flicker, worst`

**Macros:**
- `FBT` (line 145) `#define FBT`
- `LG_LINE` (line 296) `#define LG_LINE(a)`
- `GFX_SRC_IDX` (line 524) `#define GFX_SRC_IDX`
- `GFX_SRC_RGB` (line 525) `#define GFX_SRC_RGB`
- `GFX_KEEP_BYTES` (line 526) `#define GFX_KEEP_BYTES`
- `GFX_CURSOR_IDLE_TICKS` (line 552) `#define GFX_CURSOR_IDLE_TICKS`
- `GFX_CURSOR_FOLLOW_TICKS` (line 558) `#define GFX_CURSOR_FOLLOW_TICKS`
- `GFX_PROG_LEN` (line 610) `#define GFX_PROG_LEN`
- `WIN_DEF_COLS` (line 936) `#define WIN_DEF_COLS`
- `WIN_DEF_ROWS` (line 937) `#define WIN_DEF_ROWS`
- `WIN_DEF_X` (line 938) `#define WIN_DEF_X`
- `WIN_DEF_Y` (line 939) `#define WIN_DEF_Y`
- `WM_MAX_TERMS` (line 967) `#define WM_MAX_TERMS`
- `WM_ELINE_SZ` (line 968) `#define WM_ELINE_SZ`
- `FB_OFFSET` (line 1687) `#define FB_OFFSET(x,y)`
- `TB_GFX_TITLE_MAX` (line 2517) `#define TB_GFX_TITLE_MAX`

**Structs:**
- `termwin_t` (line 978)

#### `vga_fx.c`
**Path:** `kernel/vga_fx.c`
**File Doc:** *DOOM-melt desktop effects (see headers/vga_fx.h for the contract).*

**Functions:**
- `vga_fx_set_enabled` (line 22) `void vga_fx_set_enabled(int on)`
- `vga_fx_enabled` (line 27) `int vga_fx_enabled(void)`
- `fx_wait_until` (line 35) `static void fx_wait_until(unsigned long deadline)` - *Deadline pacing over the PIT-calibrated TSC clock. Interrupts stay on, so the 100 Hz tick keeps running; a concurrent desktop tick may tear one * melt frame cosmetically, never corrupt state.*
- `vga_fx_snap_rect` (line 41) `unsigned int *vga_fx_snap_rect(int x, int y, int w, int h)`
- `vga_fx_restore_rect` (line 63) `void vga_fx_restore_rect(int x, int y, int w, int h, const unsigned int *buf)`
- `vga_fx_free` (line 77) `void vga_fx_free(unsigned int *buf)`
- `once` (line 90) `* once (prev[] tracks the revealed frontier per column), then the final
 * restore guarantees the...`
- `vga_fx_melt_rect` (line 150) `void vga_fx_melt_rect(int x, int y, int w, int h,
    const unsigned int *oldb, const unsigned in...` - *Drive one old->new melt. The framebuffer must show the old rect on entry * and shows the new rect on return.*
- `vga_fx_melt_from_black` (line 159) `void vga_fx_melt_from_black(int x, int y, int w, int h, const unsigned int *newb)` - *Boot melt: the framebuffer is already cleared to black on entry, so no * old snapshot is needed; the new frame scrolls down over black.*

#### `kernel.c`
**Path:** `kernel.c`
**File Doc:** *kernel.c -- Mediator: boot orchestration and the syscall trampoline.*

**Functions:**
- `syscall_init` (line 117) `void syscall_init(void)`
- `bootlog_mark` (line 192) `void bootlog_mark(const char *name)`
- `bootlog_report` (line 199) `void bootlog_report(void)`
- `__attribute__` (line 207) `__attribute__((section(".init.text")))
void kmain(void)`
- `tables` (line 279) `* tables (already built above) for its uncached register window and the
     * heap for its rings...`
- `table` (line 104) `* Symbol table (for resolving program references) * ================================================================ */ #define KSYM_MAX 256 /* ---- SYSCALL/SYSRET setup ------------------------------`
- `ksyscall` (line 130) `extern long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6);`
- `kstack` (line 146) `* Reading gs:8 instead resolves every thread to the wrong kstack (0 on * the BSP, 1 on APs): harmless while a single process runs, fatal as * soon as two threads syscall concurrently. */ _Static_asser`
- `ms` (line 185) `* 0 ms (TSC ticks since power-on divided down, still monotonic);`
- `size` (line 257) `* image size (see kernel.ld);`

**Macros:**
- `KSYM_MAX` (line 107) `#define KSYM_MAX`
- `BOOTLOG_MAX` (line 188) `#define BOOTLOG_MAX`

**Variables:**
- `syscall_kstack` (line 115) `extern unsigned long syscall_kstack;`
- `ramdisk_start` (line 179) `extern char ramdisk_start[];`
- `ramdisk_end` (line 180) `extern char ramdisk_end[];`

#### `net.c`
**Path:** `net/net.c`
**File Doc:** *MiniOS network stack: virtio-net preferred, rtl8139 fallback, under*

**Functions:**
- `net_drv_send` (line 38) `static int net_drv_send(const unsigned char *frame, unsigned len)`
- `net_drv_poll` (line 43) `static void net_drv_poll(void)`
- `net_drv_present` (line 48) `static int net_drv_present(void)`
- `net_put16` (line 57) `static void net_put16(unsigned char *p, unsigned short v)`
- `net_put32` (line 62) `static void net_put32(unsigned char *p, unsigned int v)`
- `net_get16` (line 69) `static unsigned short net_get16(const unsigned char *p)`
- `net_get32` (line 73) `static unsigned int net_get32(const unsigned char *p)`
- `net_checksum` (line 78) `static unsigned short net_checksum(const void *data, unsigned len)`
- `net_arp_store` (line 103) `static void net_arp_store(const unsigned char *ip, const unsigned char *mac)`
- `net_arp_lookup` (line 118) `static int net_arp_lookup(const unsigned char *ip, unsigned char *mac_out)`
- `net_arp_request` (line 129) `static void net_arp_request(const unsigned char *ip)`
- `net_arp_resolve` (line 147) `static int net_arp_resolve(const unsigned char *ip, unsigned char *mac_out)` - *kmemcpy(frame + 6, net_mac, NET_ETH_ALEN); net_put16(frame + 12, NET_ETHERTYPE_ARP); net_put16(frame + 14, 1);                 /* ethernet net_put16(frame + 16, 0x0800);            /* IPv4 frame[18] = 6; frame[19] = 4; net_put16(frame + 20, NET_ARP_REQUEST); kmemcpy(frame + 22, net_mac, NET_ETH_ALEN); kmemcpy(frame + 28, net_our_ip, 4); kmemcpy(frame + 38, ip, 4); net_drv_send(frame, 42); } /* Resolve an IP on the 10.0.2.0/24 link. Retries, bounded timeout.*
- `net_ip_send` (line 172) `static int net_ip_send(const unsigned char *dip, unsigned char proto,
                       cons...` - *================================================================ IPv4 / ICMP / UDP / DNS * ================================================================ static unsigned short net_ip_id; static unsigned short net_icmp_id = 0x4D49; static unsigned short net_udp_port = NET_EPHEMERAL_MIN; static unsigned int   net_tx_bytes; static unsigned int   net_rx_bytes; /* Send a frame on the link: dst IP decides the destination MAC.*
- `net_udp_send` (line 208) `static int net_udp_send(const unsigned char *dip, unsigned short sport,
                        u...`
- `net_dns_parse` (line 230) `static void net_dns_parse(const unsigned char *data, unsigned len)` - *net_put16(pkt + 6, 0);                    /* checksum optional for UDP kmemcpy(pkt + 8, data, len); return net_ip_send(dip, NET_PROTO_UDP, pkt, total); } struct net_dns_state { unsigned short id; unsigned char  ip[4]; int            done; }; static struct net_dns_state net_dns; /* Parse a DNS response for the first A record.*
- `net_dns_resolve` (line 268) `static int net_dns_resolve(const char *host, unsigned char ip_out[4])` - *rtype = net_get16(data + pos); rdlen = net_get16(data + pos + 8); pos += 10; if (pos + rdlen > len) return; if (rtype == 1 && rdlen == 4) { kmemcpy(net_dns.ip, data + pos, 4); net_dns.done = 1; return; } pos += rdlen; } } /* Blocking A-record lookup against NET_DNS.*
- `net_udp_send` (line 329) `net_udp_send((const unsigned char[])`
- `net_icmp_rx` (line 348) `static void net_icmp_rx(const unsigned char *ip, unsigned len)`
- `net_ping` (line 377) `static int net_ping(const unsigned char ip[4])`
- `net_sock_alloc` (line 469) `static struct net_tcp_sock *net_sock_alloc(void)`
- `net_sock_index` (line 484) `static int net_sock_index(const struct net_tcp_sock *s)`
- `net_tcp_checksum` (line 493) `static unsigned short net_tcp_checksum(const unsigned char *src, const unsigned char *dst,
      ...` - *} } return 0; } static int net_sock_index(const struct net_tcp_sock *s) { int i; if (!net_sockets) return -1; for (i = 0; i < NET_SOCKETS; i++) if (&net_sockets[i] == s) return i; return -1; } /* Compute the TCP checksum over a pseudo header + segment.*
- `net_udp_checksum_ok` (line 509) `static int net_udp_checksum_ok(const unsigned char *src, const unsigned char *dst,
              ...` - *const unsigned char *seg, unsigned len) { unsigned char buf[NET_TX_MAX + 12]; unsigned total = 12 + len; kmemcpy(buf, src, 4); kmemcpy(buf + 4, dst, 4); buf[8] = 0; buf[9] = NET_PROTO_TCP; net_put16(buf + 10, (unsigned short)len); kmemcpy(buf + 12, seg, len); if (total & 1) buf[total++] = 0; return net_checksum(buf, total); } /* UDP checksum over pseudo header + datagram (may be 0 = not computed).*
- `net_tcp_xmit` (line 525) `static int net_tcp_xmit(struct net_tcp_sock *s, unsigned flags,
                        const uns...`
- `net_tcp_rx` (line 559) `static void net_tcp_rx(const unsigned char *ip, unsigned len)`
- `net_tcp_passive_open` (line 687) `static int net_tcp_passive_open(struct net_tcp_sock *ls,
        const unsigned char peer[4], uns...` - *Passive open: park a SYN_RCVD child on a LISTEN socket and answer SYN-ACK. Single backlog slot: a second SYN while one pends is dropped (the peer retransmits), never queued unbounded. The SYN-ACK transmit fails closed without an ARP entry; the peer's SYN retry * replays it once the entry resolves.*
- `net_tcp_connect_into` (line 711) `static int net_tcp_connect_into(struct net_tcp_sock *s, const unsigned char ip[4],
              ...` - *kmemcpy(c->dip, peer, 4); c->dport = pport; c->sport = lport; c->seq = net_tcp_seq; net_tcp_seq += 0x1000; c->rx_next = pseq + 1; c->ack = pseq + 1; c->state = NET_TCP_SYN_RCVD; net_tcp_xmit(c, 0x12, 0, 0, 1); ls->pending = idx; return 1; } /* Blocking connect of an allocated socket to an IPv4 address.*
- `net_tcp_send` (line 738) `static int net_tcp_send(struct net_tcp_sock *s, const char *buf, int len)` - *unsigned long retry = net_time_ms() + NET_RETRY_MS; while (net_time_ms() < retry && s->state == NET_TCP_SYN_SENT) net_drv_poll(); if (s->state == NET_TCP_SYN_SENT) net_tcp_xmit(s, 0x02, 0, 0, 0); } if (s->state != NET_TCP_ESTABLISHED) { s->in_use = 0; s->state = NET_TCP_CLOSED; return 0; } return 1; } /* Blocking send (stop-and-wait, one outstanding segment).*
- `net_tcp_recv` (line 764) `static int net_tcp_recv(struct net_tcp_sock *s, char *buf, int len)` - *net_time_ms() < deadline) { unsigned long retry = net_time_ms() + NET_RETRY_MS; while (net_time_ms() < retry && s->tx_pending) net_drv_poll(); if (s->tx_pending) net_tcp_xmit(s, 0x18, s->tx_buf, chunk, 0); } if (s->tx_pending || s->state != NET_TCP_ESTABLISHED) return sent ? sent : -1; buf += chunk; len -= (int)chunk; sent += (int)chunk; } return sent; } /* Blocking receive; 0 = EOF (FIN).*
- `net_tcp_close` (line 802) `static void net_tcp_close(struct net_tcp_sock *s)`
- `net_rx_handle_frame` (line 822) `void net_rx_handle_frame(const unsigned char *frame, unsigned len)`
- `net_open` (line 886) `int net_open(void)`
- `net_connect` (line 892) `int net_connect(const char *host, unsigned short port)`
- `net_send` (line 901) `int net_send(int fd, const char *buf, int len)`
- `net_recv` (line 906) `int net_recv(int fd, char *buf, int len)`
- `net_recv_timeout` (line 911) `int net_recv_timeout(int fd, char *buf, int len, unsigned long timeout_ms)`
- `net_close` (line 916) `void net_close(int fd)`
- `net_listen` (line 927) `int net_listen(unsigned short port)` - *Docstring: Allocate a socket bound to a local port and listening. * Returns the socket index, or -1 when the table is full.*
- `net_accept_nb` (line 942) `int net_accept_nb(int fd)` - *Docstring: Take a pending child off a LISTEN socket without waiting. Returns the child index, or -1 when no handshake has * completed yet. The child is ESTABLISHED and owned by the caller.*
- `polling` (line 959) `* without polling (the peer's ACK arrives through the driver poll). */
int net_accept(int fd, uns...`
- `net_sock_state` (line 976) `int net_sock_state(int fd)` - *Docstring: Socket state for diagnostics (the `net` builtin and the * httpd selftest). -1 on a wild fd.*
- `net_fd_udp` (line 1096) `static int net_fd_udp(long fd)`
- `net_sys_is_socket` (line 1102) `int net_sys_is_socket(long fd)`
- `net_udp_alloc` (line 1106) `static struct net_udp_sock *net_udp_alloc(void)`
- `net_udp_ephemeral` (line 1120) `static unsigned short net_udp_ephemeral(void)` - *static struct net_udp_sock *net_udp_alloc(void) { int i; if (!net_udp_sockets) return 0; for (i = 0; i < NET_UDP_SOCKETS; i++) { if (!net_udp_sockets[i].in_use) { kmemset(&net_udp_sockets[i], 0, sizeof(net_udp_sockets[i])); net_udp_sockets[i].in_use = 1; return &net_udp_sockets[i]; } } return 0; } /* Next free datagram port in the user ephemeral range.*
- `net_udp_deliver` (line 1136) `static int net_udp_deliver(const unsigned char sip[4], unsigned short sport,
                    ...` - *Queue a received datagram on the user socket bound to dport (and, when connected, from that peer only). 1 when a socket owned the port (full * queues drop the datagram, like a full Linux receive buffer).*
- `net_put_sockaddr` (line 1158) `static void net_put_sockaddr(unsigned char *sa, const unsigned char ip[4], unsigned short port)`
- `net_store_sockaddr` (line 1168) `static long net_store_sockaddr(long addr, long lenp, const unsigned char ip[4],
                 ...` - *Store a sockaddr_in at a user address with a user socklen_t length * pointer, truncating like Linux and reporting the full length.*
- `net_load_sockaddr` (line 1185) `static long net_load_sockaddr(long addr, long len, unsigned char ip[4], unsigned short *port)` - *int len; if (!addr || !lenp) return 0; if (!user_range_ok((unsigned long)lenp, sizeof(int))) return -LNX_EFAULT; len = *(int *)lenp; if (len < 0) return -LNX_EINVAL; if (len > NET_SOCKADDR_IN_LEN) len = NET_SOCKADDR_IN_LEN; if (len > 0 && !user_range_ok((unsigned long)addr, (unsigned long)len)) return -LNX_EFAULT; net_put_sockaddr(sa, ip, port); kmemcpy((void *)addr, sa, (unsigned long)len); (int *)lenp = NET_SOCKADDR_IN_LEN; return 0; } /* Read a user sockaddr_in (AF_INET, at least 16 bytes).*
- `net_sys_socket` (line 1222) `long net_sys_socket(long a1, long a2, long a3)`
- `net_sys_connect` (line 1249) `long net_sys_connect(long fd, long sockaddr, long addrlen)`
- `net_sys_bind` (line 1296) `long net_sys_bind(long fd, long sockaddr, long addrlen)`
- `net_sys_listen` (line 1318) `long net_sys_listen(long fd, long backlog)`
- `net_sys_accept` (line 1329) `long net_sys_accept(long fd, long sockaddr, long addrlen)`
- `net_send_bytes` (line 1347) `static long net_send_bytes(long fd, const unsigned char *buf, long len,
                         ...` - *Send len validated bytes: a stream sends synchronously (stop-and-wait), * a datagram goes out as one UDP datagram to `to` or the connected peer.*
- `net_sys_sendto` (line 1375) `long net_sys_sendto(long fd, long buf, long len, long flags, long to, long tolen)`
- `net_sys_recvfrom` (line 1390) `long net_sys_recvfrom(long fd, long buf, long len, long flags, long from, long fromlen)`
- `net_gather_msg` (line 1450) `static long net_gather_msg(long msg, unsigned char *kbuf, long cap)` - *long rc = net_store_sockaddr(from, fromlen, s->dip, s->dport); if (rc) return rc; } return (long)take; } if (s->rx_eof || s->state == NET_TCP_DEAD) return 0; if (!s->connecting && s->state != NET_TCP_ESTABLISHED) return -LNX_ENOTCONN; if (nonblock) return -LNX_EAGAIN; yield(); } } } /* Gather one msghdr's iovecs (validated) into kbuf, at most cap bytes.*
- `net_sys_sendmsg` (line 1470) `long net_sys_sendmsg(long fd, long msg, long flags)`
- `net_sys_sendmmsg` (line 1498) `long net_sys_sendmmsg(long fd, long vec, long vlen, long flags)` - *sendmmsg (307): glibc's resolver sends its A and AAAA queries together and treats ENOSYS as a failed lookup. Returns the messages sent, storing * each one's byte count in msg_len; an error on the first is returned.*
- `net_sys_shutdown` (line 1514) `long net_sys_shutdown(long fd, long how)`
- `net_sys_close` (line 1523) `long net_sys_close(long fd)`
- `net_sys_setsockopt` (line 1534) `long net_sys_setsockopt(long fd, long level, long name, long val, long len)`
- `net_sys_getsockopt` (line 1569) `long net_sys_getsockopt(long fd, long level, long name, long val, long lenp)`
- `net_sys_getsockname` (line 1616) `long net_sys_getsockname(long fd, long addr, long lenp)`
- `net_sys_getpeername` (line 1625) `long net_sys_getpeername(long fd, long addr, long lenp)`
- `net_sys_fcntl` (line 1643) `long net_sys_fcntl(long fd, long cmd, long arg)` - *fcntl on a socket: O_NONBLOCK through F_GETFL/F_SETFL, FD_CLOEXEC recorded through F_GETFD/F_SETFD (sockets live in one table shared by * fork, so execve keeps them; docs/spec/network.md).*
- `net_sys_ioctl` (line 1674) `long net_sys_ioctl(long fd, long req, long arg)` - *ioctl on a socket: FIONREAD answers the bytes a read would return now (a stream's buffered bytes, the size of a datagram socket's next datagram), FIONBIO sets O_NONBLOCK from the int at arg, FIOCLEX and FIONCLEX record FD_CLOEXEC; terminal and every other request is ENOTTY, * as Linux answers it for a socket. arg is validated by the caller.*
- `net_socket_revents` (line 1707) `static unsigned short net_socket_revents(long fd)` - *return 0; } } else { return -LNX_EBADF; } switch (req) { case LNX_FIONBIO: *nb = *(const int *)arg != 0; return 0; case LNX_FIOCLEX: *ce = 1; return 0; case LNX_FIONCLEX: *ce = 0; return 0; default: return -LNX_ENOTTY; } } /* poll(2) readiness of a socket descriptor.*
- `net_sys_poll` (line 1727) `long net_sys_poll(long fds, long nfds, long timeout_ms)`
- `net_sys_dns` (line 1767) `long net_sys_dns(long host)` - *MiniOS syscall 200: resolve a hostname, returned as a network-order * 32-bit address (like inet_addr), or -1 on failure.*
- `net_parse_ip` (line 1778) `static int net_parse_ip(const char *text, unsigned char ip[4])`
- `net_cmd_status` (line 1803) `void net_cmd_status(void)`
- `net_get_addrs` (line 1825) `void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4])` - *kprintf("virtio-net iobase 0x%x\n", vnet_iobase()); } else { rtl_counters(&tx_frames, &rx_frames); kprintf("rtl8139  iobase 0x%x\n", rtl_iobase()); } kprintf("mac      %02x:%02x:%02x:%02x:%02x:%02x\n", net_mac[0], net_mac[1], net_mac[2], net_mac[3], net_mac[4], net_mac[5]); kprintf("ip       %u.%u.%u.%u/24\n", net_our_ip[0], net_our_ip[1], net_our_ip[2], net_our_ip[3]); vga_puts("gateway  10.0.2.2  dns 10.0.2.3\n"); kprintf("tx       %u frames, %u bytes\n", tx_frames, net_tx_bytes); kprintf("rx       %u frames, %u bytes, %u dropped, %u v6 dropped\n", rx_frames, net_rx_bytes, net_rx_dropped, net6_rx_dropped); } /** Docstring: Copy the station MAC and IP out for status screens.*
- `net_cmd_ping` (line 1831) `void net_cmd_ping(const char *ip_text)`
- `net_cmd_dns` (line 1842) `void net_cmd_dns(const char *host)`
- `net_register_symbols` (line 1855) `void net_register_symbols(void)`
- `net_init` (line 1863) `void net_init(void)`

**Macros:**
- `NET_TCP_CLOSED` (line 400) `#define NET_TCP_CLOSED`
- `NET_TCP_SYN_SENT` (line 401) `#define NET_TCP_SYN_SENT`
- `NET_TCP_ESTABLISHED` (line 402) `#define NET_TCP_ESTABLISHED`
- `NET_TCP_FIN_SENT` (line 403) `#define NET_TCP_FIN_SENT`
- `NET_TCP_DEAD` (line 404) `#define NET_TCP_DEAD`
- `NET_TCP_LISTEN` (line 405) `#define NET_TCP_LISTEN`
- `NET_TCP_SYN_RCVD` (line 406) `#define NET_TCP_SYN_RCVD`
- `LNX_AF_INET` (line 1028) `#define LNX_AF_INET`
- `LNX_SOCK_STREAM` (line 1029) `#define LNX_SOCK_STREAM`
- `LNX_SOCK_DGRAM` (line 1030) `#define LNX_SOCK_DGRAM`
- `LNX_SOCK_TYPE_MASK` (line 1031) `#define LNX_SOCK_TYPE_MASK`
- `LNX_SOCK_NONBLOCK` (line 1032) `#define LNX_SOCK_NONBLOCK`
- `LNX_SOCK_CLOEXEC` (line 1033) `#define LNX_SOCK_CLOEXEC`
- `LNX_IPPROTO_TCP` (line 1034) `#define LNX_IPPROTO_TCP`
- `LNX_IPPROTO_UDP` (line 1035) `#define LNX_IPPROTO_UDP`
- `LNX_MSG_PEEK` (line 1036) `#define LNX_MSG_PEEK`
- `LNX_MSG_DONTWAIT` (line 1037) `#define LNX_MSG_DONTWAIT`
- `LNX_MSG_NOSIGNAL` (line 1038) `#define LNX_MSG_NOSIGNAL`
- `LNX_SOL_SOCKET` (line 1039) `#define LNX_SOL_SOCKET`
- `LNX_SO_REUSEADDR` (line 1040) `#define LNX_SO_REUSEADDR`
- `LNX_SO_TYPE` (line 1041) `#define LNX_SO_TYPE`
- `LNX_SO_ERROR` (line 1042) `#define LNX_SO_ERROR`
- `LNX_SO_SNDBUF` (line 1043) `#define LNX_SO_SNDBUF`
- `LNX_SO_RCVBUF` (line 1044) `#define LNX_SO_RCVBUF`
- `LNX_SO_KEEPALIVE` (line 1045) `#define LNX_SO_KEEPALIVE`
- `LNX_SO_LINGER` (line 1046) `#define LNX_SO_LINGER`
- `LNX_SO_RCVTIMEO` (line 1047) `#define LNX_SO_RCVTIMEO`
- `LNX_SO_SNDTIMEO` (line 1048) `#define LNX_SO_SNDTIMEO`
- `LNX_IPPROTO_IP` (line 1049) `#define LNX_IPPROTO_IP`
- `LNX_IP_TOS` (line 1050) `#define LNX_IP_TOS`
- `LNX_IP_TTL` (line 1051) `#define LNX_IP_TTL`
- `LNX_IP_MTU_DISCOVER` (line 1052) `#define LNX_IP_MTU_DISCOVER`
- `LNX_IP_RECVERR` (line 1053) `#define LNX_IP_RECVERR`
- `NET_IP_DEFAULT_TTL` (line 1054) `#define NET_IP_DEFAULT_TTL`
- `LNX_TCP_NODELAY` (line 1055) `#define LNX_TCP_NODELAY`
- `LNX_TCP_KEEPIDLE` (line 1056) `#define LNX_TCP_KEEPIDLE`
- `LNX_TCP_KEEPINTVL` (line 1057) `#define LNX_TCP_KEEPINTVL`
- `LNX_TCP_KEEPCNT` (line 1058) `#define LNX_TCP_KEEPCNT`
- `LNX_O_RDWR` (line 1059) `#define LNX_O_RDWR`
- `LNX_O_NONBLOCK` (line 1060) `#define LNX_O_NONBLOCK`
- `LNX_FD_CLOEXEC` (line 1061) `#define LNX_FD_CLOEXEC`
- `LNX_F_GETFD` (line 1062) `#define LNX_F_GETFD`
- `LNX_F_SETFD` (line 1063) `#define LNX_F_SETFD`
- `LNX_F_GETFL` (line 1064) `#define LNX_F_GETFL`
- `LNX_F_SETFL` (line 1065) `#define LNX_F_SETFL`
- `LNX_POLLIN` (line 1066) `#define LNX_POLLIN`
- `LNX_POLLOUT` (line 1067) `#define LNX_POLLOUT`
- `LNX_POLLERR` (line 1068) `#define LNX_POLLERR`
- `LNX_POLLHUP` (line 1069) `#define LNX_POLLHUP`
- `LNX_POLLNVAL` (line 1070) `#define LNX_POLLNVAL`
- `LNX_EBADF` (line 1071) `#define LNX_EBADF`
- `LNX_EAGAIN` (line 1072) `#define LNX_EAGAIN`
- `LNX_EFAULT` (line 1073) `#define LNX_EFAULT`
- `LNX_EINVAL` (line 1074) `#define LNX_EINVAL`
- `LNX_EPIPE` (line 1075) `#define LNX_EPIPE`
- `LNX_EDESTADDRREQ` (line 1076) `#define LNX_EDESTADDRREQ`
- `LNX_EMSGSIZE` (line 1077) `#define LNX_EMSGSIZE`
- `LNX_ENOPROTOOPT` (line 1078) `#define LNX_ENOPROTOOPT`
- `LNX_EPROTONOSUPPORT` (line 1079) `#define LNX_EPROTONOSUPPORT`
- `LNX_EOPNOTSUPP` (line 1080) `#define LNX_EOPNOTSUPP`
- `LNX_EAFNOSUPPORT` (line 1081) `#define LNX_EAFNOSUPPORT`
- `LNX_EISCONN` (line 1082) `#define LNX_EISCONN`
- `LNX_ENOTCONN` (line 1083) `#define LNX_ENOTCONN`
- `LNX_ETIMEDOUT` (line 1084) `#define LNX_ETIMEDOUT`
- `LNX_ECONNREFUSED` (line 1085) `#define LNX_ECONNREFUSED`
- `LNX_EALREADY` (line 1086) `#define LNX_EALREADY`
- `LNX_EINPROGRESS` (line 1087) `#define LNX_EINPROGRESS`
- `NET_SEND_FLAGS_OK` (line 1088) `#define NET_SEND_FLAGS_OK`
- `NET_RECV_FLAGS_OK` (line 1089) `#define NET_RECV_FLAGS_OK`
- `LNX_FIONREAD` (line 1663) `#define LNX_FIONREAD`
- `LNX_FIONBIO` (line 1664) `#define LNX_FIONBIO`
- `LNX_FIONCLEX` (line 1665) `#define LNX_FIONCLEX`
- `LNX_FIOCLEX` (line 1666) `#define LNX_FIOCLEX`
- `LNX_ENOTTY` (line 1667) `#define LNX_ENOTTY`

**Structs:**
- `net_arp_entry` (line 95)
- `net_dns_state` (line 221)
- `net_tcp_sock` (line 408)
- `net_udp_dgram` (line 437) - *int           tx_pending; unsigned char tx_buf[NET_TX_MAX]; unsigned int  tx_len; unsigned int  tx_seq; /* Linux socket ABI state (docs/spec/network.md). int           nonblock;   /* O_NONBLOCK on the socket int           cloexec;    /* FD_CLOEXEC as recorded by fcntl/SOCK_CLOEXEC int           connecting; /* a non-blocking connect is in flight int           so_error;   /* pending error for SO_ERROR (positive errno) unsigned long syn_deadline; unsigned long syn_retry; }; /* One received datagram.*
- `net_udp_sock` (line 445) - *int           so_error;   /* pending error for SO_ERROR (positive errno) unsigned long syn_deadline; unsigned long syn_retry; }; /* One received datagram. struct net_udp_dgram { unsigned short len; unsigned short sport; unsigned char  sip[4]; unsigned char  data[NET_UDP_DGRAM_MAX]; }; /* Datagram socket: a bounded ring of received datagrams.*

#### `rtl8139.c`
**Path:** `net/rtl8139.c`

**Functions:**
- `outl_port` (line 29) `static void outl_port(unsigned short port, unsigned int val)` - *Byte/word port I/O comes from kernel.h (outb/inb/outw/inw, same asm). * Only the dword pair stays local: the shared header has no outl/inl.*
- `inl_port` (line 33) `static unsigned int inl_port(unsigned short port)`
- `rtl_reg8` (line 39) `static unsigned char rtl_reg8(unsigned short off)`
- `rtl_reg8_w` (line 40) `static void rtl_reg8_w(unsigned short off, unsigned char v)`
- `rtl_reg16` (line 41) `static unsigned short rtl_reg16(unsigned short off)`
- `rtl_reg16_w` (line 42) `static void rtl_reg16_w(unsigned short off, unsigned short v)`
- `rtl_reg32` (line 43) `static unsigned int rtl_reg32(unsigned short off)`
- `rtl_reg32_w` (line 44) `static void rtl_reg32_w(unsigned short off, unsigned int v)`
- `rtl_find` (line 58) `static unsigned short rtl_find(void)` - *PCI config space lives in drivers/pci.h now (shared with virtio-blk and future devices); only the dword port pair stays * local, passed in as callbacks.*
- `deleted` (line 79) `* been deleted (a second base/per-ms pair beside ktime's is a second
 * clock, and drivers must n...`
- `rtl_present` (line 107) `int rtl_present(void)`
- `rtl_reset` (line 111) `static void rtl_reset(void)`
- `rtl_init` (line 120) `void rtl_init(void)`
- `rtl_tx_wait` (line 168) `static int rtl_tx_wait(unsigned slot, unsigned long deadline)`
- `rtl_send` (line 177) `int rtl_send(const unsigned char *frame, unsigned len)`
- `rtl_get_mac` (line 205) `void rtl_get_mac(unsigned char out[NET_ETH_ALEN])`
- `rtl_iobase` (line 210) `unsigned short rtl_iobase(void)`
- `rtl_counters` (line 214) `void rtl_counters(unsigned int *tx_frames, unsigned int *rx_frames)`
- `rtl_poll` (line 238) `void rtl_poll(void)`

**Macros:**
- `RTL_REG_CR` (line 46) `#define RTL_REG_CR`
- `RTL_REG_TSD0` (line 47) `#define RTL_REG_TSD0`
- `RTL_REG_TSAD0` (line 48) `#define RTL_REG_TSAD0`
- `RTL_REG_RBSTART` (line 49) `#define RTL_REG_RBSTART`
- `RTL_REG_CAPR` (line 50) `#define RTL_REG_CAPR`
- `RTL_REG_CBR` (line 51) `#define RTL_REG_CBR`
- `RTL_REG_9346CR` (line 52) `#define RTL_REG_9346CR`
- `RTL_REG_CONFIG1` (line 53) `#define RTL_REG_CONFIG1`
- `RTL_MIN_FRAME` (line 99) `#define RTL_MIN_FRAME`
- `RTL_TX_YIELD_EVERY` (line 166) `#define RTL_TX_YIELD_EVERY`

#### `tls.c`
**Path:** `net/tls.c`
**File Doc:** *tls.c - TLS 1.2 client sessions for MiniOS.*

**Functions:**
- `tls_fail` (line 25) `static void tls_fail(struct tls_session *s, const char *stage, const char *reason)`
- `tls_fd_of` (line 33) `static int tls_fd_of(const struct tls_session *s)`
- `tls_free_fd` (line 40) `void tls_free_fd(int fd)`
- `tls_aad` (line 52) `static void tls_aad(unsigned char aad[13], int type, unsigned long long seq,
                    ...` - *Build the TLS 1.2 AEAD additional data: seq(8) || type || 0303 || * TLSCompressed.length (the plaintext length, RFC 5288 section 3).*
- `tls_send_record` (line 66) `static int tls_send_record(struct tls_session *s, int type,
                           const unsi...` - *Send one record: header || nonce_explicit(8) || ciphertext || tag. The nonce_explicit is the sequence number (RFC 5288 allows it and * OpenSSL uses it); the nonce is salt || nonce_explicit.*
- `tls_send_raw_record` (line 95) `static int tls_send_raw_record(struct tls_session *s, int type,
                               co...` - *for (i = 0; i < 8; i++) buf[5 + i] = (unsigned char)(s->cli_seq >> (56 - i * 8)); TLS_MEMCPY(nonce, s->cli_salt, 4); TLS_MEMCPY(nonce + 4, buf + 5, 8); if (aes128_gcm_seal_core(s->cli_key, nonce, aad, 13, payload, (unsigned)len, buf + 5 + 8, buf + 5 + 8 + len) != 0) return -1; s->cli_seq++; if (TLS_SEND(tls_fd_of(s), (const char *)buf, total) != total) return -1; return 0; } /* Send one plaintext record (ChangeCipherSpec is never encrypted).*
- `tls_read_record` (line 114) `static int tls_read_record(struct tls_session *s, int fd, int deadline_ms)` - *Read one record: header into s->rec_hdr, payload into s->rec. Returns: 1 = record ready, 0 = clean TCP EOF, -1 = torn record or bad header, -2 = timeout. A non-positive deadline blocks forever * (application-data reads behave like plain TCP).*
- `exchange` (line 173) `* key exchange (ClientHello, ClientKeyExchange) go out in plaintext
 * records, as TLS 1.2 requir...`
- `build_client_hello` (line 190) `static int build_client_hello(struct tls_session *s, unsigned char *out)` - *const unsigned char *body, int len) { if (len < 0 || len > 1024) return -1; s->pt[0] = (unsigned char)type; s->pt[1] = (unsigned char)(len >> 16); s->pt[2] = (unsigned char)(len >> 8); s->pt[3] = (unsigned char)len; TLS_MEMCPY(s->pt + 4, body, (unsigned)len); sha256_update(&s->hs_hash, s->pt, (unsigned)(len + 4)); if (!s->keys_ready) return tls_send_raw_record(s, TLS_CT_HANDSHAKE, s->pt, len + 4); return tls_send_record(s, TLS_CT_HANDSHAKE, s->pt, len + 4); } /* ClientHello body (without the handshake header). Returns length.*
- `client_finish_flight` (line 244) `static int client_finish_flight(struct tls_session *s)` - *out[pos++] = 0x00; out[pos++] = 0x06; out[pos++] = 0x04; out[pos++] = 0x01;   /* rsa_pkcs1_sha256 out[pos++] = 0x04; out[pos++] = 0x03;   /* ecdsa_p256_sha256 out[pos++] = 0x05; out[pos++] = 0x03;   /* ecdsa_p384_sha384 { int extlen = pos - ext_start - 2; out[ext_start] = (unsigned char)(extlen >> 8); out[ext_start + 1] = (unsigned char)extlen; } } return pos; } /* Derive all keys and send ClientKeyExchange, CCS, Finished.*
- `parse_server_hello` (line 340) `static int parse_server_hello(struct tls_session *s,
                              const unsigned...`
- `parse_certificate` (line 370) `static int parse_certificate(struct tls_session *s,
                             const unsigned c...`
- `parse_server_key_exchange` (line 401) `static int parse_server_key_exchange(struct tls_session *s,
                                     ...`
- `tls_handshake` (line 466) `int tls_handshake(int fd, const char *host)`
- `tls_send` (line 687) `int tls_send(int fd, const char *buf, int len)`
- `tls_recv` (line 696) `int tls_recv(int fd, char *buf, int len)`
- `tls_sys_handshake` (line 772) `long tls_sys_handshake(long fd, long host)` - *if !defined(TLS_TEST) && !defined(TLS_RING3)*
- `tls_sys_send` (line 777) `long tls_sys_send(long fd, long buf, long len)`
- `tls_sys_recv` (line 782) `long tls_sys_recv(long fd, long buf, long len)`
- `tls_rdtsc` (line 789) `static inline unsigned long long tls_rdtsc(void)`
- `tls_random` (line 795) `void tls_random(unsigned char *out, unsigned len)`
- `outb` (line 810) `static inline void outb(unsigned short port, unsigned char v)` - *unsigned long long seed = tls_rdtsc() ^ ((unsigned long long)net_time_ms() << 33); unsigned i; static unsigned long long counter = 0x6D696E69544C53ULL; counter ^= seed; for (i = 0; i < len; i++) { seed = seed * 6364136223846793005ULL + 1442695040888963407ULL; out[i] = (unsigned char)((seed >> 33) ^ (counter >> (i & 7) * 8)); counter = counter * 6364136223846793005ULL + 1; } } /* The port helpers in net.c are static; these live here for the RTC. ifndef PORT_IO_DEFINED define PORT_IO_DEFINED*
- `inb` (line 813) `static inline unsigned char inb(unsigned short port)`
- `cmos_read` (line 821) `static inline unsigned char cmos_read(unsigned char reg)` - */* The port helpers in net.c are static; these live here for the RTC. #ifndef PORT_IO_DEFINED #define PORT_IO_DEFINED static inline void outb(unsigned short port, unsigned char v) { __asm__ volatile("outb %0, %1" : : "a"(v), "Nd"(port)); } static inline unsigned char inb(unsigned short port) { unsigned char v; __asm__ volatile("inb %1, %0" : "=a"(v) : "Nd"(port)); return v; } #endif /* CMOS RTC -> days since epoch. Registers are BCD.*
- `tls_now_days` (line 826) `long tls_now_days(void)`
- `number` (line 64) `* The nonce_explicit is the sequence number (RFC 5288 allows it and * OpenSSL uses it);`

**Macros:**
- `PORT_IO_DEFINED` (line 809) `#define PORT_IO_DEFINED`

#### `tls_crypto.c`
**Path:** `net/tls_crypto.c`
**File Doc:** *tls_crypto.c - the crypto behind the kernel TLS 1.2 client.*

**Functions:**
- `sha256_rotr` (line 33) `static unsigned sha256_rotr(unsigned x, unsigned n)`
- `sha256_init` (line 37) `void sha256_init(struct sha256_ctx *c)`
- `sha256_block` (line 50) `static void sha256_block(struct sha256_ctx *c, const unsigned char *p)`
- `sha256_update` (line 80) `void sha256_update(struct sha256_ctx *c, const unsigned char *data, unsigned len)`
- `sha256_final` (line 105) `void sha256_final(struct sha256_ctx *c, unsigned char out[32])`
- `sha256` (line 126) `void sha256(const unsigned char *data, unsigned len, unsigned char out[32])`
- `hmac_sha256` (line 135) `void hmac_sha256(const unsigned char *key, unsigned klen,
                 const unsigned char *d...`
- `p_hash` (line 165) `static void p_hash(const unsigned char *secret, unsigned secret_len,
                   const uns...`
- `tls_prf` (line 188) `void tls_prf(const unsigned char *secret, unsigned secret_len,
             const char *label, co...`
- `aes_xtime` (line 230) `static unsigned aes_xtime(unsigned x)`
- `aes_key_expand` (line 235) `static void aes_key_expand(const unsigned char key[16], unsigned rk[44])`
- `aes_mixcol` (line 253) `static void aes_mixcol(unsigned a0, unsigned a1, unsigned a2, unsigned a3,
                      ...`
- `aes128_encrypt_block` (line 263) `void aes128_encrypt_block(const unsigned char key[16],
                          const unsigned c...`
- `gf_shift_right` (line 321) `static gf128 gf_shift_right(gf128 v)`
- `gf_mul` (line 334) `static gf128 gf_mul(gf128 z, gf128 h)` - *z = z * h, in GF(2^128), MSB-first. Branches on z bits (public: * AAD/ciphertext), never on h bits (secret).*
- `gf_put` (line 351) `static gf128 gf_put(const unsigned char *p)`
- `ghash_blocks` (line 361) `static gf128 ghash_blocks(gf128 z, gf128 h, const unsigned char *data, unsigned len)`
- `gcm_tag_core` (line 384) `static void gcm_tag_core(const unsigned char key[16],
                         const unsigned cha...` - *if (len > 0) { unsigned char pad[16]; gf128 b; TLS_MEMSET(pad, 0, 16); TLS_MEMCPY(pad, data, len); b = gf_put(pad); z.lo ^= b.lo; z.hi ^= b.hi; z = gf_mul(z, h); } return z; } /* Compute GCM tag for aad || ct (ct already ciphertext).*
- `gcm_ctr_core` (line 427) `static void gcm_ctr_core(const unsigned char key[16],
                         const unsigned cha...`
- `tls_nonce` (line 450) `static void tls_nonce(const unsigned char salt[4], unsigned long long seq,
                      ...` - *TLS_MEMCPY(blk, nonce, 12); blk[12] = (unsigned char)(ctr >> 24); blk[13] = (unsigned char)(ctr >> 16); blk[14] = (unsigned char)(ctr >> 8); blk[15] = (unsigned char)(ctr); aes128_encrypt_block(key, blk, crypt); if (take > 16) take = 16; for (i = 0; i < (int)take; i++) out[off + i] = in[off + i] ^ crypt[i]; off += take; ctr++; } } /* TLS nonce: 4-byte implicit salt || 8-byte sequence number.*
- `gcm_tag` (line 457) `static void gcm_tag(const unsigned char key[16], const unsigned char salt[4],
                   ...`
- `gcm_ctr` (line 467) `static void gcm_ctr(const unsigned char key[16], const unsigned char salt[4],
                   ...`
- `aes128_gcm_seal` (line 475) `int aes128_gcm_seal(const unsigned char key[16],
                    const unsigned char salt[4],...`
- `aes128_gcm_open` (line 487) `int aes128_gcm_open(const unsigned char key[16],
                    const unsigned char salt[4],...`
- `aes128_gcm_seal_core` (line 505) `int aes128_gcm_seal_core(const unsigned char key[16],
                         const unsigned cha...`
- `aes128_gcm_open_core` (line 516) `int aes128_gcm_open_core(const unsigned char key[16],
                         const unsigned cha...`
- `bn_zero` (line 537) `static void bn_zero(unsigned *a, int nw)`
- `bn_is_zero` (line 542) `static int bn_is_zero(const unsigned *a, int nw)`
- `bn_cmp` (line 549) `static int bn_cmp(const unsigned *a, const unsigned *b, int nw)`
- `bn_add` (line 559) `static unsigned bn_add(const unsigned *a, const unsigned *b, unsigned *r, int nw)` - *for (i = 0; i < nw; i++) v |= a[i]; return v == 0; } static int bn_cmp(const unsigned *a, const unsigned *b, int nw) { int i; for (i = nw - 1; i >= 0; i--) { if (a[i] < b[i]) return -1; if (a[i] > b[i]) return 1; } return 0; } /* r = a + b; returns carry out.*
- `bn_sub` (line 571) `static unsigned bn_sub(const unsigned *a, const unsigned *b, unsigned *r, int nw)` - */* r = a + b; returns carry out. static unsigned bn_add(const unsigned *a, const unsigned *b, unsigned *r, int nw) { unsigned long long carry = 0; int i; for (i = 0; i < nw; i++) { unsigned long long t = (unsigned long long)a[i] + b[i] + carry; r[i] = (unsigned)t; carry = t >> 32; } return (unsigned)carry; } /* r = a - b; a must be >= b; returns borrow (0 = fine).*
- `bn_dbl_mod` (line 584) `static void bn_dbl_mod(const unsigned *a, const unsigned *n, const unsigned *v,
                 ...` - *r = 2a mod n, for a < n. v = 2^(32nw) mod n = 2^(32nw) - n (the * Montgomery "one"): 2a + carry means 2a - 2^(32nw) + v = 2a - n < n.*
- `bn_mont_mul` (line 596) `static void bn_mont_mul(const unsigned *a, const unsigned *b, const unsigned *n,
                ...` - *Montgomery multiplication. n is odd, n0inv = -n^(-1) mod 2^32. r = a*b*R^-1 mod n, R = 2^(32nw). * a, b < n.*
- `bn_mont_n0inv` (line 635) `static unsigned bn_mont_n0inv(unsigned n0)` - *carry = v >> 32; } s = (unsigned long long)t[nw] + carry; t[nw - 1] = (unsigned)s; t[nw] = t[nw + 1] + (unsigned)(s >> 32); } if (t[nw] || bn_cmp(t, n, nw) >= 0) { bn_sub(t, n, r, nw); } else { for (i = 0; i < nw; i++) r[i] = t[i]; } } /* -n^(-1) mod 2^32 via Newton iteration (n0 must be odd).*
- `bn_mont_r2` (line 643) `static void bn_mont_r2(const unsigned *n, const unsigned *v, int nw,
                       unsig...` - *} else { for (i = 0; i < nw; i++) r[i] = t[i]; } } /* -n^(-1) mod 2^32 via Newton iteration (n0 must be odd). static unsigned bn_mont_n0inv(unsigned n0) { unsigned inv = 1; int i; for (i = 0; i < 5; i++) inv *= 2 - n0 * inv; return 0 - inv; } /* R^2 mod n, R = 2^(32nw): 64*nw doublings from 1.*
- `bn_from_be` (line 663) `static void bn_from_be(const unsigned char *bytes, unsigned len,
                       unsigned ...`
- `bn_to_be` (line 671) `static void bn_to_be(const unsigned *a, unsigned char *out, unsigned len)`
- `mont_init` (line 677) `static void mont_init(struct mont_ctx *m, const unsigned char *p_bytes,
                      uns...`
- `mont_to` (line 689) `static void mont_to(struct mont_ctx *m, const unsigned *a, unsigned *r)`
- `mont_from` (line 693) `static void mont_from(struct mont_ctx *m, const unsigned *a, unsigned *r)`
- `mont_mul` (line 700) `static void mont_mul(struct mont_ctx *m, const unsigned *a, const unsigned *b,
                  ...`
- `mont_sqr` (line 705) `static void mont_sqr(struct mont_ctx *m, const unsigned *a, unsigned *r)`
- `mont_add` (line 712) `static void mont_add(struct mont_ctx *m, const unsigned *a, const unsigned *b,
                  ...` - *Field add/sub over the mont modulus (in Montgomery domain). The carry of a+b is corrected with one = 2^(32nw) - n, and a - b < 0 is * p - (b - a); neither path can overflow one word.*
- `mont_sub` (line 721) `static void mont_sub(struct mont_ctx *m, const unsigned *a, const unsigned *b,
                  ...`
- `mont_inv` (line 736) `static void mont_inv(struct mont_ctx *m, const unsigned *a, unsigned *r)` - *Field inverse via Fermat: a^(p-2) mod p (a in Montgomery domain; * the result stays in Montgomery domain).*
- `ec_init` (line 848) `static void ec_init(struct ec_curve *c, const unsigned char *p,
                    const unsigne...`
- `jpt_is_inf` (line 865) `static int jpt_is_inf(const struct jpt *p, int nw)`
- `jpt_set_inf` (line 869) `static void jpt_set_inf(struct jpt *p, int nw)`
- `jpt_copy` (line 875) `static void jpt_copy(struct jpt *d, const struct jpt *s, int nw)`
- `jpt_cswap` (line 885) `static void jpt_cswap(struct jpt *a, struct jpt *b, unsigned mask, int nw)` - *bn_zero(p->y, nw); bn_zero(p->z, nw); } static void jpt_copy(struct jpt *d, const struct jpt *s, int nw) { int i; for (i = 0; i < nw; i++) { d->x[i] = s->x[i]; d->y[i] = s->y[i]; d->z[i] = s->z[i]; } } /* Constant-time swap of two points on a 0/~0 mask.*
- `jpt_dbl` (line 896) `static void jpt_dbl(struct ec_curve *c, const struct jpt *p1, struct jpt *p3)` - *} /* Constant-time swap of two points on a 0/~0 mask. static void jpt_cswap(struct jpt *a, struct jpt *b, unsigned mask, int nw) { int i; for (i = 0; i < nw; i++) { unsigned t; t = (a->x[i] ^ b->x[i]) & mask; a->x[i] ^= t; b->x[i] ^= t; t = (a->y[i] ^ b->y[i]) & mask; a->y[i] ^= t; b->y[i] ^= t; t = (a->z[i] ^ b->z[i]) & mask; a->z[i] ^= t; b->z[i] ^= t; } } /* P3 = 2 * P1 (a = p - 3: E = 3(A - Z1^4)).*
- `jpt_add` (line 936) `static void jpt_add(struct ec_curve *c, const struct jpt *p1, const struct jpt *p2,
             ...` - *mont_sqr(m, E, F); mont_add(m, D, D, t);          /* 2D mont_sub(m, F, t, p3->x);      /* X3 = F - 2D mont_sub(m, D, p3->x, t); mont_mul(m, E, t, t2); mont_add(m, C, C, t); mont_add(m, t, t, t); mont_add(m, t, t, t);          /* 8C mont_sub(m, t2, t, p3->y);     /* Y3 = E(D-X3) - 8C mont_mul(m, p1->y, p1->z, YZ); mont_add(m, YZ, YZ, p3->z);    /* Z3 = 2YZ } /* P3 = P1 + P2 (generic Jacobian add).*
- `jpt_scalar_mult` (line 980) `static void jpt_scalar_mult(struct ec_curve *c, const struct jpt *base,
                         ...` - *Constant-iteration scalar multiplication: the classic ladder. * Fixed iteration count, no table lookups indexed by secret bits.*
- `jpt_to_affine` (line 1007) `static void jpt_to_affine(struct ec_curve *c, const struct jpt *p,
                          unsi...` - *Affine from Jacobian: x = X/Z^2, y = Y/Z^3. Bytes out are big-endian. * y_out may be NULL when only the x coordinate is wanted.*
- `jpt_from_affine` (line 1032) `static int jpt_from_affine(struct ec_curve *c, const unsigned char *x_bytes,
                    ...` - *Affine from bytes with on-curve validation. Returns 0 when the point * is valid and not the point at infinity.*
- `ec_curve_by_id` (line 1076) `static struct ec_curve *ec_curve_by_id(int curve)`
- `ec_boot` (line 1080) `static void ec_boot(void)`
- `p256_scalar_mult` (line 1088) `int p256_scalar_mult(const unsigned char scalar[32],
                     const unsigned char qx[...`
- `p384_scalar_mult` (line 1101) `int p384_scalar_mult(const unsigned char scalar[48],
                     const unsigned char qx[...`
- `p256_ecdh` (line 1114) `int p256_ecdh(const unsigned char priv[32],
              const unsigned char peer_x[32], const u...`
- `der_parse_sig` (line 1129) `static int der_parse_sig(const unsigned char *sig, unsigned sig_len,
                         con...`
- `ecdsa_verify` (line 1163) `int ecdsa_verify(int curve, const unsigned char pub_x[], const unsigned char pub_y[],
           ...`
- `rsa_verify_digestinfo` (line 1261) `static int rsa_verify_digestinfo(const unsigned char *em, unsigned em_len,
                      ...` - *EMSA-PKCS1-v1_5 DigestInfo check for an arbitrary hash: the encoding is 00 01 FF.. 00 <prefix><digest>. Constant-time: every byte of the * encoding contributes to the diff.*
- `rsa_pkcs1_verify_raw` (line 1285) `static int rsa_pkcs1_verify_raw(const unsigned char *n, unsigned n_len,
                         ...` - *diff |= em[i] ^ 0xff; } if (i >= em_len) return -1;         /* no separator if (i < 10) return -1;              /* padding too short (RFC 8017) i++; if (em_len - i != prefix_len + digest_len) return -1; for (i = 0; i < prefix_len; i++) diff |= em[em_len - prefix_len - digest_len + i] ^ prefix[i]; for (i = 0; i < digest_len; i++) diff |= em[em_len - digest_len + i] ^ digest[i]; return diff ? -1 : 0; } /* Shared RSA PKCS#1 v1.5 core: m^e mod n, EMSA-PKCS1-v1_5 in em.*
- `rsa_pkcs1_verify_sha256` (line 1326) `int rsa_pkcs1_verify_sha256(const unsigned char *n, unsigned n_len,
                            c...`
- `rsa_pkcs1_verify_sha384` (line 1340) `int rsa_pkcs1_verify_sha384(const unsigned char *n, unsigned n_len,
                            c...`
- `sha384_rotr` (line 1386) `static unsigned long long sha384_rotr(unsigned long long x, unsigned n)`
- `sha384_raw` (line 1390) `static void sha384_raw(const unsigned char *data, unsigned len,
                       unsigned c...`
- `sha384` (line 1506) `void sha384(const unsigned char *data, unsigned len, unsigned char out[48])`
- `p256_point_valid` (line 1512) `int p256_point_valid(const unsigned char x[32], const unsigned char y[32])`
- `p256_pub` (line 1520) `int p256_pub(const unsigned char priv[32],
             unsigned char x[32], unsigned char y[32])`
- `p256_scalar_valid` (line 1539) `int p256_scalar_valid(const unsigned char scalar[32])`
- `word` (line 326) `* of the low word (hi holds bits 64..127, lo bits 0..63). Masked in, * so the shift never branches on key bits. */ r.hi = (v.hi >> 1) ^ (0xE100000000000000ULL & mask);`

**Macros:**
- `TLS_BN_WORDS` (line 535) `#define TLS_BN_WORDS`

**Structs:**
- `mont_ctx` (line 655)
- `ec_curve` (line 838)
- `jpt` (line 859) - *Jacobian point: three coordinates in Montgomery domain, nw words each. * The point at infinity has Z = 0.*
- `gf128` (line 316)

#### `tls_x509.c`
**Path:** `net/tls_x509.c`
**File Doc:** *tls_x509.c - minimal X.509 DER parsing and chain verification.*

**Functions:**
- `oid_eq` (line 36) `static int oid_eq(const unsigned char *bytes, unsigned len,
                  const unsigned char...`
- `der_next` (line 51) `static int der_next(const unsigned char *p, unsigned limit, unsigned *pos,
                    st...` - *Parse the TLV at p[pos]; advances pos to the first byte after it. * Returns 0 on success, -1 on any bound violation.*
- `der_container` (line 82) `static int der_container(const unsigned char *p, unsigned limit, unsigned *pos,
                 ...` - *len = (len << 8) | p[(*pos)++]; } } else { len = p[(*pos)++]; } if (len > limit - *pos) return -1; out->val = p + *pos; out->len = len; out->tag = tag; pos += len; return 0; } /* A constructed SEQUENCE/SET whose content must parse as children.*
- `days_from_civil` (line 94) `static long days_from_civil(int y, int m, int d)`
- `der_time_to_days` (line 106) `static long der_time_to_days(const struct der_tlv *t)` - */* ---- Time ---- static long days_from_civil(int y, int m, int d) { long era, doe, yoe; int doy; y -= m <= 2 ? 1 : 0; era = (y >= 0 ? y : y - 399) / 400; yoe = y - (int)era * 400; doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; doe = (long)yoe * 365 + yoe / 4 - yoe / 100 + doy; return era * 146097 + doe - 719468; } /* UTCTime / GeneralizedTime "....Z" -> days since epoch, or -1.*
- `name_find_cn` (line 135) `static int name_find_cn(const unsigned char *p, unsigned limit,
                        struct x5...` - *} if (mon < 1 || mon > 12 || day < 1 || day > 31 || year < 1970 || year > 2100) return -1; return days_from_civil(year, mon, day); } /* ---- Name / extensions ---- struct x509_name { unsigned char cn[64]; unsigned cn_len; }; /* Find the first CN in an RDNSequence. Returns 0 when found.*
- `san_add` (line 178) `static void san_add(struct x509_sans *out, const unsigned char *v, unsigned len)`
- `san_parse` (line 186) `static void san_parse(const unsigned char *p, unsigned limit,
                      struct x509_s...` - *struct x509_sans { unsigned char dns[TLS_SAN_MAX][64]; unsigned      len[TLS_SAN_MAX]; int           count; }; static void san_add(struct x509_sans *out, const unsigned char *v, unsigned len) { if (out->count >= TLS_SAN_MAX || len >= 64) return; TLS_MEMCPY(out->dns[out->count], v, len); out->len[out->count] = len; out->count++; } /* Walk the SAN extension (2.5.29.17) OCTET STRING body.*
- `spki_parse` (line 203) `static int spki_parse(const unsigned char *p, unsigned limit,
                      struct tls_pu...` - *unsigned seq_len, pos = 0; out->count = 0; if (der_container(p, limit, &pos, &seq, &seq_len) != 0) return; pos = 0; while (pos < seq_len) { struct der_tlv t; if (der_next(seq, seq_len, &pos, &t) != 0) return; if (t.tag == 0x82) san_add(out, t.val, t.len); /* dNSName } } /* ---- Public key ---- /* SPKI SEQUENCE content: { alg SEQUENCE { OID, params }, BIT STRING }.*
- `cert_parse` (line 279) `static int cert_parse(const unsigned char *der, unsigned len,
                      struct x509_c...`
- `ascii_lower` (line 392) `static int ascii_lower(int c)`
- `host_match_exact` (line 397) `static int host_match_exact(const char *host, const unsigned char *name,
                        ...` - *} } } } return 0; } /* ---- Hostname matching ---- static int ascii_lower(int c) { return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c; } /* Exact match, ASCII case-insensitive.*
- `host_match_wildcard` (line 410) `static int host_match_wildcard(const char *host, const unsigned char *name,
                     ...` - *Wildcard: "*.example.com" matches exactly one label ("a.example.com", * never "a.b.example.com" nor "example.com").*
- `host_matches` (line 431) `static int host_matches(const char *host, const struct x509_cert *leaf)`
- `tls_x509_parse_pubkey` (line 452) `int tls_x509_parse_pubkey(const unsigned char *der, unsigned len,
                          struc...`
- `pubkey_equal` (line 468) `static int pubkey_equal(const struct tls_pubkey *a, const struct tls_pubkey *b)` - *Trust anchors are matched by public key, not by self-signature: a presented root is often a cross-signed copy (signed by a legacy root, e.g. the SSL.com 2022 roots are signed by Comodo AAA), so checking its signature against its own key would reject a perfectly valid anchor. Key equality is safe because every link above the top is still signature-verified: an attacker cannot present a top cert carrying an embedded root's public key unless the chain below it was signed with * that root's private key.*
- `cert_verify_signature` (line 479) `static int cert_verify_signature(const struct x509_cert *cert,
                                 c...` - *signature-verified: an attacker cannot present a top cert carrying an embedded root's public key unless the chain below it was signed with * that root's private key. static int pubkey_equal(const struct tls_pubkey *a, const struct tls_pubkey *b) { if (a->kind != b->kind) return 0; if (a->kind == 0) return a->n_len == b->n_len && a->e_len == b->e_len && TLS_MEMCMP(a->n, b->n, a->n_len) == 0 && TLS_MEMCMP(a->e, b->e, a->e_len) == 0; return TLS_MEMCMP(a->qx, b->qx, 48) == 0 && TLS_MEMCMP(a->qy, b->qy, 48) == 0; } /* Verify one certificate's signature with an issuer public key.*
- `tls_x509_verify_chain` (line 521) `int tls_x509_verify_chain(const unsigned char *chain, unsigned chain_len,
                       ...`

**Macros:**
- `TLS_SAN_MAX` (line 170) `#define TLS_SAN_MAX`

**Structs:**
- `der_tlv` (line 43)
- `x509_name` (line 129)
- `x509_sans` (line 172)
- `x509_cert` (line 265)

#### `doomedit.c`
**Path:** `progs/doomedit/doomedit.c`
**File Doc:** *doomedit.c - tile map editor that builds playable Doom PWADs.*

**Functions:**
- `dmap_thing_type` (line 165) `static int dmap_thing_type(int cell)` - *Thing type ids from the engine mobjinfo table, each with its sprite * verified present in the shareware IWAD.*
- `dmap_push_history` (line 272) `static void dmap_push_history(void)`
- `dmap_undo` (line 289) `static int dmap_undo(void)`
- `dmap_redo` (line 307) `static int dmap_redo(void)`
- `dmap_apply_cell` (line 326) `static void dmap_apply_cell(int r, int c, int brush)` - *dmap_undo_h[dmap_undo_top] = dmap_h; memcpy(dmap_undo_g[dmap_undo_top], dmap_grid, sizeof(dmap_grid)); dmap_undo_top++; } dmap_redo_top--; dmap_w = dmap_redo_w[dmap_redo_top]; dmap_h = dmap_redo_h[dmap_redo_top]; memcpy(dmap_grid, dmap_redo_g[dmap_redo_top], sizeof(dmap_grid)); dmap_anchor_active = 0; dmap_recenter(); return 0; } /** Single-cell paint keeping the one-player / one-exit invariant.*
- `dmap_flood_fill` (line 344) `static void dmap_flood_fill(int sr, int sc, int new_cell)` - *if (brush == DMAP_PLAYER || brush == DMAP_EXIT) { for (rr = 0; rr < dmap_h; rr++) for (cc = 0; cc < dmap_w; cc++) if (dmap_grid[rr][cc] == brush) dmap_grid[rr][cc] = DMAP_FLOOR; } dmap_grid[r][c] = (char)brush; if (brush == DMAP_PLAYER) { dmap_px = (float)c + 0.5f; dmap_py = (float)r + 0.5f; } } /** 4-way flood fill of the connected region holding old_cell.*
- `dmap_draw_line` (line 383) `static void dmap_draw_line(int r0, int c0, int r1, int c1, int cell)` - *if (nr < 0 || nc < 0 || nr >= dmap_h || nc >= dmap_w) continue; if (dmap_grid[nr][nc] != old_cell) continue; dmap_grid[nr][nc] = (char)new_cell; stack_r[top] = nr; stack_c[top] = nc; top++; } } dmap_level_sel = 0; } /** Bresenham line of cells, clipped to the grid.*
- `dmap_draw_rect` (line 411) `static void dmap_draw_rect(int r0, int c0, int r1, int c1, int cell)` - *e2 = err; if (e2 > -dr) { err -= dc; r0 += sr; } if (e2 < dc) { err += dr; c0 += sc; } } dmap_level_sel = 0; } /** Hollow rectangle border between two corners, clipped to the grid.*
- `dmap_reach_map` (line 440) `static void dmap_reach_map(int seen[DMAP_MAX_H][DMAP_MAX_W])` - *for (r = rt; r <= rb; r++) { if (r >= 0 && r < dmap_h && cl >= 0 && cl < dmap_w) { if (dmap_grid[r][cl] != DMAP_PLAYER && dmap_grid[r][cl] != DMAP_EXIT) dmap_grid[r][cl] = (char)cell; } if (r >= 0 && r < dmap_h && cr >= 0 && cr < dmap_w) { if (dmap_grid[r][cr] != DMAP_PLAYER && dmap_grid[r][cr] != DMAP_EXIT) dmap_grid[r][cr] = (char)cell; } } dmap_level_sel = 0; } /** BFS reachability from the player start; seen[] is 1 for reachable.*
- `dmap_path_len` (line 480) `static int dmap_path_len(void)` - *int nr = cr + dirs[k][0], nc = cc + dirs[k][1]; if (nr < 0 || nc < 0 || nr >= dmap_h || nc >= dmap_w) continue; if (seen[nr][nc] || !dmap_walkable(dmap_grid[nr][nc])) continue; seen[nr][nc] = 1; stack_r[top] = nr; stack_c[top] = nc; top++; } } } /** Shortest walkable distance player -> exit in tiles, -1 when broken.*
- `dmap_stats` (line 522) `static void dmap_stats(char *out, int max)` - *if (nr < 0 || nc < 0 || nr >= dmap_h || nc >= dmap_w) continue; if (dist[nr][nc] >= 0 || !dmap_walkable(dmap_grid[nr][nc])) continue; dist[nr][nc] = dist[cr][cc] + 1; qr[tail] = nr; qc[tail] = nc; tail++; } } return -1; } /** Headless stats line for the panel: size, sectors, path, monsters.*
- `dmap_spawn` (line 550) `static long dmap_spawn(const char *path, int argc, const char **argv)` - *} path = dmap_path_len(); if (dmap_validate(msg, sizeof(msg)) == 0) snprintf(out, (size_t)max, "%dx%d %d sect path %d mon %d things %d", dmap_w, dmap_h, dmap_nsectors, path, monsters, things); else snprintf(out, (size_t)max, "%dx%d floor %d path - mon %d: %s", dmap_w, dmap_h, floors, monsters, msg); } /** Forward: the validator lives below the level tables. static int dmap_validate(char *msg, int max); /** Run a program through SYS_SPAWN, preserving the editor.*
- `dmap_vga` (line 561) `static long dmap_vga(int on)` - *static int dmap_validate(char *msg, int max); /** Run a program through SYS_SPAWN, preserving the editor. static long dmap_spawn(const char *path, int argc, const char **argv) { long ret; register long r10 __asm__("r10") = (long)argv; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_SPAWN), "D"(path), "S"((long)0), "d"((long)argc), "r"(r10) : "rcx", "r11", "memory"); return ret; } /** Release or reclaim the display around a spawned child.*
- `dmap_is_wall` (line 570) `static int dmap_is_wall(int row, int col)` - *: "rcx", "r11", "memory"); return ret; } /** Release or reclaim the display around a spawned child. static long dmap_vga(int on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_VGA_MODE), "D"((long)on) : "rcx", "r11", "memory"); return ret; } /** True for solid cells; out of bounds counts as wall to stay closed.*
- `dmap_walkable` (line 577) `static int dmap_walkable(int cell)` - *__asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_VGA_MODE), "D"((long)on) : "rcx", "r11", "memory"); return ret; } /** True for solid cells; out of bounds counts as wall to stay closed. static int dmap_is_wall(int row, int col) { if (row < 0 || col < 0 || row >= dmap_h || col >= dmap_w) return 1; return dmap_grid[row][col] == DMAP_WALL; } /** True for cells the player can stand on: floor, markers and things.*
- `dmap_cell_class` (line 583) `static int dmap_cell_class(int cell)` - */** True for solid cells; out of bounds counts as wall to stay closed. static int dmap_is_wall(int row, int col) { if (row < 0 || col < 0 || row >= dmap_h || col >= dmap_w) return 1; return dmap_grid[row][col] == DMAP_WALL; } /** True for cells the player can stand on: floor, markers and things. static int dmap_walkable(int cell) { return cell == DMAP_FLOOR || cell == DMAP_EXIT || cell == DMAP_DOOR || cell == DMAP_DARK || cell == DMAP_NUKE || dmap_thing_type(cell) > 0; } /** Sector class of a walkable cell: doors stand alone, styles never merge.*
- `dmap_cell_color` (line 594) `static struct nk_color dmap_cell_color(int cell)` - *} /** Sector class of a walkable cell: doors stand alone, styles never merge. static int dmap_cell_class(int cell) { if (cell == DMAP_DOOR) return 1; if (cell == DMAP_DARK) return 2; if (cell == DMAP_NUKE) return 3; return 0; } /** Canvas ink per cell category, so the palette reads at a glance.*
- `dmap_new` (line 639) `static void dmap_new(void)` - *case DMAP_RSUIT: case DMAP_CMAP: case DMAP_LAMP: return nk_rgb(200, 90, 200); case DMAP_KEYB: case DMAP_KEYR: case DMAP_KEYY: return nk_rgb(240, 240, 240); case DMAP_DOOR: return nk_rgb(220, 140, 40); case DMAP_DARK: return nk_rgb(40, 40, 56); case DMAP_NUKE: return nk_rgb(60, 160, 60); default: return nk_rgb(64, 64, 64); } } /** Fill the grid with floor and a solid border.*
- `dmap_recenter` (line 804) `static void dmap_recenter(void)` - *"########################", "#P.....####............#", "#..i...+......,,,,,....#", "#......####...,,,,,...E#", "#..m...#~~~#..,,,,,....#", "#......#~~~+....a......#", "#..s...#~~~#..d........#", "#......#~~~#...........#", "########################", 0 } }; /** Move the preview camera onto the player start tile.*
- `dmap_load_preset` (line 816) `static int dmap_load_preset(int idx)` - */** Move the preview camera onto the player start tile. static void dmap_recenter(void) { int r, c; for (r = 0; r < dmap_h; r++) for (c = 0; c < dmap_w; c++) if (dmap_grid[r][c] == DMAP_PLAYER) { dmap_px = (float)c + 0.5f; dmap_py = (float)r + 0.5f; } dmap_angle = 0.0f; } /** Load a bundled level into the grid, fail closed on a bad index.*
- `dmap_rand` (line 849) `static unsigned dmap_rand(void)` - *int ch = dmap_levels[idx][row][k]; if (!dmap_walkable(ch) && ch != DMAP_WALL) return -1; dmap_grid[row][k] = (char)ch; } } dmap_anchor_active = 0; dmap_recenter(); dmap_level_sel = idx + 1; snprintf(dmap_status, sizeof(dmap_status), "level: %s", dmap_level_names[idx]); return 0; } /** Xorshift32: the only RNG the editor needs, no libc state.*
- `dmap_free_cell` (line 857) `static int dmap_free_cell(int *r, int *c)` - *dmap_level_sel = idx + 1; snprintf(dmap_status, sizeof(dmap_status), "level: %s", dmap_level_names[idx]); return 0; } /** Xorshift32: the only RNG the editor needs, no libc state. static unsigned dmap_rand(void) { dmap_rng ^= dmap_rng << 13; dmap_rng ^= dmap_rng >> 17; dmap_rng ^= dmap_rng << 5; return dmap_rng; } /** One random interior floor cell, 0 when it is not floor.*
- `dmap_random_map` (line 871) `static void dmap_random_map(unsigned seed)` - *Procedural map of connected rooms: several non-overlapping rect rooms carved out of solid rock, joined in sequence by L corridors, the player starting in the first room and the exit marker in the last one, with the full thing palette scattered on floor cells. Keeps the first layout the validator accepts; the fallback is the plain room when no attempt passes. Each attempt then gains a wall divider pierced by working doors, dark patches and one nukage pool, * so random maps are multi-sector like the bundled ones.*
- `dmap_load` (line 1077) `static int dmap_load(const char *path)` - *} if (dmap_validate(msg, sizeof(msg)) == 0) { dmap_recenter(); snprintf(dmap_status, sizeof(dmap_status), "random %dx%d %d rooms ok", dmap_w, dmap_h, nrooms); return; } dmap_rng = dmap_rng * 1664525u + 1013904223u; } dmap_new(); snprintf(dmap_status, sizeof(dmap_status), "random fell back to plain room"); } /** Load a grid text file, refusing ragged or illegal content.*
- `dmap_save_txt` (line 1129) `static int dmap_save_txt(const char *path)` - *if (row < 3 || w < 3 || w > DMAP_MAX_W) return -1; dmap_push_history(); dmap_anchor_active = 0; dmap_w = w; dmap_h = row; for (r = 0; r < dmap_h; r++) for (c = 0; c < dmap_w; c++) dmap_grid[r][c] = tmp[r][c]; dmap_recenter(); return 0; } /** Store the grid as text for later editing sessions.*
- `dmap_label_regions` (line 1163) `static int dmap_label_regions(void)` - *Sector table backing the multi-sector exporter. Regions are same-class floor areas (doors stand alone, dark and nukage never merge); every region becomes one sector, so light, heights and flats vary per room * while the BSP stays one trivial subsector. static int dmap_sect[DMAP_MAX_H][DMAP_MAX_W]; static int dmap_sec_floor[DMAP_MAX_SECTORS]; static int dmap_sec_ceil[DMAP_MAX_SECTORS]; static int dmap_sec_light[DMAP_MAX_SECTORS]; static int dmap_sec_special[DMAP_MAX_SECTORS]; static int dmap_sec_tag[DMAP_MAX_SECTORS]; static const char *dmap_sec_flat[DMAP_MAX_SECTORS]; static const char *dmap_sec_skin[DMAP_MAX_SECTORS]; /** Flood same-class walkable cells into sector ids; walls stay -1.*
- `dmap_validate` (line 1244) `static int dmap_validate(char *msg, int max)` - *dmap_sec_floor[nsec] = DMAP_FLOOR_H; dmap_sec_ceil[nsec] = DMAP_CEIL_H; dmap_sec_flat[nsec] = DMAP_FLOOR_FLAT; dmap_sec_light[nsec] = DMAP_LIGHT; dmap_sec_special[nsec] = 0; dmap_sec_skin[nsec] = DMAP_WALL_MID; } nsec++; } dmap_nsectors = nsec; return 0; } /** Validate the map, reporting the first problem for the status line.*
- `dmap_w8` (line 1317) `static void dmap_w8(unsigned v)`
- `dmap_w16` (line 1318) `static void dmap_w16(int v)`
- `dmap_w32` (line 1322) `static void dmap_w32(int v)`
- `dmap_wtex` (line 1326) `static void dmap_wtex(const char *name)`
- `dmap_seg_angle` (line 1333) `static int dmap_seg_angle(int dx, int dy)` - *dmap_wp++ = (unsigned char)(v & 0xFF); dmap_wp++ = (unsigned char)((v >> 8) & 0xFF); } static void dmap_w32(int v) { dmap_w16(v & 0xFFFF); dmap_w16((v >> 16) & 0xFFFF); } static void dmap_wtex(const char *name) { int k; for (k = 0; k < 8; k++) dmap_w8(name[k] ? (unsigned)name[k] : 0u); } /** Stored short angle for a seg direction, matching the engine loader.*
- `dmap_build_wad` (line 1343) `static int dmap_build_wad(int *size_out)` - *Compile the grid into a vanilla multi-sector E1M1 PWAD image. Every region and door block is its own sector; all segs share one subsector * under a trivial root node, which needs no ordering.*
- `dmap_export_wad` (line 1660) `static int dmap_export_wad(const char *path)` - *dmap_wp = dmap_wad; dmap_w8('P'); dmap_w8('W'); dmap_w8('A'); dmap_w8('D'); dmap_w32(11); dmap_w32(table_off); size_out = total; } } return 0; } /** Write the compiled level to a snapshot path in /saves.*
- `dmap_check_wad` (line 1675) `static int dmap_check_wad(const char *path)` - *int size = 0; FILE *fp; size_t wrote; if (dmap_build_wad(&size) != 0) return -1; fp = fopen(path, "wb"); if (!fp) return -1; wrote = fwrite(dmap_wad, 1, (size_t)size, fp); fclose(fp); return wrote == (size_t)size ? 0 : -1; } /** Validate a PWAD file header and lump census, headless.*
- `dmap_preview` (line 1693) `static void dmap_preview(struct nk_command_buffer *canvas, struct nk_rect area)` - *if (!fp) return -1; if (fread(head, 1, 12, fp) != 12) { fclose(fp); return -1; } fclose(fp); magic_ok = head[0] == 'P' && head[1] == 'W' && head[2] == 'A' && head[3] == 'D'; if (!magic_ok) return -1; return 0; } /** DDA raycaster preview in the raycastlib grid style, integer math free.*
- `dmap_brush_combo` (line 1760) `static void dmap_brush_combo(struct nk_context *ctx)` - *dist = 0.05f; line_h = (int)(area.h / dist); if (line_h > (int)area.h) line_h = (int)area.h; y0 = (int)(area.y + (area.h - (float)line_h) / 2.0f); if (side == 0) shade = nk_rgb(176, 150, 120); else shade = nk_rgb(128, 106, 84); nk_fill_rect(canvas, nk_rect(area.x + (float)col * cell, (float)y0, cell + 1.0f, (float)line_h), 0.0f, shade); } } /** Brush combobox above the canvas: one row for the whole palette.*
- `dmap_canvas` (line 1773) `static void dmap_canvas(struct nk_context *ctx)` - *Paintable tile canvas with per-category colors. The caller owns the layout row and column: this only claims the widget, draws and paints. Tools: paint one cell, fill the connected region, or two clicks for a * line / rectangle border. Single edits stay single-undo gestures.*
- `dmap_preview_row` (line 1863) `static void dmap_preview_row(struct nk_context *ctx)` - *dmap_draw_rect(dmap_anchor_r, dmap_anchor_c, r, c, dmap_brush); dmap_anchor_active = 0; dmap_level_sel = 0; } } else { dmap_push_history(); dmap_apply_cell(r, c, dmap_brush); dmap_level_sel = 0; } } } } /** Preview strip with turn and step controls bound to the player.*
- `dmap_run_map` (line 1898) `static void dmap_run_map(void)` - *} if (nk_button_label(ctx, "Reset")) { int r, c; for (r = 0; r < dmap_h; r++) for (c = 0; c < dmap_w; c++) if (dmap_grid[r][c] == DMAP_PLAYER) { dmap_px = (float)c + 0.5f; dmap_py = (float)r + 0.5f; } dmap_angle = 0.0f; } } /** Export the snapshot pair and boot Doom on the fresh PWAD.*
- `dmap_scancode` (line 2037) `static void dmap_scancode(int code, int make, int e0, void *ud)`
- `dmap_gui_run` (line 2056) `static void dmap_gui_run(void)` - *dmap_ctrl_held = make; return; } if (!make || !dmap_ctrl_held) return; if (code == 0x13) dmap_run_requested = 1; else if (code == 0x2C) dmap_undo_requested = 1; else if (code == 0x15) dmap_redo_requested = 1; } /** Frame loop owning the display exactly like the sibling editors.*
- `dmap_demo_room` (line 2110) `static void dmap_demo_room(void)` - *nk_set_window_origin(origin[0], origin[1]); nk_clear(&ctx); { unsigned t0 = (unsigned)nk_sys_time_ms(); while ((unsigned)nk_sys_time_ms() - t0 < DMAP_FRAME_MS) __asm__ volatile("pause"); } } nk_free(&ctx); nk_sys_kbd_raw(0); nk_sys_vga_mode(0); } /** Headless demo room shared by --demo and the selftest build check.*
- `dmap_selftest` (line 2122) `static int dmap_selftest(void)` - */** Headless demo room shared by --demo and the selftest build check. static void dmap_demo_room(void) { dmap_w = 9; dmap_h = 7; dmap_new(); dmap_grid[1][2] = DMAP_FLOOR; dmap_grid[2][7] = DMAP_EXIT; dmap_grid[3][5] = DMAP_IMP; dmap_grid[4][3] = DMAP_MEDI; dmap_grid[2][6] = DMAP_SHELLS; } /** Render one UI frame and prove the composite plus the PWAD builder.*
- `main` (line 2246) `int main(int argc, char **argv)`
- `areas` (line 1150) `* floor areas (doors stand alone, dark and nukage never merge);`

**Macros:**
- `DMAP_MAX_W` (line 55) `#define DMAP_MAX_W`
- `DMAP_MAX_H` (line 56) `#define DMAP_MAX_H`
- `DMAP_DEF_W` (line 57) `#define DMAP_DEF_W`
- `DMAP_DEF_H` (line 58) `#define DMAP_DEF_H`
- `DMAP_TILE` (line 59) `#define DMAP_TILE`
- `DMAP_CELL_PX` (line 60) `#define DMAP_CELL_PX`
- `DMAP_CANVAS_W` (line 61) `#define DMAP_CANVAS_W`
- `DMAP_PANEL_MIN_H` (line 62) `#define DMAP_PANEL_MIN_H`
- `DMAP_PREV_W` (line 63) `#define DMAP_PREV_W`
- `DMAP_PREV_H` (line 64) `#define DMAP_PREV_H`
- `DMAP_UI_MEMORY` (line 65) `#define DMAP_UI_MEMORY`
- `DMAP_WAD_MAX` (line 66) `#define DMAP_WAD_MAX`
- `DMAP_FNAME_MAX` (line 67) `#define DMAP_FNAME_MAX`
- `DMAP_STATUS_MAX` (line 68) `#define DMAP_STATUS_MAX`
- `DMAP_SLOTS` (line 69) `#define DMAP_SLOTS`
- `DMAP_LEVEL_COUNT` (line 70) `#define DMAP_LEVEL_COUNT`
- `DMAP_RANDOM_ATTEMPTS` (line 71) `#define DMAP_RANDOM_ATTEMPTS`
- `DMAP_MAX_SECTORS` (line 72) `#define DMAP_MAX_SECTORS`
- `DMAP_ROOM_MAX` (line 73) `#define DMAP_ROOM_MAX`
- `DMAP_ROOM_TRIES` (line 74) `#define DMAP_ROOM_TRIES`
- `DMAP_FRAME_MS` (line 75) `#define DMAP_FRAME_MS`
- `DMAP_TURN_STEP` (line 76) `#define DMAP_TURN_STEP`
- `DMAP_MOVE_STEP` (line 77) `#define DMAP_MOVE_STEP`
- `DMAP_FOV_PLANE` (line 78) `#define DMAP_FOV_PLANE`
- `DMAP_MAX_LINES` (line 79) `#define DMAP_MAX_LINES`
- `DMAP_MAX_VERTS` (line 80) `#define DMAP_MAX_VERTS`
- `DMAP_MAX_THINGS` (line 81) `#define DMAP_MAX_THINGS`
- `DMAP_PLAYER_TYPE` (line 82) `#define DMAP_PLAYER_TYPE`
- `DMAP_THING_OPT` (line 83) `#define DMAP_THING_OPT`
- `DMAP_EXIT_SPECIAL` (line 84) `#define DMAP_EXIT_SPECIAL`
- `DMAP_DOOR_SPECIAL` (line 85) `#define DMAP_DOOR_SPECIAL`
- `DMAP_FLAG_BLOCKING` (line 86) `#define DMAP_FLAG_BLOCKING`
- `DMAP_FLAG_TWOSIDED` (line 87) `#define DMAP_FLAG_TWOSIDED`
- `DMAP_NO_SIDE` (line 88) `#define DMAP_NO_SIDE`
- `DMAP_WALL_MID` (line 89) `#define DMAP_WALL_MID`
- `DMAP_EXIT_MID` (line 90) `#define DMAP_EXIT_MID`
- `DMAP_DOOR_UPPER` (line 91) `#define DMAP_DOOR_UPPER`
- `DMAP_DARK_MID` (line 92) `#define DMAP_DARK_MID`
- `DMAP_NUKE_MID` (line 93) `#define DMAP_NUKE_MID`
- `DMAP_UNUSED_TEX` (line 94) `#define DMAP_UNUSED_TEX`
- `DMAP_FLOOR_FLAT` (line 95) `#define DMAP_FLOOR_FLAT`
- `DMAP_NUKE_FLAT` (line 96) `#define DMAP_NUKE_FLAT`
- `DMAP_CEIL_FLAT` (line 97) `#define DMAP_CEIL_FLAT`
- `DMAP_FLOOR_H` (line 98) `#define DMAP_FLOOR_H`
- `DMAP_NUKE_FLOOR` (line 99) `#define DMAP_NUKE_FLOOR`
- `DMAP_CEIL_H` (line 100) `#define DMAP_CEIL_H`
- `DMAP_DOOR_CEIL` (line 101) `#define DMAP_DOOR_CEIL`
- `DMAP_LIGHT` (line 102) `#define DMAP_LIGHT`
- `DMAP_DARK_LIGHT` (line 103) `#define DMAP_DARK_LIGHT`
- `DMAP_DOOR_LIGHT` (line 104) `#define DMAP_DOOR_LIGHT`
- `DMAP_NUKE_SPECIAL` (line 105) `#define DMAP_NUKE_SPECIAL`
- `DMAP_NODE_LEAF` (line 106) `#define DMAP_NODE_LEAF`
- `DMAP_TOOL_DOOM` (line 107) `#define DMAP_TOOL_DOOM`
- `DMAP_SAVE_TXT` (line 108) `#define DMAP_SAVE_TXT`
- `DMAP_SAVE_WAD` (line 109) `#define DMAP_SAVE_WAD`
- `DMAP_TITLE` (line 110) `#define DMAP_TITLE`
- `DMAP_HISTORY` (line 111) `#define DMAP_HISTORY`
- `DMAP_TOOL_PAINT` (line 112) `#define DMAP_TOOL_PAINT`
- `DMAP_TOOL_LINE` (line 113) `#define DMAP_TOOL_LINE`
- `DMAP_TOOL_RECT` (line 114) `#define DMAP_TOOL_RECT`
- `DMAP_TOOL_FILL` (line 115) `#define DMAP_TOOL_FILL`
- `DMAP_BRUSH_COUNT` (line 230) `#define DMAP_BRUSH_COUNT`

#### `am_map.c`
**Path:** `progs/doomgeneric/am_map.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION:  the automap code*

**Functions:**
- `AM_getIslope` (line 275) `void
AM_getIslope
( mline_t*	ml,
  islope_t*	is )`
- `AM_activateNewScale` (line 293) `void AM_activateNewScale(void)`
- `AM_saveScaleAndLoc` (line 308) `void AM_saveScaleAndLoc(void)`
- `AM_restoreScaleAndLoc` (line 319) `void AM_restoreScaleAndLoc(void)`
- `AM_addMark` (line 343) `void AM_addMark(void)` - *adds a marker at the current location*
- `AM_findMinMaxBoundaries` (line 355) `void AM_findMinMaxBoundaries(void)` - *Determines bounding box of all vertices, sets global variables controlling zoom range.*
- `AM_changeWindowLoc` (line 395) `void AM_changeWindowLoc(void)`
- `AM_initVariables` (line 424) `void AM_initVariables(void)`
- `AM_loadPics` (line 480) `void AM_loadPics(void)`
- `AM_unloadPics` (line 493) `void AM_unloadPics(void)`
- `AM_clearMarks` (line 505) `void AM_clearMarks(void)`
- `AM_LevelInit` (line 518) `void AM_LevelInit(void)` - *should be called at the start of every level right now, i figure it out myself*
- `AM_Stop` (line 541) `void AM_Stop (void)`
- `AM_Start` (line 554) `void AM_Start (void)`
- `AM_minOutWindowScale` (line 573) `void AM_minOutWindowScale(void)` - *set the window scale to the maximum size*
- `AM_maxOutWindowScale` (line 583) `void AM_maxOutWindowScale(void)` - *set the window scale to the minimum size*
- `AM_Responder` (line 595) `boolean
AM_Responder
( event_t*	ev )`
- `AM_changeWindowScale` (line 742) `void AM_changeWindowScale(void)` - *Zooming*
- `AM_doFollowPlayer` (line 761) `void AM_doFollowPlayer(void)`
- `AM_updateLightLev` (line 785) `void AM_updateLightLev(void)`
- `AM_Ticker` (line 806) `void AM_Ticker (void)` - *Updates on Game Tick*
- `AM_clearFB` (line 834) `void AM_clearFB(int color)` - *Clear automap frame buffer.*
- `AM_clipMline` (line 848) `boolean
AM_clipMline
( mline_t*	ml,
  fline_t*	fl )`
- `AM_drawFline` (line 984) `void
AM_drawFline
( fline_t*	fl,
  int		color )`
- `AM_drawMline` (line 1062) `void
AM_drawMline
( mline_t*	ml,
  int		color )`
- `AM_drawGrid` (line 1077) `void AM_drawGrid(int color)` - *Draws flat (floor/ceiling tile) aligned grid lines.*
- `AM_drawWalls` (line 1123) `void AM_drawWalls(void)` - *Determines visible lines, draws them. This is LineDef based, not LineSeg based.*
- `AM_rotate` (line 1179) `void
AM_rotate
( fixed_t*	x,
  fixed_t*	y,
  angle_t	a )`
- `AM_drawLineCharacter` (line 1198) `void
AM_drawLineCharacter
( mline_t*	lineguy,
  int		lineguylines,
  fixed_t	scale,
  angle_t	ang...`
- `AM_drawPlayers` (line 1246) `void AM_drawPlayers(void)`
- `AM_drawThings` (line 1291) `void
AM_drawThings
( int	colors,
  int 	colorrange)`
- `AM_drawMarks` (line 1311) `void AM_drawMarks(void)`
- `AM_drawCrosshair` (line 1332) `void AM_drawCrosshair(int color)`
- `AM_Drawer` (line 1338) `void AM_Drawer (void)`

**Macros:**
- `REDS` (line 50) `#define REDS`
- `REDRANGE` (line 51) `#define REDRANGE`
- `BLUES` (line 52) `#define BLUES`
- `BLUERANGE` (line 53) `#define BLUERANGE`
- `GREENS` (line 54) `#define GREENS`
- `GREENRANGE` (line 55) `#define GREENRANGE`
- `GRAYS` (line 56) `#define GRAYS`
- `GRAYSRANGE` (line 57) `#define GRAYSRANGE`
- `BROWNS` (line 58) `#define BROWNS`
- `BROWNRANGE` (line 59) `#define BROWNRANGE`
- `YELLOWS` (line 60) `#define YELLOWS`
- `YELLOWRANGE` (line 61) `#define YELLOWRANGE`
- `BLACK` (line 62) `#define BLACK`
- `WHITE` (line 63) `#define WHITE`
- `BACKGROUND` (line 66) `#define BACKGROUND`
- `YOURCOLORS` (line 67) `#define YOURCOLORS`
- `YOURRANGE` (line 68) `#define YOURRANGE`
- `WALLCOLORS` (line 69) `#define WALLCOLORS`
- `WALLRANGE` (line 70) `#define WALLRANGE`
- `TSWALLCOLORS` (line 71) `#define TSWALLCOLORS`
- `TSWALLRANGE` (line 72) `#define TSWALLRANGE`
- `FDWALLCOLORS` (line 73) `#define FDWALLCOLORS`
- `FDWALLRANGE` (line 74) `#define FDWALLRANGE`
- `CDWALLCOLORS` (line 75) `#define CDWALLCOLORS`
- `CDWALLRANGE` (line 76) `#define CDWALLRANGE`
- `THINGCOLORS` (line 77) `#define THINGCOLORS`
- `THINGRANGE` (line 78) `#define THINGRANGE`
- `SECRETWALLCOLORS` (line 79) `#define SECRETWALLCOLORS`
- `SECRETWALLRANGE` (line 80) `#define SECRETWALLRANGE`
- `GRIDCOLORS` (line 81) `#define GRIDCOLORS`
- `GRIDRANGE` (line 82) `#define GRIDRANGE`
- `XHAIRCOLORS` (line 83) `#define XHAIRCOLORS`
- `AM_NUMMARKPOINTS` (line 87) `#define AM_NUMMARKPOINTS`
- `INITSCALEMTOF` (line 90) `#define INITSCALEMTOF`
- `F_PANINC` (line 93) `#define F_PANINC`
- `M_ZOOMIN` (line 96) `#define M_ZOOMIN`
- `M_ZOOMOUT` (line 99) `#define M_ZOOMOUT`
- `FTOM` (line 102) `#define FTOM(x)`
- `MTOF` (line 103) `#define MTOF(x)`
- `CXMTOF` (line 105) `#define CXMTOF(x)`
- `CYMTOF` (line 106) `#define CYMTOF(y)`
- `LINE_NEVERSEE` (line 109) `#define LINE_NEVERSEE`
- `R` (line 143) `#define R`
- `R` (line 155) `#define R`
- `R` (line 176) `#define R`
- `R` (line 184) `#define R`
- `DOOUTCODE` (line 869) `#define DOOUTCODE(oc, mx, my)`
- `PUTDOT` (line 1010) `#define PUTDOT(xx,yy,cc)`

**Structs:**
- `fpoint_t` (line 111)
- `fline_t` (line 116)
- `mpoint_t` (line 121)
- `mline_t` (line 126)
- `islope_t` (line 131)

#### `d_event.c`
**Path:** `progs/doomgeneric/d_event.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: Event handling.  Events are asynchronous inputs generally generated by the game user. Events can be discarded if no responder claims them*

**Functions:**
- `D_PostEvent` (line 35) `void D_PostEvent (event_t* ev)` - *D_PostEvent Called by the I/O functions when input is detected*
- `D_PopEvent` (line 43) `event_t *D_PopEvent(void)`

**Macros:**
- `MAXEVENTS` (line 25) `#define MAXEVENTS`

#### `d_items.c`
**Path:** `progs/doomgeneric/d_items.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:    We are referring to sprite numbers.     PSPRITE ACTIONS for waepons. This struct controls the weapon animations.  Each entry is: ammo/amunition type*

*No symbols extracted*

#### `d_iwad.c`
**Path:** `progs/doomgeneric/d_iwad.c`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Search for and locate an IWAD file, and initialize according to the IWAD type.*

**Functions:**
- `AddIWADDir` (line 64) `static void AddIWADDir(char *dir)`
- `GetRegistryString` (line 192) `static char *GetRegistryString(registry_value_t *reg_val)`
- `CheckUninstallStrings` (line 236) `static void CheckUninstallStrings(void)`
- `CheckCollectorsEdition` (line 270) `static void CheckCollectorsEdition(void)`
- `CheckSteamEdition` (line 297) `static void CheckSteamEdition(void)`
- `CheckSteamGUSPatches` (line 324) `static void CheckSteamGUSPatches(void)`
- `CheckDOSDefaults` (line 364) `static void CheckDOSDefaults(void)`
- `DirIsFile` (line 391) `static boolean DirIsFile(char *path, char *filename)`
- `CheckDirectoryHasIWAD` (line 408) `static char *CheckDirectoryHasIWAD(char *dir, char *iwadname)`
- `SearchDirectoryForIWAD` (line 449) `static char *SearchDirectoryForIWAD(char *dir, int mask, GameMission_t *mission)`
- `IdentifyIWADByName` (line 477) `static GameMission_t IdentifyIWADByName(char *name, int mask)`
- `AddDoomWadPath` (line 518) `static void AddDoomWadPath(void)`
- `BuildIWADDirList` (line 569) `static void BuildIWADDirList(void)`
- `D_FindWADByName` (line 630) `char *D_FindWADByName(char *name)`
- `D_TryFindWADByName` (line 681) `char *D_TryFindWADByName(char *filename)`
- `D_FindIWAD` (line 704) `char *D_FindIWAD(int mask, GameMission_t *mission)`
- `D_FindAllIWADs` (line 757) `const iwad_t **D_FindAllIWADs(int mask)`
- `D_SaveGameIWADName` (line 796) `char *D_SaveGameIWADName(GameMission_t gamemission)`
- `D_SuggestIWADName` (line 820) `char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)`
- `D_SuggestGameName` (line 835) `char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)`

**Macros:**
- `MAX_IWAD_DIRS` (line 58) `#define MAX_IWAD_DIRS`
- `WIN32_LEAN_AND_MEAN` (line 80) `#define WIN32_LEAN_AND_MEAN`
- `UNINSTALLER_STRING` (line 90) `#define UNINSTALLER_STRING`
- `SOFTWARE_KEY` (line 102) `#define SOFTWARE_KEY`
- `SOFTWARE_KEY` (line 104) `#define SOFTWARE_KEY`
- `STEAM_BFG_GUS_PATCHES` (line 189) `#define STEAM_BFG_GUS_PATCHES`

**Structs:**
- `registry_value_t` (line 83)

#### `d_loop.c`
**Path:** `progs/doomgeneric/d_loop.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main loop code.*

**Functions:**
- `GetAdjustedTime` (line 119) `static int GetAdjustedTime(void)`
- `BuildNewTic` (line 136) `static boolean BuildNewTic(void)`
- `NetUpdate` (line 203) `void NetUpdate (void)`
- `D_Disconnected` (line 252) `static void D_Disconnected(void)`
- `D_ReceiveTic` (line 271) `void D_ReceiveTic(ticcmd_t *ticcmds, boolean *players_mask)`
- `D_StartGameLoop` (line 305) `void D_StartGameLoop(void)`
- `BlockUntilStart` (line 315) `static void BlockUntilStart(net_gamesettings_t *settings,
                            netgame_sta...`
- `D_StartNetGame` (line 340) `void D_StartNetGame(net_gamesettings_t *settings,
                    netgame_startup_callback_t ...`
- `D_InitNetGame` (line 452) `boolean D_InitNetGame(net_connect_data_t *connect_data)`
- `D_QuitNetGame` (line 560) `void D_QuitNetGame (void)` - *D_QuitNetGame Called before quitting to leave a net game without hanging the other players*
- `GetLowTic` (line 568) `static int GetLowTic(void)`
- `OldNetSync` (line 591) `static void OldNetSync(void)`
- `PlayersInGame` (line 642) `static boolean PlayersInGame(void)`
- `TicdupSquash` (line 672) `static void TicdupSquash(ticcmd_set_t *set)`
- `SinglePlayerClear` (line 689) `static void SinglePlayerClear(ticcmd_set_t *set)`
- `TryRunTics` (line 706) `void TryRunTics (void)`
- `D_RegisterLoopCallbacks` (line 822) `void D_RegisterLoopCallbacks(loop_interface_t *i)`

**Structs:**
- `ticcmd_set_t` (line 45)

#### `d_main.c`
**Path:** `progs/doomgeneric/d_main.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DOOM main program (D_DoomMain) and game loop (D_DoomLoop), plus functions to determine game mode (shareware, registered), parse command line parameters, configure game parameters (turbo), and call the startup functions.*

**Functions:**
- `D_ProcessEvents` (line 139) `void D_ProcessEvents (void)` - *D_ProcessEvents Send all the events of the given timestamp down the responder chain*
- `D_Display` (line 169) `void D_Display (void)`
- `D_BindVariables` (line 335) `void D_BindVariables(void)`
- `D_GrabMouseCallback` (line 388) `boolean D_GrabMouseCallback(void)`
- `D_DoomLoop` (line 408) `void D_DoomLoop (void)` - *D_DoomLoop*
- `D_PageTicker` (line 490) `void D_PageTicker (void)` - *D_PageTicker Handles timing for warped projection*
- `D_PageDrawer` (line 501) `void D_PageDrawer (void)` - *D_PageDrawer*
- `D_AdvanceDemo` (line 511) `void D_AdvanceDemo (void)` - *D_AdvanceDemo Called after each demo or intro demosequence finishes*
- `D_DoAdvanceDemo` (line 521) `void D_DoAdvanceDemo (void)` - *This cycles through the demo sequences. FIXME - version dependend demo numbers?*
- `D_StartTitle` (line 609) `void D_StartTitle (void)` - *D_StartTitle*
- `GetGameName` (line 658) `static char *GetGameName(char *gamename)`
- `SetMissionForPackName` (line 701) `static void SetMissionForPackName(char *pack_name)`
- `D_IdentifyVersion` (line 737) `void D_IdentifyVersion(void)`
- `D_SetGameDescription` (line 820) `void D_SetGameDescription(void)`
- `D_AddFile` (line 883) `static boolean D_AddFile(char *filename)`
- `PrintDehackedBanners` (line 918) `void PrintDehackedBanners(void)`
- `InitGameVersion` (line 963) `static void InitGameVersion(void)`
- `PrintGameVersion` (line 1065) `void PrintGameVersion(void)`
- `D_Endoom` (line 1082) `static void D_Endoom(void)`
- `LoadIwadDeh` (line 1105) `static void LoadIwadDeh(void)` - *if ORIGCODE Load dehacked patches needed for certain IWADs.*
- `D_DoomMain` (line 1178) `void D_DoomMain (void)` - *D_DoomMain*
- `D_ConnectNetGame` (line 131) `void D_ConnectNetGame(void);`
- `D_CheckNetGame` (line 132) `void D_CheckNetGame(void);`
- `R_ExecuteSetViewSize` (line 167) `void R_ExecuteSetViewSize (void);`

**Variables:**
- `inhelpscreens` (line 106) `extern boolean inhelpscreens;`
- `setsizeneeded` (line 165) `extern boolean setsizeneeded;`
- `showMessages` (line 166) `extern int showMessages;`
- `forwardmove` (line 1351) `extern int forwardmove[2];`
- `sidemove` (line 1352) `extern int sidemove[2];`

#### `d_mode.c`
**Path:** `progs/doomgeneric/d_mode.c`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: Functions and definitions relating to the game type and operational mode.    Valid game mode/mission combinations, with the number of episodes/maps for each.*

**Functions:**
- `D_ValidGameMode` (line 50) `boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode)`
- `D_ValidEpisodeMap` (line 65) `boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,
                          int e...`
- `D_GetNumEpisodes` (line 103) `int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode)`
- `D_ValidGameVersion` (line 135) `boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version)`
- `D_IsEpisodeMap` (line 161) `boolean D_IsEpisodeMap(GameMission_t mission)`
- `D_GameMissionString` (line 182) `char *D_GameMissionString(GameMission_t mission)`

#### `d_net.c`
**Path:** `progs/doomgeneric/d_net.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DOOM Network game communication and protocol, all OS independend parts.*

**Functions:**
- `PlayerQuitGame` (line 45) `static void PlayerQuitGame(player_t *player)`
- `RunTic` (line 71) `static void RunTic(ticcmd_t *cmds, boolean *ingame)`
- `LoadGameSettings` (line 108) `static void LoadGameSettings(net_gamesettings_t *settings)`
- `SaveGameSettings` (line 139) `static void SaveGameSettings(net_gamesettings_t *settings)`
- `InitConnectData` (line 159) `static void InitConnectData(net_connect_data_t *connect_data)`
- `D_ConnectNetGame` (line 215) `void D_ConnectNetGame(void)`
- `D_CheckNetGame` (line 240) `void D_CheckNetGame (void)` - *D_CheckNetGame Works out player numbers among the net participants*

**Variables:**
- `advancedemo` (line 73) `extern boolean advancedemo;`

#### `doomdef.c`
**Path:** `progs/doomgeneric/doomdef.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DoomDef - basic defines for DOOM, e.g. Version, game mode and skill level, and display parameters.      Location for any defines turned variables.  None.*

*No symbols extracted*

#### `doomgeneric.c`
**Path:** `progs/doomgeneric/doomgeneric.c`

**Functions:**
- `dg_Create` (line 6) `void dg_Create()`

#### `doomgeneric_minios.c`
**Path:** `progs/doomgeneric/doomgeneric_minios.c`
**File Doc:** *doomgeneric_minios.c - MiniOS platform layer for doomgeneric.*

**Functions:**
- `mini_parse_autoframes` (line 24) `static void mini_parse_autoframes(int argc, char **argv)`
- `mini_parse_windowed` (line 43) `static void mini_parse_windowed(int argc, char **argv)`
- `sys_time_ms` (line 56) `static long sys_time_ms(void)`
- `sys_kbd` (line 61) `static long sys_kbd(void)`
- `sys_palette` (line 66) `static long sys_palette(const unsigned char *pal)`
- `sys_kbd_raw` (line 71) `static long sys_kbd_raw(int on)`
- `sys_vga_mode` (line 76) `static long sys_vga_mode(int on)`
- `sys_gfx_zoom` (line 81) `static long sys_gfx_zoom(long mode)`
- `sys_doom_frame` (line 86) `static long sys_doom_frame(void)`
- `load_vga_palette` (line 110) `static void load_vga_palette(void)`
- `scancode_to_doom` (line 123) `static unsigned char scancode_to_doom(unsigned char raw)`
- `kbd_enqueue` (line 182) `static void kbd_enqueue(unsigned char doom_key, int pressed)`
- `kbd_poll` (line 189) `static void kbd_poll(void)`
- `DG_Init` (line 232) `void DG_Init(void)`
- `DG_DrawFrame` (line 243) `void DG_DrawFrame(void)`
- `DG_SleepMs` (line 274) `void DG_SleepMs(uint32_t ms)`
- `DG_GetTicksMs` (line 280) `uint32_t DG_GetTicksMs(void)`
- `DG_GetKey` (line 284) `int DG_GetKey(int *pressed, unsigned char *key)`
- `DG_SetWindowTitle` (line 295) `void DG_SetWindowTitle(const char *title)`
- `MINIOS_DOOM_BACKBUF_ADDR` (line 4) `* MINIOS_DOOM_BACKBUF_ADDR (minios_abi.h);`

**Macros:**
- `FB_ADDR` (line 96) `#define FB_ADDR`
- `FB_WIDTH` (line 97) `#define FB_WIDTH`
- `FB_HEIGHT` (line 98) `#define FB_HEIGHT`
- `KBD_QUEUE_SIZE` (line 178) `#define KBD_QUEUE_SIZE`

**Structs:**
- `color` (line 103) - *DOOM renders into a kernel-backed back-buffer in the user window; the * kernel composites it onto the desktop as a window on GFX_PRESENT/BUF_GAME. #define FB_ADDR    ((volatile uint8_t *)MINIOS_DOOM_BACKBUF_ADDR) #define FB_WIDTH   320 #define FB_HEIGHT  200 /* ---------- Palette management ---------- /* Extern from i_video.c - the gamma-corrected palette colors*

**Variables:**
- `colors` (line 104) `extern struct color colors[256];`
- `I_VideoBuffer` (line 230) `extern unsigned char *I_VideoBuffer;`
- `myargc` (line 233) `extern int myargc;`
- `myargv` (line 234) `extern char **myargv;`

#### `doomgeneric_sdl.c`
**Path:** `progs/doomgeneric/doomgeneric_sdl.c`
**File Doc:** *doomgeneric for soso os*

**Functions:**
- `convertToDoomKey` (line 23) `static unsigned char convertToDoomKey(unsigned int key)`
- `addKeyToQueue` (line 63) `static void addKeyToQueue(int pressed, unsigned int keyCode)`
- `handleKeyInput` (line 72) `static void handleKeyInput()`
- `DG_Init` (line 93) `void DG_Init()`
- `DG_DrawFrame` (line 112) `void DG_DrawFrame()`
- `DG_SleepMs` (line 123) `void DG_SleepMs(uint32_t ms)`
- `DG_GetTicksMs` (line 128) `uint32_t DG_GetTicksMs()`
- `DG_GetKey` (line 133) `int DG_GetKey(int* pressed, unsigned char* doomKey)`
- `DG_SetWindowTitle` (line 152) `void DG_SetWindowTitle(const char * title)`

**Macros:**
- `KEYQUEUE_SIZE` (line 17) `#define KEYQUEUE_SIZE`

#### `doomgeneric_soso.c`
**Path:** `progs/doomgeneric/doomgeneric_soso.c`
**File Doc:** *doomgeneric for soso os*

**Enums:**
- `EnFrameBuferIoctl` (line 36)

**Functions:**
- `convertToDoomKey` (line 43) `static unsigned char convertToDoomKey(unsigned char scancode)`
- `addKeyToQueue` (line 92) `static void addKeyToQueue(int pressed, unsigned char keyCode)`
- `disableRawMode` (line 108) `void disableRawMode()`
- `enableRawMode` (line 114) `void enableRawMode()`
- `DG_Init` (line 124) `void DG_Init()`
- `handleKeyInput` (line 186) `static void handleKeyInput()`
- `DG_DrawFrame` (line 214) `void DG_DrawFrame()`
- `DG_SleepMs` (line 227) `void DG_SleepMs(uint32_t ms)`
- `DG_GetTicksMs` (line 232) `uint32_t DG_GetTicksMs()`
- `DG_GetKey` (line 237) `int DG_GetKey(int* pressed, unsigned char* doomKey)`
- `DG_SetWindowTitle` (line 258) `void DG_SetWindowTitle(const char * title)`

**Macros:**
- `KEYQUEUE_SIZE` (line 24) `#define KEYQUEUE_SIZE`

#### `doomgeneric_sosox.c`
**Path:** `progs/doomgeneric/doomgeneric_sosox.c`
**File Doc:** *doomgeneric for soso os (nano-x version) TODO: get keys from X, not using direct keyboard access!*

**Functions:**
- `convert_to_doom_key` (line 39) `static unsigned char convert_to_doom_key(unsigned char scancode)`
- `add_key_to_queue` (line 88) `static void add_key_to_queue(int pressed, unsigned char key_code)`
- `disable_raw_mode` (line 102) `void disable_raw_mode()`
- `enable_raw_mode` (line 107) `void enable_raw_mode()`
- `DG_Init` (line 117) `void DG_Init()`
- `handle_key_input` (line 159) `static void handle_key_input()`
- `DG_DrawFrame` (line 187) `void DG_DrawFrame()`
- `DG_SleepMs` (line 225) `void DG_SleepMs(uint32_t ms)`
- `DG_GetTicksMs` (line 230) `uint32_t DG_GetTicksMs()`
- `DG_GetKey` (line 235) `int DG_GetKey(int* pressed, unsigned char* doomKey)`
- `DG_SetWindowTitle` (line 256) `void DG_SetWindowTitle(const char * title)`

**Macros:**
- `KEYQUEUE_SIZE` (line 24) `#define KEYQUEUE_SIZE`

#### `doomgeneric_win.c`
**Path:** `progs/doomgeneric/doomgeneric_win.c`

**Functions:**
- `convertToDoomKey` (line 20) `static unsigned char convertToDoomKey(unsigned char key)`
- `addKeyToQueue` (line 59) `static void addKeyToQueue(int pressed, unsigned char keyCode)`
- `wndProc` (line 70) `static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)`
- `DG_Init` (line 95) `void DG_Init()`
- `DG_DrawFrame` (line 146) `void DG_DrawFrame()`
- `DG_SleepMs` (line 162) `void DG_SleepMs(uint32_t ms)`
- `DG_GetTicksMs` (line 167) `uint32_t DG_GetTicksMs()`
- `DG_GetKey` (line 172) `int DG_GetKey(int* pressed, unsigned char* doomKey)`
- `DG_SetWindowTitle` (line 193) `void DG_SetWindowTitle(const char * title)`

**Macros:**
- `KEYQUEUE_SIZE` (line 14) `#define KEYQUEUE_SIZE`

#### `doomgeneric_xlib.c`
**Path:** `progs/doomgeneric/doomgeneric_xlib.c`

**Functions:**
- `convertToDoomKey` (line 27) `static unsigned char convertToDoomKey(unsigned int key)`
- `addKeyToQueue` (line 68) `static void addKeyToQueue(int pressed, unsigned int keyCode)`
- `DG_Init` (line 79) `void DG_Init()`
- `DG_DrawFrame` (line 127) `void DG_DrawFrame()`
- `DG_SleepMs` (line 172) `void DG_SleepMs(uint32_t ms)`
- `DG_GetTicksMs` (line 177) `uint32_t DG_GetTicksMs()`
- `DG_GetKey` (line 187) `int DG_GetKey(int* pressed, unsigned char* doomKey)`
- `DG_SetWindowTitle` (line 208) `void DG_SetWindowTitle(const char * title)`

**Macros:**
- `KEYQUEUE_SIZE` (line 21) `#define KEYQUEUE_SIZE`

#### `doomstat.c`
**Path:** `progs/doomgeneric/doomstat.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Put all global tate variables here.      Game Mode - identify IWAD as shareware, retail etc.*

*No symbols extracted*

#### `dstrings.c`
**Path:** `progs/doomgeneric/dstrings.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Globally defined strings.*

*No symbols extracted*

#### `dummy.c`
**Path:** `progs/doomgeneric/dummy.c`

**Functions:**
- `I_InitTimidityConfig` (line 43) `void I_InitTimidityConfig(void)`

#### `f_finale.c`
**Path:** `progs/doomgeneric/f_finale.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Game completion, final screen animation.     Functions.*

**Functions:**
- `F_StartFinale` (line 108) `void F_StartFinale (void)` - *F_StartFinale*
- `F_Responder` (line 160) `boolean F_Responder (event_t *event)`
- `F_Ticker` (line 172) `void F_Ticker (void)` - *F_Ticker*
- `F_TextWrite` (line 227) `void F_TextWrite (void)`
- `F_StartCast` (line 340) `void F_StartCast (void)` - *F_StartCast*
- `F_CastTicker` (line 358) `void F_CastTicker (void)` - *F_CastTicker*
- `F_CastResponder` (line 465) `boolean F_CastResponder (event_t* ev)`
- `F_CastPrint` (line 486) `void F_CastPrint (char* text)`
- `F_CastDrawer` (line 541) `void F_CastDrawer (void)`
- `F_DrawPatchCol` (line 572) `void
F_DrawPatchCol
( int		x,
  patch_t*	patch,
  int		col )`
- `F_BunnyScroll` (line 606) `void F_BunnyScroll (void)` - *F_BunnyScroll*
- `F_ArtScreenDrawer` (line 661) `static void F_ArtScreenDrawer(void)`
- `F_Drawer` (line 702) `void F_Drawer (void)` - *F_Drawer*

**Macros:**
- `TEXTSPEED` (line 57) `#define	TEXTSPEED`
- `TEXTWAIT` (line 58) `#define	TEXTWAIT`

**Structs:**
- `textscreen_t` (line 60)
- `castinfo_t` (line 300) - *Final DOOM 2 animation Casting by id Software. in order of appearance*

**Variables:**
- `hu_font` (line 224) `extern patch_t *hu_font[HU_FONTSIZE];` - *include "hu_stuff.h"*

#### `f_wipe.c`
**Path:** `progs/doomgeneric/f_wipe.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Mission begin melt/wipe screen special effect.*

**Functions:**
- `wipe_shittyColMajorXform` (line 43) `void
wipe_shittyColMajorXform
( short*	array,
  int		width,
  int		height )`
- `wipe_initColorXForm` (line 65) `int
wipe_initColorXForm
( int	width,
  int	height,
  int	ticks )`
- `wipe_doColorXForm` (line 75) `int
wipe_doColorXForm
( int	width,
  int	height,
  int	ticks )`
- `wipe_exitColorXForm` (line 121) `int
wipe_exitColorXForm
( int	width,
  int	height,
  int	ticks )`
- `wipe_initMelt` (line 133) `int
wipe_initMelt
( int	width,
  int	height,
  int	ticks )`
- `wipe_doMelt` (line 164) `int
wipe_doMelt
( int	width,
  int	height,
  int	ticks )`
- `wipe_exitMelt` (line 219) `int
wipe_exitMelt
( int	width,
  int	height,
  int	ticks )`
- `wipe_StartScreen` (line 231) `int
wipe_StartScreen
( int	x,
  int	y,
  int	width,
  int	height )`
- `wipe_EndScreen` (line 243) `int
wipe_EndScreen
( int	x,
  int	y,
  int	width,
  int	height )`
- `wipe_ScreenWipe` (line 256) `int
wipe_ScreenWipe
( int	wipeno,
  int	x,
  int	y,
  int	width,
  int	height,
  int	ticks )`

#### `g_game.c`
**Path:** `progs/doomgeneric/g_game.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none*

**Functions:**
- `G_CmdChecksum` (line 233) `int G_CmdChecksum (ticcmd_t* cmd)`
- `WeaponSelectable` (line 244) `static boolean WeaponSelectable(weapontype_t weapon)`
- `G_NextWeapon` (line 281) `static int G_NextWeapon(int direction)`
- `G_BuildTiccmd` (line 322) `void G_BuildTiccmd (ticcmd_t* cmd, int maketic)` - *G_BuildTiccmd Builds a ticcmd from all of the available inputs or reads it from the demo buffer. If recording a demo, write it out*
- `G_DoLoadLevel` (line 603) `void G_DoLoadLevel (void)` - *G_DoLoadLevel*
- `SetJoyButtons` (line 675) `static void SetJoyButtons(unsigned int buttons_mask)`
- `SetMouseButtons` (line 703) `static void SetMouseButtons(unsigned int buttons_mask)`
- `G_Responder` (line 733) `boolean G_Responder (event_t* ev)` - *G_Responder Get info needed to make ticcmd_ts for the players.*
- `G_Ticker` (line 854) `void G_Ticker (void)` - *G_Ticker Make ticcmd_ts for the players.*
- `G_InitPlayer` (line 1039) `void G_InitPlayer (int player)` - *G_InitPlayer Called at the start. Called by the game initialization functions.*
- `G_PlayerFinishLevel` (line 1051) `void G_PlayerFinishLevel (int player)` - *G_PlayerFinishLevel Can when a player completes a level.*
- `G_PlayerReborn` (line 1072) `void G_PlayerReborn (int player)` - *G_PlayerReborn Called after a player dies almost everything is cleared and initialized*
- `G_CheckSpot` (line 1116) `boolean
G_CheckSpot
( int		playernum,
  mapthing_t*	mthing )`
- `G_DeathMatchSpawnPlayer` (line 1223) `void G_DeathMatchSpawnPlayer (int playernum)` - *G_DeathMatchSpawnPlayer Spawns a player at one of the random death match spots called at level load and each death*
- `G_DoReborn` (line 1250) `void G_DoReborn (int playernum)` - *G_DoReborn*
- `G_ScreenShot` (line 1296) `void G_ScreenShot (void)`
- `G_ExitLevel` (line 1328) `void G_ExitLevel (void)`
- `G_SecretExitLevel` (line 1335) `void G_SecretExitLevel (void)` - *Here's for the german edition.*
- `G_DoCompleted` (line 1346) `void G_DoCompleted (void)`
- `G_WorldDone` (line 1494) `void G_WorldDone (void)` - *G_WorldDone*
- `G_DoWorldDone` (line 1519) `void G_DoWorldDone (void)`
- `G_LoadGame` (line 1539) `void G_LoadGame (char* name)`
- `G_DoLoadGame` (line 1548) `void G_DoLoadGame (void)`
- `G_SaveGame` (line 1601) `void
G_SaveGame
( int	slot,
  char*	description )`
- `G_DoSaveGame` (line 1610) `void G_DoSaveGame (void)`
- `G_DeferedInitNew` (line 1698) `void
G_DeferedInitNew
( skill_t	skill,
  int		episode,
  int		map)`
- `G_DoNewGame` (line 1710) `void G_DoNewGame (void)`
- `G_InitNew` (line 1727) `void
G_InitNew
( skill_t	skill,
  int		episode,
  int		map )`
- `G_ReadDemoTiccmd` (line 1898) `void G_ReadDemoTiccmd (ticcmd_t* cmd)`
- `IncreaseDemoBuffer` (line 1926) `static void IncreaseDemoBuffer(void)`
- `G_WriteDemoTiccmd` (line 1956) `void G_WriteDemoTiccmd (ticcmd_t* cmd)`
- `G_RecordDemo` (line 2010) `void G_RecordDemo (char *name)` - *G_RecordDemo*
- `G_VanillaVersionCode` (line 2040) `int G_VanillaVersionCode(void)` - *Get the demo version code appropriate for the version set in gameversion.*
- `G_BeginRecording` (line 2058) `void G_BeginRecording (void)`
- `G_DeferedPlayDemo` (line 2107) `void G_DeferedPlayDemo (char* name)`
- `DemoVersionDescription` (line 2115) `static char *DemoVersionDescription(int version)`
- `G_DoPlayDemo` (line 2152) `void G_DoPlayDemo (void)`
- `G_TimeDemo` (line 2215) `void G_TimeDemo (char* name)` - *G_TimeDemo*
- `G_CheckDemoStatus` (line 2243) `boolean G_CheckDemoStatus (void)`
- `G_DoVictory` (line 88) `void G_DoVictory (void);`
- `P_SpawnPlayer` (line 1113) `void P_SpawnPlayer (mapthing_t* mthing);` - *G_CheckSpot Returns false if the player cannot be respawned at the given mapthing_t spot because something is occupying it*
- `R_ExecuteSetViewSize` (line 1535) `void R_ExecuteSetViewSize (void);`

**Macros:**
- `SAVEGAMESIZE` (line 76) `#define SAVEGAMESIZE`
- `MAXPLMOVE` (line 152) `#define MAXPLMOVE`
- `TURBOTHRESHOLD` (line 154) `#define TURBOTHRESHOLD`
- `SLOWTURNTICS` (line 193) `#define SLOWTURNTICS`
- `NUMKEYS` (line 195) `#define NUMKEYS`
- `MAX_JOY_BUTTONS` (line 196) `#define MAX_JOY_BUTTONS`
- `BODYQUESIZE` (line 225) `#define	BODYQUESIZE`
- `VERSIONSIZE` (line 1545) `#define VERSIONSIZE`
- `DEMOMARKER` (line 1895) `#define DEMOMARKER`

**Variables:**
- `player_names` (line 939) `extern char *player_names[4];`
- `pagename` (line 1326) `extern char* pagename;`
- `setsizeneeded` (line 1534) `extern boolean setsizeneeded;` - *G_InitFromSavegame Can be called by the startup code or the menu task.*

#### `gusconf.c`
**Path:** `progs/doomgeneric/gusconf.c`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: GUS emulation code.  Actually emulating a GUS is far too much work; fortunately GUS "emulation" already exists in the form of Timidity, which supports GUS patch files. This code therefore converts Doom's DMXGUS lump into an equivalent Timidity configuration file.*

**Functions:**
- `MappingIndex` (line 43) `static unsigned int MappingIndex(void)`
- `SplitLine` (line 61) `static int SplitLine(char *line, char **fields, unsigned int max_fields)`
- `ParseLine` (line 108) `static void ParseLine(gus_config_t *config, char *line)`
- `ParseDMXConfig` (line 129) `static void ParseDMXConfig(char *dmxconf, gus_config_t *config)`
- `FreeDMXConfig` (line 165) `static void FreeDMXConfig(gus_config_t *config)`
- `ReadDMXConfig` (line 175) `static char *ReadDMXConfig(void)`
- `WriteTimidityConfig` (line 197) `static boolean WriteTimidityConfig(char *path, gus_config_t *config)`
- `GUS_WriteConfig` (line 244) `boolean GUS_WriteConfig(char *path)`

**Macros:**
- `MAX_INSTRUMENTS` (line 32) `#define MAX_INSTRUMENTS`

**Structs:**
- `gus_config_t` (line 34)

#### `hu_lib.c`
**Path:** `progs/doomgeneric/hu_lib.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  heads-up text and input code*

**Functions:**
- `HUlib_init` (line 36) `void HUlib_init(void)`
- `HUlib_clearTextLine` (line 40) `void HUlib_clearTextLine(hu_textline_t* t)`
- `HUlib_initTextLine` (line 48) `void
HUlib_initTextLine
( hu_textline_t*	t,
  int			x,
  int			y,
  patch_t**		f,
  int			sc )`
- `HUlib_addCharToTextLine` (line 63) `boolean
HUlib_addCharToTextLine
( hu_textline_t*	t,
  char			ch )`
- `HUlib_delCharFromTextLine` (line 80) `boolean HUlib_delCharFromTextLine(hu_textline_t* t)`
- `HUlib_drawTextLine` (line 94) `void
HUlib_drawTextLine
( hu_textline_t*	l,
  boolean		drawcursor )`
- `HUlib_eraseTextLine` (line 137) `void HUlib_eraseTextLine(hu_textline_t* l)` - *sorta called by HU_Erase and just better darn get things straight*
- `HUlib_initSText` (line 169) `void
HUlib_initSText
( hu_stext_t*	s,
  int		x,
  int		y,
  int		h,
  patch_t**	font,
  int		star...`
- `HUlib_addLineToSText` (line 192) `void HUlib_addLineToSText(hu_stext_t* s)`
- `HUlib_addMessageToSText` (line 209) `void
HUlib_addMessageToSText
( hu_stext_t*	s,
  char*		prefix,
  char*		msg )`
- `HUlib_drawSText` (line 223) `void HUlib_drawSText(hu_stext_t* s)`
- `HUlib_eraseSText` (line 246) `void HUlib_eraseSText(hu_stext_t* s)`
- `HUlib_initIText` (line 262) `void
HUlib_initIText
( hu_itext_t*	it,
  int		x,
  int		y,
  patch_t**	font,
  int		startchar,
  ...`
- `HUlib_delCharFromIText` (line 278) `void HUlib_delCharFromIText(hu_itext_t* it)` - *The following deletion routines adhere to the left margin restriction*
- `HUlib_eraseLineFromIText` (line 284) `void HUlib_eraseLineFromIText(hu_itext_t* it)`
- `HUlib_resetIText` (line 291) `void HUlib_resetIText(hu_itext_t* it)` - *Resets left margin as well*
- `HUlib_addPrefixToIText` (line 298) `void
HUlib_addPrefixToIText
( hu_itext_t*	it,
  char*		str )`
- `HUlib_keyInIText` (line 310) `boolean
HUlib_keyInIText
( hu_itext_t*	it,
  unsigned char ch )`
- `HUlib_drawIText` (line 329) `void HUlib_drawIText(hu_itext_t* it)`
- `HUlib_eraseIText` (line 340) `void HUlib_eraseIText(hu_itext_t* it)`

**Macros:**
- `noterased` (line 32) `#define noterased`

**Variables:**
- `automapactive` (line 34) `extern boolean automapactive;`

#### `hu_stuff.c`
**Path:** `progs/doomgeneric/hu_stuff.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  Heads-up displays*

**Functions:**
- `HU_Init` (line 286) `void HU_Init(void)`
- `HU_Stop` (line 303) `void HU_Stop(void)`
- `HU_Start` (line 308) `void HU_Start(void)`
- `HU_Drawer` (line 383) `void HU_Drawer(void)`
- `HU_Erase` (line 393) `void HU_Erase(void)`
- `HU_Ticker` (line 402) `void HU_Ticker(void)`
- `HU_queueChatChar` (line 482) `void HU_queueChatChar(char c)`
- `HU_dequeueChatChar` (line 495) `char HU_dequeueChatChar(void)`
- `HU_Responder` (line 512) `boolean HU_Responder(event_t *ev)`

**Macros:**
- `HU_TITLE` (line 47) `#define HU_TITLE`
- `HU_TITLE2` (line 48) `#define HU_TITLE2`
- `HU_TITLEP` (line 49) `#define HU_TITLEP`
- `HU_TITLET` (line 50) `#define HU_TITLET`
- `HU_TITLE_CHEX` (line 51) `#define HU_TITLE_CHEX`
- `HU_TITLEHEIGHT` (line 52) `#define HU_TITLEHEIGHT`
- `HU_TITLEX` (line 53) `#define HU_TITLEX`
- `HU_TITLEY` (line 54) `#define HU_TITLEY`
- `HU_INPUTTOGGLE` (line 56) `#define HU_INPUTTOGGLE`
- `HU_INPUTX` (line 57) `#define HU_INPUTX`
- `HU_INPUTY` (line 58) `#define HU_INPUTY`
- `HU_INPUTWIDTH` (line 59) `#define HU_INPUTWIDTH`
- `HU_INPUTHEIGHT` (line 60) `#define HU_INPUTHEIGHT`
- `QUEUESIZE` (line 475) `#define QUEUESIZE`

**Variables:**
- `showMessages` (line 103) `extern int showMessages;`

#### `i_cdmus.c`
**Path:** `progs/doomgeneric/i_cdmus.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   SDL implementation of the Hexen CD interface.*

**Functions:**
- `I_CDMusInit` (line 38) `int I_CDMusInit(void)`
- `I_CDMusPrintStartup` (line 92) `void I_CDMusPrintStartup(void)`
- `I_CDMusPlay` (line 107) `int I_CDMusPlay(int track)`
- `I_CDMusStop` (line 130) `int I_CDMusStop(void)`
- `I_CDMusResume` (line 145) `int I_CDMusResume(void)`
- `I_CDMusSetVolume` (line 160) `int I_CDMusSetVolume(int volume)`
- `I_CDMusFirstTrack` (line 169) `int I_CDMusFirstTrack(void)`
- `I_CDMusLastTrack` (line 202) `int I_CDMusLastTrack(void)`
- `I_CDMusTrackLength` (line 219) `int I_CDMusTrackLength(int track_num)`

#### `i_endoom.c`
**Path:** `progs/doomgeneric/i_endoom.c`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Exit text-mode ENDOOM screen.*

**Functions:**
- `I_Endoom` (line 36) `void I_Endoom(byte *endoom_data)`

**Macros:**
- `ENDOOM_W` (line 29) `#define ENDOOM_W`
- `ENDOOM_H` (line 30) `#define ENDOOM_H`

#### `i_input.c`
**Path:** `progs/doomgeneric/i_input.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.*

**Functions:**
- `TranslateKey` (line 225) `static unsigned char TranslateKey(unsigned char key)`
- `GetTypedChar` (line 242) `static unsigned char GetTypedChar(unsigned char key)`
- `UpdateShiftStatus` (line 263) `static void UpdateShiftStatus(int pressed, unsigned char key)`
- `I_GetEvent` (line 279) `void I_GetEvent(void)`
- `I_InitInput` (line 338) `void I_InitInput(void)`

#### `i_joystick.c`
**Path:** `progs/doomgeneric/i_joystick.c`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: SDL Joystick code.*

**Functions:**
- `I_ShutdownJoystick` (line 77) `void I_ShutdownJoystick(void)`
- `IsValidAxis` (line 90) `static boolean IsValidAxis(int axis)` - *ifdef ORIGCODE*
- `I_InitJoystick` (line 115) `void I_InitJoystick(void)`
- `IsAxisButton` (line 171) `static boolean IsAxisButton(int physbutton)` - *ifdef ORIGCODE*
- `ReadButtonState` (line 203) `static int ReadButtonState(int vbutton)`
- `GetButtonsState` (line 228) `static int GetButtonsState(void)`
- `GetAxisState` (line 248) `static int GetAxisState(int axis, int invert)`
- `I_UpdateJoystick` (line 321) `void I_UpdateJoystick(void)` - *endif*
- `I_BindJoystickVariables` (line 339) `void I_BindJoystickVariables(void)`

**Macros:**
- `DEAD_ZONE` (line 38) `#define DEAD_ZONE`

#### `i_main.c`
**Path:** `progs/doomgeneric/i_main.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main program, simply calls D_DoomMain high level loop.   #include "config.h"   #include "doomtype.h" #include "i_system.h"   D_DoomMain() Not a globally visible function, just included for source reference, calls all startup code, parses command line options.*

**Functions:**
- `main` (line 40) `int main(int argc, char **argv)`
- `D_DoomMain` (line 33) `void D_DoomMain (void);`
- `M_FindResponseFile` (line 35) `void M_FindResponseFile(void);`
- `dg_Create` (line 37) `void dg_Create();`

#### `i_minios_sound.c`
**Path:** `progs/doomgeneric/i_minios_sound.c`

**Functions:**
- `sys_tone_hw` (line 32) `static long sys_tone_hw(unsigned f)`
- `sys_time` (line 35) `static long sys_time(void)`
- `sys_pcm2_open` (line 38) `static long sys_pcm2_open(long flags)`
- `sys_pcm2_write` (line 41) `static long sys_pcm2_write(const void *buf, long len)`
- `sys_pcm2_close` (line 44) `static void sys_pcm2_close(void)`
- `audio_ensure` (line 68) `static void audio_ensure(void)`
- `audio_pump` (line 77) `static void audio_pump(void)` - *SFX are muted on pcm2 (music only): effect tones ruined the melody, so audio_pump below only advances the shared clock and mus_render_pcm mixes * music plus drums. The legacy speaker path still programs real tones.*
- `audio_tone` (line 85) `static void audio_tone(unsigned freq)`
- `audio_close` (line 92) `static void audio_close(void)`
- `mus_read_varlen` (line 169) `static int mus_read_varlen(mus_player_t *m, unsigned long *out)`
- `mus_next_block` (line 183) `static int mus_next_block(mus_player_t *m, unsigned long *out)` - *Process one full block of events at the current tick and advance pos past * its delta.  Returns the delta in *out.  Returns 0 at end of score.*
- `mus_note_cmp` (line 228) `static int mus_note_cmp(const void *a, const void *b)`
- `mus_build_chord` (line 236) `static void mus_build_chord(mus_player_t *m)` - *Split the sounding notes into a bass pedal (the lowest note below the bass line) and the melody arpeggio (the highest MUS_ARP_MAX melody * notes).  Percussion never enters active[], so it is skipped here too.*
- `mus_hold_tone` (line 261) `static void mus_hold_tone(unsigned freq, unsigned long ms)` - *Hold a tone for the given number of milliseconds. On pcm2 the hold's audio is queued up front (NONBLOCK) and the busy-wait preserves timing * while it plays; on the legacy speaker the tone is programmed and held.*
- `mus_play_chord` (line 274) `static void mus_play_chord(mus_player_t *m)` - *Play one full cycle of the pseudo-polyphony: the bass pedal first, held long like the NES triangle voice, then the melody notes arpeggiated rapidly.  The repeated cycle at this cadence is what the ear integrates * into a chord instead of one voice.*
- `mus_advance` (line 288) `static void mus_advance(mus_player_t *m, unsigned long ms)`
- `mus_render_pcm` (line 320) `static void mus_render_pcm(mus_player_t *m, unsigned char *out, unsigned n)` - *Polyphonic pcm2 music: every sounding voice at once, as the score has it. The legacy path above time-slices one square wave because the PC speaker is a single channel; pcm2 takes mixed PCM, so there is no reason to arpeggiate. Each MUS tick renders its active set (all melody voices plus the bass, each with a persistent phase for click-free sustains) normalized to a constant level, plus a short noise burst for percussion hits captured in mus_next_block. Timing is tick-exact: ticks convert to samples with an absolute counter, so the rate never drifts. Runs under the shared audio_last_ms clock, so sfx and music never double-render an interval; the current sfx tone mixes in as one more * voice, giving true sfx+music polyphony.*
- `mus_render_push` (line 359) `static void mus_render_push(mus_player_t *m, unsigned n)`
- `mus_advance_pcm` (line 369) `static void mus_advance_pcm(mus_player_t *m)`
- `MUS_Init` (line 410) `static boolean MUS_Init(void)`
- `MUS_Shutdown` (line 415) `static void MUS_Shutdown(void)`
- `MUS_SetMusicVolume` (line 422) `static void MUS_SetMusicVolume(int volume)`
- `MUS_Pause` (line 424) `static void MUS_Pause(void)`
- `MUS_Resume` (line 425) `static void MUS_Resume(void)`
- `MUS_RegisterSong` (line 427) `static void *MUS_RegisterSong(void *data, int len)`
- `MUS_UnRegisterSong` (line 442) `static void MUS_UnRegisterSong(void *handle)`
- `MUS_PlaySong` (line 448) `static void MUS_PlaySong(void *handle, boolean looping)`
- `MUS_StopSong` (line 469) `static void MUS_StopSong(void)`
- `MUS_MusicIsPlaying` (line 474) `static boolean MUS_MusicIsPlaying(void)`
- `MUS_Poll` (line 478) `static void MUS_Poll(void)`
- `PCSPK_Init` (line 512) `static boolean PCSPK_Init(boolean use_sfx_prefix)`
- `PCSPK_Shutdown` (line 519) `static void PCSPK_Shutdown(void)`
- `PCSPK_GetSfxLumpNum` (line 529) `static int PCSPK_GetSfxLumpNum(sfxinfo_t *sfx)`
- `free_channel` (line 540) `static void free_channel(int i)`
- `PCSPK_Update` (line 549) `static void PCSPK_Update(void)`
- `PCSPK_UpdateSoundParams` (line 587) `static void PCSPK_UpdateSoundParams(int ch, int v, int s)`
- `PCSPK_StartSound` (line 591) `static int PCSPK_StartSound(sfxinfo_t *sfx, int channel, int vol, int sep)`
- `PCSPK_StopSound` (line 641) `static void PCSPK_StopSound(int channel)`
- `PCSPK_SoundIsPlaying` (line 647) `static boolean PCSPK_SoundIsPlaying(int channel)`
- `PCSPK_CacheSounds` (line 653) `static void PCSPK_CacheSounds(sfxinfo_t *s, int n)`
- `muted` (line 51) `* pcm2 while sfx stay muted (effect tones ruined the melody);`

**Macros:**
- `PCSPK_CHANNELS` (line 12) `#define PCSPK_CHANNELS`
- `PCSPK_TICK_MS` (line 13) `#define PCSPK_TICK_MS`
- `DOOM_PCM_RATE` (line 55) `#define DOOM_PCM_RATE`
- `DOOM_PCM_VOL` (line 56) `#define DOOM_PCM_VOL`
- `MUS_TICKS_PER_SEC` (line 118) `#define MUS_TICKS_PER_SEC`
- `MUS_PERCUSSION_CHAN` (line 119) `#define MUS_PERCUSSION_CHAN`
- `MUS_ARP_SLOT_MS` (line 120) `#define MUS_ARP_SLOT_MS`
- `MUS_BASS_HOLD_MS` (line 121) `#define MUS_BASS_HOLD_MS`
- `MUS_BASS_LINE_MIDI` (line 122) `#define MUS_BASS_LINE_MIDI`
- `MUS_ARP_MAX` (line 123) `#define MUS_ARP_MAX`
- `DOOM_PCM_DRUM_SMP` (line 125) `#define DOOM_PCM_DRUM_SMP`

**Structs:**
- `pcspk_channel_t` (line 17)
- `mus_player_t` (line 146)

#### `i_scale.c`
**Path:** `progs/doomgeneric/i_scale.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Screen scale-up code: 1x,2x,3x,4x pixel doubling Aspect ratio-correcting stretch functions*

**Functions:**
- `I_InitScale` (line 61) `void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch)`
- `I_Scale1x` (line 75) `static boolean I_Scale1x(int x1, int y1, int x2, int y2)`
- `I_Scale2x` (line 105) `static boolean I_Scale2x(int x1, int y1, int x2, int y2)`
- `I_Scale3x` (line 146) `static boolean I_Scale3x(int x1, int y1, int x2, int y2)`
- `I_Scale4x` (line 191) `static boolean I_Scale4x(int x1, int y1, int x2, int y2)`
- `I_Scale5x` (line 240) `static boolean I_Scale5x(int x1, int y1, int x2, int y2)`
- `FindNearestColor` (line 295) `static int FindNearestColor(byte *palette, int r, int g, int b)`
- `GenerateStretchTable` (line 332) `static byte *GenerateStretchTable(byte *palette, int pct)`
- `I_InitStretchTables` (line 361) `static void I_InitStretchTables(byte *palette)`
- `I_InitSquashTable` (line 387) `static void I_InitSquashTable(byte *palette)`
- `I_ResetScaleTables` (line 404) `void I_ResetScaleTables(byte *palette)`
- `WriteBlendedLine1x` (line 434) `static inline void WriteBlendedLine1x(byte *dest, byte *src1, byte *src2, 
                      ...`
- `I_Stretch1x` (line 450) `static boolean I_Stretch1x(int x1, int y1, int x2, int y2)`
- `WriteLine2x` (line 507) `static inline void WriteLine2x(byte *dest, byte *src)`
- `WriteBlendedLine2x` (line 520) `static inline void WriteBlendedLine2x(byte *dest, byte *src1, byte *src2, 
                      ...`
- `I_Stretch2x` (line 539) `static boolean I_Stretch2x(int x1, int y1, int x2, int y2)`
- `WriteLine3x` (line 620) `static inline void WriteLine3x(byte *dest, byte *src)`
- `WriteBlendedLine3x` (line 634) `static inline void WriteBlendedLine3x(byte *dest, byte *src1, byte *src2, 
                      ...`
- `I_Stretch3x` (line 654) `static boolean I_Stretch3x(int x1, int y1, int x2, int y2)`
- `WriteLine4x` (line 759) `static inline void WriteLine4x(byte *dest, byte *src)`
- `WriteBlendedLine4x` (line 774) `static inline void WriteBlendedLine4x(byte *dest, byte *src1, byte *src2, 
                      ...`
- `I_Stretch4x` (line 795) `static boolean I_Stretch4x(int x1, int y1, int x2, int y2)`
- `WriteLine5x` (line 924) `static inline void WriteLine5x(byte *dest, byte *src)`
- `I_Stretch5x` (line 942) `static boolean I_Stretch5x(int x1, int y1, int x2, int y2)`
- `WriteSquashedLine1x` (line 1030) `static inline void WriteSquashedLine1x(byte *dest, byte *src)`
- `I_Squash1x` (line 1061) `static boolean I_Squash1x(int x1, int y1, int x2, int y2)`
- `WriteSquashedLine2x` (line 1102) `static inline void WriteSquashedLine2x(byte *dest, byte *src)`
- `I_Squash2x` (line 1160) `static boolean I_Squash2x(int x1, int y1, int x2, int y2)`
- `WriteSquashedLine3x` (line 1197) `static inline void WriteSquashedLine3x(byte *dest, byte *src)`
- `I_Squash3x` (line 1243) `static boolean I_Squash3x(int x1, int y1, int x2, int y2)`
- `WriteSquashedLine4x` (line 1279) `static inline void WriteSquashedLine4x(byte *dest, byte *src)`
- `I_Squash4x` (line 1354) `static boolean I_Squash4x(int x1, int y1, int x2, int y2)`
- `WriteSquashedLine5x` (line 1390) `static inline void WriteSquashedLine5x(byte *dest, byte *src)`
- `I_Squash5x` (line 1419) `static boolean I_Squash5x(int x1, int y1, int x2, int y2)`

**Macros:**
- `inline` (line 32) `#define inline`
- `DRAW_PIXEL2` (line 1099) `#define DRAW_PIXEL2`
- `DRAW_PIXEL3` (line 1194) `#define DRAW_PIXEL3`
- `DRAW_PIXEL4` (line 1276) `#define DRAW_PIXEL4`
- `DRAW_PIXEL5` (line 1387) `#define DRAW_PIXEL5`

#### `i_sound.c`
**Path:** `progs/doomgeneric/i_sound.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none*

**Functions:**
- `SndDeviceInList` (line 116) `static boolean SndDeviceInList(snddevice_t device, snddevice_t *list,
                           ...`
- `InitSfxModule` (line 135) `static void InitSfxModule(boolean use_sfx_prefix)`
- `InitMusicModule` (line 163) `static void InitMusicModule(void)`
- `I_InitSound` (line 195) `void I_InitSound(boolean use_sfx_prefix)`
- `I_ShutdownSound` (line 250) `void I_ShutdownSound(void)`
- `I_GetSfxLumpNum` (line 263) `int I_GetSfxLumpNum(sfxinfo_t *sfxinfo)`
- `I_UpdateSound` (line 275) `void I_UpdateSound(void)`
- `CheckVolumeSeparation` (line 288) `static void CheckVolumeSeparation(int *vol, int *sep)`
- `I_UpdateSoundParams` (line 309) `void I_UpdateSoundParams(int channel, int vol, int sep)`
- `I_StartSound` (line 318) `int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep)`
- `I_StopSound` (line 331) `void I_StopSound(int channel)`
- `I_SoundIsPlaying` (line 339) `boolean I_SoundIsPlaying(int channel)`
- `I_PrecacheSounds` (line 351) `void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds)`
- `I_InitMusic` (line 359) `void I_InitMusic(void)`
- `I_ShutdownMusic` (line 363) `void I_ShutdownMusic(void)`
- `I_SetMusicVolume` (line 368) `void I_SetMusicVolume(int volume)`
- `I_PauseSong` (line 376) `void I_PauseSong(void)`
- `I_ResumeSong` (line 384) `void I_ResumeSong(void)`
- `I_RegisterSong` (line 392) `void *I_RegisterSong(void *data, int len)`
- `I_UnRegisterSong` (line 404) `void I_UnRegisterSong(void *handle)`
- `I_PlaySong` (line 412) `void I_PlaySong(void *handle, boolean looping)`
- `I_StopSong` (line 420) `void I_StopSong(void)`
- `I_MusicIsPlaying` (line 428) `boolean I_MusicIsPlaying(void)`
- `I_BindSoundVariables` (line 440) `void I_BindSoundVariables(void)`
- `I_InitTimidityConfig` (line 65) `extern void I_InitTimidityConfig(void);`

**Variables:**
- `sound_sdl_module` (line 66) `extern sound_module_t sound_sdl_module;`
- `sound_pcsound_module` (line 67) `extern sound_module_t sound_pcsound_module;`
- `music_sdl_module` (line 68) `extern music_module_t music_sdl_module;`
- `music_opl_module` (line 69) `extern music_module_t music_opl_module;`
- `music_pcspeaker_module` (line 70) `extern music_module_t music_pcspeaker_module;`
- `opl_io_port` (line 74) `extern int opl_io_port;`
- `timidity_cfg_path` (line 78) `extern char *timidity_cfg_path;`
- `use_libsamplerate` (line 443) `extern int use_libsamplerate;` - *ifdef ORIGCODE*
- `libsamplerate_scale` (line 444) `extern float libsamplerate_scale;`

#### `i_system.c`
**Path:** `progs/doomgeneric/i_system.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:*

**Functions:**
- `I_AtExit` (line 73) `void I_AtExit(atexit_func_t func, boolean run_on_error)`
- `I_Tactile` (line 87) `void I_Tactile(int on, int off, int total)`
- `AutoAllocMemory` (line 95) `static byte *AutoAllocMemory(int *size, int default_ram, int min_ram)`
- `I_ZoneBase` (line 133) `byte *I_ZoneBase (int *size)`
- `I_PrintBanner` (line 166) `void I_PrintBanner(char *msg)`
- `I_PrintDivider` (line 177) `void I_PrintDivider(void)`
- `I_PrintStartupBanner` (line 189) `void I_PrintStartupBanner(char *gamedescription)`
- `I_ConsoleStdout` (line 210) `boolean I_ConsoleStdout(void)`
- `I_Quit` (line 246) `void I_Quit (void)`
- `ZenityAvailable` (line 272) `static int ZenityAvailable(void)`
- `EscapeShellString` (line 280) `static char *EscapeShellString(char *string)`
- `ZenityErrorBox` (line 323) `static int ZenityErrorBox(char *message)`
- `I_Error` (line 359) `void I_Error (char *error, ...)`
- `I_GetMemoryValue` (line 502) `boolean I_GetMemoryValue(unsigned int offset, void *value, int size)`

**Macros:**
- `WIN32_LEAN_AND_MEAN` (line 27) `#define WIN32_LEAN_AND_MEAN`
- `DEFAULT_RAM` (line 58) `#define DEFAULT_RAM`
- `MIN_RAM` (line 59) `#define MIN_RAM`
- `ZENITY_BINARY` (line 268) `#define ZENITY_BINARY`
- `DOS_MEM_DUMP_SIZE` (line 490) `#define DOS_MEM_DUMP_SIZE`

**Structs:**
- `atexit_listentry_s` (line 64)

**Type_Aliases:**
- `atexit_listentry_t` (line 60) `typedef struct atexit_listentry_s atexit_listentry_t;` - *#include "i_timer.h" #include "i_video.h" #include "i_system.h" #include "w_wad.h" #include "z_zone.h" #ifdef __MACOSX__ #include <CoreFoundation/CFUserNotification.h> #endif #define DEFAULT_RAM 6 /* MiB #define MIN_RAM     6  /* MiB*

#### `i_timer.c`
**Path:** `progs/doomgeneric/i_timer.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Timer functions.     #include <sys/time.h> #include <unistd.h>    I_GetTime*

**Functions:**
- `I_GetTicks` (line 37) `int I_GetTicks(void)`
- `I_GetTime` (line 42) `int  I_GetTime (void)`
- `I_GetTimeMS` (line 61) `int I_GetTimeMS(void)`
- `I_Sleep` (line 75) `void I_Sleep(int ms)`
- `I_WaitVBL` (line 83) `void I_WaitVBL(int count)`
- `I_InitTimer` (line 89) `void I_InitTimer(void)`

#### `i_video.c`
**Path:** `progs/doomgeneric/i_video.c`
**File Doc:** *Emacs style mode select   -*- C++ -*- -----------------------------------------------------------------------------  $Id:$  Copyright (C) 1993-1996 by id Software, Inc.  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  $Log:$  DESCRIPTION: DOOM graphics stuff for X11, UNIX.  -----------------------------------------------------------------------------*

**Functions:**
- `cmap_to_rgb565` (line 131) `void cmap_to_rgb565(uint16_t * out, uint8_t * in, int in_pixels)`
- `cmap_to_fb` (line 152) `void cmap_to_fb(uint8_t * out, uint8_t * in, int in_pixels)`
- `I_InitGraphics` (line 179) `void I_InitGraphics (void)`
- `I_ShutdownGraphics` (line 232) `void I_ShutdownGraphics (void)`
- `I_StartFrame` (line 237) `void I_StartFrame (void)`
- `I_StartTic` (line 242) `void I_StartTic (void)`
- `I_UpdateNoBlit` (line 247) `void I_UpdateNoBlit (void)`
- `I_FinishUpdate` (line 255) `void I_FinishUpdate (void)`
- `I_ReadScreen` (line 302) `void I_ReadScreen (byte* scr)` - *I_ReadScreen*
- `I_SetPalette` (line 315) `void I_SetPalette (byte* palette)`
- `I_GetPaletteIndex` (line 333) `int I_GetPaletteIndex (int r, int g, int b)`
- `I_BeginRead` (line 369) `void I_BeginRead (void)`
- `I_EndRead` (line 373) `void I_EndRead (void)`
- `I_SetWindowTitle` (line 377) `void I_SetWindowTitle (char *title)`
- `I_GraphicsCheckCommandLine` (line 382) `void I_GraphicsCheckCommandLine (void)`
- `I_SetGrabMouseCallback` (line 386) `void I_SetGrabMouseCallback (grabmouse_callback_t func)`
- `I_EnableLoadingDisk` (line 390) `void I_EnableLoadingDisk(void)`
- `I_BindVideoVariables` (line 394) `void I_BindVideoVariables (void)`
- `I_DisplayFPSDots` (line 398) `void I_DisplayFPSDots (boolean dots_on)`
- `I_CheckIsScreensaver` (line 402) `void I_CheckIsScreensaver (void)`
- `I_GetEvent` (line 89) `void I_GetEvent(void);`
- `I_InitInput` (line 228) `extern int I_InitInput(void);`

**Macros:**
- `GFX_RGB565` (line 310) `#define GFX_RGB565(r, g, b)`
- `GFX_RGB565_R` (line 311) `#define GFX_RGB565_R(color)`
- `GFX_RGB565_G` (line 312) `#define GFX_RGB565_G(color)`
- `GFX_RGB565_B` (line 313) `#define GFX_RGB565_B(color)`

**Structs:**
- `FB_BitField` (line 54)
- `FB_ScreenInfo` (line 60)
- `color` (line 80)
- `col_t` (line 120)

**Variables:**
- `minios_palette_dirty` (line 52) `extern volatile int minios_palette_dirty;`

#### `icon.c`
**Path:** `progs/doomgeneric/icon.c`

*No symbols extracted*

#### `info.c`
**Path:** `progs/doomgeneric/info.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Thing frame/state LUT, generated by multigen utilitiy. This one is the original DOOM version, preserved.    Data.*

**Functions:**
- `A_Light0` (line 51) `void A_Light0();` - *Doesn't work with g++, needs actionf_p1*
- `A_WeaponReady` (line 52) `void A_WeaponReady();`
- `A_Lower` (line 53) `void A_Lower();`
- `A_Raise` (line 54) `void A_Raise();`
- `A_Punch` (line 55) `void A_Punch();`
- `A_ReFire` (line 56) `void A_ReFire();`
- `A_FirePistol` (line 57) `void A_FirePistol();`
- `A_Light1` (line 58) `void A_Light1();`
- `A_FireShotgun` (line 59) `void A_FireShotgun();`
- `A_Light2` (line 60) `void A_Light2();`
- `A_FireShotgun2` (line 61) `void A_FireShotgun2();`
- `A_CheckReload` (line 62) `void A_CheckReload();`
- `A_OpenShotgun2` (line 63) `void A_OpenShotgun2();`
- `A_LoadShotgun2` (line 64) `void A_LoadShotgun2();`
- `A_CloseShotgun2` (line 65) `void A_CloseShotgun2();`
- `A_FireCGun` (line 66) `void A_FireCGun();`
- `A_GunFlash` (line 67) `void A_GunFlash();`
- `A_FireMissile` (line 68) `void A_FireMissile();`
- `A_Saw` (line 69) `void A_Saw();`
- `A_FirePlasma` (line 70) `void A_FirePlasma();`
- `A_BFGsound` (line 71) `void A_BFGsound();`
- `A_FireBFG` (line 72) `void A_FireBFG();`
- `A_BFGSpray` (line 73) `void A_BFGSpray();`
- `A_Explode` (line 74) `void A_Explode();`
- `A_Pain` (line 75) `void A_Pain();`
- `A_PlayerScream` (line 76) `void A_PlayerScream();`
- `A_Fall` (line 77) `void A_Fall();`
- `A_XScream` (line 78) `void A_XScream();`
- `A_Look` (line 79) `void A_Look();`
- `A_Chase` (line 80) `void A_Chase();`
- `A_FaceTarget` (line 81) `void A_FaceTarget();`
- `A_PosAttack` (line 82) `void A_PosAttack();`
- `A_Scream` (line 83) `void A_Scream();`
- `A_SPosAttack` (line 84) `void A_SPosAttack();`
- `A_VileChase` (line 85) `void A_VileChase();`
- `A_VileStart` (line 86) `void A_VileStart();`
- `A_VileTarget` (line 87) `void A_VileTarget();`
- `A_VileAttack` (line 88) `void A_VileAttack();`
- `A_StartFire` (line 89) `void A_StartFire();`
- `A_Fire` (line 90) `void A_Fire();`
- `A_FireCrackle` (line 91) `void A_FireCrackle();`
- `A_Tracer` (line 92) `void A_Tracer();`
- `A_SkelWhoosh` (line 93) `void A_SkelWhoosh();`
- `A_SkelFist` (line 94) `void A_SkelFist();`
- `A_SkelMissile` (line 95) `void A_SkelMissile();`
- `A_FatRaise` (line 96) `void A_FatRaise();`
- `A_FatAttack1` (line 97) `void A_FatAttack1();`
- `A_FatAttack2` (line 98) `void A_FatAttack2();`
- `A_FatAttack3` (line 99) `void A_FatAttack3();`
- `A_BossDeath` (line 100) `void A_BossDeath();`
- `A_CPosAttack` (line 101) `void A_CPosAttack();`
- `A_CPosRefire` (line 102) `void A_CPosRefire();`
- `A_TroopAttack` (line 103) `void A_TroopAttack();`
- `A_SargAttack` (line 104) `void A_SargAttack();`
- `A_HeadAttack` (line 105) `void A_HeadAttack();`
- `A_BruisAttack` (line 106) `void A_BruisAttack();`
- `A_SkullAttack` (line 107) `void A_SkullAttack();`
- `A_Metal` (line 108) `void A_Metal();`
- `A_SpidRefire` (line 109) `void A_SpidRefire();`
- `A_BabyMetal` (line 110) `void A_BabyMetal();`
- `A_BspiAttack` (line 111) `void A_BspiAttack();`
- `A_Hoof` (line 112) `void A_Hoof();`
- `A_CyberAttack` (line 113) `void A_CyberAttack();`
- `A_PainAttack` (line 114) `void A_PainAttack();`
- `A_PainDie` (line 115) `void A_PainDie();`
- `A_KeenDie` (line 116) `void A_KeenDie();`
- `A_BrainPain` (line 117) `void A_BrainPain();`
- `A_BrainScream` (line 118) `void A_BrainScream();`
- `A_BrainDie` (line 119) `void A_BrainDie();`
- `A_BrainAwake` (line 120) `void A_BrainAwake();`
- `A_BrainSpit` (line 121) `void A_BrainSpit();`
- `A_SpawnSound` (line 122) `void A_SpawnSound();`
- `A_SpawnFly` (line 123) `void A_SpawnFly();`
- `A_BrainExplode` (line 124) `void A_BrainExplode();`

#### `m_argv.c`
**Path:** `progs/doomgeneric/m_argv.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:*

**Functions:**
- `M_CheckParmWithArgs` (line 43) `int M_CheckParmWithArgs(char *check, int num_args)`
- `M_ParmExists` (line 63) `boolean M_ParmExists(char *check)`
- `M_CheckParm` (line 68) `int M_CheckParm(char *check)`
- `LoadResponseFile` (line 75) `static void LoadResponseFile(int argv_index)`
- `M_FindResponseFile` (line 235) `void M_FindResponseFile(void)`
- `M_GetExecutableName` (line 250) `char *M_GetExecutableName(void)`

**Macros:**
- `MAXARGVS` (line 73) `#define MAXARGVS`

#### `m_bbox.c`
**Path:** `progs/doomgeneric/m_bbox.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main loop menu stuff. Random number LUT. Default Config File. PCX Screenshots.*

**Functions:**
- `M_ClearBox` (line 29) `void M_ClearBox (fixed_t *box)`
- `M_AddToBox` (line 36) `void
M_AddToBox
( fixed_t*	box,
  fixed_t	x,
  fixed_t	y )`

#### `m_cheat.c`
**Path:** `progs/doomgeneric/m_cheat.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Cheat sequence checking.        CHEAT SEQUENCE PACKAGE*

**Functions:**
- `cht_CheckCheat` (line 35) `int
cht_CheckCheat
( cheatseq_t*	cht,
  char		key )`
- `cht_GetParam` (line 82) `void
cht_GetParam
( cheatseq_t*	cht,
  char*		buffer )`

#### `m_config.c`
**Path:** `progs/doomgeneric/m_config.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Configuration file interface.*

**Functions:**
- `SearchCollection` (line 1563) `static default_t *SearchCollection(default_collection_t *collection, char *name)`
- `SaveDefaultCollection` (line 1609) `static void SaveDefaultCollection(default_collection_t *collection)`
- `ParseIntParameter` (line 1716) `static int ParseIntParameter(char *strparm)`
- `SetVariable` (line 1728) `static void SetVariable(default_t *def, char *value)`
- `LoadDefaultCollection` (line 1771) `static void LoadDefaultCollection(default_collection_t *collection)`
- `M_SetConfigFilenames` (line 1836) `void M_SetConfigFilenames(char *main_config, char *extra_config)`
- `M_SaveDefaults` (line 1846) `void M_SaveDefaults (void)`
- `M_SaveDefaultsAlternate` (line 1856) `void M_SaveDefaultsAlternate(char *main, char *extra)`
- `M_LoadDefaults` (line 1881) `void M_LoadDefaults (void)`
- `GetDefaultForName` (line 1937) `static default_t *GetDefaultForName(char *name)`
- `M_BindVariable` (line 1964) `void M_BindVariable(char *name, void *location)`
- `M_SetVariable` (line 1977) `boolean M_SetVariable(char *name, char *value)`
- `M_GetIntVariable` (line 1995) `int M_GetIntVariable(char *name)`
- `M_GetStrVariable` (line 2010) `const char *M_GetStrVariable(char *name)`
- `M_GetFloatVariable` (line 2025) `float M_GetFloatVariable(char *name)`
- `GetDefaultConfigDir` (line 2043) `static char *GetDefaultConfigDir(void)`
- `M_SetConfigDir` (line 2059) `void M_SetConfigDir(char *dir)`
- `M_GetSaveGameDir` (line 2087) `char *M_GetSaveGameDir(char *iwadname)`

**Macros:**
- `CONFIG_VARIABLE_GENERIC` (line 95) `#define CONFIG_VARIABLE_GENERIC(name, type)`
- `CONFIG_VARIABLE_KEY` (line 98) `#define CONFIG_VARIABLE_KEY(name)`
- `CONFIG_VARIABLE_INT` (line 100) `#define CONFIG_VARIABLE_INT(name)`
- `CONFIG_VARIABLE_INT_HEX` (line 102) `#define CONFIG_VARIABLE_INT_HEX(name)`
- `CONFIG_VARIABLE_FLOAT` (line 104) `#define CONFIG_VARIABLE_FLOAT(name)`
- `CONFIG_VARIABLE_STRING` (line 106) `#define CONFIG_VARIABLE_STRING(name)`

**Structs:**
- `default_t` (line 61)
- `default_collection_t` (line 88)

#### `m_controls.c`
**Path:** `progs/doomgeneric/m_controls.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.       Keyboard controls*

**Functions:**
- `M_BindBaseControls` (line 204) `void M_BindBaseControls(void)`
- `M_BindHereticControls` (line 241) `void M_BindHereticControls(void)`
- `M_BindHexenControls` (line 256) `void M_BindHexenControls(void)`
- `M_BindStrifeControls` (line 272) `void M_BindStrifeControls(void)`
- `M_BindWeaponControls` (line 307) `void M_BindWeaponControls(void)`
- `M_BindMapControls` (line 328) `void M_BindMapControls(void)`
- `M_BindMenuControls` (line 344) `void M_BindMenuControls(void)`
- `M_BindChatControls` (line 375) `void M_BindChatControls(unsigned int num_players)`
- `M_ApplyPlatformDefaults` (line 394) `void M_ApplyPlatformDefaults(void)`

#### `m_fixed.c`
**Path:** `progs/doomgeneric/m_fixed.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Fixed point implementation.*

**Functions:**
- `FixedMul` (line 34) `fixed_t
FixedMul
( fixed_t	a,
  fixed_t	b )`
- `FixedDiv` (line 47) `fixed_t FixedDiv(fixed_t a, fixed_t b)`

#### `m_menu.c`
**Path:** `progs/doomgeneric/m_menu.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: DOOM selection menu, options, episode etc. Sliders and icons. Kinda widget stuff.*

**Functions:**
- `M_ReadSaveStrings` (line 503) `void M_ReadSaveStrings(void)` - *M_ReadSaveStrings read the strings from the savegame files*
- `M_DrawLoad` (line 530) `void M_DrawLoad(void)` - *M_LoadGame & Cie.*
- `M_DrawSaveLoadBorder` (line 549) `void M_DrawSaveLoadBorder(int x,int y)` - *Draw border for the savegame description*
- `M_LoadSelect` (line 572) `void M_LoadSelect(int choice)` - *User wants to load this game*
- `M_LoadGame` (line 585) `void M_LoadGame (int choice)` - *Selected from DOOM menu*
- `M_DrawSave` (line 601) `void M_DrawSave(void)` - *M_SaveGame & Cie.*
- `M_DoSave` (line 622) `void M_DoSave(int slot)` - *M_Responder calls this when user is finished*
- `M_SaveSelect` (line 635) `void M_SaveSelect(int choice)` - *User wants to save. Start string input for M_Responder*
- `M_SaveGame` (line 650) `void M_SaveGame (int choice)` - *Selected from DOOM menu*
- `M_QuickSaveResponse` (line 672) `void M_QuickSaveResponse(int key)`
- `M_QuickSave` (line 681) `void M_QuickSave(void)`
- `M_QuickLoadResponse` (line 709) `void M_QuickLoadResponse(int key)` - *M_QuickLoad*
- `M_QuickLoad` (line 719) `void M_QuickLoad(void)`
- `M_DrawReadThis1` (line 743) `void M_DrawReadThis1(void)` - *Read This Menus Had a "quick hack to fix romero bug"*
- `M_DrawReadThis2` (line 820) `void M_DrawReadThis2(void)` - *Read This Menus - optional second page.*
- `M_DrawSound` (line 834) `void M_DrawSound(void)` - *Change Sfx & Music volumes*
- `M_Sound` (line 845) `void M_Sound(int choice)`
- `M_SfxVol` (line 850) `void M_SfxVol(int choice)`
- `M_MusicVol` (line 867) `void M_MusicVol(int choice)`
- `M_DrawMainMenu` (line 890) `void M_DrawMainMenu(void)` - *M_DrawMainMenu*
- `M_DrawNewGame` (line 902) `void M_DrawNewGame(void)` - *M_NewGame*
- `M_NewGame` (line 908) `void M_NewGame(int choice)`
- `M_DrawEpisode` (line 930) `void M_DrawEpisode(void)`
- `M_VerifyNightmare` (line 935) `void M_VerifyNightmare(int key)`
- `M_ChooseSkill` (line 944) `void M_ChooseSkill(int choice)`
- `M_Episode` (line 956) `void M_Episode(int choice)`
- `M_DrawOptions` (line 987) `void M_DrawOptions(void)`
- `M_Options` (line 1007) `void M_Options(int choice)`
- `M_ChangeMessages` (line 1017) `void M_ChangeMessages(int choice)` - *Toggle messages on/off*
- `M_EndGameResponse` (line 1035) `void M_EndGameResponse(int key)` - *M_EndGame*
- `M_EndGame` (line 1045) `void M_EndGame(int choice)`
- `M_ReadThis` (line 1069) `void M_ReadThis(int choice)` - *M_ReadThis*
- `M_ReadThis2` (line 1075) `void M_ReadThis2(int choice)`
- `M_FinishReadThis` (line 1093) `void M_FinishReadThis(int choice)`
- `M_QuitResponse` (line 1131) `void M_QuitResponse(int key)`
- `M_SelectEndMessage` (line 1147) `static char *M_SelectEndMessage(void)`
- `M_QuitDOOM` (line 1168) `void M_QuitDOOM(int choice)`
- `M_ChangeSensitivity` (line 1179) `void M_ChangeSensitivity(int choice)`
- `M_ChangeDetail` (line 1197) `void M_ChangeDetail(int choice)`
- `M_SizeDisplay` (line 1213) `void M_SizeDisplay(int choice)`
- `M_DrawThermo` (line 1244) `void
M_DrawThermo
( int	x,
  int	y,
  int	thermWidth,
  int	thermDot )`
- `M_DrawEmptyCell` (line 1270) `void
M_DrawEmptyCell
( menu_t*	menu,
  int		item )`
- `M_DrawSelCell` (line 1279) `void
M_DrawSelCell
( menu_t*	menu,
  int		item )`
- `M_StartMessage` (line 1289) `void
M_StartMessage
( char*		string,
  void*		routine,
  boolean	input )`
- `M_StopMessage` (line 1304) `void M_StopMessage(void)`
- `M_StringWidth` (line 1315) `int M_StringWidth(char* string)` - *Find string width from hu_font chars*
- `M_StringHeight` (line 1338) `int M_StringHeight(char* string)` - *Find string height from hu_font chars*
- `M_WriteText` (line 1357) `void
M_WriteText
( int		x,
  int		y,
  char*		string)`
- `IsNullKey` (line 1403) `static boolean IsNullKey(int key)`
- `M_Responder` (line 1416) `boolean M_Responder (event_t* ev)` - *M_Responder*
- `M_StartControlPanel` (line 1899) `void M_StartControlPanel (void)` - *M_StartControlPanel*
- `M_DrawOPLDev` (line 1913) `static void M_DrawOPLDev(void)` - *if 0*
- `M_Drawer` (line 1951) `void M_Drawer (void)` - *M_Drawer Called after the view has been rendered, but before it has been blitted.*
- `M_ClearMenus` (line 2041) `void M_ClearMenus (void)` - *M_ClearMenus*
- `M_SetupNextMenu` (line 2054) `void M_SetupNextMenu(menu_t *menudef)` - *M_SetupNextMenu*
- `M_Ticker` (line 2064) `void M_Ticker (void)` - *M_Ticker*
- `M_Init` (line 2077) `void M_Init (void)` - *M_Init*
- `M_StartGame` (line 193) `void M_StartGame(int choice);`
- `I_OPL_DevMessages` (line 1915) `extern void I_OPL_DevMessages(char *, size_t);`

**Macros:**
- `SKULLXOFF` (line 120) `#define SKULLXOFF`
- `LINEHEIGHT` (line 121) `#define LINEHEIGHT`

**Structs:**
- `menu_s` (line 151)
- `menuitem_t` (line 133) - *MENU TYPEDEFS*

**Type_Aliases:**
- `numitems` (line 148) `typedef struct menu_s { short numitems;`

**Variables:**
- `hu_font` (line 62) `extern patch_t* hu_font[HU_FONTSIZE];`
- `message_dontfuckwithme` (line 63) `extern boolean message_dontfuckwithme;`
- `chat_on` (line 65) `extern boolean chat_on;`
- `sendpause` (line 123) `extern boolean sendpause;`

#### `m_misc.c`
**Path:** `progs/doomgeneric/m_misc.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Miscellaneous.*

**Functions:**
- `M_MakeDirectory` (line 55) `void M_MakeDirectory(char *path)`
- `M_FileExists` (line 66) `boolean M_FileExists(char *filename)`
- `M_FileLength` (line 89) `long M_FileLength(FILE *handle)`
- `M_WriteFile` (line 111) `boolean M_WriteFile(char *name, void *source, int length)`
- `M_ReadFile` (line 135) `int M_ReadFile(char *name, byte **buffer)`
- `M_TempFile` (line 166) `char *M_TempFile(char *s)`
- `M_StrToInt` (line 189) `boolean M_StrToInt(const char *str, int *result)`
- `M_ExtractFileBase` (line 197) `void M_ExtractFileBase(char *path, char *dest)`
- `M_ForceUppercase` (line 242) `void M_ForceUppercase(char *text)`
- `M_StrCaseStr` (line 258) `char *M_StrCaseStr(char *haystack, char *needle)`
- `M_StringDuplicate` (line 291) `char *M_StringDuplicate(const char *orig)`
- `M_StringReplace` (line 310) `char *M_StringReplace(const char *haystack, const char *needle,
                      const char ...`
- `M_StringCopy` (line 372) `boolean M_StringCopy(char *dest, const char *src, size_t dest_size)`
- `M_StringConcat` (line 393) `boolean M_StringConcat(char *dest, const char *src, size_t dest_size)`
- `M_StringStartsWith` (line 408) `boolean M_StringStartsWith(const char *s, const char *prefix)`
- `M_StringEndsWith` (line 416) `boolean M_StringEndsWith(const char *s, const char *suffix)`
- `M_StringJoin` (line 425) `char *M_StringJoin(const char *s, ...)`
- `M_vsnprintf` (line 481) `int M_vsnprintf(char *buf, size_t buf_len, const char *s, va_list args)` - *Safe, portable vsnprintf().*
- `M_snprintf` (line 507) `int M_snprintf(char *buf, size_t buf_len, const char *s, ...)` - *Safe, portable snprintf().*
- `M_OEMToUTF8` (line 519) `char *M_OEMToUTF8(const char *oem)`

**Macros:**
- `WIN32_LEAN_AND_MEAN` (line 28) `#define WIN32_LEAN_AND_MEAN`
- `vsnprintf` (line 476) `#define vsnprintf`

#### `m_random.c`
**Path:** `progs/doomgeneric/m_random.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Random number LUT.    M_Random Returns a 0-255 number*

**Functions:**
- `P_Random` (line 50) `int P_Random (void)` - *Which one is deterministic?*
- `M_Random` (line 56) `int M_Random (void)`
- `M_ClearRandom` (line 62) `void M_ClearRandom (void)`

#### `memio.c`
**Path:** `progs/doomgeneric/memio.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Emulates the IO functions in C stdio.h reading and writing to memory.*

**Functions:**
- `mem_fopen_read` (line 42) `MEMFILE *mem_fopen_read(void *buf, size_t buflen)`
- `mem_fread` (line 58) `size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream)`
- `mem_fopen_write` (line 90) `MEMFILE *mem_fopen_write(void)`
- `mem_fwrite` (line 107) `size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream)`
- `mem_get_buf` (line 143) `void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen)`
- `mem_fclose` (line 149) `void mem_fclose(MEMFILE *stream)`
- `mem_ftell` (line 159) `long mem_ftell(MEMFILE *stream)`
- `mem_fseek` (line 164) `int mem_fseek(MEMFILE *stream, signed long position, mem_rel_t whence)`

**Structs:**
- `_MEMFILE` (line 32)

#### `p_ceilng.c`
**Path:** `progs/doomgeneric/p_ceilng.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  Ceiling aninmation (lowering, crushing, raising)       State.  Data.*

**Functions:**
- `T_MoveCeiling` (line 45) `void T_MoveCeiling (ceiling_t* ceiling)`
- `EV_DoCeiling` (line 161) `int
EV_DoCeiling
( line_t*	line,
  ceiling_e	type )`
- `P_AddActiveCeiling` (line 240) `void P_AddActiveCeiling(ceiling_t* c)` - *Add an active ceiling*
- `P_RemoveActiveCeiling` (line 259) `void P_RemoveActiveCeiling(ceiling_t* c)` - *Remove a ceiling's thinker*
- `P_ActivateInStasisCeiling` (line 280) `void P_ActivateInStasisCeiling(line_t* line)` - *Restart a ceiling that's in-stasis*
- `EV_CeilingCrushStop` (line 303) `int	EV_CeilingCrushStop(line_t	*line)` - *EV_CeilingCrushStop Stop a ceiling from crushing!*

#### `p_doors.c`
**Path:** `progs/doomgeneric/p_doors.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Door animation code (opening/closing)        State.*

**Functions:**
- `T_VerticalDoor` (line 57) `void T_VerticalDoor (vldoor_t* door)` - *T_VerticalDoor*
- `EV_DoLockedDoor` (line 195) `int
EV_DoLockedDoor
( line_t*	line,
  vldoor_e	type,
  mobj_t*	thing )`
- `EV_DoDoor` (line 252) `int
EV_DoDoor
( line_t*	line,
  vldoor_e	type )`
- `EV_VerticalDoor` (line 337) `void
EV_VerticalDoor
( line_t*	line,
  mobj_t*	thing )`
- `P_SpawnDoorCloseIn30` (line 519) `void P_SpawnDoorCloseIn30 (sector_t* sec)` - *Spawn a door that closes after 30 seconds*
- `P_SpawnDoorRaiseIn5Mins` (line 542) `void
P_SpawnDoorRaiseIn5Mins
( sector_t*	sec,
  int		secnum )`
- `P_InitSlidingDoorFrames` (line 580) `void P_InitSlidingDoorFrames(void)`
- `P_FindSlidingDoorType` (line 624) `int P_FindSlidingDoorType(line_t*	line)` - *Return index into "slideFrames" array for which door type to use*
- `T_SlidingDoor` (line 639) `void T_SlidingDoor (slidedoor_t*	door)`
- `EV_SlidingDoor` (line 727) `void
EV_SlidingDoor
( line_t*	line,
  mobj_t*	thing )`

#### `p_enemy.c`
**Path:** `progs/doomgeneric/p_enemy.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Enemy thinking, AI. Action Pointer Functions that are associated with states/frames.*

**Functions:**
- `P_RecursiveSound` (line 99) `void
P_RecursiveSound
( sector_t*	sec,
  int		soundblocks )`
- `P_NoiseAlert` (line 152) `void
P_NoiseAlert
( mobj_t*	target,
  mobj_t*	emmiter )`
- `P_CheckMeleeRange` (line 167) `boolean P_CheckMeleeRange (mobj_t*	actor)` - *P_CheckMeleeRange*
- `P_CheckMissileRange` (line 190) `boolean P_CheckMissileRange (mobj_t* actor)` - *P_CheckMissileRange*
- `P_Move` (line 260) `boolean P_Move (mobj_t*	actor)`
- `P_TryWalk` (line 337) `boolean P_TryWalk (mobj_t* actor)` - *TryWalk Attempts to move actor on in its current (ob->moveangle) direction. If blocked by either a wall or an actor returns FALSE If move is either clear or blocked only by a door, returns TRUE and sets... If a door is in the way, an OpenDoor call is made to start it opening.*
- `P_NewChaseDir` (line 351) `void P_NewChaseDir (mobj_t*	actor)`
- `P_LookForPlayers` (line 487) `boolean
P_LookForPlayers
( mobj_t*	actor,
  boolean	allaround )`
- `A_KeenDie` (line 551) `void A_KeenDie (mobj_t* mo)` - *A_KeenDie DOOM II special, map 32. Uses special tag 666.*
- `A_Look` (line 589) `void A_Look (mobj_t* actor)` - *A_Look Stay in state until a player is sighted.*
- `A_Chase` (line 657) `void A_Chase (mobj_t*	actor)` - *A_Chase Actor has a melee attack, so it tries to close as fast as possible*
- `A_FaceTarget` (line 767) `void A_FaceTarget (mobj_t* actor)` - *A_FaceTarget*
- `A_PosAttack` (line 787) `void A_PosAttack (mobj_t* actor)` - *A_PosAttack*
- `A_SPosAttack` (line 806) `void A_SPosAttack (mobj_t* actor)`
- `A_CPosAttack` (line 830) `void A_CPosAttack (mobj_t* actor)`
- `A_CPosRefire` (line 850) `void A_CPosRefire (mobj_t* actor)`
- `A_SpidRefire` (line 867) `void A_SpidRefire (mobj_t* actor)`
- `A_BspiAttack` (line 883) `void A_BspiAttack (mobj_t *actor)`
- `A_TroopAttack` (line 898) `void A_TroopAttack (mobj_t* actor)` - *A_TroopAttack*
- `A_SargAttack` (line 920) `void A_SargAttack (mobj_t* actor)`
- `A_HeadAttack` (line 935) `void A_HeadAttack (mobj_t* actor)`
- `A_CyberAttack` (line 954) `void A_CyberAttack (mobj_t* actor)`
- `A_BruisAttack` (line 964) `void A_BruisAttack (mobj_t* actor)`
- `A_SkelMissile` (line 987) `void A_SkelMissile (mobj_t* actor)` - *A_SkelMissile*
- `A_Tracer` (line 1006) `void A_Tracer (mobj_t* actor)`
- `A_SkelWhoosh` (line 1078) `void A_SkelWhoosh (mobj_t*	actor)`
- `A_SkelFist` (line 1086) `void A_SkelFist (mobj_t*	actor)`
- `PIT_VileCheck` (line 1114) `boolean PIT_VileCheck (mobj_t*	thing)`
- `A_VileChase` (line 1152) `void A_VileChase (mobj_t* actor)` - *A_VileChase Check for ressurecting a body*
- `A_VileStart` (line 1218) `void A_VileStart (mobj_t* actor)` - *A_VileStart*
- `A_StartFire` (line 1230) `void A_StartFire (mobj_t* actor)`
- `A_FireCrackle` (line 1236) `void A_FireCrackle (mobj_t* actor)`
- `A_Fire` (line 1242) `void A_Fire (mobj_t* actor)`
- `A_VileTarget` (line 1273) `void A_VileTarget (mobj_t*	actor)` - *A_VileTarget Spawn the hellfire*
- `A_VileAttack` (line 1298) `void A_VileAttack (mobj_t* actor)` - *A_VileAttack*
- `A_FatRaise` (line 1339) `void A_FatRaise (mobj_t *actor)`
- `A_FatAttack1` (line 1346) `void A_FatAttack1 (mobj_t* actor)`
- `A_FatAttack2` (line 1366) `void A_FatAttack2 (mobj_t* actor)`
- `A_FatAttack3` (line 1385) `void A_FatAttack3 (mobj_t*	actor)`
- `A_SkullAttack` (line 1415) `void A_SkullAttack (mobj_t* actor)`
- `A_PainShootSkull` (line 1446) `void
A_PainShootSkull
( mobj_t*	actor,
  angle_t	angle )`
- `A_PainAttack` (line 1508) `void A_PainAttack (mobj_t* actor)` - *A_PainAttack Spawn a lost soul and launch it at the target*
- `A_PainDie` (line 1518) `void A_PainDie (mobj_t* actor)`
- `A_Scream` (line 1531) `void A_Scream (mobj_t* actor)`
- `A_XScream` (line 1568) `void A_XScream (mobj_t* actor)`
- `A_Pain` (line 1573) `void A_Pain (mobj_t* actor)`
- `A_Fall` (line 1581) `void A_Fall (mobj_t *actor)`
- `A_Explode` (line 1594) `void A_Explode (mobj_t* thingy)` - *A_Explode*
- `CheckBossEnd` (line 1605) `static boolean CheckBossEnd(mobjtype_t motype)`
- `A_BossDeath` (line 1656) `void A_BossDeath (mobj_t* mo)` - *A_BossDeath Possibly trigger special effects if on first boss level*
- `A_Hoof` (line 1757) `void A_Hoof (mobj_t* mo)`
- `A_Metal` (line 1763) `void A_Metal (mobj_t* mo)`
- `A_BabyMetal` (line 1769) `void A_BabyMetal (mobj_t* mo)`
- `A_OpenShotgun2` (line 1776) `void
A_OpenShotgun2
( player_t*	player,
  pspdef_t*	psp )`
- `A_LoadShotgun2` (line 1784) `void
A_LoadShotgun2
( player_t*	player,
  pspdef_t*	psp )`
- `A_CloseShotgun2` (line 1797) `void
A_CloseShotgun2
( player_t*	player,
  pspdef_t*	psp )`
- `A_BrainAwake` (line 1811) `void A_BrainAwake (mobj_t* mo)`
- `A_BrainPain` (line 1841) `void A_BrainPain (mobj_t*	mo)`
- `A_BrainScream` (line 1847) `void A_BrainScream (mobj_t*	mo)`
- `A_BrainExplode` (line 1873) `void A_BrainExplode (mobj_t* mo)`
- `A_BrainDie` (line 1894) `void A_BrainDie (mobj_t*	mo)`
- `A_BrainSpit` (line 1899) `void A_BrainSpit (mobj_t*	mo)`
- `A_SpawnSound` (line 1928) `void A_SpawnSound (mobj_t* mo)` - *travelling cube sound*
- `A_SpawnFly` (line 1934) `void A_SpawnFly (mobj_t* mo)`
- `A_PlayerScream` (line 1992) `void A_PlayerScream (mobj_t* mo)`
- `A_ReFire` (line 1792) `void A_ReFire ( player_t* player, pspdef_t* psp );`

**Macros:**
- `FATSPREAD` (line 1337) `#define	FATSPREAD`
- `SKULLSPEED` (line 1413) `#define	SKULLSPEED`

#### `p_floor.c`
**Path:** `progs/doomgeneric/p_floor.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Floor animation: raising stairs.       State. Data.*

**Functions:**
- `T_MovePlane` (line 42) `result_e
T_MovePlane
( sector_t*	sector,
  fixed_t	speed,
  fixed_t	dest,
  boolean	crush,
  int	...`
- `T_MoveFloor` (line 202) `void T_MoveFloor(floormove_t* floor)` - *MOVE A FLOOR TO IT'S DESTINATION (UP OR DOWN)*
- `EV_DoFloor` (line 251) `int
EV_DoFloor
( line_t*	line,
  floor_e	floortype )`
- `EV_BuildStairs` (line 444) `int
EV_BuildStairs
( line_t*	line,
  stair_e	type )`

#### `p_inter.c`
**Path:** `progs/doomgeneric/p_inter.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handling interactions (i.e., collisions).      Data.*

**Functions:**
- `P_GiveAmmo` (line 66) `boolean
P_GiveAmmo
( player_t*	player,
  ammotype_t	ammo,
  int		num )`
- `P_GiveWeapon` (line 160) `boolean
P_GiveWeapon
( player_t*	player,
  weapontype_t	weapon,
  boolean	dropped )`
- `P_GiveBody` (line 223) `boolean
P_GiveBody
( player_t*	player,
  int		num )`
- `P_GiveArmor` (line 246) `boolean
P_GiveArmor
( player_t*	player,
  int		armortype )`
- `P_GiveCard` (line 268) `void
P_GiveCard
( player_t*	player,
  card_t	card )`
- `P_GivePower` (line 284) `boolean
P_GivePower
( player_t*	player,
  int /*powertype_t*/	power )`
- `P_TouchSpecialThing` (line 333) `void
P_TouchSpecialThing
( mobj_t*	special,
  mobj_t*	toucher )`
- `P_KillMobj` (line 666) `void
P_KillMobj
( mobj_t*	source,
  mobj_t*	target )`
- `P_DamageMobj` (line 779) `void
P_DamageMobj
( mobj_t*	target,
  mobj_t*	inflictor,
  mobj_t*	source,
  int 		damage )`

**Macros:**
- `BONUSADD` (line 43) `#define BONUSADD`

#### `p_lights.c`
**Path:** `progs/doomgeneric/p_lights.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handle Sector base lighting effects. Muzzle flash?        State.*

**Functions:**
- `T_FireFlicker` (line 39) `void T_FireFlicker (fireflicker_t* flick)` - *T_FireFlicker*
- `P_SpawnFireFlicker` (line 61) `void P_SpawnFireFlicker (sector_t*	sector)` - *P_SpawnFireFlicker*
- `T_LightFlash` (line 91) `void T_LightFlash (lightflash_t* flash)` - *T_LightFlash Do flashing lights.*
- `P_SpawnLightFlash` (line 117) `void P_SpawnLightFlash (sector_t*	sector)` - *P_SpawnLightFlash After the map has been loaded, scan each sector for specials that spawn thinkers*
- `T_StrobeFlash` (line 148) `void T_StrobeFlash (strobe_t*		flash)` - *T_StrobeFlash*
- `P_SpawnStrobeFlash` (line 174) `void
P_SpawnStrobeFlash
( sector_t*	sector,
  int		fastOrSlow,
  int		inSync )`
- `EV_StartLightStrobing` (line 208) `void EV_StartLightStrobing(line_t*	line)` - *Start strobing lights (usually from a trigger)*
- `EV_TurnTagLightsOff` (line 229) `void EV_TurnTagLightsOff(line_t* line)` - *TURN LINE'S TAG LIGHTS OFF*
- `EV_LightTurnOn` (line 264) `void
EV_LightTurnOn
( line_t*	line,
  int		bright )`
- `T_Glow` (line 307) `void T_Glow(glow_t*	g)`
- `P_SpawnGlowingLight` (line 334) `void P_SpawnGlowingLight(sector_t*	sector)`

#### `p_map.c`
**Path:** `progs/doomgeneric/p_map.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard, Andrey Budko  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Movement, collision handling. Shooting and aiming.*

**Functions:**
- `PIT_StompThing` (line 97) `boolean PIT_StompThing (mobj_t* thing)` - *PIT_StompThing*
- `P_TeleportMove` (line 131) `boolean
P_TeleportMove
( mobj_t*	thing,
  fixed_t	x,
  fixed_t	y )`
- `PIT_CheckLine` (line 206) `boolean PIT_CheckLine (line_t* ld)` - *PIT_CheckLine Adjusts tmfloorz and tmceilingz as lines are contacted*
- `PIT_CheckThing` (line 275) `boolean PIT_CheckThing (mobj_t* thing)` - *PIT_CheckThing*
- `P_CheckPosition` (line 402) `boolean
P_CheckPosition
( mobj_t*	thing,
  fixed_t	x,
  fixed_t	y )`
- `P_TryMove` (line 478) `boolean
P_TryMove
( mobj_t*	thing,
  fixed_t	x,
  fixed_t	y )`
- `P_ThingHeightClip` (line 557) `boolean P_ThingHeightClip (mobj_t* thing)` - *P_ThingHeightClip Takes a valid thing and adjusts the thing->floorz, thing->ceilingz, and possibly thing->z. This is called for all nearby monsters whenever a sector changes height. If the thing doesn't fit, the z will be set to the lowest value and false will be returned.*
- `P_HitSlideLine` (line 611) `void P_HitSlideLine (line_t* ld)` - *P_HitSlideLine Adjusts the xmove / ymove so that the next move will slide along the wall.*
- `PTR_SlideTraverse` (line 663) `boolean PTR_SlideTraverse (intercept_t* in)` - *PTR_SlideTraverse*
- `P_SlideMove` (line 722) `void P_SlideMove (mobj_t* mo)` - *P_SlideMove The momx / momy move is bad, so try to slide along a wall. Find the first line hit, move flush to it, and slide along it  This is a kludgy mess.*
- `PTR_AimTraverse` (line 843) `boolean
PTR_AimTraverse (intercept_t* in)`
- `PTR_ShootTraverse` (line 928) `boolean PTR_ShootTraverse (intercept_t* in)` - *PTR_ShootTraverse*
- `P_AimLineAttack` (line 1068) `fixed_t
P_AimLineAttack
( mobj_t*	t1,
  angle_t	angle,
  fixed_t	distance )`
- `P_LineAttack` (line 1110) `void
P_LineAttack
( mobj_t*	t1,
  angle_t	angle,
  fixed_t	distance,
  fixed_t	slope,
  int		dama...`
- `PTR_UseTraverse` (line 1142) `boolean	PTR_UseTraverse (intercept_t* in)`
- `P_UseLines` (line 1177) `void P_UseLines (player_t*	player)` - *P_UseLines Looks for special lines in front of the player to activate.*
- `PIT_RadiusAttack` (line 1211) `boolean PIT_RadiusAttack (mobj_t* thing)` - *PIT_RadiusAttack "bombsource" is the creature that caused the explosion at "bombspot".*
- `P_RadiusAttack` (line 1253) `void
P_RadiusAttack
( mobj_t*	spot,
  mobj_t*	source,
  int		damage )`
- `PIT_ChangeSector` (line 1304) `boolean PIT_ChangeSector (mobj_t*	thing)` - *PIT_ChangeSector*
- `P_ChangeSector` (line 1368) `boolean
P_ChangeSector
( sector_t*	sector,
  boolean	crunch )`
- `SpechitOverrun` (line 1391) `static void SpechitOverrun(line_t *ld)`

**Macros:**
- `DEFAULT_SPECHIT_MAGIC` (line 50) `#define DEFAULT_SPECHIT_MAGIC`

**Variables:**
- `topslope` (line 834) `extern fixed_t topslope;` - *slopes to top and bottom of target*
- `bottomslope` (line 835) `extern fixed_t bottomslope;`

#### `p_maputl.c`
**Path:** `progs/doomgeneric/p_maputl.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard Copyright(C) 2005, 2006 Andrey Budko  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Movement/collision utility functions, as used by function in p_map.c. BLOCKMAP Iterator functions, and some PIT_* functions to use for iteration.*

**Functions:**
- `P_AproxDistance` (line 44) `fixed_t
P_AproxDistance
( fixed_t	dx,
  fixed_t	dy )`
- `P_PointOnLineSide` (line 61) `int
P_PointOnLineSide
( fixed_t	x,
  fixed_t	y,
  line_t*	line )`
- `P_BoxOnLineSide` (line 105) `int
P_BoxOnLineSide
( fixed_t*	tmbox,
  line_t*	ld )`
- `P_PointOnDivlineSide` (line 156) `int
P_PointOnDivlineSide
( fixed_t	x,
  fixed_t	y,
  divline_t*	line )`
- `P_MakeDivline` (line 206) `void
P_MakeDivline
( line_t*	li,
  divline_t*	dl )`
- `P_InterceptVector` (line 226) `fixed_t
P_InterceptVector
( divline_t*	v2,
  divline_t*	v1 )`
- `P_LineOpening` (line 295) `void P_LineOpening (line_t* linedef)`
- `P_UnsetThingPosition` (line 342) `void P_UnsetThingPosition (mobj_t* thing)` - *P_UnsetThingPosition Unlinks a thing from block map and sectors. On each position change, BLOCKMAP and other lookups maintaining lists ot things inside these structures need to be updated.*
- `P_SetThingPosition` (line 391) `void
P_SetThingPosition (mobj_t* thing)`
- `P_BlockLinesIterator` (line 467) `boolean
P_BlockLinesIterator
( int			x,
  int			y,
  boolean(*func)(line_t*) )`
- `P_BlockThingsIterator` (line 508) `boolean
P_BlockThingsIterator
( int			x,
  int			y,
  boolean(*func)(mobj_t*) )`
- `PIT_AddLineIntercepts` (line 559) `boolean
PIT_AddLineIntercepts (line_t* ld)`
- `PIT_AddThingIntercepts` (line 614) `boolean PIT_AddThingIntercepts (mobj_t* thing)` - *PIT_AddThingIntercepts*
- `P_TraverseIntercepts` (line 682) `boolean
P_TraverseIntercepts
( traverser_t	func,
  fixed_t	maxfrac )`
- `InterceptsMemoryOverrun` (line 782) `static void InterceptsMemoryOverrun(int location, int value)`
- `InterceptsOverrun` (line 827) `static void InterceptsOverrun(int num_intercepts, intercept_t *intercept)`
- `P_PathTraverse` (line 861) `boolean
P_PathTraverse
( fixed_t		x1,
  fixed_t		y1,
  fixed_t		x2,
  fixed_t		y2,
  int			flags,...`

**Structs:**
- `intercepts_overrun_t` (line 738)

**Variables:**
- `bulletslope` (line 731) `extern fixed_t bulletslope;`

#### `p_mobj.c`
**Path:** `progs/doomgeneric/p_mobj.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Moving object handling. Spawn functions.*

**Functions:**
- `P_SetMobjState` (line 48) `boolean
P_SetMobjState
( mobj_t*	mobj,
  statenum_t	state )`
- `P_ExplodeMissile` (line 84) `void P_ExplodeMissile (mobj_t* mo)` - *P_ExplodeMissile*
- `P_XYMovement` (line 108) `void P_XYMovement (mobj_t* mo)`
- `P_ZMovement` (line 240) `void P_ZMovement (mobj_t* mo)` - *P_ZMovement*
- `P_NightmareRespawn` (line 383) `void
P_NightmareRespawn (mobj_t* mobj)`
- `P_MobjThinker` (line 441) `void P_MobjThinker (mobj_t* mobj)` - *P_MobjThinker*
- `P_SpawnMobj` (line 506) `mobj_t*
P_SpawnMobj
( fixed_t	x,
  fixed_t	y,
  fixed_t	z,
  mobjtype_t	type )`
- `P_RemoveMobj` (line 572) `void P_RemoveMobj (mobj_t* mobj)`
- `P_RespawnSpecials` (line 604) `void P_RespawnSpecials (void)` - *P_RespawnSpecials*
- `P_SpawnPlayer` (line 668) `void P_SpawnPlayer (mapthing_t* mthing)` - *P_SpawnPlayer Called when a player is spawned on the level. Most of the player structure stays unchanged between levels.*
- `P_SpawnMapThing` (line 739) `void P_SpawnMapThing (mapthing_t* mthing)` - *P_SpawnMapThing The fields of the mapthing should already be in host byte order.*
- `P_SpawnPuff` (line 851) `void
P_SpawnPuff
( fixed_t	x,
  fixed_t	y,
  fixed_t	z )`
- `P_SpawnBlood` (line 878) `void
P_SpawnBlood
( fixed_t	x,
  fixed_t	y,
  fixed_t	z,
  int		damage )`
- `P_CheckMissileSpawn` (line 907) `void P_CheckMissileSpawn (mobj_t* th)` - *P_CheckMissileSpawn Moves the missile forward a bit and possibly explodes it right there.*
- `P_SubstNullMobj` (line 929) `mobj_t *P_SubstNullMobj(mobj_t *mobj)`
- `P_SpawnMissile` (line 950) `mobj_t*
P_SpawnMissile
( mobj_t*	source,
  mobj_t*	dest,
  mobjtype_t	type )`
- `P_SpawnPlayerMissile` (line 996) `void
P_SpawnPlayerMissile
( mobj_t*	source,
  mobjtype_t	type )`
- `G_PlayerReborn` (line 37) `void G_PlayerReborn (int player);`

**Macros:**
- `STOPSPEED` (line 105) `#define STOPSPEED`
- `FRICTION` (line 106) `#define FRICTION`

**Variables:**
- `attackrange` (line 848) `extern fixed_t attackrange;` - *P_SpawnPuff*

#### `p_plats.c`
**Path:** `progs/doomgeneric/p_plats.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Plats (i.e. elevator platforms) code, raising/lowering.       State.*

**Functions:**
- `T_PlatRaise` (line 45) `void T_PlatRaise(plat_t* plat)` - *Move a plat up and down*
- `EV_DoPlat` (line 129) `int
EV_DoPlat
( line_t*	line,
  plattype_e	type,
  int		amount )`
- `P_ActivateInStasis` (line 248) `void P_ActivateInStasis(int tag)`
- `EV_StopPlat` (line 263) `void EV_StopPlat(line_t* line)`
- `P_AddActivePlat` (line 278) `void P_AddActivePlat(plat_t* plat)`
- `P_RemoveActivePlat` (line 291) `void P_RemoveActivePlat(plat_t* plat)`

#### `p_pspr.c`
**Path:** `progs/doomgeneric/p_pspr.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Weapon sprite animation, weapon objects. Action functions for weapons.       State.*

**Functions:**
- `P_SetPsprite` (line 50) `void
P_SetPsprite
( player_t*	player,
  int		position,
  statenum_t	stnum )`
- `P_CalcSwing` (line 103) `void P_CalcSwing (player_t*	player)`
- `P_BringUpWeapon` (line 129) `void P_BringUpWeapon (player_t* player)` - *P_BringUpWeapon Starts bringing the pending weapon up from the bottom of the screen. Uses player*
- `P_CheckAmmo` (line 152) `boolean P_CheckAmmo (player_t* player)` - *P_CheckAmmo Returns true if there is enough ammo to shoot. If not, selects the next weapon to use.*
- `P_FireWeapon` (line 237) `void P_FireWeapon (player_t* player)` - *P_FireWeapon.*
- `P_DropWeapon` (line 256) `void P_DropWeapon (player_t* player)` - *P_DropWeapon Player died, so put the weapon away.*
- `A_WeaponReady` (line 273) `void
A_WeaponReady
( player_t*	player,
  pspdef_t*	psp )`
- `A_ReFire` (line 334) `void A_ReFire
( player_t*	player,
  pspdef_t*	psp )` - *A_ReFire The player can re-fire the weapon without lowering it entirely.*
- `A_CheckReload` (line 357) `void
A_CheckReload
( player_t*	player,
  pspdef_t*	psp )`
- `A_Lower` (line 376) `void
A_Lower
( player_t*	player,
  pspdef_t*	psp )`
- `A_Raise` (line 414) `void
A_Raise
( player_t*	player,
  pspdef_t*	psp )`
- `A_GunFlash` (line 440) `void
A_GunFlash
( player_t*	player,
  pspdef_t*	psp )`
- `A_Punch` (line 459) `void
A_Punch
( player_t*	player,
  pspdef_t*	psp )`
- `A_Saw` (line 493) `void
A_Saw
( player_t*	player,
  pspdef_t*	psp )`
- `DecreaseAmmo` (line 542) `static void DecreaseAmmo(player_t *player, int ammonum, int amount)`
- `A_FireMissile` (line 559) `void
A_FireMissile
( player_t*	player,
  pspdef_t*	psp )`
- `A_FireBFG` (line 572) `void
A_FireBFG
( player_t*	player,
  pspdef_t*	psp )`
- `A_FirePlasma` (line 587) `void
A_FirePlasma
( player_t*	player,
  pspdef_t*	psp )`
- `P_BulletSlope` (line 610) `void P_BulletSlope (mobj_t*	mo)`
- `P_GunShot` (line 635) `void
P_GunShot
( mobj_t*	mo,
  boolean	accurate )`
- `A_FirePistol` (line 656) `void
A_FirePistol
( player_t*	player,
  pspdef_t*	psp )`
- `A_FireShotgun` (line 678) `void
A_FireShotgun
( player_t*	player,
  pspdef_t*	psp )`
- `A_FireShotgun2` (line 705) `void
A_FireShotgun2
( player_t*	player,
  pspdef_t*	psp )`
- `A_FireCGun` (line 742) `void
A_FireCGun
( player_t*	player,
  pspdef_t*	psp )`
- `A_Light0` (line 770) `void A_Light0 (player_t *player, pspdef_t *psp)` - *?*
- `A_Light1` (line 775) `void A_Light1 (player_t *player, pspdef_t *psp)`
- `A_Light2` (line 780) `void A_Light2 (player_t *player, pspdef_t *psp)`
- `A_BFGSpray` (line 790) `void A_BFGSpray (mobj_t* mo)` - *A_BFGSpray Spawn a BFG explosion on every monster in view*
- `A_BFGsound` (line 827) `void
A_BFGsound
( player_t*	player,
  pspdef_t*	psp )`
- `P_SetupPsprites` (line 840) `void P_SetupPsprites (player_t* player)` - *P_SetupPsprites Called at start of level for each player.*
- `P_MovePsprites` (line 860) `void P_MovePsprites (player_t* player)` - *P_MovePsprites Called every tic by player thinking routine.*

**Macros:**
- `LOWERSPEED` (line 38) `#define LOWERSPEED`
- `RAISESPEED` (line 39) `#define RAISESPEED`
- `WEAPONBOTTOM` (line 41) `#define WEAPONBOTTOM`
- `WEAPONTOP` (line 42) `#define WEAPONTOP`

#### `p_saveg.c`
**Path:** `progs/doomgeneric/p_saveg.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Archiving: SaveGame I/O.      State.*

**Functions:**
- `P_TempSaveGameFile` (line 47) `char *P_TempSaveGameFile(void)`
- `P_SaveGameFile` (line 61) `char *P_SaveGameFile(int slot)`
- `saveg_read8` (line 81) `static byte saveg_read8(void)`
- `saveg_write8` (line 99) `static void saveg_write8(byte value)`
- `saveg_read16` (line 112) `static short saveg_read16(void)`
- `saveg_write16` (line 122) `static void saveg_write16(short value)`
- `saveg_read32` (line 128) `static int saveg_read32(void)`
- `saveg_write32` (line 140) `static void saveg_write32(int value)`
- `saveg_read_pad` (line 150) `static void saveg_read_pad(void)`
- `saveg_write_pad` (line 166) `static void saveg_write_pad(void)`
- `saveg_readp` (line 185) `static void *saveg_readp(void)`
- `saveg_writep` (line 190) `static void saveg_writep(void *p)`
- `saveg_read_mapthing_t` (line 208) `static void saveg_read_mapthing_t(mapthing_t *str)`
- `saveg_write_mapthing_t` (line 226) `static void saveg_write_mapthing_t(mapthing_t *str)`
- `saveg_read_actionf_t` (line 248) `static void saveg_read_actionf_t(actionf_t *str)`
- `saveg_write_actionf_t` (line 254) `static void saveg_write_actionf_t(actionf_t *str)`
- `saveg_read_thinker_t` (line 273) `static void saveg_read_thinker_t(thinker_t *str)`
- `saveg_write_thinker_t` (line 285) `static void saveg_write_thinker_t(thinker_t *str)`
- `saveg_read_mobj_t` (line 301) `static void saveg_read_mobj_t(mobj_t *str)`
- `saveg_write_mobj_t` (line 421) `static void saveg_write_mobj_t(mobj_t *str)`
- `saveg_read_ticcmd_t` (line 541) `static void saveg_read_ticcmd_t(ticcmd_t *str)`
- `saveg_write_ticcmd_t` (line 563) `static void saveg_write_ticcmd_t(ticcmd_t *str)`
- `saveg_read_pspdef_t` (line 589) `static void saveg_read_pspdef_t(pspdef_t *str)`
- `saveg_write_pspdef_t` (line 615) `static void saveg_write_pspdef_t(pspdef_t *str)`
- `saveg_read_player_t` (line 641) `static void saveg_read_player_t(player_t *str)`
- `saveg_write_player_t` (line 772) `static void saveg_write_player_t(player_t *str)`
- `saveg_read_ceiling_t` (line 908) `static void saveg_read_ceiling_t(ceiling_t *str)`
- `saveg_write_ceiling_t` (line 944) `static void saveg_write_ceiling_t(ceiling_t *str)`
- `saveg_read_vldoor_t` (line 981) `static void saveg_read_vldoor_t(vldoor_t *str)`
- `saveg_write_vldoor_t` (line 1011) `static void saveg_write_vldoor_t(vldoor_t *str)`
- `saveg_read_floormove_t` (line 1042) `static void saveg_read_floormove_t(floormove_t *str)`
- `saveg_write_floormove_t` (line 1075) `static void saveg_write_floormove_t(floormove_t *str)`
- `saveg_read_plat_t` (line 1109) `static void saveg_read_plat_t(plat_t *str)`
- `saveg_write_plat_t` (line 1151) `static void saveg_write_plat_t(plat_t *str)`
- `saveg_read_lightflash_t` (line 1194) `static void saveg_read_lightflash_t(lightflash_t *str)`
- `saveg_write_lightflash_t` (line 1221) `static void saveg_write_lightflash_t(lightflash_t *str)`
- `saveg_read_strobe_t` (line 1249) `static void saveg_read_strobe_t(strobe_t *str)`
- `saveg_write_strobe_t` (line 1276) `static void saveg_write_strobe_t(strobe_t *str)`
- `saveg_read_glow_t` (line 1304) `static void saveg_read_glow_t(glow_t *str)`
- `saveg_write_glow_t` (line 1325) `static void saveg_write_glow_t(glow_t *str)`
- `P_WriteSaveGameHeader` (line 1347) `void P_WriteSaveGameHeader(char *description)`
- `P_ReadSaveGameHeader` (line 1379) `boolean P_ReadSaveGameHeader(void)`
- `P_ReadSaveGameEOF` (line 1419) `boolean P_ReadSaveGameEOF(void)`
- `P_WriteSaveGameEOF` (line 1432) `void P_WriteSaveGameEOF(void)`
- `P_ArchivePlayers` (line 1440) `void P_ArchivePlayers (void)` - *P_ArchivePlayers*
- `P_UnArchivePlayers` (line 1460) `void P_UnArchivePlayers (void)` - *P_UnArchivePlayers*
- `P_ArchiveWorld` (line 1484) `void P_ArchiveWorld (void)` - *P_ArchiveWorld*
- `P_UnArchiveWorld` (line 1532) `void P_UnArchiveWorld (void)` - *P_UnArchiveWorld*
- `P_ArchiveThinkers` (line 1592) `void P_ArchiveThinkers (void)` - *P_ArchiveThinkers*
- `P_UnArchiveThinkers` (line 1620) `void P_UnArchiveThinkers (void)` - *P_UnArchiveThinkers*
- `P_ArchiveSpecials` (line 1704) `void P_ArchiveSpecials (void)` - *Things to handle:  T_MoveCeiling, (ceiling_t: sector_t * swizzle), - active list T_VerticalDoor, (vldoor_t: sector_t * swizzle), T_MoveFloor, (floormove_t: sector_t * swizzle), T_LightFlash, (lightflash_t: sector_t * swizzle), T_StrobeFlash, (strobe_t: sector_t *), T_Glow, (glow_t: sector_t *), T_PlatRaise, (plat_t: sector_t *), - active list*
- `P_UnArchiveSpecials` (line 1793) `void P_UnArchiveSpecials (void)` - *P_UnArchiveSpecials*

**Macros:**
- `SAVEGAME_EOF` (line 36) `#define SAVEGAME_EOF`
- `VERSIONSIZE` (line 37) `#define VERSIONSIZE`
- `saveg_read_enum` (line 197) `#define saveg_read_enum`
- `saveg_write_enum` (line 198) `#define saveg_write_enum`
- `saveg_read_think_t` (line 266) `#define saveg_read_think_t`
- `saveg_write_think_t` (line 267) `#define saveg_write_think_t`

#### `p_setup.c`
**Path:** `progs/doomgeneric/p_setup.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Do all the WAD I/O, get map description, set up initial state and misc. LUTs.*

**Functions:**
- `P_LoadVertexes` (line 118) `void P_LoadVertexes (int lump)` - *P_LoadVertexes*
- `GetSectorAtNullAddress` (line 153) `sector_t* GetSectorAtNullAddress(void)` - *GetSectorAtNullAddress*
- `P_LoadSegs` (line 172) `void P_LoadSegs (int lump)` - *P_LoadSegs*
- `P_LoadSubsectors` (line 236) `void P_LoadSubsectors (int lump)` - *P_LoadSubsectors*
- `P_LoadSectors` (line 265) `void P_LoadSectors (int lump)` - *P_LoadSectors*
- `P_LoadNodes` (line 298) `void P_LoadNodes (int lump)` - *P_LoadNodes*
- `P_LoadThings` (line 335) `void P_LoadThings (int lump)` - *P_LoadThings*
- `P_LoadLineDefs` (line 392) `void P_LoadLineDefs (int lump)` - *P_LoadLineDefs Also counts secret lines for intermissions.*
- `P_LoadSideDefs` (line 473) `void P_LoadSideDefs (int lump)` - *P_LoadSideDefs*
- `P_LoadBlockMap` (line 504) `void P_LoadBlockMap (int lump)` - *P_LoadBlockMap*
- `P_GroupLines` (line 545) `void P_GroupLines (void)` - *P_GroupLines Builds sector line lists and subsector sector numbers. Finds block bounding boxes for sectors.*
- `PadRejectArray` (line 661) `static void PadRejectArray(byte *array, unsigned int len)`
- `P_LoadReject` (line 712) `static void P_LoadReject(int lumpnum)`
- `P_SetupLevel` (line 744) `void
P_SetupLevel
( int		episode,
  int		map,
  int		playermask,
  skill_t	skill)`
- `P_Init` (line 847) `void P_Init (void)` - *P_Init*
- `P_SpawnMapThing` (line 44) `void P_SpawnMapThing (mapthing_t* mthing);`

**Macros:**
- `MAX_DEATHMATCH_STARTS` (line 105) `#define MAX_DEATHMATCH_STARTS`

#### `p_sight.c`
**Path:** `progs/doomgeneric/p_sight.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: LineOfSight/Visibility checks, uses REJECT Lookup Table.       State.   P_CheckSight*

**Functions:**
- `P_DivlineSide` (line 48) `int
P_DivlineSide
( fixed_t	x,
  fixed_t	y,
  divline_t*	node )`
- `P_InterceptVector2` (line 102) `fixed_t
P_InterceptVector2
( divline_t*	v2,
  divline_t*	v1 )`
- `P_CrossSubsector` (line 128) `boolean P_CrossSubsector (int num)` - *P_CrossSubsector Returns true if strace crosses the given subsector successfully.*
- `P_CrossBSPNode` (line 258) `boolean P_CrossBSPNode (int bspnum)` - *P_CrossBSPNode Returns true if strace crosses the given node successfully.*
- `P_CheckSight` (line 301) `boolean
P_CheckSight
( mobj_t*	t1,
  mobj_t*	t2 )`

#### `p_spec.c`
**Path:** `progs/doomgeneric/p_spec.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Implements special effects: Texture animation, height or lighting changes according to adjacent sectors, respective utility functions, etc. Line Tag handling. Line and Sector triggers.*

**Functions:**
- `P_InitPicAnims` (line 143) `void P_InitPicAnims (void)`
- `getSide` (line 203) `side_t*
getSide
( int		currentSector,
  int		line,
  int		side )`
- `getSector` (line 219) `sector_t*
getSector
( int		currentSector,
  int		line,
  int		side )`
- `twoSided` (line 234) `int
twoSided
( int	sector,
  int	line )`
- `getNextSector` (line 250) `sector_t*
getNextSector
( line_t*	line,
  sector_t*	sec )`
- `P_FindLowestFloorSurrounding` (line 269) `fixed_t	P_FindLowestFloorSurrounding(sector_t* sec)` - *P_FindLowestFloorSurrounding() FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS*
- `P_FindHighestFloorSurrounding` (line 296) `fixed_t	P_FindHighestFloorSurrounding(sector_t *sec)` - *P_FindHighestFloorSurrounding() FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS*
- `P_FindNextHighestFloor` (line 330) `fixed_t
P_FindNextHighestFloor
( sector_t* sec,
  int       currentheight )`
- `P_FindLowestCeilingSurrounding` (line 392) `fixed_t
P_FindLowestCeilingSurrounding(sector_t* sec)`
- `P_FindHighestCeilingSurrounding` (line 417) `fixed_t	P_FindHighestCeilingSurrounding(sector_t* sec)` - *FIND HIGHEST CEILING IN THE SURROUNDING SECTORS*
- `P_FindSectorFromLineTag` (line 444) `int
P_FindSectorFromLineTag
( line_t*	line,
  int		start )`
- `P_FindMinSurroundingLight` (line 464) `int
P_FindMinSurroundingLight
( sector_t*	sector,
  int		max )`
- `P_CrossSpecialLine` (line 502) `void
P_CrossSpecialLine
( int		linenum,
  int		side,
  mobj_t*	thing )`
- `P_ShootSpecialLine` (line 969) `void
P_ShootSpecialLine
( mobj_t*	thing,
  line_t*	line )`
- `P_PlayerInSpecialSector` (line 1019) `void P_PlayerInSpecialSector (player_t* player)` - *P_PlayerInSpecialSector Called every tic frame that the player origin is in a special sector*
- `P_UpdateSpecials` (line 1093) `void P_UpdateSpecials (void)`
- `DonutOverrun` (line 1178) `static void DonutOverrun(fixed_t *s3_floorheight, short *s3_floorpic,
                         li...`
- `EV_DoDonut` (line 1257) `int EV_DoDonut(line_t*	line)` - *Special Stuff that can not be categorized*
- `P_SpawnSpecials` (line 1374) `void P_SpawnSpecials (void)` - *Parses command line parameters.*

**Macros:**
- `MAXANIMS` (line 78) `#define MAXANIMS`
- `MAXLINEANIMS` (line 136) `#define MAXLINEANIMS`
- `MAX_ADJOINING_SECTORS` (line 327) `#define MAX_ADJOINING_SECTORS`
- `DONUT_FLOORHEIGHT_DEFAULT` (line 1175) `#define DONUT_FLOORHEIGHT_DEFAULT`
- `DONUT_FLOORPIC_DEFAULT` (line 1176) `#define DONUT_FLOORPIC_DEFAULT`

**Structs:**
- `anim_t` (line 55) - *Animating textures and planes There is another anim_t used in wi_stuff, unrelated.*
- `animdef_t` (line 68) - *source animation definition*

**Variables:**
- `anims` (line 80) `extern anim_t anims[MAXANIMS];`
- `lastanim` (line 81) `extern anim_t* lastanim;`
- `numlinespecials` (line 138) `extern short numlinespecials;`
- `linespeciallist` (line 139) `extern line_t* linespeciallist[MAXLINEANIMS];`
- `numflats` (line 1185) `extern int numflats;`

#### `p_switch.c`
**Path:** `progs/doomgeneric/p_switch.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: Switches, buttons. Two-state animation. Exits.*

**Functions:**
- `P_InitSwitchList` (line 101) `void P_InitSwitchList(void)` - *P_InitSwitchList Only called at game initialization.*
- `P_StartButton` (line 149) `void
P_StartButton
( line_t*	line,
  bwhere_e	w,
  int		texture,
  int		time )`
- `P_ChangeSwitchTexture` (line 195) `void
P_ChangeSwitchTexture
( line_t*	line,
  int 		useAgain )`
- `P_UseSpecialLine` (line 270) `boolean
P_UseSpecialLine
( mobj_t*	thing,
  line_t*	line,
  int		side )`

#### `p_telept.c`
**Path:** `progs/doomgeneric/p_telept.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Teleportation.          Data.*

**Functions:**
- `EV_Teleport` (line 42) `int
EV_Teleport
( line_t*	line,
  int		side,
  mobj_t*	thing )`

#### `p_tick.c`
**Path:** `progs/doomgeneric/p_tick.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Archiving: SaveGame I/O. Thinker, Ticker.*

**Functions:**
- `P_InitThinkers` (line 46) `void P_InitThinkers (void)` - *P_InitThinkers*
- `P_AddThinker` (line 58) `void P_AddThinker (thinker_t* thinker)` - *P_AddThinker Adds a new thinker at the end of the list.*
- `P_RemoveThinker` (line 73) `void P_RemoveThinker (thinker_t* thinker)` - *P_RemoveThinker Deallocation is lazy -- it will not actually be freed until its thinking turn comes up.*
- `P_AllocateThinker` (line 85) `void P_AllocateThinker (thinker_t*	thinker)` - *P_AllocateThinker Allocates memory and adds a new thinker at the end of the list.*
- `P_RunThinkers` (line 94) `void P_RunThinkers (void)` - *P_RunThinkers*
- `P_Ticker` (line 123) `void P_Ticker (void)`

#### `p_user.c`
**Path:** `progs/doomgeneric/p_user.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Player related stuff. Bobbing POV/weapon, movement. Pending weapon.*

**Functions:**
- `P_Thrust` (line 52) `void
P_Thrust
( player_t*	player,
  angle_t	angle,
  fixed_t	move )`
- `P_CalcHeight` (line 70) `void P_CalcHeight (player_t* player)` - *P_CalcHeight Calculate the walking / running height adjustment*
- `P_MovePlayer` (line 141) `void P_MovePlayer (player_t* player)` - *P_MovePlayer*
- `P_DeathThink` (line 175) `void P_DeathThink (player_t* player)`
- `P_PlayerThink` (line 229) `void P_PlayerThink (player_t* player)` - *P_PlayerThink*

**Macros:**
- `INVERSECOLORMAP` (line 34) `#define INVERSECOLORMAP`
- `MAXBOB` (line 42) `#define MAXBOB`
- `ANG5` (line 173) `#define ANG5`

#### `r_bsp.c`
**Path:** `progs/doomgeneric/r_bsp.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: BSP traversal, handling of LineSegs for rendering.*

**Functions:**
- `R_ClearDrawSegs` (line 61) `void R_ClearDrawSegs (void)` - *R_ClearDrawSegs*
- `R_ClipSolidWallSegment` (line 97) `void
R_ClipSolidWallSegment
( int			first,
  int			last )`
- `R_ClipPassWallSegment` (line 190) `void
R_ClipPassWallSegment
( int	first,
  int	last )`
- `R_ClearClipSegs` (line 238) `void R_ClearClipSegs (void)` - *R_ClearClipSegs*
- `R_AddLine` (line 252) `void R_AddLine (seg_t*	line)` - *R_AddLine Clips the given segment and adds any visible pieces to the line list.*
- `R_CheckBBox` (line 374) `boolean R_CheckBBox (fixed_t*	bspcoord)`
- `R_Subsector` (line 490) `void R_Subsector (int num)` - *R_Subsector Determine floor/ceiling planes. Add sprites of things in sector. Draw one or more line segments.*
- `R_RenderBSPNode` (line 545) `void R_RenderBSPNode (int bspnum)` - *RenderBSPNode Renders all subsectors below a given node, traversing subtree recursively. Just call with BSP root.*
- `R_StoreWallRange` (line 51) `void R_StoreWallRange ( int start, int stop );`

**Macros:**
- `MAXSEGS` (line 81) `#define MAXSEGS`

**Structs:**
- `cliprange_t` (line 73) - *ClipWallSegment Clips the given range of columns and includes it in the new clip list.*

#### `r_data.c`
**Path:** `progs/doomgeneric/r_data.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Preparation of data for rendering, generation of lookups, caching, retrieval by name.*

**Functions:**
- `R_DrawColumnInCache` (line 186) `void
R_DrawColumnInCache
( column_t*	patch,
  byte*		cache,
  int		originy,
  int		cacheheight )`
- `R_GenerateComposite` (line 226) `void R_GenerateComposite (int texnum)` - *R_GenerateComposite Using the texture definition, the composite texture is created from the patches, and each column is cached.*
- `R_GenerateLookup` (line 294) `void R_GenerateLookup (int texnum)` - *R_GenerateLookup*
- `R_GetColumn` (line 383) `byte*
R_GetColumn
( int		tex,
  int		col )`
- `GenerateTextureHashTable` (line 404) `static void GenerateTextureHashTable(void)`
- `R_InitTextures` (line 451) `void R_InitTextures (void)` - *R_InitTextures Initializes the texture list with the textures from the world map.*
- `R_InitFlats` (line 633) `void R_InitFlats (void)` - *R_InitFlats*
- `R_InitSpriteLumps` (line 655) `void R_InitSpriteLumps (void)` - *R_InitSpriteLumps Finds the width and hoffset of all sprites in the wad, so the sprite does not need to be cached completely just for having the header info ready during rendering.*
- `R_InitColormaps` (line 685) `void R_InitColormaps (void)` - *R_InitColormaps*
- `R_InitData` (line 703) `void R_InitData (void)` - *R_InitData Locates all the lumps that will be used by all views Must be called after W_Init.*
- `R_FlatNumForName` (line 720) `int R_FlatNumForName (char* name)` - *R_FlatNumForName Retrieval, get a flat number for a flat name.*
- `R_CheckTextureNumForName` (line 744) `int	R_CheckTextureNumForName (char *name)` - *R_CheckTextureNumForName Check whether texture is available. Filter out NoTexture indicator.*
- `R_TextureNumForName` (line 775) `int	R_TextureNumForName (char* name)` - *R_TextureNumForName Calls R_CheckTextureNumForName, aborts with error message.*
- `R_PrecacheLevel` (line 800) `void R_PrecacheLevel (void)`

**Structs:**
- `texture_s` (line 106)
- `texpatch_t` (line 89) - *A single patch from a texture definition, basically a rectangular area within the texture rectangle.*

**Type_Aliases:**
- `texture_t` (line 103) `typedef struct texture_s texture_t;` - *A maptexturedef_t describes a rectangular texture, which is composed of one or more mappatch_t structures that arrange graphic patches.*

#### `r_draw.c`
**Path:** `progs/doomgeneric/r_draw.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The actual span/column drawing functions. Here find the main potential for optimization, e.g. inline assembly, different algorithms.*

**Functions:**
- `R_DrawColumn` (line 102) `void R_DrawColumn (void)` - *A column is a vertical slice/span from a wall texture that, given the DOOM style restrictions on the view orientation, will always have constant z depth. Thus a special case loop for very fast rendering can be used. It has also been used with Wolfenstein 3D.*
- `R_DrawColumn` (line 152) `void R_DrawColumn (void)` - *UNUSED. Loop unrolled. if 0*
- `R_DrawColumnLow` (line 208) `void R_DrawColumnLow (void)`
- `R_DrawFuzzColumn` (line 283) `void R_DrawFuzzColumn (void)` - *Framebuffer postprocessing. Creates a fuzzy image by copying pixels from adjacent ones to left and right. Used with an all black colormap, this could create the SHADOW effect, i.e. spectres and invisible players.*
- `R_DrawFuzzColumnLow` (line 342) `void R_DrawFuzzColumnLow (void)`
- `R_DrawTranslatedColumn` (line 424) `void R_DrawTranslatedColumn (void)`
- `R_DrawTranslatedColumnLow` (line 468) `void R_DrawTranslatedColumnLow (void)`
- `R_InitTranslationTables` (line 530) `void R_InitTranslationTables (void)` - *R_InitTranslationTables Creates the translation tables to map the green color ramp to gray, brown, red. Assumes a given structure of the PLAYPAL. Could be read from a lump instead.*
- `R_DrawSpan` (line 590) `void R_DrawSpan (void)` - *Draws the actual span.*
- `R_DrawSpan` (line 646) `void R_DrawSpan (void)` - *UNUSED. Loop unrolled by 4. if 0*
- `R_DrawSpanLow` (line 719) `void R_DrawSpanLow (void)` - *Again..*
- `R_InitBuffer` (line 777) `void
R_InitBuffer
( int		width,
  int		height )`
- `R_FillBackScreen` (line 812) `void R_FillBackScreen (void)` - *R_FillBackScreen Fills the back screen with a pattern for variable screen sizes Also draws a beveled edge.*
- `R_VideoErase` (line 919) `void
R_VideoErase
( unsigned	ofs,
  int		count )`
- `R_DrawViewBorder` (line 941) `void R_DrawViewBorder (void)` - *R_DrawViewBorder Draws the border around the view for different size windows?*

**Macros:**
- `MAXWIDTH` (line 41) `#define MAXWIDTH`
- `MAXHEIGHT` (line 42) `#define MAXHEIGHT`
- `SBARHEIGHT` (line 45) `#define SBARHEIGHT`
- `FUZZTABLE` (line 257) `#define FUZZTABLE`
- `FUZZOFF` (line 258) `#define FUZZOFF`

#### `r_main.c`
**Path:** `progs/doomgeneric/r_main.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Rendering main loop and setup functions, utility functions (BSP, geometry, trigonometry). See tables.c, too.*

**Functions:**
- `R_AddPointToBox` (line 123) `void
R_AddPointToBox
( int		x,
  int		y,
  fixed_t*	box )`
- `R_PointOnSide` (line 146) `int
R_PointOnSide
( fixed_t	x,
  fixed_t	y,
  node_t*	node )`
- `R_PointOnSegSide` (line 199) `int
R_PointOnSegSide
( fixed_t	x,
  fixed_t	y,
  seg_t*	line )`
- `R_PointToAngle` (line 276) `angle_t
R_PointToAngle
( fixed_t	x,
  fixed_t	y )`
- `R_PointToAngle2` (line 362) `angle_t
R_PointToAngle2
( fixed_t	x1,
  fixed_t	y1,
  fixed_t	x2,
  fixed_t	y2 )`
- `R_PointToDist` (line 376) `fixed_t
R_PointToDist
( fixed_t	x,
  fixed_t	y )`
- `R_InitPointToAngle` (line 422) `void R_InitPointToAngle (void)` - *R_InitPointToAngle*
- `R_ScaleFromGlobalAngle` (line 449) `fixed_t R_ScaleFromGlobalAngle (angle_t visangle)` - *R_ScaleFromGlobalAngle Returns the texture mapping scale for the current line (horizontal span) at the given angle. rw_distance must be calculated first.*
- `R_InitTables` (line 505) `void R_InitTables (void)` - *R_InitTables*
- `R_InitTextureMapping` (line 540) `void R_InitTextureMapping (void)` - *R_InitTextureMapping*
- `R_InitLightTables` (line 610) `void R_InitLightTables (void)`
- `R_SetViewSize` (line 654) `void
R_SetViewSize
( int		blocks,
  int		detail )`
- `R_ExecuteSetViewSize` (line 667) `void R_ExecuteSetViewSize (void)` - *R_ExecuteSetViewSize*
- `R_Init` (line 767) `void R_Init (void)`
- `R_PointInSubsector` (line 794) `subsector_t*
R_PointInSubsector
( fixed_t	x,
  fixed_t	y )`
- `R_SetupFrame` (line 823) `void R_SetupFrame (player_t* player)` - *R_SetupFrame*
- `R_RenderPlayerView` (line 863) `void R_RenderPlayerView (player_t* player)` - *R_RenderView*

**Macros:**
- `FIELDOFVIEW` (line 43) `#define FIELDOFVIEW`
- `DISTMAP` (line 608) `#define DISTMAP`

**Variables:**
- `walllights` (line 54) `extern lighttable_t** walllights;`

#### `r_plane.c`
**Path:** `progs/doomgeneric/r_plane.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Here is a core component: drawing the floors and ceilings, while maintaining a per column clipping list only. Moreover, the sky areas have to be determined.*

**Functions:**
- `R_InitPlanes` (line 94) `void R_InitPlanes (void)` - *R_InitPlanes Only at game startup.*
- `R_MapPlane` (line 114) `void
R_MapPlane
( int		y,
  int		x1,
  int		x2 )`
- `R_ClearPlanes` (line 178) `void R_ClearPlanes (void)` - *R_ClearPlanes At begining of frame.*
- `R_FindPlane` (line 211) `visplane_t*
R_FindPlane
( fixed_t	height,
  int		picnum,
  int		lightlevel )`
- `R_CheckPlane` (line 259) `visplane_t*
R_CheckPlane
( visplane_t*	pl,
  int		start,
  int		stop )`
- `R_MakeSpans` (line 324) `void
R_MakeSpans
( int		x,
  int		t1,
  int		b1,
  int		t2,
  int		b2 )`
- `R_DrawPlanes` (line 360) `void R_DrawPlanes (void)` - *R_DrawPlanes At the end of each frame.*

**Macros:**
- `MAXVISPLANES` (line 45) `#define MAXVISPLANES`
- `MAXOPENINGS` (line 52) `#define MAXOPENINGS`

#### `r_segs.c`
**Path:** `progs/doomgeneric/r_segs.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: All the clipping: columns, horizontal spans, sky columns.*

**Functions:**
- `R_RenderMaskedSegRange` (line 96) `void
R_RenderMaskedSegRange
( drawseg_t*	ds,
  int		x1,
  int		x2 )`
- `R_RenderSegLoop` (line 199) `void R_RenderSegLoop (void)`
- `R_StoreWallRange` (line 372) `void
R_StoreWallRange
( int	start,
  int	stop )`

**Macros:**
- `HEIGHTBITS` (line 196) `#define HEIGHTBITS`
- `HEIGHTUNIT` (line 197) `#define HEIGHTUNIT`

#### `r_sky.c`
**Path:** `progs/doomgeneric/r_sky.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Sky rendering. The DOOM sky is a texture map like any wall, wrapping around. A 1024 columns equal 360 degrees. The default sky map is 256 columns and repeats 4 times on a 320 screen?      Needed for FRACUNIT.  Needed for Flat retrieval.*

**Functions:**
- `R_InitSkyMap` (line 47) `void R_InitSkyMap (void)` - *R_InitSkyMap Called whenever the view size changes.*

#### `r_things.c`
**Path:** `progs/doomgeneric/r_things.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh of things, i.e. objects represented by sprites.*

**Functions:**
- `R_InstallSpriteLump` (line 100) `void
R_InstallSpriteLump
( int		lump,
  unsigned	frame,
  unsigned	rotation,
  boolean	flipped )`
- `R_InitSpriteDefs` (line 171) `void R_InitSpriteDefs (char** namelist)` - *R_InitSpriteDefs Pass a null terminated list of sprite names (4 chars exactly) to be used. Builds the sprite rotation matrixes to account for horizontally flipped sprites. Will report an error if the lumps are inconsistant. Only called at startup.  Sprite lump names are 4 characters for the actor, a letter for the frame, and a number for the rotation. A sprite that is flippable will have an additional letter/number appended. The rotation character can be 0 to signify no rotations.*
- `R_InitSprites` (line 291) `void R_InitSprites (char** namelist)` - *R_InitSprites Called at program start.*
- `R_ClearSprites` (line 309) `void R_ClearSprites (void)` - *R_ClearSprites Called at frame start.*
- `R_NewVisSprite` (line 320) `vissprite_t* R_NewVisSprite (void)`
- `R_DrawMaskedColumn` (line 343) `void R_DrawMaskedColumn (column_t* column)`
- `R_DrawVisSprite` (line 389) `void
R_DrawVisSprite
( vissprite_t*		vis,
  int			x1,
  int			x2 )`
- `R_ProjectSprite` (line 444) `void R_ProjectSprite (mobj_t* thing)` - *R_ProjectSprite Generates a vissprite for a thing if it might be visible.*
- `R_AddSprites` (line 605) `void R_AddSprites (sector_t* sec)` - *R_AddSprites During BSP traversal, this adds sprites by sector.*
- `R_DrawPSprite` (line 638) `void R_DrawPSprite (pspdef_t* psp)` - *R_DrawPSprite*
- `R_DrawPlayerSprites` (line 738) `void R_DrawPlayerSprites (void)` - *R_DrawPlayerSprites*
- `R_SortVisSprites` (line 779) `void R_SortVisSprites (void)`
- `R_DrawSprite` (line 837) `void R_DrawSprite (vissprite_t* spr)`
- `R_DrawMasked` (line 951) `void R_DrawMasked (void)` - *R_DrawMasked*

**Macros:**
- `MINZ` (line 40) `#define MINZ`
- `BASEYCENTER` (line 41) `#define BASEYCENTER`

**Structs:**
- `maskdraw_t` (line 48)

#### `s_sound.c`
**Path:** `progs/doomgeneric/s_sound.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none*

**Functions:**
- `S_Init` (line 114) `void S_Init(int sfxVolume, int musicVolume)`
- `S_Shutdown` (line 146) `void S_Shutdown(void)`
- `S_StopChannel` (line 152) `static void S_StopChannel(int cnum)`
- `S_Start` (line 191) `void S_Start(void)`
- `S_StopSound` (line 243) `void S_StopSound(mobj_t *origin)`
- `S_GetChannel` (line 262) `static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo)`
- `S_AdjustSoundParams` (line 323) `static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,
                               i...`
- `S_StartSound` (line 391) `void S_StartSound(void *origin_p, int sfx_id)`
- `S_PauseSound` (line 482) `void S_PauseSound(void)`
- `S_ResumeSound` (line 491) `void S_ResumeSound(void)`
- `S_UpdateSounds` (line 504) `void S_UpdateSounds(mobj_t *listener)`
- `S_SetMusicVolume` (line 571) `void S_SetMusicVolume(int volume)`
- `S_SetSfxVolume` (line 582) `void S_SetSfxVolume(int volume)`
- `S_StartMusic` (line 596) `void S_StartMusic(int m_id)`
- `S_ChangeMusic` (line 601) `void S_ChangeMusic(int musicnum, int looping)`
- `S_MusicPlaying` (line 649) `boolean S_MusicPlaying(void)`
- `S_StopMusic` (line 654) `void S_StopMusic(void)`

**Macros:**
- `S_CLIPPING_DIST` (line 44) `#define S_CLIPPING_DIST`
- `S_CLOSE_DIST` (line 52) `#define S_CLOSE_DIST`
- `S_ATTENUATOR` (line 56) `#define S_ATTENUATOR`
- `S_STEREO_SWING` (line 60) `#define S_STEREO_SWING`
- `NORM_PITCH` (line 62) `#define NORM_PITCH`
- `NORM_PRIORITY` (line 63) `#define NORM_PRIORITY`
- `NORM_SEP` (line 64) `#define NORM_SEP`

**Structs:**
- `channel_t` (line 66)

#### `sha1.c`
**Path:** `progs/doomgeneric/sha1.c`
**File Doc:** *sha1.c - SHA1 hash function*

**Functions:**
- `SHA1_Init` (line 40) `void SHA1_Init(sha1_context_t *hd)`
- `Transform` (line 55) `static void Transform(sha1_context_t *hd, byte *data)` - *Transform the message X which consists of 16 32-bit-words*
- `SHA1_Update` (line 198) `void SHA1_Update(sha1_context_t *hd, byte *inbuf, size_t inlen)` - *Update the message digest with the contents of INBUF with length INLEN.*
- `SHA1_Final` (line 238) `void SHA1_Final(sha1_digest_t digest, sha1_context_t *hd)`
- `SHA1_UpdateInt32` (line 303) `void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val)`
- `SHA1_UpdateString` (line 315) `void SHA1_UpdateString(sha1_context_t *context, char *str)`

**Macros:**
- `K1` (line 84) `#define K1`
- `K2` (line 85) `#define K2`
- `K3` (line 86) `#define K3`
- `K4` (line 87) `#define K4`
- `F1` (line 88) `#define F1(x,y,z)`
- `F2` (line 89) `#define F2(x,y,z)`
- `F3` (line 90) `#define F3(x,y,z)`
- `F4` (line 91) `#define F4(x,y,z)`
- `rol` (line 93) `#define rol(x,n)`
- `M` (line 95) `#define M(i)`
- `R` (line 99) `#define R(a,b,c,d,e,f,k,m)`
- `X` (line 288) `#define X(a)`
- `X` (line 290) `#define X(a)`

#### `sounds.c`
**Path:** `progs/doomgeneric/sounds.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Created by a sound utility. Kept as a sample, DOOM2 sounds.        Information about all the music*

**Macros:**
- `MUSIC` (line 31) `#define MUSIC(name)`
- `SOUND` (line 111) `#define SOUND(name, priority)`
- `SOUND_LINK` (line 113) `#define SOUND_LINK(name, priority, link_id, pitch, volume)`

#### `st_lib.c`
**Path:** `progs/doomgeneric/st_lib.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The status bar widget code.*

**Functions:**
- `STlib_init` (line 51) `void STlib_init(void)`
- `STlib_initNum` (line 59) `void
STlib_initNum
( st_number_t*		n,
  int			x,
  int			y,
  patch_t**		pl,
  int*			num,
  bool...`
- `STlib_drawNum` (line 84) `void
STlib_drawNum
( st_number_t*	n,
  boolean	refresh )`
- `STlib_updateNum` (line 146) `void
STlib_updateNum
( st_number_t*		n,
  boolean		refresh )`
- `STlib_initPercent` (line 156) `void
STlib_initPercent
( st_percent_t*		p,
  int			x,
  int			y,
  patch_t**		pl,
  int*			num,
 ...`
- `STlib_updatePercent` (line 173) `void
STlib_updatePercent
( st_percent_t*		per,
  int			refresh )`
- `STlib_initMultIcon` (line 186) `void
STlib_initMultIcon
( st_multicon_t*	i,
  int			x,
  int			y,
  patch_t**		il,
  int*			inum,...`
- `STlib_updateMultIcon` (line 205) `void
STlib_updateMultIcon
( st_multicon_t*	mi,
  boolean		refresh )`
- `STlib_initBinIcon` (line 236) `void
STlib_initBinIcon
( st_binicon_t*		b,
  int			x,
  int			y,
  patch_t*		i,
  boolean*		val,
...`
- `STlib_updateBinIcon` (line 255) `void
STlib_updateBinIcon
( st_binicon_t*		bi,
  boolean		refresh )`

**Variables:**
- `automapactive` (line 40) `extern boolean automapactive;` - *in AM_map.c*

#### `st_stuff.c`
**Path:** `progs/doomgeneric/st_stuff.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Status bar code. Does the face/direction indicator animatin. Does palette indicators as well (red pain/berserk, bright pickup)*

**Functions:**
- `ST_refreshBackground` (line 416) `void ST_refreshBackground(void)`
- `ST_Responder` (line 439) `boolean
ST_Responder (event_t* ev)`
- `ST_calcPainOffset` (line 665) `int ST_calcPainOffset(void)`
- `ST_updateFaceWidget` (line 688) `void ST_updateFaceWidget(void)` - *This is a not-very-pretty routine which handles the face states and their timing. the precedence of expressions is: dead > evil grin > turned head > straight ahead*
- `ST_updateWidgets` (line 860) `void ST_updateWidgets(void)`
- `ST_Ticker` (line 924) `void ST_Ticker (void)`
- `ST_doPaletteStuff` (line 936) `void ST_doPaletteStuff(void)`
- `ST_drawWidgets` (line 1001) `void ST_drawWidgets(boolean refresh)`
- `ST_doRefresh` (line 1036) `void ST_doRefresh(void)`
- `ST_diffDraw` (line 1049) `void ST_diffDraw(void)`
- `ST_Drawer` (line 1055) `void ST_Drawer (boolean fullscreen, boolean refresh)`
- `ST_loadUnloadGraphics` (line 1076) `static void ST_loadUnloadGraphics(load_callback_t callback)`
- `ST_loadCallback` (line 1162) `static void ST_loadCallback(char *lumpname, patch_t **variable)`
- `ST_loadGraphics` (line 1167) `void ST_loadGraphics(void)`
- `ST_loadData` (line 1172) `void ST_loadData(void)`
- `ST_unloadCallback` (line 1178) `static void ST_unloadCallback(char *lumpname, patch_t **variable)`
- `ST_unloadGraphics` (line 1184) `void ST_unloadGraphics(void)`
- `ST_unloadData` (line 1189) `void ST_unloadData(void)`
- `ST_initData` (line 1194) `void ST_initData(void)`
- `ST_createWidgets` (line 1227) `void ST_createWidgets(void)`
- `ST_Start` (line 1389) `void ST_Start (void)`
- `ST_Stop` (line 1401) `void ST_Stop (void)`
- `ST_Init` (line 1411) `void ST_Init (void)`

**Macros:**
- `STARTREDPALS` (line 68) `#define STARTREDPALS`
- `STARTBONUSPALS` (line 69) `#define STARTBONUSPALS`
- `NUMREDPALS` (line 70) `#define NUMREDPALS`
- `NUMBONUSPALS` (line 71) `#define NUMBONUSPALS`
- `RADIATIONPAL` (line 73) `#define RADIATIONPAL`
- `ST_FACEPROBABILITY` (line 77) `#define ST_FACEPROBABILITY`
- `ST_TOGGLECHAT` (line 80) `#define ST_TOGGLECHAT`
- `ST_X` (line 83) `#define ST_X`
- `ST_X2` (line 84) `#define ST_X2`
- `ST_FX` (line 86) `#define ST_FX`
- `ST_FY` (line 87) `#define ST_FY`
- `ST_TALLNUMWIDTH` (line 91) `#define ST_TALLNUMWIDTH`
- `ST_NUMPAINFACES` (line 94) `#define ST_NUMPAINFACES`
- `ST_NUMSTRAIGHTFACES` (line 95) `#define ST_NUMSTRAIGHTFACES`
- `ST_NUMTURNFACES` (line 96) `#define ST_NUMTURNFACES`
- `ST_NUMSPECIALFACES` (line 97) `#define ST_NUMSPECIALFACES`
- `ST_FACESTRIDE` (line 99) `#define ST_FACESTRIDE`
- `ST_NUMEXTRAFACES` (line 102) `#define ST_NUMEXTRAFACES`
- `ST_NUMFACES` (line 104) `#define ST_NUMFACES`
- `ST_TURNOFFSET` (line 107) `#define ST_TURNOFFSET`
- `ST_OUCHOFFSET` (line 108) `#define ST_OUCHOFFSET`
- `ST_EVILGRINOFFSET` (line 109) `#define ST_EVILGRINOFFSET`
- `ST_RAMPAGEOFFSET` (line 110) `#define ST_RAMPAGEOFFSET`
- `ST_GODFACE` (line 111) `#define ST_GODFACE`
- `ST_DEADFACE` (line 112) `#define ST_DEADFACE`
- `ST_FACESX` (line 114) `#define ST_FACESX`
- `ST_FACESY` (line 115) `#define ST_FACESY`
- `ST_EVILGRINCOUNT` (line 117) `#define ST_EVILGRINCOUNT`
- `ST_STRAIGHTFACECOUNT` (line 118) `#define ST_STRAIGHTFACECOUNT`
- `ST_TURNCOUNT` (line 119) `#define ST_TURNCOUNT`
- `ST_OUCHCOUNT` (line 120) `#define ST_OUCHCOUNT`
- `ST_RAMPAGEDELAY` (line 121) `#define ST_RAMPAGEDELAY`
- `ST_MUCHPAIN` (line 123) `#define ST_MUCHPAIN`
- `ST_AMMOWIDTH` (line 135) `#define ST_AMMOWIDTH`
- `ST_AMMOX` (line 136) `#define ST_AMMOX`
- `ST_AMMOY` (line 137) `#define ST_AMMOY`
- `ST_HEALTHWIDTH` (line 140) `#define ST_HEALTHWIDTH`
- `ST_HEALTHX` (line 141) `#define ST_HEALTHX`
- `ST_HEALTHY` (line 142) `#define ST_HEALTHY`
- `ST_ARMSX` (line 145) `#define ST_ARMSX`
- `ST_ARMSY` (line 146) `#define ST_ARMSY`
- `ST_ARMSBGX` (line 147) `#define ST_ARMSBGX`
- `ST_ARMSBGY` (line 148) `#define ST_ARMSBGY`
- `ST_ARMSXSPACE` (line 149) `#define ST_ARMSXSPACE`
- `ST_ARMSYSPACE` (line 150) `#define ST_ARMSYSPACE`
- `ST_FRAGSX` (line 153) `#define ST_FRAGSX`
- `ST_FRAGSY` (line 154) `#define ST_FRAGSY`
- `ST_FRAGSWIDTH` (line 155) `#define ST_FRAGSWIDTH`
- `ST_ARMORWIDTH` (line 158) `#define ST_ARMORWIDTH`
- `ST_ARMORX` (line 159) `#define ST_ARMORX`
- `ST_ARMORY` (line 160) `#define ST_ARMORY`
- `ST_KEY0WIDTH` (line 163) `#define ST_KEY0WIDTH`
- `ST_KEY0HEIGHT` (line 164) `#define ST_KEY0HEIGHT`
- `ST_KEY0X` (line 165) `#define ST_KEY0X`
- `ST_KEY0Y` (line 166) `#define ST_KEY0Y`
- `ST_KEY1WIDTH` (line 167) `#define ST_KEY1WIDTH`
- `ST_KEY1X` (line 168) `#define ST_KEY1X`
- `ST_KEY1Y` (line 169) `#define ST_KEY1Y`
- `ST_KEY2WIDTH` (line 170) `#define ST_KEY2WIDTH`
- `ST_KEY2X` (line 171) `#define ST_KEY2X`
- `ST_KEY2Y` (line 172) `#define ST_KEY2Y`
- `ST_AMMO0WIDTH` (line 175) `#define ST_AMMO0WIDTH`
- `ST_AMMO0HEIGHT` (line 176) `#define ST_AMMO0HEIGHT`
- `ST_AMMO0X` (line 177) `#define ST_AMMO0X`
- `ST_AMMO0Y` (line 178) `#define ST_AMMO0Y`
- `ST_AMMO1WIDTH` (line 179) `#define ST_AMMO1WIDTH`
- `ST_AMMO1X` (line 180) `#define ST_AMMO1X`
- `ST_AMMO1Y` (line 181) `#define ST_AMMO1Y`
- `ST_AMMO2WIDTH` (line 182) `#define ST_AMMO2WIDTH`
- `ST_AMMO2X` (line 183) `#define ST_AMMO2X`
- `ST_AMMO2Y` (line 184) `#define ST_AMMO2Y`
- `ST_AMMO3WIDTH` (line 185) `#define ST_AMMO3WIDTH`
- `ST_AMMO3X` (line 186) `#define ST_AMMO3X`
- `ST_AMMO3Y` (line 187) `#define ST_AMMO3Y`
- `ST_MAXAMMO0WIDTH` (line 191) `#define ST_MAXAMMO0WIDTH`
- `ST_MAXAMMO0HEIGHT` (line 192) `#define ST_MAXAMMO0HEIGHT`
- `ST_MAXAMMO0X` (line 193) `#define ST_MAXAMMO0X`
- `ST_MAXAMMO0Y` (line 194) `#define ST_MAXAMMO0Y`
- `ST_MAXAMMO1WIDTH` (line 195) `#define ST_MAXAMMO1WIDTH`
- `ST_MAXAMMO1X` (line 196) `#define ST_MAXAMMO1X`
- `ST_MAXAMMO1Y` (line 197) `#define ST_MAXAMMO1Y`
- `ST_MAXAMMO2WIDTH` (line 198) `#define ST_MAXAMMO2WIDTH`
- `ST_MAXAMMO2X` (line 199) `#define ST_MAXAMMO2X`
- `ST_MAXAMMO2Y` (line 200) `#define ST_MAXAMMO2Y`
- `ST_MAXAMMO3WIDTH` (line 201) `#define ST_MAXAMMO3WIDTH`
- `ST_MAXAMMO3X` (line 202) `#define ST_MAXAMMO3X`
- `ST_MAXAMMO3Y` (line 203) `#define ST_MAXAMMO3Y`
- `ST_WEAPON0X` (line 206) `#define ST_WEAPON0X`
- `ST_WEAPON0Y` (line 207) `#define ST_WEAPON0Y`
- `ST_WEAPON1X` (line 210) `#define ST_WEAPON1X`
- `ST_WEAPON1Y` (line 211) `#define ST_WEAPON1Y`
- `ST_WEAPON2X` (line 214) `#define ST_WEAPON2X`
- `ST_WEAPON2Y` (line 215) `#define ST_WEAPON2Y`
- `ST_WEAPON3X` (line 218) `#define ST_WEAPON3X`
- `ST_WEAPON3Y` (line 219) `#define ST_WEAPON3Y`
- `ST_WEAPON4X` (line 222) `#define ST_WEAPON4X`
- `ST_WEAPON4Y` (line 223) `#define ST_WEAPON4Y`
- `ST_WEAPON5X` (line 226) `#define ST_WEAPON5X`
- `ST_WEAPON5Y` (line 227) `#define ST_WEAPON5Y`
- `ST_WPNSX` (line 230) `#define ST_WPNSX`
- `ST_WPNSY` (line 231) `#define ST_WPNSY`
- `ST_DETHX` (line 234) `#define ST_DETHX`
- `ST_DETHY` (line 235) `#define ST_DETHY`
- `ST_MSGTEXTX` (line 241) `#define ST_MSGTEXTX`
- `ST_MSGTEXTY` (line 242) `#define ST_MSGTEXTY`
- `ST_MSGWIDTH` (line 244) `#define ST_MSGWIDTH`
- `ST_MSGHEIGHT` (line 246) `#define ST_MSGHEIGHT`
- `ST_OUTTEXTX` (line 248) `#define ST_OUTTEXTX`
- `ST_OUTTEXTY` (line 249) `#define ST_OUTTEXTY`
- `ST_OUTWIDTH` (line 252) `#define ST_OUTWIDTH`
- `ST_OUTHEIGHT` (line 254) `#define ST_OUTHEIGHT`
- `ST_MAPTITLEX` (line 256) `#define ST_MAPTITLEX`
- `ST_MAPTITLEY` (line 259) `#define ST_MAPTITLEY`
- `ST_MAPHEIGHT` (line 260) `#define ST_MAPHEIGHT`

#### `statdump.c`
**Path:** `progs/doomgeneric/statdump.c`

**Functions:**
- `DiscoverGamemode` (line 71) `static void DiscoverGamemode(wbstartstruct_t *stats, int num_stats)`
- `GetNumPlayers` (line 130) `static int GetNumPlayers(wbstartstruct_t *stats)`
- `PrintBanner` (line 150) `static void PrintBanner(FILE *stream)`
- `PrintPercentage` (line 155) `static void PrintPercentage(FILE *stream, int amount, int total)`
- `PrintPlayerStats` (line 180) `static void PrintPlayerStats(FILE *stream, wbstartstruct_t *stats,
        int player_num)`
- `PrintFragsTable` (line 213) `static void PrintFragsTable(FILE *stream, wbstartstruct_t *stats)`
- `PrintLevelName` (line 272) `static void PrintLevelName(FILE *stream, int episode, int level)`
- `PrintStats` (line 301) `static void PrintStats(FILE *stream, wbstartstruct_t *stats)`
- `StatCopy` (line 333) `void StatCopy(wbstartstruct_t *stats)`
- `StatDump` (line 343) `void StatDump(void)`

**Macros:**
- `MAX_CAPTURES` (line 56) `#define MAX_CAPTURES`

#### `tables.c`
**Path:** `progs/doomgeneric/tables.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Lookup tables. Do not try to look them up :-). In the order of appearance:  int finetangent[4096]	- Tangens LUT. Should work with BAM fairly well (12 of 16bit, effectively, by shifting).  int finesine[10240]		- Sine lookup. Guess what, serves as cosine, too. Remarkable thing is, how to use BAMs with this?  int tantoangle[2049]	- ArcTan LUT, maps tan(angle) to angle fast. Gotta search.*

**Functions:**
- `SlopeDiv` (line 41) `int SlopeDiv(unsigned int num, unsigned int den)`

#### `v_video.c`
**Path:** `progs/doomgeneric/v_video.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Gamma correction LUT stuff. Functions to draw patches (by post) directly to screen. Functions to blit a block to the screen.*

**Functions:**
- `V_MarkRect` (line 69) `void V_MarkRect(int x, int y, int width, int height)` - *V_MarkRect*
- `V_CopyRect` (line 85) `void V_CopyRect(int srcx, int srcy, byte *source,
                int width, int height,
        ...` - *V_CopyRect*
- `V_SetPatchClipCallback` (line 129) `void V_SetPatchClipCallback(vpatchclipfunc_t func)` - *V_SetPatchClipCallback  haleyjd 08/28/10: Added for Strife support. By calling this function, you can setup runtime error checking for patch clipping. Strife never caused errors by drawing patches partway off-screen. Some versions of vanilla DOOM also behaved differently than the default implementation, so this could possibly be extended to those as well for accurate emulation.*
- `V_DrawPatch` (line 139) `void V_DrawPatch(int x, int y, patch_t *patch)`
- `V_DrawPatchFlipped` (line 203) `void V_DrawPatchFlipped(int x, int y, patch_t *patch)`
- `V_DrawPatchDirect` (line 268) `void V_DrawPatchDirect(int x, int y, patch_t *patch)`
- `V_DrawTLPatch` (line 279) `void V_DrawTLPatch(int x, int y, patch_t * patch)`
- `V_DrawXlaPatch` (line 329) `void V_DrawXlaPatch(int x, int y, patch_t * patch)`
- `V_DrawAltTLPatch` (line 378) `void V_DrawAltTLPatch(int x, int y, patch_t * patch)`
- `V_DrawShadowedPatch` (line 428) `void V_DrawShadowedPatch(int x, int y, patch_t *patch)`
- `V_LoadTintTable` (line 482) `void V_LoadTintTable(void)`
- `V_LoadXlaTable` (line 493) `void V_LoadXlaTable(void)`
- `V_DrawBlock` (line 503) `void V_DrawBlock(int x, int y, int width, int height, byte *src)`
- `V_DrawFilledBox` (line 529) `void V_DrawFilledBox(int x, int y, int w, int h, int c)`
- `V_DrawHorizLine` (line 549) `void V_DrawHorizLine(int x, int y, int w, int c)`
- `V_DrawVertLine` (line 562) `void V_DrawVertLine(int x, int y, int h, int c)`
- `V_DrawBox` (line 576) `void V_DrawBox(int x, int y, int w, int h, int c)`
- `V_DrawRawScreen` (line 589) `void V_DrawRawScreen(byte *raw)`
- `V_Init` (line 597) `void V_Init (void)` - *V_Init*
- `V_UseBuffer` (line 606) `void V_UseBuffer(byte *buffer)`
- `V_RestoreBuffer` (line 613) `void V_RestoreBuffer(void)`
- `WritePCXfile` (line 653) `void WritePCXfile(char *filename, byte *data,
                  int width, int height,
          ...`
- `error_fn` (line 711) `static void error_fn(png_structp p, png_const_charp s)`
- `warning_fn` (line 716) `static void warning_fn(png_structp p, png_const_charp s)`
- `WritePNGfile` (line 721) `void WritePNGfile(char *filename, byte *data,
                  int width, int height,
          ...`
- `V_ScreenShot` (line 791) `void V_ScreenShot(char *format)`
- `V_DrawMouseSpeedBox` (line 846) `void V_DrawMouseSpeedBox(int speed)`

**Macros:**
- `RANGECHECK` (line 46) `#define RANGECHECK`
- `MOUSE_SPEED_BOX_WIDTH` (line 843) `#define MOUSE_SPEED_BOX_WIDTH`
- `MOUSE_SPEED_BOX_HEIGHT` (line 844) `#define MOUSE_SPEED_BOX_HEIGHT`

**Variables:**
- `png_screenshots` (line 800) `extern int png_screenshots;` - *ifdef HAVE_LIBPNG*
- `usemouse` (line 848) `extern int usemouse;`

#### `w_checksum.c`
**Path:** `progs/doomgeneric/w_checksum.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Generate a checksum of the WAD directory.*

**Functions:**
- `GetFileNumber` (line 31) `static int GetFileNumber(wad_file_t *handle)`
- `ChecksumAddLump` (line 57) `static void ChecksumAddLump(sha1_context_t *sha1_context, lumpinfo_t *lump)`
- `W_Checksum` (line 68) `void W_Checksum(sha1_digest_t digest)`

#### `w_file.c`
**Path:** `progs/doomgeneric/w_file.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.*

**Functions:**
- `W_OpenFile` (line 53) `wad_file_t *W_OpenFile(char *path)`
- `W_CloseFile` (line 85) `void W_CloseFile(wad_file_t *wad)`
- `W_Read` (line 90) `size_t W_Read(wad_file_t *wad, unsigned int offset,
              void *buffer, size_t buffer_len)`

**Variables:**
- `stdc_wad_file` (line 28) `extern wad_file_class_t stdc_wad_file;`
- `win32_wad_file` (line 32) `extern wad_file_class_t win32_wad_file;` - *ifdef _WIN32*
- `posix_wad_file` (line 37) `extern wad_file_class_t posix_wad_file;` - *ifdef HAVE_MMAP*

#### `w_file_stdc.c`
**Path:** `progs/doomgeneric/w_file_stdc.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.*

**Functions:**
- `W_StdC_OpenFile` (line 33) `static wad_file_t *W_StdC_OpenFile(char *path)`
- `W_StdC_CloseFile` (line 56) `static void W_StdC_CloseFile(wad_file_t *wad)`
- `W_StdC_Read` (line 69) `size_t W_StdC_Read(wad_file_t *wad, unsigned int offset,
                   void *buffer, size_t ...`

**Structs:**
- `stdc_wad_file_t` (line 25)

**Variables:**
- `stdc_wad_file` (line 31) `extern wad_file_class_t stdc_wad_file;`

#### `w_main.c`
**Path:** `progs/doomgeneric/w_main.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Common code to parse command line, identifying WAD files to load.    Parse the command line, merging WAD files that are sppecified. Returns true if at least one file was added.*

**Functions:**
- `W_ParseCommandLine` (line 30) `boolean W_ParseCommandLine(void)`

#### `w_wad.c`
**Path:** `progs/doomgeneric/w_wad.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handles WAD file header, directory, lump I/O.*

**Functions:**
- `W_LumpNameHash` (line 72) `unsigned int W_LumpNameHash(const char *s)`
- `ExtendLumpInfo` (line 89) `static void ExtendLumpInfo(int newnumlumps)` - *Increase the size of the lumpinfo[] array to the specified size.*
- `W_AddFile` (line 141) `wad_file_t *W_AddFile (char *filename)`
- `W_NumLumps` (line 246) `int W_NumLumps (void)` - *W_NumLumps*
- `W_CheckNumForName` (line 258) `int W_CheckNumForName (char* name)`
- `W_GetNumForName` (line 308) `int W_GetNumForName (char* name)` - *W_GetNumForName Calls W_CheckNumForName, but bombs out if not found.*
- `W_LumpLength` (line 327) `int W_LumpLength (unsigned int lump)` - *W_LumpLength Returns the buffer size needed to load the given lump.*
- `W_ReadLump` (line 344) `void W_ReadLump(unsigned int lump, void *dest)` - *W_ReadLump Loads the lump into the given buffer, which must be >= W_LumpLength().*
- `W_CacheLumpNum` (line 384) `void *W_CacheLumpNum(int lumpnum, int tag)`
- `W_CacheLumpName` (line 431) `void *W_CacheLumpName(char *name, int tag)` - *W_CacheLumpName*
- `W_ReleaseLumpNum` (line 446) `void W_ReleaseLumpNum(int lumpnum)`
- `W_ReleaseLumpName` (line 467) `void W_ReleaseLumpName(char *name)`
- `W_Profile` (line 480) `void W_Profile (void)`
- `W_GenerateHashTable` (line 541) `void W_GenerateHashTable(void)`
- `W_CheckCorrectIWAD` (line 588) `void W_CheckCorrectIWAD(GameMission_t mission)`
- `I_EndRead` (line 39) `void I_EndRead (void);`

#### `wi_stuff.c`
**Path:** `progs/doomgeneric/wi_stuff.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Intermission screens.*

**Functions:**
- `WI_slamBackground` (line 402) `void WI_slamBackground(void)` - *slam background*
- `WI_Responder` (line 409) `boolean WI_Responder(event_t* ev)` - *The ticker is used to detect keys because of timing issues in netgames.*
- `WI_drawLF` (line 416) `void WI_drawLF(void)` - *Draws "<Levelname> Finished!"*
- `WI_drawEL` (line 452) `void WI_drawEL(void)` - *Draws "Entering <LevelName>"*
- `WI_drawOnLnode` (line 471) `void
WI_drawOnLnode
( int		n,
  patch_t*	c[] )`
- `WI_initAnimatedBack` (line 519) `void WI_initAnimatedBack(void)`
- `WI_updateAnimatedBack` (line 548) `void WI_updateAnimatedBack(void)`
- `WI_drawAnimatedBack` (line 599) `void WI_drawAnimatedBack(void)`
- `WI_drawNum` (line 628) `int
WI_drawNum
( int		x,
  int		y,
  int		n,
  int		digits )`
- `WI_drawPercent` (line 685) `void
WI_drawPercent
( int		x,
  int		y,
  int		p )`
- `WI_drawTime` (line 704) `void
WI_drawTime
( int		x,
  int		y,
  int		t )`
- `WI_End` (line 740) `void WI_End(void)`
- `WI_initNoState` (line 746) `void WI_initNoState(void)`
- `WI_updateNoState` (line 753) `void WI_updateNoState(void)`
- `WI_initShowNextLoc` (line 772) `void WI_initShowNextLoc(void)`
- `WI_updateShowNextLoc` (line 781) `void WI_updateShowNextLoc(void)`
- `WI_drawShowNextLoc` (line 791) `void WI_drawShowNextLoc(void)`
- `WI_drawNoState` (line 832) `void WI_drawNoState(void)`
- `WI_fragSum` (line 838) `int WI_fragSum(int playernum)`
- `WI_initDeathmatchStats` (line 869) `void WI_initDeathmatchStats(void)`
- `WI_updateDeathmatchStats` (line 898) `void WI_updateDeathmatchStats(void)`
- `WI_drawDeathmatchStats` (line 1001) `void WI_drawDeathmatchStats(void)`
- `WI_initNetgameStats` (line 1089) `void WI_initNetgameStats(void)`
- `WI_updateNetgameStats` (line 1117) `void WI_updateNetgameStats(void)`
- `WI_drawNetgameStats` (line 1272) `void WI_drawNetgameStats(void)`
- `WI_initStats` (line 1329) `void WI_initStats(void)`
- `WI_updateStats` (line 1341) `void WI_updateStats(void)`
- `WI_drawStats` (line 1447) `void WI_drawStats(void)`
- `WI_checkForAccelerate` (line 1481) `void WI_checkForAccelerate(void)`
- `WI_Ticker` (line 1514) `void WI_Ticker(void)` - *Updates stuff each tick*
- `WI_loadUnloadData` (line 1554) `static void WI_loadUnloadData(load_callback_t callback)`
- `WI_loadCallback` (line 1704) `static void WI_loadCallback(char *name, patch_t **variable)`
- `WI_loadData` (line 1709) `void WI_loadData(void)`
- `WI_unloadCallback` (line 1735) `static void WI_unloadCallback(char *name, patch_t **variable)`
- `WI_unloadData` (line 1741) `void WI_unloadData(void)`
- `WI_Drawer` (line 1752) `void WI_Drawer (void)`
- `WI_initVariables` (line 1776) `void WI_initVariables(wbstartstruct_t* wbstartstruct)`
- `WI_Start` (line 1818) `void WI_Start(wbstartstruct_t* wbstartstruct)`

**Macros:**
- `NUMEPISODES` (line 61) `#define NUMEPISODES`
- `NUMMAPS` (line 62) `#define NUMMAPS`
- `WI_TITLEY` (line 75) `#define WI_TITLEY`
- `WI_SPACINGY` (line 76) `#define WI_SPACINGY`
- `SP_STATSX` (line 79) `#define SP_STATSX`
- `SP_STATSY` (line 80) `#define SP_STATSY`
- `SP_TIMEX` (line 82) `#define SP_TIMEX`
- `SP_TIMEY` (line 83) `#define SP_TIMEY`
- `NG_STATSY` (line 87) `#define NG_STATSY`
- `NG_STATSX` (line 88) `#define NG_STATSX`
- `NG_SPACINGX` (line 90) `#define NG_SPACINGX`
- `DM_MATRIXX` (line 94) `#define DM_MATRIXX`
- `DM_MATRIXY` (line 95) `#define DM_MATRIXY`
- `DM_SPACINGX` (line 97) `#define DM_SPACINGX`
- `DM_TOTALSX` (line 99) `#define DM_TOTALSX`
- `DM_KILLERSX` (line 101) `#define DM_KILLERSX`
- `DM_KILLERSY` (line 102) `#define DM_KILLERSY`
- `DM_VICTIMSX` (line 103) `#define DM_VICTIMSX`
- `DM_VICTIMSY` (line 104) `#define DM_VICTIMSY`
- `ANIM` (line 222) `#define ANIM(type, period, nanims, x, y, nexttic)`
- `SP_KILLS` (line 288) `#define SP_KILLS`
- `SP_ITEMS` (line 289) `#define SP_ITEMS`
- `SP_SECRET` (line 290) `#define SP_SECRET`
- `SP_FRAGS` (line 291) `#define SP_FRAGS`
- `SP_TIME` (line 292) `#define SP_TIME`
- `SP_PAR` (line 293) `#define SP_PAR`
- `SP_PAUSE` (line 295) `#define SP_PAUSE`
- `SHOWNEXTLOCDELAY` (line 298) `#define SHOWNEXTLOCDELAY`

**Structs:**
- `point_t` (line 117)
- `anim_t` (line 129) - *Animation. There is another anim_t used in p_spec.*

#### `z_zone.c`
**Path:** `progs/doomgeneric/z_zone.c`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Zone Memory Allocation. Neat.       ZONE MEMORY ALLOCATION  There is never any space between memblocks, and there will never be two contiguous free memblocks. The rover can be left pointing at a non-empty block.*

**Functions:**
- `Z_ClearZone` (line 71) `void Z_ClearZone (memzone_t* zone)` - *Z_ClearZone*
- `Z_Init` (line 97) `void Z_Init (void)` - *Z_Init*
- `Z_Free` (line 126) `void Z_Free (void* ptr)` - *Z_Free*
- `Z_Malloc` (line 185) `void*
Z_Malloc
( int		size,
  int		tag,
  void*		user )`
- `Z_FreeTags` (line 298) `void
Z_FreeTags
( int		lowtag,
  int		hightag )`
- `Z_DumpHeap` (line 328) `void
Z_DumpHeap
( int		lowtag,
  int		hightag )`
- `Z_FileDumpHeap` (line 367) `void Z_FileDumpHeap (FILE* f)` - *Z_FileDumpHeap*
- `Z_CheckHeap` (line 400) `void Z_CheckHeap (void)` - *Z_CheckHeap*
- `Z_ChangeTag2` (line 429) `void Z_ChangeTag2(void *ptr, int tag, char *file, int line)` - *Z_ChangeTag*
- `Z_ChangeUser` (line 446) `void Z_ChangeUser(void *ptr, void **user)`
- `Z_FreeMemory` (line 466) `int Z_FreeMemory (void)` - *Z_FreeMemory*
- `Z_ZoneSize` (line 484) `unsigned int Z_ZoneSize(void)`

**Macros:**
- `MEM_ALIGN` (line 36) `#define MEM_ALIGN`
- `ZONEID` (line 37) `#define ZONEID`
- `MINFRAGMENT` (line 181) `#define MINFRAGMENT`

**Structs:**
- `memblock_s` (line 39)
- `memzone_t` (line 50)

**Type_Aliases:**
- `size` (line 38) `typedef struct memblock_s { int size;` - *define MEM_ALIGN sizeof(void *) define ZONEID	0x1d4a11*

#### `file.c`
**Path:** `progs/file/file.c`
**File Doc:** *Docstring: MiniOS file browser (Nuklear ring-3 app, MiniFS: file/file.elf).*

**Functions:**
- `file_sys_dir_list` (line 101) `static long file_sys_dir_list(const char *path, char *buf, long cap)` - *static unsigned char file_icon_mask[FILE_ICON_N][FILE_ICON_MAX * FILE_ICON_MAX]; static struct nk_minios_img file_icon_img[FILE_ICON_N]; static int file_icons_ok; static char file_cwd[FILE_MAX_PATH]; static char file_entries[FILE_LIST_CAP]; static long file_entry_count; static char file_status[FILE_STATUS_MAX]; static char file_preview_path[FILE_MAX_PATH]; static unsigned char file_preview_px[FILE_PREVIEW_W * FILE_PREVIEW_H]; static int file_preview_w; static int file_preview_h; static int file_preview_on; /** Raw DIR_LIST syscall (241): names land NUL-separated in buf.*
- `file_sys_spawn` (line 111) `static long file_sys_spawn(const char *path, int argc, const char **argv)` - *static int file_preview_h; static int file_preview_on; /** Raw DIR_LIST syscall (241): names land NUL-separated in buf. static long file_sys_dir_list(const char *path, char *buf, long cap) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_DIR_LIST), "D"(path), "S"(buf), "d"(cap) : "rcx", "r11", "memory"); return ret; } /** Raw SPAWN syscall (215) preserving this app across the child.*
- `file_ext_of` (line 122) `static void file_ext_of(const char *fname, char *dst, unsigned cap)` - *} /** Raw SPAWN syscall (215) preserving this app across the child. static long file_sys_spawn(const char *path, int argc, const char **argv) { long ret; register long r10 __asm__("r10") = (long)argv; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_SPAWN), "D"(path), "S"(0), "d"((long)argc), "r"(r10) : "rcx", "r11", "memory"); return ret; } /** Lowercase the extension of fname into dst (no dot, empty when none).*
- `file_icon_kind` (line 146) `static int file_icon_kind(const char *fname, int isdir)` - *Icon kind for an entry: folder for dirs, image for .png, object for .o/.elf/.cvm, files for the text kinds (.c/.h/.lisp/.lua/.py/.txt/.s) and for anything else. The extension arrives lowercased from * file_ext_of, so every comparison is exact.*
- `file_icon_sz` (line 158) `static int file_icon_sz(void)` - *and for anything else. The extension arrives lowercased from * file_ext_of, so every comparison is exact. static int file_icon_kind(const char *fname, int isdir) { char ext[FILE_EXT_MAX + 1]; if (isdir) return FILE_ICON_FOLDER; file_ext_of(fname, ext, sizeof(ext)); if (strcmp(ext, "png") == 0) return FILE_ICON_IMAGE; if (strcmp(ext, "o") == 0 || strcmp(ext, "elf") == 0 || strcmp(ext, "cvm") == 0) return FILE_ICON_OBJECT; return FILE_ICON_FILES; } /** Live icon edge: 32 in big mode, 16 in small mode.*
- `file_icon_decode` (line 165) `static int file_icon_decode(const char *path, unsigned char *px,
                            unsi...` - *Decode one RGBA icon into indexed pixels plus an alpha mask, scaled to the live size. Fail closed: any bound or decode error returns -1 and * leaves the slot untouched.*
- `file_icons_load` (line 213) `static int file_icons_load(void)` - *Load the four kind icons; all-or-nothing so the UI never mixes icon * and text rows. Returns 1 when every icon is live.*
- `file_toggle_icons` (line 238) `static int file_toggle_icons(void)` - *Flip the icon size and reload the four kind icons. Returns 1 when the new size is live, 0 when the reload failed (flag stays flipped so the * next toggle retries the other size instead of sticking).*
- `file_join` (line 245) `static int file_join(const char *dir, const char *name, char *dst, unsigned cap)` - *Flip the icon size and reload the four kind icons. Returns 1 when the new size is live, 0 when the reload failed (flag stays flipped so the * next toggle retries the other size instead of sticking). static int file_toggle_icons(void) { file_icon_big = !file_icon_big; file_icons_ok = file_icons_load(); return file_icons_ok; } /** Join dir + name into dst, fail closed on overflow.*
- `file_parent` (line 259) `static void file_parent(char *path)` - *static int file_join(const char *dir, const char *name, char *dst, unsigned cap) { unsigned a = 0; unsigned b = 0; while (dir[a] && a < cap) a++; while (name[b] && b < FILE_NAME_MAX) b++; if (a + 1 + b + 1 > cap) return -1; memcpy(dst, dir, a); if (a > 0 && dst[a - 1] != '/') dst[a++] = '/'; memcpy(dst + a, name, b); dst[a + b] = 0; return 0; } /** Parent of an absolute path, root stays root.*
- `file_assoc_line` (line 269) `static int file_assoc_line(const char *line, char *ext, char *prog)` - *return 0; } /** Parent of an absolute path, root stays root. static void file_parent(char *path) { unsigned n = 0; while (path[n]) n++; while (n > 1 && path[n - 1] == '/') path[--n] = 0; while (n > 1 && path[n - 1] != '/') n--; if (n <= 1) { path[0] = '/'; path[1] = 0; return; } path[n - 1] = 0; } /** Validate one association line: ext|program, fail closed.*
- `file_assoc_load` (line 302) `static void file_assoc_load(void)` - *} if (line[p + k] && line[p + k] != '\n' && line[p + k] != '\r') return -1; while (p > 0 && (prog[p - 1] == ' ' || prog[p - 1] == '\t')) p--; prog[p] = 0; } ext[m] = 0; if (!prog[0]) return -1; if (strcmp(prog, FILE_ACTION_SHELL) != 0 && strcmp(prog, FILE_ACTION_INTERNAL) != 0 && prog[0] != '/') return -1; return 0; } /** Load the association table, builtins on failure.*
- `file_assoc_lookup` (line 318) `static const char *file_assoc_lookup(const char *ext)` - *char line[FILE_LOG_LINE]; char ext[FILE_EXT_MAX + 1]; char prog[FILE_PROG_MAX + 1]; fassoc_clear(&file_assocs); f = fopen(FILE_ASSOC_PATH, "r"); if (!f) return; while (fgets(line, sizeof(line), f)) { if (file_assoc_line(line, ext, prog) != 0) continue; if (fassoc_push(&file_assocs, ext, prog) != 0) break; } fclose(f); } /** Program for an extension, empty when unmapped.*
- `file_action_of` (line 323) `static int file_action_of(const char *fname, const char **prog_out)` - *if (!f) return; while (fgets(line, sizeof(line), f)) { if (file_assoc_line(line, ext, prog) != 0) continue; if (fassoc_push(&file_assocs, ext, prog) != 0) break; } fclose(f); } /** Program for an extension, empty when unmapped. static const char *file_assoc_lookup(const char *ext) { return fassoc_lookup(&file_assocs, ext); } /** Dispatch kind for a file name through the association table.*
- `file_refresh` (line 336) `static void file_refresh(void)` - */** Dispatch kind for a file name through the association table. static int file_action_of(const char *fname, const char **prog_out) { char ext[FILE_EXT_MAX + 1]; const char *prog; file_ext_of(fname, ext, sizeof(ext)); prog = file_assoc_lookup(ext); if (prog_out) *prog_out = prog; if (!prog[0]) return FILE_ACT_UNKNOWN; if (strcmp(prog, FILE_ACTION_SHELL) == 0) return FILE_ACT_SHELL; if (strcmp(prog, FILE_ACTION_INTERNAL) == 0) return FILE_ACT_INTERNAL; return FILE_ACT_TEXT; } /** Refresh the entry list for the cwd, fail closed with a status.*
- `file_preview_load` (line 351) `static int file_preview_load(const char *path)` - *long rc = file_sys_dir_list(file_cwd, file_entries, FILE_LIST_CAP); if (rc < 0) { file_entry_count = 0; file_entries[0] = 0; snprintf(file_status, sizeof(file_status), "cannot list %s (%ld)", file_cwd, rc); return; } file_entry_count = rc; snprintf(file_status, sizeof(file_status), "%s (%ld entries)", file_cwd, rc); } /** Decode a png file into the preview buffer, nearest-neighbor downscale.*
- `file_preview_blit` (line 385) `static void file_preview_blit(int ox, int oy)` - *Blit the preview buffer into the NK back-buffer after rasterize (and its * RGB twin when the kernel maps it).*
- `file_spawn_visible` (line 407) `static long file_spawn_visible(const char *tool, int argc, const char **argv,
                   ...` - *int dx = ox + x; int dy = oy + y; unsigned char r, g, b; volatile uint8_t *d; if (dx < 0 || dx >= NK_W || dy < 0 || dy >= NK_H) continue; fb[dy * NK_W + dx] = file_preview_px[y * FILE_PREVIEW_W + x]; if (!rgb) continue; nk_idx_to_rgb(file_preview_px[y * FILE_PREVIEW_W + x], &r, &g, &b); d = NK_RGB_BUF + ((dy * NK_W) + dx) * 3; d[0] = r; d[1] = g; d[2] = b; } } /** Run a program with the display released so output lands on console.*
- `file_open_text` (line 430) `static void file_open_text(const char *path)` - *printf("file: %s exit code: %ld\n", label, rc); fflush(stdout); nk_sys_vga_mode(1); nk_build_palette(pal768); nk_sys_palette(pal768); nk_sys_kbd_raw(1); if (rc != 0) snprintf(file_status, sizeof(file_status), "%s exit %ld", label, rc); else snprintf(file_status, sizeof(file_status), "%s ok", label); return rc; } /** Open a text file in vedit, preserving this browser.*
- `file_run_shell` (line 441) `static void file_run_shell(const char *path)` - *} /** Open a text file in vedit, preserving this browser. static void file_open_text(const char *path) { const char *args[3]; char label[FILE_LOG_LINE]; args[0] = FILE_TOOL_VEDIT; args[1] = path; args[2] = 0; snprintf(label, sizeof(label), "vedit %s", path); file_spawn_visible(FILE_TOOL_VEDIT, 2, args, label); } /** Run a shell-kind file: elf/o directly, cvm through the interpreter.*
- `file_activate` (line 480) `static void file_activate(const char *dir, const char *name)` - *if (strcmp(ext, "cvm") == 0) { args[0] = path; args[1] = 0; snprintf(label, sizeof(label), "run %s", path); file_spawn_visible(FILE_TOOL_CVM, 1, args, label); return; } args[0] = path; args[1] = 0; snprintf(label, sizeof(label), "run %s", path); file_spawn_visible(path, 1, args, label); } /** Dispatch one file name through the association table.*
- `file_ui_build` (line 511) `static void file_ui_build(struct nk_context *ctx)` - *snprintf(file_preview_path, sizeof(file_preview_path), "%s", path); snprintf(file_status, sizeof(file_status), "preview %s", path); } else { file_preview_on = 0; snprintf(file_status, sizeof(file_status), "cannot preview %s", path); } } else { file_preview_on = 0; snprintf(file_status, sizeof(file_status), "no handler for %s", name); } } /** Immediate-mode frame: breadcrumb, places, content grid, status.*
- `file_selftest` (line 613) `static int file_selftest(void)` - *Headless selftest for BDD: assoc vectors plus a live listing. The live set must drain to its entry baseline: every icon decode, preview decode and assoc push in this body frees what it borrows, so a * regression in the file -> vedit open path fails here first.*
- `file_gui_run` (line 779) `static void file_gui_run(void)`
- `main` (line 838) `int main(int argc, char **argv)`

**Macros:**
- `STB_IMAGE_IMPLEMENTATION` (line 24) `#define STB_IMAGE_IMPLEMENTATION`
- `STBI_ONLY_PNG` (line 25) `#define STBI_ONLY_PNG`
- `STBI_NO_STDIO` (line 26) `#define STBI_NO_STDIO`
- `MINIOS_LEAKCHECK_IMPL` (line 28) `#define MINIOS_LEAKCHECK_IMPL`
- `MINIOS_LK_ENABLE` (line 29) `#define MINIOS_LK_ENABLE`
- `FILE_MAX_PATH` (line 33) `#define FILE_MAX_PATH`
- `FILE_MAX_ENTRIES` (line 34) `#define FILE_MAX_ENTRIES`
- `FILE_NAME_MAX` (line 35) `#define FILE_NAME_MAX`
- `FILE_LIST_CAP` (line 36) `#define FILE_LIST_CAP`
- `FILE_ASSOC_PATH` (line 37) `#define FILE_ASSOC_PATH`
- `FILE_EXT_MAX` (line 38) `#define FILE_EXT_MAX`
- `FILE_PROG_MAX` (line 39) `#define FILE_PROG_MAX`
- `FILE_TOOL_VEDIT` (line 40) `#define FILE_TOOL_VEDIT`
- `FILE_TOOL_CVM` (line 41) `#define FILE_TOOL_CVM`
- `FILE_STATUS_MAX` (line 42) `#define FILE_STATUS_MAX`
- `FILE_UI_MEMORY` (line 43) `#define FILE_UI_MEMORY`
- `FILE_PREVIEW_W` (line 44) `#define FILE_PREVIEW_W`
- `FILE_PREVIEW_H` (line 45) `#define FILE_PREVIEW_H`
- `FILE_PREVIEW_FILE_MAX` (line 46) `#define FILE_PREVIEW_FILE_MAX`
- `FILE_TITLE` (line 47) `#define FILE_TITLE`
- `FILE_ACTION_SHELL` (line 48) `#define FILE_ACTION_SHELL`
- `FILE_ACTION_INTERNAL` (line 49) `#define FILE_ACTION_INTERNAL`
- `FILE_LOG_LINE` (line 50) `#define FILE_LOG_LINE`
- `FILE_ICON_SMALL` (line 57) `#define FILE_ICON_SMALL`
- `FILE_ICON_BIG` (line 58) `#define FILE_ICON_BIG`
- `FILE_ICON_MAX` (line 59) `#define FILE_ICON_MAX`
- `FILE_ICON_N` (line 60) `#define FILE_ICON_N`
- `FILE_ICON_FOLDER` (line 61) `#define FILE_ICON_FOLDER`
- `FILE_ICON_FILES` (line 62) `#define FILE_ICON_FILES`
- `FILE_ICON_IMAGE` (line 63) `#define FILE_ICON_IMAGE`
- `FILE_ICON_OBJECT` (line 64) `#define FILE_ICON_OBJECT`
- `FILE_ICON_PATH_FOLDER` (line 65) `#define FILE_ICON_PATH_FOLDER`
- `FILE_ICON_PATH_FILES` (line 66) `#define FILE_ICON_PATH_FILES`
- `FILE_ICON_PATH_IMAGE` (line 67) `#define FILE_ICON_PATH_IMAGE`
- `FILE_ICON_PATH_OBJECT` (line 68) `#define FILE_ICON_PATH_OBJECT`
- `FILE_ACT_TEXT` (line 71) `#define FILE_ACT_TEXT`
- `FILE_ACT_SHELL` (line 72) `#define FILE_ACT_SHELL`
- `FILE_ACT_INTERNAL` (line 73) `#define FILE_ACT_INTERNAL`
- `FILE_ACT_UNKNOWN` (line 74) `#define FILE_ACT_UNKNOWN`

**Structs:**
- `file_assoc` (line 76)

#### `freedomui_minios.c`
**Path:** `progs/freedomui/freedomui_minios.c`
**File Doc:** *freedomui_minios - Real FreeDom browser on MiniOS, DOOM/Q2G pattern.*

**Functions:**
- `freedomui_default` (line 97) `static FreedomUiConfig freedomui_default(void)` - *long path_max; long url_max; long hops_max; long font_w; long font_h; long port_http; long port_https; long ink_bg; long ink_fg; long bar_bg; long bar_fg; } FreedomUiConfig; /** Default configuration derived from the ABI header.*
- `freedomui_build_palette` (line 130) `static long freedomui_build_palette(unsigned char *pal, long cap)` - *Shared hybrid palette, one table for every NK-window app (progs/nk_palette.h); this wrapper keeps the historic name and fail-closed contract the host suite pins.*
- `freedomui_engine_text` (line 145) `static long freedomui_engine_text(char *body, long n, char **title, char **text)` - *Parse a fetched body through the real engine into owned title and text.  Runs hp_parse with secure defaults (scripts stripped, handlers stripped) then hp_get_title and hp_extract_text. Both out pointers are owned buffers the caller releases with hp_free; either may be NULL when the document carries no title or no text. Returns element count, or -1 on parse failure. Fail-closed on every bound.*
- `freedomui_sys_present` (line 193) `static long freedomui_sys_present(long buf, long origin)` - *static char f_path[FUI_PATH_MAX]; static char f_loc[FUI_URL_MAX]; static char f_hdr[FUI_HDR_MAX]; static char f_body[FUI_BODY_CAP]; static char *f_text; static ui_layout f_lay; static long f_elems; static long f_nbytes; static long f_secure; static long f_port; static long f_status; static long f_truncated; /** Present syscall wrapper for the NK buffer path.*
- `freedomui_sys_title` (line 200) `static long freedomui_sys_title(char *t)` - *static long f_nbytes; static long f_secure; static long f_port; static long f_status; static long f_truncated; /** Present syscall wrapper for the NK buffer path. static long freedomui_sys_present(long buf, long origin) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_PRESENT), "D"(buf), "S"(origin) : "rcx", "r11", "memory"); return ret; } /** Set window title through the generic title syscall.*
- `freedomui_sys_palette` (line 207) `static long freedomui_sys_palette(unsigned char *pal)` - *static long freedomui_sys_present(long buf, long origin) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_PRESENT), "D"(buf), "S"(origin) : "rcx", "r11", "memory"); return ret; } /** Set window title through the generic title syscall. static long freedomui_sys_title(char *t) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_SET_TITLE), "D"(t) : "rcx", "r11", "memory"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels.*
- `freedomui_sys_mouse` (line 214) `static long freedomui_sys_mouse(long *m)` - *static long freedomui_sys_title(char *t) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_SET_TITLE), "D"(t) : "rcx", "r11", "memory"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels. static long freedomui_sys_palette(unsigned char *pal) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_PALETTE), "D"(pal) : "rcx", "r11", "memory"); return ret; } /** Read desktop mouse state into a four word buffer.*
- `freedomui_sys_kbd` (line 221) `static long freedomui_sys_kbd(void)` - *static long freedomui_sys_palette(unsigned char *pal) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_PALETTE), "D"(pal) : "rcx", "r11", "memory"); return ret; } /** Read desktop mouse state into a four word buffer. static long freedomui_sys_mouse(long *m) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_MOUSE), "D"(m) : "rcx", "r11", "memory"); return ret; } /** Poll one raw keyboard scancode, negative when idle.*
- `freedomui_sys_vga_mode` (line 228) `static long freedomui_sys_vga_mode(long on)` - *static long freedomui_sys_mouse(long *m) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_MOUSE), "D"(m) : "rcx", "r11", "memory"); return ret; } /** Poll one raw keyboard scancode, negative when idle. static long freedomui_sys_kbd(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD), "D"(0) : "rcx", "r11", "memory"); return ret; } /** Tell the kernel a graphics program owns the display.*
- `freedomui_sys_kbd_raw` (line 235) `static long freedomui_sys_kbd_raw(long on)` - *static long freedomui_sys_kbd(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD), "D"(0) : "rcx", "r11", "memory"); return ret; } /** Tell the kernel a graphics program owns the display. static long freedomui_sys_vga_mode(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_VGA_MODE), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Switch the console into raw scancode mode.*
- `freedomui_sys_yield` (line 242) `static long freedomui_sys_yield(void)` - *static long freedomui_sys_vga_mode(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_VGA_MODE), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Switch the console into raw scancode mode. static long freedomui_sys_kbd_raw(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD_RAW), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Voluntary yield to the scheduler.*
- `fui_append` (line 249) `static long fui_append(char *dst, long pos, char *src, long cap)` - *static long freedomui_sys_kbd_raw(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD_RAW), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Voluntary yield to the scheduler. static long freedomui_sys_yield(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_SCHED_YIELD), "D"(0) : "rcx", "r11", "memory"); return ret; } /** Bounded append of src at dst[pos].*
- `fui_strlen` (line 267) `static long fui_strlen(char *s, long cap)` - *} i = 0L; while (src[i] != 0) { if (pos + i + 1L >= cap) { return -1L; } dst[pos + i] = src[i]; i++; } dst[pos + i] = 0; return pos + i; } /** Bounded string length.*
- `fui_has_scheme` (line 285) `static int fui_has_scheme(const char *s, const char *scheme)` - *Nonzero when the target starts with the given scheme (case-insensitive). RFC 3986 says the scheme is case-insensitive, so * "HTTP://host" and "http://host" are the same target.*
- `fui_is_http_scheme` (line 309) `static int fui_is_http_scheme(const char *s)` - *Nonzero when the target starts with the explicit "http://" scheme (case-insensitive). The FreeDom omnibox upgrades every http:// target to https; the MiniOS contract keeps an explicit http:// on http, so * the browser has to tell the two apart before the omnibox sees it.*
- `fui_split_url` (line 314) `static long fui_split_url(FreedomUiConfig *c, char *url, char *host, char *path, long *port, long...` - *Nonzero when the target starts with the explicit "http://" scheme (case-insensitive). The FreeDom omnibox upgrades every http:// target to https; the MiniOS contract keeps an explicit http:// on http, so * the browser has to tell the two apart before the omnibox sees it. static int fui_is_http_scheme(const char *s) { return fui_has_scheme(s, "http://"); } /** Split an http(s) URL into host, path, port and secure flag.*
- `fui_parse_headers` (line 383) `static long fui_parse_headers(FreedomUiConfig *c, char *hdr, long *status, long *clen, long *hasc...` - *return 0L; } path[k] = p[hl + k]; k++; } path[k] = 0; } else { path[0] = '/'; path[1] = 0; } return 1L; } /** Parse response headers into status, length, encoding and routing.*
- `fui_fetch_raw` (line 501) `static long fui_fetch_raw(FreedomUiConfig *c, char *host, char *path, long port, long secure)` - *} k++; } } } line++; while (hdr[i] == '\r' || hdr[i] == '\n') { i++; } } return 0L; } /** Fetch one response body into the page buffer.*
- `fui_render` (line 729) `static long fui_render(FreedomUiConfig *c, size_t off)` - *if (got < c->body_cap) { f_body[got] = (char)ch; got++; } else { f_truncated = 1L; } } } } tls_close((int)fd); return got; } /** Render the engine text window at the given scroll offset.*
- `fui_browse` (line 848) `static long fui_browse(FreedomUiConfig *c)` - *long ink; if (bits & (0x80 >> px)) { ink = c->bar_fg; } else { ink = c->bar_bg; } fb[((size_t)c->text_rows * (size_t)c->font_h + (size_t)row) * (size_t)c->surface_w + (size_t)col * (size_t)c->font_w + (size_t)px] = (unsigned char)ink; } } } return freedomui_sys_present(c->present_buf, 0L); } /** Interactive scroll loop until q or ESC quits.*
- `freedomui_selftest` (line 927) `static long freedomui_selftest(void)` - *} off = ui_clamp_scroll((size_t)want, f_lay.count, (size_t)c->text_rows); changed = 1L; } if (changed) { if (fui_render(c, off) < 0L) { return 1L; } } freedomui_sys_yield(); } } /** Guest selftest entry mirroring the Nuklear frame contract.*
- `freedomui_host_probe` (line 1015) `static long freedomui_host_probe(FreedomUiConfig *c)` - *return 1L; } if (freedomui_sys_kbd() > 0x7FFFFFFFL) { printf("freedomui: kbd out of range\n"); return 1L; } freedomui_sys_title("FreeDom"); printf("freedomui: frame ok (%ldx%ld)\n", c.surface_w, c.surface_h); return 0L; } #endif #ifdef FREEDOMUI_HOST_TEST /** Host harness probe for pure backend logic plus engine linkage.*
- `freedomui_host_entry` (line 1098) `int freedomui_host_entry(FreedomUiConfig *c)` - *if (title) { hp_free(title); } return -1L; } ui_layout_free(&lay); hp_free(text); if (title) { hp_free(title); } return 0L; } /** Host harness entry for pure backend logic plus engine linkage.*
- `main` (line 1103) `int main(int argc, char **argv)` - *ui_layout_free(&lay); hp_free(text); if (title) { hp_free(title); } return 0L; } /** Host harness entry for pure backend logic plus engine linkage. int freedomui_host_entry(FreedomUiConfig *c) { return (int)freedomui_host_probe(c); } #else /** Guest entry point shared by the MiniFS binary.*
- `net_dns_resolve` (line 44) `int net_dns_resolve(const char *host);`
- `tls_handshake` (line 45) `int tls_handshake(int fd, char *host);`
- `tls_send` (line 46) `int tls_send(int fd, char *buf, int len);`
- `tls_recv` (line 47) `int tls_recv(int fd, char *buf, int len);`
- `tls_close` (line 48) `void tls_close(int fd);`

**Macros:**
- `FUI_COLS` (line 51) `#define FUI_COLS`
- `FUI_TEXT_ROWS` (line 52) `#define FUI_TEXT_ROWS`
- `FUI_BODY_CAP` (line 53) `#define FUI_BODY_CAP`
- `FUI_HDR_MAX` (line 54) `#define FUI_HDR_MAX`
- `FUI_NET_BUF` (line 55) `#define FUI_NET_BUF`
- `FUI_REQ_MAX` (line 56) `#define FUI_REQ_MAX`
- `FUI_HOST_MAX` (line 57) `#define FUI_HOST_MAX`
- `FUI_PATH_MAX` (line 58) `#define FUI_PATH_MAX`
- `FUI_URL_MAX` (line 59) `#define FUI_URL_MAX`
- `FUI_HOPS_MAX` (line 60) `#define FUI_HOPS_MAX`
- `FUI_FONT_W` (line 61) `#define FUI_FONT_W`
- `FUI_FONT_H` (line 62) `#define FUI_FONT_H`
- `FUI_TITLE_MAX` (line 63) `#define FUI_TITLE_MAX`

**Structs:**
- `FreedomUiConfig` (line 69) - *#define FUI_NET_BUF 768L #define FUI_REQ_MAX 768L #define FUI_HOST_MAX 64L #define FUI_PATH_MAX 128L #define FUI_URL_MAX 512L #define FUI_HOPS_MAX 3L #define FUI_FONT_W 8L #define FUI_FONT_H 8L #define FUI_TITLE_MAX 31L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Centralized configuration for the MiniOS backend.*

**Type_Aliases:**
- `present_buf` (line 69) `typedef struct FreedomUiConfig { long present_buf;` - *#define FUI_NET_BUF 768L #define FUI_REQ_MAX 768L #define FUI_HOST_MAX 64L #define FUI_PATH_MAX 128L #define FUI_URL_MAX 512L #define FUI_HOPS_MAX 3L #define FUI_FONT_W 8L #define FUI_FONT_H 8L #define FUI_TITLE_MAX 31L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Centralized configuration for the MiniOS backend.*

#### `media_unavailable.c`
**Path:** `progs/freedomui/media_unavailable.c`
**File Doc:** *media_unavailable.c - FreeDom media decoder entry points for a build*

**Functions:**
- `write_all` (line 20) `static void write_all(int fd, const void *buf, size_t len)` - *closed: no decoder process is ever started, and a direct --media-decoder invocation answers with one MD_ERROR and exits.  #include <errno.h> #include <stdint.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include "media_decoder.h" static const char media_unavailable_msg[] = "media decoding is not available on MiniOS"; /** Writes all of buf, retrying on short writes; stops on error.*
- `media_decoder_run` (line 41) `void media_decoder_run(int out_fd, int cmd_fd)` - *Refuses to start a decoder: the caller reports the failure and stays * responsive (browser_ui video_play already handles a failed spawn). int media_decoder_spawn(pid_t *pid, int *out_fd, int *cmd_fd) { (void)pid; (void)out_fd; (void)cmd_fd; errno = ENOSYS; return -1; } /** --media-decoder entry: one non-fatal MD_ERROR, then exit.*

#### `platform_minios.c`
**Path:** `progs/freedomui/platform_minios.c`
**File Doc:** *platform_minios.c - MiniOS implementation of FreeDom's gui/platform.h.*

**Functions:**
- `sys_fb_info_rgb` (line 83) `static long sys_fb_info_rgb(int *rgb)`
- `now_ms` (line 94) `static long now_ms(void)`
- `set_title` (line 98) `static void set_title(const char *title)`
- `pf_display_open` (line 137) `pf_status pf_display_open(pf_display **out)`
- `pf_display_close` (line 153) `void pf_display_close(pf_display *d)`
- `pf_display_flush` (line 162) `void pf_display_flush(pf_display *d)`
- `pf_display_set_cursor` (line 166) `void pf_display_set_cursor(pf_display *d, pf_cursor c)`
- `deliver_pending` (line 173) `static int deliver_pending(pf_display *d)`
- `key_event` (line 183) `static void key_event(pf_display *d, const ps2_key *k, int kind)`
- `pump_keyboard` (line 210) `static int pump_keyboard(pf_display *d)`
- `pump_mouse` (line 224) `static int pump_mouse(pf_display *d)`
- `pf_display_wait` (line 268) `int pf_display_wait(pf_display *d, struct pollfd *extra, int n, int timeout_ms)`
- `pf_clipboard_available` (line 293) `int pf_clipboard_available(const pf_display *d)`
- `pf_clipboard_set_text` (line 297) `pf_status pf_clipboard_set_text(pf_display *d, const char *text)`
- `pf_clipboard_get_text` (line 304) `pf_status pf_clipboard_get_text(pf_display *d, char **out, size_t *out_len)`
- `pf_window_open` (line 320) `pf_status pf_window_open(pf_display *d, const pf_window_opts *o,
                         const p...`
- `pf_window_close` (line 342) `void pf_window_close(pf_window *w)`
- `pf_window_surface` (line 359) `cairo_surface_t *pf_window_surface(pf_window *w, int width, int height)`
- `pf_window_present` (line 374) `void pf_window_present(pf_window *w)`
- `pf_window_set_title` (line 408) `void pf_window_set_title(pf_window *w, const char *title)`
- `set_zoom_state` (line 414) `static void set_zoom_state(pf_window *w, unsigned bit, int on)`
- `pf_window_set_maximized` (line 424) `void pf_window_set_maximized(pf_window *w, int on)`
- `pf_window_set_fullscreen` (line 428) `void pf_window_set_fullscreen(pf_window *w, int on)`
- `pf_window_minimize` (line 432) `void pf_window_minimize(pf_window *w)`
- `pf_window_begin_move` (line 436) `void pf_window_begin_move(pf_window *w)`
- `pf_window_begin_resize` (line 440) `void pf_window_begin_resize(pf_window *w, pf_edge edge)`

**Macros:**
- `_GNU_SOURCE` (line 11) `#define _GNU_SOURCE`
- `FREEDOM_GUI_TICK_MS` (line 27) `#define FREEDOM_GUI_TICK_MS`
- `FREEDOM_GUI_KBD_DRAIN_MAX` (line 29) `#define FREEDOM_GUI_KBD_DRAIN_MAX`
- `FREEDOM_GUI_TITLE_MAX` (line 31) `#define FREEDOM_GUI_TITLE_MAX`
- `FREEDOM_GUI_CLIP_MAX` (line 33) `#define FREEDOM_GUI_CLIP_MAX`
- `FREEDOM_GUI_MALLOC_ARENAS` (line 35) `#define FREEDOM_GUI_MALLOC_ARENAS`
- `FREEDOM_GUI_MOUSE_WORDS` (line 38) `#define FREEDOM_GUI_MOUSE_WORDS`
- `FREEDOM_GUI_MOUSE_X` (line 39) `#define FREEDOM_GUI_MOUSE_X`
- `FREEDOM_GUI_MOUSE_Y` (line 40) `#define FREEDOM_GUI_MOUSE_Y`
- `FREEDOM_GUI_MOUSE_BUTTONS` (line 41) `#define FREEDOM_GUI_MOUSE_BUTTONS`
- `FREEDOM_GUI_MOUSE_WHEEL` (line 42) `#define FREEDOM_GUI_MOUSE_WHEEL`
- `FREEDOM_GUI_BUTTONS` (line 44) `#define FREEDOM_GUI_BUTTONS`
- `FREEDOM_GUI_KEY_F4` (line 46) `#define FREEDOM_GUI_KEY_F4`
- `FREEDOM_GUI_RGB_BPP` (line 48) `#define FREEDOM_GUI_RGB_BPP`
- `FREEDOM_GUI_RGB_PRESENT` (line 50) `#define FREEDOM_GUI_RGB_PRESENT`

**Structs:**
- `pf_window` (line 56)
- `pf_display` (line 68)
- `minios_process_note` (line 124) - *Run as a process, never in the shell's pid-0 exec frame: the browser's fetch threads, renderer fork and /proc/self/exe tab workers need real * process semantics (minios_abi.h, process note).*

#### `ps2_keymap.c`
**Path:** `progs/freedomui/ps2_keymap.c`
**File Doc:** *ps2_keymap.c - pure PS/2 set 1 scancode to keysym translator (US layout).*

**Functions:**
- `ps2_init` (line 144) `void ps2_init(ps2_state *s)`
- `held_mods` (line 150) `static unsigned held_mods(const ps2_state *s)`
- `set_text` (line 158) `static void set_text(ps2_key *k, char c)`
- `is_letter` (line 164) `static int is_letter(char c)`
- `modifier_key` (line 169) `static uint32_t modifier_key(ps2_state *s, unsigned code, int extended, int make)` - *return m; } static void set_text(ps2_key *k, char c) { k->text[0] = c; k->text[1] = '\0'; k->text_len = 1; } static int is_letter(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } /* Modifier and lock keys: update the held state; returns the keysym or 0.*
- `extended_key` (line 195) `static uint32_t extended_key(unsigned code, ps2_key *k)` - *if (make) s->caps_lock = !s->caps_lock; return KE_KEY_Caps_Lock; } else if (!extended && code == SC_NUMLOCK) { if (make) s->num_lock = !s->num_lock; return KS_NUM_LOCK; } else { return 0; } if (make) s->held |= bit; else      s->held &= ~bit; return sym; } /* Keys behind E0 that are not modifiers.*
- `plain_key` (line 218) `static uint32_t plain_key(const ps2_state *s, unsigned code, ps2_key *k)` - *case SC_E0_RIGHT:  return KE_KEY_Right; case SC_E0_END:    return KE_KEY_End; case SC_E0_DOWN:   return KE_KEY_Down; case SC_E0_NEXT:   return KE_KEY_Page_Down; case SC_E0_INSERT: return KS_INSERT; case SC_E0_DELETE: set_text(k, (char)ASCII_DEL); return KE_KEY_Delete; case SC_E0_SUPERL: return KS_SUPER_L; case SC_E0_SUPERR: return KS_SUPER_R; case SC_E0_MENU:   return KS_MENU; default:           return 0; } } /* Keys without a prefix that are not modifiers.*
- `ps2_feed` (line 253) `int ps2_feed(ps2_state *s, uint8_t byte, ps2_key *out)`

**Macros:**
- `PS2_PREFIX_EXTENDED` (line 13) `#define PS2_PREFIX_EXTENDED`
- `PS2_PREFIX_PAUSE` (line 14) `#define PS2_PREFIX_PAUSE`
- `PS2_PAUSE_TAIL` (line 15) `#define PS2_PAUSE_TAIL`
- `PS2_BREAK_BIT` (line 16) `#define PS2_BREAK_BIT`
- `PS2_CODE_MASK` (line 17) `#define PS2_CODE_MASK`
- `PS2_TABLE_SIZE` (line 18) `#define PS2_TABLE_SIZE`
- `PS2_HELD_LSHIFT` (line 20) `#define PS2_HELD_LSHIFT`
- `PS2_HELD_RSHIFT` (line 21) `#define PS2_HELD_RSHIFT`
- `PS2_HELD_LCTRL` (line 22) `#define PS2_HELD_LCTRL`
- `PS2_HELD_RCTRL` (line 23) `#define PS2_HELD_RCTRL`
- `PS2_HELD_LALT` (line 24) `#define PS2_HELD_LALT`
- `PS2_HELD_RALT` (line 25) `#define PS2_HELD_RALT`
- `SC_ESCAPE` (line 27) `#define SC_ESCAPE`
- `SC_BACKSPACE` (line 28) `#define SC_BACKSPACE`
- `SC_TAB` (line 29) `#define SC_TAB`
- `SC_RETURN` (line 30) `#define SC_RETURN`
- `SC_CTRL` (line 31) `#define SC_CTRL`
- `SC_LSHIFT` (line 32) `#define SC_LSHIFT`
- `SC_RSHIFT` (line 33) `#define SC_RSHIFT`
- `SC_KP_MUL` (line 34) `#define SC_KP_MUL`
- `SC_ALT` (line 35) `#define SC_ALT`
- `SC_CAPS` (line 36) `#define SC_CAPS`
- `SC_F1` (line 37) `#define SC_F1`
- `SC_F10` (line 38) `#define SC_F10`
- `SC_NUMLOCK` (line 39) `#define SC_NUMLOCK`
- `SC_SCROLL` (line 40) `#define SC_SCROLL`
- `SC_KP_FIRST` (line 41) `#define SC_KP_FIRST`
- `SC_KP_LAST` (line 42) `#define SC_KP_LAST`
- `SC_F11` (line 43) `#define SC_F11`
- `SC_F12` (line 44) `#define SC_F12`
- `SC_E0_KP_DIV` (line 45) `#define SC_E0_KP_DIV`
- `SC_E0_PRINT` (line 46) `#define SC_E0_PRINT`
- `SC_E0_HOME` (line 47) `#define SC_E0_HOME`
- `SC_E0_UP` (line 48) `#define SC_E0_UP`
- `SC_E0_PRIOR` (line 49) `#define SC_E0_PRIOR`
- `SC_E0_LEFT` (line 50) `#define SC_E0_LEFT`
- `SC_E0_RIGHT` (line 51) `#define SC_E0_RIGHT`
- `SC_E0_END` (line 52) `#define SC_E0_END`
- `SC_E0_DOWN` (line 53) `#define SC_E0_DOWN`
- `SC_E0_NEXT` (line 54) `#define SC_E0_NEXT`
- `SC_E0_INSERT` (line 55) `#define SC_E0_INSERT`
- `SC_E0_DELETE` (line 56) `#define SC_E0_DELETE`
- `SC_E0_SUPERL` (line 57) `#define SC_E0_SUPERL`
- `SC_E0_SUPERR` (line 58) `#define SC_E0_SUPERR`
- `SC_E0_MENU` (line 59) `#define SC_E0_MENU`
- `KS_F1` (line 61) `#define KS_F1`
- `KS_F11` (line 62) `#define KS_F11`
- `KS_INSERT` (line 63) `#define KS_INSERT`
- `KS_PRINT` (line 64) `#define KS_PRINT`
- `KS_MENU` (line 65) `#define KS_MENU`
- `KS_SCROLL_LOCK` (line 66) `#define KS_SCROLL_LOCK`
- `KS_NUM_LOCK` (line 67) `#define KS_NUM_LOCK`
- `KS_SUPER_L` (line 68) `#define KS_SUPER_L`
- `KS_SUPER_R` (line 69) `#define KS_SUPER_R`
- `KS_KP_HOME` (line 70) `#define KS_KP_HOME`
- `KS_KP_LEFT` (line 71) `#define KS_KP_LEFT`
- `KS_KP_UP` (line 72) `#define KS_KP_UP`
- `KS_KP_RIGHT` (line 73) `#define KS_KP_RIGHT`
- `KS_KP_DOWN` (line 74) `#define KS_KP_DOWN`
- `KS_KP_PRIOR` (line 75) `#define KS_KP_PRIOR`
- `KS_KP_NEXT` (line 76) `#define KS_KP_NEXT`
- `KS_KP_END` (line 77) `#define KS_KP_END`
- `KS_KP_BEGIN` (line 78) `#define KS_KP_BEGIN`
- `KS_KP_INSERT` (line 79) `#define KS_KP_INSERT`
- `KS_KP_MULTIPLY` (line 80) `#define KS_KP_MULTIPLY`
- `KS_KP_DECIMAL` (line 81) `#define KS_KP_DECIMAL`
- `KS_KP_DIVIDE` (line 82) `#define KS_KP_DIVIDE`
- `ASCII_BS` (line 84) `#define ASCII_BS`
- `ASCII_TAB` (line 85) `#define ASCII_TAB`
- `ASCII_CR` (line 86) `#define ASCII_CR`
- `ASCII_ESC` (line 87) `#define ASCII_ESC`
- `ASCII_DEL` (line 88) `#define ASCII_DEL`

**Structs:**
- `ps2_keypad` (line 122) - *[0x07] = '^', [0x08] = '&', [0x09] = '*', [0x0A] = '(', [0x0B] = ')', [0x0C] = '_', [0x0D] = '+', [0x10] = 'Q', [0x11] = 'W', [0x12] = 'E', [0x13] = 'R', [0x14] = 'T', [0x15] = 'Y', [0x16] = 'U', [0x17] = 'I', [0x18] = 'O', [0x19] = 'P', [0x1A] = '{', [0x1B] = '}', [0x1E] = 'A', [0x1F] = 'S', [0x20] = 'D', [0x21] = 'F', [0x22] = 'G', [0x23] = 'H', [0x24] = 'J', [0x25] = 'K', [0x26] = 'L', [0x27] = ':', [0x28] = '"', [0x29] = '~', [0x2B] = '|', [0x2C] = 'Z', [0x2D] = 'X', [0x2E] = 'C', [0x2F] = 'V', [0x30] = 'B', [0x31] = 'N', [0x32] = 'M', [0x33] = '<', [0x34] = '>', [0x35] = '?', [0x39] = ' ', }; /* Keypad 0x47..0x53: keysym and text with Num Lock on, keysym with it off.*

**Type_Aliases:**
- `num_sym` (line 122) `typedef struct ps2_keypad { uint32_t num_sym;` - *[0x07] = '^', [0x08] = '&', [0x09] = '*', [0x0A] = '(', [0x0B] = ')', [0x0C] = '_', [0x0D] = '+', [0x10] = 'Q', [0x11] = 'W', [0x12] = 'E', [0x13] = 'R', [0x14] = 'T', [0x15] = 'Y', [0x16] = 'U', [0x17] = 'I', [0x18] = 'O', [0x19] = 'P', [0x1A] = '{', [0x1B] = '}', [0x1E] = 'A', [0x1F] = 'S', [0x20] = 'D', [0x21] = 'F', [0x22] = 'G', [0x23] = 'H', [0x24] = 'J', [0x25] = 'K', [0x26] = 'L', [0x27] = ':', [0x28] = '"', [0x29] = '~', [0x2B] = '|', [0x2C] = 'Z', [0x2D] = 'X', [0x2E] = 'C', [0x2F] = 'V', [0x30] = 'B', [0x31] = 'N', [0x32] = 'M', [0x33] = '<', [0x34] = '>', [0x35] = '?', [0x39] = ' ', }; /* Keypad 0x47..0x53: keysym and text with Num Lock on, keysym with it off.*

#### `lisp.c`
**Path:** `progs/lisp/lisp.c`

**Enums:**
- `LispConfig` (line 41) - *Central configuration for every bound in the interpreter.  No other literal below controls a limit, a port, a syscall number or a user-visible string twice; edits happen here. Every array sized by one of these constants below (open_files[], argv[], message[]) MUST spell the constant, not the number, so this enum stays the single source of truth it claims to be.*

**Functions:**
- `lisp_version` (line 62) `static const char *lisp_version(void)` - *Version string printed by --version and the REPL banner.*
- `msys` (line 205) `static long msys(long n, long a1, long a2, long a3)` - *Raw 3-argument syscall through the x86-64 Linux ABI.*
- `msys5` (line 218) `static long msys5(long n, long a1, long a2, long a3, long a4, long a5)` - *Raw 5-argument syscall for SYS_SPAWN with path, redirect, argc, argv.*
- `fatal` (line 233) `static void fatal(Runtime *rt, const char *message)` - *Report a fatal internal failure and terminate the process.*
- `xalloc` (line 242) `static void *xalloc(Runtime *rt, size_t size)` - *Allocate zeroed tracked memory that frees with the runtime.*
- `xstrdup` (line 266) `static char *xstrdup(Runtime *rt, const char *source)` - *Duplicate a string into tracked memory.*
- `make_node` (line 284) `static Node *make_node(Runtime *rt, NodeType type)` - *Allocate a node of the given type in tracked memory.*
- `make_error` (line 293) `static Node *make_error(Runtime *rt, const char *message)` - *Build an error value carrying a diagnostic message.*
- `make_num` (line 302) `static Node *make_num(Runtime *rt, int64_t value)` - *Build a numeric value node.*
- `make_str` (line 311) `static Node *make_str(Runtime *rt, const char *value)` - *Build a string value node from a NUL-terminated source.*
- `make_sym` (line 320) `static Node *make_sym(Runtime *rt, const char *value)` - *Build a symbol value node from a NUL-terminated name.*
- `make_prim` (line 329) `static Node *make_prim(Runtime *rt, PrimFn function)` - *Build a primitive function value node.*
- `cons` (line 338) `static Node *cons(Runtime *rt, Node *car, Node *cdr)` - *Build a cons cell from two values.*
- `is_nil` (line 348) `static bool is_nil(Runtime *rt, const Node *node)` - *Test whether a node is the empty list in any of its spellings.*
- `make_file` (line 355) `static Node *make_file(Runtime *rt, FILE *handle)` - *Register an open FILE handle and wrap it in a file value node.*
- `cleanup` (line 377) `static void cleanup(Runtime *rt)` - *Close every tracked file and release every tracked allocation.*
- `runtime_init` (line 399) `static void runtime_init(Runtime *rt)` - *Initialize a runtime with streams, constants and empty tables.*
- `env_new` (line 411) `static Env *env_new(Runtime *rt, Env *parent)` - *Allocate a new environment frame with an optional parent.*
- `env_bind` (line 421) `static void env_bind(Runtime *rt, Env *env, Node *symbol, Node *value)` - *Bind a symbol to a value in the innermost frame.*
- `env_set` (line 432) `static bool env_set(Env *env, Node *symbol, Node *value)` - *Update the nearest visible binding of a symbol.*
- `env_lookup` (line 454) `static Node *env_lookup(Env *env, Node *symbol)` - *Resolve the nearest visible binding of a symbol.*
- `reader_peek` (line 475) `static char reader_peek(const Reader *reader)` - *Peek at the current reader character without consuming it.*
- `reader_next` (line 482) `static char reader_next(Reader *reader)` - *Consume one reader character and track line and column.*
- `reader_at_end` (line 500) `static bool reader_at_end(const Reader *reader)` - *Test whether the reader reached the end of its buffer.*
- `skip_space_and_comments` (line 507) `static void skip_space_and_comments(Reader *reader)` - *Skip whitespace and line comments starting with a semicolon.*
- `sb_init` (line 523) `static void sb_init(StringBuilder *builder)` - *Initialize a string builder with a bounded initial capacity.*
- `sb_push` (line 536) `static void sb_push(StringBuilder *builder, char value)` - *Append one byte to a string builder with overflow-checked growth.*
- `parse_ok` (line 562) `static ParseResult parse_ok(Node *value)` - *Build a successful parse result.*
- `parse_eof` (line 573) `static ParseResult parse_eof(void)` - *Build an end-of-input parse result.*
- `parse_error` (line 584) `static ParseResult parse_error(const char *message)` - *Build a parse error result with a bounded message.*
- `read_list` (line 596) `static ParseResult read_list(Runtime *rt, Reader *reader)` - *Read a parenthesized list terminated by a closing paren.*
- `read_string` (line 626) `static ParseResult read_string(Runtime *rt, Reader *reader)` - *Read a double-quoted string with backslash escapes.*
- `token_delimiter` (line 677) `static bool token_delimiter(char c)` - *Test whether a character terminates an atom token.*
- `read_atom` (line 685) `static ParseResult read_atom(Runtime *rt, Reader *reader)` - *Read a number, nil, t or symbol token.*
- `read_expr` (line 721) `static ParseResult read_expr(Runtime *rt, Reader *reader)` - *Read one expression, skipping whitespace and comments first.*
- `list_count` (line 750) `static size_t list_count(Runtime *rt, Node *list, bool *proper)` - *Count proper list elements and report whether the spine is proper.*
- `has_arity` (line 767) `static bool has_arity(Runtime *rt, Node *args, size_t expected)` - *Test whether an argument list has exactly the expected length.*
- `arg_at` (line 775) `static Node *arg_at(Runtime *rt, Node *args, size_t index)` - *Fetch the positional argument at an index or NULL when absent.*
- `arg_matches` (line 815) `static bool arg_matches(const Node *value, ArgKind kind)` - *Test whether an already-fetched argument matches one ArgKind.*
- `check_args` (line 841) `static bool check_args(Runtime *rt, Node *args, const ArgKind *kinds,
    size_t n, Node **out)` - *Validate that args is a proper list of exactly n elements whose types match kinds[0..n), writing each fetched argument into out[0..n).  Returns false (out[] left untouched) on any mismatch; the caller's one job on failure is to pick the error message, since that is the only part that legitimately differs between primitives.*
- `arity0` (line 861) `static bool arity0(Runtime *rt, Node *args)` - *Validate that args is the empty argument list.*
- `prim_add` (line 869) `static Node *prim_add(Runtime *rt, Node *args)` - *Add two numbers with overflow reported as an error value.*
- `prim_sub` (line 885) `static Node *prim_sub(Runtime *rt, Node *args)` - *Subtract two numbers with overflow reported as an error value.*
- `prim_mul` (line 901) `static Node *prim_mul(Runtime *rt, Node *args)` - *Multiply two numbers with overflow reported as an error value.*
- `prim_div` (line 917) `static Node *prim_div(Runtime *rt, Node *args)` - *Divide two numbers with zero and overflow reported as errors.*
- `prim_eq` (line 939) `static Node *prim_eq(Runtime *rt, Node *args)` - *Compare two numbers for equality.*
- `prim_lt` (line 951) `static Node *prim_lt(Runtime *rt, Node *args)` - *Compare two numbers with less-than.*
- `prim_car` (line 963) `static Node *prim_car(Runtime *rt, Node *args)` - *Return the first element of a cons cell or nil.*
- `prim_cdr` (line 975) `static Node *prim_cdr(Runtime *rt, Node *args)` - *Return the rest of a cons cell or nil.*
- `prim_cons` (line 987) `static Node *prim_cons(Runtime *rt, Node *args)` - *Build a cons cell from two values.*
- `prim_string_concat` (line 999) `static Node *prim_string_concat(Runtime *rt, Node *args)` - *Concatenate two strings with an overflow-checked allocation.*
- `prim_string_eq` (line 1026) `static Node *prim_string_eq(Runtime *rt, Node *args)` - *Compare two strings for equality.*
- `prim_string_length` (line 1038) `static Node *prim_string_length(Runtime *rt, Node *args)` - *Return the byte length of a string.*
- `prim_string_at` (line 1050) `static Node *prim_string_at(Runtime *rt, Node *args)` - *Return the one-character string at a byte index or nil when out of range.*
- `prim_char_code` (line 1072) `static Node *prim_char_code(Runtime *rt, Node *args)` - *Convert between a one-character string and its byte value.*
- `prim_print` (line 1094) `static Node *prim_print(Runtime *rt, Node *args)` - *Print a value without a trailing newline.*
- `prim_println` (line 1108) `static Node *prim_println(Runtime *rt, Node *args)` - *Print a value with a trailing newline.*
- `file_mode_allowed` (line 1123) `static bool file_mode_allowed(const char *mode)` - *Test whether a file mode string belongs to the safe whitelist.*
- `prim_read_char` (line 1183) `static Node *prim_read_char(Runtime *rt, Node *args)` - *Read one byte from a file or nil at end of file.*
- `prim_write` (line 1200) `static Node *prim_write(Runtime *rt, Node *args)` - *Write a string or byte value to an open file.*
- `prim_close_file` (line 1224) `static Node *prim_close_file(Runtime *rt, Node *args)` - *Close an open file and release its runtime slot.*
- `prim_null_p` (line 1249) `static Node *prim_null_p(Runtime *rt, Node *args)` - *Test whether a value is nil.*
- `prim_number_p` (line 1261) `static Node *prim_number_p(Runtime *rt, Node *args)` - *Test whether a value is a number.*
- `prim_string_p` (line 1273) `static Node *prim_string_p(Runtime *rt, Node *args)` - *Test whether a value is a string.*
- `prim_error_message` (line 1285) `static Node *prim_error_message(Runtime *rt, Node *args)` - *Return the message of an error value or nil for other values.*
- `prim_exit` (line 1303) `static Node *prim_exit(Runtime *rt, Node *args)` - *Terminate the process with a numeric exit status.  Variable arity (0 or 1); stays outside check_args() for the same reason open-file does.*
- `prim_time_ms` (line 1330) `static Node *prim_time_ms(Runtime *rt, Node *args)` - *Return milliseconds since boot through the kernel time service.*
- `prim_rtc` (line 1340) `static Node *prim_rtc(Runtime *rt, Node *args)` - *Return the clock time as a three-element list or nil when unavailable.*
- `prim_fb_info` (line 1357) `static Node *prim_fb_info(Runtime *rt, Node *args)` - *Return framebuffer width, height and pitch or nil when unavailable.*
- `prim_vol` (line 1377) `static Node *prim_vol(Runtime *rt, Node *args)` - *Read or set the speaker volume, clamped to the valid range.  Variable arity (0 or 1); stays outside check_args() for the same reason open-file does.*
- `prim_pal` (line 1405) `static Node *prim_pal(Runtime *rt, Node *args)` - *Load a 768-byte VGA palette from a string value.*
- `prim_pcspeaker` (line 1421) `static Node *prim_pcspeaker(Runtime *rt, Node *args)` - *Play a speaker tone for a bounded millisecond duration.*
- `prim_minios_run` (line 1465) `static Node *prim_minios_run(Runtime *rt, Node *args)` - *Run a program through SYS_SPAWN and return its exit code.*
- `eval_list` (line 1527) `static Node *eval_list(Runtime *rt, Node *list, Env *env)` - *Evaluate every element of a list into a fresh proper list.  Error results travel as ordinary values so programs can inspect them with error-message; only a hard evaluation failure aborts the walk.*
- `eval_sequence` (line 1551) `static Node *eval_sequence(Runtime *rt, Node *body, Env *env)` - *Evaluate a body sequence and return the last value.*
- `valid_params` (line 1569) `static bool valid_params(Runtime *rt, Node *params)` - *Test whether a parameter list holds only symbols.*
- `eval` (line 1583) `static Node *eval(Runtime *rt, Node *expression, Env *env)` - *Evaluate an expression with tail-call reuse and a bounded depth.*
- `print_escaped_string` (line 1846) `static void print_escaped_string(FILE *out, const char *value)` - *Write a string with escape sequences for readable output.*
- `print_node` (line 1877) `static void print_node(Runtime *rt, Node *node, bool readable)` - *Print a value in readable or display form with a bounded depth.*
- `bind_primitive` (line 1948) `static void bind_primitive(Runtime *rt, Env *env, const char *name,
    PrimFn function)` - *Register one named primitive in an environment frame.*
- `init_env` (line 2004) `static Env *init_env(Runtime *rt)` - *Build the global environment with arithmetic, strings, files and MiniOS.*
- `bind_argv` (line 2017) `static void bind_argv(Runtime *rt, Env *env, int argc, char **argv, int first)` - *Expose the script argument vector as a proper list of strings.*
- `read_all_file` (line 2029) `static char *read_all_file(const char *filename, size_t max_bytes)` - *Read a whole file into memory with a hard size cap.*
- `process_source` (line 2087) `static int process_source(Runtime *rt, const char *source,
    const char *source_name, bool echo)` - *Evaluate every form in a source buffer and report the first failure.*
- `process_inline` (line 2129) `static int process_inline(Runtime *rt, const char *code)` - *Evaluate one inline expression from the -e flag.*
- `print_usage` (line 2136) `static void print_usage(Runtime *rt)` - *Print usage for the command line interface.*
- `repl` (line 2143) `static int repl(Runtime *rt)` - *Run the interactive read-eval loop on the runtime input stream.*
- `main` (line 2190) `int main(int argc, char **argv)` - *Entry point with -e, script and REPL modes plus bounded arguments.*
- `numbers` (line 9) `* * Language surface: numbers (int64), strings, symbols, cons cells, closures * with lexical scope, and the special forms quote, if, begin, define, set!, * lambda and let. Diagnostics go to stderr, va`
- `arity` (line 1300) `* * Variable arity (0 or 1);`

**Structs:**
- `Node` (line 113) - *Runtime value node with one payload per type.*
- `Binding` (line 140) - *Single name binding inside an environment frame.*
- `Env` (line 149) - *Lexical environment frame with a parent chain.*
- `AllocTracker` (line 157) - *Allocation record so the whole heap frees at exit.*
- `Runtime` (line 165) - *Interpreter runtime with globals, streams and resource tables.*
- `ParseResult` (line 104) - *Result of a single read step with a bounded diagnostic.*
- `Reader` (line 181) - *Character cursor over an immutable source buffer.*
- `StringBuilder` (line 192) - *Growable byte buffer for tokens and strings.*
- `PrimEntry` (line 1960) - *========================================================================= Primitive registry ========================================================================= A flat name -> function table instead of ~30 repeated bind_primitive() calls. Adding a builtin is now one row here; init_env() itself never needs to change again to register it. * =========================================================================*

**Type_Aliases:**
- `Runtime` (line 65) `typedef struct Runtime Runtime;`
- `Node` (line 67) `typedef struct Node Node;`
- `Env` (line 68) `typedef struct Env Env;`
- `Binding` (line 69) `typedef struct Binding Binding;`
- `AllocTracker` (line 70) `typedef struct AllocTracker AllocTracker;`

#### `tin.c`
**Path:** `progs/lisp/tin.c`

**Functions:**
- `main` (line 1) `int main()`

#### `lua_main.c`
**Path:** `progs/lua/lua_main.c`

**Functions:**
- `luaL_require_global` (line 22) `static void luaL_require_global(lua_State *L, const char *name,
                                l...`
- `set_arg_table` (line 28) `static void set_arg_table(lua_State *L, int argc, char **argv, int first)`
- `docode` (line 41) `static int docode(lua_State *L, const char *code)`
- `dofile` (line 51) `static int dofile(lua_State *L, const char *name)`
- `repl` (line 61) `static int repl(lua_State *L)`
- `main` (line 105) `int main(int argc, char **argv)`
- `module` (line 5) `* C module (minios.c) can be registered globally before any script runs: * `minios.run(...)`, `minios.time_ms()`, etc. are available as a plain global * table, exactly like `import minios` in MicroPyt`

#### `minios.c`
**Path:** `progs/lua/minios.c`

**Functions:**
- `msys5` (line 37) `static long msys5(long n, long a1, long a2, long a3, long a4, long a5)` - */* ── raw syscall helpers (x86-64 Linux ABI) ─────────────────────────── static long msys(long n, long a1, long a2, long a3) { long ret; __asm__ volatile( "syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), "d"(a3) : "rcx", "r11", "memory" ); return ret; } /* 5-argument syscall (SYS_SPAWN needs path, redirect, argc, argv).*
- `minios_time_ms` (line 62) `static int minios_time_ms(lua_State *L)` - *} /* ── MiniOS syscall numbers (canonical table from minios_abi.h) ─────── #include "minios_abi.h" #define SYS_TIME_MS     MINIOS_SYS_TIME #define SYS_PALETTE     MINIOS_SYS_PALETTE #define SYS_PCSPK_INIT  MINIOS_SYS_PCSPK_INIT #define SYS_PCSPK_TONE  MINIOS_SYS_PCSPK_TONE #define SYS_RTC         MINIOS_SYS_RTC #define SYS_FB_INFO     MINIOS_SYS_FB_INFO #define SYS_PCSPK_VOL   MINIOS_SYS_PCSPK_VOL #define SYS_SPAWN       MINIOS_SYS_SPAWN /* ── minios.time_ms() ────────────────────────────────────────────────*
- `minios_rtc` (line 68) `static int minios_rtc(lua_State *L)` - *#define SYS_PCSPK_INIT  MINIOS_SYS_PCSPK_INIT #define SYS_PCSPK_TONE  MINIOS_SYS_PCSPK_TONE #define SYS_RTC         MINIOS_SYS_RTC #define SYS_FB_INFO     MINIOS_SYS_FB_INFO #define SYS_PCSPK_VOL   MINIOS_SYS_PCSPK_VOL #define SYS_SPAWN       MINIOS_SYS_SPAWN /* ── minios.time_ms() ──────────────────────────────────────────────── static int minios_time_ms(lua_State *L) { lua_pushinteger(L, (lua_Integer)msys(SYS_TIME_MS, 0, 0, 0)); return 1; } /* ── minios.rtc() -> hour, minute, second ────────────────────────────*
- `minios_fb_info` (line 82) `static int minios_fb_info(lua_State *L)` - *static int minios_rtc(lua_State *L) { int h, m, s; if (msys(SYS_RTC, (long)&h, (long)&m, (long)&s) < 0) { lua_pushnil(L); lua_pushstring(L, "rtc read failed"); return 2; } lua_pushinteger(L, h); lua_pushinteger(L, m); lua_pushinteger(L, s); return 3; } /* ── minios.fb_info() -> width, height, pitch ────────────────────────*
- `minios_vol` (line 96) `static int minios_vol(lua_State *L)` - *static int minios_fb_info(lua_State *L) { int w, h, p; if (msys(SYS_FB_INFO, (long)&w, (long)&h, (long)&p) < 0) { lua_pushnil(L); lua_pushstring(L, "fb_info failed"); return 2; } lua_pushinteger(L, w); lua_pushinteger(L, h); lua_pushinteger(L, p); return 3; } /* ── minios.vol([v]) -> current volume ───────────────────────────────*
- `minios_pal` (line 109) `static int minios_pal(lua_State *L)` - */* ── minios.vol([v]) -> current volume ─────────────────────────────── static int minios_vol(lua_State *L) { if (lua_gettop(L) >= 1 && !lua_isnil(L, 1)) { int v = (int)luaL_checkinteger(L, 1); if (v < 0 || v > 100) return luaL_error(L, "volume must be 0..100"); lua_pushinteger(L, (lua_Integer)msys(SYS_PCSPK_VOL, v, 0, 0)); } else { lua_pushinteger(L, (lua_Integer)msys(SYS_PCSPK_VOL, -1, 0, 0)); } return 1; } /* ── minios.pal(buf) -- load a 768-byte VGA DAC palette ──────────────*
- `minios_pcspeaker` (line 119) `static int minios_pcspeaker(lua_State *L)` - *return 1; } /* ── minios.pal(buf) -- load a 768-byte VGA DAC palette ────────────── static int minios_pal(lua_State *L) { size_t len; const char *buf = luaL_checklstring(L, 1, &len); if (len < 768) return luaL_error(L, "palette must be 768 bytes"); msys(SYS_PALETTE, (long)buf, 0, 0); return 0; } /* ── minios.pcspeaker(freq, ms) ──────────────────────────────────────*
- `minios_run` (line 136) `static int minios_run(lua_State *L)` - *── minios.run(path[, args][, redirect]) -> exit code ─────────────── Runs a program through SYS_SPAWN (215), preserving the caller (Lua) so it can chain toolchain commands.  args is an optional Lua table of strings; * redirect is an optional output file path that captures the console output.*
- `luaopen_minios` (line 192) `int luaopen_minios(lua_State *L)`

**Macros:**
- `SYS_TIME_MS` (line 52) `#define SYS_TIME_MS`
- `SYS_PALETTE` (line 53) `#define SYS_PALETTE`
- `SYS_PCSPK_INIT` (line 54) `#define SYS_PCSPK_INIT`
- `SYS_PCSPK_TONE` (line 55) `#define SYS_PCSPK_TONE`
- `SYS_RTC` (line 56) `#define SYS_RTC`
- `SYS_FB_INFO` (line 57) `#define SYS_FB_INFO`
- `SYS_PCSPK_VOL` (line 58) `#define SYS_PCSPK_VOL`
- `SYS_SPAWN` (line 59) `#define SYS_SPAWN`

#### `minios_module.c`
**Path:** `progs/micropython/variants/minios/minios_module.c`

**Functions:**
- `msys5` (line 26) `static long msys5(long n, long a1, long a2, long a3, long a4, long a5)` - */* ── raw syscall helper (x86-64 Linux ABI) ─────────────────────────── static long msys(long n, long a1, long a2, long a3) { long ret; __asm__ volatile( "syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), "d"(a3) : "rcx", "r11", "memory" ); return ret; } /* 5-argument syscall (SYS_SPAWN needs path, redirect, argc, argv, status).*
- `minios_time_ms` (line 52) `static mp_obj_t minios_time_ms(void)`
- `minios_rtc` (line 59) `static mp_obj_t minios_rtc(void)`
- `minios_fb_info` (line 76) `static mp_obj_t minios_fb_info(void)`
- `minios_pal` (line 111) `static mp_obj_t minios_pal(mp_obj_t buf_in)`
- `minios_pcspeaker` (line 127) `static mp_obj_t minios_pcspeaker(mp_obj_t freq_in, mp_obj_t ms_in)`
- `minios_run` (line 149) `static mp_obj_t minios_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args)`
- `MP_DEFINE_CONST_FUN_OBJ_0` (line 55) `static MP_DEFINE_CONST_FUN_OBJ_0(minios_time_ms_obj, minios_time_ms);`
- `MP_DEFINE_CONST_FUN_OBJ_VAR` (line 107) `static MP_DEFINE_CONST_FUN_OBJ_VAR(minios_vol_obj, 0, minios_vol);`
- `MP_DEFINE_CONST_FUN_OBJ_1` (line 123) `static MP_DEFINE_CONST_FUN_OBJ_1(minios_pal_obj, minios_pal);`
- `MP_DEFINE_CONST_FUN_OBJ_2` (line 140) `static MP_DEFINE_CONST_FUN_OBJ_2(minios_pcspeaker_obj, minios_pcspeaker);`
- `MP_DEFINE_CONST_FUN_OBJ_KW` (line 193) `static MP_DEFINE_CONST_FUN_OBJ_KW(minios_run_obj, 1, minios_run);`
- `MP_DEFINE_CONST_DICT` (line 207) `static MP_DEFINE_CONST_DICT(minios_module_globals, minios_module_globals_table);`

**Macros:**
- `SYS_TIME_MS` (line 41) `#define SYS_TIME_MS`
- `SYS_PALETTE` (line 42) `#define SYS_PALETTE`
- `SYS_PCSPK_INIT` (line 43) `#define SYS_PCSPK_INIT`
- `SYS_PCSPK_TONE` (line 44) `#define SYS_PCSPK_TONE`
- `SYS_RTC` (line 45) `#define SYS_RTC`
- `SYS_FB_INFO` (line 46) `#define SYS_FB_INFO`
- `SYS_PCSPK_VOL` (line 47) `#define SYS_PCSPK_VOL`
- `SYS_SPAWN` (line 48) `#define SYS_SPAWN`

#### `minicraft.c`
**Path:** `progs/minicraft/minicraft.c`
**File Doc:** *minicraft.c - Minecraft-like voxel walker for MiniOS (ring 3, static ELF).*

**Functions:**
- `best_tool_for` (line 231) `static int best_tool_for(unsigned char b)`
- `break_time_ms` (line 250) `static long break_time_ms(unsigned char b, int tool)`
- `break_beep_for` (line 275) `static long break_beep_for(unsigned char b)`
- `mc_toggle_zoom` (line 316) `static void mc_toggle_zoom(void)`
- `s_time_ms` (line 337) `static long s_time_ms(void)`
- `s_kbd` (line 342) `static long s_kbd(void)`
- `s_kbd_raw` (line 347) `static long s_kbd_raw(long on)`
- `s_getc_raw` (line 359) `static long s_getc_raw(void)` - *Serial fallback for menus: SYS_KBD in raw mode carries PS/2 only, so a serial console can never drive a scancode menu (Enter, digits and arrows never arrive). GETC_RAW serves the serial side with no line buffering; translate its bytes to the scancode the menu already handles, -1 when idle. Menu-only: gameplay keeps the raw * scancode path untouched.*
- `ser_get` (line 373) `static long ser_get(void)`
- `ser_unget` (line 386) `static void ser_unget(unsigned char b)`
- `menu_ser_key` (line 391) `static long menu_ser_key(long b)`
- `kbd_drain` (line 428) `static void kbd_drain(void)` - *Drain stale scancodes (typematic repeats, a release that arrived with * its press) before leaving a menu, so they never retrigger on return.*
- `s_vga` (line 433) `static long s_vga(long on)`
- `s_pal` (line 438) `static long s_pal(const unsigned char *p)`
- `s_present` (line 443) `static long s_present(void)`
- `s_title` (line 448) `static long s_title(const char *t)`
- `s_mouse` (line 453) `static long s_mouse(int *m)`
- `s_zoom` (line 458) `static long s_zoom(long on)`
- `s_yield` (line 463) `static void s_yield(void)`
- `s_pcspk_init` (line 468) `static long s_pcspk_init(void)`
- `__attribute__` (line 473) `static long __attribute__((unused)) s_tone(long f)`
- `beep` (line 478) `static void beep(long freq, long dur_ms)`
- `pal_set` (line 497) `static void pal_set(int i, int r, int g, int b)`
- `build_palette` (line 503) `static void build_palette(void)`
- `in_world` (line 562) `static int in_world(int x, int y, int z)`
- `chunk_of` (line 577) `static int chunk_of(int v)` - *(void)x; (void)y; return z >= 0 && z < MC_H; } static unsigned int hash2(int x, int y); static unsigned int hash2_seed(int x, int y, unsigned int seed); static void gen_terrain_chunk(int slot); static void decorate_chunk(int slot); static void chunk_build_meta(int slot); static int save_chunk_file(int slot); static int load_chunk_file(int slot, int cx, int cy); /* Chunk math on unbounded coords: floor division so negatives land right.*
- `chunk_local` (line 581) `static int chunk_local(int v)`
- `chunk_lidx` (line 586) `static int chunk_lidx(int lx, int ly, int z)`
- `chunk_find` (line 592) `static int chunk_find(int cx, int cy)` - *O(1) fast path: DDA walks neighbours, so the last chunk almost always * hits; the 49-slot scan is the rare slow path, never the hot loop.*
- `world_max_recompute` (line 606) `static void world_max_recompute(void)`
- `chunk_evict_slot` (line 615) `static int chunk_evict_slot(int cx, int cy)`
- `chunk_ensure` (line 635) `static int chunk_ensure(int cx, int cy)`
- `chunk_build_meta` (line 658) `static void chunk_build_meta(int slot)`
- `col_recompute` (line 703) `static void col_recompute(int x, int y)`
- `col_top_at` (line 728) `static int col_top_at(int x, int y)`
- `light_recompute_col` (line 735) `static void light_recompute_col(int x, int y)`
- `get_b` (line 764) `static unsigned char get_b(int x, int y, int z)`
- `set_b` (line 774) `static void set_b(int x, int y, int z, unsigned char b)`
- `set_b_raw` (line 790) `static void set_b_raw(int x, int y, int z, unsigned char b)`
- `sky_light` (line 801) `static float sky_light(int x, int y, int z)` - *world_dirty = 1; } static void set_b_raw(int x, int y, int z, unsigned char b) { int s; if (z < 0 || z >= MC_H) return; s = chunk_find(chunk_of(x), chunk_of(y)); if (s < 0) return; ch_blocks[s][chunk_lidx(chunk_local(x), chunk_local(y), z)] = b; } /* skylight 1.0 at surface fading to 0.22 deep: O(1) via chunk light*
- `is_solid` (line 811) `static int is_solid(unsigned char b)`
- `in_water_at` (line 814) `static int in_water_at(float x, float y, float z)`
- `is_visible` (line 819) `static int is_visible(unsigned char b)`
- `hash2` (line 823) `static unsigned int hash2(int x, int y)`
- `hash2_seed` (line 830) `static unsigned int hash2_seed(int x, int y, unsigned int seed)`
- `mc_smoothstep` (line 839) `static float mc_smoothstep(float t)`
- `biome_fdiv` (line 846) `static int biome_fdiv(int v, int c)` - *Voronoi biome lattice: floor division so negatives land right. A smoothed (bilinear) field must NOT be thresholded here: averaging 4 uniforms * collapses the distribution and kills every biome but forest.*
- `voro_site` (line 861) `static void voro_site(int cx, int cy, unsigned int seed, int cell,
    int *sx, int *sy)`
- `biome_voro` (line 869) `static int biome_voro(int x, int y, unsigned int seed, int cell,
    int ox, int oy, unsigned int...`
- `biome_desert` (line 893) `static int biome_desert(int x, int y, unsigned int seed)`
- `biome_snow` (line 897) `static int biome_snow(int x, int y, unsigned int seed)`
- `is_cave` (line 901) `static int is_cave(int x, int y, int z, unsigned int seed)`
- `ground_h_seed` (line 909) `static int ground_h_seed(int x, int y, unsigned int seed)`
- `inv_add` (line 931) `static int inv_add(int b, int n)`
- `inv_remove` (line 945) `static int inv_remove(int b, int n)`
- `decorate_column` (line 995) `static void decorate_column(int x, int y, unsigned int seed)`
- `gen_terrain_chunk` (line 1034) `static void gen_terrain_chunk(int slot)`
- `decorate_chunk` (line 1043) `static void decorate_chunk(int slot)`
- `ensure_around_px` (line 1056) `static void ensure_around_px(float px, float py)` - *Keep a (2R+1)^2 ring of terrain around the player, an inner ring decorated, drop the rest (dirty chunks hit disk first). Runs every frame: pure cache hits when standing still, a few chunk gens on border * crossings. Coordinates are unbounded: no edge, no wall, no wrap.*
- `ensure_around` (line 1090) `static void ensure_around(void)`
- `new_world` (line 1095) `static void new_world(unsigned int seed)` - *save_chunk_file(i); ch_used[i] = 0; if (ch_cache == i) ch_cache = -1; } } world_max_recompute(); } static void ensure_around(void) { ensure_around_px(pl_x, pl_y); } /* World gen phases: 1 terrain ring 2 decor ring 3 spawn 4 mobs.*
- `mob_spawn_one` (line 1191) `static void mob_spawn_one(Pig *m, int id, int hp, long now)`
- `pig_collides` (line 1243) `static int pig_collides(float x, float y, float z)`
- `creeper_explode` (line 1257) `static void creeper_explode(Pig *c, long now)`
- `creep_sense` (line 1325) `static void creep_sense(Pig *c, float *pdx, float *pdy, float *pdz, float *pd3)` - *Creeper perception in 3D: planar delta, eye-height delta and full distance. The old code used planar distance only, so a player flying * 10 blocks overhead still lit the fuse.*
- `creep_has_los` (line 1337) `static int creep_has_los(Pig *c)` - *Voxel line of sight between creeper eyes and player eyes, sampled every half block. Walls blind the chase; open field keeps the old * behaviour byte for byte. Bounded steps, no allocation.*
- `creep_separate` (line 1361) `static void creep_separate(Pig *p, int id, float dt)` - *Herd separation: creepers inside MC_CREEP_SEP_D push apart so the pack * never stacks on one tile and every one of the 3 does not arrive glued.*
- `tick_mob` (line 1386) `static void tick_mob(Pig *p, int id, float dt, long now)`
- `tick_pigs` (line 1512) `static void tick_pigs(float dt, long now)`
- `face_color` (line 1520) `static unsigned char face_color(unsigned char b, int face)`
- `sky_color` (line 1569) `static unsigned char sky_color(float dz, float sun_dot, int x, int y, float tsec)`
- `shade_block` (line 1602) `static unsigned char shade_block(unsigned char b, int face, int bx, int by, int bz,
             ...`
- `cast_ray` (line 1659) `static RayHit cast_ray(float ox, float oy, float oz, float dx, float dy, float dz, float maxd)`
- `eye_z` (line 1750) `static float eye_z(void)`
- `mc_glyph` (line 1817) `static int mc_glyph(char ch)`
- `mc_pixel` (line 1825) `static void mc_pixel(int x, int y, unsigned char c)`
- `mc_text` (line 1831) `static void mc_text(int x, int y, const char *s, unsigned char fg)`
- `mc_text_bg` (line 1844) `static void mc_text_bg(int x, int y, const char *s, unsigned char fg, unsigned char bg)`
- `mc_block_name` (line 1857) `static const char *mc_block_name(unsigned char b)`
- `mc_facing` (line 1877) `static char mc_facing(void)`
- `cam_build` (line 1892) `static void cam_build(void)`
- `render_terrain` (line 1910) `static void render_terrain(RayHit tgt, float cyaw, float syaw, float cpit,
                      ...`
- `mob_pixel` (line 1945) `static unsigned char mob_pixel(Pig *m, int id, int px, int py, int x0, int x1, int y0, int y1)`
- `render_mob_array` (line 1979) `static void render_mob_array(Pig *arr, int n, float fx, float fy, float fz,
    float rx, float r...`
- `render_pigs` (line 2030) `static void render_pigs(float cyaw, float syaw, float cpit, float spit, float ez)`
- `render_frame` (line 2038) `static void render_frame(void)`
- `sc_hist_push` (line 2151) `static void sc_hist_push(unsigned char b)`
- `poll_kbd` (line 2162) `static void poll_kbd(void)`
- `player_collides` (line 2355) `static int player_collides(float x, float y, float z)`
- `move_x` (line 2379) `static void move_x(float nx)`
- `move_y` (line 2384) `static void move_y(float ny)`
- `move_z_abs` (line 2389) `static MoveResult move_z_abs(float nz)`
- `block_intersects_player` (line 2404) `static int block_intersects_player(int bx, int by, int bz)`
- `try_autostep` (line 2413) `static void try_autostep(float tx, float ty)`
- `hurt` (line 2424) `static void hurt(int dmg, const char *why)`
- `tick_player` (line 2449) `static void tick_player(float dt)`
- `tick_water` (line 2548) `static void tick_water(long now)`
- `tick_hunger` (line 2596) `static void tick_hunger(long now)`
- `goal_text` (line 2608) `static const char *goal_text(void)`
- `tick_goals` (line 2619) `static void tick_goals(void)`
- `tick_discover` (line 2630) `static void tick_discover(long now)`
- `tick_interact` (line 2668) `static void tick_interact(void)`
- `mc_crc32` (line 2919) `static uint32_t mc_crc32(const void *data, size_t len, uint32_t crc)`
- `save_compute_crc` (line 2932) `static uint32_t save_compute_crc(const SaveHeader *hd)`
- `chunk_path` (line 2938) `static void chunk_path(int cx, int cy, char *out, size_t n)`
- `save_chunk_file` (line 2942) `static int save_chunk_file(int slot)`
- `load_chunk_file` (line 2974) `static int load_chunk_file(int slot, int cx, int cy)`
- `save_validate_loaded` (line 3056) `static int save_validate_loaded(void)`
- `load_reset_runtime` (line 3075) `static void load_reset_runtime(void)`
- `carve_blob` (line 3108) `static void carve_blob(const unsigned char *blob)` - *Import a 64x64x32 legacy blob into chunks (0..3, 0..3), then dirty so * region files persist it. Old saves keep their world, new code owns it.*
- `load_world_legacy` (line 3137) `static int load_world_legacy(FILE *f)` - *Legacy raw save: fixed old_inv[12] layout is fragile if B_COUNT grows; * kept read-only for ancient saves, never written. Do not extend.*
- `load_apply_player` (line 3175) `static void load_apply_player(const SaveHeader *hd)`
- `load_world_v3` (line 3194) `static int load_world_v3(FILE *f, SaveHeader *hd)`
- `load_world_v2` (line 3234) `static int load_world_v2(FILE *f, SaveHeader *hd)`
- `load_world` (line 3271) `static int load_world(void)`
- `selftest` (line 3345) `static int selftest(void)`
- `census` (line 3606) `static int census(void)` - *128x128 columns (64 biome cells): a 64-wide patch covers too few * 16-block biome cells and the desert rate fluctuates wildly by area.*
- `dumpstats` (line 3670) `static int dumpstats(void)`
- `title_menu` (line 3754) `static int title_menu(int have_save, int *seed_io)`
- `pause_menu` (line 3922) `static int pause_menu(int *seed_io)` - *Pause menu on ESC (Alt+F4 still kills the process kernel-side): * 0 = resume, 1 = new world with *seed_io, 2 = save + quit to shell.*
- `main` (line 4095) `int main(int argc, char **argv)`
- `save_world` (line 330) `static int save_world(void);`

**Macros:**
- `MC_H` (line 34) `#define MC_H`
- `MC_CHUNK` (line 35) `#define MC_CHUNK`
- `MC_LOAD_R` (line 36) `#define MC_LOAD_R`
- `MC_CHUNKS` (line 37) `#define MC_CHUNKS`
- `MC_CVOL` (line 38) `#define MC_CVOL`
- `MC_COLS` (line 39) `#define MC_COLS`
- `FB_W` (line 41) `#define FB_W`
- `FB_H` (line 42) `#define FB_H`
- `BACKBUF` (line 45) `#define BACKBUF`
- `BACKBUF` (line 47) `#define BACKBUF`
- `SAVE_PATH` (line 50) `#define SAVE_PATH`
- `SAVE_TMP_PATH` (line 51) `#define SAVE_TMP_PATH`
- `MC_SAVE_MAGIC` (line 52) `#define MC_SAVE_MAGIC`
- `MC_SAVE_VERSION` (line 53) `#define MC_SAVE_VERSION`
- `MC_SAVE_CRC_SEED` (line 54) `#define MC_SAVE_CRC_SEED`
- `MC_CHUNK_MAGIC` (line 55) `#define MC_CHUNK_MAGIC`
- `MC_CHUNK_VERSION` (line 56) `#define MC_CHUNK_VERSION`
- `MC_EYE` (line 59) `#define MC_EYE`
- `MC_GRAV` (line 60) `#define MC_GRAV`
- `MC_JUMP` (line 61) `#define MC_JUMP`
- `MC_MAXFALL` (line 62) `#define MC_MAXFALL`
- `MC_SPEED` (line 63) `#define MC_SPEED`
- `MC_FLY_SPEED` (line 64) `#define MC_FLY_SPEED`
- `MC_SPRINT` (line 65) `#define MC_SPRINT`
- `MC_MOUSE` (line 66) `#define MC_MOUSE`
- `MC_REACH` (line 67) `#define MC_REACH`
- `MC_VIEW` (line 68) `#define MC_VIEW`
- `MC_DDA_STEPS` (line 69) `#define MC_DDA_STEPS`
- `MC_BREAK_MS` (line 70) `#define MC_BREAK_MS`
- `MC_BREAK_GRACE_MS` (line 71) `#define MC_BREAK_GRACE_MS`
- `MC_PLACE_MS` (line 72) `#define MC_PLACE_MS`
- `MC_WATER_GRAV` (line 73) `#define MC_WATER_GRAV`
- `MC_WATER_SINK` (line 74) `#define MC_WATER_SINK`
- `MC_WATER_SWIM` (line 75) `#define MC_WATER_SWIM`
- `MC_INV_MAX` (line 76) `#define MC_INV_MAX`
- `MC_PITCH_MAX` (line 77) `#define MC_PITCH_MAX`
- `MC_AUTOSTEP` (line 78) `#define MC_AUTOSTEP`
- `MC_HP_MAX` (line 79) `#define MC_HP_MAX`
- `MC_PIGS` (line 80) `#define MC_PIGS`
- `MC_CREEPS_MAX` (line 81) `#define MC_CREEPS_MAX`
- `MC_CREEPS_DEF` (line 82) `#define MC_CREEPS_DEF`
- `MC_CREEP_HP` (line 83) `#define MC_CREEP_HP`
- `MC_FUSE_MS` (line 84) `#define MC_FUSE_MS`
- `MC_BOOM_R` (line 85) `#define MC_BOOM_R`
- `MC_CREEP_SENSE` (line 88) `#define MC_CREEP_SENSE`
- `MC_CREEP_DZ_MAX` (line 89) `#define MC_CREEP_DZ_MAX`
- `MC_CREEP_FUSE_D` (line 90) `#define MC_CREEP_FUSE_D`
- `MC_CREEP_DEFUSE_D` (line 91) `#define MC_CREEP_DEFUSE_D`
- `MC_RESPAWN_MS` (line 98) `#define MC_RESPAWN_MS`
- `MC_CREEP_NIGHT_MS` (line 99) `#define MC_CREEP_NIGHT_MS`
- `MC_PIG_DAY_MS` (line 100) `#define MC_PIG_DAY_MS`
- `MC_NIGHT_LIGHT` (line 101) `#define MC_NIGHT_LIGHT`
- `MC_CREEP_SEP_D` (line 102) `#define MC_CREEP_SEP_D`
- `MC_PORK_HEAL` (line 103) `#define MC_PORK_HEAL`
- `MC_HUNGER_MAX` (line 104) `#define MC_HUNGER_MAX`
- `MC_HUNGER_MS` (line 105) `#define MC_HUNGER_MS`
- `MC_PIG_HP` (line 106) `#define MC_PIG_HP`
- `MC_PIG_HURT_MS` (line 107) `#define MC_PIG_HURT_MS`
- `MC_DAY_MS` (line 108) `#define MC_DAY_MS`
- `MC_SAVE_SECS` (line 109) `#define MC_SAVE_SECS`
- `MC_BAYER_N` (line 110) `#define MC_BAYER_N`
- `MC_H_BASE` (line 111) `#define MC_H_BASE`
- `MC_H_WT_DET` (line 112) `#define MC_H_WT_DET`
- `MC_H_WT_MID` (line 113) `#define MC_H_WT_MID`
- `MC_H_WT_COARSE` (line 114) `#define MC_H_WT_COARSE`
- `SC_ESC` (line 117) `#define SC_ESC`
- `SC_1` (line 118) `#define SC_1`
- `SC_9` (line 119) `#define SC_9`
- `SC_Q` (line 120) `#define SC_Q`
- `SC_W` (line 121) `#define SC_W`
- `SC_E` (line 122) `#define SC_E`
- `SC_R` (line 123) `#define SC_R`
- `SC_T` (line 124) `#define SC_T`
- `SC_U` (line 125) `#define SC_U`
- `SC_I` (line 126) `#define SC_I`
- `SC_O` (line 127) `#define SC_O`
- `SC_P` (line 128) `#define SC_P`
- `SC_J` (line 129) `#define SC_J`
- `SC_A` (line 130) `#define SC_A`
- `SC_S` (line 131) `#define SC_S`
- `SC_D` (line 132) `#define SC_D`
- `SC_F` (line 133) `#define SC_F`
- `SC_G` (line 134) `#define SC_G`
- `SC_K` (line 135) `#define SC_K`
- `SC_L` (line 136) `#define SC_L`
- `SC_C` (line 137) `#define SC_C`
- `SC_V` (line 138) `#define SC_V`
- `SC_B` (line 139) `#define SC_B`
- `SC_N` (line 140) `#define SC_N`
- `SC_ENTER` (line 141) `#define SC_ENTER`
- `SC_BACK` (line 142) `#define SC_BACK`
- `SC_0` (line 143) `#define SC_0`
- `MC_SEED_MAX` (line 144) `#define MC_SEED_MAX`
- `MC_KBD_SEQ_SPINS` (line 145) `#define MC_KBD_SEQ_SPINS`
- `SC_SPACE` (line 146) `#define SC_SPACE`
- `SC_LSHIFT` (line 147) `#define SC_LSHIFT`
- `SC_RSHIFT` (line 148) `#define SC_RSHIFT`
- `SC_CTRL` (line 149) `#define SC_CTRL`
- `EXT_UP` (line 150) `#define EXT_UP`
- `EXT_DOWN` (line 151) `#define EXT_DOWN`
- `EXT_LEFT` (line 152) `#define EXT_LEFT`
- `EXT_RIGHT` (line 153) `#define EXT_RIGHT`
- `EXT_F11` (line 154) `#define EXT_F11`
- `MOB_PIG` (line 308) `#define MOB_PIG`
- `MOB_CREEP` (line 309) `#define MOB_CREEP`
- `SER_STASH_CAP` (line 369) `#define SER_STASH_CAP`
- `MC_VORO_DESERT_CELL` (line 858) `#define MC_VORO_DESERT_CELL`
- `MC_VORO_SNOW_CELL` (line 859) `#define MC_VORO_SNOW_CELL`
- `MC_LEGACY_WORLD` (line 2916) `#define MC_LEGACY_WORLD`

**Structs:**
- `Recipe` (line 216)
- `Pig` (line 295)
- `RayHit` (line 1650)
- `SaveHeaderV3` (line 2878) - *snprintf(last_act, sizeof(last_act), "+%s", mc_block_name(nb)); } last_act_ms = now; beep(440, 50); } } last_edit_ms = now; } } } prev_buttons = m[2]; } /* Frozen v3 header (saves already on disk); v4 appends mobs_n.*
- `SaveHeader` (line 2892)
- `ChunkHeader` (line 2907)

#### `cvm_emit.c`
**Path:** `progs/nuklear/cvm_emit.c`
**File Doc:** *cvm_emit.c — node-graph to CVM bytecode compiler.*

**Functions:**
- `code` (line 8) `* exit code (OP_HALT leaves the operand-stack top as the exit status, which
 * the shell reports ...`
- `cb_push` (line 79) `static int cb_push(struct codebuf *cb, unsigned char c)`
- `cb_u32` (line 91) `static int cb_u32(struct codebuf *cb, unsigned long v)`
- `cb_i64` (line 97) `static int cb_i64(struct codebuf *cb, long long v)`
- `cb_patch_u32` (line 103) `static void cb_patch_u32(struct codebuf *cb, size_t pos, unsigned long v)`
- `cb_imm` (line 111) `static int cb_imm(struct codebuf *cb, long long v)` - *static int cb_i64(struct codebuf *cb, long long v) { for (int i = 0; i < 8; i++) if (cb_push(cb, (unsigned char)(v >> (8 * i))) < 0) return -1; return 0; } static void cb_patch_u32(struct codebuf *cb, size_t pos, unsigned long v) { cb->b[pos + 0] = (unsigned char)(v & 255); cb->b[pos + 1] = (unsigned char)((v >> 8) & 255); cb->b[pos + 2] = (unsigned char)((v >> 16) & 255); cb->b[pos + 3] = (unsigned char)((v >> 24) & 255); } /* Push an integer literal with the shortest encoding.*
- `req_inputs` (line 126) `static int req_inputs(enum cvm_node_type t)` - *if (v >= -128 && v <= 127) { if (cb_push(cb, OP_PUSH_IMM8) < 0) return -1; if (cb_push(cb, (unsigned char)(v & 0xFF)) < 0) return -1; } else if (v >= -2147483648LL && v <= 2147483647LL) { if (cb_push(cb, OP_PUSH_IMM32) < 0) return -1; if (cb_u32(cb, (unsigned long)(unsigned long long)v) < 0) return -1; } else { if (cb_push(cb, OP_PUSH_IMM64) < 0) return -1; if (cb_i64(cb, v) < 0) return -1; } return 0; } /* Number of required inputs for a node type.*
- `is_sink` (line 145) `static int is_sink(enum cvm_node_type t)`
- `topo_sort` (line 150) `static int topo_sort(const struct cvm_node *nodes, int n,
                     int *order, char *...` - *case NODE_EXIT: return 1; case NODE_IF: return 3; default: return 2; } } static int is_sink(enum cvm_node_type t) { return t == NODE_PRINT || t == NODE_PRINTS || t == NODE_EXIT; } /* ---- topological sort (Kahn, stable) ----*
- `emit_operand` (line 213) `static int emit_operand(struct codebuf *code, const struct cvm_node *nodes,
                     ...` - *Emit one operand: the wired local slot or the fallback literal. The caller * guarantees validation passed, so an open input always has use_lit set.*
- `emit_jz` (line 224) `static int emit_jz(struct codebuf *code, size_t *rel_pos)`
- `emit_jmp` (line 230) `static int emit_jmp(struct codebuf *code, size_t *rel_pos)`
- `cvm_compile` (line 236) `int cvm_compile(const struct cvm_node *nodes, int n,
                unsigned char **out, size_t ...`
- `w32` (line 491) `void w32(void *p, unsigned v)` - *size_t ft = (size_t)nf * CVM_FUNC_ENTRY_SIZE; size_t gt = (size_t)ng * CVM_GLOBAL_ENTRY_SIZE; size_t nt = (size_t)nn * CVM_NATIVE_ENTRY_SIZE; size_t st = (size_t)ns * 8; size_t code_off = CVM_MODULE_HEADER_SIZE + ft + gt + nt + st; size_t total = code_off + (size_t)cs + ds.len + (size_t)sp; unsigned char *mod = (unsigned char *)calloc(1, total); if (!mod) goto oom; mod[0] = CVM_MAGIC_0; mod[1] = CVM_MAGIC_1; mod[2] = CVM_MAGIC_2; mod[3] = CVM_MAGIC_3; mod[4] = (unsigned char)CVM_VERSION_MAJOR; mod[5] = 0;                      /* minor*
- `module` (line 3) `* * Emits a cvm2 module (format v2) from a dataflow graph. Nodes are * topologically sorted (a true DAG order, so the editor can connect nodes in * any sequence);`

**Macros:**
- `CVM_MAGIC_0` (line 29) `#define CVM_MAGIC_0`
- `CVM_MAGIC_1` (line 30) `#define CVM_MAGIC_1`
- `CVM_MAGIC_2` (line 31) `#define CVM_MAGIC_2`
- `CVM_MAGIC_3` (line 32) `#define CVM_MAGIC_3`
- `CVM_VERSION_MAJOR` (line 33) `#define CVM_VERSION_MAJOR`
- `CVM_MODULE_HEADER_SIZE` (line 34) `#define CVM_MODULE_HEADER_SIZE`
- `CVM_FUNC_ENTRY_SIZE` (line 35) `#define CVM_FUNC_ENTRY_SIZE`
- `CVM_GLOBAL_ENTRY_SIZE` (line 36) `#define CVM_GLOBAL_ENTRY_SIZE`
- `CVM_NATIVE_ENTRY_SIZE` (line 37) `#define CVM_NATIVE_ENTRY_SIZE`
- `OP_PUSH_IMM64` (line 40) `#define OP_PUSH_IMM64`
- `OP_PUSH_IMM32` (line 41) `#define OP_PUSH_IMM32`
- `OP_PUSH_IMM8` (line 42) `#define OP_PUSH_IMM8`
- `OP_PUSH_ZERO` (line 43) `#define OP_PUSH_ZERO`
- `OP_PUSH_LOCAL` (line 44) `#define OP_PUSH_LOCAL`
- `OP_STORE_LOCAL` (line 45) `#define OP_STORE_LOCAL`
- `OP_ADD` (line 46) `#define OP_ADD`
- `OP_SUB` (line 47) `#define OP_SUB`
- `OP_MUL` (line 48) `#define OP_MUL`
- `OP_DIV` (line 49) `#define OP_DIV`
- `OP_MOD` (line 50) `#define OP_MOD`
- `OP_NEG` (line 51) `#define OP_NEG`
- `OP_AND` (line 52) `#define OP_AND`
- `OP_OR` (line 53) `#define OP_OR`
- `OP_XOR` (line 54) `#define OP_XOR`
- `OP_NOT` (line 55) `#define OP_NOT`
- `OP_SHL` (line 56) `#define OP_SHL`
- `OP_SHR` (line 57) `#define OP_SHR`
- `OP_CMP_EQ` (line 58) `#define OP_CMP_EQ`
- `OP_CMP_NE` (line 59) `#define OP_CMP_NE`
- `OP_CMP_LT` (line 60) `#define OP_CMP_LT`
- `OP_CMP_LE` (line 61) `#define OP_CMP_LE`
- `OP_CMP_GT` (line 62) `#define OP_CMP_GT`
- `OP_CMP_GE` (line 63) `#define OP_CMP_GE`
- `OP_LNOT` (line 64) `#define OP_LNOT`
- `OP_JMP` (line 65) `#define OP_JMP`
- `OP_JZ` (line 66) `#define OP_JZ`
- `OP_CALL_NATIVE` (line 67) `#define OP_CALL_NATIVE`
- `OP_LEA_DATA` (line 68) `#define OP_LEA_DATA`
- `OP_HALT` (line 69) `#define OP_HALT`
- `CVM_MAX_NODES` (line 71) `#define CVM_MAX_NODES`

**Structs:**
- `codebuf` (line 73)

#### `font8x8.c`
**Path:** `progs/nuklear/font8x8.c`
**File Doc:** *font8x8 - shared 8x8 bitmap font for MiniOS ring-3 graphics programs.*

*No symbols extracted*

#### `node_editor.c`
**Path:** `progs/nuklear/node_editor.c`
**File Doc:** *node_editor.c — visual low-code editor that compiles to CVM bytecode.*

**Functions:**
- `node_inputs` (line 96) `static int node_inputs(int k)`
- `node_outputs` (line 101) `static int node_outputs(int k)`
- `kind_name` (line 106) `static const char *kind_name(int k)`
- `kind_color` (line 111) `static struct nk_color kind_color(int k)`
- `graph_clear` (line 116) `static void graph_clear(void)`
- `graph_add` (line 122) `static int graph_add(int kind)`
- `graph_del` (line 136) `static void graph_del(int idx)`
- `graph_to_compiler` (line 154) `static int graph_to_compiler(struct cvm_node *out, int cap)` - *g_count--; for (int i = 0; i < g_count; i++) for (int k = 0; k < 3; k++) { if (g_nodes[i].in[k] == idx) { g_nodes[i].in[k] = -1; } else if (g_nodes[i].in[k] > idx) { g_nodes[i].in[k]--; } } if (g_selected == idx) g_selected = -1; else if (g_selected > idx) g_selected--; } /* Map the graph into the compiler's node array. Returns node count or <0.*
- `repair_graph` (line 176) `static int repair_graph(char *rep, size_t repcap, char *herr, size_t herrcap,
                   ...` - *Pre-compile pass: repair every open data input with a const 0 fallback (an open PrStr prints an empty line), so Compile always writes a module instead of refusing. Repairs are loud (rep), and *bad selects the first touched node. Only unrepairable problems (herr: bad type, dangling wire, * sink used as a source, PrStr wired to a non-string) still refuse.*
- `addrep` (line 183) `void addrep(const char *s)`
- `adderr` (line 193) `void adderr(const char *s)`
- `compile_to` (line 283) `static int compile_to(const char *path)` - *Compile the current graph to a file. Returns 0 on success. Open inputs are auto-repaired (const 0 / empty line) and reported, so this refuses * only on unrepairable problems.*
- `write_quoted` (line 339) `static void write_quoted(FILE *f, const char *s)` - *--- Headless graph text format (v2, backward compatible) ---- num a 5          str s "hi"       add b a c      add c a #5 neg n a          if r c t e       print p e      print p e "%d ms\n" prints s2 s      exit x e Inputs are earlier-defined node names or #integer literals (wire or const). Forward references are rejected. A quoted "..." token carries * C-like escapes (\\ \" \n \t). The print format is an optional 4th token.*
- `save_graph_file` (line 392) `static int save_graph_file(const char *path)`
- `parse_graph_file` (line 430) `static int parse_graph_file(const char *path)`
- `resolve` (line 437) `int resolve(const char *nme, int upto)`
- `parse_input` (line 443) `int parse_input(const char *tok, int idx, int k)` - *static int parse_graph_file(const char *path) { FILE *f = fopen(path, "r"); if (!f) return -1; graph_clear(); static char names[MAX_NODES][16]; char line[512]; int rc = 0; int resolve(const char *nme, int upto) { for (int k = 0; k < upto; k++) if (strcmp(names[k], nme) == 0) return k; return -2; } /* Parse one input token: name, #literal, or #- (open, no literal).*
- `pin_y` (line 522) `static float pin_y(struct gnode *n, int slot, int is_output)` - */* Link-drag state: click an output pin, drag to an input pin. static int linking_active; static int linking_src_node; static int linking_src_slot; /* Node geometry constants. #define NODE_W       130.0f #define TITLE_H      20.0f #define PIN_R        5 #define PIN_DIAM     (PIN_R * 2 + 1) #define BEZIER_PAD   50.0f #define GRID_SIZE    32.0f /* Compute the Y positions of input and output pins for a node.*
- `node_h` (line 534) `static float node_h(struct gnode *n)`
- `ui_inspector` (line 542) `static void ui_inspector(struct nk_context *ctx)`
- `ui_build` (line 622) `static void ui_build(struct nk_context *ctx, float win_w, float win_h)`
- `gui_run` (line 931) `static void gui_run(void)` - *circle.y = pin_y(n, k, 0) - PIN_R + oy; circle.w = PIN_DIAM; circle.h = PIN_DIAM; nk_fill_circle(canvas, circle, n->in[k] >= 0 ? nk_rgb(80, 200, 80) : nk_rgb(100, 100, 100)); } } nk_layout_space_end(ctx); nk_end(ctx); } } /* ---- main loop ----*
- `main` (line 983) `int main(int argc, char **argv)`

**Macros:**
- `MAX_NODES` (line 33) `#define MAX_NODES`
- `STR_MAX` (line 34) `#define STR_MAX`
- `UI_MEMORY` (line 500) `#define UI_MEMORY`
- `NODE_W` (line 514) `#define NODE_W`
- `TITLE_H` (line 515) `#define TITLE_H`
- `PIN_R` (line 516) `#define PIN_R`
- `PIN_DIAM` (line 517) `#define PIN_DIAM`
- `BEZIER_PAD` (line 518) `#define BEZIER_PAD`
- `GRID_SIZE` (line 519) `#define GRID_SIZE`

**Structs:**
- `gnode` (line 44)
- `nodedef` (line 55) - *G_COUNT }; struct gnode { int kind; long long ival; char sval[STR_MAX]; int in[3]; long long lit[3]; int use_lit[3]; float x, y; }; /* Single registry: name, text-format word, inputs, outputs, color.*

#### `nuklear_minios.c`
**Path:** `progs/nuklear/nuklear_minios.c`
**File Doc:** *nuklear_minios.c — MiniOS platform layer for Nuklear.*

**Functions:**
- `nk_sys_time_ms` (line 33) `long nk_sys_time_ms(void)` - *#include <string.h> #include <stdio.h> #include <math.h> #include "nuklear_minios.h" /* glibc program name for the mailbox box (GNU extension). extern char *program_invocation_short_name; #include "nk_palette.h" #include "wl/wl_mbox.h" #include "wl/wl_client.h" /* ---- MiniOS syscalls (canonical table from minios_abi.h) ----*
- `nk_sys_kbd` (line 38) `long nk_sys_kbd(void)`
- `nk_sys_palette` (line 43) `long nk_sys_palette(const unsigned char *pal)`
- `nk_sys_kbd_raw` (line 48) `long nk_sys_kbd_raw(int on)`
- `nk_sys_getpid` (line 53) `long nk_sys_getpid(void)`
- `nk_client_probe` (line 72) `static int nk_client_probe(void)`
- `nk_sys_vga_mode` (line 114) `long nk_sys_vga_mode(int on)`
- `nk_sys_fb_info` (line 121) `long nk_sys_fb_info(int *w, int *h, int *pitch)`
- `nk_sys_fb_info_rgb` (line 137) `static long nk_sys_fb_info_rgb(int *w, int *h, int *pitch, int *rgb)`
- `nk_rgb_available` (line 147) `int nk_rgb_available(void)`
- `rgb256_prepare` (line 162) `static void rgb256_prepare(void)`
- `nk_idx_to_rgb` (line 170) `void nk_idx_to_rgb(int idx, unsigned char *r, unsigned char *g,
                   unsigned char *b)`
- `cur_set` (line 186) `static void cur_set(struct nk_color c)`
- `cur_bg_set` (line 190) `static void cur_bg_set(struct nk_color c)`
- `nk_sys_mouse` (line 193) `long nk_sys_mouse(int *xybw)`
- `nk_sys_mouse_badptr` (line 198) `long nk_sys_mouse_badptr(void)`
- `nk_client_hash` (line 216) `static unsigned nk_client_hash(const unsigned char *p, unsigned n)`
- `nk_client_publish` (line 227) `static int nk_client_publish(void)`
- `nk_sys_nk_frame` (line 280) `long nk_sys_nk_frame(int *origin)`
- `nk_mirror_box` (line 314) `static void nk_mirror_box(char *dst, int cap)`
- `nk_mirror_emit` (line 335) `static int nk_mirror_emit(const char *box, unsigned seq,
        const unsigned char *msg, int mlen)`
- `nk_mirror_tick` (line 352) `static void nk_mirror_tick(void)`
- `nk_sys_gfx_set_title` (line 409) `long nk_sys_gfx_set_title(const char *t)`
- `nk_build_palette` (line 418) `void nk_build_palette(unsigned char *pal768)` - *The desktop-exact hybrid palette lives once in progs/nk_palette.h; * this wrapper keeps the platform signature while sharing the table.*
- `pal_prepare` (line 427) `static void pal_prepare(void)`
- `col_to_idx` (line 438) `static int col_to_idx(struct nk_color c)`
- `set_clip` (line 469) `static void set_clip(int x, int y, int w, int h)`
- `px` (line 479) `static void px(int x, int y, int c)`
- `px_bg` (line 492) `static void px_bg(int x, int y, int c)` - *static void px(int x, int y, int c) { volatile uint8_t *d; if (x < clip_x || x >= clip_x + clip_w) return; if (y < clip_y || y >= clip_y + clip_h) return; if (x < 0 || x >= NK_W || y < 0 || y >= NK_H) return; fb[y * NK_W + x] = (uint8_t)c; if (nk_rgb_on == 1) { d = fbrgb + ((y * NK_W) + x) * 3; d[0] = (uint8_t)cur_r; d[1] = (uint8_t)cur_g; d[2] = (uint8_t)cur_b; } } /* Text-background twin: same pixel, the command's background color.*
- `px_idx` (line 506) `static void px_idx(int x, int y, int c)` - *Index-owned pixels (IMAGE commands): RGB resolves through the exact * rgb256 table, so both buffers agree without a nearest search.*
- `fill_rect` (line 522) `static void fill_rect(int x, int y, int w, int h, int c)`
- `draw_line` (line 529) `static void draw_line(int x0, int y0, int x1, int y1, int th, int c)`
- `fill_circle` (line 547) `static void fill_circle(int cx, int cy, int r, int c)`
- `stroke_circle` (line 553) `static void stroke_circle(int cx, int cy, int r, int th, int c)`
- `fill_poly` (line 571) `static void fill_poly(int *xs, int *ys, int n, int c)` - *draw_line(cx + x, cy - y, cx - x, cy - y, th, c); draw_line(cx - x, cy + y, cx - x, cy - y, th, c); draw_line(cx + x, cy + y, cx - x, cy - y, th, c); draw_line(cx - y, cy - x, cx - x, cy - y, th, c); draw_line(cx + y, cy - x, cx - x, cy - y, th, c); draw_line(cx - y, cy + x, cx - x, cy - y, th, c); draw_line(cx + y, cy + x, cx - x, cy - y, th, c); y++; if (err <= 0) { err += 2*y + 1; } if (err > 0)  { x--; err -= 2*x + 1; } } } /* Fill a convex polygon (x[], y[]).*
- `stroke_poly` (line 594) `static void stroke_poly(int *xs, int *ys, int n, int th, int c)`
- `draw_text` (line 601) `static void draw_text(int x, int y, const char *s, int len, int fg, int bg)`
- `draw_arc` (line 615) `static void draw_arc(int cx, int cy, int r, float a0, float a1,
                     int filled, ...`
- `nk_rasterize` (line 636) `void nk_rasterize(struct nk_context *ctx)`
- `nk_foreach` (line 641) `nk_foreach(cmd, ctx)`
- `nk_minios_font_width` (line 813) `static float nk_minios_font_width(nk_handle handle, float height,
                               ...` - *im->px[iy * im->w + ix]); } } break; } case NK_COMMAND_CUSTOM: break; default: break; } } } /* ---- Font (8x8 monospace) ----*
- `nk_minios_font` (line 819) `struct nk_user_font nk_minios_font(void)`
- `feed_key` (line 854) `static void feed_key(struct nk_context *ctx, enum nk_keys key, int down)`
- `nk_set_scancode_hook` (line 861) `void nk_set_scancode_hook(nk_scancode_cb cb, void *ud)`
- `handle_scancode` (line 866) `static void handle_scancode(struct nk_context *ctx, unsigned char sc)`
- `nk_client_poll` (line 914) `static void nk_client_poll(struct nk_context *ctx)` - *Client input pump: feed the pending .ev batch when its seq advanced, else hold the last state. Never touches PS/2; the * server owns the port while the desktop runs.*
- `nk_poll_input` (line 961) `void nk_poll_input(struct nk_context *ctx)`
- `nk_set_window_origin` (line 1000) `void nk_set_window_origin(int x, int y)`
- `nk_quit_requested` (line 1008) `int nk_quit_requested(void)` - *WM quit gesture latch: ESC or Alt+F4 pressed since the last poll. Returns 1 once per gesture, then clears. Every NK app polls this per * frame so no window depends on the tiny title-bar X to close.*
- `list` (line 4) `* abstract draw command list (nk__begin/nk__next);`

**Macros:**
- `NK_IMPLEMENTATION` (line 17) `#define NK_IMPLEMENTATION`

**Variables:**
- `program_invocation_short_name` (line 27) `extern char *program_invocation_short_name;` - *wheel. All MiniOS-specific syscalls go through the Linux syscall ABI, so this compiles into a normal static ring-3 ELF.  #define NK_IMPLEMENTATION #include "nuklear.h" #include <string.h> #include <stdio.h> #include <math.h> #include "nuklear_minios.h" /* glibc program name for the mailbox box (GNU extension).*

#### `nuklear_theme.c`
**Path:** `progs/nuklear/nuklear_theme.c`
**File Doc:** *Docstring: shared Nuklear theme loader, linked by every NK app.*

**Functions:**
- `nk_theme_name_ok` (line 37) `static int nk_theme_name_ok(const char *name)`
- `nk_theme_active` (line 49) `int nk_theme_active(char *dst, int cap)`
- `nk_theme_parse_line` (line 73) `static int nk_theme_parse_line(const char *line,
                               unsigned char rgb...`
- `nk_theme_probe` (line 105) `int nk_theme_probe(const char *name, unsigned char rgb[NK_THEME_KEY_COUNT][3])`
- `nk_theme_apply` (line 141) `int nk_theme_apply(struct nk_context *ctx, const char *name)`

**Macros:**
- `X` (line 21) `#define X(k, i)`

**Structs:**
- `nk_theme_slot` (line 15)

#### `paint.c`
**Path:** `progs/paint/paint.c`
**File Doc:** *Docstring: MiniOS paint program (Nuklear ring-3 app, MiniFS: paint/paint.elf).*

**Functions:**
- `paint_clamp` (line 92) `static int paint_clamp(int v, int lo, int hi)` - *static int paint_size = 0; static int paint_down = 0; static int paint_lastx; static int paint_lasty; static int paint_anchorx; static int paint_anchory; static float paint_rectx; static float paint_recty; static char paint_path[PAINT_PATH_MAX] = PAINT_DEFAULT_PATH; static char paint_status[PAINT_STATUS_MAX]; static int paint_quit; static int paint_autoload; /** Clamp v into [lo, hi].*
- `paint_plot` (line 99) `static int paint_plot(unsigned char *buf, int w, int h, int x, int y,
                      unsig...` - *static float paint_recty; static char paint_path[PAINT_PATH_MAX] = PAINT_DEFAULT_PATH; static char paint_status[PAINT_STATUS_MAX]; static int paint_quit; static int paint_autoload; /** Clamp v into [lo, hi]. static int paint_clamp(int v, int lo, int hi) { if (v < lo) return lo; if (v > hi) return hi; return v; } /** Bound-checked pixel plot, fail closed outside the canvas.*
- `paint_dab` (line 108) `static void paint_dab(unsigned char *buf, int w, int h, int x, int y,
                      unsig...` - *if (v > hi) return hi; return v; } /** Bound-checked pixel plot, fail closed outside the canvas. static int paint_plot(unsigned char *buf, int w, int h, int x, int y, unsigned char c) { if (!buf || w <= 0 || h <= 0) return -1; if (x < 0 || y < 0 || x >= w || y >= h) return -1; buf[y * w + x] = c; return 0; } /** Filled square dab of side s centered on (x, y).*
- `paint_line` (line 119) `static int paint_line(unsigned char *buf, int w, int h, int x0, int y0,
                      int...` - *} /** Filled square dab of side s centered on (x, y). static void paint_dab(unsigned char *buf, int w, int h, int x, int y, unsigned char c, int s) { int half = s / 2; int dx; int dy; for (dy = -half; dy < s - half; dy++) for (dx = -half; dx < s - half; dx++) paint_plot(buf, w, h, x + dx, y + dy, c); } /** Bresenham line with brush dabs, returns plotted points (not dabs).*
- `paint_rect_fill` (line 144) `static int paint_rect_fill(unsigned char *buf, int w, int h, int x0, int y0,
                    ...` - *paint_dab(buf, w, h, x0, y0, c, s); n++; } if (x0 == x1 && y0 == y1) break; { int e2 = 2 * err; if (e2 > -dy) { err -= dy; x0 += sx; } if (e2 < dx) { err += dx; y0 += sy; } } } return n; } /** Filled rectangle, corners normalized, returns painted pixels.*
- `paint_circle_fill` (line 161) `static int paint_circle_fill(unsigned char *buf, int w, int h, int cx,
                          ...` - *int xb = x0 < x1 ? x1 : x0; int ya = y0 < y1 ? y0 : y1; int yb = y0 < y1 ? y1 : y0; int x; int y; int n = 0; if (!buf || w <= 0 || h <= 0) return -1; for (y = ya; y <= yb; y++) for (x = xa; x <= xb; x++) if (paint_plot(buf, w, h, x, y, c) == 0) n++; return n; } /** Filled midpoint circle of radius r, returns painted pixels.*
- `paint_flood` (line 179) `static int paint_flood(unsigned char *buf, int w, int h, int x, int y,
                       uns...` - *Bounded flood fill with mark-on-push: every cell is marked once, so * the explicit stack never exceeds the canvas size.*
- `paint_nearest` (line 223) `static int paint_nearest(const unsigned char *pal, unsigned r, unsigned g,
                      ...` - *} if (cy + 1 < h && buf[(cy + 1) * w + cx] == oc) { buf[(cy + 1) * w + cx] = nc; sx[top] = cx; sy[top] = cy + 1; top++; n++; } if (cy - 1 >= 0 && buf[(cy - 1) * w + cx] == oc) { buf[(cy - 1) * w + cx] = nc; sx[top] = cx; sy[top] = cy - 1; top++; n++; } } return n; } /** Nearest hybrid-palette index by squared RGB distance.*
- `paint_pal` (line 240) `static const unsigned char *paint_pal(void)` - *unsigned long bd = 0xFFFFFFFFUL; unsigned k; if (!pal) return -1; for (k = 0; k < 256; k++) { long dr = (long)pal[k * 3] - (long)r; long dg = (long)pal[k * 3 + 1] - (long)g; long db = (long)pal[k * 3 + 2] - (long)b; unsigned long d = (unsigned long)(dr * dr + dg * dg + db * db); if (d < bd) { bd = d; best = k; } } return (int)best; } /** Cached hybrid palette: built once, shared by picker, save and load.*
- `paint_path_ok` (line 251) `static int paint_path_ok(const char *p)` - *} /** Cached hybrid palette: built once, shared by picker, save and load. static const unsigned char *paint_pal(void) { static unsigned char pal768[768]; static int ready = 0; if (!ready) { nk_build_palette(pal768); ready = 1; } return pal768; } /** Save-path gate: printable ASCII, bounded, .png suffix, no traversal.*
- `paint_crc_init` (line 272) `static void paint_crc_init(void)`
- `paint_crc_update` (line 285) `static unsigned long paint_crc_update(unsigned long c,
                                      cons...`
- `paint_adler` (line 296) `static unsigned long paint_adler(const unsigned char *p, unsigned long n)` - *paint_crc_ready = 1; } static unsigned long paint_crc_update(unsigned long c, const unsigned char *p, unsigned long n) { unsigned long k; paint_crc_init(); for (k = 0; k < n; k++) c = paint_crc_tab[(c ^ p[k]) & 0xFF] ^ (c >> 8); return c; } /** Adler-32 over one buffer (the zlib trailer of a single IDAT).*
- `paint_put_u32` (line 308) `static int paint_put_u32(unsigned char *dst, unsigned long cap,
                         unsigned...` - */** Adler-32 over one buffer (the zlib trailer of a single IDAT). static unsigned long paint_adler(const unsigned char *p, unsigned long n) { unsigned long a = 1; unsigned long b = 0; unsigned long k; for (k = 0; k < n; k++) { a = (a + p[k]) % 65521; b = (b + a) % 65521; } return (b << 16) | a; } /** Bound-checked big-endian u32 store for the PNG writer.*
- `paint_put_bytes` (line 320) `static int paint_put_bytes(unsigned char *dst, unsigned long cap,
                           unsi...` - */** Bound-checked big-endian u32 store for the PNG writer. static int paint_put_u32(unsigned char *dst, unsigned long cap, unsigned long *pos, unsigned long v) { if (!dst || !pos || *pos + 4 > cap) return -1; dst[*pos] = (unsigned char)((v >> 24) & 0xFF); dst[*pos + 1] = (unsigned char)((v >> 16) & 0xFF); dst[*pos + 2] = (unsigned char)((v >> 8) & 0xFF); dst[*pos + 3] = (unsigned char)(v & 0xFF); pos += 4; return 0; } /** Bound-checked raw copy for the PNG writer.*
- `paint_png_encode` (line 333) `static long paint_png_encode(unsigned char *dst, unsigned long cap,
                             ...` - *Encode indexed pixels as 8-bit truecolor PNG (stored deflate blocks). * Returns the byte count or a negative code on any bound violation.*
- `paint_load_file` (line 461) `static int paint_load_file(const char *path)` - *Decode a PNG file into the canvas (top-left, clamped, nearest-mapped). * Reports through the status line, never a partial silent canvas.*
- `paint_save_file` (line 514) `static int paint_save_file(const char *path)` - *for (x = 0; x < cw; x++) { int v = paint_nearest(pal768, px[(y * w + x) * 3], px[(y * w + x) * 3 + 1], px[(y * w + x) * 3 + 2]); paint_px[y * PAINT_W + x] = (unsigned char)v; } snprintf(paint_status, sizeof(paint_status), "loaded %s (%dx%d)", path, w, h); } stbi_image_free(px); return 0; } /** Encode the canvas and write it to path, fail closed on any shortfall.*
- `paint_blit` (line 549) `static void paint_blit(int ox, int oy)` - *Blit the canvas into the NK back-buffer after rasterize (and its RGB * twin when the kernel maps it, so the canvas shows full color too).*
- `paint_ink` (line 570) `static unsigned char paint_ink(void)` - *int dx = ox + x; int dy = oy + y; unsigned char r, g, b; volatile uint8_t *d; if (dx < 0 || dx >= NK_W || dy < 0 || dy >= NK_H) continue; fb[dy * NK_W + dx] = paint_px[y * PAINT_W + x]; if (!rgb) continue; nk_idx_to_rgb(paint_px[y * PAINT_W + x], &r, &g, &b); d = NK_RGB_BUF + ((dy * NK_W) + dx) * 3; d[0] = r; d[1] = g; d[2] = b; } } /** Current drawing color index (eraser paints the canvas background).*
- `paint_handle_input` (line 577) `static void paint_handle_input(struct nk_context *ctx)` - *nk_idx_to_rgb(paint_px[y * PAINT_W + x], &r, &g, &b); d = NK_RGB_BUF + ((dy * NK_W) + dx) * 3; d[0] = r; d[1] = g; d[2] = b; } } /** Current drawing color index (eraser paints the canvas background). static unsigned char paint_ink(void) { if (paint_tool == PAINT_TOOL_ERASER) return paint_colors[PAINT_NCOLORS - 1]; return paint_colors[paint_swatch % PAINT_NCOLORS]; } /** Drive the active stroke from the Nuklear input state.*
- `paint_ui_build` (line 636) `static void paint_ui_build(struct nk_context *ctx)` - *Build the file row, the exact-size canvas beside the tool panel, and the status row. The canvas cell is PAINT_W wide so every white pixel shown is paintable; tools, colors and buttons live in the side * panel instead of above an oversized slot.*
- `paint_pattern_present` (line 720) `static int paint_pattern_present(int fw, int fh, int fp, int *ox, int *oy)` - *Scan the whole framebuffer for the canvas marker run (first four swatches consecutive). Position-independent: it holds whatever video mode the boot picked and wherever the compositor centered the window. No console output inside: serial prints take milliseconds and open * windows for the 25 Hz desktop tick between present and scan.*
- `paint_selftest` (line 755) `static int paint_selftest(void)` - *break; } } if (hit) { ox = x; oy = y; return 1; } } } return 0; } /** Headless selftest for BDD: core vectors, PNG roundtrip, one frame.*
- `paint_gui_run` (line 942) `static void paint_gui_run(void)` - *printf("paint: composite did not land (canvas %d,%d origin %d,%d)\n", (int)paint_rectx, (int)paint_recty, origin[0], origin[1]); return 1; } nk_free(&ctx); nk_sys_kbd_raw(0); nk_sys_vga_mode(0); printf("paint: frame ok (%dx%d)\n", NK_W, NK_H); return 0; } static unsigned char paint_ui_memory[PAINT_UI_MEMORY]; /** Interactive GUI loop: toolbar, canvas strokes, blit, present.*
- `main` (line 992) `int main(int argc, char **argv)`

**Macros:**
- `STB_IMAGE_IMPLEMENTATION` (line 26) `#define STB_IMAGE_IMPLEMENTATION`
- `STBI_ONLY_PNG` (line 27) `#define STBI_ONLY_PNG`
- `STBI_NO_STDIO` (line 28) `#define STBI_NO_STDIO`
- `PAINT_W` (line 32) `#define PAINT_W`
- `PAINT_H` (line 33) `#define PAINT_H`
- `PAINT_N` (line 34) `#define PAINT_N`
- `PAINT_PATH_MAX` (line 35) `#define PAINT_PATH_MAX`
- `PAINT_FILE_MAX` (line 36) `#define PAINT_FILE_MAX`
- `PAINT_STATUS_MAX` (line 37) `#define PAINT_STATUS_MAX`
- `PAINT_UI_MEMORY` (line 38) `#define PAINT_UI_MEMORY`
- `PAINT_PNG_MAX` (line 39) `#define PAINT_PNG_MAX`
- `PAINT_PNG_MAX_DIM` (line 40) `#define PAINT_PNG_MAX_DIM`
- `PAINT_TITLE` (line 41) `#define PAINT_TITLE`
- `PAINT_DEFAULT_PATH` (line 42) `#define PAINT_DEFAULT_PATH`
- `PAINT_PANEL_TITLE` (line 43) `#define PAINT_PANEL_TITLE`
- `PAINT_FILE_BTN_W` (line 44) `#define PAINT_FILE_BTN_W`
- `PAINT_FRAME_MS` (line 45) `#define PAINT_FRAME_MS`
- `PAINT_FRAME_ATTEMPTS` (line 46) `#define PAINT_FRAME_ATTEMPTS`
- `PAINT_NCOLORS` (line 47) `#define PAINT_NCOLORS`
- `PAINT_NSIZES` (line 48) `#define PAINT_NSIZES`
- `PAINT_NTOOLS` (line 49) `#define PAINT_NTOOLS`
- `PAINT_TOOL_BRUSH` (line 52) `#define PAINT_TOOL_BRUSH`
- `PAINT_TOOL_LINE` (line 53) `#define PAINT_TOOL_LINE`
- `PAINT_TOOL_RECT` (line 54) `#define PAINT_TOOL_RECT`
- `PAINT_TOOL_CIRCLE` (line 55) `#define PAINT_TOOL_CIRCLE`
- `PAINT_TOOL_FILL` (line 56) `#define PAINT_TOOL_FILL`
- `PAINT_TOOL_ERASER` (line 57) `#define PAINT_TOOL_ERASER`

#### `piano.c`
**Path:** `progs/piano/piano.c`
**File Doc:** *piano.c — a Nuklear piano that plays FM sound through the SB16 driver.*

**Functions:**
- `sys_pcm_open` (line 93) `static long sys_pcm_open(long flags)`
- `sys_pcm_write` (line 98) `static long sys_pcm_write(const void *buf, long len)` - *Returns bytes taken (NONBLOCK short count on backpressure, never a * stall), or negative on a dead path.*
- `sys_pcm_close` (line 101) `static void sys_pcm_close(void)`
- `sys_yield` (line 104) `static void sys_yield(void)`
- `sys_present_idx` (line 112) `static long sys_present_idx(int *origin)` - *Indexed present (buffer id 1): the 288 KB indexed copy instead of the 864 KB RGB twin. Piano inks are flat UI colors that survive the palette mapping, so the RGB path buys nothing here and costs ~3x in the kernel blit under TCG. nk_sys_nk_frame would pick RGB whenever the kernel maps * it; piano bypasses it on purpose. Origin reporting matches.*
- `o3_op` (line 127) `static int o3_op(int ch, int is_car)`
- `o3_opreg` (line 131) `static void o3_opreg(int ch, int is_car, int regbase, int val)`
- `o3_chreg` (line 135) `static void o3_chreg(int ch, int regbase, int val)`
- `o3_note` (line 173) `static void o3_note(int ch, int midi, int on)`
- `midi_to_key` (line 211) `static int midi_to_key(int midi)`
- `clamp_midi` (line 234) `static int clamp_midi(int m)`
- `pedal_set` (line 241) `static void pedal_set(int on)` - *pressed scancode owns its channel until release.  Indexed by 7-bit code. static int sc_chan[128]; static int sustain_pedal; static int octave;                    /* -2..+2, note shifted by 12*octave static int volume;                    /* 0..100 master, applied on the mix static int clamp_midi(int m) { if (m < 0) m = 0; if (m > 127) m = 127; return m; } /* Release every voice the pedal is holding (pedal lifted).*
- `voice_alloc` (line 255) `static int voice_alloc(void)`
- `note_off_key` (line 268) `static void note_off_key(int key)`
- `note_on_key` (line 281) `static void note_on_key(int key, int midi, int vel)`
- `kbd_semitone` (line 298) `static int kbd_semitone(int code)` - *── PC-keyboard MIDI map (Fruity Loops style) ───────────────────────── PS/2 set-1 scancodes (7-bit code, E0 clear) to semitone offsets from the UI base: A-row whites, Q-row blacks between them, Z-row bass whites, digits aliasing the upper blacks.  Comma/period are octave down/up and * are handled in the hook, not here.  Returns -100 for "not a note". define KBD_NO_NOTE (-100)*
- `kbd_all_off` (line 333) `static void kbd_all_off(void)`
- `note_on_sc` (line 339) `static void note_on_sc(int code, int vel)`
- `note_off_sc` (line 353) `static void note_off_sc(int code)`
- `piano_scancode` (line 369) `static void piano_scancode(int code, int make, int e0, void *ud)` - *Raw scancode hook (registered with nk_set_scancode_hook): note on/off * plus comma/period octave shift.  Extended (E0) keys are ignored.*
- `fx_configure` (line 421) `static void fx_configure(int delay_ms, int tremolo_pct, int clip, int vol)` - *#define FX_DELAY_CAP (RATE)           /* 1 s of delay at 22050 Hz #define FX_DELAY_MAX_MS 800 #define FX_FEEDBACK 0.35f #define FX_WET      0.55f #define FX_TREM_FREQ 5.0f static float fx_delay_buf[FX_DELAY_CAP]; static int   fx_delay_len;            /* samples, 0 = echo off static int   fx_delay_pos; static int   fx_tremolo_pct;          /* 0..100, 0 = tremolo off static float fx_trem_phase; static int   fx_softclip; /* (Re)configure every FX stage; also used by the selftest.*
- `fx_process` (line 440) `static float fx_process(float x)`
- `sb_flush` (line 469) `static void sb_flush(void)` - *Flush held bytes to the low-latency ring. A short NONBLOCK write is backpressure, not loss: the remainder stays held (fill < PCM_BUF) and the next frame retries it, and the event is counted so `sb16` shows whether the synth outruns the engine. Only a negative return * (dead path) drops the buffer, fail-loud instead of spinning on it.*
- `render_audio` (line 484) `static void render_audio(long ms)`
- `key_rect` (line 511) `static void key_rect(int key, int *x, int *y, int *w, int *h)`
- `hit_key` (line 518) `static int hit_key(int mx, int my)`
- `hit_velocity` (line 535) `static int hit_velocity(int key, int my)` - *Velocity 1..100 from the click's vertical position inside a key: the very * top is soft, the bottom is loud.*
- `ctrl_hit` (line 563) `static int ctrl_hit(int id, int mx, int my)`
- `ctrl_active` (line 567) `static int ctrl_active(int id)`
- `ctrl_press` (line 577) `static void ctrl_press(int id)`
- `ui_run` (line 594) `static void ui_run(int bench_ms)` - *case 1: if (octave < 2) octave++; break; case 2: if (volume > 0) volume -= 5; break; case 3: if (volume < 100) volume += 5; break; case 4: pedal_set(sustain_pedal ? 0 : 1); break; case 5: fx_configure(fx_delay_len > 0 ? 0 : 220, fx_tremolo_pct, fx_softclip, volume); break; case 6: fx_configure(fx_delay_len > 0 ? fx_delay_len * 1000 / (int)RATE : 0, fx_tremolo_pct > 0 ? 0 : 70, fx_softclip, volume); break; case 7: fx_configure(fx_delay_len > 0 ? fx_delay_len * 1000 / (int)RATE : 0, fx_tremolo_pct, fx_softclip ? 0 : 1, volume); break; default: break; } } /* ── UI ───────────────────────────────────────────────────────────────*
- `rate` (line 818) `* wait below caps the frame rate (bench mode skips it so the
         * benchmark still measures ...`
- `run_selftest` (line 836) `static int run_selftest(void)` - *sys_yield(); } else { sys_yield(); } } nk_set_scancode_hook(0, 0); nk_free(&ctx); nk_sys_kbd_raw(0); nk_sys_vga_mode(0); sys_pcm_close(); } /* ── Headless selftest (BDD hook) ─────────────────────────────────────*
- `run_pcm2_probe` (line 1015) `static int run_pcm2_probe(void)` - *Headless pcm2 plumbing probe (BDD hook): open NONBLOCK, stream one 2048-byte pattern, close, reopen (release symmetry), close. Passes on any backend: a draining engine accepts everything, a stalled one (null backend, no IRQ, no DMA progress) still accepts the first kernel ring (1024 B) without blocking. Prints `pcm2: probe ok (accepted=N)` or a diagnostic; needs no SB16 IRQ * and no GUI.*
- `main` (line 1042) `int main(int argc, char **argv)`

**Macros:**
- `UI_MEMORY` (line 54) `#define UI_MEMORY`
- `SYS_PCM2_OPEN` (line 57) `#define SYS_PCM2_OPEN`
- `SYS_PCM2_WRITE` (line 58) `#define SYS_PCM2_WRITE`
- `SYS_PCM2_CLOSE` (line 59) `#define SYS_PCM2_CLOSE`
- `RATE` (line 61) `#define RATE`
- `PCM_FRAG` (line 62) `#define PCM_FRAG`
- `PCM_BUF` (line 63) `#define PCM_BUF`
- `MAX_AUDIO_MS` (line 76) `#define MAX_AUDIO_MS`
- `PIANO_FRAME_MS` (line 84) `#define PIANO_FRAME_MS`
- `PIANO_FRAME_PERIOD` (line 91) `#define PIANO_FRAME_PERIOD`
- `KEY_W` (line 190) `#define KEY_W`
- `KEY_H` (line 191) `#define KEY_H`
- `BK_W` (line 192) `#define BK_W`
- `BK_H` (line 193) `#define BK_H`
- `KEY_Y` (line 194) `#define KEY_Y`
- `PIANO_BASE_MIDI` (line 195) `#define PIANO_BASE_MIDI`
- `PIANO_OCTAVES` (line 196) `#define PIANO_OCTAVES`
- `NKEYS` (line 209) `#define NKEYS`
- `MAX_VOICES` (line 221) `#define MAX_VOICES`
- `KBD_NO_NOTE` (line 297) `#define KBD_NO_NOTE`
- `FX_DELAY_CAP` (line 407) `#define FX_DELAY_CAP`
- `FX_DELAY_MAX_MS` (line 408) `#define FX_DELAY_MAX_MS`
- `FX_FEEDBACK` (line 409) `#define FX_FEEDBACK`
- `FX_WET` (line 410) `#define FX_WET`
- `FX_TREM_FREQ` (line 411) `#define FX_TREM_FREQ`
- `CTRL_Y` (line 545) `#define CTRL_Y`
- `CTRL_H` (line 546) `#define CTRL_H`
- `BTN_W` (line 547) `#define BTN_W`
- `BTN_GAP` (line 548) `#define BTN_GAP`
- `NCTRLS` (line 561) `#define NCTRLS`

#### `platform_minios.c`
**Path:** `progs/pokemon/platform_minios.c`

**Functions:**
- `sys_time_ms` (line 70) `static long sys_time_ms(void)`
- `sys_kbd` (line 76) `static long sys_kbd(void)`
- `sys_nk_frame` (line 82) `static long sys_nk_frame(int *origin)`
- `sys_mouse` (line 88) `static long sys_mouse(int *xybw)`
- `sys_vga_mode` (line 94) `static long sys_vga_mode(int on)`
- `sys_kbd_raw` (line 100) `static long sys_kbd_raw(int on)`
- `sys_palette` (line 106) `static long sys_palette(const unsigned char *pal)`
- `sys_gfx_title` (line 112) `static long sys_gfx_title(const char *t)`
- `sys_tone` (line 118) `static long sys_tone(unsigned f)`
- `sys_pcm2_open` (line 124) `static long sys_pcm2_open(long flags)`
- `sys_pcm2_write` (line 130) `static long sys_pcm2_write(const void *buf, long len)`
- `sys_pcm2_close` (line 136) `static void sys_pcm2_close(void)`
- `gain` (line 143) `* timing gain (overshoot is microseconds against millisecond waits).
 * Difference-based, so it s...`
- `gb_platform_set_debug` (line 191) `void gb_platform_set_debug(bool enabled)`
- `_dl_argv` (line 198) `* usable _dl_argv (it bound to unrelated storage and strcmp faulted).
 * DO NOT reintroduce argv ...`
- `minios_audio_sample` (line 263) `static void minios_audio_sample(GBContext *ctx, int16_t left, int16_t right)`
- `gb_voice_in_range` (line 307) `static bool gb_voice_in_range(unsigned f)`
- `sample_apu_voices` (line 311) `static void sample_apu_voices(gb_voice_t *v)`
- `minios_audio_play` (line 331) `static void minios_audio_play(const gb_voice_t *v, bool pcm_audible,
                            ...`
- `rebuild_joypad` (line 403) `static void rebuild_joypad(void)`
- `poll_keyboard` (line 417) `static void poll_keyboard(void)`
- `push_332_palette` (line 456) `static void push_332_palette(void)` - *3-3-2 RGB palette ramp, pushed ONCE at init (not per frame). * Pixel index = (R & 0xE0) | ((G & 0xE0) >> 3) | ((B & 0xC0) >> 6).*
- `ui_fringe_dirty` (line 621) `static bool ui_fringe_dirty(uint32_t now)`
- `ui_fringe_sync` (line 627) `static void ui_fringe_sync(uint32_t now)`
- `menu_fill` (line 633) `static void menu_fill(int x0, int y0, int w, int h, uint8_t idx)`
- `menu_text` (line 646) `static void menu_text(int x, int y, const char *s, uint8_t fg)`
- `menu_osd` (line 665) `static void menu_osd(const char *s)`
- `menu_draw` (line 671) `static void menu_draw(void)`
- `menu_item_at` (line 701) `static int menu_item_at(int lx, int ly)`
- `menu_do_save` (line 708) `static void menu_do_save(void)`
- `menu_do_load` (line 724) `static void menu_do_load(void)`
- `menu_activate` (line 743) `static void menu_activate(int it)`
- `poll_menu` (line 777) `static void poll_menu(void)` - *Esc toggles, Up/Down move, Enter activates; the mouse is a bonus. * PS/2 Set 1: Esc = 0x01, Up = 0x48, Down = 0x50, Enter = 0x1C.*
- `pokemon_art_load_one` (line 845) `static int pokemon_art_load_one(const char *path, unsigned char **rgb,
                          ...`
- `pokemon_art_load` (line 870) `static void pokemon_art_load(void)`
- `pokemon_art_draw_one` (line 888) `static void pokemon_art_draw_one(const unsigned char *rgb, int sw, int sh,
                      ...`
- `pokemon_art_draw` (line 926) `static void pokemon_art_draw(void)`
- `px_to_idx` (line 957) `static uint8_t px_to_idx(uint32_t pixel)`
- `upload_frame` (line 976) `static void upload_frame(const uint32_t *framebuffer)`
- `gb_platform_init` (line 1057) `bool gb_platform_init(int scale)`
- `minios_persist_path` (line 1089) `static void minios_persist_path(char *out, size_t n, const GBContext *ctx,
                      ...`
- `minios_legacy_path` (line 1098) `static void minios_legacy_path(char *out, size_t n, const GBContext *ctx,
                       ...` - *Legacy ramdisk path (pre-MiniFS fix wrote bin/<id>.* onto volatile ramdisk). Loads still probe it as a fallback so a checkpoint saved * in the same session before an upgrade is not invisible.*
- `minios_load_helper` (line 1104) `static bool minios_load_helper(const char *path, void *data, size_t size,
                       ...`
- `minios_save_helper` (line 1122) `static bool minios_save_helper(const char *path, const void *data, size_t size)`
- `minios_load_battery_ram` (line 1133) `static bool minios_load_battery_ram(GBContext *ctx, const char *rom_name,
                       ...`
- `minios_save_battery_ram` (line 1148) `static bool minios_save_battery_ram(GBContext *ctx, const char *rom_name,
                       ...`
- `minios_load_rtc_data` (line 1158) `static bool minios_load_rtc_data(GBContext *ctx, const char *rom_name,
                          ...`
- `minios_save_rtc_data` (line 1171) `static bool minios_save_rtc_data(GBContext *ctx, const char *rom_name,
                          ...`
- `minios_fast_forward` (line 1209) `static inline bool minios_fast_forward(void)`
- `minios_state_path` (line 1213) `static void minios_state_path(char *out, size_t n, const GBContext *ctx)`
- `minios_legacy_state_path` (line 1218) `static void minios_legacy_state_path(char *out, size_t n, const GBContext *ctx)`
- `minios_autosave` (line 1223) `static void minios_autosave(uint32_t now)`
- `poll_hotkeys` (line 1237) `static void poll_hotkeys(void)` - *PS/2 Set 1: F5 = 0x3F, F8 = 0x42, Ctrl = 0x1D, S = 0x1F, L = 0x26, SPACE = 0x39, Shift = 0x2A/0x36. SPACE held is momentary turbo; * Ctrl+Space latches it (sticky), Ctrl+Shift+Space releases it.*
- `gb_platform_register_context` (line 1289) `void gb_platform_register_context(GBContext *ctx)`
- `gb_platform_shutdown` (line 1311) `void gb_platform_shutdown(void)`
- `gb_platform_poll_events` (line 1322) `bool gb_platform_poll_events(GBContext *ctx)`
- `gb_platform_render_frame` (line 1331) `void gb_platform_render_frame(const uint32_t *framebuffer)`
- `frames` (line 1367) `* frames (menu bar not on screen yet) and any frame after the
         * LCD-off path zeroed the ...`
- `gb_platform_present_framebuffer` (line 1400) `void gb_platform_present_framebuffer(const uint32_t *framebuffer)`
- `gb_platform_render_lcd_off_frame` (line 1412) `void gb_platform_render_lcd_off_frame(void)`
- `gb_platform_vsync` (line 1434) `void gb_platform_vsync(uint32_t frame_cycles)`
- `gb_platform_set_benchmark_mode` (line 1451) `void gb_platform_set_benchmark_mode(bool enabled)`
- `gb_platform_set_input_script` (line 1455) `bool gb_platform_set_input_script(const char *script)`
- `gb_platform_set_input_record_file` (line 1461) `void gb_platform_set_input_record_file(const char *path)`
- `gb_platform_set_persistence_dir` (line 1466) `bool gb_platform_set_persistence_dir(const char *path)`
- `gb_platform_set_dump_frames` (line 1475) `void gb_platform_set_dump_frames(const char *frames)`
- `gb_platform_set_dump_present_frames` (line 1497) `void gb_platform_set_dump_present_frames(const char *frames)`
- `gb_platform_set_screenshot_prefix` (line 1518) `void gb_platform_set_screenshot_prefix(const char *prefix)`
- `gb_platform_get_timing_info` (line 1524) `void gb_platform_get_timing_info(GBPlatformTimingInfo *out)`
- `gb_platform_get_joypad` (line 1531) `uint8_t gb_platform_get_joypad(void)`
- `gb_platform_set_title` (line 1535) `void gb_platform_set_title(const char *title)`
- `gb_platform_get_smooth_lcd_transitions` (line 1541) `bool gb_platform_get_smooth_lcd_transitions(void)`
- `gb_platform_set_smooth_lcd_transitions` (line 1545) `void gb_platform_set_smooth_lcd_transitions(bool enabled)`
- `gb_platform_set_launcher_return_enabled` (line 1549) `void gb_platform_set_launcher_return_enabled(bool enabled)`
- `gb_platform_get_exit_action` (line 1553) `GBPlatformExitAction gb_platform_get_exit_action(void)`
- `gb_platform_submit_port_frame` (line 1557) `void gb_platform_submit_port_frame(void *user, const GBPortFrame *frame)`
- `gb_platform_test_audio_concurrency` (line 1563) `bool gb_platform_test_audio_concurrency(uint32_t frames,
                                        ...` - *void gb_platform_set_launcher_return_enabled(bool enabled) { (void)enabled; } GBPlatformExitAction gb_platform_get_exit_action(void) { return g_exit_action; } void gb_platform_submit_port_frame(void *user, const GBPortFrame *frame) { (void)user; (void)frame; } /* Test-hook stubs (no-ops on MiniOS)*
- `gb_platform_test_inject_persistence_fault` (line 1572) `void gb_platform_test_inject_persistence_fault(
    GBPersistenceTestTarget target,
    GBPersist...`
- `audio` (line 219) `* PC speaker audio (DOOM-style: sparse syscalls from poll points) * * Per rendered frame, live voice frequencies come from gb_audio_voice() * (runtime accessor over internal channel state: enabled, DA`
- `menu` (line 572) `* FILE menu (no Nuklear on purpose) * * A 16 px menu bar lives in the top margin the 2x GB image never touches * (it starts at GB_DST_Y0 = 36). Clicking FILE (or pressing Esc) drops a * 5-item menu: S`

**Macros:**
- `STB_IMAGE_IMPLEMENTATION` (line 61) `#define STB_IMAGE_IMPLEMENTATION`
- `STBI_ONLY_PNG` (line 62) `#define STBI_ONLY_PNG`
- `STBI_NO_STDIO` (line 63) `#define STBI_NO_STDIO`
- `FB_ADDR` (line 161) `#define FB_ADDR`
- `FB_W` (line 162) `#define FB_W`
- `FB_H` (line 163) `#define FB_H`
- `GB_SCALE` (line 165) `#define GB_SCALE`
- `GB_DST_W` (line 166) `#define GB_DST_W`
- `GB_DST_H` (line 167) `#define GB_DST_H`
- `GB_DST_X0` (line 168) `#define GB_DST_X0`
- `GB_DST_Y0` (line 169) `#define GB_DST_Y0`
- `MINIOS_AUDIO_RATE` (line 234) `#define MINIOS_AUDIO_RATE`
- `MINIOS_AUDIO_SILENCE_E` (line 235) `#define MINIOS_AUDIO_SILENCE_E`
- `MINIOS_AUDIO_MIN_HZ` (line 236) `#define MINIOS_AUDIO_MIN_HZ`
- `MINIOS_AUDIO_MAX_HZ` (line 237) `#define MINIOS_AUDIO_MAX_HZ`
- `MINIOS_ARP_BASS_MS` (line 238) `#define MINIOS_ARP_BASS_MS`
- `MINIOS_ARP_MEL_MS` (line 239) `#define MINIOS_ARP_MEL_MS`
- `MENU_BAR_H` (line 587) `#define MENU_BAR_H`
- `MENU_FILE_X0` (line 588) `#define MENU_FILE_X0`
- `MENU_FILE_X1` (line 589) `#define MENU_FILE_X1`
- `MENU_DROP_X0` (line 590) `#define MENU_DROP_X0`
- `MENU_DROP_W` (line 591) `#define MENU_DROP_W`
- `MENU_ITEM_H` (line 592) `#define MENU_ITEM_H`
- `MENU_NITEMS` (line 593) `#define MENU_NITEMS`
- `MENU_BG` (line 596) `#define MENU_BG`
- `MENU_FG` (line 597) `#define MENU_FG`
- `MENU_HOVER` (line 598) `#define MENU_HOVER`
- `MENU_OSD_BG` (line 599) `#define MENU_OSD_BG`
- `MINIOS_AUTOSAVE_MS` (line 1194) `#define MINIOS_AUTOSAVE_MS`
- `MINIOS_FF_FRAMESKIP` (line 1206) `#define MINIOS_FF_FRAMESKIP`

**Structs:**
- `gb_voice_t` (line 302)

#### `q2generic_minios.c`
**Path:** `progs/quake2generic/q2generic_minios.c`
**File Doc:** *q2generic_minios.c - MiniOS platform layer for quake2generic.*

**Functions:**
- `MINIOS_GFX_BUF_GAME` (line 5) `* MINIOS_SYS_GFX_PRESENT with MINIOS_GFX_BUF_GAME (211 stays as a kernel
 * compat alias) and the...`
- `sys_kbd` (line 30) `static long sys_kbd(void)`
- `sys_palette` (line 36) `static long sys_palette(const unsigned char *pal)`
- `sys_kbd_raw` (line 42) `static long sys_kbd_raw(int on)`
- `sys_vga_mode` (line 48) `static long sys_vga_mode(int on)`
- `sys_doom_frame` (line 54) `static long sys_doom_frame(void)`
- `sys_mouse` (line 60) `static long sys_mouse(int *buf)`
- `sys_set_title` (line 66) `static long sys_set_title(const char *t)`
- `sys_gfx_zoom` (line 72) `static long sys_gfx_zoom(long mode)`
- `q2g_parse_windowed` (line 86) `static void q2g_parse_windowed(int argc, char **argv)`
- `q2g_parse_autoframes` (line 121) `static void q2g_parse_autoframes(int argc, char **argv)`
- `QG_GetMouseDiff` (line 154) `void QG_GetMouseDiff(int *dx, int *dy)`
- `QG_CaptureMouse` (line 168) `void QG_CaptureMouse(void)`
- `QG_ReleaseMouse` (line 172) `void QG_ReleaseMouse(void)`
- `QG_Mkdir` (line 175) `void QG_Mkdir(const char *path)`
- `scancode_to_q2key` (line 179) `static unsigned char scancode_to_q2key(unsigned char raw)`
- `extended_to_q2key` (line 262) `static unsigned char extended_to_q2key(unsigned char sc)`
- `kbd_poll` (line 280) `static void kbd_poll(void)`
- `SWimp_SetPalette` (line 310) `void SWimp_SetPalette(const unsigned char *palette)`
- `SWimp_SetMode` (line 320) `rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)`
- `SWimp_Init` (line 337) `int SWimp_Init(void *hInstance, void *wndProc)`
- `SWimp_Shutdown` (line 346) `void SWimp_Shutdown(void)`
- `SWimp_BeginFrame` (line 349) `void SWimp_BeginFrame(float camera_separation)`
- `SWimp_EndFrame` (line 352) `void SWimp_EndFrame(void)`
- `SWimp_AppActivate` (line 381) `void SWimp_AppActivate(qboolean active)`
- `QG_Milliseconds` (line 385) `int QG_Milliseconds(void)`
- `main` (line 389) `int main(int argc, char **argv)`
- `MINIOS_DOOM_BACKBUF_ADDR` (line 4) `* MINIOS_DOOM_BACKBUF_ADDR (minios_abi.h);`
- `Sys_Quit` (line 99) `extern void Sys_Quit(void);` - *Sys_Quit lives in the engine's system driver (other/q_system.c); not pulled * in through quake2.h, so declare it here for the autoquit hook below.*
- `Cbuf_AddText` (line 102) `extern void Cbuf_AddText(char *text);` - *Sys_Quit lives in the engine's system driver (other/q_system.c); not pulled * in through quake2.h, so declare it here for the autoquit hook below. extern void Sys_Quit(void); /* Command buffer (other/cmd.c) for the in-game sound test hook below.*
- `q2snd_probe` (line 106) `extern int q2snd_probe(void);` - *Sound backend probe (snddma_minios.c): headless proof the DMA layer * reaches the pcm2 path, run with `quake2generic.elf --pcm2-probe`.*

**Macros:**
- `Q2G_FB_W` (line 21) `#define Q2G_FB_W`
- `Q2G_FB_H` (line 22) `#define Q2G_FB_H`
- `Q2G_BACKBUF` (line 78) `#define Q2G_BACKBUF`

#### `snddma_minios.c`
**Path:** `progs/quake2generic/snddma_minios.c`
**File Doc:** *snddma_minios.c - Quake 2 DMA sound backend over the MiniOS pcm2 path.*

**Functions:**
- `sys_pcm2_open` (line 67) `static long sys_pcm2_open(long flags)`
- `sys_pcm2_write` (line 75) `static long sys_pcm2_write(const void *buf, long len)`
- `sys_pcm2_close` (line 83) `static void sys_pcm2_close(void)`
- `sys_time_ms` (line 89) `static long sys_time_ms(void)`
- `q2_dma_push` (line 104) `static int q2_dma_push(int end)` - *Push the freshly painted range [q2_dma_written, end) in ring order with NONBLOCK writes that take what the kernel ring has room for. The mixer ring is 16-bit mono; each frame is downconverted to 8-bit unsigned for pcm2 in bounded sub-chunks. A short count is not loss: the frames wait in dma.buffer (the engine only wraps far behind the paint lead) and go out on the next Submit. Returns the number of frames handed to the * device.*
- `SNDDMA_Init` (line 138) `qboolean SNDDMA_Init(void)`
- `SNDDMA_GetDMAPos` (line 182) `int SNDDMA_GetDMAPos(void)`
- `SNDDMA_Shutdown` (line 190) `void SNDDMA_Shutdown(void)`
- `SNDDMA_BeginPainting` (line 202) `void SNDDMA_BeginPainting(void)`
- `SNDDMA_Submit` (line 205) `void SNDDMA_Submit(void)`
- `q2snd_probe` (line 222) `int q2snd_probe(void)` - *Headless plumbing probe (BDD hook): open pcm2, stream one pattern, close, report. Needs no game data, so it runs on a bare boot with the SB16 attached and is the serial proof that the Quake 2 backend reaches the * low-latency path.*

**Macros:**
- `Q2SND_RATE` (line 48) `#define Q2SND_RATE`
- `Q2SND_SAMPLES` (line 49) `#define Q2SND_SAMPLES`
- `Q2SND_SILENCE` (line 50) `#define Q2SND_SILENCE`
- `Q2SND_AHEAD` (line 54) `#define Q2SND_AHEAD`
- `Q2SND_BUF_BYTES` (line 56) `#define Q2SND_BUF_BYTES`

#### `aes.c`
**Path:** `progs/src/aes.c`
**File Doc:** *aes.c - command path AES-256-CTR encryption tools: aes and unaes.*

**Functions:**
- `aes_read_all` (line 69) `static char *aes_read_all(const char *name, int *len)`
- `aes_write_all` (line 86) `static int aes_write_all(const char *name, char *data, int len)`
- `aes_has` (line 96) `static int aes_has(const char *s, const char *needle)`
- `hex_val` (line 110) `static int hex_val(int c)`
- `aes_parse_hex` (line 117) `static int aes_parse_hex(const char *s, int want, int *out)`
- `aes_gf_mul` (line 130) `static int aes_gf_mul(int a, int b)` - *static int aes_parse_hex(const char *s, int want, int *out) { int i, hi, lo; if ((int)strlen(s) != want) return 0; for (i = 0; i < want; i += 2) { hi = hex_val(s[i]); lo = hex_val(s[i + 1]); if (hi < 0 || lo < 0) return 0; out[i / 2] = hi * 16 + lo; } return 1; } /* Multiply in GF(2^8) modulo the AES polynomial; both operands are 0..255.*
- `aes_xtime` (line 142) `static int aes_xtime(int x)`
- `aes_rotl8` (line 148) `static int aes_rotl8(int x, int n)`
- `aes_init_tables` (line 155) `static void aes_init_tables(void)` - *Build the S-box from first principles: multiplicative inverse in GF(2^8) composed with the FIPS-197 affine transform.  Zero maps straight to the * affine constant because 0 has no inverse.*
- `aes_key_expand` (line 174) `static void aes_key_expand(const int *key)` - *Expand the 32-byte key into AES_RK_LEN round-key bytes (FIPS-197 for Nk=8, Nr=14: RotWord plus SubWord every Nk words, an extra SubWord pass * every Nk/2 words).*
- `aes_add_round_key` (line 209) `static void aes_add_round_key(int round)`
- `aes_sub_bytes` (line 215) `static void aes_sub_bytes(void)`
- `aes_shift_rows` (line 220) `static void aes_shift_rows(void)`
- `aes_mix_columns` (line 228) `static void aes_mix_columns(void)`
- `aes_cipher` (line 248) `static void aes_cipher(void)`
- `aes_iv_increment` (line 263) `static void aes_iv_increment(void)` - *int r; aes_add_round_key(0); for (r = 1; r < AES_ROUNDS; r++) { aes_sub_bytes(); aes_shift_rows(); aes_mix_columns(); aes_add_round_key(r); } aes_sub_bytes(); aes_shift_rows(); aes_add_round_key(AES_ROUNDS); } /* Big-endian increment of the whole counter block (SP 800-38A CTR).*
- `aes_ctr_crypt` (line 273) `static void aes_ctr_crypt(char *data, int len)` - *aes_add_round_key(AES_ROUNDS); } /* Big-endian increment of the whole counter block (SP 800-38A CTR). static void aes_iv_increment(void) { int b; for (b = AES_BLOCK - 1; b >= 0; b--) { aes_iv[b] = aes_iv[b] + 1; if (aes_iv[b] <= 255) break; aes_iv[b] = 0; } } /* XOR data in place with the keystream Cipher(nonce), Cipher(nonce+1)...*
- `aes_hdr_put` (line 288) `static void aes_hdr_put(char *h, int size)`
- `aes_hdr_get` (line 299) `static int aes_hdr_get(char *h)`
- `aes_tool_name` (line 307) `static const char *aes_tool_name(int decode)`
- `aes_run` (line 312) `static int aes_run(int decode, const char *keyhex, const char *noncehex,
                   const...`
- `main` (line 384) `int main(int argc, char **argv)`
- `GF` (line 8) `* generated procedurally from the GF(2^8) multiplicative inverse plus the * FIPS-197 affine transform, so the file carries no magic tables. The mode * is CTR (NIST SP 800-38A): no padding, encrypt and`
- `putchar` (line 25) `int putchar();`
- `strcmp` (line 26) `int strcmp();`
- `strlen` (line 27) `int strlen();`
- `fopen` (line 28) `void *fopen();`
- `fclose` (line 29) `int fclose();`
- `fread` (line 30) `int fread();`
- `fwrite` (line 31) `int fwrite();`
- `fseek` (line 32) `int fseek();`
- `ftell` (line 33) `int ftell();`
- `rewind` (line 34) `void rewind();`
- `malloc` (line 35) `void *malloc();`
- `free` (line 36) `void free();`

**Macros:**
- `AES_MAGIC0` (line 38) `#define AES_MAGIC0`
- `AES_MAGIC1` (line 39) `#define AES_MAGIC1`
- `AES_MAGIC2` (line 40) `#define AES_MAGIC2`
- `AES_MAGIC3` (line 41) `#define AES_MAGIC3`
- `AES_HDR_SIZE` (line 42) `#define AES_HDR_SIZE`
- `AES_BLOCK` (line 44) `#define AES_BLOCK`
- `AES_KEY_BYTES` (line 45) `#define AES_KEY_BYTES`
- `AES_NONCE_BYTES` (line 46) `#define AES_NONCE_BYTES`
- `AES_ROUNDS` (line 47) `#define AES_ROUNDS`
- `AES_RK_LEN` (line 48) `#define AES_RK_LEN`
- `AES_SBOX_SIZE` (line 49) `#define AES_SBOX_SIZE`
- `AES_RCON_SIZE` (line 50) `#define AES_RCON_SIZE`
- `AES_POLY` (line 52) `#define AES_POLY`
- `AES_AFFINE_C` (line 53) `#define AES_AFFINE_C`
- `AES_RCON_PAD` (line 54) `#define AES_RCON_PAD`
- `HEX_KEY_LEN` (line 56) `#define HEX_KEY_LEN`
- `HEX_NONCE_LEN` (line 57) `#define HEX_NONCE_LEN`
- `AES_SEEK_END` (line 59) `#define AES_SEEK_END`
- `AES_EXIT_FAIL` (line 61) `#define AES_EXIT_FAIL`

#### `apsse.c`
**Path:** `progs/src/apsse.c`
**File Doc:** *apsse.c - SSE in glibc threads on every CPU (docs/spec/smp-sched.md,*

**Functions:**
- `apsse_grind` (line 49) `static uint64_t apsse_grind(int id)` - *SSE2 integer lanes, a double accumulator and an SSE2 memchr per round; the folded value depends on every lane, so a corrupted XMM register * changes it.*
- `apsse_worker` (line 75) `static void *apsse_worker(void *arg)`
- `main` (line 81) `int main(void)`

**Macros:**
- `_GNU_SOURCE` (line 23) `#define _GNU_SOURCE`
- `APSSE_THREADS` (line 31) `#define APSSE_THREADS`
- `APSSE_ROUNDS` (line 32) `#define APSSE_ROUNDS`
- `APSSE_SEED` (line 33) `#define APSSE_SEED`
- `APSSE_BUF` (line 34) `#define APSSE_BUF`
- `APSSE_NEEDLE` (line 35) `#define APSSE_NEEDLE`
- `APSSE_MAP_ROUNDS` (line 36) `#define APSSE_MAP_ROUNDS`
- `APSSE_MAP_BYTES` (line 37) `#define APSSE_MAP_BYTES`
- `APSSE_MAP_FILL` (line 38) `#define APSSE_MAP_FILL`
- `APSSE_OK` (line 39) `#define APSSE_OK`
- `APSSE_BAD` (line 40) `#define APSSE_BAD`

**Structs:**
- `apsse_job` (line 42)

#### `aslr.c`
**Path:** `progs/src/aslr.c`
**File Doc:** *aslr -- userspace ASLR probe (self-exec chain).*

**Functions:**
- `as_sc` (line 10) `static long as_sc(long n, long a1, long a2, long a3)` - *aslr -- userspace ASLR probe (self-exec chain).  gen0 (no args) prints its stack pointer, brk and first-mmap address, then execve()s itself carrying those three values. gen1 compares its own addresses against the parent's: stack top slides per exec, brk starts past a random pad, the mmap cursor starts slid down. Any one dimension differing proves fresh entropy; identical triples mean the mixer is dead. Prints "aslr: ok" (exit 0) or "aslr: SAME" (exit 1). * Built as a static Linux ELF like execho.elf.*
- `as_mmap` (line 18) `static long as_mmap(void)`
- `as_write` (line 31) `static void as_write(const char *s, unsigned long len)`
- `as_exit` (line 35) `static void as_exit(long code)`
- `as_execve` (line 40) `static void as_execve(const char *path, const char **argv)`
- `as_putu` (line 47) `static void as_putu(unsigned long v)`
- `as_atou` (line 59) `static unsigned long as_atou(const char *s)`
- `as_rsp` (line 68) `static unsigned long as_rsp(void)`
- `as_fail` (line 74) `static void as_fail(int step)`
- `lmain` (line 82) `int lmain(long argc, char **argv)`

#### `audio.c`
**Path:** `progs/src/audio.c`

**Functions:**
- `syscall1` (line 3) `static long syscall1(long n, long a1)`
- `syscall2` (line 9) `static long syscall2(long n, long a1, long a2)`
- `syscall3` (line 15) `static long syscall3(long n, long a1, long a2, long a3)`
- `syscall0` (line 21) `static long syscall0(long n)`
- `audio_init` (line 27) `int audio_init(void)`
- `audio_tone` (line 31) `void audio_tone(unsigned freq)`
- `audio_pcm_open` (line 35) `int audio_pcm_open(unsigned rate, unsigned channels, unsigned format)`
- `audio_pcm_submit` (line 40) `int audio_pcm_submit(const void *buf, unsigned len)`
- `audio_pcm_pump` (line 44) `void audio_pcm_pump(void)`
- `audio_pcm_close` (line 48) `void audio_pcm_close(void)`
- `audio_set_volume` (line 52) `void audio_set_volume(unsigned volume)`
- `audio_get_volume` (line 56) `unsigned audio_get_volume(void)`
- `audio_sb16_present` (line 60) `int audio_sb16_present(void)`
- `audio_stream_open` (line 64) `int audio_stream_open(void)`
- `audio_stream_close` (line 68) `void audio_stream_close(int id)`
- `audio_stream_submit` (line 72) `int audio_stream_submit(int id, const void *buf, unsigned len)`
- `audio_stream_volume` (line 76) `void audio_stream_volume(int id, unsigned char vol)`

#### `burn.c`
**Path:** `progs/src/burn.c`
**File Doc:** *burn -- SMP mixed-workload probe: brk plus mmap plus CPU burn with*

**Functions:**
- `bn_sc` (line 6) `static long bn_sc(long n, long a1, long a2, long a3)` - *burn -- SMP mixed-workload probe: brk plus mmap plus CPU burn with a deterministic checksum. Concurrent isolated copies must all print the same sum and exit 0; a corrupted brk view, an aliased mmap or a torn page changes the sum or faults before it prints. Built as a * static Linux ELF like aslr.elf.*
- `bn_mmap` (line 14) `static long bn_mmap(unsigned long len)`
- `bn_write` (line 27) `static void bn_write(const char *s, unsigned long len)`
- `bn_exit` (line 31) `static void bn_exit(long code)`
- `bn_putu` (line 36) `static void bn_putu(unsigned long v)`
- `bn_fail` (line 48) `static void bn_fail(void)`
- `lmain` (line 53) `int lmain(void)`

#### `cp.c`
**Path:** `progs/src/cp.c`

**Functions:**
- `main` (line 10) `int main(int argc, char **argv)`
- `printf` (line 1) `int printf();`
- `fopen` (line 2) `void *fopen();`
- `fclose` (line 3) `int fclose();`
- `fread` (line 4) `int fread();`
- `fwrite` (line 5) `int fwrite();`

**Macros:**
- `CP_BUF_SIZE` (line 7) `#define CP_BUF_SIZE`
- `CP_EXIT_FAIL` (line 8) `#define CP_EXIT_FAIL`

#### `cpl.c`
**Path:** `progs/src/cpl.c`
**File Doc:** *Ring-3 privilege probe. Reads the CS selector at runtime and exits with*

**Functions:**
- `read_cpl` (line 6) `static long read_cpl(void)` - *Ring-3 privilege probe. Reads the CS selector at runtime and exits with the CPL it is executing at. Under the isolation contract a Linux ELF runs at ring 3, so CS is the user code selector (0x23) and the exit code is 3; a regression to ring-0 execution would report 0. Built as a * static Linux ELF like lxhello.elf and run through the syscall ABI.*
- `exit_now` (line 12) `static void exit_now(long code)`
- `_start` (line 16) `void _start(void)`

#### `cvmfmt.c`
**Path:** `progs/src/cvmfmt.c`
**File Doc:** *cvmfmt.c - CVM formatting probe.*

**Functions:**
- `main` (line 19) `int main(void)`

#### `execho.c`
**Path:** `progs/src/execho.c`
**File Doc:** *execho -- fork(57) + execve(59) + wait4(61) probe.*

**Functions:**
- `path` (line 7) `* execs a ghost path (must fail -2, exits 42). The parent checks
 * both wait4 results with Linux...`
- `ex_write` (line 20) `static void ex_write(const char *s, unsigned long len)`
- `ex_exit` (line 24) `static void ex_exit(long code)`
- `ex_fail` (line 29) `static void ex_fail(int step)`
- `lmain` (line 37) `int lmain(void)`
- `program` (line 5) `* * Proves the UNIX process composition the kernel lacked: a child * produced by fork replaces its image with execve and the parent * reaps the REPLACED program (not a clone). First child execs * bin/`

#### `execthr.c`
**Path:** `progs/src/execthr.c`
**File Doc:** *execthr -- execve kills sibling threads (Linux semantics).*

**Functions:**
- `et_sc` (line 11) `static long et_sc(long n, long a1, long a2, long a3)` - *execthr -- execve kills sibling threads (Linux semantics).  Main spawns one thread that spins forever, then execve()s bin/lxhello.elf. The thread must die with the old image: lxhello prints Hello and exits 2, mrun reports it, and no fault or hang follows. A kernel that frees the old window under the live thread faults or wedges instead. The dead thread stays a zombie of the exec'd program (no reparenting in v1), so each run costs one proc slot; test-only, never a server pattern. Built as a static Linux * ELF like execho.elf.*
- `et_exit` (line 19) `static void et_exit(long code)`
- `et_thread` (line 27) `static void et_thread(void)`
- `lmain` (line 33) `int lmain(void)`

#### `fib.c`
**Path:** `progs/src/fib.c`

**Functions:**
- `fib` (line 1) `int fib(int n)`
- `main` (line 6) `int main(void)`

#### `forktest.c`
**Path:** `progs/src/forktest.c`

**Functions:**
- `fx_syscall6` (line 17) `static long fx_syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)`
- `fx_strlen` (line 41) `static unsigned long fx_strlen(const char *s)`
- `fx_write` (line 47) `static void fx_write(const char *s)`
- `fx_exit` (line 51) `static void fx_exit(long code)`
- `_start` (line 56) `void _start(void)`
- `this` (line 115) `* this (and the child's closes must survive below). */ fx_syscall6(SYS_close, pfd[1], 0, 0, 0, 0, 0);`

**Macros:**
- `SYS_read` (line 30) `#define SYS_read`
- `SYS_write` (line 31) `#define SYS_write`
- `SYS_close` (line 32) `#define SYS_close`
- `SYS_pipe` (line 33) `#define SYS_pipe`
- `SYS_yield` (line 34) `#define SYS_yield`
- `SYS_fork` (line 35) `#define SYS_fork`
- `SYS_exit` (line 36) `#define SYS_exit`
- `SYS_wait4` (line 37) `#define SYS_wait4`

#### `fptest.c`
**Path:** `progs/src/fptest.c`
**File Doc:** *fptest.c -- FPU/SSE context-switch probe (Phase 0.1, ADR-0014).*

**Functions:**
- `read_mxcsr` (line 42) `static unsigned int read_mxcsr(void)`
- `raw_gettid` (line 48) `static long raw_gettid(void)`
- `raw_getrandom` (line 52) `static long raw_getrandom(void *buf, unsigned long n)`
- `stack_align_canary` (line 78) `static void stack_align_canary(void)` - *Stack-alignment canary: an aligned SSE store to a stack slot faults with #GP unless the thread entry stack satisfies SysV (rsp%16==8 at entry, 16-aligned after the call prologue). Compiler spills would only sometimes touch the misaligned area; this faults deterministically. A fault kills the worker with -14, which the join * reports instead of a silent wrong answer.*
- `worker` (line 84) `static void *worker(void *p)`
- `main` (line 148) `int main(void)`
- `gettid` (line 21) `* * The same run smokes gettid (Phase 0.4: the two workers must observe * distinct tids, never the constant 1) and getrandom (Phase 0.5: it * must fill the buffer and report the count, never EFAULT). `

**Macros:**
- `FP_ITERS` (line 38) `#define FP_ITERS`

**Structs:**
- `fp_slot_t` (line 56)

#### `freedom.c`
**Path:** `progs/src/freedom.c`
**File Doc:** *freedom - a headless text browser for MiniOS.*

**Functions:**
- `tls_close` (line 58) `static int tls_close(int fd)` - *Session-aware close (frees the TLS session for fd, no-op when none): every fetch path must use this, never raw close(), or the next fetch reuses the recycled fd number onto a live slot and its handshake fails with "session already exists" (redirects and linked stylesheets * hit this on their second fetch). void tls_close(int fd); #else int socket(int domain, int type, int proto); int connect(int fd, void *addr, int addrlen); int sendto(int fd, char *buf, int len, int flags, void *to, int tolen); int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen); int close(int fd); /* miniGCC twin: no TLS engine linked, so no session can exist.*
- `atoi` (line 151) `static int atoi(char *s)` - *static char f_dom[FREEDOM_DOM_BUF]; static int  f_domlen; static char f_css[FREEDOM_CSS_BUF]; static int  f_csslen; static char f_linkhost[FREEDOM_CSS_MAX][64]; static char f_linkpath[FREEDOM_CSS_MAX][128]; static int  f_linkn; static int  f_cstage; static int  f_csize; static int  f_crem; static int  f_bdone; /* Decimal string to int (the ld stub set has no atol).*
- `append` (line 166) `static int append(char *dst, int pos, char *src, int cap)` - *Append src to dst at pos; returns the new length or -1 when it does not fit. A negative pos (a previous append in the chain failed) stays -1 without touching dst, so chained callers like classify_tag cannot * walk to dst-1.*
- `ci_lower` (line 176) `static int ci_lower(int c)`
- `ci_starts` (line 182) `static int ci_starts(char *s, char *pre)` - *if (pos < 0) return -1; n = strlen(src); if (pos + n >= cap) return -1; memcpy(dst + pos, src, n); dst[pos + n] = 0; return pos + n; } static int ci_lower(int c) { if (c >= 'A' && c <= 'Z') return c + ('a' - 'A'); return c; } /* Case-insensitive starts-with.*
- `ci_eq` (line 193) `static int ci_eq(char *a, char *b)` - *} /* Case-insensitive starts-with. static int ci_starts(char *s, char *pre) { while (*pre) { if (!*s) return 0; if (ci_lower(*s) != ci_lower(*pre)) return 0; s++; pre++; } return 1; } /* Case-insensitive equality.*
- `ci_index` (line 203) `static int ci_index(char *s, char *needle)` - *return 1; } /* Case-insensitive equality. static int ci_eq(char *a, char *b) { while (*a && *b) { if (ci_lower(*a) != ci_lower(*b)) return 0; a++; b++; } return *a == 0 && *b == 0; } /* Case-insensitive index of needle in haystack, or -1.*
- `looks_like_url` (line 212) `static int looks_like_url(char *s)` - *} return *a == 0 && *b == 0; } /* Case-insensitive index of needle in haystack, or -1. static int ci_index(char *s, char *needle) { int i; for (i = 0; s[i]; i++) { if (ci_starts(s + i, needle)) return i; } return -1; } /* Does the input look like an URL (no spaces, contains a dot)?*
- `has_scheme` (line 226) `static int has_scheme(char *s)` - *Does s begin with "<scheme>:" per RFC 3986 (ALPHA *(ALPHA/DIGIT/+/-/.) ":")? Any such prefix makes the string a scheme, * and the omnibox policy is: only http:// and https:// are executed.*
- `make_search` (line 242) `static void make_search(char *out, char *query, int cap)` - *char c; c = s[0]; if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))) return 0; for (i = 1; s[i]; i++) { c = s[i]; if (c == ':') return 1; if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '+' || c == '-' || c == '.')) return 0; } return 0; } /* Encode a query for the DuckDuckGo HTML endpoint (no-JS).*
- `split_url` (line 266) `static int split_url(char *url)` - *Split an http:// or https:// URL into f_host, f_path, f_port and f_secure. Returns 0 on failure. The input buffer is never modified: the parse is index-only, so it stays valid when the compiler widens * dereferenced stores.*
- `resolve_redirect` (line 313) `static int resolve_redirect(void)` - *Recompute f_host/f_path/f_port/f_secure from the last Location value. Returns 1 when the chase may continue, 0 when it must stop * (diagnostic already printed).*
- `put_ws` (line 366) `static void put_ws(void)`
- `put_utf` (line 377) `static void put_utf(int c)` - *Print one text byte through the UTF-8 gate. Remote pages are hostile data: bytes outside a valid UTF-8 sequence (overlong, surrogate, out of range) are replaced with '?' (FreeDom policy). * Sequence state is kept in f_utbuf/f_utlen/f_utrem.*
- `put_text` (line 427) `static void put_text(int c)` - *Print one text byte: whitespace collapses, everything else goes * through the UTF-8 gate. Dump modes suppress the page text.*
- `css_append` (line 483) `static void css_append(char *s, int n)`
- `css_line` (line 489) `static void css_line(char *s)`
- `dom_append` (line 494) `static void dom_append(char *s, int n)`
- `dom_space` (line 500) `static void dom_space(void)`
- `dom_nl` (line 504) `static void dom_nl(void)`
- `record_attr` (line 509) `static void record_attr(void)` - *int i; for (i = 0; i < n && f_domlen < FREEDOM_DOM_BUF - 1; i++) f_dom[f_domlen++] = s[i]; } static void dom_space(void) { if (f_domlen < FREEDOM_DOM_BUF - 1) f_dom[f_domlen++] = ' '; } static void dom_nl(void) { if (f_domlen < FREEDOM_DOM_BUF - 1) f_dom[f_domlen++] = '\n'; } /* Record the finished attribute in its place.*
- `is_void_tag` (line 534) `static int is_void_tag(void)` - *f_hreflen = f_vallen < 127 ? f_vallen : 127; memcpy(f_href, f_val, f_hreflen); f_href[f_hreflen] = 0; } else if (ci_eq(f_attr, "style")) { f_stylelen = f_vallen < (FREEDOM_ATTR_MAX - 1) ? f_vallen : (FREEDOM_ATTR_MAX - 1); memcpy(f_styleattr, f_val, f_stylelen); f_styleattr[f_stylelen] = 0; } else if (ci_eq(f_attr, "rel")) { f_rel_ss = ci_index(f_val, "stylesheet") >= 0; } } /* Is tagname a void element (no closing tag, no children)?*
- `classify_tag` (line 546) `static void classify_tag(void)` - *A tag was fully collected into f_tagn (+ attributes). Decide what it * does to the stream and the dumps.*
- `body_byte` (line 631) `static void body_byte(int c)` - *} dom_nl(); if (!is_void_tag()) f_depth++; } if (ci_eq(f_tagn, "br") || ci_eq(f_tagn, "p") || ci_eq(f_tagn, "div") || ci_eq(f_tagn, "h1") || ci_eq(f_tagn, "h2") || ci_eq(f_tagn, "h3") || ci_eq(f_tagn, "h4") || ci_eq(f_tagn, "h5") || ci_eq(f_tagn, "h6") || ci_eq(f_tagn, "li") || ci_eq(f_tagn, "tr")) { if (f_mode == 0) putchar('\n'); f_ws = 1; } } /* Feed one body byte into the filter.*
- `head_line` (line 796) `static void head_line(char *line)` - *f_rel_ss = 0; return; } if (c == '&') { f_entlen = 1; f_ent[0] = 0; return; } put_text(c); } /* --- HTTP ---------------------------------------------------------- /* Classify one header line (NUL-terminated).*
- `parse_head` (line 821) `static void parse_head(void)` - *Parse the collected header block f_hdr[0..f_hlen-1] (the last four * bytes are the terminating CRLF CRLF).*
- `recv_body` (line 843) `static int recv_body(int fd, char *buf, int len)` - *f_hdr[lend] = 0; if (i == 0) { char *sp; sp = strchr(f_hdr, ' '); if (sp) f_status = atoi(sp + 1); } else if (lend > i) { head_line(f_hdr + i); } f_hdr[lend] = '\r'; i = lend + 2; } } /* Receive body bytes: TLS for f_secure, plain TCP otherwise.*
- `send_all` (line 849) `static int send_all(int fd, char *buf, int len)` - *head_line(f_hdr + i); } f_hdr[lend] = '\r'; i = lend + 2; } } /* Receive body bytes: TLS for f_secure, plain TCP otherwise. static int recv_body(int fd, char *buf, int len) { if (f_secure) return tls_recv(fd, buf, len); return recvfrom(fd, buf, len, 0, 0, 0); } /* Send the whole request: TLS for f_secure, plain TCP otherwise.*
- `fetch` (line 860) `static int fetch(char *host, char *path, int port)` - *Send one HTTP request and process the response body. Returns the status code, or 0 on transport failure. Sets f_redir when a * Location header was seen.*
- `fetch_css` (line 1031) `static void fetch_css(char *host, char *path)` - *Fetch a linked stylesheet and print its raw body (through the UTF-8 * gate). No redirect chasing: the bound is one request.*
- `print_css_dump` (line 1113) `static void print_css_dump(void)` - *} continue; } f_ws = 0; put_utf(c); got++; } } tls_close(fd); putchar('\n'); printf("freedom: %s (%d bytes)\n", host, got); } /* Print the collected CSS dump.*
- `print_dom_dump` (line 1122) `static void print_dom_dump(void)` - *putchar('\n'); printf("freedom: %s (%d bytes)\n", host, got); } /* Print the collected CSS dump. static void print_css_dump(void) { int i; puts("=== freedom css ==="); for (i = 0; i < f_csslen; i++) put_utf(f_css[i]); if (f_csslen == 0) puts("(no css)"); if (f_linkn > 0) putchar('\n'); } /* Print the collected DOM outline.*
- `main` (line 1129) `int main(int argc, char **argv)`
- `curlfree` (line 4) `* spirit of curlfree (http.c + htmlfilter.c): a bounded header phase, * Content-Length or EOF body reading, Transfer-Encoding: chunked * decoding, redirect chasing with a hop bound, and a filter that `
- `net_dns_resolve` (line 41) `int net_dns_resolve(const char *host);` - *Ring-3 TLS build (phase 2 of docs/TLS_MIGRATION.md): host libc for sockets/stdio/strings (identical ABI numbers inside the guest); net_dns_resolve and tls_* link from the shared ring-3 TLS objects (progs/tls_u) instead of trapping kernel syscalls 200-203. stdlib.h * is deliberately absent: this file defines its own static atoi. include <stdio.h> include <string.h> include <unistd.h> include <sys/socket.h>*
- `tls_handshake` (line 42) `int tls_handshake(int fd, char *host);`
- `tls_send` (line 43) `int tls_send(int fd, char *buf, int len);`
- `tls_recv` (line 44) `int tls_recv(int fd, char *buf, int len);`
- `socket` (line 52) `int socket(int domain, int type, int proto);` - *else*
- `connect` (line 53) `int connect(int fd, void *addr, int addrlen);`
- `sendto` (line 54) `int sendto(int fd, char *buf, int len, int flags, void *to, int tolen);`
- `recvfrom` (line 55) `int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen);`
- `close` (line 56) `int close(int fd);`
- `printf` (line 63) `int printf(char *fmt, ...);`
- `puts` (line 64) `int puts(char *s);`
- `strlen` (line 65) `int strlen(char *s);`
- `strchr` (line 66) `char *strchr(char *s, int c);`
- `strcmp` (line 67) `int strcmp(char *a, char *b);`
- `strncmp` (line 68) `int strncmp(char *a, char *b, int n);`
- `memcpy` (line 69) `int memcpy(char *dst, char *src, int n);`
- `memset` (line 70) `int memset(char *dst, int c, int n);`
- `putchar` (line 71) `int putchar(int c);`

**Macros:**
- `FREEDOM_HOPS_MAX` (line 74) `#define FREEDOM_HOPS_MAX`
- `FREEDOM_HDR_MAX` (line 75) `#define FREEDOM_HDR_MAX`
- `FREEDOM_BUF` (line 76) `#define FREEDOM_BUF`
- `FREEDOM_CHUNK_MAX` (line 77) `#define FREEDOM_CHUNK_MAX`
- `FREEDOM_CSS_MAX` (line 78) `#define FREEDOM_CSS_MAX`
- `FREEDOM_CSS_BUF` (line 79) `#define FREEDOM_CSS_BUF`
- `FREEDOM_DOM_BUF` (line 80) `#define FREEDOM_DOM_BUF`
- `FREEDOM_ATTR_MAX` (line 81) `#define FREEDOM_ATTR_MAX`
- `FREEDOM_LINE_MAX` (line 82) `#define FREEDOM_LINE_MAX`

#### `freedom_wl.c`
**Path:** `progs/src/freedom_wl.c`
**File Doc:** *freedom_wl - Wayland to MiniOS intermediate layer for FreeDom.*

**Functions:**
- `freedom_wl_surface_id` (line 114) `static long freedom_wl_surface_id(void)` - *Logical Wayland-mini surface id for this client (ADR-0024). The present path still uses GFX_PRESENT BUF_NK; the id names the * client side of the wlcomp mapping and is bounds-checked.*
- `freedom_wl_surface_attach` (line 129) `static long freedom_wl_surface_attach(FreedomWlConfig *c)` - *Attach this client to the wlcomp mapping: encode an attach message for the first pool and a commit for our surface, decode both back and require the roundtrip. The present path is unchanged; this call * proves the client speaks the wire before it ever draws.*
- `freedom_wl_default` (line 158) `static FreedomWlConfig freedom_wl_default(void)` - *if (pool != WL_ID_POOL_BASE || w != (int)c->surface_w || h != (int)c->surface_h) return -1L; n = wl_commit_encode(msg, WL_MAX_MSG, (unsigned int)c->wl_surface); if (n != WL_COMMIT_SZ) return -1L; if (wl_commit_decode(msg, n, &id) != WL_ERR_OK) return -1L; if (id != (unsigned int)c->wl_surface) return -1L; return 0L; } /** Default configuration derived from the ABI header.*
- `freedom_wl_clip_rect` (line 196) `static long freedom_wl_clip_rect(FreedomWlConfig *c, long *x, long *y, long *w, long *h)` - *c.hops_max = WL_HOPS_MAX; c.font_w = WL_FONT_W; c.font_h = WL_FONT_H; c.port_http = 80L; c.port_https = 443L; c.ink_bg = (long)COL_TERMINAL; c.ink_fg = (long)COL_TERM_TXT; c.bar_bg = (long)COL_TITLEBAR; c.bar_fg = (long)COL_TITLE_TXT; c.wl_surface = freedom_wl_surface_id(); return c; } /** Clamp a dirty rect into the surface bounds.*
- `freedom_wl_frame_bytes` (line 227) `static long freedom_wl_frame_bytes(FreedomWlConfig *c, long w, long h)` - *} if (*x + *w > c->surface_w) { w = c->surface_w - *x; } if (*y + *h > c->surface_h) { h = c->surface_h - *y; } if (*w <= 0L || *h <= 0L) { return -1L; } return 0L; } /** Expected byte size of the shared-memory frame for given geometry.*
- `freedom_wl_keysym` (line 246) `static long freedom_wl_keysym(FreedomWlConfig *c, long sc)` - *if (w <= 0L || h <= 0L) { return -1L; } if (w > c->surface_w || h > c->surface_h) { return -1L; } bytes_per_pixel = 1L; if (w > 0x7FFFFFFFL / (h * bytes_per_pixel)) { return -1L; } return w * h * bytes_per_pixel; } /** Translate a PS/2 Set 1 scancode base into a keysym.*
- `freedom_wl_sanitize_utf8` (line 286) `static long freedom_wl_sanitize_utf8(char *s, long cap)` - *} if (make == 0x39L) { return 32L; } if (make == 0x0EL) { return 8L; } if (make == 0x0FL) { return 9L; } return -1L; } /** Rewrite a buffer in place to well-formed UTF-8.*
- `freedom_wl_title_ok` (line 359) `static long freedom_wl_title_ok(FreedomWlConfig *c, char *t, long n)` - *i++; } if (o >= cap - 1L) { break; } } if (o >= cap) { return -1L; } s[o] = 0; return o; } /** Validate a window title against the kernel title bound.*
- `wl_copy` (line 370) `static long wl_copy(char *dst, char *src, long cap)` - *} /** Validate a window title against the kernel title bound. static long freedom_wl_title_ok(FreedomWlConfig *c, char *t, long n) { if (!c || !t) { return -1L; } if (n < 0L || n > c->title_max) { return -1L; } return 0L; } /** Bounded string copy with NUL termination.*
- `wl_strlen` (line 388) `static long wl_strlen(char *s, long cap)` - *} i = 0L; while (src[i] != 0) { if (i + 1L >= cap) { return -1L; } dst[i] = src[i]; i++; } dst[i] = 0; return 0L; } /** Bounded string length.*
- `wl_append` (line 404) `static long wl_append(char *dst, long pos, char *src, long cap)` - *if (!s || cap <= 0L) { return -1L; } i = 0L; while (i < cap && s[i] != 0) { i++; } if (i >= cap) { return -1L; } return i; } /** Bounded append of src at dst[pos].*
- `wl_ci_lower` (line 427) `static long wl_ci_lower(long ch)` - *} if (pos + n >= cap) { return -1L; } i = 0L; while (i < n) { dst[pos + i] = src[i]; i++; } dst[pos + n] = 0; return pos + n; } /** ASCII lowercase fold.*
- `wl_ci_starts` (line 435) `static long wl_ci_starts(char *s, char *pre)` - *} dst[pos + n] = 0; return pos + n; } /** ASCII lowercase fold. static long wl_ci_lower(long ch) { if (ch >= 'A' && ch <= 'Z') { return ch + ('a' - 'A'); } return ch; } /** Case-insensitive prefix match.*
- `wl_ci_contains` (line 453) `static long wl_ci_contains(char *s, char *needle)` - *while (*pre) { if (*s == 0) { return 0L; } if (wl_ci_lower(*s) != wl_ci_lower(*pre)) { return 0L; } s++; pre++; } return 1L; } /** Case-insensitive substring search.*
- `wl_has_scheme` (line 467) `static long wl_has_scheme(char *s)` - *static long wl_ci_contains(char *s, char *needle) { if (!s || !needle) { return 0L; } while (*s) { if (wl_ci_starts(s, needle)) { return 1L; } s++; } return 0L; } /** RFC 3986 scheme probe: ALPHA *(ALPHA/DIGIT/+/-/.) then colon.*
- `wl_looks_like_url` (line 493) `static long wl_looks_like_url(char *s)` - *ch = s[i]; if (ch == ':') { return 1L; } if (!((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.')) { return 0L; } i++; } return 0L; } /** Omnibox URL probe: no spaces and at least one dot.*
- `wl_make_search` (line 512) `static long wl_make_search(char *out, char *query, long cap)` - *dot = 0L; while (*s) { if (*s == ' ' || *s == '\t') { return 0L; } if (*s == '.') { dot = 1L; } s++; } return dot; } /** Encode a query for the no-JS search endpoint.*
- `wl_split_url` (line 544) `static long wl_split_url(FreedomWlConfig *c, char *url, char *host, char *path, long *port, long ...` - *} else { out[pos] = *query; pos++; out[pos] = 0; } if (pos < 0L) { return -1L; } query++; } return pos; } /** Split an http(s) URL into host, path, port and secure flag.*
- `wl_resolve_redirect` (line 609) `static long wl_resolve_redirect(FreedomWlConfig *c, char *loc, long secure, char *host, char *pat...` - *if (plen < 0L) { return 0L; } if (wl_copy(path, p + hl, c->path_max) < 0L) { return 0L; } } else { path[0] = '/'; path[1] = 0; } return 1L; } /** Recompute host/path/port/secure from a Location value.*
- `wl_scroll_clamp` (line 689) `static long wl_scroll_clamp(FreedomWlConfig *c, long off, long nlines)` - *if (last + 1L + l >= c->path_max) { return 0L; } i = 0L; while (i < l) { path[last + 1L + i] = loc[i]; i++; } path[last + 1L + l] = 0; } return 1L; } /** Clamp a scroll offset into the page range.*
- `wl_filter_wrap` (line 708) `static long wl_filter_wrap(FreedomWlConfig *c, char *body, long n, char *lines, long maxlines, lo...` - *if (nlines <= c->text_rows) { return 0L; } maxoff = nlines - c->text_rows; if (off < 0L) { return 0L; } if (off > maxoff) { return maxoff; } return off; } /** HTML to wrapped text lines over a flat line array.*
- `wl_status_text` (line 951) `static long wl_status_text(FreedomWlConfig *c, char *host, long nbytes, long off, long nlines, ch...` - *lines[li * linelen + co] = (char)ch; co++; lines[li * linelen + co] = 0; } if (co > 0L) { return li + 1L; } if (li == 0L) { return 1L; } return li; } /** Compose the status bar line for the bottom row.*
- `freedom_wl_build_palette` (line 1039) `static long freedom_wl_build_palette(unsigned char *pal, long cap)` - *Shared hybrid palette, one table for every NK-window app (progs/nk_palette.h); this wrapper keeps the historic name and * fail-closed contract the host suite pins.*
- `freedom_wl_sys_present` (line 1062) `static long freedom_wl_sys_present(long buf, long origin)` - *static char w_host[WL_HOST_MAX]; static char w_path[WL_PATH_MAX]; static char w_loc[WL_URL_MAX]; static char w_hdr[WL_HDR_MAX]; static char w_body[WL_BODY_CAP]; static char w_lines[WL_LINES_MAX][WL_LINE_LEN]; static long w_nlines; static long w_nbytes; static long w_secure; static long w_port; static long w_status; static long w_truncated; /** Present syscall wrapper for the NK buffer path.*
- `freedom_wl_sys_title` (line 1069) `static long freedom_wl_sys_title(char *t)` - *static long w_nbytes; static long w_secure; static long w_port; static long w_status; static long w_truncated; /** Present syscall wrapper for the NK buffer path. static long freedom_wl_sys_present(long buf, long origin) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_PRESENT), "D"(buf), "S"(origin) : "rcx", "r11", "memory"); return ret; } /** Set window title through the generic title syscall.*
- `freedom_wl_sys_palette` (line 1076) `static long freedom_wl_sys_palette(unsigned char *pal)` - *static long freedom_wl_sys_present(long buf, long origin) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_PRESENT), "D"(buf), "S"(origin) : "rcx", "r11", "memory"); return ret; } /** Set window title through the generic title syscall. static long freedom_wl_sys_title(char *t) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_SET_TITLE), "D"(t) : "rcx", "r11", "memory"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels.*
- `freedom_wl_sys_mouse` (line 1083) `static long freedom_wl_sys_mouse(long *m)` - *static long freedom_wl_sys_title(char *t) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_SET_TITLE), "D"(t) : "rcx", "r11", "memory"); return ret; } /** Upload the 768-byte graphics palette before presenting indexed pixels. static long freedom_wl_sys_palette(unsigned char *pal) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_PALETTE), "D"(pal) : "rcx", "r11", "memory"); return ret; } /** Read desktop mouse state into a four word buffer.*
- `freedom_wl_sys_kbd` (line 1090) `static long freedom_wl_sys_kbd(void)` - *static long freedom_wl_sys_palette(unsigned char *pal) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_PALETTE), "D"(pal) : "rcx", "r11", "memory"); return ret; } /** Read desktop mouse state into a four word buffer. static long freedom_wl_sys_mouse(long *m) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_MOUSE), "D"(m) : "rcx", "r11", "memory"); return ret; } /** Poll one raw keyboard scancode, negative when idle.*
- `freedom_wl_sys_vga_mode` (line 1097) `static long freedom_wl_sys_vga_mode(long on)` - *static long freedom_wl_sys_mouse(long *m) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_MOUSE), "D"(m) : "rcx", "r11", "memory"); return ret; } /** Poll one raw keyboard scancode, negative when idle. static long freedom_wl_sys_kbd(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD), "D"(0) : "rcx", "r11", "memory"); return ret; } /** Tell the kernel a graphics program owns the display.*
- `freedom_wl_sys_kbd_raw` (line 1104) `static long freedom_wl_sys_kbd_raw(long on)` - *static long freedom_wl_sys_kbd(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD), "D"(0) : "rcx", "r11", "memory"); return ret; } /** Tell the kernel a graphics program owns the display. static long freedom_wl_sys_vga_mode(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_VGA_MODE), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Switch the console into raw scancode mode.*
- `freedom_wl_sys_yield` (line 1111) `static long freedom_wl_sys_yield(void)` - *static long freedom_wl_sys_vga_mode(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_VGA_MODE), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Switch the console into raw scancode mode. static long freedom_wl_sys_kbd_raw(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD_RAW), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Voluntary yield to the scheduler.*
- `wl_parse_headers` (line 1118) `static long wl_parse_headers(FreedomWlConfig *c, char *hdr, long *status, long *clen, long *hascl...` - *static long freedom_wl_sys_kbd_raw(long on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD_RAW), "D"(on) : "rcx", "r11", "memory"); return ret; } /** Voluntary yield to the scheduler. static long freedom_wl_sys_yield(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_SCHED_YIELD), "D"(0) : "rcx", "r11", "memory"); return ret; } /** Parse response headers into status, length, encoding and routing.*
- `wl_fetch_raw` (line 1210) `static long wl_fetch_raw(FreedomWlConfig *c, char *host, char *path, long port, long secure)` - *if (!wl_ci_starts(hdr + k, "text")) { istext = 0L; } } } line++; while (hdr[i] == '\r' || hdr[i] == '\n') { i++; } } return 0L; } /** Fetch one response body into the page buffer.*
- `wl_render` (line 1445) `static long wl_render(FreedomWlConfig *c, long off)` - *if (got < c->body_cap) { w_body[got] = (char)ch; got++; } else { w_truncated = 1L; } } } } tls_close((int)fd); return got; } /** Render the page window at the given scroll offset.*
- `wl_browse` (line 1532) `static long wl_browse(FreedomWlConfig *c)` - *long ink; if (bits & (0x80 >> px)) { ink = c->bar_fg; } else { ink = c->bar_bg; } fb[(c->text_rows * c->font_h + row) * c->surface_w + col * c->font_w + px] = (unsigned char)ink; } } } return freedom_wl_sys_present(c->present_buf, 0L); } /** Interactive scroll loop until q or ESC quits.*
- `freedom_wl_selftest` (line 1613) `static long freedom_wl_selftest(void)` - *off = off + (long)m[3] * c->scroll_step; changed = 1L; } if (changed) { off = wl_scroll_clamp(c, off, w_nlines); if (wl_render(c, off) < 0L) { return 1L; } } freedom_wl_sys_yield(); } } /** Guest selftest entry mirroring the Nuklear frame contract.*
- `freedom_wl_host_probe` (line 1696) `int freedom_wl_host_probe(FreedomWlConfig *c)` - *return 1L; } if (freedom_wl_sys_kbd() > 0x7FFFFFFFL) { printf("freedom_wl: kbd out of range\n"); return 1L; } freedom_wl_sys_title("FreeDom"); printf("freedom_wl: frame ok (%ldx%ld)\n", c.surface_w, c.surface_h); return 0L; } #endif #ifdef FREEDOM_WL_HOST_TEST /** Host harness entry for the pure mapping logic.*
- `main` (line 1731) `int main(int argc, char **argv)` - *} buf[0] = 'h'; buf[1] = 'i'; buf[2] = 0; if (freedom_wl_sanitize_utf8(buf, 16L) != 2L) { return 1; } if (freedom_wl_surface_attach(c) != 0L) { return 1; } return 0; } #else /** Guest entry point shared by the MiniFS binary.*
- `net_dns_resolve` (line 42) `int net_dns_resolve(const char *host);`
- `tls_handshake` (line 43) `int tls_handshake(int fd, char *host);`
- `tls_send` (line 44) `int tls_send(int fd, char *buf, int len);`
- `tls_recv` (line 45) `int tls_recv(int fd, char *buf, int len);`
- `tls_close` (line 46) `void tls_close(int fd);`

**Macros:**
- `WL_COLS` (line 49) `#define WL_COLS`
- `WL_ROWS` (line 50) `#define WL_ROWS`
- `WL_TEXT_ROWS` (line 51) `#define WL_TEXT_ROWS`
- `WL_LINES_MAX` (line 52) `#define WL_LINES_MAX`
- `WL_LINE_LEN` (line 53) `#define WL_LINE_LEN`
- `WL_BODY_CAP` (line 54) `#define WL_BODY_CAP`
- `WL_HDR_MAX` (line 55) `#define WL_HDR_MAX`
- `WL_NET_BUF` (line 56) `#define WL_NET_BUF`
- `WL_REQ_MAX` (line 57) `#define WL_REQ_MAX`
- `WL_HOST_MAX` (line 58) `#define WL_HOST_MAX`
- `WL_PATH_MAX` (line 59) `#define WL_PATH_MAX`
- `WL_URL_MAX` (line 60) `#define WL_URL_MAX`
- `WL_HOPS_MAX` (line 61) `#define WL_HOPS_MAX`
- `WL_FONT_W` (line 62) `#define WL_FONT_W`
- `WL_FONT_H` (line 63) `#define WL_FONT_H`
- `WL_TAG_MAX` (line 64) `#define WL_TAG_MAX`
- `WL_ENT_MAX` (line 65) `#define WL_ENT_MAX`

**Structs:**
- `FreedomWlConfig` (line 76) - *#define WL_FONT_W 8L #define WL_FONT_H 8L #define WL_TAG_MAX 16L #define WL_ENT_MAX 10L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Well-known network endpoints. static const char WL_SEARCH_HOST[] = "html.duckduckgo.com"; static const char WL_SEARCH_PREFIX[] = "/html/?q="; static const char WL_USER_AGENT[] = "freedom_wl/1.0 (MiniOS)"; /** Centralized configuration for the Wayland to MiniOS mapping.*

**Type_Aliases:**
- `present_buf` (line 76) `typedef struct FreedomWlConfig { long present_buf;` - *#define WL_FONT_W 8L #define WL_FONT_H 8L #define WL_TAG_MAX 16L #define WL_ENT_MAX 10L /** Shared 8x8 bitmap font, one copy in progs/nuklear/font8x8.c. extern const uint8_t nk_font8x8[96][8]; /** Well-known network endpoints. static const char WL_SEARCH_HOST[] = "html.duckduckgo.com"; static const char WL_SEARCH_PREFIX[] = "/html/?q="; static const char WL_USER_AGENT[] = "freedom_wl/1.0 (MiniOS)"; /** Centralized configuration for the Wayland to MiniOS mapping.*

#### `ftest.c`
**Path:** `progs/src/ftest.c`
**File Doc:** *Exercises the kernel libc surface used by loaded .o programs:*

**Functions:**
- `main` (line 13) `int main(int argc, char **argv)`
- `fprintf` (line 4) `extern int fprintf(void *stream, const char *fmt, ...);` - *Exercises the kernel libc surface used by loaded .o programs: fprintf to stdout/stderr, snprintf into a buffer, errno on a failed * open, and exit().*
- `snprintf` (line 5) `extern int snprintf(char *buf, unsigned long size, const char *fmt, ...);`
- `printf` (line 6) `extern int printf(const char *fmt, ...);`
- `exit` (line 7) `extern void exit(int code);`
- `fopen` (line 11) `extern void *fopen(const char *path, const char *mode);`

**Variables:**
- `stdout` (line 8) `extern void *stdout;`
- `stderr` (line 9) `extern void *stderr;`
- `errno` (line 10) `extern int errno;`

#### `hello.c`
**Path:** `progs/src/hello.c`
**File Doc:** *MiniOS test program — compiled as relocatable .o, loaded by kernel ELF loader*

**Functions:**
- `main` (line 4) `int main(int argc, char **argv)`
- `printf` (line 2) `extern int printf(const char *fmt, ...);` - */* MiniOS test program — compiled as relocatable .o, loaded by kernel ELF loader*

#### `http.c`
**Path:** `progs/src/http.c`
**File Doc:** *Minimal HTTP/1.0 GET through the Linux socket syscalls.*

**Functions:**
- `atoi` (line 18) `int atoi(char *s)` - *int socket(int domain, int type, int proto); int connect(int fd, void *addr, int addrlen); int sendto(int fd, char *buf, int len, int flags, void *to, int tolen); int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen); int shutdown(int fd, int how); int close(int fd); int net_dns_resolve(const char *host); int puts(char *s); int printf(char *fmt, ...); int strlen(char *s); int putchar(int c); /* Decimal string to int (the ld stub set has no atol).*
- `main` (line 29) `int main(int argc, char **argv)`
- `kernel` (line 3) `* Hostnames are resolved by the kernel (net_dns_resolve syscall). */ int socket(int domain, int type, int proto);`
- `connect` (line 6) `int connect(int fd, void *addr, int addrlen);`
- `sendto` (line 7) `int sendto(int fd, char *buf, int len, int flags, void *to, int tolen);`
- `recvfrom` (line 8) `int recvfrom(int fd, char *buf, int len, int flags, void *from, int *fromlen);`
- `shutdown` (line 9) `int shutdown(int fd, int how);`
- `close` (line 10) `int close(int fd);`
- `net_dns_resolve` (line 11) `int net_dns_resolve(const char *host);`
- `puts` (line 12) `int puts(char *s);`
- `printf` (line 13) `int printf(char *fmt, ...);`
- `strlen` (line 14) `int strlen(char *s);`
- `putchar` (line 15) `int putchar(int c);`

#### `json.c`
**Path:** `progs/src/json.c`
**File Doc:** *json.c - command path JSON tool: validate, pretty-print and query.*

**Functions:**
- `js_read_all` (line 58) `static char *js_read_all(const char *name, int *len)`
- `js_new` (line 76) `static int js_new(void)`
- `js_skip_ws` (line 81) `static void js_skip_ws(void)`
- `js_peek` (line 89) `static int js_peek(void)`
- `js_parse_string` (line 97) `static int js_parse_string(void)`
- `js_parse_number` (line 133) `static int js_parse_number(void)`
- `js_key_match` (line 143) `static int js_key_match(int child, const char *key)`
- `js_parse_object` (line 147) `static int js_parse_object(void)`
- `js_parse_array` (line 182) `static int js_parse_array(void)`
- `js_parse_value` (line 211) `static int js_parse_value(void)`
- `js_indent` (line 281) `static void js_indent(int n)`
- `js_print_str` (line 286) `static void js_print_str(const char *s)`
- `js_print_value` (line 303) `static void js_print_value(int node, int depth)`
- `js_find_member` (line 347) `static int js_find_member(int obj, const char *key)`
- `js_array_at` (line 357) `static int js_array_at(int arr, int idx)`
- `js_query` (line 369) `static int js_query(int root, const char *path)`
- `main` (line 401) `int main(int argc, char **argv)`
- `js_str` (line 5) `* members keep their key in js_str (the member value node) and their value * in the node itself, and object members / array elements are chained with * js_next. * * Usage: json <file> validate and pre`
- `free` (line 14) `void free();`
- `printf` (line 15) `int printf();`
- `putchar` (line 16) `int putchar();`
- `puts` (line 17) `int puts();`
- `strlen` (line 18) `int strlen();`
- `strcmp` (line 19) `int strcmp();`
- `fopen` (line 20) `void *fopen();`
- `fclose` (line 21) `int fclose();`
- `fread` (line 22) `int fread();`
- `fseek` (line 23) `int fseek();`
- `ftell` (line 24) `int ftell();`
- `rewind` (line 25) `void rewind();`

**Macros:**
- `JS_MAX_NODES` (line 27) `#define JS_MAX_NODES`
- `JS_POOL` (line 28) `#define JS_POOL`
- `JS_NULL` (line 30) `#define JS_NULL`
- `JS_BOOL` (line 31) `#define JS_BOOL`
- `JS_NUM` (line 32) `#define JS_NUM`
- `JS_STR` (line 33) `#define JS_STR`
- `JS_OBJ` (line 34) `#define JS_OBJ`
- `JS_ARR` (line 35) `#define JS_ARR`
- `JS_SEEK_END` (line 37) `#define JS_SEEK_END`
- `JS_EXIT_OK` (line 38) `#define JS_EXIT_OK`
- `JS_EXIT_FAIL` (line 39) `#define JS_EXIT_FAIL`

#### `kmem.c`
**Path:** `progs/src/kmem.c`
**File Doc:** *Kernel-pointer rejection probe. Passes a supervisor-only address*

**Functions:**
- `syscall3` (line 7) `static long syscall3(long n, long a1, long a2, long a3)` - *Kernel-pointer rejection probe. Passes a supervisor-only address (0x0C100000, inside the kernel heap at 0x0C000000) to write(2). The hardened syscall boundary must reject it with -EFAULT; the program exits 0 when the write was refused and 1 when the kernel wrongly dereferenced a kernel pointer on its behalf. Built as a static Linux * ELF like lxhello.elf.*
- `exit_now` (line 14) `static void exit_now(long code)`
- `_start` (line 18) `void _start(void)`

#### `ldhello.c`
**Path:** `progs/src/ldhello.c`

**Functions:**
- `main` (line 1) `int main(void)`

#### `lxabi.c`
**Path:** `progs/src/lxabi.c`
**File Doc:** *lxabi.c - Linux process, thread and descriptor ABI probe (FreeDom*

**Functions:**
- `report` (line 65) `static void report(const char *name, int ok, const char *detail)`
- `now_ms` (line 75) `static long now_ms(void)`
- `busy_wait_ms` (line 81) `static void busy_wait_ms(long ms)`
- `fork_probe` (line 95) `static void fork_probe(uint64_t *out)` - *Raw clone(SIGCHLD) with known values in every callee-saved register and in * the argument registers; both sides store what they see after the syscall.*
- `regs_match` (line 132) `static int regs_match(const uint64_t *r)`
- `check_fork_registers` (line 138) `static void check_fork_registers(void)`
- `check_fork_cow_kernel_write` (line 160) `static void check_fork_cow_kernel_write(void)`
- `worker` (line 201) `static void *worker(void *arg)`
- `check_threads` (line 215) `static void check_threads(void)`
- `detached_worker` (line 245) `static void *detached_worker(void *arg)`
- `check_detached_reaped` (line 251) `static void check_detached_reaped(void)`
- `signaller` (line 275) `static void *signaller(void *arg)`
- `check_condvar` (line 285) `static void check_condvar(void)`
- `check_pipe2_flags` (line 307) `static void check_pipe2_flags(void)`
- `check_pipe_blocking` (line 334) `static void check_pipe_blocking(void)`
- `check_pipe_epipe` (line 356) `static void check_pipe_epipe(void)`
- `check_writev_pipe` (line 382) `static void check_writev_pipe(void)`
- `check_poll` (line 394) `static void check_poll(void)`
- `check_eventfd` (line 418) `static void check_eventfd(void)`
- `check_close_range` (line 443) `static void check_close_range(void)`
- `check_time` (line 455) `static void check_time(void)`
- `check_mkdir` (line 464) `static void check_mkdir(void)`
- `check_limits` (line 478) `static void check_limits(void)` - *The answers glibc sizes memory from: a finite stack limit (thread stacks default to it) and a CPU count that matches the affinity mask * (malloc allows 8 arenas per CPU, each reserving 64 MB of address space).*
- `mono_us` (line 491) `static long mono_us(void)`
- `check_sleep` (line 500) `static void check_sleep(void)` - *Sleeps really wait: nanosleep for a relative interval, clock_nanosleep until an absolute monotonic deadline, and a malformed interval is * EINVAL instead of a silent zero-length sleep.*
- `lxabi_sleeper` (line 527) `static void *lxabi_sleeper(void *arg)` - *rc = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &abs_t, NULL); waited = mono_us() - t0; report("clock-nanosleep-abstime", rc == 0 && waited >= (LXABI_SLEEP_MS - 1) * 1000L, "absolute clock_nanosleep returned before its deadline"); errno = 0; rc = nanosleep(&bad, NULL); report("nanosleep-einval", rc == -1 && errno == EINVAL, "tv_nsec of one second accepted"); struct timespec res = { -1, -1 }; rc = clock_getres(CLOCK_MONOTONIC, &res); report("clock-getres", rc == 0 && res.tv_sec == 0 && res.tv_nsec > 0 && res.tv_nsec <= 1000000L, "monotonic resolution missing or coarser than 1 ms"); } /* A worker thread that sleeps forever: only a group-wide exit ends it.*
- `child_status` (line 535) `static int child_status(void (*body)(void))` - *Fork a child that runs body, wait for it with a bounded spin and return * its wait status, or -1 when it never ended (the group outlived it).*
- `abort_from_worker_body` (line 555) `static void abort_from_worker_body(void)`
- `lxabi_exit_group_worker` (line 561) `static void *lxabi_exit_group_worker(void *arg)`
- `exit_group_from_worker_body` (line 567) `static void exit_group_from_worker_body(void)`
- `wild_jump_body` (line 573) `static void wild_jump_body(void)`
- `process` (line 581) `* process (never a kernel panic), and kill(pid, 0) or a harmless signal
 * leaves the target aliv...`
- `check_uid_gid` (line 642) `static void check_uid_gid(void)` - *Every process runs as root (uid/gid 0); glibc and CPython's startup * read these, and -ENOSYS made them answer (uid_t)-1.*
- `check_rename_dir` (line 649) `static void check_rename_dir(void)` - *Directory rename within one parent: Linux allows it, and pip's * uninstall stashes a whole dist-info/pycache directory this way.*
- `copy_dentry_name` (line 715) `static void copy_dentry_name(char *dst, size_t cap, const char *src)` - *getdents64 (217): a directory fd enumerates MiniFS entries with the right d_type and resumes across calls; a regular file fd answers * ENOTDIR. CPython's os.scandir/FileFinder ride exactly this.*
- `check_getdents64` (line 722) `static void check_getdents64(void)`
- `main` (line 789) `int main(void)`

**Macros:**
- `_GNU_SOURCE` (line 17) `#define _GNU_SOURCE`
- `LXABI_CHILD_DELAY_MS` (line 41) `#define LXABI_CHILD_DELAY_MS`
- `LXABI_THREADS` (line 42) `#define LXABI_THREADS`
- `LXABI_THREAD_ITERS` (line 43) `#define LXABI_THREAD_ITERS`
- `LXABI_DETACHED` (line 44) `#define LXABI_DETACHED`
- `LXABI_WAIT_SPINS` (line 45) `#define LXABI_WAIT_SPINS`
- `LXABI_GROUP_EXIT_CODE` (line 46) `#define LXABI_GROUP_EXIT_CODE`
- `LXABI_SLEEP_MS` (line 47) `#define LXABI_SLEEP_MS`
- `LXABI_MAX_SANE_CPUS` (line 48) `#define LXABI_MAX_SANE_CPUS`
- `LXABI_TIMEDWAIT_MS` (line 49) `#define LXABI_TIMEDWAIT_MS`
- `LXABI_EPOCH_2023` (line 50) `#define LXABI_EPOCH_2023`
- `LXABI_CLOCK_SKEW_S` (line 51) `#define LXABI_CLOCK_SKEW_S`
- `LXABI_REG_PROBE_WORDS` (line 52) `#define LXABI_REG_PROBE_WORDS`
- `LXABI_CLONE_NR` (line 53) `#define LXABI_CLONE_NR`
- `LXABI_SIGCHLD` (line 54) `#define LXABI_SIGCHLD`
- `LXABI_A6_MAGIC` (line 55) `#define LXABI_A6_MAGIC`
- `LXABI_CHILD_BAD` (line 56) `#define LXABI_CHILD_BAD`
- `LXABI_MKDIR_PATH` (line 57) `#define LXABI_MKDIR_PATH`
- `LXABI_MKDIR_FILE` (line 58) `#define LXABI_MKDIR_FILE`
- `LXABI_CLOSE_RANGE_NR` (line 59) `#define LXABI_CLOSE_RANGE_NR`
- `LXABI_PAGE` (line 60) `#define LXABI_PAGE`
- `LXABI_COW_WORD` (line 61) `#define LXABI_COW_WORD`

**Structs:**
- `thread_result` (line 195)

**Type_Aliases:**
- `tls_seen` (line 194) `typedef struct thread_result { long tls_seen;`

#### `lxhello.c`
**Path:** `progs/src/lxhello.c`

**Functions:**
- `lx_syscall3` (line 11) `static long lx_syscall3(long n, long a1, long a2, long a3)`
- `lx_strlen` (line 23) `static unsigned long lx_strlen(const char *s)`
- `lx_write` (line 29) `static void lx_write(const char *s)`
- `lx_write_int` (line 33) `static void lx_write_int(long v)`
- `lmain` (line 46) `int lmain(long argc, char **argv)` - *static void lx_write_int(long v) { char buf[24]; int i = (int)sizeof(buf); int neg = 0; buf[--i] = 0; if (v < 0) { neg = 1; v = -v; } if (v == 0) buf[--i] = '0'; while (v > 0 && i > 0) { buf[--i] = (char)('0' + v % 10); v /= 10; } if (neg && i > 0) buf[--i] = '-'; lx_write(&buf[i]); } /* Entry called by _start with the real argc/argv pulled off the stack.*

**Macros:**
- `SYS_write` (line 20) `#define SYS_write`
- `SYS_exit` (line 21) `#define SYS_exit`

#### `lxnet.c`
**Path:** `progs/src/lxnet.c`
**File Doc:** *lxnet.c - Linux socket ABI probe (FreeDom readiness step 6,*

**Functions:**
- `report` (line 49) `static void report(const char *name, int ok, const char *detail)`
- `wait_for` (line 55) `static int wait_for(int fd, short events)`
- `read_all` (line 62) `static int read_all(int fd, char *buf, size_t len)` - *static void report(const char *name, int ok, const char *detail) { if (ok) printf("lxnet: %s ok\n", name); else { printf("lxnet: %s FAIL %s\n", name, detail ? detail : ""); failures++; } fflush(stdout); } static int wait_for(int fd, short events) { struct pollfd p = { fd, events, 0 }; int r = poll(&p, 1, LXNET_WAIT_MS); return r == 1 && (p.revents & events); } /* Read exactly len bytes or fail (waits through poll between chunks).*
- `check_udp` (line 73) `static void check_udp(const struct sockaddr_in *peer)`
- `check_refused` (line 150) `static void check_refused(const struct sockaddr_in *peer)` - *A non-blocking connect to a port nobody listens on fails through poll * (POLLERR) with SO_ERROR = ECONNREFUSED, cleared once read.*
- `check_tcp` (line 174) `static void check_tcp(const struct sockaddr_in *peer)`
- `check_misc` (line 217) `static void check_misc(void)`
- `dial` (line 236) `static int dial(const char *host, const char *port)` - *if (fd >= 0) close(fd); struct addrinfo hints, *res = NULL; memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; int rc = getaddrinfo("localhost", "80", &hints, &res); int ok = rc == 0 && res && res->ai_family == AF_INET && ((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr == inet_addr(LXNET_LOOPBACK); report("getaddrinfo-hosts", ok, rc ? gai_strerror(rc) : "wrong address"); if (res) freeaddrinfo(res); } /* Resolve host and dial port the way libcurl does; 0 when connected.*
- `main` (line 280) `int main(int argc, char **argv)`

**Macros:**
- `_GNU_SOURCE` (line 24) `#define _GNU_SOURCE`
- `LXNET_WAIT_MS` (line 40) `#define LXNET_WAIT_MS`
- `LXNET_BUF` (line 41) `#define LXNET_BUF`
- `LXNET_UDP_MSG` (line 42) `#define LXNET_UDP_MSG`
- `LXNET_TCP_MSG` (line 43) `#define LXNET_TCP_MSG`
- `LXNET_LOOPBACK` (line 44) `#define LXNET_LOOPBACK`
- `LXNET_IP_UNKNOWN` (line 45) `#define LXNET_IP_UNKNOWN`

#### `lxproc.c`
**Path:** `progs/src/lxproc.c`
**File Doc:** *lxproc.c - foreground process-note probe (docs/spec/shell-fs.md, "Process*

**Functions:**
- `report_exe` (line 50) `static int report_exe(void)` - *uint32_t namesz; uint32_t descsz; uint32_t type; char     name[sizeof MINIOS_NOTE_NAME]; uint32_t desc; }; __attribute__((section(".note.minios.process"), used, aligned(4))) static const struct lxproc_note lxproc_process_note = { sizeof MINIOS_NOTE_NAME, sizeof(uint32_t), MINIOS_NOTE_PROCESS, MINIOS_NOTE_NAME, 1u }; #endif /** Print the image path the kernel reports; 0 on success.*
- `report_fork` (line 64) `static int report_fork(void)` - *Fork a child that exits with LXPROC_CHILD_CODE and reap it; 0 when the * outcome is one of the two the contract allows.*
- `main` (line 91) `int main(void)`

**Macros:**
- `_GNU_SOURCE` (line 17) `#define _GNU_SOURCE`
- `LXPROC_EXE_MAX` (line 27) `#define LXPROC_EXE_MAX`
- `LXPROC_CHILD_CODE` (line 29) `#define LXPROC_CHILD_CODE`
- `LXPROC_OK` (line 30) `#define LXPROC_OK`
- `LXPROC_BAD` (line 31) `#define LXPROC_BAD`

**Structs:**
- `lxproc_note` (line 35) - *#include <sys/wait.h> #include <unistd.h> #include "minios_abi.h" /** Bytes kept from the /proc/self/exe answer. #define LXPROC_EXE_MAX 128 /** Exit status the forked child reports, so the reap proves it ran. #define LXPROC_CHILD_CODE 7 #define LXPROC_OK 0 #define LXPROC_BAD 1 #ifdef LXPROC_PROCESS_NOTE /** MiniOS process note: name, 4-byte descriptor, both 4-byte padded.*

#### `lxsecc.c`
**Path:** `progs/src/lxsecc.c`
**File Doc:** *lxsecc.c - Linux seccomp-bpf, prctl and /proc/self/exe probe (FreeDom*

**Functions:**
- `report` (line 44) `static void report(const char *name, int ok, const char *detail)`
- `exit_code_of` (line 53) `static int exit_code_of(int st)` - *Exit code of a reaped child under both encodings: Linux's status word (code << 8, signal in the low bits) and MiniOS's raw code. A signal death * reads as its nonzero signal number.*
- `run_child` (line 58) `static int run_child(void (*body)(void))`
- `install_filter` (line 72) `static int install_filter(unsigned getpid_action)` - *Filter: arch guard, getpid -> ERRNO(err_getpid), write/exit/exit_group/ * rt_sigreturn/mprotect(no PROT_EXEC)/fork paths allowed, all else KILL.*
- `child_errno_action` (line 100) `static void child_errno_action(void)`
- `child_kill_action` (line 107) `static void child_kill_action(void)`
- `child_wx` (line 116) `static void child_wx(void)` - *The page is the child's own anonymous mapping, made before the filter (which forbids mmap): a copy-on-write page shared with the parent would * test the kernel's CoW rules instead of the filter's argument check.*
- `grandchild_inherits` (line 127) `static void grandchild_inherits(void)`
- `child_inherit` (line 133) `static void child_inherit(void)`
- `child_stacked` (line 142) `static void child_stacked(void)`
- `child_strict` (line 150) `static void child_strict(void)`
- `child_no_nnp` (line 157) `static void child_no_nnp(void)`
- `child_bad_program` (line 165) `static void child_bad_program(void)`
- `check_prctl_flags` (line 177) `static void check_prctl_flags(void)`
- `check_proc_self_exe` (line 197) `static void check_proc_self_exe(const char *argv0)`
- `main` (line 215) `int main(int argc, char **argv)`

**Macros:**
- `_GNU_SOURCE` (line 13) `#define _GNU_SOURCE`
- `LXSECC_EXEC_FLAG` (line 28) `#define LXSECC_EXEC_FLAG`
- `LXSECC_EXEC_CODE` (line 29) `#define LXSECC_EXEC_CODE`
- `LXSECC_OK_CODE` (line 30) `#define LXSECC_OK_CODE`
- `LXSECC_BAD_CODE` (line 31) `#define LXSECC_BAD_CODE`
- `LXSECC_EXE_MAX` (line 32) `#define LXSECC_EXE_MAX`
- `LXSECC_NAME` (line 33) `#define LXSECC_NAME`
- `LXSECC_NAME_MAX` (line 34) `#define LXSECC_NAME_MAX`
- `LXSECC_ERRNO_A` (line 35) `#define LXSECC_ERRNO_A`
- `LXSECC_ERRNO_B` (line 36) `#define LXSECC_ERRNO_B`
- `LXSECC_PAGE` (line 37) `#define LXSECC_PAGE`
- `LXSECC_STATUS_MASK` (line 38) `#define LXSECC_STATUS_MASK`
- `LXSECC_STATUS_SHIFT` (line 39) `#define LXSECC_STATUS_SHIFT`
- `LXSECC_STATUS_BYTE` (line 40) `#define LXSECC_STATUS_BYTE`

#### `lxsel.c`
**Path:** `progs/src/lxsel.c`
**File Doc:** *lxsel.c -- select(2)/pselect6(2) ABI probe (docs/spec/python.md).*

**Functions:**
- `report` (line 36) `static void report(const char *name, int ok)`
- `raw_select` (line 45) `static long raw_select(long nfds, fd_set *r, fd_set *w, fd_set *e,
                       struct ...`
- `raw_pselect6` (line 50) `static long raw_pselect6(long nfds, fd_set *r, fd_set *w, fd_set *e,
                         str...`
- `elapsed_ms` (line 55) `static long elapsed_ms(struct timespec *a, struct timespec *b)`
- `main` (line 60) `int main(void)`

**Macros:**
- `_GNU_SOURCE` (line 17) `#define _GNU_SOURCE`
- `LXSEL_NFDS_OUT_OF_RANGE` (line 28) `#define LXSEL_NFDS_OUT_OF_RANGE`
- `LXSEL_BAD_FD` (line 29) `#define LXSEL_BAD_FD`
- `LXSEL_TIMEOUT_US` (line 30) `#define LXSEL_TIMEOUT_US`
- `LXSEL_TIMEOUT_MS_MIN` (line 31) `#define LXSEL_TIMEOUT_MS_MIN`
- `LXSEL_PSELECT_TIMEOUT_NS` (line 32) `#define LXSEL_PSELECT_TIMEOUT_NS`

#### `lxtls.c`
**Path:** `progs/src/lxtls.c`
**File Doc:** *lxtls.c - libcurl/OpenSSL fetch probe (FreeDom readiness step 6,*

**Functions:**
- `lxtls_sink` (line 39) `static size_t lxtls_sink(char *data, size_t size, size_t nmemb, void *user)` - *Count the body without storing it: the probe proves transport, not * content.*
- `lxtls_debug` (line 46) `static int lxtls_debug(CURL *h, curl_infotype type, char *data, size_t size, void *user)` - *Count the body without storing it: the probe proves transport, not * content. static size_t lxtls_sink(char *data, size_t size, size_t nmemb, void *user) { (void)data; (size_t *)user += size * nmemb; return size * nmemb; } /* Echo libcurl's informational and header lines, one prefixed line each.*
- `lxtls_step` (line 65) `static int lxtls_step(const char *name, int ok)` - *return 0; for (i = 0; i <= size; i++) { if (i == size || data[i] == '\n') { size_t len = i - start; if (len > 0 && data[start + len - 1] == '\r') len--; if (len > 0) printf("lxtls| %.*s\n", (int)len, data + start); start = i + 1; } } fflush(stdout); return 0; } /* Report one RAND step and, on failure, OpenSSL's error queue.*
- `lxtls_rand` (line 73) `static int lxtls_rand(void)` - *} fflush(stdout); return 0; } /* Report one RAND step and, on failure, OpenSSL's error queue. static int lxtls_step(const char *name, int ok) { printf("lxtls: rand %s %s\n", name, ok ? "ok" : "FAIL"); if (!ok) ERR_print_errors_fp(stdout); fflush(stdout); return ok; } /* lxtls --rand: every layer RAND_status depends on, bottom up.*
- `main` (line 87) `int main(int argc, char **argv)`

**Macros:**
- `LXTLS_TIMEOUT_S` (line 31) `#define LXTLS_TIMEOUT_S`
- `LXTLS_CONNECT_S` (line 32) `#define LXTLS_CONNECT_S`
- `LXTLS_MAX_REDIRECTS` (line 33) `#define LXTLS_MAX_REDIRECTS`
- `LXTLS_CA_BUNDLE` (line 34) `#define LXTLS_CA_BUNDLE`
- `LXTLS_RAND_BYTES` (line 35) `#define LXTLS_RAND_BYTES`

#### `lz4.c`
**Path:** `progs/src/lz4.c`
**File Doc:** *lz4.c - command path LZ4 (de)compression tools: lz4 and unlz4.*

**Functions:**
- `lz4_has` (line 39) `static int lz4_has(const char *s, const char *needle)`
- `lz4_read_all` (line 53) `static char *lz4_read_all(const char *name, int *len)`
- `lz4_write_all` (line 70) `static int lz4_write_all(const char *name, char *data, int len)`
- `lz4_compress_file` (line 80) `static int lz4_compress_file(const char *src, const char *dst)`
- `lz4_decompress_file` (line 117) `static int lz4_decompress_file(const char *src, const char *dst)`
- `main` (line 164) `int main(int argc, char **argv)`
- `kernel` (line 6) `* * The codec lives in the kernel (lz4_kernel.c, the same one MiniFS uses), so * these tools are thin front-ends over the two MiniOS syscalls 216 * (lz4_compress) and 255 (lz4_decompress), which mirro`
- `free` (line 15) `void free();`
- `printf` (line 16) `int printf();`
- `strcmp` (line 17) `int strcmp();`
- `strlen` (line 18) `int strlen();`
- `fopen` (line 19) `void *fopen();`
- `fclose` (line 20) `int fclose();`
- `fread` (line 21) `int fread();`
- `fwrite` (line 22) `int fwrite();`
- `fseek` (line 23) `int fseek();`
- `ftell` (line 24) `int ftell();`
- `rewind` (line 25) `void rewind();`
- `lz4_compress` (line 27) `int lz4_compress(char *src, int srclen, char *dst, int dstcap);`
- `lz4_decompress` (line 28) `int lz4_decompress(char *src, int srclen, char *dst, int dstcap);`

**Macros:**
- `LZ4_HDR_SIZE` (line 30) `#define LZ4_HDR_SIZE`
- `LZ4_BOUND_DEN` (line 31) `#define LZ4_BOUND_DEN`
- `LZ4_BOUND_SLACK` (line 32) `#define LZ4_BOUND_SLACK`
- `LZ4_MAX_BLOCK` (line 33) `#define LZ4_MAX_BLOCK`
- `LZ4_SEEK_END` (line 35) `#define LZ4_SEEK_END`
- `LZ4_EXIT_FAIL` (line 37) `#define LZ4_EXIT_FAIL`

#### `lzss.c`
**Path:** `progs/src/lzss.c`
**File Doc:** *lzss.c - command path LZSS (de)compression tools: lzss and unlzss.*

**Functions:**
- `lz_in_getc` (line 64) `static int lz_in_getc(void)`
- `lz_out_put` (line 69) `static void lz_out_put(int c)`
- `lz_putbit1` (line 74) `static void lz_putbit1(void)`
- `lz_putbit0` (line 84) `static void lz_putbit0(void)`
- `lz_flush_bits` (line 93) `static void lz_flush_bits(void)`
- `lz_out_literal` (line 97) `static void lz_out_literal(int c)`
- `lz_out_pair` (line 105) `static void lz_out_pair(int x, int y)`
- `lz_encode` (line 118) `static int lz_encode(void)`
- `lz_getbit` (line 173) `static int lz_getbit(int n)`
- `lz_decode` (line 189) `static int lz_decode(void)`
- `lz_hdr_put` (line 218) `static void lz_hdr_put(char *h, int size)`
- `lz_hdr_get` (line 229) `static int lz_hdr_get(char *h)`
- `lz_has` (line 237) `static int lz_has(const char *s, const char *needle)`
- `lz_read_all` (line 251) `static char *lz_read_all(const char *name, int *len)`
- `lz_write_all` (line 268) `static int lz_write_all(const char *name, char *data, int len)`
- `lz_compress` (line 278) `static int lz_compress(const char *src, const char *dst)`
- `lz_decompress` (line 325) `static int lz_decompress(const char *src, const char *dst)`
- `main` (line 397) `int main(int argc, char **argv)`
- `malloc` (line 13) `void *malloc();`
- `free` (line 14) `void free();`
- `printf` (line 15) `int printf();`
- `strcmp` (line 16) `int strcmp();`
- `strlen` (line 17) `int strlen();`
- `fopen` (line 18) `void *fopen();`
- `fclose` (line 19) `int fclose();`
- `fread` (line 20) `int fread();`
- `fwrite` (line 21) `int fwrite();`
- `fseek` (line 22) `int fseek();`
- `ftell` (line 23) `int ftell();`
- `rewind` (line 24) `void rewind();`

**Macros:**
- `LZSS_EI` (line 26) `#define LZSS_EI`
- `LZSS_EJ` (line 27) `#define LZSS_EJ`
- `LZSS_P` (line 28) `#define LZSS_P`
- `LZSS_N` (line 29) `#define LZSS_N`
- `LZSS_F` (line 30) `#define LZSS_F`
- `LZSS_WIN` (line 31) `#define LZSS_WIN`
- `LZSS_MAGIC0` (line 33) `#define LZSS_MAGIC0`
- `LZSS_MAGIC1` (line 34) `#define LZSS_MAGIC1`
- `LZSS_MAGIC2` (line 35) `#define LZSS_MAGIC2`
- `LZSS_MAGIC3` (line 36) `#define LZSS_MAGIC3`
- `LZSS_HDR_SIZE` (line 37) `#define LZSS_HDR_SIZE`
- `LZSS_ENC_SLACK` (line 39) `#define LZSS_ENC_SLACK`
- `LZSS_EXPAND_NUM` (line 40) `#define LZSS_EXPAND_NUM`
- `LZSS_EXPAND_DEN` (line 41) `#define LZSS_EXPAND_DEN`
- `LZSS_SEEK_END` (line 43) `#define LZSS_SEEK_END`
- `LZSS_ERR_NONE` (line 45) `#define LZSS_ERR_NONE`
- `LZSS_ERR_OVERFLOW` (line 46) `#define LZSS_ERR_OVERFLOW`
- `LZSS_EXIT_FAIL` (line 48) `#define LZSS_EXIT_FAIL`

#### `mmreuse.c`
**Path:** `progs/src/mmreuse.c`
**File Doc:** *mmap/munmap reclaim stress test.  Repeatedly maps and unmaps a large*

**Functions:**
- `mmap_anon` (line 7) `static long mmap_anon(long len)` - *mmap/munmap reclaim stress test.  Repeatedly maps and unmaps a large region.  On a kernel whose munmap never returns address space, the downward mmap cursor drains until a map fails with ENOMEM (-12); with reclaim the freed region is reused and no map ever fails.  Exit code 0 = pass, 1 = a map failed (the leak it guards against).  Built as a static * Linux ELF like cpl.elf and run through the raw syscall ABI.*
- `munmap` (line 21) `static long munmap(long addr, long len)`
- `exit_now` (line 31) `static void exit_now(long code)`
- `_start` (line 35) `void _start(void)`
- `ENOMEM` (line 3) `* downward mmap cursor drains until a map fails with ENOMEM (-12);`

#### `mprot.c`
**Path:** `progs/src/mprot.c`
**File Doc:** *mprotect probe. Maps two anonymous regions and walks the protection*

**Functions:**
- `mmap_anon` (line 11) `static long mmap_anon(long len)`
- `mprotect_sys` (line 25) `static long mprotect_sys(long addr, long len, long prot)`
- `write_str` (line 36) `static long write_str(const char *s, long n)`
- `exit_now` (line 44) `static void exit_now(long code)`
- `_start` (line 48) `void _start(void)`

#### `mtop.c`
**Path:** `progs/src/mtop.c`
**File Doc:** *mtop.c - ASCII real-time system monitor for MiniOS.*

**Functions:**
- `sc3` (line 63) `static long sc3(long n, long a1, long a2, long a3)`
- `mtop_time` (line 72) `static long mtop_time(void)`
- `mtop_rtc` (line 76) `static long mtop_rtc(int *h, int *m, int *s)`
- `mtop_key` (line 80) `static long mtop_key(void)`
- `mtop_minfo` (line 84) `static long mtop_minfo(long sel, long *o1, long *o2)`
- `emit` (line 90) `static void emit(char *s)`
- `mtop_quit_key` (line 94) `static int mtop_quit_key(long k)`
- `mtop_clear_ansi` (line 103) `static void mtop_clear_ansi(void)`
- `mtop_clear` (line 113) `static void mtop_clear(void)`
- `mtop_atoi` (line 117) `static int mtop_atoi(char *s)`
- `mtop_putu` (line 136) `static void mtop_putu(long v)`
- `mtop_put2` (line 158) `static void mtop_put2(int v)`
- `mtop_put_kb` (line 163) `static void mtop_put_kb(long kb)`
- `mtop_bar` (line 179) `static void mtop_bar(long v, long max, int w)`
- `mtop_hist_max` (line 194) `static long mtop_hist_max(long *h, int n)`
- `mtop_hist_push` (line 204) `static void mtop_hist_push(long *h, long v)`
- `mtop_spark` (line 214) `static void mtop_spark(long *h, int n)`
- `mtop_mem` (line 242) `static long mtop_mem(long *used, long *freeb, long *total)`
- `mtop_cpu` (line 253) `static long mtop_cpu(long *count, long *busy)`
- `mtop_disk_open` (line 289) `static void mtop_disk_open(void)`
- `mtop_disk_read` (line 313) `static long mtop_disk_read(long *bytes)`
- `mtop_net_probe` (line 337) `static long mtop_net_probe(long *dns_ms, long *sock_ok)`
- `mtop_frame` (line 355) `static void mtop_frame(int n)`
- `main` (line 531) `int main(int argc, char **argv)`
- `syscall` (line 12) `* * All system figures come from the MINFO syscall (251): heap used / * free, ramdisk used / cap, MiniFS free / total blocks, cpu total / * idle 100 Hz ticks, cpu count / uptime. CPU busy percent is *`
- `putchar` (line 35) `int putchar();`
- `strlen` (line 36) `int strlen();`
- `strcmp` (line 37) `int strcmp();`
- `fopen` (line 38) `void *fopen();`
- `fclose` (line 39) `int fclose();`
- `fread` (line 40) `int fread();`
- `rewind` (line 41) `void rewind();`
- `socket` (line 42) `int socket();`
- `close` (line 43) `int close();`
- `net_dns_resolve` (line 44) `int net_dns_resolve();`

**Macros:**
- `MTOP_HIST` (line 46) `#define MTOP_HIST`
- `MTOP_DISK_BUF` (line 47) `#define MTOP_DISK_BUF`
- `MTOP_DISK_MAX` (line 48) `#define MTOP_DISK_MAX`
- `MTOP_MINFO` (line 49) `#define MTOP_MINFO`

#### `mvrn.c`
**Path:** `progs/src/mvrn.c`
**File Doc:** *mvrn -- rename(82) syscall probe.*

**Functions:**
- `mvrn_sc3` (line 9) `static long mvrn_sc3(long n, long a1, long a2, long a3)` - *mvrn -- rename(82) syscall probe.  Exercises the rename path a ring-3 program sees: create a file through open/write/close, move it with rename(82), then pin the fail-closed edges (missing src is -ENOENT, a kernel-space pointer is -EFAULT) and clean up with unlink. Prints "mvrn: ok" and exits 0 only when every step behaves; any deviation prints "mvrn: FAIL <step>" and exits 1. * Built as a static Linux ELF like lxhello.elf (no libc, raw syscalls).*
- `mvrn_write` (line 16) `static void mvrn_write(const char *s, unsigned long len)`
- `mvrn_exit` (line 20) `static void mvrn_exit(long code)`
- `mvrn_fail` (line 24) `static void mvrn_fail(int step)`
- `lmain` (line 32) `int lmain(void)`

#### `nx.c`
**Path:** `progs/src/nx.c`
**File Doc:** *NX probe. Under the isolation contract every user page starts*

**Functions:**
- `write_str` (line 11) `static long write_str(const char *s, long n)`
- `exit_now` (line 19) `static void exit_now(long code)`
- `_start` (line 23) `void _start(void)`

#### `opl3.c`
**Path:** `progs/src/opl3.c`

**Functions:**
- `sys_time` (line 36) `static long sys_time(void)`
- `sys_open` (line 39) `static long sys_open(long on)`
- `sys_submit` (line 42) `static long sys_submit(const void *buf, long len)`
- `busy_ms` (line 46) `static void busy_ms(long ms)`
- `opl3_set_instrument` (line 52) `static void opl3_set_instrument(opl3_chip *chip)` - *} static long sys_open(long on) { long r; __asm__ volatile("syscall":"=a"(r):"a"(SYS_SB16_OPEN),"D"(on):"rcx","r11","memory"); return r; } static long sys_submit(const void *buf, long len) { long r; __asm__ volatile("syscall":"=a"(r):"a"(SYS_SB16_SUBMIT),"D"((long)buf),"S"(len):"rcx","r11","memory"); return r; } static void busy_ms(long ms) { long t0 = sys_time(); while (sys_time() - t0 < ms) __asm__ volatile("pause"); } /* 2-op FM instrument, channel 0 (modulator op0, carrier op1).*
- `opl3_note` (line 69) `static void opl3_note(opl3_chip *chip, unsigned block, unsigned fnum, int on)`
- `render` (line 77) `static void render(opl3_chip *chip, long ms, long *fail)` - *Render `ms` of the current note and stream it to the SB16.  Each submit is one DMA buffer of MONO_BYTES; submissions are paced to real-time audio * (BUF_MS each) so the kernel ring stays full without overflowing.*
- `main` (line 107) `int main(void)`

**Macros:**
- `SYS_TIME` (line 21) `#define SYS_TIME`
- `SYS_SB16_OPEN` (line 22) `#define SYS_SB16_OPEN`
- `SYS_SB16_SUBMIT` (line 23) `#define SYS_SB16_SUBMIT`
- `SYS_WRITE` (line 24) `#define SYS_WRITE`
- `SAMPLE_RATE` (line 28) `#define SAMPLE_RATE`
- `STEREO_FRAMES` (line 29) `#define STEREO_FRAMES`
- `MONO_BYTES` (line 30) `#define MONO_BYTES`
- `BUF_MS` (line 32) `#define BUF_MS`
- `F_NUM_FACTOR` (line 34) `#define F_NUM_FACTOR`

**Structs:**
- `note_t` (line 102)

#### `pcmap.c`
**Path:** `progs/src/pcmap.c`
**File Doc:** *pcmap probe: file-backed MAP_PRIVATE mmap shares text.*

**Functions:**
- `sc_open` (line 12) `static long sc_open(const char *p)` - *pcmap probe: file-backed MAP_PRIVATE mmap shares text.  Maps 17 pages of lisp.c (65933 bytes on MiniFS) plus a second mapping of page 1 at file offset 4096, checksums the content and cross-checks the overlap: the offset mapping must read exactly what the base mapping holds 4096 bytes in. Both mappings stay resident (no munmap) so the `mem` pcache count proves one shared copy, and exit tears the window down through the ref-drop walk. Built as a static Linux ELF like mprot.elf; run twice under mrun for the cross-process share. Pinned hash and page count assume * the current lisp.c size; drift fails loudly, never silently.*
- `sc_mmap` (line 21) `static long sc_mmap(long len, long prot, long flags, long fd, long off)`
- `sc_write` (line 34) `static long sc_write(long fd, const char *s, long n)`
- `sc_exit` (line 42) `static void sc_exit(long code)`
- `sc_fnv` (line 46) `static unsigned long sc_fnv(const char *p, long n)`
- `sc_hex8` (line 56) `static void sc_hex8(unsigned long v, char *out)`
- `sc_munmap` (line 65) `static long sc_munmap(long addr, long len)`
- `_start` (line 75) `void _start(void)`

#### `pip.c`
**Path:** `progs/src/pip.c`
**File Doc:** *pip -- launcher for `python3 -m pip`, and pip3 as a copy of this image.*

**Functions:**
- `main` (line 45) `int main(int argc, char **argv)` - *uint32_t namesz; uint32_t descsz; uint32_t type; char     name[sizeof MINIOS_NOTE_NAME]; uint32_t desc; }; __attribute__((section(".note.minios.process"), used, aligned(4))) static const struct pip_note pip_process_note = { sizeof MINIOS_NOTE_NAME, sizeof(uint32_t), MINIOS_NOTE_PROCESS, MINIOS_NOTE_NAME, 1u }; #endif /** Build argv and exec the interpreter; returns only on failure.*

**Macros:**
- `PIP_PYTHON_PATH` (line 19) `#define PIP_PYTHON_PATH`
- `PIP_MODULE_FLAG` (line 21) `#define PIP_MODULE_FLAG`
- `PIP_MODULE_NAME` (line 22) `#define PIP_MODULE_NAME`
- `PIP_PREFIX_WORDS` (line 24) `#define PIP_PREFIX_WORDS`
- `PIP_EXEC_FAILED` (line 26) `#define PIP_EXEC_FAILED`

**Structs:**
- `pip_note` (line 30) - *#include "minios_abi.h" /** Interpreter path inside the guest; cwd independent. #define PIP_PYTHON_PATH "/python3" /** Python arguments that select the pip module. #define PIP_MODULE_FLAG "-m" #define PIP_MODULE_NAME "pip" /** Prefix words added in front of the caller's arguments. #define PIP_PREFIX_WORDS 3 /** Exit status for a failed execve. #define PIP_EXEC_FAILED 127 #ifdef PIP_PROCESS_NOTE /** MiniOS process note: name, 4-byte descriptor, both 4-byte padded.*

#### `pollready.c`
**Path:** `progs/src/pollready.c`

**Functions:**
- `p_write` (line 26) `static long p_write(long fd, const char *s, long n)`
- `p_strlen` (line 30) `static unsigned long p_strlen(const char *s)`
- `p_puts` (line 36) `static void p_puts(long fd, const char *s)`
- `p_atoi` (line 40) `static int p_atoi(const char *s)`
- `p_parse_ip` (line 46) `static int p_parse_ip(const char *s, unsigned char out[4])`
- `lmain` (line 63) `int lmain(long argc, char **argv)` - *int v = 0; int digits = 0; while (*s >= '0' && *s <= '9') { v = v * 10 + (*s - '0'); s++; digits++; } if (!digits || v > 255) return -1; out[i] = (unsigned char)v; if (i < 3) { if (*s != '.') return -1; s++; } } return *s ? -1 : 0; } /* Entry called by _start with argc/argv off the initial stack.*

#### `sbtone.c`
**Path:** `progs/src/sbtone.c`
**File Doc:** *sbtone.c — headless SB16 diagnostic (ring-3, no GUI).*

**Functions:**
- `buffers` (line 14) `*
 * Exit code is the number of submitted buffers (0 on failure to open).
 */

#include <stdio.h>...`
- `main` (line 36) `int main(void)`

**Macros:**
- `SYS_SB16_OPEN` (line 21) `#define SYS_SB16_OPEN`
- `SYS_SB16_SUBMIT` (line 22) `#define SYS_SB16_SUBMIT`
- `SYS_TIME` (line 23) `#define SYS_TIME`
- `RATE` (line 25) `#define RATE`
- `BUF` (line 26) `#define BUF`
- `WINDOW_MS` (line 27) `#define WINDOW_MS`

#### `scfuzz.c`
**Path:** `progs/src/scfuzz.c`
**File Doc:** *scfuzz: deterministic syscall fuzzer (syzkaller spirit, BDD scale).*

**Functions:**
- `guest` (line 7) `* the guest (the BDD timeout then talks). All fuzz maps stay inside
 * one private 4 MB arena (pa...`
- `sc_mprotect` (line 38) `static long sc_mprotect(long addr, long len, long prot)`
- `sc_munmap` (line 49) `static long sc_munmap(long addr, long len)`
- `sc_write` (line 53) `static long sc_write(long fd, const char *s, long n)`
- `sc_exit` (line 61) `static void sc_exit(long code)`
- `sc_rng` (line 67) `static unsigned long sc_rng(unsigned long *s)`
- `sc_fold` (line 76) `static unsigned long sc_fold(unsigned long h, unsigned long v)`
- `sc_hex8` (line 88) `static void sc_hex8(unsigned long v, char *out)`
- `sc_worker` (line 97) `static unsigned long sc_worker(int me, unsigned long seed)`
- `sc_thread1` (line 161) `static void *sc_thread1(void *arg)`
- `_start` (line 167) `void _start(void)`

**Macros:**
- `SC_OPS` (line 15) `#define SC_OPS`
- `SC_ARENA` (line 16) `#define SC_ARENA`
- `SC_PAGE` (line 17) `#define SC_PAGE`
- `SC_PAGES` (line 18) `#define SC_PAGES`
- `SC_T0_BASE` (line 19) `#define SC_T0_BASE`
- `SC_T0_N` (line 20) `#define SC_T0_N`
- `SC_T1_BASE` (line 21) `#define SC_T1_BASE`
- `SC_T1_N` (line 22) `#define SC_T1_N`

#### `sign.c`
**Path:** `progs/src/sign.c`
**File Doc:** *sign.c - in-OS Ed25519 code signer for MiniOS secure boot.*

**Functions:**
- `sign_hexval` (line 89) `static unsigned int sign_hexval(char c)` - *static unsigned int sign_k[160]; static unsigned int sign_h[16]; static unsigned int sign_w[160]; static char sign_buf[128]; static int sign_used; static unsigned int sign_nlo; static unsigned int sign_nhi; static unsigned int sign_q4[8]; static unsigned int sign_l8[8]; static unsigned int sign_gb[32]; static unsigned int sign_ga[32]; /** Docstring: Hex digit value, 0 outside hex.*
- `sign_unhex` (line 100) `static void sign_unhex(char *out, char *in, int n)` - *static unsigned int sign_ga[32]; /** Docstring: Hex digit value, 0 outside hex. static unsigned int sign_hexval(char c) { if (c >= 48 && c <= 57) return (unsigned int)(c - 48); if (c >= 97 && c <= 102) return (unsigned int)(c - 97 + 10); if (c >= 65 && c <= 70) return (unsigned int)(c - 65 + 10); return 0; } /** Docstring: Decode 2*n hex chars into n bytes.*
- `sign_byte` (line 111) `static unsigned int sign_byte(char *p, int i)` - *} /** Docstring: Decode 2*n hex chars into n bytes. static void sign_unhex(char *out, char *in, int n) { int i = 0; while (i < n) { unsigned int hi = sign_hexval(in[2 * i]); unsigned int lo = sign_hexval(in[2 * i + 1]); out[i] = (char)((hi << 4) | lo); i++; } } /** Docstring: Unsigned byte at index, the aes.c masking idiom.*
- `sign_copy` (line 119) `static void sign_copy(char *dst, char *src, int n)` - *out[i] = (char)((hi << 4) | lo); i++; } } /** Docstring: Unsigned byte at index, the aes.c masking idiom. static unsigned int sign_byte(char *p, int i) { int v = p[i]; if (v < 0) v = v + 256; return (unsigned int)v; } /** Docstring: Copy n bytes.*
- `sign_strlen` (line 128) `static int sign_strlen(char *s)` - *v = v + 256; return (unsigned int)v; } /** Docstring: Copy n bytes. static void sign_copy(char *dst, char *src, int n) { int i = 0; while (i < n) { dst[i] = src[i]; i++; } } /** Docstring: String length.*
- `sign_le16` (line 136) `static unsigned int sign_le16(char *p, int off)` - *dst[i] = src[i]; i++; } } /** Docstring: String length. static int sign_strlen(char *s) { int n = 0; while (s[n] != 0) n = n + 1; return n; } /** Docstring: Little-endian u16 at offset.*
- `sign_le32` (line 141) `static unsigned int sign_le32(char *p, int off)` - */** Docstring: String length. static int sign_strlen(char *s) { int n = 0; while (s[n] != 0) n = n + 1; return n; } /** Docstring: Little-endian u16 at offset. static unsigned int sign_le16(char *p, int off) { return sign_byte(p, off) | (sign_byte(p, off + 1) << 8); } /** Docstring: Little-endian u32 at offset.*
- `sign_put32` (line 147) `static void sign_put32(char *p, int off, unsigned int v)` - *} /** Docstring: Little-endian u16 at offset. static unsigned int sign_le16(char *p, int off) { return sign_byte(p, off) | (sign_byte(p, off + 1) << 8); } /** Docstring: Little-endian u32 at offset. static unsigned int sign_le32(char *p, int off) { return sign_byte(p, off) | (sign_byte(p, off + 1) << 8) | (sign_byte(p, off + 2) << 16) | (sign_byte(p, off + 3) << 24); } /** Docstring: Store u32 little-endian.*
- `sign_offok` (line 180) `static int sign_offok(char *p, int off, int *lo)` - *if (hi < 10) out[2 * i] = (char)(48 + hi); else out[2 * i] = (char)(87 + hi); if (lo < 10) out[2 * i + 1] = (char)(48 + lo); else out[2 * i + 1] = (char)(87 + lo); i = i + 1; } out[2 * n] = 0; } /** Docstring: Load a file offset field, refusing high parts.*
- `below` (line 195) `* every other op below (`|`, `<<`) is low-32 exact. */
static void sign_rotr(unsigned int *lo, un...`
- `sign_borrow2` (line 230) `static unsigned int sign_borrow2(unsigned int x, unsigned int y, unsigned int s)` - *Docstring: Borrow out of x minus y into s, without comparisons. * Same miniGCC rationale as sign_carry2: sanitize before shifting.*
- `sign_add3` (line 237) `static unsigned int sign_add3(unsigned int *s, unsigned int a, unsigned int b, unsigned int c)` - *Docstring: Borrow out of x minus y into s, without comparisons. * Same miniGCC rationale as sign_carry2: sanitize before shifting. static unsigned int sign_borrow2(unsigned int x, unsigned int y, unsigned int s) { unsigned int t = (~x & y) | ((~(x ^ y)) & s); t = (t << 32) >> 32; return (t >> 31) & 1; } /** Docstring: Add three words with carry, returning the new carry.*
- `sign_be32` (line 247) `static unsigned int sign_be32(char *p, int off)` - *return (t >> 31) & 1; } /** Docstring: Add three words with carry, returning the new carry. static unsigned int sign_add3(unsigned int *s, unsigned int a, unsigned int b, unsigned int c) { unsigned int t = a + b; unsigned int cy = sign_carry2(a, b, t); unsigned int u = t + c; cy = cy + sign_carry2(t, c, u); s = u; return cy; } /** Docstring: Big-endian u32 at byte offset.*
- `sign_block` (line 253) `static void sign_block(void)` - *unsigned int cy = sign_carry2(a, b, t); unsigned int u = t + c; cy = cy + sign_carry2(t, c, u); s = u; return cy; } /** Docstring: Big-endian u32 at byte offset. static unsigned int sign_be32(char *p, int off) { return (sign_byte(p, off) << 24) | (sign_byte(p, off + 1) << 16) | (sign_byte(p, off + 2) << 8) | sign_byte(p, off + 3); } /** Docstring: One SHA-512 compression over the 128-byte buffer.*
- `sign_sha_init` (line 387) `static void sign_sha_init(void)` - *i = 0; while (i < 16) { unsigned int n = sign_h[i] + st[i]; unsigned int cy = 0; cy = sign_carry2(sign_h[i], st[i], n); sign_h[i] = n; i++; n = sign_h[i] + st[i] + cy; sign_h[i] = n; i++; } } /** Docstring: Start a SHA-512 digest.*
- `sign_sha_update` (line 410) `static void sign_sha_update(char *data, int len)` - *sign_h[8] = 0xade682d1; sign_h[9] = 0x510e527f; sign_h[10] = 0x2b3e6c1f; sign_h[11] = 0x9b05688c; sign_h[12] = 0xfb41bd6b; sign_h[13] = 0x1f83d9ab; sign_h[14] = 0x137e2179; sign_h[15] = 0x5be0cd19; sign_nlo = 0; sign_nhi = 0; sign_used = 0; } /** Docstring: Feed bytes into the running digest.*
- `sign_sha_final` (line 442) `static void sign_sha_final(char *out)` - *Docstring: Finish the digest into 64 bytes.  The bit counter never exceeds 2^27 (files cap at 16 MB), so the high length word is constant zero and only safe sub-32 shifts * appear below.*
- `sign_feed32` (line 490) `static void sign_feed32(unsigned int v)` - *while (s < 8) { int ww = 0; if (s < 4) ww = (int)((sign_h[2 * i + 1] >> (24 - 8 * s)) & 255); else ww = (int)((sign_h[2 * i] >> (56 - 8 * s)) & 255); out[b + s] = (char)ww; s = s + 1; } i = i + 1; } } /** Docstring: Feed a u32 into the digest little-endian.*
- `sign_key_init` (line 500) `static void sign_key_init(void)` - *} } /** Docstring: Feed a u32 into the digest little-endian. static void sign_feed32(unsigned int v) { char b[4]; b[0] = (char)(v & 255); b[1] = (char)((v >> 8) & 255); b[2] = (char)((v >> 16) & 255); b[3] = (char)((v >> 24) & 255); sign_sha_update(b, 4); } /** Docstring: Decode the K table chunks into 160 words.*
- `fe_copy` (line 549) `static void fe_copy(unsigned int *r, unsigned int *a)` - *sign_q4[5] = 4294967295; sign_q4[6] = 4294967295; sign_q4[7] = 2147483647; sign_l8[0] = 1559614445; sign_l8[1] = 1477600026; sign_l8[2] = 2734136534; sign_l8[3] = 350157278; sign_l8[4] = 0; sign_l8[5] = 0; sign_l8[6] = 0; sign_l8[7] = 268435456; } /** Docstring: Copy eight limbs.*
- `fe_zero` (line 558) `static void fe_zero(unsigned int *r)` - *sign_l8[6] = 0; sign_l8[7] = 268435456; } /** Docstring: Copy eight limbs. static void fe_copy(unsigned int *r, unsigned int *a) { int i = 0; while (i < 8) { r[i] = a[i]; i = i + 1; } } /** Docstring: Zero eight limbs.*
- `fe_one` (line 567) `static void fe_one(unsigned int *r)` - *i = i + 1; } } /** Docstring: Zero eight limbs. static void fe_zero(unsigned int *r) { int i = 0; while (i < 8) { r[i] = 0; i = i + 1; } } /** Docstring: One as eight limbs.*
- `fe_cmov` (line 573) `static void fe_cmov(unsigned int *r, unsigned int *b, unsigned int flag)` - *int i = 0; while (i < 8) { r[i] = 0; i = i + 1; } } /** Docstring: One as eight limbs. static void fe_one(unsigned int *r) { fe_zero(r); r[0] = 1; } /** Docstring: Masked select between limb arrays, no secret branches.*
- `fe_ge` (line 586) `static unsigned int fe_ge(unsigned int *a, unsigned int *b)` - *Docstring: 1 when a holds at least b, else 0.  Runs the subtraction limb by limb and returns the inverted final * borrow, so no ordering comparison touches full-range limbs.*
- `fe_rawsub` (line 601) `static void fe_rawsub(unsigned int *r, unsigned int *a, unsigned int *b)` - *unsigned int borrow = 0; int i = 0; while (i < 8) { unsigned int t1 = a[i] - borrow; unsigned int c0 = sign_borrow2(a[i], borrow, t1); unsigned int t2 = t1 - b[i]; unsigned int c1 = sign_borrow2(t1, b[i], t2); borrow = c0 | c1; i = i + 1; } return borrow ^ 1; } /** Docstring: Raw subtract, caller guarantees no borrow out.*
- `fe_add` (line 617) `static void fe_add(unsigned int *r, unsigned int *a, unsigned int *b)` - *int i = 0; while (i < 8) { unsigned int ai = a[i]; unsigned int t1 = ai - borrow; unsigned int c0 = sign_borrow2(ai, borrow, t1); unsigned int t2 = t1 - b[i]; unsigned int c1 = sign_borrow2(t1, b[i], t2); r[i] = t2; borrow = c0 | c1; i = i + 1; } } /** Docstring: Add mod q with one conditional subtract.*
- `fe_sub` (line 636) `static void fe_sub(unsigned int *r, unsigned int *a, unsigned int *b)` - *unsigned int s1 = a[i] + b[i]; unsigned int c0 = sign_carry2(a[i], b[i], s1); unsigned int s2 = s1 + carry; unsigned int c1 = sign_carry2(s1, carry, s2); t[i] = s2; carry = c0 | c1; i = i + 1; } if (carry == 1 || fe_ge(t, sign_q4) == 1) fe_rawsub(t, t, sign_q4); fe_copy(r, t); } /** Docstring: Subtract mod q with borrow folded back.*
- `bits` (line 672) `* values here always fit 32 bits (limbs below 2^16, carries and
 * products below 2^32), so the s...`
- `fe_foldadd` (line 690) `static void fe_foldadd(unsigned int *row, int at, unsigned int x)` - *unsigned int carry = 0; carry = (v << 32) >> 32; while (i < 32 && carry != 0) { unsigned int rv = 0; unsigned int s = 0; rv = (row[i] << 32) >> 32; s = rv + carry; row[i] = s & 65535; carry = s >> 16; i = i + 1; } } /** Docstring: Fold 38 times a sub-2^16 limb into a 16-bit row.*
- `fe_mul` (line 696) `static void fe_mul(unsigned int *r, unsigned int *a, unsigned int *b)` - *s = rv + carry; row[i] = s & 65535; carry = s >> 16; i = i + 1; } } /** Docstring: Fold 38 times a sub-2^16 limb into a 16-bit row. static void fe_foldadd(unsigned int *row, int at, unsigned int x) { unsigned int v = (x << 5) + (x << 2) + (x << 1); fe_rowadd(row, at, v); } /** Docstring: Multiply mod q through 16-bit rows and 38-folds.*
- `fe_sq` (line 766) `static void fe_sq(unsigned int *r, unsigned int *a)` - *fe_zero(back); back[0] = acc[16] * 38; fe_add(t, t, back); k = 0; while (k < 3) { if (fe_ge(t, sign_q4) == 1) fe_rawsub(t, t, sign_q4); k = k + 1; } fe_copy(r, t); } } /** Docstring: Square mod q.*
- `fe_inv` (line 771) `static void fe_inv(unsigned int *r, unsigned int *a)` - *if (fe_ge(t, sign_q4) == 1) fe_rawsub(t, t, sign_q4); k = k + 1; } fe_copy(r, t); } } /** Docstring: Square mod q. static void fe_sq(unsigned int *r, unsigned int *a) { fe_mul(r, a, a); } /** Docstring: Power with the q-minus-2 bit pattern, always square.*
- `fe_frombytes` (line 790) `static void fe_frombytes(unsigned int *r, char *b)` - *while (i < 255) { unsigned int bit = 1; if (i == 252 || i == 250) bit = 0; fe_sq(tmp, acc); fe_copy(acc, tmp); fe_mul(tmp, acc, a); fe_cmov(acc, tmp, bit); i = i + 1; } fe_copy(r, acc); } /** Docstring: Load 32 bytes into eight limbs.*
- `fe_tobytes` (line 800) `static void fe_tobytes(char *b, unsigned int *a)` - *fe_copy(r, acc); } /** Docstring: Load 32 bytes into eight limbs. static void fe_frombytes(unsigned int *r, char *b) { int i = 0; while (i < 8) { r[i] = sign_byte(b, 4 * i) | (sign_byte(b, 4 * i + 1) << 8) | (sign_byte(b, 4 * i + 2) << 16) | (sign_byte(b, 4 * i + 3) << 24); i = i + 1; } } /** Docstring: Store eight limbs as 32 bytes.*
- `fe_curved` (line 812) `static void fe_curved(unsigned int *d, unsigned int *d2)` - */** Docstring: Store eight limbs as 32 bytes. static void fe_tobytes(char *b, unsigned int *a) { int i = 0; while (i < 8) { b[4 * i] = (char)(a[i] & 255); b[4 * i + 1] = (char)((a[i] >> 8) & 255); b[4 * i + 2] = (char)((a[i] >> 16) & 255); b[4 * i + 3] = (char)((a[i] >> 24) & 255); i = i + 1; } } /** Docstring: Recover d from minus 121665 over 121666.*
- `ge_copy` (line 829) `static void ge_copy(unsigned int *r, unsigned int *a)` - *unsigned int inv[8]; unsigned int zero[8]; fe_zero(num); fe_zero(den); num[0] = 121665; den[0] = 121666; fe_inv(inv, den); fe_mul(d, num, inv); fe_zero(zero); fe_sub(d, zero, d); fe_add(d2, d, d); } /** Docstring: Copy one extended point of 32 limbs.*
- `fe_off` (line 845) `static unsigned int *fe_off(unsigned int *p, int n)` - *Docstring: Address of limb n from a limb base.  miniGCC scales `a[i]` by 8 (its `unsigned int` slot) but adds raw bytes for `p + N`, and parses `&p[N]` on a pointer as `(&p) + 8N` (the address of the pointer variable, caught by a wild-rsp crash in `ge_scalarmult`). `&arr[N]` on arrays happens to work, but this helper is the only sanctioned limb addressing: `p + n * 8` is byte * addition of an exact scaled offset. Never use it on `char *`.*
- `ge_cmov` (line 850) `static void ge_cmov(unsigned int *r, unsigned int *b, unsigned int flag)` - *Docstring: Address of limb n from a limb base.  miniGCC scales `a[i]` by 8 (its `unsigned int` slot) but adds raw bytes for `p + N`, and parses `&p[N]` on a pointer as `(&p) + 8N` (the address of the pointer variable, caught by a wild-rsp crash in `ge_scalarmult`). `&arr[N]` on arrays happens to work, but this helper is the only sanctioned limb addressing: `p + n * 8` is byte * addition of an exact scaled offset. Never use it on `char *`. static unsigned int *fe_off(unsigned int *p, int n) { return p + n * 8; } /** Docstring: Masked point select, no secret branches.*
- `ge_add` (line 860) `static void ge_add(unsigned int *r, unsigned int *p, unsigned int *q, unsigned int *d2)` - *return p + n * 8; } /** Docstring: Masked point select, no secret branches. static void ge_cmov(unsigned int *r, unsigned int *b, unsigned int flag) { unsigned int m = 0 - (flag & 1); int i = 0; while (i < 32) { r[i] = r[i] ^ (m & (r[i] ^ b[i])); i = i + 1; } } /** Docstring: Complete twisted-Edwards addition.*
- `ge_double` (line 892) `static void ge_double(unsigned int *r, unsigned int *p)` - *fe_mul(c, t0, d2); fe_add(t0, fe_off(p, 16), fe_off(p, 16)); fe_mul(d, t0, fe_off(q, 16)); fe_sub(e, b, a); fe_sub(f, d, c); fe_add(g, d, c); fe_add(h, b, a); fe_mul(r, e, f); fe_mul(fe_off(r, 8), g, h); fe_mul(fe_off(r, 16), f, g); fe_mul(fe_off(r, 24), e, h); } /** Docstring: Twisted-Edwards doubling for a fixed at minus one.*
- `ge_scalarmult` (line 926) `static void ge_scalarmult(unsigned int *r, unsigned int *p, char *s, unsigned int *d2)` - *fe_zero(na); fe_sub(na, na, a); fe_add(g, na, b); fe_sub(f, g, c); fe_zero(nb); fe_sub(nb, nb, b); fe_add(h, na, nb); fe_mul(r, e, f); fe_mul(fe_off(r, 8), g, h); fe_mul(fe_off(r, 16), f, g); fe_mul(fe_off(r, 24), e, h); } /** Docstring: Multiply a point by a 32-byte scalar.*
- `sc_mod_l` (line 951) `static void sc_mod_l(unsigned int *r, unsigned int *t16)` - *while (i >= 0) { unsigned int bit = 0; if (((sign_byte(s, i >> 3) >> (i & 7)) & 1) == 1) bit = 1; ge_double(dbl, qq); ge_copy(qq, dbl); ge_add(dbl, qq, p, d2); ge_cmov(qq, dbl, bit); i = i - 1; } ge_copy(r, qq); } /** Docstring: Reduce sixteen limbs mod L by binary long division.*
- `sc_mul_add` (line 1013) `static void sc_mul_add(unsigned int *r, unsigned int *a, unsigned int *b, unsigned int *c)` - *rem[8] = rem[8] - borrow; } s = s + 1; } b = b + 1; } k = 0; while (k < 8) { r[k] = rem[k]; k = k + 1; } } /** Docstring: Multiply two scalars with r added, all mod L.*
- `sign_rev32` (line 1070) `static void sign_rev32(char *b)` - *carry = c0 | c1; i = i + 1; } while (i < 16) { unsigned int s = t16[i] + carry; carry = sign_carry2(t16[i], carry, s); t16[i] = s; i = i + 1; } } sc_mod_l(r, t16); } /** Docstring: Reverse 32 bytes in place, big-endian hex to limbs.*
- `sign_points_init` (line 1081) `static void sign_points_init(void)` - *} /** Docstring: Reverse 32 bytes in place, big-endian hex to limbs. static void sign_rev32(char *b) { int i = 0; while (i < 16) { char t = b[i]; b[i] = b[31 - i]; b[31 - i] = t; i = i + 1; } } /** Docstring: Load the embedded base and key points.*
- `sign_digest` (line 1112) `static void sign_digest(char *sig, char *digest)` - *fe_copy(fe_off(sign_gb, 8), t); fe_one(fe_off(sign_gb, 16)); fe_mul(t, sign_gb, fe_off(sign_gb, 8)); fe_copy(fe_off(sign_gb, 24), t); fe_frombytes(t, ax); fe_copy(sign_ga, t); fe_frombytes(t, ay); fe_copy(fe_off(sign_ga, 8), t); fe_one(fe_off(sign_ga, 16)); fe_mul(t, sign_ga, fe_off(sign_ga, 8)); fe_copy(fe_off(sign_ga, 24), t); } /** Docstring: Sign a 64-byte digest with the embedded seed.*
- `sign_read` (line 1232) `static char *sign_read(char *name, int *len)` - *while (i < 16) { t16[i] = sign_byte(hrambytes, 4 * i) | (sign_byte(hrambytes, 4 * i + 1) << 8) | (sign_byte(hrambytes, 4 * i + 2) << 16) | (sign_byte(hrambytes, 4 * i + 3) << 24); i = i + 1; } sc_mod_l(hram, t16); fe_tobytes(h32, hram); sc_mul_add(ss, hram, a, rr); sign_copy(sig, renc, 32); fe_tobytes(abuf, ss); sign_copy(sig + 32, abuf, 32); } /** Docstring: Read a whole file, capped, returning its bytes or zero.*
- `sign_write` (line 1260) `static int sign_write(char *name, char *data, int len)` - *len = 1; buf = malloc(*len); if (buf == 0) { fclose(f); return 0; } got = fread(buf, 1, *len, f); fclose(f); if (got != *len) return 0; return buf; } /** Docstring: Write a whole file, 0 on success.*
- `sign_note_span` (line 1273) `static int sign_note_span(char *img, int off, int len, int *desc)` - */** Docstring: Write a whole file, 0 on success. static int sign_write(char *name, char *data, int len) { void *f = fopen(name, "w"); int got = 0; if (f == 0) return 1; got = fwrite(data, 1, len, f); fclose(f); if (got != len) return 1; return 0; } /** Docstring: Scan one PT_NOTE span for the signature descriptor.*
- `sign_digest_of` (line 1307) `static int sign_digest_of(char *img, int size, int entry, char *ph, int phnum, char *digest)` - *Docstring: Build the canonical digest over entry plus PT_LOADs.  File bytes below the ELF header size are excluded from the segment feeds while the entry stays bound as a value, matching * the kernel gate and tools/sign_elf.py.*
- `sign_patch_notes` (line 1356) `static int sign_patch_notes(char *img, int size, char *ph, int phnum, char *desc)` - *sign_feed32(0); start = poff; if (start < SIGN_EHDR_SIZE) start = SIGN_EHDR_SIZE; end = poff + pfilesz; if (start < end) sign_sha_update(img + start, end - start); i = i + 1; } sign_sha_final(digest); return 0; } /** Docstring: Patch an own-key PT_NOTE slot, 1 when patched.*
- `sign_append` (line 1393) `static int sign_append(char *name, char *img, int size, int shoff, int shnum, int shentsize,
    ...` - *rc = sign_note_span(img, poff, pfilesz, &slot); if (rc == 1 && img[slot] == SIGN_KEY_ID) { while (k < SIGN_DESC_BYTES) { img[slot + k] = desc[k]; k = k + 1; } patched = 1; } n = n + 1; } return patched; } /** Docstring: Append a fresh signature section, 0 on success.*
- `sign_file` (line 1529) `static int sign_file(char *name)` - *int sn = shnum + 1; out[60] = (char)(sn & 255); out[61] = (char)((sn >> 8) & 255); } } if (sign_write(name, out, newsize) != 0) { printf("sign: cannot write %s\n", name); return 1; } printf("sign: %s: signed (key %d)\n", name, SIGN_KEY_ID); return 0; } /** Docstring: Sign one file in place, returning an exit-style code.*
- `sign_selftest` (line 1637) `static int sign_selftest(void)` - *Docstring: In-OS differential selftest, pinned by BDD.  Prints the SHA-512 of "abc" and an Ed25519 signature of the 64-zero-byte digest under the embedded development key. The BDD suite pins both lines byte-exact against python/PyNaCl oracles, so any miniGCC codegen regression in the SHA, field, curve or digest paths fails the boot suite instead of shipping bad signatures (every primitive below was differential-tested during * bringup; see the file header for the constraints they pin).*
- `main` (line 1657) `int main(int argc, char **argv)`
- `printf` (line 28) `int printf();`
- `strcmp` (line 29) `int strcmp();`
- `fopen` (line 30) `void *fopen();`
- `fclose` (line 31) `int fclose();`
- `fread` (line 32) `int fread();`
- `fwrite` (line 33) `int fwrite();`
- `fseek` (line 34) `int fseek();`
- `ftell` (line 35) `int ftell();`
- `malloc` (line 36) `void *malloc();`
- `free` (line 37) `void free();`

**Macros:**
- `SIGN_KEY_ID` (line 39) `#define SIGN_KEY_ID`
- `SIGN_EXIT_FAIL` (line 40) `#define SIGN_EXIT_FAIL`
- `SIGN_ET_EXEC` (line 42) `#define SIGN_ET_EXEC`
- `SIGN_ET_DYN` (line 43) `#define SIGN_ET_DYN`
- `SIGN_EM_X86_64` (line 44) `#define SIGN_EM_X86_64`
- `SIGN_PT_LOAD` (line 45) `#define SIGN_PT_LOAD`
- `SIGN_PT_NOTE` (line 46) `#define SIGN_PT_NOTE`
- `SIGN_SHT_NOTE` (line 47) `#define SIGN_SHT_NOTE`
- `SIGN_EHDR_SIZE` (line 48) `#define SIGN_EHDR_SIZE`
- `SIGN_PHDR_SIZE` (line 49) `#define SIGN_PHDR_SIZE`
- `SIGN_SHDR_SIZE` (line 50) `#define SIGN_SHDR_SIZE`
- `SIGN_NOTE_HDR` (line 51) `#define SIGN_NOTE_HDR`
- `SIGN_DESC_BYTES` (line 52) `#define SIGN_DESC_BYTES`
- `SIGN_SIG_BYTES` (line 53) `#define SIGN_SIG_BYTES`
- `SIGN_NOTE_TOTAL` (line 54) `#define SIGN_NOTE_TOTAL`
- `SIGN_NOTE_TYPE` (line 55) `#define SIGN_NOTE_TYPE`
- `SIGN_MAX_FILE` (line 56) `#define SIGN_MAX_FILE`
- `SIGN_SEEK_END` (line 57) `#define SIGN_SEEK_END`

#### `spin.c`
**Path:** `progs/src/spin.c`

**Functions:**
- `lx_syscall3` (line 11) `static long lx_syscall3(long n, long a1, long a2, long a3)`
- `lx_strlen` (line 20) `static unsigned long lx_strlen(const char *s)`
- `lx_write` (line 26) `static void lx_write(const char *s)`
- `lx_write_int` (line 30) `static void lx_write_int(long v)`
- `lx_atoi` (line 42) `static long lx_atoi(const char *s)`
- `spin_u32` (line 66) `static void spin_u32(unsigned char *d, unsigned long v)`
- `spin_hdr` (line 73) `static void spin_hdr(unsigned char *d, unsigned long id, unsigned long op,
        unsigned long ...`
- `spin_box_ok` (line 82) `static int spin_box_ok(const char *box)`
- `spin_hex8` (line 95) `static void spin_hex8(unsigned int v, char *dst)`
- `spin_write_all` (line 104) `static long spin_write_all(long fd, const unsigned char *buf, long len)`
- `spin_emit` (line 114) `static int spin_emit(const char *box, unsigned int seq,
        const unsigned char *msg, long mlen)`
- `spin_raw_file` (line 145) `static int spin_raw_file(const char *box)`
- `spin_pixels` (line 169) `static void spin_pixels(long off)`
- `spin_wl` (line 181) `static int spin_wl(const char *box, const char *narg)`
- `lmain` (line 225) `int lmain(long argc, char **argv)`

**Macros:**
- `SPIN_WLW` (line 56) `#define SPIN_WLW`
- `SPIN_WLH` (line 57) `#define SPIN_WLH`
- `SPIN_WLA` (line 58) `#define SPIN_WLA`
- `SPIN_WLB` (line 59) `#define SPIN_WLB`

#### `test.c`
**Path:** `progs/src/test.c`

**Functions:**
- `add` (line 1) `int add(int a, int b)`
- `main` (line 2) `int main(void)`

#### `thdemo.c`
**Path:** `progs/src/thdemo.c`
**File Doc:** *thdemo.c -- Producer-consumer over mthreads (roadmap Phase 1, M1).*

**Functions:**
- `producer` (line 36) `static void *producer(void *p)`
- `consumer` (line 57) `static void *consumer(void *p)`
- `main` (line 82) `int main(void)`
- `threads` (line 3) `* * Ten threads (1 main + 5 producers + 4 consumers) share one address * space through thread_spawn (MiniOS syscall 225): a bounded buffer, * a spin mutex and Mesa-style spin-waits. Workers never touc`

**Macros:**
- `NPROD` (line 21) `#define NPROD`
- `NCONS` (line 22) `#define NCONS`
- `PER_PROD` (line 23) `#define PER_PROD`
- `BUFSZ` (line 24) `#define BUFSZ`
- `EXPECTED_N` (line 26) `#define EXPECTED_N`
- `EXPECTED_SUM` (line 27) `#define EXPECTED_SUM`

#### `w1.c`
**Path:** `progs/src/w1.c`

**Functions:**
- `main` (line 3) `int main(void)`
- `write` (line 1) `int write(int fd, char *buf, int n);`

#### `tls_u_main.c`
**Path:** `progs/tls_u/tls_u_main.c`
**File Doc:** *tlsget - minimal HTTPS GET over the ring-3 TLS stack.*

**Functions:**
- `syscall` (line 10) `* the MiniOS DNS syscall (200, sig 0: error-check only, sends nothing).
 * The kernel keeps servi...`
- `parse_port` (line 47) `static int parse_port(const char *s)` - *Strict port parser (clang-tidy cert-err34-c: atoi reports no errors, so "abc" and overflow both become 0 and fail open into the * default 443). All digits, at least one, value 1..65535, else -1.*
- `main` (line 61) `int main(int argc, char **argv)`

**Macros:**
- `_POSIX_C_SOURCE` (line 14) `#define _POSIX_C_SOURCE`
- `_DEFAULT_SOURCE` (line 15) `#define _DEFAULT_SOURCE`

#### `tls_u_port.c`
**Path:** `progs/tls_u/tls_u_port.c`
**File Doc:** *tls_u_port.c - ring-3 transport for the shared TLS stack (TLS_RING3).*

**Functions:**
- `sockets` (line 5) `* sockets: on the host they are host sockets (used by the
 * openssl-s_server interop test), insi...`
- `tls_u_recv` (line 39) `int tls_u_recv(int fd, char *buf, int len)`
- `tls_u_recv_timeout` (line 44) `int tls_u_recv_timeout(int fd, char *buf, int len, unsigned long ms)`
- `tls_u_close` (line 55) `void tls_u_close(int fd)`
- `tls_close` (line 67) `void tls_close(int fd)` - *Session-aware close for multi-fetch processes (freedom follows redirects and linked stylesheets, reusing the lowest free fd number every time). The engine keys sessions by raw fd and only clears the slot on handshake error; a successful session lives until someone frees it, so plain close() leaks the slot and the next handshake on the recycled fd number fails with "session already exists". Freeing * an fd with no session is a safe no-op. void tls_free_fd(int fd); /* session table owner: net/tls.c*
- `tls_now_days` (line 72) `long tls_now_days(void)`
- `tls_random` (line 78) `void tls_random(unsigned char *out, unsigned len)`
- `u_raw_syscall3` (line 99) `static long u_raw_syscall3(long n, long a1, long a2, long a3)`
- `parse_quad` (line 122) `static int parse_quad(const char *s, unsigned *ip_out)` - *Strict dotted-quad parser (clang-tidy cert-err34-c: sscanf %u has undefined overflow and accepts whitespace/sign, so "9999999999.1.1.1" is UB before the <256 check ever runs). Digits and dots only, four * octets 0..255, full-string consumption, else -1.*
- `tls_u_resolve` (line 147) `int tls_u_resolve(const char *host, unsigned *ip_out)`
- `net_dns_resolve` (line 183) `int net_dns_resolve(const char *host)` - *freedom's resolver name: kernel DNS value semantics (u32 host order, * -1 on failure).*
- `tls_free_fd` (line 66) `void tls_free_fd(int fd);` - *Session-aware close for multi-fetch processes (freedom follows redirects and linked stylesheets, reusing the lowest free fd number every time). The engine keys sessions by raw fd and only clears the slot on handshake error; a successful session lives until someone frees it, so plain close() leaks the slot and the next handshake on the recycled fd number fails with "session already exists". Freeing * an fd with no session is a safe no-op.*
- `answer` (line 163) `* answer (some resolvers go IPv6-only on the first query). */ memset(&hints, 0, sizeof(hints));`

**Macros:**
- `_POSIX_C_SOURCE` (line 12) `#define _POSIX_C_SOURCE`
- `_DEFAULT_SOURCE` (line 13) `#define _DEFAULT_SOURCE`

#### `topogpt3.c`
**Path:** `progs/topogpt3/topogpt3.c`

**Functions:**
- `tg_exp` (line 114) `static float tg_exp(float x)`
- `tg_tanh` (line 128) `static float tg_tanh(float x)`
- `tg_sin` (line 135) `static float tg_sin(float x)`
- `tg_cos` (line 144) `static float tg_cos(float x)`
- `tg_fabs` (line 148) `static float tg_fabs(float x)`
- `tg_log` (line 152) `static float tg_log(float x)`
- `tg_fmax` (line 164) `static float tg_fmax(float a, float b)`
- `tg_fmin` (line 168) `static float tg_fmin(float a, float b)`
- `load_vocab` (line 255) `static void load_vocab(const char *path)`
- `build_torus_graph` (line 296) `static void build_torus_graph(void)`
- `precompute_rope` (line 327) `static void precompute_rope(void)`
- `matvec` (line 359) `static void matvec(const float *W, const float *x, float *y, int rows, int cols)`
- `matvec_bias` (line 370) `static void matvec_bias(const float *W, const float *b, const float *x, float *y,
               ...`
- `rmsnorm` (line 382) `static void rmsnorm(const float *x, const float *w, float *y, int d)`
- `softmax` (line 391) `static void softmax(float *x, int n)`
- `gelu` (line 400) `static void gelu(float *x, int n)`
- `silu` (line 410) `static void silu(float *x, int n)`
- `swiglu` (line 418) `static void swiglu(const float *gate_w, const float *up_w, const float *down_w,
                 ...`
- `quat_normalize` (line 435) `static void quat_normalize(float *q)`
- `quat_hamilton` (line 440) `static void quat_hamilton(const float *a, const float *b, float *c)`
- `quat_linear` (line 448) `static void quat_linear(const float *Ww, const float *Wx, const float *Wy, const float *Wz,
     ...` - *static void quat_normalize(float *q) { float n = tg_sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]); if (n > 1e-8f) { q[0]/=n; q[1]/=n; q[2]/=n; q[3]/=n; } } static void quat_hamilton(const float *a, const float *b, float *c) { c[0] = a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]; c[1] = a[0]*b[1] + a[1]*b[0] + a[2]*b[3] - a[3]*b[2]; c[2] = a[0]*b[2] - a[1]*b[3] + a[2]*b[0] + a[3]*b[1]; c[3] = a[0]*b[3] + a[1]*b[2] - a[2]*b[1] + a[3]*b[0]; } /* QuaternionLinear: x[w,x,y,z] -> y[w,x,y,z]*
- `ifft_radix2` (line 505) `static void ifft_radix2(float *real, float *imag, int n)`
- `rfft` (line 513) `static void rfft(const float *x, float *Xr, float *Xi, int n)` - *cur_r = nr; } } } } static void ifft_radix2(float *real, float *imag, int n) { int i; for (i = 0; i < n; i++) imag[i] = -imag[i]; fft_radix2(real, imag, n); for (i = 0; i < n; i++) { real[i] /= (float)n; imag[i] = -imag[i] / (float)n; } } /* Real FFT: x[n] -> X[n/2+1] complex*
- `irfft` (line 522) `static void irfft(const float *Xr, const float *Xi, float *x, int n)` - *fft_radix2(real, imag, n); for (i = 0; i < n; i++) { real[i] /= (float)n; imag[i] = -imag[i] / (float)n; } } /* Real FFT: x[n] -> X[n/2+1] complex static void rfft(const float *x, float *Xr, float *Xi, int n) { float re[n], im[n]; int i; for (i = 0; i < n; i++) { re[i] = x[i]; im[i] = 0.0f; } fft_radix2(re, im, n); for (i = 0; i <= n/2; i++) { Xr[i] = re[i]; Xi[i] = im[i]; } } /* Inverse real FFT: X[n/2+1] complex -> x[n]*
- `filter1d` (line 537) `static void filter1d(const float *x, const float *kr, const float *ki,
                      floa...`
- `ifft2d` (line 580) `static void ifft2d(float *data_r, float *data_i, int h, int w)`
- `rfft2d_real` (line 602) `static void rfft2d_real(const float *data, float *out_r, float *out_i,
                         i...` - *ifft_radix2(row_re, row_im, w); for (c = 0; c < w; c++) { re[r*w+c] = row_re[c]; im[r*w+c] = row_im[c]; } } /* IFFT columns float col_re[h], col_im[h]; for (c = 0; c < w; c++) { for (r = 0; r < h; r++) { col_re[r] = re[r*w+c]; col_im[r] = im[r*w+c]; } ifft_radix2(col_re, col_im, h); for (r = 0; r < h; r++) { re[r*w+c] = col_re[r]; im[r*w+c] = col_im[r]; } } for (i = 0; i < h * w; i++) { data_r[i] = re[i]; data_i[i] = im[i]; } } /* RFFT2: 2D real FFT, output is [h][w/2+1] complex*
- `irfft2d` (line 629) `static void irfft2d(const float *in_r, const float *in_i, float *out,
                     int h,...` - *for (r = 0; r < h; r++) { col_re[r] = re[r*w+c]; col_im[r] = im[r*w+c]; } fft_radix2(col_re, col_im, h); for (r = 0; r < h; r++) { re[r*w+c] = col_re[r]; im[r*w+c] = col_im[r]; } } int fw = w / 2 + 1; for (r = 0; r < h; r++) { for (c = 0; c < fw; c++) { out_r[r * fw + c] = re[r * w + c]; out_i[r * fw + c] = im[r * w + c]; } } } /* IRFFT2: inverse of rfft2d_real*
- `cmul` (line 664) `static void cmul(float ar, float ai, float cr, float di, float *rr, float *ri)` - *====================================================================== SECTION 11: QUATERNION SPECTRAL LAYER 2D * ====================================================================== /* Complex multiply: (ar+bi)(cr+di) = (ac-bd)+(ad+bc)i*
- `spectral_contract` (line 670) `static void spectral_contract(const float *Wr, const float *Wi,
                               co...` - *====================================================================== SECTION 11: QUATERNION SPECTRAL LAYER 2D * ====================================================================== /* Complex multiply: (ar+bi)(cr+di) = (ac-bd)+(ad+bc)i static void cmul(float ar, float ai, float cr, float di, float *rr, float *ri) { rr = ar*cr - ai*di; ri = ar*di + ai*cr; } /* Contract: Y[o,h,w] = sum_i W[i,o,h,w] * X[b,i,h,w] (complex)*
- `quat_spectral_layer_2d` (line 695) `static void quat_spectral_layer_2d(
    const float *x, float *y,
    const float *kr_w, const fl...`
- `spectral_ae_encode` (line 785) `static void spectral_ae_encode(const float *x, float *z, const LayerWeights *lw)`
- `spectral_ae_decode` (line 793) `static void spectral_ae_decode(const float *z, float *x, const LayerWeights *lw)`
- `process_torus_grid` (line 800) `static void process_torus_grid(const float *grid, float *out, const LayerWeights *lw)`
- `torus_soft_assign` (line 821) `static void torus_soft_assign(const float *phi1, const float *phi2,
                             ...`
- `message_passing` (line 843) `static void message_passing(const float *node_feat, float *out,
                             cons...`
- `torus_brain_forward` (line 888) `static void torus_brain_forward(const float *x, float *out, float *recon_loss,
                  ...`
- `attention_forward` (line 978) `static void attention_forward(const float *x, float *out, int layer_idx, int pos, int total_kv_co...`
- `moe_forward` (line 1078) `static void moe_forward(const float *x, float *out, const LayerWeights *lw)`
- `forward` (line 1128) `static void forward(const int *token_ids, int seq_len, float *logits_out)`
- `tokenize_string` (line 1195) `static int tokenize_string(const char *text, int *tokens, int max_tokens)`
- `apply_temperature` (line 1210) `static void apply_temperature(float *logits, int n, float temp)`
- `apply_repetition_penalty` (line 1216) `static void apply_repetition_penalty(float *logits, int n, const int *tokens,
                   ...`
- `apply_top_k` (line 1229) `static void apply_top_k(float *logits, int n, int k)`
- `sample` (line 1248) `static int sample(const float *logits, int n)`
- `load_weights` (line 1282) `static int load_weights(const char *path)`
- `load_weights_fp16` (line 1452) `static int load_weights_fp16(const char *path)`
- `load_weights_auto` (line 1583) `static int load_weights_auto(const char *path)` - *printf("  Layer %d loaded\n", i); } READ_TENSOR16(W.final_norm, D_MODEL); #undef SKIP_TENSOR16 #undef READ_TENSOR16 fclose(f); printf("Weights loaded successfully (fp16).\n"); return 0; } /* Auto-detect format and load weights*
- `time_now_ms` (line 1600) `static double time_now_ms(void)` - *====================================================================== SECTION 20: TIMING * ====================================================================== /* Portable wall-clock timer using rdtsc where available, else microseconds*
- `decode_token` (line 1614) `static void decode_token(int tid)`
- `load_token_file` (line 1629) `static int load_token_file(const char *path, int *out_ids, int max_ids)` - *if (tid < 256) { /* Map GPT-2 byte-level encoding back to original byte int n = tid; if (n < 94) n += 33; else if (n < 163) n += 161 - 94; else n += 173 - 163; putchar(n); } else { /* Multi-byte token: output placeholder or skip putchar('?'); } } /* Load pre-tokenized binary file (format: "TKID" + uint32 count + int32 ids[])*
- `decode_token_tiktoken` (line 1652) `static void decode_token_tiktoken(int tid)` - *if (fread(&n, 4, 1, f) != 1) { fclose(f); return 0; } if (n > (unsigned)max_ids) n = max_ids; int count = (int)n; int i; for (i = 0; i < count; i++) { int id; if (fread(&id, 4, 1, f) != 1) break; out_ids[i] = id; } fclose(f); return count; } /* Decode token ID using loaded vocabulary*
- `generate_tokens` (line 1661) `static void generate_tokens(int *prompt_tokens, int n_prompt, int max_new_tokens,
               ...`
- `generate` (line 1725) `static void generate(const char *prompt, int max_new_tokens, float temperature,
                 ...`
- `interactive_mode` (line 1736) `static void interactive_mode(void)`
- `print_help` (line 1850) `static void print_help(void)`
- `main` (line 1885) `int main(int argc, char **argv)`
- `printf` (line 28) `extern int printf(const char *, ...);`
- `fprintf` (line 29) `extern int fprintf(FILE *, const char *, ...);`
- `sprintf` (line 30) `extern int sprintf(char *, const char *, ...);`
- `snprintf` (line 31) `extern int snprintf(char *, unsigned long, const char *, ...);`
- `puts` (line 32) `extern int puts(const char *);`
- `putchar` (line 33) `extern int putchar(int);`
- `fputc` (line 34) `extern int fputc(int, FILE *);`
- `fputs` (line 35) `extern int fputs(const char *, FILE *);`
- `fopen` (line 36) `extern FILE *fopen(const char *, const char *);`
- `fclose` (line 37) `extern int fclose(FILE *);`
- `fread` (line 38) `extern unsigned long fread(void *, unsigned long, unsigned long, FILE *);`
- `fwrite` (line 39) `extern unsigned long fwrite(const void *, unsigned long, unsigned long, FILE *);`
- `fseek` (line 40) `extern int fseek(FILE *, long, int);`
- `ftell` (line 41) `extern long ftell(FILE *);`
- `fflush` (line 42) `extern int fflush(FILE *);`
- `malloc` (line 47) `extern void *malloc(unsigned long);` - *define NULL ((void*)0) define SEEK_SET 0 define SEEK_CUR 1 define SEEK_END 2*
- `free` (line 48) `extern void free(void *);`
- `memcpy` (line 49) `extern void *memcpy(void *, const void *, unsigned long);`
- `memset` (line 50) `extern void *memset(void *, int, unsigned long);`
- `strcmp` (line 51) `extern int strcmp(const char *, const char *);`
- `strncmp` (line 52) `extern int strncmp(const char *, const char *, unsigned long);`
- `strlen` (line 53) `extern unsigned long strlen(const char *);`
- `strstr` (line 54) `extern char *strstr(const char *, const char *);`

**Macros:**
- `NULL` (line 43) `#define NULL`
- `SEEK_SET` (line 44) `#define SEEK_SET`
- `SEEK_CUR` (line 45) `#define SEEK_CUR`
- `SEEK_END` (line 46) `#define SEEK_END`
- `VOCAB_SIZE` (line 65) `#define VOCAB_SIZE`
- `D_MODEL` (line 66) `#define D_MODEL`
- `N_HEADS` (line 67) `#define N_HEADS`
- `N_KV_HEADS` (line 68) `#define N_KV_HEADS`
- `GQA_GROUPS` (line 69) `#define GQA_GROUPS`
- `D_HEAD` (line 70) `#define D_HEAD`
- `D_QUAT` (line 71) `#define D_QUAT`
- `N_LAYERS` (line 72) `#define N_LAYERS`
- `MAX_SEQ_LEN` (line 73) `#define MAX_SEQ_LEN`
- `N_EXPERTS` (line 74) `#define N_EXPERTS`
- `MOE_TOP_K` (line 75) `#define MOE_TOP_K`
- `N_NODES` (line 76) `#define N_NODES`
- `N_RADIAL` (line 77) `#define N_RADIAL`
- `N_ANGULAR` (line 78) `#define N_ANGULAR`
- `N_EDGE_TYPES` (line 79) `#define N_EDGE_TYPES`
- `N_EDGES` (line 80) `#define N_EDGES`
- `SPECTRAL_LATENT_DIM` (line 81) `#define SPECTRAL_LATENT_DIM`
- `D_LAT_Q` (line 82) `#define D_LAT_Q`
- `TORUS_GRID_H` (line 83) `#define TORUS_GRID_H`
- `TORUS_GRID_W` (line 84) `#define TORUS_GRID_W`
- `FREQ_W` (line 85) `#define FREQ_W`
- `N_SPECTRAL_LAYERS` (line 86) `#define N_SPECTRAL_LAYERS`
- `EXPERT_INNER` (line 87) `#define EXPERT_INNER`
- `READOUT_INNER` (line 88) `#define READOUT_INNER`
- `EOS_TOKEN` (line 89) `#define EOS_TOKEN`
- `EMBED_INNER` (line 90) `#define EMBED_INNER`
- `PI` (line 91) `#define PI`
- `EPS_RMS` (line 92) `#define EPS_RMS`
- `TORUS_TEMP` (line 93) `#define TORUS_TEMP`
- `MAX_TOKENS` (line 94) `#define MAX_TOKENS`
- `MAX_PROMPT_LEN` (line 95) `#define MAX_PROMPT_LEN`
- `MAX_LINE` (line 96) `#define MAX_LINE`
- `TOK_TAB_SIZE` (line 97) `#define TOK_TAB_SIZE`
- `TOK_VOCAB_SIZE` (line 98) `#define TOK_VOCAB_SIZE`
- `SKIP_TENSOR` (line 1300) `#define SKIP_TENSOR()`
- `READ_TENSOR` (line 1310) `#define READ_TENSOR(dest, count)`
- `SKIP_TENSOR16` (line 1470) `#define SKIP_TENSOR16()`
- `READ_TENSOR16` (line 1480) `#define READ_TENSOR16(dest, count)`

**Structs:**
- `FILE` (line 24) - *topogpt3 -p "prompt" [-n N] [-t T]   Headless mode topogpt3 -i                          Interactive mode topogpt3 -f file.txt                 Read prompt from file  #pragma GCC diagnostic ignored "-Wunused-function" #ifdef __has_include #if __has_include(<stdio.h>) #include <stdio.h> #include <string.h> #include <stdlib.h> #else /* MiniOS standalone: declare stdio from ld stubs*
- `LayerWeights` (line 176)
- `ModelWeights` (line 224)

**Variables:**
- `stdin` (line 25) `extern FILE *stdin;`
- `stdout` (line 26) `extern FILE *stdout;`
- `stderr` (line 27) `extern FILE *stderr;`

#### `vedit.c`
**Path:** `progs/vedit/vedit.c`
**File Doc:** *vedit IDE build and run contract.*

**Functions:**
- `vedit_getc_raw` (line 38) `static long vedit_getc_raw(long blocking)` - *#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <sys/stat.h> #include "nuklear.h" #include "nuklear_minios.h" #include "nuklear_theme.h" #define MINIOS_LEAKCHECK_IMPL #define MINIOS_LK_ENABLE #include "leakcheck.h" /** Platform syscalls vedit needs beyond the platform layer.*
- `vedit_set_title` (line 47) `static long vedit_set_title(const char *t)` - *#define MINIOS_LEAKCHECK_IMPL #define MINIOS_LK_ENABLE #include "leakcheck.h" /** Platform syscalls vedit needs beyond the platform layer. static long vedit_getc_raw(long blocking) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GETC_RAW), "D"(blocking) : "rcx", "r11", "memory"); return ret; } /** Set the graphics window title.*
- `vedit_spawn` (line 56) `static long vedit_spawn(const char *path, const char *redir, int argc,
                        co...` - *: "rcx", "r11", "memory"); return ret; } /** Set the graphics window title. static long vedit_set_title(const char *t) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_GFX_SET_TITLE), "D"(t) : "rcx", "r11", "memory"); return ret; } /** Run a program through SYS_SPAWN, preserving the IDE across the child.*
- `vedit_vga` (line 68) `static long vedit_vga(int on)` - */** Run a program through SYS_SPAWN, preserving the IDE across the child. static long vedit_spawn(const char *path, const char *redir, int argc, const char **argv) { long ret; register long r10 __asm__("r10") = (long)argv; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_SPAWN), "D"(path), "S"(redir), "d"((long)argc), "r"(r10) : "rcx", "r11", "memory"); return ret; } /** Release or reclaim the display so toolchain output stays on the terminal.*
- `vedit_kbd_raw` (line 80) `static long vedit_kbd_raw(int on)` - *Force cooked keyboard mode: GETC_RAW (this editor's only key source) starves while raw mode diverts PS/2 bytes to the raw queue, so vedit asserts its requirement at startup instead of inheriting the * launcher's mode (a file-browser spawn left raw on and all keys died).*
- `vedit_time_ms` (line 89) `static unsigned long vedit_time_ms(void)` - *Force cooked keyboard mode: GETC_RAW (this editor's only key source) starves while raw mode diverts PS/2 bytes to the raw queue, so vedit asserts its requirement at startup instead of inheriting the * launcher's mode (a file-browser spawn left raw on and all keys died). static long vedit_kbd_raw(int on) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_KBD_RAW), "D"((long)on) : "rcx", "r11", "memory"); return ret; } /** Wall-clock milliseconds for the cross-frame ESC-sequence timeout.*
- `vedit_clip_set` (line 97) `static long vedit_clip_set(const char *s, long len)` - *: "a"(MINIOS_SYS_KBD_RAW), "D"((long)on) : "rcx", "r11", "memory"); return ret; } /** Wall-clock milliseconds for the cross-frame ESC-sequence timeout. static unsigned long vedit_time_ms(void) { long ret; __asm__ volatile("syscall" : "=a"(ret) : "a"(MINIOS_SYS_TIME) : "rcx", "r11", "memory"); return (unsigned long)ret; } /** Shared clipboard: SET copies in (249), GET copies out (250).*
- `vedit_clip_get` (line 105) `static long vedit_clip_get(char *out, long cap)`
- `vedit_c_bg` (line 183) `static struct nk_color vedit_c_bg(void)` - */* ---- Decoded keys above any byte ---- #define VEDIT_KEY_UP 1000 #define VEDIT_KEY_DOWN 1001 #define VEDIT_KEY_LEFT 1002 #define VEDIT_KEY_RIGHT 1003 #define VEDIT_KEY_HOME 1004 #define VEDIT_KEY_END 1005 #define VEDIT_KEY_PGUP 1006 #define VEDIT_KEY_PGDN 1007 #define VEDIT_KEY_DEL 1008 #define VEDIT_KEY_ESC 1009 /* ---- Theme: every ink named once, used everywhere ----*
- `vedit_c_gutter` (line 184) `static struct nk_color vedit_c_gutter(void)`
- `vedit_c_default` (line 185) `static struct nk_color vedit_c_default(void)`
- `vedit_c_keyword` (line 186) `static struct nk_color vedit_c_keyword(void)`
- `vedit_c_string` (line 187) `static struct nk_color vedit_c_string(void)`
- `vedit_c_comment` (line 188) `static struct nk_color vedit_c_comment(void)`
- `vedit_c_number` (line 189) `static struct nk_color vedit_c_number(void)`
- `vedit_c_preproc` (line 190) `static struct nk_color vedit_c_preproc(void)`
- `vedit_c_header` (line 191) `static struct nk_color vedit_c_header(void)`
- `vedit_c_headtxt` (line 192) `static struct nk_color vedit_c_headtxt(void)`
- `vedit_c_status` (line 193) `static struct nk_color vedit_c_status(void)`
- `vedit_c_cursor` (line 194) `static struct nk_color vedit_c_cursor(void)`
- `vedit_ink` (line 196) `static struct nk_color vedit_ink(int col)`
- `vedit_set_msg` (line 361) `static void vedit_set_msg(const char *s)`
- `vedit_is_alpha` (line 368) `static int vedit_is_alpha(int c)`
- `vedit_is_digit` (line 372) `static int vedit_is_digit(int c)`
- `vedit_is_wordc` (line 376) `static int vedit_is_wordc(int c)`
- `vedit_is_kw` (line 380) `static int vedit_is_kw(const char *table, const char *word, int wlen)`
- `separators` (line 403) `* allow_quote exists because C digit separators (1'000'000) are not
 * valid in Python/Lua number...`
- `vedit_parse_number` (line 426) `static int vedit_parse_number(const char *t, int len, int i, int allow_quote)`
- `vedit_parse_keyword` (line 441) `static int vedit_parse_keyword(const char *t, int len, int i,
                               cons...`
- `vedit_lang_of` (line 458) `static int vedit_lang_of(const char *fname)` - *int wl = 0; int j = i; int k; while (j < len && vedit_is_wordc((unsigned char)t[j])) { if (wl < VEDIT_WORD_MAX - 1) w[wl++] = t[j]; j++; } if (vedit_is_kw(kw_table, w, wl)) { for (k = i; k < j; k++) vedit_cell[k] = VEDIT_COL_KEYWORD; } return j; } /** Map a file name to its highlight language.*
- `vedit_lang_name` (line 479) `static const char *vedit_lang_name(int lang)`
- `vedit_scan_line` (line 489) `static int vedit_scan_line(const char *t, int len, int st)` - *} /** Name a highlight language for the status row. static const char *vedit_lang_name(int lang) { if (lang == VEDIT_LANG_C) return "C"; if (lang == VEDIT_LANG_PY) return "Python"; if (lang == VEDIT_LANG_LUA) return "Lua"; if (lang == VEDIT_LANG_ASM) return "Asm"; if (lang == VEDIT_LANG_LISP) return "Lisp"; return "text"; } /* Paint one line into vedit_cell; returns the state for the next line.*
- `vedit_state_at` (line 760) `static int vedit_state_at(int row)` - *} else if (c == '"' || c == '\'') { i = vedit_parse_string(t, len, i); } else if (vedit_is_digit(c)) { i = vedit_parse_number(t, len, i, 0); } else if (vedit_is_alpha(c)) { i = vedit_parse_keyword(t, len, i, vedit_kw_lua); } else { i++; } } return 0; } /* Multi-line state at the start of a row: replay earlier lines.*
- `vedit_row_ptr` (line 769) `static char *vedit_row_ptr(int idx)`
- `vedit_clamp` (line 773) `static void vedit_clamp(void)`
- `vedit_follow` (line 785) `static void vedit_follow(void)`
- `vedit_insert_char` (line 798) `static void vedit_insert_char(int c)`
- `vedit_delete_line_at` (line 836) `static void vedit_delete_line_at(int idx)`
- `vedit_backspace` (line 847) `static void vedit_backspace(void)`
- `vedit_delete_char` (line 883) `static void vedit_delete_char(void)`
- `vedit_split` (line 916) `static void vedit_split(void)`
- `vedit_tab` (line 969) `static void vedit_tab(void)`
- `vedit_str_case` (line 1005) `static void vedit_str_case(char *s, int mode)` - *Upper/lower/capitalize a NUL string in place; mode 1=upper, 2=lower, * 3=capitalize. Pure: the host suite mirrors it byte for byte.*
- `vedit_str_transpose` (line 1032) `static void vedit_str_transpose(char *s, int len, int pos)` - *new_word = 0; } else { if (new_word) { if (c >= 'a' && c <= 'z') s[i] = (char)(c - 32); new_word = 0; } else { if (c >= 'A' && c <= 'Z') s[i] = (char)(c + 32); } } i++; } } /** Transpose two adjacent bytes around dot; pure string core of ^T.*
- `vedit_magic_class` (line 1044) `static int vedit_magic_class(int c, const char *cls)` - *Minimal magic matcher (uemacs search.c subset): '.' any, '*' repeat, '^'/'$' anchors, '[...]' classes with ranges and '^' negation. Returns 1 on a match of pat against the prefix of text, with *mlen set to the * matched length. Pure: host suite pins every vector.*
- `vedit_magic_atom` (line 1066) `static int vedit_magic_atom(const char *pat, int c, int *atom_len)`
- `vedit_magic_here` (line 1089) `static int vedit_magic_here(const char *text, const char *pat, int *mlen)`
- `vedit_magic_match` (line 1150) `static int vedit_magic_match(const char *text, const char *pat, int *mlen)` - *if (vedit_magic_here(text + k, rest, &sub)) { mlen = total + k + sub; return 1; } if (k == 0) break; } return 0; } } mlen = total; return 1; } /** Match pat anywhere in text; anchored when pat starts with '^'.*
- `vedit_buf_alloc` (line 1179) `static int vedit_buf_alloc(int idx)`
- `vedit_next_buffer` (line 1207) `static int vedit_next_buffer(void)`
- `vedit_hist_push` (line 1221) `static void vedit_hist_push(const char *fname)`
- `vedit_set_mark` (line 1240) `static void vedit_set_mark(void)`
- `vedit_region` (line 1248) `static int vedit_region(int *y0, int *x0, int *y1, int *x1)` - *for (k = 0; k < VEDIT_HIST_N - 1; k++) memcpy(vedit_hist[k], vedit_hist[k + 1], VEDIT_FNAME_MAX); memcpy(vedit_hist[VEDIT_HIST_N - 1], fname, n + 1); } } static void vedit_set_mark(void) { vedit_mark_on = 1; vedit_mark_y = vedit_cy; vedit_mark_x = vedit_cx; vedit_set_msg("mark set"); } /** Region bounds in buffer order; returns 0 when no usable region.*
- `vedit_copy_region` (line 1269) `static int vedit_copy_region(void)` - *int t = *y0; y0 = *y1; y1 = t; t = *x0; x0 = *x1; x1 = t; } if (*y0 == *y1 && *x0 == *x1) return 0; if (*y0 >= vedit_count) return 0; if (*y1 >= vedit_count) *y1 = vedit_count - 1; return 1; } /** Copy the region into the kill ring head (uemacs copy-region).*
- `vedit_kill_region` (line 1299) `static int vedit_kill_region(void)` - *if (a > vedit_used[y]) a = vedit_used[y]; if (b > vedit_used[y]) b = vedit_used[y]; for (k = a; k < b && pos < VEDIT_KILL_MAX - 1; k++) vedit_kill[vedit_kill_head][pos++] = vedit_row_ptr(y)[k]; if (y < y1 && pos < VEDIT_KILL_MAX - 1) vedit_kill[vedit_kill_head][pos++] = '\n'; } vedit_kill[vedit_kill_head][pos] = 0; vedit_kill_len[vedit_kill_head] = pos; vedit_set_msg("copied"); return 0; } /** Delete the region after copying it (uemacs kill-region).*
- `vedit_kill_line` (line 1345) `static int vedit_kill_line(void)` - *} for (k = 0; k < tail; k++) first[x0 + k] = last[x1 + k]; vedit_used[y0] = x0 + tail; for (y = y1; y > y0; y--) vedit_delete_line_at(y); vedit_cy = y0; vedit_cx = x0; } vedit_mark_on = 0; vedit_dirty = 1; vedit_set_msg("killed"); return 0; } /** Kill to end of line, or the newline itself when already at it.*
- `vedit_yank` (line 1383) `static int vedit_yank(void)` - *vedit_kill[vedit_kill_head][0] = '\n'; vedit_kill[vedit_kill_head][1] = 0; vedit_kill_len[vedit_kill_head] = 1; vedit_delete_char(); vedit_set_msg("killed"); vedit_dirty = 1; return 0; } vedit_dirty = 1; vedit_set_msg("killed"); return 0; } /** Yank the ring head at dot (uemacs yank).*
- `vedit_word_move` (line 1416) `static int vedit_word_move(int dir)` - *vedit_row_ptr(vedit_cy)[vedit_cx] = s[k]; vedit_cx++; vedit_dirty = 1; } else { vedit_insert_char((unsigned char)s[k]); if (vedit_msg[0]) return -1; } } } vedit_msg[0] = 0; return 0; } /** Word motion core: dir +1 forward, -1 back.*
- `vedit_case_word` (line 1451) `static int vedit_case_word(int mode)` - *vedit_cx = vedit_used[vedit_cy]; return 0; } while (vedit_cx > 0 && !vedit_is_wordc((unsigned char)l[vedit_cx - 1])) vedit_cx--; while (vedit_cx > 0 && vedit_is_wordc((unsigned char)l[vedit_cx - 1])) vedit_cx--; return 0; } } /** Apply case mode to the word at/after dot (uemacs word.c).*
- `vedit_transpose` (line 1490) `static int vedit_transpose(void)` - *if (mode == 1 && c >= 'a' && c <= 'z') l[k] = (char)(c - 32); else if (mode == 2 && c >= 'A' && c <= 'Z') l[k] = (char)(c + 32); else if (mode == 3) { if (k == start && c >= 'a' && c <= 'z') l[k] = (char)(c - 32); if (k > start && c >= 'A' && c <= 'Z') l[k] = (char)(c + 32); } } vedit_cx = end; vedit_dirty = 1; vedit_msg[0] = 0; return 0; } /** Transpose the two characters around dot (uemacs random.c).*
- `vedit_goto_fence` (line 1513) `static int vedit_goto_fence(void)` - *vedit_set_msg("nothing to transpose"); return -1; } if (vedit_cx <= 0) vedit_cx = 1; if (vedit_cx >= vedit_used[vedit_cy]) vedit_cx = vedit_used[vedit_cy] - 1; vedit_str_transpose(l, vedit_used[vedit_cy], vedit_cx); if (vedit_cx < vedit_used[vedit_cy]) vedit_cx++; vedit_dirty = 1; vedit_msg[0] = 0; return 0; } /** Jump to the fence matching the one under dot (uemacs random.c).*
- `vedit_count_words` (line 1579) `static void vedit_count_words(void)` - *vedit_cy = y; vedit_cx = x; vedit_msg[0] = 0; return 0; } depth--; } } } vedit_set_msg("no match"); return -1; } /** Count words/lines/chars from dot to end, emacs-style, into msg.*
- `vedit_match_at` (line 1622) `static int vedit_match_at(int row, int col, const char *needle, int magic,
                      ...` - *printf("vedit: %s\n", nb); } /* ---- uemacs F2: magic search, isearch, replace, fill ---- #define VEDIT_FILL_COL 72 static int vedit_isearch_oy; static int vedit_isearch_ox; static int vedit_isearch_dir; static int vedit_qrep_on; static char vedit_qrep_old[VEDIT_MAGIC_MAX]; static char vedit_qrep_new[VEDIT_LINE_MAX]; /** Match needle at line/col; magic when flag set. Returns match length.*
- `vedit_search_fwd` (line 1659) `static int vedit_search_fwd(int row, int col, const char *needle, int magic,
                    ...` - *if (avail > VEDIT_LINE_MAX) avail = VEDIT_LINE_MAX; for (k = 0; k < avail; k++) tmp[k] = l[col + k]; tmp[avail] = 0; if (!vedit_magic_match(tmp, needle, &m)) return 0; if (m == 0) { mlen = 0; return 1; } mlen = m; return 1; } } /** Forward search from (row,col); wraps once. Moves dot, returns 0.*
- `vedit_search_rev` (line 1691) `static int vedit_search_rev(int row, int col, const char *needle, int magic)`
- `vedit_isearch_step` (line 1714) `static void vedit_isearch_step(void)`
- `vedit_replace_at` (line 1741) `static int vedit_replace_at(int row, int col, const char *old_s,
                            cons...` - *vedit_set_msg("wrapped"); else vedit_msg[0] = 0; } else { if (vedit_search_rev(vedit_isearch_oy, vedit_isearch_ox, vedit_prompt_buf, 0) != 0) vedit_set_msg("failing"); else vedit_msg[0] = 0; } memcpy(vedit_last_find, vedit_prompt_buf, VEDIT_LINE_MAX); } /** Replace one occurrence at (row,col); returns new cursor col or -1.*
- `vedit_replace_all` (line 1761) `static int vedit_replace_all(const char *old_s, const char *new_s,
                             i...` - *if (!vedit_match_at(row, col, old_s, magic, &mlen) || mlen <= 0) return -1; l = vedit_row_ptr(row); nlen = (int)strlen(new_s); if (vedit_used[row] - mlen + nlen > VEDIT_LINE_USED) return -1; for (k = vedit_used[row] - 1; k >= col + mlen; k--) l[k - mlen + nlen] = l[k]; for (k = 0; k < nlen; k++) l[col + k] = new_s[k]; vedit_used[row] += nlen - mlen; vedit_dirty = 1; return col + nlen; } /** Replace all, forward from dot with wrap; reports count, fail closed.*
- `vedit_fill_paragraph` (line 1814) `static int vedit_fill_paragraph(void)` - *r++; c = 0; if (r >= vedit_count) break; } } { char nb[64]; snprintf(nb, sizeof(nb), "replaced %d", count); vedit_set_msg(nb); } return 0; } /** Refill the blank-line-delimited paragraph at dot (uemacs word.c).*
- `vedit_find` (line 1898) `static void vedit_find(const char *needle)`
- `vedit_save` (line 1988) `static int vedit_save(void)`
- `vedit_load` (line 2051) `static int vedit_load(void)`
- `vedit_open_in_buffer` (line 2122) `static int vedit_open_in_buffer(const char *fname, int ro)` - *{ struct stat st; if (stat(vedit_fname, &st) == 0) { vedit_sizes[vedit_cur] = (long)st.st_size; vedit_mtimes[vedit_cur] = (long)st.st_mtime; } else { vedit_sizes[vedit_cur] = -1; vedit_mtimes[vedit_cur] = -1; } } return 1; } /** Open a file in a free buffer (or reuse the pristine untitled one).*
- `vedit_insert_buf` (line 2183) `static char *vedit_insert_buf(long size)` - *Insert scratch arena: one reusable block serves every insert-file and shell-capture load, reset per call and grown only when the file outgrows it. Repeated Ctrl+R builds and M-! captures stop churning * one malloc/free pair per run; the block frees once at IDE exit. static char *vedit_insert_scratch; static size_t vedit_insert_cap; /** Docstring: borrow size bytes of insert scratch, growing it when short.*
- `vedit_insert_file` (line 2196) `static int vedit_insert_file(const char *fname)` - */** Docstring: borrow size bytes of insert scratch, growing it when short. static char *vedit_insert_buf(long size) { char *grown; if (size <= 0 || (unsigned long)size > VEDIT_FILE_MAX) return 0; if (vedit_insert_scratch && (unsigned long)size <= vedit_insert_cap) return vedit_insert_scratch; grown = realloc(vedit_insert_scratch, (size_t)size); if (!grown) return 0; vedit_insert_scratch = grown; vedit_insert_cap = (size_t)size; return grown; } /** Insert a file at dot, char by char through the fail-closed ops.*
- `vedit_has_ext` (line 2257) `static int vedit_has_ext(const char *fname, const char *ext)` - *vedit_split(); } else { vedit_insert_char((unsigned char)data[k]); } if (vedit_msg[0]) { vedit_set_msg("insert stopped: buffer full"); return -1; } } vedit_msg[0] = 0; return 0; } /** Report whether a file name ends with the given extension.*
- `vedit_base_of` (line 2269) `static int vedit_base_of(const char *fname, char *dst, size_t cap)` - */** Report whether a file name ends with the given extension. static int vedit_has_ext(const char *fname, const char *ext) { size_t n = strlen(fname); size_t e = strlen(ext); size_t k; if (e == 0 || e > n) return 0; for (k = 0; k < e; k++) { if (fname[n - e + k] != ext[k]) return 0; } return 1; } /** Copy the base name without directories or extension into dst.*
- `vedit_join` (line 2290) `static int vedit_join(const char *dir, const char *base, const char *ext,
                      c...` - *if (fname[k] == '/') s = k + 1; } for (k = s; k < n; k++) { if (fname[k] == '.') e = k; } if (e <= s) e = n; len = e - s; if (len == 0 || len + 1 > cap || len >= VEDIT_BASE_MAX) return -1; for (k = 0; k < len; k++) dst[k] = fname[s + k]; dst[len] = 0; return 0; } /** Join dir + base + ext into dst with bounds checking.*
- `vedit_link_fmt` (line 2307) `static int vedit_link_fmt(const char *s)` - *size_t b = strlen(base); size_t e = strlen(ext); size_t k = 0; size_t i; if (d + b + e + 1 > cap) return -1; if (d + b + e + 1 > VEDIT_PATH_MAX) return -1; for (i = 0; i < d; i++) dst[k++] = dir[i]; for (i = 0; i < b; i++) dst[k++] = base[i]; for (i = 0; i < e; i++) dst[k++] = ext[i]; dst[k] = 0; return 0; } /** Accept only the two linker formats, rejecting anything else.*
- `vedit_print_log` (line 2320) `static void vedit_print_log(const char *path)` - */** Accept only the two linker formats, rejecting anything else. static int vedit_link_fmt(const char *s) { size_t k = 0; const char *e = VEDIT_LINK_ELF; const char *c = VEDIT_LINK_CVM; while (e[k] && s[k] == e[k]) k++; if (e[k] == 0 && s[k] == 0) return 1; k = 0; while (c[k] && s[k] == c[k]) k++; if (c[k] == 0 && s[k] == 0) return 2; return 0; } /** Print a captured toolchain log to the console in bounded chunks.*
- `vedit_spawn_visible` (line 2337) `static long vedit_spawn_visible(const char *tool, const char *redir, int argc,
                  ...` - *size_t n; if (!f) { printf("vedit: no output captured (%s missing)\n", path); return; } while ((n = fread(buf, 1, sizeof(buf), f)) > 0) { size_t k; for (k = 0; k < n; k++) putchar(buf[k]); } fclose(f); fflush(stdout); } /** Drop the display, run one child, echo its log, then resume the IDE.*
- `vedit_sign_elf` (line 2366) `static void vedit_sign_elf(const char *out)` - *if (rc < 0) { snprintf(nb, sizeof(nb), "%s failed (%ld)", label, rc); vedit_set_msg(nb); } else if (rc != 0) { snprintf(nb, sizeof(nb), "%s exit %ld", label, rc); vedit_set_msg(nb); } else { snprintf(nb, sizeof(nb), "%s ok", label); vedit_set_msg(nb); } return rc; } /** Sign a freshly linked ELF so the kernel signature gate runs it.*
- `vedit_cmd_exec` (line 2377) `static void vedit_cmd_exec(const char *out, int kind)` - *} /** Sign a freshly linked ELF so the kernel signature gate runs it. static void vedit_sign_elf(const char *out) { const char *args[3]; char label[VEDIT_MSG_MAX]; snprintf(label, sizeof(label), "sign %s", out); args[0] = VEDIT_TOOL_SIGN; args[1] = out; args[2] = 0; vedit_spawn_visible(VEDIT_TOOL_SIGN, 0, 2, args, label); } /** Run a freshly linked artifact so its output lands on the console.*
- `vedit_run_kind` (line 2390) `static int vedit_run_kind(const char *fname)` - */** Run a freshly linked artifact so its output lands on the console. static void vedit_cmd_exec(const char *out, int kind) { const char *args[2]; char label[VEDIT_MSG_MAX]; snprintf(label, sizeof(label), "run %s", out); args[0] = out; args[1] = 0; if (kind == 1) vedit_spawn_visible(out, 0, 1, args, label); else vedit_spawn_visible(VEDIT_TOOL_CVM, 0, 1, args, label); } /** Decide the ^R tool for a file: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp.*
- `vedit_cmd_run` (line 2400) `static void vedit_cmd_run(void)` - *vedit_spawn_visible(VEDIT_TOOL_CVM, 0, 1, args, label); } /** Decide the ^R tool for a file: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp. static int vedit_run_kind(const char *fname) { if (vedit_has_ext(fname, ".c") || vedit_has_ext(fname, ".h")) return 1; if (vedit_has_ext(fname, ".lua")) return 2; if (vedit_has_ext(fname, ".py")) return 3; if (vedit_has_ext(fname, ".s")) return 4; if (vedit_has_ext(fname, ".lisp")) return 5; return 0; } /** Save, then compile or run the current buffer by extension.*
- `vedit_cmd_link` (line 2478) `static void vedit_cmd_link(const char *fmt)` - *vedit_set_msg("usage: save as .c, .s, .lua, .py or .lisp first"); return; } args[0] = tool; args[1] = vedit_fname; args[2] = 0; for (k = 0; k < sizeof(label) - 1 && vedit_fname[k]; k++) label[k] = vedit_fname[k]; label[k] = 0; redir = VEDIT_BUILD_LOG; vedit_spawn_visible(tool, redir, 2, args, label); } /** Save, then link asm/<base>.s into bin/<base>.elf or cvm/<base>.cvm.*
- `vedit_selftest_build` (line 2532) `static int vedit_selftest_build(void)` - *Headless build contract check: no display, no syscalls, exit status only. Mirror contract with tests/test_vedit_build.c: any vector added here * must gain a host CHECK there too, so spec drift fails the build.*
- `vedit_selftest_leak` (line 2725) `static int vedit_selftest_leak(void)` - *Headless leak contract: the insert scratch arena and one buffer lifecycle must net zero live blocks. Exercises exactly the reuse * path every Ctrl+R / Ctrl+L build walks, with no display syscalls.*
- `vedit_pane_save` (line 2785) `static void vedit_pane_save(int p)`
- `vedit_first_open` (line 2793) `static int vedit_first_open(void)`
- `vedit_pane_load` (line 2801) `static void vedit_pane_load(int p)`
- `vedit_count_open` (line 2813) `static int vedit_count_open(void)`
- `vedit_split_set` (line 2822) `static void vedit_split_set(int on)`
- `vedit_next_pane` (line 2841) `static void vedit_next_pane(void)`
- `vedit_cmd_lookup` (line 2873) `static int vedit_cmd_lookup(const char *name)`
- `vedit_parse_key` (line 2889) `static int vedit_parse_key(const char *s)` - *Parse a key description into a decoded key code: ^A..^Z ^@ ^[ ^\ ^] ^^ ^_, M-<c>, or Up Down Left Right Home End PgUp PgDn Del Esc. * Pure: host suite pins every vector.*
- `vedit_cmd_bind` (line 2941) `static int vedit_cmd_bind(int key, int cmd)`
- `vedit_cmd_bound` (line 2957) `static int vedit_cmd_bound(int key)`
- `vedit_list_buffers` (line 2965) `static void vedit_list_buffers(void)`
- `vedit_hist_show` (line 2984) `static void vedit_hist_show(void)`
- `vedit_help_text` (line 2992) `static void vedit_help_text(void)`
- `vedit_cmd_exec_id` (line 3008) `static void vedit_cmd_exec_id(int id, const char *arg, int *quit,
                              i...` - *printf("arrows/Home/End/PgUp/PgDn move, ^U arg, ^A/^E bol/eol\n"); printf("M-f/M-b word, M-c/M-l/M-u case word, ^@/M-SP mark, M-w copy\n"); printf("M-k kill region, ^K kill line, ^Y yank, ^T transpose\n"); printf("^] goto fence, M-s/M-r isearch, M-n hunt, M-%% query\n"); printf("M-q fill, M-1/M-2/M-o windows, M-x command, M-! shell\n"); printf("M-# filter, M-( M-) M-e macro, ^W find, ^G goto\n"); printf("M-v paste, M-W region to clipboard, drag selects to clipboard\n"); printf("^O/^S save, ^N name, ^R run, ^L link, ^D dump, ^X done\n"); printf("M-x help names every command; vedit.rc runs at startup\n"); fflush(stdout); vedit_set_msg("see console for key list"); } /** Execute a named command id; arg carries an rc-file argument or 0.*
- `strcmp` (line 3196) `strcmp(name, "describe-bindings") == 0)`
- `vedit_run_rc` (line 3214) `static void vedit_run_rc(const char *path)` - *Run the startup script: `bind <key> <cmd>` plus bare commands with * an optional trailing argument. Unknown lines are reported, never fatal.*
- `vedit_sel_clear` (line 3292) `static void vedit_sel_clear(void)`
- `vedit_sel_norm` (line 3297) `static void vedit_sel_norm(void)`
- `vedit_sel_copy` (line 3310) `static int vedit_sel_copy(void)` - *static void vedit_sel_norm(void) { if (vedit_sy0 > vedit_sy1 || (vedit_sy0 == vedit_sy1 && vedit_sx0 > vedit_sx1)) { int t = vedit_sy0; vedit_sy0 = vedit_sy1; vedit_sy1 = t; t = vedit_sx0; vedit_sx0 = vedit_sx1; vedit_sx1 = t; } } /** Copy the mouse selection into the kernel clipboard; 0 ok.*
- `vedit_clip_paste` (line 3353) `static int vedit_clip_paste(void)` - *} if (vedit_clip_set(vedit_clipbuf, pos) != 0) { vedit_set_msg("clipboard refused"); return -1; } { char nb[64]; snprintf(nb, sizeof(nb), "copied %d byte(s)", pos); vedit_set_msg(nb); } return 0; } /** Paste the kernel clipboard at dot; fail closed, never truncated.*
- `vedit_region_to_clip` (line 3383) `static int vedit_region_to_clip(void)` - *vedit_split(); else vedit_insert_char((unsigned char)vedit_clipbuf[k]); if (vedit_msg[0]) { vedit_set_msg("paste stopped: buffer full"); return -1; } } vedit_sel_clear(); vedit_msg[0] = 0; return 0; } /** Copy the emacs region (not the mouse) into the clipboard.*
- `vedit_sh_split` (line 3428) `static int vedit_sh_split(const char *line, char *buf, const char **argv)` - *} if (pos <= 0) { vedit_set_msg("nothing selected"); return -1; } if (vedit_clip_set(vedit_clipbuf, pos) != 0) { vedit_set_msg("clipboard refused"); return -1; } vedit_set_msg("copied to clipboard"); return 0; } /** Split a shell line into argv; returns argc or -1 on overflow.*
- `vedit_shell_command` (line 3448) `static void vedit_shell_command(const char *line)` - *if (!*line) break; if (argc >= VEDIT_SH_ARGS) return -1; argv[argc++] = buf + k; while (*line && *line != ' ' && *line != '\t') { if (k >= VEDIT_SH_LINE - 1) return -1; buf[k++] = *line++; } buf[k++] = 0; } argv[argc] = 0; return argc; } /** Run a shell line, capturing stdout into the *shell* buffer.*
- `vedit_write_region` (line 3477) `static int vedit_write_region(const char *path, int *y0o, int *x0o, int *y1o,
                   ...` - *idx = vedit_open_in_buffer("*shell*", 0); if (idx < 0) return; vedit_count = 0; vedit_cx = 0; vedit_cy = 0; vedit_top = 0; vedit_insert_file(VEDIT_TMP_OUT); vedit_cx = 0; vedit_cy = 0; vedit_top = 0; vedit_set_msg("see *shell* buffer"); } /** Write the region (or whole buffer) to path; 0 ok.*
- `vedit_filter_buffer` (line 3521) `static void vedit_filter_buffer(const char *prog)` - *if (y < y1) putc('\n', f); } if (fclose(f) != 0) { vedit_set_msg("cannot write temp file"); return -1; } if (y0o) *y0o = y0; if (x0o) *x0o = x0; if (y1o) *y1o = y1; if (x1o) *x1o = x1; return 0; } /** Pipe the region (or buffer) through an external program.*
- `vedit_grep` (line 3581) `static void vedit_grep(const char *pat)` - *vedit_cx = x1; vedit_mark_y = y0; vedit_mark_x = x0; vedit_mark_on = 1; if (vedit_kill_region() != 0) return; if (vedit_insert_file(VEDIT_TMP_F) != 0) { vedit_set_msg("filter output did not fit"); return; } vedit_mark_on = 0; vedit_set_msg("filtered"); } /** Magic grep of the current buffer into the *grep* buffer.*
- `vedit_next_error` (line 3644) `static void vedit_next_error(void)` - *} vedit_switch_buffer(idx); vedit_grep_src = src; vedit_cx = 0; vedit_cy = 0; vedit_top = 0; { char nb[64]; snprintf(nb, sizeof(nb), "%d match(es)", hits); vedit_set_msg(nb); } } /** Jump to the match under dot in *grep* ("N: text" -> src buffer line N).*
- `vedit_read_key_poll` (line 3692) `static int vedit_read_key_poll(void)`
- `vedit_ansi_for` (line 3746) `static void vedit_ansi_for(int col)` - *vedit_esc_state = 3; vedit_esc_t0 = now; return -1; } return VEDIT_KEY_ESC; } vedit_esc_state = 0; if (c != '~') return VEDIT_KEY_ESC; if (vedit_esc_p1 == '3') return VEDIT_KEY_DEL; if (vedit_esc_p1 == '5') return VEDIT_KEY_PGUP; return VEDIT_KEY_PGDN; } /** Serial ANSI mirror: the UI itself is pixels.*
- `vedit_console_dump` (line 3754) `static void vedit_console_dump(void)`
- `vedit_prompt_open` (line 3784) `static void vedit_prompt_open(const char *label, int mode)` - *vedit_ansi_for(vedit_cell[c]); cur = vedit_cell[c]; } putchar(l[c]); } if (cur != VEDIT_COL_DEFAULT) printf("\033[0m"); putchar('\n'); } fflush(stdout); } /* ---- Nuklear UI ---- /** Prompt openers (state lives at the top with the other IDE state).*
- `vedit_prompt_find` (line 3795) `static void vedit_prompt_find(void)`
- `vedit_prompt_isearch` (line 3799) `static void vedit_prompt_isearch(int dir)`
- `vedit_qrep_next` (line 3809) `static void vedit_qrep_next(int r, int c)` - *static void vedit_prompt_find(void) { vedit_prompt_open("find: ", VEDIT_PROMPT_FIND); } static void vedit_prompt_isearch(int dir) { vedit_isearch_oy = vedit_cy; vedit_isearch_ox = vedit_cx; vedit_isearch_dir = dir; vedit_prompt_open(dir > 0 ? "I-search: " : "reverse-I-search: ", dir > 0 ? VEDIT_PROMPT_ISEARCH_F : VEDIT_PROMPT_ISEARCH_R); } /** Step the pending query-replace from (r,c); prompts or finishes.*
- `vedit_qrep_answer` (line 3821) `static void vedit_qrep_answer(int key)`
- `vedit_prompt_saveas` (line 3860) `static void vedit_prompt_saveas(void)`
- `vedit_draw_row` (line 3870) `static void vedit_draw_row(struct nk_command_buffer *canvas,
                           struct nk...`
- `vedit_draw_ui` (line 3968) `static void vedit_draw_ui(struct nk_context *ctx, struct nk_user_font *font,
                    ...` - *if (a < 0) a = 0; if (b > len) b = len; for (c = a; c < b; c++) { int vc = c - vedit_hoff; if (vc < 0 || vc >= textw) continue; nk_draw_text(canvas, nk_rect((float)(x + vc * vedit_cw), (float)y, (float)vedit_cw, (float)vedit_ch), l + c, 1, font, vedit_c_cursor(), vedit_c_bg()); } } } /** Draw the IDE window: menu buttons, code rows, status and help.*
- `vedit_prompt_key` (line 4248) `static void vedit_prompt_key(int key)` - *vedit_cw), (float)(vedit_status_y + 2), (float)vedit_cw, (float)vedit_ch), 0, vedit_c_cursor()); } nk_draw_text(canvas, nk_rect((float)vedit_cw, (float)vedit_help_y, (float)(NK_W - 2 * vedit_cw), (float)vedit_ch), help, (int)strlen(help), font, vedit_c_bg(), vedit_c_gutter()); nk_end(ctx); } /** Route one decoded key while a prompt is open.*
- `vedit_key` (line 4422) `static void vedit_key(int key, int *quit, int *save_and_quit)` - *vedit_isearch_step(); } return; } if (key >= 32 && key < 127 && vedit_prompt_pos < VEDIT_LINE_MAX - 1) { vedit_prompt_buf[vedit_prompt_pos++] = (char)key; vedit_prompt_buf[vedit_prompt_pos] = 0; if (vedit_prompt_mode == VEDIT_PROMPT_ISEARCH_F || vedit_prompt_mode == VEDIT_PROMPT_ISEARCH_R) vedit_isearch_step(); } } /** Route one decoded key when no prompt is open.*
- `vedit_sync_title` (line 4662) `static void vedit_sync_title(void)`
- `vedit_gui_run` (line 4672) `static void vedit_gui_run(void)`
- `vedit_selftest` (line 4763) `static int vedit_selftest(void)`
- `main` (line 4839) `int main(int argc, char **argv)`
- `definitions` (line 268) `* definitions (C99, one file, no headers). */ static void vedit_str_case(char *s, int mode);`

**Macros:**
- `MINIOS_LEAKCHECK_IMPL` (line 33) `#define MINIOS_LEAKCHECK_IMPL`
- `MINIOS_LK_ENABLE` (line 34) `#define MINIOS_LK_ENABLE`
- `VEDIT_MAX_LINES` (line 114) `#define VEDIT_MAX_LINES`
- `VEDIT_LINE_MAX` (line 115) `#define VEDIT_LINE_MAX`
- `VEDIT_LINE_USED` (line 116) `#define VEDIT_LINE_USED`
- `VEDIT_FILE_MAX` (line 117) `#define VEDIT_FILE_MAX`
- `VEDIT_FNAME_MAX` (line 118) `#define VEDIT_FNAME_MAX`
- `VEDIT_DEFAULT_FILE` (line 119) `#define VEDIT_DEFAULT_FILE`
- `VEDIT_MSG_MAX` (line 120) `#define VEDIT_MSG_MAX`
- `VEDIT_WORD_MAX` (line 121) `#define VEDIT_WORD_MAX`
- `VEDIT_TAB_W` (line 122) `#define VEDIT_TAB_W`
- `VEDIT_ESC_MS` (line 123) `#define VEDIT_ESC_MS`
- `VEDIT_FRAME_MS` (line 124) `#define VEDIT_FRAME_MS`
- `VEDIT_UI_MEMORY` (line 125) `#define VEDIT_UI_MEMORY`
- `VEDIT_KEY_RUN` (line 126) `#define VEDIT_KEY_RUN`
- `VEDIT_KEY_LINK` (line 127) `#define VEDIT_KEY_LINK`
- `VEDIT_KEY_DUMP` (line 128) `#define VEDIT_KEY_DUMP`
- `VEDIT_TOOL_MINIGCC` (line 129) `#define VEDIT_TOOL_MINIGCC`
- `VEDIT_TOOL_LD` (line 130) `#define VEDIT_TOOL_LD`
- `VEDIT_TOOL_SIGN` (line 131) `#define VEDIT_TOOL_SIGN`
- `VEDIT_TOOL_CVM` (line 132) `#define VEDIT_TOOL_CVM`
- `VEDIT_TOOL_LUA` (line 133) `#define VEDIT_TOOL_LUA`
- `VEDIT_TOOL_PY` (line 134) `#define VEDIT_TOOL_PY`
- `VEDIT_TOOL_LISP` (line 135) `#define VEDIT_TOOL_LISP`
- `VEDIT_DIR_ASM` (line 136) `#define VEDIT_DIR_ASM`
- `VEDIT_DIR_BIN` (line 137) `#define VEDIT_DIR_BIN`
- `VEDIT_DIR_CVM` (line 138) `#define VEDIT_DIR_CVM`
- `VEDIT_BUILD_LOG` (line 139) `#define VEDIT_BUILD_LOG`
- `VEDIT_LINK_ELF` (line 140) `#define VEDIT_LINK_ELF`
- `VEDIT_LINK_CVM` (line 141) `#define VEDIT_LINK_CVM`
- `VEDIT_STATUS_MAX` (line 142) `#define VEDIT_STATUS_MAX`
- `VEDIT_BASE_MAX` (line 143) `#define VEDIT_BASE_MAX`
- `VEDIT_PATH_MAX` (line 144) `#define VEDIT_PATH_MAX`
- `VEDIT_LOG_TAIL` (line 145) `#define VEDIT_LOG_TAIL`
- `VEDIT_LANG_TEXT` (line 148) `#define VEDIT_LANG_TEXT`
- `VEDIT_LANG_C` (line 149) `#define VEDIT_LANG_C`
- `VEDIT_LANG_PY` (line 150) `#define VEDIT_LANG_PY`
- `VEDIT_LANG_LUA` (line 151) `#define VEDIT_LANG_LUA`
- `VEDIT_LANG_ASM` (line 152) `#define VEDIT_LANG_ASM`
- `VEDIT_LANG_LISP` (line 153) `#define VEDIT_LANG_LISP`
- `VEDIT_COL_DEFAULT` (line 156) `#define VEDIT_COL_DEFAULT`
- `VEDIT_COL_KEYWORD` (line 157) `#define VEDIT_COL_KEYWORD`
- `VEDIT_COL_STRING` (line 158) `#define VEDIT_COL_STRING`
- `VEDIT_COL_COMMENT` (line 159) `#define VEDIT_COL_COMMENT`
- `VEDIT_COL_NUMBER` (line 160) `#define VEDIT_COL_NUMBER`
- `VEDIT_COL_PREPROC` (line 161) `#define VEDIT_COL_PREPROC`
- `VEDIT_ST_BLOCK` (line 164) `#define VEDIT_ST_BLOCK`
- `VEDIT_ST_PY3S` (line 165) `#define VEDIT_ST_PY3S`
- `VEDIT_ST_PY3D` (line 166) `#define VEDIT_ST_PY3D`
- `VEDIT_ST_LUABLK` (line 167) `#define VEDIT_ST_LUABLK`
- `VEDIT_ST_LUASTR` (line 168) `#define VEDIT_ST_LUASTR`
- `VEDIT_KEY_UP` (line 171) `#define VEDIT_KEY_UP`
- `VEDIT_KEY_DOWN` (line 172) `#define VEDIT_KEY_DOWN`
- `VEDIT_KEY_LEFT` (line 173) `#define VEDIT_KEY_LEFT`
- `VEDIT_KEY_RIGHT` (line 174) `#define VEDIT_KEY_RIGHT`
- `VEDIT_KEY_HOME` (line 175) `#define VEDIT_KEY_HOME`
- `VEDIT_KEY_END` (line 176) `#define VEDIT_KEY_END`
- `VEDIT_KEY_PGUP` (line 177) `#define VEDIT_KEY_PGUP`
- `VEDIT_KEY_PGDN` (line 178) `#define VEDIT_KEY_PGDN`
- `VEDIT_KEY_DEL` (line 179) `#define VEDIT_KEY_DEL`
- `VEDIT_KEY_ESC` (line 180) `#define VEDIT_KEY_ESC`
- `VEDIT_NBUF` (line 251) `#define VEDIT_NBUF`
- `VEDIT_KILL_N` (line 252) `#define VEDIT_KILL_N`
- `VEDIT_KILL_MAX` (line 253) `#define VEDIT_KILL_MAX`
- `VEDIT_MACRO_MAX` (line 254) `#define VEDIT_MACRO_MAX`
- `VEDIT_HIST_N` (line 255) `#define VEDIT_HIST_N`
- `VEDIT_CMD_MAX` (line 256) `#define VEDIT_CMD_MAX`
- `VEDIT_MAGIC_MAX` (line 257) `#define VEDIT_MAGIC_MAX`
- `VEDIT_KEY_META` (line 258) `#define VEDIT_KEY_META(c)`
- `VEDIT_KEY_ARG` (line 259) `#define VEDIT_KEY_ARG`
- `VEDIT_KEY_MARK` (line 260) `#define VEDIT_KEY_MARK`
- `VEDIT_KEY_KILL_LINE` (line 261) `#define VEDIT_KEY_KILL_LINE`
- `VEDIT_KEY_YANK` (line 262) `#define VEDIT_KEY_YANK`
- `VEDIT_KEY_TRANSPOSE` (line 263) `#define VEDIT_KEY_TRANSPOSE`
- `VEDIT_KEY_FENCE` (line 264) `#define VEDIT_KEY_FENCE`
- `VEDIT_KEY_BOL` (line 265) `#define VEDIT_KEY_BOL`
- `VEDIT_KEY_EOL` (line 266) `#define VEDIT_KEY_EOL`
- `vedit_pool` (line 293) `#define vedit_pool`
- `vedit_used` (line 294) `#define vedit_used`
- `vedit_count` (line 295) `#define vedit_count`
- `vedit_cx` (line 296) `#define vedit_cx`
- `vedit_cy` (line 297) `#define vedit_cy`
- `vedit_top` (line 298) `#define vedit_top`
- `vedit_hoff` (line 299) `#define vedit_hoff`
- `vedit_dirty` (line 300) `#define vedit_dirty`
- `vedit_trunc` (line 301) `#define vedit_trunc`
- `vedit_lang` (line 302) `#define vedit_lang`
- `vedit_fname` (line 303) `#define vedit_fname`
- `vedit_msg` (line 304) `#define vedit_msg`
- `VEDIT_PROMPT_FIND` (line 313) `#define VEDIT_PROMPT_FIND`
- `VEDIT_PROMPT_GOTO` (line 314) `#define VEDIT_PROMPT_GOTO`
- `VEDIT_PROMPT_NAME` (line 315) `#define VEDIT_PROMPT_NAME`
- `VEDIT_PROMPT_LINK` (line 316) `#define VEDIT_PROMPT_LINK`
- `VEDIT_PROMPT_CMD` (line 317) `#define VEDIT_PROMPT_CMD`
- `VEDIT_PROMPT_ISEARCH_F` (line 318) `#define VEDIT_PROMPT_ISEARCH_F`
- `VEDIT_PROMPT_ISEARCH_R` (line 319) `#define VEDIT_PROMPT_ISEARCH_R`
- `VEDIT_PROMPT_REP_OLD` (line 320) `#define VEDIT_PROMPT_REP_OLD`
- `VEDIT_PROMPT_REP_NEW` (line 321) `#define VEDIT_PROMPT_REP_NEW`
- `VEDIT_PROMPT_QREP` (line 322) `#define VEDIT_PROMPT_QREP`
- `VEDIT_PROMPT_SHELLCMD` (line 323) `#define VEDIT_PROMPT_SHELLCMD`
- `VEDIT_PROMPT_FILTER` (line 324) `#define VEDIT_PROMPT_FILTER`
- `VEDIT_PROMPT_SELECT` (line 325) `#define VEDIT_PROMPT_SELECT`
- `VEDIT_PROMPT_GREP` (line 326) `#define VEDIT_PROMPT_GREP`
- `VEDIT_PROMPT_BINDKEY` (line 327) `#define VEDIT_PROMPT_BINDKEY`
- `VEDIT_PROMPT_BINDCMD` (line 328) `#define VEDIT_PROMPT_BINDCMD`
- `VEDIT_FILL_COL` (line 1612) `#define VEDIT_FILL_COL`
- `VEDIT_TMP_OUT` (line 3273) `#define VEDIT_TMP_OUT`
- `VEDIT_TMP_IN` (line 3274) `#define VEDIT_TMP_IN`
- `VEDIT_TMP_F` (line 3275) `#define VEDIT_TMP_F`
- `VEDIT_SH_ARGS` (line 3276) `#define VEDIT_SH_ARGS`
- `VEDIT_SH_LINE` (line 3277) `#define VEDIT_SH_LINE`
- `VEDIT_CLIP_MAX` (line 3278) `#define VEDIT_CLIP_MAX`

#### `wlcomp.c`
**Path:** `progs/wl/wlcomp.c`
**File Doc:** *wlcomp - Wayland-mini ring-3 compositor (ADR-0024, ADR-0026).*

**Functions:**
- `wlcomp_sys_title` (line 57) `static long wlcomp_sys_title(const char *t)`
- `wlcomp_sys_present` (line 65) `static long wlcomp_sys_present(long buf)`
- `wlcomp_sys_present_origin` (line 73) `static long wlcomp_sys_present_origin(long buf, int *origin)`
- `wlcomp_sys_palette` (line 81) `static long wlcomp_sys_palette(unsigned char *pal)`
- `wlcomp_sys_mouse` (line 89) `static long wlcomp_sys_mouse(int *m)`
- `wlcomp_sys_kbd` (line 97) `static long wlcomp_sys_kbd(void)`
- `wlcomp_sys_kbd_raw` (line 105) `static long wlcomp_sys_kbd_raw(long on)`
- `wlcomp_sys_vga_mode` (line 113) `static long wlcomp_sys_vga_mode(long on)`
- `wlcomp_sys_yield` (line 121) `static long wlcomp_sys_yield(void)`
- `wlcomp_sys_dir_list` (line 129) `static long wlcomp_sys_dir_list(const char *path, char *buf, long cap)`
- `wlcomp_palette` (line 139) `static int wlcomp_palette(void)` - *Upload the shared hybrid palette so indexed pixels expand through * desktop-exact colors on every VBE mode instead of the gray ramp.*
- `wlcomp_pattern` (line 150) `static void wlcomp_pattern(unsigned char *dst, int w, int h,
        unsigned char a, unsigned ch...` - *Paint a deterministic test pattern so the demo proves real pixels * travelled the blit path instead of solid fills.*
- `wlcomp_demo` (line 189) `static int wlcomp_demo(wl_comp_t *c)`
- `wlcomp_demo_blit` (line 214) `static int wlcomp_demo_blit(wl_comp_t *c, unsigned char *fb)` - *if (wl_comp_add(c, s1, 320, 200) != WL_ERR_OK) return 1; if (wl_comp_set_color(c, s0, 4) != WL_ERR_OK) return 1; if (wl_comp_set_color(c, s1, 6) != WL_ERR_OK) return 1; if (wl_comp_layout_tile(c, WLCOMP_W, WLCOMP_H) != 2) return 1; if (wl_comp_focus(c, s0) != WL_ERR_OK) return 1; return 0; } /** Composite the tiled demo with real client pixels into the frame.*
- `wlcomp_emit` (line 260) `static int wlcomp_emit(unsigned char *s, int cap, int o, unsigned int id,
        unsigned int op...` - *wlcomp_pattern(p1, w1, h1, cfg.check_a, cfg.check_b, 1); px[c->order[0]] = p0; pw[c->order[0]] = w0; ph[c->order[0]] = h0; px[c->order[1]] = p1; pw[c->order[1]] = w1; ph[c->order[1]] = h1; rc = wlcomp_blit(c, fb, WLCOMP_W, WLCOMP_H, px, pw, ph); free(p0); free(p1); return rc != WL_ERR_OK; } /** Append one header-only request to a session buffer.*
- `wlcomp_session` (line 272) `static int wlcomp_session(wl_comp_t *c, wl_client_t *cl)` - *Drive a full client session through stream plus dispatch. The byte * feed splits mid-header so reassembly is proven, not assumed.*
- `wlcomp_selftest` (line 345) `static int wlcomp_selftest(void)`
- `wlserv_init` (line 418) `static void wlserv_init(wlserv_t *s)`
- `wlserv_slot` (line 437) `static int wlserv_slot(const wl_comp_t *c, unsigned int id)` - *wpix_init(&wlserv_raw); for (i = 0; i < WL_MAX_SURFACES; i++) { s->pw[i] = 0; s->ph[i] = 0; s->rw[i] = 0; s->rh[i] = 0; s->raw_dirty[i] = 1; } s->origin[0] = 0; s->origin[1] = 0; s->last_count = 0; } /** Items index owning a surface id, or -1 for a stranger.*
- `wlserv_recolor` (line 450) `static void wlserv_recolor(wl_comp_t *c)` - *Paint every mapped slot a distinct desktop-exact ink so clients * without pixels still read as separate windows.*
- `wlserv_present` (line 467) `static int wlserv_present(wlserv_t *s)` - *Composite the cached pixels and present with palette uploaded, capturing the content origin for pointer translation. Chrome (title bar plus close box plus active focus) paints here so every * frame carries real window decorations.*
- `wlserv_load_raw` (line 502) `static int wlserv_load_raw(wlserv_t *s, int b, int idx)` - *Reload the raw copy of one slot from its box .raw file. Returns 0 on success; any short file, size lie or allocation failure returns -1 * and leaves the caller to drop the slot.*
- `wlserv_fit` (line 547) `static void wlserv_fit(wlserv_t *s)` - *Fit every mapped surface to its laid-out size: reload the box raw copy only when the client published since the last fit, then resample into the live cell only when the pixels or the cell changed. Heap slots size on geometry change only, so steady frames allocate nothing and a move or resize never touches the disk; any short file or size lie drops that cache, never a neighbour, so one * hostile client cannot blank the desktop.*
- `wlserv_gc_strays` (line 609) `static void wlserv_gc_strays(void)` - *Unlink stray .msg files no client owns: names that fail the exact mailbox parse can never dispatch, so they are dead weight from a * crashed client. The mirror flag carries no suffix and is kept.*
- `wlserv_focus_box` (line 664) `static int wlserv_focus_box(const wlserv_t *s)` - *Server-to-client input delivery (ADR-0026 live step). The server owns PS/2 while it owns the display, so it forwards raw scancodes plus mapped pointer state to the focused box through its .ev file. Queues are static (never malloc): a full queue drops the oldest * byte, a slow client loses middle batches by seq design. static unsigned char wlserv_ev_pend[WL_MAX_SURFACES][WL_EV_SC_MAX]; static unsigned wlserv_ev_npend[WL_MAX_SURFACES]; static unsigned wlserv_ev_seq[WL_MAX_SURFACES]; static unsigned wlserv_ev_wheel = 0; /** Focused box slot, or -1 when no mapped window holds input.*
- `wlserv_key` (line 686) `static void wlserv_key(wlserv_t *s, unsigned char byte)` - *Queue one raw byte for the focused client. Bytes nobody owns are * dropped, never buffered: input without a window is noise.*
- `wlserv_ev_clear` (line 706) `static void wlserv_ev_clear(wlserv_t *s, int b)` - *b = wlserv_focus_box(s); if (b < 0) return; n = wlserv_ev_npend[b]; if (n >= WL_EV_SC_MAX) { for (i = 0; i + 1 < WL_EV_SC_MAX; i++) wlserv_ev_pend[b][i] = wlserv_ev_pend[b][i + 1]; n = WL_EV_SC_MAX - 1; } wlserv_ev_pend[b][n] = byte; wlserv_ev_npend[b] = n + 1; } /** Drop a slot queue without serving it.*
- `wlserv_push_ev` (line 717) `static void wlserv_push_ev(wlserv_t *s, int fx, int fy, int buttons)` - *Push the current input state to the focused box. Frame coords map into the client's raw buffer through wl_ev_map; outside is (-1,-1) so the client never warps a click. The queue clears after write, * which is what keeps batches from replaying.*
- `wlserv_clean_ev` (line 765) `static void wlserv_clean_ev(void)` - *Unlink every stale .ev file so no dead input replays after a restart. Runs once at server start; live files are rewritten by * their owners from then on.*
- `wlserv_close` (line 798) `static int wlserv_close(wlserv_t *s, unsigned int id)` - *Close one surface by id: remove it, free its box slot for the next client, drop its cache and unlink its raw pixels. Returns 1 when something closed. A live client re-attaches on its next frame, so closing a live window also wants the client's job killed from the * shell; the box name carries the client pid for exactly that.*
- `wlserv_box_known` (line 830) `static int wlserv_box_known(const wlserv_t *s, const char *box)` - *if (s->boxes[b].used) { if (wl_mbox_raw_name(path, sizeof path, s->boxes[b].box) > 0) unlink(path); if (wl_mbox_ev_name(path, sizeof path, s->boxes[b].box) > 0) unlink(path); s->boxes[b].used = 0; s->boxes[b].box[0] = '\0'; s->boxes[b].seq_last = 0; } wlserv_recolor(&s->comp); return 1; } /** 1 when a box name already owns a server slot.*
- `forever` (line 844) `* one of the WL_MAX_SURFACES slots forever (eight bad names used to lock
 * every real client out...`
- `wlserv_drain` (line 933) `static int wlserv_drain(wlserv_t *s)` - *Drain at most WL_MBOX_POLL_MAX mailbox files: validate every frame before dispatch, unlink what was consumed, and leave torn writes for the next poll. A box whose first message is torn or rejected never keeps the slot it was provisionally given. Every routed message marks the slot's raw pixels dirty (clients republish the .raw file before each attach/commit), so the next fit reloads them. * Returns 1 when pixels changed.*
- `wlclient_find` (line 1005) `static const wlclient_pat_t *wlclient_find(const char *name)`
- `wlcomp_client` (line 1034) `static int wlcomp_client(const char *box, const char *pat)` - *Attach one client surface from a second process through the shared wl_client.h transport: pixels first so the server never attaches a surface whose raw file is missing, then the six-message session, each sequenced. One-shot malloc is fine here; the server * hot loop is the path that must never allocate.*
- `wlcomp_path` (line 1103) `static int wlcomp_path(char *dst, int cap, const char *name)` - *Join WL_MBOX_DIR + '/' + name into dst. Returns 1 on success, 0 when the name is not NUL-terminated in bounds or the path would not fit: one helper for every directory scan in this file, so the * join logic cannot drift between call sites.*
- `wlserv_relayout_present` (line 1123) `static int wlserv_relayout_present(wlserv_t *s)` - *Tile, refit pixels and present. Returns 0 when the desktop shows the new layout, nonzero otherwise. Every mutate-then-show site *  funnels here so a missed present can never leave a stale frame.*
- `wlcomp_clean` (line 1137) `static int wlcomp_clean(void)` - *static int wlserv_relayout_present(wlserv_t *s) { if (!s) return 1; if (wl_comp_layout_tile(&s->comp, WLCOMP_W, WLCOMP_H) <= 0) return 1; s->last_count = s->comp.count; wlserv_recolor(&s->comp); wlserv_fit(s); if (wlserv_present(s) != 0) return 1; return 0; } /** Unlink every mailbox file so a new session starts clean.*
- `wlcomp_once` (line 1165) `static int wlcomp_once(void)` - *Drain once and exit so scripts prove multiprocess composition * through the gfx frames counter without an interactive loop.*
- `wlcomp_server` (line 1197) `static int wlcomp_server(void)` - *Interactive desktop: click focuses, title drag moves, rim drag resizes, close box closes, pure pointer motion re-presents so the kernel cursor painter follows every move, Alt+T re-tiles, Alt+M minimizes, Alt+U restores, Alt+Tab cycles focus, Alt+Q quits with the desktop redrawn behind it. ESC quits too when no window is mapped (an empty desktop owns the keyboard but has nobody to receive keys, so ESC must never trap the user there); with windows mapped ESC reaches the focused client through its .ev file. Plain keys always reach the focused client; only Alt-held combos act on the server, so typing never tiles. A /shm/wl/quit flag file quits cleanly too (the `desktop stop` path, which cannot send keystrokes to a * background job).*
- `main` (line 1467) `int main(int argc, char **argv)`

**Macros:**
- `WLCOMP_W` (line 39) `#define WLCOMP_W`
- `WLCOMP_H` (line 40) `#define WLCOMP_H`
- `WLCOMP_CFG_DEFAULT` (line 53) `#define WLCOMP_CFG_DEFAULT`

**Structs:**
- `wlcomp_cfg_t` (line 43) - *#include <string.h> #include <unistd.h> #include "minios_abi.h" #include "nk_palette.h" #include "wl_mini.h" #include "wl/wl_mbox.h" #include "wl/wl_client.h" #include "wl/wl_pixbuf.h" #define WLCOMP_W 800 #define WLCOMP_H 360 /** Centralized compositor configuration, no magic numbers at call sites.*
- `wlserv_t` (line 406)
- `wlclient_pat_t` (line 995) - *wlserv_drop(s, idx); s->rw[idx] = w; s->rh[idx] = h; } s->raw_dirty[idx] = 1; } changed = 1; } if (changed) wlserv_recolor(&s->comp); return changed; } /** Client pattern table, one row per attachable demo client.*

#### `qga.c`
**Path:** `qga.c`
**File Doc:** *MiniOS QEMU guest agent (QGA).*

**Functions:**
- `qga_tx_ready` (line 27) `static int qga_tx_ready(void)`
- `qga_rx_ready` (line 28) `static int qga_rx_ready(void)`
- `qga_putc` (line 30) `static void qga_putc(char c)`
- `qga_init` (line 35) `void qga_init(void)`
- `qga_ws` (line 56) `static int qga_ws(char c)`
- `qga_parse_object` (line 65) `static int qga_parse_object(const char **pp, struct qga_pair *out, int max,
                     ...` - *Parse a JSON object whose members are stored flat into out[*count..]: a nested object's members keep the parent key as a prefix (`arguments.id`). Only string/int/null/bool values are accepted; arrays and deeper nesting are rejected fail-closed. Returns 1 on success, 0 on malformed or * overflowing input.*
- `qga_parse_flat` (line 147) `static int qga_parse_flat(const char *s, struct qga_pair *out, int max)` - *Parse a request line into the flat pair table. Returns the number of pairs, * or -1 on malformed/overflowing input.*
- `qga_get_str` (line 158) `static const char *qga_get_str(const struct qga_pair *pairs, int n, const char *key)`
- `qga_get_int` (line 166) `static int qga_get_int(const struct qga_pair *pairs, int n, const char *key, long *out)`
- `qga_resp_reset` (line 184) `static void qga_resp_reset(void)`
- `qga_resp_puts` (line 186) `static void qga_resp_puts(const char *s)`
- `qga_resp_putc_enc` (line 194) `static void qga_resp_putc_enc(char c)`
- `qga_resp_put_long` (line 201) `static void qga_resp_put_long(long v)` - *Append the decimal form of v (a separate helper so no varargs forwarding is * needed; the kernel formatter is not re-entrant with a stored va_list).*
- `qga_err` (line 210) `static void qga_err(const char *klass, const char *desc)`
- `qga_puts_resp` (line 218) `static void qga_puts_resp(void)`
- `qga_b64_encode` (line 231) `static void qga_b64_encode(const unsigned char *in, int n)`
- `qga_cmd_get_time` (line 281) `static void qga_cmd_get_time(void)`
- `qga_cmd_exec` (line 306) `static void qga_cmd_exec(const struct qga_pair *pairs, int n)` - *guest-exec runs a shell command line; output goes to the console (the `>` redirect still captures it). Queued so the shell executes it at its next * loop top, which raw_blocking_getc forces by returning a newline.*
- `qga_cmd_shutdown` (line 316) `static void qga_cmd_shutdown(const struct qga_pair *pairs, int n)`
- `qga_file_size` (line 329) `static int qga_file_size(const KFILE *f)`
- `qga_cmd_file_open` (line 334) `static void qga_cmd_file_open(const struct qga_pair *pairs, int n)`
- `qga_cmd_file_read` (line 360) `static void qga_cmd_file_read(const struct qga_pair *pairs, int n)`
- `qga_cmd_file_close` (line 384) `static void qga_cmd_file_close(const struct qga_pair *pairs, int n)`
- `qga_dispatch` (line 401) `static void qga_dispatch(struct qga_pair *pairs, int n)`
- `qga_poll` (line 446) `void qga_poll(void)` - *Accumulate bytes until a complete line, then parse and answer it. Callers * call it once per idle spin of the shell's raw input loop.*
- `channel` (line 10) `* * Polled channel (no interrupt controller): qga_init sets up COM2 and * qga_poll, called from raw_blocking_getc, services one complete line per * call. Every input path is bounded and fail-closed: a`

**Structs:**
- `qga_pair` (line 49)

#### `smp.c`
**Path:** `smp.c`
**File Doc:** *SMP application-processor bring-up.*

**Functions:**
- `lapic_read` (line 88) `static unsigned lapic_read(unsigned off)`
- `lapic_write` (line 91) `static void lapic_write(unsigned off, unsigned val)`
- `smp_nmi_broadcast` (line 113) `void smp_nmi_broadcast(void)` - *Broadcast an NMI to every other CPU (TLB shootdown, kernel/mm/tlb.c). Any CPU may call it: interrupts stay off across the two ICR writes so a tick on this CPU cannot interleave its own broadcast between them, and a * previous send still in flight is waited out first.*
- `map_lapic` (line 128) `static int map_lapic(void)` - *Map the LAPIC so the BSP can program the ICR, and the APs can read their id registers.  Extends stage 2's tables: PDPT slot 3 gains a new PD whose * entry covers the LAPIC's 2 MB window as uncached.  Returns 1 on success.*
- `ap_delay` (line 141) `static void ap_delay(void)`
- `lapic_calibrate` (line 170) `static void lapic_calibrate(void)`
- `ap_lapic_timer_start` (line 204) `static void ap_lapic_timer_start(void)` - *ifdef MINIOS_AP_TIMER*
- `ap_lapic_timer_init` (line 210) `static void ap_lapic_timer_init(void)` - *endif*
- `smp_init` (line 341) `void smp_init(void)`
- `syscall_entry` (line 86) `extern void syscall_entry(void);` - *Per-AP kernel stack for the idle loop entry (the 2 KB stub stack is * too shallow for the loop's C frames plus nested IPI ISRs). static char ap_idle_kstack[MAX_CPUS][8192] __attribute__((aligned(16))); /* The syscall trampoline lives in kernel.c (declared global there).*
- `BSP` (line 258) `* were programmed only on the BSP (syscall_init runs in kmain), so * an AP's first sysretq loaded SS from a zeroed STAR (selector 0x08, * kernel code, as SS) and died with #SS. The values mirror * sys`
- `routine` (line 286) `* routine (FreeDom's fetch threads, under -smp 2). */ cpu_enable_caches();`
- `INIT` (line 359) `* INIT (edge-triggered): resets APs to wait-for-SIPI state. * QEMU 11 drops level-triggered INIT (delivery status never clears), * so edge-triggered is used. Two SIPIs deliver the startup vector. */ l`

**Macros:**
- `LAPIC_BASE` (line 29) `#define LAPIC_BASE`
- `LAPIC_ID_OFF` (line 30) `#define LAPIC_ID_OFF`
- `LAPIC_SVR_OFF` (line 31) `#define LAPIC_SVR_OFF`
- `LAPIC_ICR_HI` (line 32) `#define LAPIC_ICR_HI`
- `LAPIC_ICR_LO` (line 33) `#define LAPIC_ICR_LO`
- `LAPIC_LVT_TIMER` (line 34) `#define LAPIC_LVT_TIMER`
- `LAPIC_LVT_LINT0` (line 35) `#define LAPIC_LVT_LINT0`
- `LAPIC_LVT_LINT1` (line 36) `#define LAPIC_LVT_LINT1`
- `LAPIC_LVT_MASKED` (line 37) `#define LAPIC_LVT_MASKED`
- `LAPIC_LVT_EXTINT` (line 38) `#define LAPIC_LVT_EXTINT`
- `LAPIC_EOI_OFF` (line 39) `#define LAPIC_EOI_OFF`
- `LAPIC_TIMER_DIV` (line 40) `#define LAPIC_TIMER_DIV`
- `LAPIC_TIMER_INIT` (line 41) `#define LAPIC_TIMER_INIT`
- `LAPIC_TIMER_CUR` (line 42) `#define LAPIC_TIMER_CUR`
- `LAPIC_SVR_ENABLE` (line 44) `#define LAPIC_SVR_ENABLE`
- `LAPIC_ICR_BUSY` (line 45) `#define LAPIC_ICR_BUSY`
- `LAPIC_ICR_INIT` (line 46) `#define LAPIC_ICR_INIT`
- `LAPIC_ICR_SIPI` (line 47) `#define LAPIC_ICR_SIPI`
- `LAPIC_ICR_ALL_EXC` (line 48) `#define LAPIC_ICR_ALL_EXC`
- `LAPIC_ICR_LEVEL` (line 49) `#define LAPIC_ICR_LEVEL`
- `LAPIC_ICR_TRIGGER` (line 50) `#define LAPIC_ICR_TRIGGER`
- `LAPIC_ICR_NMI` (line 51) `#define LAPIC_ICR_NMI`
- `LAPIC_ICR_IDLE_SPINS` (line 53) `#define LAPIC_ICR_IDLE_SPINS`
- `SIPI_VECTOR` (line 55) `#define SIPI_VECTOR`
- `PIT_HZ` (line 58) `#define PIT_HZ`
- `LAPIC_TIMER_DIVIDE_16` (line 61) `#define LAPIC_TIMER_DIVIDE_16`
- `LAPIC_TIMER_PERIODIC` (line 62) `#define LAPIC_TIMER_PERIODIC`
- `LAPIC_PD_ADDR` (line 70) `#define LAPIC_PD_ADDR`
- `LAPIC_PDPT_SLOT` (line 71) `#define LAPIC_PDPT_SLOT`
- `LAPIC_PD_IDX` (line 72) `#define LAPIC_PD_IDX`

#### `test_abi.c`
**Path:** `tests/test_abi.c`
**File Doc:** *Docstring: tests/test_abi.c -- Host test for the ABI manifest gate.*

**Functions:**
- `expect` (line 16) `static void expect(const char *name, const char *manifest, int want)`
- `main` (line 25) `int main(void)`

#### `test_arena.c`
**Path:** `tests/test_arena.c`
**File Doc:** *Docstring: host test for the bump arena (make test-arena).*

**Functions:**
- `main` (line 23) `int main(void)`

**Macros:**
- `CHECK` (line 14) `#define CHECK(cond, msg)`

#### `test_batch.c`
**Path:** `tests/test_batch.c`
**File Doc:** *Docstring: Host test for kernel/batch.c (make test-batch).*

**Functions:**
- `stub_dispatch` (line 24) `static long stub_dispatch(uint32_t opcode)`
- `main` (line 31) `int main(void)`

**Macros:**
- `CHECK` (line 17) `#define CHECK(cond, msg)`

#### `test_driver.c`
**Path:** `tests/test_driver.c`
**File Doc:** *test_driver.c -- Host test for the Strategy-pattern device registry.*

**Functions:**
- `test_read` (line 15) `static int test_read(device_t *d, unsigned lba, unsigned count, void *buf)`
- `test_pcm_open` (line 28) `static void test_pcm_open(device_t *d)`
- `test_pcm_submit` (line 33) `static int test_pcm_submit(device_t *d, const unsigned char *pcm, unsigned len)`
- `test_tone` (line 39) `static void test_tone(device_t *d, unsigned freq)`
- `main` (line 65) `int main(void)`

#### `test_ext4.c`
**Path:** `tests/test_ext4.c`
**File Doc:** *Docstring: Host test for the ext4 loopback driver (make test-ext4).*

**Functions:**
- `kmalloc` (line 24) `void *kmalloc(unsigned long size)`
- `kfree` (line 28) `void kfree(void *ptr)`
- `kstrlen` (line 32) `unsigned long kstrlen(const char *s)`
- `kstrncmp` (line 36) `int kstrncmp(const char *a, const char *b, unsigned long n)`
- `kstrncpy` (line 40) `char *kstrncpy(char *dst, const char *src, unsigned long n)`
- `kmemcpy` (line 47) `void *kmemcpy(void *dst, const void *src, unsigned long n)`
- `kstrchr` (line 51) `char *kstrchr(const char *s, int c)`
- `fs_resolve` (line 55) `int fs_resolve(const char *path, char *out, unsigned cap)`
- `ramdisk_open` (line 68) `RDFile *ramdisk_open(const char *name)`
- `ramdisk_read` (line 73) `int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)`
- `minifs_is_mounted` (line 81) `int minifs_is_mounted(void)`
- `minifs_resolve_path` (line 85) `int minifs_resolve_path(const char *path)`
- `minifs_stat` (line 90) `int minifs_stat(int ino, MiniFSInode *out)`
- `minifs_read` (line 96) `int minifs_read(int ino, void *buf, unsigned off, unsigned len)`
- `ide_present` (line 104) `int ide_present(void)`
- `ide_total_sectors` (line 108) `unsigned int ide_total_sectors(void)`
- `ide_read_sectors` (line 112) `int ide_read_sectors(unsigned int lba, unsigned int count, void *buf)`
- `block_disk_sectors` (line 119) `unsigned long block_disk_sectors(void)`
- `block_read_sectors` (line 123) `int block_read_sectors(unsigned lba, unsigned count, void *buf)`
- `e16` (line 143) `static void e16(unsigned char *p, unsigned v)`
- `e32` (line 148) `static void e32(unsigned char *p, unsigned long v)`
- `ext_fix_de` (line 156) `static unsigned ext_fix_de(unsigned char *d, unsigned off, const char *nm,
                      ...` - *static void e16(unsigned char *p, unsigned v) { p[0] = (unsigned char)(v & 255); p[1] = (unsigned char)((v >> 8) & 255); } static void e32(unsigned char *p, unsigned long v) { p[0] = (unsigned char)(v & 255); p[1] = (unsigned char)((v >> 8) & 255); p[2] = (unsigned char)((v >> 16) & 255); p[3] = (unsigned char)((v >> 24) & 255); } /* Append one directory entry at off; returns the next offset.*
- `ext_fix_inode` (line 168) `static void ext_fix_inode(unsigned ino, unsigned mode, unsigned long size,
                      ...`
- `ext_fix_x1` (line 180) `static void ext_fix_x1(unsigned char *iblk, unsigned l0, unsigned p0,
                       unsi...` - *} static void ext_fix_inode(unsigned ino, unsigned mode, unsigned long size, unsigned flags, const unsigned char *iblk) { unsigned char *ib = ext_fix_img + 5 * 1024 + (ino - 1) * 128; e16(ib + 0, mode); e32(ib + 4, (unsigned)(size & 0xFFFFFFFFUL)); e16(ib + 26, 1); e32(ib + 32, flags); memcpy(ib + 40, iblk, 60); e32(ib + 108, (unsigned)(size >> 32)); } /* One single-extent leaf: logical l0 runs len blocks from phys p0.*
- `ext_fix_build` (line 192) `static void ext_fix_build(void)`
- `test_image` (line 305) `static void test_image(void)`
- `test_bad_magic` (line 412) `static void test_bad_magic(void)`
- `main` (line 421) `int main(void)`

**Macros:**
- `EXT_FIX_BLOCKS` (line 62) `#define EXT_FIX_BLOCKS`
- `EXT_FIX_SIZE` (line 63) `#define EXT_FIX_SIZE`
- `CHECK` (line 135) `#define CHECK(cond)`

#### `test_fat32.c`
**Path:** `tests/test_fat32.c`
**File Doc:** *Docstring: Host test for the FAT32 loopback driver (make test-fat).*

**Functions:**
- `kmalloc` (line 24) `void *kmalloc(unsigned long size)`
- `kfree` (line 28) `void kfree(void *ptr)`
- `kstrlen` (line 32) `unsigned long kstrlen(const char *s)`
- `kstrncmp` (line 36) `int kstrncmp(const char *a, const char *b, unsigned long n)`
- `kstrncpy` (line 40) `char *kstrncpy(char *dst, const char *src, unsigned long n)`
- `kmemcpy` (line 47) `void *kmemcpy(void *dst, const void *src, unsigned long n)`
- `fs_resolve` (line 51) `int fs_resolve(const char *path, char *out, unsigned cap)`
- `ramdisk_open` (line 66) `RDFile *ramdisk_open(const char *name)`
- `ramdisk_read` (line 71) `int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len)`
- `minifs_is_mounted` (line 79) `int minifs_is_mounted(void)`
- `minifs_resolve_path` (line 83) `int minifs_resolve_path(const char *path)`
- `minifs_stat` (line 88) `int minifs_stat(int ino, MiniFSInode *out)`
- `minifs_read` (line 94) `int minifs_read(int ino, void *buf, unsigned off, unsigned len)`
- `ide_present` (line 102) `int ide_present(void)`
- `ide_total_sectors` (line 106) `unsigned int ide_total_sectors(void)`
- `ide_read_sectors` (line 110) `int ide_read_sectors(unsigned int lba, unsigned int count, void *buf)`
- `kstrcmp` (line 117) `int kstrcmp(const char *a, const char *b)`
- `block_disk_sectors` (line 121) `unsigned long block_disk_sectors(void)`
- `block_read_sectors` (line 125) `int block_read_sectors(unsigned lba, unsigned count, void *buf)`
- `st16` (line 145) `static void st16(unsigned char *p, unsigned v)`
- `st32` (line 150) `static void st32(unsigned char *p, unsigned long v)`
- `fat_fix_build` (line 157) `static void fat_fix_build(void)`
- `test_units` (line 236) `static void test_units(void)`
- `test_image` (line 258) `static void test_image(void)`
- `test_bad_magic` (line 320) `static void test_bad_magic(void)`
- `main` (line 329) `int main(void)`

**Macros:**
- `FAT_FIX_SECTORS` (line 58) `#define FAT_FIX_SECTORS`
- `FAT_FIX_SIZE` (line 59) `#define FAT_FIX_SIZE`
- `CHECK` (line 137) `#define CHECK(cond)`

#### `test_fault.c`
**Path:** `tests/test_fault.c`
**File Doc:** *test_fault.c -- fault-injection suite (boyscout gap #10).*

**Functions:**
- `range_ok` (line 35) `static int range_ok(unsigned long p, unsigned long len)`
- `str_ok` (line 41) `static int str_ok(const unsigned char *mem, unsigned long p,
                  unsigned long maxlen)` - *cannot report is itself a failure. #define CHECK(c, m) do { if (!(c)) { failures++; if (fprintf(stderr, "FAIL: %s:%d: %s\n", __FILE__, __LINE__, m) < 0) failures++; } } while (0) /* ---- Mirror of kernel/syscalls.c user window ---- #define U_BASE ((unsigned long)0x00400000ul) #define U_END  ((unsigned long)0x0C000000ul) static unsigned char umem[64]; static int range_ok(unsigned long p, unsigned long len) { if (p < U_BASE) return 0; if (len > U_END - p) return 0; return p + len <= U_END; } /* Mirror of user_str_ok: NUL must land inside [p, p+maxlen).*
- `normalize` (line 52) `static void normalize(const char *path, char *out, unsigned cap)` - *Minimal mirror of fs/vfs.c fs_resolve (cwd-relative, cap 64): * collapses ".", pops "..", skips empty components.*
- `path_trusted` (line 83) `static int path_trusted(const char *full)` - *define TRUSTED_DIR "objects/" define TRUSTED_LEN 8*
- `main` (line 94) `int main(void)`
- `against` (line 10) `* after bounding against (END-BASE)/elemsz, so the product cannot * wrap past the range check);`

**Macros:**
- `CHECK` (line 28) `#define CHECK(c, m)`
- `U_BASE` (line 31) `#define U_BASE`
- `U_END` (line 32) `#define U_END`
- `TRUSTED_DIR` (line 81) `#define TRUSTED_DIR`
- `TRUSTED_LEN` (line 82) `#define TRUSTED_LEN`

#### `test_file_assoc.c`
**Path:** `tests/test_file_assoc.c`
**File Doc:** *Docstring: host test for the file browser assoc contract (make test-file).*

**Functions:**
- `t_ext_of` (line 26) `static void t_ext_of(const char *fname, char *dst, unsigned cap)`
- `t_assoc_line` (line 46) `static int t_assoc_line(const char *line, char *ext, char *prog)`
- `t_icon_kind` (line 80) `static int t_icon_kind(const char *fname, int isdir)` - *Mirror of file_icon_kind in progs/file/file.c (0 folder, 1 files, * 2 image, 3 object).*
- `t_icon_sz` (line 95) `static int t_icon_sz(void)`
- `main` (line 99) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`
- `T_EXT_MAX` (line 23) `#define T_EXT_MAX`
- `T_PROG_MAX` (line 24) `#define T_PROG_MAX`
- `T_ICON_SMALL` (line 92) `#define T_ICON_SMALL`
- `T_ICON_BIG` (line 93) `#define T_ICON_BIG`

#### `test_freedom_wl.c`
**Path:** `tests/test_freedom_wl.c`
**File Doc:** *test_freedom_wl - host suite for the Wayland to MiniOS mapping.*

**Functions:**
- `check_host` (line 12) `static int check_host(int cond, const char *name)` - *test_freedom_wl - host suite for the Wayland to MiniOS mapping.  Exercises the pure logic of progs/src/freedom_wl without syscalls. Fail-closed on every bound. Exit nonzero on first failure.  #include <stdio.h> #define FREEDOM_WL_HOST_TEST 1 #include "../progs/src/freedom_wl.c" /** Report helper for single check lines.*
- `main` (line 22) `int main(void)` - *#define FREEDOM_WL_HOST_TEST 1 #include "../progs/src/freedom_wl.c" /** Report helper for single check lines. static int check_host(int cond, const char *name) { if (!cond) { printf("FAIL: %s\n", name); return 1; } printf("PASS: %s\n", name); return 0; } /** Entry point running all mapping checks.*

**Macros:**
- `FREEDOM_WL_HOST_TEST` (line 8) `#define FREEDOM_WL_HOST_TEST`

#### `test_freedomui.c`
**Path:** `tests/test_freedomui.c`
**File Doc:** *test_freedomui - host suite for the real FreeDom MiniOS backend.*

**Functions:**
- `main` (line 24) `int main(void)` - *#define FREEDOMUI_HOST_TEST 1 #include "../progs/freedomui/freedomui_minios.c" /** Report helper for single check lines. static int check_ui(int cond, const char *name) { if (!cond) { printf("FAIL: %s\n", name); return 1; } printf("PASS: %s\n", name); return 0; } /** Entry point running all backend checks.*

**Macros:**
- `FREEDOMUI_HOST_TEST` (line 10) `#define FREEDOMUI_HOST_TEST`

#### `test_futex.c`
**Path:** `tests/test_futex.c`
**File Doc:** *Docstring: Host test for kernel/futex.c (make test-futex).*

**Functions:**
- `proc_get` (line 18) `proc_t *proc_get(int pid)`
- `schedule` (line 26) `void schedule(void)`
- `fresh_proc` (line 39) `static void fresh_proc(int pid)`
- `fresh_all` (line 48) `static void fresh_all(void)`
- `main` (line 60) `int main(void)`
- `masked` (line 153) `* with PRIVATE and CLOCK_REALTIME masked (393 = 9|128|256). */ CHECK(futex_linux_cmd(9) == LINUX_FUTEX_WAIT_BITSET, "WAIT_BITSET decodes");`

**Macros:**
- `CHECK` (line 32) `#define CHECK(cond, msg)`

#### `test_fx.c`
**Path:** `tests/test_fx.c`
**File Doc:** *Docstring: Host test for headers/vga_fx.h (make test-fx).*

**Functions:**
- `main` (line 23) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`

#### `test_hal_io.c`
**Path:** `tests/test_hal_io.c`
**File Doc:** *Docstring: Host test for arch/x86/hal_io.h (make test-hal).*

**Functions:**
- `main` (line 30) `int main(void)`

**Macros:**
- `HAL_IO_HOST_TEST` (line 11) `#define HAL_IO_HOST_TEST`
- `CHECK` (line 23) `#define CHECK(cond, msg)`

#### `test_httpd.c`
**Path:** `tests/test_httpd.c`
**File Doc:** *Docstring: Host test for headers/httpd.h (make test-httpd).*

**Functions:**
- `main` (line 25) `int main(void)`

**Macros:**
- `CHECK` (line 18) `#define CHECK(cond, msg)`

#### `test_ktime.c`
**Path:** `tests/test_ktime.c`
**File Doc:** *test_ktime.c -- host test for the pure conversion math in ktime.h*

**Functions:**
- `main` (line 16) `int main(void)`

**Macros:**
- `CHECK` (line 14) `#define CHECK(c, m)`

#### `test_ldso.c`
**Path:** `tests/test_ldso.c`
**File Doc:** *Docstring: host test for the ld.so pure parser (make test-ldso).*

**Functions:**
- `w16` (line 27) `static void w16(unsigned char *p, unsigned v)`
- `w32` (line 32) `static void w32(unsigned char *p, unsigned long v)`
- `w64` (line 39) `static void w64(unsigned char *p, unsigned long long v)`
- `build_tables` (line 92) `static void build_tables(unsigned char *img, int rela_type)`
- `main` (line 127) `int main(void)`

**Macros:**
- `CHECK` (line 20) `#define CHECK(cond, msg)`
- `IMG_SZ` (line 53) `#define IMG_SZ`
- `DYN_OFF` (line 54) `#define DYN_OFF`
- `STR_OFF` (line 55) `#define STR_OFF`
- `SYM_OFF` (line 56) `#define SYM_OFF`
- `HASH_OFF` (line 57) `#define HASH_OFF`
- `RELA_OFF` (line 58) `#define RELA_OFF`

#### `test_leakcheck.c`
**Path:** `tests/test_leakcheck.c`
**File Doc:** *Docstring: host test for the leak tracker (make test-leakcheck).*

**Functions:**
- `main` (line 27) `int main(void)`

**Macros:**
- `MINIOS_LEAKCHECK_IMPL` (line 10) `#define MINIOS_LEAKCHECK_IMPL`
- `MINIOS_LK_ENABLE` (line 11) `#define MINIOS_LK_ENABLE`
- `CHECK` (line 20) `#define CHECK(cond, msg)`

#### `test_minios_png.c`
**Path:** `tests/test_minios_png.c`
**File Doc:** *Docstring: host test for the shared ring-3 PNG helpers (make test-png).*

**Functions:**
- `t_332` (line 24) `static void t_332(void)` - *#include <stdlib.h> #include "progs/minios_png.h" static int failures = 0; #define CHECK(cond, msg) do { \ if (!(cond)) { \ failures++; \ fprintf(stderr, "FAIL: %s (line %d)\n", (msg), __LINE__); \ } \ } while (0) /** Docstring: 3-3-2 quantize matches the manual bit packing.*
- `t_nearest` (line 33) `static void t_nearest(void)` - *fprintf(stderr, "FAIL: %s (line %d)\n", (msg), __LINE__); \ } \ } while (0) /** Docstring: 3-3-2 quantize matches the manual bit packing. static void t_332(void) { CHECK(mpng_332_idx(255, 0, 0) == 0xE0, "332 red"); CHECK(mpng_332_idx(0, 255, 0) == 0x1C, "332 green"); CHECK(mpng_332_idx(0, 0, 255) == 0x03, "332 blue"); CHECK(mpng_332_idx(0, 0, 0) == 0x00, "332 black"); CHECK(mpng_332_idx(255, 255, 255) == 0xFF, "332 white"); } /** Docstring: nearest search hits exact entries and rejects bad input.*
- `t_geom` (line 58) `static void t_geom(void)` - *pal[7] = 0; pal[8] = 255; CHECK(mpng_nearest(pal, 3, 255, 0, 0) == 0, "nearest red"); CHECK(mpng_nearest(pal, 3, 0, 255, 0) == 1, "nearest green"); CHECK(mpng_nearest(pal, 3, 0, 0, 255) == 2, "nearest blue"); CHECK(mpng_nearest(0, 3, 0, 0, 0) < 0, "nearest null pal"); CHECK(mpng_nearest(pal, 0, 0, 0, 0) < 0, "nearest empty pal"); CHECK(mpng_nearest(pal, 9999, 0, 0, 0) < 0, "nearest oversize pal"); for (k = 0; k < 768; k++) pal[k] = 0; CHECK(mpng_nearest(pal, 256, 10, 20, 30) == 0, "nearest first wins"); } /** Docstring: center and fit-scale geometry with fail-closed edges.*
- `t_scale` (line 70) `static void t_scale(void)` - */** Docstring: center and fit-scale geometry with fail-closed edges. static void t_geom(void) { CHECK(mpng_center(800, 320) == 240, "center 800/320"); CHECK(mpng_center(360, 360) == 0, "center exact"); CHECK(mpng_center(100, 200) < 0, "center unfit"); CHECK(mpng_center(-1, 10) < 0, "center negative"); CHECK(mpng_fit_scale(32, 32, 240, 344) == 7, "fit 32 in 240x344"); CHECK(mpng_fit_scale(512, 512, 240, 344) == 1, "fit large keeps 1"); CHECK(mpng_fit_scale(0, 32, 240, 344) < 0, "fit zero src"); CHECK(mpng_fit_scale(32, 32, 0, 10) < 0, "fit zero box"); } /** Docstring: scaled conversion preserves corners and rejects bounds.*
- `t_scale_big` (line 99) `static void t_scale_big(void)` - *CHECK(dst[0] == 242, "scale corner keeps red"); CHECK(mpng_rgb_to_332_scaled(rgb, 2, 2, dst332, 4, 4) == 0, "scale332 ok"); CHECK(dst332[0] == (unsigned char)mpng_332_idx(255, 0, 0), "scale332 corner"); CHECK(mpng_rgb_to_idx_scaled(0, 2, 2, pal, 256, dst, 4, 4) < 0, "scale null rgb"); CHECK(mpng_rgb_to_idx_scaled(rgb, 9999, 2, pal, 256, dst, 4, 4) < 0, "scale oversize src"); CHECK(mpng_rgb_to_idx_scaled(rgb, 2, 2, pal, 256, dst, 9999, 4) < 0, "scale oversize dst"); } /** Docstring: large-source twin accepts wallpaper geometry, same bounds.*
- `t_blit` (line 139) `static void t_blit(void)` - *free(big); } else { CHECK(0, "big wallpaper alloc"); } } CHECK(mpng_rgb_to_idx_scaled_big(0, 2, 2, pal, 256, dst, 4, 4) < 0, "big null rgb"); CHECK(mpng_rgb_to_idx_scaled_big(rgb, 99999, 2, pal, 256, dst, 4, 4) < 0, "big oversize src"); CHECK(mpng_rgb_to_idx_scaled_big(rgb, 2, 2, pal, 256, dst, 9999, 4) < 0, "big oversize dst"); } /** Docstring: clipped blit lands inside and ignores outside.*
- `t_load` (line 157) `static void t_load(void)` - *tile[0] = 1; tile[1] = 2; tile[2] = 3; tile[3] = 4; CHECK(mpng_blit_idx(fb, 4, 4, tile, 2, 2, 1, 1) == 0, "blit ok"); CHECK(fb[1 * 4 + 1] == 1 && fb[1 * 4 + 2] == 2, "blit row0"); CHECK(fb[2 * 4 + 1] == 3 && fb[2 * 4 + 2] == 4, "blit row1"); CHECK(fb[0] == 7, "blit outside untouched"); CHECK(mpng_blit_idx(0, 4, 4, tile, 2, 2, 0, 0) < 0, "blit null fb"); CHECK(mpng_blit_idx(fb, 4, 4, tile, 9999, 2, 0, 0) < 0, "blit oversize tile"); } /** Docstring: bounded load fails closed on bad paths and caps.*
- `t_policy` (line 176) `static void t_policy(void)` - *CHECK(mpng_load_file("", &out, &n, MPNG_FILE_MAX) < 0, "load empty"); CHECK(mpng_load_file(0, &out, &n, MPNG_FILE_MAX) < 0, "load null"); CHECK(mpng_load_file("/no/such/file.png", 0, &n, MPNG_FILE_MAX) < 0, "load null out"); CHECK(mpng_load_file("tests/test_minios_png.c", &out, &n, 4) < 0, "load tiny cap"); CHECK(mpng_load_file("tests/test_minios_png.c", &out, &n, MPNG_FILE_MAX) == 0, "load self"); CHECK(out != 0 && n > 0, "load content"); if (out) free(out); } /** Docstring: side-art policy pins right pokemon and no cgoblin left.*
- `main` (line 191) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`

#### `test_modifiers.c`
**Path:** `tests/test_modifiers.c`
**File Doc:** *Docstring: Designated initializers, so adding a member cannot silently*

**Functions:**
- `main` (line 24) `int main(void)`

**Macros:**
- `CHECK` (line 17) `#define CHECK(cond, msg)`

#### `test_notify.c`
**Path:** `tests/test_notify.c`

**Functions:**
- `probe_handler` (line 16) `static void probe_handler(const wm_notify_event_t *e)`
- `main` (line 22) `int main(void)`

**Macros:**
- `CHECK` (line 9) `#define CHECK(cond, msg)`

#### `test_paint.c`
**Path:** `tests/test_paint.c`
**File Doc:** *Docstring: host test for the paint canvas/PNG contract (make test-paint).*

**Functions:**
- `t_clamp` (line 30) `static int t_clamp(int v, int lo, int hi)`
- `t_plot` (line 36) `static int t_plot(unsigned char *buf, int w, int h, int x, int y,
                  unsigned char c)`
- `t_line` (line 44) `static int t_line(unsigned char *buf, int w, int h, int x0, int y0, int x1,
                  int...`
- `t_flood` (line 70) `static int t_flood(unsigned char *buf, int w, int h, int x, int y,
                   unsigned ch...`
- `t_crc_init` (line 116) `static void t_crc_init(void)`
- `t_crc` (line 129) `static unsigned long t_crc(const unsigned char *p, unsigned long n)`
- `t_path_ok` (line 138) `static int t_path_ok(const char *p)`
- `t_nearest` (line 155) `static int t_nearest(const unsigned char *pal, unsigned r, unsigned g,
                     unsig...`
- `test_plot` (line 171) `static void test_plot(void)`
- `test_line` (line 188) `static void test_line(void)`
- `test_flood` (line 207) `static void test_flood(void)`
- `test_png_codec` (line 228) `static void test_png_codec(void)`
- `test_png_layout` (line 259) `static void test_png_layout(void)`
- `test_path` (line 273) `static void test_path(void)`
- `test_nearest` (line 287) `static void test_nearest(void)`
- `main` (line 300) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`
- `T_W` (line 23) `#define T_W`
- `T_H` (line 24) `#define T_H`
- `T_N` (line 25) `#define T_N`
- `T_PATH_MAX` (line 26) `#define T_PATH_MAX`

#### `test_panic.c`
**Path:** `tests/test_panic.c`
**File Doc:** *Docstring: Host test for headers/panic.h (make test-panic).*

**Functions:**
- `always_valid` (line 23) `static int always_valid(unsigned long addr)`
- `never_valid` (line 28) `static int never_valid(unsigned long addr)`
- `deny_valid` (line 35) `static int deny_valid(unsigned long addr)`
- `main` (line 39) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`

#### `test_pcache.c`
**Path:** `tests/test_pcache.c`
**File Doc:** *Docstring: host test for the page cache store (make test-pcache).*

**Functions:**
- `kmalloc` (line 19) `void *kmalloc(unsigned long size)`
- `kfree` (line 23) `void kfree(void *ptr)`
- `kprintf` (line 27) `int kprintf(const char *fmt, ...)`
- `main` (line 43) `int main(void)`

**Macros:**
- `CHECK` (line 36) `#define CHECK(cond, msg)`

#### `test_pci.c`
**Path:** `tests/test_pci.c`
**File Doc:** *Docstring: Host test for headers/drivers/pci.h (make test-pci).*

**Functions:**
- `fake_outl` (line 39) `static void fake_outl(unsigned short port, unsigned val)`
- `fake_inl` (line 60) `static unsigned fake_inl(unsigned short port)`
- `set_dev` (line 73) `static void set_dev(unsigned bus, unsigned dev, unsigned func,
                    unsigned id, u...`
- `main` (line 79) `int main(void)`

**Macros:**
- `CHECK` (line 26) `#define CHECK(cond, msg)`
- `FAKE_BUSES` (line 33) `#define FAKE_BUSES`
- `FAKE_REGS` (line 34) `#define FAKE_REGS`

#### `test_pcm.c`
**Path:** `tests/test_pcm.c`
**File Doc:** *Host-side unit test for the PCM ring buffer (headers/pcm_ring.h).*

**Functions:**
- `t_roundtrip` (line 28) `static void t_roundtrip(void)`
- `t_wrap` (line 44) `static void t_wrap(void)`
- `t_overrun` (line 61) `static void t_overrun(void)`
- `t_underrun` (line 75) `static void t_underrun(void)`
- `t_zero_cap` (line 91) `static void t_zero_cap(void)`
- `lcg_next` (line 104) `static unsigned lcg_next(void)`
- `t_model` (line 109) `static void t_model(void)`
- `main` (line 144) `int main(void)`

**Macros:**
- `CHECK` (line 21) `#define CHECK(cond, msg)`

#### `test_percpu_rq.c`
**Path:** `tests/test_percpu_rq.c`
**File Doc:** *Docstring: Host test for kernel/percpu_rq.c (make test-percpu-rq).*

**Functions:**
- `main` (line 24) `int main(void)`

**Macros:**
- `CHECK` (line 17) `#define CHECK(cond, msg)`

#### `test_pipe.c`
**Path:** `tests/test_pipe.c`
**File Doc:** *Docstring: Host test for headers/pipe.h (make test-pipe).*

**Functions:**
- `main` (line 23) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`

#### `test_ps2_keymap.c`
**Path:** `tests/test_ps2_keymap.c`
**File Doc:** *test_ps2_keymap - host suite for the PS/2 set 1 to keysym translator.*

**Functions:**
- `check` (line 19) `static void check(int cond, const char *name)` - *keys, Ctrl/Alt chords without text, extended (E0) keys, the keypad under both Num Lock states, the fake shifts of Print Screen, the E1 Pause sequence, release events and fail-closed arguments. Exit nonzero on the first failure.  #include <stdio.h> #include <string.h> #include <xkbcommon/xkbcommon-keysyms.h> #include "../progs/freedomui/ps2_keymap.h" static int fails; /** Report helper for single check lines.*
- `feed_seq` (line 29) `static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out)` - *static int fails; /** Report helper for single check lines. static void check(int cond, const char *name) { if (!cond) { printf("FAIL: %s\n", name); fails++; return; } printf("PASS: %s\n", name); } /** Feeds a byte sequence and returns the kind of the last event.*
- `press` (line 36) `static int press(ps2_state *s, unsigned char code, ps2_key *out)` - *fails++; return; } printf("PASS: %s\n", name); } /** Feeds a byte sequence and returns the kind of the last event. static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out) { int kind = PS2_EV_NONE; for (int i = 0; i < n; i++) kind = ps2_feed(s, seq[i], out); return kind; } /** Presses one non-extended make code and returns the event kind.*
- `release` (line 41) `static int release(ps2_state *s, unsigned char code, ps2_key *out)` - */** Feeds a byte sequence and returns the kind of the last event. static int feed_seq(ps2_state *s, const unsigned char *seq, int n, ps2_key *out) { int kind = PS2_EV_NONE; for (int i = 0; i < n; i++) kind = ps2_feed(s, seq[i], out); return kind; } /** Presses one non-extended make code and returns the event kind. static int press(ps2_state *s, unsigned char code, ps2_key *out) { return ps2_feed(s, code, out); } /** Releases one non-extended code (break = make | 0x80).*
- `test_letters_and_shift` (line 45) `static void test_letters_and_shift(void)`
- `test_caps_lock` (line 69) `static void test_caps_lock(void)`
- `test_punctuation` (line 90) `static void test_punctuation(void)`
- `test_control_key_text` (line 111) `static void test_control_key_text(void)`
- `test_chords_have_no_text` (line 128) `static void test_chords_have_no_text(void)`
- `test_extended_keys` (line 150) `static void test_extended_keys(void)`
- `test_function_keys` (line 202) `static void test_function_keys(void)`
- `test_keypad_num_lock` (line 218) `static void test_keypad_num_lock(void)`
- `test_prefix_sequences` (line 263) `static void test_prefix_sequences(void)`
- `test_fail_closed` (line 280) `static void test_fail_closed(void)`
- `main` (line 293) `int main(void)` - *static void test_fail_closed(void) { ps2_state s; ps2_key k; ps2_init(&s); check(ps2_feed(NULL, 0x1E, &k) == PS2_EV_NONE, "null state"); check(ps2_feed(&s, 0x1E, NULL) == PS2_EV_NONE, "null out"); check(ps2_feed(&s, 0x00, &k) == PS2_EV_NONE, "code zero ignored"); check(ps2_feed(&s, 0x7F, &k) == PS2_EV_NONE, "unmapped code ignored"); check(ps2_feed(&s, 0xFA, &k) == PS2_EV_NONE, "controller ack ignored"); check(press(&s, 0x1E, &k) == PS2_EV_PRESS && k.sym == XKB_KEY_a, "stream usable after junk"); } /** Entry point running all translator checks.*

#### `test_randmix.c`
**Path:** `tests/test_randmix.c`
**File Doc:** *test_randmix.c -- host test for the getrandom mixer in randmix.h*

**Functions:**
- `popcount64` (line 18) `static int popcount64(unsigned long x)`
- `main` (line 24) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(c, m)`

#### `test_rcu.c`
**Path:** `tests/test_rcu.c`
**File Doc:** *Docstring: Host test for kernel/rcu.c (make test-rcu).*

**Functions:**
- `rcu_host_cpu` (line 19) `cpu_t *rcu_host_cpu(void)`
- `test_cb` (line 23) `static void test_cb(void *arg)`
- `main` (line 37) `int main(void)`

**Macros:**
- `CHECK` (line 30) `#define CHECK(cond, msg)`

#### `test_rtc.c`
**Path:** `tests/test_rtc.c`
**File Doc:** *test_rtc.c -- host test for the pure date math in drivers/rtc.c*

**Functions:**
- `main` (line 18) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(c, m)`

#### `test_sanitize.c`
**Path:** `tests/test_sanitize.c`
**File Doc:** *Docstring: Host test for sanitize.h (make test-sanitize).*

**Functions:**
- `user_range_ok` (line 20) `int user_range_ok(unsigned long p, unsigned long len)`
- `user_str_ok` (line 26) `int user_str_ok(unsigned long p, unsigned long maxlen)`
- `kmemcpy` (line 32) `void *kmemcpy(void *dst, const void *src, unsigned long n)`
- `range_probe` (line 48) `static long range_probe(unsigned long p, long len)`
- `str_probe` (line 54) `static long str_probe(unsigned long p)`
- `copy_probe` (line 61) `static long copy_probe(unsigned long uptr, long count, unsigned long elemsz)`
- `main` (line 67) `int main(void)`

**Macros:**
- `EFAULT` (line 13) `#define EFAULT`
- `CHECK` (line 41) `#define CHECK(cond, msg)`

#### `test_seccomp_bpf.c`
**Path:** `tests/test_seccomp_bpf.c`
**File Doc:** *Docstring: Host test for kernel/seccomp_bpf.c (make test-seccomp-bpf).*

**Functions:**
- `data_for` (line 34) `static sbpf_data data_for(int nr, unsigned long long a2)`
- `test_freedom_shape` (line 43) `static void test_freedom_shape(void)`
- `test_check_refusals` (line 88) `static void test_check_refusals(void)`
- `test_scratch_flow` (line 130) `static void test_scratch_flow(void)`
- `test_alu_and_jumps` (line 150) `static void test_alu_and_jumps(void)`
- `test_action_rank` (line 199) `static void test_action_rank(void)`
- `main` (line 210) `int main(void)`

**Macros:**
- `CHECK` (line 17) `#define CHECK(cond, msg)`
- `STMT` (line 21) `#define STMT(c, k)`
- `JUMP` (line 22) `#define JUMP(c, k, t, f)`
- `NR_READ` (line 24) `#define NR_READ`
- `NR_WRITE` (line 25) `#define NR_WRITE`
- `NR_OPEN` (line 26) `#define NR_OPEN`
- `NR_MMAP` (line 27) `#define NR_MMAP`
- `NR_MPROTECT` (line 28) `#define NR_MPROTECT`
- `PROT_EXEC` (line 29) `#define PROT_EXEC`
- `ARGS2_OFF` (line 30) `#define ARGS2_OFF`

#### `test_select_map.c`
**Path:** `tests/test_select_map.c`
**File Doc:** *Docstring: Host test for headers/select_map.h (make test-select-map).*

**Functions:**
- `test_bit_ops` (line 25) `static void test_bit_ops(void)`
- `test_count_and_build` (line 50) `static void test_count_and_build(void)`
- `test_union_events` (line 72) `static void test_union_events(void)`
- `test_result_classes` (line 90) `static void test_result_classes(void)`
- `test_result_only_requested` (line 123) `static void test_result_only_requested(void)`
- `test_result_hup_read_only` (line 142) `static void test_result_hup_read_only(void)`
- `test_badfd` (line 160) `static void test_badfd(void)`
- `main` (line 169) `int main(void)`

**Macros:**
- `CHECK` (line 18) `#define CHECK(cond, msg)`

#### `test_sign.c`
**Path:** `tests/test_sign.c`
**File Doc:** *Docstring: Host test for kernel/ed25519.c plus headers/sign.h.*

**Functions:**
- `hexval` (line 27) `static unsigned hexval(char c)`
- `unhex` (line 33) `static void unhex(unsigned char *out, const char *in, unsigned n)`
- `main` (line 51) `int main(void)`

**Macros:**
- `CHECK` (line 20) `#define CHECK(cond, msg)`

#### `test_sync.c`
**Path:** `tests/test_sync.c`
**File Doc:** *Host-side unit test for the blocking sync primitives (kernel/sync.c).*

**Functions:**
- `proc_get` (line 24) `proc_t *proc_get(int pid)`
- `schedule` (line 30) `void schedule(void)`
- `fresh_proc` (line 44) `static void fresh_proc(int pid)`
- `fresh_all` (line 52) `static void fresh_all(void)`
- `main` (line 63) `int main(void)`

**Macros:**
- `CHECK` (line 37) `#define CHECK(cond, msg)`

#### `test_theme.c`
**Path:** `tests/test_theme.c`
**File Doc:** *Docstring: host test for the shared Nuklear theme contract.*

**Functions:**
- `t_name_ok` (line 34) `static int t_name_ok(const char *name)`
- `t_parse_line` (line 46) `static int t_parse_line(const char *line, int *idx, long v[3])`
- `cube_exact` (line 74) `static int cube_exact(long v)`
- `check_theme_file` (line 78) `static void check_theme_file(const char *path)`
- `main` (line 107) `int main(void)`

**Macros:**
- `CHECK` (line 16) `#define CHECK(cond, msg)`
- `X` (line 29) `#define X(k, i)`

**Structs:**
- `tslot` (line 23)

#### `test_tick.c`
**Path:** `tests/test_tick.c`
**File Doc:** *Docstring: Host test for kernel/tick.c (make test-tick).*

**Functions:**
- `rec_a` (line 24) `static void rec_a(void *ctx)`
- `rec_b` (line 31) `static void rec_b(void *ctx)`
- `rec_d` (line 38) `static void rec_d(void *ctx)`
- `dummy` (line 47) `static void dummy(void *ctx)`
- `main` (line 52) `int main(void)`

**Macros:**
- `CHECK` (line 17) `#define CHECK(cond, msg)`

#### `test_usbblk.c`
**Path:** `tests/test_usbblk.c`
**File Doc:** *Docstring: Host test for the USB mass-storage driver (make test-usbblk).*

**Functions:**
- `device_register` (line 20) `int device_register(device_t *dev)`
- `device_find` (line 26) `device_t *device_find(const char *name)`
- `main` (line 43) `int main(void)`

**Macros:**
- `CHECK` (line 36) `#define CHECK(cond, msg)`

#### `test_usbhid.c`
**Path:** `tests/test_usbhid.c`
**File Doc:** *Docstring: Host test for the USB HID driver (make test-usbhid).*

**Functions:**
- `kbd_feed_scancode` (line 22) `int kbd_feed_scancode(unsigned char sc)`
- `kbd_q_push` (line 30) `void kbd_q_push(unsigned char c)`
- `check_usage` (line 48) `static void check_usage(unsigned usage, unsigned char want_sc, int want_e0,
                     ...`
- `main` (line 59) `int main(void)`

**Macros:**
- `CHECK` (line 41) `#define CHECK(cond, msg)`

#### `test_vedit_build.c`
**Path:** `tests/test_vedit_build.c`
**File Doc:** *Docstring: Host test for the vedit IDE build contract (make test-vedit).*

**Functions:**
- `t_has_ext` (line 40) `static int t_has_ext(const char *fname, const char *ext)`
- `t_base_of` (line 51) `static int t_base_of(const char *fname, char *dst, size_t cap)`
- `t_join` (line 71) `static int t_join(const char *dir, const char *base, const char *ext,
                  char *dst...`
- `t_link_fmt` (line 87) `static int t_link_fmt(const char *s)`
- `t_lang_of` (line 101) `static int t_lang_of(const char *fname)` - *Mirror of vedit_lang_of: 1=C, 2=PY, 3=LUA, 4=ASM, 5=LISP. Unknown * defaults to C, exactly like the guest (untitled highlights as C).*
- `t_run_kind` (line 121) `static int t_run_kind(const char *fname)` - *} if (n >= 3 && fname[n - 3] == '.' && fname[n - 2] == 'p' && fname[n - 1] == 'y') return 2; if (n >= 4 && fname[n - 4] == '.' && fname[n - 3] == 'l' && fname[n - 2] == 'u' && fname[n - 1] == 'a') return 3; if (n >= 5 && fname[n - 5] == '.' && fname[n - 4] == 'l' && fname[n - 3] == 'i' && fname[n - 2] == 's' && fname[n - 1] == 'p') return 5; return 1; } /* Mirror of vedit_run_kind: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp, else 0.*
- `t_str_case` (line 131) `static void t_str_case(char *s, int mode)` - *return 1; } /* Mirror of vedit_run_kind: 1=minigcc, 2=lua, 3=python, 4=ld, 5=lisp, else 0. static int t_run_kind(const char *fname) { if (t_has_ext(fname, ".c") || t_has_ext(fname, ".h")) return 1; if (t_has_ext(fname, ".lua")) return 2; if (t_has_ext(fname, ".py")) return 3; if (t_has_ext(fname, ".s")) return 4; if (t_has_ext(fname, ".lisp")) return 5; return 0; } /* Mirror of vedit_str_case.*
- `t_transpose` (line 157) `static void t_transpose(char *s, int len, int pos)`
- `t_mclass` (line 166) `static int t_mclass(int c, const char *cls)` - *} i++; } } static void t_transpose(char *s, int len, int pos) { char t; if (!s || len < 2 || pos < 1 || pos >= len) return; t = s[pos - 1]; s[pos - 1] = s[pos]; s[pos] = t; } /* Mirror of vedit_magic_match (subset: ./star/anchors/classes).*
- `t_matom` (line 188) `static int t_matom(const char *pat, int c, int *atom_len)`
- `t_mhere` (line 211) `static int t_mhere(const char *text, const char *pat, int *mlen)`
- `t_magic` (line 268) `static int t_magic(const char *text, const char *pat, int *mlen)`
- `t_cmd` (line 299) `static int t_cmd(const char *name)`
- `t_parse_key` (line 312) `static int t_parse_key(const char *s)`
- `main` (line 345) `int main(void)`

**Macros:**
- `CHECK` (line 33) `#define CHECK(cond, msg)`

#### `test_vma.c`
**Path:** `tests/test_vma.c`
**File Doc:** *Host-side unit test for the VMA red-black tree (vma.c).*

**Functions:**
- `black_height` (line 27) `static int black_height(const vma_node_t *n)`
- `tree_valid` (line 38) `static int tree_valid(const vma_node_t *root)`
- `count_nodes` (line 75) `static int count_nodes(const vma_node_t *root)`
- `test_insert_find_delete` (line 89) `static void test_insert_find_delete(void)`
- `test_pool_exhaustion` (line 136) `static void test_pool_exhaustion(void)`
- `test_full_drain` (line 153) `static void test_full_drain(void)`
- `test_file_tags_and_containing` (line 167) `static void test_file_tags_and_containing(void)`
- `test_node_recycling` (line 201) `static void test_node_recycling(void)` - *Deleted nodes are recycled: a process that maps and unmaps far more * than VMA_MAX times never runs the pool dry.*
- `main` (line 231) `int main(void)`

**Macros:**
- `CHECK` (line 20) `#define CHECK(cond, msg)`

#### `test_vma_bench.c`
**Path:** `tests/test_vma_bench.c`
**File Doc:** *test_vma_bench.c -- RB-tree vs sorted-list benchmark (boyscout gap #9).*

**Functions:**
- `now_us` (line 13) `static long now_us(void)`
- `l_insert` (line 23) `static void l_insert(unsigned long b)`
- `l_find` (line 28) `static int l_find(unsigned long b)`
- `bench` (line 34) `static void bench(int n)`
- `main` (line 54) `int main(void)`

**Macros:**
- `LIST_MAX` (line 20) `#define LIST_MAX`

#### `test_wl.c`
**Path:** `tests/test_wl.c`
**File Doc:** *Host test for progs/wl/wl_mini.h (make test-wl).*

**Functions:**
- `main` (line 27) `int main(void)`

**Macros:**
- `CHECK` (line 20) `#define CHECK(cond, msg)`

#### `test_wm.c`
**Path:** `tests/test_wm.c`
**File Doc:** *Docstring: Host test for wm_geom.h and wm_events.h (make test-wm).*

**Functions:**
- `main` (line 29) `int main(void)`

**Macros:**
- `CHECK` (line 22) `#define CHECK(cond, msg)`

#### `test_xhci.c`
**Path:** `tests/test_xhci.c`
**File Doc:** *Docstring: Host test for the xHCI controller driver (make test-xhci).*

**Functions:**
- `main` (line 30) `int main(void)`

**Macros:**
- `CHECK` (line 23) `#define CHECK(cond, msg)`

#### `tls_test.c`
**Path:** `tls_test.c`
**File Doc:** *tls_test.c - host-side tests for the kernel TLS stack.*

**Functions:**
- `tls_test_send` (line 26) `int tls_test_send(int fd, const char *buf, int len)`
- `tls_test_recv` (line 36) `int tls_test_recv(int fd, char *buf, int len)`
- `tls_test_recv_timeout` (line 41) `int tls_test_recv_timeout(int fd, char *buf, int len, unsigned long ms)`
- `tls_test_close` (line 54) `void tls_test_close(int fd)`
- `hexdigit` (line 67) `static int hexdigit(int c)`
- `unhex` (line 74) `static void unhex(const char *hex, unsigned char *out, int n)`
- `bytes_eq` (line 80) `static int bytes_eq(const unsigned char *a, const unsigned char *b, int n)`
- `test_sha256` (line 88) `static void test_sha256(void)`
- `test_sha384` (line 103) `static void test_sha384(void)`
- `test_gcm` (line 114) `static void test_gcm(void)`
- `test_p256` (line 154) `static void test_p256(void)`
- `test_rsa_ecdsa_vectors` (line 200) `static void test_rsa_ecdsa_vectors(void)`
- `tcp_connect` (line 249) `static int tcp_connect(int port)`
- `http_over_tls` (line 265) `static int http_over_tls(int port, const char *host)` - *int fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) return -1; memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_port = htons((unsigned short)port); sa.sin_addr.s_addr = htonl(0x7f000001UL); if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) { close(fd); return -1; } return fd; } /* Full handshake + one HTTP round trip. Returns 0 on success.*
- `scenario_good` (line 290) `static int scenario_good(int port)`
- `scenario_wild_good` (line 295) `static int scenario_wild_good(int port)` - *total += n; printed = 1; } tls_free_fd(fd); close(fd); if (!printed) return -1; return 0; } static int scenario_good(int port) { return http_over_tls(port, "localhost") == 0 ? 0 : -1; } /* "*.example.com" matches exactly one label.*
- `scenario_wild_root` (line 299) `static int scenario_wild_root(int port)`
- `scenario_wild_deep` (line 309) `static int scenario_wild_deep(int port)`
- `scenario_bad_host` (line 319) `static int scenario_bad_host(int port)`
- `scenario_bad_ca` (line 329) `static int scenario_bad_ca(int port)`
- `scenario_expired` (line 339) `static int scenario_expired(int port)`
- `main` (line 349) `int main(int argc, char **argv)`

**Macros:**
- `CHECK` (line 62) `#define CHECK(name, cond)`

#### `abi_stamp.c`
**Path:** `tools/abi_stamp.c`
**File Doc:** *Docstring: tools/abi_stamp.c -- Build-time ABI manifest generator.*

**Functions:**
- `main` (line 14) `int main(void)`

#### `vma.c`
**Path:** `vma.c`

**Functions:**
- `vma_ctx_init` (line 37) `void vma_ctx_init(vma_ctx_t *c, vma_node_t *pool)`
- `vma_ctx_bind` (line 52) `void vma_ctx_bind(vma_ctx_t *c)`
- `vma_ctx_save` (line 64) `void vma_ctx_save(vma_ctx_t *c)`
- `vma_view_save` (line 74) `void vma_view_save(vma_view_t *v)`
- `vma_view_load` (line 86) `void vma_view_load(const vma_view_t *v)`
- `vma_tree_init` (line 98) `void vma_tree_init(void)`
- `vma_alloc_node` (line 113) `static vma_node_t *vma_alloc_node(void)`
- `vma_rotate_left` (line 124) `static void vma_rotate_left(vma_node_t **root, vma_node_t *x)`
- `vma_rotate_right` (line 136) `static void vma_rotate_right(vma_node_t **root, vma_node_t *x)`
- `vma_insert_fixup` (line 148) `static void vma_insert_fixup(vma_node_t **root, vma_node_t *z)`
- `vma_tree_insert` (line 187) `vma_node_t *vma_tree_insert(vma_node_t **root, unsigned long base, unsigned long len)`
- `vma_node_in_tree` (line 215) `static int vma_node_in_tree(vma_node_t *root, vma_node_t *n)` - *1 when node n hangs in the tree rooted at root (live and free trees * share one pool and one cache, so a cached node must prove its tree).*
- `vma_tree_find` (line 220) `vma_node_t *vma_tree_find(vma_node_t *root, unsigned long base)`
- `vma_tree_find_containing` (line 238) `vma_node_t *vma_tree_find_containing(vma_node_t *root, unsigned long va)` - *Docstring: Find the live node containing va (base <= va < base+len), or VMA_NIL. The fault path needs interior hits; the exact-base find above cannot serve it. Pure tree walk, no MRU (the MRU keys exact * bases only). Overflow-closed: a wrapping range never contains.*
- `vma_transplant` (line 252) `static void vma_transplant(vma_node_t **root, vma_node_t *u, vma_node_t *v)`
- `vma_tree_minimum` (line 259) `static vma_node_t *vma_tree_minimum(vma_node_t *x)`
- `vma_delete_fixup` (line 264) `static void vma_delete_fixup(vma_node_t **root, vma_node_t *x)`
- `vma_tree_delete` (line 319) `int vma_tree_delete(vma_node_t **root, unsigned long base)`

### H (196 files)

#### `abi.h`
**Path:** `headers/abi.h`
**File Doc:** *Docstring: abi.h -- Boot-time ABI manifest gate contract.*

**Functions:**
- `abi_verify` (line 25) `int abi_verify(const char *text, long version, unsigned long checksum);`
- `abi_check_manifest` (line 28) `int abi_check_manifest(void);` - *ifndef ABI_HOST_TEST*

**Macros:**
- `ABI_H` (line 14) `#define ABI_H`
- `ABI_OK` (line 16) `#define ABI_OK`
- `ABI_NO_MANIFEST` (line 17) `#define ABI_NO_MANIFEST`
- `ABI_BAD_FORMAT` (line 18) `#define ABI_BAD_FORMAT`
- `ABI_VERSION_MISMATCH` (line 19) `#define ABI_VERSION_MISMATCH`
- `ABI_CHECKSUM_MISMATCH` (line 20) `#define ABI_CHECKSUM_MISMATCH`
- `ABI_MANIFEST_NAME` (line 22) `#define ABI_MANIFEST_NAME`
- `ABI_MANIFEST_MAX` (line 23) `#define ABI_MANIFEST_MAX`

#### `ap_stub.h`
**Path:** `headers/ap_stub.h`
**File Doc:** *generated from ap_stub.bin - do not edit*

*No symbols extracted*

#### `bootdefs.h`
**Path:** `headers/arch/x86/boot/bootdefs.h`
**File Doc:** *bootdefs.h - centralized configuration for the MiniOS two-stage boot path.*

**Functions:**
- `address` (line 196) `* address (below 1 MB so a real-mode SIPI can reach it) and executed by every * AP. It reuses the page tables and 64-bit GDT stage 2 built for the BSP. */ #define AP_STUB_ADDR 0x6000 #define GDT64_COD`

**Macros:**
- `BOOTDEFS_H` (line 52) `#define BOOTDEFS_H`
- `SECTOR_BYTES` (line 54) `#define SECTOR_BYTES`
- `SECTOR_PARAGRAPH_SHIFT` (line 55) `#define SECTOR_PARAGRAPH_SHIFT`
- `SECTOR_DWORD_SHIFT` (line 56) `#define SECTOR_DWORD_SHIFT`
- `BOOT_SIGNATURE` (line 58) `#define BOOT_SIGNATURE`
- `BOOT_SIGNATURE_BYTES` (line 59) `#define BOOT_SIGNATURE_BYTES`
- `BOOT_SEG_NULL` (line 61) `#define BOOT_SEG_NULL`
- `BOOT_STACK_TOP` (line 62) `#define BOOT_STACK_TOP`
- `BOOT_DAP_ADDR` (line 64) `#define BOOT_DAP_ADDR`
- `BOOT_DAP_SIZE` (line 65) `#define BOOT_DAP_SIZE`
- `BOOT_DAP_OFF_COUNT` (line 66) `#define BOOT_DAP_OFF_COUNT`
- `BOOT_DAP_OFF_OFFSET` (line 67) `#define BOOT_DAP_OFF_OFFSET`
- `BOOT_DAP_OFF_SEGMENT` (line 68) `#define BOOT_DAP_OFF_SEGMENT`
- `BOOT_DAP_OFF_LBA_LO` (line 69) `#define BOOT_DAP_OFF_LBA_LO`
- `BOOT_DAP_OFF_LBA_HI` (line 70) `#define BOOT_DAP_OFF_LBA_HI`
- `BOOT_DRIVE_ADDR` (line 71) `#define BOOT_DRIVE_ADDR`
- `BOOT_KASLR_ADDR` (line 72) `#define BOOT_KASLR_ADDR`
- `BOOT_STAGE2_LBA` (line 74) `#define BOOT_STAGE2_LBA`
- `BOOT_STAGE2_SECTORS` (line 75) `#define BOOT_STAGE2_SECTORS`
- `BOOT_STAGE2_ADDR` (line 76) `#define BOOT_STAGE2_ADDR`
- `BOOT_STAGE2_SEG` (line 77) `#define BOOT_STAGE2_SEG`
- `BOOT_KERNEL_LBA` (line 79) `#define BOOT_KERNEL_LBA`
- `BOOT_KERNEL_BUF_ADDR` (line 80) `#define BOOT_KERNEL_BUF_ADDR`
- `BOOT_KERNEL_BUF_SEG` (line 81) `#define BOOT_KERNEL_BUF_SEG`
- `BOOT_KERNEL_PHYS_ADDR` (line 82) `#define BOOT_KERNEL_PHYS_ADDR`
- `BOOT_CHUNK_SECTORS` (line 84) `#define BOOT_CHUNK_SECTORS`
- `BOOT_BIOS_MAX_SECTORS` (line 85) `#define BOOT_BIOS_MAX_SECTORS`
- `BOOT_PM_STACK_TOP` (line 87) `#define BOOT_PM_STACK_TOP`
- `BOOT_SB16_DMA_ADDR` (line 89) `#define BOOT_SB16_DMA_ADDR`
- `BOOT_SB16_DMA_BYTES` (line 90) `#define BOOT_SB16_DMA_BYTES`
- `BOOT_PCM2_DMA_ADDR` (line 91) `#define BOOT_PCM2_DMA_ADDR`
- `BOOT_PCM2_DMA_BYTES` (line 92) `#define BOOT_PCM2_DMA_BYTES`
- `BIOS_DISK_INT` (line 94) `#define BIOS_DISK_INT`
- `BIOS_DISK_EXT_CHECK` (line 95) `#define BIOS_DISK_EXT_CHECK`
- `BIOS_DISK_EXT_REQ_MAGIC` (line 96) `#define BIOS_DISK_EXT_REQ_MAGIC`
- `BIOS_DISK_EXT_ACK_MAGIC` (line 97) `#define BIOS_DISK_EXT_ACK_MAGIC`
- `BIOS_DISK_EXT_PACKET_BIT` (line 98) `#define BIOS_DISK_EXT_PACKET_BIT`
- `BIOS_DISK_READ_EXT` (line 99) `#define BIOS_DISK_READ_EXT`
- `BIOS_VIDEO_INT` (line 101) `#define BIOS_VIDEO_INT`
- `BIOS_VIDEO_TTY_WRITE` (line 102) `#define BIOS_VIDEO_TTY_WRITE`
- `BIOS_VIDEO_TTY_ATTR` (line 103) `#define BIOS_VIDEO_TTY_ATTR`
- `BIOS_VIDEO_SET_MODE` (line 104) `#define BIOS_VIDEO_SET_MODE`
- `BIOS_VBE_GET_MODE_INFO` (line 116) `#define BIOS_VBE_GET_MODE_INFO`
- `BIOS_VBE_SET_MODE` (line 117) `#define BIOS_VBE_SET_MODE`
- `VBE_MODE_1024x768x32` (line 118) `#define VBE_MODE_1024x768x32`
- `VBE_MODE_800x600x32` (line 119) `#define VBE_MODE_800x600x32`
- `VBE_MODE_640x480x32` (line 120) `#define VBE_MODE_640x480x32`
- `VBE_MODE_1024x768x8` (line 121) `#define VBE_MODE_1024x768x8`
- `VBE_MODE_800x600x8` (line 122) `#define VBE_MODE_800x600x8`
- `VBE_MODE_640x480x8` (line 123) `#define VBE_MODE_640x480x8`
- `VBE_MODE_LFB` (line 124) `#define VBE_MODE_LFB`
- `VBE_MODE_INFO_ADDR` (line 125) `#define VBE_MODE_INFO_ADDR`
- `VBE_MODE_ATTR_OFF` (line 126) `#define VBE_MODE_ATTR_OFF`
- `VBE_ATTR_SUPPORTED` (line 127) `#define VBE_ATTR_SUPPORTED`
- `VBE_ATTR_LFB` (line 128) `#define VBE_ATTR_LFB`
- `VBE_INFO_XRES_OFF` (line 129) `#define VBE_INFO_XRES_OFF`
- `VBE_INFO_YRES_OFF` (line 130) `#define VBE_INFO_YRES_OFF`
- `VBE_INFO_BYTES_SCAN_OFF` (line 131) `#define VBE_INFO_BYTES_SCAN_OFF`
- `VBE_INFO_PHYSBASE_OFF` (line 132) `#define VBE_INFO_PHYSBASE_OFF`
- `VBE_INFO_BPP_SRC_OFF` (line 133) `#define VBE_INFO_BPP_SRC_OFF`
- `VBE_BPP_8` (line 134) `#define VBE_BPP_8`
- `VBE_BPP_24` (line 135) `#define VBE_BPP_24`
- `VBE_BPP_32` (line 136) `#define VBE_BPP_32`
- `VBE_INFO_ADDR` (line 148) `#define VBE_INFO_ADDR`
- `VBE_INFO_FBBASE_OFF` (line 149) `#define VBE_INFO_FBBASE_OFF`
- `VBE_INFO_PITCH_OFF` (line 150) `#define VBE_INFO_PITCH_OFF`
- `VBE_INFO_WIDTH_OFF` (line 151) `#define VBE_INFO_WIDTH_OFF`
- `VBE_INFO_HEIGHT_OFF` (line 152) `#define VBE_INFO_HEIGHT_OFF`
- `VBE_INFO_VALID_OFF` (line 153) `#define VBE_INFO_VALID_OFF`
- `VBE_INFO_BPP_OFF` (line 154) `#define VBE_INFO_BPP_OFF`
- `A20_CONTROL_PORT` (line 156) `#define A20_CONTROL_PORT`
- `A20_ENABLE_BIT` (line 157) `#define A20_ENABLE_BIT`
- `A20_RESET_CLEAR_MASK` (line 158) `#define A20_RESET_CLEAR_MASK`
- `CR0_PE` (line 160) `#define CR0_PE`
- `CR0_PE_CLEAR_MASK` (line 161) `#define CR0_PE_CLEAR_MASK`
- `CR0_PG` (line 162) `#define CR0_PG`
- `CR0_WP` (line 163) `#define CR0_WP`
- `CR4_PAE` (line 164) `#define CR4_PAE`
- `CR0_MP` (line 165) `#define CR0_MP`
- `CR0_EM` (line 166) `#define CR0_EM`
- `CR0_NW` (line 167) `#define CR0_NW`
- `CR0_CD` (line 168) `#define CR0_CD`
- `CR4_OSFXSR` (line 169) `#define CR4_OSFXSR`
- `CR4_OSXMMEXCPT` (line 170) `#define CR4_OSXMMEXCPT`
- `MSR_EFER` (line 172) `#define MSR_EFER`
- `EFER_LME` (line 173) `#define EFER_LME`
- `EFER_NXE` (line 174) `#define EFER_NXE`
- `GDT32_CODE32_SEL` (line 176) `#define GDT32_CODE32_SEL`
- `GDT32_DATA32_SEL` (line 177) `#define GDT32_DATA32_SEL`
- `GDT32_CODE16_SEL` (line 178) `#define GDT32_CODE16_SEL`
- `GDT32_DATA16_SEL` (line 179) `#define GDT32_DATA16_SEL`
- `GDT32_DESC_NULL` (line 181) `#define GDT32_DESC_NULL`
- `GDT32_DESC_CODE32` (line 182) `#define GDT32_DESC_CODE32`
- `GDT32_DESC_DATA32` (line 183) `#define GDT32_DESC_DATA32`
- `GDT32_DESC_CODE16` (line 184) `#define GDT32_DESC_CODE16`
- `GDT32_DESC_DATA16` (line 185) `#define GDT32_DESC_DATA16`
- `GDT64_ADDR` (line 187) `#define GDT64_ADDR`
- `GDT64_BYTES` (line 188) `#define GDT64_BYTES`
- `GDT64_SMP_BYTES` (line 193) `#define GDT64_SMP_BYTES`
- `AP_STUB_ADDR` (line 198) `#define AP_STUB_ADDR`
- `GDT64_CODE_SEL` (line 199) `#define GDT64_CODE_SEL`
- `GDT64_DATA_SEL` (line 200) `#define GDT64_DATA_SEL`
- `GDT64_USER_DATA_SEL` (line 201) `#define GDT64_USER_DATA_SEL`
- `GDT64_USER_CODE_SEL` (line 202) `#define GDT64_USER_CODE_SEL`
- `GDT64_DESC_NULL` (line 203) `#define GDT64_DESC_NULL`
- `GDT64_DESC_CODE` (line 204) `#define GDT64_DESC_CODE`
- `GDT64_DESC_DATA` (line 205) `#define GDT64_DESC_DATA`
- `GDT64_DESC_UDATA` (line 206) `#define GDT64_DESC_UDATA`
- `GDT64_DESC_UCODE` (line 207) `#define GDT64_DESC_UCODE`
- `PT_PML4_ADDR` (line 209) `#define PT_PML4_ADDR`
- `PT_PDPT_ADDR` (line 210) `#define PT_PDPT_ADDR`
- `PT_PD_ADDR` (line 211) `#define PT_PD_ADDR`
- `PT_USER0_ADDR` (line 212) `#define PT_USER0_ADDR`
- `PT_USER1_ADDR` (line 213) `#define PT_USER1_ADDR`
- `PT_ZERO_DWORDS` (line 214) `#define PT_ZERO_DWORDS`
- `PT_FLAGS_PRESENT_RW` (line 215) `#define PT_FLAGS_PRESENT_RW`
- `PT_FLAGS_PRESENT_RW_PS` (line 216) `#define PT_FLAGS_PRESENT_RW_PS`
- `PT_FLAGS_PS` (line 217) `#define PT_FLAGS_PS`
- `PT_FLAGS_USER` (line 218) `#define PT_FLAGS_USER`
- `PT_FLAGS_PCD` (line 219) `#define PT_FLAGS_PCD`
- `PT_FLAGS_PWT` (line 220) `#define PT_FLAGS_PWT`
- `PT_FLAGS_NX` (line 221) `#define PT_FLAGS_NX`
- `PT_ADDR_MASK` (line 222) `#define PT_ADDR_MASK`
- `PT_USER_ENTRY` (line 223) `#define PT_USER_ENTRY`
- `PT_USER_NX_ENTRY` (line 224) `#define PT_USER_NX_ENTRY`
- `PT_ENTRY_PRESENT` (line 225) `#define PT_ENTRY_PRESENT`
- `PT_ENTRY_USER` (line 226) `#define PT_ENTRY_USER`
- `SB16_DMA_PT_ENTRY` (line 232) `#define SB16_DMA_PT_ENTRY`
- `SB16_DMA_PT_PAGES` (line 233) `#define SB16_DMA_PT_PAGES`
- `PT_FLAGS_UNCACHED` (line 238) `#define PT_FLAGS_UNCACHED`
- `KMM_DEVICE_PDPT_SLOT` (line 244) `#define KMM_DEVICE_PDPT_SLOT`
- `PT_PD_ENTRIES` (line 245) `#define PT_PD_ENTRIES`
- `PT_PD_ENTRY_BYTES` (line 246) `#define PT_PD_ENTRY_BYTES`
- `PT_PD_PAGE_BYTES` (line 247) `#define PT_PD_PAGE_BYTES`
- `PT_PD_INDEX_SHIFT` (line 248) `#define PT_PD_INDEX_SHIFT`
- `PT_FILL_START_INDEX` (line 249) `#define PT_FILL_START_INDEX`
- `PT_FILL_START_ADDR` (line 250) `#define PT_FILL_START_ADDR`
- `PT_FILL_ENTRIES` (line 251) `#define PT_FILL_ENTRIES`
- `PT_USER_TABLES_ADDR` (line 271) `#define PT_USER_TABLES_ADDR`
- `PT_USER_TABLES_BYTES` (line 272) `#define PT_USER_TABLES_BYTES`
- `KASLR_MIN_ADDR` (line 284) `#define KASLR_MIN_ADDR`
- `KASLR_ALIGN_SHIFT` (line 285) `#define KASLR_ALIGN_SHIFT`
- `KASLR_MAX_UNITS` (line 286) `#define KASLR_MAX_UNITS`
- `KASLR_IMG_OFF_1MB` (line 287) `#define KASLR_IMG_OFF_1MB`
- `KASLR_IMG_OFF_2MB` (line 288) `#define KASLR_IMG_OFF_2MB`
- `KASLR_IMAGE_SPAN` (line 289) `#define KASLR_IMAGE_SPAN`
- `CMOS_INDEX_PORT` (line 291) `#define CMOS_INDEX_PORT`
- `CMOS_DATA_PORT` (line 292) `#define CMOS_DATA_PORT`
- `CMOS_NMI_DISABLE` (line 293) `#define CMOS_NMI_DISABLE`
- `CMOS_REG_EXTMEM_LO` (line 295) `#define CMOS_REG_EXTMEM_LO`
- `CMOS_REG_EXTMEM_HI` (line 296) `#define CMOS_REG_EXTMEM_HI`
- `CMOS_EXTMEM_BASE` (line 297) `#define CMOS_EXTMEM_BASE`
- `CMOS_EXTMEM_UNIT` (line 298) `#define CMOS_EXTMEM_UNIT`
- `CMOS_REG_SECONDS` (line 299) `#define CMOS_REG_SECONDS`
- `CMOS_REG_MINUTES` (line 300) `#define CMOS_REG_MINUTES`
- `CMOS_REG_HOURS` (line 301) `#define CMOS_REG_HOURS`

#### `cpu_setup.h`
**Path:** `headers/arch/x86/cpu_setup.h`
**File Doc:** *cpu_setup.h - per-CPU control-register setup shared by the BSP (kmain)*

**Functions:**
- `cpu_enable_caches` (line 30) `static inline void cpu_enable_caches(void)` - *Turn caching on (CR0.CD and CR0.NW clear), then write back and * invalidate so no line filled under the reset policy survives.*

**Macros:**
- `ARCH_X86_CPU_SETUP_H` (line 10) `#define ARCH_X86_CPU_SETUP_H`

#### `hal_io.h`
**Path:** `headers/arch/x86/hal_io.h`
**File Doc:** *Docstring: x86 port I/O hardware abstraction contract.*

**Functions:**
- `hal_mmio_write32` (line 123) `static inline void hal_mmio_write32(volatile unsigned *addr, unsigned val)` - *A device region must be mapped uncached (see kmm_map_uncached): a write-back mapping lets a register read be answered from cache, and a stale event-ring status register is a driver that works on nothing. The fences are the other half of the contract: TRB writes must be ordered before the doorbell store that publishes them, and event TRB reads before the cycle bit is released for reuse.  /** Docstring: Read a 32-bit device register. static inline unsigned hal_mmio_read32(const volatile unsigned *addr) { return *addr; } /** Docstring: Write a 32-bit device register.*
- `hal_mmio_read64` (line 128) `static inline unsigned long long hal_mmio_read64(const volatile unsigned long long *addr)` - *bit is released for reuse.  /** Docstring: Read a 32-bit device register. static inline unsigned hal_mmio_read32(const volatile unsigned *addr) { return *addr; } /** Docstring: Write a 32-bit device register. static inline void hal_mmio_write32(volatile unsigned *addr, unsigned val) { addr = val; } /** Docstring: Read a 64-bit device register.*
- `hal_mmio_write64` (line 133) `static inline void hal_mmio_write64(volatile unsigned long long *addr,
                          ...` - *return *addr; } /** Docstring: Write a 32-bit device register. static inline void hal_mmio_write32(volatile unsigned *addr, unsigned val) { addr = val; } /** Docstring: Read a 64-bit device register. static inline unsigned long long hal_mmio_read64(const volatile unsigned long long *addr) { return *addr; } /** Docstring: Write a 64-bit device register.*
- `hal_mmio_read16` (line 139) `static inline unsigned short hal_mmio_read16(const volatile unsigned short *addr)` - *} /** Docstring: Read a 64-bit device register. static inline unsigned long long hal_mmio_read64(const volatile unsigned long long *addr) { return *addr; } /** Docstring: Write a 64-bit device register. static inline void hal_mmio_write64(volatile unsigned long long *addr, unsigned long long val) { addr = val; } /** Docstring: Read a 16-bit device register.*
- `hal_mmio_write16` (line 144) `static inline void hal_mmio_write16(volatile unsigned short *addr,
                              ...` - *} /** Docstring: Write a 64-bit device register. static inline void hal_mmio_write64(volatile unsigned long long *addr, unsigned long long val) { addr = val; } /** Docstring: Read a 16-bit device register. static inline unsigned short hal_mmio_read16(const volatile unsigned short *addr) { return *addr; } /** Docstring: Write a 16-bit device register.*
- `hal_mmio_read8` (line 150) `static inline unsigned char hal_mmio_read8(const volatile unsigned char *addr)` - *} /** Docstring: Read a 16-bit device register. static inline unsigned short hal_mmio_read16(const volatile unsigned short *addr) { return *addr; } /** Docstring: Write a 16-bit device register. static inline void hal_mmio_write16(volatile unsigned short *addr, unsigned short val) { addr = val; } /** Docstring: Read an 8-bit device register.*
- `hal_mmio_write8` (line 155) `static inline void hal_mmio_write8(volatile unsigned char *addr,
                                ...` - *} /** Docstring: Write a 16-bit device register. static inline void hal_mmio_write16(volatile unsigned short *addr, unsigned short val) { addr = val; } /** Docstring: Read an 8-bit device register. static inline unsigned char hal_mmio_read8(const volatile unsigned char *addr) { return *addr; } /** Docstring: Write an 8-bit device register.*
- `hal_mmio_wmb` (line 161) `static inline void hal_mmio_wmb(void)` - *} /** Docstring: Read an 8-bit device register. static inline unsigned char hal_mmio_read8(const volatile unsigned char *addr) { return *addr; } /** Docstring: Write an 8-bit device register. static inline void hal_mmio_write8(volatile unsigned char *addr, unsigned char val) { addr = val; } /** Docstring: Write memory barrier, orders prior stores before later stores.*
- `hal_mmio_rmb` (line 166) `static inline void hal_mmio_rmb(void)` - *} /** Docstring: Write an 8-bit device register. static inline void hal_mmio_write8(volatile unsigned char *addr, unsigned char val) { addr = val; } /** Docstring: Write memory barrier, orders prior stores before later stores. static inline void hal_mmio_wmb(void) { __asm__ volatile("sfence" ::: "memory"); } /** Docstring: Read memory barrier, orders prior loads before later loads.*
- `hal_mmio_mb` (line 171) `static inline void hal_mmio_mb(void)` - *addr = val; } /** Docstring: Write memory barrier, orders prior stores before later stores. static inline void hal_mmio_wmb(void) { __asm__ volatile("sfence" ::: "memory"); } /** Docstring: Read memory barrier, orders prior loads before later loads. static inline void hal_mmio_rmb(void) { __asm__ volatile("lfence" ::: "memory"); } /** Docstring: Full memory barrier, orders every prior access before later ones.*
- `hal_outb` (line 189) `static inline void hal_outb(unsigned short port, unsigned char val)` - *#ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written. extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls. extern unsigned hal_io_stub_lapic_eois; /** Docstring: Canned byte returned by stub port reads. extern unsigned char hal_io_stub_read_val; /** Docstring: Stub port byte write, records port and value.*
- `hal_inb` (line 196) `static inline unsigned char hal_inb(unsigned short port)` - *extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls. extern unsigned hal_io_stub_lapic_eois; /** Docstring: Canned byte returned by stub port reads. extern unsigned char hal_io_stub_read_val; /** Docstring: Stub port byte write, records port and value. static inline void hal_outb(unsigned short port, unsigned char val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = val; } /** Docstring: Stub port byte read, returns the canned value.*
- `hal_outw` (line 202) `static inline void hal_outw(unsigned short port, unsigned short val)` - */** Docstring: Stub port byte write, records port and value. static inline void hal_outb(unsigned short port, unsigned char val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = val; } /** Docstring: Stub port byte read, returns the canned value. static inline unsigned char hal_inb(unsigned short port) { (void)port; return hal_io_stub_read_val; } /** Docstring: Stub port word write, records port and low byte.*
- `hal_inw` (line 209) `static inline unsigned short hal_inw(unsigned short port)` - */** Docstring: Stub port byte read, returns the canned value. static inline unsigned char hal_inb(unsigned short port) { (void)port; return hal_io_stub_read_val; } /** Docstring: Stub port word write, records port and low byte. static inline void hal_outw(unsigned short port, unsigned short val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = (unsigned)(val & 0xFFU); } /** Docstring: Stub port word read, returns the canned value.*
- `hal_lapic_eoi` (line 215) `static inline void hal_lapic_eoi(void)` - */** Docstring: Stub port word write, records port and low byte. static inline void hal_outw(unsigned short port, unsigned short val) { hal_io_stub_writes++; hal_io_stub_last_port = port; hal_io_stub_last_val = (unsigned)(val & 0xFFU); } /** Docstring: Stub port word read, returns the canned value. static inline unsigned short hal_inw(unsigned short port) { (void)port; return (unsigned short)hal_io_stub_read_val; } /** Docstring: Stub LAPIC EOI, counts calls.*
- `hal_pic_eoi` (line 220) `static inline void hal_pic_eoi(int irq)` - *} /** Docstring: Stub port word read, returns the canned value. static inline unsigned short hal_inw(unsigned short port) { (void)port; return (unsigned short)hal_io_stub_read_val; } /** Docstring: Stub LAPIC EOI, counts calls. static inline void hal_lapic_eoi(void) { hal_io_stub_lapic_eois++; } /** Docstring: Stub PIC EOI for an IRQ line.*
- `hal_outb` (line 230) `static inline void hal_outb(unsigned short port, unsigned char val)` - *hal_io_stub_lapic_eois++; } /** Docstring: Stub PIC EOI for an IRQ line. static inline void hal_pic_eoi(int irq) { if (irq >= 8) { hal_outb(HAL_PIC2_CMD, HAL_PIC_EOI); } hal_outb(HAL_PIC1_CMD, HAL_PIC_EOI); } #else /** Docstring: Emit a port byte write.*
- `hal_inb` (line 235) `static inline unsigned char hal_inb(unsigned short port)` - *if (irq >= 8) { hal_outb(HAL_PIC2_CMD, HAL_PIC_EOI); } hal_outb(HAL_PIC1_CMD, HAL_PIC_EOI); } #else /** Docstring: Emit a port byte write. static inline void hal_outb(unsigned short port, unsigned char val) { __asm__ volatile("outb %0, %1" : : "a"(val), "Nd"(port)); } /** Docstring: Emit a port byte read.*
- `hal_outw` (line 242) `static inline void hal_outw(unsigned short port, unsigned short val)` - */** Docstring: Emit a port byte write. static inline void hal_outb(unsigned short port, unsigned char val) { __asm__ volatile("outb %0, %1" : : "a"(val), "Nd"(port)); } /** Docstring: Emit a port byte read. static inline unsigned char hal_inb(unsigned short port) { unsigned char r; __asm__ volatile("inb %1, %0" : "=a"(r) : "Nd"(port)); return r; } /** Docstring: Emit a port word write.*
- `hal_inw` (line 247) `static inline unsigned short hal_inw(unsigned short port)` - */** Docstring: Emit a port byte read. static inline unsigned char hal_inb(unsigned short port) { unsigned char r; __asm__ volatile("inb %1, %0" : "=a"(r) : "Nd"(port)); return r; } /** Docstring: Emit a port word write. static inline void hal_outw(unsigned short port, unsigned short val) { __asm__ volatile("outw %0, %1" : : "a"(val), "Nd"(port)); } /** Docstring: Emit a port word read.*
- `hal_lapic_eoi` (line 254) `static inline void hal_lapic_eoi(void)` - */** Docstring: Emit a port word write. static inline void hal_outw(unsigned short port, unsigned short val) { __asm__ volatile("outw %0, %1" : : "a"(val), "Nd"(port)); } /** Docstring: Emit a port word read. static inline unsigned short hal_inw(unsigned short port) { unsigned short r; __asm__ volatile("inw %1, %0" : "=a"(r) : "Nd"(port)); return r; } /** Docstring: Acknowledge the local APIC after an IPI-driven tick.*
- `hal_pic_eoi` (line 259) `static inline void hal_pic_eoi(int irq)` - */** Docstring: Emit a port word read. static inline unsigned short hal_inw(unsigned short port) { unsigned short r; __asm__ volatile("inw %1, %0" : "=a"(r) : "Nd"(port)); return r; } /** Docstring: Acknowledge the local APIC after an IPI-driven tick. static inline void hal_lapic_eoi(void) { (volatile unsigned *)HAL_LAPIC_EOI_ADDR = 0; } /** Docstring: Send end-of-interrupt for an IRQ line.*

**Macros:**
- `HAL_IO_H` (line 13) `#define HAL_IO_H`
- `HAL_PIC1_CMD` (line 16) `#define HAL_PIC1_CMD`
- `HAL_PIC1_DATA` (line 18) `#define HAL_PIC1_DATA`
- `HAL_PIC2_CMD` (line 20) `#define HAL_PIC2_CMD`
- `HAL_PIC2_DATA` (line 22) `#define HAL_PIC2_DATA`
- `HAL_PIC_EOI` (line 24) `#define HAL_PIC_EOI`
- `HAL_PIT_CMD` (line 27) `#define HAL_PIT_CMD`
- `HAL_PIT_CH0` (line 29) `#define HAL_PIT_CH0`
- `HAL_PS2_STATUS` (line 32) `#define HAL_PS2_STATUS`
- `HAL_PS2_DATA` (line 34) `#define HAL_PS2_DATA`
- `HAL_PS2_MOUSE_OBF` (line 36) `#define HAL_PS2_MOUSE_OBF`
- `HAL_PS2_IBF_EMPTY` (line 38) `#define HAL_PS2_IBF_EMPTY`
- `HAL_PS2_OBF_FULL` (line 40) `#define HAL_PS2_OBF_FULL`
- `HAL_PS2_CMD_WRITE_MOUSE` (line 42) `#define HAL_PS2_CMD_WRITE_MOUSE`
- `HAL_PS2_CMD_ENABLE_AUX` (line 44) `#define HAL_PS2_CMD_ENABLE_AUX`
- `HAL_PS2_CMD_DISABLE_AUX` (line 46) `#define HAL_PS2_CMD_DISABLE_AUX`
- `HAL_PS2_CMD_ENABLE_KBD` (line 48) `#define HAL_PS2_CMD_ENABLE_KBD`
- `HAL_PS2_CMD_DISABLE_KBD` (line 50) `#define HAL_PS2_CMD_DISABLE_KBD`
- `HAL_PS2_CMD_READ_CONFIG` (line 52) `#define HAL_PS2_CMD_READ_CONFIG`
- `HAL_PS2_CMD_WRITE_CONFIG` (line 54) `#define HAL_PS2_CMD_WRITE_CONFIG`
- `HAL_PS2_CONFIG_IRQ1` (line 56) `#define HAL_PS2_CONFIG_IRQ1`
- `HAL_PS2_CONFIG_IRQ12` (line 58) `#define HAL_PS2_CONFIG_IRQ12`
- `HAL_PS2_CONFIG_DISABLE_KBD` (line 60) `#define HAL_PS2_CONFIG_DISABLE_KBD`
- `HAL_PS2_CONFIG_DISABLE_AUX` (line 62) `#define HAL_PS2_CONFIG_DISABLE_AUX`
- `HAL_PS2_CONFIG_TRANSLATE` (line 64) `#define HAL_PS2_CONFIG_TRANSLATE`
- `HAL_MOUSE_CMD_RESET` (line 66) `#define HAL_MOUSE_CMD_RESET`
- `HAL_MOUSE_CMD_SET_RATE` (line 68) `#define HAL_MOUSE_CMD_SET_RATE`
- `HAL_MOUSE_CMD_GET_ID` (line 70) `#define HAL_MOUSE_CMD_GET_ID`
- `HAL_MOUSE_CMD_DEFAULTS` (line 72) `#define HAL_MOUSE_CMD_DEFAULTS`
- `HAL_MOUSE_CMD_ENABLE` (line 74) `#define HAL_MOUSE_CMD_ENABLE`
- `HAL_MOUSE_CMD_DISABLE` (line 76) `#define HAL_MOUSE_CMD_DISABLE`
- `HAL_MOUSE_RATE_KNOCK_200` (line 78) `#define HAL_MOUSE_RATE_KNOCK_200`
- `HAL_MOUSE_RATE_KNOCK_100` (line 80) `#define HAL_MOUSE_RATE_KNOCK_100`
- `HAL_MOUSE_RATE_KNOCK_80` (line 82) `#define HAL_MOUSE_RATE_KNOCK_80`
- `HAL_MOUSE_ID_INTELLI` (line 84) `#define HAL_MOUSE_ID_INTELLI`
- `HAL_MOUSE_HW_TIMEOUT` (line 86) `#define HAL_MOUSE_HW_TIMEOUT`
- `HAL_MOUSE_SYNC_BIT` (line 89) `#define HAL_MOUSE_SYNC_BIT`
- `HAL_MOUSE_OVF_BITS` (line 91) `#define HAL_MOUSE_OVF_BITS`
- `HAL_MOUSE_BUTTON_MASK` (line 93) `#define HAL_MOUSE_BUTTON_MASK`
- `HAL_MOUSE_PACKET_LEN` (line 95) `#define HAL_MOUSE_PACKET_LEN`
- `HAL_MOUSE_SCALE` (line 97) `#define HAL_MOUSE_SCALE`
- `HAL_LAPIC_EOI_ADDR` (line 100) `#define HAL_LAPIC_EOI_ADDR`

**Variables:**
- `hal_io_stub_writes` (line 178) `extern unsigned hal_io_stub_writes;` - */** Docstring: Read memory barrier, orders prior loads before later loads. static inline void hal_mmio_rmb(void) { __asm__ volatile("lfence" ::: "memory"); } /** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile("mfence" ::: "memory"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes.*
- `hal_io_stub_last_port` (line 180) `extern unsigned hal_io_stub_last_port;` - *static inline void hal_mmio_rmb(void) { __asm__ volatile("lfence" ::: "memory"); } /** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile("mfence" ::: "memory"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written.*
- `hal_io_stub_last_val` (line 182) `extern unsigned hal_io_stub_last_val;` - *} /** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile("mfence" ::: "memory"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written.*
- `hal_io_stub_lapic_eois` (line 184) `extern unsigned hal_io_stub_lapic_eois;` - */** Docstring: Full memory barrier, orders every prior access before later ones. static inline void hal_mmio_mb(void) { __asm__ volatile("mfence" ::: "memory"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written. extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls.*
- `hal_io_stub_read_val` (line 186) `extern unsigned char hal_io_stub_read_val;` - *__asm__ volatile("mfence" ::: "memory"); } #ifdef HAL_IO_HOST_TEST /** Docstring: Stub log for host tests, counts port writes. extern unsigned hal_io_stub_writes; /** Docstring: Stub log for host tests, last port written. extern unsigned hal_io_stub_last_port; /** Docstring: Stub log for host tests, last value written. extern unsigned hal_io_stub_last_val; /** Docstring: Stub log for host tests, counts LAPIC EOI calls. extern unsigned hal_io_stub_lapic_eois; /** Docstring: Canned byte returned by stub port reads.*

#### `msr.h`
**Path:** `headers/arch/x86/msr.h`
**File Doc:** *Model-Specific Register access for x86-64.*

**Functions:**
- `wrmsr` (line 8) `static inline void wrmsr(unsigned msr, unsigned long val)`
- `rdmsr` (line 13) `static inline unsigned long rdmsr(unsigned msr)`

**Macros:**
- `ARCH_X86_MSR_H` (line 2) `#define ARCH_X86_MSR_H`
- `MSR_STAR` (line 19) `#define MSR_STAR`
- `MSR_LSTAR` (line 20) `#define MSR_LSTAR`
- `MSR_SFMASK` (line 21) `#define MSR_SFMASK`
- `MSR_FSBASE` (line 22) `#define MSR_FSBASE`
- `MSR_GSBASE` (line 23) `#define MSR_GSBASE`
- `MSR_KERNEL_GS_BASE` (line 24) `#define MSR_KERNEL_GS_BASE`

#### `arena.h`
**Path:** `headers/arena.h`
**File Doc:** *Docstring: bump arena for MiniOS, kernel and ring-3 alike.*

**Functions:**
- `arena_init` (line 48) `static inline void arena_init(arena_t *a, void *block, size_t size)` - *#include <stddef.h> /** Docstring: default borrow alignment when the caller passes align 0. #define ARENA_DEFAULT_ALIGN 8u /** Docstring: one bump scope over a caller-owned backing block. typedef struct minios_arena { unsigned char *base; unsigned char *cur; unsigned char *end; } arena_t; /** Docstring: bind an arena to a backing block, empty when block is null.*
- `arena_align_up` (line 62) `static inline size_t arena_align_up(size_t n, size_t align)` - *static inline void arena_init(arena_t *a, void *block, size_t size) { if (!a) return; if (!block || size == 0) { a->base = 0; a->cur = 0; a->end = 0; return; } a->base = (unsigned char *)block; a->cur = (unsigned char *)block; a->end = (unsigned char *)block + size; } /** Docstring: round n up to align, 0 on overflow or non-power-of-two align.*
- `arena_bytes_for` (line 74) `static inline size_t arena_bytes_for(size_t count, size_t elem_size)` - */** Docstring: round n up to align, 0 on overflow or non-power-of-two align. static inline size_t arena_align_up(size_t n, size_t align) { size_t mask; size_t up; if (align == 0) align = ARENA_DEFAULT_ALIGN; if (align & (align - 1)) return 0; mask = align - 1; if (n > (size_t)-1 - mask) return 0; up = (n + mask) & ~mask; return up; } /** Docstring: overflow checked bytes for count items of elem_size.*
- `arena_alloc` (line 81) `static inline void *arena_alloc(arena_t *a, size_t size, size_t align)` - *mask = align - 1; if (n > (size_t)-1 - mask) return 0; up = (n + mask) & ~mask; return up; } /** Docstring: overflow checked bytes for count items of elem_size. static inline size_t arena_bytes_for(size_t count, size_t elem_size) { if (count == 0 || elem_size == 0) return 0; if (count > (size_t)-1 / elem_size) return 0; return count * elem_size; } /** Docstring: borrow size bytes at align, null when the scope is exhausted.*
- `arena_used` (line 95) `static inline size_t arena_used(const arena_t *a)` - *static inline void *arena_alloc(arena_t *a, size_t size, size_t align) { size_t off; size_t up; if (!a || !a->base || size == 0) return 0; off = (size_t)(a->cur - a->base); up = arena_align_up(off, align); if (up == 0 && off != 0) return 0; if (up > (size_t)(a->end - a->base)) return 0; if (size > (size_t)(a->end - a->base) - up) return 0; a->cur = a->base + up + size; return a->base + up; } /** Docstring: bytes borrowed so far, 0 for a null or empty arena.*
- `arena_free_bytes` (line 101) `static inline size_t arena_free_bytes(const arena_t *a)` - *if (up == 0 && off != 0) return 0; if (up > (size_t)(a->end - a->base)) return 0; if (size > (size_t)(a->end - a->base) - up) return 0; a->cur = a->base + up + size; return a->base + up; } /** Docstring: bytes borrowed so far, 0 for a null or empty arena. static inline size_t arena_used(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: bytes still borrowable, 0 for a null or empty arena.*
- `arena_reset` (line 107) `static inline void arena_reset(arena_t *a)` - */** Docstring: bytes borrowed so far, 0 for a null or empty arena. static inline size_t arena_used(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: bytes still borrowable, 0 for a null or empty arena. static inline size_t arena_free_bytes(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->end - a->cur); } /** Docstring: rewind the scope to empty without releasing the backing block.*
- `arena_checkpoint` (line 113) `static inline size_t arena_checkpoint(const arena_t *a)` - */** Docstring: bytes still borrowable, 0 for a null or empty arena. static inline size_t arena_free_bytes(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->end - a->cur); } /** Docstring: rewind the scope to empty without releasing the backing block. static inline void arena_reset(arena_t *a) { if (!a) return; a->cur = a->base; } /** Docstring: bookmark the cursor for a later partial rewind.*
- `arena_rewind` (line 119) `static inline int arena_rewind(arena_t *a, size_t checkpoint)` - */** Docstring: rewind the scope to empty without releasing the backing block. static inline void arena_reset(arena_t *a) { if (!a) return; a->cur = a->base; } /** Docstring: bookmark the cursor for a later partial rewind. static inline size_t arena_checkpoint(const arena_t *a) { if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: rewind to a checkpoint, -1 when the mark is out of range.*
- `arena_contains` (line 128) `static inline int arena_contains(const arena_t *a, const void *ptr)` - *if (!a || !a->base) return 0; return (size_t)(a->cur - a->base); } /** Docstring: rewind to a checkpoint, -1 when the mark is out of range. static inline int arena_rewind(arena_t *a, size_t checkpoint) { if (!a || !a->base) return -1; if (checkpoint > (size_t)(a->end - a->base)) return -1; if (checkpoint > (size_t)(a->cur - a->base)) return -1; a->cur = a->base + checkpoint; return 0; } /** Docstring: true when ptr lies inside the backing block.*
- `kmalloc` (line 3) `* * A bump arena serves one kmalloc (kernel) or malloc (ring-3) with pointer * bumps instead of N allocator round trips, then releases the whole scope * with a single free. That is the exact shape of `
- `kfree` (line 25) `* kfree(back);`

**Macros:**
- `MINIOS_ARENA_H` (line 33) `#define MINIOS_ARENA_H`
- `ARENA_DEFAULT_ALIGN` (line 38) `#define ARENA_DEFAULT_ALIGN`

**Structs:**
- `minios_arena` (line 41) - *Alignment defaults to 8 bytes when the caller passes 0. Every size sum is overflow checked and fails closed with a null return, never a wrap. Arenas are not thread safe; one arena per CPU or per syscall scope.  #ifndef MINIOS_ARENA_H #define MINIOS_ARENA_H #include <stddef.h> /** Docstring: default borrow alignment when the caller passes align 0. #define ARENA_DEFAULT_ALIGN 8u /** Docstring: one bump scope over a caller-owned backing block.*

#### `audio.h`
**Path:** `headers/audio.h`
**File Doc:** *Unified audio API for MiniOS.*

**Functions:**
- `audio_init` (line 21) `int audio_init(void);` - *PC speaker (square wave, syscalls 209/210/214) - Sound Blaster 16 (8-bit mono PCM DMA, syscalls 221/222/224) - SB16 multicanal mixer (streams, syscalls 225-228)  Ring-3 programs use these wrappers instead of calling raw syscalls. The kernel dispatches to the appropriate hardware backend.  #define AUDIO_RATE_DEFAULT  22050 #define AUDIO_CHANNELS_MONO 1 #define AUDIO_FORMAT_U8     0 #define AUDIO_FORMAT_S16    1 /* Initialize the audio subsystem.  Probes for SB16, resets PC speaker.*
- `audio_tone` (line 24) `void audio_tone(unsigned freq);` - *Ring-3 programs use these wrappers instead of calling raw syscalls. The kernel dispatches to the appropriate hardware backend.  #define AUDIO_RATE_DEFAULT  22050 #define AUDIO_CHANNELS_MONO 1 #define AUDIO_FORMAT_U8     0 #define AUDIO_FORMAT_S16    1 /* Initialize the audio subsystem.  Probes for SB16, resets PC speaker. int  audio_init(void); /* Tone mode: play a square wave at `freq` Hz.  0 = silence.*
- `audio_pcm_open` (line 27) `int audio_pcm_open(unsigned rate, unsigned channels, unsigned format);` - *#define AUDIO_RATE_DEFAULT  22050 #define AUDIO_CHANNELS_MONO 1 #define AUDIO_FORMAT_U8     0 #define AUDIO_FORMAT_S16    1 /* Initialize the audio subsystem.  Probes for SB16, resets PC speaker. int  audio_init(void); /* Tone mode: play a square wave at `freq` Hz.  0 = silence. void audio_tone(unsigned freq); /* PCM streaming mode (SB16).*
- `audio_pcm_submit` (line 28) `int audio_pcm_submit(const void *buf, unsigned len);`
- `audio_pcm_pump` (line 29) `void audio_pcm_pump(void);`
- `audio_pcm_close` (line 30) `void audio_pcm_close(void);`
- `audio_set_volume` (line 33) `void audio_set_volume(unsigned volume);` - */* Initialize the audio subsystem.  Probes for SB16, resets PC speaker. int  audio_init(void); /* Tone mode: play a square wave at `freq` Hz.  0 = silence. void audio_tone(unsigned freq); /* PCM streaming mode (SB16). int  audio_pcm_open(unsigned rate, unsigned channels, unsigned format); int  audio_pcm_submit(const void *buf, unsigned len); void audio_pcm_pump(void); void audio_pcm_close(void); /* Volume control (PC speaker mute switch).*
- `audio_get_volume` (line 34) `unsigned audio_get_volume(void);`
- `audio_sb16_present` (line 37) `int audio_sb16_present(void);` - */* Tone mode: play a square wave at `freq` Hz.  0 = silence. void audio_tone(unsigned freq); /* PCM streaming mode (SB16). int  audio_pcm_open(unsigned rate, unsigned channels, unsigned format); int  audio_pcm_submit(const void *buf, unsigned len); void audio_pcm_pump(void); void audio_pcm_close(void); /* Volume control (PC speaker mute switch). void audio_set_volume(unsigned volume); unsigned audio_get_volume(void); /* Query hardware presence.*
- `audio_stream_open` (line 40) `int audio_stream_open(void);` - */* PCM streaming mode (SB16). int  audio_pcm_open(unsigned rate, unsigned channels, unsigned format); int  audio_pcm_submit(const void *buf, unsigned len); void audio_pcm_pump(void); void audio_pcm_close(void); /* Volume control (PC speaker mute switch). void audio_set_volume(unsigned volume); unsigned audio_get_volume(void); /* Query hardware presence. int audio_sb16_present(void); /* Mixer stream API (SB16 multicanal).*
- `audio_stream_close` (line 41) `void audio_stream_close(int id);`
- `audio_stream_submit` (line 42) `int audio_stream_submit(int id, const void *buf, unsigned len);`
- `audio_stream_volume` (line 43) `void audio_stream_volume(int id, unsigned char vol);`

**Macros:**
- `AUDIO_H` (line 2) `#define AUDIO_H`
- `AUDIO_RATE_DEFAULT` (line 15) `#define AUDIO_RATE_DEFAULT`
- `AUDIO_CHANNELS_MONO` (line 16) `#define AUDIO_CHANNELS_MONO`
- `AUDIO_FORMAT_U8` (line 17) `#define AUDIO_FORMAT_U8`
- `AUDIO_FORMAT_S16` (line 18) `#define AUDIO_FORMAT_S16`

#### `batch.h`
**Path:** `headers/batch.h`
**File Doc:** *Docstring: batch.h -- Batched synchronous syscall submission.*

**Functions:**
- `batch_exec` (line 62) `long batch_exec(const batch_op_t *ops, long *results, int count, int *completed, batch_handler_t dispatch);`

**Macros:**
- `BATCH_H` (line 2) `#define BATCH_H`
- `BATCH_MAX_OPS` (line 41) `#define BATCH_MAX_OPS`
- `BATCH_OP_NOP` (line 43) `#define BATCH_OP_NOP`
- `BATCH_OP_YIELD` (line 44) `#define BATCH_OP_YIELD`
- `BATCH_OP_TIME` (line 45) `#define BATCH_OP_TIME`
- `BATCH_OP_GETPID` (line 46) `#define BATCH_OP_GETPID`
- `BATCH_OK` (line 48) `#define BATCH_OK`
- `BATCH_ERR_COUNT` (line 49) `#define BATCH_ERR_COUNT`
- `BATCH_ERR_PTR` (line 50) `#define BATCH_ERR_PTR`
- `BATCH_ERR_OPCODE` (line 51) `#define BATCH_ERR_OPCODE`

**Structs:**
- `batch_op_t` (line 53)

#### `block.h`
**Path:** `headers/block.h`
**File Doc:** *Block device abstraction for MiniFS. Maps 4096-byte logical blocks to 512-byte IDE sectors.*

**Functions:**
- `block_init` (line 12) `void block_init(void);` - *Block device abstraction for MiniFS. * Maps 4096-byte logical blocks to 512-byte IDE sectors. #define BLOCK_SIZE      4096 #define BLOCK_SHIFT     12 #define SECTORS_PER_BLOCK  (BLOCK_SIZE / IDE_SECTOR_SIZE) /* Initialize the block layer. Calls ide_init() internally.*
- `block_set_base` (line 15) `void block_set_base(unsigned int lba_base);` - *Block device abstraction for MiniFS. * Maps 4096-byte logical blocks to 512-byte IDE sectors. #define BLOCK_SIZE      4096 #define BLOCK_SHIFT     12 #define SECTORS_PER_BLOCK  (BLOCK_SIZE / IDE_SECTOR_SIZE) /* Initialize the block layer. Calls ide_init() internally. void block_init(void); /* Set the base LBA offset for all block I/O.*
- `block_read` (line 18) `int block_read(unsigned int block_num, void *buf);` - *Block device abstraction for MiniFS. * Maps 4096-byte logical blocks to 512-byte IDE sectors. #define BLOCK_SIZE      4096 #define BLOCK_SHIFT     12 #define SECTORS_PER_BLOCK  (BLOCK_SIZE / IDE_SECTOR_SIZE) /* Initialize the block layer. Calls ide_init() internally. void block_init(void); /* Set the base LBA offset for all block I/O. void block_set_base(unsigned int lba_base); /* Read/write one 4096-byte block. Returns 0 on success.*
- `block_write` (line 19) `int block_write(unsigned int block_num, const void *buf);`
- `block_read_multi` (line 23) `int block_read_multi(unsigned int block_num, unsigned int count, void *buf);` - *Read/write multiple contiguous blocks. * Returns 0 on success.*
- `block_write_multi` (line 24) `int block_write_multi(unsigned int block_num, unsigned int count, const void *buf);`
- `block_flush` (line 27) `void block_flush(void);` - *Read/write multiple contiguous blocks. * Returns 0 on success. int block_read_multi(unsigned int block_num, unsigned int count, void *buf); int block_write_multi(unsigned int block_num, unsigned int count, const void *buf); /* Flush any cached writes (currently a no-op, IDE is synchronous).*
- `block_total` (line 30) `unsigned int block_total(void);` - *Read/write multiple contiguous blocks. * Returns 0 on success. int block_read_multi(unsigned int block_num, unsigned int count, void *buf); int block_write_multi(unsigned int block_num, unsigned int count, const void *buf); /* Flush any cached writes (currently a no-op, IDE is synchronous). void block_flush(void); /* Total blocks available, 0 if no disk.*
- `block_read_sectors` (line 37) `int block_read_sectors(unsigned lba, unsigned count, void *buf);` - *Docstring: Backend-aware sector I/O on absolute LBAs, bypassing the block cache and the MiniFS base offset. This is what partition scanners and foreign filesystems use, so a FAT on a USB stick reads from USB and not from IDE. buf must be DMA-safe (heap): the USB backend hands it to * the controller as a physical address. Returns 0 on success.*
- `block_disk_sectors` (line 40) `unsigned long block_disk_sectors(void);` - *Docstring: Backend-aware sector I/O on absolute LBAs, bypassing the block cache and the MiniFS base offset. This is what partition scanners and foreign filesystems use, so a FAT on a USB stick reads from USB and not from IDE. buf must be DMA-safe (heap): the USB backend hands it to * the controller as a physical address. Returns 0 on success. int block_read_sectors(unsigned lba, unsigned count, void *buf); /** Docstring: Backend-aware disk size in 512-byte sectors, 0 if no disk.*

**Macros:**
- `BLOCK_H` (line 2) `#define BLOCK_H`
- `BLOCK_SIZE` (line 7) `#define BLOCK_SIZE`
- `BLOCK_SHIFT` (line 8) `#define BLOCK_SHIFT`
- `SECTORS_PER_BLOCK` (line 9) `#define SECTORS_PER_BLOCK`

#### `desktop_icons.h`
**Path:** `headers/desktop_icons.h`
**File Doc:** *desktop_icons.h -- embedded icon pixel data for desktop shortcuts.*

**Macros:**
- `DESKTOP_ICONS_H` (line 8) `#define DESKTOP_ICONS_H`
- `ICON_EMBEDDED_W` (line 12) `#define ICON_EMBEDDED_W`
- `ICON_EMBEDDED_H` (line 13) `#define ICON_EMBEDDED_H`

#### `desktop_shortcuts.h`
**Path:** `headers/desktop_shortcuts.h`
**File Doc:** *desktop_shortcuts.h -- configurable desktop icon shortcuts.*

**Functions:**
- `desktop_shortcuts_load` (line 82) `void desktop_shortcuts_load(void);` - *Load shortcuts from etc/shortcuts, decode icons, compute layout. * Called once from vga_fb_draw_desktop on first draw.*
- `desktop_shortcuts_draw` (line 85) `void desktop_shortcuts_draw(void);` - *Load shortcuts from etc/shortcuts, decode icons, compute layout. * Called once from vga_fb_draw_desktop on first draw. void desktop_shortcuts_load(void); /* Draw all shortcut icons and labels onto the framebuffer.*
- `desktop_shortcuts_hit_test` (line 89) `const char *desktop_shortcuts_hit_test(int mx, int my);` - *Handle a left-click at (mx, my).  Returns the command string if the * click hit an icon, or NULL otherwise.*

**Macros:**
- `DESKTOP_SHORTCUTS_H` (line 13) `#define DESKTOP_SHORTCUTS_H`
- `MAX_SHORTCUTS` (line 18) `#define MAX_SHORTCUTS`
- `SHORTCUT_NAME_LEN` (line 19) `#define SHORTCUT_NAME_LEN`
- `SHORTCUT_CMD_LEN` (line 20) `#define SHORTCUT_CMD_LEN`
- `SHORTCUT_PATH_LEN` (line 21) `#define SHORTCUT_PATH_LEN`
- `ICON_W` (line 24) `#define ICON_W`
- `ICON_H` (line 25) `#define ICON_H`
- `ICON_PAD_X` (line 26) `#define ICON_PAD_X`
- `ICON_PAD_Y` (line 27) `#define ICON_PAD_Y`
- `ICON_LABEL_H` (line 28) `#define ICON_LABEL_H`
- `DOCK_PAD_X` (line 33) `#define DOCK_PAD_X`
- `DOCK_PAD_Y` (line 34) `#define DOCK_PAD_Y`
- `DOCK_GAP` (line 35) `#define DOCK_GAP`
- `DOCK_LABEL_GAP` (line 36) `#define DOCK_LABEL_GAP`
- `DOCK_CRYSTAL_STEP` (line 41) `#define DOCK_CRYSTAL_STEP`
- `DOCK_MAG_W` (line 48) `#define DOCK_MAG_W`
- `DOCK_MAG_H` (line 49) `#define DOCK_MAG_H`
- `DOCK_NEAR_W` (line 50) `#define DOCK_NEAR_W`
- `DOCK_NEAR_H` (line 51) `#define DOCK_NEAR_H`
- `DOCK_BOUNCE_H` (line 57) `#define DOCK_BOUNCE_H`
- `DOCK_BOUNCE_TICKS` (line 58) `#define DOCK_BOUNCE_TICKS`
- `ICON_PAL_BASE` (line 65) `#define ICON_PAL_BASE`
- `ICON_PAL_SIZE` (line 66) `#define ICON_PAL_SIZE`

**Structs:**
- `desktop_shortcut` (line 72) - *A decoded+cached desktop shortcut. Pixels are raw RGBA bytes (ICON_W*ICON_H*4): the PNG's own colors, alpha below 128 transparent. Embedded fallback icons arrive as palette indices and are expanded to * RGBA at load time, so the renderer has a single code path.*

#### `driver.h`
**Path:** `headers/driver.h`
**File Doc:** *driver.h -- Strategy pattern for hardware drivers (thesis correction 2).*

**Functions:**
- `device_register` (line 56) `int device_register(device_t *dev);`
- `device_find` (line 57) `device_t *device_find(const char *name);`
- `device_find_by_type` (line 58) `device_t *device_find_by_type(int type);`
- `device_count` (line 59) `int device_count(void);`
- `device_reset` (line 60) `void device_reset(void);`

**Macros:**
- `DRIVER_H` (line 2) `#define DRIVER_H`
- `DEV_NAME_LEN` (line 18) `#define DEV_NAME_LEN`
- `DEV_MAX` (line 19) `#define DEV_MAX`
- `DEV_TYPE_BLOCK` (line 21) `#define DEV_TYPE_BLOCK`
- `DEV_TYPE_AUDIO` (line 22) `#define DEV_TYPE_AUDIO`
- `DEV_TYPE_NET` (line 23) `#define DEV_TYPE_NET`
- `DEV_TYPE_CHAR` (line 24) `#define DEV_TYPE_CHAR`

**Structs:**
- `device` (line 48)
- `block_ops_t` (line 28)
- `audio_ops_t` (line 37)

**Type_Aliases:**
- `device_t` (line 25) `typedef struct device device_t;` - *define DEV_TYPE_BLOCK 1 define DEV_TYPE_AUDIO 2 define DEV_TYPE_NET   3 define DEV_TYPE_CHAR  4*

#### `kbd.h`
**Path:** `headers/drivers/kbd.h`
**File Doc:** *Keyboard layout: US qwerty (default) or Spanish (Spain) qwerty. Toggled from the taskbar widget or the `kbd` shell builtin.*

**Functions:**
- `kbd_available` (line 9) `int kbd_available(void);`
- `kbd_read` (line 10) `int kbd_read(void);`
- `kbd_feed_scancode` (line 11) `int kbd_feed_scancode(unsigned char sc);`
- `kbd_reset_for_shell` (line 12) `void kbd_reset_for_shell(void);`
- `kbd_get_layout` (line 15) `int kbd_get_layout(void);` - *Keyboard layout: US qwerty (default) or Spanish (Spain) qwerty. Toggled * from the taskbar widget or the `kbd` shell builtin. #define KBD_LAYOUT_EN 0 #define KBD_LAYOUT_ES 1 int kbd_available(void); int kbd_read(void); int kbd_feed_scancode(unsigned char sc); void kbd_reset_for_shell(void); /* Layout selection*
- `kbd_set_layout` (line 16) `void kbd_set_layout(int layout);`
- `kbd_toggle_layout` (line 17) `void kbd_toggle_layout(void);`
- `kbd_q_empty` (line 27) `int kbd_q_empty(void);` - *Printable test for console input: ASCII 32..126 plus Latin-1 160..255 (the ES layout emits single-byte Latin-1 for ñ ¡ ¿ ´ ¨ · ª º ç Ç ¬). * DEL (127) and the C1 controls (128..159) are never input. static inline int kbd_is_printable(int c) { return (c >= 32 && c <= 126) || (c >= 160 && c <= 255); } /* Translated queue (shell input)*
- `kbd_q_pop` (line 28) `int kbd_q_pop(void);`
- `kbd_q_push` (line 29) `void kbd_q_push(unsigned char c);`
- `kbd_drop_counts` (line 32) `void kbd_drop_counts(unsigned long *cooked, unsigned long *raw);` - *Printable test for console input: ASCII 32..126 plus Latin-1 160..255 (the ES layout emits single-byte Latin-1 for ñ ¡ ¿ ´ ¨ · ª º ç Ç ¬). * DEL (127) and the C1 controls (128..159) are never input. static inline int kbd_is_printable(int c) { return (c >= 32 && c <= 126) || (c >= 160 && c <= 255); } /* Translated queue (shell input) int  kbd_q_empty(void); int  kbd_q_pop(void); void kbd_q_push(unsigned char c); /** Docstring: Drop counters for full cooked and raw queues.*
- `kbd_raw_mode_get` (line 35) `int kbd_raw_mode_get(void);` - *DEL (127) and the C1 controls (128..159) are never input. static inline int kbd_is_printable(int c) { return (c >= 32 && c <= 126) || (c >= 160 && c <= 255); } /* Translated queue (shell input) int  kbd_q_empty(void); int  kbd_q_pop(void); void kbd_q_push(unsigned char c); /** Docstring: Drop counters for full cooked and raw queues. void kbd_drop_counts(unsigned long *cooked, unsigned long *raw); /* Raw queue (DOOM / SYS_KBD)*
- `kbd_raw_mode_set` (line 36) `void kbd_raw_mode_set(int on);`
- `kbd_raw_empty` (line 37) `int kbd_raw_empty(void);`
- `kbd_raw_pop` (line 38) `int kbd_raw_pop(void);`
- `kbd_raw_push_byte` (line 39) `void kbd_raw_push_byte(unsigned char c);`
- `kbd_e0_get` (line 40) `int kbd_e0_get(void);`
- `kbd_e0_set` (line 41) `void kbd_e0_set(int v);`
- `kbd_flush_all` (line 42) `void kbd_flush_all(void);`
- `kbd_raw_flush` (line 43) `void kbd_raw_flush(void);`
- `kbd_sys_raw_filter` (line 50) `int kbd_sys_raw_filter(unsigned char sc);` - *Raw-path WM filter for the SYS_KBD direct-port read (DOOM/Quake/Nuklear read scancodes one byte per syscall, bypassing kbd_read): tracks E0 and modifiers, performs Alt+Tab / Super+Tab / Super+arrows / Alt+Enter,M,X,Q and swallows the consumed bytes. Returns 1 when sc must not reach the * app. Declared here so kernel/syscalls.c shares the one implementation.*

**Macros:**
- `KBD_H` (line 2) `#define KBD_H`
- `KBD_LAYOUT_EN` (line 6) `#define KBD_LAYOUT_EN`
- `KBD_LAYOUT_ES` (line 7) `#define KBD_LAYOUT_ES`

#### `modifiers.h`
**Path:** `headers/drivers/modifiers.h`
**File Doc:** *Docstring: Unified modifier tracking for cooked and raw paths.*

**Functions:**
- `modifiers_init` (line 37) `static inline void modifiers_init(modifier_state_t *st)` - *int ctrl_r; int alt_l; int alt_r; int super_l; int super_r; } modifier_keys_t; #define MOD_SHIFT (1 << 0) #define MOD_CTRL  (1 << 1) #define MOD_ALT   (1 << 2) #define MOD_ALTGR (1 << 3) #define MOD_SUPER (1 << 4) /** Docstring: Clear every modifier, shell reset path.*
- `modifiers_update` (line 54) `static inline int modifiers_update(const modifier_keys_t *keys,
                                 ...` - *Docstring: Track one make or break code, 1 when consumed.  Set 1 gives both halves of Ctrl, Alt and Super the same base code and separates them with 0xE0, so an unprefixed code is always the left one. Right Ctrl arrived from a PS/2 keyboard and from a USB HID report with no prefix difference at all before this, and was silently dropped: the state * said Ctrl was up while a key was physically held.*
- `modifiers_match` (line 92) `static inline int modifiers_match(const modifier_state_t *st, int mask)` - *return 1; } if (code == keys->alt_r) { st->altgr = pressed; return 1; } if (code == keys->super_l || code == keys->super_r) { st->super = pressed; return 1; } return 0; } /** Docstring: True when the state covers every bit in mask.*

**Macros:**
- `MODIFIERS_H` (line 2) `#define MODIFIERS_H`
- `MOD_SHIFT` (line 30) `#define MOD_SHIFT`
- `MOD_CTRL` (line 31) `#define MOD_CTRL`
- `MOD_ALT` (line 32) `#define MOD_ALT`
- `MOD_ALTGR` (line 33) `#define MOD_ALTGR`
- `MOD_SUPER` (line 34) `#define MOD_SUPER`

**Structs:**
- `modifier_state_t` (line 5) - *#ifndef MODIFIERS_H #define MODIFIERS_H /** Docstring: Unified modifier tracking for cooked and raw paths.*
- `modifier_keys_t` (line 19) - *Docstring: Key codes feeding the tracker, one config per layout.  The right-hand members are only recognised when the event carries the 0xE0 prefix, which is how scancode set 1 disambiguates the two halves of each pair. Right Alt is the exception that proves the rule: on a Spanish * layout it is AltGr, so it feeds the separate altgr bit rather than alt.*

#### `mouse.h`
**Path:** `headers/drivers/mouse.h`
**File Doc:** *Docstring: mouse.h -- boundary of the PS/2 mouse device driver*

**Functions:**
- `mouse_hw_init` (line 11) `void mouse_hw_init(void);` - *Docstring: mouse.h -- boundary of the PS/2 mouse device driver (drivers/mouse.c). Owns the controller handshake, the Intellimouse * detect knock and the enable/disable verbs. #include "kernel.h" /** Docstring: Detect the wheel mouse and enable data reporting.*
- `mouse_disable` (line 14) `void mouse_disable(void);` - *Docstring: mouse.h -- boundary of the PS/2 mouse device driver (drivers/mouse.c). Owns the controller handshake, the Intellimouse * detect knock and the enable/disable verbs. #include "kernel.h" /** Docstring: Detect the wheel mouse and enable data reporting. void mouse_hw_init(void); /** Docstring: Disable mouse data reporting.*
- `mouse_enable` (line 17) `void mouse_enable(void);` - *Docstring: mouse.h -- boundary of the PS/2 mouse device driver (drivers/mouse.c). Owns the controller handshake, the Intellimouse * detect knock and the enable/disable verbs. #include "kernel.h" /** Docstring: Detect the wheel mouse and enable data reporting. void mouse_hw_init(void); /** Docstring: Disable mouse data reporting. void mouse_disable(void); /** Docstring: Enable mouse data reporting.*

**Macros:**
- `MOUSE_H` (line 2) `#define MOUSE_H`

#### `nvme.h`
**Path:** `headers/drivers/nvme.h`

**Functions:**
- `nvme_init` (line 4) `int nvme_init(void);`
- `nvme_present` (line 5) `int nvme_present(void);`
- `nvme_version` (line 6) `unsigned nvme_version(void);`
- `nvme_note` (line 7) `const char *nvme_note(void);`
- `nvme_sectors` (line 8) `unsigned long nvme_sectors(void);`
- `nvme_read_sectors` (line 9) `int nvme_read_sectors(unsigned lba, unsigned count, void *buf);`

**Macros:**
- `DRIVERS_NVME_H` (line 2) `#define DRIVERS_NVME_H`

#### `pci.h`
**Path:** `headers/drivers/pci.h`
**File Doc:** *Docstring: drivers/pci.h -- PCI configuration-space access.*

**Functions:**
- `pci_cfg_read` (line 80) `static inline unsigned pci_cfg_read(unsigned bus, unsigned dev,
        unsigned func, unsigned r...` - *Docstring: Read one config dword. (bus, dev, func, reg) with reg dword-aligned by construction (low two bits masked, never a * misaligned access).*
- `pci_cfg_write` (line 90) `static inline void pci_cfg_write(unsigned bus, unsigned dev,
        unsigned func, unsigned reg,...` - *Docstring: Read one config dword. (bus, dev, func, reg) with reg dword-aligned by construction (low two bits masked, never a * misaligned access). static inline unsigned pci_cfg_read(unsigned bus, unsigned dev, unsigned func, unsigned reg, void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { outl(PCI_CFG_ADDR, 0x80000000u | (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xFCu)); return inl(PCI_CFG_DATA); } /** Docstring: Write one config dword. Same addressing as read.*
- `pci_cfg_read8` (line 100) `static inline unsigned char pci_cfg_read8(unsigned bus, unsigned dev,
        unsigned func, unsi...` - *Docstring: Read a config byte. The window is dword aligned once; the * byte selector rides in the low address bits, never a byte port op.*
- `pci_cfg_write8` (line 109) `static inline void pci_cfg_write8(unsigned bus, unsigned dev,
        unsigned func, unsigned reg...` - *Docstring: Read a config byte. The window is dword aligned once; the * byte selector rides in the low address bits, never a byte port op. static inline unsigned char pci_cfg_read8(unsigned bus, unsigned dev, unsigned func, unsigned reg, void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { unsigned dword = pci_cfg_read(bus, dev, func, reg, outl, inl); return (unsigned char)((dword >> ((reg & 3u) * 8u)) & 0xFFu); } /** Docstring: Write a config byte, read-modify-write on the window.*
- `pci_present` (line 122) `static inline int pci_present(unsigned bus, unsigned dev, unsigned func,
        void (*outl)(uns...` - *Docstring: True when a function is populated. A dword read of vendor id returns all ones for an unpopulated function, which is also what a bus * with nothing behind bridge 0 returns, so this doubles as a bus probe.*
- `xHCI` (line 134) `* base class: an xHCI (0x0C/0x03/0x30) would look for class 0x03, and a PCI
 * bridge (0x06/0x04)...`
- `pci_is_multifunction` (line 152) `static inline int pci_is_multifunction(unsigned bus, unsigned dev,
        void (*outl)(unsigned ...` - *Docstring: True when a function advertises more than one function in its * slot, so the walk must visit every function number, not just function 0.*
- `pci_find` (line 165) `static inline int pci_find(unsigned vendor, unsigned device,
        unsigned (*inl)(unsigned sho...` - *Docstring: Find a device by vendor/device ID on bus 0.  Returns the dev number, or -1 when absent. Bus-0 function-0 only: this is the QEMU seabios/OVMF layout, which is all the emulated single-function devices needed. A device that must also be found behind a chipset bridge * (any xHCI) uses pci_find_class, which walks.*
- `pci_find_class` (line 193) `static inline int pci_find_class(pci_bdf_t *out,
        unsigned cls, unsigned subclass, unsigne...` - *The walk starts at bus 0 and follows each PCI-to-PCI bridge's secondary bus number, so a controller behind a chipset bridge on real hardware is found exactly as one on QEMU's bus 0. Two 256-bit masks, 32 bytes of stack each: "reachable" (a bridge leads here) and "scanned" (already looked at). Reachability and scanning are separate so a bus numbered *below* the bridge that leads to it -- a forward reference, legal and real -- is still visited: the sweep runs again while it keeps reaching unscanned buses, bounded by PCI_CLASS_MAX_PASSES. A bus whose function 0 is empty is skipped whole, which makes an unpopulated range cost two reads per bus. Any class component may be PCI_CLASS_ANY.  Returns 1 and fills out on a hit, 0 when nothing matches (out is then * zeroed, so a caller that ignores the result still fails closed).*
- `pci_bar_count` (line 248) `static inline unsigned pci_bar_count(unsigned bus, unsigned dev, unsigned func,
        void (*ou...` - *outl, inl)) { unsigned sec = pci_cfg_read8(bus, dev, 0, PCI_REG_BRIDGE_SECONDARY, outl, inl); if (sec != 0u && sec < PCI_MAX_BUS && !(seen[sec >> 6] & (1ULL << (sec & 63u)))) reach[sec >> 6] |= 1ULL << (sec & 63u); } } } if (!progress) break; } return 0; } /** Docstring: Number of 64-bit BARs in the bar/6 dword.*
- `pci_bar_is_io` (line 263) `static inline int pci_bar_is_io(unsigned bus, unsigned dev, unsigned func,
        unsigned bar,
...` - *void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { unsigned n = 0; while (n < PCI_REG_BAR_COUNT) { unsigned bar = pci_cfg_read(bus, dev, func, PCI_REG_BAR0 + n * 4u, outl, inl); if (bar == 0u || bar == PCI_ABSENT_ID) break; n++; if (bar & PCI_BAR_64BIT) n++; } return n; } /** Docstring: True when a BAR is an I/O port range rather than memory.*
- `pci_bar_is_64bit` (line 274) `static inline int pci_bar_is_64bit(unsigned bus, unsigned dev, unsigned func,
        unsigned ba...` - *Docstring: True when a BAR is a 64-bit memory BAR, so its high dword is * the next BAR slot and must be programmed together with it.*
- `pci_bar_ctz32` (line 284) `static inline unsigned pci_bar_ctz32(unsigned val)` - *Docstring: True when a BAR is a 64-bit memory BAR, so its high dword is * the next BAR slot and must be programmed together with it. static inline int pci_bar_is_64bit(unsigned bus, unsigned dev, unsigned func, unsigned bar, void (*outl)(unsigned short, unsigned), unsigned (*inl)(unsigned short)) { unsigned val = pci_cfg_read(bus, dev, func, PCI_REG_BAR0 + bar * 4u, outl, inl); return (val & PCI_BAR_IO) == 0 && (val & PCI_BAR_64BIT) != 0; } /** Docstring: Count of trailing zero bits in a 32-bit word, 32 for zero.*
- `pci_bar_size_from_mask` (line 315) `static inline unsigned long long pci_bar_size_from_mask(unsigned long long mask)` - *A BAR that fits below 4 GB has its unimplemented lines in the low half and an all-ones high half. Reading the high half as the answer instead -- because it is the half that looks non-empty -- reports 2^32 for a 64 KB window and refuses every controller.  A BAR above 4 GB implements all 32 low lines, so the low half is all ones and the count comes from the high half.  Only the low half carries the type bits, which are fields rather than address lines, so only the low half is masked. Applying the same nibble mask to the high half invents four unimplemented lines there and reports a window sixteen times too small. A mask with no unimplemented line in either half describes no window and is refused, which is the fail-closed answer a * caller must refuse on.*
- `pci_bar_size` (line 346) `static inline unsigned long long pci_bar_size(unsigned bus, unsigned dev,
        unsigned func, ...` - *The mask is what proves the region is big enough; a size is never assumed from a spec table because a wrong answer is a window overrun on hardware that disagrees. Writing all ones makes the device drive its address lines with the unmasked bits, so the read-back mask has zeroes exactly where address lines exist. The original value is restored before returning, so a caller that then relocates the BAR starts from the firmware assignment rather than from all ones.  Returns 0 for an absent function, an I/O BAR, or a BAR with no address bits at all -- all of which are hard failures for an MMIO driver.  The caller must clear PCI_COMMAND_MEMORY first: writing all ones leaves the device decoding a different address than the one the command register * authorizes, and a device that is still decoding sees its own probe.*
- `pci_bar_relocate` (line 382) `static inline int pci_bar_relocate(unsigned bus, unsigned dev, unsigned func,
        unsigned ba...` - *Docstring: Program a memory BAR with a physical base address.  Legal only while the command register's memory-space-enable bit is clear: the device must not be decoding at the old address while the BAR changes. A 64-bit BAR takes its high dword from base's upper half, so a caller relocating into a 32-bit window must pass a base whose upper half is zero rather than expecting truncation. Returns 1 on success, 0 when the device * is absent or the BAR is an I/O range.*
- `pci_bar_base` (line 406) `static inline unsigned long long pci_bar_base(unsigned bus, unsigned dev,
        unsigned func, ...` - *Docstring: Physical base a memory BAR is programmed with, read back from the device. Returns 0 for an absent function, an I/O BAR, or a BAR left unassigned, all of which a caller must refuse on.  A 64-bit BAR's high half is zero when the address fits below 4 GB, which is the common case, so the two halves are combined by adding rather than by choosing: a 32-bit BAR's second dword is not part of the BAR at all and * holds whatever the next BAR or a bridge window put there.*
- `pci_bar_restore` (line 424) `static inline void pci_bar_restore(unsigned bus, unsigned dev,
        unsigned func, unsigned ba...` - *Docstring: Restore a BAR pair to previously saved raw values. Used to put a device back exactly as firmware left it when a probe bails, so a later * driver or a warm reboot sees the original assignment.*

**Macros:**
- `DRIVERS_PCI_H` (line 11) `#define DRIVERS_PCI_H`
- `PCI_CFG_ADDR` (line 13) `#define PCI_CFG_ADDR`
- `PCI_CFG_DATA` (line 14) `#define PCI_CFG_DATA`
- `PCI_MAX_BUS` (line 15) `#define PCI_MAX_BUS`
- `PCI_MAX_DEV` (line 16) `#define PCI_MAX_DEV`
- `PCI_MAX_FUNC` (line 17) `#define PCI_MAX_FUNC`
- `PCI_REG_VENDOR_ID` (line 20) `#define PCI_REG_VENDOR_ID`
- `PCI_REG_COMMAND` (line 21) `#define PCI_REG_COMMAND`
- `PCI_REG_CLASS_REV` (line 22) `#define PCI_REG_CLASS_REV`
- `PCI_REG_CLASS_PROGIF` (line 23) `#define PCI_REG_CLASS_PROGIF`
- `PCI_REG_HEADER_TYPE` (line 24) `#define PCI_REG_HEADER_TYPE`
- `PCI_REG_BAR0` (line 25) `#define PCI_REG_BAR0`
- `PCI_REG_CARD_BUS` (line 26) `#define PCI_REG_CARD_BUS`
- `PCI_REG_BRIDGE_SECONDARY` (line 27) `#define PCI_REG_BRIDGE_SECONDARY`
- `PCI_REG_CAP_PTR` (line 28) `#define PCI_REG_CAP_PTR`
- `PCI_REG_BAR_COUNT` (line 29) `#define PCI_REG_BAR_COUNT`
- `PCI_COMMAND_IO` (line 32) `#define PCI_COMMAND_IO`
- `PCI_COMMAND_MEMORY` (line 33) `#define PCI_COMMAND_MEMORY`
- `PCI_COMMAND_BUS_MASTER` (line 34) `#define PCI_COMMAND_BUS_MASTER`
- `PCI_BAR_TYPE_MASK` (line 37) `#define PCI_BAR_TYPE_MASK`
- `PCI_BAR_IO` (line 38) `#define PCI_BAR_IO`
- `PCI_BAR_64BIT` (line 39) `#define PCI_BAR_64BIT`
- `PCI_BAR_PREFETCH` (line 40) `#define PCI_BAR_PREFETCH`
- `PCI_BAR_ADDR_MASK` (line 41) `#define PCI_BAR_ADDR_MASK`
- `PCI_ABSENT_ID` (line 44) `#define PCI_ABSENT_ID`
- `PCI_HEADER_MULTIFUNC` (line 45) `#define PCI_HEADER_MULTIFUNC`
- `PCI_HEADER_TYPE_MASK` (line 46) `#define PCI_HEADER_TYPE_MASK`
- `PCI_HDR_TYPE_BRIDGE` (line 47) `#define PCI_HDR_TYPE_BRIDGE`
- `PCI_CLASS_BRIDGE` (line 55) `#define PCI_CLASS_BRIDGE`
- `PCI_SUBCLASS_PCI_BRIDGE` (line 56) `#define PCI_SUBCLASS_PCI_BRIDGE`
- `PCI_CLASS_XHCI` (line 57) `#define PCI_CLASS_XHCI`
- `PCI_SUBCLASS_XHCI` (line 58) `#define PCI_SUBCLASS_XHCI`
- `PCI_PROGIF_XHCI` (line 59) `#define PCI_PROGIF_XHCI`
- `PCI_CLASS_ANY` (line 62) `#define PCI_CLASS_ANY`
- `PCI_CLASS_MAX_PASSES` (line 68) `#define PCI_CLASS_MAX_PASSES`

**Structs:**
- `pci_bdf_t` (line 71) - *Docstring: Sweeps of the bus walk before it gives up. One sweep visits every bus number, so a second sweep only happens when a bridge led to a bus numbered below the bridge itself; four covers any real topology with * room to spare and keeps the walk finite. #define PCI_CLASS_MAX_PASSES 4u /** Docstring: Address of a device on the bus, as found by the walk.*

#### `usbblk.h`
**Path:** `headers/drivers/usbblk.h`
**File Doc:** *Docstring: drivers/usbblk.h -- boundary of the USB mass-storage driver.*

**Functions:**
- `ubk_init` (line 21) `int ubk_init(void);` - *Docstring: Bring up mass storage on every enumerated device. Returns the number of disks registered, which is 0 on a machine with none and is not an * error.*
- `ubk_present` (line 24) `int ubk_present(void);` - *Docstring: Bring up mass storage on every enumerated device. Returns the number of disks registered, which is 0 on a machine with none and is not an * error. int ubk_init(void); /** Docstring: True when a USB disk was registered and is the active backend.*
- `ubk_sectors` (line 27) `unsigned long ubk_sectors(void);` - *Docstring: Bring up mass storage on every enumerated device. Returns the number of disks registered, which is 0 on a machine with none and is not an * error. int ubk_init(void); /** Docstring: True when a USB disk was registered and is the active backend. int ubk_present(void); /** Docstring: Sector count of the registered disk.*
- `ubk_read_sectors` (line 32) `int ubk_read_sectors(unsigned long lba, unsigned count, void *buf);` - *Docstring: Read or write whole 512-byte sectors. Returns 1 on success, 0 on a refused request: a range outside the disk, a short transfer, a * command failure or a stale CSW. Never reports a partial block as read.*
- `ubk_write_sectors` (line 33) `int ubk_write_sectors(unsigned long lba, unsigned count, const void *buf);`
- `ubk_counters` (line 46) `void ubk_counters(ubk_counters_t *out);` - *Docstring: Counters, so a disk that is absent is distinguishable from a * driver that is broken. typedef struct { unsigned long commands; unsigned long read_blocks; unsigned long write_blocks; unsigned long failures; unsigned long stalls; } ubk_counters_t; /** Docstring: Snapshot the counters.*
- `ubk_build_cbw` (line 52) `void ubk_build_cbw(unsigned char *out, unsigned tag, unsigned long lba, unsigned blocks, int read, int data_len);` - *Docstring: Build a Command Block Wrapper into out, which must have room for UBK_CBW_LEN bytes. Pure, for the host test: a CBW whose fields disagree with its arguments is a command the device must reject, and getting the * residue wrong makes a short write look complete.*
- `ubk_check_csw` (line 60) `int ubk_check_csw(const unsigned char *csw, unsigned tag, unsigned expect_len);` - *Docstring: Check a Command Status Wrapper. Returns 1 when the CSW matches the CBW it was sent with and reports success, 0 otherwise. Pure, for the same reason. The residue check is what catches a device that moved fewer bytes than asked for: without it a truncated sector read would be handed * back as good data.*

**Macros:**
- `DRIVERS_USBBLK_H` (line 11) `#define DRIVERS_USBBLK_H`
- `UBK_BLOCK_SIZE` (line 14) `#define UBK_BLOCK_SIZE`
- `UBK_MAX_BLOCKS` (line 15) `#define UBK_MAX_BLOCKS`
- `UBK_MAX_SECTORS` (line 16) `#define UBK_MAX_SECTORS`

**Structs:**
- `ubk_counters_t` (line 37) - *Docstring: Counters, so a disk that is absent is distinguishable from a * driver that is broken.*

#### `usbhid.h`
**Path:** `headers/drivers/usbhid.h`
**File Doc:** *Docstring: drivers/usbhid.h -- boundary of the USB HID boot-protocol driver.*

**Functions:**
- `usbhid_init` (line 60) `int usbhid_init(void);` - *Docstring: Bring up HID on every enumerated device and report what was found. Returns the number of HID interfaces claimed, which is 0 on a * machine with no HID device and is not an error.*
- `usbhid_poll_keyboard` (line 64) `int usbhid_poll_keyboard(void);` - *Docstring: Service the interrupt endpoint of a claimed keyboard. One * report per call; returns 1 when a report was processed.*
- `usbhid_poll_mouse` (line 68) `int usbhid_poll_mouse(void);` - *Docstring: Service the interrupt endpoint of a claimed mouse. One report * per call; returns 1 when a report was processed.*
- `usbhid_poll` (line 71) `int usbhid_poll(void);` - *Docstring: Service the interrupt endpoint of a claimed mouse. One report * per call; returns 1 when a report was processed. int usbhid_poll_mouse(void); /** Docstring: Service both, for the tick bus. Returns the reports handled.*
- `usbhid_keyboard_present` (line 76) `int usbhid_keyboard_present(void);` - *Docstring: True when a USB keyboard is driving the input path, so the keyboard driver can skip the PS/2 port instead of spinning on a controller * that does not exist on modern hardware.*
- `usbhid_mouse_present` (line 79) `int usbhid_mouse_present(void);` - *Docstring: True when a USB keyboard is driving the input path, so the keyboard driver can skip the PS/2 port instead of spinning on a controller * that does not exist on modern hardware. int usbhid_keyboard_present(void); /** Docstring: True when a USB mouse is driving mouse_state.*
- `usbhid_press_kbd_report` (line 84) `int usbhid_press_kbd_report(const unsigned char report[HID_KBD_REPORT_LEN]);` - *Docstring: Feed a boot keyboard report through the differ, for the host test and the in-OS self test. Uses the first claimed keyboard's * stored previous report and updates it. Returns the scancodes emitted.*
- `usbhid_kbd_scancodes` (line 94) `int usbhid_kbd_scancodes(const unsigned char prev[HID_KBD_REPORT_LEN], const unsigned char cur[HID_KBD_REPORT_LEN], unsigned char *out, int max);` - *Docstring: Set-1 scancode stream for one keyboard report transition.  Pure: no hardware, no kernel state, no allocation, which is what makes it host-testable. Breaks are emitted before makes, for modifiers and for keys alike, so a burst never reads as a held-key repeat. A key that merely moved slot within the array produces nothing, because the array order is the device's choice. Returns the number of scancodes written, which is less * than max only when the report produced no events.*
- `usbhid_mouse_decode` (line 102) `void usbhid_mouse_decode(const unsigned char prev[HID_MOUSE_REPORT_LEN], const unsigned char cur[HID_MOUSE_REPORT_LEN], int *dx, int *dy, int *buttons, int *wheel);` - *Docstring: Decode one boot mouse report transition into screen-space motion, buttons and wheel. Pure, for the same reason. dx and dy are raw report deltas; the caller applies the motion scale, matching the PS/2 * path so both sources move the pointer identically.*
- `usbhid_counters` (line 116) `void usbhid_counters(usbhid_counters_t *out);` - *Docstring: Counters, so a device that is absent is distinguishable from a * driver that is broken. typedef struct { unsigned long kbd_reports; unsigned long mouse_reports; unsigned long scancodes; unsigned long transfer_errors; } usbhid_counters_t; /** Docstring: Snapshot the counters.*
- `usbhid_set1_from_usage` (line 127) `int usbhid_set1_from_usage(unsigned usage, unsigned char *sc, int *e0);` - *Docstring: Translate a HID usage code to its PS/2 set-1 make code and whether it needs the 0xE0 prefix. Returns 0 for a usage with no set-1 equivalent, which the caller drops rather than inventing a scancode for.  A pure function over a table, host-testable: HID usage ids are not scancodes above 0x27 (usage 0x28 is Return while set-1 Return is 0x1C), and the navigation cluster and the right-hand modifiers exist in one place on a USB keyboard while set-1 needs the prefix to tell them from their * left-hand twins. Both decisions live here so no caller has to know them.*

**Macros:**
- `DRIVERS_USBHID_H` (line 12) `#define DRIVERS_USBHID_H`
- `HID_USAGE_MIN` (line 15) `#define HID_USAGE_MIN`
- `HID_USAGE_MAX` (line 16) `#define HID_USAGE_MAX`
- `HID_MODIFIER_BIT` (line 17) `#define HID_MODIFIER_BIT(n)`
- `HID_MOD_LEFT_CTRL` (line 18) `#define HID_MOD_LEFT_CTRL`
- `HID_MOD_LEFT_SHIFT` (line 19) `#define HID_MOD_LEFT_SHIFT`
- `HID_MOD_LEFT_ALT` (line 20) `#define HID_MOD_LEFT_ALT`
- `HID_MOD_LEFT_GUI` (line 21) `#define HID_MOD_LEFT_GUI`
- `HID_MOD_RIGHT_CTRL` (line 22) `#define HID_MOD_RIGHT_CTRL`
- `HID_MOD_RIGHT_SHIFT` (line 23) `#define HID_MOD_RIGHT_SHIFT`
- `HID_MOD_RIGHT_ALT` (line 24) `#define HID_MOD_RIGHT_ALT`
- `HID_MOD_RIGHT_GUI` (line 25) `#define HID_MOD_RIGHT_GUI`
- `HID_KBD_REPORT_LEN` (line 29) `#define HID_KBD_REPORT_LEN`
- `HID_KBD_SLOTS` (line 30) `#define HID_KBD_SLOTS`
- `HID_MOUSE_REPORT_LEN` (line 36) `#define HID_MOUSE_REPORT_LEN`
- `HID_MOUSE_BUTTON_MASK` (line 37) `#define HID_MOUSE_BUTTON_MASK`
- `USBHID_MAX_REPORT_LEN` (line 41) `#define USBHID_MAX_REPORT_LEN`
- `USBHID_TRUNCATED` (line 46) `#define USBHID_TRUNCATED`
- `USBHID_PROTO_NONE` (line 51) `#define USBHID_PROTO_NONE`
- `HID_REQ_SET_PROTOCOL` (line 54) `#define HID_REQ_SET_PROTOCOL`
- `HID_PROTOCOL_BOOT` (line 55) `#define HID_PROTOCOL_BOOT`

**Structs:**
- `usbhid_counters_t` (line 108) - *Docstring: Counters, so a device that is absent is distinguishable from a * driver that is broken.*

#### `virtio_blk.h`
**Path:** `headers/drivers/virtio_blk.h`
**File Doc:** *Docstring: drivers/virtio_blk.h -- virtio-blk boundary.*

**Functions:**
- `vblk_init` (line 11) `int vblk_init(void);`
- `vblk_present` (line 12) `int vblk_present(void);`
- `vblk_sectors` (line 13) `unsigned long vblk_sectors(void);`
- `vblk_read_sectors` (line 14) `int vblk_read_sectors(unsigned lba, unsigned count, void *buf);`
- `vblk_write_sectors` (line 15) `int vblk_write_sectors(unsigned lba, unsigned count, const void *buf);`
- `vblk_register_device` (line 18) `void vblk_register_device(void);` - *sector contract: probe once, then read/write 512-byte sectors by LBA. The `vblk` builtin and the block-layer preference are * the only consumers; MiniFS itself never names a device. #ifndef DRIVERS_VIRTIO_BLK_H #define DRIVERS_VIRTIO_BLK_H int vblk_init(void); int vblk_present(void); unsigned long vblk_sectors(void); int vblk_read_sectors(unsigned lba, unsigned count, void *buf); int vblk_write_sectors(unsigned lba, unsigned count, const void *buf); /** Docstring: Publish vblk0 for the block layer preference.*

**Macros:**
- `DRIVERS_VIRTIO_BLK_H` (line 9) `#define DRIVERS_VIRTIO_BLK_H`

#### `virtio_net.h`
**Path:** `headers/drivers/virtio_net.h`
**File Doc:** *Docstring: drivers/virtio_net.h -- virtio-net boundary.*

**Functions:**
- `vnet_init` (line 16) `int vnet_init(void);` - *Docstring: Probe PCI for a virtio-net device and bring both queues up. Idempotent: a second call reuses the live queues. Returns 1 when the device is ready, 0 when absent or unusable (fail-closed, * rtl8139 stays).*
- `vnet_present` (line 19) `int vnet_present(void);` - *Docstring: Probe PCI for a virtio-net device and bring both queues up. Idempotent: a second call reuses the live queues. Returns 1 when the device is ready, 0 when absent or unusable (fail-closed, * rtl8139 stays). int vnet_init(void); /** Docstring: True once vnet_init brought the queues up.*
- `failure` (line 22) `* 0 on failure (no device, oversize, or TX deadline expiry). Pads * short frames to 60 bytes like the rtl8139 path. */ int vnet_send(const unsigned char *frame, unsigned len);`
- `vnet_poll` (line 28) `void vnet_poll(void);` - *Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks.*
- `vnet_get_mac` (line 31) `void vnet_get_mac(unsigned char out[6]);` - *Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes).*
- `vnet_iobase` (line 34) `unsigned short vnet_iobase(void);` - *Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]); /** Docstring: The NIC I/O base, or 0 when the device is absent.*
- `vnet_counters` (line 37) `void vnet_counters(unsigned int *tx_frames, unsigned int *rx_frames);` - *Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]); /** Docstring: The NIC I/O base, or 0 when the device is absent. unsigned short vnet_iobase(void); /** Docstring: Frame-level TX/RX counters.*
- `vnet_link_up` (line 40) `int vnet_link_up(void);` - *Docstring: Drain completed RX buffers into net_rx_handle_frame, * reposting every descriptor. Bounded per call, never blocks. void vnet_poll(void); /** Docstring: Copy the NIC MAC into out (NET_ETH_ALEN bytes). void vnet_get_mac(unsigned char out[6]); /** Docstring: The NIC I/O base, or 0 when the device is absent. unsigned short vnet_iobase(void); /** Docstring: Frame-level TX/RX counters. void vnet_counters(unsigned int *tx_frames, unsigned int *rx_frames); /** Docstring: Link-up status from the config space.*

**Macros:**
- `DRIVERS_VIRTIO_NET_H` (line 10) `#define DRIVERS_VIRTIO_NET_H`

#### `xhci.h`
**Path:** `headers/drivers/xhci.h`
**File Doc:** *Docstring: drivers/xhci.h -- boundary of the xHCI host controller driver.*

**Functions:**
- `xhc_init` (line 140) `int xhc_init(void);` - *Docstring: Bring up the first xHCI controller found. Returns 1 when a controller is running and xhc_poll will service it, 0 when there is none, which is the normal case on QEMU and on a machine whose firmware already owns the controller. Never leaves a half-mapped BAR behind: any failure * restores the firmware's assignment.*
- `xhc_poll` (line 146) `int xhc_poll(void);` - *Docstring: Service the event ring. Drains every pending TRB and completes the matching transfer. Safe to call from any context, any number of times, with interrupts on or off; it allocates nothing and takes no lock. * Returns 1 when it completed something.*
- `xhc_port_count` (line 150) `int xhc_port_count(void);` - *Docstring: Number of root ports the controller reports, bounded by * XHC_MAX_PORTS.*
- `xhc_port_state` (line 154) `int xhc_port_state(int port, xhc_port_t *out);` - *Docstring: Read a root port's live state. Returns 1 on a valid port * number, 0 otherwise, and leaves out zeroed on refusal.*
- `xhc_port_reset` (line 159) `int xhc_port_reset(int port);` - *Docstring: Reset a port and wait for the device on it to be addressable. Returns 1 when the port reports a connected, powered, * enabled device.*
- `xhc_enumerate` (line 165) `int xhc_enumerate(int port);` - *Docstring: Reset, address, describe and register the device on a port. Returns its index, or -1 on any failure, in which case the slot is released and the error is counted. Idempotent per port: a port already * holding a live device returns that device's index.*
- `xhc_enumerate_all` (line 169) `int xhc_enumerate_all(void);` - *Docstring: Enumerate every port that has something attached. Returns the * number of devices registered by this call.*
- `xhc_device_count` (line 172) `int xhc_device_count(void);` - *Docstring: Enumerate every port that has something attached. Returns the * number of devices registered by this call. int xhc_enumerate_all(void); /** Docstring: Number of devices enumerated so far.*
- `xhc_device_info` (line 175) `int xhc_device_info(int index, xhc_dev_t *out);` - *Docstring: Enumerate every port that has something attached. Returns the * number of devices registered by this call. int xhc_enumerate_all(void); /** Docstring: Number of devices enumerated so far. int xhc_device_count(void); /** Docstring: Fetch one enumerated device's state.*
- `xhc_open_interface` (line 186) `int xhc_open_interface(int index, unsigned cls, unsigned sub, unsigned proto, xhc_iface_t *out);` - *Docstring: Find an interface of an enumerated device by class triple and copy out its endpoints.  A pure function over the cached configuration descriptor, with every descriptor's bLength, type and remaining span checked before use: an unterminated or zero-length descriptor ends the walk instead of looping, and the endpoint count is capped by XHC_MAX_EPS. out is zeroed first, so a caller that ignores the result sees a zeroed interface, never stale * stack. Returns 1 on a match with at least one endpoint, 0 otherwise.*
- `xhc_control` (line 193) `int xhc_control(int index, const unsigned char setup[8], void *data, unsigned len, int host_to_device);` - *Docstring: Issue a control transfer on the control endpoint of a device. setup is the eight setup bytes, already packed, including the direction bit of bmRequestType. host_to_device selects a write data stage. Returns 1 on * a completed transfer, 0 on a stall, a timeout or a short phase.*
- `xhc_configure_endpoint` (line 200) `int xhc_configure_endpoint(int index, int ep_index, int ep_addr, int ep_type, int max_packet, int mult, int interval, int burst);` - *Docstring: Configure one non-control endpoint and give it a transfer ring. ep_index is the endpoint context index, 1..XHC_EP_INDEX_LIMIT-1. ep_addr carries the address and direction bits. Returns 1 on success, 0 on * a bad index, a device that is not addressed, or an allocation failure.*
- `xhc_transfer` (line 211) `int xhc_transfer(int index, int ep_index, void *buf, unsigned len, int *got);` - *Docstring: Move data on a configured endpoint and wait for its transfer event. len must be exactly what the endpoint's protocol transfers: one HID report, or a whole number of 512-byte blocks. got receives the byte count only for the zero-length case, which is how a device reports "nothing new"; otherwise the transfer either completed at len or failed.  Returns 1 when the device completed the transfer, 0 on a stall, a transfer * error, or a timeout.*
- `xhc_reset_endpoint` (line 216) `int xhc_reset_endpoint(int index, int ep_index);` - *Docstring: Stop, reset and re-point one endpoint's transfer ring after a stall or a timeout, so Bulk-Only recovery continues on the same ring. * Returns 1 when the endpoint is usable again.*
- `xhc_transfer_async` (line 220) `int xhc_transfer_async(int index, int ep_index, void *buf, unsigned len);` - *Docstring: Post one endpoint transfer without waiting. Returns the token * for xhc_poll_token, or 0 on refusal.*
- `xhc_poll_token_limit` (line 225) `int xhc_poll_token_limit(int token, unsigned budget_ms);` - *Docstring: Non-blocking completion check: 1 on success, -1 on a failed completion, -2 past the transfer budget, 0 while outstanding. A zero * budget never expires, for interrupt endpoints whose silence is NAKs.*
- `xhc_poll_token` (line 226) `int xhc_poll_token(int token);`
- `xhc_counters` (line 229) `void xhc_counters(xhc_counters_t *out);` - *Docstring: Non-blocking completion check: 1 on success, -1 on a failed completion, -2 past the transfer budget, 0 while outstanding. A zero * budget never expires, for interrupt endpoints whose silence is NAKs. int xhc_poll_token_limit(int token, unsigned budget_ms); int xhc_poll_token(int token); /** Docstring: Snapshot the counters.*
- `xhc_probe_note` (line 234) `const char *xhc_probe_note(void);` - *Docstring: Why the last xhc_init failed, or NULL when it succeeded. Reported by the usb builtin so an absent controller and a refused one are * distinguishable.*
- `xhc_info` (line 238) `int xhc_info(unsigned *version, unsigned *slots, unsigned *ports, unsigned *caplength);` - *Docstring: Controller version and capability-derived limits for the usb * builtin. Returns 1 when a controller is present.*

**Macros:**
- `DRIVERS_XHCI_H` (line 23) `#define DRIVERS_XHCI_H`
- `XHC_MAX_DEVICES` (line 29) `#define XHC_MAX_DEVICES`
- `XHC_MAX_PORTS` (line 34) `#define XHC_MAX_PORTS`
- `XHC_MAX_EPS` (line 38) `#define XHC_MAX_EPS`
- `XHC_EP_INDEX_LIMIT` (line 43) `#define XHC_EP_INDEX_LIMIT`
- `XHC_MAX_PENDING` (line 47) `#define XHC_MAX_PENDING`
- `XHC_MAX_CONFIG_DESC` (line 51) `#define XHC_MAX_CONFIG_DESC`
- `XHC_TRB_RING_TRBS` (line 56) `#define XHC_TRB_RING_TRBS`
- `XHC_RESET_BUDGET_MS` (line 61) `#define XHC_RESET_BUDGET_MS`
- `XHC_CMD_BUDGET_MS` (line 62) `#define XHC_CMD_BUDGET_MS`
- `XHC_XFER_BUDGET_MS` (line 63) `#define XHC_XFER_BUDGET_MS`
- `XHC_PORT_BUDGET_MS` (line 64) `#define XHC_PORT_BUDGET_MS`
- `XHC_CAPLENGTH_MIN` (line 68) `#define XHC_CAPLENGTH_MIN`
- `XHC_SPEED_FULL` (line 71) `#define XHC_SPEED_FULL`
- `XHC_SPEED_LOW` (line 72) `#define XHC_SPEED_LOW`
- `XHC_SPEED_HIGH` (line 73) `#define XHC_SPEED_HIGH`
- `XHC_SPEED_SUPER` (line 74) `#define XHC_SPEED_SUPER`
- `XHC_EP_CONTROL` (line 77) `#define XHC_EP_CONTROL`
- `XHC_EP_ISOCHRONOUS` (line 78) `#define XHC_EP_ISOCHRONOUS`
- `XHC_EP_BULK` (line 79) `#define XHC_EP_BULK`
- `XHC_EP_INTERRUPT` (line 80) `#define XHC_EP_INTERRUPT`
- `XHC_EP_DIR_IN` (line 83) `#define XHC_EP_DIR_IN`
- `XHC_CLASS_HID` (line 86) `#define XHC_CLASS_HID`
- `XHC_SUBCLASS_BOOT` (line 87) `#define XHC_SUBCLASS_BOOT`
- `XHC_CLASS_MASS_STORAGE` (line 88) `#define XHC_CLASS_MASS_STORAGE`
- `XHC_SUBCLASS_SCSI` (line 89) `#define XHC_SUBCLASS_SCSI`
- `XHC_PROTOCOL_BULK_ONLY` (line 90) `#define XHC_PROTOCOL_BULK_ONLY`

**Structs:**
- `xhc_iface_t` (line 94) - *Docstring: One interface of a device with its endpoints, recovered from a * configuration descriptor. Filled by xhc_open_interface.*
- `xhc_port_t` (line 107) - *Docstring: What one root port currently holds. Every field is read from * PORTSC, never inferred.*
- `xhc_dev_t` (line 115) - *Docstring: What one root port currently holds. Every field is read from * PORTSC, never inferred. typedef struct { int connected; int enabled; int speed; int power; } xhc_port_t; /** Docstring: Per-device state the class drivers read back.*
- `xhc_counters_t` (line 124) - *Docstring: Counters, so a zero is attributable rather than mysterious. * Every field is incremented by the code path that did the work.*

#### `editor.h`
**Path:** `headers/editor.h`
**File Doc:** *editor.h -- the built-in line editor contract.*

**Functions:**
- `shell_cmd_edit` (line 15) `void shell_cmd_edit(int argc, char **argv);`

**Macros:**
- `EDITOR_H` (line 2) `#define EDITOR_H`

#### `ext4.h`
**Path:** `headers/ext4.h`
**File Doc:** *ext4.h -- Read-only ext4 loopback/device driver.*

**Functions:**
- `ext4_list` (line 35) `int ext4_list(const char *imgpath, const char *dirpath, char names[][EXT4_NAME_MAX + 1], int *isdir, int cap);` - *List one directory: names (dirs with trailing '/') up to cap. * Returns the entry count, or -1 when the image, path or walk fails.*
- `ext4_vfs_open` (line 40) `int ext4_vfs_open(const char *path, int mode, void **handle);` - *VFS verbs: open "imgpath:extpath" (first ':' splits), read, close, * fstat. Write/truncate refuse. All fail closed with -1.*
- `ext4_vfs_read` (line 41) `int ext4_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len);`
- `ext4_vfs_write` (line 43) `int ext4_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len);`
- `ext4_vfs_close` (line 45) `int ext4_vfs_close(void *handle);`
- `ext4_vfs_fstat` (line 46) `int ext4_vfs_fstat(void *handle, unsigned long *size_out);`
- `ext4_vfs_truncate` (line 47) `int ext4_vfs_truncate(void *handle, unsigned long size);`
- `first` (line 50) `* MBR 0x83 entry first (proven by a superblock read), then a magic * scan over 2048-aligned LBAs for superfloppy layouts. Returns the * base LBA, or -1 when no ext4 is present. Cached. */ long ext_dev`

**Macros:**
- `EXT4_H` (line 2) `#define EXT4_H`
- `EXT4_NAME_MAX` (line 16) `#define EXT4_NAME_MAX`
- `EXT4_MAX_DEPTH` (line 17) `#define EXT4_MAX_DEPTH`
- `EXT4_LIST_CAP` (line 18) `#define EXT4_LIST_CAP`
- `EXT4_PATH_MAX` (line 19) `#define EXT4_PATH_MAX`

**Structs:**
- `ext4_handle_t` (line 22) - *singly-indirect blocks), linear directories. Out of scope and refused fail-closed: htree-indexed directories, symlinks (even fast ones), encrypted or inline-data files, doubly and triply indirect blocks, journal replay (reads see the last consistent state). Checksums are not verified; every structural offset is bounds-checked instead. The image backend (regular file or real * disk region) is the shared fsimg contract. #define EXT4_NAME_MAX  255 #define EXT4_MAX_DEPTH 8 #define EXT4_LIST_CAP  64 #define EXT4_PATH_MAX  256 /* One open ext4 file: image backend plus the located inode.*

**Variables:**
- `ext4_vfs_ops` (line 55) `extern const vfs_ops_t ext4_vfs_ops;`

#### `fat32.h`
**Path:** `headers/fat32.h`
**File Doc:** *fat32.h -- Read-only FAT32 loopback driver over ramdisk/MiniFS images.*

**Functions:**
- `file` (line 6) `* * A FAT32 disk image stored as a regular file (built on the host with * mkfs.vfat, packed into minifs.bin) is parsed here: BPB validation, * cluster-chain walking and 8.3 directory traversal. Only t`
- `fat32_list` (line 45) `int fat32_list(const char *imgpath, const char *dirpath, char names[][FAT32_NAME_MAX], int *isdir, int cap);` - *List one directory: names (dirs with trailing '/') up to cap. * Returns the entry count, or -1 when the image, path or walk fails.*
- `fat_dev_base` (line 54) `long fat_dev_base(void);` - *Locate the first FAT32 partition on the primary IDE master: a real MBR FAT32 entry first (real hardware with a partition table), then a magic scan over 2048-aligned LBAs (superfloppy images with no table, like the os.img tail). Returns the base LBA, or -1 when no FAT32 is present. Result is cached; the disk never changes under * a running guest.*
- `fat32_vfs_open` (line 58) `int fat32_vfs_open(const char *path, int mode, void **handle);` - *VFS verbs: open "imgpath:fatpath" (first ':' splits), read, close, * fstat. Write/truncate refuse. All fail closed with -1.*
- `fat32_vfs_read` (line 59) `int fat32_vfs_read(void *handle, void *buf, unsigned long pos, unsigned long len);`
- `fat32_vfs_write` (line 61) `int fat32_vfs_write(void *handle, const void *buf, unsigned long pos, unsigned long len);`
- `fat32_vfs_close` (line 63) `int fat32_vfs_close(void *handle);`
- `fat32_vfs_fstat` (line 64) `int fat32_vfs_fstat(void *handle, unsigned long *size_out);`
- `fat32_vfs_truncate` (line 65) `int fat32_vfs_truncate(void *handle, unsigned long size);`

**Macros:**
- `FAT32_H` (line 2) `#define FAT32_H`
- `FAT32_NAME_MAX` (line 16) `#define FAT32_NAME_MAX`
- `FAT32_MAX_DEPTH` (line 17) `#define FAT32_MAX_DEPTH`
- `FAT32_LIST_CAP` (line 18) `#define FAT32_LIST_CAP`
- `FAT32_CLUS_MAX` (line 19) `#define FAT32_CLUS_MAX`

**Structs:**
- `fat32_handle_t` (line 25) - *One open FAT file: image backend plus the located entry. A loopback image reads through ramdisk/minifs at file offsets; a real disk partition (`hd0`, first FAT32 found) reads absolute LBA sectors * through the IDE driver at dev_lba + offset.*

**Variables:**
- `fat32_vfs_ops` (line 67) `extern const vfs_ops_t fat32_vfs_ops;`

#### `fsimg.h`
**Path:** `headers/fsimg.h`
**File Doc:** *fsimg.h -- One image backend for read-only filesystem drivers.*

**Functions:**
- `fsimg_open_file` (line 23) `int fsimg_open_file(const char *resolved, fsimg_t *img);` - *Open a resolved path as a loopback image. Refuses past 4 GB (all * sector math below is 32-bit).*
- `fsimg_open_dev` (line 27) `int fsimg_open_dev(unsigned long base_lba, unsigned long nsec, fsimg_t *img);` - *Open an absolute disk region [base_lba, base_lba + nsec) as an * image. Bounds are 64-bit and fenced to the drive size.*
- `fsimg_read` (line 32) `int fsimg_read(const fsimg_t *img, unsigned long off, void *buf, unsigned long len);` - *Read len bytes at off into buf. Fails closed on any bound * violation, short backend transfer, or missing device.*
- `fsimg_split` (line 40) `int fsimg_split(const char *path, char *left, unsigned llen, char *right, unsigned rlen);` - *Split "left:right" at the first ':' (image names never carry one). Bounds are per side: image paths resolve under RAMDISK_FNAME_LEN, in-image paths may run deeper. Refuses empty sides and overlong parts. Shared by the fat: and ext4: VFS addressings, which have * the same shape.*

**Macros:**
- `FSIMG_H` (line 2) `#define FSIMG_H`

**Structs:**
- `fsimg_t` (line 13)

#### `futex.h`
**Path:** `headers/futex.h`
**File Doc:** *Docstring: futex.h -- Fast userspace mutex sleep/wake contract.*

**Functions:**
- `futex_init` (line 86) `void futex_init(void);`
- `futex_wait` (line 87) `long futex_wait(unsigned long uaddr, int val);`
- `futex_wake` (line 88) `long futex_wake(unsigned long uaddr, int n);`
- `futex_forget` (line 91) `void futex_forget(int pid);` - *Unlink pid from whatever futex queue still holds it and clear its * recorded address; a no-op for a pid that is not waiting.*
- `FUTEX_CLOCK_REALTIME` (line 96) `* FUTEX_CLOCK_REALTIME (it only selects the clock of a BITSET deadline). * Returns -1 for anything unserved (REQUEUE, CMP_REQUEUE, WAKE_OP, PI/PP, * unknown flags). Host-tested (tests/test_futex.c);`
- `futex_linux_cmd` (line 100) `int futex_linux_cmd(long op);` - *Decode a Linux futex(2) op to LINUX_FUTEX_WAIT/WAKE/WAIT_BITSET/ WAKE_BITSET, masking FUTEX_PRIVATE_FLAG (process-private is served on the same global buckets: same semantics, no isolation shortcut) and FUTEX_CLOCK_REALTIME (it only selects the clock of a BITSET deadline). Returns -1 for anything unserved (REQUEUE, CMP_REQUEUE, WAKE_OP, PI/PP, unknown flags). Host-tested (tests/test_futex.c); the kernel errno * mapping lives in syscalls.c, which is not host-compilable.*
- `futex_timeout_remaining_us` (line 107) `long futex_timeout_remaining_us(int cmd, long sec, long nsec, unsigned long now_us);` - *Microseconds left before a futex timeout: relative for WAIT, absolute (against now_us on the op's clock) for WAIT_BITSET. Zero or negative means the deadline passed; FUTEX_TIMEOUT_INVALID for a negative second or a nanosecond field outside [0, 1e9); FUTEX_TIMEOUT_FOREVER when the * seconds would overflow a microsecond count. Pure, host-tested.*

**Macros:**
- `FUTEX_H` (line 2) `#define FUTEX_H`
- `FUTEX_BUCKETS` (line 51) `#define FUTEX_BUCKETS`
- `FUTEX_BUCKET_MASK` (line 52) `#define FUTEX_BUCKET_MASK`
- `FUTEX_HASH_GOLDEN` (line 53) `#define FUTEX_HASH_GOLDEN`
- `FUTEX_OK` (line 55) `#define FUTEX_OK`
- `FUTEX_NOMATCH` (line 56) `#define FUTEX_NOMATCH`
- `FUTEX_NOPROC` (line 57) `#define FUTEX_NOPROC`
- `FUTEX_WAKE_ALL` (line 58) `#define FUTEX_WAKE_ALL`
- `LINUX_FUTEX_WAIT` (line 65) `#define LINUX_FUTEX_WAIT`
- `LINUX_FUTEX_WAKE` (line 66) `#define LINUX_FUTEX_WAKE`
- `LINUX_FUTEX_WAIT_BITSET` (line 67) `#define LINUX_FUTEX_WAIT_BITSET`
- `LINUX_FUTEX_WAKE_BITSET` (line 68) `#define LINUX_FUTEX_WAKE_BITSET`
- `LINUX_FUTEX_PRIVATE_FLAG` (line 69) `#define LINUX_FUTEX_PRIVATE_FLAG`
- `LINUX_FUTEX_CLOCK_REALTIME` (line 70) `#define LINUX_FUTEX_CLOCK_REALTIME`
- `LINUX_FUTEX_BITSET_MATCH_ANY` (line 71) `#define LINUX_FUTEX_BITSET_MATCH_ANY`
- `FUTEX_US_PER_S` (line 72) `#define FUTEX_US_PER_S`
- `FUTEX_NS_PER_US` (line 73) `#define FUTEX_NS_PER_US`
- `FUTEX_NS_PER_S` (line 74) `#define FUTEX_NS_PER_S`
- `FUTEX_TIMEOUT_INVALID` (line 77) `#define FUTEX_TIMEOUT_INVALID`
- `FUTEX_TIMEOUT_FOREVER` (line 78) `#define FUTEX_TIMEOUT_FOREVER`

**Structs:**
- `futex_bucket_t` (line 80)

#### `httpd.h`
**Path:** `headers/httpd.h`
**File Doc:** *Docstring: httpd.h -- Minimal static HTTP/1.0 server contract.*

**Functions:**
- `httpd_ctype` (line 28) `static inline const char *httpd_ctype(const char *path)` - *Docstring: Content type by file suffix. Unknown suffixes serve as * application/octet-stream, never refused. Null path reads as octet.*
- `httpd_header` (line 121) `static inline int httpd_header(int code, const char *reason,
        const char *ctype, unsigned ...` - *Docstring: Emit a response head into out. Returns the head length, or HTTPD_ERR_BOUND past cap. body_len is the exact Content-Length; * the caller streams the body after the head.*

**Macros:**
- `HTTPD_H` (line 15) `#define HTTPD_H`
- `HTTPD_MAX_PATH` (line 17) `#define HTTPD_MAX_PATH`
- `HTTPD_MAX_REQ` (line 18) `#define HTTPD_MAX_REQ`
- `HTTPD_HEAD_MAX` (line 19) `#define HTTPD_HEAD_MAX`
- `HTTPD_ERR_BOUND` (line 21) `#define HTTPD_ERR_BOUND`
- `HTTPD_ERR_METHOD` (line 22) `#define HTTPD_ERR_METHOD`
- `HTTPD_ERR_PATH` (line 23) `#define HTTPD_ERR_PATH`
- `HTTPD_ERR_VERSION` (line 24) `#define HTTPD_ERR_VERSION`

#### `ide.h`
**Path:** `headers/ide.h`
**File Doc:** *IDE/ATA PIO driver for MiniOS.*

**Functions:**
- `ide_init` (line 49) `void ide_init(void);` - *#define IDE_CMD_FLUSH       0xE7    /* FLUSH CACHE /* Drive/Head register bits #define IDE_DRIVE_LBA       0x40    /* LBA mode #define IDE_DRIVE_MASTER    0xA0    /* master drive #define IDE_DRIVE_SLAVE     0xB0    /* slave drive /* Timeout in PIT ticks (approximate) #define IDE_TIMEOUT         1000000 /* Sector size in bytes #define IDE_SECTOR_SIZE     512 /* Initialize the IDE driver: probe, IDENTIFY, report geometry.*
- `ide_read_sectors` (line 53) `int ide_read_sectors(unsigned int lba, unsigned int count, void *buf);` - *Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error.*
- `ide_write_sectors` (line 54) `int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf);`
- `ide_read_sector` (line 57) `int ide_read_sector(unsigned int lba, void *buf);` - *Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error. int ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); /* Convenience: single sector read/write.*
- `ide_write_sector` (line 58) `int ide_write_sector(unsigned int lba, const void *buf);`
- `ide_total_sectors` (line 61) `unsigned int ide_total_sectors(void);` - *Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error. int ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); /* Convenience: single sector read/write. int ide_read_sector(unsigned int lba, void *buf); int ide_write_sector(unsigned int lba, const void *buf); /* Returns total sectors on the disk, or 0 if not detected.*
- `ide_present` (line 64) `int ide_present(void);` - *Read/write sectors using 28-bit LBA. * Returns 0 on success, -1 on error. int ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); /* Convenience: single sector read/write. int ide_read_sector(unsigned int lba, void *buf); int ide_write_sector(unsigned int lba, const void *buf); /* Returns total sectors on the disk, or 0 if not detected. unsigned int ide_total_sectors(void); /* Returns 1 if a disk was successfully detected.*
- `ide_register_device` (line 68) `void ide_register_device(void);` - *Publish the Strategy ops table to the device registry (driver.h). * Called from ide_init; re-registration is a no-op (duplicate refused).*

**Macros:**
- `IDE_H` (line 2) `#define IDE_H`
- `IDE_PRIMARY_BASE` (line 9) `#define IDE_PRIMARY_BASE`
- `IDE_PRIMARY_CTRL` (line 10) `#define IDE_PRIMARY_CTRL`
- `IDE_REG_DATA` (line 13) `#define IDE_REG_DATA`
- `IDE_REG_ERROR` (line 14) `#define IDE_REG_ERROR`
- `IDE_REG_SECCOUNT` (line 15) `#define IDE_REG_SECCOUNT`
- `IDE_REG_LBA_LO` (line 16) `#define IDE_REG_LBA_LO`
- `IDE_REG_LBA_MID` (line 17) `#define IDE_REG_LBA_MID`
- `IDE_REG_LBA_HI` (line 18) `#define IDE_REG_LBA_HI`
- `IDE_REG_DRIVE` (line 19) `#define IDE_REG_DRIVE`
- `IDE_REG_STATUS` (line 20) `#define IDE_REG_STATUS`
- `IDE_REG_ALTSTATUS` (line 21) `#define IDE_REG_ALTSTATUS`
- `IDE_STATUS_ERR` (line 24) `#define IDE_STATUS_ERR`
- `IDE_STATUS_DRQ` (line 25) `#define IDE_STATUS_DRQ`
- `IDE_STATUS_SRV` (line 26) `#define IDE_STATUS_SRV`
- `IDE_STATUS_DF` (line 27) `#define IDE_STATUS_DF`
- `IDE_STATUS_RDY` (line 28) `#define IDE_STATUS_RDY`
- `IDE_STATUS_BSY` (line 29) `#define IDE_STATUS_BSY`
- `IDE_CMD_READ` (line 32) `#define IDE_CMD_READ`
- `IDE_CMD_WRITE` (line 33) `#define IDE_CMD_WRITE`
- `IDE_CMD_IDENTIFY` (line 34) `#define IDE_CMD_IDENTIFY`
- `IDE_CMD_FLUSH` (line 35) `#define IDE_CMD_FLUSH`
- `IDE_DRIVE_LBA` (line 38) `#define IDE_DRIVE_LBA`
- `IDE_DRIVE_MASTER` (line 39) `#define IDE_DRIVE_MASTER`
- `IDE_DRIVE_SLAVE` (line 40) `#define IDE_DRIVE_SLAVE`
- `IDE_TIMEOUT` (line 43) `#define IDE_TIMEOUT`
- `IDE_SECTOR_SIZE` (line 46) `#define IDE_SECTOR_SIZE`

#### `console_in.h`
**Path:** `headers/kernel/console_in.h`
**File Doc:** *Docstring: console_in.h -- boundary of the console input device*

**Functions:**
- `Consumers` (line 7) `* Consumers (shell prompt, editor, SPAWN waits, GETC_RAW syscall) include * this header instead of reaching into kernel/shell.c. */ #include "kernel.h" /** Docstring: Blocking read from PS/2 or COM1 w`
- `console_history_page` (line 19) `void console_history_page(int dir);` - *Docstring: Page the console history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring and the text-mode * console the legacy VGA scrollback ring; this picks the one that is up.*
- `console_peek` (line 22) `int console_peek(void);` - *Docstring: Page the console history by one screen (dir -1 up, +1 down). The framebuffer terminal keeps its own logical ring and the text-mode * console the legacy VGA scrollback ring; this picks the one that is up. void console_history_page(int dir); /** Docstring: Next buffered byte without consuming it, or -1.*
- `console_raw_try` (line 26) `int console_raw_try(void);` - *Docstring: Raw console multiplexer backing GETC_RAW: same sources, * no line buffering, echo or scrollback. try returns -1 when idle.*
- `console_raw_get` (line 27) `int console_raw_get(void);`
- `console_job_try` (line 30) `int console_job_try(void);` - *Docstring: Raw console multiplexer backing GETC_RAW: same sources, * no line buffering, echo or scrollback. try returns -1 when idle. int console_raw_try(void); int console_raw_get(void); /** Docstring: PS/2-only GETC_RAW source for background jobs.*
- `console_job_get` (line 31) `int console_job_get(void);`
- `console_ungetc` (line 35) `void console_ungetc(unsigned char c);` - *Docstring: Push one byte back into the console FIFO; the next * console_getc/console_peek serves it first. Drops the byte when full.*
- `console_stdin_push` (line 42) `int console_stdin_push(const char *data, unsigned long len);` - *Docstring: Pipeline stdin override: the next console_getc calls serve len bytes from data, then report EOF (-1) instead of blocking on the live console until console_stdin_clear runs. The shell pipeline runner owns this: stage N+1 reads stage N's captured output as its stdin. * Bounded by PIPE_CAP_MAX, fail-closed (0) past it or on OOM.*
- `console_stdin_clear` (line 43) `void console_stdin_clear(void);`
- `console_stdin_active` (line 44) `int console_stdin_active(void);`

**Macros:**
- `CONSOLE_IN_H` (line 2) `#define CONSOLE_IN_H`

#### `vga_cursor.h`
**Path:** `headers/kernel/vga_cursor.h`
**File Doc:** *Docstring: vga_cursor.h -- boundary of the pointer sprite layer*

**Functions:**
- `cursor_over` (line 16) `int cursor_over(int x0, int y0, int w, int h);` - *Docstring: vga_cursor.h -- boundary of the pointer sprite layer (kernel/vga_cursor.c). Owns the arrow bitmap, the saved background and the painted position; draws only through the framebuffer primitives. * Callers move/erase/invalidate through these ops and never poke state. #include "kernel.h" /** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle.*
- `cursor_place` (line 19) `void cursor_place(int mx, int my);` - *(kernel/vga_cursor.c). Owns the arrow bitmap, the saved background and the painted position; draws only through the framebuffer primitives. * Callers move/erase/invalidate through these ops and never poke state. #include "kernel.h" /** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally.*
- `cursor_move` (line 22) `void cursor_move(int mx, int my);` - *#include "kernel.h" /** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved.*
- `cursor_erase` (line 25) `void cursor_erase(void);` - */** Docstring: Pointer sprite dimensions in pixels. #define CURSOR_W 8 #define CURSOR_H 8 /** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved. void cursor_move(int mx, int my); /** Docstring: Restore the saved background and mark the pointer hidden.*
- `cursor_invalidate` (line 28) `void cursor_invalidate(void);` - */** Docstring: True when the sprite overlaps the given screen rectangle. int cursor_over(int x0, int y0, int w, int h); /** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved. void cursor_move(int mx, int my); /** Docstring: Restore the saved background and mark the pointer hidden. void cursor_erase(void); /** Docstring: Mark the pointer hidden without touching the framebuffer.*
- `cursor_note_repaint` (line 31) `void cursor_note_repaint(int x0, int y0, int w, int h);` - */** Docstring: Paint the pointer at mx/my unconditionally. void cursor_place(int mx, int my); /** Docstring: Desktop-tick update: repaint only when the position moved. void cursor_move(int mx, int my); /** Docstring: Restore the saved background and mark the pointer hidden. void cursor_erase(void); /** Docstring: Mark the pointer hidden without touching the framebuffer. void cursor_invalidate(void); /** Docstring: Invalidate when the pointer overlaps a repainted rectangle.*

**Macros:**
- `VGA_CURSOR_H` (line 2) `#define VGA_CURSOR_H`
- `CURSOR_W` (line 12) `#define CURSOR_W`
- `CURSOR_H` (line 13) `#define CURSOR_H`

#### `kernel.h`
**Path:** `headers/kernel.h`
**File Doc:** *The user-window memory layout (load base, stack, brk cap, graphics*

**Functions:**
- `outb` (line 26) `static inline void outb(unsigned short port, unsigned char val)`
- `inb` (line 29) `static inline unsigned char inb(unsigned short port)`
- `outw` (line 34) `static inline void outw(unsigned short port, unsigned short val)`
- `inw` (line 37) `static inline unsigned short inw(unsigned short port)`
- `insw` (line 47) `static inline void insw(unsigned short port, unsigned short *buf,
                        unsigne...` - *String port I/O: one instruction moves `count` words between the port and the buffer.  Under KVM every port access is a VM-exit, so a 512 B sector costs 1 exit this way instead of 256 single-word inw/outw (measured: MiniFS reads ran at ~250 KB/s before, bulk ELF loads took * minutes).  `cld` pins the direction; alignment is not required.*
- `outsw` (line 54) `static inline void outsw(unsigned short port, const unsigned short *buf,
                        ...`
- `waits` (line 64) `* and mouse_hw_init issues dozens of waits (measured 5 s of boot).  This
 * polls the port once p...`
- `C` (line 903) `* it with pointer subtraction in C (undefined behaviour). The value is
 * a link-time difference,...`
- `ktime_ms` (line 25) `unsigned long ktime_ms(void);` - *Forward: PIT-calibrated wall clock (defined in kernel/time.c); valid * once pit_init has run. Used only by the deadline polls below.*
- `vga_clear` (line 94) `void vga_clear(void);`
- `vga_putc` (line 95) `void vga_putc(char c);`
- `vga_puts` (line 96) `void vga_puts(const char *s);`
- `vga_scroll` (line 97) `void vga_scroll(void);`
- `vga_set_cursor` (line 98) `void vga_set_cursor(int x, int y);`
- `vga_newline` (line 99) `void vga_newline(void);`
- `vga_cursor_enable` (line 100) `void vga_cursor_enable(int on);`
- `vga_get_x` (line 108) `int vga_get_x(void);` - *Console output lock (kernel/console.c): serializes SMP console output across CPUs. Held across the whole vga_putc body; try-or-race so an ISR * dump prints rather than deadlocks on a lock held by interrupted context. extern spinlock_t console_lock; /* VGA state getters (kernel/console.c, for scrollback renderer)*
- `vga_get_y` (line 109) `int vga_get_y(void);`
- `vga_set_xy` (line 110) `void vga_set_xy(int x, int y);`
- `vga_get_color` (line 111) `char vga_get_color(void);`
- `minfo_sleep_init` (line 116) `void minfo_sleep_init(int tick_ok);` - *MINFO sleep support (kernel/syscalls.c): timed park for ring-3 monitors. sched_init passes the tick-registration result; without a * registered waker sel 6 fails closed instead of hanging.*
- `minfo_tick_wake` (line 117) `void minfo_tick_wake(void *ctx);`
- `sb_init` (line 120) `void sb_init(void);` - *MINFO sleep support (kernel/syscalls.c): timed park for ring-3 monitors. sched_init passes the tick-registration result; without a * registered waker sel 6 fails closed instead of hanging. void minfo_sleep_init(int tick_ok); void minfo_tick_wake(void *ctx); /* ========== Scrollback ring (kernel/scrollback.c) ==========*
- `sb_capture_row0` (line 121) `void sb_capture_row0(void);`
- `sb_reset` (line 122) `void sb_reset(void);`
- `sb_get_count` (line 123) `int sb_get_count(void);`
- `sb_get_head` (line 124) `int sb_get_head(void);`
- `sb_get_char` (line 125) `char sb_get_char(int row, int col);`
- `serial_init` (line 128) `void serial_init(void);` - *monitors. sched_init passes the tick-registration result; without a * registered waker sel 6 fails closed instead of hanging. void minfo_sleep_init(int tick_ok); void minfo_tick_wake(void *ctx); /* ========== Scrollback ring (kernel/scrollback.c) ========== void sb_init(void); void sb_capture_row0(void); void sb_reset(void); int  sb_get_count(void); int  sb_get_head(void); char sb_get_char(int row, int col); /* ========== Serial console (COM1) ==========*
- `serial_putc` (line 129) `void serial_putc(char c);`
- `serial_puts` (line 130) `void serial_puts(const char *s);`
- `sc_record_dump` (line 131) `void sc_record_dump(int pid);`
- `serial_e_count` (line 132) `unsigned long serial_e_count(void);`
- `serial_available` (line 134) `int serial_available(void);` - *void sb_init(void); void sb_capture_row0(void); void sb_reset(void); int  sb_get_count(void); int  sb_get_head(void); char sb_get_char(int row, int col); /* ========== Serial console (COM1) ========== void serial_init(void); void serial_putc(char c); void serial_puts(const char *s); void sc_record_dump(int pid); unsigned long serial_e_count(void);          /* E-flood tracer (serial.c) extern unsigned long ser_e_ra, ser_e_cpu;    /* first 'E' writer's RA/CPU*
- `serial_getc` (line 135) `int serial_getc(void);`
- `kbd_read` (line 173) `int kbd_read(void);`
- `kbd_available` (line 174) `int kbd_available(void);`
- `kbd_reset_for_shell` (line 175) `void kbd_reset_for_shell(void);`
- `kmalloc` (line 213) `void *kmalloc(unsigned long size);`
- `kfree` (line 215) `void kfree(void *ptr);`
- `kcalloc` (line 216) `void *kcalloc(unsigned long nmemb, unsigned long size);`
- `krealloc` (line 217) `void *krealloc(void *ptr, unsigned long size);`
- `kallocator_init` (line 218) `void kallocator_init(void);`
- `kmalloc_aligned` (line 219) `void *kmalloc_aligned(unsigned long size, unsigned long align);`
- `kmalloc_page` (line 221) `void *kmalloc_page(void);` - *define KMALLOC_PAGE 0x1000UL*
- `kfree_aligned` (line 222) `void kfree_aligned(void *ptr);`
- `dlmalloc_init` (line 226) `void dlmalloc_init(unsigned long size);` - *dlmalloc backend (third_party/dlmalloc): an mspace rooted over the fixed * kernel heap. The kernel's allocator delegates to these.*
- `dlmalloc_malloc` (line 230) `void *dlmalloc_malloc(unsigned long size);`
- `dlmalloc_memalign` (line 231) `void *dlmalloc_memalign(unsigned long align, unsigned long size);`
- `dlmalloc_free` (line 232) `void dlmalloc_free(void *ptr);`
- `dlmalloc_calloc` (line 233) `void *dlmalloc_calloc(unsigned long nmemb, unsigned long size);`
- `dlmalloc_realloc` (line 234) `void *dlmalloc_realloc(void *ptr, unsigned long size);`
- `dlmalloc_usage` (line 236) `void dlmalloc_usage(unsigned long *used, unsigned long *free_b, unsigned long *arena);` - *Bytes of kernel heap actually in use as the dlmalloc space: HEAP_SIZE * clamped to the RAM installed above HEAP_BASE. extern unsigned long kheap_size; void *dlmalloc_malloc(unsigned long size); void *dlmalloc_memalign(unsigned long align, unsigned long size); void  dlmalloc_free(void *ptr); void *dlmalloc_calloc(unsigned long nmemb, unsigned long size); void *dlmalloc_realloc(void *ptr, unsigned long size); /** Docstring: Heap usage snapshot for the mem builtin.*
- `ramdisk_init` (line 287) `void ramdisk_init(void);`
- `ramdisk_open` (line 288) `RDFile *ramdisk_open(const char *name);`
- `ramdisk_read` (line 289) `int ramdisk_read(RDFile *f, void *buf, unsigned offset, unsigned len);`
- `ramdisk_write` (line 290) `int ramdisk_write(RDFile *f, const void *buf, unsigned offset, unsigned len);`
- `ramdisk_create` (line 291) `RDFile *ramdisk_create(const char *name, unsigned size);`
- `ramdisk_resize` (line 292) `int ramdisk_resize(RDFile *f, unsigned newsize);`
- `ramdisk_delete` (line 293) `int ramdisk_delete(RDFile *f);`
- `RAMDISK_FNAME_LEN` (line 295) `* RAMDISK_FNAME_LEN (fs_resolve guarantees it);`
- `ramdisk_rename` (line 297) `int ramdisk_rename(const char *oldname, const char *newname);` - *Docstring: In-place rename of one ramdisk entry. Both names fit RAMDISK_FNAME_LEN (fs_resolve guarantees it); missing src or an * existing dst refuses, never overwrites. Returns 0 on success.*
- `ramdisk_list` (line 298) `int ramdisk_list(RDFile **out, int max);`
- `ramdisk_setup_from` (line 299) `void ramdisk_setup_from(void *data, unsigned size);`
- `ramdisk_count` (line 300) `int ramdisk_count(void);`
- `ramdisk_file_name` (line 301) `const char *ramdisk_file_name(int idx);`
- `ramdisk_usage` (line 303) `void ramdisk_usage(unsigned *used, unsigned *cap, unsigned *max);` - *Docstring: In-place rename of one ramdisk entry. Both names fit RAMDISK_FNAME_LEN (fs_resolve guarantees it); missing src or an * existing dst refuses, never overwrites. Returns 0 on success. int      ramdisk_rename(const char *oldname, const char *newname); int      ramdisk_list(RDFile **out, int max); void     ramdisk_setup_from(void *data, unsigned size); int      ramdisk_count(void); const char *ramdisk_file_name(int idx); /** Docstring: Ramdisk usage snapshot for the mem builtin.*
- `fs_resolve` (line 311) `int fs_resolve(const char *path, char *out, unsigned cap);` - *Path resolution choke point shared by the shell builtins and the zip builtins. fs_resolve resolves a path against the cwd into `out` (cap >= RAMDISK_FNAME_LEN); a name that does not fit is rejected like a * missing file, never truncated.*
- `fs_dir_exists` (line 312) `int fs_dir_exists(const char *dir);`
- `fs_is_dir` (line 313) `int fs_is_dir(const char *resolved);`
- `vfs_register` (line 417) `int vfs_register(const char *prefix, const vfs_ops_t *ops, const char *driver);`
- `vfs_unregister` (line 418) `int vfs_unregister(const char *prefix);`
- `vfs_list` (line 422) `int vfs_list(char prefixes[][VFS_PREFIX_LEN], char drivers[][VFS_DRIVER_LEN], int refs[], int cap);` - *define VFS_MAX_MOUNTS 8 define VFS_PREFIX_LEN 32 define VFS_DRIVER_LEN 16*
- `vfs_mount_driver` (line 424) `int vfs_mount_driver(const char *prefix, const char *driver);`
- `vfs_open` (line 425) `int vfs_open(const char *path, int mode, vfs_file_t *f);`
- `vfs_read` (line 426) `int vfs_read(vfs_file_t *f, void *buf, unsigned long len);`
- `vfs_write` (line 427) `int vfs_write(vfs_file_t *f, const void *buf, unsigned long len);`
- `vfs_close` (line 428) `int vfs_close(vfs_file_t *f);`
- `vfs_fstat` (line 429) `int vfs_fstat(vfs_file_t *f, unsigned long *size_out);`
- `vfs_readdir` (line 430) `int vfs_readdir(const char *path, vfs_dirent_t *ents, int cap);`
- `vfs_init` (line 431) `void vfs_init(void);`
- `vfs_register_builtins` (line 432) `void vfs_register_builtins(void);`
- `minifs_mkdir_p` (line 433) `int minifs_mkdir_p(const char *resolved);`
- `kfopen` (line 495) `KFILE *kfopen(const char *path, const char *mode);`
- `kfopen_dir` (line 499) `KFILE *kfopen_dir(const char *resolved);` - *Directory handle for getdents64: kfopen refuses directories (EISDIR), so open(2) on a directory takes this path instead. resolved must be a * directory path; trailing '/' is added by the helper.*
- `kfclose` (line 500) `int kfclose(KFILE *f);`
- `today` (line 505) `* cell is correct today (single shared ET_REL window, no miniGCC * threads);`
- `fs_rename` (line 524) `int fs_rename(const char *oldr, const char *newr);` - *Rename one file within its filesystem; see fs/kfile.c for the contract: * 0 ok, -2 missing src, -21 directory, -17 existing dst, -18 cross-fs.*
- `kfgetc` (line 525) `int kfgetc(KFILE *f);`
- `kfgets` (line 526) `char *kfgets(char *buf, int size, KFILE *f);`
- `kfungetc` (line 527) `int kfungetc(int c, KFILE *f);`
- `kfread` (line 528) `unsigned long kfread(void *ptr, unsigned long size, unsigned long nmemb, KFILE *f);`
- `kfwrite` (line 529) `unsigned long kfwrite(const void *ptr, unsigned long size, unsigned long nmemb, KFILE *f);`
- `kfseek` (line 530) `int kfseek(KFILE *f, long offset, int whence);`
- `kftell` (line 531) `long kftell(KFILE *f);`
- `kfputs` (line 532) `int kfputs(const char *s, KFILE *f);`
- `kfputc` (line 533) `int kfputc(int c, KFILE *f);`
- `kfflush` (line 534) `int kfflush(KFILE *f);`
- `krewind` (line 535) `void krewind(KFILE *f);`
- `kfile_stdin` (line 540) `KFILE *kfile_stdin(void);`
- `kfile_stdout` (line 541) `KFILE *kfile_stdout(void);`
- `kfile_stderr` (line 542) `KFILE *kfile_stderr(void);`
- `kstrlen` (line 545) `unsigned long kstrlen(const char *s);` - *long   kftell(KFILE *f); int    kfputs(const char *s, KFILE *f); int    kfputc(int c, KFILE *f); int    kfflush(KFILE *f); void   krewind(KFILE *f); extern KFILE *kstdin; extern KFILE *kstdout; extern KFILE *kstderr; KFILE *kfile_stdin(void); KFILE *kfile_stdout(void); KFILE *kfile_stderr(void); /* ========== String functions ==========*
- `kstrcpy` (line 546) `char *kstrcpy(char *dst, const char *src);`
- `kstrncpy` (line 547) `char *kstrncpy(char *dst, const char *src, unsigned long n);`
- `kstrncat` (line 548) `char *kstrncat(char *dst, const char *src, unsigned long n);`
- `kstrcmp` (line 549) `int kstrcmp(const char *a, const char *b);`
- `kstrncmp` (line 550) `int kstrncmp(const char *a, const char *b, unsigned long n);`
- `kstrchr` (line 551) `char *kstrchr(const char *s, int c);`
- `kstrstr` (line 552) `char *kstrstr(const char *hay, const char *ndl);`
- `kmemcpy` (line 553) `void *kmemcpy(void *dst, const void *src, unsigned long n);`
- `kmemset` (line 554) `void *kmemset(void *dst, int c, unsigned long n);`
- `kmemcmp` (line 555) `int kmemcmp(const void *a, const void *b, unsigned long n);`
- `kmemmove` (line 556) `void *kmemmove(void *dst, const void *src, unsigned long n);`
- `katol` (line 557) `long katol(const char *s);`
- `kprintf` (line 560) `int kprintf(const char *fmt, ...);` - *char *kstrcpy(char *dst, const char *src); char *kstrncpy(char *dst, const char *src, unsigned long n); char *kstrncat(char *dst, const char *src, unsigned long n); int   kstrcmp(const char *a, const char *b); int   kstrncmp(const char *a, const char *b, unsigned long n); char *kstrchr(const char *s, int c); char *kstrstr(const char *hay, const char *ndl); void *kmemcpy(void *dst, const void *src, unsigned long n); void *kmemset(void *dst, int c, unsigned long n); int   kmemcmp(const void *a, const void *b, unsigned long n); void *kmemmove(void *dst, const void *src, unsigned long n); long   katol(const char *s); /* ========== printf ==========*
- `kfprintf` (line 561) `int kfprintf(KFILE *f, const char *fmt, ...);`
- `ksprintf` (line 562) `int ksprintf(char *buf, const char *fmt, ...);`
- `ksnprintf` (line 563) `int ksnprintf(char *buf, unsigned long size, const char *fmt, ...);`
- `klog` (line 578) `void klog(log_level_t level, log_subsystem_t subsys, const char *fmt, ...);`
- `klog_hexdump` (line 580) `void klog_hexdump(log_level_t level, log_subsystem_t subsys, const void *data, unsigned long len, const char *label);`
- `klog_set_level` (line 582) `void klog_set_level(log_level_t level);`
- `klog_set_subsys_level` (line 583) `void klog_set_subsys_level(log_subsystem_t subsys, log_level_t level);`
- `klog_disable` (line 584) `void klog_disable(void);`
- `klog_enable` (line 585) `void klog_enable(void);`
- `shell_init` (line 588) `void shell_init(void);` - *LOG_SUBSYS_SHELL, LOG_SUBSYS_BOOT, LOG_SUBSYS_GENERAL, LOG_SUBSYS_COUNT } log_subsystem_t; void klog(log_level_t level, log_subsystem_t subsys, const char *fmt, ...); void klog_hexdump(log_level_t level, log_subsystem_t subsys, const void *data, unsigned long len, const char *label); void klog_set_level(log_level_t level); void klog_set_subsys_level(log_subsystem_t subsys, log_level_t level); void klog_disable(void); void klog_enable(void); /* ========== Shell ==========*
- `shell_run` (line 589) `void shell_run(void);`
- `console_getc` (line 590) `int console_getc(void);`
- `console_peek` (line 591) `int console_peek(void);`
- `redirect_suspend` (line 592) `int redirect_suspend(void);`
- `redirect_resume` (line 593) `void redirect_resume(int was);`
- `redirect_begin` (line 594) `int redirect_begin(void);`
- `redirect_commit` (line 595) `int redirect_commit(const char *path, int append_mode);`
- `redirect_take` (line 596) `char *redirect_take(unsigned long *len_out);`
- `redirect_pending` (line 597) `unsigned long redirect_pending(void);`
- `redirect_take_into` (line 598) `unsigned long redirect_take_into(char *dst, unsigned long cap, unsigned long *len_out);`
- `redirect_discard` (line 600) `void redirect_discard(void);`
- `redirect_active` (line 601) `int redirect_active(void);`
- `console_stdin_push` (line 602) `int console_stdin_push(const char *data, unsigned long len);`
- `console_stdin_clear` (line 603) `void console_stdin_clear(void);`
- `console_stdin_active` (line 604) `int console_stdin_active(void);`
- `panic_screen` (line 607) `void panic_screen(unsigned long vector, unsigned long err, unsigned long rip, unsigned long rsp, unsigned long rbp, int halt);` - *void redirect_resume(int was); int  redirect_begin(void); int  redirect_commit(const char *path, int append_mode); char *redirect_take(unsigned long *len_out); unsigned long redirect_pending(void); unsigned long redirect_take_into(char *dst, unsigned long cap, unsigned long *len_out); void redirect_discard(void); int  redirect_active(void); int console_stdin_push(const char *data, unsigned long len); void console_stdin_clear(void); int console_stdin_active(void); /* ========== Panic screen (kernel/panic.c) ==========*
- `clip_set` (line 611) `int clip_set(const char *data, unsigned long len);` - *unsigned long redirect_pending(void); unsigned long redirect_take_into(char *dst, unsigned long cap, unsigned long *len_out); void redirect_discard(void); int  redirect_active(void); int console_stdin_push(const char *data, unsigned long len); void console_stdin_clear(void); int console_stdin_active(void); /* ========== Panic screen (kernel/panic.c) ========== void panic_screen(unsigned long vector, unsigned long err, unsigned long rip, unsigned long rsp, unsigned long rbp, int halt); /* ========== Shared clipboard (kernel/clip.c) ==========*
- `clip_get` (line 612) `int clip_get(char *out, unsigned long cap);`
- `clip_clear` (line 613) `void clip_clear(void);`
- `clip_len_get` (line 614) `int clip_len_get(void);`
- `shell_take_redirect` (line 615) `int shell_take_redirect(int *argc, char **argv, char **path, int *append_mode);`
- `shell_run_any` (line 616) `int shell_run_any(const char *name, int argc, char **argv);`
- `shell_exec_builtin` (line 617) `void shell_exec_builtin(int argc, char **argv);`
- `shell_report_exit` (line 618) `void shell_report_exit(int code);`
- `shell_report` (line 619) `void shell_report(const char *what, const char *detail);`
- `kprog_slot` (line 644) `KProg *kprog_slot(const char *name);`
- `kprog_lookup` (line 645) `KProg *kprog_lookup(const char *name);`
- `ksym_resolve` (line 646) `void *ksym_resolve(const char *name);`
- `k_spawn` (line 647) `int k_spawn(const char *name, int argc, char **argv);`
- `k_register_program` (line 648) `void k_register_program(const char *name, prog_entry_t entry);`
- `k_register_process` (line 649) `void k_register_process(const char *name, void *proc_entry);`
- `k_register_symbol` (line 650) `void k_register_symbol(const char *name, void *addr);`
- `register_libc_symbols` (line 654) `void register_libc_symbols(void);` - *Libc name table for ET_REL programs (kernel/console.c). Called once * from kmain; the table itself lives in kernel/symtab.c.*
- `k_exec_user` (line 657) `int k_exec_user(void *entry, int argc, char **argv);` - *Libc name table for ET_REL programs (kernel/console.c). Called once * from kmain; the table itself lives in kernel/symtab.c. void register_libc_symbols(void); /* ========== Process execution (Linux ELF binaries) ==========*
- `k_run_rel` (line 658) `int k_run_rel(prog_entry_t entry, int argc, char **argv);`
- `kexit` (line 659) `void kexit(int code);`
- `k_run_on_stack` (line 662) `int k_run_on_stack(void *stack_top, prog_entry_t entry, int argc, char **argv);` - *ET_REL stack switch (arch/x86/ctx_sw.S): runs entry(argc, argv) on * the 64 KB stack ending at stack_top. See the asm contract there.*
- `ksetjmp` (line 667) `int ksetjmp(void *buf) __attribute__((returns_twice));`
- `klongjmp` (line 668) `void klongjmp(void *buf, int val) __attribute__((noreturn));`
- `setup_user_stack` (line 671) `unsigned long *setup_user_stack(char *sbase, unsigned long ssize, int argc, char **argv);`
- `vga_mode_set` (line 673) `void vga_mode_set(int on);`
- `vga_mode_is_active` (line 674) `int vga_mode_is_active(void);`
- `vga_gfx_ran_set` (line 675) `void vga_gfx_ran_set(int on);`
- `desktop_launch` (line 678) `void desktop_launch(const char *cmd);` - */* ========== Execution infrastructure (kernel/exec.c) ========== typedef struct { unsigned long v[8]; } kjmpbuf; int  ksetjmp(void *buf) __attribute__((returns_twice)); void klongjmp(void *buf, int val) __attribute__((noreturn)); extern kjmpbuf exec_return; extern int     exec_exit_code; unsigned long *setup_user_stack(char *sbase, unsigned long ssize, int argc, char **argv); void vga_mode_set(int on); int  vga_mode_is_active(void); void vga_gfx_ran_set(int on); /* ========== Desktop shortcut launch ==========*
- `shell_queue_launch` (line 679) `void shell_queue_launch(const char *cmd);`
- `vga_fb_focus_next` (line 682) `void vga_fb_focus_next(void);` - *void klongjmp(void *buf, int val) __attribute__((noreturn)); extern kjmpbuf exec_return; extern int     exec_exit_code; unsigned long *setup_user_stack(char *sbase, unsigned long ssize, int argc, char **argv); void vga_mode_set(int on); int  vga_mode_is_active(void); void vga_gfx_ran_set(int on); /* ========== Desktop shortcut launch ========== void desktop_launch(const char *cmd); void shell_queue_launch(const char *cmd); /* ========== Multi-window manager (vga_fb.c) ==========*
- `vga_fb_focus_id` (line 683) `int vga_fb_focus_id(int id);`
- `vga_fb_focus_get` (line 684) `int vga_fb_focus_get(void);`
- `vga_fb_nterms_get` (line 685) `int vga_fb_nterms_get(void);`
- `vga_fb_term_split` (line 686) `int vga_fb_term_split(void);`
- `vga_fb_term_close_focused` (line 687) `int vga_fb_term_close_focused(void);`
- `vga_fb_tile_all` (line 688) `void vga_fb_tile_all(void);`
- `vga_fb_list_windows` (line 689) `void vga_fb_list_windows(void);`
- `vga_fb_park_line` (line 690) `void vga_fb_park_line(const char *b, int p);`
- `vga_fb_unpark_line` (line 691) `int vga_fb_unpark_line(char *b, int *p);`
- `vga_fb_set_gfx_program` (line 692) `void vga_fb_set_gfx_program(const char *name);`
- `vga_fb_act_empty` (line 693) `int vga_fb_act_empty(void);`
- `vga_fb_prompt_live` (line 694) `int vga_fb_prompt_live(void);`
- `vga_fb_note_prompt` (line 695) `void vga_fb_note_prompt(void);`
- `vga_fb_clear_prompt` (line 696) `void vga_fb_clear_prompt(void);`
- `vga_fb_prompted` (line 697) `int vga_fb_prompted(void);`
- `shell_readline_active` (line 701) `int shell_readline_active(void);` - *Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c.*
- `shell_focus_park` (line 702) `void shell_focus_park(void);`
- `shell_focus_restore` (line 703) `void shell_focus_restore(void);`
- `user_range_ok` (line 708) `int user_range_ok(unsigned long p, unsigned long len);` - *Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c. int  shell_readline_active(void); void shell_focus_park(void); void shell_focus_restore(void); /** Docstring: Nonzero while the shell blocks in a foreground wait. extern volatile int shell_fg_active; /* ========== User-pointer validation (kernel.c) ==========*
- `user_str_ok` (line 709) `int user_str_ok(unsigned long p, unsigned long maxlen);`
- `mm_setup_protections` (line 712) `void mm_setup_protections(void);` - *Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c. int  shell_readline_active(void); void shell_focus_park(void); void shell_focus_restore(void); /** Docstring: Nonzero while the shell blocks in a foreground wait. extern volatile int shell_fg_active; /* ========== User-pointer validation (kernel.c) ========== int user_range_ok(unsigned long p, unsigned long len); int user_str_ok(unsigned long p, unsigned long maxlen); /* ========== Page table helpers (kernel/mm/paging.c) ==========*
- `pt_page_alloc` (line 713) `void *pt_page_alloc(void);`
- `pt_page_free` (line 714) `void pt_page_free(void *ptr);`
- `mm_user_pte_update` (line 715) `void mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3);`
- `mm_user_set_exec` (line 716) `void mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3);`
- `swap_out` (line 719) `int swap_out(unsigned long window_sz);` - *extern volatile int shell_fg_active; /* ========== User-pointer validation (kernel.c) ========== int user_range_ok(unsigned long p, unsigned long len); int user_str_ok(unsigned long p, unsigned long maxlen); /* ========== Page table helpers (kernel/mm/paging.c) ========== void  mm_setup_protections(void); void *pt_page_alloc(void); void  pt_page_free(void *ptr); void  mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3); void  mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3); /* ========== Swap (kernel/mm/swap.c) ==========*
- `swap_in` (line 720) `int swap_in(void);`
- `elf_load` (line 766) `void *elf_load(void *data, unsigned size, void **base_out);`
- `load_exec_elf` (line 767) `void *load_exec_elf(void *data, unsigned size);` - *Heap/mmap ceiling: the shared-library region starts here with the graphics tail above it, so brk growth and the mmap cursor can reach neither. Replaces bare USER_BRK_END wherever a fresh user view is seeded; the DOOM_BACKBUF_ADDR clamp stays alongside as the graphics * pin, a no-op today and a guard if the region ever moves. #define USER_HEAP_CEIL LDSO_REGION_BASE void *elf_load(void *data, unsigned size, void **base_out);       /* ET_REL relocatable .o*
- `elf_wants_process` (line 768) `int elf_wants_process(const void *data, unsigned size);` - *Heap/mmap ceiling: the shared-library region starts here with the graphics tail above it, so brk growth and the mmap cursor can reach neither. Replaces bare USER_BRK_END wherever a fresh user view is seeded; the DOOM_BACKBUF_ADDR clamp stays alongside as the graphics * pin, a no-op today and a guard if the region ever moves. #define USER_HEAP_CEIL LDSO_REGION_BASE void *elf_load(void *data, unsigned size, void **base_out);       /* ET_REL relocatable .o void *load_exec_elf(void *data, unsigned size);  /* ET_EXEC / ET_DYN*
- `load_exec_elf_into` (line 769) `void *load_exec_elf_into(void *data, unsigned size, unsigned long cr3, unsigned long *brk_out, unsigned long *base_out);` - *Heap/mmap ceiling: the shared-library region starts here with the graphics tail above it, so brk growth and the mmap cursor can reach neither. Replaces bare USER_BRK_END wherever a fresh user view is seeded; the DOOM_BACKBUF_ADDR clamp stays alongside as the graphics * pin, a no-op today and a guard if the region ever moves. #define USER_HEAP_CEIL LDSO_REGION_BASE void *elf_load(void *data, unsigned size, void **base_out);       /* ET_REL relocatable .o void *load_exec_elf(void *data, unsigned size);  /* ET_EXEC / ET_DYN int elf_wants_process(const void *data, unsigned size);  /* process note*
- `ldso_bind_into` (line 778) `int ldso_bind_into(void *data, unsigned size, unsigned long base, unsigned long cr3, vma_ctx_t *vma);` - *Minimal dynamic linker (T8 ld.so, kernel/loader.c). bind_into maps the DT_NEEDED libraries of an already-copied image into the target window (live legacy view when vma is 0 and cr3 is the current one, isolated window otherwise) and resolves its GLOB_DAT slots; the pseudo_* hooks serve registry file bytes to the page-fault path under ldso pseudo * inodes, so text stays shared through the pcache.*
- `ldso_pseudo_stat` (line 780) `int ldso_pseudo_stat(int ino, unsigned long *size_out);`
- `ldso_pseudo_read` (line 781) `int ldso_pseudo_read(int ino, void *dst, unsigned long off, unsigned len);`
- `pt_clone_user_empty` (line 782) `unsigned long pt_clone_user_empty(void);`
- `mm_user_ensure_page` (line 783) `int mm_user_ensure_page(unsigned long cr3, unsigned long va);`
- `mm_user_map_page` (line 784) `int mm_user_map_page(unsigned long cr3, unsigned long va, unsigned long phys, int write, int exec);`
- `mm_file_fault` (line 786) `int mm_file_fault(unsigned long cr3, unsigned long va);`
- `mm_file_break` (line 787) `int mm_file_break(unsigned long cr3, unsigned long va);`
- `mm_file_page_phys` (line 788) `unsigned long mm_file_page_phys(unsigned long cr3, unsigned long va);`
- `mm_file_range_release` (line 789) `void mm_file_range_release(unsigned long cr3, unsigned long base, unsigned long len, int ino, unsigned long off, int unmap);`
- `mm_demand_pte` (line 805) `unsigned long mm_demand_pte(unsigned long prot);` - *Anonymous demand paging (docs/spec/kernel.md): a reserved page is a non-present PTE carrying PTE_DEMAND and the protection the mapping asked for, in bits the MMU ignores while the present bit is clear (bits 0 and 1 stay clear, so every "present" test keeps reading it as absent). The first touch, from ring 3 or a kernel copy into a user buffer, maps a * zeroed page with that protection; PROT_NONE never maps. define PTE_DEMAND        0x200UL define PTE_DEMAND_READ   0x100UL define PTE_DEMAND_WRITE  0x400UL define PTE_DEMAND_EXEC   0x800UL define LINUX_PROT_READ   1UL define LINUX_PROT_WRITE  2UL define LINUX_PROT_EXEC   4UL*
- `mm_anon_reserve` (line 806) `int mm_anon_reserve(unsigned long cr3, unsigned long base, unsigned long len, unsigned long prot);`
- `mm_anon_fault` (line 808) `int mm_anon_fault(unsigned long cr3, unsigned long va, int write);`
- `pt_page_owned` (line 809) `int pt_page_owned(unsigned long phys);`
- `mm_anon_release` (line 810) `void mm_anon_release(unsigned long cr3, unsigned long base, unsigned long len);`
- `cow_drop_ref` (line 811) `int cow_drop_ref(unsigned long phys);`
- `refused` (line 817) `* refused (see kernel/mm/paging.c for the fail-closed list). */ unsigned long kmm_map_device(unsigned long phys, unsigned long len);`
- `kmm_make_uncached` (line 819) `int kmm_make_uncached(unsigned long phys, unsigned long len);`
- `mm_copy_user_page` (line 820) `int mm_copy_user_page(unsigned long dst_cr3, unsigned long src_cr3, unsigned long va);`
- `fault` (line 824) `* fixes one write fault (0 = resume), cow_release_window drops a * dying window's shares ahead of pt_free_user. */ unsigned long cow_fork_window(unsigned long parent_cr3);`
- `cow_resolve` (line 827) `int cow_resolve(unsigned long cr3, unsigned long va);`
- `user_page_present` (line 828) `int user_page_present(unsigned long cr3, unsigned long va);`
- `cow_release_window` (line 829) `void cow_release_window(unsigned long cr3);`
- `cow_shared` (line 830) `int cow_shared(void);`
- `cow_page_shared` (line 831) `int cow_page_shared(unsigned long phys);`
- `syscall_init` (line 834) `void syscall_init(void);` - *Copy-on-write fork (kernel/mm/cow.c): share on fork, privatize on first write. cow_fork_window builds the child window, cow_resolve fixes one write fault (0 = resume), cow_release_window drops a * dying window's shares ahead of pt_free_user. unsigned long cow_fork_window(unsigned long parent_cr3); int cow_resolve(unsigned long cr3, unsigned long va); int user_page_present(unsigned long cr3, unsigned long va); void cow_release_window(unsigned long cr3); int cow_shared(void); int cow_page_shared(unsigned long phys); /* ========== Linux syscall interface ==========*
- `ksyscall` (line 838) `long ksyscall(long n, long a1, long a2, long a3, long a4, long a5, long a6);`
- `syscall_trace_enabled` (line 839) `long syscall_trace_enabled(void);`
- `syscall_trace_set` (line 840) `void syscall_trace_set(int on);`
- `syscall_trace_verbose_enabled` (line 841) `long syscall_trace_verbose_enabled(void);`
- `syscall_trace_verbose_set` (line 842) `void syscall_trace_verbose_set(int on);`
- `syscall_trace_shown` (line 843) `unsigned long syscall_trace_shown(void);`
- `syscall_name` (line 844) `const char *syscall_name(long n);`
- `kfd_get` (line 865) `KFILE *kfd_get(int fd);`
- `kfd_put` (line 866) `void kfd_put(KFILE *f);`
- `kfd_override` (line 867) `KFILE *kfd_override(int fd, KFILE *f);`
- `kpipe_pair` (line 868) `int kpipe_pair(KFILE **rend_out, KFILE **wend_out);`
- `kpipe_empty_wopen` (line 869) `int kpipe_empty_wopen(KFILE *f);`
- `kpipe_is_write_end` (line 870) `int kpipe_is_write_end(KFILE *f);`
- `kpipe_state` (line 873) `int kpipe_state(KFILE *f, unsigned *avail, unsigned *space, int *wopen, int *ropen);` - *Pipe snapshot for poll and the blocking syscall layer: bytes waiting, * free space, writer open, reader open. -1 on a non-pipe file.*
- `kfd_poll_revents` (line 876) `int kfd_poll_revents(int fd);` - *poll(2) readiness bits of a non-socket descriptor (kernel/syscalls.c): * pipes, eventfds, files and the console; POLLNVAL for a closed fd.*
- `kevent_create` (line 882) `KFILE *kevent_create(unsigned long long initval, int semaphore);` - *eventfd(2) descriptions (docs/spec/smp-sched.md): create with an initial counter, read (0 or -EAGAIN when the counter is 0), write (0, -EAGAIN on overflow past KEVENT_MAX, -EINVAL for the all-ones value), and the * readiness poll consults. define KEVENT_MAX 0xfffffffffffffffeULL*
- `kevent_read` (line 883) `long kevent_read(KFILE *f, unsigned long long *out);`
- `kevent_write` (line 884) `long kevent_write(KFILE *f, unsigned long long v);`
- `kevent_readable` (line 885) `int kevent_readable(KFILE *f);`
- `kevent_writable` (line 886) `int kevent_writable(KFILE *f);`
- `fd_lock` (line 889) `* fd_lock (never nested, never held across yields);`
- `ktime_us` (line 913) `unsigned long ktime_us(void);`
- `wall_us_now` (line 914) `unsigned long wall_us_now(void);`
- `bootlog_mark` (line 917) `void bootlog_mark(const char *name);` - *it with pointer subtraction in C (undefined behaviour). The value is a link-time difference, so it is invariant under the KASLR slide: ramdisk_start and ramdisk_end move together inside the contiguous * image span. static inline unsigned long ramdisk_image_size(void) { return (unsigned long)ramdisk_size; } /* ========== Kernel clock ========== unsigned long ktime_ms(void); unsigned long ktime_us(void); unsigned long wall_us_now(void); /* ========== Boot-phase log (kernel.c, `bootlog` builtin) ==========*
- `bootlog_report` (line 918) `void bootlog_report(void);`
- `pcspk_init` (line 921) `void pcspk_init(void);` - *static inline unsigned long ramdisk_image_size(void) { return (unsigned long)ramdisk_size; } /* ========== Kernel clock ========== unsigned long ktime_ms(void); unsigned long ktime_us(void); unsigned long wall_us_now(void); /* ========== Boot-phase log (kernel.c, `bootlog` builtin) ========== void bootlog_mark(const char *name); void bootlog_report(void); /* ========== PC speaker ==========*
- `pcspk_tone` (line 922) `void pcspk_tone(unsigned freq);`
- `pcspk_off` (line 923) `void pcspk_off(void);`
- `pcspk_set_volume` (line 924) `void pcspk_set_volume(unsigned volume);`
- `pcspk_get_volume` (line 925) `unsigned pcspk_get_volume(void);`
- `rtc_read_tod` (line 928) `int rtc_read_tod(int *hour, int *min, int *sec);` - *unsigned long wall_us_now(void); /* ========== Boot-phase log (kernel.c, `bootlog` builtin) ========== void bootlog_mark(const char *name); void bootlog_report(void); /* ========== PC speaker ========== void     pcspk_init(void); void     pcspk_tone(unsigned freq); void     pcspk_off(void); void     pcspk_set_volume(unsigned volume); unsigned pcspk_get_volume(void); /* ========== RTC time-of-day ==========*
- `ide_init` (line 931) `void ide_init(void);` - *void bootlog_mark(const char *name); void bootlog_report(void); /* ========== PC speaker ========== void     pcspk_init(void); void     pcspk_tone(unsigned freq); void     pcspk_off(void); void     pcspk_set_volume(unsigned volume); unsigned pcspk_get_volume(void); /* ========== RTC time-of-day ========== int rtc_read_tod(int *hour, int *min, int *sec); /* ========== IDE driver ==========*
- `ide_read_sectors` (line 932) `int ide_read_sectors(unsigned int lba, unsigned int count, void *buf);`
- `ide_write_sectors` (line 933) `int ide_write_sectors(unsigned int lba, unsigned int count, const void *buf);`
- `ide_read_sector` (line 934) `int ide_read_sector(unsigned int lba, void *buf);`
- `ide_write_sector` (line 935) `int ide_write_sector(unsigned int lba, const void *buf);`
- `ide_total_sectors` (line 936) `unsigned int ide_total_sectors(void);`
- `ide_present` (line 937) `int ide_present(void);`
- `block_init` (line 940) `void block_init(void);` - */* ========== RTC time-of-day ========== int rtc_read_tod(int *hour, int *min, int *sec); /* ========== IDE driver ========== void ide_init(void); int  ide_read_sectors(unsigned int lba, unsigned int count, void *buf); int  ide_write_sectors(unsigned int lba, unsigned int count, const void *buf); int  ide_read_sector(unsigned int lba, void *buf); int  ide_write_sector(unsigned int lba, const void *buf); unsigned int ide_total_sectors(void); int  ide_present(void); /* ========== Block device layer ==========*
- `block_read` (line 941) `int block_read(unsigned int block_num, void *buf);`
- `block_write` (line 942) `int block_write(unsigned int block_num, const void *buf);`
- `block_read_multi` (line 943) `int block_read_multi(unsigned int block_num, unsigned int count, void *buf);`
- `block_write_multi` (line 944) `int block_write_multi(unsigned int block_num, unsigned int count, const void *buf);`
- `block_total` (line 945) `unsigned int block_total(void);`
- `k_user_fault_return` (line 948) `void k_user_fault_return(void);` - *int  ide_read_sector(unsigned int lba, void *buf); int  ide_write_sector(unsigned int lba, const void *buf); unsigned int ide_total_sectors(void); int  ide_present(void); /* ========== Block device layer ========== void block_init(void); int  block_read(unsigned int block_num, void *buf); int  block_write(unsigned int block_num, const void *buf); int  block_read_multi(unsigned int block_num, unsigned int count, void *buf); int  block_write_multi(unsigned int block_num, unsigned int count, const void *buf); unsigned int block_total(void); /* ========== User-mode fault recovery ==========*

**Macros:**
- `KERNEL_H` (line 2) `#define KERNEL_H`
- `EFAULT` (line 4) `#define EFAULT`
- `ALIGN_UP` (line 20) `#define ALIGN_UP(x, a)`
- `PORT_IO_DEFINED` (line 22) `#define PORT_IO_DEFINED`
- `VGA_BASE` (line 90) `#define VGA_BASE`
- `VGA_COLS` (line 91) `#define VGA_COLS`
- `VGA_ROWS` (line 92) `#define VGA_ROWS`
- `KEY_BACKSPACE` (line 138) `#define KEY_BACKSPACE`
- `KEY_ENTER` (line 139) `#define KEY_ENTER`
- `KEY_LSHIFT` (line 140) `#define KEY_LSHIFT`
- `KEY_RSHIFT` (line 141) `#define KEY_RSHIFT`
- `KEY_CAPS` (line 142) `#define KEY_CAPS`
- `KEY_E0` (line 143) `#define KEY_E0`
- `KEY_UP` (line 144) `#define KEY_UP`
- `KEY_DOWN` (line 145) `#define KEY_DOWN`
- `KEY_PGUP` (line 146) `#define KEY_PGUP`
- `KEY_PGDN` (line 147) `#define KEY_PGDN`
- `KEY_ESC` (line 148) `#define KEY_ESC`
- `KEY_CSI` (line 149) `#define KEY_CSI`
- `KEY_ARR_UP` (line 150) `#define KEY_ARR_UP`
- `KEY_ARR_DOWN` (line 151) `#define KEY_ARR_DOWN`
- `KEY_ARR_RIGHT` (line 152) `#define KEY_ARR_RIGHT`
- `KEY_ARR_LEFT` (line 153) `#define KEY_ARR_LEFT`
- `KEY_HOME_SEQ` (line 154) `#define KEY_HOME_SEQ`
- `KEY_END_SEQ` (line 155) `#define KEY_END_SEQ`
- `KEY_PGUP_SEQ` (line 156) `#define KEY_PGUP_SEQ`
- `KEY_PGDN_SEQ` (line 157) `#define KEY_PGDN_SEQ`
- `KEY_LEFT` (line 158) `#define KEY_LEFT`
- `KEY_RIGHT` (line 159) `#define KEY_RIGHT`
- `KEY_LCTRL` (line 160) `#define KEY_LCTRL`
- `KEY_RCTRL` (line 161) `#define KEY_RCTRL`
- `KEY_F5` (line 162) `#define KEY_F5`
- `KEY_F11` (line 163) `#define KEY_F11`
- `KEY_TILDE` (line 164) `#define KEY_TILDE`
- `KEY_LALT` (line 165) `#define KEY_LALT`
- `KEY_RALT` (line 166) `#define KEY_RALT`
- `KEY_HOME` (line 167) `#define KEY_HOME`
- `KEY_END` (line 168) `#define KEY_END`
- `KEY_TAB` (line 169) `#define KEY_TAB`
- `KEY_SUPER_L` (line 170) `#define KEY_SUPER_L`
- `KEY_SUPER_R` (line 171) `#define KEY_SUPER_R`
- `USER_LOAD_BASE` (line 185) `#define USER_LOAD_BASE`
- `USER_LOAD_END` (line 186) `#define USER_LOAD_END`
- `USER_STACK_SIZE` (line 187) `#define USER_STACK_SIZE`
- `USER_STACK_TOP` (line 188) `#define USER_STACK_TOP`
- `USER_STACK_BASE` (line 189) `#define USER_STACK_BASE`
- `USER_BRK_END` (line 190) `#define USER_BRK_END`
- `LDSO_REGION_BASE` (line 194) `#define LDSO_REGION_BASE`
- `LDSO_REGION_SIZE` (line 195) `#define LDSO_REGION_SIZE`
- `LDSO_REGION_END` (line 196) `#define LDSO_REGION_END`
- `SYS_KSTK_TOP` (line 201) `#define SYS_KSTK_TOP`
- `SYS_KSTK_BASE` (line 202) `#define SYS_KSTK_BASE`
- `HEAP_BASE` (line 204) `#define HEAP_BASE`
- `HEAP_SIZE` (line 205) `#define HEAP_SIZE`
- `DEV_MMIO_VBASE` (line 210) `#define DEV_MMIO_VBASE`
- `PCI_MMIO_SIZE` (line 211) `#define PCI_MMIO_SIZE`
- `KMALLOC_PAGE` (line 220) `#define KMALLOC_PAGE`
- `RAMDISK_MAX_FILES` (line 269) `#define RAMDISK_MAX_FILES`
- `RAMDISK_FNAME_LEN` (line 279) `#define RAMDISK_FNAME_LEN`
- `RD_DATA_MAX` (line 305) `#define RD_DATA_MAX`
- `ETREL_TRUSTED_DIR` (line 322) `#define ETREL_TRUSTED_DIR`
- `ETREL_TRUSTED_LEN` (line 323) `#define ETREL_TRUSTED_LEN`
- `VFS_NAME_MAX` (line 382) `#define VFS_NAME_MAX`
- `VFS_MAX_MOUNTS` (line 419) `#define VFS_MAX_MOUNTS`
- `VFS_PREFIX_LEN` (line 420) `#define VFS_PREFIX_LEN`
- `VFS_DRIVER_LEN` (line 421) `#define VFS_DRIVER_LEN`
- `EOF` (line 468) `#define EOF`
- `ENOENT` (line 509) `#define ENOENT`
- `EIO` (line 510) `#define EIO`
- `EBADF` (line 511) `#define EBADF`
- `ENOMEM` (line 512) `#define ENOMEM`
- `ENOTDIR` (line 513) `#define ENOTDIR`
- `EISDIR` (line 514) `#define EISDIR`
- `EINVAL` (line 515) `#define EINVAL`
- `EFBIG` (line 516) `#define EFBIG`
- `ENOSPC` (line 517) `#define ENOSPC`
- `ESPIPE` (line 518) `#define ESPIPE`
- `ENAMETOOLONG` (line 519) `#define ENAMETOOLONG`
- `KSYM_MAX` (line 624) `#define KSYM_MAX`
- `KPROG_MAX` (line 625) `#define KPROG_MAX`
- `EI_NIDENT` (line 730) `#define EI_NIDENT`
- `ET_REL` (line 755) `#define ET_REL`
- `ET_EXEC` (line 756) `#define ET_EXEC`
- `ET_DYN` (line 757) `#define ET_DYN`
- `USER_HEAP_CEIL` (line 764) `#define USER_HEAP_CEIL`
- `PTE_DEMAND` (line 798) `#define PTE_DEMAND`
- `PTE_DEMAND_READ` (line 799) `#define PTE_DEMAND_READ`
- `PTE_DEMAND_WRITE` (line 800) `#define PTE_DEMAND_WRITE`
- `PTE_DEMAND_EXEC` (line 801) `#define PTE_DEMAND_EXEC`
- `LINUX_PROT_READ` (line 802) `#define LINUX_PROT_READ`
- `LINUX_PROT_WRITE` (line 803) `#define LINUX_PROT_WRITE`
- `LINUX_PROT_EXEC` (line 804) `#define LINUX_PROT_EXEC`
- `KFD_MAX` (line 845) `#define KFD_MAX`
- `KEVENT_MAX` (line 881) `#define KEVENT_MAX`

**Structs:**
- `vfs_dirent` (line 383) - *Docstring: one directory entry behind the readdir verb. Defined * before vfs_ops_t so the verb names the type directly. define VFS_NAME_MAX 255*
- `vfs_ops` (line 388)
- `vfs_file` (line 398)
- `kfd_view` (line 855) - *Docstring: Per-process file-descriptor view.  Each process owns one view (heap-allocated, shared on CLONE_FILES with a refcount, deep-copied on fork/spawn/exec-parent with one KFILE ref bump per live entry). f[fd] is the table; cloexec carries one close-on-exec bit per fd; ref counts view owners (never the entries: those keep their own KFILE ref). The shell and every pid without its own view (pid 0, AP idle) use the static root view, which is never * freed. All membership mutates only under fd_lock.*
- `RDFile` (line 281)
- `KFILE` (line 470)
- `KSym` (line 627)
- `KProg` (line 632)
- `kjmpbuf` (line 666) - *ET_REL stack switch (arch/x86/ctx_sw.S): runs entry(argc, argv) on * the 64 KB stack ending at stack_top. See the asm contract there. int  k_run_on_stack(void *stack_top, prog_entry_t entry, int argc, char **argv); /* ========== Execution infrastructure (kernel/exec.c) ==========*
- `Elf64_Ehdr` (line 738)

**Type_Aliases:**
- `name` (line 383) `typedef struct vfs_dirent { char name[VFS_NAME_MAX + 1];` - *Docstring: one directory entry behind the readdir verb. Defined * before vfs_ops_t so the verb names the type directly. define VFS_NAME_MAX 255*
- `file_operations` (line 414) `typedef vfs_ops_t file_operations;` - *Facade aliases (thesis correction 2B, 4.4BSD/Linux vnode model): vfs_ops_t IS the file_operations table, and vnode is the object it operates on. New code uses these names; vfs_ops_t/vfs_file_t remain as compat aliases. Open/Closed Principle: adding a filesystem means registering a new ops table, never editing a dispatch cascade. No caller branches on which filesystem backs a handle; vfs_read/write/close/fstat dispatch purely * through ops.*
- `vnode_t` (line 415) `typedef vfs_file_t vnode_t;`
- `Elf64_Addr` (line 731) `typedef unsigned long long Elf64_Addr;` - */* ========== Swap (kernel/mm/swap.c) ========== int   swap_out(unsigned long window_sz); int   swap_in(void); /* brk/mmap globals (loader.c) extern unsigned long g_brk; extern unsigned long g_brk_limit; extern unsigned long user_mmap_cur; /* ========== ELF loader (loader.c) ========== /* Minimal ELF64 definitions (used by shell_load, shell_run_elf_buf, SPAWN) define EI_NIDENT 16*
- `Elf64_Off` (line 732) `typedef unsigned long long Elf64_Off;`
- `Elf64_Word` (line 733) `typedef unsigned int Elf64_Word;`
- `Elf64_Half` (line 734) `typedef unsigned short Elf64_Half;`
- `Elf64_Xword` (line 735) `typedef unsigned long long Elf64_Xword;`
- `Elf64_Sxword` (line 736) `typedef long long Elf64_Sxword;`

**Variables:**
- `console_lock` (line 105) `extern spinlock_t console_lock;` - *Console output lock (kernel/console.c): serializes SMP console output across CPUs. Held across the whole vga_putc body; try-or-race so an ISR * dump prints rather than deadlocks on a lock held by interrupted context.*
- `ser_e_cpu` (line 133) `extern unsigned long ser_e_ra, ser_e_cpu;` - */* ========== Scrollback ring (kernel/scrollback.c) ========== void sb_init(void); void sb_capture_row0(void); void sb_reset(void); int  sb_get_count(void); int  sb_get_head(void); char sb_get_char(int row, int col); /* ========== Serial console (COM1) ========== void serial_init(void); void serial_putc(char c); void serial_puts(const char *s); void sc_record_dump(int pid); unsigned long serial_e_count(void);          /* E-flood tracer (serial.c)*
- `kmalloc_fail_after` (line 214) `extern long kmalloc_fail_after;`
- `kheap_size` (line 229) `extern unsigned long kheap_size;` - *Bytes of kernel heap actually in use as the dlmalloc space: HEAP_SIZE * clamped to the RAM installed above HEAP_BASE.*
- `fs_cwd` (line 434) `extern char fs_cwd[];`
- `kerrno` (line 521) `extern int kerrno;` - *Guarded: host test TUs include system headers beside kernel.h. ifndef ENOENT define ENOENT 2 define EIO 5 define EBADF 9 define ENOMEM 12 define ENOTDIR 20 define EISDIR 21 define EINVAL 22 define EFBIG 27 define ENOSPC 28 define ESPIPE 29 define ENAMETOOLONG 36 endif*
- `kstdin` (line 537) `extern KFILE *kstdin;`
- `kstdout` (line 538) `extern KFILE *kstdout;`
- `kstderr` (line 539) `extern KFILE *kstderr;`
- `ksym_table` (line 639) `extern KSym ksym_table[];`
- `ksym_count` (line 640) `extern int ksym_count;`
- `kprog_table` (line 641) `extern KProg kprog_table[];`
- `kprog_count` (line 642) `extern int kprog_count;`
- `exec_return` (line 669) `extern kjmpbuf exec_return;`
- `exec_exit_code` (line 670) `extern int exec_exit_code;`
- `shell_fg_active` (line 705) `extern volatile int shell_fg_active;` - *Shell side of window focus: park/restore the half-typed input line so it * travels with its window. Implemented in shell.c, called from vga_fb.c. int  shell_readline_active(void); void shell_focus_park(void); void shell_focus_restore(void); /** Docstring: Nonzero while the shell blocks in a foreground wait.*
- `g_brk` (line 723) `extern unsigned long g_brk;` - *int user_str_ok(unsigned long p, unsigned long maxlen); /* ========== Page table helpers (kernel/mm/paging.c) ========== void  mm_setup_protections(void); void *pt_page_alloc(void); void  pt_page_free(void *ptr); void  mm_user_pte_update(unsigned long vaddr, int exec, unsigned long cr3); void  mm_user_set_exec(unsigned long start, unsigned long end, unsigned long cr3); /* ========== Swap (kernel/mm/swap.c) ========== int   swap_out(unsigned long window_sz); int   swap_in(void); /* brk/mmap globals (loader.c)*
- `g_brk_limit` (line 724) `extern unsigned long g_brk_limit;`
- `user_mmap_cur` (line 725) `extern unsigned long user_mmap_cur;`
- `fd_lock` (line 864) `extern spinlock_t fd_lock;` - *Leaf lock for every view's membership plus KFILE refcounts (never nested, never held across yields); heavy IO may delay a tick, which beats torn metadata. Lock order: sched_lock -> fd_lock (views are * attached under sched_lock, mutated under fd_lock alone).*
- `fs_lock` (line 891) `extern spinlock_t fs_lock;` - *Big filesystem lock, defined in fs/kfile.c: serializes whole kf* bodies plus unlink and dir_list against each other. Leaf like fd_lock (never nested, never held across yields); heavy IO may * delay a tick, which beats torn metadata.*
- `kernel_end` (line 894) `extern unsigned long kernel_end;` - *Big filesystem lock, defined in fs/kfile.c: serializes whole kf* bodies plus unlink and dir_list against each other. Leaf like fd_lock (never nested, never held across yields); heavy IO may * delay a tick, which beats torn metadata. extern spinlock_t fs_lock; /* ========== Kernel info ==========*
- `ramdisk_start` (line 895) `extern char ramdisk_start[];`
- `ramdisk_end` (line 896) `extern char ramdisk_end[];`
- `ramdisk_size` (line 897) `extern char ramdisk_size[];`

#### `ktime.h`
**Path:** `headers/ktime.h`
**File Doc:** *ktime.h -- pure time-conversion helpers shared by the kernel clock*

**Functions:**
- `ktime_us_from_delta` (line 19) `static inline unsigned long ktime_us_from_delta(unsigned long delta_ticks,
                      ...`
- `wall_us_from_parts` (line 30) `static inline unsigned long wall_us_from_parts(unsigned long base_sec,
                          ...` - *wall_us_from_parts: wall-clock microseconds from an RTC-anchored base. base_sec is the last seen RTC second, base_ktime_us the monotonic clock then, now_ktime_us the monotonic clock now. Pure so the host * suite pins the rollover math; the kernel feeds it live values.*

**Macros:**
- `KTIME_H` (line 2) `#define KTIME_H`

#### `ldso.h`
**Path:** `headers/ldso.h`
**File Doc:** *Docstring: headers/ldso.h -- minimal dynamic-linking (T8 ld.so) contract.*

**Functions:**
- `ldso_find_dynamic` (line 86) `int ldso_find_dynamic(const unsigned char *file, unsigned long long fsize, unsigned long long *dyn_off, unsigned long long *dyn_size);` - *Docstring: Locate the PT_DYNAMIC file range. Returns 1 with offsets on success, 0 when the image carries no dynamic section (static binary, * not an error), -1 when any header, count or bound is corrupt.*
- `ldso_vaddr_to_offset` (line 92) `int ldso_vaddr_to_offset(const unsigned char *file, unsigned long long fsize, unsigned long long va, unsigned long long *off);` - *Docstring: Translate a link VA through PT_LOAD into a file offset. Returns 0 with the offset on success, -1 when no segment contains it * or any arithmetic overflows.*
- `ldso_segments` (line 97) `int ldso_segments(const unsigned char *file, unsigned long long fsize, LdsoSeg *segs, unsigned ncap, unsigned *nseg);` - *Docstring: Collect PT_LOAD spans (at most ncap) for reservation and * GOT-range checks. Returns 0 with the count, -1 on corrupt headers.*
- `ldso_scan_dynamic` (line 103) `int ldso_scan_dynamic(const unsigned char *file, unsigned long long fsize, unsigned long long dyn_off, unsigned long long dyn_size, LdsoDynInfo *info);` - *Docstring: Walk the dynamic array into info. Caps entries at LDSO_MAX_DYN, keeps the first SONAME, records up to LDSO_MAX_NEEDED * NEEDED offsets. Returns 0 on success, -1 on truncation or overflow.*
- `ldso_sym_count` (line 110) `int ldso_sym_count(const unsigned char *file, unsigned long long fsize, unsigned long long hash_off, unsigned *nsyms);` - *Docstring: Read the SYSV hash header at a file offset into bucket and chain counts. The chain count is the dynamic symbol count. Returns 0 * on success, -1 when the table is truncated or claims no symbols.*
- `ldso_copy_str` (line 116) `int ldso_copy_str(const unsigned char *file, unsigned long long fsize, unsigned long long strtab_off, unsigned long long strsz, unsigned long long name_off, char *out, unsigned out_cap);` - *Docstring: Bounded copy of one dynamic string (NEEDED/SONAME/symbol). The NUL must land inside strsz. Returns 0 with a terminated buffer, * -1 on any out-of-range offset or missing terminator.*
- `ldso_sym_lookup` (line 124) `int ldso_sym_lookup(const unsigned char *file, unsigned long long fsize, unsigned long long symtab_off, unsigned nsyms, unsigned long long strtab_off, unsigned long long strsz, const char *name, unsig` - *Docstring: Linear search of a dynamic symbol table by name. Accepts GLOBAL FUNC/NOTYPE definitions only (v1 links functions, nothing else). Returns 1 with st_value on hit, 0 on clean miss, -1 on any * corrupt table bound.*
- `ldso_rela_count` (line 132) `int ldso_rela_count(const LdsoDynInfo *info, unsigned *nrela);` - *Docstring: Validate the RELA header triple and report the row count. Only 24-byte entries are supported (v1 emits exactly those). * Returns 0 with the count, -1 on any mismatch or overflow.*
- `ldso_read_rela` (line 137) `int ldso_read_rela(const unsigned char *file, unsigned long long fsize, unsigned long long rela_off, unsigned nrela, unsigned idx, unsigned nsyms, LdsoRelaRow *row);` - *Docstring: Read one RELA row with full validation: row inside the table, type GLOB_DAT/JUMP_SLOT (anything else is -2, unsupported), * symbol index below nsyms. Returns 0 on success.*
- `ldso_basename` (line 144) `void ldso_basename(char *out, const char *src);` - *Docstring: Basename normalization for registry keys ("a/b.so" to "b.so", bounded, always terminated). Two spellings of one library * share one registry slot and one load.*

**Macros:**
- `LDSO_H` (line 15) `#define LDSO_H`
- `LDSO_MAX_LIBS` (line 17) `#define LDSO_MAX_LIBS`
- `LDSO_MAX_NEEDED` (line 18) `#define LDSO_MAX_NEEDED`
- `LDSO_NAME_LEN` (line 19) `#define LDSO_NAME_LEN`
- `LDSO_MAX_DYN` (line 20) `#define LDSO_MAX_DYN`
- `LDSO_FILE_MAX` (line 21) `#define LDSO_FILE_MAX`
- `LDSO_INO_BASE` (line 22) `#define LDSO_INO_BASE`
- `LDSO_ET_EXEC` (line 24) `#define LDSO_ET_EXEC`
- `LDSO_ET_DYN` (line 25) `#define LDSO_ET_DYN`
- `LDSO_EM_X86_64` (line 26) `#define LDSO_EM_X86_64`
- `LDSO_PT_LOAD` (line 27) `#define LDSO_PT_LOAD`
- `LDSO_PT_DYNAMIC` (line 28) `#define LDSO_PT_DYNAMIC`
- `LDSO_PF_X` (line 29) `#define LDSO_PF_X`
- `LDSO_DT_NULL` (line 31) `#define LDSO_DT_NULL`
- `LDSO_DT_NEEDED` (line 32) `#define LDSO_DT_NEEDED`
- `LDSO_DT_HASH` (line 33) `#define LDSO_DT_HASH`
- `LDSO_DT_STRTAB` (line 34) `#define LDSO_DT_STRTAB`
- `LDSO_DT_SYMTAB` (line 35) `#define LDSO_DT_SYMTAB`
- `LDSO_DT_RELA` (line 36) `#define LDSO_DT_RELA`
- `LDSO_DT_RELASZ` (line 37) `#define LDSO_DT_RELASZ`
- `LDSO_DT_RELAENT` (line 38) `#define LDSO_DT_RELAENT`
- `LDSO_DT_STRSZ` (line 39) `#define LDSO_DT_STRSZ`
- `LDSO_DT_SYMENT` (line 40) `#define LDSO_DT_SYMENT`
- `LDSO_DT_SONAME` (line 41) `#define LDSO_DT_SONAME`
- `LDSO_R_GLOB_DAT` (line 43) `#define LDSO_R_GLOB_DAT`
- `LDSO_R_JUMP_SLOT` (line 44) `#define LDSO_R_JUMP_SLOT`
- `LDSO_STB_GLOBAL` (line 46) `#define LDSO_STB_GLOBAL`
- `LDSO_STT_NOTYPE` (line 47) `#define LDSO_STT_NOTYPE`
- `LDSO_STT_FUNC` (line 48) `#define LDSO_STT_FUNC`
- `LDSO_SHN_UNDEF` (line 49) `#define LDSO_SHN_UNDEF`
- `LDSO_SYM_SIZE` (line 50) `#define LDSO_SYM_SIZE`
- `LDSO_RELA_SIZE` (line 51) `#define LDSO_RELA_SIZE`

**Structs:**
- `LdsoSeg` (line 53)
- `LdsoDynInfo` (line 61)
- `LdsoRelaRow` (line 77)

#### `leakcheck.h`
**Path:** `headers/leakcheck.h`
**File Doc:** *Docstring: allocation tracker for MiniOS, STB leakcheck lineage.*

**Functions:**
- `lk_malloc` (line 96) `void *lk_malloc(size_t size, const char *file, int line)` - *#define MINIOS_LK_RAW_ALLOC(sz) kmalloc((unsigned long)(sz)) #define MINIOS_LK_RAW_FREE(p) kfree(p) #else #include <stdlib.h> #include <stdio.h> #include <string.h> #define MINIOS_LK_RAW_ALLOC(sz) malloc(sz) #define MINIOS_LK_RAW_FREE(p) free(p) #endif /** Docstring: head of the live-block list, newest allocation first. static lk_block_t *lk_head; /** Docstring: tracked malloc, records caller file and line.*
- `lk_unlink` (line 110) `static void lk_unlink(lk_block_t *b)` - *void *lk_malloc(size_t size, const char *file, int line) { lk_block_t *b = (lk_block_t *)MINIOS_LK_RAW_ALLOC(size + sizeof(*b)); if (b == 0) return 0; b->file = file; b->line = line; b->size = size; b->next = lk_head; b->prev = 0; if (lk_head) lk_head->prev = b; lk_head = b; return b + 1; } /** Docstring: unlink one record from the live-block list.*
- `lk_find` (line 120) `static lk_block_t *lk_find(void *ptr)` - *return b + 1; } /** Docstring: unlink one record from the live-block list. static void lk_unlink(lk_block_t *b) { if (b->prev == 0) { lk_head = b->next; } else { b->prev->next = b->next; } if (b->next) b->next->prev = b->prev; } /** Docstring: find the record owning ptr by scanning for its payload base.*
- `lk_free` (line 130) `void lk_free(void *ptr)` - *if (b->next) b->next->prev = b->prev; } /** Docstring: find the record owning ptr by scanning for its payload base. static lk_block_t *lk_find(void *ptr) { lk_block_t *b = lk_head; while (b) { if ((void *)(b + 1) == ptr) return b; b = b->next; } return 0; } /** Docstring: tracked free, passes unknown blocks to the raw backend.*
- `lk_realloc` (line 143) `void *lk_realloc(void *ptr, size_t size, const char *file, int line)` - */** Docstring: tracked free, passes unknown blocks to the raw backend. void lk_free(void *ptr) { lk_block_t *b; if (ptr == 0) return; b = lk_find(ptr); if (b == 0) { MINIOS_LK_RAW_FREE(ptr); return; } lk_unlink(b); MINIOS_LK_RAW_FREE(b); } /** Docstring: tracked realloc, preserves bytes across a tracked move.*
- `lk_print` (line 186) `static void lk_print(const char *reason, const lk_block_t *b)` - *return ptr; } q = lk_malloc(size, file, line); if (q) { d = (unsigned char *)q; s = (unsigned char *)ptr; keep = b->size; for (k = 0; k < keep; k++) d[k] = s[k]; lk_free(ptr); } return q; } /** Docstring: print one live record on the configured pipe.*
- `lk_dumpmem` (line 197) `void lk_dumpmem(void)` - *} /** Docstring: print one live record on the configured pipe. static void lk_print(const char *reason, const lk_block_t *b) { #ifdef MINIOS_LK_KERNEL kprintf("%s: %s (%d): %lu bytes\n", reason, b->file, b->line, (unsigned long)b->size); #else fprintf(MINIOS_LK_PIPE, "%s: %s (%d): %lu bytes at %p\n", reason, b->file, b->line, (unsigned long)b->size, (const void *)(b + 1)); #endif } /** Docstring: report every block still live, newest first.*
- `lk_live_count` (line 206) `unsigned long lk_live_count(void)` - *b->file, b->line, (unsigned long)b->size, (const void *)(b + 1)); #endif } /** Docstring: report every block still live, newest first. void lk_dumpmem(void) { lk_block_t *b = lk_head; while (b) { lk_print("LEAKED", b); b = b->next; } } /** Docstring: count of blocks still live.*
- `lk_live_bytes` (line 217) `unsigned long lk_live_bytes(void)` - *} /** Docstring: count of blocks still live. unsigned long lk_live_count(void) { unsigned long n = 0; lk_block_t *b = lk_head; while (b) { n++; b = b->next; } return n; } /** Docstring: payload bytes still live.*
- `kmalloc` (line 79) `extern void *kmalloc(unsigned long size);` - *ifdef MINIOS_LK_KERNEL*
- `kfree` (line 80) `extern void kfree(void *ptr);`
- `kprintf` (line 81) `extern int kprintf(const char *fmt, ...);`

**Macros:**
- `MINIOS_LEAKCHECK_H` (line 28) `#define MINIOS_LEAKCHECK_H`
- `MINIOS_LK_PIPE` (line 42) `#define MINIOS_LK_PIPE`
- `MINIOS_LK_PIPE` (line 44) `#define MINIOS_LK_PIPE`
- `MINIOS_LK_RAW_ALLOC` (line 82) `#define MINIOS_LK_RAW_ALLOC(sz)`
- `MINIOS_LK_RAW_FREE` (line 83) `#define MINIOS_LK_RAW_FREE(p)`
- `MINIOS_LK_RAW_ALLOC` (line 88) `#define MINIOS_LK_RAW_ALLOC(sz)`
- `MINIOS_LK_RAW_FREE` (line 89) `#define MINIOS_LK_RAW_FREE(p)`
- `malloc` (line 235) `#define malloc(sz)`
- `free` (line 236) `#define free(p)`
- `realloc` (line 237) `#define realloc(p, sz)`

**Structs:**
- `lk_block` (line 50)

**Type_Aliases:**
- `lk_block_t` (line 49) `typedef struct lk_block lk_block_t;` - *#ifndef MINIOS_LK_KERNEL #include <stdlib.h> #include <stdio.h> #endif #ifndef MINIOS_LK_PIPE #ifdef MINIOS_LK_KERNEL #define MINIOS_LK_PIPE 0 #else #define MINIOS_LK_PIPE stdout #endif #endif /** Docstring: one live allocation record, intrusive list node.*

#### `lz4_kernel.h`
**Path:** `headers/lz4_kernel.h`

**Functions:**
- `LZ4_compress_default` (line 4) `int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity);`
- `LZ4_compressBound` (line 5) `int LZ4_compressBound(int inputSize);`
- `LZ4_decompress_safe` (line 6) `int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity);`

**Macros:**
- `LZ4_KERNEL_H` (line 2) `#define LZ4_KERNEL_H`

#### `minifetch.h`
**Path:** `headers/minifetch.h`
**File Doc:** *Docstring: minifetch.h -- neofetch-style system screen contract.*

**Functions:**
- `shell_cmd_minifetch` (line 14) `void shell_cmd_minifetch(void);`

**Macros:**
- `MINIFETCH_H` (line 12) `#define MINIFETCH_H`

#### `minifs.h`
**Path:** `headers/minifs.h`
**File Doc:** *MiniFS: a minimal Unix-like filesystem for MiniOS.*

**Functions:**
- `minifs_compress` (line 30) `unsigned int minifs_compress(const void *src, unsigned int src_len, void *dst, unsigned int dst_cap);`
- `minifs_decompress` (line 31) `unsigned int minifs_decompress(const void *src, unsigned int src_len, void *dst, unsigned int dst_cap);`
- `minifs_init` (line 117) `void minifs_init(void);`
- `minifs_mount` (line 118) `int minifs_mount(void);`
- `minifs_sync` (line 119) `int minifs_sync(void);`
- `minifs_is_mounted` (line 120) `int minifs_is_mounted(void);`
- `minifs_create` (line 122) `int minifs_create(const char *path, unsigned short mode);`
- `minifs_mkdir` (line 123) `int minifs_mkdir(const char *path, unsigned short mode);`
- `minifs_unlink` (line 124) `int minifs_unlink(const char *path);`
- `minifs_rmdir` (line 125) `int minifs_rmdir(const char *path);`
- `refuses` (line 128) `* An existing file dst refuses (no silent overwrite);`
- `minifs_rename` (line 130) `int minifs_rename(const char *oldpath, const char *newpath);` - *Docstring: Move one MiniFS directory entry to a new parent/name, keeping its inode (no data moves). Files only; directories refuse. An existing file dst refuses (no silent overwrite); a missing dst * parent refuses. Returns 0 on success, -1 on any failure.*
- `minifs_read` (line 131) `int minifs_read(int inode_num, void *buf, unsigned int offset, unsigned int len);`
- `minifs_write` (line 132) `int minifs_write(int inode_num, const void *buf, unsigned int offset, unsigned int len);`
- `minifs_truncate` (line 133) `int minifs_truncate(int inode_num, unsigned int new_size);`
- `minifs_stat` (line 134) `int minifs_stat(int inode_num, MiniFSInode *out);`
- `minifs_access` (line 135) `int minifs_access(const char *path);`
- `minifs_resolve_path` (line 137) `int minifs_resolve_path(const char *path);`
- `minifs_dir_lookup` (line 138) `int minifs_dir_lookup(int dir_inode, const char *name);`
- `minifs_dir_add_entry` (line 139) `int minifs_dir_add_entry(int dir_inode, const char *name, int child_inode, unsigned char type);`
- `minifs_dir_remove_entry` (line 140) `int minifs_dir_remove_entry(int dir_inode, const char *name);`
- `minifs_dir_read` (line 141) `int minifs_dir_read(int dir_inode, int index, MiniFSDirEntry *out, char *name_out);`
- `minifs_alloc_block` (line 143) `int minifs_alloc_block(void);`
- `minifs_free_block` (line 144) `void minifs_free_block(unsigned int block);`
- `minifs_alloc_inode` (line 145) `int minifs_alloc_inode(void);`
- `minifs_free_inode` (line 146) `void minifs_free_inode(int inode_num);`
- `minifs_inode_get_block` (line 147) `int minifs_inode_get_block(MiniFSInode *inode, unsigned int logical_block, unsigned int *phys_block);`
- `minifs_inode_alloc_block` (line 148) `int minifs_inode_alloc_block(MiniFSInode *inode, unsigned int logical_block);`
- `minifs_journal_begin` (line 150) `void minifs_journal_begin(unsigned int txn_id);`
- `minifs_journal_add_block` (line 151) `void minifs_journal_add_block(unsigned int block);`
- `minifs_journal_touch` (line 152) `void minifs_journal_touch(unsigned int phys);`
- `minifs_journal_commit` (line 153) `int minifs_journal_commit(unsigned int txn_id);`
- `minifs_journal_clear` (line 154) `void minifs_journal_clear(void);`
- `minifs_journal_abort` (line 155) `void minifs_journal_abort(void);`
- `minifs_journal_recover` (line 156) `void minifs_journal_recover(void);`
- `minifs_file_open` (line 158) `MiniFSFile *minifs_file_open(int inode_num, int flags);`
- `minifs_file_close` (line 159) `int minifs_file_close(MiniFSFile *f);`
- `minifs_get_lba_start` (line 161) `unsigned int minifs_get_lba_start(void);`
- `minifs_get_total_blocks` (line 162) `unsigned int minifs_get_total_blocks(void);`
- `minifs_usage` (line 164) `void minifs_usage(unsigned int *free_b, unsigned int *total_b, unsigned int *free_i, unsigned int *total_i);` - *void minifs_journal_begin(unsigned int txn_id); void minifs_journal_add_block(unsigned int block); void minifs_journal_touch(unsigned int phys); int  minifs_journal_commit(unsigned int txn_id); void minifs_journal_clear(void); void minifs_journal_abort(void); void minifs_journal_recover(void); MiniFSFile *minifs_file_open(int inode_num, int flags); int  minifs_file_close(MiniFSFile *f); unsigned int minifs_get_lba_start(void); unsigned int minifs_get_total_blocks(void); /** Docstring: Filesystem usage snapshot for the mem builtin.*

**Macros:**
- `MINIFS_H` (line 2) `#define MINIFS_H`
- `MINIFS_MAGIC` (line 8) `#define MINIFS_MAGIC`
- `MINIFS_VERSION` (line 9) `#define MINIFS_VERSION`
- `MINIFS_BLOCK_SIZE` (line 10) `#define MINIFS_BLOCK_SIZE`
- `MINIFS_MAX_FILENAME` (line 11) `#define MINIFS_MAX_FILENAME`
- `MINIFS_ROOT_INODE` (line 12) `#define MINIFS_ROOT_INODE`
- `MINIFS_INODES_PER_BLOCK` (line 13) `#define MINIFS_INODES_PER_BLOCK`
- `MINIFS_DIR_ENTRIES_PER_BLOCK` (line 14) `#define MINIFS_DIR_ENTRIES_PER_BLOCK`
- `MINIFS_S_IFMT` (line 16) `#define MINIFS_S_IFMT`
- `MINIFS_S_IFREG` (line 17) `#define MINIFS_S_IFREG`
- `MINIFS_S_IFDIR` (line 18) `#define MINIFS_S_IFDIR`
- `MINIFS_S_IFLNK` (line 19) `#define MINIFS_S_IFLNK`
- `MINIFS_S_IRWXU` (line 20) `#define MINIFS_S_IRWXU`
- `MINIFS_S_IRWXG` (line 21) `#define MINIFS_S_IRWXG`
- `MINIFS_S_IRWXO` (line 22) `#define MINIFS_S_IRWXO`
- `MINIFS_FT_FILE` (line 24) `#define MINIFS_FT_FILE`
- `MINIFS_FT_DIR` (line 25) `#define MINIFS_FT_DIR`
- `MINIFS_FT_SYMLINK` (line 26) `#define MINIFS_FT_SYMLINK`
- `MINIFS_INODE_COMPRESSED` (line 28) `#define MINIFS_INODE_COMPRESSED`
- `MINIFS_DIR_ENTRY_HDR_SIZE` (line 75) `#define MINIFS_DIR_ENTRY_HDR_SIZE`
- `MINIFS_JOURNAL_BLOCKS` (line 77) `#define MINIFS_JOURNAL_BLOCKS`
- `MINIFS_JOURNAL_MAX_ENTRIES` (line 78) `#define MINIFS_JOURNAL_MAX_ENTRIES`
- `MINIFS_JOP_WRITE` (line 79) `#define MINIFS_JOP_WRITE`
- `MINIFS_JOP_CREATE` (line 80) `#define MINIFS_JOP_CREATE`
- `MINIFS_JOP_DELETE` (line 81) `#define MINIFS_JOP_DELETE`
- `MINIFS_JOP_MKDIR` (line 82) `#define MINIFS_JOP_MKDIR`
- `MINIFS_JOP_RMDIR` (line 83) `#define MINIFS_JOP_RMDIR`
- `MINIFS_JOP_TRUNCATE` (line 84) `#define MINIFS_JOP_TRUNCATE`
- `MINIFS_JOP_COMMIT` (line 85) `#define MINIFS_JOP_COMMIT`
- `MINIFS_JSTATE_CLEAN` (line 87) `#define MINIFS_JSTATE_CLEAN`
- `MINIFS_JSTATE_DIRTY` (line 88) `#define MINIFS_JSTATE_DIRTY`

**Structs:**
- `MiniFSSuper` (line 33)
- `MiniFSInode` (line 52)
- `MiniFSDirEntry` (line 68)
- `MiniFSJournalSuper` (line 90)
- `MiniFSJournalEntry` (line 98)
- `MiniFSFile` (line 110)

#### `rtl8139.h`
**Path:** `headers/net/rtl8139.h`

**Functions:**
- `rtl_present` (line 18) `int rtl_present(void);` - *rtl8139 NIC driver interface.  This header is the boundary between the polled rtl8139 driver (rtl8139.c) and the protocol stack (net.c).  The driver owns the port I/O, PCI probe, TX/RX rings, the NIC MAC and the PIT-calibrated clock; the stack owns addressing, sockets and the demux that the driver reaches through rtl_poll.  All frame sizes and MAC constants come from net.h.  #include "net.h" /* Nonzero when the rtl8139 was found and initialized.*
- `rtl_init` (line 21) `void rtl_init(void);` - *This header is the boundary between the polled rtl8139 driver (rtl8139.c) and the protocol stack (net.c).  The driver owns the port I/O, PCI probe, TX/RX rings, the NIC MAC and the PIT-calibrated clock; the stack owns addressing, sockets and the demux that the driver reaches through rtl_poll.  All frame sizes and MAC constants come from net.h.  #include "net.h" /* Nonzero when the rtl8139 was found and initialized. int rtl_present(void); /* Calibrate the clock, probe the NIC and set up the TX/RX rings.*
- `rtl_send` (line 25) `int rtl_send(const unsigned char *frame, unsigned len);` - *Transmit one raw Ethernet frame.  Returns 1 on success, 0 on failure * (no device, frame too large for a slot, or a TX deadline expiry).*
- `net_rx_handle_frame` (line 28) `* net_rx_handle_frame (the protocol demux in net.c). */ void rtl_poll(void);`
- `rtl_get_mac` (line 32) `void rtl_get_mac(unsigned char out[NET_ETH_ALEN]);` - *Drain the RX ring once; every received frame is handed to * net_rx_handle_frame (the protocol demux in net.c). void rtl_poll(void); /* Copy the NIC MAC into out (NET_ETH_ALEN bytes).*
- `rtl_iobase` (line 35) `unsigned short rtl_iobase(void);` - *Drain the RX ring once; every received frame is handed to * net_rx_handle_frame (the protocol demux in net.c). void rtl_poll(void); /* Copy the NIC MAC into out (NET_ETH_ALEN bytes). void rtl_get_mac(unsigned char out[NET_ETH_ALEN]); /* The NIC I/O base, or 0 when the device is absent.*
- `rtl_counters` (line 38) `void rtl_counters(unsigned int *tx_frames, unsigned int *rx_frames);` - *Drain the RX ring once; every received frame is handed to * net_rx_handle_frame (the protocol demux in net.c). void rtl_poll(void); /* Copy the NIC MAC into out (NET_ETH_ALEN bytes). void rtl_get_mac(unsigned char out[NET_ETH_ALEN]); /* The NIC I/O base, or 0 when the device is absent. unsigned short rtl_iobase(void); /* Frame-level TX/RX counters (bytes are protocol counters in net.c).*

**Macros:**
- `RTL8139_H` (line 2) `#define RTL8139_H`

#### `net.h`
**Path:** `headers/net.h`
**File Doc:** *========== Fixed slirp configuration (QEMU -nic user) ==========*

**Functions:**
- `ring` (line 58) `* ring (below) is the rtl8139's 8 KB hardware ring, unrelated. */ #define NET_SOCK_RX_BUF 16384 #define NET_RX_RING_SIZE 8192 #define NET_SOCKETS 16 #define NET_DNS_PORT 53 #define NET_EPHEMERAL_MIN 4`
- `net_sys_is_socket` (line 101) `int net_sys_is_socket(long fd);` - *net_connect / socket fds are NET_FD_BASE + index for Linux syscalls and * 0..NET_SOCKETS-1 for the libc-style symbols. void net_init(void); /* Linux socket ABI entry points (kernel/syscalls.c routes to them).*
- `net_sys_setsockopt` (line 102) `long net_sys_setsockopt(long fd, long level, long name, long val, long len);`
- `net_sys_getsockopt` (line 103) `long net_sys_getsockopt(long fd, long level, long name, long val, long lenp);`
- `net_sys_getsockname` (line 104) `long net_sys_getsockname(long fd, long addr, long lenp);`
- `net_sys_getpeername` (line 105) `long net_sys_getpeername(long fd, long addr, long lenp);`
- `net_sys_sendmsg` (line 106) `long net_sys_sendmsg(long fd, long msg, long flags);`
- `net_sys_sendmmsg` (line 107) `long net_sys_sendmmsg(long fd, long vec, long vlen, long flags);`
- `net_sys_fcntl` (line 108) `long net_sys_fcntl(long fd, long cmd, long arg);`
- `net_sys_ioctl` (line 109) `long net_sys_ioctl(long fd, long req, long arg);`
- `net_register_symbols` (line 110) `void net_register_symbols(void);`
- `net_cmd_status` (line 113) `void net_cmd_status(void);` - *void net_init(void); /* Linux socket ABI entry points (kernel/syscalls.c routes to them). int  net_sys_is_socket(long fd); long net_sys_setsockopt(long fd, long level, long name, long val, long len); long net_sys_getsockopt(long fd, long level, long name, long val, long lenp); long net_sys_getsockname(long fd, long addr, long lenp); long net_sys_getpeername(long fd, long addr, long lenp); long net_sys_sendmsg(long fd, long msg, long flags); long net_sys_sendmmsg(long fd, long vec, long vlen, long flags); long net_sys_fcntl(long fd, long cmd, long arg); long net_sys_ioctl(long fd, long req, long arg); void net_register_symbols(void); /* Shell commands*
- `net_cmd_ping` (line 114) `void net_cmd_ping(const char *ip_text);`
- `net_get_addrs` (line 115) `void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4]);`
- `net_cmd_dns` (line 116) `void net_cmd_dns(const char *host);`
- `net_open` (line 119) `int net_open(void);` - *long net_sys_getpeername(long fd, long addr, long lenp); long net_sys_sendmsg(long fd, long msg, long flags); long net_sys_sendmmsg(long fd, long vec, long vlen, long flags); long net_sys_fcntl(long fd, long cmd, long arg); long net_sys_ioctl(long fd, long req, long arg); void net_register_symbols(void); /* Shell commands void net_cmd_status(void); void net_cmd_ping(const char *ip_text); void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4]); void net_cmd_dns(const char *host); /* Libc-style API for ET_REL programs*
- `net_connect` (line 120) `int net_connect(const char *host, unsigned short port);`
- `net_send` (line 121) `int net_send(int fd, const char *buf, int len);`
- `net_recv` (line 122) `int net_recv(int fd, char *buf, int len);`
- `net_recv_timeout` (line 124) `int net_recv_timeout(int fd, char *buf, int len, unsigned long timeout_ms);` - *void net_register_symbols(void); /* Shell commands void net_cmd_status(void); void net_cmd_ping(const char *ip_text); void net_get_addrs(unsigned char mac_out[NET_ETH_ALEN], unsigned char ip_out[4]); void net_cmd_dns(const char *host); /* Libc-style API for ET_REL programs int  net_open(void); int  net_connect(const char *host, unsigned short port); int  net_send(int fd, const char *buf, int len); int  net_recv(int fd, char *buf, int len); /* Blocking receive with a deadline: like net_recv, but -1 on timeout.*
- `net_close` (line 125) `void net_close(int fd);`
- `demux` (line 131) `* segment through the production demux (httpd selftest). */ int net_listen(unsigned short port);`
- `net_accept_nb` (line 133) `int net_accept_nb(int fd);`
- `net_accept` (line 134) `int net_accept(int fd, unsigned long timeout_ms);`
- `net_sock_state` (line 135) `int net_sock_state(int fd);`
- `net_sock_seq` (line 136) `int net_sock_seq(int fd, unsigned *seq_out, unsigned *ack_out);`
- `net_test_inject_tcp` (line 137) `int net_test_inject_tcp(const unsigned char peer[4], unsigned short pport, unsigned short lport, unsigned char flags, unsigned int seq, unsigned int ack, const unsigned char *data, unsigned datalen);`
- `net_sys_socket` (line 142) `long net_sys_socket(long a1, long a2, long a3);` - *index, or -1). net_accept_nb takes an established child without waiting; net_accept waits up to timeout_ms. net_sock_state reports the TCP state for diagnostics. net_test_inject_tcp feeds one peer * segment through the production demux (httpd selftest). int  net_listen(unsigned short port); int  net_accept_nb(int fd); int  net_accept(int fd, unsigned long timeout_ms); int  net_sock_state(int fd); int  net_sock_seq(int fd, unsigned *seq_out, unsigned *ack_out); int  net_test_inject_tcp(const unsigned char peer[4], unsigned short pport, unsigned short lport, unsigned char flags, unsigned int seq, unsigned int ack, const unsigned char *data, unsigned datalen); /* Linux syscall ABI (sockaddr_in layout matches Linux)*
- `net_sys_connect` (line 143) `long net_sys_connect(long fd, long sockaddr, long addrlen);`
- `net_sys_bind` (line 144) `long net_sys_bind(long fd, long sockaddr, long addrlen);`
- `net_sys_listen` (line 145) `long net_sys_listen(long fd, long backlog);`
- `net_sys_accept` (line 146) `long net_sys_accept(long fd, long sockaddr, long addrlen);`
- `net_sys_sendto` (line 147) `long net_sys_sendto(long fd, long buf, long len, long flags, long to, long tolen);`
- `net_sys_recvfrom` (line 148) `long net_sys_recvfrom(long fd, long buf, long len, long flags, long from, long fromlen);`
- `net_sys_shutdown` (line 149) `long net_sys_shutdown(long fd, long how);`
- `net_sys_close` (line 150) `long net_sys_close(long fd);`
- `net_sys_poll` (line 151) `long net_sys_poll(long fds, long nfds, long timeout_ms);`
- `net_sys_dns` (line 152) `long net_sys_dns(long host);`
- `net_time_ms` (line 155) `unsigned long net_time_ms(void);` - */* Linux syscall ABI (sockaddr_in layout matches Linux) long net_sys_socket(long a1, long a2, long a3); long net_sys_connect(long fd, long sockaddr, long addrlen); long net_sys_bind(long fd, long sockaddr, long addrlen); long net_sys_listen(long fd, long backlog); long net_sys_accept(long fd, long sockaddr, long addrlen); long net_sys_sendto(long fd, long buf, long len, long flags, long to, long tolen); long net_sys_recvfrom(long fd, long buf, long len, long flags, long from, long fromlen); long net_sys_shutdown(long fd, long how); long net_sys_close(long fd); long net_sys_poll(long fds, long nfds, long timeout_ms); long net_sys_dns(long host); /* Milliseconds since net_init (PIT-calibrated TSC).*
- `net_rx_handle_frame` (line 159) `void net_rx_handle_frame(const unsigned char *frame, unsigned len);` - *Demux entry point the rtl8139 driver (rtl8139.c) calls for every * frame drained from the RX ring; lives in net.c.*
- `stack` (line 162) `* the stack (dropped fragments);`
- `tls_free_fd` (line 170) `void tls_free_fd(int fd);` - *TLS sessions attached to socket fds (tls.c); net_sys_close frees them. With MINIOS_NO_TLS the engine is unlinked and tls.h carries the inline * no-op; this declaration would collide with it, so it is omitted. ifndef MINIOS_NO_TLS*

**Macros:**
- `NET_H` (line 2) `#define NET_H`
- `NET_IP_ADDR` (line 5) `#define NET_IP_ADDR`
- `NET_NETMASK` (line 6) `#define NET_NETMASK`
- `NET_GATEWAY` (line 7) `#define NET_GATEWAY`
- `NET_DNS` (line 8) `#define NET_DNS`
- `NET_POLLIN` (line 12) `#define NET_POLLIN`
- `NET_POLLOUT` (line 13) `#define NET_POLLOUT`
- `NET_POLLERR` (line 14) `#define NET_POLLERR`
- `NET_POLLHUP` (line 15) `#define NET_POLLHUP`
- `NET_POLLNVAL` (line 16) `#define NET_POLLNVAL`
- `NET_PCI_VENDOR` (line 19) `#define NET_PCI_VENDOR`
- `NET_PCI_DEVICE` (line 20) `#define NET_PCI_DEVICE`
- `NET_RX_BUF_LEN` (line 26) `#define NET_RX_BUF_LEN`
- `NET_RX_ALIGN` (line 27) `#define NET_RX_ALIGN`
- `NET_RX_RING_PAD` (line 31) `#define NET_RX_RING_PAD`
- `NET_RCR` (line 34) `#define NET_RCR`
- `NET_MAX_FRAME` (line 35) `#define NET_MAX_FRAME`
- `NET_TX_SLOTS` (line 36) `#define NET_TX_SLOTS`
- `NET_ETH_ALEN` (line 39) `#define NET_ETH_ALEN`
- `NET_ETHERTYPE_IP` (line 40) `#define NET_ETHERTYPE_IP`
- `NET_ETHERTYPE_ARP` (line 41) `#define NET_ETHERTYPE_ARP`
- `NET_ETHERTYPE_IPV6` (line 42) `#define NET_ETHERTYPE_IPV6`
- `NET_PROTO_ICMP` (line 45) `#define NET_PROTO_ICMP`
- `NET_PROTO_TCP` (line 46) `#define NET_PROTO_TCP`
- `NET_PROTO_UDP` (line 47) `#define NET_PROTO_UDP`
- `NET_ARP_CACHE` (line 50) `#define NET_ARP_CACHE`
- `NET_ARP_REQUEST` (line 51) `#define NET_ARP_REQUEST`
- `NET_ARP_REPLY` (line 52) `#define NET_ARP_REPLY`
- `NET_TCP_MSS` (line 55) `#define NET_TCP_MSS`
- `NET_TCP_WINDOW` (line 56) `#define NET_TCP_WINDOW`
- `NET_SOCK_RX_BUF` (line 59) `#define NET_SOCK_RX_BUF`
- `NET_RX_RING_SIZE` (line 60) `#define NET_RX_RING_SIZE`
- `NET_SOCKETS` (line 61) `#define NET_SOCKETS`
- `NET_DNS_PORT` (line 62) `#define NET_DNS_PORT`
- `NET_EPHEMERAL_MIN` (line 63) `#define NET_EPHEMERAL_MIN`
- `NET_DNS_TRIES` (line 64) `#define NET_DNS_TRIES`
- `NET_DNS_TMO_MS` (line 65) `#define NET_DNS_TMO_MS`
- `NET_CONNECT_TMO_S` (line 66) `#define NET_CONNECT_TMO_S`
- `NET_RETRY_MS` (line 67) `#define NET_RETRY_MS`
- `NET_ACCEPT_TMO_MS` (line 68) `#define NET_ACCEPT_TMO_MS`
- `NET_TX_MAX` (line 69) `#define NET_TX_MAX`
- `NET_FD_BASE` (line 72) `#define NET_FD_BASE`
- `NET_UDP_SOCKETS` (line 77) `#define NET_UDP_SOCKETS`
- `NET_UDP_QUEUE` (line 78) `#define NET_UDP_QUEUE`
- `NET_UDP_DGRAM_MAX` (line 79) `#define NET_UDP_DGRAM_MAX`
- `NET_UDP_FD_BASE` (line 80) `#define NET_UDP_FD_BASE`
- `NET_UDP_EPHEMERAL_MIN` (line 81) `#define NET_UDP_EPHEMERAL_MIN`
- `NET_UDP_EPHEMERAL_MAX` (line 82) `#define NET_UDP_EPHEMERAL_MAX`
- `NET_SOCKADDR_IN_LEN` (line 83) `#define NET_SOCKADDR_IN_LEN`
- `NET_MSGHDR_LEN` (line 85) `#define NET_MSGHDR_LEN`
- `NET_MMSGHDR_LEN` (line 86) `#define NET_MMSGHDR_LEN`
- `NET_MSGHDR_NAME_OFF` (line 87) `#define NET_MSGHDR_NAME_OFF`
- `NET_MSGHDR_NAMELEN_OFF` (line 88) `#define NET_MSGHDR_NAMELEN_OFF`
- `NET_MSGHDR_IOV_OFF` (line 89) `#define NET_MSGHDR_IOV_OFF`
- `NET_MSGHDR_IOVLEN_OFF` (line 90) `#define NET_MSGHDR_IOVLEN_OFF`
- `NET_MMSGHDR_LEN_OFF` (line 91) `#define NET_MMSGHDR_LEN_OFF`
- `NET_IOV_LEN` (line 92) `#define NET_IOV_LEN`
- `NET_IOV_MAX` (line 93) `#define NET_IOV_MAX`
- `NET_MMSG_MAX` (line 94) `#define NET_MMSG_MAX`

**Variables:**
- `net_rx_dropped` (line 163) `extern unsigned int net_rx_dropped;` - *Aggregate RX drop counter shared between the driver (bad frames) and * the stack (dropped fragments); defined in net.c.*
- `net6_rx_dropped` (line 164) `extern unsigned int net6_rx_dropped;`

#### `panic.h`
**Path:** `headers/panic.h`
**File Doc:** *Docstring: panic.h -- Kernel panic backtrace contract (header-only).*

**Functions:**
- `panic_hex_str` (line 28) `static inline int panic_hex_str(char *buf, int cap, unsigned long v, int digits)` - *Docstring: Format an unsigned long as fixed-width lowercase hex into buf, writing exactly digits characters plus a NUL terminator, so the buffer must hold digits + 1 bytes. digits is clamped to [0, PANIC_HEX_MAX_DIGITS] and to the buffer capacity, so the widest field never writes past the terminator. Returns the number of * characters written.*
- `panic_backtrace` (line 51) `static inline int panic_backtrace(unsigned long rbp, panic_valid_fn valid,
        unsigned long ...` - *Docstring: Walk up to max frame pointers from rbp, storing each frame's return address (*(rbp+8)) into out. Stops on null rbp, failed predicate, a non-advancing frame or a null return address. * Returns the stored count. Fail-closed on null out or null predicate.*

**Macros:**
- `PANIC_H` (line 15) `#define PANIC_H`
- `PANIC_BT_MAX` (line 17) `#define PANIC_BT_MAX`
- `PANIC_HEX_MAX_DIGITS` (line 20) `#define PANIC_HEX_MAX_DIGITS`

#### `pcache.h`
**Path:** `headers/pcache.h`
**File Doc:** *Docstring: pcache.h -- page cache for MiniFS, slice 1 (store only).*

**Functions:**
- `pcache_init` (line 28) `void pcache_init(void);` - *Docstring: Allocate the page pool; disabled (all calls fail closed) when the heap cannot spare it, exactly like the block * cache. Prints one boot marker either way.*
- `pcache_lookup` (line 32) `int pcache_lookup(int ino, unsigned index);` - *Docstring: Find a cached page without reserving. Returns the slot * or -1. Never allocates, never evicts.*
- `pcache_get` (line 42) `int pcache_get(int ino, unsigned index, int *is_new);` - *Docstring: Get a page, pinned with one ref. Hit returns the live slot; miss reserves an empty or evicted slot (ref 1, clean, *is_new 1, data uninitialized: the caller fills it before any reader sees it) or -1 when every slot is pinned or the pool is disabled, in which case the caller falls back to direct block I/O, fail-open correct. Racy fills must use publish below, never a reserved-then-filled get: a concurrent faulter would map the * half-written page.*
- `pcache_publish` (line 51) `int pcache_publish(int ino, unsigned index, const unsigned char *data);` - *Docstring: Publish a privately filled page into the cache atomically. Copies data into a reserved slot and marks it valid under one lock hold, or refs the slot a racing publisher won first; either way the returned slot is complete before any other holder can see it. Returns the slot (ref 1 for this mapping) or -1 when no slot is free, in which case the caller maps its * private page and takes no ref.*
- `pcache_put` (line 55) `void pcache_put(int slot);` - *Docstring: Drop one ref taken by get. A zero ref is a no-op, * never negative.*
- `pcache_ref` (line 61) `int pcache_ref(int ino, unsigned index);` - *Docstring: Take one more ref on a cached page without allocating. Fork uses this for every file-backed page the child inherits, so the child teardown drops exactly what the copy added. Returns the * slot or -1 when the page is not cached.*
- `pcache_unmap` (line 69) `void pcache_unmap(int ino, unsigned index);` - *Docstring: Drop the ref a mapping holds on one cached page. The munmap and teardown walks derive (ino, index) from the VMA node and call this per page; unknown pages are a silent no-op so a partially populated mapping unmaps cleanly. Prefer put_if below wherever the PTE is at hand: blind drops can steal another * mapping's ref after a private fallback.*
- `match` (line 75) `* a phys match (owned, ref dropped unless already zero), 0 * otherwise. */ int pcache_put_if(int ino, unsigned index, unsigned long phys);`
- `pcache_ref_if` (line 83) `int pcache_ref_if(int ino, unsigned index, unsigned long phys);` - *Docstring: Take one more ref only when the cached page is the exact phys the caller shares. Fork proves sharing through the parent PTE before inheriting, so a stale VMA tag never pins a * recycled slot. Returns the slot or -1.*
- `pcache_owns_phys` (line 88) `int pcache_owns_phys(unsigned long phys);` - *Docstring: True when phys is a cache pool page. The teardown sweeper skips those instead of freeing pool memory as if it were * a private data page.*
- `pcache_data` (line 93) `unsigned char *pcache_data(int slot);` - *Docstring: Page data for a slot from get/lookup, 0 on a bad slot. The pointer stays valid until put drops the last ref and * the slot is recycled.*
- `pcache_mark_dirty` (line 98) `void pcache_mark_dirty(int slot);` - *Docstring: Mark a pinned page dirty. Slice 3 flushes it; slice 1 only records. Recycled slots bump a generation counter * (slice 3 exposes it so holders can validate across put).*
- `pcache_invalidate_ino` (line 102) `void pcache_invalidate_ino(int ino);` - *Docstring: Drop every page of an inode (truncate/unlink). * Dirty pages drop with them until slice 3 teaches writeback.*
- `pcache_stats` (line 106) `void pcache_stats(unsigned long *pages_out, unsigned long *hits_out, unsigned long *miss_out, unsigned long *evicted_out, unsigned long *dirty_out);` - *Docstring: Snapshot for the mem builtin and BDD: live pages, * cumulative hits/misses/evictions, dirty count.*

**Macros:**
- `PCACHE_H` (line 17) `#define PCACHE_H`
- `PCACHE_PAGES` (line 20) `#define PCACHE_PAGES`
- `PCACHE_PAGE` (line 23) `#define PCACHE_PAGE`

#### `pcm2.h`
**Path:** `headers/pcm2.h`
**File Doc:** *pcm2.h -- low-latency PCM audio path over SB16 single-cycle DMA.*

**Functions:**
- `pcm2_active` (line 77) `int pcm2_active(void);`
- `pcm2_open` (line 78) `int pcm2_open(unsigned flags, int owner);`
- `pcm2_write` (line 79) `int pcm2_write(const unsigned char *user, unsigned len, int owner);`
- `pcm2_close` (line 80) `void pcm2_close(int owner);`
- `pcm2_irq` (line 81) `void pcm2_irq(void);`
- `pcm2_poll` (line 82) `void pcm2_poll(void);`
- `pcm2_counters` (line 83) `void pcm2_counters(pcm2_counters_t *out);`

**Macros:**
- `PCM2_H` (line 2) `#define PCM2_H`
- `PCM2_RATE` (line 52) `#define PCM2_RATE`
- `PCM2_FRAG` (line 53) `#define PCM2_FRAG`
- `PCM2_FRAGS` (line 54) `#define PCM2_FRAGS`
- `PCM2_DMA_BYTES` (line 55) `#define PCM2_DMA_BYTES`
- `PCM2_RING` (line 56) `#define PCM2_RING`
- `PCM2_FLAG_NONBLOCK` (line 58) `#define PCM2_FLAG_NONBLOCK`
- `PCM2_ERR_BUSY` (line 60) `#define PCM2_ERR_BUSY`
- `PCM2_ERR_NODEV` (line 61) `#define PCM2_ERR_NODEV`
- `PCM2_ERR_NOMEM` (line 62) `#define PCM2_ERR_NOMEM`
- `PCM2_ERR_PERM` (line 63) `#define PCM2_ERR_PERM`
- `PCM2_ERR_PIPE` (line 64) `#define PCM2_ERR_PIPE`
- `PCM2_ERR_INVAL` (line 65) `#define PCM2_ERR_INVAL`

**Structs:**
- `pcm2_counters_t` (line 67)

#### `pcm_ring.h`
**Path:** `headers/pcm_ring.h`
**File Doc:** *pcm_ring.h -- single-producer/single-consumer byte ring for PCM audio.*

**Functions:**
- `pcm_ring_init` (line 36) `static inline void pcm_ring_init(pcm_ring_t *r, unsigned char *buf,
                             ...`
- `pcm_ring_used` (line 47) `static inline unsigned pcm_ring_used(const pcm_ring_t *r)`
- `pcm_ring_free` (line 51) `static inline unsigned pcm_ring_free(const pcm_ring_t *r)`
- `pcm_ring_write` (line 55) `static inline unsigned pcm_ring_write(pcm_ring_t *r, const unsigned char *src,
                  ...`
- `pcm_ring_read` (line 76) `static inline unsigned pcm_ring_read(pcm_ring_t *r, unsigned char *dst,
                         ...`

**Macros:**
- `PCM_RING_H` (line 2) `#define PCM_RING_H`

**Structs:**
- `pcm_ring_t` (line 26)

#### `pcspk.h`
**Path:** `headers/pcspk.h`

**Functions:**
- `pcspk_init` (line 8) `void pcspk_init(void);`
- `pcspk_tone` (line 9) `void pcspk_tone(unsigned freq);`
- `pcspk_off` (line 10) `void pcspk_off(void);`
- `pcspk_set_volume` (line 11) `void pcspk_set_volume(unsigned volume);`
- `pcspk_get_volume` (line 12) `unsigned pcspk_get_volume(void);`

**Macros:**
- `PCSPK_H` (line 2) `#define PCSPK_H`
- `PCSPK_VOL_MIN` (line 4) `#define PCSPK_VOL_MIN`
- `PCSPK_VOL_MAX` (line 5) `#define PCSPK_VOL_MAX`
- `PCSPK_VOL_DEFAULT` (line 6) `#define PCSPK_VOL_DEFAULT`

#### `percpu_rq.h`
**Path:** `headers/percpu_rq.h`
**File Doc:** *Docstring: percpu_rq.h -- Per-CPU runqueues with work stealing.*

**Functions:**
- `rq_init` (line 61) `void rq_init(void);`
- `rq_enqueue` (line 62) `void rq_enqueue(int cpu, int pid);`
- `rq_pop_local` (line 63) `int rq_pop_local(int cpu);`
- `rq_steal_once` (line 64) `int rq_steal_once(int self_cpu, int *from_cpu);`
- `rq_empty` (line 65) `int rq_empty(int cpu);`
- `rq_should_rescan` (line 66) `int rq_should_rescan(int cpu);`
- `rq_note_poll` (line 67) `void rq_note_poll(int cpu);`
- `rq_stats` (line 68) `void rq_stats(int cpu, unsigned long *hits, unsigned long *steals, unsigned long *drops);`

**Macros:**
- `PERCPU_RQ_H` (line 2) `#define PERCPU_RQ_H`
- `RQ_DEPTH` (line 45) `#define RQ_DEPTH`
- `RQ_RESCAN_PERIOD` (line 46) `#define RQ_RESCAN_PERIOD`
- `RQ_VALIDATE_ATTEMPTS` (line 47) `#define RQ_VALIDATE_ATTEMPTS`
- `WQ_NONE_HINT` (line 48) `#define WQ_NONE_HINT`

**Structs:**
- `percpu_rq_t` (line 50)

#### `pipe.h`
**Path:** `headers/pipe.h`
**File Doc:** *Docstring: pipe.h -- Kernel pipe ring contract (header-only).*

**Functions:**
- `pipe_ring_init` (line 47) `static inline int pipe_ring_init(pipe_ring_t *r, unsigned char *buf,
        unsigned cap)` - *Docstring: Bind a caller-owned buffer to a ring. Fails closed on a * null buffer or a zero/oversize capacity.*
- `pipe_ring_avail` (line 64) `static inline unsigned pipe_ring_avail(const pipe_ring_t *r)` - *return PIPE_ERR_BOUND; if (cap == 0u || cap > PIPE_CAP_MAX) return PIPE_ERR_BOUND; r->buf = buf; r->cap = cap; r->head = 0u; r->tail = 0u; r->count = 0u; r->wopen = 1; r->ropen = 1; return 0; } /** Docstring: Bytes available to read. Zero on a null ring.*
- `pipe_ring_space` (line 71) `static inline unsigned pipe_ring_space(const pipe_ring_t *r)` - *r->count = 0u; r->wopen = 1; r->ropen = 1; return 0; } /** Docstring: Bytes available to read. Zero on a null ring. static inline unsigned pipe_ring_avail(const pipe_ring_t *r) { if (!r || !r->buf) return 0u; return r->count; } /** Docstring: Free space available to write. Zero on a null ring.*
- `pipe_ring_write` (line 79) `static inline unsigned pipe_ring_write(pipe_ring_t *r,
        const unsigned char *src, unsigned...` - *Docstring: Append up to len bytes, return bytes stored. Partial on a * full ring, never overrun. Zero on null input or a closed writer.*
- `pipe_ring_close_writer` (line 118) `static inline int pipe_ring_close_writer(pipe_ring_t *r)` - *Docstring: Mark the writer closed. Later reads drain then report EOF. * Idempotent; null ring is a no-op returning PIPE_ERR_BOUND.*
- `pipe_ring_close_reader` (line 128) `static inline int pipe_ring_close_reader(pipe_ring_t *r)` - *Docstring: Mark the reader closed. Later writes store nothing (the syscall layer answers EPIPE). Idempotent; null ring is a no-op * returning PIPE_ERR_BOUND.*
- `pipe_ring_ropen` (line 135) `static inline int pipe_ring_ropen(const pipe_ring_t *r)` - *Docstring: Mark the reader closed. Later writes store nothing (the syscall layer answers EPIPE). Idempotent; null ring is a no-op * returning PIPE_ERR_BOUND. static inline int pipe_ring_close_reader(pipe_ring_t *r) { if (!r) return PIPE_ERR_BOUND; r->ropen = 0; return 0; } /** Docstring: 1 while the read end is open, 0 once closed or on null.*
- `pipe_ring_stat` (line 140) `static inline int pipe_ring_stat(const pipe_ring_t *r, pipe_cfg_t *out)` - *Docstring: Snapshot ring geometry into a caller struct. Fail-closed * on null input.*
- `ends` (line 4) `* * Single source of truth for the pipe byte ring shared by the kernel * pipe ends (fs/kfile.c), the pipe/dup/dup2 syscalls (kernel/syscalls.c) * and the shell pipeline runner (kernel/shell.c). Header`

**Macros:**
- `PIPE_H` (line 19) `#define PIPE_H`
- `PIPE_CAP_DEFAULT` (line 21) `#define PIPE_CAP_DEFAULT`
- `PIPE_CAP_MAX` (line 22) `#define PIPE_CAP_MAX`
- `PIPE_ERR_BOUND` (line 24) `#define PIPE_ERR_BOUND`
- `PIPE_EMPTY` (line 25) `#define PIPE_EMPTY`
- `PIPE_CFG_DEFAULT` (line 43) `#define PIPE_CFG_DEFAULT`

**Structs:**
- `pipe_ring_t` (line 27)
- `pipe_cfg_t` (line 37)

#### `proc_sec.h`
**Path:** `headers/proc_sec.h`
**File Doc:** *Docstring: proc_sec.h -- per-process security state behind the Linux*

**Functions:**
- `proc_sec_inherit` (line 23) `void proc_sec_inherit(int child, int parent);` - *Exit code of a process or thread a filter kills: a death by SIGSYS (31), recorded negative like every MiniOS signal death, so wait4 reports * WIFSIGNALED with WTERMSIG == SIGSYS. #define SECCOMP_KILL_EXIT (-31) /* Lifecycle (callers hold sched_lock where noted in sched.c).*
- `proc_sec_release` (line 24) `void proc_sec_release(int pid);`
- `proc_sec_exec` (line 25) `void proc_sec_exec(int pid);`
- `proc_sec_set_exe` (line 26) `void proc_sec_set_exe(int pid, const char *resolved);`
- `proc_sec_exe` (line 28) `const char *proc_sec_exe(int pid);` - *Exit code of a process or thread a filter kills: a death by SIGSYS (31), recorded negative like every MiniOS signal death, so wait4 reports * WIFSIGNALED with WTERMSIG == SIGSYS. #define SECCOMP_KILL_EXIT (-31) /* Lifecycle (callers hold sched_lock where noted in sched.c). void proc_sec_inherit(int child, int parent); void proc_sec_release(int pid); void proc_sec_exec(int pid); void proc_sec_set_exe(int pid, const char *resolved); /* Resolved image path of pid ("" when unknown).*
- `it` (line 31) `* the syscall must answer in *ret when a filter decided it (ERRNO, TRACE, * USER_NOTIF);`
- `proc_sec_filter` (line 34) `int proc_sec_filter(long n, long a1, long a2, long a3, long a4, long a5, long a6, long *ret);` - *Run the caller's filters for syscall n. Returns 1 and stores the value the syscall must answer in *ret when a filter decided it (ERRNO, TRACE, USER_NOTIF); kills the caller for KILL and TRAP; returns 0 to let the * syscall run.*
- `proc_sec_prctl` (line 36) `long proc_sec_prctl(long option, long a2, long a3, long a4, long a5);`
- `proc_sec_seccomp` (line 37) `long proc_sec_seccomp(long op, long flags, long uargs);`

**Macros:**
- `PROC_SEC_H` (line 13) `#define PROC_SEC_H`
- `SECCOMP_FILTERS_MAX` (line 16) `#define SECCOMP_FILTERS_MAX`
- `SECCOMP_KILL_EXIT` (line 20) `#define SECCOMP_KILL_EXIT`

#### `qga.h`
**Path:** `headers/qga.h`
**File Doc:** *========== QEMU guest agent channel (COM2, ISA 16550) ==========*

**Functions:**
- `qga_init` (line 48) `void qga_init(void);`
- `qga_poll` (line 49) `void qga_poll(void);`

**Macros:**
- `QGA_H` (line 2) `#define QGA_H`
- `QGA_COM2_BASE` (line 5) `#define QGA_COM2_BASE`
- `QGA_COM2_IRQ` (line 6) `#define QGA_COM2_IRQ`
- `QGA_UART_THR` (line 9) `#define QGA_UART_THR`
- `QGA_UART_RBR` (line 10) `#define QGA_UART_RBR`
- `QGA_UART_DLL` (line 11) `#define QGA_UART_DLL`
- `QGA_UART_DLM` (line 12) `#define QGA_UART_DLM`
- `QGA_UART_IER` (line 13) `#define QGA_UART_IER`
- `QGA_UART_FCR` (line 14) `#define QGA_UART_FCR`
- `QGA_UART_LCR` (line 15) `#define QGA_UART_LCR`
- `QGA_UART_LSR` (line 16) `#define QGA_UART_LSR`
- `QGA_UART_MCR` (line 17) `#define QGA_UART_MCR`
- `QGA_UART_LSR_TX_RDY` (line 18) `#define QGA_UART_LSR_TX_RDY`
- `QGA_UART_LSR_RX_RDY` (line 19) `#define QGA_UART_LSR_RX_RDY`
- `QGA_UART_LCR_DLAB` (line 20) `#define QGA_UART_LCR_DLAB`
- `QGA_UART_LCR_8N1` (line 21) `#define QGA_UART_LCR_8N1`
- `QGA_UART_FCR_CFG` (line 22) `#define QGA_UART_FCR_CFG`
- `QGA_UART_MCR_CFG` (line 23) `#define QGA_UART_MCR_CFG`
- `QGA_BAUD_DIVISOR` (line 25) `#define QGA_BAUD_DIVISOR`
- `QGA_LINE_MAX` (line 30) `#define QGA_LINE_MAX`
- `QGA_RESP_MAX` (line 31) `#define QGA_RESP_MAX`
- `QGA_FILE_READ_MAX` (line 34) `#define QGA_FILE_READ_MAX`
- `QGA_MAX_PAIRS` (line 37) `#define QGA_MAX_PAIRS`
- `QGA_KEY_MAX` (line 38) `#define QGA_KEY_MAX`
- `QGA_STR_MAX` (line 39) `#define QGA_STR_MAX`
- `QGA_MAX_DEPTH` (line 42) `#define QGA_MAX_DEPTH`
- `QGA_FILE_MAX` (line 46) `#define QGA_FILE_MAX`

#### `randmix.h`
**Path:** `headers/randmix.h`
**File Doc:** *randmix.h -- entropy mixer for getrandom (318).*

**Functions:**
- `source` (line 11) `* source (all-zero seed) still walks, because the increment is inside
 * the mixer, not in the ca...`

**Macros:**
- `RANDMIX_H` (line 2) `#define RANDMIX_H`

#### `rcu.h`
**Path:** `headers/rcu.h`
**File Doc:** *Docstring: rcu.h -- Read-copy-update, lite epoch edition.*

**Functions:**
- `retirement` (line 30) `* retirement (the writer keeps ownership) instead of dropping the free. * Callbacks run in tick context with interrupts disabled, so they must * be short and non-blocking. rcu_synchronize spins on qui`
- `rcu_init` (line 51) `void rcu_init(void);`
- `rcu_read_lock` (line 52) `void rcu_read_lock(void);`
- `rcu_read_unlock` (line 53) `void rcu_read_unlock(void);`
- `rcu_deref` (line 54) `void *rcu_deref(void *volatile *pp);`
- `rcu_publish` (line 55) `void rcu_publish(void *volatile *pp, void *v);`
- `rcu_call` (line 56) `long rcu_call(rcu_cb_t fn, void *arg);`
- `rcu_note_tick` (line 57) `void rcu_note_tick(int cpu);`
- `rcu_note_idle` (line 58) `void rcu_note_idle(int cpu);`
- `rcu_poll` (line 59) `void rcu_poll(void);`
- `rcu_synchronize` (line 60) `long rcu_synchronize(void);`

**Macros:**
- `RCU_H` (line 2) `#define RCU_H`
- `RCU_CB_MAX` (line 42) `#define RCU_CB_MAX`
- `RCU_SYNC_SPINS` (line 43) `#define RCU_SYNC_SPINS`
- `RCU_OK` (line 45) `#define RCU_OK`
- `RCU_ERR_FULL` (line 46) `#define RCU_ERR_FULL`
- `RCU_ERR_TIMEOUT` (line 47) `#define RCU_ERR_TIMEOUT`

#### `rtc.h`
**Path:** `headers/rtc.h`

**Functions:**
- `rtc_days_from_civil` (line 18) `static inline long rtc_days_from_civil(long y, long m, long d)` - *Days since 1970-01-01 for a civil date (Howard Hinnant's algorithm, pure integer arithmetic, no tables). Powers rtc_wall_seconds and the host suite (tests/test_rtc.c); valid for the full 2000..2099 CMOS window and far beyond. Lives here (not in rtc.c) so the host test can * compile it without the port-I/O half of the driver.*
- `rtc_read_tod` (line 4) `int rtc_read_tod(int *hour, int *min, int *sec);`
- `rtc_read_date` (line 11) `int rtc_read_date(int *year, int *mon, int *day);` - *Calendar date from the CMOS RTC (registers 0x07-0x09). Full year (CMOS carries two digits; 0..99 maps to 2000..2099). Fail-closed like the time reader: impossible month/day (including Feb 29 on a non-leap year) or a clock that never stops updating returns 0 and * writes nothing.*
- `suite` (line 15) `* host suite (tests/test_rtc.c);`
- `rtc_wall_seconds` (line 33) `int rtc_wall_seconds(unsigned long *out);` - *Wall-clock seconds since the Unix epoch from one RTC snapshot. Returns 1 and stores the value, or 0 on any RTC failure (caller decides the fallback; TLS treats 0 as "no clock" and fails the * chain check closed downstream).*

**Macros:**
- `RTC_H` (line 2) `#define RTC_H`

#### `sanitize.h`
**Path:** `headers/sanitize.h`
**File Doc:** *Docstring: sanitize.h -- Single choke point for syscall argument checks.*

**Macros:**
- `SANITIZE_H` (line 2) `#define SANITIZE_H`
- `SANITIZE_LEN_NEG` (line 32) `#define SANITIZE_LEN_NEG(var)`
- `SANITIZE_RANGE` (line 37) `#define SANITIZE_RANGE(ptr, len)`
- `SANITIZE_STR` (line 43) `#define SANITIZE_STR(ptr, maxlen)`
- `SANITIZE_COPY_IN` (line 49) `#define SANITIZE_COPY_IN(kbuf, uptr, count, elemsz)`

#### `sb16.h`
**Path:** `headers/sb16.h`
**File Doc:** *Sound Blaster 16 DMA audio driver contract.*

**Functions:**
- `sb16_init` (line 65) `int sb16_init(void);`
- `sb16_present` (line 66) `int sb16_present(void);`
- `sb16_tone` (line 67) `void sb16_tone(unsigned freq);`
- `sb16_irq` (line 68) `void sb16_irq(void);`
- `sb16_poll` (line 69) `void sb16_poll(void);`
- `sb16_pcm_open` (line 73) `void sb16_pcm_open(void);` - *Legacy single-stream API (maps to mixer stream 0: pcm_open allocates it, * pcm_submit forwards into it, pcm_close releases it).*
- `sb16_pcm_submit` (line 74) `int sb16_pcm_submit(const unsigned char *pcm, unsigned len);`
- `sb16_pcm_close` (line 75) `void sb16_pcm_close(void);`
- `sb16_pump` (line 76) `void sb16_pump(void);`
- `sb16_stream_open` (line 79) `int sb16_stream_open(void);` - *Legacy single-stream API (maps to mixer stream 0: pcm_open allocates it, * pcm_submit forwards into it, pcm_close releases it). void sb16_pcm_open(void); int  sb16_pcm_submit(const unsigned char *pcm, unsigned len); void sb16_pcm_close(void); void sb16_pump(void); /* Mixer stream API.*
- `sb16_stream_close` (line 80) `void sb16_stream_close(int id);`
- `sb16_stream_submit` (line 81) `int sb16_stream_submit(int id, const unsigned char *pcm, unsigned len);`
- `sb16_stream_volume` (line 82) `void sb16_stream_volume(int id, unsigned char vol);`
- `sb16_stream_count` (line 83) `int sb16_stream_count(void);`
- `sb16_ring_free` (line 85) `unsigned sb16_ring_free(void);`
- `sb16_mode_active` (line 86) `int sb16_mode_active(void);`
- `sb16_legacy_busy` (line 91) `int sb16_legacy_busy(void);` - *True while the legacy engine audibly owns the DSP (PCM stream open or a tone sounding). pcm2_open consults it for the mutual -EBUSY; * silent/idle legacy state never blocks the low-latency path.*
- `sb16_counters` (line 93) `void sb16_counters(sb16_counters_t *out);`

**Macros:**
- `SB16_H` (line 2) `#define SB16_H`
- `SB16_PCM_BUF` (line 32) `#define SB16_PCM_BUF`
- `SB16_PCM_RATE` (line 33) `#define SB16_PCM_RATE`
- `SB16_SLOTS` (line 34) `#define SB16_SLOTS`
- `SB16_RING_CAP` (line 35) `#define SB16_RING_CAP`
- `SB16_ARM_PERIOD_MS` (line 36) `#define SB16_ARM_PERIOD_MS`
- `SB16_STREAMS` (line 42) `#define SB16_STREAMS`
- `SB16_STREAM_BUF` (line 43) `#define SB16_STREAM_BUF`

**Structs:**
- `sb16_stream_t` (line 46) - *Per-stream ring buffer.  Each stream gets SB16_STREAM_BUF bytes of kernel-side buffering so multiple producers never interfere.  At 22050 Hz * 8-bit mono that is ~366 ms per stream. #define SB16_STREAMS      4u       /* max concurrent mixer streams #define SB16_STREAM_BUF   (SB16_PCM_BUF * 4u)  /* 8192 bytes per stream /* Mixer stream state.*
- `sb16_counters_t` (line 55)

#### `sched.h`
**Path:** `headers/sched.h`
**File Doc:** *Forward: full view lives in kernel.h (needs KFILE first); the PCB*

**Functions:**
- `__attribute__` (line 375) `typedef struct __attribute__((packed))` - *Per-CPU TSS selectors: slot 5 + 2*cpu in the runtime GDT (each TSS descriptor occupies two 8-byte slots).  CPU 0 keeps selector 0x28, * exactly as before. #define TSS_SEL(cpu) ((uint16_t)((5 + 2 * (cpu)) * 8)) /* Exported IDTR for APs to load during SMP bring-up.*
- `group` (line 108) `* process is its own group (tgid == pid);`
- `entry` (line 135) `* private view with one KFILE ref per live entry (0 on OOM), release * drops the view at reap, cloexec closes marked fds on execve. */ void kfd_view_share(proc_t *child);`
- `kfd_view_copy` (line 138) `int kfd_view_copy(proc_t *child, proc_t *parent);`
- `kfd_view_release` (line 139) `void kfd_view_release(proc_t *p);`
- `kfd_view_cloexec` (line 140) `void kfd_view_cloexec(void);`
- `kfd_view_root` (line 141) `kfd_view_t *kfd_view_root(void);`
- `bytes` (line 173) `* RLIM_AS total user bytes (brk growth + mmap) beyond the load base * RLIM_CPU timer ticks of CPU time, then SIGKILL-equivalent (137) * RLIM_NOFILE open-file count in the process's own fd view (enforc`
- `first` (line 232) `* address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at * the saved top (sc_top_save[pid]);`
- `syscall_frame_current` (line 245) `const syscall_frame_t *syscall_frame_current(void);` - *The frame syscall_entry.S builds on the per-proc kernel stack, lowest address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at the saved top (sc_top_save[pid]); a fork or clone child copies the user * registers from here so it resumes with the caller's full state. typedef struct { uint64_t rflags;            /* user r11 uint64_t rip;               /* user rcx uint64_t nr; uint64_t rdi, rsi, rdx, r10, r8, r9; uint64_t pid; uint64_t pcb_kstack; uint64_t r15, r14, r13, r12, rbp, rbx; } syscall_frame_t; /* The current pid's frame, or 0 outside a ring-3 syscall.*
- `sched_idle_on_kernel_cr3` (line 359) `int sched_idle_on_kernel_cr3(int cpu);` - *1 when cpu's idle context is parked on the kernel page tables, never on * a process's (whose tables are freed when it dies).*
- `sched_init` (line 379) `void sched_init(void);` - *Per-CPU TSS selectors: slot 5 + 2*cpu in the runtime GDT (each TSS descriptor occupies two 8-byte slots).  CPU 0 keeps selector 0x28, * exactly as before. #define TSS_SEL(cpu) ((uint16_t)((5 + 2 * (cpu)) * 8)) /* Exported IDTR for APs to load during SMP bring-up. typedef struct __attribute__((packed)) { uint16_t limit; uint64_t base; } idtr_t; extern idtr_t bsp_idtr; /* ---- Functions ----*
- `kstack_report` (line 380) `void kstack_report(void);`
- `schedtop_report` (line 381) `void schedtop_report(void);`
- `irqstat_report` (line 382) `void irqstat_report(void);`
- `gdb_regs_report` (line 383) `void gdb_regs_report(int pid);`
- `gdb_dump_report` (line 384) `void gdb_dump_report(unsigned long addr, unsigned long len);`
- `tss_init_ap` (line 388) `void tss_init_ap(int cpu);`
- `smp_ap_idle_loop` (line 389) `void smp_ap_idle_loop(void);`
- `proc_create` (line 390) `int proc_create(const char *name, int parent_pid);`
- `proc_get` (line 391) `proc_t *proc_get(int pid);`
- `schedule` (line 392) `void schedule(void);`
- `sched_set_nice` (line 393) `int sched_set_nice(int pid, int nice);`
- `seccomp_deny_one` (line 394) `int seccomp_deny_one(int pid, int n);`
- `seccomp_allow_one` (line 395) `int seccomp_allow_one(int pid, int n);`
- `seccomp_denied` (line 396) `int seccomp_denied(int pid, int n);`
- `rlimit_cpu_exceeded` (line 397) `int rlimit_cpu_exceeded(int pid);`
- `rlimit_cpu_tick` (line 398) `void rlimit_cpu_tick(int pid);`
- `switch_to` (line 399) `void switch_to(proc_t *prev, proc_t *next);`
- `switch_to_notrap` (line 400) `void switch_to_notrap(proc_t *prev, proc_t *next);`
- `switch_save_only` (line 401) `void switch_save_only(proc_t *prev);`
- `resume_iretq` (line 408) `void resume_iretq(void);`
- `yield` (line 409) `void yield(void);`
- `do_exit` (line 410) `void do_exit(int code);`
- `do_clone` (line 411) `long do_clone(long flags, long newsp);`
- `do_fork` (line 412) `long do_fork(void);`
- `do_fork_ex` (line 413) `long do_fork_ex(uint64_t set_tid, uint64_t clear_tid);`
- `do_linux_clone` (line 414) `long do_linux_clone(unsigned long flags, unsigned long newsp, unsigned long ptid, unsigned long ctid, unsigned long tls);`
- `do_group_exit` (line 416) `void do_group_exit(int code);`
- `mm_view_claim_current` (line 417) `void mm_view_claim_current(void);`
- `do_kill_code` (line 418) `int do_kill_code(int pid, int code);`
- `fork_child_settid` (line 421) `void fork_child_settid(void);` - *void     sched_park_capture(proc_t *cur); void     resume_iretq(void); void     yield(void); void     do_exit(int code); long     do_clone(long flags, long newsp); long     do_fork(void); long     do_fork_ex(uint64_t set_tid, uint64_t clear_tid); long     do_linux_clone(unsigned long flags, unsigned long newsp, unsigned long ptid, unsigned long ctid, unsigned long tls); void     do_group_exit(int code); void     mm_view_claim_current(void); int      do_kill_code(int pid, int code); /* Signal a ring-3 fault reports through wait4 (SIGSEGV). define USER_FAULT_SIGNAL 11*
- `aslr_stack_bytes` (line 431) `unsigned long aslr_stack_bytes(void);` - *ASLR jitter, fresh per exec (TSC + ticks + per-exec counter, never zero for stack/brk so consecutive execs differ observably): stack top slides 1..4096 bytes, brk start 1..256 pages past the image, mmap cursor up to 255 pages down, ET_DYN base up to 47 * 2 MB slots up.*
- `aslr_brk_pages` (line 432) `unsigned long aslr_brk_pages(void);`
- `aslr_mmap_pages` (line 433) `unsigned long aslr_mmap_pages(void);`
- `aslr_dyn_base` (line 434) `unsigned long aslr_dyn_base(void);`
- `failure` (line 439) `* failure (negative errno);`
- `do_execve` (line 440) `long do_execve(char *kpath, int kargc, char **kargv);` - *do_execve() - replace the caller's image with a fresh ET_EXEC/ET_DYN program (kernel/sched.c). The caller keeps pid, parent, children, kstack slot family, fd table and limits; everything else (window, VMA, brk view, stack, FPU, FSBASE, name) is rebuilt. Returns only on * failure (negative errno); success enters ring 3 and never returns.*
- `do_thread_spawn` (line 441) `long do_thread_spawn(unsigned long fn, unsigned long stack, unsigned long arg);`
- `do_waitpid` (line 443) `int do_waitpid(int pid);`
- `do_waitpid_nb` (line 444) `int do_waitpid_nb(int pid);`
- `shell_reap_nb` (line 445) `int shell_reap_nb(int *pid_out, int *code_out);`
- `shell_reap_one` (line 446) `int shell_reap_one(int pid, int *code_out);`
- `shell_nchildren` (line 447) `int shell_nchildren(void);`
- `do_waitpid_linux` (line 451) `int do_waitpid_linux(int pid, int nohang, int *found);` - *kstack slot family, fd table and limits; everything else (window, VMA, brk view, stack, FPU, FSBASE, name) is rebuilt. Returns only on * failure (negative errno); success enters ring 3 and never returns. long     do_execve(char *kpath, int kargc, char **kargv); long     do_thread_spawn(unsigned long fn, unsigned long stack, unsigned long arg); int      do_waitpid(int pid); int      do_waitpid_nb(int pid); int      shell_reap_nb(int *pid_out, int *code_out); int      shell_reap_one(int pid, int *code_out); int      shell_nchildren(void); #define WAITPID_NONE (-0x7FFF) /* do_waitpid_linux: the caller has no matching child at all (-ECHILD). define WAITPID_NOCHILD (-0x7FFE)*
- `do_kill` (line 452) `int do_kill(int pid);`
- `timer_tick` (line 453) `void timer_tick(void);`
- `pt_clone_user` (line 456) `uint64_t pt_clone_user(uint64_t parent_cr3);` - *unsigned long arg); int      do_waitpid(int pid); int      do_waitpid_nb(int pid); int      shell_reap_nb(int *pid_out, int *code_out); int      shell_reap_one(int pid, int *code_out); int      shell_nchildren(void); #define WAITPID_NONE (-0x7FFF) /* do_waitpid_linux: the caller has no matching child at all (-ECHILD). #define WAITPID_NOCHILD (-0x7FFE) int do_waitpid_linux(int pid, int nohang, int *found); int      do_kill(int pid); void     timer_tick(void); /* ---- Per-process page tables ----*
- `pt_free_user` (line 457) `void pt_free_user(uint64_t cr3);`
- `caller` (line 462) `* caller (shell mrun) reaps it with do_waitpid. Returns pid or -1. * Programs using mmap/VMA or expecting a shared fd table beyond * O_RDONLY stdin-style use are best-effort in this revision. */ int p`

**Macros:**
- `SCHED_H` (line 2) `#define SCHED_H`
- `PROC_FREE` (line 14) `#define PROC_FREE`
- `PROC_READY` (line 15) `#define PROC_READY`
- `PROC_RUNNING` (line 16) `#define PROC_RUNNING`
- `PROC_BLOCKED` (line 17) `#define PROC_BLOCKED`
- `PROC_ZOMBIE` (line 18) `#define PROC_ZOMBIE`
- `PROC_SWITCHING` (line 22) `#define PROC_SWITCHING`
- `MAX_PROCS` (line 25) `#define MAX_PROCS`
- `PROC_KSTACK_SZ` (line 26) `#define PROC_KSTACK_SZ`
- `MAX_CPUS` (line 29) `#define MAX_CPUS`
- `BOOT_CPU` (line 30) `#define BOOT_CPU`
- `CTX_RBP_OFF` (line 44) `#define CTX_RBP_OFF`
- `CTX_RIP_OFF` (line 45) `#define CTX_RIP_OFF`
- `CTX_RSP_OFF` (line 46) `#define CTX_RSP_OFF`
- `CTX_RFLAGS_OFF` (line 47) `#define CTX_RFLAGS_OFF`
- `PROC_T_SIZE` (line 132) `#define PROC_T_SIZE`
- `PROC_KSTACK_OFF` (line 142) `#define PROC_KSTACK_OFF`
- `PROC_FPU_OFF` (line 147) `#define PROC_FPU_OFF`
- `PROC_PID_OFF` (line 154) `#define PROC_PID_OFF`
- `PROC_FSBASE_OFF` (line 155) `#define PROC_FSBASE_OFF`
- `FPU_SAVE_SZ` (line 157) `#define FPU_SAVE_SZ`
- `FPU_MXCSR_OFF` (line 158) `#define FPU_MXCSR_OFF`
- `FPU_MXCSR_DEFAULT` (line 159) `#define FPU_MXCSR_DEFAULT`
- `SECCOMP_MIN` (line 163) `#define SECCOMP_MIN`
- `SECCOMP_MAX` (line 164) `#define SECCOMP_MAX`
- `SECCOMP_BIT` (line 165) `#define SECCOMP_BIT(n)`
- `SECCOMP_OP_DENY_ONE` (line 168) `#define SECCOMP_OP_DENY_ONE`
- `SECCOMP_OP_ALLOW_ONE` (line 169) `#define SECCOMP_OP_ALLOW_ONE`
- `SECCOMP_OP_DENY_ALL` (line 170) `#define SECCOMP_OP_DENY_ALL`
- `RLIM_OP_SET` (line 177) `#define RLIM_OP_SET`
- `RLIM_OP_GET` (line 178) `#define RLIM_OP_GET`
- `RLIM_AS` (line 179) `#define RLIM_AS`
- `RLIM_CPU` (line 180) `#define RLIM_CPU`
- `RLIM_NOFILE` (line 181) `#define RLIM_NOFILE`
- `RLIM_EXIT_CPU` (line 182) `#define RLIM_EXIT_CPU`
- `NICE_MIN` (line 184) `#define NICE_MIN`
- `NICE_MAX` (line 185) `#define NICE_MAX`
- `NICE_DEFAULT` (line 186) `#define NICE_DEFAULT`
- `SCHED_BASE_QUANTUM` (line 191) `#define SCHED_BASE_QUANTUM`
- `SCHED_NICE_MULT_KEY` (line 192) `#define SCHED_NICE_MULT_KEY`
- `SCHED_NICE_MULT_CHARGE` (line 193) `#define SCHED_NICE_MULT_CHARGE`
- `SCHED_NICE_OFFSET` (line 194) `#define SCHED_NICE_OFFSET`
- `CLONE_VM` (line 197) `#define CLONE_VM`
- `CLONE_FILES` (line 198) `#define CLONE_FILES`
- `LINUX_CLONE_SIGNAL_MASK` (line 200) `#define LINUX_CLONE_SIGNAL_MASK`
- `LINUX_CLONE_VM` (line 201) `#define LINUX_CLONE_VM`
- `LINUX_CLONE_FS` (line 202) `#define LINUX_CLONE_FS`
- `LINUX_CLONE_FILES` (line 203) `#define LINUX_CLONE_FILES`
- `LINUX_CLONE_SIGHAND` (line 204) `#define LINUX_CLONE_SIGHAND`
- `LINUX_CLONE_PIDFD` (line 205) `#define LINUX_CLONE_PIDFD`
- `LINUX_CLONE_PTRACE` (line 206) `#define LINUX_CLONE_PTRACE`
- `LINUX_CLONE_VFORK` (line 207) `#define LINUX_CLONE_VFORK`
- `LINUX_CLONE_PARENT` (line 208) `#define LINUX_CLONE_PARENT`
- `LINUX_CLONE_THREAD` (line 209) `#define LINUX_CLONE_THREAD`
- `LINUX_CLONE_NEWNS` (line 210) `#define LINUX_CLONE_NEWNS`
- `LINUX_CLONE_SYSVSEM` (line 211) `#define LINUX_CLONE_SYSVSEM`
- `LINUX_CLONE_SETTLS` (line 212) `#define LINUX_CLONE_SETTLS`
- `LINUX_CLONE_PARENT_SETTID` (line 213) `#define LINUX_CLONE_PARENT_SETTID`
- `LINUX_CLONE_CHILD_CLEARTID` (line 214) `#define LINUX_CLONE_CHILD_CLEARTID`
- `LINUX_CLONE_DETACHED` (line 215) `#define LINUX_CLONE_DETACHED`
- `LINUX_CLONE_UNTRACED` (line 216) `#define LINUX_CLONE_UNTRACED`
- `LINUX_CLONE_CHILD_SETTID` (line 217) `#define LINUX_CLONE_CHILD_SETTID`
- `LINUX_CLONE_NEWNS_MASK` (line 218) `#define LINUX_CLONE_NEWNS_MASK`
- `LINUX_CLONE_IO` (line 219) `#define LINUX_CLONE_IO`
- `LINUX_SIGCHLD` (line 220) `#define LINUX_SIGCHLD`
- `LINUX_CLONE_THREAD_OK` (line 223) `#define LINUX_CLONE_THREAD_OK`
- `LINUX_CLONE_FORK_OK` (line 228) `#define LINUX_CLONE_FORK_OK`
- `current_pid` (line 312) `#define current_pid`
- `DESKTOP_TICK_INTERVAL` (line 316) `#define DESKTOP_TICK_INTERVAL`
- `TSS_SEL` (line 372) `#define TSS_SEL(cpu)`
- `USER_FAULT_SIGNAL` (line 420) `#define USER_FAULT_SIGNAL`
- `EXECVE_MAX_ARGS` (line 424) `#define EXECVE_MAX_ARGS`
- `EXECVE_MAX_ARG` (line 425) `#define EXECVE_MAX_ARG`
- `WAITPID_NONE` (line 448) `#define WAITPID_NONE`
- `WAITPID_NOCHILD` (line 450) `#define WAITPID_NOCHILD`

**Structs:**
- `cpu` (line 268) - *Fields: cpu_id:           index into cpus[], 0 for BSP cur_pid:           PID of the running process on this CPU syscall_kstack:   kernel stack top exchanged on syscall entry kstack_top:       per-CPU interrupt stack top last_sched_tick:  sys_ticks value of last context switch (Phase 2) lapic_id:         APIC ID from hardware is_bsp:           1 for the boot processor, 0 for APs idle:             1 when CPU is in idle loop (Phase 2: idle thread) irq_depth:        interrupt nesting count for irqsave (Phase 3) idle_proc:        pointer to idle process (Phase 2) run_queue:        opaque pointer to per-CPU run queue (Phase 2)*
- `ctx_regs_t` (line 33) - *Transient: the owner CPU is between "decided to switch away" and "context fully saved".  Never claimable: a steal here would resume a * stale context.  schedule() turns it into READY only after the save. #define PROC_SWITCHING  5 /* ---- Limits ---- #define MAX_PROCS       64 #define PROC_KSTACK_SZ  (16UL * 1024) /* ---- SMP limits ---- #define MAX_CPUS        8 #define BOOT_CPU        0 /* ---- Per-process saved registers (offsets must match ctx_sw.S) ----*
- `proc_t` (line 50) - *Byte offsets into ctx_regs_t for the pure-asm park capture (sched_park_capture in arch/x86/ctx_sw.S, which cannot use C). * Proven by _Static_asserts in kernel/sched.c; never hand-sync. #define CTX_RBP_OFF    48 #define CTX_RIP_OFF    120 #define CTX_RSP_OFF    128 #define CTX_RFLAGS_OFF 136 /* ---- Process Control Block ----*
- `syscall_frame_t` (line 235) - *The frame syscall_entry.S builds on the per-proc kernel stack, lowest address first (SYSCALL_FRAME_WORDS in syscall_asm.h). It ends exactly at the saved top (sc_top_save[pid]); a fork or clone child copies the user * registers from here so it resumes with the caller's full state.*

**Type_Aliases:**
- `kfd_view_t` (line 11) `typedef struct kfd_view kfd_view_t;` - *Forward: full view lives in kernel.h (needs KFILE first); the PCB only carries a pointer, so the incomplete type suffices here and * sched.h stays includable without kernel.h.*
- `limit` (line 375) `typedef struct __attribute__((packed)) { uint16_t limit;` - *Per-CPU TSS selectors: slot 5 + 2*cpu in the runtime GDT (each TSS descriptor occupies two 8-byte slots).  CPU 0 keeps selector 0x28, * exactly as before. #define TSS_SEL(cpu) ((uint16_t)((5 + 2 * (cpu)) * 8)) /* Exported IDTR for APs to load during SMP bring-up.*

**Variables:**
- `cpus` (line 294) `extern cpu_t cpus[MAX_CPUS];`
- `cpu_count` (line 295) `extern int cpu_count;`
- `procs` (line 333) `extern proc_t procs[MAX_PROCS];` - *Invariant: these structures are accessed by the BSP (boot processor) and will be accessed by APs (application processors) when SMP scheduling is enabled.  All modifications must hold sched_lock.  Per-CPU data (no lock needed): - cpu_t cpus[]: each CPU reads only its own entry via this_cpu() - GS base: set to &cpus[cpu_id] for kernel execution  Shared data (protected by sched_lock): - procs[]: the process table - proc_count: the high-water mark of PIDs - scheduler state in schedule(), do_exit(), do_waitpid()*
- `proc_count` (line 334) `extern int proc_count;`
- `sys_ticks` (line 335) `extern volatile uint64_t sys_ticks;`
- `user_program_active` (line 336) `extern volatile int user_program_active;`
- `sched_lock` (line 337) `extern spinlock_t sched_lock;`
- `sched_ready` (line 338) `extern volatile int sched_ready;`
- `ap_idle_proc` (line 356) `extern proc_t ap_idle_proc[MAX_CPUS];` - *APs (application processors) run CLONE_VM threads: same CR3 as their parent, so no brk/mmap view switch and no TLB shootdown is needed. Non-CLONE_VM processes stay on the BSP, which owns the shared g_brk/user_mmap_cur globals (guarded by mm_lock against concurrent brk/mmap syscalls from AP threads).  Per-CPU idle contexts: an AP with no READY thread parks in ap_idle_proc[cpu] (pid -1, never in procs[], never picked by scans) instead of borrowing procs[0], which the BSP owns.  current_pid == -1 on a CPU means that CPU is idle.  smp_dispatches[cpu] counts threads first dispatched on that CPU; the `smp` shell builtin reports it, so parallel execution is observable * over the serial console without a framebuffer.*
- `smp_dispatches` (line 360) `extern volatile unsigned long smp_dispatches[MAX_CPUS];`
- `smp_idle_polls` (line 361) `extern volatile unsigned long smp_idle_polls[MAX_CPUS];`
- `cpu_idle_ticks` (line 364) `extern volatile unsigned long cpu_idle_ticks[MAX_CPUS];` - *Per-CPU idle ticks at 100 Hz for the MINFO cpu selector (see the * sibling definition in kernel/sched.c).*
- `smp_dbg_bad_gs` (line 367) `extern volatile unsigned smp_dbg_bad_gs;` - *Timer ticks that arrived with a GS base outside cpus[] (fail-safe * EOI, no scheduling action).  Zero in a healthy boot.*
- `bsp_idtr` (line 376) `extern idtr_t bsp_idtr;`
- `isr_cnt_kbd` (line 385) `extern volatile unsigned long isr_cnt_kbd;`
- `isr_cnt_mouse` (line 386) `extern volatile unsigned long isr_cnt_mouse;`
- `isr_cnt_sb16` (line 387) `extern volatile unsigned long isr_cnt_sb16;`

#### `seccomp_bpf.h`
**Path:** `headers/seccomp_bpf.h`
**File Doc:** *Docstring: seccomp_bpf.h -- classic BPF checker and interpreter for*

**Functions:**
- `sbpf_check` (line 95) `int sbpf_check(const sbpf_insn *prog, unsigned len, unsigned short *scratch);` - *Validate a program before it ever runs: 1..SBPF_MAX_INSNS instructions, only the opcodes Linux accepts for seccomp, word loads inside seccomp_data at aligned offsets, scratch indices below SBPF_MEMWORDS, no constant zero divisor or modulus, constant shifts below 32, every jump landing inside the program, no scratch word read before every path wrote it, and a RET last. scratch must hold len entries (the per-pc * initialized-scratch masks). 0 when valid, SBPF_ERR_INVALID otherwise.*
- `sbpf_run` (line 100) `unsigned int sbpf_run(const sbpf_insn *prog, unsigned len, const sbpf_data *d);` - *Run a program sbpf_check accepted over one syscall's data; returns the 32-bit action. A runtime division or modulus by a zero X returns * SBPF_RET_KILL_PROCESS.*
- `sbpf_action_rank` (line 104) `int sbpf_action_rank(unsigned int action);` - *Restrictiveness rank of an action (0 = most restrictive): the order * stacked filters are combined in. Unknown actions rank as KILL_PROCESS.*

**Macros:**
- `SECCOMP_BPF_H` (line 12) `#define SECCOMP_BPF_H`
- `SBPF_MAX_INSNS` (line 30) `#define SBPF_MAX_INSNS`
- `SBPF_DATA_SIZE` (line 31) `#define SBPF_DATA_SIZE`
- `SBPF_MEMWORDS` (line 32) `#define SBPF_MEMWORDS`
- `SBPF_WORD` (line 33) `#define SBPF_WORD`
- `SBPF_SHIFT_MAX` (line 34) `#define SBPF_SHIFT_MAX`
- `SBPF_ERR_INVALID` (line 35) `#define SBPF_ERR_INVALID`
- `SBPF_RET_KILL_PROCESS` (line 38) `#define SBPF_RET_KILL_PROCESS`
- `SBPF_RET_KILL_THREAD` (line 39) `#define SBPF_RET_KILL_THREAD`
- `SBPF_RET_TRAP` (line 40) `#define SBPF_RET_TRAP`
- `SBPF_RET_ERRNO` (line 41) `#define SBPF_RET_ERRNO`
- `SBPF_RET_USER_NOTIF` (line 42) `#define SBPF_RET_USER_NOTIF`
- `SBPF_RET_TRACE` (line 43) `#define SBPF_RET_TRACE`
- `SBPF_RET_LOG` (line 44) `#define SBPF_RET_LOG`
- `SBPF_RET_ALLOW` (line 45) `#define SBPF_RET_ALLOW`
- `SBPF_RET_ACTION_FULL` (line 46) `#define SBPF_RET_ACTION_FULL`
- `SBPF_RET_DATA` (line 47) `#define SBPF_RET_DATA`
- `SBPF_AUDIT_ARCH_X86_64` (line 49) `#define SBPF_AUDIT_ARCH_X86_64`
- `SBPF_CLASS` (line 52) `#define SBPF_CLASS(c)`
- `SBPF_LD` (line 53) `#define SBPF_LD`
- `SBPF_LDX` (line 54) `#define SBPF_LDX`
- `SBPF_ST` (line 55) `#define SBPF_ST`
- `SBPF_STX` (line 56) `#define SBPF_STX`
- `SBPF_ALU` (line 57) `#define SBPF_ALU`
- `SBPF_JMP` (line 58) `#define SBPF_JMP`
- `SBPF_RET` (line 59) `#define SBPF_RET`
- `SBPF_MISC` (line 60) `#define SBPF_MISC`
- `SBPF_W` (line 61) `#define SBPF_W`
- `SBPF_IMM` (line 62) `#define SBPF_IMM`
- `SBPF_ABS` (line 63) `#define SBPF_ABS`
- `SBPF_MEM` (line 64) `#define SBPF_MEM`
- `SBPF_LEN` (line 65) `#define SBPF_LEN`
- `SBPF_ADD` (line 66) `#define SBPF_ADD`
- `SBPF_SUB` (line 67) `#define SBPF_SUB`
- `SBPF_MUL` (line 68) `#define SBPF_MUL`
- `SBPF_DIV` (line 69) `#define SBPF_DIV`
- `SBPF_OR` (line 70) `#define SBPF_OR`
- `SBPF_AND` (line 71) `#define SBPF_AND`
- `SBPF_LSH` (line 72) `#define SBPF_LSH`
- `SBPF_RSH` (line 73) `#define SBPF_RSH`
- `SBPF_NEG` (line 74) `#define SBPF_NEG`
- `SBPF_MOD` (line 75) `#define SBPF_MOD`
- `SBPF_XOR` (line 76) `#define SBPF_XOR`
- `SBPF_JA` (line 77) `#define SBPF_JA`
- `SBPF_JEQ` (line 78) `#define SBPF_JEQ`
- `SBPF_JGT` (line 79) `#define SBPF_JGT`
- `SBPF_JGE` (line 80) `#define SBPF_JGE`
- `SBPF_JSET` (line 81) `#define SBPF_JSET`
- `SBPF_K` (line 82) `#define SBPF_K`
- `SBPF_X` (line 83) `#define SBPF_X`
- `SBPF_A` (line 84) `#define SBPF_A`
- `SBPF_TAX` (line 85) `#define SBPF_TAX`
- `SBPF_TXA` (line 86) `#define SBPF_TXA`

**Structs:**
- `sbpf_insn` (line 15) - *Docstring: seccomp_bpf.h -- classic BPF checker and interpreter for Linux seccomp filters (docs/spec/kernel.md, "Linux seccomp-bpf, prctl and /proc/self/exe").  Pure: no kernel state, no allocation, so tests/test_seccomp_bpf.c (make test-seccomp-bpf) drives it on the host. The kernel copies a user sock_fprog, runs sbpf_check once at install time and sbpf_run on every syscall of a filtered process. The instruction and data layouts are the Linux ABI ones (struct sock_filter, struct seccomp_data).  #ifndef SECCOMP_BPF_H #define SECCOMP_BPF_H /* struct sock_filter: 8 bytes.*
- `sbpf_data` (line 23) - *Linux ABI ones (struct sock_filter, struct seccomp_data).  #ifndef SECCOMP_BPF_H #define SECCOMP_BPF_H /* struct sock_filter: 8 bytes. typedef struct { unsigned short code; unsigned char  jt; unsigned char  jf; unsigned int   k; } sbpf_insn; /* struct seccomp_data: 64 bytes.*

#### `select_map.h`
**Path:** `headers/select_map.h`
**File Doc:** *Docstring: select_map.h -- fd_set <-> pollfd translation for select(2).*

**Functions:**
- `select_fd_isset` (line 37) `static inline int select_fd_isset(const unsigned char *set, int fd)`
- `select_fd_put` (line 41) `static inline void select_fd_put(unsigned char *set, int fd)`
- `select_poll_count` (line 46) `static inline unsigned select_poll_count(const unsigned char *r,
                                ...` - *int fd; short events; short revents; } select_pollfd_t; static inline int select_fd_isset(const unsigned char *set, int fd) { return set && fd >= 0 && (set[fd >> 3] & (1u << (fd & 7))) != 0; } static inline void select_fd_put(unsigned char *set, int fd) { if (set && fd >= 0) set[fd >> 3] |= (unsigned char)(1u << (fd & 7)); } /** Docstring: Count fds below nfds present in any of the three sets.*
- `select_poll_build` (line 66) `static inline unsigned select_poll_build(select_pollfd_t *pfd,
                                  ...` - *Docstring: Build the pollfd array for the fds the sets request.  Entries come out in ascending fd order, one per requested fd, with the union of the classes the three sets asked for. The caller sizes the array through select_poll_count with the same arguments.*
- `select_poll_result` (line 95) `static inline unsigned select_poll_result(unsigned char *rout,
                                  ...` - *Docstring: Map poll revents into fresh result sets (Linux classes).  The "in" sets are the kernel-side copies of what the caller requested (roin/win/ein may be NULL); "out" sets are zeroed and receive only fds that were both requested in that set and ready in that class, so an fd armed for write only never appears in the read results. Returns the number of fds ready in at least one set, like Linux select.*
- `select_poll_badfd` (line 131) `static inline int select_poll_badfd(const select_pollfd_t *pfd,
                                 ...` - *(rv & (SELECT_POLLOUT | SELECT_POLLERR))) { select_fd_put(wout, fd); any = 1; } if (eout && select_fd_isset(ein, fd) && (rv & SELECT_POLLPRI)) { select_fd_put(eout, fd); any = 1; } if (any) ready++; } return ready; } /** Docstring: True when any polled fd reported POLLNVAL (a bad fd).*

**Macros:**
- `SELECT_MAP_H` (line 2) `#define SELECT_MAP_H`
- `SELECT_FD_SETSIZE` (line 20) `#define SELECT_FD_SETSIZE`
- `SELECT_FD_SET_BYTES` (line 21) `#define SELECT_FD_SET_BYTES`
- `SELECT_POLLIN` (line 24) `#define SELECT_POLLIN`
- `SELECT_POLLPRI` (line 25) `#define SELECT_POLLPRI`
- `SELECT_POLLOUT` (line 26) `#define SELECT_POLLOUT`
- `SELECT_POLLERR` (line 27) `#define SELECT_POLLERR`
- `SELECT_POLLHUP` (line 28) `#define SELECT_POLLHUP`
- `SELECT_POLLNVAL` (line 29) `#define SELECT_POLLNVAL`

**Structs:**
- `select_pollfd_t` (line 31)

#### `shell.h`
**Path:** `headers/shell.h`
**File Doc:** *shell.h -- shared shell constants and the line reader/parser reused by*

**Functions:**
- `shell_readline_buf` (line 18) `void shell_readline_buf(char *buf, int size);` - *Read one line into buf with arrow-key editing; used by the built-in * editor to edit file text.*
- `shell_parse` (line 21) `int shell_parse(char *line, char **argv, int max_args);` - *Read one line into buf with arrow-key editing; used by the built-in * editor to edit file text. void shell_readline_buf(char *buf, int size); /* Tokenize `line` into up to `max_args` argv entries; returns argc.*
- `shell_parse_long` (line 29) `int shell_parse_long(const char *s, long *out);` - *Strict signed decimal parse for numeric shell/editor operands: an optional sign followed by at least one digit, whole string consumed, fail-closed on empty input, trailing garbage or overflow. Returns 1 and sets *out on success, 0 otherwise. Replaces katol (which stops at the first non-digit and wraps on overflow) at every builtin call * site, so `kill 12abc` is a diagnostic instead of pid 12.*
- `shell_parse_pid` (line 34) `int shell_parse_pid(const char *s, int min_pid, int *out);` - *Bounded pid parse: strict shell_parse_long plus min_pid <= pid < MAX_PROCS. Unifies the wait/kill/vmmap range checks so the bound cannot drift per * call site. Returns 1 and sets *out on success, 0 otherwise.*
- `shell_cmd_sh` (line 39) `int shell_cmd_sh(int argc, char **argv);` - *Execute a shell script: read `path` line by line, skip blanks and `#` comments, parse each line and dispatch it through the normal builtin/ * program path.  Returns 0 on success, 1 on file error.*

**Macros:**
- `SHELL_H` (line 2) `#define SHELL_H`
- `CMD_BUF_SZ` (line 13) `#define CMD_BUF_SZ`
- `MAX_ARGS` (line 14) `#define MAX_ARGS`

#### `sign.h`
**Path:** `headers/sign.h`
**File Doc:** *Docstring: sign.h -- MiniOS binary signing contract.*

**Functions:**
- `sign_pubkey` (line 47) `static inline const unsigned char *sign_pubkey(unsigned id)` - *Docstring: Look up the trusted public key for a key id. * Answers 0 for unknown ids and for the unprovisioned slot.*
- `ed_sha512_init` (line 69) `void ed_sha512_init(ed_sha *c);`
- `ed_sha512_update` (line 70) `void ed_sha512_update(ed_sha *c, const unsigned char *data, unsigned long len);`
- `ed_sha512_final` (line 71) `void ed_sha512_final(ed_sha *c, unsigned char out[64]);`
- `ed25519_verify` (line 75) `int ed25519_verify(const unsigned char sig[64], const unsigned char *msg, unsigned long msglen, const unsigned char pub[32]);` - *Docstring: Verify an Ed25519 signature, 1 valid else 0. * See kernel/ed25519.c for the full contract.*

**Macros:**
- `SIGN_H` (line 17) `#define SIGN_H`
- `SIGN_KEY_DEV` (line 19) `#define SIGN_KEY_DEV`
- `SIGN_KEY_PROD` (line 20) `#define SIGN_KEY_PROD`
- `SIGN_KEYS` (line 21) `#define SIGN_KEYS`
- `SIGN_PUB_BYTES` (line 22) `#define SIGN_PUB_BYTES`
- `SIGN_SIG_BYTES` (line 23) `#define SIGN_SIG_BYTES`
- `SIGN_DESC_BYTES` (line 24) `#define SIGN_DESC_BYTES`
- `SIGN_NOTE_TYPE` (line 25) `#define SIGN_NOTE_TYPE`

**Structs:**
- `ed_sha` (line 61)

#### `smp.h`
**Path:** `headers/smp.h`
**File Doc:** *SMP bring-up: wake the application processors (APs) via the LAPIC INIT/SIPI*

**Functions:**
- `smp_init` (line 41) `void smp_init(void);`
- `smp_ap_entry` (line 42) `void smp_ap_entry(void);`
- `smp_ipi_broadcast` (line 43) `void smp_ipi_broadcast(int vector);` - *PIT-anchored LAPIC calibration (ticks per 10 ms at divide-by-16). Measured once by the BSP in smp_init; the AP periodic timer uses it when MINIOS_AP_TIMER is set. lapic_cal_valid is 0 on the fixed * 625000-tick fallback. extern unsigned lapic_cal_10ms; extern int lapic_cal_valid; void smp_init(void); void smp_ap_entry(void);   /* entry point each AP jumps to from ap_entry.S*
- `smp_nmi_broadcast` (line 44) `void smp_nmi_broadcast(void);` - *PIT-anchored LAPIC calibration (ticks per 10 ms at divide-by-16). Measured once by the BSP in smp_init; the AP periodic timer uses it when MINIOS_AP_TIMER is set. lapic_cal_valid is 0 on the fixed * 625000-tick fallback. extern unsigned lapic_cal_10ms; extern int lapic_cal_valid; void smp_init(void); void smp_ap_entry(void);   /* entry point each AP jumps to from ap_entry.S void smp_ipi_broadcast(int vector);  /* fixed-delivery IPI, all except self*

**Macros:**
- `SMP_H` (line 2) `#define SMP_H`

**Variables:**
- `smp_lock` (line 25) `extern spinlock_t smp_lock;`
- `smp_dbg_svr` (line 30) `extern volatile unsigned smp_dbg_svr;` - *Read-back diagnostics written by the AP after its LAPIC setup; the `smp` builtin prints them so a dead AP's APIC state is visible over * the serial console.*
- `smp_dbg_lvt` (line 31) `extern volatile unsigned smp_dbg_lvt;`
- `smp_dbg_ipis` (line 32) `extern volatile unsigned smp_dbg_ipis;`
- `smp_dbg_sent` (line 33) `extern volatile unsigned smp_dbg_sent;` - *Read-back diagnostics written by the AP after its LAPIC setup; the `smp` builtin prints them so a dead AP's APIC state is visible over * the serial console. extern volatile unsigned smp_dbg_svr; extern volatile unsigned smp_dbg_lvt; extern volatile unsigned smp_dbg_ipis;  /* vector-32 ISRs run on APs*
- `lapic_cal_10ms` (line 38) `extern unsigned lapic_cal_10ms;` - *PIT-anchored LAPIC calibration (ticks per 10 ms at divide-by-16). Measured once by the BSP in smp_init; the AP periodic timer uses it when MINIOS_AP_TIMER is set. lapic_cal_valid is 0 on the fixed * 625000-tick fallback.*
- `lapic_cal_valid` (line 39) `extern int lapic_cal_valid;`

#### `spawn.h`
**Path:** `headers/spawn.h`
**File Doc:** *Docstring: Scalar shared-window view saved across a child run.*

**Functions:**
- `spawn_backup` (line 28) `int spawn_backup(spawn_ctx_t *ctx);` - *Docstring: Save the caller shared-window view into ctx. Heap-owns the VMA pool copy (only the live prefix, never the whole VMA_MAX array), so nested spawns no longer alias one file-static buffer. Returns 0 when the * copy cannot be allocated; the caller must refuse the spawn fail-closed.*
- `spawn_restore` (line 31) `void spawn_restore(spawn_ctx_t *ctx);` - *Docstring: Save the caller shared-window view into ctx. Heap-owns the VMA pool copy (only the live prefix, never the whole VMA_MAX array), so nested spawns no longer alias one file-static buffer. Returns 0 when the * copy cannot be allocated; the caller must refuse the spawn fail-closed. int spawn_backup(spawn_ctx_t *ctx); /** Docstring: Restore a view previously saved by spawn_backup.*
- `spawn_validate_argv` (line 34) `int spawn_validate_argv(int argc, const char **uargv);` - *Docstring: Save the caller shared-window view into ctx. Heap-owns the VMA pool copy (only the live prefix, never the whole VMA_MAX array), so nested spawns no longer alias one file-static buffer. Returns 0 when the * copy cannot be allocated; the caller must refuse the spawn fail-closed. int spawn_backup(spawn_ctx_t *ctx); /** Docstring: Restore a view previously saved by spawn_backup. void spawn_restore(spawn_ctx_t *ctx); /** Docstring: Validate user argv words against the user window.*
- `spawn_copy_argv` (line 39) `char **spawn_copy_argv(int argc, const char **uargv);` - *Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv.*
- `spawn_free_argv` (line 42) `void spawn_free_argv(char **kargv, int argc);` - *Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv. char **spawn_copy_argv(int argc, const char **uargv); /** Docstring: Release a copy produced by spawn_copy_argv with one kfree.*
- `spawn_load_image` (line 45) `unsigned char *spawn_load_image(const char *resolved, unsigned *size_out);` - *Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv. char **spawn_copy_argv(int argc, const char **uargv); /** Docstring: Release a copy produced by spawn_copy_argv with one kfree. void spawn_free_argv(char **kargv, int argc); /** Docstring: Snapshot a resolved path into a kernel buffer.*
- `spawn_execute` (line 48) `int spawn_execute(const char *resolved, const char *redirect, unsigned char *data, unsigned data_size, int argc, char **kargv, const char **uargv_fallback);` - *Docstring: Copy user argv into kernel memory, zero terminated. One heap block serves the vector plus every word through a bump arena; the * caller releases the whole scope with spawn_free_argv. char **spawn_copy_argv(int argc, const char **uargv); /** Docstring: Release a copy produced by spawn_copy_argv with one kfree. void spawn_free_argv(char **kargv, int argc); /** Docstring: Snapshot a resolved path into a kernel buffer. unsigned char *spawn_load_image(const char *resolved, unsigned *size_out); /** Docstring: Run a loaded image by ELF type, return child status.*

**Macros:**
- `SPAWN_H` (line 2) `#define SPAWN_H`

**Structs:**
- `spawn_ctx_t` (line 9) - *#ifndef SPAWN_H #define SPAWN_H #include "kernel.h" #include "vma.h" #include "sched.h" /** Docstring: Scalar shared-window view saved across a child run.*

#### `spinlock.h`
**Path:** `headers/spinlock.h`
**File Doc:** *spinlock.h -- Lightweight spinlock for MiniOS kernel.*

**Functions:**
- `spin_init` (line 46) `static inline void spin_init(spinlock_t *lock)`
- `spin_save_irq` (line 56) `static inline irqflags_t spin_save_irq(void)` - *Host unit-test variants (tests/test_sync.c, `make test-sync`): cli/sti and pushf/popf are privileged and fault in userspace, so the host build spins on the GCC atomics only and treats interrupt state as a dummy value.  Kernel builds never define SYNC_HOST_TEST and always take the * real path in the #else branch below.*
- `spin_restore_irq` (line 57) `static inline void spin_restore_irq(irqflags_t flags)`
- `spin_lock` (line 58) `static inline void spin_lock(spinlock_t *lock)`
- `spin_unlock` (line 64) `static inline void spin_unlock(spinlock_t *lock)`
- `spin_lock_irqsave` (line 68) `static inline void spin_lock_irqsave(spinlock_t *lock, irqflags_t *flags)`
- `spin_unlock_irqrestore` (line 75) `static inline void spin_unlock_irqrestore(spinlock_t *lock, irqflags_t flags)`
- `spin_unlock_keep_irq` (line 80) `static inline void spin_unlock_keep_irq(spinlock_t *lock)`
- `spin_trylock` (line 84) `static inline int spin_trylock(spinlock_t *lock)`
- `spin_save_irq` (line 92) `static inline irqflags_t spin_save_irq(void)` - *__sync_lock_release(&lock->locked); } static inline void spin_unlock_keep_irq(spinlock_t *lock) { __sync_synchronize(); __sync_lock_release(&lock->locked); } static inline int spin_trylock(spinlock_t *lock) { int was = __sync_lock_test_and_set(&lock->locked, 1); if (!was) __sync_synchronize(); return !was; } #else /* Read RFLAGS and disable interrupts.*
- `spin_restore_irq` (line 99) `static inline void spin_restore_irq(irqflags_t flags)` - *int was = __sync_lock_test_and_set(&lock->locked, 1); if (!was) __sync_synchronize(); return !was; } #else /* Read RFLAGS and disable interrupts. static inline irqflags_t spin_save_irq(void) { irqflags_t flags; __asm__ volatile("pushfq; pop %0; cli" : "=r"(flags)); return flags; } /* Restore RFLAGS (including IF) from a saved value.*
- `spin_lock` (line 107) `static inline void spin_lock(spinlock_t *lock)` - *Acquire the lock and disable interrupts. Interrupts are disabled before the CAS loop to prevent ISR re-entry. The memory clobber ensures the compiler does not reorder across the lock. * Use this from ISR context or when a single-level lock is sufficient.*
- `spin_unlock` (line 118) `static inline void spin_unlock(spinlock_t *lock)` - *Release the lock and re-enable interrupts. The release uses __sync_lock_release which is a store-release with * the correct memory ordering.*
- `spin_unlock_keep_irq` (line 130) `static inline void spin_unlock_keep_irq(spinlock_t *lock)` - *Release the lock WITHOUT touching interrupts (IF stays as-is). For context-switch paths: the lock was acquired with interrupts off and they must stay off across the switch, because a timer tick landing between the release and switch_to would park the half-switched state over the incoming thread's ctx.  The incoming * context's own rflags decide IF after the switch.*
- `spin_unlock_irqrestore` (line 150) `static inline void spin_unlock_irqrestore(spinlock_t *lock, irqflags_t flags)` - *Release the lock and restore the saved interrupt state. If the caller's interrupts were enabled before spin_lock_irqsave, * they are re-enabled here.  If they were disabled, they stay disabled.*

**Macros:**
- `SPINLOCK_H` (line 2) `#define SPINLOCK_H`
- `SPINLOCK_INIT` (line 44) `#define SPINLOCK_INIT`

**Structs:**
- `spinlock_t` (line 38)

**Type_Aliases:**
- `irqflags_t` (line 41) `typedef unsigned long irqflags_t;`

#### `sync.h`
**Path:** `headers/sync.h`
**File Doc:** *sync.h -- Blocking synchronization primitives (roadmap Phase 3.1).*

**Functions:**
- `wq_init` (line 50) `void wq_init(wait_queue_t *q);`
- `sleep_on` (line 51) `void sleep_on(wait_queue_t *q);`
- `wake_up` (line 52) `int wake_up(wait_queue_t *q);`
- `wake_up_all` (line 53) `int wake_up_all(wait_queue_t *q);`
- `inheritance` (line 56) `* Priority inheritance (thesis correction 3): a low-priority holder that * blocks a high-priority waiter is boosted to the waiter's effective * priority, transitively along the blocked-on chain, until`
- `mutex_init` (line 72) `void mutex_init(mutex_t *m);`
- `mutex_lock` (line 73) `void mutex_lock(mutex_t *m);`
- `mutex_unlock` (line 74) `void mutex_unlock(mutex_t *m);`
- `mutex_trylock` (line 75) `int mutex_trylock(mutex_t *m);`
- `mutex_note_waiter` (line 76) `void mutex_note_waiter(mutex_t *m, int waiter);`
- `pi_set_base` (line 77) `void pi_set_base(int pid, int prio);`
- `pi_get_eff` (line 78) `int pi_get_eff(int pid);`
- `sem_init` (line 89) `void sem_init(sem_t *s, int value);`
- `sem_wait` (line 90) `void sem_wait(sem_t *s);`
- `sem_post` (line 91) `void sem_post(sem_t *s);`
- `cond_init` (line 103) `void cond_init(cond_t *c);`
- `cond_wait` (line 104) `void cond_wait(cond_t *c, mutex_t *m);`
- `cond_signal` (line 105) `void cond_signal(cond_t *c);`
- `cond_broadcast` (line 106) `void cond_broadcast(cond_t *c);`
- `rwlock_init` (line 124) `void rwlock_init(rwlock_t *rw);`
- `rwlock_read_lock` (line 125) `void rwlock_read_lock(rwlock_t *rw);`
- `rwlock_read_unlock` (line 126) `void rwlock_read_unlock(rwlock_t *rw);`
- `rwlock_write_lock` (line 127) `void rwlock_write_lock(rwlock_t *rw);`
- `rwlock_write_unlock` (line 128) `void rwlock_write_unlock(rwlock_t *rw);`
- `now` (line 130) `* available right now (a reader never takes it while a writer waits). */ int rwlock_read_trylock(rwlock_t *rw);`
- `rwlock_write_trylock` (line 132) `int rwlock_write_trylock(rwlock_t *rw);`

**Macros:**
- `SYNC_H` (line 2) `#define SYNC_H`
- `WQ_NONE` (line 39) `#define WQ_NONE`
- `WAIT_QUEUE_INIT` (line 48) `#define WAIT_QUEUE_INIT`
- `MUTEX_INIT` (line 70) `#define MUTEX_INIT`
- `SEM_INIT` (line 87) `#define SEM_INIT(n)`
- `COND_INIT` (line 101) `#define COND_INIT`
- `RWLOCK_INIT` (line 122) `#define RWLOCK_INIT`

**Structs:**
- `wait_queue_t` (line 42) - *wait-queue linkage: procs chain through proc_t.wq_next, WQ_NONE ends the chain and marks an empty queue.  PIDs start at 1 (sched.c), so a * zeroed proc_t never aliases a queued entry. #define WQ_NONE (-1) /* ---- Wait queues ----*
- `mutex_t` (line 63) - *--- Mutex (blocking, non-recursive) ---- Priority inheritance (thesis correction 3): a low-priority holder that blocks a high-priority waiter is boosted to the waiter's effective priority, transitively along the blocked-on chain, until it releases. pi_set_base assigns a thread's base priority (default 0); pi_get_eff reports the boosted value the scheduler must honor. State lives in sync.c parallel arrays: proc_t is 248 bytes by asm contract (sched.c * asserts it, syscall_entry hardcodes it), so no field can be added.*
- `sem_t` (line 81) - *wait_queue_t waiters; } mutex_t; #define MUTEX_INIT { SPINLOCK_INIT, 0, WQ_NONE, WAIT_QUEUE_INIT } void mutex_init(mutex_t *m); void mutex_lock(mutex_t *m); void mutex_unlock(mutex_t *m); int  mutex_trylock(mutex_t *m); void mutex_note_waiter(mutex_t *m, int waiter); void pi_set_base(int pid, int prio); int  pi_get_eff(int pid); /* ---- Counting semaphore ----*
- `cond_t` (line 97) - *--- Condition variable ---- Always paired with a mutex: cond_wait atomically releases the mutex, sleeps, and re-acquires it before returning (Mesa semantics: re-check * the predicate in a loop).*
- `rwlock_t` (line 114) - *--- Read-write lock (writer-preferring, no recursion) ---- A queued writer announces itself in `writers_waiting`, and new readers yield to it: without that rule a steady stream of readers starves the writer (every reader sees readers == 0 on its way in). The counter is incremented when the writer starts waiting and * decremented when it finally holds the lock, so it never leaks.*

#### `syscall_asm.h`
**Path:** `headers/syscall_asm.h`
**File Doc:** *syscall_asm.h -- numeric contract for arch/x86/syscall_entry.S.*

**Macros:**
- `SYSCALL_ASM_H` (line 2) `#define SYSCALL_ASM_H`
- `SYSCALL_USER_WIN_LO` (line 15) `#define SYSCALL_USER_WIN_LO`
- `SYSCALL_USER_WIN_HI` (line 16) `#define SYSCALL_USER_WIN_HI`
- `SYSCALL_PROC_T_SIZE` (line 17) `#define SYSCALL_PROC_T_SIZE`
- `SYSCALL_PROC_KSTACK_OFF` (line 18) `#define SYSCALL_PROC_KSTACK_OFF`
- `SYSCALL_MAX_PROCS` (line 19) `#define SYSCALL_MAX_PROCS`
- `SYSCALL_CPU_CUR_PID_OFF` (line 20) `#define SYSCALL_CPU_CUR_PID_OFF`
- `SYSCALL_CPU_SC_N_OFF` (line 21) `#define SYSCALL_CPU_SC_N_OFF`
- `SYSCALL_CPU_SC_RIP_OFF` (line 22) `#define SYSCALL_CPU_SC_RIP_OFF`
- `SYSCALL_CPU_SC_PID_OFF` (line 23) `#define SYSCALL_CPU_SC_PID_OFF`
- `SYSCALL_CPU_SC_RET_OFF` (line 24) `#define SYSCALL_CPU_SC_RET_OFF`
- `SYSCALL_CPU_SC_TMP_OFF` (line 25) `#define SYSCALL_CPU_SC_TMP_OFF`
- `SYSCALL_FRAME_WORDS` (line 29) `#define SYSCALL_FRAME_WORDS`

#### `syscalls_proc.h`
**Path:** `headers/syscalls_proc.h`
**File Doc:** *syscalls_proc.h -- process-management syscall handlers shared with the*

**Functions:**
- `dispatcher` (line 5) `* dispatcher (kernel/syscalls.c). These handlers touch only scheduler * state (current_pid, procs[], do_* / seccomp_* / yield) plus the * kernel-wide user_range_ok validator, so they live in their own`
- `sys_minios_nice` (line 12) `long sys_minios_nice(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_minios_clone` (line 13) `long sys_minios_clone(long flags, long newsp, long a3, long a4, long a5, long a6);`
- `sys_minios_thread_spawn` (line 14) `long sys_minios_thread_spawn(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_yield` (line 15) `long sys_linux_yield(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_getpid` (line 16) `long sys_linux_getpid(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_gettid` (line 17) `long sys_linux_gettid(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_fork` (line 18) `long sys_linux_fork(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_clone` (line 19) `long sys_linux_clone(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_vfork` (line 20) `long sys_linux_vfork(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_execve` (line 21) `long sys_linux_execve(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_exit` (line 22) `long sys_linux_exit(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_wait4` (line 23) `long sys_linux_wait4(long a1, long a2, long a3, long a4, long a5, long a6);`
- `sys_linux_kill` (line 24) `long sys_linux_kill(long a1, long a2, long a3, long a4, long a5, long a6);`
- `linux_signal_fatal` (line 31) `int linux_signal_fatal(long sig);` - *Linux signal numbers 1..LINUX_SIGNAL_MAX; a fatal one ends its target. * The foreground shell reports a signal death as exit code 128 + sig. define LINUX_SIGNAL_MAX       64 define LINUX_SIGNAL_EXIT_BASE 128 define LINUX_EXIT_STATUS_MASK 0xff*
- `do_proc_exit` (line 34) `long do_proc_exit(long code);` - *Linux signal numbers 1..LINUX_SIGNAL_MAX; a fatal one ends its target. * The foreground shell reports a signal death as exit code 128 + sig. #define LINUX_SIGNAL_MAX       64 #define LINUX_SIGNAL_EXIT_BASE 128 #define LINUX_EXIT_STATUS_MASK 0xff int linux_signal_fatal(long sig); /* Shared exit path for sys_linux_exit and the exit_group fall-through.*

**Macros:**
- `SYSCALLS_PROC_H` (line 2) `#define SYSCALLS_PROC_H`
- `LINUX_SIGNAL_MAX` (line 28) `#define LINUX_SIGNAL_MAX`
- `LINUX_SIGNAL_EXIT_BASE` (line 29) `#define LINUX_SIGNAL_EXIT_BASE`
- `LINUX_EXIT_STATUS_MASK` (line 30) `#define LINUX_EXIT_STATUS_MASK`

#### `tick.h`
**Path:** `headers/tick.h`
**File Doc:** *Docstring: Tick listener bus contract.*

**Functions:**
- `tick_reset` (line 47) `void tick_reset(void);` - *needs; the bound exists so the tables stay fixed-size. #define TICK_MAX_USB_LISTENERS 2 /** Docstring: Default bus configuration. #define TICK_CONFIG_DEFAULT ((tick_config_t){ \ TICK_MAX_AUDIO_LISTENERS, \ TICK_MAX_DESKTOP_LISTENERS, \ TICK_MAX_USB_LISTENERS \ }) /** Docstring: Periodic effect signature. Context is opaque to the bus. typedef void (*tick_fn_t)(void *ctx); /** Docstring: Reset both listener lists to empty.*
- `tick_register_audio` (line 54) `int tick_register_audio(tick_fn_t fn, void *ctx);` - *Docstring: Register an unconditional BSP audio effect.  Returns 0 on success, -1 when the handler is null or the audio table is full. A refusal changes nothing.*
- `tick_register_desktop` (line 61) `int tick_register_desktop(tick_fn_t fn, void *ctx);` - *Docstring: Register a gated desktop effect.  Returns 0 on success, -1 when the handler is null or the desktop table is full. A refusal changes nothing.*
- `tick_register_usb` (line 69) `int tick_register_usb(tick_fn_t fn, void *ctx);` - *Docstring: Register a polled USB controller effect.  The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.*
- `tick_run_usb` (line 72) `void tick_run_usb(void);` - *Docstring: Register a polled USB controller effect.  The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order.*
- `tick_run_audio` (line 75) `void tick_run_audio(void);` - *Docstring: Register a polled USB controller effect.  The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order.*
- `tick_run_desktop` (line 78) `void tick_run_desktop(void);` - *The xHCI event ring is polled by decision rather than interrupt-driven, so this listener is the polling trigger. Returns 0 on success, -1 when the handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order. void tick_run_audio(void); /** Docstring: Run desktop listeners in registration order.*
- `tick_audio_count` (line 81) `int tick_audio_count(void);` - *handler is null or the USB table is full. A refusal changes nothing.  int tick_register_usb(tick_fn_t fn, void *ctx); /** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order. void tick_run_audio(void); /** Docstring: Run desktop listeners in registration order. void tick_run_desktop(void); /** Docstring: Count registered audio listeners.*
- `tick_desktop_count` (line 84) `int tick_desktop_count(void);` - */** Docstring: Run USB listeners in registration order. void tick_run_usb(void); /** Docstring: Run audio listeners in registration order. void tick_run_audio(void); /** Docstring: Run desktop listeners in registration order. void tick_run_desktop(void); /** Docstring: Count registered audio listeners. int tick_audio_count(void); /** Docstring: Count registered desktop listeners.*
- `tick_desktop_due` (line 92) `int tick_desktop_due(unsigned long long ticks, unsigned interval);` - *Docstring: Pure desktop gating predicate.  Returns nonzero when the given tick count falls on a desktop tick for the given interval. A non-positive interval never fires. Holds for every tick value including zero.*

**Macros:**
- `TICK_H` (line 19) `#define TICK_H`
- `TICK_MAX_AUDIO_LISTENERS` (line 29) `#define TICK_MAX_AUDIO_LISTENERS`
- `TICK_MAX_DESKTOP_LISTENERS` (line 31) `#define TICK_MAX_DESKTOP_LISTENERS`
- `TICK_MAX_USB_LISTENERS` (line 34) `#define TICK_MAX_USB_LISTENERS`
- `TICK_CONFIG_DEFAULT` (line 37) `#define TICK_CONFIG_DEFAULT`

**Structs:**
- `tick_config_t` (line 22) - *gating predicate for the desktop tick.  Design: fixed-size tables, no heap, no locks. Registration happens at boot before sti, dispatch happens in ISR context and only reads. A failed registration returns a negative code and changes nothing. A null entry is never dispatched. Dispatch order equals registration order. Behavior of existing listeners is unchanged; only the call path moves.  #ifndef TICK_H #define TICK_H /** Docstring: Centralized bounds for the tick listener bus.*

#### `tlb.h`
**Path:** `headers/tlb.h`
**File Doc:** *tlb.h - cross-CPU TLB shootdown (docs/spec/smp-sched.md, "TLB shootdown").*

**Functions:**
- `space` (line 4) `* while that CPU keeps running the same address space (CLONE_VM threads on * an AP). Callers clear the PTEs, flush locally, call tlb_shootdown with the * address space, and only then release the frame`
- `tlb_shootdown_count` (line 22) `unsigned long tlb_shootdown_count(void);` - *Shootdowns broadcast and acknowledgement waits that ran out of budget * (reported by the smp builtin).*
- `tlb_shootdown_timeouts` (line 23) `unsigned long tlb_shootdown_timeouts(void);`
- `tlb_nmi_entry` (line 26) `void tlb_nmi_entry(void);` - *Shootdowns broadcast and acknowledgement waits that ran out of budget * (reported by the smp builtin). unsigned long tlb_shootdown_count(void); unsigned long tlb_shootdown_timeouts(void); /* The vector-2 gate (arch/x86/tlb_nmi.S) and its acknowledgement counter.*

**Macros:**
- `TLB_H` (line 10) `#define TLB_H`
- `TLB_RELEASE_BATCH` (line 13) `#define TLB_RELEASE_BATCH`

**Variables:**
- `tlb_shoot_acks` (line 27) `extern volatile unsigned int tlb_shoot_acks;`

#### `tls.h`
**Path:** `headers/tls.h`
**File Doc:** *========== TLS 1.2 client (RFC 5246) ==========*

**Functions:**
- `tls_free_fd` (line 293) `static inline void tls_free_fd(int fd)` - *Kernel built without the TLS engine (net/tls*.c unlinked): no session can ever exist, so the net.c close path needs no call. Inline no-op * keeps the reference without pulling the engine back in.*
- `sha256_init` (line 168) `void sha256_init(struct sha256_ctx *c);`
- `sha256_update` (line 169) `void sha256_update(struct sha256_ctx *c, const unsigned char *data, unsigned len);`
- `sha256_final` (line 170) `void sha256_final(struct sha256_ctx *c, unsigned char out[32]);`
- `sha256` (line 171) `void sha256(const unsigned char *data, unsigned len, unsigned char out[32]);`
- `sha384` (line 172) `void sha384(const unsigned char *data, unsigned len, unsigned char out[48]);`
- `hmac_sha256` (line 174) `void hmac_sha256(const unsigned char *key, unsigned klen, const unsigned char *data, unsigned dlen, unsigned char out[32]);`
- `tls_prf` (line 179) `void tls_prf(const unsigned char *secret, unsigned secret_len, const char *label, const unsigned char *seed, unsigned seed_len, unsigned char *out, unsigned out_len);` - */* ========== Crypto (tls_crypto.c) ========== void sha256_init(struct sha256_ctx *c); void sha256_update(struct sha256_ctx *c, const unsigned char *data, unsigned len); void sha256_final(struct sha256_ctx *c, unsigned char out[32]); void sha256(const unsigned char *data, unsigned len, unsigned char out[32]); void sha384(const unsigned char *data, unsigned len, unsigned char out[48]); void hmac_sha256(const unsigned char *key, unsigned klen, const unsigned char *data, unsigned dlen, unsigned char out[32]); /* TLS 1.2 PRF with SHA-256*
- `aes128_encrypt_block` (line 184) `void aes128_encrypt_block(const unsigned char key[16], const unsigned char in[16], unsigned char out[16]);` - *void sha256_final(struct sha256_ctx *c, unsigned char out[32]); void sha256(const unsigned char *data, unsigned len, unsigned char out[32]); void sha384(const unsigned char *data, unsigned len, unsigned char out[48]); void hmac_sha256(const unsigned char *key, unsigned klen, const unsigned char *data, unsigned dlen, unsigned char out[32]); /* TLS 1.2 PRF with SHA-256 void tls_prf(const unsigned char *secret, unsigned secret_len, const char *label, const unsigned char *seed, unsigned seed_len, unsigned char *out, unsigned out_len); /* AES-128 block cipher (key expansion internal; T-table implementation)*
- `aes128_gcm_seal` (line 189) `int aes128_gcm_seal(const unsigned char key[16], const unsigned char salt[4], unsigned long long seq, const unsigned char *aad, unsigned aad_len, const unsigned char *pt, unsigned pt_len, unsigned cha` - *GCM. Each call seals one record: tag = 16 bytes appended to ct. * Returns 0 on success, -1 on overflow (len > TLS_REC_MAX).*
- `aes128_gcm_open` (line 197) `int aes128_gcm_open(const unsigned char key[16], const unsigned char salt[4], unsigned long long seq, const unsigned char *aad, unsigned aad_len, const unsigned char *ct, unsigned ct_len, const unsign` - *GCM. Each call seals one record: tag = 16 bytes appended to ct. * Returns 0 on success, -1 on overflow (len > TLS_REC_MAX). int aes128_gcm_seal(const unsigned char key[16], const unsigned char salt[4], unsigned long long seq, const unsigned char *aad, unsigned aad_len, const unsigned char *pt, unsigned pt_len, unsigned char *ct, unsigned char tag[16]); /* Returns 0 when the tag verifies, -1 otherwise (constant-time compare).*
- `aes128_gcm_seal_core` (line 208) `int aes128_gcm_seal_core(const unsigned char key[16], const unsigned char nonce[12], const unsigned char *aad, unsigned aad_len, const unsigned char *pt, unsigned pt_len, unsigned char *ct, unsigned c` - *Core GCM with an arbitrary 12-byte nonce (the TLS API above is the 4-byte salt + 8-byte sequence special case). Used by the host tests * against the NIST vectors.*
- `aes128_gcm_open_core` (line 213) `int aes128_gcm_open_core(const unsigned char key[16], const unsigned char nonce[12], const unsigned char *aad, unsigned aad_len, const unsigned char *ct, unsigned ct_len, const unsigned char tag[16], `
- `p256_scalar_mult` (line 222) `int p256_scalar_mult(const unsigned char scalar[32], const unsigned char qx[32], const unsigned char qy[32], unsigned char rx[32], unsigned char ry[32]);` - *secp256r1 / secp384r1: shared Jacobian point arithmetic over NIST * primes. curve: 0 = P-256, 1 = P-384.*
- `p384_scalar_mult` (line 225) `int p384_scalar_mult(const unsigned char scalar[48], const unsigned char qx[48], const unsigned char qy[48], unsigned char rx[48], unsigned char ry[48]);`
- `p256_ecdh` (line 231) `int p256_ecdh(const unsigned char priv[32], const unsigned char peer_x[32], const unsigned char peer_y[32], unsigned char z[32]);` - *ECDH shared secret: Z = priv * peer_pub (P-256). Returns 0 on success, * -1 when the peer point is not on the curve (fail closed).*
- `p256_point_valid` (line 236) `int p256_point_valid(const unsigned char x[32], const unsigned char y[32]);` - *ECDH shared secret: Z = priv * peer_pub (P-256). Returns 0 on success, * -1 when the peer point is not on the curve (fail closed). int  p256_ecdh(const unsigned char priv[32], const unsigned char peer_x[32], const unsigned char peer_y[32], unsigned char z[32]); /* P-256 point validation and helpers for the handshake*
- `p256_pub` (line 237) `int p256_pub(const unsigned char priv[32], unsigned char x[32], unsigned char y[32]);`
- `p256_scalar_valid` (line 239) `int p256_scalar_valid(const unsigned char scalar[32]);`
- `ecdsa_verify` (line 243) `int ecdsa_verify(int curve, const unsigned char pub_x[], const unsigned char pub_y[], const unsigned char digest[], unsigned digest_len, const unsigned char sig[], unsigned sig_len);` - *ECDSA verify over a SHA-256 or SHA-384 digest. curve: 0 = P-256, * 1 = P-384. Returns 0 when the signature verifies.*
- `rsa_pkcs1_verify_sha256` (line 249) `int rsa_pkcs1_verify_sha256(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[32], const unsigned char *sig, unsigned sig_len);` - *RSA PKCS#1 v1.5 signature verify with SHA-256. modulus up to 4096 bits. * digest is the SHA-256 of the signed data. Returns 0 on success.*
- `rsa_pkcs1_verify_sha384` (line 253) `int rsa_pkcs1_verify_sha384(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[48], const unsigned char *sig, unsigned sig_len);`
- `tls_x509_parse_pubkey` (line 261) `int tls_x509_parse_pubkey(const unsigned char *der, unsigned len, struct tls_pubkey *pk);` - *RSA PKCS#1 v1.5 signature verify with SHA-256. modulus up to 4096 bits. * digest is the SHA-256 of the signed data. Returns 0 on success. int  rsa_pkcs1_verify_sha256(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[32], const unsigned char *sig, unsigned sig_len); int  rsa_pkcs1_verify_sha384(const unsigned char *n, unsigned n_len, const unsigned char *e, unsigned e_len, const unsigned char digest[48], const unsigned char *sig, unsigned sig_len); /* ========== X.509 (tls_x509.c) ========== /* Parse one DER certificate into a public key. Returns 0 on success.*
- `now` (line 267) `* window against now (days since epoch). Returns 0 on success. */ int tls_x509_verify_chain(const unsigned char *chain, unsigned chain_len, unsigned cert_lens[], int n_certs, const char *host, long no`
- `tls_handshake` (line 277) `int tls_handshake(int fd, const char *host);` - *Blocking TLS 1.2 handshake over an open TCP socket (net fd index). host is the SNI + certificate hostname. Returns 0 on success, -1 with * a diagnostic on the console. The session lives on the kernel heap.*
- `tls_send` (line 280) `int tls_send(int fd, const char *buf, int len);` - *Blocking TLS 1.2 handshake over an open TCP socket (net fd index). host is the SNI + certificate hostname. Returns 0 on success, -1 with * a diagnostic on the console. The session lives on the kernel heap. int tls_handshake(int fd, const char *host); /* Send len plaintext bytes as one TLS record. All-or-error.*
- `tls_recv` (line 284) `int tls_recv(int fd, char *buf, int len);` - *Receive decrypted application bytes. 0 = clean EOF (close_notify or FIN * at a record boundary); -1 = protocol error / truncation (diagnostic).*
- `tls_sys_handshake` (line 297) `long tls_sys_handshake(long fd, long host);` - *Kernel built without the TLS engine (net/tls*.c unlinked): no session can ever exist, so the net.c close path needs no call. Inline no-op * keeps the reference without pulling the engine back in. static inline void tls_free_fd(int fd) { (void)fd; } #endif /* ========== Syscalls (kernel wiring in tls.c) ==========*
- `tls_sys_send` (line 298) `long tls_sys_send(long fd, long buf, long len);`
- `tls_sys_recv` (line 299) `long tls_sys_recv(long fd, long buf, long len);`

**Macros:**
- `TLS_H` (line 2) `#define TLS_H`
- `TLS_CT_CCS` (line 7) `#define TLS_CT_CCS`
- `TLS_CT_ALERT` (line 8) `#define TLS_CT_ALERT`
- `TLS_CT_HANDSHAKE` (line 9) `#define TLS_CT_HANDSHAKE`
- `TLS_CT_APPDATA` (line 10) `#define TLS_CT_APPDATA`
- `TLS_REC_HEADER` (line 11) `#define TLS_REC_HEADER`
- `TLS_REC_MAX` (line 12) `#define TLS_REC_MAX`
- `TLS_MSG_MAX` (line 13) `#define TLS_MSG_MAX`
- `TLS_PLAIN_MAX` (line 14) `#define TLS_PLAIN_MAX`
- `TLS_VERSION_TLS12` (line 15) `#define TLS_VERSION_TLS12`
- `TLS_VERSION_TLS10` (line 16) `#define TLS_VERSION_TLS10`
- `TLS_HS_CLIENT_HELLO` (line 19) `#define TLS_HS_CLIENT_HELLO`
- `TLS_HS_SERVER_HELLO` (line 20) `#define TLS_HS_SERVER_HELLO`
- `TLS_HS_CERTIFICATE` (line 21) `#define TLS_HS_CERTIFICATE`
- `TLS_HS_SERVER_KEY_EXCHANGE` (line 22) `#define TLS_HS_SERVER_KEY_EXCHANGE`
- `TLS_HS_SERVER_HELLO_DONE` (line 23) `#define TLS_HS_SERVER_HELLO_DONE`
- `TLS_HS_CLIENT_KEY_EXCHANGE` (line 24) `#define TLS_HS_CLIENT_KEY_EXCHANGE`
- `TLS_HS_FINISHED` (line 25) `#define TLS_HS_FINISHED`
- `TLS_CSUITE_ECDHE_RSA_AES128GCM` (line 28) `#define TLS_CSUITE_ECDHE_RSA_AES128GCM`
- `TLS_CSUITE_ECDHE_ECDSA_AES128GCM` (line 29) `#define TLS_CSUITE_ECDHE_ECDSA_AES128GCM`
- `TLS_SIG_RSA_PKCS1_SHA256` (line 32) `#define TLS_SIG_RSA_PKCS1_SHA256`
- `TLS_SIG_ECDSA_P256_SHA256` (line 33) `#define TLS_SIG_ECDSA_P256_SHA256`
- `TLS_SIG_ECDSA_P384_SHA384` (line 34) `#define TLS_SIG_ECDSA_P384_SHA384`
- `TLS_GROUP_SECP256R1` (line 37) `#define TLS_GROUP_SECP256R1`
- `TLS_EXT_SERVER_NAME` (line 40) `#define TLS_EXT_SERVER_NAME`
- `TLS_EXT_SUPPORTED_GROUPS` (line 41) `#define TLS_EXT_SUPPORTED_GROUPS`
- `TLS_EXT_EC_POINT_FORMATS` (line 42) `#define TLS_EXT_EC_POINT_FORMATS`
- `TLS_EXT_SIGNATURE_ALGS` (line 43) `#define TLS_EXT_SIGNATURE_ALGS`
- `TLS_ALERT_LEVEL_WARNING` (line 46) `#define TLS_ALERT_LEVEL_WARNING`
- `TLS_ALERT_LEVEL_FATAL` (line 47) `#define TLS_ALERT_LEVEL_FATAL`
- `TLS_HS_TIMEOUT_MS` (line 50) `#define TLS_HS_TIMEOUT_MS`
- `TLS_READ_TIMEOUT_MS` (line 51) `#define TLS_READ_TIMEOUT_MS`
- `TLS_HOST_MAX` (line 54) `#define TLS_HOST_MAX`
- `TLS_CHAIN_MAX` (line 57) `#define TLS_CHAIN_MAX`
- `TLS_CERT_MAX` (line 58) `#define TLS_CERT_MAX`
- `TLS_BN_4096_WORDS` (line 62) `#define TLS_BN_4096_WORDS`
- `TLS_BN_384_WORDS` (line 63) `#define TLS_BN_384_WORDS`
- `TLS_ROOT_COUNT` (line 68) `#define TLS_ROOT_COUNT`

**Structs:**
- `tls_root` (line 70)
- `sha256_ctx` (line 79)
- `tls_pubkey` (line 85)
- `tls_session` (line 95)

**Variables:**
- `tls_roots` (line 75) `extern const struct tls_root tls_roots[TLS_ROOT_COUNT];`

#### `tls_port.h`
**Path:** `headers/tls_port.h`
**File Doc:** *Portability shim between the MiniOS kernel and the host-side test*

**Functions:**
- `tls_now_days` (line 40) `static inline long tls_now_days(void)`
- `tls_random` (line 44) `static inline void tls_random(unsigned char *out, unsigned len)`
- `these` (line 29) `* of these (tls_test.c). */ extern int tls_test_send(int fd, const char *buf, int len);`
- `tls_test_recv` (line 31) `extern int tls_test_recv(int fd, char *buf, int len);`
- `tls_test_recv_timeout` (line 32) `extern int tls_test_recv_timeout(int fd, char *buf, int len, unsigned long ms);`
- `tls_test_close` (line 33) `extern void tls_test_close(int fd);`
- `sockets` (line 62) `* sockets (glibc maps socket/connect/send/recv/poll onto the MiniOS * Linux ABI numbers the kernel implements);`
- `gettimeofday` (line 64) `* gettimeofday(96) and entropy from /dev/urandom with a time/pid * fallback. Session slots are indexed by raw OS fd, so TLS_FD_MAX * covers both the MiniOS socket range (100+) and host small fds. */ #`
- `tls_u_recv` (line 82) `int tls_u_recv(int fd, char *buf, int len);`
- `tls_u_recv_timeout` (line 83) `int tls_u_recv_timeout(int fd, char *buf, int len, unsigned long ms);`
- `tls_u_close` (line 84) `void tls_u_close(int fd);`
- `syscall` (line 95) `* the MiniOS DNS syscall (200, invoked sig-0-safe). 0 on success. */ int tls_u_resolve(const char *host, unsigned *ip_out);`

**Macros:**
- `TLS_PORT_H` (line 2) `#define TLS_PORT_H`
- `TLS_FD_MAX` (line 18) `#define TLS_FD_MAX`
- `TLS_PRINTF` (line 20) `#define TLS_PRINTF`
- `TLS_MALLOC` (line 21) `#define TLS_MALLOC(n)`
- `TLS_FREE` (line 22) `#define TLS_FREE(p)`
- `TLS_MEMCPY` (line 23) `#define TLS_MEMCPY`
- `TLS_MEMSET` (line 24) `#define TLS_MEMSET`
- `TLS_MEMCMP` (line 25) `#define TLS_MEMCMP`
- `TLS_STRLEN` (line 26) `#define TLS_STRLEN`
- `TLS_SEND` (line 35) `#define TLS_SEND`
- `TLS_RECV` (line 36) `#define TLS_RECV`
- `TLS_RECV_TIMEOUT` (line 37) `#define TLS_RECV_TIMEOUT`
- `TLS_CLOSE` (line 38) `#define TLS_CLOSE`
- `TLS_FD_MAX` (line 71) `#define TLS_FD_MAX`
- `TLS_PRINTF` (line 73) `#define TLS_PRINTF`
- `TLS_MALLOC` (line 74) `#define TLS_MALLOC(n)`
- `TLS_FREE` (line 75) `#define TLS_FREE(p)`
- `TLS_MEMCPY` (line 76) `#define TLS_MEMCPY`
- `TLS_MEMSET` (line 77) `#define TLS_MEMSET`
- `TLS_MEMCMP` (line 78) `#define TLS_MEMCMP`
- `TLS_STRLEN` (line 79) `#define TLS_STRLEN`
- `TLS_SEND` (line 86) `#define TLS_SEND`
- `TLS_RECV` (line 87) `#define TLS_RECV`
- `TLS_RECV_TIMEOUT` (line 88) `#define TLS_RECV_TIMEOUT`
- `TLS_CLOSE` (line 89) `#define TLS_CLOSE`
- `TLS_PRINTF` (line 103) `#define TLS_PRINTF`
- `TLS_MALLOC` (line 104) `#define TLS_MALLOC(n)`
- `TLS_FREE` (line 105) `#define TLS_FREE(p)`
- `TLS_MEMCPY` (line 106) `#define TLS_MEMCPY`
- `TLS_MEMSET` (line 107) `#define TLS_MEMSET`
- `TLS_MEMCMP` (line 108) `#define TLS_MEMCMP`
- `TLS_STRLEN` (line 109) `#define TLS_STRLEN`
- `TLS_SEND` (line 111) `#define TLS_SEND`
- `TLS_RECV` (line 112) `#define TLS_RECV`
- `TLS_RECV_TIMEOUT` (line 113) `#define TLS_RECV_TIMEOUT`
- `TLS_CLOSE` (line 114) `#define TLS_CLOSE`
- `TLS_FD_MAX` (line 115) `#define TLS_FD_MAX`

#### `tls_roots.h`
**Path:** `headers/tls_roots.h`
**File Doc:** *tls_roots.h - embedded CA roots (DER), generated by mkroots.sh.*

*No symbols extracted*

#### `vga_fb.h`
**Path:** `headers/vga_fb.h`
**File Doc:** *Framebuffer geometry. The boot loader probes VESA BIOS Extensions for a*

**Functions:**
- `fb_bytes_per_pixel` (line 30) `int fb_bytes_per_pixel(void);` - *Bytes per framebuffer pixel derived from fb_bpp (1 for 8-bit, 3 for 24, * 4 for 32).*
- `vga_fb_read_rgb` (line 34) `unsigned long vga_fb_read_rgb(int x, int y);` - *Read one desktop pixel as packed 0x00RRGGBB (palette-resolved in 8-bit mode, native in true color). Backstop for `gfx pixel`/`gfx shot`, which * must report colors instead of DAC indices once the DAC is gone.*
- `vga_fb_set_gfx_palette` (line 38) `void vga_fb_set_gfx_palette(const unsigned char *pal);` - *Store the graphics program's 768-byte palette (SYS_PALETTE). In 8-bit mode it is also programmed into the DAC; in true color it is only kept so the * DOOM/Nuklear blits can expand their indexed back-buffers to RGB.*
- `vga_fb_boot_config` (line 40) `void vga_fb_boot_config(void);`
- `SYS_DOOM_FRAME` (line 44) `* and calls SYS_DOOM_FRAME (211) to have the kernel composite it onto the * desktop at its native resolution, so the shell window stays visible. */ #define DOOM_W MINIOS_DOOM_W #define DOOM_H MINIOS_D`
- `SYS_NK_FRAME` (line 63) `* SYS_NK_FRAME (220);`
- `vga_fb_blit_nk_window` (line 75) `void vga_fb_blit_nk_window(void);` - *RGB companion buffer (3 bytes per pixel, R,G,B order, NK_W x NK_H). Mapped by mm_setup_protections like the indexed buffers; presented with * GFX_PRESENT + MINIOS_GFX_BUF_NK_RGB through vga_fb_blit_nk_rgb_window. define NK_RGB_ADDR   MINIOS_NK_RGB_ADDR define NK_RGB_BYTES  MINIOS_NK_RGB_BYTES*
- `vga_fb_blit_nk_rgb_window` (line 76) `void vga_fb_blit_nk_rgb_window(void);`
- `below` (line 99) `* file below (800x600 RGB PNG on the ramdisk, produced by * tools/gen_desktop_pngs.py) is decoded once per boot via stbi_load_file, * stretched to the framebuffer and mapped to a fixed 6x6x6 websafe c`
- `vga_fb_init` (line 177) `void vga_fb_init(void);` - *A scrollback line can be up to the widest terminal (TERM_MAX_COLS), and a long logical line that wrapped across several screen rows is stored whole, * so the ring must not truncate it or a re-rendered line would be cut short. #define SB_MAX_LINES 256 #define SB_LINE_MAX  TERM_MAX_COLS /* ---- Public API ----*
- `vga_fb_term_ring_init` (line 182) `void vga_fb_term_ring_init(void);` - *Feed one completed console line into the terminal history (the text-mode console has no other history) and page that history by one screen (dir -1 up, +1 down). The page keys drive the paging when the * framebuffer terminal is up.*
- `vga_fb_term_feed` (line 183) `void vga_fb_term_feed(const char *line, int len);`
- `vga_fb_history_page` (line 184) `void vga_fb_history_page(int dir);`
- `vga_fb_clear` (line 185) `void vga_fb_clear(void);`
- `vga_fb_pixel` (line 186) `void vga_fb_pixel(int x, int y, uint8_t color);`
- `vga_fb_rect` (line 187) `void vga_fb_rect(int x, int y, int w, int h, uint8_t color);`
- `vga_fb_pixel_rgb` (line 189) `void vga_fb_pixel_rgb(int x, int y, uint8_t r, uint8_t g, uint8_t b);` - *Feed one completed console line into the terminal history (the text-mode console has no other history) and page that history by one screen (dir -1 up, +1 down). The page keys drive the paging when the * framebuffer terminal is up. void     vga_fb_term_ring_init(void); void     vga_fb_term_feed(const char *line, int len); void     vga_fb_history_page(int dir); void     vga_fb_clear(void); void     vga_fb_pixel(int x, int y, uint8_t color); void     vga_fb_rect(int x, int y, int w, int h, uint8_t color); /* Direct RGB primitives: full depth in 32/24-bit, quantized in 8-bit.*
- `vga_fb_rect_rgb` (line 190) `void vga_fb_rect_rgb(int x, int y, int w, int h, uint8_t r, uint8_t g, uint8_t b);`
- `vga_fb_char` (line 191) `void vga_fb_char(int col, int row, char c, uint8_t fg, uint8_t bg);`
- `vga_fb_str` (line 192) `void vga_fb_str(int col, int row, const char *s, uint8_t fg, uint8_t bg);`
- `vga_fb_putc_term` (line 193) `void vga_fb_putc_term(char c);`
- `vga_fb_puts_term` (line 194) `void vga_fb_puts_term(const char *s);`
- `term_clear` (line 195) `void term_clear(void);`
- `vga_fb_text_cursor` (line 196) `void vga_fb_text_cursor(int col);`
- `vga_fb_hide_text_cursor` (line 197) `void vga_fb_hide_text_cursor(void);`
- `fb_read_packed` (line 200) `unsigned long fb_read_packed(int x, int y);` - *Packed-pixel primitives (0x00RRGGBB): the cursor layer draws through * these so it never touches raw framebuffer memory itself.*
- `fb_write_packed` (line 201) `void fb_write_packed(int x, int y, unsigned long rgb);`
- `vga_fb_draw_desktop` (line 202) `void vga_fb_draw_desktop(void);`
- `vga_fb_toggle_fullscreen` (line 203) `void vga_fb_toggle_fullscreen(void);`
- `vga_fb_move_terminal` (line 204) `void vga_fb_move_terminal(int dx, int dy);`
- `vga_fb_snap_window` (line 205) `void vga_fb_snap_window(int zone);`
- `vga_fb_resize` (line 206) `void vga_fb_resize(int dcols, int drows);`
- `vga_fb_reset_default` (line 207) `void vga_fb_reset_default(void);`
- `vga_fb_toggle_minimize` (line 208) `void vga_fb_toggle_minimize(void);`
- `vga_fb_is_minimized` (line 209) `int vga_fb_is_minimized(void);`
- `vga_fb_is_fullscreen` (line 210) `int vga_fb_is_fullscreen(void);`
- `vga_fb_gfx_set_fullscreen` (line 218) `int vga_fb_gfx_set_fullscreen(int on);` - *Graphics window view (headers/wm_gfxview.h owns the math). Fullscreen scales the app to the whole display with the aspect kept and takes the keyboard; hidden minimizes it to its taskbar button while it keeps running. Both glide between frames and return -1 without a program. The origin is the content top-left an app subtracts from SYS_MOUSE coordinates, and map_mouse converts a desktop pointer into the app's * back-buffer space when its view is scaled (1:1 views pass through).*
- `vga_fb_gfx_set_hidden` (line 219) `int vga_fb_gfx_set_hidden(int hide);`
- `vga_fb_gfx_view_name` (line 220) `const char *vga_fb_gfx_view_name(void);`
- `vga_fb_gfx_origin` (line 221) `void vga_fb_gfx_origin(int *x, int *y);`
- `vga_fb_gfx_map_mouse` (line 222) `void vga_fb_gfx_map_mouse(int *x, int *y);`
- `fb_write_row_packed` (line 224) `void fb_write_row_packed(int x, int y, const unsigned int *src, int n);` - *Graphics window view (headers/wm_gfxview.h owns the math). Fullscreen scales the app to the whole display with the aspect kept and takes the keyboard; hidden minimizes it to its taskbar button while it keeps running. Both glide between frames and return -1 without a program. The origin is the content top-left an app subtracts from SYS_MOUSE coordinates, and map_mouse converts a desktop pointer into the app's * back-buffer space when its view is scaled (1:1 views pass through). int      vga_fb_gfx_set_fullscreen(int on); int      vga_fb_gfx_set_hidden(int hide); const char *vga_fb_gfx_view_name(void); void     vga_fb_gfx_origin(int *x, int *y); void     vga_fb_gfx_map_mouse(int *x, int *y); /* Row fast paths of the packed-pixel primitives (clipped once per row).*
- `fb_read_row_packed` (line 225) `void fb_read_row_packed(int x, int y, unsigned int *dst, int n);`
- `vga_fb_close_active` (line 226) `int vga_fb_close_active(void);`
- `vga_fb_focus_next` (line 230) `void vga_fb_focus_next(void);` - *Multi-window manager: Alt-Tab focus cycle, Super-Tab tiling, second * terminal. Focus ids 0/1 = terminals, 2 = graphics window. define WM_FOCUS_GFX 2*
- `vga_fb_focus_id` (line 231) `int vga_fb_focus_id(int id);`
- `vga_fb_focus_get` (line 232) `int vga_fb_focus_get(void);`
- `vga_fb_focus_event` (line 235) `const wm_notify_event_t *vga_fb_focus_event(void);` - *Focus event bus (wm_notify.h): last move for serial-observable state, * plus programmatic reporting for focus moves owned by other units.*
- `vga_fb_focus_report` (line 236) `void vga_fb_focus_report(int before, int source);`
- `vga_fb_theme_name` (line 237) `int vga_fb_theme_name(char *dst, int cap);`
- `vga_fb_ps2_owner` (line 243) `int vga_fb_ps2_owner(int pid);` - *PS/2 ownership for pid: 1 when pid may consume the keyboard port. One keyboard feeds every window, so the focused window owns it: a background gfx job reads only while the gfx window is focused, the shell only while a terminal is. A legacy foreground program owns everything (its shell is * blocked, so there is nobody to steal from). Serial stays shell-only.*
- `vga_fb_nterms_get` (line 244) `int vga_fb_nterms_get(void);`
- `vga_fb_term_split` (line 245) `int vga_fb_term_split(void);`
- `vga_fb_term_close_focused` (line 246) `int vga_fb_term_close_focused(void);`
- `vga_fb_tile_all` (line 247) `void vga_fb_tile_all(void);`
- `vga_fb_layout_set` (line 248) `int vga_fb_layout_set(int mode);`
- `vga_fb_layout_cycle` (line 249) `void vga_fb_layout_cycle(void);`
- `vga_fb_layout_get` (line 250) `int vga_fb_layout_get(void);`
- `vga_fb_layout_name` (line 251) `const char *vga_fb_layout_name(void);`
- `vga_fb_list_windows` (line 252) `void vga_fb_list_windows(void);`
- `wm_close_pending` (line 253) `int wm_close_pending(void);`
- `wm_clear_close` (line 254) `void wm_clear_close(void);`
- `wm_gfx_mode_active` (line 255) `int wm_gfx_mode_active(void);`
- `vga_fb_mouse_tick` (line 256) `void vga_fb_mouse_tick(void);`
- `vga_fb_wait_tick` (line 260) `void vga_fb_wait_tick(void);` - *Desktop tick for a kernel wait loop (foreground process wait, mrun): runs vga_fb_mouse_tick at DESKTOP_TICK_INTERVAL unless the exec frame's * timer ISR already owns it.*
- `vga_fb_mouse_init` (line 261) `void vga_fb_mouse_init(void);`
- `dock_bounce_counts` (line 264) `void dock_bounce_counts(unsigned long *kicks, unsigned long *paints);` - *Dock click bounce (Mac style): arm count and strip repaints while live, * for the serial-observable proof (`wm state` reports both).*
- `dock_click_count` (line 265) `void dock_click_count(unsigned long *edges);`
- `dock_pending_active` (line 266) `int dock_pending_active(void);`
- `pixels` (line 270) `* are heap buffers of packed pixels (fb_read_packed order), 0 on OOM or a * degenerate rect. A disabled effect or a failed snapshot leaves the new * frame in place, so every entry fails closed to a pl`
- `vga_fx_enabled` (line 274) `int vga_fx_enabled(void);`
- `vga_fx_snap_rect` (line 275) `unsigned int *vga_fx_snap_rect(int x, int y, int w, int h);`
- `vga_fx_restore_rect` (line 276) `void vga_fx_restore_rect(int x, int y, int w, int h, const unsigned int *buf);`
- `vga_fx_free` (line 277) `void vga_fx_free(unsigned int *buf);`
- `vga_fx_melt_rect` (line 278) `void vga_fx_melt_rect(int x, int y, int w, int h, const unsigned int *oldb, const unsigned int *newb);`
- `vga_fx_melt_from_black` (line 280) `void vga_fx_melt_from_black(int x, int y, int w, int h, const unsigned int *newb);`
- `vga_fb_set_gfx_mode` (line 291) `void vga_fb_set_gfx_mode(int on);` - *Graphics-mode pointer. SYS_VGA_MODE toggles vga_fb_set_gfx_mode; while a ring-3 graphics program owns the display the kernel idle loop (and with it vga_fb_mouse_tick) never runs, so the frame-composite functions restore the previous frame's pointer before the blit and redraw it after, keeping the * desktop pointer visible over the whole display without leaving trails.*

**Macros:**
- `VGA_FB_H` (line 2) `#define VGA_FB_H`
- `FB_ADDR` (line 22) `#define FB_ADDR`
- `DOOM_W` (line 46) `#define DOOM_W`
- `DOOM_H` (line 47) `#define DOOM_H`
- `DOOM_BACKBUF_ADDR` (line 48) `#define DOOM_BACKBUF_ADDR`
- `GFX_TITLE_DEFAULT` (line 52) `#define GFX_TITLE_DEFAULT`
- `NK_W` (line 67) `#define NK_W`
- `NK_H` (line 68) `#define NK_H`
- `NK_BACKBUF_ADDR` (line 69) `#define NK_BACKBUF_ADDR`
- `NK_RGB_ADDR` (line 73) `#define NK_RGB_ADDR`
- `NK_RGB_BYTES` (line 74) `#define NK_RGB_BYTES`
- `COL_BLACK` (line 82) `#define COL_BLACK`
- `COL_BG` (line 83) `#define COL_BG`
- `COL_TASKBAR` (line 84) `#define COL_TASKBAR`
- `COL_TASKBAR_TXT` (line 85) `#define COL_TASKBAR_TXT`
- `COL_TITLEBAR` (line 86) `#define COL_TITLEBAR`
- `COL_TITLE_TXT` (line 87) `#define COL_TITLE_TXT`
- `COL_TERMINAL` (line 88) `#define COL_TERMINAL`
- `COL_TERM_TXT` (line 89) `#define COL_TERM_TXT`
- `COL_TERM_CUR` (line 90) `#define COL_TERM_CUR`
- `COL_BORDER` (line 91) `#define COL_BORDER`
- `COL_WHITE` (line 92) `#define COL_WHITE`
- `COL_SHADOW` (line 93) `#define COL_SHADOW`
- `COL_HIGHLIGHT` (line 94) `#define COL_HIGHLIGHT`
- `COL_SCROLLBAR` (line 95) `#define COL_SCROLLBAR`
- `COL_SCROLL_THUMB` (line 96) `#define COL_SCROLL_THUMB`
- `WALLPAPER_PATH` (line 103) `#define WALLPAPER_PATH`
- `WALL_PAL_BASE` (line 104) `#define WALL_PAL_BASE`
- `WALL_PAL_SIZE` (line 105) `#define WALL_PAL_SIZE`
- `FONT_W` (line 107) `#define FONT_W`
- `FONT_H` (line 108) `#define FONT_H`
- `TERM_MAX_COLS` (line 113) `#define TERM_MAX_COLS`
- `TERM_MAX_ROWS` (line 114) `#define TERM_MAX_ROWS`
- `TASKBAR_H` (line 117) `#define TASKBAR_H`
- `TASKBAR_PAD` (line 118) `#define TASKBAR_PAD`
- `TASKBAR_CLOCK_CH` (line 119) `#define TASKBAR_CLOCK_CH`
- `TASKBAR_VOL_CH` (line 120) `#define TASKBAR_VOL_CH`
- `TASKBAR_VOL_STEP` (line 121) `#define TASKBAR_VOL_STEP`
- `TASKBAR_ICON_W` (line 122) `#define TASKBAR_ICON_W`
- `TASKBAR_BTN_W` (line 123) `#define TASKBAR_BTN_W`
- `TASKBAR_KBD_CH` (line 125) `#define TASKBAR_KBD_CH`
- `TASKBAR_KBD_W` (line 126) `#define TASKBAR_KBD_W`
- `TASKBAR_THEME_CH` (line 128) `#define TASKBAR_THEME_CH`
- `TASKBAR_THEME_W` (line 129) `#define TASKBAR_THEME_W`
- `TILING_LEFT` (line 132) `#define TILING_LEFT`
- `TILING_RIGHT` (line 133) `#define TILING_RIGHT`
- `TILING_TOP` (line 134) `#define TILING_TOP`
- `TILING_BOTTOM` (line 135) `#define TILING_BOTTOM`
- `TILING_TOP_LEFT` (line 136) `#define TILING_TOP_LEFT`
- `TILING_TOP_RIGHT` (line 137) `#define TILING_TOP_RIGHT`
- `TILING_BOTTOM_LEFT` (line 138) `#define TILING_BOTTOM_LEFT`
- `TILING_BOTTOM_RIGHT` (line 139) `#define TILING_BOTTOM_RIGHT`
- `SCROLLBAR_W` (line 142) `#define SCROLLBAR_W`
- `SCROLLBAR_PAD` (line 143) `#define SCROLLBAR_PAD`
- `WM_BTN_W` (line 148) `#define WM_BTN_W`
- `WM_BTN_H` (line 149) `#define WM_BTN_H`
- `WM_BTN_PAD` (line 150) `#define WM_BTN_PAD`
- `WM_BTN_MIN` (line 151) `#define WM_BTN_MIN`
- `WM_BTN_MAX` (line 152) `#define WM_BTN_MAX`
- `WM_BTN_CLOSE` (line 153) `#define WM_BTN_CLOSE`
- `SB_MAX_LINES` (line 173) `#define SB_MAX_LINES`
- `SB_LINE_MAX` (line 174) `#define SB_LINE_MAX`
- `WM_FOCUS_GFX` (line 229) `#define WM_FOCUS_GFX`

**Structs:**
- `mouse_state_t` (line 159) - *Title-bar window controls (minimize, maximize, close). Drawn as a strip of three FONT_W-wide glyph buttons at the right end of any titled window * (terminal, DOOM, Nuklear); the mouse tick hit-tests them before drag. #define WM_BTN_W       FONT_W #define WM_BTN_H       FONT_H #define WM_BTN_PAD     2 #define WM_BTN_MIN     1 #define WM_BTN_MAX     2 #define WM_BTN_CLOSE   3 /* Terminal geometry (set by vga_fb layout engine) extern int term_x, term_y, term_cols, term_rows; /* ---- Mouse state (updated by IRQ12 handler in sched.c) ----*

**Variables:**
- `fb_width` (line 23) `extern int fb_width;` - *high-resolution linear framebuffer (32-bit true color first, then the 8-bit-palette modes) and records width, height, pitch, physical base and bits per pixel in the fixed VBE_INFO_ADDR struct; vga_fb_boot_config loads them into the globals below before the kernel maps the framebuffer. Without VBE the values are the Mode 13h defaults (320x200x8, phys 0xA0000). In a true-color mode the kernel's palette-index drawing is expanded to RGB on write, so desktop, icons and wallpaper are no longer quantized to the 256-entry VGA DAC; in 8-bit mode the DAC path is used unchanged. FB_ADDR is the fixed virtual address in the user window that both the kernel desktop and graphics programs write through. It sits in the reserved tail above DOOM_BACKBUF_ADDR (which is also the brk cap), so a program's heap can never grow over the framebuffer. All three pinned addresses derive from * progs/minios_abi.h (single source of truth for the kernel-ABI layout). define FB_ADDR    ((volatile uint8_t *)MINIOS_FB_ADDR)*
- `fb_height` (line 24) `extern int fb_height;`
- `fb_pitch` (line 25) `extern int fb_pitch;`
- `fb_bpp` (line 26) `extern int fb_bpp;`
- `fb_phys_base` (line 27) `extern unsigned long fb_phys_base;`
- `gfx_win_title` (line 50) `extern const char *gfx_win_title;`
- `gfx_frames_composited` (line 59) `extern unsigned long gfx_frames_composited;` - *Number of frames a ring-3 graphics program (DOOM, Quake 2, Nuklear) has composited through SYS_DOOM_FRAME / SYS_NK_FRAME since boot. The shell's `gfx frames` builtin reports it over the serial console, so the BDD suite can prove a game actually rendered frames -- not merely launched -- by * running a demo and checking the counter climbed.*
- `nk_win_y` (line 79) `extern int nk_win_x, nk_win_y;` - *Window origin of the last Nuklear composite, so SYS_NK_FRAME can report * where the UI landed for mouse-coordinate translation.*
- `term_rows` (line 156) `extern int term_x, term_y, term_cols, term_rows;` - *Title-bar window controls (minimize, maximize, close). Drawn as a strip of three FONT_W-wide glyph buttons at the right end of any titled window * (terminal, DOOM, Nuklear); the mouse tick hit-tests them before drag. #define WM_BTN_W       FONT_W #define WM_BTN_H       FONT_H #define WM_BTN_PAD     2 #define WM_BTN_MIN     1 #define WM_BTN_MAX     2 #define WM_BTN_CLOSE   3 /* Terminal geometry (set by vga_fb layout engine)*
- `mouse_state` (line 167) `extern mouse_state_t mouse_state;`
- `fx_melts_completed` (line 284) `extern unsigned long fx_melts_completed;` - *Melt transitions completed since boot (boot melt counts, so a fresh shell already reports 1 with the effect on). Serial-observable proof the melts * ran, in the same spirit as `gfx frames`.*
- `vga_fb_active` (line 293) `extern int vga_fb_active;`

#### `vga_fx.h`
**Path:** `headers/vga_fx.h`
**File Doc:** *Docstring: DOOM-melt desktop effect contract for MiniOS.*

**Functions:**
- `vga_fx_rand` (line 30) `static inline unsigned long vga_fx_rand(unsigned long *s)` - *typedef struct { int step_px; int frame_ms; int max_delay; unsigned long seed; } vga_fx_config_t; /** Docstring: Default melt pacing: 8 px per frame, 8 ms per frame. #define VGA_FX_CONFIG_DEFAULT { 8, 8, 16, 0x1F2E3D4CUL } /** Docstring: Widest transition the column array can describe. #define VGA_FX_COLS_MAX 1024 /** Docstring: One xorshift32 step, the melt's deterministic PRNG.*
- `vga_fx_init_cols` (line 47) `static inline int vga_fx_init_cols(const vga_fx_config_t *cfg, int *cols, int w)` - *Docstring: Seed consecutive column fronts with staggered delays. Mirrors f_wipe.c: first column waits a random 0..15 frames, each next * column drifts by -1..+1, clamped at zero, -16 repaired to -15.*
- `vga_fx_advance` (line 71) `static inline int vga_fx_advance(const vga_fx_config_t *cfg, int *cols, int w, int h)` - *Docstring: Advance every column front one melt frame. * Returns 1 when every front reached the rect bottom, 0 otherwise.*
- `vga_fx_front` (line 97) `static inline int vga_fx_front(int col_y, int h)` - *done = 0; } else if (cols[i] < h) { int dy = (cols[i] < 16) ? cols[i] + 1 : step; cols[i] += dy; if (cols[i] > h) { cols[i] = h; } done = 0; } } return done; } /** Docstring: Rows [0, front) of one column already show the new frame.*
- `vga_fx_clamp_rect` (line 109) `static inline int vga_fx_clamp_rect(int *x, int *y, int *w, int *h, int fb_w, int fb_h)` - */** Docstring: Rows [0, front) of one column already show the new frame. static inline int vga_fx_front(int col_y, int h) { if (col_y < 0) { return 0; } if (col_y > h) { return h; } return col_y; } /** Docstring: Clamp a transition rect inside the framebuffer.*

**Macros:**
- `VGA_FX_H` (line 13) `#define VGA_FX_H`
- `VGA_FX_CONFIG_DEFAULT` (line 24) `#define VGA_FX_CONFIG_DEFAULT`
- `VGA_FX_COLS_MAX` (line 27) `#define VGA_FX_COLS_MAX`

**Structs:**
- `vga_fx_config_t` (line 16) - *Single-file header-only contract owning the melt transition logic the desktop plays when windows appear or disappear and on first boot. The algorithm mirrors progs/doomgeneric/f_wipe.c wipe_initMelt/wipe_doMelt: per-column fronts start with staggered negative delays, then scroll the new frame down over the old one column by column. Pure integer logic over caller-owned arrays, so it stays host-testable; the kernel keeps owning the framebuffer, heap and pacing and only consumes the fronts. All functions fail closed on degenerate input.  #ifndef VGA_FX_H #define VGA_FX_H /** Docstring: Centralized effect configuration, no magic numbers.*

#### `vma.h`
**Path:** `headers/vma.h`

**Functions:**
- `vma_tree_init` (line 64) `void vma_tree_init(void);`
- `vma_tree_insert` (line 65) `vma_node_t *vma_tree_insert(vma_node_t **root, unsigned long base, unsigned long len);`
- `vma_tree_find` (line 66) `vma_node_t *vma_tree_find(vma_node_t *root, unsigned long base);`
- `vma_tree_find_containing` (line 67) `vma_node_t *vma_tree_find_containing(vma_node_t *root, unsigned long va);`
- `vma_tree_delete` (line 68) `int vma_tree_delete(vma_node_t **root, unsigned long base);`
- `vma_ctx_init` (line 69) `void vma_ctx_init(vma_ctx_t *c, vma_node_t *pool);`
- `vma_ctx_bind` (line 70) `void vma_ctx_bind(vma_ctx_t *c);`
- `vma_ctx_save` (line 71) `void vma_ctx_save(vma_ctx_t *c);`
- `vma_view_save` (line 86) `void vma_view_save(vma_view_t *v);`
- `vma_view_load` (line 87) `void vma_view_load(const vma_view_t *v);`
- `vma_ctx_alloc` (line 90) `vma_ctx_t *vma_ctx_alloc(void);` - *Heap-backed contexts live in sched.c (vma.c stays host-testable): * alloc returns a fresh context with a private pool, or 0 on OOM.*
- `vma_ctx_free` (line 91) `void vma_ctx_free(vma_ctx_t *c);`

**Macros:**
- `VMA_H` (line 2) `#define VMA_H`
- `VMA_MAX` (line 31) `#define VMA_MAX`

**Structs:**
- `vma_node` (line 21)
- `vma_ctx_t` (line 44) - *Per-process VMA context (multitask foundation): every non-CLONE_VM process owns its live/free trees plus a private node pool, so two concurrent jobs never corrupt each other's mmap bookkeeping the way the old single global tree did (the DOOM-in-isolation #GP came from exactly that: a fresh window over a stale shared tree). CLONE_VM threads share their parent's context pointer. The kernel-global VMA_NIL/roots/pool below are a *view* onto the running process's context, rebound by vma_ctx_bind on every brk/mmap-view switch; the legacy single-window path keeps using the static vma_legacy context, so its behavior is byte-for-byte unchanged. Pools live on the kernel * heap (a static per-proc pool would blow the USER_LOAD_BASE budget).*
- `vma_view_t` (line 76) - *Opaque snapshot of the bound view (all globals vma_ctx_bind swaps, including the MRU). The ld.so child-window dance saves the spawner view, binds the child, and restores exactly, so a stale MRU can * never hand one window's node to another.*

**Type_Aliases:**
- `base` (line 20) `typedef struct vma_node { unsigned long base;` - *Replaces the former flat mmap_used/mmap_free arrays with an O(log n) tree.  A single fixed node pool backs the tree for the life of one ring-3 program; both the live and free trees draw from it.  The pool is reset by vma_tree_init on every exec, so a fresh program starts empty.  The current kernel runs a single address space, so the tree is a set of process-wide globals (vma_live_root, vma_free_root, VMA_NIL, vma_pool) rather than a per-process instance.  The SPAWN syscall saves and restores those globals across a child ET_EXEC/DYN execution.  All operations are integer-only and free of kernel dependencies, which lets the tree be exercised host-side by tests/test_vma.c.*

**Variables:**
- `VMA_NIL` (line 55) `extern vma_node_t *VMA_NIL;`
- `vma_live_root` (line 56) `extern vma_node_t *vma_live_root;`
- `vma_free_root` (line 57) `extern vma_node_t *vma_free_root;`
- `vma_pool` (line 58) `extern vma_node_t vma_pool[VMA_MAX];`
- `vma_pool_n` (line 59) `extern int vma_pool_n;`
- `vma_spare` (line 60) `extern vma_node_t *vma_spare;`
- `vma_pool_ptr` (line 61) `extern vma_node_t *vma_pool_ptr;`
- `vma_legacy` (line 62) `extern vma_ctx_t vma_legacy;`

#### `wm_events.h`
**Path:** `headers/wm_events.h`
**File Doc:** *Docstring: Window event contract for the MiniOS desktop.*

**Functions:**
- `wm_is_click_edge` (line 52) `static inline int wm_is_click_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons)` - *int button; int wheel; } wm_event_t; /** Docstring: Centralized event translator configuration. typedef struct { int left_mask; int wheel_step; } wm_event_config_t; /** Docstring: Default event configuration matching the PS/2 mouse path. #define WM_EVENT_CONFIG_DEFAULT { 1, 3 } /** Docstring: True on the rising edge of the left button.*
- `wm_is_release_edge` (line 59) `static inline int wm_is_release_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_but...` - *int wheel_step; } wm_event_config_t; /** Docstring: Default event configuration matching the PS/2 mouse path. #define WM_EVENT_CONFIG_DEFAULT { 1, 3 } /** Docstring: True on the rising edge of the left button. static inline int wm_is_click_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons) { int mask = (cfg != 0 && cfg->left_mask != 0) ? cfg->left_mask : 1; return (curr_buttons & mask) && !(prev_buttons & mask); } /** Docstring: True on the falling edge of the left button.*
- `wm_translate_event` (line 66) `static inline wm_event_t wm_translate_event(const wm_event_config_t *cfg, const wm_mouse_t *prev,...` - *static inline int wm_is_click_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons) { int mask = (cfg != 0 && cfg->left_mask != 0) ? cfg->left_mask : 1; return (curr_buttons & mask) && !(prev_buttons & mask); } /** Docstring: True on the falling edge of the left button. static inline int wm_is_release_edge(const wm_event_config_t *cfg, int prev_buttons, int curr_buttons) { int mask = (cfg != 0 && cfg->left_mask != 0) ? cfg->left_mask : 1; return !(curr_buttons & mask) && (prev_buttons & mask); } /** Docstring: Translate two consecutive mouse snapshots into one event.*
- `wm_event_suppresses_drag` (line 104) `static inline int wm_event_suppresses_drag(const wm_event_t *evt)` - *return evt; } if (curr->wheel != 0) { evt.type = WM_EVT_SCROLL; return evt; } if (curr->x != prev->x || curr->y != prev->y) { evt.type = WM_EVT_MOVE; return evt; } return evt; } /** Docstring: True when the event must suppress a title drag on this tick.*
- `wm_combo_lookup` (line 201) `static inline int wm_combo_lookup(int alt, int altgr, int sup, int e0, int sc, int path, int *zon...` - *{1, 0, 1, WM_SC_HOME, WM_PATH_COOKED, WM_COMBO_SNAP, WM_SNAP_TOP_LEFT}, {1, 0, 1, WM_SC_END, WM_PATH_COOKED, WM_COMBO_SNAP, WM_SNAP_BOTTOM_RIGHT}, {0, 1, 1, WM_SC_UP, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_TOP}, {0, 1, 1, WM_SC_DOWN, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_BOTTOM}, {0, 1, 1, WM_SC_LEFT, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_LEFT}, {0, 1, 1, WM_SC_RIGHT, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_RIGHT}, {0, 1, 1, WM_SC_HOME, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_TOP_LEFT}, {0, 1, 1, WM_SC_END, WM_PATH_COOKED | WM_PATH_RAW, WM_COMBO_SNAP, WM_SNAP_BOTTOM_RIGHT} }; /** Docstring: Row count of the shared combo table. #define WM_COMBOS_N (sizeof(WM_COMBOS) / sizeof(WM_COMBOS[0])) /** Docstring: Lookup one Alt/Super combo, fail closed on AltGr or mismatch.*
- `wm_combo_lookup_mods` (line 238) `static inline int wm_combo_lookup_mods(const modifier_state_t *st, int e0, int sc, int path, int ...` - *continue; } if (!(WM_COMBOS[i].paths & path)) { continue; } if (zone_out != 0) { zone_out = WM_COMBOS[i].zone; } return WM_COMBOS[i].action; } return WM_COMBO_NONE; } /** Docstring: Lookup through one modifier state, AltGr fail-closed.*

**Macros:**
- `WM_EVENTS_H` (line 11) `#define WM_EVENTS_H`
- `WM_EVENT_CONFIG_DEFAULT` (line 49) `#define WM_EVENT_CONFIG_DEFAULT`
- `WM_SC_TAB` (line 110) `#define WM_SC_TAB`
- `WM_SC_ENTER` (line 111) `#define WM_SC_ENTER`
- `WM_SC_MINUS` (line 112) `#define WM_SC_MINUS`
- `WM_SC_EQUAL` (line 113) `#define WM_SC_EQUAL`
- `WM_SC_ZERO` (line 114) `#define WM_SC_ZERO`
- `WM_SC_Q` (line 115) `#define WM_SC_Q`
- `WM_SC_LBRACKET` (line 116) `#define WM_SC_LBRACKET`
- `WM_SC_RBRACKET` (line 117) `#define WM_SC_RBRACKET`
- `WM_SC_M` (line 118) `#define WM_SC_M`
- `WM_SC_X` (line 119) `#define WM_SC_X`
- `WM_SC_UP` (line 120) `#define WM_SC_UP`
- `WM_SC_DOWN` (line 121) `#define WM_SC_DOWN`
- `WM_SC_LEFT` (line 122) `#define WM_SC_LEFT`
- `WM_SC_RIGHT` (line 123) `#define WM_SC_RIGHT`
- `WM_SC_HOME` (line 124) `#define WM_SC_HOME`
- `WM_SC_END` (line 125) `#define WM_SC_END`
- `WM_SNAP_LEFT` (line 128) `#define WM_SNAP_LEFT`
- `WM_SNAP_RIGHT` (line 129) `#define WM_SNAP_RIGHT`
- `WM_SNAP_TOP` (line 130) `#define WM_SNAP_TOP`
- `WM_SNAP_BOTTOM` (line 131) `#define WM_SNAP_BOTTOM`
- `WM_SNAP_TOP_LEFT` (line 132) `#define WM_SNAP_TOP_LEFT`
- `WM_SNAP_TOP_RIGHT` (line 133) `#define WM_SNAP_TOP_RIGHT`
- `WM_SNAP_BOTTOM_LEFT` (line 134) `#define WM_SNAP_BOTTOM_LEFT`
- `WM_SNAP_BOTTOM_RIGHT` (line 135) `#define WM_SNAP_BOTTOM_RIGHT`
- `WM_PATH_COOKED` (line 138) `#define WM_PATH_COOKED`
- `WM_PATH_RAW` (line 139) `#define WM_PATH_RAW`
- `WM_COMBOS_N` (line 198) `#define WM_COMBOS_N`

**Structs:**
- `wm_mouse_t` (line 25) - *#define WM_EVENTS_H #include "drivers/modifiers.h" /** Docstring: Discrete window manager event kinds. typedef enum { WM_EVT_NONE = 0, WM_EVT_CLICK = 1, WM_EVT_RELEASE = 2, WM_EVT_MOVE = 3, WM_EVT_SCROLL = 4 } wm_event_type_t; /** Docstring: Raw mouse snapshot consumed by the translator.*
- `wm_event_t` (line 34) - *WM_EVT_MOVE = 3, WM_EVT_SCROLL = 4 } wm_event_type_t; /** Docstring: Raw mouse snapshot consumed by the translator. typedef struct { int x; int y; int buttons; int wheel; int present; } wm_mouse_t; /** Docstring: Translated window manager event.*
- `wm_event_config_t` (line 43) - *int wheel; int present; } wm_mouse_t; /** Docstring: Translated window manager event. typedef struct { wm_event_type_t type; int x; int y; int button; int wheel; } wm_event_t; /** Docstring: Centralized event translator configuration.*
- `wm_combo_t` (line 158) - *WM_COMBO_FOCUS_NEXT = 1, WM_COMBO_TILE_ALL = 2, WM_COMBO_FULLSCREEN = 3, WM_COMBO_MINIMIZE = 4, WM_COMBO_CLOSE = 5, WM_COMBO_SNAP = 6, WM_COMBO_RESIZE_DEC_W = 7, WM_COMBO_RESIZE_INC_W = 8, WM_COMBO_RESIZE_DEC_BOTH = 9, WM_COMBO_RESIZE_INC_BOTH = 10, WM_COMBO_RESET = 11 } wm_combo_action_t; /** Docstring: One row of the shared Alt/Super combo table.*

#### `wm_focus.h`
**Path:** `headers/wm_focus.h`
**File Doc:** *Docstring: Focus manager contract for the MiniOS desktop.*

**Functions:**
- `wm_focus_selectable` (line 23) `static inline int wm_focus_selectable(const wm_focus_state_t *st, int id)` - *#ifndef WM_FOCUS_H #define WM_FOCUS_H #include "wm_window.h" /** Docstring: Focus state snapshot consumed by every transition. typedef struct { int focus; int nterms; int present[4]; int gfx_active; } wm_focus_state_t; /** Docstring: True when id is a selectable focus target in this state.*
- `wm_focus_next` (line 38) `static inline int wm_focus_next(const wm_focus_state_t *st)` - *{ if (st == 0) { return 0; } if (id == WM_WINDOW_GFX_ID) { return st->gfx_active ? 1 : 0; } if (id < 0 || id >= st->nterms || id >= 4) { return 0; } return st->present[id] ? 1 : 0; } /** Docstring: Next focus id in rotation order, unchanged when < 2 targets.*
- `wm_focus_set` (line 55) `static inline int wm_focus_set(const wm_focus_state_t *st, int id)` - *int i; if (st == 0) { return 0; } for (i = 0; i < 4; i++) { flat[i] = 0; } for (i = 0; i < st->nterms && i < 4; i++) { flat[i] = st->present[i]; } return wm_focus_next_id(flat, st->nterms > 4 ? 4 : st->nterms, st->gfx_active, st->focus); } /** Docstring: Validated focus assignment, -1 when id is not selectable.*

**Macros:**
- `WM_FOCUS_H` (line 10) `#define WM_FOCUS_H`

**Structs:**
- `wm_focus_state_t` (line 15) - *Docstring: Focus manager contract for the MiniOS desktop.  Single-file header-only contract owning focus state transitions. Focus ids share one space across terminals and the graphics window; every transition validates against present flags and the graphics mode so an invalid id can never steal the keyboard. The state struct carries no kernel dependency, keeping all transitions host-testable.  #ifndef WM_FOCUS_H #define WM_FOCUS_H #include "wm_window.h" /** Docstring: Focus state snapshot consumed by every transition.*

#### `wm_geom.h`
**Path:** `headers/wm_geom.h`
**File Doc:** *Docstring: Window geometry contract for the MiniOS desktop.*

**Functions:**
- `wm_rect_valid` (line 33) `static inline int wm_rect_valid(const wm_rect_t *r)` - *} wm_geom_config_t; /** Docstring: Default geometry matching the kernel 8x8 font layout. #define WM_GEOM_CONFIG_DEFAULT { 8, 8, 8, 8 } /** Docstring: Axis-aligned rectangle in framebuffer pixels. typedef struct { int x; int y; int w; int h; } wm_rect_t; /** Docstring: True when the rectangle can contain any point.*
- `wm_rect_contains` (line 39) `static inline int wm_rect_contains(const wm_rect_t *r, int px, int py)` - *typedef struct { int x; int y; int w; int h; } wm_rect_t; /** Docstring: True when the rectangle can contain any point. static inline int wm_rect_valid(const wm_rect_t *r) { return r != 0 && r->w > 0 && r->h > 0; } /** Docstring: True when point px,py lies inside rectangle r.*
- `wm_title_bar_rect` (line 48) `static inline wm_rect_t wm_title_bar_rect(const wm_geom_config_t *cfg, int px, int py, int w)` - *{ return r != 0 && r->w > 0 && r->h > 0; } /** Docstring: True when point px,py lies inside rectangle r. static inline int wm_rect_contains(const wm_rect_t *r, int px, int py) { if (!wm_rect_valid(r)) { return 0; } return px >= r->x && px < r->x + r->w && py >= r->y && py < r->y + r->h; } /** Docstring: Title bar strip for a window at px,py with total width w.*
- `wm_content_rect` (line 59) `static inline wm_rect_t wm_content_rect(const wm_geom_config_t *cfg, int px, int py, int w, int h)` - *} /** Docstring: Title bar strip for a window at px,py with total width w. static inline wm_rect_t wm_title_bar_rect(const wm_geom_config_t *cfg, int px, int py, int w) { wm_rect_t r; r.x = px; r.y = py; r.w = w > 0 ? w : 0; r.h = (cfg != 0 && cfg->title_h > 0) ? cfg->title_h : 0; return r; } /** Docstring: Text content area below the title bar.*
- `wm_scrollbar_rect` (line 71) `static inline wm_rect_t wm_scrollbar_rect(const wm_geom_config_t *cfg, int px, int py, int conten...` - */** Docstring: Text content area below the title bar. static inline wm_rect_t wm_content_rect(const wm_geom_config_t *cfg, int px, int py, int w, int h) { wm_rect_t r; int th = (cfg != 0 && cfg->title_h > 0) ? cfg->title_h : 0; r.x = px; r.y = py + th; r.w = w > 0 ? w : 0; r.h = h - th > 0 ? h - th : 0; return r; } /** Docstring: Scrollbar strip at the right edge of the content area.*
- `wm_hit_title_bar` (line 84) `static inline int wm_hit_title_bar(const wm_geom_config_t *cfg, int wx, int wy, int w, int px, in...` - */** Docstring: Scrollbar strip at the right edge of the content area. static inline wm_rect_t wm_scrollbar_rect(const wm_geom_config_t *cfg, int px, int py, int content_w, int content_h) { wm_rect_t r; int th = (cfg != 0 && cfg->title_h > 0) ? cfg->title_h : 0; int sw = (cfg != 0 && cfg->scrollbar_w > 0) ? cfg->scrollbar_w : 0; r.x = px + content_w; r.y = py + th; r.w = sw; r.h = content_h > 0 ? content_h : 0; return r; } /** Docstring: True when point px,py hits the title bar of a window at wx,wy with total width w.*
- `wm_clamp_point` (line 91) `static inline void wm_clamp_point(int *px, int *py, int fb_w, int fb_h)` - *r.y = py + th; r.w = sw; r.h = content_h > 0 ? content_h : 0; return r; } /** Docstring: True when point px,py hits the title bar of a window at wx,wy with total width w. static inline int wm_hit_title_bar(const wm_geom_config_t *cfg, int wx, int wy, int w, int px, int py) { wm_rect_t r = wm_title_bar_rect(cfg, wx, wy, w); return wm_rect_contains(&r, px, py); } /** Docstring: Clamp a point into the framebuffer bounds.*

**Macros:**
- `WM_GEOM_H` (line 11) `#define WM_GEOM_H`
- `WM_GEOM_CONFIG_DEFAULT` (line 22) `#define WM_GEOM_CONFIG_DEFAULT`

**Structs:**
- `wm_geom_config_t` (line 14) - *Docstring: Window geometry contract for the MiniOS desktop.  Single-file header-only contract owning every rectangle computation the window manager performs. All dimensions arrive through wm_geom_config_t so no caller hardcodes font metrics, title height or scrollbar width. Every predicate fails closed on degenerate rectangles and every constructor clamps negative extents to zero instead of producing inverted ranges that a hit test could misread.  #ifndef WM_GEOM_H #define WM_GEOM_H /** Docstring: Centralized geometry configuration for one WM layout engine.*
- `wm_rect_t` (line 25) - *#define WM_GEOM_H /** Docstring: Centralized geometry configuration for one WM layout engine. typedef struct { int font_w; int font_h; int scrollbar_w; int title_h; } wm_geom_config_t; /** Docstring: Default geometry matching the kernel 8x8 font layout. #define WM_GEOM_CONFIG_DEFAULT { 8, 8, 8, 8 } /** Docstring: Axis-aligned rectangle in framebuffer pixels.*

#### `wm_gfxview.h`
**Path:** `headers/wm_gfxview.h`
**File Doc:** *Docstring: Graphics-window view contract for the MiniOS desktop.*

**Functions:**
- `wm_gfxview_mode_name` (line 64) `static inline const char *wm_gfxview_mode_name(int mode)` - *Docstring: One computed view: frame (chrome plus content area), * title strip height (0 in fullscreen) and the scaled content rect. typedef struct { int mode; wm_gfxview_rect_t frame; int title_h; wm_gfxview_rect_t content; } wm_gfxview_t; /** Docstring: Human name for one view mode, else zero.*
- `wm_gfxview_dims_ok` (line 79) `static inline int wm_gfxview_dims_ok(int w, int h)` - *{ switch (mode) { case WM_GFXVIEW_FLOAT: return "floating"; case WM_GFXVIEW_TILED: return "tiled"; case WM_GFXVIEW_FULL: return "fullscreen"; default: return 0; } } /** Docstring: True when every edge lies in the accepted range.*
- `Downscale` (line 88) `* Downscale (fit below 1x) always takes the exact fit. Returns 1 on
 * success, 0 on degenerate i...`
- `wm_gfxview_clamp` (line 134) `static inline void wm_gfxview_clamp(wm_gfxview_rect_t *r, int fb_w, int fb_h)` - *Docstring: Clamp a rect inside the framebuffer by moving, then by * shrinking when it is larger than the screen.*
- `wm_gfxview_place_content` (line 160) `static inline int wm_gfxview_place_content(const wm_gfxview_config_t *cfg, int sw, int sh,
      ...` - *r->x = fb_w - r->w; } if (r->y + r->h > fb_h) { r->y = fb_h - r->h; } if (r->x < 0) { r->x = 0; } if (r->y < 0) { r->y = 0; } } /** Docstring: Center an aspect-fit content rect inside an area.*
- `wm_gfxview_map_point` (line 255) `static inline int wm_gfxview_map_point(const wm_gfxview_t *v, int sw, int sh,
                   ...` - *Docstring: Map a framebuffer point into back-buffer space. Inside the content rect the point scales exactly into [0, sw) x [0, sh); outside it clamps to the nearest edge so a drag that leaves the window keeps tracking. The result is reported as content origin plus local offset, which is the coordinate space apps already subtract their reported origin from. Returns 1 when the point was inside, 0 when it * was clamped, -1 on degenerate input.*
- `wm_gfxview_ease` (line 291) `static inline long wm_gfxview_ease(int t, int n, long den)` - *Docstring: Ease-out cubic progress in [0, den] for step t of n. 1 - (1 - t/n)^3 in integer arithmetic: fast start, soft landing, * monotonic, exactly 0 at t = 0 and exactly den at t = n.*
- `wm_gfxview_lerp_rect` (line 313) `static inline int wm_gfxview_lerp_rect(const wm_gfxview_rect_t *a, const wm_gfxview_rect_t *b,
  ...` - *return 0; } inv = (long)(n - t); r = den - (den * inv * inv * inv) / ((long)n * (long)n * (long)n); if (r < 0) { r = 0; } if (r > den) { r = den; } return r; } /** Docstring: Interpolate one rect between a and b at eased step t of n.*
- `wm_gfxview_rect_same` (line 336) `static inline int wm_gfxview_rect_same(const wm_gfxview_rect_t *a, const wm_gfxview_rect_t *b)` - *out->x = a->x + (int)(((long)(b->x - a->x) * p) / den); out->y = a->y + (int)(((long)(b->y - a->y) * p) / den); out->w = a->w + (int)(((long)(b->w - a->w) * p) / den); out->h = a->h + (int)(((long)(b->h - a->h) * p) / den); if (out->w < 1) { out->w = 1; } if (out->h < 1) { out->h = 1; } return 1; } /** Docstring: True when two rects are identical.*

**Macros:**
- `WM_GFXVIEW_H` (line 21) `#define WM_GFXVIEW_H`
- `WM_GFXVIEW_CONFIG_DEFAULT` (line 41) `#define WM_GFXVIEW_CONFIG_DEFAULT`
- `WM_GFXVIEW_DIM_MAX` (line 44) `#define WM_GFXVIEW_DIM_MAX`

**Structs:**
- `wm_gfxview_config_t` (line 31) - *between two frame rects. Pure integer logic, no kernel dependencies, every entry fails closed on degenerate input so it stays host-testable.  #ifndef WM_GFXVIEW_H #define WM_GFXVIEW_H /** Docstring: View modes of the graphics window. typedef enum { WM_GFXVIEW_FLOAT = 0, WM_GFXVIEW_TILED = 1, WM_GFXVIEW_FULL = 2 } wm_gfxview_mode_t; /** Docstring: Centralized view configuration, no magic numbers.*
- `wm_gfxview_rect_t` (line 47) - *Docstring: Default view: 8 px title, integer scale kept when it * covers at least 7/8 of the fit, 10 animation frames at 16 ms. #define WM_GFXVIEW_CONFIG_DEFAULT { 8, 7, 8, 10, 16 } /** Docstring: Largest source or destination edge the math accepts. #define WM_GFXVIEW_DIM_MAX 8192 /** Docstring: One axis-aligned rectangle in framebuffer pixels.*
- `wm_gfxview_t` (line 56) - *Docstring: One computed view: frame (chrome plus content area), * title strip height (0 in fullscreen) and the scaled content rect.*

#### `wm_layout.h`
**Path:** `headers/wm_layout.h`
**File Doc:** *Docstring: Unified layout contract for the MiniOS desktop.*

**Functions:**
- `wm_layout_mode_name` (line 57) `static inline const char *wm_layout_mode_name(int mode)` - */** Docstring: Default layout matching the legacy two terminal split. #define WM_LAYOUT_CONFIG_DEFAULT { 0, 4, 2, 618, 1000 } /** Docstring: One computed cell in character units. typedef struct { int x; int y; int cols; int rows; int fullscreen; } wm_layout_cell_t; /** Docstring: Human name for one layout mode, else zero.*
- `wm_layout_mode_valid` (line 76) `static inline int wm_layout_mode_valid(int mode)` - *case WM_LAYOUT_BSP: return "bsp"; case WM_LAYOUT_CASCADE: return "cascade"; case WM_LAYOUT_FIBONACCI: return "fibonacci"; case WM_LAYOUT_FULLSCREEN: return "fullscreen"; default: return 0; } } /** Docstring: True when mode is a selectable layout mode.*
- `wm_layout_clamp_cell` (line 82) `static inline int wm_layout_clamp_cell(wm_layout_cell_t *cell, int max_cols, int max_rows)` - *case WM_LAYOUT_FULLSCREEN: return "fullscreen"; default: return 0; } } /** Docstring: True when mode is a selectable layout mode. static inline int wm_layout_mode_valid(int mode) { return mode >= WM_LAYOUT_TILE && mode <= WM_LAYOUT_FULLSCREEN; } /** Docstring: Clamp cell extents into the grid, fail closed on nulls.*
- `wm_layout_fullscreen_cell` (line 118) `static inline int wm_layout_fullscreen_cell(int max_cols, int max_rows, wm_layout_cell_t *out)` - *} if (cell->rows < 1) { cell->rows = 1; } if (cell->x + cell->cols > max_cols) { cell->cols = max_cols - cell->x; } if (cell->y + cell->rows > max_rows) { cell->rows = max_rows - cell->y; } return cell->cols > 0 && cell->rows > 0; } /** Docstring: Full grid cell for the focused window.*
- `wm_layout_compute_tile` (line 135) `static inline int wm_layout_compute_tile(const wm_layout_window_t *wins, int nwin, int max_cols, ...` - *return 0; } if (max_cols <= 0 || max_rows <= 0) { return 0; } out->x = 0; out->y = 0; out->cols = max_cols; out->rows = max_rows; out->fullscreen = 1; return 1; } /** Docstring: Tile split across the long axis, legacy dual split exactly.*
- `wm_layout_compute_bsp` (line 182) `static inline int wm_layout_compute_bsp(const wm_layout_window_t *wins, int nwin, int max_cols, i...` - *} base = max_rows / nwin; rem = max_rows - base * nwin; for (i = 0; i < nwin; i++) { out[i].x = 0; out[i].y = i * base; out[i].cols = max_cols; out[i].rows = base + ((i == nwin - 1) ? rem : 0); out[i].fullscreen = 0; } return nwin; } /** Docstring: Recursive binary splits alternating axes, bspwm feel.*
- `wm_layout_compute_cascade` (line 250) `static inline int wm_layout_compute_cascade(const wm_layout_config_t *cfg, const wm_layout_window...` - *} out[i].x = rx; out[i].y = ry; out[i].cols = rw; out[i].rows = half; out[i].fullscreen = 0; ry = ry + half; rh = rh - half; } } return nwin; } /** Docstring: Cascaded offsets so every title stays visible.*
- `wm_layout_compute_fibonacci` (line 285) `static inline int wm_layout_compute_fibonacci(const wm_layout_config_t *cfg, const wm_layout_wind...` - *out[i].cols = max_cols - ox; out[i].rows = max_rows - oy; out[i].fullscreen = 0; if (out[i].cols < 1) { out[i].cols = 1; } if (out[i].rows < 1) { out[i].rows = 1; } } return nwin; } /** Docstring: Fibonacci spiral carving integer ratio strips.*
- `wm_layout_compute` (line 361) `static inline int wm_layout_compute(const wm_layout_config_t *cfg, const wm_layout_window_t *wins...` - *} out[i].x = rx; out[i].y = ry; out[i].cols = rw; out[i].rows = cut; out[i].fullscreen = 0; ry = ry + cut; rh = rh - cut; } } return nwin; } /** Docstring: Compute one cell per present window in input order.*
- `wm_layout_same` (line 443) `static inline int wm_layout_same(const wm_layout_cell_t *a, const wm_layout_cell_t *b, int n)` - *} if (n != nc) { return 0; } for (i = 0; i < nc; i++) { if (!wm_layout_clamp_cell(&cells[i], max_cols, max_rows)) { return 0; } out[i] = cells[i]; } return nc; } /** Docstring: True when two plans cover identical cells in order.*

**Macros:**
- `WM_LAYOUT_H` (line 12) `#define WM_LAYOUT_H`
- `WM_LAYOUT_MODE_COUNT` (line 24) `#define WM_LAYOUT_MODE_COUNT`
- `WM_LAYOUT_CONFIG_DEFAULT` (line 45) `#define WM_LAYOUT_CONFIG_DEFAULT`

**Structs:**
- `wm_layout_window_t` (line 27) - */** Docstring: Layout modes sharing one compute entry point. typedef enum { WM_LAYOUT_TILE = 0, WM_LAYOUT_BSP = 1, WM_LAYOUT_CASCADE = 2, WM_LAYOUT_FIBONACCI = 3, WM_LAYOUT_FULLSCREEN = 4 } wm_layout_mode_t; /** Docstring: Total layout modes in the mode table. #define WM_LAYOUT_MODE_COUNT 5 /** Docstring: One input window for layout computation.*
- `wm_layout_config_t` (line 36) - */** Docstring: Total layout modes in the mode table. #define WM_LAYOUT_MODE_COUNT 5 /** Docstring: One input window for layout computation. typedef struct { int kind; int id; int present; int min_cols; int min_rows; } wm_layout_window_t; /** Docstring: Centralized layout configuration for one engine.*
- `wm_layout_cell_t` (line 48) - */** Docstring: Centralized layout configuration for one engine. typedef struct { int gap; int cascade_dx; int cascade_dy; int fib_num; int fib_den; } wm_layout_config_t; /** Docstring: Default layout matching the legacy two terminal split. #define WM_LAYOUT_CONFIG_DEFAULT { 0, 4, 2, 618, 1000 } /** Docstring: One computed cell in character units.*

#### `wm_notify.h`
**Path:** `headers/wm_notify.h`
**File Doc:** *Docstring: Focus event bus for the MiniOS desktop.*

**Functions:**
- `wm_notify_reset` (line 51) `static inline void wm_notify_reset(wm_notify_bus_t *bus)` - */** Docstring: Focus listener, runs synchronously inside emit. typedef void (*wm_notify_handler_t)(const wm_notify_event_t *event); /** Docstring: Static subscriber table plus last emitted event. #define WM_NOTIFY_MAX_HANDLERS 4 typedef struct { wm_notify_handler_t handlers[WM_NOTIFY_MAX_HANDLERS]; int count; wm_notify_event_t last; int has_event; } wm_notify_bus_t; /** Docstring: Drop every subscriber and forget the last event.*
- `wm_notify_subscribe` (line 66) `static inline int wm_notify_subscribe(wm_notify_bus_t *bus,
                                     ...` - *{ int i; if (bus == 0) return; for (i = 0; i < WM_NOTIFY_MAX_HANDLERS; i++) bus->handlers[i] = 0; bus->count = 0; bus->last.type = 0; bus->last.old_focus = 0; bus->last.new_focus = 0; bus->last.source = 0; bus->has_event = 0; } /** Docstring: Register one listener, -1 when full or null.*
- `wm_notify_emit` (line 76) `static inline void wm_notify_emit(wm_notify_bus_t *bus,
                                  const w...` - *bus->has_event = 0; } /** Docstring: Register one listener, -1 when full or null. static inline int wm_notify_subscribe(wm_notify_bus_t *bus, wm_notify_handler_t handler) { if (bus == 0 || handler == 0) return -1; if (bus->count >= WM_NOTIFY_MAX_HANDLERS) return -1; bus->handlers[bus->count++] = handler; return 0; } /** Docstring: Deliver one event to every listener, then record it.*
- `wm_notify_last` (line 90) `static inline const wm_notify_event_t *wm_notify_last(
    const wm_notify_bus_t *bus)` - *static inline void wm_notify_emit(wm_notify_bus_t *bus, const wm_notify_event_t *event) { int i; if (bus == 0 || event == 0) return; for (i = 0; i < bus->count; i++) { if (bus->handlers[i]) bus->handlers[i](event); } bus->last = *event; bus->has_event = 1; } /** Docstring: Last emitted event, 0 when none was ever emitted.*
- `wm_notify_src_name` (line 98) `static inline const char *wm_notify_src_name(int source)` - *} bus->last = *event; bus->has_event = 1; } /** Docstring: Last emitted event, 0 when none was ever emitted. static inline const wm_notify_event_t *wm_notify_last( const wm_notify_bus_t *bus) { if (bus == 0 || !bus->has_event) return 0; return &bus->last; } /** Docstring: Short source name for serial-observable state.*

**Macros:**
- `WM_NOTIFY_H` (line 2) `#define WM_NOTIFY_H`
- `WM_NOTIFY_MAX_HANDLERS` (line 41) `#define WM_NOTIFY_MAX_HANDLERS`

**Structs:**
- `wm_notify_event_t` (line 30) - *typedef enum { WM_NOTIFY_FOCUS = 1 } wm_notify_type_t; typedef enum { WM_FOCUS_SRC_KEYBOARD = 1, WM_FOCUS_SRC_POINTER = 2, WM_FOCUS_SRC_TASKBAR = 3, WM_FOCUS_SRC_MODE = 4, WM_FOCUS_SRC_PROGRAM = 5 } wm_focus_source_t; /** Docstring: One focus move, old and new ids share the focus space.*
- `wm_notify_bus_t` (line 43)

#### `wm_render.h`
**Path:** `headers/wm_render.h`
**File Doc:** *Docstring: Render pipeline contract for the MiniOS desktop.*

**Functions:**
- `wm_build_render_plan` (line 39) `static inline int wm_build_render_plan(const wm_render_config_t *cfg, const int *present, int nte...` - *typedef struct { wm_layer_t layer; int id; } wm_render_item_t; /** Docstring: Centralized render pipeline configuration. typedef struct { int max_items; } wm_render_config_t; /** Docstring: Default pipeline bound for two terminals plus chrome. #define WM_RENDER_CONFIG_DEFAULT { 8 } /** Docstring: Build the back-to-front composition plan for one frame.*

**Macros:**
- `WM_RENDER_H` (line 11) `#define WM_RENDER_H`
- `WM_RENDER_CONFIG_DEFAULT` (line 36) `#define WM_RENDER_CONFIG_DEFAULT`

**Structs:**
- `wm_render_item_t` (line 25) - *#define WM_RENDER_H #include "wm_window.h" /** Docstring: Composition layers from back to front. typedef enum { WM_LAYER_WALLPAPER = 0, WM_LAYER_SHORTCUTS = 1, WM_LAYER_TASKBAR = 2, WM_LAYER_TERMINAL = 3, WM_LAYER_GRAPHICS = 4 } wm_layer_t; /** Docstring: One composited item in back-to-front order.*
- `wm_render_config_t` (line 31) - *WM_LAYER_WALLPAPER = 0, WM_LAYER_SHORTCUTS = 1, WM_LAYER_TASKBAR = 2, WM_LAYER_TERMINAL = 3, WM_LAYER_GRAPHICS = 4 } wm_layer_t; /** Docstring: One composited item in back-to-front order. typedef struct { wm_layer_t layer; int id; } wm_render_item_t; /** Docstring: Centralized render pipeline configuration.*

#### `wm_tiling.h`
**Path:** `headers/wm_tiling.h`
**File Doc:** *Docstring: Tiling layout contract for the MiniOS desktop.*

**Functions:**
- `wm_tile_layout` (line 22) `static inline int wm_tile_layout(const int *present, int nterms, int gfx_active, int max_cols, in...` - *#ifndef WM_TILING_H #define WM_TILING_H /** Docstring: Terminal cell in character units. typedef struct { int x; int y; int cols; int rows; int fullscreen; } wm_tile_cell_t; /** Docstring: Compute terminal cells for the current window set.*

**Macros:**
- `WM_TILING_H` (line 10) `#define WM_TILING_H`

**Structs:**
- `wm_tile_cell_t` (line 13) - *Docstring: Tiling layout contract for the MiniOS desktop.  Single-file header-only contract owning terminal cell layout. Given the usable grid and which windows exist, it computes one cell per terminal in character units so no caller hardcodes half splits or stack math. Graphics placement stays in the kernel; this contract only reserves its half by narrowing the terminals. All functions fail closed.  #ifndef WM_TILING_H #define WM_TILING_H /** Docstring: Terminal cell in character units.*

#### `wm_window.h`
**Path:** `headers/wm_window.h`
**File Doc:** *Docstring: Unified window contract for the MiniOS desktop.*

**Functions:**
- `wm_window_active` (line 41) `static inline int wm_window_active(const wm_window_t *w)` - */** Docstring: Unified window descriptor in framebuffer pixels. typedef struct { wm_window_kind_t kind; int id; int x; int y; int w; int h; int present; int minimized; } wm_window_t; /** Docstring: True when the window can receive input or pointer hits.*
- `wm_window_rect` (line 47) `static inline wm_rect_t wm_window_rect(const wm_window_t *w)` - *int y; int w; int h; int present; int minimized; } wm_window_t; /** Docstring: True when the window can receive input or pointer hits. static inline int wm_window_active(const wm_window_t *w) { return w != 0 && w->kind != WM_WIN_NONE && w->present && !w->minimized && w->w > 0 && w->h > 0; } /** Docstring: Rectangle covering the whole window including decorations.*
- `wm_window_contains` (line 58) `static inline int wm_window_contains(const wm_window_t *w, int px, int py)` - *} /** Docstring: Rectangle covering the whole window including decorations. static inline wm_rect_t wm_window_rect(const wm_window_t *w) { wm_rect_t r; r.x = (w != 0) ? w->x : 0; r.y = (w != 0) ? w->y : 0; r.w = (w != 0 && w->w > 0) ? w->w : 0; r.h = (w != 0 && w->h > 0) ? w->h : 0; return r; } /** Docstring: True when point px,py hits the window body or decorations.*
- `wm_window_title_hits` (line 68) `static inline int wm_window_title_hits(const wm_geom_config_t *cfg, const wm_window_t *w, int px,...` - *return r; } /** Docstring: True when point px,py hits the window body or decorations. static inline int wm_window_contains(const wm_window_t *w, int px, int py) { wm_rect_t r = wm_window_rect(w); if (!wm_window_active(w)) { return 0; } return wm_rect_contains(&r, px, py); } /** Docstring: True when point px,py hits the window title bar.*
- `wm_focus_next_id` (line 77) `static inline int wm_focus_next_id(const int *present, int nterms, int gfx_active, int focus)` - *} return wm_rect_contains(&r, px, py); } /** Docstring: True when point px,py hits the window title bar. static inline int wm_window_title_hits(const wm_geom_config_t *cfg, const wm_window_t *w, int px, int py) { if (!wm_window_active(w)) { return 0; } return wm_hit_title_bar(cfg, w->x, w->y, w->w, px, py); } /** Docstring: Next focus id across present terminals plus graphics when active.*
- `wm_paint_order` (line 114) `static inline int wm_paint_order(const int *present, int nterms, int focus, int *order, int cap)` - *return focus; } for (k = 0; k < n; k++) { if (ids[k] == focus) { at = k; } } if (at < 0) { return ids[0]; } return ids[(at + 1) % n]; } /** Docstring: Paint order for terminals with focused window last.*

**Macros:**
- `WM_WINDOW_H` (line 11) `#define WM_WINDOW_H`
- `WM_WINDOW_GFX_ID` (line 23) `#define WM_WINDOW_GFX_ID`
- `WM_WINDOW_MAX_TERMS` (line 26) `#define WM_WINDOW_MAX_TERMS`

**Structs:**
- `wm_window_t` (line 29) - */** Docstring: Window kinds sharing one focus space. typedef enum { WM_WIN_NONE = 0, WM_WIN_TERMINAL = 1, WM_WIN_GRAPHICS = 2 } wm_window_kind_t; /** Docstring: Focus id for the graphics window in the shared focus space. #define WM_WINDOW_GFX_ID 2 /** Docstring: Maximum terminal windows sharing the focus space. #define WM_WINDOW_MAX_TERMS 2 /** Docstring: Unified window descriptor in framebuffer pixels.*

#### `zip.h`
**Path:** `headers/zip.h`
**File Doc:** *zip.h — MiniOS integration API for the miniz zip library.*

**Functions:**
- `miniz` (line 6) `* * The shell builtins over miniz (see zip.c) are declared here so kernel.c's * shell dispatcher can route the unzip/zip commands. Both builtins work * whole-file in memory over the unified file API (`
- `shell_cmd_zip` (line 15) `void shell_cmd_zip(int argc, char **argv);`

**Macros:**
- `ZIP_H` (line 2) `#define ZIP_H`

#### `am_map.h`
**Path:** `progs/doomgeneric/am_map.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: AutoMap module.     Used by ST StatusBar stuff.*

**Functions:**
- `AM_Ticker` (line 35) `void AM_Ticker (void);` - *Called by main loop.*
- `AM_Drawer` (line 39) `void AM_Drawer (void);` - *Called by main loop, called instead of view drawer if automap active.*
- `AM_Stop` (line 43) `void AM_Stop (void);` - *Called to force the automap to quit if the level is completed while it is up.*

**Macros:**
- `__AMMAP_H__` (line 20) `#define __AMMAP_H__`
- `AM_MSGHEADER` (line 26) `#define AM_MSGHEADER`
- `AM_MSGENTERED` (line 27) `#define AM_MSGENTERED`
- `AM_MSGEXITED` (line 28) `#define AM_MSGEXITED`

**Variables:**
- `cheat_amap` (line 46) `extern cheatseq_t cheat_amap;`

#### `config.h`
**Path:** `progs/doomgeneric/config.h`
**File Doc:** *config.hin.  Generated from configure.ac by autoheader.*

**Macros:**
- `HAVE_INTTYPES_H` (line 10) `#define HAVE_INTTYPES_H`
- `HAVE_STDINT_H` (line 46) `#define HAVE_STDINT_H`
- `HAVE_STDLIB_H` (line 49) `#define HAVE_STDLIB_H`
- `HAVE_STRINGS_H` (line 52) `#define HAVE_STRINGS_H`
- `HAVE_STRING_H` (line 55) `#define HAVE_STRING_H`
- `HAVE_SYS_TYPES_H` (line 61) `#define HAVE_SYS_TYPES_H`
- `PACKAGE` (line 67) `#define PACKAGE`
- `PACKAGE_NAME` (line 73) `#define PACKAGE_NAME`
- `PACKAGE_STRING` (line 76) `#define PACKAGE_STRING`
- `PACKAGE_TARNAME` (line 79) `#define PACKAGE_TARNAME`
- `PACKAGE_URL` (line 82) `#define PACKAGE_URL`
- `PACKAGE_VERSION` (line 85) `#define PACKAGE_VERSION`
- `PROGRAM_PREFIX` (line 88) `#define PROGRAM_PREFIX`
- `STDC_HEADERS` (line 91) `#define STDC_HEADERS`
- `VERSION` (line 94) `#define VERSION`
- `FILES_DIR` (line 100) `#define FILES_DIR`

#### `d_englsh.h`
**Path:** `progs/doomgeneric/d_englsh.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Printed strings for translation. English language support (default).     Printed strings for translation    D_Main.C*

**Macros:**
- `__D_ENGLSH__` (line 21) `#define __D_ENGLSH__`
- `D_DEVSTR` (line 30) `#define D_DEVSTR`
- `D_CDROM` (line 31) `#define D_CDROM`
- `PRESSKEY` (line 36) `#define PRESSKEY`
- `PRESSYN` (line 37) `#define PRESSYN`
- `QUITMSG` (line 38) `#define QUITMSG`
- `LOADNET` (line 39) `#define LOADNET`
- `QLOADNET` (line 40) `#define QLOADNET`
- `QSAVESPOT` (line 41) `#define QSAVESPOT`
- `SAVEDEAD` (line 42) `#define SAVEDEAD`
- `QSPROMPT` (line 43) `#define QSPROMPT`
- `QLPROMPT` (line 44) `#define QLPROMPT`
- `NEWGAME` (line 46) `#define NEWGAME`
- `NIGHTMARE` (line 50) `#define NIGHTMARE`
- `SWSTRING` (line 54) `#define SWSTRING`
- `MSGOFF` (line 58) `#define MSGOFF`
- `MSGON` (line 59) `#define MSGON`
- `NETEND` (line 60) `#define NETEND`
- `ENDGAME` (line 61) `#define ENDGAME`
- `DOSY` (line 63) `#define DOSY`
- `DETAILHI` (line 65) `#define DETAILHI`
- `DETAILLO` (line 66) `#define DETAILLO`
- `GAMMALVL0` (line 67) `#define GAMMALVL0`
- `GAMMALVL1` (line 68) `#define GAMMALVL1`
- `GAMMALVL2` (line 69) `#define GAMMALVL2`
- `GAMMALVL3` (line 70) `#define GAMMALVL3`
- `GAMMALVL4` (line 71) `#define GAMMALVL4`
- `EMPTYSTRING` (line 72) `#define EMPTYSTRING`
- `GOTARMOR` (line 77) `#define GOTARMOR`
- `GOTMEGA` (line 78) `#define GOTMEGA`
- `GOTHTHBONUS` (line 79) `#define GOTHTHBONUS`
- `GOTARMBONUS` (line 80) `#define GOTARMBONUS`
- `GOTSTIM` (line 81) `#define GOTSTIM`
- `GOTMEDINEED` (line 82) `#define GOTMEDINEED`
- `GOTMEDIKIT` (line 83) `#define GOTMEDIKIT`
- `GOTSUPER` (line 84) `#define GOTSUPER`
- `GOTBLUECARD` (line 86) `#define GOTBLUECARD`
- `GOTYELWCARD` (line 87) `#define GOTYELWCARD`
- `GOTREDCARD` (line 88) `#define GOTREDCARD`
- `GOTBLUESKUL` (line 89) `#define GOTBLUESKUL`
- `GOTYELWSKUL` (line 90) `#define GOTYELWSKUL`
- `GOTREDSKULL` (line 91) `#define GOTREDSKULL`
- `GOTINVUL` (line 93) `#define GOTINVUL`
- `GOTBERSERK` (line 94) `#define GOTBERSERK`
- `GOTINVIS` (line 95) `#define GOTINVIS`
- `GOTSUIT` (line 96) `#define GOTSUIT`
- `GOTMAP` (line 97) `#define GOTMAP`
- `GOTVISOR` (line 98) `#define GOTVISOR`
- `GOTMSPHERE` (line 99) `#define GOTMSPHERE`
- `GOTCLIP` (line 101) `#define GOTCLIP`
- `GOTCLIPBOX` (line 102) `#define GOTCLIPBOX`
- `GOTROCKET` (line 103) `#define GOTROCKET`
- `GOTROCKBOX` (line 104) `#define GOTROCKBOX`
- `GOTCELL` (line 105) `#define GOTCELL`
- `GOTCELLBOX` (line 106) `#define GOTCELLBOX`
- `GOTSHELLS` (line 107) `#define GOTSHELLS`
- `GOTSHELLBOX` (line 108) `#define GOTSHELLBOX`
- `GOTBACKPACK` (line 109) `#define GOTBACKPACK`
- `GOTBFG9000` (line 111) `#define GOTBFG9000`
- `GOTCHAINGUN` (line 112) `#define GOTCHAINGUN`
- `GOTCHAINSAW` (line 113) `#define GOTCHAINSAW`
- `GOTLAUNCHER` (line 114) `#define GOTLAUNCHER`
- `GOTPLASMA` (line 115) `#define GOTPLASMA`
- `GOTSHOTGUN` (line 116) `#define GOTSHOTGUN`
- `GOTSHOTGUN2` (line 117) `#define GOTSHOTGUN2`
- `PD_BLUEO` (line 122) `#define PD_BLUEO`
- `PD_REDO` (line 123) `#define PD_REDO`
- `PD_YELLOWO` (line 124) `#define PD_YELLOWO`
- `PD_BLUEK` (line 125) `#define PD_BLUEK`
- `PD_REDK` (line 126) `#define PD_REDK`
- `PD_YELLOWK` (line 127) `#define PD_YELLOWK`
- `GGSAVED` (line 132) `#define GGSAVED`
- `HUSTR_MSGU` (line 137) `#define HUSTR_MSGU`
- `HUSTR_E1M1` (line 139) `#define HUSTR_E1M1`
- `HUSTR_E1M2` (line 140) `#define HUSTR_E1M2`
- `HUSTR_E1M3` (line 141) `#define HUSTR_E1M3`
- `HUSTR_E1M4` (line 142) `#define HUSTR_E1M4`
- `HUSTR_E1M5` (line 143) `#define HUSTR_E1M5`
- `HUSTR_E1M6` (line 144) `#define HUSTR_E1M6`
- `HUSTR_E1M7` (line 145) `#define HUSTR_E1M7`
- `HUSTR_E1M8` (line 146) `#define HUSTR_E1M8`
- `HUSTR_E1M9` (line 147) `#define HUSTR_E1M9`
- `HUSTR_E2M1` (line 149) `#define HUSTR_E2M1`
- `HUSTR_E2M2` (line 150) `#define HUSTR_E2M2`
- `HUSTR_E2M3` (line 151) `#define HUSTR_E2M3`
- `HUSTR_E2M4` (line 152) `#define HUSTR_E2M4`
- `HUSTR_E2M5` (line 153) `#define HUSTR_E2M5`
- `HUSTR_E2M6` (line 154) `#define HUSTR_E2M6`
- `HUSTR_E2M7` (line 155) `#define HUSTR_E2M7`
- `HUSTR_E2M8` (line 156) `#define HUSTR_E2M8`
- `HUSTR_E2M9` (line 157) `#define HUSTR_E2M9`
- `HUSTR_E3M1` (line 159) `#define HUSTR_E3M1`
- `HUSTR_E3M2` (line 160) `#define HUSTR_E3M2`
- `HUSTR_E3M3` (line 161) `#define HUSTR_E3M3`
- `HUSTR_E3M4` (line 162) `#define HUSTR_E3M4`
- `HUSTR_E3M5` (line 163) `#define HUSTR_E3M5`
- `HUSTR_E3M6` (line 164) `#define HUSTR_E3M6`
- `HUSTR_E3M7` (line 165) `#define HUSTR_E3M7`
- `HUSTR_E3M8` (line 166) `#define HUSTR_E3M8`
- `HUSTR_E3M9` (line 167) `#define HUSTR_E3M9`
- `HUSTR_E4M1` (line 169) `#define HUSTR_E4M1`
- `HUSTR_E4M2` (line 170) `#define HUSTR_E4M2`
- `HUSTR_E4M3` (line 171) `#define HUSTR_E4M3`
- `HUSTR_E4M4` (line 172) `#define HUSTR_E4M4`
- `HUSTR_E4M5` (line 173) `#define HUSTR_E4M5`
- `HUSTR_E4M6` (line 174) `#define HUSTR_E4M6`
- `HUSTR_E4M7` (line 175) `#define HUSTR_E4M7`
- `HUSTR_E4M8` (line 176) `#define HUSTR_E4M8`
- `HUSTR_E4M9` (line 177) `#define HUSTR_E4M9`
- `HUSTR_1` (line 179) `#define HUSTR_1`
- `HUSTR_2` (line 180) `#define HUSTR_2`
- `HUSTR_3` (line 181) `#define HUSTR_3`
- `HUSTR_4` (line 182) `#define HUSTR_4`
- `HUSTR_5` (line 183) `#define HUSTR_5`
- `HUSTR_6` (line 184) `#define HUSTR_6`
- `HUSTR_7` (line 185) `#define HUSTR_7`
- `HUSTR_8` (line 186) `#define HUSTR_8`
- `HUSTR_9` (line 187) `#define HUSTR_9`
- `HUSTR_10` (line 188) `#define HUSTR_10`
- `HUSTR_11` (line 189) `#define HUSTR_11`
- `HUSTR_12` (line 191) `#define HUSTR_12`
- `HUSTR_13` (line 192) `#define HUSTR_13`
- `HUSTR_14` (line 193) `#define HUSTR_14`
- `HUSTR_15` (line 194) `#define HUSTR_15`
- `HUSTR_16` (line 195) `#define HUSTR_16`
- `HUSTR_17` (line 196) `#define HUSTR_17`
- `HUSTR_18` (line 197) `#define HUSTR_18`
- `HUSTR_19` (line 198) `#define HUSTR_19`
- `HUSTR_20` (line 199) `#define HUSTR_20`
- `HUSTR_21` (line 201) `#define HUSTR_21`
- `HUSTR_22` (line 202) `#define HUSTR_22`
- `HUSTR_23` (line 203) `#define HUSTR_23`
- `HUSTR_24` (line 204) `#define HUSTR_24`
- `HUSTR_25` (line 205) `#define HUSTR_25`
- `HUSTR_26` (line 206) `#define HUSTR_26`
- `HUSTR_27` (line 207) `#define HUSTR_27`
- `HUSTR_28` (line 208) `#define HUSTR_28`
- `HUSTR_29` (line 209) `#define HUSTR_29`
- `HUSTR_30` (line 210) `#define HUSTR_30`
- `HUSTR_31` (line 212) `#define HUSTR_31`
- `HUSTR_32` (line 213) `#define HUSTR_32`
- `PHUSTR_1` (line 215) `#define PHUSTR_1`
- `PHUSTR_2` (line 216) `#define PHUSTR_2`
- `PHUSTR_3` (line 217) `#define PHUSTR_3`
- `PHUSTR_4` (line 218) `#define PHUSTR_4`
- `PHUSTR_5` (line 219) `#define PHUSTR_5`
- `PHUSTR_6` (line 220) `#define PHUSTR_6`
- `PHUSTR_7` (line 221) `#define PHUSTR_7`
- `PHUSTR_8` (line 222) `#define PHUSTR_8`
- `PHUSTR_9` (line 223) `#define PHUSTR_9`
- `PHUSTR_10` (line 224) `#define PHUSTR_10`
- `PHUSTR_11` (line 225) `#define PHUSTR_11`
- `PHUSTR_12` (line 227) `#define PHUSTR_12`
- `PHUSTR_13` (line 228) `#define PHUSTR_13`
- `PHUSTR_14` (line 229) `#define PHUSTR_14`
- `PHUSTR_15` (line 230) `#define PHUSTR_15`
- `PHUSTR_16` (line 231) `#define PHUSTR_16`
- `PHUSTR_17` (line 232) `#define PHUSTR_17`
- `PHUSTR_18` (line 233) `#define PHUSTR_18`
- `PHUSTR_19` (line 234) `#define PHUSTR_19`
- `PHUSTR_20` (line 235) `#define PHUSTR_20`
- `PHUSTR_21` (line 237) `#define PHUSTR_21`
- `PHUSTR_22` (line 238) `#define PHUSTR_22`
- `PHUSTR_23` (line 239) `#define PHUSTR_23`
- `PHUSTR_24` (line 240) `#define PHUSTR_24`
- `PHUSTR_25` (line 241) `#define PHUSTR_25`
- `PHUSTR_26` (line 242) `#define PHUSTR_26`
- `PHUSTR_27` (line 243) `#define PHUSTR_27`
- `PHUSTR_28` (line 244) `#define PHUSTR_28`
- `PHUSTR_29` (line 245) `#define PHUSTR_29`
- `PHUSTR_30` (line 246) `#define PHUSTR_30`
- `PHUSTR_31` (line 248) `#define PHUSTR_31`
- `PHUSTR_32` (line 249) `#define PHUSTR_32`
- `THUSTR_1` (line 251) `#define THUSTR_1`
- `THUSTR_2` (line 252) `#define THUSTR_2`
- `THUSTR_3` (line 253) `#define THUSTR_3`
- `THUSTR_4` (line 254) `#define THUSTR_4`
- `THUSTR_5` (line 255) `#define THUSTR_5`
- `THUSTR_6` (line 256) `#define THUSTR_6`
- `THUSTR_7` (line 257) `#define THUSTR_7`
- `THUSTR_8` (line 258) `#define THUSTR_8`
- `THUSTR_9` (line 259) `#define THUSTR_9`
- `THUSTR_10` (line 260) `#define THUSTR_10`
- `THUSTR_11` (line 261) `#define THUSTR_11`
- `THUSTR_12` (line 263) `#define THUSTR_12`
- `THUSTR_13` (line 264) `#define THUSTR_13`
- `THUSTR_14` (line 265) `#define THUSTR_14`
- `THUSTR_15` (line 266) `#define THUSTR_15`
- `THUSTR_16` (line 267) `#define THUSTR_16`
- `THUSTR_17` (line 268) `#define THUSTR_17`
- `THUSTR_18` (line 269) `#define THUSTR_18`
- `THUSTR_19` (line 270) `#define THUSTR_19`
- `THUSTR_20` (line 271) `#define THUSTR_20`
- `THUSTR_21` (line 273) `#define THUSTR_21`
- `THUSTR_22` (line 274) `#define THUSTR_22`
- `THUSTR_23` (line 275) `#define THUSTR_23`
- `THUSTR_24` (line 276) `#define THUSTR_24`
- `THUSTR_25` (line 277) `#define THUSTR_25`
- `THUSTR_26` (line 278) `#define THUSTR_26`
- `THUSTR_27` (line 279) `#define THUSTR_27`
- `THUSTR_28` (line 280) `#define THUSTR_28`
- `THUSTR_29` (line 281) `#define THUSTR_29`
- `THUSTR_30` (line 282) `#define THUSTR_30`
- `THUSTR_31` (line 284) `#define THUSTR_31`
- `THUSTR_32` (line 285) `#define THUSTR_32`
- `HUSTR_CHATMACRO1` (line 287) `#define HUSTR_CHATMACRO1`
- `HUSTR_CHATMACRO2` (line 288) `#define HUSTR_CHATMACRO2`
- `HUSTR_CHATMACRO3` (line 289) `#define HUSTR_CHATMACRO3`
- `HUSTR_CHATMACRO4` (line 290) `#define HUSTR_CHATMACRO4`
- `HUSTR_CHATMACRO5` (line 291) `#define HUSTR_CHATMACRO5`
- `HUSTR_CHATMACRO6` (line 292) `#define HUSTR_CHATMACRO6`
- `HUSTR_CHATMACRO7` (line 293) `#define HUSTR_CHATMACRO7`
- `HUSTR_CHATMACRO8` (line 294) `#define HUSTR_CHATMACRO8`
- `HUSTR_CHATMACRO9` (line 295) `#define HUSTR_CHATMACRO9`
- `HUSTR_CHATMACRO0` (line 296) `#define HUSTR_CHATMACRO0`
- `HUSTR_TALKTOSELF1` (line 298) `#define HUSTR_TALKTOSELF1`
- `HUSTR_TALKTOSELF2` (line 299) `#define HUSTR_TALKTOSELF2`
- `HUSTR_TALKTOSELF3` (line 300) `#define HUSTR_TALKTOSELF3`
- `HUSTR_TALKTOSELF4` (line 301) `#define HUSTR_TALKTOSELF4`
- `HUSTR_TALKTOSELF5` (line 302) `#define HUSTR_TALKTOSELF5`
- `HUSTR_MESSAGESENT` (line 304) `#define HUSTR_MESSAGESENT`
- `HUSTR_PLRGREEN` (line 309) `#define HUSTR_PLRGREEN`
- `HUSTR_PLRINDIGO` (line 310) `#define HUSTR_PLRINDIGO`
- `HUSTR_PLRBROWN` (line 311) `#define HUSTR_PLRBROWN`
- `HUSTR_PLRRED` (line 312) `#define HUSTR_PLRRED`
- `HUSTR_KEYGREEN` (line 314) `#define HUSTR_KEYGREEN`
- `HUSTR_KEYINDIGO` (line 315) `#define HUSTR_KEYINDIGO`
- `HUSTR_KEYBROWN` (line 316) `#define HUSTR_KEYBROWN`
- `HUSTR_KEYRED` (line 317) `#define HUSTR_KEYRED`
- `AMSTR_FOLLOWON` (line 323) `#define AMSTR_FOLLOWON`
- `AMSTR_FOLLOWOFF` (line 324) `#define AMSTR_FOLLOWOFF`
- `AMSTR_GRIDON` (line 326) `#define AMSTR_GRIDON`
- `AMSTR_GRIDOFF` (line 327) `#define AMSTR_GRIDOFF`
- `AMSTR_MARKEDSPOT` (line 329) `#define AMSTR_MARKEDSPOT`
- `AMSTR_MARKSCLEARED` (line 330) `#define AMSTR_MARKSCLEARED`
- `STSTR_MUS` (line 336) `#define STSTR_MUS`
- `STSTR_NOMUS` (line 337) `#define STSTR_NOMUS`
- `STSTR_DQDON` (line 338) `#define STSTR_DQDON`
- `STSTR_DQDOFF` (line 339) `#define STSTR_DQDOFF`
- `STSTR_KFAADDED` (line 341) `#define STSTR_KFAADDED`
- `STSTR_FAADDED` (line 342) `#define STSTR_FAADDED`
- `STSTR_NCON` (line 344) `#define STSTR_NCON`
- `STSTR_NCOFF` (line 345) `#define STSTR_NCOFF`
- `STSTR_BEHOLD` (line 347) `#define STSTR_BEHOLD`
- `STSTR_BEHOLDX` (line 348) `#define STSTR_BEHOLDX`
- `STSTR_CHOPPERS` (line 350) `#define STSTR_CHOPPERS`
- `STSTR_CLEV` (line 351) `#define STSTR_CLEV`
- `E1TEXT` (line 356) `#define E1TEXT`
- `E2TEXT` (line 374) `#define E2TEXT`
- `E3TEXT` (line 394) `#define E3TEXT`
- `E4TEXT` (line 414) `#define E4TEXT`
- `C1TEXT` (line 435) `#define C1TEXT`
- `C2TEXT` (line 451) `#define C2TEXT`
- `C3TEXT` (line 473) `#define C3TEXT`
- `C4TEXT` (line 487) `#define C4TEXT`
- `C5TEXT` (line 508) `#define C5TEXT`
- `C6TEXT` (line 518) `#define C6TEXT`
- `P1TEXT` (line 526) `#define P1TEXT`
- `P2TEXT` (line 543) `#define P2TEXT`
- `P3TEXT` (line 554) `#define P3TEXT`
- `P4TEXT` (line 568) `#define P4TEXT`
- `P5TEXT` (line 584) `#define P5TEXT`
- `P6TEXT` (line 592) `#define P6TEXT`
- `T1TEXT` (line 598) `#define T1TEXT`
- `T2TEXT` (line 613) `#define T2TEXT`
- `T3TEXT` (line 625) `#define T3TEXT`
- `T4TEXT` (line 635) `#define T4TEXT`
- `T5TEXT` (line 649) `#define T5TEXT`
- `T6TEXT` (line 657) `#define T6TEXT`
- `CC_ZOMBIE` (line 674) `#define CC_ZOMBIE`
- `CC_SHOTGUN` (line 675) `#define CC_SHOTGUN`
- `CC_HEAVY` (line 676) `#define CC_HEAVY`
- `CC_IMP` (line 677) `#define CC_IMP`
- `CC_DEMON` (line 678) `#define CC_DEMON`
- `CC_LOST` (line 679) `#define CC_LOST`
- `CC_CACO` (line 680) `#define CC_CACO`
- `CC_HELL` (line 681) `#define CC_HELL`
- `CC_BARON` (line 682) `#define CC_BARON`
- `CC_ARACH` (line 683) `#define CC_ARACH`
- `CC_PAIN` (line 684) `#define CC_PAIN`
- `CC_REVEN` (line 685) `#define CC_REVEN`
- `CC_MANCU` (line 686) `#define CC_MANCU`
- `CC_ARCH` (line 687) `#define CC_ARCH`
- `CC_SPIDER` (line 688) `#define CC_SPIDER`
- `CC_CYBER` (line 689) `#define CC_CYBER`
- `CC_HERO` (line 690) `#define CC_HERO`

#### `d_event.h`
**Path:** `progs/doomgeneric/d_event.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:          Event handling.*

**Functions:**
- `D_PostEvent` (line 129) `void D_PostEvent (event_t *ev);` - *Called by IO functions when input is detected.*
- `D_PopEvent` (line 133) `event_t *D_PopEvent(void);`

**Macros:**
- `__D_EVENT__` (line 21) `#define __D_EVENT__`

**Structs:**
- `event_t` (line 42) - *Event structure.*

#### `d_items.h`
**Path:** `progs/doomgeneric/d_items.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Items: key cards, artifacts, weapon, ammunition.        Weapon info: sprite frames, ammunition use.*

**Macros:**
- `__D_ITEMS__` (line 21) `#define __D_ITEMS__`

**Structs:**
- `weaponinfo_t` (line 28) - *Weapon info: sprite frames, ammunition use.*

**Variables:**
- `weaponinfo` (line 39) `extern weaponinfo_t weaponinfo[NUMWEAPONS];`

#### `d_iwad.h`
**Path:** `progs/doomgeneric/d_iwad.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Find IWAD and initialize according to IWAD type.*

**Functions:**
- `D_FindWADByName` (line 42) `char *D_FindWADByName(char *filename);`
- `D_TryFindWADByName` (line 43) `char *D_TryFindWADByName(char *filename);`
- `D_FindIWAD` (line 44) `char *D_FindIWAD(int mask, GameMission_t *mission);`
- `D_FindAllIWADs` (line 45) `const iwad_t **D_FindAllIWADs(int mask);`
- `D_SaveGameIWADName` (line 46) `char *D_SaveGameIWADName(GameMission_t gamemission);`
- `D_SuggestIWADName` (line 47) `char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);`
- `D_SuggestGameName` (line 48) `char *D_SuggestGameName(GameMission_t mission, GameMode_t mode);`
- `D_CheckCorrectIWAD` (line 49) `void D_CheckCorrectIWAD(GameMission_t mission);`

**Macros:**
- `__D_IWAD__` (line 20) `#define __D_IWAD__`
- `IWAD_MASK_DOOM` (line 24) `#define IWAD_MASK_DOOM`
- `IWAD_MASK_HERETIC` (line 30) `#define IWAD_MASK_HERETIC`
- `IWAD_MASK_HEXEN` (line 31) `#define IWAD_MASK_HEXEN`
- `IWAD_MASK_STRIFE` (line 32) `#define IWAD_MASK_STRIFE`

**Structs:**
- `iwad_t` (line 34)

#### `d_loop.h`
**Path:** `progs/doomgeneric/d_loop.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Main loop stuff.     Callback function invoked while waiting for the netgame to start. The callback is invoked when new players are ready. The callback should return true, or return false to abort startup.*

**Functions:**
- `D_RegisterLoopCallbacks` (line 52) `void D_RegisterLoopCallbacks(loop_interface_t *i);` - *Register callback functions for the main loop code to use.*
- `NetUpdate` (line 55) `void NetUpdate (void);` - *Create any new ticcmds and broadcast to other players.*
- `D_QuitNetGame` (line 59) `void D_QuitNetGame (void);` - *Broadcasts special packets to other players to notify of game exit*
- `TryRunTics` (line 62) `void TryRunTics (void);` - *? how many ticks to run?*
- `D_StartGameLoop` (line 65) `void D_StartGameLoop(void);` - *Called at start of game loop to initialize timers*
- `D_StartNetGame` (line 74) `void D_StartNetGame(net_gamesettings_t *settings, netgame_startup_callback_t callback);`

**Macros:**
- `__D_LOOP__` (line 20) `#define __D_LOOP__`

**Structs:**
- `loop_interface_t` (line 31)

**Variables:**
- `singletics` (line 77) `extern boolean singletics;`
- `ticdup` (line 78) `extern int gametic, ticdup;`

#### `d_main.h`
**Path:** `progs/doomgeneric/d_main.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.         Read events from all input devices*

**Functions:**
- `D_ProcessEvents` (line 30) `void D_ProcessEvents (void);`
- `D_PageTicker` (line 36) `void D_PageTicker (void);` - *BASE LEVEL*
- `D_PageDrawer` (line 37) `void D_PageDrawer (void);`
- `D_AdvanceDemo` (line 38) `void D_AdvanceDemo (void);`
- `D_DoAdvanceDemo` (line 39) `void D_DoAdvanceDemo (void);`
- `D_StartTitle` (line 40) `void D_StartTitle (void);`

**Macros:**
- `__D_MAIN__` (line 21) `#define __D_MAIN__`

**Variables:**
- `gameaction` (line 46) `extern gameaction_t gameaction;`

#### `d_mode.h`
**Path:** `progs/doomgeneric/d_mode.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Functions and definitions relating to the game type and operational mode.     The "mission" controls what game we are playing.*

**Functions:**
- `D_GetNumEpisodes` (line 93) `int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode);`
- `D_GameMissionString` (line 95) `char *D_GameMissionString(GameMission_t mission);`

**Macros:**
- `__D_MODE__` (line 21) `#define __D_MODE__`

#### `d_player.h`
**Path:** `progs/doomgeneric/d_player.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:       The player data structure depends on a number of other structs: items (internal inventory), animation states (closely tied to the sprites used to represent them, unfortunately).*

**Macros:**
- `__D_PLAYER__` (line 21) `#define __D_PLAYER__`

**Structs:**
- `player_s` (line 78) - *Extended player object info: player_t*
- `wbplayerstruct_t` (line 168) - *INTERMISSION Structure passed e.g. to WI_Start(wb)*
- `wbstartstruct_t` (line 182)

**Type_Aliases:**
- `mo` (line 78) `typedef struct player_s { mobj_t* mo;` - *Extended player object info: player_t*

#### `d_textur.h`
**Path:** `progs/doomgeneric/d_textur.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Typedefs related to to textures etc., isolated here to make it easier separating modules.          Flats?*

**Macros:**
- `__D_TEXTUR__` (line 22) `#define __D_TEXTUR__`

**Structs:**
- `pic_t` (line 33) - *Flats?  a pic is an unmasked block of pixels*

#### `d_think.h`
**Path:** `progs/doomgeneric/d_think.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: MapObj data. Map Objects or mobjs are actors, entities, thinker, take-your-pick... anything that moves, acts, or suffers state changes of more or less violent nature.          Experimental stuff.*

**Macros:**
- `__D_THINK__` (line 23) `#define __D_THINK__`

**Structs:**
- `thinker_s` (line 58) - *Doubly linked list of actors.*

**Type_Aliases:**
- `think_t` (line 54) `typedef actionf_t think_t;` - *Historically, "think_t" is yet another function pointer to a routine to handle an actor.*
- `prev` (line 58) `typedef struct thinker_s { struct thinker_s* prev;` - *Doubly linked list of actors.*

#### `d_ticcmd.h`
**Path:** `progs/doomgeneric/d_ticcmd.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.       The data sampled per tick (single player) and transmitted to other peers (multiplayer). Mainly movements/button commands per game tick, plus a checksum for internal state consistency.*

**Macros:**
- `__D_TICCMD__` (line 22) `#define __D_TICCMD__`

**Structs:**
- `ticcmd_t` (line 32)

#### `deh_main.h`
**Path:** `progs/doomgeneric/deh_main.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Dehacked entrypoint and common code     These are the limits that dehacked uses (from dheinit.h in the dehacked source).  If these limits are exceeded, it does not generate an error, but a warning is displayed.*

**Functions:**
- `DEH_ParseCommandLine` (line 33) `void DEH_ParseCommandLine(void);`
- `DEH_LoadFile` (line 34) `int DEH_LoadFile(char *filename);`
- `DEH_LoadLump` (line 35) `int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error);`
- `DEH_LoadLumpByName` (line 36) `int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error);`
- `DEH_Checksum` (line 40) `void DEH_Checksum(sha1_digest_t digest);`

**Macros:**
- `DEH_MAIN_H` (line 19) `#define DEH_MAIN_H`
- `DEH_VANILLA_NUMSTATES` (line 30) `#define DEH_VANILLA_NUMSTATES`
- `DEH_VANILLA_NUMSFX` (line 31) `#define DEH_VANILLA_NUMSFX`

**Variables:**
- `deh_allow_extended_strings` (line 42) `extern boolean deh_allow_extended_strings;`
- `deh_allow_long_strings` (line 43) `extern boolean deh_allow_long_strings;`
- `deh_allow_long_cheats` (line 44) `extern boolean deh_allow_long_cheats;`
- `deh_apply_cheats` (line 45) `extern boolean deh_apply_cheats;`

#### `deh_misc.h`
**Path:** `progs/doomgeneric/deh_misc.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Parses "Misc" sections in dehacked files*

**Macros:**
- `DEH_MISC_H` (line 19) `#define DEH_MISC_H`
- `DEH_DEFAULT_INITIAL_HEALTH` (line 23) `#define DEH_DEFAULT_INITIAL_HEALTH`
- `DEH_DEFAULT_INITIAL_BULLETS` (line 24) `#define DEH_DEFAULT_INITIAL_BULLETS`
- `DEH_DEFAULT_MAX_HEALTH` (line 25) `#define DEH_DEFAULT_MAX_HEALTH`
- `DEH_DEFAULT_MAX_ARMOR` (line 26) `#define DEH_DEFAULT_MAX_ARMOR`
- `DEH_DEFAULT_GREEN_ARMOR_CLASS` (line 27) `#define DEH_DEFAULT_GREEN_ARMOR_CLASS`
- `DEH_DEFAULT_BLUE_ARMOR_CLASS` (line 28) `#define DEH_DEFAULT_BLUE_ARMOR_CLASS`
- `DEH_DEFAULT_MAX_SOULSPHERE` (line 29) `#define DEH_DEFAULT_MAX_SOULSPHERE`
- `DEH_DEFAULT_SOULSPHERE_HEALTH` (line 30) `#define DEH_DEFAULT_SOULSPHERE_HEALTH`
- `DEH_DEFAULT_MEGASPHERE_HEALTH` (line 31) `#define DEH_DEFAULT_MEGASPHERE_HEALTH`
- `DEH_DEFAULT_GOD_MODE_HEALTH` (line 32) `#define DEH_DEFAULT_GOD_MODE_HEALTH`
- `DEH_DEFAULT_IDFA_ARMOR` (line 33) `#define DEH_DEFAULT_IDFA_ARMOR`
- `DEH_DEFAULT_IDFA_ARMOR_CLASS` (line 34) `#define DEH_DEFAULT_IDFA_ARMOR_CLASS`
- `DEH_DEFAULT_IDKFA_ARMOR` (line 35) `#define DEH_DEFAULT_IDKFA_ARMOR`
- `DEH_DEFAULT_IDKFA_ARMOR_CLASS` (line 36) `#define DEH_DEFAULT_IDKFA_ARMOR_CLASS`
- `DEH_DEFAULT_BFG_CELLS_PER_SHOT` (line 37) `#define DEH_DEFAULT_BFG_CELLS_PER_SHOT`
- `DEH_DEFAULT_SPECIES_INFIGHTING` (line 38) `#define DEH_DEFAULT_SPECIES_INFIGHTING`
- `deh_initial_health` (line 63) `#define deh_initial_health`
- `deh_initial_bullets` (line 64) `#define deh_initial_bullets`
- `deh_max_health` (line 65) `#define deh_max_health`
- `deh_max_armor` (line 66) `#define deh_max_armor`
- `deh_green_armor_class` (line 67) `#define deh_green_armor_class`
- `deh_blue_armor_class` (line 68) `#define deh_blue_armor_class`
- `deh_max_soulsphere` (line 69) `#define deh_max_soulsphere`
- `deh_soulsphere_health` (line 70) `#define deh_soulsphere_health`
- `deh_megasphere_health` (line 71) `#define deh_megasphere_health`
- `deh_god_mode_health` (line 72) `#define deh_god_mode_health`
- `deh_idfa_armor` (line 73) `#define deh_idfa_armor`
- `deh_idfa_armor_class` (line 74) `#define deh_idfa_armor_class`
- `deh_idkfa_armor` (line 75) `#define deh_idkfa_armor`
- `deh_idkfa_armor_class` (line 76) `#define deh_idkfa_armor_class`
- `deh_bfg_cells_per_shot` (line 77) `#define deh_bfg_cells_per_shot`
- `deh_species_infighting` (line 78) `#define deh_species_infighting`

**Variables:**
- `deh_initial_health` (line 42) `extern int deh_initial_health;`
- `deh_initial_bullets` (line 43) `extern int deh_initial_bullets;`
- `deh_max_health` (line 44) `extern int deh_max_health;`
- `deh_max_armor` (line 45) `extern int deh_max_armor;`
- `deh_green_armor_class` (line 46) `extern int deh_green_armor_class;`
- `deh_blue_armor_class` (line 47) `extern int deh_blue_armor_class;`
- `deh_max_soulsphere` (line 48) `extern int deh_max_soulsphere;`
- `deh_soulsphere_health` (line 49) `extern int deh_soulsphere_health;`
- `deh_megasphere_health` (line 50) `extern int deh_megasphere_health;`
- `deh_god_mode_health` (line 51) `extern int deh_god_mode_health;`
- `deh_idfa_armor` (line 52) `extern int deh_idfa_armor;`
- `deh_idfa_armor_class` (line 53) `extern int deh_idfa_armor_class;`
- `deh_idkfa_armor` (line 54) `extern int deh_idkfa_armor;`
- `deh_idkfa_armor_class` (line 55) `extern int deh_idkfa_armor_class;`
- `deh_bfg_cells_per_shot` (line 56) `extern int deh_bfg_cells_per_shot;`
- `deh_species_infighting` (line 57) `extern int deh_species_infighting;`

#### `deh_str.h`
**Path:** `progs/doomgeneric/deh_str.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Dehacked string replacements      Used to do dehacked text substitutions throughout the program*

**Functions:**
- `DEH_String` (line 29) `char *DEH_String(char *s);`
- `DEH_printf` (line 30) `void DEH_printf(char *fmt, ...);`
- `DEH_fprintf` (line 31) `void DEH_fprintf(FILE *fstream, char *fmt, ...);`
- `DEH_snprintf` (line 32) `void DEH_snprintf(char *buffer, size_t len, char *fmt, ...);`
- `DEH_AddStringReplacement` (line 33) `void DEH_AddStringReplacement(char *from_text, char *to_text);`

**Macros:**
- `DEH_STR_H` (line 19) `#define DEH_STR_H`
- `DEH_String` (line 38) `#define DEH_String(x)`
- `DEH_printf` (line 39) `#define DEH_printf`
- `DEH_fprintf` (line 40) `#define DEH_fprintf`
- `DEH_snprintf` (line 41) `#define DEH_snprintf`
- `DEH_AddStringReplacement` (line 42) `#define DEH_AddStringReplacement(x, y)`

#### `doom.h`
**Path:** `progs/doomgeneric/doom.h`

**Functions:**
- `D_DoomMain` (line 28) `void D_DoomMain (void);`

**Macros:**
- `SRC_CHOCDOOM_DOOM_H_` (line 10) `#define SRC_CHOCDOOM_DOOM_H_`

#### `doomdata.h`
**Path:** `progs/doomgeneric/doomdata.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: all external data is defined here most of the data is loaded into different structures at run time some internal structures shared by many modules are here    The most basic types we use, portability.  Some global defines, that configure the game.*

**Macros:**
- `__DOOMDATA__` (line 22) `#define __DOOMDATA__`
- `ML_BLOCKING` (line 98) `#define ML_BLOCKING`
- `ML_BLOCKMONSTERS` (line 101) `#define ML_BLOCKMONSTERS`
- `ML_TWOSIDED` (line 105) `#define ML_TWOSIDED`
- `ML_DONTPEGTOP` (line 117) `#define ML_DONTPEGTOP`
- `ML_DONTPEGBOTTOM` (line 120) `#define ML_DONTPEGBOTTOM`
- `ML_SECRET` (line 123) `#define ML_SECRET`
- `ML_SOUNDBLOCK` (line 126) `#define ML_SOUNDBLOCK`
- `ML_DONTDRAW` (line 129) `#define ML_DONTDRAW`
- `ML_MAPPED` (line 132) `#define ML_MAPPED`
- `NF_SUBSECTOR` (line 175) `#define	NF_SUBSECTOR`

#### `doomdef.h`
**Path:** `progs/doomgeneric/doomdef.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Internally used data structures for virtually everything, lots of other stuff.*

**Macros:**
- `__DOOMDEF__` (line 21) `#define __DOOMDEF__`
- `DOOM_VERSION` (line 34) `#define DOOM_VERSION`
- `DOOM_191_VERSION` (line 37) `#define DOOM_191_VERSION`
- `RANGECHECK` (line 42) `#define RANGECHECK`
- `MAXPLAYERS` (line 45) `#define MAXPLAYERS`
- `MTF_EASY` (line 77) `#define	MTF_EASY`
- `MTF_NORMAL` (line 78) `#define	MTF_NORMAL`
- `MTF_HARD` (line 79) `#define	MTF_HARD`
- `MTF_AMBUSH` (line 82) `#define	MTF_AMBUSH`

#### `doomfeatures.h`
**Path:** `progs/doomgeneric/doomfeatures.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: List of features which can be enabled/disabled to slim down the program.    Enables wad merging (the '-merge' command line parameter)   Enables dehacked support ('-deh')   Enables multiplayer support (network games)*

**Macros:**
- `DOOM_FEATURES_H` (line 20) `#define DOOM_FEATURES_H`
- `FEATURE_SOUND` (line 36) `#define FEATURE_SOUND`

#### `doomgeneric.h`
**Path:** `progs/doomgeneric/doomgeneric.h`

**Functions:**
- `DG_Init` (line 14) `void DG_Init();`
- `DG_DrawFrame` (line 15) `void DG_DrawFrame();`
- `DG_SleepMs` (line 16) `void DG_SleepMs(uint32_t ms);`
- `DG_GetTicksMs` (line 17) `uint32_t DG_GetTicksMs();`
- `DG_GetKey` (line 18) `int DG_GetKey(int* pressed, unsigned char* key);`
- `DG_SetWindowTitle` (line 19) `void DG_SetWindowTitle(const char * title);`

**Macros:**
- `DOOM_GENERIC` (line 2) `#define DOOM_GENERIC`
- `DOOMGENERIC_RESX` (line 7) `#define DOOMGENERIC_RESX`
- `DOOMGENERIC_RESY` (line 8) `#define DOOMGENERIC_RESY`

**Variables:**
- `DG_ScreenBuffer` (line 11) `extern uint32_t* DG_ScreenBuffer;`

#### `doomkeys.h`
**Path:** `progs/doomgeneric/doomkeys.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Key definitions     DOOM keyboard definition. This is the stuff configured by Setup.Exe. Most key data are simple ascii (uppercased).*

**Macros:**
- `__DOOMKEYS__` (line 20) `#define __DOOMKEYS__`
- `KEY_RIGHTARROW` (line 27) `#define KEY_RIGHTARROW`
- `KEY_LEFTARROW` (line 28) `#define KEY_LEFTARROW`
- `KEY_UPARROW` (line 29) `#define KEY_UPARROW`
- `KEY_DOWNARROW` (line 30) `#define KEY_DOWNARROW`
- `KEY_STRAFE_L` (line 31) `#define KEY_STRAFE_L`
- `KEY_STRAFE_R` (line 32) `#define KEY_STRAFE_R`
- `KEY_USE` (line 33) `#define KEY_USE`
- `KEY_FIRE` (line 34) `#define KEY_FIRE`
- `KEY_ESCAPE` (line 35) `#define KEY_ESCAPE`
- `KEY_ENTER` (line 36) `#define KEY_ENTER`
- `KEY_TAB` (line 37) `#define KEY_TAB`
- `KEY_F1` (line 38) `#define KEY_F1`
- `KEY_F2` (line 39) `#define KEY_F2`
- `KEY_F3` (line 40) `#define KEY_F3`
- `KEY_F4` (line 41) `#define KEY_F4`
- `KEY_F5` (line 42) `#define KEY_F5`
- `KEY_F6` (line 43) `#define KEY_F6`
- `KEY_F7` (line 44) `#define KEY_F7`
- `KEY_F8` (line 45) `#define KEY_F8`
- `KEY_F9` (line 46) `#define KEY_F9`
- `KEY_F10` (line 47) `#define KEY_F10`
- `KEY_F11` (line 48) `#define KEY_F11`
- `KEY_F12` (line 49) `#define KEY_F12`
- `KEY_BACKSPACE` (line 51) `#define KEY_BACKSPACE`
- `KEY_PAUSE` (line 52) `#define KEY_PAUSE`
- `KEY_EQUALS` (line 54) `#define KEY_EQUALS`
- `KEY_MINUS` (line 55) `#define KEY_MINUS`
- `KEY_RSHIFT` (line 57) `#define KEY_RSHIFT`
- `KEY_RCTRL` (line 58) `#define KEY_RCTRL`
- `KEY_RALT` (line 59) `#define KEY_RALT`
- `KEY_LALT` (line 61) `#define KEY_LALT`
- `KEY_CAPSLOCK` (line 65) `#define KEY_CAPSLOCK`
- `KEY_NUMLOCK` (line 66) `#define KEY_NUMLOCK`
- `KEY_SCRLCK` (line 67) `#define KEY_SCRLCK`
- `KEY_PRTSCR` (line 68) `#define KEY_PRTSCR`
- `KEY_HOME` (line 70) `#define KEY_HOME`
- `KEY_END` (line 71) `#define KEY_END`
- `KEY_PGUP` (line 72) `#define KEY_PGUP`
- `KEY_PGDN` (line 73) `#define KEY_PGDN`
- `KEY_INS` (line 74) `#define KEY_INS`
- `KEY_DEL` (line 75) `#define KEY_DEL`
- `KEYP_0` (line 77) `#define KEYP_0`
- `KEYP_1` (line 78) `#define KEYP_1`
- `KEYP_2` (line 79) `#define KEYP_2`
- `KEYP_3` (line 80) `#define KEYP_3`
- `KEYP_4` (line 81) `#define KEYP_4`
- `KEYP_5` (line 82) `#define KEYP_5`
- `KEYP_6` (line 83) `#define KEYP_6`
- `KEYP_7` (line 84) `#define KEYP_7`
- `KEYP_8` (line 85) `#define KEYP_8`
- `KEYP_9` (line 86) `#define KEYP_9`
- `KEYP_DIVIDE` (line 88) `#define KEYP_DIVIDE`
- `KEYP_PLUS` (line 89) `#define KEYP_PLUS`
- `KEYP_MINUS` (line 90) `#define KEYP_MINUS`
- `KEYP_MULTIPLY` (line 91) `#define KEYP_MULTIPLY`
- `KEYP_PERIOD` (line 92) `#define KEYP_PERIOD`
- `KEYP_EQUALS` (line 93) `#define KEYP_EQUALS`
- `KEYP_ENTER` (line 94) `#define KEYP_ENTER`

#### `doomstat.h`
**Path:** `progs/doomgeneric/doomstat.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: All the global variables that store the internal state. Theoretically speaking, the internal state of the engine should be found by looking at the variables collected here, and every relevant module will have to include this header file. In practice, things are a bit messy.     We need globally shared data structures, for defining the global state variables.*

**Macros:**
- `__D_STATE__` (line 26) `#define __D_STATE__`
- `logical_gamemission` (line 69) `#define logical_gamemission`
- `MAX_DM_STARTS` (line 227) `#define MAX_DM_STARTS`

**Variables:**
- `nomonsters` (line 46) `extern boolean nomonsters;` - *----------------------- Command line parameters.*
- `respawnparm` (line 47) `extern boolean respawnparm;`
- `fastparm` (line 48) `extern boolean fastparm;`
- `devparm` (line 50) `extern boolean devparm;`
- `gamemode` (line 56) `extern GameMode_t gamemode;` - *---------------------------------------------------- Game Mode - identify IWAD as shareware, retail etc.*
- `gamemission` (line 57) `extern GameMission_t gamemission;`
- `gameversion` (line 58) `extern GameVersion_t gameversion;`
- `gamedescription` (line 59) `extern char *gamedescription;`
- `bfgedition` (line 62) `extern boolean bfgedition;` - *If true, we're using one of the mangled BFG edition IWADs.*
- `modifiedgame` (line 74) `extern boolean modifiedgame;` - *Set if homebrew PWAD stuff has been added.*
- `startskill` (line 82) `extern skill_t startskill;` - *Defaults for menu, methinks.*
- `startepisode` (line 83) `extern int startepisode;`
- `startmap` (line 84) `extern int startmap;`
- `startloadgame` (line 89) `extern int startloadgame;`
- `autostart` (line 91) `extern boolean autostart;`
- `gameskill` (line 94) `extern skill_t gameskill;` - *Selected by user.*
- `gameepisode` (line 95) `extern int gameepisode;`
- `gamemap` (line 96) `extern int gamemap;`
- `timelimit` (line 99) `extern int timelimit;` - *If non-zero, exit the level after this number of minutes*
- `respawnmonsters` (line 102) `extern boolean respawnmonsters;` - *Nightmare mode flag, single player.*
- `netgame` (line 105) `extern boolean netgame;` - *Netgame? Only true if >1 player.*
- `deathmatch` (line 108) `extern int deathmatch;` - *0=Cooperative; 1=Deathmatch; 2=Altdeath*
- `sfxVolume` (line 120) `extern int sfxVolume;` - *From m_menu.c: Sound FX volume has default, 0 - 15 Music volume has default, 0 - 15 These are multiplied by 8.*
- `musicVolume` (line 121) `extern int musicVolume;`
- `snd_MusicDevice` (line 127) `extern int snd_MusicDevice;` - *Current music/sfx card - index useless w/o a reference LUT in a sound module. Ideally, this would use indices found in: /usr/include/linux/soundcard.h*
- `snd_SfxDevice` (line 128) `extern int snd_SfxDevice;`
- `snd_DesiredMusicDevice` (line 130) `extern int snd_DesiredMusicDevice;` - *Config file? Same disclaimer as above.*
- `snd_DesiredSfxDevice` (line 131) `extern int snd_DesiredSfxDevice;`
- `statusbaractive` (line 141) `extern boolean statusbaractive;` - *Depending on view size - no status bar? Note that there is no way to disable the status bar explicitely.*
- `automapactive` (line 143) `extern boolean automapactive;`
- `menuactive` (line 144) `extern boolean menuactive;`
- `paused` (line 145) `extern boolean paused;`
- `viewactive` (line 148) `extern boolean viewactive;`
- `nodrawers` (line 150) `extern boolean nodrawers;`
- `testcontrols` (line 153) `extern boolean testcontrols;`
- `testcontrols_mousespeed` (line 154) `extern int testcontrols_mousespeed;`
- `viewangleoffset` (line 161) `extern int viewangleoffset;` - *This one is related to the 3-screen display mode. ANG90 = left side, ANG270 = right*
- `consoleplayer` (line 164) `extern int consoleplayer;` - *Player taking events, and displaying.*
- `displayplayer` (line 165) `extern int displayplayer;`
- `totalkills` (line 172) `extern int totalkills;` - *------------------------------------ Scores, rating. Statistics on a given map, for intermission.*
- `totalitems` (line 173) `extern int totalitems;`
- `totalsecret` (line 174) `extern int totalsecret;`
- `levelstarttic` (line 177) `extern int levelstarttic;` - *Timer, for scores.*
- `leveltime` (line 178) `extern int leveltime;`
- `usergame` (line 186) `extern boolean usergame;` - *------------------------------------- DEMO playback/recording related stuff. No demo, there is a human player in charge? Disable save/end game?*
- `demoplayback` (line 189) `extern boolean demoplayback;` - *?*
- `demorecording` (line 190) `extern boolean demorecording;`
- `lowres_turn` (line 195) `extern boolean lowres_turn;`
- `singledemo` (line 198) `extern boolean singledemo;` - *Quit after playing a demo from cmdline.*
- `gamestate` (line 204) `extern gamestate_t gamestate;` - *?*
- `players` (line 220) `extern player_t players[MAXPLAYERS];` - *Bookkeeping on players - state.*
- `playeringame` (line 223) `extern boolean playeringame[MAXPLAYERS];` - *Alive? Disconnected?*
- `deathmatchstarts` (line 228) `extern mapthing_t deathmatchstarts[MAX_DM_STARTS];` - *Player spawn spots for deathmatch. define MAX_DM_STARTS   10*
- `deathmatch_p` (line 229) `extern mapthing_t* deathmatch_p;`
- `playerstarts` (line 232) `extern mapthing_t playerstarts[MAXPLAYERS];` - *Player spawn spots.*
- `wminfo` (line 236) `extern wbstartstruct_t wminfo;` - *Intermission stats. Parameters for world map / intermission.*
- `savegamedir` (line 249) `extern char * savegamedir;` - *File handling stuff.*
- `basedefault` (line 250) `extern char basedefault[1024];`
- `precache` (line 253) `extern boolean precache;` - *if true, load all graphics at level load*
- `wipegamestate` (line 258) `extern gamestate_t wipegamestate;` - *wipegamestate can be set to -1 to force a wipe on the next draw*
- `mouseSensitivity` (line 260) `extern int mouseSensitivity;`
- `bodyqueslot` (line 262) `extern int bodyqueslot;`
- `skyflatnum` (line 269) `extern int skyflatnum;` - *Needed to store the number of the dummy sky flat. Used for rendering, as well as tracking projectiles etc.*
- `rndindex` (line 276) `extern int rndindex;`
- `netcmds` (line 278) `extern ticcmd_t *netcmds;`

#### `doomtype.h`
**Path:** `progs/doomgeneric/doomtype.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Simple basic typedefs, isolated here to make it easier separating modules.     #define macros to provide functions missing in Windows. Outside Windows, we use strings.h for str[n]casecmp.*

**Macros:**
- `__DOOMTYPE__` (line 22) `#define __DOOMTYPE__`
- `strcasecmp` (line 30) `#define strcasecmp`
- `strncasecmp` (line 31) `#define strncasecmp`
- `PACKEDATTR` (line 50) `#define PACKEDATTR`
- `PACKEDATTR` (line 52) `#define PACKEDATTR`
- `DIR_SEPARATOR` (line 88) `#define DIR_SEPARATOR`
- `DIR_SEPARATOR_S` (line 89) `#define DIR_SEPARATOR_S`
- `PATH_SEPARATOR` (line 90) `#define PATH_SEPARATOR`
- `DIR_SEPARATOR` (line 94) `#define DIR_SEPARATOR`
- `DIR_SEPARATOR_S` (line 95) `#define DIR_SEPARATOR_S`
- `PATH_SEPARATOR` (line 96) `#define PATH_SEPARATOR`
- `arrlen` (line 100) `#define arrlen(array)`

**Type_Aliases:**
- `boolean` (line 68) `typedef bool boolean;` - *Use builtin bool type with C++.*
- `byte` (line 81) `typedef uint8_t byte;` - *endif*

#### `dstrings.h`
**Path:** `progs/doomgeneric/dstrings.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   DESCRIPTION: DOOM strings, by language.      All important printed strings.   Misc. other strings.*

**Macros:**
- `__DSTRINGS__` (line 22) `#define __DSTRINGS__`
- `SAVEGAMENAME` (line 30) `#define SAVEGAMENAME`
- `NUM_QUITMESSAGES` (line 35) `#define NUM_QUITMESSAGES`

**Variables:**
- `doom1_endmsg` (line 37) `extern char *doom1_endmsg[];`
- `doom2_endmsg` (line 38) `extern char *doom2_endmsg[];`

#### `f_finale.h`
**Path:** `progs/doomgeneric/f_finale.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:        FINALE   Called by main loop.*

**Functions:**
- `F_Ticker` (line 34) `void F_Ticker (void);` - *Called by main loop.*
- `F_Drawer` (line 37) `void F_Drawer (void);` - *Called by main loop.*
- `F_StartFinale` (line 40) `void F_StartFinale (void);`

**Macros:**
- `__F_FINALE__` (line 21) `#define __F_FINALE__`

#### `f_wipe.h`
**Path:** `progs/doomgeneric/f_wipe.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Mission start screen wipe/melt, special effects.      SCREEN WIPE PACKAGE*

**Functions:**
- `wipe_StartScreen` (line 39) `int wipe_StartScreen ( int x, int y, int width, int height );`
- `wipe_EndScreen` (line 47) `int wipe_EndScreen ( int x, int y, int width, int height );`
- `wipe_ScreenWipe` (line 55) `int wipe_ScreenWipe ( int wipeno, int x, int y, int width, int height, int ticks );`

**Macros:**
- `__F_WIPE_H__` (line 21) `#define __F_WIPE_H__`

#### `g_game.h`
**Path:** `progs/doomgeneric/g_game.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Duh.        GAME*

**Functions:**
- `G_DeathMatchSpawnPlayer` (line 31) `void G_DeathMatchSpawnPlayer (int playernum);` - *GAME*
- `G_InitNew` (line 33) `void G_InitNew (skill_t skill, int episode, int map);`
- `G_DeferedInitNew` (line 38) `void G_DeferedInitNew (skill_t skill, int episode, int map);` - *Can be called by the startup code or M_Responder. A normal game starts at map 1, but a warp test can start elsewhere*
- `G_DeferedPlayDemo` (line 40) `void G_DeferedPlayDemo (char* demo);`
- `G_LoadGame` (line 44) `void G_LoadGame (char* name);` - *Can be called by the startup code or M_Responder, calls P_SetupLevel or W_EnterWorld.*
- `G_DoLoadGame` (line 46) `void G_DoLoadGame (void);`
- `G_SaveGame` (line 49) `void G_SaveGame (int slot, char* description);` - *Called by M_Responder.*
- `G_RecordDemo` (line 52) `void G_RecordDemo (char* name);` - *Only called by startup code.*
- `G_BeginRecording` (line 54) `void G_BeginRecording (void);`
- `G_PlayDemo` (line 56) `void G_PlayDemo (char* name);`
- `G_TimeDemo` (line 57) `void G_TimeDemo (char* name);`
- `G_ExitLevel` (line 60) `void G_ExitLevel (void);`
- `G_SecretExitLevel` (line 61) `void G_SecretExitLevel (void);`
- `G_WorldDone` (line 63) `void G_WorldDone (void);`
- `G_BuildTiccmd` (line 67) `void G_BuildTiccmd (ticcmd_t *cmd, int maketic);`
- `G_Ticker` (line 69) `void G_Ticker (void);`
- `G_ScreenShot` (line 72) `void G_ScreenShot (void);`
- `G_DrawMouseSpeedBox` (line 74) `void G_DrawMouseSpeedBox(void);`
- `G_VanillaVersionCode` (line 75) `int G_VanillaVersionCode(void);`

**Macros:**
- `__G_GAME__` (line 21) `#define __G_GAME__`

**Variables:**
- `vanilla_savegame_limit` (line 77) `extern int vanilla_savegame_limit;`
- `vanilla_demo_limit` (line 78) `extern int vanilla_demo_limit;`

#### `gusconf.h`
**Path:** `progs/doomgeneric/gusconf.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: GUS emulation code.*

**Macros:**
- `__GUSCONF_H__` (line 19) `#define __GUSCONF_H__`

**Variables:**
- `gus_patch_path` (line 23) `extern char *gus_patch_path;`
- `gus_ram_kb` (line 24) `extern unsigned int gus_ram_kb;`

#### `hu_lib.h`
**Path:** `progs/doomgeneric/hu_lib.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none    We are referring to patches.  font stuff*

**Functions:**
- `HUlib_init` (line 91) `void HUlib_init(void);` - *initializes heads-up widget library*
- `HUlib_clearTextLine` (line 98) `void HUlib_clearTextLine(hu_textline_t *t);` - *clear a line of text*
- `HUlib_initTextLine` (line 100) `void HUlib_initTextLine(hu_textline_t *t, int x, int y, patch_t **f, int sc);`
- `HUlib_drawTextLine` (line 109) `void HUlib_drawTextLine(hu_textline_t *l, boolean drawcursor);` - *draws tline*
- `HUlib_eraseTextLine` (line 112) `void HUlib_eraseTextLine(hu_textline_t *l);` - *erases text line*
- `HUlib_initSText` (line 121) `void HUlib_initSText ( hu_stext_t* s, int x, int y, int h, patch_t** font, int startchar, boolean* on );`
- `HUlib_addLineToSText` (line 131) `void HUlib_addLineToSText(hu_stext_t* s);` - *add a new line*
- `HUlib_addMessageToSText` (line 135) `void HUlib_addMessageToSText ( hu_stext_t* s, char* prefix, char* msg );`
- `HUlib_drawSText` (line 141) `void HUlib_drawSText(hu_stext_t* s);` - *draws stext*
- `HUlib_eraseSText` (line 144) `void HUlib_eraseSText(hu_stext_t* s);` - *erases all stext lines*
- `HUlib_initIText` (line 148) `void HUlib_initIText ( hu_itext_t* it, int x, int y, patch_t** font, int startchar, boolean* on );`
- `HUlib_delCharFromIText` (line 157) `void HUlib_delCharFromIText(hu_itext_t* it);` - *enforces left margin*
- `HUlib_eraseLineFromIText` (line 160) `void HUlib_eraseLineFromIText(hu_itext_t* it);` - *enforces left margin*
- `HUlib_resetIText` (line 163) `void HUlib_resetIText(hu_itext_t* it);` - *resets line and left margin*
- `HUlib_addPrefixToIText` (line 167) `void HUlib_addPrefixToIText ( hu_itext_t* it, char* str );`
- `HUlib_drawIText` (line 177) `void HUlib_drawIText(hu_itext_t* it);`
- `HUlib_eraseIText` (line 180) `void HUlib_eraseIText(hu_itext_t* it);` - *erases all itext lines*

**Macros:**
- `__HULIB__` (line 19) `#define __HULIB__`
- `HU_CHARERASE` (line 25) `#define HU_CHARERASE`
- `HU_MAXLINES` (line 27) `#define HU_MAXLINES`
- `HU_MAXLINELENGTH` (line 28) `#define HU_MAXLINELENGTH`

**Structs:**
- `hu_textline_t` (line 36) - *Text Line widget (parent of Scrolling Text and Input Text widgets)*
- `hu_stext_t` (line 56) - *Scrolling Text window widget (child of Text Line widget)*
- `hu_itext_t` (line 72) - *Input Text Line widget (child of Text Line widget)*

#### `hu_stuff.h`
**Path:** `progs/doomgeneric/hu_stuff.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  Head up display       Globally visible constants.   Calculate # of glyphs in font.*

**Functions:**
- `HU_Init` (line 46) `void HU_Init(void);`
- `HU_Start` (line 47) `void HU_Start(void);`
- `HU_Ticker` (line 51) `void HU_Ticker(void);`
- `HU_Drawer` (line 52) `void HU_Drawer(void);`
- `HU_dequeueChatChar` (line 53) `char HU_dequeueChatChar(void);`
- `HU_Erase` (line 54) `void HU_Erase(void);`

**Macros:**
- `__HU_STUFF_H__` (line 19) `#define __HU_STUFF_H__`
- `HU_FONTSTART` (line 27) `#define HU_FONTSTART`
- `HU_FONTEND` (line 28) `#define HU_FONTEND`
- `HU_FONTSIZE` (line 31) `#define HU_FONTSIZE`
- `HU_BROADCAST` (line 33) `#define HU_BROADCAST`
- `HU_MSGX` (line 35) `#define HU_MSGX`
- `HU_MSGY` (line 36) `#define HU_MSGY`
- `HU_MSGWIDTH` (line 37) `#define HU_MSGWIDTH`
- `HU_MSGHEIGHT` (line 38) `#define HU_MSGHEIGHT`
- `HU_MSGTIMEOUT` (line 40) `#define HU_MSGTIMEOUT`

**Variables:**
- `chat_macros` (line 56) `extern char *chat_macros[10];`

#### `i_cdmus.h`
**Path:** `progs/doomgeneric/i_cdmus.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   i_cdmus.h*

**Functions:**
- `I_CDMusInit` (line 31) `int I_CDMusInit(void);`
- `I_CDMusPrintStartup` (line 32) `void I_CDMusPrintStartup(void);`
- `I_CDMusPlay` (line 33) `int I_CDMusPlay(int track);`
- `I_CDMusStop` (line 34) `int I_CDMusStop(void);`
- `I_CDMusResume` (line 35) `int I_CDMusResume(void);`
- `I_CDMusSetVolume` (line 36) `int I_CDMusSetVolume(int volume);`
- `I_CDMusFirstTrack` (line 37) `int I_CDMusFirstTrack(void);`
- `I_CDMusLastTrack` (line 38) `int I_CDMusLastTrack(void);`
- `I_CDMusTrackLength` (line 39) `int I_CDMusTrackLength(int track);`

**Macros:**
- `__ICDMUS__` (line 19) `#define __ICDMUS__`
- `CDERR_NOTINSTALLED` (line 21) `#define CDERR_NOTINSTALLED`
- `CDERR_NOAUDIOSUPPORT` (line 22) `#define CDERR_NOAUDIOSUPPORT`
- `CDERR_NOAUDIOTRACKS` (line 23) `#define CDERR_NOAUDIOTRACKS`
- `CDERR_BADDRIVE` (line 24) `#define CDERR_BADDRIVE`
- `CDERR_BADTRACK` (line 25) `#define CDERR_BADTRACK`
- `CDERR_IOCTLBUFFMEM` (line 26) `#define CDERR_IOCTLBUFFMEM`
- `CDERR_DEVREQBASE` (line 27) `#define CDERR_DEVREQBASE`

**Variables:**
- `cd_Error` (line 29) `extern int cd_Error;`

#### `i_endoom.h`
**Path:** `progs/doomgeneric/i_endoom.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Exit text-mode ENDOOM screen.     Display the Endoom screen on shutdown.  Pass a pointer to the ENDOOM lump.*

**Functions:**
- `I_Endoom` (line 26) `void I_Endoom(byte *data);`

**Macros:**
- `__I_ENDOOM__` (line 21) `#define __I_ENDOOM__`

#### `i_joystick.h`
**Path:** `progs/doomgeneric/i_joystick.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System-specific joystick interface.     Number of "virtual" joystick buttons defined in configuration files. This needs to be at least as large as the number of different key bindings supported by the higher-level game code (joyb* variables).  If this bit is set in a configuration file axis value, the axis is not actually a joystick axis, but instead is a "button axis". This means that instead of reading an SDL joystick axis, we read the state of two buttons to get the axis value. This is needed for eg.*

**Functions:**
- `I_InitJoystick` (line 63) `void I_InitJoystick(void);`
- `I_ShutdownJoystick` (line 64) `void I_ShutdownJoystick(void);`
- `I_UpdateJoystick` (line 65) `void I_UpdateJoystick(void);`
- `I_BindJoystickVariables` (line 67) `void I_BindJoystickVariables(void);`

**Macros:**
- `__I_JOYSTICK__` (line 20) `#define __I_JOYSTICK__`
- `NUM_VIRTUAL_BUTTONS` (line 25) `#define NUM_VIRTUAL_BUTTONS`
- `BUTTON_AXIS` (line 33) `#define BUTTON_AXIS`
- `IS_BUTTON_AXIS` (line 36) `#define IS_BUTTON_AXIS(axis)`
- `BUTTON_AXIS_NEG` (line 39) `#define BUTTON_AXIS_NEG(axis)`
- `BUTTON_AXIS_POS` (line 40) `#define BUTTON_AXIS_POS(axis)`
- `CREATE_BUTTON_AXIS` (line 43) `#define CREATE_BUTTON_AXIS(neg, pos)`
- `HAT_AXIS` (line 48) `#define HAT_AXIS`
- `IS_HAT_AXIS` (line 50) `#define IS_HAT_AXIS(axis)`
- `HAT_AXIS_HAT` (line 53) `#define HAT_AXIS_HAT(axis)`
- `HAT_AXIS_DIRECTION` (line 55) `#define HAT_AXIS_DIRECTION(axis)`
- `CREATE_HAT_AXIS` (line 57) `#define CREATE_HAT_AXIS(hat, direction)`
- `HAT_AXIS_HORIZONTAL` (line 60) `#define HAT_AXIS_HORIZONTAL`
- `HAT_AXIS_VERTICAL` (line 61) `#define HAT_AXIS_VERTICAL`

#### `i_scale.h`
**Path:** `progs/doomgeneric/i_scale.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Pixel-doubling scale up functions.*

**Functions:**
- `I_InitScale` (line 25) `void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch);`
- `I_ResetScaleTables` (line 26) `void I_ResetScaleTables(byte *palette);`

**Macros:**
- `__I_SCALE__` (line 21) `#define __I_SCALE__`

**Variables:**
- `mode_scale_1x` (line 30) `extern screen_mode_t mode_scale_1x;`
- `mode_scale_2x` (line 31) `extern screen_mode_t mode_scale_2x;`
- `mode_scale_3x` (line 32) `extern screen_mode_t mode_scale_3x;`
- `mode_scale_4x` (line 33) `extern screen_mode_t mode_scale_4x;`
- `mode_scale_5x` (line 34) `extern screen_mode_t mode_scale_5x;`
- `mode_stretch_1x` (line 38) `extern screen_mode_t mode_stretch_1x;`
- `mode_stretch_2x` (line 39) `extern screen_mode_t mode_stretch_2x;`
- `mode_stretch_3x` (line 40) `extern screen_mode_t mode_stretch_3x;`
- `mode_stretch_4x` (line 41) `extern screen_mode_t mode_stretch_4x;`
- `mode_stretch_5x` (line 42) `extern screen_mode_t mode_stretch_5x;`
- `mode_squash_1x` (line 46) `extern screen_mode_t mode_squash_1x;`
- `mode_squash_2x` (line 47) `extern screen_mode_t mode_squash_2x;`
- `mode_squash_3x` (line 48) `extern screen_mode_t mode_squash_3x;`
- `mode_squash_4x` (line 49) `extern screen_mode_t mode_squash_4x;`
- `mode_squash_5x` (line 50) `extern screen_mode_t mode_squash_5x;`

#### `i_sound.h`
**Path:** `progs/doomgeneric/i_sound.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The not so system specific sound interface.        SoundFX struct.*

**Functions:**
- `I_InitSound` (line 152) `void I_InitSound(boolean use_sfx_prefix);`
- `I_ShutdownSound` (line 153) `void I_ShutdownSound(void);`
- `I_GetSfxLumpNum` (line 154) `int I_GetSfxLumpNum(sfxinfo_t *sfxinfo);`
- `I_UpdateSound` (line 155) `void I_UpdateSound(void);`
- `I_UpdateSoundParams` (line 156) `void I_UpdateSoundParams(int channel, int vol, int sep);`
- `I_StartSound` (line 157) `int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep);`
- `I_StopSound` (line 158) `void I_StopSound(int channel);`
- `I_PrecacheSounds` (line 160) `void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds);`
- `I_InitMusic` (line 217) `void I_InitMusic(void);`
- `I_ShutdownMusic` (line 218) `void I_ShutdownMusic(void);`
- `I_SetMusicVolume` (line 219) `void I_SetMusicVolume(int volume);`
- `I_PauseSong` (line 220) `void I_PauseSong(void);`
- `I_ResumeSong` (line 221) `void I_ResumeSong(void);`
- `I_RegisterSong` (line 222) `void *I_RegisterSong(void *data, int len);`
- `I_UnRegisterSong` (line 223) `void I_UnRegisterSong(void *handle);`
- `I_PlaySong` (line 224) `void I_PlaySong(void *handle, boolean looping);`
- `I_StopSong` (line 225) `void I_StopSong(void);`
- `I_BindSoundVariables` (line 235) `void I_BindSoundVariables(void);`

**Macros:**
- `__I_SOUND__` (line 21) `#define __I_SOUND__`

**Structs:**
- `sfxinfo_struct` (line 31)
- `musicinfo_t` (line 72) - *MusicInfo struct.*
- `sound_module_t` (line 105)
- `music_module_t` (line 164)

**Type_Aliases:**
- `sfxinfo_t` (line 29) `typedef struct sfxinfo_struct sfxinfo_t;` - *SoundFX struct.*

**Variables:**
- `snd_sfxdevice` (line 228) `extern int snd_sfxdevice;`
- `snd_musicdevice` (line 229) `extern int snd_musicdevice;`
- `snd_samplerate` (line 230) `extern int snd_samplerate;`
- `snd_cachesize` (line 231) `extern int snd_cachesize;`
- `snd_maxslicetime_ms` (line 232) `extern int snd_maxslicetime_ms;`
- `snd_musiccmd` (line 233) `extern char *snd_musiccmd;`

#### `i_swap.h`
**Path:** `progs/doomgeneric/i_swap.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Endianess handling, swapping 16bit and 32bit.      Endianess handling. WAD files are stored little endian.  Just use SDL's endianness swapping functions.*

**Macros:**
- `__I_SWAP__` (line 21) `#define __I_SWAP__`
- `SHORT` (line 34) `#define SHORT(x)`
- `LONG` (line 35) `#define LONG(x)`
- `SYS_LITTLE_ENDIAN` (line 40) `#define SYS_LITTLE_ENDIAN`
- `SYS_BIG_ENDIAN` (line 42) `#define SYS_BIG_ENDIAN`
- `SHORT` (line 47) `#define SHORT(x)`
- `LONG` (line 48) `#define LONG(x)`
- `SYS_LITTLE_ENDIAN` (line 50) `#define SYS_LITTLE_ENDIAN`

#### `i_system.h`
**Path:** `progs/doomgeneric/i_system.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.*

**Functions:**
- `I_Init` (line 30) `void I_Init (void);` - *Called by DoomMain.*
- `I_ZoneBase` (line 35) `byte* I_ZoneBase (int *size);` - *Called by startup code to get the ammount of memory to malloc for the zone management.*
- `I_BaseTiccmd` (line 48) `ticcmd_t* I_BaseTiccmd (void);` - *Either returns a null ticcmd, or calls a loadable driver to build it. This ticcmd will then be modified by the gameloop for normal input.*
- `I_Quit` (line 53) `void I_Quit (void);` - *Called by M_Responder when quit is selected. Clean exit, displays sell blurb.*
- `I_Error` (line 55) `void I_Error (char *error, ...);`
- `I_Tactile` (line 57) `void I_Tactile (int on, int off, int total);`
- `I_AtExit` (line 65) `void I_AtExit(atexit_func_t func, boolean run_if_error);`
- `I_BindVariables` (line 69) `void I_BindVariables(void);`
- `I_PrintStartupBanner` (line 73) `void I_PrintStartupBanner(char *gamedescription);`
- `I_PrintBanner` (line 77) `void I_PrintBanner(char *text);`
- `I_PrintDivider` (line 81) `void I_PrintDivider(void);`

**Macros:**
- `__I_SYSTEM__` (line 21) `#define __I_SYSTEM__`

#### `i_timer.h`
**Path:** `progs/doomgeneric/i_timer.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System-specific timer interface      Called by D_DoomLoop, returns current time in tics.*

**Functions:**
- `I_GetTime` (line 27) `int I_GetTime (void);` - *Called by D_DoomLoop, returns current time in tics.*
- `I_GetTimeMS` (line 30) `int I_GetTimeMS (void);` - *returns current time in ms*
- `I_Sleep` (line 33) `void I_Sleep(int ms);` - *Pause for a specified number of ms*
- `I_InitTimer` (line 36) `void I_InitTimer(void);` - *Initialize timer*
- `I_WaitVBL` (line 39) `void I_WaitVBL(int count);` - *Wait for vertical retrace or pause a bit.*

**Macros:**
- `__I_TIMER__` (line 21) `#define __I_TIMER__`
- `TICRATE` (line 23) `#define TICRATE`

#### `i_video.h`
**Path:** `progs/doomgeneric/i_video.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.      Screen width and height.   Screen width used for "squash" scale functions*

**Functions:**
- `I_InitGraphics` (line 97) `void I_InitGraphics (void);` - *Called by D_DoomMain, determines the hardware configuration and sets up the video mode*
- `I_GraphicsCheckCommandLine` (line 99) `void I_GraphicsCheckCommandLine(void);`
- `I_ShutdownGraphics` (line 101) `void I_ShutdownGraphics(void);`
- `I_SetPalette` (line 104) `void I_SetPalette (byte* palette);` - *Takes full 8 bit values.*
- `I_GetPaletteIndex` (line 105) `int I_GetPaletteIndex(int r, int g, int b);`
- `I_UpdateNoBlit` (line 107) `void I_UpdateNoBlit (void);`
- `I_FinishUpdate` (line 108) `void I_FinishUpdate (void);`
- `I_ReadScreen` (line 110) `void I_ReadScreen (byte* scr);`
- `I_BeginRead` (line 112) `void I_BeginRead (void);`
- `I_SetWindowTitle` (line 114) `void I_SetWindowTitle(char *title);`
- `I_CheckIsScreensaver` (line 116) `void I_CheckIsScreensaver(void);`
- `I_SetGrabMouseCallback` (line 117) `void I_SetGrabMouseCallback(grabmouse_callback_t func);`
- `I_DisplayFPSDots` (line 119) `void I_DisplayFPSDots(boolean dots_on);`
- `I_BindVideoVariables` (line 120) `void I_BindVideoVariables(void);`
- `I_InitWindowTitle` (line 122) `void I_InitWindowTitle(void);`
- `I_InitWindowIcon` (line 123) `void I_InitWindowIcon(void);`
- `I_StartFrame` (line 128) `void I_StartFrame (void);`
- `I_StartTic` (line 133) `void I_StartTic (void);`
- `I_EnableLoadingDisk` (line 137) `void I_EnableLoadingDisk(void);`

**Macros:**
- `__I_VIDEO__` (line 21) `#define __I_VIDEO__`
- `SCREENWIDTH` (line 27) `#define SCREENWIDTH`
- `SCREENHEIGHT` (line 28) `#define SCREENHEIGHT`
- `SCREENWIDTH_4_3` (line 32) `#define SCREENWIDTH_4_3`
- `SCREENHEIGHT_4_3` (line 36) `#define SCREENHEIGHT_4_3`
- `MAX_MOUSE_BUTTONS` (line 38) `#define MAX_MOUSE_BUTTONS`

**Structs:**
- `screen_mode_t` (line 40)

**Variables:**
- `video_driver` (line 139) `extern char *video_driver;`
- `screenvisible` (line 140) `extern boolean screenvisible;`
- `mouse_acceleration` (line 142) `extern float mouse_acceleration;`
- `mouse_threshold` (line 143) `extern int mouse_threshold;`
- `vanilla_keyboard_mapping` (line 144) `extern int vanilla_keyboard_mapping;`
- `screensaver_mode` (line 145) `extern boolean screensaver_mode;`
- `usegamma` (line 146) `extern int usegamma;`
- `I_VideoBuffer` (line 147) `extern byte *I_VideoBuffer;`
- `screen_width` (line 149) `extern int screen_width;`
- `screen_height` (line 150) `extern int screen_height;`
- `screen_bpp` (line 151) `extern int screen_bpp;`
- `fullscreen` (line 152) `extern int fullscreen;`
- `aspect_ratio_correct` (line 153) `extern int aspect_ratio_correct;`
- `show_diskicon` (line 155) `extern int show_diskicon;`
- `diskicon_readbytes` (line 156) `extern int diskicon_readbytes;`

#### `info.h`
**Path:** `progs/doomgeneric/info.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Thing frame/state LUT, generated by multigen utilitiy. This one is the original DOOM version, preserved.    Needed for action function pointer handling.*

**Macros:**
- `__INFO__` (line 22) `#define __INFO__`

**Structs:**
- `state_t` (line 1144)
- `mobjinfo_t` (line 1301)

**Variables:**
- `states` (line 1156) `extern state_t states[NUMSTATES];`
- `sprnames` (line 1157) `extern char *sprnames[];`
- `mobjinfo` (line 1329) `extern mobjinfo_t mobjinfo[NUMMOBJTYPES];`

#### `m_argv.h`
**Path:** `progs/doomgeneric/m_argv.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Nil.       MISC*

**Functions:**
- `M_CheckParm` (line 33) `int M_CheckParm (char* check);` - *Returns the position of the given parameter in the arg list (0 if not found).*
- `M_CheckParmWithArgs` (line 37) `int M_CheckParmWithArgs(char *check, int num_args);` - *Same as M_CheckParm, but checks that num_args arguments are available following the specified argument.*
- `M_FindResponseFile` (line 39) `void M_FindResponseFile(void);`
- `M_GetExecutableName` (line 47) `char *M_GetExecutableName(void);`

**Macros:**
- `__M_ARGV__` (line 21) `#define __M_ARGV__`

**Variables:**
- `myargc` (line 28) `extern int myargc;` - *MISC*
- `myargv` (line 29) `extern char** myargv;`

#### `m_bbox.h`
**Path:** `progs/doomgeneric/m_bbox.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Nil.        Bounding box coordinate storage.*

**Functions:**
- `M_ClearBox` (line 38) `void M_ClearBox (fixed_t* box);` - *Bounding box functions.*
- `M_AddToBox` (line 41) `void M_AddToBox ( fixed_t* box, fixed_t x, fixed_t y );`

**Macros:**
- `__M_BBOX__` (line 21) `#define __M_BBOX__`

#### `m_cheat.h`
**Path:** `progs/doomgeneric/m_cheat.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Cheat code checking.      CHEAT SEQUENCE PACKAGE   declaring a cheat*

**Functions:**
- `cht_CheckCheat` (line 51) `int cht_CheckCheat ( cheatseq_t* cht, char key );`
- `cht_GetParam` (line 57) `void cht_GetParam ( cheatseq_t* cht, char* buffer );`

**Macros:**
- `__M_CHEAT__` (line 21) `#define __M_CHEAT__`
- `CHEAT` (line 29) `#define CHEAT(value, parameters)`
- `MAX_CHEAT_LEN` (line 32) `#define MAX_CHEAT_LEN`
- `MAX_CHEAT_PARAMS` (line 33) `#define MAX_CHEAT_PARAMS`

**Structs:**
- `cheatseq_t` (line 35)

#### `m_config.h`
**Path:** `progs/doomgeneric/m_config.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Configuration file interface.*

**Functions:**
- `M_LoadDefaults` (line 25) `void M_LoadDefaults(void);`
- `M_SaveDefaults` (line 26) `void M_SaveDefaults(void);`
- `M_SaveDefaultsAlternate` (line 27) `void M_SaveDefaultsAlternate(char *main, char *extra);`
- `M_SetConfigDir` (line 28) `void M_SetConfigDir(char *dir);`
- `M_BindVariable` (line 29) `void M_BindVariable(char *name, void *variable);`
- `M_GetIntVariable` (line 31) `int M_GetIntVariable(char *name);`
- `M_GetStrVariable` (line 32) `const char *M_GetStrVariable(char *name);`
- `M_GetFloatVariable` (line 33) `float M_GetFloatVariable(char *name);`
- `M_SetConfigFilenames` (line 34) `void M_SetConfigFilenames(char *main_config, char *extra_config);`
- `M_GetSaveGameDir` (line 35) `char *M_GetSaveGameDir(char *iwadname);`

**Macros:**
- `__M_CONFIG__` (line 21) `#define __M_CONFIG__`

**Variables:**
- `configdir` (line 37) `extern char *configdir;`

#### `m_controls.h`
**Path:** `progs/doomgeneric/m_controls.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.*

**Functions:**
- `M_BindBaseControls` (line 156) `void M_BindBaseControls(void);`
- `M_BindHereticControls` (line 157) `void M_BindHereticControls(void);`
- `M_BindHexenControls` (line 158) `void M_BindHexenControls(void);`
- `M_BindStrifeControls` (line 159) `void M_BindStrifeControls(void);`
- `M_BindWeaponControls` (line 160) `void M_BindWeaponControls(void);`
- `M_BindMapControls` (line 161) `void M_BindMapControls(void);`
- `M_BindMenuControls` (line 162) `void M_BindMenuControls(void);`
- `M_BindChatControls` (line 163) `void M_BindChatControls(unsigned int num_players);`
- `M_ApplyPlatformDefaults` (line 165) `void M_ApplyPlatformDefaults(void);`

**Macros:**
- `__M_CONTROLS_H__` (line 18) `#define __M_CONTROLS_H__`

**Variables:**
- `key_right` (line 20) `extern int key_right;`
- `key_left` (line 21) `extern int key_left;`
- `key_up` (line 23) `extern int key_up;`
- `key_down` (line 24) `extern int key_down;`
- `key_strafeleft` (line 25) `extern int key_strafeleft;`
- `key_straferight` (line 26) `extern int key_straferight;`
- `key_fire` (line 27) `extern int key_fire;`
- `key_use` (line 28) `extern int key_use;`
- `key_strafe` (line 29) `extern int key_strafe;`
- `key_speed` (line 30) `extern int key_speed;`
- `key_jump` (line 32) `extern int key_jump;`
- `key_flyup` (line 34) `extern int key_flyup;`
- `key_flydown` (line 35) `extern int key_flydown;`
- `key_flycenter` (line 36) `extern int key_flycenter;`
- `key_lookup` (line 37) `extern int key_lookup;`
- `key_lookdown` (line 38) `extern int key_lookdown;`
- `key_lookcenter` (line 39) `extern int key_lookcenter;`
- `key_invleft` (line 40) `extern int key_invleft;`
- `key_invright` (line 41) `extern int key_invright;`
- `key_useartifact` (line 42) `extern int key_useartifact;`
- `key_usehealth` (line 45) `extern int key_usehealth;` - *villsa [STRIFE] strife keys*
- `key_invquery` (line 46) `extern int key_invquery;`
- `key_mission` (line 47) `extern int key_mission;`
- `key_invpop` (line 48) `extern int key_invpop;`
- `key_invkey` (line 49) `extern int key_invkey;`
- `key_invhome` (line 50) `extern int key_invhome;`
- `key_invend` (line 51) `extern int key_invend;`
- `key_invuse` (line 52) `extern int key_invuse;`
- `key_invdrop` (line 53) `extern int key_invdrop;`
- `key_message_refresh` (line 55) `extern int key_message_refresh;`
- `key_pause` (line 56) `extern int key_pause;`
- `key_multi_msg` (line 58) `extern int key_multi_msg;`
- `key_multi_msgplayer` (line 59) `extern int key_multi_msgplayer[8];`
- `key_weapon1` (line 61) `extern int key_weapon1;`
- `key_weapon2` (line 62) `extern int key_weapon2;`
- `key_weapon3` (line 63) `extern int key_weapon3;`
- `key_weapon4` (line 64) `extern int key_weapon4;`
- `key_weapon5` (line 65) `extern int key_weapon5;`
- `key_weapon6` (line 66) `extern int key_weapon6;`
- `key_weapon7` (line 67) `extern int key_weapon7;`
- `key_weapon8` (line 68) `extern int key_weapon8;`
- `key_arti_all` (line 70) `extern int key_arti_all;`
- `key_arti_health` (line 71) `extern int key_arti_health;`
- `key_arti_poisonbag` (line 72) `extern int key_arti_poisonbag;`
- `key_arti_blastradius` (line 73) `extern int key_arti_blastradius;`
- `key_arti_teleport` (line 74) `extern int key_arti_teleport;`
- `key_arti_teleportother` (line 75) `extern int key_arti_teleportother;`
- `key_arti_egg` (line 76) `extern int key_arti_egg;`
- `key_arti_invulnerability` (line 77) `extern int key_arti_invulnerability;`
- `key_demo_quit` (line 79) `extern int key_demo_quit;`
- `key_spy` (line 80) `extern int key_spy;`
- `key_prevweapon` (line 81) `extern int key_prevweapon;`
- `key_nextweapon` (line 82) `extern int key_nextweapon;`
- `key_map_north` (line 84) `extern int key_map_north;`
- `key_map_south` (line 85) `extern int key_map_south;`
- `key_map_east` (line 86) `extern int key_map_east;`
- `key_map_west` (line 87) `extern int key_map_west;`
- `key_map_zoomin` (line 88) `extern int key_map_zoomin;`
- `key_map_zoomout` (line 89) `extern int key_map_zoomout;`
- `key_map_toggle` (line 90) `extern int key_map_toggle;`
- `key_map_maxzoom` (line 91) `extern int key_map_maxzoom;`
- `key_map_follow` (line 92) `extern int key_map_follow;`
- `key_map_grid` (line 93) `extern int key_map_grid;`
- `key_map_mark` (line 94) `extern int key_map_mark;`
- `key_map_clearmark` (line 95) `extern int key_map_clearmark;`
- `key_menu_activate` (line 99) `extern int key_menu_activate;`
- `key_menu_up` (line 100) `extern int key_menu_up;`
- `key_menu_down` (line 101) `extern int key_menu_down;`
- `key_menu_left` (line 102) `extern int key_menu_left;`
- `key_menu_right` (line 103) `extern int key_menu_right;`
- `key_menu_back` (line 104) `extern int key_menu_back;`
- `key_menu_forward` (line 105) `extern int key_menu_forward;`
- `key_menu_confirm` (line 106) `extern int key_menu_confirm;`
- `key_menu_abort` (line 107) `extern int key_menu_abort;`
- `key_menu_help` (line 109) `extern int key_menu_help;`
- `key_menu_save` (line 110) `extern int key_menu_save;`
- `key_menu_load` (line 111) `extern int key_menu_load;`
- `key_menu_volume` (line 112) `extern int key_menu_volume;`
- `key_menu_detail` (line 113) `extern int key_menu_detail;`
- `key_menu_qsave` (line 114) `extern int key_menu_qsave;`
- `key_menu_endgame` (line 115) `extern int key_menu_endgame;`
- `key_menu_messages` (line 116) `extern int key_menu_messages;`
- `key_menu_qload` (line 117) `extern int key_menu_qload;`
- `key_menu_quit` (line 118) `extern int key_menu_quit;`
- `key_menu_gamma` (line 119) `extern int key_menu_gamma;`
- `key_menu_incscreen` (line 121) `extern int key_menu_incscreen;`
- `key_menu_decscreen` (line 122) `extern int key_menu_decscreen;`
- `key_menu_screenshot` (line 123) `extern int key_menu_screenshot;`
- `mousebfire` (line 125) `extern int mousebfire;`
- `mousebstrafe` (line 126) `extern int mousebstrafe;`
- `mousebforward` (line 127) `extern int mousebforward;`
- `mousebjump` (line 129) `extern int mousebjump;`
- `mousebstrafeleft` (line 131) `extern int mousebstrafeleft;`
- `mousebstraferight` (line 132) `extern int mousebstraferight;`
- `mousebbackward` (line 133) `extern int mousebbackward;`
- `mousebuse` (line 134) `extern int mousebuse;`
- `mousebprevweapon` (line 136) `extern int mousebprevweapon;`
- `mousebnextweapon` (line 137) `extern int mousebnextweapon;`
- `joybfire` (line 139) `extern int joybfire;`
- `joybstrafe` (line 140) `extern int joybstrafe;`
- `joybuse` (line 141) `extern int joybuse;`
- `joybspeed` (line 142) `extern int joybspeed;`
- `joybjump` (line 144) `extern int joybjump;`
- `joybstrafeleft` (line 146) `extern int joybstrafeleft;`
- `joybstraferight` (line 147) `extern int joybstraferight;`
- `joybprevweapon` (line 149) `extern int joybprevweapon;`
- `joybnextweapon` (line 150) `extern int joybnextweapon;`
- `joybmenu` (line 152) `extern int joybmenu;`
- `dclick_use` (line 154) `extern int dclick_use;`

#### `m_fixed.h`
**Path:** `progs/doomgeneric/m_fixed.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Fixed point arithemtics, implementation.         Fixed point, 32bit as 16.16.*

**Functions:**
- `FixedMul` (line 34) `fixed_t FixedMul (fixed_t a, fixed_t b);`
- `FixedDiv` (line 35) `fixed_t FixedDiv (fixed_t a, fixed_t b);`

**Macros:**
- `__M_FIXED__` (line 21) `#define __M_FIXED__`
- `FRACBITS` (line 29) `#define FRACBITS`
- `FRACUNIT` (line 30) `#define FRACUNIT`

**Type_Aliases:**
- `fixed_t` (line 31) `typedef int fixed_t;` - *Fixed point, 32bit as 16.16.  define FRACBITS		16 define FRACUNIT		(1<<FRACBITS)*

#### `m_menu.h`
**Path:** `progs/doomgeneric/m_menu.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Menu widget stuff, episode selection and such.         MENUS  Called by main loop,*

**Functions:**
- `M_Ticker` (line 40) `void M_Ticker (void);` - *Called by main loop, only used for menu (skull cursor) animation.*
- `M_Drawer` (line 44) `void M_Drawer (void);` - *Called by main loop, draws the menus directly into the screen buffer.*
- `M_Init` (line 48) `void M_Init (void);` - *Called by D_DoomMain, loads the config file.*
- `M_StartControlPanel` (line 52) `void M_StartControlPanel (void);` - *Called by intro code to force menu up upon a keypress, does nothing if menu is already up.*

**Macros:**
- `__M_MENU__` (line 21) `#define __M_MENU__`

**Variables:**
- `detailLevel` (line 56) `extern int detailLevel;`
- `screenblocks` (line 57) `extern int screenblocks;`

#### `m_misc.h`
**Path:** `progs/doomgeneric/m_misc.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Miscellaneous.*

**Functions:**
- `M_ReadFile` (line 29) `int M_ReadFile(char *name, byte **buffer);`
- `M_MakeDirectory` (line 30) `void M_MakeDirectory(char *dir);`
- `M_TempFile` (line 31) `char *M_TempFile(char *s);`
- `M_FileLength` (line 33) `long M_FileLength(FILE *handle);`
- `M_ExtractFileBase` (line 35) `void M_ExtractFileBase(char *path, char *dest);`
- `M_ForceUppercase` (line 36) `void M_ForceUppercase(char *text);`
- `M_StrCaseStr` (line 37) `char *M_StrCaseStr(char *haystack, char *needle);`
- `M_StringDuplicate` (line 38) `char *M_StringDuplicate(const char *orig);`
- `M_StringReplace` (line 41) `char *M_StringReplace(const char *haystack, const char *needle, const char *replacement);`
- `M_StringJoin` (line 43) `char *M_StringJoin(const char *s, ...);`
- `M_vsnprintf` (line 46) `int M_vsnprintf(char *buf, size_t buf_len, const char *s, va_list args);`
- `M_snprintf` (line 47) `int M_snprintf(char *buf, size_t buf_len, const char *s, ...);`
- `M_OEMToUTF8` (line 48) `char *M_OEMToUTF8(const char *ansi);`

**Macros:**
- `__M_MISC__` (line 21) `#define __M_MISC__`

#### `m_random.h`
**Path:** `progs/doomgeneric/m_random.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:          Returns a number from 0 to 255, from a lookup table.*

**Functions:**
- `M_Random` (line 30) `int M_Random (void);` - *Returns a number from 0 to 255, from a lookup table.*
- `P_Random` (line 33) `int P_Random (void);` - *As M_Random, but used only by the play simulation.*
- `M_ClearRandom` (line 36) `void M_ClearRandom (void);` - *Fix randoms for demos.*

**Macros:**
- `__M_RANDOM__` (line 21) `#define __M_RANDOM__`

#### `memio.h`
**Path:** `progs/doomgeneric/memio.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.*

**Functions:**
- `mem_fopen_read` (line 28) `MEMFILE *mem_fopen_read(void *buf, size_t buflen);`
- `mem_fread` (line 29) `size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream);`
- `mem_fopen_write` (line 30) `MEMFILE *mem_fopen_write(void);`
- `mem_fwrite` (line 31) `size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream);`
- `mem_get_buf` (line 32) `void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen);`
- `mem_fclose` (line 33) `void mem_fclose(MEMFILE *stream);`
- `mem_ftell` (line 34) `long mem_ftell(MEMFILE *stream);`
- `mem_fseek` (line 35) `int mem_fseek(MEMFILE *stream, signed long offset, mem_rel_t whence);`

**Macros:**
- `MEMIO_H` (line 17) `#define MEMIO_H`

**Type_Aliases:**
- `MEMFILE` (line 18) `typedef struct _MEMFILE MEMFILE;` - *ifndef MEMIO_H define MEMIO_H*

#### `net_client.h`
**Path:** `progs/doomgeneric/net_client.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Network client code*

**Functions:**
- `NET_CL_Disconnect` (line 26) `void NET_CL_Disconnect(void);`
- `NET_CL_Run` (line 27) `void NET_CL_Run(void);`
- `NET_CL_Init` (line 28) `void NET_CL_Init(void);`
- `NET_CL_LaunchGame` (line 29) `void NET_CL_LaunchGame(void);`
- `NET_CL_StartGame` (line 30) `void NET_CL_StartGame(net_gamesettings_t *settings);`
- `NET_CL_SendTiccmd` (line 31) `void NET_CL_SendTiccmd(ticcmd_t *ticcmd, int maketic);`
- `NET_Init` (line 33) `void NET_Init(void);`
- `NET_BindVariables` (line 35) `void NET_BindVariables(void);`

**Macros:**
- `NET_CLIENT_H` (line 18) `#define NET_CLIENT_H`

**Variables:**
- `net_client_connected` (line 37) `extern boolean net_client_connected;`
- `net_client_received_wait_data` (line 38) `extern boolean net_client_received_wait_data;`
- `net_client_wait_data` (line 39) `extern net_waitdata_t net_client_wait_data;`
- `net_waiting_for_launch` (line 40) `extern boolean net_waiting_for_launch;`
- `net_player_name` (line 41) `extern char *net_player_name;`
- `net_server_wad_sha1sum` (line 43) `extern sha1_digest_t net_server_wad_sha1sum;`
- `net_server_deh_sha1sum` (line 44) `extern sha1_digest_t net_server_deh_sha1sum;`
- `net_server_is_freedoom` (line 45) `extern unsigned int net_server_is_freedoom;`
- `net_local_wad_sha1sum` (line 46) `extern sha1_digest_t net_local_wad_sha1sum;`
- `net_local_deh_sha1sum` (line 47) `extern sha1_digest_t net_local_deh_sha1sum;`
- `net_local_is_freedoom` (line 48) `extern unsigned int net_local_is_freedoom;`
- `drone` (line 50) `extern boolean drone;`

#### `net_dedicated.h`
**Path:** `progs/doomgeneric/net_dedicated.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.   Dedicated server code.*

**Functions:**
- `NET_DedicatedServer` (line 21) `void NET_DedicatedServer(void);`

**Macros:**
- `NET_DEDICATED_H` (line 19) `#define NET_DEDICATED_H`

#### `net_defs.h`
**Path:** `progs/doomgeneric/net_defs.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Definitions for use in networking code.      Absolute maximum number of "nodes" in the game.  This is different to NET_MAXPLAYERS, as there may be observers that are not participating (eg. left/right monitors)*

**Macros:**
- `NET_DEFS_H` (line 19) `#define NET_DEFS_H`
- `MAXNETNODES` (line 31) `#define MAXNETNODES`
- `NET_MAXPLAYERS` (line 37) `#define NET_MAXPLAYERS`
- `MAXPLAYERNAME` (line 41) `#define MAXPLAYERNAME`
- `BACKUPTICS` (line 45) `#define BACKUPTICS`
- `NET_MAGIC_NUMBER` (line 103) `#define NET_MAGIC_NUMBER`
- `NET_RELIABLE_PACKET` (line 107) `#define NET_RELIABLE_PACKET`
- `NET_TICDIFF_FORWARD` (line 193) `#define NET_TICDIFF_FORWARD`
- `NET_TICDIFF_SIDE` (line 194) `#define NET_TICDIFF_SIDE`
- `NET_TICDIFF_TURN` (line 195) `#define NET_TICDIFF_TURN`
- `NET_TICDIFF_BUTTONS` (line 196) `#define NET_TICDIFF_BUTTONS`
- `NET_TICDIFF_CONSISTANCY` (line 197) `#define NET_TICDIFF_CONSISTANCY`
- `NET_TICDIFF_CHATCHAR` (line 198) `#define NET_TICDIFF_CHATCHAR`
- `NET_TICDIFF_RAVEN` (line 199) `#define NET_TICDIFF_RAVEN`
- `NET_TICDIFF_STRIFE` (line 200) `#define NET_TICDIFF_STRIFE`

**Structs:**
- `_net_packet_s` (line 52)
- `_net_module_s` (line 60)
- `_net_addr_s` (line 95)
- `net_connect_data_t` (line 147)
- `net_gamesettings_t` (line 163)
- `net_ticdiff_t` (line 202)
- `net_full_ticcmd_t` (line 210)
- `net_querydata_t` (line 220)
- `net_waitdata_t` (line 233)

**Type_Aliases:**
- `net_module_t` (line 46) `typedef struct _net_module_s net_module_t;` - *define BACKUPTICS 128*
- `net_packet_t` (line 48) `typedef struct _net_packet_s net_packet_t;`
- `net_addr_t` (line 49) `typedef struct _net_addr_s net_addr_t;`
- `net_context_t` (line 50) `typedef struct _net_context_s net_context_t;`

#### `net_gui.h`
**Path:** `progs/doomgeneric/net_gui.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Graphical stuff related to the networking code:  * The client waiting screen when we are waiting for the server to start the game.*

**Functions:**
- `NET_WaitForLaunch` (line 26) `extern void NET_WaitForLaunch(void);`

**Macros:**
- `NET_GUI_H` (line 22) `#define NET_GUI_H`

#### `net_io.h`
**Path:** `progs/doomgeneric/net_io.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Network packet manipulation (net_packet_t)*

**Functions:**
- `NET_NewContext` (line 25) `net_context_t *NET_NewContext(void);`
- `NET_AddModule` (line 26) `void NET_AddModule(net_context_t *context, net_module_t *module);`
- `NET_SendPacket` (line 27) `void NET_SendPacket(net_addr_t *addr, net_packet_t *packet);`
- `NET_SendBroadcast` (line 28) `void NET_SendBroadcast(net_context_t *context, net_packet_t *packet);`
- `NET_AddrToString` (line 31) `char *NET_AddrToString(net_addr_t *addr);`
- `NET_FreeAddress` (line 32) `void NET_FreeAddress(net_addr_t *addr);`
- `NET_ResolveAddress` (line 33) `net_addr_t *NET_ResolveAddress(net_context_t *context, char *address);`

**Macros:**
- `NET_IO_H` (line 19) `#define NET_IO_H`

**Variables:**
- `net_broadcast_addr` (line 23) `extern net_addr_t net_broadcast_addr;`

#### `net_loop.h`
**Path:** `progs/doomgeneric/net_loop.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Loopback network module for server compiled into the client*

**Macros:**
- `NET_LOOP_H` (line 19) `#define NET_LOOP_H`

**Variables:**
- `net_loop_client_module` (line 23) `extern net_module_t net_loop_client_module;`
- `net_loop_server_module` (line 24) `extern net_module_t net_loop_server_module;`

#### `net_packet.h`
**Path:** `progs/doomgeneric/net_packet.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Definitions for use in networking code.*

**Functions:**
- `NET_NewPacket` (line 23) `net_packet_t *NET_NewPacket(int initial_size);`
- `NET_PacketDup` (line 24) `net_packet_t *NET_PacketDup(net_packet_t *packet);`
- `NET_FreePacket` (line 25) `void NET_FreePacket(net_packet_t *packet);`
- `NET_ReadString` (line 35) `char *NET_ReadString(net_packet_t *packet);`
- `NET_WriteInt8` (line 37) `void NET_WriteInt8(net_packet_t *packet, unsigned int i);`
- `NET_WriteInt16` (line 38) `void NET_WriteInt16(net_packet_t *packet, unsigned int i);`
- `NET_WriteInt32` (line 39) `void NET_WriteInt32(net_packet_t *packet, unsigned int i);`
- `NET_WriteString` (line 41) `void NET_WriteString(net_packet_t *packet, char *string);`

**Macros:**
- `NET_PACKET_H` (line 19) `#define NET_PACKET_H`

#### `net_query.h`
**Path:** `progs/doomgeneric/net_query.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Querying servers to find their current status.*

**Functions:**
- `NET_StartLANQuery` (line 28) `extern int NET_StartLANQuery(void);`
- `NET_StartMasterQuery` (line 29) `extern int NET_StartMasterQuery(void);`
- `NET_LANQuery` (line 31) `extern void NET_LANQuery(void);`
- `NET_MasterQuery` (line 32) `extern void NET_MasterQuery(void);`
- `NET_QueryAddress` (line 33) `extern void NET_QueryAddress(char *addr);`
- `NET_FindLANServer` (line 34) `extern net_addr_t *NET_FindLANServer(void);`
- `NET_Query_Poll` (line 36) `extern int NET_Query_Poll(net_query_callback_t callback, void *user_data);`
- `NET_Query_ResolveMaster` (line 38) `extern net_addr_t *NET_Query_ResolveMaster(net_context_t *context);`
- `NET_Query_AddToMaster` (line 39) `extern void NET_Query_AddToMaster(net_addr_t *master_addr);`
- `NET_Query_CheckAddedToMaster` (line 40) `extern boolean NET_Query_CheckAddedToMaster(boolean *result);`
- `NET_Query_MasterResponse` (line 41) `extern void NET_Query_MasterResponse(net_packet_t *packet);`

**Macros:**
- `NET_QUERY_H` (line 19) `#define NET_QUERY_H`

#### `net_sdl.h`
**Path:** `progs/doomgeneric/net_sdl.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Networking module which uses SDL_net*

**Macros:**
- `NET_SDL_H` (line 19) `#define NET_SDL_H`

**Variables:**
- `net_sdl_module` (line 23) `extern net_module_t net_sdl_module;`

#### `net_server.h`
**Path:** `progs/doomgeneric/net_server.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  Network server code    initialize server and wait for connections*

**Functions:**
- `NET_SV_Init` (line 22) `void NET_SV_Init(void);`
- `NET_SV_Run` (line 26) `void NET_SV_Run(void);`
- `NET_SV_Shutdown` (line 31) `void NET_SV_Shutdown(void);`
- `NET_SV_AddModule` (line 35) `void NET_SV_AddModule(net_module_t *module);`
- `NET_SV_RegisterWithMaster` (line 39) `void NET_SV_RegisterWithMaster(void);`

**Macros:**
- `NET_SERVER_H` (line 18) `#define NET_SERVER_H`

#### `p_inter.h`
**Path:** `progs/doomgeneric/p_inter.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:*

**Macros:**
- `__P_INTER__` (line 21) `#define __P_INTER__`

#### `p_local.h`
**Path:** `progs/doomgeneric/p_local.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Play functions, animation, global header.*

**Functions:**
- `P_InitThinkers` (line 70) `void P_InitThinkers (void);`
- `P_AddThinker` (line 71) `void P_AddThinker (thinker_t* thinker);`
- `P_RemoveThinker` (line 72) `void P_RemoveThinker (thinker_t* thinker);`
- `P_SetupPsprites` (line 78) `void P_SetupPsprites (player_t* curplayer);` - *P_PSPR*
- `P_MovePsprites` (line 79) `void P_MovePsprites (player_t* curplayer);`
- `P_DropWeapon` (line 80) `void P_DropWeapon (player_t* player);`
- `P_PlayerThink` (line 86) `void P_PlayerThink (player_t* player);` - *P_USER*
- `P_RespawnSpecials` (line 104) `void P_RespawnSpecials (void);`
- `P_SpawnMobj` (line 107) `mobj_t* P_SpawnMobj ( fixed_t x, fixed_t y, fixed_t z, mobjtype_t type );`
- `P_RemoveMobj` (line 113) `void P_RemoveMobj (mobj_t* th);`
- `P_SubstNullMobj` (line 114) `mobj_t* P_SubstNullMobj (mobj_t* th);`
- `P_MobjThinker` (line 116) `void P_MobjThinker (mobj_t* mobj);`
- `P_SpawnPuff` (line 118) `void P_SpawnPuff (fixed_t x, fixed_t y, fixed_t z);`
- `P_SpawnBlood` (line 119) `void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, int damage);`
- `P_SpawnMissile` (line 120) `mobj_t* P_SpawnMissile (mobj_t* source, mobj_t* dest, mobjtype_t type);`
- `P_SpawnPlayerMissile` (line 121) `void P_SpawnPlayerMissile (mobj_t* source, mobjtype_t type);`
- `P_NoiseAlert` (line 127) `void P_NoiseAlert (mobj_t* target, mobj_t* emmiter);` - *P_ENEMY*
- `P_AproxDistance` (line 162) `fixed_t P_AproxDistance (fixed_t dx, fixed_t dy);`
- `P_PointOnLineSide` (line 163) `int P_PointOnLineSide (fixed_t x, fixed_t y, line_t* line);`
- `P_PointOnDivlineSide` (line 164) `int P_PointOnDivlineSide (fixed_t x, fixed_t y, divline_t* line);`
- `P_MakeDivline` (line 165) `void P_MakeDivline (line_t* li, divline_t* dl);`
- `P_InterceptVector` (line 166) `fixed_t P_InterceptVector (divline_t* v2, divline_t* v1);`
- `P_BoxOnLineSide` (line 167) `int P_BoxOnLineSide (fixed_t* tmbox, line_t* ld);`
- `P_LineOpening` (line 174) `void P_LineOpening (line_t* linedef);`
- `P_UnsetThingPosition` (line 194) `void P_UnsetThingPosition (mobj_t* thing);`
- `P_SetThingPosition` (line 195) `void P_SetThingPosition (mobj_t* thing);`
- `P_SlideMove` (line 228) `void P_SlideMove (mobj_t* mo);`
- `P_UseLines` (line 230) `void P_UseLines (player_t* player);`
- `P_AimLineAttack` (line 237) `fixed_t P_AimLineAttack ( mobj_t* t1, angle_t angle, fixed_t distance );`
- `P_LineAttack` (line 243) `void P_LineAttack ( mobj_t* t1, angle_t angle, fixed_t distance, fixed_t slope, int damage );`
- `P_RadiusAttack` (line 251) `void P_RadiusAttack ( mobj_t* spot, mobj_t* source, int damage );`
- `P_TouchSpecialThing` (line 279) `void P_TouchSpecialThing ( mobj_t* special, mobj_t* toucher );`
- `P_DamageMobj` (line 284) `void P_DamageMobj ( mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage );`

**Macros:**
- `__P_LOCAL__` (line 21) `#define __P_LOCAL__`
- `FLOATSPEED` (line 27) `#define FLOATSPEED`
- `MAXHEALTH` (line 30) `#define MAXHEALTH`
- `VIEWHEIGHT` (line 31) `#define VIEWHEIGHT`
- `MAPBLOCKUNITS` (line 35) `#define MAPBLOCKUNITS`
- `MAPBLOCKSIZE` (line 36) `#define MAPBLOCKSIZE`
- `MAPBLOCKSHIFT` (line 37) `#define MAPBLOCKSHIFT`
- `MAPBMASK` (line 38) `#define MAPBMASK`
- `MAPBTOFRAC` (line 39) `#define MAPBTOFRAC`
- `PLAYERRADIUS` (line 43) `#define PLAYERRADIUS`
- `MAXRADIUS` (line 48) `#define MAXRADIUS`
- `GRAVITY` (line 50) `#define GRAVITY`
- `MAXMOVE` (line 51) `#define MAXMOVE`
- `USERANGE` (line 53) `#define USERANGE`
- `MELEERANGE` (line 54) `#define MELEERANGE`
- `MISSILERANGE` (line 55) `#define MISSILERANGE`
- `BASETHRESHOLD` (line 58) `#define	BASETHRESHOLD`
- `ONFLOORZ` (line 92) `#define ONFLOORZ`
- `ONCEILINGZ` (line 93) `#define ONCEILINGZ`
- `ITEMQUESIZE` (line 96) `#define ITEMQUESIZE`
- `MAXINTERCEPTS_ORIGINAL` (line 154) `#define MAXINTERCEPTS_ORIGINAL`
- `MAXINTERCEPTS` (line 155) `#define MAXINTERCEPTS`
- `PT_ADDLINES` (line 179) `#define PT_ADDLINES`
- `PT_ADDTHINGS` (line 180) `#define PT_ADDTHINGS`
- `PT_EARLYOUT` (line 181) `#define PT_EARLYOUT`
- `MAXSPECIALCROSS` (line 219) `#define MAXSPECIALCROSS`
- `MAXSPECIALCROSS_ORIGINAL` (line 220) `#define MAXSPECIALCROSS_ORIGINAL`

**Structs:**
- `divline_t` (line 133) - *P_MAPUTL*
- `d` (line 142)

**Variables:**
- `thinkercap` (line 67) `extern thinker_t thinkercap;` - *both the head and tail of the thinker list*
- `itemrespawnque` (line 98) `extern mapthing_t itemrespawnque[ITEMQUESIZE];`
- `itemrespawntime` (line 99) `extern int itemrespawntime[ITEMQUESIZE];`
- `iquehead` (line 100) `extern int iquehead;`
- `iquetail` (line 101) `extern int iquetail;`
- `intercepts` (line 157) `extern intercept_t intercepts[MAXINTERCEPTS];`
- `intercept_p` (line 158) `extern intercept_t* intercept_p;`
- `opentop` (line 169) `extern fixed_t opentop;`
- `openbottom` (line 170) `extern fixed_t openbottom;`
- `openrange` (line 171) `extern fixed_t openrange;`
- `lowfloor` (line 172) `extern fixed_t lowfloor;`
- `trace` (line 183) `extern divline_t trace;`
- `floatok` (line 204) `extern boolean floatok;` - *If "floatok" true, move would be ok if within "tmfloorz - tmceilingz".*
- `tmfloorz` (line 205) `extern fixed_t tmfloorz;`
- `tmceilingz` (line 206) `extern fixed_t tmceilingz;`
- `ceilingline` (line 209) `extern line_t* ceilingline;`
- `spechit` (line 222) `extern line_t* spechit[MAXSPECIALCROSS];`
- `numspechit` (line 223) `extern int numspechit;`
- `linetarget` (line 234) `extern mobj_t* linetarget;`
- `rejectmatrix` (line 261) `extern byte* rejectmatrix;` - *P_SETUP*
- `blockmaplump` (line 262) `extern short* blockmaplump;`
- `blockmap` (line 263) `extern short* blockmap;`
- `bmapwidth` (line 264) `extern int bmapwidth;`
- `bmapheight` (line 265) `extern int bmapheight;`
- `bmaporgx` (line 266) `extern fixed_t bmaporgx;`
- `bmaporgy` (line 267) `extern fixed_t bmaporgy;`
- `blocklinks` (line 268) `extern mobj_t** blocklinks;`
- `maxammo` (line 275) `extern int maxammo[NUMAMMO];` - *P_INTER*
- `clipammo` (line 276) `extern int clipammo[NUMAMMO];`

#### `p_mobj.h`
**Path:** `progs/doomgeneric/p_mobj.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Map Objects, MObj, definition and handling.     Basics.  We need the thinker_t stuff.  We need the WAD data structure for Map things,*

**Macros:**
- `__P_MOBJ__` (line 21) `#define __P_MOBJ__`

**Structs:**
- `mobj_s` (line 201) - *Map Object definition.*

**Type_Aliases:**
- `thinker` (line 201) `typedef struct mobj_s { // List: thinker links. thinker_t thinker;` - *Map Object definition.*

#### `p_pspr.h`
**Path:** `progs/doomgeneric/p_pspr.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Sprite animation.     Basic data types. Needs fixed point, and BAM angles.    Needs to include the precompiled*

**Macros:**
- `__P_PSPR__` (line 21) `#define __P_PSPR__`
- `FF_FULLBRIGHT` (line 44) `#define FF_FULLBRIGHT`
- `FF_FRAMEMASK` (line 45) `#define FF_FRAMEMASK`

**Structs:**
- `pspdef_t` (line 62)

#### `p_saveg.h`
**Path:** `progs/doomgeneric/p_saveg.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Savegame I/O, archiving, persistence.      maximum size of a savegame description   temporary filename to use while saving.*

**Functions:**
- `P_TempSaveGameFile` (line 31) `char *P_TempSaveGameFile(void);`
- `P_SaveGameFile` (line 35) `char *P_SaveGameFile(int slot);`
- `P_WriteSaveGameHeader` (line 40) `void P_WriteSaveGameHeader(char *description);`
- `P_WriteSaveGameEOF` (line 45) `void P_WriteSaveGameEOF(void);`
- `P_ArchivePlayers` (line 49) `void P_ArchivePlayers (void);` - *Persistent storage/archiving. These are the load / save game routines.*
- `P_UnArchivePlayers` (line 50) `void P_UnArchivePlayers (void);`
- `P_ArchiveWorld` (line 51) `void P_ArchiveWorld (void);`
- `P_UnArchiveWorld` (line 52) `void P_UnArchiveWorld (void);`
- `P_ArchiveThinkers` (line 53) `void P_ArchiveThinkers (void);`
- `P_UnArchiveThinkers` (line 54) `void P_UnArchiveThinkers (void);`
- `P_ArchiveSpecials` (line 55) `void P_ArchiveSpecials (void);`
- `P_UnArchiveSpecials` (line 56) `void P_UnArchiveSpecials (void);`

**Macros:**
- `__P_SAVEG__` (line 21) `#define __P_SAVEG__`
- `SAVESTRINGSIZE` (line 27) `#define SAVESTRINGSIZE`

**Variables:**
- `save_stream` (line 58) `extern FILE *save_stream;`
- `savegame_error` (line 59) `extern boolean savegame_error;`

#### `p_setup.h`
**Path:** `progs/doomgeneric/p_setup.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Setup a game, startup stuff.        NOT called by W_Ticker. Fixme.*

**Functions:**
- `P_SetupLevel` (line 28) `void P_SetupLevel ( int episode, int map, int playermask, skill_t skill);`
- `P_Init` (line 35) `void P_Init (void);` - *Called by startup code.*

**Macros:**
- `__P_SETUP__` (line 21) `#define __P_SETUP__`

#### `p_spec.h`
**Path:** `progs/doomgeneric/p_spec.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION:  none Implements special effects: Texture animation, height or lighting changes according to adjacent sectors, respective utility functions, etc.       End-level timer (-TIMER option)*

**Functions:**
- `P_InitPicAnims` (line 39) `void P_InitPicAnims (void);` - *at game start*
- `P_SpawnSpecials` (line 42) `void P_SpawnSpecials (void);` - *at map load*
- `P_UpdateSpecials` (line 45) `void P_UpdateSpecials (void);` - *every tic*
- `P_ShootSpecialLine` (line 55) `void P_ShootSpecialLine ( mobj_t* thing, line_t* line );`
- `P_CrossSpecialLine` (line 60) `void P_CrossSpecialLine ( int linenum, int side, mobj_t* thing );`
- `P_PlayerInSpecialSector` (line 65) `void P_PlayerInSpecialSector (player_t* player);`
- `twoSided` (line 68) `int twoSided ( int sector, int line );`
- `getSector` (line 73) `sector_t* getSector ( int currentSector, int line, int side );`
- `getSide` (line 79) `side_t* getSide ( int currentSector, int line, int side );`
- `P_FindLowestFloorSurrounding` (line 84) `fixed_t P_FindLowestFloorSurrounding(sector_t* sec);`
- `P_FindHighestFloorSurrounding` (line 85) `fixed_t P_FindHighestFloorSurrounding(sector_t* sec);`
- `P_FindNextHighestFloor` (line 88) `fixed_t P_FindNextHighestFloor ( sector_t* sec, int currentheight );`
- `P_FindLowestCeilingSurrounding` (line 92) `fixed_t P_FindLowestCeilingSurrounding(sector_t* sec);`
- `P_FindHighestCeilingSurrounding` (line 93) `fixed_t P_FindHighestCeilingSurrounding(sector_t* sec);`
- `P_FindSectorFromLineTag` (line 96) `int P_FindSectorFromLineTag ( line_t* line, int start );`
- `P_FindMinSurroundingLight` (line 101) `int P_FindMinSurroundingLight ( sector_t* sector, int max );`
- `getNextSector` (line 106) `sector_t* getNextSector ( line_t* line, sector_t* sec );`
- `EV_DoDonut` (line 114) `int EV_DoDonut(line_t* line);` - *SPECIAL*
- `P_SpawnFireFlicker` (line 178) `void P_SpawnFireFlicker (sector_t* sector);`
- `T_LightFlash` (line 179) `void T_LightFlash (lightflash_t* flash);`
- `P_SpawnLightFlash` (line 180) `void P_SpawnLightFlash (sector_t* sector);`
- `T_StrobeFlash` (line 181) `void T_StrobeFlash (strobe_t* flash);`
- `P_SpawnStrobeFlash` (line 184) `void P_SpawnStrobeFlash ( sector_t* sector, int fastOrSlow, int inSync );`
- `EV_StartLightStrobing` (line 189) `void EV_StartLightStrobing(line_t* line);`
- `EV_TurnTagLightsOff` (line 190) `void EV_TurnTagLightsOff(line_t* line);`
- `EV_LightTurnOn` (line 193) `void EV_LightTurnOn ( line_t* line, int bright );`
- `T_Glow` (line 197) `void T_Glow(glow_t* g);`
- `P_SpawnGlowingLight` (line 198) `void P_SpawnGlowingLight(sector_t* sector);`
- `P_ChangeSwitchTexture` (line 249) `void P_ChangeSwitchTexture ( line_t* line, int useAgain );`
- `P_InitSwitchList` (line 253) `void P_InitSwitchList(void);`
- `T_PlatRaise` (line 308) `void T_PlatRaise(plat_t* plat);`
- `EV_DoPlat` (line 311) `int EV_DoPlat ( line_t* line, plattype_e type, int amount );`
- `P_AddActivePlat` (line 316) `void P_AddActivePlat(plat_t* plat);`
- `P_RemoveActivePlat` (line 317) `void P_RemoveActivePlat(plat_t* plat);`
- `EV_StopPlat` (line 318) `void EV_StopPlat(line_t* line);`
- `P_ActivateInStasis` (line 319) `void P_ActivateInStasis(int tag);`
- `EV_VerticalDoor` (line 365) `void EV_VerticalDoor ( line_t* line, mobj_t* thing );`
- `EV_DoDoor` (line 370) `int EV_DoDoor ( line_t* line, vldoor_e type );`
- `EV_DoLockedDoor` (line 375) `int EV_DoLockedDoor ( line_t* line, vldoor_e type, mobj_t* thing );`
- `T_VerticalDoor` (line 380) `void T_VerticalDoor (vldoor_t* door);`
- `P_SpawnDoorCloseIn30` (line 381) `void P_SpawnDoorCloseIn30 (sector_t* sec);`
- `P_SpawnDoorRaiseIn5Mins` (line 384) `void P_SpawnDoorRaiseIn5Mins ( sector_t* sec, int secnum );`
- `P_InitSlidingDoorFrames` (line 464) `void P_InitSlidingDoorFrames(void);`
- `EV_SlidingDoor` (line 467) `void EV_SlidingDoor ( line_t* line, mobj_t* thing );`
- `EV_DoCeiling` (line 520) `int EV_DoCeiling ( line_t* line, ceiling_e type );`
- `T_MoveCeiling` (line 524) `void T_MoveCeiling (ceiling_t* ceiling);`
- `P_AddActiveCeiling` (line 525) `void P_AddActiveCeiling(ceiling_t* c);`
- `P_RemoveActiveCeiling` (line 526) `void P_RemoveActiveCeiling(ceiling_t* c);`
- `EV_CeilingCrushStop` (line 527) `int EV_CeilingCrushStop(line_t* line);`
- `P_ActivateInStasisCeiling` (line 528) `void P_ActivateInStasisCeiling(line_t* line);`
- `EV_BuildStairs` (line 617) `int EV_BuildStairs ( line_t* line, stair_e type );`
- `EV_DoFloor` (line 622) `int EV_DoFloor ( line_t* line, floor_e floortype );`
- `T_MoveFloor` (line 626) `void T_MoveFloor( floormove_t* floor);`
- `EV_Teleport` (line 632) `int EV_Teleport ( line_t* line, int side, mobj_t* thing );`

**Macros:**
- `__P_SPEC__` (line 24) `#define __P_SPEC__`
- `MO_TELEPORTMAN` (line 35) `#define MO_TELEPORTMAN`
- `GLOWSPEED` (line 173) `#define GLOWSPEED`
- `STROBEBRIGHT` (line 174) `#define STROBEBRIGHT`
- `FASTDARK` (line 175) `#define FASTDARK`
- `SLOWDARK` (line 176) `#define SLOWDARK`
- `MAXSWITCHES` (line 238) `#define MAXSWITCHES`
- `MAXBUTTONS` (line 241) `#define MAXBUTTONS`
- `BUTTONTIME` (line 244) `#define BUTTONTIME`
- `PLATWAIT` (line 301) `#define PLATWAIT`
- `PLATSPEED` (line 302) `#define PLATSPEED`
- `MAXPLATS` (line 303) `#define MAXPLATS`
- `VDOORSPEED` (line 361) `#define VDOORSPEED`
- `VDOORWAIT` (line 362) `#define VDOORWAIT`
- `SNUMFRAMES` (line 456) `#define SNUMFRAMES`
- `SDOORWAIT` (line 458) `#define SDOORWAIT`
- `SWAITTICS` (line 459) `#define SWAITTICS`
- `MAXSLIDEDOORS` (line 462) `#define MAXSLIDEDOORS`
- `CEILSPEED` (line 513) `#define CEILSPEED`
- `CEILWAIT` (line 514) `#define CEILWAIT`
- `MAXCEILINGS` (line 515) `#define MAXCEILINGS`
- `FLOORSPEED` (line 597) `#define FLOORSPEED`

**Structs:**
- `fireflicker_t` (line 121) - *P_LIGHTS*
- `lightflash_t` (line 133)
- `strobe_t` (line 147)
- `glow_t` (line 162)
- `switchlist_t` (line 206) - *P_SWITCH*
- `button_t` (line 224)
- `plat_t` (line 282)
- `vldoor_t` (line 340)
- `slidedoor_t` (line 415)
- `slidename_t` (line 431)
- `slideframe_t` (line 446)
- `ceiling_t` (line 490)
- `floormove_t` (line 581)

**Variables:**
- `levelTimer` (line 30) `extern boolean levelTimer;` - *End-level timer (-TIMER option)*
- `levelTimeCount` (line 31) `extern int levelTimeCount;`
- `buttonlist` (line 246) `extern button_t buttonlist[MAXBUTTONS];`
- `activeplats` (line 306) `extern plat_t* activeplats[MAXPLATS];`
- `activeceilings` (line 517) `extern ceiling_t* activeceilings[MAXCEILINGS];`

#### `p_tick.h`
**Path:** `progs/doomgeneric/p_tick.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: ?        Called by C_Ticker, can call G_PlayerExited. Carries out all thinking of monsters and players.*

**Functions:**
- `P_Ticker` (line 29) `void P_Ticker (void);` - *Called by C_Ticker, can call G_PlayerExited. Carries out all thinking of monsters and players.*

**Macros:**
- `__P_TICK__` (line 21) `#define __P_TICK__`

#### `r_bsp.h`
**Path:** `progs/doomgeneric/r_bsp.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh module, BSP traversal and handling.*

**Functions:**
- `R_ClearClipSegs` (line 54) `void R_ClearClipSegs (void);` - *BSP?*
- `R_ClearDrawSegs` (line 55) `void R_ClearDrawSegs (void);`
- `R_RenderBSPNode` (line 58) `void R_RenderBSPNode (int bspnum);`

**Macros:**
- `__R_BSP__` (line 21) `#define __R_BSP__`

**Variables:**
- `curline` (line 25) `extern seg_t* curline;`
- `sidedef` (line 26) `extern side_t* sidedef;`
- `linedef` (line 27) `extern line_t* linedef;`
- `frontsector` (line 28) `extern sector_t* frontsector;`
- `backsector` (line 29) `extern sector_t* backsector;`
- `rw_x` (line 31) `extern int rw_x;`
- `rw_stopx` (line 32) `extern int rw_stopx;`
- `segtextured` (line 34) `extern boolean segtextured;`
- `markfloor` (line 37) `extern boolean markfloor;` - *false if the back side is the same plane*
- `markceiling` (line 38) `extern boolean markceiling;`
- `skymap` (line 40) `extern boolean skymap;`
- `drawsegs` (line 42) `extern drawseg_t drawsegs[MAXDRAWSEGS];`
- `ds_p` (line 43) `extern drawseg_t* ds_p;`
- `hscalelight` (line 45) `extern lighttable_t** hscalelight;`
- `vscalelight` (line 46) `extern lighttable_t** vscalelight;`
- `dscalelight` (line 47) `extern lighttable_t** dscalelight;`

#### `r_data.h`
**Path:** `progs/doomgeneric/r_data.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh module, data I/O, caching, retrieval of graphics by name.       Retrieve column data for span blitting.*

**Functions:**
- `R_GetColumn` (line 30) `byte* R_GetColumn ( int tex, int col );`
- `R_InitData` (line 36) `void R_InitData (void);` - *I/O, setting up the stuff.*
- `R_PrecacheLevel` (line 37) `void R_PrecacheLevel (void);`
- `R_FlatNumForName` (line 43) `int R_FlatNumForName (char* name);` - *Retrieval. Floor/ceiling opaque texture tiles, lookup by name. For animation?*
- `R_TextureNumForName` (line 48) `int R_TextureNumForName (char *name);` - *Called by P_Ticker for switches and animations, returns the texture number for the texture name.*
- `R_CheckTextureNumForName` (line 49) `int R_CheckTextureNumForName (char *name);`

**Macros:**
- `__R_DATA__` (line 22) `#define __R_DATA__`

#### `r_defs.h`
**Path:** `progs/doomgeneric/r_defs.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh/rendering module, shared data struct definitions.      Screenwidth.  Some more or less basic data types we depend on.*

**Macros:**
- `__R_DEFS__` (line 21) `#define __R_DEFS__`
- `SIL_NONE` (line 46) `#define SIL_NONE`
- `SIL_BOTTOM` (line 47) `#define SIL_BOTTOM`
- `SIL_TOP` (line 48) `#define SIL_TOP`
- `SIL_BOTH` (line 49) `#define SIL_BOTH`
- `MAXDRAWSEGS` (line 51) `#define MAXDRAWSEGS`

**Structs:**
- `line_s` (line 76) - *Forward of LineDefs, for Sectors.*
- `line_s` (line 175)
- `subsector_s` (line 223) - *A SubSector. References a Sector. Basically, this is a list of LineSegs, indicating the visible walls that define (all or some) sides of a convex BSP leaf.*
- `drawseg_s` (line 306) - *?*
- `vissprite_s` (line 338) - *A vissprite_t is a thing that will be drawn during a refresh. I.e. a sprite object that is partly visible.*
- `vertex_t` (line 67) - *Your plain vanilla vertex. Note: transformed values not buffered locally, like some DOOM-alikes ("wt", "WebView") did.*
- `degenmobj_t` (line 84) - *Each sector has a degenmobj_t in its center for sound origin purposes. I suppose this does not handle sound from moving objects (doppler), because position is prolly just buffered, not updated.*
- `sector_t` (line 97) - *The SECTORS record, at runtime. Stores things/mobjs.*
- `side_t` (line 140)
- `seg_t` (line 236) - *The LineSeg.*
- `node_t` (line 261) - *BSP node.*
- `spriteframe_t` (line 390) - *Sprites are patches with a special naming convention so they can be recognized by R_InitSprites. The base name is NNNNFx or NNNNFxFx, with x indicating the rotation, x = 0, 1-7. The sprite and frame specified by a thing_t is range checked at run time. A sprite is a patch_t that is assumed to represent a three dimensional object and may have multiple rotations pre drawn. Horizontal flipping is used to save space, thus NNNNF2F5 defines a mirrored patch. Some sprites will only have one picture used for all views: NNNNF0*
- `spritedef_t` (line 411) - *A sprite definition: a number of animation frames.*
- `visplane_t` (line 423) - *Now what is a visplane, anyway?*

**Type_Aliases:**
- `v1` (line 172) `typedef struct line_s { // Vertices, from v1 to v2. vertex_t* v1;`
- `sector` (line 223) `typedef struct subsector_s { sector_t* sector;` - *A SubSector. References a Sector. Basically, this is a list of LineSegs, indicating the visible walls that define (all or some) sides of a convex BSP leaf.*
- `lighttable_t` (line 298) `typedef byte lighttable_t;` - *This could be wider for >8 bit display. Indeed, true color support is posibble precalculating 24bpp lightmap/colormap LUT. from darkening PLAYPAL to all black. Could even us emore than 32 levels.*
- `curline` (line 306) `typedef struct drawseg_s { seg_t* curline;` - *?*
- `prev` (line 338) `typedef struct vissprite_s { // Doubly linked list. struct vissprite_s* prev;` - *A vissprite_t is a thing that will be drawn during a refresh. I.e. a sprite object that is partly visible.*

#### `r_draw.h`
**Path:** `progs/doomgeneric/r_draw.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.*

**Functions:**
- `R_DrawColumn` (line 40) `void R_DrawColumn (void);` - *The span blitting interface. Hook in assembler or system specific BLT here.*
- `R_DrawColumnLow` (line 41) `void R_DrawColumnLow (void);`
- `R_DrawFuzzColumn` (line 44) `void R_DrawFuzzColumn (void);` - *The Spectre/Invisibility effect.*
- `R_DrawFuzzColumnLow` (line 45) `void R_DrawFuzzColumnLow (void);`
- `R_DrawTranslatedColumn` (line 50) `void R_DrawTranslatedColumn (void);` - *Draw with color translation tables, for player sprite rendering, Green/Red/Blue/Indigo shirts.*
- `R_DrawTranslatedColumnLow` (line 51) `void R_DrawTranslatedColumnLow (void);`
- `R_VideoErase` (line 54) `void R_VideoErase ( unsigned ofs, int count );`
- `R_DrawSpan` (line 78) `void R_DrawSpan (void);` - *Span blitting for rows, floor/ceiling. No Sepctre effect needed.*
- `R_DrawSpanLow` (line 81) `void R_DrawSpanLow (void);` - *Low resolution mode, 160x200?*
- `R_InitBuffer` (line 85) `void R_InitBuffer ( int width, int height );`
- `R_InitTranslationTables` (line 92) `void R_InitTranslationTables (void);` - *Initialize color translation tables, for player rendering etc.*
- `R_FillBackScreen` (line 97) `void R_FillBackScreen (void);` - *Rendering function.*
- `R_DrawViewBorder` (line 100) `void R_DrawViewBorder (void);` - *If the view size is not full screen, draws a border around it.*

**Macros:**
- `__R_DRAW__` (line 21) `#define __R_DRAW__`

**Variables:**
- `dc_colormap` (line 26) `extern lighttable_t* dc_colormap;`
- `dc_x` (line 27) `extern int dc_x;`
- `dc_yl` (line 28) `extern int dc_yl;`
- `dc_yh` (line 29) `extern int dc_yh;`
- `dc_iscale` (line 30) `extern fixed_t dc_iscale;`
- `dc_texturemid` (line 31) `extern fixed_t dc_texturemid;`
- `dc_source` (line 34) `extern byte* dc_source;` - *first pixel in a column*
- `ds_y` (line 58) `extern int ds_y;`
- `ds_x1` (line 59) `extern int ds_x1;`
- `ds_x2` (line 60) `extern int ds_x2;`
- `ds_colormap` (line 62) `extern lighttable_t* ds_colormap;`
- `ds_xfrac` (line 64) `extern fixed_t ds_xfrac;`
- `ds_yfrac` (line 65) `extern fixed_t ds_yfrac;`
- `ds_xstep` (line 66) `extern fixed_t ds_xstep;`
- `ds_ystep` (line 67) `extern fixed_t ds_ystep;`
- `ds_source` (line 70) `extern byte* ds_source;` - *start of a 64*64 tile image*
- `translationtables` (line 72) `extern byte* translationtables;`
- `dc_translation` (line 73) `extern byte* dc_translation;`

#### `r_local.h`
**Path:** `progs/doomgeneric/r_local.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh (R_*) module, global header. All the rendering/drawing stuff is here.    Binary Angles, sine/cosine/atan lookups.  Screen size related parameters.  Include the refresh/render data structs.*

**Macros:**
- `__R_LOCAL__` (line 21) `#define __R_LOCAL__`

#### `r_main.h`
**Path:** `progs/doomgeneric/r_main.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: System specific interface stuff.          POV related.*

**Functions:**
- `void` (line 92) `extern void (*colfunc) (void);` - *Function pointers to switch refresh/drawing functions. Used to select shadow mode etc.*
- `R_PointOnSide` (line 103) `int R_PointOnSide ( fixed_t x, fixed_t y, node_t* node );`
- `R_PointOnSegSide` (line 109) `int R_PointOnSegSide ( fixed_t x, fixed_t y, seg_t* line );`
- `R_PointToAngle` (line 115) `angle_t R_PointToAngle ( fixed_t x, fixed_t y );`
- `R_PointToAngle2` (line 120) `angle_t R_PointToAngle2 ( fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2 );`
- `R_PointToDist` (line 127) `fixed_t R_PointToDist ( fixed_t x, fixed_t y );`
- `R_ScaleFromGlobalAngle` (line 132) `fixed_t R_ScaleFromGlobalAngle (angle_t visangle);`
- `R_PointInSubsector` (line 135) `subsector_t* R_PointInSubsector ( fixed_t x, fixed_t y );`
- `R_AddPointToBox` (line 140) `void R_AddPointToBox ( int x, int y, fixed_t* box );`
- `R_RenderPlayerView` (line 152) `void R_RenderPlayerView (player_t *player);` - *Called by G_Drawer.*
- `R_Init` (line 155) `void R_Init (void);` - *Called by startup code.*
- `R_SetViewSize` (line 158) `void R_SetViewSize (int blocks, int detail);` - *Called by M_Responder.*

**Macros:**
- `__R_MAIN__` (line 21) `#define __R_MAIN__`
- `LIGHTLEVELS` (line 61) `#define LIGHTLEVELS`
- `LIGHTSEGSHIFT` (line 62) `#define LIGHTSEGSHIFT`
- `MAXLIGHTSCALE` (line 64) `#define MAXLIGHTSCALE`
- `LIGHTSCALESHIFT` (line 65) `#define LIGHTSCALESHIFT`
- `MAXLIGHTZ` (line 66) `#define MAXLIGHTZ`
- `LIGHTZSHIFT` (line 67) `#define LIGHTZSHIFT`
- `NUMCOLORMAPS` (line 79) `#define NUMCOLORMAPS`

**Variables:**
- `viewcos` (line 32) `extern fixed_t viewcos;` - *POV related.*
- `viewsin` (line 33) `extern fixed_t viewsin;`
- `viewwindowx` (line 35) `extern int viewwindowx;`
- `viewwindowy` (line 36) `extern int viewwindowy;`
- `centerx` (line 40) `extern int centerx;`
- `centery` (line 41) `extern int centery;`
- `centerxfrac` (line 43) `extern fixed_t centerxfrac;`
- `centeryfrac` (line 44) `extern fixed_t centeryfrac;`
- `projection` (line 45) `extern fixed_t projection;`
- `validcount` (line 47) `extern int validcount;`
- `linecount` (line 49) `extern int linecount;`
- `loopcount` (line 50) `extern int loopcount;`
- `scalelightfixed` (line 70) `extern lighttable_t* scalelightfixed[MAXLIGHTSCALE];`
- `extralight` (line 73) `extern int extralight;`
- `fixedcolormap` (line 74) `extern lighttable_t* fixedcolormap;`
- `detailshift` (line 85) `extern int detailshift;` - *Blocky/low detail mode. B remove this? 0 = high, 1 = low*

#### `r_plane.h`
**Path:** `progs/doomgeneric/r_plane.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh, visplane stuff (floor, ceilings).         Visplane related.*

**Functions:**
- `R_InitPlanes` (line 43) `void R_InitPlanes (void);`
- `R_ClearPlanes` (line 44) `void R_ClearPlanes (void);`
- `R_MapPlane` (line 47) `void R_MapPlane ( int y, int x1, int x2 );`
- `R_MakeSpans` (line 53) `void R_MakeSpans ( int x, int t1, int b1, int t2, int b2 );`
- `R_DrawPlanes` (line 60) `void R_DrawPlanes (void);`
- `R_FindPlane` (line 63) `visplane_t* R_FindPlane ( fixed_t height, int picnum, int lightlevel );`
- `R_CheckPlane` (line 69) `visplane_t* R_CheckPlane ( visplane_t* pl, int start, int stop );`

**Macros:**
- `__R_PLANE__` (line 21) `#define __R_PLANE__`

**Variables:**
- `lastopening` (line 29) `extern short* lastopening;` - *Visplane related.*
- `floorfunc` (line 34) `extern planefunction_t floorfunc;`
- `ceilingfunc_t` (line 35) `extern planefunction_t ceilingfunc_t;`
- `floorclip` (line 37) `extern short floorclip[SCREENWIDTH];`
- `ceilingclip` (line 38) `extern short ceilingclip[SCREENWIDTH];`
- `yslope` (line 40) `extern fixed_t yslope[SCREENHEIGHT];`
- `distscale` (line 41) `extern fixed_t distscale[SCREENWIDTH];`

#### `r_segs.h`
**Path:** `progs/doomgeneric/r_segs.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh module, drawing LineSegs from BSP.*

**Functions:**
- `R_RenderMaskedSegRange` (line 27) `void R_RenderMaskedSegRange ( drawseg_t* ds, int x1, int x2 );`

**Macros:**
- `__R_SEGS__` (line 21) `#define __R_SEGS__`

#### `r_sky.h`
**Path:** `progs/doomgeneric/r_sky.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Sky rendering.       SKY, store the number for name.  The sky map is 256*128*4 maps.*

**Functions:**
- `R_InitSkyMap` (line 35) `void R_InitSkyMap (void);` - *Called whenever the view size changes.*

**Macros:**
- `__R_SKY__` (line 21) `#define __R_SKY__`
- `SKYFLATNAME` (line 26) `#define			SKYFLATNAME`
- `ANGLETOSKYSHIFT` (line 29) `#define ANGLETOSKYSHIFT`

**Variables:**
- `skytexture` (line 31) `extern int skytexture;`
- `skytexturemid` (line 32) `extern int skytexturemid;`

#### `r_state.h`
**Path:** `progs/doomgeneric/r_state.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh/render internal state variables (global).     Need data structure definitions.*

**Macros:**
- `__R_STATE__` (line 21) `#define __R_STATE__`

**Variables:**
- `textureheight` (line 38) `extern fixed_t* textureheight;` - *needed for texture pegging*
- `spritewidth` (line 41) `extern fixed_t* spritewidth;` - *needed for pre rendering (fracs)*
- `spriteoffset` (line 43) `extern fixed_t* spriteoffset;`
- `spritetopoffset` (line 44) `extern fixed_t* spritetopoffset;`
- `colormaps` (line 46) `extern lighttable_t* colormaps;`
- `viewwidth` (line 48) `extern int viewwidth;`
- `scaledviewwidth` (line 49) `extern int scaledviewwidth;`
- `viewheight` (line 50) `extern int viewheight;`
- `firstflat` (line 52) `extern int firstflat;`
- `flattranslation` (line 55) `extern int* flattranslation;` - *for global animation*
- `texturetranslation` (line 56) `extern int* texturetranslation;`
- `firstspritelump` (line 60) `extern int firstspritelump;` - *Sprite....*
- `lastspritelump` (line 61) `extern int lastspritelump;`
- `numspritelumps` (line 62) `extern int numspritelumps;`
- `numsprites` (line 69) `extern int numsprites;` - *Lookup tables for map data.*
- `sprites` (line 70) `extern spritedef_t* sprites;`
- `numvertexes` (line 72) `extern int numvertexes;`
- `vertexes` (line 73) `extern vertex_t* vertexes;`
- `numsegs` (line 75) `extern int numsegs;`
- `segs` (line 76) `extern seg_t* segs;`
- `numsectors` (line 78) `extern int numsectors;`
- `sectors` (line 79) `extern sector_t* sectors;`
- `numsubsectors` (line 81) `extern int numsubsectors;`
- `subsectors` (line 82) `extern subsector_t* subsectors;`
- `numnodes` (line 84) `extern int numnodes;`
- `nodes` (line 85) `extern node_t* nodes;`
- `numlines` (line 87) `extern int numlines;`
- `lines` (line 88) `extern line_t* lines;`
- `numsides` (line 90) `extern int numsides;`
- `sides` (line 91) `extern side_t* sides;`
- `viewx` (line 97) `extern fixed_t viewx;` - *POV data.*
- `viewy` (line 98) `extern fixed_t viewy;`
- `viewz` (line 99) `extern fixed_t viewz;`
- `viewangle` (line 101) `extern angle_t viewangle;`
- `viewplayer` (line 102) `extern player_t* viewplayer;`
- `clipangle` (line 106) `extern angle_t clipangle;` - *?*
- `viewangletox` (line 108) `extern int viewangletox[FINEANGLES/2];`
- `xtoviewangle` (line 109) `extern angle_t xtoviewangle[SCREENWIDTH+1];`
- `rw_distance` (line 112) `extern fixed_t rw_distance;`
- `rw_normalangle` (line 113) `extern angle_t rw_normalangle;`
- `rw_angle1` (line 118) `extern int rw_angle1;` - *angle to line origin*
- `sscount` (line 121) `extern int sscount;` - *Segs count?*
- `floorplane` (line 123) `extern visplane_t* floorplane;`
- `ceilingplane` (line 124) `extern visplane_t* ceilingplane;`

#### `r_things.h`
**Path:** `progs/doomgeneric/r_things.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Rendering of moving objects, sprites.*

**Functions:**
- `R_DrawMaskedColumn` (line 46) `void R_DrawMaskedColumn (column_t* column);`
- `R_SortVisSprites` (line 49) `void R_SortVisSprites (void);`
- `R_AddSprites` (line 51) `void R_AddSprites (sector_t* sec);`
- `R_AddPSprites` (line 52) `void R_AddPSprites (void);`
- `R_DrawSprites` (line 53) `void R_DrawSprites (void);`
- `R_InitSprites` (line 54) `void R_InitSprites (char** namelist);`
- `R_ClearSprites` (line 55) `void R_ClearSprites (void);`
- `R_DrawMasked` (line 56) `void R_DrawMasked (void);`
- `R_ClipVisSprite` (line 59) `void R_ClipVisSprite ( vissprite_t* vis, int xl, int xh );`

**Macros:**
- `__R_THINGS__` (line 21) `#define __R_THINGS__`
- `MAXVISSPRITES` (line 25) `#define MAXVISSPRITES`

**Variables:**
- `vissprites` (line 27) `extern vissprite_t vissprites[MAXVISSPRITES];`
- `vissprite_p` (line 28) `extern vissprite_t* vissprite_p;`
- `vsprsortedhead` (line 29) `extern vissprite_t vsprsortedhead;`
- `negonearray` (line 33) `extern short negonearray[SCREENWIDTH];` - *Constant arrays used for psprite clipping and initializing clipping.*
- `screenheightarray` (line 34) `extern short screenheightarray[SCREENWIDTH];`
- `mfloorclip` (line 37) `extern short* mfloorclip;` - *vars for R_DrawMaskedColumn*
- `mceilingclip` (line 38) `extern short* mceilingclip;`
- `spryscale` (line 39) `extern fixed_t spryscale;`
- `sprtopscreen` (line 40) `extern fixed_t sprtopscreen;`
- `pspritescale` (line 42) `extern fixed_t pspritescale;`
- `pspriteiscale` (line 43) `extern fixed_t pspriteiscale;`

#### `s_sound.h`
**Path:** `progs/doomgeneric/s_sound.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The not so system specific sound interface.       Initializes sound stuff, including volume Sets channels, SFX and music volume, allocates channel buffer, sets S_sfx lookup.*

**Functions:**
- `S_Init` (line 32) `void S_Init(int sfxVolume, int musicVolume);`
- `S_Shutdown` (line 37) `void S_Shutdown(void);`
- `S_Start` (line 47) `void S_Start(void);`
- `S_StartSound` (line 54) `void S_StartSound(void *origin, int sound_id);`
- `S_StopSound` (line 57) `void S_StopSound(mobj_t *origin);` - *Stop sound for thing at <origin>*
- `S_StartMusic` (line 61) `void S_StartMusic(int music_id);` - *Start music using <music_id> from sounds.h*
- `S_ChangeMusic` (line 65) `void S_ChangeMusic(int music_id, int looping);` - *Start music using <music_id> from sounds.h, and set whether looping*
- `S_StopMusic` (line 71) `void S_StopMusic(void);` - *Stops the music fer sure.*
- `S_PauseSound` (line 74) `void S_PauseSound(void);` - *Stop and resume music, during game PAUSE.*
- `S_ResumeSound` (line 75) `void S_ResumeSound(void);`
- `S_UpdateSounds` (line 81) `void S_UpdateSounds(mobj_t *listener);` - *Updates music & sounds*
- `S_SetMusicVolume` (line 83) `void S_SetMusicVolume(int volume);`
- `S_SetSfxVolume` (line 84) `void S_SetSfxVolume(int volume);`

**Macros:**
- `__S_SOUND__` (line 21) `#define __S_SOUND__`

**Variables:**
- `snd_channels` (line 86) `extern int snd_channels;`

#### `sha1.h`
**Path:** `progs/doomgeneric/sha1.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: SHA-1 digest.*

**Functions:**
- `SHA1_Init` (line 33) `void SHA1_Init(sha1_context_t *context);`
- `SHA1_Update` (line 34) `void SHA1_Update(sha1_context_t *context, byte *buf, size_t len);`
- `SHA1_Final` (line 35) `void SHA1_Final(sha1_digest_t digest, sha1_context_t *context);`
- `SHA1_UpdateInt32` (line 36) `void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val);`
- `SHA1_UpdateString` (line 37) `void SHA1_UpdateString(sha1_context_t *context, char *str);`

**Macros:**
- `__SHA1_H__` (line 19) `#define __SHA1_H__`

**Structs:**
- `sha1_context_s` (line 26)

**Type_Aliases:**
- `sha1_context_t` (line 22) `typedef struct sha1_context_s sha1_context_t;` - *include "doomtype.h"*
- `sha1_digest_t` (line 24) `typedef byte sha1_digest_t[20];`

#### `sounds.h`
**Path:** `progs/doomgeneric/sounds.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Created by the sound utility written by Dave Taylor. Kept as a sample, DOOM2  sounds. Frozen.     the complete set of sound effects*

**Macros:**
- `__SOUNDS__` (line 21) `#define __SOUNDS__`

**Variables:**
- `S_sfx` (line 26) `extern sfxinfo_t S_sfx[];` - *the complete set of sound effects*
- `S_music` (line 29) `extern musicinfo_t S_music[];` - *the complete set of music*

#### `st_lib.h`
**Path:** `progs/doomgeneric/st_lib.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: The status bar widget code.     We are referring to patches.   Typedefs of widgets   Number widget*

**Functions:**
- `STlib_init` (line 138) `void STlib_init(void);` - *Initializes widget library. More precisely, initialize STMINUS, everything else is done somewhere else.*
- `STlib_initNum` (line 144) `void STlib_initNum ( st_number_t* n, int x, int y, patch_t** pl, int* num, boolean* on, int width );`
- `STlib_updateNum` (line 154) `void STlib_updateNum ( st_number_t* n, boolean refresh );`
- `STlib_initPercent` (line 161) `void STlib_initPercent ( st_percent_t* p, int x, int y, patch_t** pl, int* num, boolean* on, patch_t* percent );`
- `STlib_updatePercent` (line 172) `void STlib_updatePercent ( st_percent_t* per, int refresh );`
- `STlib_initMultIcon` (line 179) `void STlib_initMultIcon ( st_multicon_t* mi, int x, int y, patch_t** il, int* inum, boolean* on );`
- `STlib_updateMultIcon` (line 189) `void STlib_updateMultIcon ( st_multicon_t* mi, boolean refresh );`
- `STlib_initBinIcon` (line 196) `void STlib_initBinIcon ( st_binicon_t* b, int x, int y, patch_t* i, boolean* val, boolean* on );`
- `STlib_updateBinIcon` (line 205) `void STlib_updateBinIcon ( st_binicon_t* bi, boolean refresh );`

**Macros:**
- `__STLIB__` (line 20) `#define __STLIB__`

**Structs:**
- `st_number_t` (line 32)
- `st_percent_t` (line 64) - *Percent widget ("child" of number widget, or, more precisely, contains a number widget.)*
- `st_multicon_t` (line 77) - *Multiple Icon widget*
- `st_binicon_t` (line 106)

#### `st_stuff.h`
**Path:** `progs/doomgeneric/st_stuff.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Status bar code. Does the face/direction indicator animatin. Does palette indicators as well (red pain/berserk, bright pickup)     Size of statusbar. Now sensitive for scaling.*

**Functions:**
- `ST_Ticker` (line 43) `void ST_Ticker (void);` - *Called by main loop.*
- `ST_Drawer` (line 46) `void ST_Drawer (boolean fullscreen, boolean refresh);` - *Called by main loop.*
- `ST_Start` (line 49) `void ST_Start (void);` - *Called when the console player is spawned on each level.*
- `ST_Init` (line 52) `void ST_Init (void);` - *Called by startup code.*

**Macros:**
- `__STSTUFF_H__` (line 22) `#define __STSTUFF_H__`
- `ST_HEIGHT` (line 30) `#define ST_HEIGHT`
- `ST_WIDTH` (line 31) `#define ST_WIDTH`
- `ST_Y` (line 32) `#define ST_Y`

**Variables:**
- `st_backing_screen` (line 76) `extern byte *st_backing_screen;`
- `cheat_mus` (line 77) `extern cheatseq_t cheat_mus;`
- `cheat_god` (line 78) `extern cheatseq_t cheat_god;`
- `cheat_ammo` (line 79) `extern cheatseq_t cheat_ammo;`
- `cheat_ammonokey` (line 80) `extern cheatseq_t cheat_ammonokey;`
- `cheat_noclip` (line 81) `extern cheatseq_t cheat_noclip;`
- `cheat_commercial_noclip` (line 82) `extern cheatseq_t cheat_commercial_noclip;`
- `cheat_powerup` (line 83) `extern cheatseq_t cheat_powerup[7];`
- `cheat_choppers` (line 84) `extern cheatseq_t cheat_choppers;`
- `cheat_clev` (line 85) `extern cheatseq_t cheat_clev;`
- `cheat_mypos` (line 86) `extern cheatseq_t cheat_mypos;`

#### `statdump.h`
**Path:** `progs/doomgeneric/statdump.h`

**Functions:**
- `StatCopy` (line 20) `void StatCopy(wbstartstruct_t *stats);`
- `StatDump` (line 21) `void StatDump(void);`

**Macros:**
- `DOOM_STATDUMP_H` (line 18) `#define DOOM_STATDUMP_H`

#### `tables.h`
**Path:** `progs/doomgeneric/tables.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 1993-2008 Raven Software Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Lookup tables. Do not try to look them up :-). In the order of appearance:  int finetangent[4096]	- Tangens LUT. Should work with BAM fairly well (12 of 16bit, effectively, by shifting).  int finesine[10240]		- Sine lookup. Guess what, serves as cosine, too. Remarkable thing is, how to use BAMs with this?  int tantoangle[2049]	- ArcTan LUT, maps tan(angle) to angle fast. Gotta search.*

**Functions:**
- `SlopeDiv` (line 92) `int SlopeDiv(unsigned int num, unsigned int den);` - *Utility function, called by R_PointToAngle.*

**Macros:**
- `__TABLES__` (line 35) `#define __TABLES__`
- `FINEANGLES` (line 41) `#define FINEANGLES`
- `FINEMASK` (line 42) `#define FINEMASK`
- `ANGLETOFINESHIFT` (line 46) `#define ANGLETOFINESHIFT`
- `ANG45` (line 63) `#define ANG45`
- `ANG90` (line 64) `#define ANG90`
- `ANG180` (line 65) `#define ANG180`
- `ANG270` (line 66) `#define ANG270`
- `ANG_MAX` (line 67) `#define ANG_MAX`
- `ANG1` (line 69) `#define ANG1`
- `ANG60` (line 70) `#define ANG60`
- `ANG1_X` (line 75) `#define ANG1_X`
- `SLOPERANGE` (line 77) `#define SLOPERANGE`
- `SLOPEBITS` (line 78) `#define SLOPEBITS`
- `DBITS` (line 79) `#define DBITS`

**Type_Aliases:**
- `angle_t` (line 80) `typedef unsigned angle_t;` - *define SLOPERANGE		2048 define SLOPEBITS		11 define DBITS			(FRACBITS-SLOPEBITS)*

**Variables:**
- `finesine` (line 49) `extern const fixed_t finesine[5*FINEANGLES/4];` - *Effective size is 10240.*
- `finecosine` (line 52) `extern const fixed_t *finecosine;` - *Re-use data, is just PI/2 pahse shift.*
- `finetangent` (line 56) `extern const fixed_t finetangent[FINEANGLES/2];` - *Effective size is 4096.*
- `tantoangle` (line 87) `extern const angle_t tantoangle[SLOPERANGE+1];` - *Effective size is 2049; The +1 size is to handle the case when x==y without additional checking.*

#### `v_patch.h`
**Path:** `progs/doomgeneric/v_patch.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Refresh/rendering module, shared data struct definitions.     Patches. A patch holds one or more columns. Patches are used for sprites and all masked pictures, and we compose textures from the TEXTURE1/2 lists of patches.*

**Macros:**
- `V_PATCH_H` (line 21) `#define V_PATCH_H`

**Type_Aliases:**
- `column_t` (line 47) `typedef post_t column_t;` - *column_t is a list of 0 or more post_t, (byte)-1 terminated*

#### `v_video.h`
**Path:** `progs/doomgeneric/v_video.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Gamma correction LUT. Functions to draw patches (by post) directly to screen. Functions to blit a block to the screen.      Needed because we are refering to patches.*

**Functions:**
- `V_SetPatchClipCallback` (line 45) `void V_SetPatchClipCallback(vpatchclipfunc_t func);`
- `V_Init` (line 49) `void V_Init (void);` - *Allocates buffer screens, call before R_Init.*
- `V_CopyRect` (line 53) `void V_CopyRect(int srcx, int srcy, byte *source, int width, int height, int destx, int desty);`
- `V_DrawPatch` (line 57) `void V_DrawPatch(int x, int y, patch_t *patch);`
- `V_DrawPatchFlipped` (line 58) `void V_DrawPatchFlipped(int x, int y, patch_t *patch);`
- `V_DrawTLPatch` (line 59) `void V_DrawTLPatch(int x, int y, patch_t *patch);`
- `V_DrawAltTLPatch` (line 60) `void V_DrawAltTLPatch(int x, int y, patch_t * patch);`
- `V_DrawShadowedPatch` (line 61) `void V_DrawShadowedPatch(int x, int y, patch_t *patch);`
- `V_DrawXlaPatch` (line 62) `void V_DrawXlaPatch(int x, int y, patch_t * patch);`
- `V_DrawPatchDirect` (line 63) `void V_DrawPatchDirect(int x, int y, patch_t *patch);`
- `V_DrawBlock` (line 67) `void V_DrawBlock(int x, int y, int width, int height, byte *src);`
- `V_MarkRect` (line 69) `void V_MarkRect(int x, int y, int width, int height);`
- `V_DrawFilledBox` (line 71) `void V_DrawFilledBox(int x, int y, int w, int h, int c);`
- `V_DrawHorizLine` (line 72) `void V_DrawHorizLine(int x, int y, int w, int c);`
- `V_DrawVertLine` (line 73) `void V_DrawVertLine(int x, int y, int h, int c);`
- `V_DrawBox` (line 74) `void V_DrawBox(int x, int y, int w, int h, int c);`
- `V_DrawRawScreen` (line 78) `void V_DrawRawScreen(byte *raw);`
- `V_UseBuffer` (line 82) `void V_UseBuffer(byte *buffer);`
- `V_RestoreBuffer` (line 86) `void V_RestoreBuffer(void);`
- `V_ScreenShot` (line 92) `void V_ScreenShot(char *format);`
- `V_LoadTintTable` (line 97) `void V_LoadTintTable(void);`
- `V_LoadXlaTable` (line 103) `void V_LoadXlaTable(void);`
- `V_DrawMouseSpeedBox` (line 105) `void V_DrawMouseSpeedBox(int speed);`

**Macros:**
- `__V_VIDEO__` (line 23) `#define __V_VIDEO__`
- `CENTERY` (line 34) `#define CENTERY`

**Variables:**
- `dirtybox` (line 37) `extern int dirtybox[4];`
- `tinttable` (line 39) `extern byte *tinttable;`

#### `w_checksum.h`
**Path:** `progs/doomgeneric/w_checksum.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Generate a checksum of the WAD directory.*

**Functions:**
- `W_Checksum` (line 24) `extern void W_Checksum(sha1_digest_t digest);`

**Macros:**
- `W_CHECKSUM_H` (line 20) `#define W_CHECKSUM_H`

#### `w_file.h`
**Path:** `progs/doomgeneric/w_file.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.*

**Functions:**
- `W_OpenFile` (line 65) `wad_file_t *W_OpenFile(char *path);`
- `W_CloseFile` (line 69) `void W_CloseFile(wad_file_t *wad);`
- `W_Read` (line 75) `size_t W_Read(wad_file_t *wad, unsigned int offset, void *buffer, size_t buffer_len);`

**Macros:**
- `__W_FILE__` (line 21) `#define __W_FILE__`

**Structs:**
- `_wad_file_s` (line 46)
- `wad_file_class_t` (line 28)

**Type_Aliases:**
- `wad_file_t` (line 25) `typedef struct _wad_file_s wad_file_t;` - *include <stdio.h> include "doomtype.h"*

#### `w_main.h`
**Path:** `progs/doomgeneric/w_main.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Common code to parse command line, identifying WAD files to load.*

**Macros:**
- `W_MAIN_H` (line 19) `#define W_MAIN_H`

#### `w_merge.h`
**Path:** `progs/doomgeneric/w_merge.h`
**File Doc:** *Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Handles merging of PWADs, similar to deutex's -merge option  Ideally this should work exactly the same as in deutex, but trying to read the deutex source code made my brain hurt.     Add a new WAD and merge it into the main directory*

**Functions:**
- `W_MergeFile` (line 29) `void W_MergeFile(char *filename);`
- `W_NWTMergeFile` (line 33) `void W_NWTMergeFile(char *filename, int flags);`
- `W_NWTDashMerge` (line 37) `void W_NWTDashMerge(char *filename);`
- `W_PrintDirectory` (line 41) `void W_PrintDirectory(void);`

**Macros:**
- `W_MERGE_H` (line 22) `#define W_MERGE_H`
- `W_NWT_MERGE_SPRITES` (line 24) `#define W_NWT_MERGE_SPRITES`
- `W_NWT_MERGE_FLATS` (line 25) `#define W_NWT_MERGE_FLATS`

#### `w_wad.h`
**Path:** `progs/doomgeneric/w_wad.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: WAD I/O functions.*

**Functions:**
- `W_AddFile` (line 58) `wad_file_t *W_AddFile (char *filename);`
- `W_CheckNumForName` (line 60) `int W_CheckNumForName (char* name);`
- `W_GetNumForName` (line 61) `int W_GetNumForName (char* name);`
- `W_LumpLength` (line 63) `int W_LumpLength (unsigned int lump);`
- `W_ReadLump` (line 64) `void W_ReadLump (unsigned int lump, void *dest);`
- `W_CacheLumpNum` (line 66) `void* W_CacheLumpNum (int lump, int tag);`
- `W_CacheLumpName` (line 67) `void* W_CacheLumpName (char* name, int tag);`
- `W_GenerateHashTable` (line 69) `void W_GenerateHashTable(void);`
- `W_LumpNameHash` (line 71) `extern unsigned int W_LumpNameHash(const char *s);`
- `W_ReleaseLumpNum` (line 73) `void W_ReleaseLumpNum(int lump);`
- `W_ReleaseLumpName` (line 74) `void W_ReleaseLumpName(char *name);`
- `W_CheckCorrectIWAD` (line 76) `void W_CheckCorrectIWAD(GameMission_t mission);`

**Macros:**
- `__W_WAD__` (line 21) `#define __W_WAD__`

**Structs:**
- `lumpinfo_s` (line 41)

**Type_Aliases:**
- `lumpinfo_t` (line 38) `typedef struct lumpinfo_s lumpinfo_t;` - *WADFILE I/O related stuff.*

**Variables:**
- `lumpinfo` (line 55) `extern lumpinfo_t *lumpinfo;`
- `numlumps` (line 56) `extern unsigned int numlumps;`

#### `wi_stuff.h`
**Path:** `progs/doomgeneric/wi_stuff.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Intermission.    #include "v_video.h"   States for the intermission*

**Functions:**
- `WI_Ticker` (line 36) `void WI_Ticker (void);` - *Called by main loop, animate the intermission.*
- `WI_Drawer` (line 40) `void WI_Drawer (void);` - *Called by main loop, draws the intermission directly into the screen buffer.*
- `WI_Start` (line 43) `void WI_Start(wbstartstruct_t* wbstartstruct);` - *Setup for an intermission screen.*
- `WI_End` (line 46) `void WI_End(void);` - *Shut down the intermission screen*

**Macros:**
- `__WI_STUFF__` (line 20) `#define __WI_STUFF__`

#### `z_zone.h`
**Path:** `progs/doomgeneric/z_zone.h`
**File Doc:** *Copyright(C) 1993-1996 Id Software, Inc. Copyright(C) 2005-2014 Simon Howard  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  DESCRIPTION: Zone Memory Allocation, perhaps NeXT ObjectiveC inspired. Remark: this was the only stuff that, according to John Carmack, might have been useful for Quake.        ZONE MEMORY*

**Functions:**
- `Z_Init` (line 53) `void Z_Init (void);`
- `Z_Malloc` (line 54) `void* Z_Malloc (int size, int tag, void *ptr);`
- `Z_Free` (line 55) `void Z_Free (void *ptr);`
- `Z_FreeTags` (line 56) `void Z_FreeTags (int lowtag, int hightag);`
- `Z_DumpHeap` (line 57) `void Z_DumpHeap (int lowtag, int hightag);`
- `Z_FileDumpHeap` (line 58) `void Z_FileDumpHeap (FILE *f);`
- `Z_CheckHeap` (line 59) `void Z_CheckHeap (void);`
- `Z_ChangeTag2` (line 60) `void Z_ChangeTag2 (void *ptr, int tag, char *file, int line);`
- `Z_ChangeUser` (line 61) `void Z_ChangeUser(void *ptr, void **user);`
- `Z_FreeMemory` (line 62) `int Z_FreeMemory (void);`
- `Z_ZoneSize` (line 63) `unsigned int Z_ZoneSize(void);`

**Macros:**
- `__Z_ZONE__` (line 25) `#define __Z_ZONE__`
- `Z_ChangeTag` (line 69) `#define Z_ChangeTag(p,t)`

#### `file_assoc.h`
**Path:** `progs/file/file_assoc.h`
**File Doc:** *Docstring: dynamic association table for the MiniOS file browser.*

**Imported by:** `test_file_assoc.c`, `test_leakcheck.c`

**Functions:**
- `fassoc_ext_ok` (line 59) `static int fassoc_ext_ok(const char *ext)` - */** Docstring: one validated association entry, ext without dot. struct fassoc_entry { char ext[FASSOC_EXT_MAX + 1]; char prog[FASSOC_PROG_MAX + 1]; }; /** Docstring: dynamic table state, zero init is valid. struct fassoc_table { struct fassoc_entry *p; size_t cnt; size_t cap; }; /** Docstring: validate ext against the assoc line charset and bound.*
- `fassoc_prog_ok` (line 73) `static int fassoc_prog_ok(const char *prog)` - *static int fassoc_ext_ok(const char *ext) { size_t n = 0; size_t k = 0; if (ext == NULL) return 0; while (ext[n] != 0) n++; if (n == 0 || n > (size_t)FASSOC_EXT_MAX) return 0; for (k = 0; k < n; k++) { char c = ext[k]; if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))) return 0; } return 1; } /** Docstring: validate prog against shell, internal, or absolute path.*
- `fassoc_clear` (line 89) `static void fassoc_clear(struct fassoc_table *t)` - *size_t k = 0; if (prog == NULL) return 0; while (prog[n] != 0) n++; if (n == 0 || n > (size_t)FASSOC_PROG_MAX) return 0; if (strcmp(prog, "shell") == 0) return 1; if (strcmp(prog, "internal") == 0) return 1; if (prog[0] != '/') return 0; for (k = 0; k < n; k++) { if (prog[k] == '|') return 0; } return 1; } /** Docstring: reset table to empty without releasing capacity.*
- `fassoc_free` (line 95) `static void fassoc_free(struct fassoc_table *t)` - *if (prog[0] != '/') return 0; for (k = 0; k < n; k++) { if (prog[k] == '|') return 0; } return 1; } /** Docstring: reset table to empty without releasing capacity. static void fassoc_clear(struct fassoc_table *t) { if (t == NULL) return; t->cnt = 0; } /** Docstring: release backing store and reset to zero init state.*
- `fassoc_reserve` (line 104) `static int fassoc_reserve(struct fassoc_table *t, size_t want)` - *if (t == NULL) return; t->cnt = 0; } /** Docstring: release backing store and reset to zero init state. static void fassoc_free(struct fassoc_table *t) { if (t == NULL) return; free(t->p); t->p = NULL; t->cnt = 0; t->cap = 0; } /** Docstring: ensure capacity for want entries, old data kept on failure.*
- `fassoc_push` (line 125) `static int fassoc_push(struct fassoc_table *t, const char *ext, const char *prog)` - *while (ncap < want) { size_t nxt = ncap * (size_t)FASSOC_GROW_NUM / (size_t)FASSOC_GROW_DEN + 1; if (nxt <= ncap) return -1; if (nxt > (size_t)FASSOC_HARD_MAX) nxt = (size_t)FASSOC_HARD_MAX; ncap = nxt; } np = (struct fassoc_entry *)realloc(t->p, ncap * sizeof(*np)); if (np == NULL) return -1; t->p = np; t->cap = ncap; return 0; } /** Docstring: append one validated entry, fail closed without mutation.*
- `fassoc_lookup` (line 140) `static const char *fassoc_lookup(const struct fassoc_table *t, const char *ext)` - *if (t == NULL) return -1; if (!fassoc_ext_ok(ext)) return -1; if (!fassoc_prog_ok(prog)) return -1; if (t->cnt >= (size_t)FASSOC_HARD_MAX) return -1; if (t->cnt >= t->cap) { if (fassoc_reserve(t, t->cnt + 1) != 0) return -1; } strcpy(t->p[t->cnt].ext, ext); strcpy(t->p[t->cnt].prog, prog); t->cnt++; return 0; } /** Docstring: program for ext in file order, empty string when unmapped.*
- `fassoc_count` (line 150) `static size_t fassoc_count(const struct fassoc_table *t)` - *return 0; } /** Docstring: program for ext in file order, empty string when unmapped. static const char *fassoc_lookup(const struct fassoc_table *t, const char *ext) { size_t k = 0; if (t == NULL || ext == NULL || ext[0] == 0) return ""; for (k = 0; k < t->cnt; k++) { if (strcmp(t->p[k].ext, ext) == 0) return t->p[k].prog; } return ""; } /** Docstring: logical entry count, zero for null table.*

**Macros:**
- `MINIOS_FILE_ASSOC_H` (line 15) `#define MINIOS_FILE_ASSOC_H`
- `FASSOC_EXT_MAX` (line 22) `#define FASSOC_EXT_MAX`
- `FASSOC_PROG_MAX` (line 26) `#define FASSOC_PROG_MAX`
- `FASSOC_INIT_CAP` (line 30) `#define FASSOC_INIT_CAP`
- `FASSOC_HARD_MAX` (line 34) `#define FASSOC_HARD_MAX`
- `FASSOC_GROW_NUM` (line 38) `#define FASSOC_GROW_NUM`
- `FASSOC_GROW_DEN` (line 42) `#define FASSOC_GROW_DEN`

**Structs:**
- `fassoc_entry` (line 46) - *#ifndef FASSOC_HARD_MAX #define FASSOC_HARD_MAX 512 #endif #ifndef FASSOC_GROW_NUM #define FASSOC_GROW_NUM 2 #endif #ifndef FASSOC_GROW_DEN #define FASSOC_GROW_DEN 1 #endif /** Docstring: one validated association entry, ext without dot.*
- `fassoc_table` (line 52) - *#define FASSOC_GROW_NUM 2 #endif #ifndef FASSOC_GROW_DEN #define FASSOC_GROW_DEN 1 #endif /** Docstring: one validated association entry, ext without dot. struct fassoc_entry { char ext[FASSOC_EXT_MAX + 1]; char prog[FASSOC_PROG_MAX + 1]; }; /** Docstring: dynamic table state, zero init is valid.*

#### `ps2_keymap.h`
**Path:** `progs/freedomui/ps2_keymap.h`
**File Doc:** *ps2_keymap.h - pure PS/2 set 1 scancode to keysym translator (US layout).*

**Functions:**
- `ps2_init` (line 47) `void ps2_init(ps2_state *s);` - *int      extended;  /* an E0 prefix is pending int      skip;      /* bytes of an E1 sequence still to swallow } ps2_state; /** One translated key event. typedef struct ps2_key { uint32_t sym;                /* X11/xkb keysym uint32_t code;               /* make code, PS2_CODE_EXTENDED for E0 keys char     text[PS2_TEXT_MAX]; /* UTF-8 produced by a press, NUL-terminated int      text_len; unsigned mods;               /* KE_MOD_* held when the key changed } ps2_key; /** Resets the state: nothing held, Caps Lock off, Num Lock on.*
- `arguments` (line 51) `* arguments (out is then left untouched). */ int ps2_feed(ps2_state *s, uint8_t byte, ps2_key *out);`

**Macros:**
- `MINIOS_PS2_KEYMAP_H` (line 10) `#define MINIOS_PS2_KEYMAP_H`
- `PS2_EV_NONE` (line 16) `#define PS2_EV_NONE`
- `PS2_EV_PRESS` (line 17) `#define PS2_EV_PRESS`
- `PS2_EV_RELEASE` (line 18) `#define PS2_EV_RELEASE`
- `PS2_CODE_EXTENDED` (line 21) `#define PS2_CODE_EXTENDED`
- `PS2_CODE_LIMIT` (line 24) `#define PS2_CODE_LIMIT`
- `PS2_TEXT_MAX` (line 26) `#define PS2_TEXT_MAX`

**Structs:**
- `ps2_state` (line 29) - *#define PS2_EV_NONE    0 #define PS2_EV_PRESS   1 #define PS2_EV_RELEASE 2 /** Bit set in ps2_key.code for keys sent behind the E0 prefix. #define PS2_CODE_EXTENDED 0x100u /** Upper bound of ps2_key.code, for callers that track held keys. #define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes.*
- `ps2_key` (line 38) - *#define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes. typedef struct ps2_state { unsigned held;      /* PS2_HELD_* bits int      caps_lock; int      num_lock; int      extended;  /* an E0 prefix is pending int      skip;      /* bytes of an E1 sequence still to swallow } ps2_state; /** One translated key event.*

**Type_Aliases:**
- `held` (line 29) `typedef struct ps2_state { unsigned held;` - *#define PS2_EV_NONE    0 #define PS2_EV_PRESS   1 #define PS2_EV_RELEASE 2 /** Bit set in ps2_key.code for keys sent behind the E0 prefix. #define PS2_CODE_EXTENDED 0x100u /** Upper bound of ps2_key.code, for callers that track held keys. #define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes.*
- `sym` (line 38) `typedef struct ps2_key { uint32_t sym;` - *#define PS2_CODE_LIMIT 0x200u #define PS2_TEXT_MAX 8 /** Translator state: held modifiers, lock toggles and pending prefixes. typedef struct ps2_state { unsigned held;      /* PS2_HELD_* bits int      caps_lock; int      num_lock; int      extended;  /* an E0 prefix is pending int      skip;      /* bytes of an E1 sequence still to swallow } ps2_state; /** One translated key event.*

#### `mpconfigvariant.h`
**Path:** `progs/micropython/variants/minios/mpconfigvariant.h`

**Macros:**
- `MICROPY_CONFIG_ROM_LEVEL` (line 11) `#define MICROPY_CONFIG_ROM_LEVEL`
- `MICROPY_FLOAT_IMPL` (line 14) `#define MICROPY_FLOAT_IMPL`
- `MICROPY_LONGINT_IMPL` (line 15) `#define MICROPY_LONGINT_IMPL`
- `MICROPY_ERROR_REPORTING` (line 18) `#define MICROPY_ERROR_REPORTING`
- `MICROPY_WARNINGS` (line 19) `#define MICROPY_WARNINGS`
- `MICROPY_DEBUG_PRINTERS` (line 20) `#define MICROPY_DEBUG_PRINTERS`
- `MICROPY_USE_READLINE` (line 23) `#define MICROPY_USE_READLINE`
- `MICROPY_KBD_EXCEPTION` (line 30) `#define MICROPY_KBD_EXCEPTION`
- `MICROPY_ASYNC_KBD_INTR` (line 31) `#define MICROPY_ASYNC_KBD_INTR`
- `MICROPY_HELPER_REPL` (line 34) `#define MICROPY_HELPER_REPL`
- `MICROPY_PY_SYS_PS1` (line 35) `#define MICROPY_PY_SYS_PS1`
- `MICROPY_PY_SYS_PS2` (line 36) `#define MICROPY_PY_SYS_PS2`
- `MICROPY_PY_SYS_ATEXIT` (line 37) `#define MICROPY_PY_SYS_ATEXIT`
- `MICROPY_PY_SYS_EXC_INFO` (line 38) `#define MICROPY_PY_SYS_EXC_INFO`
- `MICROPY_PY_SYS_STDFILES` (line 39) `#define MICROPY_PY_SYS_STDFILES`
- `MICROPY_PY_OS` (line 42) `#define MICROPY_PY_OS`
- `MICROPY_PY_OS_INCLUDEFILE` (line 43) `#define MICROPY_PY_OS_INCLUDEFILE`
- `MICROPY_PY_OS_ERRNO` (line 44) `#define MICROPY_PY_OS_ERRNO`
- `MICROPY_PY_OS_GETENV_PUTENV_UNSETENV` (line 45) `#define MICROPY_PY_OS_GETENV_PUTENV_UNSETENV`
- `MICROPY_PY_OS_SYSTEM` (line 46) `#define MICROPY_PY_OS_SYSTEM`
- `MICROPY_PY_OS_URANDOM` (line 47) `#define MICROPY_PY_OS_URANDOM`
- `MICROPY_PY_SELECT` (line 60) `#define MICROPY_PY_SELECT`
- `MICROPY_PY_SELECT_POSIX_OPTIMISATIONS` (line 61) `#define MICROPY_PY_SELECT_POSIX_OPTIMISATIONS`
- `MICROPY_PY_SELECT_SELECT` (line 62) `#define MICROPY_PY_SELECT_SELECT`
- `MICROPY_PY_ASYNCIO` (line 65) `#define MICROPY_PY_ASYNCIO`
- `MICROPY_STREAMS_NON_BLOCK` (line 70) `#define MICROPY_STREAMS_NON_BLOCK`
- `MICROPY_PY_ERRNO` (line 73) `#define MICROPY_PY_ERRNO`
- `MICROPY_PY_TIME` (line 76) `#define MICROPY_PY_TIME`
- `MICROPY_PY_TIME_INCLUDEFILE` (line 77) `#define MICROPY_PY_TIME_INCLUDEFILE`
- `MICROPY_PY_TIME_TIME_TIME_NS` (line 78) `#define MICROPY_PY_TIME_TIME_TIME_NS`
- `MICROPY_PY_TIME_CUSTOM_SLEEP` (line 79) `#define MICROPY_PY_TIME_CUSTOM_SLEEP`
- `MICROPY_PY_SSL` (line 82) `#define MICROPY_PY_SSL`
- `MICROPY_PY_FFI` (line 83) `#define MICROPY_PY_FFI`
- `MICROPY_PY_THREAD` (line 84) `#define MICROPY_PY_THREAD`
- `MICROPY_PY_MACHINE` (line 85) `#define MICROPY_PY_MACHINE`
- `MICROPY_PY_WEBSOCKET` (line 86) `#define MICROPY_PY_WEBSOCKET`
- `MICROPY_PERSISTENT_CODE_LOAD` (line 89) `#define MICROPY_PERSISTENT_CODE_LOAD`
- `MICROPY_REPL_EMACS_WORDS_MOVE` (line 92) `#define MICROPY_REPL_EMACS_WORDS_MOVE`
- `MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE` (line 93) `#define MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE`
- `MICROPY_USE_READLINE_HISTORY` (line 94) `#define MICROPY_USE_READLINE_HISTORY`
- `MICROPY_OPT_COMPUTED_GOTO` (line 99) `#define MICROPY_OPT_COMPUTED_GOTO`
- `MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF` (line 102) `#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF`
- `MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE` (line 103) `#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE`
- `MICROPY_PY_GC_COLLECT_RETVAL` (line 106) `#define MICROPY_PY_GC_COLLECT_RETVAL`
- `MICROPY_VFS_ROM` (line 109) `#define MICROPY_VFS_ROM`
- `MICROPY_VFS_ROM_IOCTL` (line 110) `#define MICROPY_VFS_ROM_IOCTL`

#### `minios_abi.h`
**Path:** `progs/minios_abi.h`
**File Doc:** *minios_abi.h -- Single source of truth for the MiniOS user-kernel ABI.*

**Imported by:** `abi_stamp.c`, `test_abi.c`, `test_wl.c`

**Functions:**
- `DOOM_BACKBUF_ADDR` (line 133) `* * All three sit in the reserved tail above DOOM_BACKBUF_ADDR (the brk cap), * so a growing heap or mmap region can never reach them. NK_BACKBUF sits * HIGHER than the framebuffer's maximum span: at `
- `range` (line 334) `* number inside the MiniOS window and outside the pcm2 range (246-248). */ #define MINIOS_SYS_LZ4_DECOMPRESS 255 #define MINIOS_SYS_MOUSE 219 #define MINIOS_SYS_NK_FRAME 220 #define MINIOS_SYS_SB16_OP`

**Macros:**
- `MINIOS_ABI_H` (line 2) `#define MINIOS_ABI_H`
- `MINIOS_ABI_VERSION` (line 44) `#define MINIOS_ABI_VERSION`
- `MINIOS_ABI_CHECKSUM` (line 48) `#define MINIOS_ABI_CHECKSUM`
- `MINIOS_USER_LOAD_BASE` (line 118) `#define MINIOS_USER_LOAD_BASE`
- `MINIOS_USER_LOAD_END` (line 119) `#define MINIOS_USER_LOAD_END`
- `MINIOS_USER_STACK_SIZE` (line 120) `#define MINIOS_USER_STACK_SIZE`
- `MINIOS_USER_STACK_TOP` (line 121) `#define MINIOS_USER_STACK_TOP`
- `MINIOS_USER_STACK_BASE` (line 122) `#define MINIOS_USER_STACK_BASE`
- `MINIOS_USER_BRK_END` (line 123) `#define MINIOS_USER_BRK_END`
- `MINIOS_DOOM_BACKBUF_ADDR` (line 140) `#define MINIOS_DOOM_BACKBUF_ADDR`
- `MINIOS_DOOM_W` (line 141) `#define MINIOS_DOOM_W`
- `MINIOS_DOOM_H` (line 142) `#define MINIOS_DOOM_H`
- `MINIOS_FB_ADDR` (line 143) `#define MINIOS_FB_ADDR`
- `MINIOS_NK_BACKBUF_ADDR` (line 144) `#define MINIOS_NK_BACKBUF_ADDR`
- `MINIOS_NK_W` (line 145) `#define MINIOS_NK_W`
- `MINIOS_NK_H` (line 146) `#define MINIOS_NK_H`
- `MINIOS_LDSO_BASE` (line 161) `#define MINIOS_LDSO_BASE`
- `MINIOS_LDSO_SIZE` (line 162) `#define MINIOS_LDSO_SIZE`
- `MINIOS_LDSO_END` (line 163) `#define MINIOS_LDSO_END`
- `MINIOS_NK_RGB_ADDR` (line 171) `#define MINIOS_NK_RGB_ADDR`
- `MINIOS_NK_RGB_BYTES` (line 172) `#define MINIOS_NK_RGB_BYTES`
- `MINIOS_HEAP_BASE` (line 177) `#define MINIOS_HEAP_BASE`
- `MINIOS_HEAP_SIZE` (line 183) `#define MINIOS_HEAP_SIZE`
- `MINIOS_PCI_MMIO_SIZE` (line 207) `#define MINIOS_PCI_MMIO_SIZE`
- `MINIOS_DEV_MMIO_VBASE` (line 219) `#define MINIOS_DEV_MMIO_VBASE`
- `MINIOS_FB_WIDTH_MAX` (line 224) `#define MINIOS_FB_WIDTH_MAX`
- `MINIOS_FB_HEIGHT_MAX` (line 225) `#define MINIOS_FB_HEIGHT_MAX`
- `MINIOS_SYS_READ` (line 243) `#define MINIOS_SYS_READ`
- `MINIOS_SYS_WRITE` (line 244) `#define MINIOS_SYS_WRITE`
- `MINIOS_SYS_OPEN` (line 245) `#define MINIOS_SYS_OPEN`
- `MINIOS_SYS_CLOSE` (line 246) `#define MINIOS_SYS_CLOSE`
- `MINIOS_SYS_FSTAT` (line 247) `#define MINIOS_SYS_FSTAT`
- `MINIOS_SYS_POLL` (line 248) `#define MINIOS_SYS_POLL`
- `MINIOS_SYS_LSEEK` (line 249) `#define MINIOS_SYS_LSEEK`
- `MINIOS_SYS_MMAP` (line 250) `#define MINIOS_SYS_MMAP`
- `MINIOS_SYS_MPROTECT` (line 251) `#define MINIOS_SYS_MPROTECT`
- `MINIOS_SYS_MUNMAP` (line 252) `#define MINIOS_SYS_MUNMAP`
- `MINIOS_SYS_BRK` (line 253) `#define MINIOS_SYS_BRK`
- `MINIOS_SYS_RT_SIGACTION` (line 254) `#define MINIOS_SYS_RT_SIGACTION`
- `MINIOS_SYS_RT_SIGPROCMASK` (line 255) `#define MINIOS_SYS_RT_SIGPROCMASK`
- `MINIOS_SYS_IOCTL` (line 256) `#define MINIOS_SYS_IOCTL`
- `MINIOS_SYS_WRITEV` (line 257) `#define MINIOS_SYS_WRITEV`
- `MINIOS_SYS_ACCESS` (line 258) `#define MINIOS_SYS_ACCESS`
- `MINIOS_SYS_SCHED_YIELD` (line 259) `#define MINIOS_SYS_SCHED_YIELD`
- `MINIOS_SYS_GETPID` (line 260) `#define MINIOS_SYS_GETPID`
- `MINIOS_SYS_SOCKET` (line 261) `#define MINIOS_SYS_SOCKET`
- `MINIOS_SYS_CONNECT` (line 262) `#define MINIOS_SYS_CONNECT`
- `MINIOS_SYS_SENDTO` (line 263) `#define MINIOS_SYS_SENDTO`
- `MINIOS_SYS_RECVFROM` (line 264) `#define MINIOS_SYS_RECVFROM`
- `MINIOS_SYS_SHUTDOWN` (line 265) `#define MINIOS_SYS_SHUTDOWN`
- `MINIOS_SYS_FORK` (line 266) `#define MINIOS_SYS_FORK`
- `MINIOS_SYS_VFORK` (line 267) `#define MINIOS_SYS_VFORK`
- `MINIOS_SYS_EXECVE` (line 268) `#define MINIOS_SYS_EXECVE`
- `MINIOS_SYS_EXIT` (line 269) `#define MINIOS_SYS_EXIT`
- `MINIOS_SYS_WAIT4` (line 270) `#define MINIOS_SYS_WAIT4`
- `MINIOS_SYS_KILL` (line 271) `#define MINIOS_SYS_KILL`
- `MINIOS_SYS_UNAME` (line 272) `#define MINIOS_SYS_UNAME`
- `MINIOS_SYS_UNLINK` (line 273) `#define MINIOS_SYS_UNLINK`
- `MINIOS_SYS_RENAME` (line 274) `#define MINIOS_SYS_RENAME`
- `MINIOS_SYS_READLINK` (line 275) `#define MINIOS_SYS_READLINK`
- `MINIOS_SYS_GETTID` (line 276) `#define MINIOS_SYS_GETTID`
- `MINIOS_SYS_FLOCK` (line 280) `#define MINIOS_SYS_FLOCK`
- `MINIOS_SYS_FSYNC` (line 281) `#define MINIOS_SYS_FSYNC`
- `MINIOS_SYS_FDATASYNC` (line 282) `#define MINIOS_SYS_FDATASYNC`
- `MINIOS_SYS_GETCWD` (line 283) `#define MINIOS_SYS_GETCWD`
- `MINIOS_SYS_GETTIMEOFDAY` (line 284) `#define MINIOS_SYS_GETTIMEOFDAY`
- `MINIOS_SYS_ARCH_PRCTL` (line 285) `#define MINIOS_SYS_ARCH_PRCTL`
- `MINIOS_SYS_OPENAT` (line 286) `#define MINIOS_SYS_OPENAT`
- `MINIOS_SYS_NEWFSTATAT` (line 287) `#define MINIOS_SYS_NEWFSTATAT`
- `MINIOS_SYS_STATX` (line 290) `#define MINIOS_SYS_STATX`
- `MINIOS_SYS_SET_ROBUST_LIST` (line 294) `#define MINIOS_SYS_SET_ROBUST_LIST`
- `MINIOS_SYS_PRLIMIT64` (line 298) `#define MINIOS_SYS_PRLIMIT64`
- `MINIOS_SYS_GETRANDOM` (line 299) `#define MINIOS_SYS_GETRANDOM`
- `MINIOS_SYS_RSEQ` (line 300) `#define MINIOS_SYS_RSEQ`
- `MINIOS_SYS_EXIT_GROUP` (line 301) `#define MINIOS_SYS_EXIT_GROUP`
- `MINIOS_SYS_SET_TID_ADDRESS` (line 302) `#define MINIOS_SYS_SET_TID_ADDRESS`
- `MINIOS_SYS_CLOCK_GETTIME` (line 303) `#define MINIOS_SYS_CLOCK_GETTIME`
- `MINIOS_SYS_TGKILL` (line 304) `#define MINIOS_SYS_TGKILL`
- `MINIOS_SYS_DNS` (line 307) `#define MINIOS_SYS_DNS`
- `MINIOS_SYS_TLS_HANDSHAKE` (line 313) `#define MINIOS_SYS_TLS_HANDSHAKE`
- `MINIOS_SYS_TLS_SEND` (line 314) `#define MINIOS_SYS_TLS_SEND`
- `MINIOS_SYS_TLS_RECV` (line 315) `#define MINIOS_SYS_TLS_RECV`
- `MINIOS_SYS_TIME` (line 318) `#define MINIOS_SYS_TIME`
- `MINIOS_SYS_KBD` (line 319) `#define MINIOS_SYS_KBD`
- `MINIOS_SYS_PALETTE` (line 320) `#define MINIOS_SYS_PALETTE`
- `MINIOS_SYS_KBD_RAW` (line 321) `#define MINIOS_SYS_KBD_RAW`
- `MINIOS_SYS_VGA_MODE` (line 322) `#define MINIOS_SYS_VGA_MODE`
- `MINIOS_SYS_PCSPK_INIT` (line 323) `#define MINIOS_SYS_PCSPK_INIT`
- `MINIOS_SYS_PCSPK_TONE` (line 324) `#define MINIOS_SYS_PCSPK_TONE`
- `MINIOS_SYS_DOOM_FRAME` (line 325) `#define MINIOS_SYS_DOOM_FRAME`
- `MINIOS_SYS_RTC` (line 326) `#define MINIOS_SYS_RTC`
- `MINIOS_SYS_FB_INFO` (line 327) `#define MINIOS_SYS_FB_INFO`
- `MINIOS_SYS_PCSPK_VOL` (line 328) `#define MINIOS_SYS_PCSPK_VOL`
- `MINIOS_SYS_SPAWN` (line 329) `#define MINIOS_SYS_SPAWN`
- `MINIOS_SYS_LZ4_COMPRESS` (line 330) `#define MINIOS_SYS_LZ4_COMPRESS`
- `MINIOS_SYS_LZ4_DECOMPRESS` (line 335) `#define MINIOS_SYS_LZ4_DECOMPRESS`
- `MINIOS_SYS_MOUSE` (line 336) `#define MINIOS_SYS_MOUSE`
- `MINIOS_SYS_NK_FRAME` (line 337) `#define MINIOS_SYS_NK_FRAME`
- `MINIOS_SYS_SB16_OPEN` (line 338) `#define MINIOS_SYS_SB16_OPEN`
- `MINIOS_SYS_SB16_SUBMIT` (line 339) `#define MINIOS_SYS_SB16_SUBMIT`
- `MINIOS_SYS_GFX_SET_TITLE` (line 340) `#define MINIOS_SYS_GFX_SET_TITLE`
- `MINIOS_SYS_SB16_PUMP` (line 341) `#define MINIOS_SYS_SB16_PUMP`
- `MINIOS_SYS_SB16_STREAM_OPEN` (line 344) `#define MINIOS_SYS_SB16_STREAM_OPEN`
- `MINIOS_SYS_SB16_STREAM_CLOSE` (line 345) `#define MINIOS_SYS_SB16_STREAM_CLOSE`
- `MINIOS_SYS_SB16_STREAM_SUBMIT` (line 346) `#define MINIOS_SYS_SB16_STREAM_SUBMIT`
- `MINIOS_SYS_SB16_STREAM_VOLUME` (line 347) `#define MINIOS_SYS_SB16_STREAM_VOLUME`
- `MINIOS_SYS_THREAD_SPAWN` (line 348) `#define MINIOS_SYS_THREAD_SPAWN`
- `MINIOS_SYS_FUTEX_WAIT` (line 349) `#define MINIOS_SYS_FUTEX_WAIT`
- `MINIOS_SYS_FUTEX_WAKE` (line 350) `#define MINIOS_SYS_FUTEX_WAKE`
- `MINIOS_SYS_SUBMIT_BATCH` (line 351) `#define MINIOS_SYS_SUBMIT_BATCH`
- `MINIOS_SYS_GETC_RAW` (line 352) `#define MINIOS_SYS_GETC_RAW`
- `MINIOS_SYS_GFX_PRESENT` (line 353) `#define MINIOS_SYS_GFX_PRESENT`
- `MINIOS_SYS_SECCOMP` (line 354) `#define MINIOS_SYS_SECCOMP`
- `MINIOS_SYS_NICE` (line 355) `#define MINIOS_SYS_NICE`
- `MINIOS_SYS_RLIMIT` (line 356) `#define MINIOS_SYS_RLIMIT`
- `MINIOS_SYS_DIR_LIST` (line 357) `#define MINIOS_SYS_DIR_LIST`
- `MINIOS_SYS_GFX_ZOOM` (line 358) `#define MINIOS_SYS_GFX_ZOOM`
- `MINIOS_SYS_WL_ATTACH` (line 363) `#define MINIOS_SYS_WL_ATTACH`
- `MINIOS_SYS_WL_COMMIT` (line 364) `#define MINIOS_SYS_WL_COMMIT`
- `MINIOS_SYS_WL_INPUT` (line 365) `#define MINIOS_SYS_WL_INPUT`
- `MINIOS_SYS_PCM2_OPEN` (line 371) `#define MINIOS_SYS_PCM2_OPEN`
- `MINIOS_SYS_PCM2_WRITE` (line 372) `#define MINIOS_SYS_PCM2_WRITE`
- `MINIOS_SYS_PCM2_CLOSE` (line 373) `#define MINIOS_SYS_PCM2_CLOSE`
- `MINIOS_SYS_CLIP_SET` (line 381) `#define MINIOS_SYS_CLIP_SET`
- `MINIOS_SYS_CLIP_GET` (line 382) `#define MINIOS_SYS_CLIP_GET`
- `MINIOS_SYS_MINFO` (line 399) `#define MINIOS_SYS_MINFO`
- `MINIOS_PCM2_NONBLOCK` (line 400) `#define MINIOS_PCM2_NONBLOCK`
- `MINIOS_PCM2_RATE` (line 404) `#define MINIOS_PCM2_RATE`
- `MINIOS_PCM2_FRAG` (line 405) `#define MINIOS_PCM2_FRAG`
- `MINIOS_SYS_CLONE` (line 407) `#define MINIOS_SYS_CLONE`
- `MINIOS_GFX_BUF_GAME` (line 416) `#define MINIOS_GFX_BUF_GAME`
- `MINIOS_GFX_BUF_NK` (line 417) `#define MINIOS_GFX_BUF_NK`
- `MINIOS_GFX_BUF_NK_RGB` (line 418) `#define MINIOS_GFX_BUF_NK_RGB`
- `MINIOS_SYS_FRAMEBUFFER_COMMIT` (line 419) `#define MINIOS_SYS_FRAMEBUFFER_COMMIT`
- `MINIOS_SYS_WINDOW_PRESENT` (line 420) `#define MINIOS_SYS_WINDOW_PRESENT`
- `MINIOS_SYS_WINDOW_TITLE` (line 421) `#define MINIOS_SYS_WINDOW_TITLE`
- `MINIOS_GFX_ZOOM_NATIVE` (line 428) `#define MINIOS_GFX_ZOOM_NATIVE`
- `MINIOS_GFX_ZOOM_2X` (line 429) `#define MINIOS_GFX_ZOOM_2X`
- `MINIOS_GFX_ZOOM_FULLSCREEN` (line 430) `#define MINIOS_GFX_ZOOM_FULLSCREEN`
- `MINIOS_GFX_ZOOM_WINDOWED` (line 431) `#define MINIOS_GFX_ZOOM_WINDOWED`
- `SYS_TIME_MS` (line 434) `#define SYS_TIME_MS`
- `SYS_PALETTE` (line 435) `#define SYS_PALETTE`
- `SYS_PCSPK_INIT` (line 436) `#define SYS_PCSPK_INIT`
- `SYS_PCSPK_TONE` (line 437) `#define SYS_PCSPK_TONE`
- `SYS_RTC` (line 438) `#define SYS_RTC`
- `SYS_FB_INFO` (line 439) `#define SYS_FB_INFO`
- `SYS_PCSPK_VOL` (line 440) `#define SYS_PCSPK_VOL`
- `SYS_SPAWN` (line 441) `#define SYS_SPAWN`
- `SYS_TIME` (line 442) `#define SYS_TIME`
- `SYS_WRITE` (line 443) `#define SYS_WRITE`
- `MINIOS_EABI_MISMATCH` (line 450) `#define MINIOS_EABI_MISMATCH`
- `MINIOS_NOTE_NAME` (line 463) `#define MINIOS_NOTE_NAME`
- `MINIOS_NOTE_PROCESS` (line 464) `#define MINIOS_NOTE_PROCESS`
- `MINIOS_NOTE_SIGN` (line 465) `#define MINIOS_NOTE_SIGN`

#### `minios_png.h`
**Path:** `progs/minios_png.h`
**File Doc:** *Docstring: shared ring-3 PNG helpers for MiniOS apps (progs/minios_png.h).*

**Imported by:** `test_minios_png.c`

**Functions:**
- `mpng_332_idx` (line 58) `static int mpng_332_idx(unsigned r, unsigned g, unsigned b)` - *static const char *mpng_left_candidates[MPNG_LEFT_N] = { "/icons/doom.png", "/icons/doomedit.png", "/icons/quake2.png", "/icons/piano.png", "/icons/nuklear.png", "/icons/vedit.png", "/icons/file.png", "/icons/shell.png", "/icons/paint.png", "/icons/minicraft.png" }; /** Docstring: direct 3-3-2 index for one RGB triple, the pokemon ramp.*
- `mpng_nearest` (line 63) `static int mpng_nearest(const unsigned char *pal, long pal_n, unsigned r,
                       ...` - *"/icons/nuklear.png", "/icons/vedit.png", "/icons/file.png", "/icons/shell.png", "/icons/paint.png", "/icons/minicraft.png" }; /** Docstring: direct 3-3-2 index for one RGB triple, the pokemon ramp. static int mpng_332_idx(unsigned r, unsigned g, unsigned b) { return (int)(((r & 0xE0u)) | (((g & 0xE0u) >> 3)) | (((b & 0xC0u) >> 6))); } /** Docstring: nearest palette index by squared RGB distance, fail closed.*
- `mpng_center` (line 84) `static int mpng_center(int outer, int inner)` - *for (k = 0; k < pal_n; k++) { long dr = (long)pal[k * 3] - (long)r; long dg = (long)pal[k * 3 + 1] - (long)g; long db = (long)pal[k * 3 + 2] - (long)b; long d = dr * dr + dg * dg + db * db; if (d < bd) { bd = d; best = k; } } return (int)best; } /** Docstring: centered offset of inner inside outer, negative when unfit.*
- `mpng_fit_scale` (line 93) `static int mpng_fit_scale(int sw, int sh, int boxw, int boxh)` - *} return (int)best; } /** Docstring: centered offset of inner inside outer, negative when unfit. static int mpng_center(int outer, int inner) { if (outer < 0 || inner < 0) return -1; if (inner > outer) return -1; return (outer - inner) / 2; } /** Docstring: integer scale that fits src inside a box, at least 1.*
- `mpng_rgb_to_idx_scaled` (line 108) `static int mpng_rgb_to_idx_scaled(const unsigned char *rgb, int sw, int sh,
                     ...` - *int s = 1; int best = 1; if (sw <= 0 || sh <= 0 || boxw <= 0 || boxh <= 0) return -1; for (s = 1; s <= boxw && s <= boxh; s++) { if (sw * s <= boxw && sh * s <= boxh) best = s; else break; } return best; } /** Docstring: scale RGB into indexed dst with nearest neighbour.*
- `bound` (line 140) `* its 512 source bound (pinned by the host suite), so icon and policy
 * art never grow through t...`
- `mpng_rgb_to_332_scaled` (line 172) `static int mpng_rgb_to_332_scaled(const unsigned char *rgb, int sw, int sh,
                     ...` - *int sy = y * sh / dh; for (x = 0; x < dw; x++) { int sx = x * sw / dw; const unsigned char *p = rgb + (sy * sw + sx) * 3; int v = mpng_nearest(pal, pal_n, p[0], p[1], p[2]); if (v < 0) return MPNG_ERR_BOUND; dst[y * dw + x] = (unsigned char)v; } } return MPNG_ERR_OK; } /** Docstring: scale RGB into 3-3-2 indexed dst with nearest neighbour.*
- `mpng_blit_idx` (line 196) `static int mpng_blit_idx(unsigned char *fb, int fw, int fh,
                         const unsign...` - *if (dw > MPNG_MAX_DIM || dh > MPNG_MAX_DIM) return MPNG_ERR_BOUND; for (y = 0; y < dh; y++) { int sy = y * sh / dh; for (x = 0; x < dw; x++) { int sx = x * sw / dw; const unsigned char *p = rgb + (sy * sw + sx) * 3; dst[y * dw + x] = (unsigned char)mpng_332_idx(p[0], p[1], p[2]); } } return MPNG_ERR_OK; } /** Docstring: blit an indexed tile into an indexed frame, clipped.*
- `mpng_load_file` (line 222) `static int mpng_load_file(const char *path, unsigned char **out, long *out_n,
                   ...` - *int dy = oy + y; if (dy < 0 || dy >= fh) continue; for (x = 0; x < tw; x++) { int dx = ox + x; if (dx < 0 || dx >= fw) continue; fb[dy * fw + dx] = tile[y * tw + x]; } } return MPNG_ERR_OK; } /** Docstring: bounded whole-file read, malloced, caller frees.*

**Macros:**
- `MINIOS_PNG_H` (line 22) `#define MINIOS_PNG_H`
- `MPNG_FILE_MAX` (line 28) `#define MPNG_FILE_MAX`
- `MPNG_MAX_DIM` (line 29) `#define MPNG_MAX_DIM`
- `MPNG_BIG_DIM` (line 33) `#define MPNG_BIG_DIM`
- `MPNG_PAL_N` (line 34) `#define MPNG_PAL_N`
- `MPNG_PAL_BYTES` (line 35) `#define MPNG_PAL_BYTES`
- `MPNG_PATH_MAX` (line 36) `#define MPNG_PATH_MAX`
- `MPNG_RIGHT_PATH` (line 37) `#define MPNG_RIGHT_PATH`
- `MPNG_LEFT_N` (line 38) `#define MPNG_LEFT_N`
- `MPNG_ERR_OK` (line 39) `#define MPNG_ERR_OK`
- `MPNG_ERR_BOUND` (line 40) `#define MPNG_ERR_BOUND`
- `MPNG_ERR_EMPTY` (line 41) `#define MPNG_ERR_EMPTY`

#### `nk_palette.h`
**Path:** `progs/nk_palette.h`
**File Doc:** *nk_palette.h - one shared hybrid palette for every NK-window app.*

**Imported by:** `test_wl.c`

**Functions:**
- `nk_palette_build` (line 22) `static int nk_palette_build(unsigned char *pal, long cap)`

**Macros:**
- `NK_PALETTE_H` (line 12) `#define NK_PALETTE_H`
- `NK_PAL_BYTES` (line 14) `#define NK_PAL_BYTES`
- `NK_PAL_DESK` (line 15) `#define NK_PAL_DESK`
- `NK_PAL_CUBE` (line 16) `#define NK_PAL_CUBE`
- `NK_PAL_GRAYS` (line 17) `#define NK_PAL_GRAYS`
- `NK_PAL_ACCENTS` (line 18) `#define NK_PAL_ACCENTS`
- `NK_PAL_ERR_OK` (line 19) `#define NK_PAL_ERR_OK`
- `NK_PAL_ERR_BOUND` (line 20) `#define NK_PAL_ERR_BOUND`

#### `cvm_emit.h`
**Path:** `progs/nuklear/cvm_emit.h`
**File Doc:** *cvm_emit.h — node-graph compiler for CVM (cvm2 module format v2).*

**Enums:**
- `cvm_node_type` (line 22) - *into a self-contained .cvm module: a single entry function whose bytecode computes every node value into a local slot and prints/exits at the output nodes. The emitted module is loadable by the CVM interpreter (objects/cvm.o) exactly like one produced by `ld -f cvm`, so `run` can execute it. Output uses the `printf`/`puts` natives (registered by cvm_host.c); exit codes come from the operand stack via OP_HALT.  #include <stddef.h> /* String payload bound for STR constants and PRINT formats. #define CVM_NODE_STR_MAX 128 /* Node types the graph compiler understands.*

**Functions:**
- `graph` (line 6) `* * A node graph (constants, arithmetic, bitwise, comparisons, a conditional * select, and string constants feeding PRINT/PRINTS/EXIT sinks) is compiled * into a self-contained .cvm module: a single e`
- `err` (line 67) `* err (err_cap bytes). The module is heap-allocated and owned by the caller * (free it). */ int cvm_compile(const struct cvm_node *nodes, int n, unsigned char **out, size_t *out_size, char *err, size_`

**Macros:**
- `CVM_EMIT_H` (line 2) `#define CVM_EMIT_H`
- `CVM_NODE_STR_MAX` (line 19) `#define CVM_NODE_STR_MAX`

**Structs:**
- `cvm_node` (line 56) - *One node in the graph. Inputs are indices of other nodes; a negative input means open, in which case the per-input literal is used when use_lit[k] is set, otherwise compilation fails with a node-context diagnostic. Output nodes (PRINT/PRINTS/EXIT) terminate the compiled program and can never be * used as an input source.*

#### `nuklear_minios.h`
**Path:** `progs/nuklear/nuklear_minios.h`
**File Doc:** *nuklear_minios.h — MiniOS platform layer for Nuklear.*

**Functions:**
- `nk_rgb_available` (line 33) `int nk_rgb_available(void);` - *RGB companion buffer (R,G,B byte order, NK_W x NK_H). Mapped only by ABI-v7 kernels; nk_rgb_available() probes it once via the fb_info 4th * word, so old kernels keep the indexed path without ever faulting. #define NK_RGB_BUF      ((volatile uint8_t *)MINIOS_NK_RGB_ADDR) /* 1 when the kernel maps NK_RGB_BUF (cached probe, 0 on old kernels).*
- `nk_idx_to_rgb` (line 37) `void nk_idx_to_rgb(int idx, unsigned char *r, unsigned char *g, unsigned char *b);` - *Resolve one hybrid palette index to its exact RGB triple (canvas and preview mirrors that own indexed pixels reuse the same table the * rasterizer draws through, so both buffers agree pixel for pixel).*
- `nk_sys_time_ms` (line 41) `long nk_sys_time_ms(void);` - *Resolve one hybrid palette index to its exact RGB triple (canvas and preview mirrors that own indexed pixels reuse the same table the * rasterizer draws through, so both buffers agree pixel for pixel). void nk_idx_to_rgb(int idx, unsigned char *r, unsigned char *g, unsigned char *b); /* MiniOS syscalls used by the platform.*
- `nk_sys_kbd` (line 42) `long nk_sys_kbd(void);`
- `nk_sys_palette` (line 43) `long nk_sys_palette(const unsigned char *pal768);`
- `nk_sys_kbd_raw` (line 44) `long nk_sys_kbd_raw(int on);`
- `nk_sys_vga_mode` (line 45) `long nk_sys_vga_mode(int on);`
- `nk_sys_fb_info` (line 46) `long nk_sys_fb_info(int *w, int *h, int *pitch);`
- `nk_sys_mouse` (line 47) `long nk_sys_mouse(int *xybw);`
- `nk_sys_mouse_badptr` (line 51) `long nk_sys_mouse_badptr(void);` - *Call SYS_MOUSE with a pointer that is NOT in the user window; the kernel must reject it with -EFAULT. Used by --selftest to prove the pointer * validation, so a mutant that drops the bounds check is killed.*
- `nk_sys_nk_frame` (line 52) `long nk_sys_nk_frame(int *origin);`
- `nk_sys_gfx_set_title` (line 53) `long nk_sys_gfx_set_title(const char *t);` - *Call SYS_MOUSE with a pointer that is NOT in the user window; the kernel must reject it with -EFAULT. Used by --selftest to prove the pointer * validation, so a mutant that drops the bounds check is killed. long nk_sys_mouse_badptr(void); long nk_sys_nk_frame(int *origin);     /* int[2]: window content origin*
- `nk_build_palette` (line 57) `void nk_build_palette(unsigned char *pal768);` - *Hybrid palette: indices 0-14 are the desktop colors (kept so the desktop * behind the window never recolors); 15-255 are the UI ramp.*
- `nk_minios_font` (line 63) `struct nk_user_font nk_minios_font(void);` - *Hybrid palette: indices 0-14 are the desktop colors (kept so the desktop * behind the window never recolors); 15-255 are the UI ramp. void nk_build_palette(unsigned char *pal768); /* 8x8 bitmap font (ASCII 32..127), shared with the rasterizer. extern const uint8_t nk_font8x8[96][8]; /* The nk_user_font for this backend: 8x8 monospace.*
- `nk_rasterize` (line 66) `void nk_rasterize(struct nk_context *ctx);` - *Hybrid palette: indices 0-14 are the desktop colors (kept so the desktop * behind the window never recolors); 15-255 are the UI ramp. void nk_build_palette(unsigned char *pal768); /* 8x8 bitmap font (ASCII 32..127), shared with the rasterizer. extern const uint8_t nk_font8x8[96][8]; /* The nk_user_font for this backend: 8x8 monospace. struct nk_user_font nk_minios_font(void); /* Rasterize the Nuklear command list into the back-buffer.*
- `SYS_NK_FRAME` (line 85) `* SYS_NK_FRAME (nk_set_window_origin). */ void nk_set_window_origin(int x, int y);`
- `nk_poll_input` (line 87) `void nk_poll_input(struct nk_context *ctx);`
- `nk_quit_requested` (line 92) `int nk_quit_requested(void);` - *WM quit gesture: ESC or Alt+F4 since the last poll (1 once, then clears). Every NK app checks this per frame so closing never depends * on the title-bar X alone.*
- `nk_set_scancode_hook` (line 101) `void nk_set_scancode_hook(nk_scancode_cb cb, void *ud);`

**Macros:**
- `NUKLEAR_MINIOS_H` (line 2) `#define NUKLEAR_MINIOS_H`
- `NK_W` (line 24) `#define NK_W`
- `NK_H` (line 25) `#define NK_H`
- `NK_BACKBUF` (line 26) `#define NK_BACKBUF`
- `NK_RGB_BUF` (line 30) `#define NK_RGB_BUF`
- `NK_MINIOS_IMG_MAX` (line 73) `#define NK_MINIOS_IMG_MAX`

**Structs:**
- `nk_context` (line 20) - *Forward declarations so this header is self-contained when included * without nuklear.h first (font8x8.c does exactly that).*
- `nk_user_font` (line 21)
- `nk_command_buffer` (line 22)
- `nk_minios_img` (line 74) - *Caller-owned image for NK_COMMAND_IMAGE: palette-indexed pixels plus a 0/1 alpha mask (mask 0 skips the pixel, so icons keep transparency). The app keeps the buffers alive while the image is used; the backend only reads. Bounds are fail closed: a null descriptor, a null plane or * a non-positive/excessive extent draws nothing. define NK_MINIOS_IMG_MAX 64*

#### `nuklear_theme.h`
**Path:** `progs/nuklear/nuklear_theme.h`
**File Doc:** *Docstring: shared Nuklear theme contract for every MiniOS NK app.*

**Functions:**
- `nk_theme_active` (line 62) `int nk_theme_active(char *dst, int cap);` - *X(scrollbar_cursor, 24) \ X(scrollbar_cursor_hover, 25) \ X(scrollbar_cursor_active, 26) \ X(tab_header, 27) \ X(knob, 28) \ X(knob_cursor, 29) \ X(knob_cursor_hover, 30) \ X(knob_cursor_active, 31) #define NK_THEME_KEY_COUNT 32 struct nk_context; /** Resolve the active theme name (current file, else the default).*
- `nk_theme_probe` (line 65) `int nk_theme_probe(const char *name, unsigned char rgb[NK_THEME_KEY_COUNT][3]);` - *X(tab_header, 27) \ X(knob, 28) \ X(knob_cursor, 29) \ X(knob_cursor_hover, 30) \ X(knob_cursor_active, 31) #define NK_THEME_KEY_COUNT 32 struct nk_context; /** Resolve the active theme name (current file, else the default). int nk_theme_active(char *dst, int cap); /** Load name (or active when 0) into rgb[32][3]; 0 ok, <0 fallback used.*
- `nk_theme_apply` (line 68) `int nk_theme_apply(struct nk_context *ctx, const char *name);` - *X(knob_cursor_hover, 30) \ X(knob_cursor_active, 31) #define NK_THEME_KEY_COUNT 32 struct nk_context; /** Resolve the active theme name (current file, else the default). int nk_theme_active(char *dst, int cap); /** Load name (or active when 0) into rgb[32][3]; 0 ok, <0 fallback used. int nk_theme_probe(const char *name, unsigned char rgb[NK_THEME_KEY_COUNT][3]); /** Apply name (or active when 0) to ctx; 0 ok, <0 fallback applied.*

**Macros:**
- `NUKLEAR_THEME_H` (line 2) `#define NUKLEAR_THEME_H`
- `NK_THEME_NAME_MAX` (line 15) `#define NK_THEME_NAME_MAX`
- `NK_THEME_KEY_MAX` (line 16) `#define NK_THEME_KEY_MAX`
- `NK_THEME_LINE_MAX` (line 17) `#define NK_THEME_LINE_MAX`
- `NK_THEME_PATH_DIR` (line 18) `#define NK_THEME_PATH_DIR`
- `NK_THEME_PATH_CURRENT` (line 19) `#define NK_THEME_PATH_CURRENT`
- `NK_THEME_DEFAULT` (line 20) `#define NK_THEME_DEFAULT`
- `NK_THEME_KEY_LIST` (line 23) `#define NK_THEME_KEY_LIST`
- `NK_THEME_KEY_COUNT` (line 57) `#define NK_THEME_KEY_COUNT`

**Structs:**
- `nk_context` (line 59)

#### `SDL.h`
**Path:** `progs/pokemon/minios_stubs/SDL.h`
**File Doc:** *SDL.h stub for MiniOS cross-compilation*

**Functions:**
- `SDL_GetPerformanceCounter` (line 11) `static inline Uint64 SDL_GetPerformanceCounter(void)`
- `SDL_GetPerformanceFrequency` (line 12) `static inline Uint64 SDL_GetPerformanceFrequency(void)`
- `SDL_GetTicks` (line 13) `static inline Uint32 SDL_GetTicks(void)`
- `SDL_Delay` (line 14) `static inline void SDL_Delay(Uint32 ms)`

**Macros:**
- `SDL_H_STUB_MINIOS` (line 3) `#define SDL_H_STUB_MINIOS`

**Type_Aliases:**
- `Uint64` (line 5) `typedef uint64_t Uint64;` - */* SDL.h stub for MiniOS cross-compilation ifndef SDL_H_STUB_MINIOS define SDL_H_STUB_MINIOS include <stdint.h>*
- `Uint32` (line 6) `typedef uint32_t Uint32;`
- `Sint32` (line 7) `typedef int32_t Sint32;`
- `Sint16` (line 8) `typedef int16_t Sint16;`
- `Uint8` (line 9) `typedef uint8_t Uint8;`

#### `mthreads.h`
**Path:** `progs/src/mthreads.h`
**File Doc:** *mthreads.h -- Minimal pthread-like threads for MiniOS ELFs (roadmap*

**Functions:**
- `m_syscall6` (line 50) `static inline long m_syscall6(long n, long a, long b, long c)`
- `myield` (line 59) `static inline void myield(void)`
- `mfutex_wait` (line 63) `static inline long mfutex_wait(volatile int *addr, int val)`
- `mfutex_wake` (line 67) `static inline long mfutex_wake(volatile int *addr, int n)`
- `mmutex_init` (line 71) `static inline void mmutex_init(mmutex_t *m)`
- `mmutex_lock` (line 75) `static inline void mmutex_lock(mmutex_t *m)`
- `mmutex_unlock` (line 90) `static inline void mmutex_unlock(mmutex_t *m)`
- `mthread_entry` (line 98) `static void mthread_entry(void *p)` - *Thread entry trampoline: runs fn(arg), stores the return, exits 0. * The exit code is always 0; join reads retval from the shared slot.*
- `mthread_create` (line 117) `static int mthread_create(mthread_t *t, void *(*fn)(void *), void *arg)`
- `mthread_join` (line 144) `static int mthread_join(mthread_t t, void **retval)` - *Join: wait4 (Linux semantics) answers the reaped pid and stores the status word; the thread always exits 0, so a join succeeds only when the pid it reaped is this thread's and the status says exit 0. Returns 0, * the negative errno from wait4, or -1 for any other outcome.*

**Macros:**
- `MTHREADS_H` (line 24) `#define MTHREADS_H`
- `MTHREAD_STACK_SZ` (line 28) `#define MTHREAD_STACK_SZ`
- `MTHREAD_MAX` (line 29) `#define MTHREAD_MAX`
- `MMUTEX_FREE` (line 31) `#define MMUTEX_FREE`
- `MMUTEX_HELD` (line 32) `#define MMUTEX_HELD`
- `MMUTEX_CONTENDED` (line 33) `#define MMUTEX_CONTENDED`
- `MMUTEX_SPINS` (line 34) `#define MMUTEX_SPINS`

**Structs:**
- `mmutex_t` (line 38)
- `mthread_slot_t` (line 42)

**Type_Aliases:**
- `mthread_t` (line 35) `typedef int mthread_t;` - *define MMUTEX_FREE 0 define MMUTEX_HELD 1 define MMUTEX_CONTENDED 2 define MMUTEX_SPINS 100*

#### `wl_client.h`
**Path:** `progs/wl/wl_client.h`
**File Doc:** *wl_client.h - Thin mailbox client for Wayland-mini (ADR-0026).*

**Functions:**
- `wl_client_emit_file` (line 21) `static inline int wl_client_emit_file(const char *box, unsigned int seq,
        const unsigned c...` - *N tiled windows with real multitasking under the existing preemptive scheduler. File bytes stay here (stdio); names, frames and wire encoding stay in wl_mbox.h and wl_mini.h. Every bound fails closed, never truncates.  #ifndef WL_CLIENT_H #define WL_CLIENT_H #include "wl/wl_mbox.h" #define WL_CLIENT_MSGS 6 /** Write one framed session message as its own mailbox file.*
- `wl_client_raw_file` (line 48) `static inline int wl_client_raw_file(const char *box,
        const unsigned char *px, int w, int h)` - *Write the pixel blob the next attach sizes. Pixels first so the * server never attaches a surface whose raw file is missing.*
- `wl_client_attach` (line 75) `static inline int wl_client_attach(const char *box, unsigned int seq0,
        const unsigned cha...` - *Attach one surface: pixels first, then display, bind, create, pool, attach and commit, each sequenced from seq0. Returns * WL_ERR_OK when all six messages landed.*

**Macros:**
- `WL_CLIENT_H` (line 14) `#define WL_CLIENT_H`
- `WL_CLIENT_MSGS` (line 18) `#define WL_CLIENT_MSGS`

#### `wl_mbox.h`
**Path:** `progs/wl/wl_mbox.h`
**File Doc:** *wl_mbox.h - Mailbox file transport for Wayland-mini (ADR-0026).*

**Imported by:** `test_wl.c`

**Functions:**
- `wl_mbox_init` (line 36) `static inline void wl_mbox_init(wl_mbox_box_t *boxes)`
- `wl_mbox_box_ok` (line 51) `static inline int wl_mbox_box_ok(const char *box)` - *Box names are lowercase alphanumerics so they can never escape the * directory through dot or slash tricks.*
- `wl_mbox_hex` (line 74) `static inline int wl_mbox_hex(unsigned int v, char *dst)` - *if (ch >= '0' && ch <= '9') ok = 1; if (!ok) return WL_ERR_STR; n++; if (n >= WL_MBOX_BOX_MAX) return WL_ERR_STR; } if (n == 0) return WL_ERR_STR; return WL_ERR_OK; } /** Sequence as fixed 8 lowercase hex so names sort chronologically.*
- `wl_mbox_unhex` (line 87) `static inline int wl_mbox_unhex(char ch, unsigned int *v)`
- `wl_mbox_name` (line 103) `static inline int wl_mbox_name(char *dst, int cap, const char *box,
        unsigned int seq)` - *Build WL_MBOX_DIR/box-seq.msg. Returns the length, never a prefix * of it, so a short buffer reads as an error and not a stray file.*
- `wl_mbox_parse` (line 147) `static inline int wl_mbox_parse(const char *path, char *box, int boxcap,
        unsigned int *seq)` - *Parse a mailbox path back into box plus sequence. Only exact * matches pass; a renamed stray or a foreign suffix never dispatches.*
- `wl_mbox_raw_name` (line 194) `static inline int wl_mbox_raw_name(char *dst, int cap, const char *box)` - *path += WL_MBOX_SEQ_HEX; i = 0; while (suf[i] != '\0') { if (path[i] != suf[i]) return WL_ERR_STR; i++; } if (path[i] != '\0') return WL_ERR_STR; seq = v; return WL_ERR_OK; } /** Raw pixel path beside the mailbox, sized w*h by the last attach.*
- `wl_mbox_ev_name` (line 225) `static inline int wl_mbox_ev_name(char *dst, int cap, const char *box)` - *return WL_ERR_BOUND; dst[di++] = box[i++]; } i = 0; while (suf[i] != '\0') { if (di >= cap - 1) return WL_ERR_BOUND; dst[di++] = suf[i++]; } dst[di] = '\0'; return di; } /** Event path beside the mailbox, one fixed frame per focused box.*
- `wl_client_box` (line 257) `static inline int wl_client_box(const char *prog, long pid, char *dst,
        int cap)` - *Client box name: lowercase alnum program plus decimal pid, so two * instances of one app never share a mailbox. Pure, host-tested.*
- `wl_mbox_frame_encode` (line 310) `static inline int wl_mbox_frame_encode(unsigned char *dst, int cap,
        unsigned int seq, con...` - *Frame one wire message: magic plus sequence plus the raw message. The reader refuses anything short, anything foreign and anything * with trailing bytes, so a torn write waits for the next poll.*
- `wl_mbox_frame_decode` (line 332) `static inline int wl_mbox_frame_decode(const unsigned char *src, int len,
        unsigned int *s...`
- `wl_mbox_assign` (line 358) `static inline int wl_mbox_assign(wl_mbox_box_t *boxes, const char *box)` - *Claim the slot a box owns, stable across polls, fail-closed when * the server is full or the name is wild.*
- `wl_mbox_fresh` (line 394) `static inline int wl_mbox_fresh(const wl_mbox_box_t *boxes, int slot,
        unsigned int seq)` - *Freshness of an arriving sequence: a repeat of the last accepted one is a duplicate the server already consumed, anything else is * new work. Fail-closed on wild slots.*
- `wl_mbox_route` (line 409) `static inline int wl_mbox_route(wl_comp_t *c, wl_mbox_box_t *boxes,
        const char *box, unsi...` - *Route one mailbox message to the compositor state. The box owns its slot, so a client id is only checked for range, never for global meaning: each connection speaks its own id space exactly like a real Wayland client, and the slot is the server resource. Attach reports w/h for the pixel load, commit reports -1 for no * change, anything else that validates reports the slot too.*

**Macros:**
- `WL_MBOX_H` (line 15) `#define WL_MBOX_H`
- `WL_MBOX_DIR` (line 19) `#define WL_MBOX_DIR`
- `WL_MBOX_SUFFIX` (line 20) `#define WL_MBOX_SUFFIX`
- `WL_MBOX_RAW_SUFFIX` (line 21) `#define WL_MBOX_RAW_SUFFIX`
- `WL_MBOX_EV_SUFFIX` (line 22) `#define WL_MBOX_EV_SUFFIX`
- `WL_MBOX_BOX_MAX` (line 23) `#define WL_MBOX_BOX_MAX`
- `WL_MBOX_NAME_MAX` (line 24) `#define WL_MBOX_NAME_MAX`
- `WL_MBOX_MAGIC` (line 25) `#define WL_MBOX_MAGIC`
- `WL_MBOX_FRAME_HEAD` (line 26) `#define WL_MBOX_FRAME_HEAD`
- `WL_MBOX_POLL_MAX` (line 27) `#define WL_MBOX_POLL_MAX`
- `WL_MBOX_SEQ_HEX` (line 28) `#define WL_MBOX_SEQ_HEX`

**Structs:**
- `wl_mbox_box_t` (line 30)

#### `wl_mini.h`
**Path:** `progs/wl/wl_mini.h`
**File Doc:** *wl_mini.h - Wayland-mini subset contract (header-only, ADR-0024).*

**Imported by:** `test_wl.c`

**Functions:**
- `wl_hdr_encode` (line 71) `static inline int wl_hdr_encode(unsigned char *dst, int cap,
        unsigned int id, unsigned in...`
- `wl_hdr_decode` (line 99) `static inline int wl_hdr_decode(const unsigned char *src, int len,
        wl_hdr_t *out)`
- `wl_u32_encode` (line 128) `static inline int wl_u32_encode(unsigned char *dst, int cap, int off,
        unsigned int v)`
- `wl_u32_decode` (line 139) `static inline int wl_u32_decode(const unsigned char *src, int len, int off,
        unsigned int *v)`
- `wl_strlen_bounded` (line 150) `static inline int wl_strlen_bounded(const char *s)`
- `wl_str_encode` (line 163) `static inline int wl_str_encode(unsigned char *dst, int cap, int off,
        const char *s)` - *static inline int wl_strlen_bounded(const char *s) { int n = 0; if (!s) return WL_ERR_STR; while (s[n] != '\0') { n++; if (n >= WL_MAX_STR) return WL_ERR_STR; } return n; } /* String arg: u32 len (incl. NUL) + bytes + pad to 4. Returns total or err.*
- `wl_str_decode` (line 188) `static inline int wl_str_decode(const unsigned char *src, int len, int off,
        char *dst, in...`
- `wl_surface_id_valid` (line 214) `static inline int wl_surface_id_valid(unsigned int id)`
- `wl_pool_id_valid` (line 219) `static inline int wl_pool_id_valid(unsigned int id)`
- `wl_pool_fit` (line 223) `static inline int wl_pool_fit(int w, int h)`
- `wl_comp_init` (line 271) `static inline void wl_comp_init(wl_comp_t *c)`
- `wl_comp_refresh_active` (line 289) `static inline void wl_comp_refresh_active(wl_comp_t *c)` - *Refresh the active flag from z-order: only the top-most mapped, non-minimized surface reads active. Single place so focus, add and * remove can never disagree on which title paints bright.*
- `wl_comp_add` (line 309) `static inline int wl_comp_add(wl_comp_t *c, unsigned int id, int w, int h)`
- `wl_comp_remove` (line 345) `static inline int wl_comp_remove(wl_comp_t *c, unsigned int id)`
- `wl_comp_focus` (line 372) `static inline int wl_comp_focus(wl_comp_t *c, unsigned int id)`
- `wl_comp_hit` (line 397) `static inline int wl_comp_hit(const wl_comp_t *c, int x, int y)`
- `wl_surface_hit_zone` (line 415) `static inline int wl_surface_hit_zone(const wl_surface_t *s, int x, int y)` - *Classify a point inside one surface: close button first, then title drag strip, then the resize rim, else body. Points outside fail closed with HIT_NONE. Geometry mirrors wlcomp_blit_chrome so * clicks and pixels can never disagree.*
- `wl_comp_top_visible` (line 441) `static inline int wl_comp_top_visible(const wl_comp_t *c)` - *Slot of the top-most mapped, non-minimized surface, or -1. This is the window that owns keyboard input: the raw top of the z-order can * be a minimized surface, which must never receive keys it cannot show.*
- `wl_comp_set_minimized` (line 460) `static inline int wl_comp_set_minimized(wl_comp_t *c, unsigned int id,
        int minimized)` - *Minimize/restore one surface. Minimized surfaces keep their slot and geometry but skip hit testing, tiling and compositing until restored. Minimizing sinks the surface to the bottom of the z-order and hands focus to the top-most visible surface, so the next key or * Alt+M lands on a window the user can see.*
- `wl_comp_set_color` (line 487) `static inline int wl_comp_set_color(wl_comp_t *c, unsigned int id, int color)`
- `wlcomp_render` (line 512) `static inline int wlcomp_render(const wl_comp_t *c, unsigned char *fb,
        int fb_w, int fb_h)`
- `wl_comp_set_rect` (line 550) `static inline int wl_comp_set_rect(wl_comp_t *c, unsigned int id,
        int x, int y, int w, in...` - *Move and resize a mapped surface. Geometry validates through wl_pool_fit; positions allow a one-screen negative margin so a drag * can park a surface partly offscreen, anything beyond fails closed.*
- `wl_comp_layout_tile` (line 577) `static inline int wl_comp_layout_tile(wl_comp_t *c, int fb_w, int fb_h)` - *Tile every mapped surface over the frame in z-order. One surface fills the frame, two split it vertically, three or more form a rows-by-columns grid with the last row and column absorbing the integer remainder. Returns the tiled count, fail-closed when there * is nothing mapped or the frame is degenerate.*
- `wlcomp_blit` (line 637) `static inline int wlcomp_blit(const wl_comp_t *c, unsigned char *fb,
        int fb_w, int fb_h, ...` - *Composite the surface stack with real client pixels. px, pw and ph are slot-indexed tables over items[]; a null slot entry renders the surface solid color exactly like wlcomp_render, which keeps single color clients working. A present pixel table whose dimensions differ * from the surface fails closed. Null table means all solid.*
- `body` (line 698) `* resampled into the body (inside the 1 px border, below the title),
 * the exact rect wl_ev_map ...`
- `wl_scale_nearest` (line 793) `static inline int wl_scale_nearest(unsigned char *dst, int dw, int dh,
        const unsigned cha...` - *Nearest-neighbour scale of an indexed frame, the compositor side of a client buffer meeting a layout cell of another size. A real compositor scales or clips; refusing would unmap every client the moment it tiles, so the resample stays exact and bounded instead. Fail-closed on null or degenerate geometry and on arithmetic the * frame cannot hold.*
- `wl_attach_encode` (line 823) `static inline int wl_attach_encode(unsigned char *dst, int cap,
        unsigned int pool, int w,...` - *Attach payload: u32 pool id, u32 width, u32 height. The client speaks it over the mailbox transport; the compositor decodes it before touching any pixel, so a wild pool or an oversized frame never * reaches layout.*
- `wl_attach_decode` (line 842) `static inline int wl_attach_decode(const unsigned char *src, int len,
        unsigned int *pool,...`
- `wl_commit_encode` (line 870) `static inline int wl_commit_encode(unsigned char *dst, int cap,
        unsigned int id)` - *Commit payload: u32 surface id naming the surface whose attached * buffer becomes visible. Wild ids fail closed, never focus a stranger.*
- `wl_commit_decode` (line 883) `static inline int wl_commit_decode(const unsigned char *src, int len,
        unsigned int *id)`
- `wl_clip_encode` (line 907) `static inline int wl_clip_encode(unsigned char *dst, int cap,
        const unsigned char *text, ...`
- `wl_clip_decode` (line 930) `static inline int wl_clip_decode(const unsigned char *src, int len,
        unsigned char *dst, i...`
- `wl_ev_encode` (line 978) `static inline int wl_ev_encode(unsigned char *dst, int cap,
        const wl_ev_t *ev)`
- `wl_ev_decode` (line 1008) `static inline int wl_ev_decode(const unsigned char *src, int len,
        wl_ev_t *ev)`
- `wl_ev_map` (line 1051) `static inline int wl_ev_map(int fx, int fy, int sx, int sy, int sw,
        int sh, int rw, int r...` - *Map a frame point into a client's raw buffer coords. The content area starts below the 1px border plus the title bar; the scale covers layout cells differing from attach dims. Outside maps to * (-1,-1) with 0, never a clamped edge that would warp clicks.*
- `wl_client_init` (line 1092) `static inline void wl_client_init(wl_client_t *cl)`
- `wl_client_surface` (line 1100) `static inline int wl_client_surface(wl_client_t *cl, unsigned int *id)`
- `wl_client_pool` (line 1109) `static inline int wl_client_pool(wl_client_t *cl, unsigned int *id)`
- `wl_stream_init` (line 1129) `static inline void wl_stream_init(wl_stream_t *s)`
- `wl_stream_feed` (line 1135) `static inline int wl_stream_feed(wl_stream_t *s, const unsigned char *src,
        int n)`
- `wl_stream_next` (line 1150) `static inline int wl_stream_next(wl_stream_t *s, int *size)`
- `wl_stream_consume` (line 1166) `static inline int wl_stream_consume(wl_stream_t *s, int n)`
- `wl_iface_find` (line 1187) `static inline int wl_iface_find(const char *name)`
- `wl_comp_attach_buf` (line 1218) `static inline int wl_comp_attach_buf(wl_comp_t *c, unsigned int id,
        unsigned int pool, in...` - *Bind an attached buffer to a surface, keeping its position. The pool id stands in for the passed fd miniOS cannot carry, validated * here before any pixel is ever addressed through it.*
- `wl_dispatch` (line 1245) `static inline int wl_dispatch(wl_comp_t *c, wl_client_t *cl,
        unsigned int id, unsigned in...` - *Route one framed request to the compositor state, the protocol.c plus server.c shape collapsed into one pure function. Unknown ids name strangers, unknown opcodes name unimplemented verbs, short * payloads never reach the surface they address.*
- `coords` (line 959) `* coords (mapped by wl_ev_map, -1 when outside), wheel is a * monotonic total the client diffs, scancodes are raw Set-1 bytes * (E0 prefixes included) the client's own translator consumes. * A slow cl`

**Macros:**
- `WL_MINI_H` (line 18) `#define WL_MINI_H`
- `WL_MAX_MSG` (line 20) `#define WL_MAX_MSG`
- `WL_MAX_STR` (line 21) `#define WL_MAX_STR`
- `WL_MAX_SURFACES` (line 22) `#define WL_MAX_SURFACES`
- `WL_MAX_POOLS` (line 23) `#define WL_MAX_POOLS`
- `WL_SURF_MAX_W` (line 24) `#define WL_SURF_MAX_W`
- `WL_SURF_MAX_H` (line 25) `#define WL_SURF_MAX_H`
- `WL_POOL_MAX` (line 26) `#define WL_POOL_MAX`
- `WL_HDR_SZ` (line 27) `#define WL_HDR_SZ`
- `WL_ATTACH_SZ` (line 28) `#define WL_ATTACH_SZ`
- `WL_COMMIT_SZ` (line 29) `#define WL_COMMIT_SZ`
- `WL_ERR_OK` (line 31) `#define WL_ERR_OK`
- `WL_ERR_BOUND` (line 32) `#define WL_ERR_BOUND`
- `WL_ERR_TRUNC` (line 33) `#define WL_ERR_TRUNC`
- `WL_ERR_SIZE` (line 34) `#define WL_ERR_SIZE`
- `WL_ERR_ID` (line 35) `#define WL_ERR_ID`
- `WL_ERR_STR` (line 36) `#define WL_ERR_STR`
- `WL_ERR_MORE` (line 37) `#define WL_ERR_MORE`
- `WL_ID_DISPLAY` (line 39) `#define WL_ID_DISPLAY`
- `WL_ID_REGISTRY` (line 40) `#define WL_ID_REGISTRY`
- `WL_ID_COMPOSITOR` (line 41) `#define WL_ID_COMPOSITOR`
- `WL_ID_SHM` (line 42) `#define WL_ID_SHM`
- `WL_ID_XDG_BASE` (line 43) `#define WL_ID_XDG_BASE`
- `WL_ID_SURFACE_BASE` (line 44) `#define WL_ID_SURFACE_BASE`
- `WL_ID_POOL_BASE` (line 45) `#define WL_ID_POOL_BASE`
- `WL_ID_BUFFER_BASE` (line 46) `#define WL_ID_BUFFER_BASE`
- `WL_OP_DISPLAY_GET_REGISTRY` (line 48) `#define WL_OP_DISPLAY_GET_REGISTRY`
- `WL_OP_REGISTRY_BIND` (line 49) `#define WL_OP_REGISTRY_BIND`
- `WL_OP_COMPOSITOR_CREATE_SURFACE` (line 50) `#define WL_OP_COMPOSITOR_CREATE_SURFACE`
- `WL_OP_SHM_CREATE_POOL` (line 51) `#define WL_OP_SHM_CREATE_POOL`
- `WL_OP_POOL_CREATE_BUFFER` (line 52) `#define WL_OP_POOL_CREATE_BUFFER`
- `WL_OP_SURFACE_ATTACH` (line 53) `#define WL_OP_SURFACE_ATTACH`
- `WL_OP_SURFACE_COMMIT` (line 54) `#define WL_OP_SURFACE_COMMIT`
- `WL_OP_XDG_GET_TOPLEVEL` (line 55) `#define WL_OP_XDG_GET_TOPLEVEL`
- `WL_CFG_DEFAULT` (line 69) `#define WL_CFG_DEFAULT`
- `WL_TITLE_H` (line 238) `#define WL_TITLE_H`
- `WL_CLOSE_W` (line 239) `#define WL_CLOSE_W`
- `WL_RESIZE_EDGE` (line 240) `#define WL_RESIZE_EDGE`
- `WL_TITLE_ACTIVE` (line 241) `#define WL_TITLE_ACTIVE`
- `WL_TITLE_INACTIVE` (line 242) `#define WL_TITLE_INACTIVE`
- `WL_CLOSE_INK` (line 243) `#define WL_CLOSE_INK`
- `WL_HIT_NONE` (line 245) `#define WL_HIT_NONE`
- `WL_HIT_BODY` (line 246) `#define WL_HIT_BODY`
- `WL_HIT_TITLE` (line 247) `#define WL_HIT_TITLE`
- `WL_HIT_CLOSE` (line 248) `#define WL_HIT_CLOSE`
- `WL_HIT_RESIZE` (line 249) `#define WL_HIT_RESIZE`
- `WLCOMP_BG` (line 509) `#define WLCOMP_BG`
- `WLCOMP_BORDER` (line 510) `#define WLCOMP_BORDER`
- `WL_ID_CLIPBOARD` (line 902) `#define WL_ID_CLIPBOARD`
- `WL_OP_CLIPBOARD_SET` (line 903) `#define WL_OP_CLIPBOARD_SET`
- `WL_OP_CLIPBOARD_GET` (line 904) `#define WL_OP_CLIPBOARD_GET`
- `WL_CLIP_MAX` (line 905) `#define WL_CLIP_MAX`
- `WL_EV_MAGIC` (line 964) `#define WL_EV_MAGIC`
- `WL_EV_SC_MAX` (line 965) `#define WL_EV_SC_MAX`
- `WL_EV_SZ` (line 966) `#define WL_EV_SZ`
- `WL_STREAM_CAP` (line 1122) `#define WL_STREAM_CAP`
- `WL_IFACE_COUNT` (line 1185) `#define WL_IFACE_COUNT`

**Structs:**
- `wl_hdr_t` (line 57)
- `wl_cfg_t` (line 63)
- `wl_surface_t` (line 251)
- `wl_comp_t` (line 264)
- `wl_ev_t` (line 968)
- `wl_client_t` (line 1086)
- `wl_stream_t` (line 1124)
- `wl_iface_t` (line 1179) - *Interface descriptor table, the hand-written wl_interface subset. request and event counts name what wl_dispatch answers, nothing * more; a scanner earns its place only if the subset grows.*

#### `wl_pixbuf.h`
**Path:** `progs/wl/wl_pixbuf.h`
**File Doc:** *Docstring: heap pixel store for the Wayland-mini server.*

**Imported by:** `test_wl.c`

**Functions:**
- `wpix_init` (line 63) `static int wpix_init(struct wpix_store *s)` - *unsigned char *p; int w; int h; }; /** Docstring: slot caches plus one reusable raw/decode scratch pair. struct wpix_store { struct wpix_slot slots[WPIX_MAX_SLOTS]; unsigned char *tmp_raw; unsigned char *tmp_dst; size_t tmp_cap; }; /** Docstring: zero init every slot and scratch pointer.*
- `wpix_free` (line 78) `static void wpix_free(struct wpix_store *s)` - *size_t k = 0; if (s == NULL) return -1; for (k = 0; k < (size_t)WPIX_MAX_SLOTS; k++) { s->slots[k].p = NULL; s->slots[k].w = 0; s->slots[k].h = 0; } s->tmp_raw = NULL; s->tmp_dst = NULL; s->tmp_cap = 0; return 0; } /** Docstring: release every slot and scratch buffer, back to zero init.*
- `wpix_used` (line 95) `static size_t wpix_used(const struct wpix_store *s)` - *for (k = 0; k < (size_t)WPIX_MAX_SLOTS; k++) { free(s->slots[k].p); s->slots[k].p = NULL; s->slots[k].w = 0; s->slots[k].h = 0; } free(s->tmp_raw); free(s->tmp_dst); s->tmp_raw = NULL; s->tmp_dst = NULL; s->tmp_cap = 0; } /** Docstring: live pixel bytes held across all slots.*
- `wpix_ptr` (line 107) `static unsigned char *wpix_ptr(struct wpix_store *s, int idx)` - */** Docstring: live pixel bytes held across all slots. static size_t wpix_used(const struct wpix_store *s) { size_t k = 0; size_t n = 0; if (s == NULL) return 0; for (k = 0; k < (size_t)WPIX_MAX_SLOTS; k++) { if (s->slots[k].p != NULL && s->slots[k].w > 0 && s->slots[k].h > 0) n += (size_t)s->slots[k].w * (size_t)s->slots[k].h; } return n; } /** Docstring: readable pixels for slot idx, null when empty or wild.*
- `wpix_raw` (line 115) `static unsigned char *wpix_raw(struct wpix_store *s)` - *n += (size_t)s->slots[k].w * (size_t)s->slots[k].h; } return n; } /** Docstring: readable pixels for slot idx, null when empty or wild. static unsigned char *wpix_ptr(struct wpix_store *s, int idx) { if (s == NULL || idx < 0 || idx >= WPIX_MAX_SLOTS) return NULL; if (s->slots[idx].p == NULL || s->slots[idx].w <= 0 || s->slots[idx].h <= 0) return NULL; return s->slots[idx].p; } /** Docstring: raw scratch for mailbox file reads, null below capacity.*
- `wpix_dst` (line 121) `static unsigned char *wpix_dst(struct wpix_store *s)` - *static unsigned char *wpix_ptr(struct wpix_store *s, int idx) { if (s == NULL || idx < 0 || idx >= WPIX_MAX_SLOTS) return NULL; if (s->slots[idx].p == NULL || s->slots[idx].w <= 0 || s->slots[idx].h <= 0) return NULL; return s->slots[idx].p; } /** Docstring: raw scratch for mailbox file reads, null below capacity. static unsigned char *wpix_raw(struct wpix_store *s) { if (s == NULL) return NULL; return s->tmp_raw; } /** Docstring: decode scratch for resampled cells, null below capacity.*
- `wpix_drop` (line 127) `static void wpix_drop(struct wpix_store *s, int idx)` - */** Docstring: raw scratch for mailbox file reads, null below capacity. static unsigned char *wpix_raw(struct wpix_store *s) { if (s == NULL) return NULL; return s->tmp_raw; } /** Docstring: decode scratch for resampled cells, null below capacity. static unsigned char *wpix_dst(struct wpix_store *s) { if (s == NULL) return NULL; return s->tmp_dst; } /** Docstring: drop slot pixels and release its memory to the budget.*
- `wpix_tmp` (line 136) `static int wpix_tmp(struct wpix_store *s, size_t need)` - *if (s == NULL) return NULL; return s->tmp_dst; } /** Docstring: drop slot pixels and release its memory to the budget. static void wpix_drop(struct wpix_store *s, int idx) { if (s == NULL || idx < 0 || idx >= WPIX_MAX_SLOTS) return; free(s->slots[idx].p); s->slots[idx].p = NULL; s->slots[idx].w = 0; s->slots[idx].h = 0; } /** Docstring: grow both scratch buffers to need bytes, old kept on failure.*
- `wpix_ensure` (line 153) `static int wpix_ensure(struct wpix_store *s, int idx, int w, int h)` - *if (s == NULL) return -1; if (need == 0 || need > (size_t)WPIX_SLOT_MAX) return -1; if (s->tmp_cap >= need) return 0; nr = (unsigned char *)realloc(s->tmp_raw, need); if (nr == NULL) return -1; s->tmp_raw = nr; nd = (unsigned char *)realloc(s->tmp_dst, need); if (nd == NULL) return -1; s->tmp_dst = nd; s->tmp_cap = need; return 0; } /** Docstring: size slot idx for w*h cells inside bounds and budget.*
- `wpix_commit` (line 175) `static int wpix_commit(struct wpix_store *s, int idx, const unsigned char *src, int w, int h)` - *if (s->slots[idx].p != NULL && s->slots[idx].w == w && s->slots[idx].h == h) return 0; if (s->slots[idx].p != NULL && s->slots[idx].w > 0 && s->slots[idx].h > 0) old = (size_t)s->slots[idx].w * (size_t)s->slots[idx].h; if (wpix_used(s) - old + cells > (size_t)WPIX_BUDGET_MAX) return -1; np = (unsigned char *)realloc(s->slots[idx].p, cells); if (np == NULL) return -1; s->slots[idx].p = np; s->slots[idx].w = w; s->slots[idx].h = h; return 0; } /** Docstring: copy cells into a matching slot, fail closed on mismatch.*

**Macros:**
- `MINIOS_WL_PIXBUF_H` (line 17) `#define MINIOS_WL_PIXBUF_H`
- `WPIX_MAX_SLOTS` (line 28) `#define WPIX_MAX_SLOTS`
- `WPIX_MAX_W` (line 32) `#define WPIX_MAX_W`
- `WPIX_MAX_H` (line 36) `#define WPIX_MAX_H`
- `WPIX_SLOT_MAX` (line 40) `#define WPIX_SLOT_MAX`
- `WPIX_BUDGET_MAX` (line 44) `#define WPIX_BUDGET_MAX`

**Structs:**
- `wpix_slot` (line 48) - *#ifndef WPIX_MAX_H #define WPIX_MAX_H WL_SURF_MAX_H #endif #ifndef WPIX_SLOT_MAX #define WPIX_SLOT_MAX WL_POOL_MAX #endif #ifndef WPIX_BUDGET_MAX #define WPIX_BUDGET_MAX (WL_MAX_SURFACES * WL_POOL_MAX) #endif /** Docstring: one slot cache, empty when p is null or w*h is zero.*
- `wpix_store` (line 55) - *#endif #ifndef WPIX_BUDGET_MAX #define WPIX_BUDGET_MAX (WL_MAX_SURFACES * WL_POOL_MAX) #endif /** Docstring: one slot cache, empty when p is null or w*h is zero. struct wpix_slot { unsigned char *p; int w; int h; }; /** Docstring: slot caches plus one reusable raw/decode scratch pair.*

#### `kernel.h`
**Path:** `tests/stubs/kernel.h`
**File Doc:** *Docstring: Host-test stand-in for headers/kernel.h (tests/stubs first on*

**Functions:**
- `observe` (line 8) `* the tests must observe (fed scancodes, queued bytes, registered devices)
 * is recorded in vari...`
- `__attribute__` (line 30) `static __attribute__((unused)) void kfree(void *p)` - *Docstring: Aligned blocks from kmalloc_aligned are not freed by the * host tests, so no base-pointer recovery is needed here.*
- `__attribute__` (line 34) `static __attribute__((unused)) void *kmalloc_aligned(unsigned long size, unsigned long align)`
- `__attribute__` (line 51) `static __attribute__((unused)) int kprintf(const char *fmt, ...)`
- `__attribute__` (line 60) `static __attribute__((unused)) int kmm_make_uncached(unsigned long phys, unsigned long len)`
- `__attribute__` (line 66) `static __attribute__((unused)) unsigned long kmm_map_device(unsigned long phys,
                 ...`
- `__attribute__` (line 74) `static __attribute__((unused)) unsigned long ktime_ms(void)`
- `__attribute__` (line 80) `static __attribute__((unused)) irqflags_t spin_save_irq(void)`
- `__attribute__` (line 84) `static __attribute__((unused)) void spin_restore_irq(irqflags_t flags)`

**Macros:**
- `TEST_STUB_KERNEL_H` (line 14) `#define TEST_STUB_KERNEL_H`
- `PCI_MMIO_SIZE` (line 22) `#define PCI_MMIO_SIZE`
- `kmemset` (line 48) `#define kmemset`
- `kmemcpy` (line 49) `#define kmemcpy`

**Type_Aliases:**
- `irqflags_t` (line 77) `typedef unsigned long irqflags_t;`

**Variables:**
- `stub_ms_now` (line 72) `extern unsigned long stub_ms_now;`

### LUA (1 files)

#### `test.lua`
**Path:** `progs/src/test.lua`

**Functions:**
- `check` (line 12)
- `write_file` (line 22)
- `read_file` (line 30)
- `test_module_bindings` (line 40)
- `test_filesystem` (line 53)
- `test_xxhash` (line 70)
- `test_stb` (line 75)
- `test_dlmalloc` (line 80)
- `test_hello` (line 85)
- `test_ftest` (line 90)
- `test_minigcc` (line 95)
- `test_ld` (line 100)
- `test_toolchain_roundtrip` (line 112)
- `test_spawn_preserves_interpreter` (line 122)
- `test_bin_cp` (line 135)
- `test_bin_lz4` (line 141)
- `test_bin_lzss` (line 158)
- `test_bin_aes` (line 175)
- `test_bin_json` (line 194)
- `test_bin_freedom` (line 205)

### PY (67 files)

#### `__init__.py`
**Path:** `mcp/__init__.py`

*No symbols extracted*

#### `mcp_dbg_driver.py`
**Path:** `mcp/mcp_dbg_driver.py`
**File Doc:** *Debug driver: boot MiniOS through the MCP bridge and run freedom.*

**Classes:**
- `Client` (line 15) `class Client`

**Functions:**
- `main` (line 64) `def main()`

**Methods:**
- `__init__` (line 16) `def __init__(self)`
- `request` (line 28) `def request(self, method, params)`
- `tool` (line 46) `def tool(self, name, params)`
- `close` (line 54) `def close(self)`

#### `mcp_dogfood.py`
**Path:** `mcp/mcp_dogfood.py`
**File Doc:** *Dogfood: drive minios_mcp.py over stdio JSON-RPC and install the freedom addon from a git repo, then browse with the installed binary.  Stdlib only. Usage: python3 mcp_dogfood.py <addons-dir>*

**Classes:**
- `Client` (line 19) `class Client`

**Functions:**
- `main` (line 78) `def main()`

**Methods:**
- `__init__` (line 20) `def __init__(self, addons_dir)`
- `request` (line 40) `def request(self, method, params)`
- `tool` (line 58) `def tool(self, name, params)`
- `close` (line 68) `def close(self)`

#### `minios_addons.py`
**Path:** `mcp/minios_addons.py`
**File Doc:** *MiniOS addon marketplace (lazyaddons-style).  Addons are YAML files that say where a program's source lives on GitHub and how it is built. Two flavors share one dialect:  - kind `guest` (default): built *inside* the OS. This module parses that YAML with a strict stdlib-only subset parser (no PyYAML) and installs the addon into a running MiniOS session: clone the repo, upload each source through the editor in bounded chunks, reassemble with `cat`, build and verify inside the OS. - kind `host`: built on the host with the ordinary gcc toolchain and packed into the image by `make` (every sibling checkout and every vendored tree). `minios_install` refuses these with a diagnostic that names the make target instead of half-installing them. - kind `reference`: source-only reference checkouts (never vendored, never linked, never built). Same refusal as `host`.  The host shell is never invoked; the only commands run are the addon's own build/verify lines, driven line by line through the MiniOS shell.*

**Classes:**
- `AddonError` (line 56) `class AddonError(Exception)` - *Expected marketplace failure, reported to the client as isError.*
- `AddonState` (line 377) `class AddonState` - *Host-side record of installed addons (system temp dir).*

**Functions:**
- `_clean` (line 62) `def _clean(s)`
- `_unquote` (line 66) `def _unquote(v)`
- `parse_addon_yaml` (line 73) `def parse_addon_yaml(text)` - *Parse the strict YAML subset. Returns the addon dict.

Grammar: flat `key: value` lines; `install:` opens an indented block
with `repo_url:`, an optional `kind:` (`guest` default, `host`,
`reference`), optional `dir_var:`/`ref:`/`artifact:` metadata, a
`files:` list of `- src:`/`dst:` pairs, and `build:` / `host_build:` /
`verify:` lists of `- ...` command lines (`verify` items may carry a
nested `exit_code:`). Everything else is a parse error with its line
number.*
- `validate_addon` (line 205) `def validate_addon(addon, source)` - *Check bounds and character sets. Raises AddonError.*
- `validate_addon_path` (line 295) `def validate_addon_path(path)` - *dst paths live on the ramdisk: relative, no '..', bounded charset.*
- `validate_shell_line` (line 309) `def validate_shell_line(line)` - *Build/verify lines are single printable-ASCII shell commands.*
- `load_addons_dir` (line 323) `def load_addons_dir(addons_dir)` - *Load every addon yaml; each entry is a dict or an error string.*
- `split_for_editor` (line 347) `def split_for_editor(text)` - *Split a source into editor-sized chunks. Raises AddonError.*
- `exit_code_of` (line 372) `def exit_code_of(text)`
- `install_addon` (line 401) `def install_addon(session, addon, cfg)` - *Install one validated addon into the booted MiniOS session.

Failure at any step raises AddonError; upload parts are removed and
nothing is recorded, so a half-installed package is never reported.*
- `fail` (line 85) `def fail(lineno, why)`

**Methods:**
- `__init__` (line 380) `def __init__(self, path)`
- `load` (line 383) `def load(self)`
- `save` (line 393) `def save(self, addons)`

#### `minios_mcp.py`
**Path:** `mcp/minios_mcp.py`
**File Doc:** *MiniOS MCP bridge.  Exposes a running MiniOS instance as tools over the MCP stdio protocol. The server boots os.img in QEMU, owns a pty-backed serial console, and lets a client write, compile, link and run software inside the OS.  Python 3 standard library only. One QEMU child per server, terminated on every exit path. The host shell is never invoked.*

**Classes:**
- `ToolError` (line 131) `class ToolError(Exception)` - *Expected tool failure, reported to the client as isError.*
- `RPCError` (line 137) `class RPCError(Exception)` - *JSON-RPC level failure carrying a standard error code.*
- `LogBuffer` (line 146) `class LogBuffer` - *Bounded console log with absolute byte positions and waits.*
- `MiniOSSession` (line 216) `class MiniOSSession` - *One QEMU child, one pty, one console log, one consume cursor.*
- `MCPServer` (line 731) `class MCPServer` - *JSON-RPC dispatch loop over stdio.*

**Functions:**
- `env_config` (line 71) `def env_config()` - *Resolve the configuration: defaults overridden by the environment.*
- `clamp_timeout` (line 89) `def clamp_timeout(ms)` - *Clamp a requested wait to the bounded timeout range.*
- `validate_path` (line 102) `def validate_path(name)` - *Reject file names the ramdisk or the shell would mishandle.*
- `validate_content` (line 118) `def validate_content(text)` - *Reject lines the kernel readline cannot carry (printable ASCII).*
- `subprocess_launch` (line 580) `def subprocess_launch(cfg, slave_fd)`
- `main` (line 888) `def main()`

**Methods:**
- `__init__` (line 140) `def __init__(self, code, message)`
- `__init__` (line 149) `def __init__(self, cap)`
- `append` (line 155) `def append(self, data)`
- `bytes_from` (line 163) `def bytes_from(self, pos)`
- `text_from` (line 168) `def text_from(self, pos, end)`
- `find` (line 175) `def find(self, marker, start)`
- `wait_for` (line 179) `def wait_for(self, marker, start, timeout_ms)` - *Block until marker appears at or after start; return position.*
- `wait_for_any` (line 192) `def wait_for_any(self, markers, start, timeout_ms)` - *Block until any of markers appears at or after start; return the
earliest position found, or -1 when the timeout expires first.*
- `_find_locked` (line 206) `def _find_locked(self, marker, start)`
- `__init__` (line 219) `def __init__(self, cfg)`
- `booted` (line 230) `def booted(self)`
- `status` (line 233) `def status(self)`
- `_reap_stale` (line 242) `def _reap_stale(self)`
- `_drop_pidfile` (line 278) `def _drop_pidfile(self)`
- `boot` (line 284) `def boot(self, timeout_ms)`
- `_read_loop` (line 319) `def _read_loop(self)`
- `_close_pty` (line 329) `def _close_pty(self)`
- `_write_line` (line 339) `def _write_line(self, line)`
- `_write_editor_line` (line 348) `def _write_editor_line(self, line)` - *Editor content lines may be empty (blank lines in the file).*
- `send` (line 356) `def send(self, line, timeout_ms)`
- `expect` (line 367) `def expect(self, marker, timeout_ms)`
- `snapshot` (line 381) `def snapshot(self, max_bytes)`
- `run_test` (line 391) `def run_test(self, commands, expect, refute, timeout_ms)` - *Run a generic scenario: send a list of shell commands, then assert
that each expected marker appears (and each refuted marker does not)
in the output those commands produced. Returns a verdict plus the
captured transcript. This is the reusable harness behind every in-OS
feature test, so a session never has to hand-roll a QEMU boot and
marker-assertion script.*
- `cat` (line 447) `def cat(self, path)`
- `run_python` (line 453) `def run_python(self, script, args, timeout_ms)` - *Run a MicroPython script (or `-c` code) inside MiniOS and return
its output, including the `exit code: N` line. MicroPython now runs
reliably thanks to the kernel fix that zeroes the initial registers
at the ELF entry (rdx is rtld_fini for glibc's _start).*
- `cat_body` (line 464) `def cat_body(self, path, missing_ok)` - *Read a ramdisk file and return exactly its bytes.

The serial console frames lines with carriage returns (CRLF, and a
CR before each new line while the terminal redraws); the kernel cat
appends one newline after the content. Content written through this
bridge is printable ASCII only, so every CR is framing: they are all
dropped first, then the echoed command line, the prompt and that
single trailing newline are stripped.*
- `_cleanup_parts` (line 493) `def _cleanup_parts(self, parts)`
- `write` (line 500) `def write(self, path, content)`
- `poweroff` (line 537) `def poweroff(self, timeout_ms)`
- `terminate` (line 557) `def terminate(self)`
- `close` (line 576) `def close(self)`
- `__init__` (line 734) `def __init__(self, cfg)`
- `run` (line 738) `def run(self)`
- `_handle` (line 746) `def _handle(self, line)`
- `_initialize` (line 772) `def _initialize(self, params)`
- `_call` (line 779) `def _call(self, params)`
- `_dispatch` (line 796) `def _dispatch(self, name, args)`
- `_addons_list` (line 842) `def _addons_list(self)`
- `_addon_install` (line 863) `def _addon_install(self, args)`
- `_reply` (line 884) `def _reply(self, msg)`

#### `test_minios_mcp.py`
**Path:** `mcp/test_minios_mcp.py`
**File Doc:** *Unit and BDD suite for the MiniOS MCP bridge.  Unit tests exercise protocol dispatch, input validation and buffer/cursor semantics without QEMU. BDD scenarios boot the real os.img and drive the edit/compile/link/run loop over JSON-RPC; they skip when QEMU or the image is absent.  Environment overrides: MINIOS_MCP (server path), MINIOS_IMAGE, QEMU, MINIOS_SKIP_BDD=1 forces the QEMU scenarios to skip.*

**Classes:**
- `MCPServer` (line 58) `class MCPServer` - *Child process running minios_mcp.py, driven over stdio JSON-RPC.*
- `TestProtocol` (line 141) `class TestProtocol(TestCase)`
- `TestValidation` (line 205) `class TestValidation(TestCase)`
- `TestLogBuffer` (line 254) `class TestLogBuffer(TestCase)`
- `_ConsoleBDDBase` (line 306) `class _ConsoleBDDBase(TestCase)` - *Fail-fast for QEMU-backed classes: once a tool call has hit a
console wait timeout the bridge is stuck (a mutated marker, a hung
shell) and every remaining test would only burn its own timeout, so
they are skipped instead.*
- `TestMiniOSBDD` (line 342) `class TestMiniOSBDD(_ConsoleBDDBase)`
- `TestAddonYaml` (line 480) `class TestAddonYaml(TestCase)`
- `TestAddonHelpers` (line 602) `class TestAddonHelpers(TestCase)`
- `FakeOS` (line 642) `class FakeOS` - *In-memory stand-in for the MiniOS session (no QEMU).*
- `TestAddonInstall` (line 708) `class TestAddonInstall(TestCase)`
- `TestAddonBDD` (line 844) `class TestAddonBDD(_ConsoleBDDBase)` - *Install a fixture addon from a local git repo into the real OS.*
- `_toolerror` (line 697) `class _toolerror(Exception)`

**Functions:**
- `load_module` (line 29) `def load_module()`
- `have_qemu` (line 52) `def have_qemu()`
- `guarded` (line 318) `def guarded(name, params)`
- `broken_cat` (line 786) `def broken_cat(path, missing_ok)`

**Methods:**
- `__init__` (line 61) `def __init__(self, env_extra)`
- `initialize` (line 80) `def initialize(self)`
- `request` (line 84) `def request(self, method, params)`
- `raw` (line 91) `def raw(self, line)`
- `_read_response` (line 96) `def _read_response(self)`
- `_roundtrip` (line 102) `def _roundtrip(self, msg)`
- `tool` (line 110) `def tool(self, name, params)`
- `close` (line 120) `def close(self)`
- `setUpClass` (line 143) `def setUpClass(cls)`
- `tearDownClass` (line 149) `def tearDownClass(cls)`
- `test_initialize` (line 152) `def test_initialize(self)`
- `test_tools_list` (line 158) `def test_tools_list(self)`
- `test_ping` (line 166) `def test_ping(self)`
- `test_unknown_method` (line 170) `def test_unknown_method(self)`
- `test_malformed_json` (line 174) `def test_malformed_json(self)`
- `test_unknown_tool` (line 178) `def test_unknown_tool(self)`
- `test_send_not_booted` (line 183) `def test_send_not_booted(self)`
- `test_send_empty_line_rejected` (line 189) `def test_send_empty_line_rejected(self)`
- `test_test_not_booted` (line 195) `def test_test_not_booted(self)`
- `setUpClass` (line 207) `def setUpClass(cls)`
- `test_path_accepts_plain_names` (line 212) `def test_path_accepts_plain_names(self)`
- `test_path_rejects_unsafe` (line 216) `def test_path_rejects_unsafe(self)`
- `test_path_rejects_long` (line 220) `def test_path_rejects_long(self)`
- `test_content_accepts_ascii` (line 223) `def test_content_accepts_ascii(self)`
- `test_content_rejects_non_printable` (line 226) `def test_content_rejects_non_printable(self)`
- `test_timeout_clamped` (line 230) `def test_timeout_clamped(self)`
- `test_write_rejects_line_too_long` (line 234) `def test_write_rejects_line_too_long(self)`
- `test_write_rejects_too_many_lines` (line 243) `def test_write_rejects_too_many_lines(self)`
- `setUpClass` (line 256) `def setUpClass(cls)`
- `test_bounds` (line 261) `def test_bounds(self)`
- `test_find_and_total` (line 268) `def test_find_and_total(self)`
- `test_cursor_prevents_stale_match` (line 275) `def test_cursor_prevents_stale_match(self)`
- `test_wait_for_any_earliest` (line 284) `def test_wait_for_any_earliest(self)`
- `test_cat_body_drops_console_framing` (line 292) `def test_cat_body_drops_console_framing(self)`
- `test_editor_prompt_forms_cover_kernel_markers` (line 298) `def test_editor_prompt_forms_cover_kernel_markers(self)`
- `guard_server` (line 315) `def guard_server(cls)`
- `setUp` (line 336) `def setUp(self)`
- `setUpClass` (line 344) `def setUpClass(cls)`
- `tearDownClass` (line 351) `def tearDownClass(cls)`
- `test_t01_boot` (line 355) `def test_t01_boot(self)`
- `test_t02_expect` (line 365) `def test_t02_expect(self)`
- `test_t03_write_and_cat` (line 372) `def test_t03_write_and_cat(self)`
- `test_t04_toolchain_elf` (line 382) `def test_t04_toolchain_elf(self)`
- `test_t05_toolchain_cvm` (line 394) `def test_t05_toolchain_cvm(self)`
- `test_t06_selfhosted_compiler` (line 404) `def test_t06_selfhosted_compiler(self)`
- `test_t07_bin_command_path` (line 411) `def test_t07_bin_command_path(self)`
- `test_t08_python_script` (line 419) `def test_t08_python_script(self)`
- `test_t09_py_eval` (line 426) `def test_t09_py_eval(self)`
- `test_t10_minios_test` (line 431) `def test_t10_minios_test(self)`
- `test_t11_poweroff_and_reboot` (line 452) `def test_t11_poweroff_and_reboot(self)`
- `setUpClass` (line 482) `def setUpClass(cls)`
- `test_parse_valid` (line 492) `def test_parse_valid(self)`
- `test_validate_accepts_valid` (line 502) `def test_validate_accepts_valid(self)`
- `test_unknown_key_rejected` (line 506) `def test_unknown_key_rejected(self)`
- `test_bad_indent_rejected` (line 510) `def test_bad_indent_rejected(self)`
- `test_validate_rejects_bad_dst` (line 514) `def test_validate_rejects_bad_dst(self)`
- `test_validate_rejects_missing_name` (line 519) `def test_validate_rejects_missing_name(self)`
- `test_validate_rejects_long_build_line` (line 523) `def test_validate_rejects_long_build_line(self)`
- `test_validate_rejects_control_chars` (line 531) `def test_validate_rejects_control_chars(self)`
- `test_validate_rejects_empty_files` (line 536) `def test_validate_rejects_empty_files(self)`
- `test_host_kind_accepts_empty_files` (line 541) `def test_host_kind_accepts_empty_files(self)`
- `test_reference_kind_carries_nothing` (line 556) `def test_reference_kind_carries_nothing(self)`
- `test_bad_kind_rejected` (line 564) `def test_bad_kind_rejected(self)`
- `test_host_kind_requires_artifact` (line 572) `def test_host_kind_requires_artifact(self)`
- `test_install_refuses_host_before_touching_session` (line 586) `def test_install_refuses_host_before_touching_session(self)`
- `setUpClass` (line 604) `def setUpClass(cls)`
- `test_split_for_editor_chunks` (line 614) `def test_split_for_editor_chunks(self)`
- `test_split_rejects_long_line` (line 621) `def test_split_rejects_long_line(self)`
- `test_split_rejects_non_ascii` (line 625) `def test_split_rejects_non_ascii(self)`
- `test_exit_code_of` (line 629) `def test_exit_code_of(self)`
- `test_state_roundtrip` (line 634) `def test_state_roundtrip(self)`
- `__init__` (line 645) `def __init__(self, exit_codes)`
- `booted` (line 652) `def booted(self)`
- `boot` (line 655) `def boot(self, timeout_ms)`
- `write` (line 659) `def write(self, path, content)`
- `send` (line 666) `def send(self, line, timeout_ms)`
- `cat_body` (line 690) `def cat_body(self, path, missing_ok)`
- `_cleanup_parts` (line 702) `def _cleanup_parts(self, parts)`
- `setUpClass` (line 710) `def setUpClass(cls)`
- `tearDownClass` (line 742) `def tearDownClass(cls)`
- `make_addon` (line 747) `def make_addon(self)`
- `test_install_success` (line 769) `def test_install_success(self)`
- `test_install_mismatch_aborts_and_cleans` (line 782) `def test_install_mismatch_aborts_and_cleans(self)`
- `test_install_multi_chunk_reassembly` (line 796) `def test_install_multi_chunk_reassembly(self)`
- `test_install_verify_failure_aborts` (line 828) `def test_install_verify_failure_aborts(self)`
- `test_install_build_failure_aborts` (line 835) `def test_install_build_failure_aborts(self)`
- `setUpClass` (line 848) `def setUpClass(cls)`
- `tearDownClass` (line 886) `def tearDownClass(cls)`
- `test_addons_list` (line 894) `def test_addons_list(self)`
- `test_install_fixture` (line 900) `def test_install_fixture(self)`
- `test_install_unknown_addon_fails` (line 909) `def test_install_unknown_addon_fails(self)`

#### `__init__.py`
**Path:** `progs/micropython/variants/minios/lib/__init__.py`
**File Doc:** *MiniOS frozen library package.*

*No symbols extracted*

#### `hello.py`
**Path:** `progs/micropython/variants/minios/lib/hello.py`
**File Doc:** *hello.py -- frozen demo: runs at import time as a smoke test.*

*No symbols extracted*

#### `mip.py`
**Path:** `progs/micropython/variants/minios/lib/mip.py`
**File Doc:** *mip.py -- MiniOS package installer (frozen module).  Minimal pip for the MiniOS MicroPython port: fetches one .py module over HTTP (or HTTPS through the ring-3 TLS engine) and installs it into a directory on sys.path. Frozen with the port (lib/manifest freeze), so it is always importable.  Policy, fail closed:  - http and https only. Inside MiniOS, https runs `bin/tlsget` (the userspace TLS stack with pinned roots) through SYS_SPAWN and reads the captured response; on host CPython https raises OSError (no minios module), so host tests cover the http and refusal paths. - one module per URL and the file name must be a bare identifier plus .py ([A-Za-z_][A-Za-z0-9_]*), so a hostile server cannot write outside dest (no traversal, subdirectories, percent escapes or dots). - the download is written to <dest>/<name>.py.part and renamed on success: a failed fetch never leaves a half module on sys.path. - HTTP/1.0 + Connection: close; chunked responses and mismatched Content-Length are refused; MAX_BODY caps the download. - a successful install appends dest to sys.path so the module imports in the same session.  Usage inside MiniOS::  import mip mip.install('http://host:8899/pkg.py')          # into ./lib mip.install('https://host/pkg.py', 'mylib')     # TLS through tlsget micropython -c "import mip; raise SystemExit(mip.main())" install <url>*

**Functions:**
- `parse_url` (line 49) `def parse_url(url)` - *Split an http/https URL into (scheme, host, port, path).

Raises ValueError for any other scheme, a missing or malformed
authority, a port outside 1..65535, or control characters in the
host or path (request-line injection).*
- `_split_authority_path` (line 67) `def _split_authority_path(url, rest, default_port)` - *Parse host[:port][/path] after the scheme prefix.*
- `split_url` (line 98) `def split_url(url)` - *Split an http URL into (host, port, path); https is refused here.*
- `split_https_url` (line 106) `def split_https_url(url)` - *Split an https URL into (host, port, path); http is refused here.*
- `module_name` (line 114) `def module_name(url)` - *Return the .py file name a URL installs, validating it is bare.

The last path segment (query and fragment dropped) must be
[A-Za-z_][A-Za-z0-9_]*.py and no path segment may be "." or "..";
anything else raises ValueError so a hostile URL cannot escape the
destination directory.*
- `_is_module_stem` (line 136) `def _is_module_stem(stem)` - *True when stem is an ASCII MicroPython module identifier.*
- `parse_response` (line 150) `def parse_response(data)` - *Split one HTTP/1.x response into (status, headers, body).

Headers are lowercased keys with stripped values. Fails closed:
a missing terminator, malformed status line or header, a chunked
transfer-encoding, or a Content-Length that disagrees with the body
all raise ValueError.*
- `_status_code` (line 191) `def _status_code(line)` - *Extract the numeric status from an HTTP status line.*
- `absolute_url` (line 202) `def absolute_url(base, location)` - *Resolve a redirect Location against base; http and https survive.

Absolute locations pass through unchanged (re-validated by the
caller's next parse_url), path-absolute locations keep base's scheme
and authority; truly relative locations raise ValueError.*
- `http_get` (line 222) `def http_get(host, port, path)` - *Fetch http://host:port/path, returning the raw response bytes.

One HTTP/1.0 request with Connection: close, read to EOF over a
timed socket; the response is capped at MAX_BODY + MAX_HEAD_BYTES.*
- `_unlink_quiet` (line 268) `def _unlink_quiet(path)` - *Best-effort remove; the following call reports the real error.*
- `ensure_dir` (line 276) `def ensure_dir(path)` - *Create path and its parents; existing directories are fine.

The final write reports real errors, so a mkdir refusal here is not
fatal (the directory may already exist).*
- `https_get` (line 298) `def https_get(host, port, path)` - *Fetch https://host:port/path through the ring-3 TLS engine.

Spawns bin/tlsget (the userspace TLS stack with pinned roots, the
same engine freedom uses) through the minios module's SYS_SPAWN and
reads the response from the capture file. -q keeps tlsget's success
diagnostic out of the capture, so the file holds exactly the raw
HTTP response. This is MiniOS-only: on host CPython there is no
minios module and OSError says so.*
- `install` (line 336) `def install(url, dest)` - *Fetch url and write it as <dest>/<module>.py; returns the path.

Follows up to MAX_REDIRECTS redirects across http and https;
refuses non-200 answers, unsafe module names and chunked responses.
The file appears atomically (write to .part, then rename) and dest
joins sys.path so the module imports in the same session.*
- `main` (line 394) `def main(argv)` - *CLI entry point: install <url> [dest]; returns the exit code.

MicroPython's -c puts the code first in sys.argv and every argument
after it next, so the shell form is::

    micropython -c "import mip; raise SystemExit(mip.main())" install <url> [dest]*

#### `manifest.py`
**Path:** `progs/micropython/variants/minios/manifest.py`
**File Doc:** *manifest.py -- frozen modules for the MiniOS MicroPython variant. Scripts listed here are compiled to .mpy by mpy-cross and embedded in the firmware binary, so they are available as frozen imports without touching the filesystem.*

*No symbols extracted*

#### `hello.py`
**Path:** `progs/src/hello.py`

*No symbols extracted*

#### `shell.py`
**Path:** `progs/src/shell.py`
**File Doc:** *shell.py -- pybash: a Python shell layer on top of MiniOS's C shell.  The C shell is untouched. This is an additional capability layer that gives MiniOS pipelines, variables and control flow in Python, so new behaviour no longer requires recompiling kernel.c. The core primitive is minios.run(), which invokes any ramdisk program through SYS_SPAWN while preserving the interpreter, and minios.run(..., redirect=file) to capture a program's console output for composition.  Usage (inside MiniOS): micropython src/shell.py*

**Functions:**
- `run_capture` (line 20) `def run_capture(cmd, args)`
- `expand` (line 30) `def expand(line, env)`
- `main` (line 36) `def main()`

#### `test.py`
**Path:** `progs/src/test.py`
**File Doc:** *test.py -- in-OS test suite for MiniOS, driven by MicroPython.  Tests every available binary sorted by size (smallest first). Graphical programs excluded: DOOM, Quake2, Nuklear, Piano, TopoGPT.  Usage (inside MiniOS): micropython src/test.py*

**Functions:**
- `check` (line 15) `def check(name, cond, detail)`
- `safe_run` (line 25) `def safe_run()`
- `test_module_bindings` (line 38) `def test_module_bindings()`
- `test_filesystem` (line 56) `def test_filesystem()`
- `test_xxhash` (line 72) `def test_xxhash()`
- `test_stb` (line 77) `def test_stb()`
- `test_dlmalloc` (line 82) `def test_dlmalloc()`
- `test_hello` (line 87) `def test_hello()`
- `test_ftest` (line 92) `def test_ftest()`
- `test_minigcc` (line 97) `def test_minigcc()`
- `test_ld` (line 102) `def test_ld()`
- `test_toolchain_roundtrip` (line 119) `def test_toolchain_roundtrip()`
- `test_spawn_preserves_interpreter` (line 134) `def test_spawn_preserves_interpreter()`
- `test_bin_cp` (line 148) `def test_bin_cp()`
- `test_bin_lz4` (line 153) `def test_bin_lz4()`
- `test_bin_lzss` (line 181) `def test_bin_lzss()`
- `test_bin_aes` (line 209) `def test_bin_aes()`
- `test_bin_json` (line 239) `def test_bin_json()`
- `test_bin_freedom` (line 253) `def test_bin_freedom()`
- `main` (line 261) `def main()`

#### `test_py.py`
**Path:** `progs/src/test_py.py`
**File Doc:** *test_py.py -- in-OS Python checks for src/test_all.sh (docs/spec/python.md).  Every check prints a PASS: or FAIL: marker the host runner greps. Runs from the ramdisk with the frozen mip module and the socket-enabled MicroPython build; no network is touched (mip vectors are the offline refusals; the live install is tests/test_mip.py on the host).*

**Functions:**
- `check` (line 12) `def check(name, cond)`
- `_asyncio_double` (line 79) `def _asyncio_double(n, ms)`
- `_asyncio_main` (line 84) `def _asyncio_main()`
- `_asyncio_wire_check` (line 88) `def _asyncio_wire_check(host, port)`
- `_one` (line 89) `def _one()`

#### `test_doom_pwad.py`
**Path:** `tests/test_doom_pwad.py`
**File Doc:** *test_doom_pwad.py - host contract suite for tools/doom_pwad.py.  Runs the grid compiler and the PWAD checker against fixed vectors: a known room builds to a pinned byte layout, the output passes the checker, and every malformed input or mutated file is refused with a diagnostic instead of a partial artifact.*

**Classes:**
- `GridValidationTests` (line 29) `class GridValidationTests(TestCase)` - *Grid parsing refuses malformed rooms before any byte is emitted.*
- `PwadLayoutTests` (line 82) `class PwadLayoutTests(TestCase)` - *The emitted PWAD keeps the vanilla lump contract byte-exact.*
- `PwadMutationTests` (line 181) `class PwadMutationTests(TestCase)` - *Single-byte and structural mutations of a good file all fail.*
- `ExtendedLegendTests` (line 255) `class ExtendedLegendTests(TestCase)` - *Every palette letter compiles to its engine thing id.*
- `MultiSectorTests` (line 317) `class MultiSectorTests(TestCase)` - *Doors, dark rooms and nukage pits compile to real sectors.*
- `MultiSectorMutationTests` (line 388) `class MultiSectorMutationTests(TestCase)` - *Broken tags, specials and sidedef pairs fail closed.*

**Functions:**
- `lump_blob` (line 310) `def lump_blob(blob, idx)` - *Slice one lump payload out of a built image by directory order.*

**Methods:**
- `test_valid_room_parses` (line 32) `def test_valid_room_parses(self)` - *A closed room with player and exit parses to five rows.*
- `test_ragged_rows_refused` (line 36) `def test_ragged_rows_refused(self)` - *Rows of uneven length are rejected, never padded silently.*
- `test_missing_player_refused` (line 41) `def test_missing_player_refused(self)` - *A room without a player start cannot build.*
- `test_missing_exit_refused` (line 46) `def test_missing_exit_refused(self)` - *A room without an exit marker cannot build.*
- `test_illegal_char_refused` (line 51) `def test_illegal_char_refused(self)` - *Characters outside the legend are rejected outright.*
- `test_unreachable_exit_refused` (line 56) `def test_unreachable_exit_refused(self)` - *An exit sealed behind walls is refused instead of unplayable.*
- `test_exit_needs_wall` (line 66) `def test_exit_needs_wall(self)` - *An exit marker floating mid-floor has no switch edge to mark.*
- `test_roundtrip_check` (line 85) `def test_roundtrip_check(self)` - *A built room passes the checker with a sane lump census.*
- `test_header_pin` (line 96) `def test_header_pin(self)` - *Magic, lump count and label lump stay pinned for the fixture.*
- `test_lump_order_pin` (line 103) `def test_lump_order_pin(self)` - *Lumps follow the ML_LABEL..ML_BLOCKMAP order the engine walks.*
- `test_things_pin` (line 115) `def test_things_pin(self)` - *Player and exit-adjacent layout land on expected coordinates.*
- `test_exit_switch_pin` (line 129) `def test_exit_switch_pin(self)` - *Exactly one linedef carries the exit special after a build.*
- `test_exit_on_every_side` (line 141) `def test_exit_on_every_side(self)` - *An exit against any of the four walls builds a closed room.*
- `test_pillar_room_stays_closed` (line 154) `def test_pillar_room_stays_closed(self)` - *Interior wall blocks add loops without opening the boundary.*
- `test_open_boundary_dies` (line 168) `def test_open_boundary_dies(self)` - *Retargeting one endpoint unbalances two vertexes, refused.*
- `setUp` (line 184) `def setUp(self)` - *Build one known-good image shared by every mutation case.*
- `test_bad_magic_dies` (line 188) `def test_bad_magic_dies(self)` - *An IWAD magic on a custom file is refused, never trusted.*
- `test_truncated_file_dies` (line 193) `def test_truncated_file_dies(self)` - *A file cut mid-directory is refused instead of half-parsed.*
- `test_swapped_lumps_die` (line 198) `def test_swapped_lumps_die(self)` - *Swapping two directory names breaks the order contract.*
- `test_partial_record_dies` (line 212) `def test_partial_record_dies(self)` - *A THINGS lump with a torn record is refused, never rounded.*
- `test_wild_vertex_dies` (line 221) `def test_wild_vertex_dies(self)` - *A linedef pointing past the vertex list is refused.*
- `test_missing_exit_dies` (line 230) `def test_missing_exit_dies(self)` - *Clearing the exit special leaves a file with no way out.*
- `test_unterminated_blockmap_dies` (line 243) `def test_unterminated_blockmap_dies(self)` - *A blockmap list without a terminator is refused, never scanned.*
- `test_every_legend_char_builds` (line 273) `def test_every_legend_char_builds(self)` - *A room holding the whole palette passes the checker.*
- `test_every_thing_id_matches_engine` (line 278) `def test_every_thing_id_matches_engine(self)` - *Each letter lands on the doomednum the engine spawns.*
- `test_door_room_builds_two_sectors` (line 320) `def test_door_room_builds_two_sectors(self)` - *A door cell splits one room into two sectors with a tag.*
- `test_door_lines_are_tagged_openers` (line 327) `def test_door_lines_are_tagged_openers(self)` - *Both door faces carry D1 open with the door sector tag.*
- `test_dark_and_nukage_sector_props` (line 355) `def test_dark_and_nukage_sector_props(self)` - *Dark rooms dim the light, nukage drops the floor and stings.*
- `test_reject_scales_with_sector_count` (line 374) `def test_reject_scales_with_sector_count(self)` - *REJECT holds exactly the bit table for the sector count.*
- `test_new_legend_chars_build` (line 382) `def test_new_legend_chars_build(self)` - *Door, dark and nukage tiles pass the checker in one room.*
- `setUp` (line 391) `def setUp(self)` - *Build one known-good door image shared by every case.*
- `mutate_line` (line 395) `def mutate_line(self, idx, field, value)` - *Return the good image with one linedef field replaced.*
- `door_line` (line 406) `def door_line(self)` - *Index of the first D1 door line in the fixture image.*
- `test_door_tag_zero_dies` (line 418) `def test_door_tag_zero_dies(self)` - *A door opener without a tag is refused, never miswired.*
- `test_unknown_special_dies` (line 423) `def test_unknown_special_dies(self)` - *A linedef special the writer never emits is refused.*
- `test_onesided_with_back_dies` (line 428) `def test_onesided_with_back_dies(self)` - *A one-sided line smuggling a back sidedef is refused.*
- `test_exit_tagged_dies` (line 433) `def test_exit_tagged_dies(self)` - *The exit switch must stay untagged like the writer emits it.*

#### `test_minifs_tools.py`
**Path:** `tests/test_minifs_tools.py`
**File Doc:** *Host suite for the MiniFS image tools (docs/spec/shell-fs.md).  tools/mkfs.minifs.py builds the MiniFS image the kernel mounts and tools/minifs_fsck.py gates it in the build. These cases pin the two contracts the kernel cannot see at boot:  - the superblock free counters equal the bitmaps, and fsck rejects an image whose counters drift; - same-named directories from several roots merge into one, and any other duplicate name is a build error.  Usage: python3 tests/test_minifs_tools.py -v*

**Classes:**
- `Config` (line 23) `class Config` - *Every tunable of the suite in one place.*
- `MiniFSToolsTest` (line 40) `class MiniFSToolsTest(TestCase)` - *mkfs.minifs.py and minifs_fsck.py agree on a consistent image.*

**Functions:**
- `run` (line 35) `def run(args)` - *Run a tool under the current interpreter; returns the process.*

**Methods:**
- `setUp` (line 43) `def setUp(self)`
- `tearDown` (line 47) `def tearDown(self)`
- `tree` (line 50) `def tree(self, root, rel, data)` - *Create file root/rel holding data and return the root path.*
- `mkfs` (line 58) `def mkfs(self)` - *Build an image from paths; returns (process, image path).*
- `superblock_word` (line 64) `def superblock_word(self, image, off)`
- `test_counters_match_bitmaps` (line 69) `def test_counters_match_bitmaps(self)`
- `test_fsck_rejects_drifted_counters` (line 79) `def test_fsck_rejects_drifted_counters(self)`
- `test_same_named_directories_merge` (line 93) `def test_same_named_directories_merge(self)`
- `test_duplicate_file_is_an_error` (line 107) `def test_duplicate_file_is_an_error(self)`

#### `test_mip.py`
**Path:** `tests/test_mip.py`
**File Doc:** *test_mip.py -- host test for the frozen MicroPython installer (make test-mip).  Two layers:  1. Pure vectors: URL split, module-name validation, HTTP response parsing, redirect resolution and the write path, all loaded straight from progs/micropython/variants/minios/lib/mip.py under CPython (the module imports nothing at top level that the host lacks).  2. Live install: drives progs/bin/micropython.elf (a static Linux ELF, same artifact MiniOS runs) against a local http.server and asserts real files land on disk for plain fetch, redirect and the CLI, while https, chunked responses and traversal names are refused. Skipped until the ELF is rebuilt with MICROPY_PY_SOCKET=1.*

**Classes:**
- `MipPureTests` (line 44) `class MipPureTests(TestCase)` - *Vectors for the pure helpers; no sockets, no subprocesses.*
- `_Handler` (line 212) `class _Handler(BaseHTTPRequestHandler)` - *Serve HELLO script plus redirect, chunked and 404 responses.*
- `MipLiveTests` (line 242) `class MipLiveTests(TestCase)` - *Install for real through the static MicroPython ELF on localhost.*

**Functions:**
- `load_mip` (line 36) `def load_mip()` - *Import lib/mip.py as a standalone module under CPython.*

**Methods:**
- `setUpClass` (line 48) `def setUpClass(cls)`
- `test_split_url_default_port` (line 51) `def test_split_url_default_port(self)`
- `test_split_url_explicit_port_and_query` (line 57) `def test_split_url_explicit_port_and_query(self)`
- `test_split_url_path_defaults_to_root` (line 63) `def test_split_url_path_defaults_to_root(self)`
- `test_split_url_refuses_https` (line 66) `def test_split_url_refuses_https(self)`
- `test_split_https_url_default_port` (line 70) `def test_split_https_url_default_port(self)`
- `test_split_https_url_explicit_port` (line 76) `def test_split_https_url_explicit_port(self)`
- `test_split_https_url_refuses_plain_http` (line 82) `def test_split_https_url_refuses_plain_http(self)`
- `test_parse_url_reports_scheme` (line 86) `def test_parse_url_reports_scheme(self)`
- `test_split_url_refuses_other_schemes` (line 96) `def test_split_url_refuses_other_schemes(self)`
- `test_split_url_refuses_bad_authority` (line 101) `def test_split_url_refuses_bad_authority(self)`
- `test_split_url_refuses_control_chars` (line 107) `def test_split_url_refuses_control_chars(self)`
- `test_module_name_accepts_plain_module` (line 112) `def test_module_name_accepts_plain_module(self)`
- `test_module_name_strips_query` (line 116) `def test_module_name_strips_query(self)`
- `test_module_name_refuses_unsafe_names` (line 119) `def test_module_name_refuses_unsafe_names(self)`
- `test_parse_response_crlf` (line 135) `def test_parse_response_crlf(self)`
- `test_parse_response_bare_lf` (line 144) `def test_parse_response_bare_lf(self)`
- `test_parse_response_rejects_garbage` (line 151) `def test_parse_response_rejects_garbage(self)`
- `test_parse_response_rejects_content_length_mismatch` (line 157) `def test_parse_response_rejects_content_length_mismatch(self)`
- `test_parse_response_refuses_chunked` (line 167) `def test_parse_response_refuses_chunked(self)`
- `test_https_get_needs_minios_on_host` (line 173) `def test_https_get_needs_minios_on_host(self)`
- `test_absolute_url_resolves_path_location` (line 177) `def test_absolute_url_resolves_path_location(self)`
- `test_absolute_url_keeps_absolute_location` (line 187) `def test_absolute_url_keeps_absolute_location(self)`
- `test_absolute_url_keeps_base_scheme` (line 197) `def test_absolute_url_keeps_base_scheme(self)`
- `test_absolute_url_refuses_relative_location` (line 207) `def test_absolute_url_refuses_relative_location(self)`
- `log_message` (line 217) `def log_message(self, fmt)`
- `do_GET` (line 220) `def do_GET(self)`
- `setUpClass` (line 246) `def setUpClass(cls)`
- `tearDownClass` (line 261) `def tearDownClass(cls)`
- `setUp` (line 266) `def setUp(self)`
- `run_in_elf` (line 270) `def run_in_elf(self, code)`
- `combined` (line 277) `def combined(self, proc)`
- `test_install_plain_and_load` (line 280) `def test_install_plain_and_load(self)`
- `test_install_follows_redirect` (line 290) `def test_install_follows_redirect(self)`
- `test_install_404_fails` (line 300) `def test_install_404_fails(self)`
- `test_install_https_needs_minios` (line 308) `def test_install_https_needs_minios(self)`
- `test_install_refuses_chunked` (line 319) `def test_install_refuses_chunked(self)`
- `test_install_refuses_traversal_name` (line 327) `def test_install_refuses_traversal_name(self)`
- `test_install_twice_succeeds` (line 334) `def test_install_twice_succeeds(self)`
- `test_cli_install` (line 344) `def test_cli_install(self)`

#### `boot_wl.py`
**Path:** `tools/boot_wl.py`
**File Doc:** *boot_wl.py - boot the miniOS Wayland-mini desktop in one step.  Builds nothing; `make wl` owns the build. Boots os.img, waits for the shell prompt over a pty serial console, types the desktop setup (mailbox clean, mirror flag, three real app frames via their selftests run strictly sequentially, one terminal-pattern client, server in background) with paced bytes and an echo backstop, then either proxies the user terminal to the guest for interactive use or, with WL_HEADLESS=1, screendumps the framebuffer over QMP, powers off and reports the shot path. Setup steps never overlap: each program runs alone and the harness waits for the shell prompt before the next starts, which is the reliable configuration while concurrent heavyweights are under diagnosis (see the honest-limits note in CLAUDE.md).  Usage: python3 tools/boot_wl.py WL_HEADLESS=1 WL_SHOT=/tmp/wl.png python3 tools/boot_wl.py  Every tunable lives in WlBootConfig; no host assumption beyond the QEMU binary name, which WL_QEMU overrides. Failure paths report and release the child; a stuck prompt fails after WL_BOOT_TIMEOUT instead of hanging the make run.*

**Classes:**
- `WlBootConfig` (line 40) `class WlBootConfig`
- `WlBoot` (line 67) `class WlBoot`

**Functions:**
- `main` (line 226) `def main()`

**Methods:**
- `__init__` (line 68) `def __init__(self, cfg)`
- `fail` (line 75) `def fail(self, msg)`
- `close` (line 80) `def close(self)`
- `boot` (line 91) `def boot(self)`
- `snapshot` (line 107) `def snapshot(self, timeout)`
- `wait_prompt` (line 124) `def wait_prompt(self)`
- `send` (line 135) `def send(self, line)`
- `send_wait` (line 142) `def send_wait(self, line, timeout)`
- `setup` (line 154) `def setup(self)`
- `qmp` (line 165) `def qmp(self, obj)`
- `headless` (line 182) `def headless(self)`
- `proxy` (line 195) `def proxy(self)`

#### `check_abi_numbers.py`
**Path:** `tools/check_abi_numbers.py`
**File Doc:** *check_abi_numbers.py -- MiniOS syscall numbers vs Linux x86-64 truth.  Phase 0.6 of the FreeDom readiness plan: a browser is the first program that depends on syscalls telling the truth, and several MiniOS numbers drifted from the Linux table (the class that bit us at [74] = flock while Linux x86-64 74 = fsync, 73 = flock). A static host-compiled ELF traps the Linux number and gets whatever MiniOS registered there.  Ground truth is Linux arch/x86/entry/syscalls/syscall_64.tbl (x86-64 common range), frozen here so the gate needs no kernel headers. Two checks, both fail-closed (exit 1) on undocumented drift:  Rule A -- compat claims in progs/minios_abi.h: a MINIOS_SYS_FOO whose normalized name exists in the Linux table and whose value is < 200 must equal the Linux number exactly. Rule B -- MiniOS-wins shadows: a MiniOS number that collides with a *different* Linux syscall must be listed in DEVIATIONS with the ADR that justifies it (fix or documented deviation, never silence). Rule C -- dispatch site in kernel/syscalls.c: every `[N] = { fn, "name" }` entry of linux_syscall_table and every `case N:` fall-through in ksyscall_dispatch must resolve N to the Linux number for "name". Rule D -- MiniOS-internal collisions: two MINIOS_SYS_* names must never share a number. The dispatch table is indexed by number, so a second name silently overwrites the first (lz4_decompress vs pcm2_close both claimed 248 and only the last entry survived). Rule E -- toolchain stubs: the sibling `ld` links every miniGCC program with a built-in libc whose MiniOS stubs hardcode syscall numbers. A stale stub number sends the program to the wrong handler, so every*

**Functions:**
- `normalize` (line 142) `def normalize(minios_name)`
- `parse_abi` (line 146) `def parse_abi(path)`
- `parse_ld_stubs` (line 157) `def parse_ld_stubs(path)` - *Read the sibling ld's built-in libc stubs: symbol -> syscall number.*
- `parse_dispatch` (line 164) `def parse_dispatch(path)`
- `main` (line 177) `def main()`

#### `check_addons.py`
**Path:** `tools/check_addons.py`
**File Doc:** *check_addons.py -- validate the MiniOS addon marketplace index.  Loads every addons/*.yaml through the strict stdlib-only parser in mcp/minios_addons.py (no PyYAML) and reports each addon's kind. Any unparseable file, failed validation or installer refusal for a guest addon fails closed with a diagnostic and a nonzero exit, so the index can never drift from the dialect the MCP server speaks.  Usage: python3 tools/check_addons.py [--addons-dir DIR]  Exit status: 0 when every file validates, 1 otherwise.*

**Functions:**
- `load_parser` (line 22) `def load_parser()`
- `main` (line 31) `def main()`

#### `check_cohesion.py`
**Path:** `tools/check_cohesion.py`
**File Doc:** *check_cohesion.py -- Architectural cohesion gate for MiniOS CI.  Parses the CPG JSON-LD output from readmenator and fails the build if any root community's cohesion drops below the configured threshold.  Usage: python3 tools/check_cohesion.py [cpg.jsonld] [--threshold 0.25]  Exit codes: 0 -- all communities above threshold 1 -- cohesion regression detected 2 -- input file missing or malformed*

**Functions:**
- `load_cpg` (line 23) `def load_cpg(path)` - *Load and parse the CPG JSON-LD file.*
- `compute_cohesion` (line 31) `def compute_cohesion(community_nodes, community_edges)` - *Compute cohesion as internal_edges / max_possible_edges.*
- `extract_communities` (line 42) `def extract_communities(cpg)` - *Extract communities and their internal edges from CPG.*
- `main` (line 58) `def main()`

#### `check_complexity.py`
**Path:** `tools/check_complexity.py`
**File Doc:** *check_complexity.py -- Kernel complexity gate for MiniOS CI.  Validates that kernel.c does not exceed the configured symbol count threshold without explicit approval in ARCH_POLICY.yaml.  Usage: python3 tools/check_complexity.py [--threshold 350] [--policy ARCH_POLICY.yaml]  Exit codes: 0 -- within threshold or explicitly approved 1 -- complexity exceeded without approval 2 -- input files missing*

**Functions:**
- `count_symbols` (line 24) `def count_symbols(filepath)` - *Count top-level function and global variable definitions.*
- `load_approval` (line 46) `def load_approval(policy_path)` - *Load explicit complexity approval from ARCH_POLICY.yaml.*
- `main` (line 61) `def main()`

#### `check_fork_stubs.py`
**Path:** `tools/check_fork_stubs.py`
**File Doc:** *Fail-closed stub gate for unimplemented process syscalls.  vfork has no implementation in this kernel. A stub that answers success lets userland believe a child exists when none does, so it must answer Linux ENOSYS. execve used to be in this set; it is implemented now (do_execve in kernel/sched.c, fork+exec proven by the execho BDD scenario), so the gate no longer scans it: a stub regression there fails the execho scenario instead of this gate. fork() is implemented (do_fork with copy-on-write pages, kernel/sched.c) and is checked by the fork BDD scenario instead. The check scans the handler definitions and fails on any success return.*

**Classes:**
- `Config` (line 18) `class Config` - *Centralized tunable values for the stub gate.*

**Functions:**
- `handler_body` (line 27) `def handler_body(text, name)` - *Return the body of the named handler or empty string when absent.*
- `check_stubs` (line 37) `def check_stubs(text, cfg)` - *Collect failure strings for stubs that do not fail closed.*
- `main` (line 52) `def main()` - *Entry point used by lint and CI.*

#### `check_kb_sync.py`
**Path:** `tools/check_kb_sync.py`
**File Doc:** *check_kb_sync.py -- Verify KNOWLEDGE_BASE.md is in sync with code.  Runs readmenator to regenerate the knowledge base, then checks if the output differs from the committed version.  Used in CI to prevent drift.  Usage: python3 tools/check_kb_sync.py [--kb KNOWLEDGE_BASE.md] [--regenerate]  Exit codes: 0 -- KB is in sync 1 -- KB is out of sync 2 -- readmenator not available*

**Functions:**
- `regenerate_kb` (line 24) `def regenerate_kb()` - *Attempt to regenerate KNOWLEDGE_BASE.md using readmenator.*
- `main` (line 43) `def main()`

#### `check_mutant_anchors.py`
**Path:** `tools/check_mutant_anchors.py`
**File Doc:** *Verify every mutate.sh mutant anchor matches its target file.  A mutant whose sed expression matches nothing is reported BROKEN by mutate.sh instead of killed, so a stale anchor silently weakens the mutation gate. Ground truth is sed itself: each expression is applied to a scratch copy of its target and a no-change result is breakage.  Usage: python3 tools/check_mutant_anchors.py*

**Classes:**
- `Config` (line 17) `class Config` - *Central configuration for the anchor check.*

**Functions:**
- `bash_unquote` (line 26) `def bash_unquote(expr)` - *Collapse the escapes bash applies inside the MUTATIONS string.*
- `unescaped_quote` (line 41) `def unescaped_quote(expr)` - *True when expr holds a double quote bash would not keep.

The table is one double-quoted bash string: a bare " closes it, so sed
receives the expression with that quote stripped and matches nothing at
run time even though the raw text matches here.*
- `parse_mutations` (line 58) `def parse_mutations(text)` - *Extract (name, expression, target) triples from the MUTATIONS block.

Bounds derive from the block markers, never from line numbers, so
adding a mutant cannot silently push rows out of the checked range.*
- `anchor_matches` (line 84) `def anchor_matches(repo, target, expr)` - *Apply the sed expression to a scratch copy; True when it changes it.*
- `main` (line 105) `def main()` - *Entry point: report anchors that change nothing and exit nonzero.*

#### `check_spin_discipline.py`
**Path:** `tools/check_spin_discipline.py`
**File Doc:** *Check spinlock call-site discipline across kernel C sources.  Rules, derived from the headers/spinlock.h contract: S1  No orphaned acquire or release: a function using spin_lock must reach a spin_unlock on some path (and vice versa); same for the irqsave/irqrestore pair. Early-return style (one acquire, many releases) is idiomatic here, so exact counts are not enforced. Functions using spin_trylock follow the conditional-unlock idiom and are exempt from pairing. S2  No plain spin_lock inside interrupt context: isr_dispatch and any function whose name carries isr/irq may only use the irqsave form, because spin_unlock re-enables interrupts unconditionally.  Usage: python3 tools/check_spin_discipline.py [dir ...] Exit 1 with a diagnostic on the first violation, else prints ok.*

**Classes:**
- `Config` (line 23) `class Config`

**Functions:**
- `iter_functions` (line 38) `def iter_functions(path)` - *Yield (name, first_line, body_lines) with a brace-depth split.*
- `check_file` (line 64) `def check_file(path)` - *Return a list of violation strings for one translation unit.*
- `main` (line 99) `def main(argv)` - *Walk the configured roots and fail closed on any violation.*

#### `check_surprising.py`
**Path:** `tools/check_surprising.py`
**File Doc:** *check_surprising.py -- Detect surprising architectural connections.  Parses the CPG JSON-LD output from readmenator and flags new connections of N or more hops between distinct communities.  These represent coupling debt that should be visible and prioritizable.  Usage: python3 tools/check_surprising.py [cpg.jsonld] [--min-hops 5]  Exit codes: 0 -- no surprising connections 1 -- new surprising connections detected 2 -- input file missing or malformed*

**Functions:**
- `load_cpg` (line 25) `def load_cpg(path)` - *Load and parse the CPG JSON-LD file.*
- `build_graph` (line 33) `def build_graph(cpg)` - *Build adjacency list from CPG nodes and edges.*
- `bfs_min_hops` (line 56) `def bfs_min_hops(nodes, edges, source, target_community, max_hops)` - *BFS from source to any node in target_community, returning hop count.*
- `find_surprising_connections` (line 87) `def find_surprising_connections(nodes, edges, min_hops)` - *Find connections of min_hops or more between distinct communities.*
- `main` (line 118) `def main()`

#### `check_syscall_sanitize.py`
**Path:** `tools/check_syscall_sanitize.py`
**File Doc:** *Scoped audit gate for syscall user-pointer sanitization.  Every ring-3 pointer that reaches a syscall handler as a1..a6 must pass a SANITIZE_* macro or user_range_ok/user_str_ok check before its first dereference. The discipline allows one delegation shape: an unchecked pointer may flow only into a callee that sanitizes internally (Config.delegated_callees); anything else is a fail-closed violation.  The analysis is textual and conservative: it over-reports, and Config records each triaged outcome, so a new unsanitized dereference fails the build instead of shipping silently.*

**Classes:**
- `Config` (line 18) `class Config` - *Centralized tunable values for the sanitize audit.*

**Functions:**
- `split_functions` (line 70) `def split_functions(lines)` - *Yield (name, start, body_lines) triples using brace depth.*
- `checked_names` (line 113) `def checked_names(body)` - *Return identifiers named inside sanitizer checks in a body.*
- `delegated_only` (line 123) `def delegated_only(body, alias)` - *Decide whether an alias flows only into sanitizing callees.*
- `split_top_args` (line 144) `def split_top_args(argtext)` - *Split a call argument list on top-level commas only.*
- `audit_body` (line 163) `def audit_body(name, body)` - *Return violation strings for one function body.*
- `audit_file` (line 218) `def audit_file(path)` - *Audit every handler in one file, return violation strings.*
- `main` (line 229) `def main()` - *Entry point used by lint and CI.*

#### `clip_bridge.py`
**Path:** `tools/clip_bridge.py`
**File Doc:** *Host to MiniOS clipboard bridge plan builder.  Builds the exact shell lines that carry a host text file into the guest through the shared 4 KB clipboard slot (syscalls 249/250) or, for multi-line input, through the kernel line editor upload path the MCP ``minios_write`` tool already drives. This module never talks to QEMU itself: it prints a plan the operator pastes into a live serial session or feeds to ``minios_send`` line by line, so there is no host assumption beyond the serial console both paths already require.  Single-line printable input within the clipboard cap travels as one ``clip <text>`` line and lands ready to paste with Ctrl+V at any prompt or in vedit. Anything else (embedded newlines, overlong lines, non-printable bytes) travels as an editor script (``edit <dst>`` plus one ``a <line>`` per line plus ``x``), which is the only guest path that preserves newlines: the ``clip`` builtin joins argv with spaces.  Every bound is fail-closed. A destination outside the character whitelist, a line the kernel readline cannot carry, or content past the clipboard cap is refused before a single plan line is printed, never silently truncated.*

**Classes:**
- `ClipBridgeConfig` (line 30) `class ClipBridgeConfig` - *Centralized bounds for the bridge plan.*

**Functions:**
- `valid_dst` (line 41) `def valid_dst(name, cfg)` - *True when name is a safe guest path.*
- `printable_line` (line 52) `def printable_line(line, cfg)` - *True when every char survives the kernel readline.*
- `build_plan` (line 59) `def build_plan(text, dst, cfg)` - *Return (ok, lines, diagnostic) for carrying text to dst.*
- `main` (line 84) `def main(argv)` - *Entry point: clip_bridge.py <src-file> <dst-name>.*

#### `doom_pwad.py`
**Path:** `tools/doom_pwad.py`
**File Doc:** *doom_pwad.py - grid map to vanilla Doom PWAD writer and checker.  Converts a text grid map into a single-level PWAD that replaces E1M1 in the shareware IWAD, and validates PWAD files produced by any tool. The generated level is multi-sector: each same-style floor region and each door block is its own sector, so rooms can differ in light, floor height and flats, and doors genuinely open. The BSP stays trivially correct: every linedef becomes one seg, all segs form one subsector, and the root node points at that same subsector on both children. One subsector needs no ordering, so no external node builder is required; sight, collision and clipping all work off the line/sector lists.  Usage: doom_pwad.py build <grid.txt> <out.wad> doom_pwad.py check <file.wad> doom_pwad.py info <file.wad>  Grid legend: '#' wall, '.' floor, 'P' player 1 start, 'E' exit switch marker, '+' door cell, ',' dark floor, '~' nukage pit, enemies 'i' imp, 'd' demon, 'z' zombieman, 'g' shotgun guy, 'v' spectre, 'b' baron, weapons 's' shotgun, 'h' chaingun, 'r' rocket launcher, 'w' chainsaw, ammo 'a' shells, 'u' clip, 'o' bullet box, 'k' rockets, 'x' rocket box, 'T' shell box, health 'm' medikit, 'q' stimpack, 'y' soulsphere, 'n' health bonus, armor 'f' armor bonus, 'G' green armor, 'U' blue armor, keys '1' blue, '2' red, '3' yellow, powerups 'V' invisibility, 'R' radiation suit, 'C' computer map, 'L' light amp, gear 'D' backpack, 'B' barrel, decor '0' pillar. A '+' cell is its own door sector (low ceiling, tagged) whose edges to neighbouring rooms are two-sided D1 open-door lines, usable from either side. A ',' region is the same room at low light; a '~' region is a*

**Classes:**
- `DoomPwadConfig` (line 52) `class DoomPwadConfig` - *Centralized tunables for the grid compiler and the PWAD checker.*
- `PwadError` (line 161) `class PwadError(Exception)` - *Fail-closed diagnostic raised for any invalid grid or PWAD.*

**Functions:**
- `pad_tex` (line 165) `def pad_tex(raw)` - *Return a texture or flat name padded to its 8-byte field.*
- `parse_grid` (line 172) `def parse_grid(text)` - *Parse grid text into rows, refusing empty or ragged input.*
- `grid_extents` (line 195) `def grid_extents(rows)` - *Return coordinate bounds of the lattice in map units.*
- `is_wall` (line 203) `def is_wall(rows, row, col)` - *Treat out-of-bounds cells as solid wall so maps stay closed.*
- `flood_reachable` (line 210) `def flood_reachable(rows)` - *Return the walkable set reachable from the player start tile.*
- `validate_grid` (line 240) `def validate_grid(rows)` - *Enforce single player, single exit, and full reachability.*
- `cell_corners` (line 269) `def cell_corners(row, col)` - *Return cell corners as (x0, x1, y_top, y_bottom) in map units.*
- `cell_class` (line 279) `def cell_class(cell)` - *Classify a walkable cell: doors stand alone, styles never merge.*
- `label_regions` (line 291) `def label_regions(rows)` - *Flood same-class walkable cells into region ids; walls stay -1.*
- `region_sector` (line 326) `def region_sector(region, door_tag)` - *Map a labelled region to its sector record fields and wall skin.*
- `compile_geometry` (line 371) `def compile_geometry(rows, exit_pos, wall_side)` - *Compile edges into vertexes, two-sided rooms and tagged doors.

Returns vertexes, linedefs as (v1, v2, flags, special, tag, s0, s1),
sidedefs as (xoff, yoff, upper, lower, mid, sector) and the exit edge.
Edges against walls are one-sided; room-to-room and room-to-door
edges are two-sided with the front on the cell being compiled.*
- `compile_things` (line 485) `def compile_things(rows)` - *Compile thing stamps into mapthing records in scan order.*
- `seg_angle` (line 506) `def seg_angle(dx, dy)` - *Return the stored short angle for a seg direction vector.*
- `build_lumps` (line 516) `def build_lumps(rows)` - *Compile a validated grid into the eleven E1M1 lump payloads.*
- `build_pwad` (line 597) `def build_pwad(rows)` - *Assemble lump payloads into a complete PWAD byte string.*
- `read_pwad` (line 616) `def read_pwad(data)` - *Split PWAD bytes into header fields and an ordered lump table.*
- `check_pwad` (line 639) `def check_pwad(data)` - *Validate lump order, record sizes and cross-lump references.*
- `cmd_build` (line 816) `def cmd_build(grid_path, out_path)` - *Build a PWAD from a grid file, refusing to write on any error.*
- `cmd_check` (line 826) `def cmd_check(path)` - *Validate a PWAD file and report its lump census on success.*
- `main` (line 834) `def main(argv)` - *Dispatch the build, check and info verbs with host-safe errors.*
- `vertex` (line 386) `def vertex(x, y)` - *Deduplicate lattice points shared by adjacent edges.*
- `payload` (line 650) `def payload(name)` - *Slice one lump payload out of the file image.*
- `check_multiple` (line 655) `def check_multiple(name, fmt)` - *Require the lump length to hold whole records only.*

#### `extract_shell.py`
**Path:** `tools/extract_shell.py`
**File Doc:** *tools/extract_shell.py -- Plan for Phase 6.1 shell extraction.  This script documents the shell extraction plan. The actual extraction requires careful handling of cross-dependencies between shell code and kernel internals.  DEPENDENCIES (shell -> kernel): VFS:       kfopen, kfclose, kfread, kfwrite, kfgets, kfputs, kfseek, kftell FS:        fs_resolve, fs_dir_exists, fs_is_dir Ramdisk:   ramdisk_open, ramdisk_read, ramdisk_list, ramdisk_create MiniFS:    minifs_resolve_path, minifs_stat, minifs_read, minifs_mkdir_p, minifs_create, minifs_write, minifs_sync, minifs_is_mounted, minifs_list Process:   k_exec_user, k_run_rel, k_spawn, k_register_program, k_register_process, k_register_symbol, elf_load, load_exec_elf Audio:     pcspk_tone, pcspk_set_volume, pcspk_get_volume Graphics:  vga_fb_* functions (desktop, WM, GFX_SET_TITLE syscall) Hashing:   xxh64_* functions Network:   net_*, tls_* functions Compress:  lzss_*, lz4_*, zip_* functions Crypto:    aes_* functions Editor:    edit_* functions Other:     kprintf, kmemset, kmemcpy, kstrlen, kstrcmp, kstrncmp, kstrcpy, kstrncpy, kstrchr, kstrstr, kstrncat, redirect_begin, redirect_commit, redirect_suspend, redirect_resume  FUNCTIONS TO EXTRACT (38 functions, ~2070 lines): Shell core:    shell_init, shell_run, shell_prompt, shell_parse, shell_exec_builtin, shell_report_exit, shell_report Line editing:  shell_readline, shell_readline_buf, shell_readline_hist,*

*No symbols extracted*

#### `gdb_repro.py`
**Path:** `tools/gdb_repro.py`
**File Doc:** *gdb_repro.py — drive a graphics-program sequence under the GDB stub.  Boots MiniOS with the gdb server (-s), a QMP socket for keyboard/mouse injection and a pty serial console, attaches gdb with a conditional breakpoint on the page-fault handler (isr_dispatch, vector 14), then drives a sequence of graphics programs. When a page fault fires, gdb dumps the trap frame (rip/rsp/cr2 = faulting address = FS base + offset) and exits.*

**Functions:**
- `rs` (line 23) `def rs(m, t)`
- `main` (line 27) `def main()`
- `send` (line 65) `def send(line)`
- `quit_doom` (line 70) `def quit_doom()`

#### `gen_desktop_pngs.py`
**Path:** `tools/gen_desktop_pngs.py`
**File Doc:** *gen_desktop_pngs.py -- build MiniOS desktop art from user-supplied PNGs.  Sources (images/ by default, overridable with --src-dir): paint.png              paint icon source cgoblin.png            wallpaper source (any size, RGB/RGBA) doom.png               DOOM icon source doomedit.png           doomedit map-editor icon source quake2.png             Quake 2 icon source piano.png              piano icon source nuklear.png            Nuklear icon source vedit.png              vedit editor icon source pokemon.png            Pokemon icon source (Pikachu art, not pixel art) freedom.png            FreeDom browser icon source  Outputs (under the MiniOS repo): progs/icons/doom.png, doomedit.png, quake2.png, piano.png, nuklear.png, vedit.png, pokemon.png, file.png, shell.png, paint.png, minicraft.png, freedom.png, folder.png, files.png, image.png, object.png  32x32 RGBA (folder/files/image/object are the file-browser kind icons). progs/wall/wallpaper.png                                   800x600 RGB  The kernel runs in an 8-bit palette mode, so it maps icon pixels to the 16-entry icon palette and wallpaper pixels to a fixed 6x6x6 colour cube at boot; these files only need the right dimensions. Icons keep alpha (the kernel treats fully transparent pixels as transparent). The wallpaper is cover-scaled (aspect-preserving fill + centre crop) so a square source like cgoblin.png never looks stretched.  Fail-closed: a missing source aborts with a diagnostic and nonzero exit*

**Functions:**
- `write_atomic` (line 71) `def write_atomic(img, path)`
- `main` (line 77) `def main()`

#### `gen_icons.py`
**Path:** `tools/gen_icons.py`
**File Doc:** *gen_icons.py -- generate 32x32 RGBA PNG icon files for the MiniOS desktop.  Each icon is defined as a 32-line string of hex characters (0-F), where each char maps to a colour in the icon palette.  The script writes minimal valid PNG files (no zlib import needed -- raw deflate via the stored method).  Usage:  python3 tools/gen_icons.py progs/icons/*

**Functions:**
- `make_png` (line 179) `def make_png(pixels, palette, width, height)` - *Create a minimal indexed-colour PNG from pixel indices and a palette.*
- `make_chunk` (line 209) `def make_chunk(chunk_type, data)`
- `main` (line 214) `def main()`

#### `gen_minifs.py`
**Path:** `tools/gen_minifs.py`
**File Doc:** *Generate minifs.c for MiniOS.*

*No symbols extracted*

#### `gen_zip_fixtures.py`
**Path:** `tools/gen_zip_fixtures.py`
**File Doc:** *gen_zip_fixtures.py -- generate the zip test fixtures shipped on the ramdisk.  Two small ZIP archives, built with the host's standard zipfile so the in-OS extractor is tested against bytes produced by a reference implementation, not just by its own writer:  host.zip    a well-formed archive with a directory and two files, proving the in-OS extractor interops with host-produced ZIPs.  hostile.zip an archive whose entry names try to escape the extraction root: a traversal ("../escape.txt"), an absolute path ("/abs.txt") and a directory marker ("dir/") beside one plain file.  The in-OS extractor must create only good.txt, dir/ and abs.txt (the absolute name is sanitized to relative) and must never create escape.txt.  Timestamps are fixed so the build is reproducible.*

**Functions:**
- `write_zip` (line 28) `def write_zip(path, entries)` - *entries: list of (name, data_or_None).  data None marks a directory.*
- `main` (line 42) `def main()`

#### `kernel_feature_survey.py`
**Path:** `tools/kernel_feature_survey.py`
**File Doc:** *kernel_feature_survey.py - verify which C features the MiniOS kernel needs.  Scans kernel and ring-3 sources for constructs miniGCC must support before it can compile them: function pointers, extended-asm constraints, wide calls, unions, long long, bitfields, privileged mnemonics and section attributes. Every claim the SDD specs make about a gap must reproduce through this tool first, so plans never rest on hallucinated file paths.  Usage: kernel_feature_survey.py [root] [--format text|md] Exit 0 always; findings print to stdout.*

**Classes:**
- `SurveyConfig` (line 18) `class SurveyConfig` - *Centralized tunables for the survey.*

**Functions:**
- `iter_sources` (line 34) `def iter_sources(root)` - *Yield C source paths under root, skipping vendored and cache dirs.*
- `find_fnptr_hits` (line 43) `def find_fnptr_hits(path, text)` - *Return line numbers declaring function pointers.*
- `find_asm_constraints` (line 49) `def find_asm_constraints(path, text)` - *Return sorted constraint letters used in extended asm.*
- `count_params` (line 59) `def count_params(params)` - *Count parameters, treating void and empty as zero.*
- `survey` (line 67) `def survey(root)` - *Collect findings per category across all sources.*
- `render_text` (line 103) `def render_text(findings)` - *Render findings as plain text.*
- `main` (line 122) `def main(argv)` - *Entry point for the survey tool.*

#### `minifs_dump.py`
**Path:** `tools/minifs_dump.py`
**File Doc:** *minifs_dump.py - Dump/inspect a MiniFS filesystem image.*

**Classes:**
- `FS` (line 25) `class FS`

**Functions:**
- `u16` (line 13) `def u16(d, o)`
- `u32` (line 14) `def u32(d, o)`
- `mode_str` (line 16) `def mode_str(m)`
- `main` (line 105) `def main()`

**Methods:**
- `__init__` (line 26) `def __init__(self, fn)`
- `blk` (line 29) `def blk(self, n)`
- `_sb` (line 30) `def _sb(self)`
- `inode` (line 38) `def inode(self, i)`
- `read` (line 47) `def read(self, ino)`
- `resolve` (line 67) `def resolve(self, path)`
- `ls` (line 86) `def ls(self, ino, prefix)`

#### `minifs_fsck.py`
**Path:** `tools/minifs_fsck.py`
**File Doc:** *minifs_fsck.py - Check MiniFS filesystem consistency.*

**Classes:**
- `FSCK` (line 23) `class FSCK`

**Functions:**
- `u16` (line 13) `def u16(d, o)`
- `u32` (line 14) `def u32(d, o)`
- `crc32` (line 15) `def crc32(data)`
- `main` (line 173) `def main()`

**Methods:**
- `__init__` (line 24) `def __init__(self, fn)`
- `_find_base` (line 31) `def _find_base(self)`
- `blk` (line 49) `def blk(self, n)`
- `_sb` (line 52) `def _sb(self)`
- `inode` (line 58) `def inode(self, i)`
- `inode_crc_ok` (line 65) `def inode_crc_ok(self, i)`
- `read` (line 71) `def read(self, ino)`
- `err` (line 86) `def err(self, msg)`
- `mark_block` (line 88) `def mark_block(self, n)`
- `scan_inode` (line 93) `def scan_inode(self, i)`
- `scan_dir` (line 105) `def scan_dir(self, ino)`
- `bitmap_free` (line 137) `def bitmap_free(self, start, count)` - *Clear bits among the first count bits of the bitmap at block start.*
- `check_counters` (line 146) `def check_counters(self)` - *The superblock free counters must match the bitmaps, or every
free-space report (and the kernel's own decrement) starts wrong.*
- `run` (line 161) `def run(self)`

#### `minifs_saves.py`
**Path:** `tools/minifs_saves.py`
**File Doc:** *minifs_saves.py - preserve the guest's saves/ dir across image rebuilds.  Regenerating minifs.bin from scratch wipes everything the guest wrote at runtime (Pokemon battery .sav/.rtc and .state savestates live in saves/ on MiniFS). Before mkfs runs, this tool extracts the live saves/ tree out of the previous os.img into a staging dir; the Makefile then passes that dir back into mkfs, so a rebuild carries the saves forward instead of wiping them. Only doom maps and Pokemon saves persist (PERSIST_SUFFIXES); minicraft chunks are skipped with a log line, never packed.  Usage: minifs_saves.py backup <os.img|minifs.bin> <stagedir>  The saves land in <stagedir>/saves/... (nothing is created when the image is missing or carries no saves/ dir). Guest files are written raw by minifs_write, never compressed, so extraction is byte-exact; a file found with the compressed flag set or with double-indirect blocks (both outside what the guest write path produces) aborts with a nonzero exit instead of backing up corrupt data.*

**Classes:**
- `Image` (line 61) `class Image` - *Random-access MiniFS partition inside a host file.*
- `FS` (line 85) `class FS`

**Functions:**
- `u16` (line 53) `def u16(d, o)`
- `u32` (line 57) `def u32(d, o)`
- `valid_name` (line 216) `def valid_name(nm)`
- `strict_name` (line 224) `def strict_name(nm)`
- `find_partition_base` (line 233) `def find_partition_base(fn)` - *Locate the MiniFS partition inside a host image file.

Returns the byte offset of the partition, or None. Prefers the exact
layout the build produces (kernel at LBA 9, partition 2048-sector
aligned after it); falls back to a magic scan.*
- `cmd_backup` (line 271) `def cmd_backup(img_path, stage)`
- `main` (line 343) `def main(argv)`
- `walk` (line 293) `def walk(dir_ino, rel)`

**Methods:**
- `__init__` (line 64) `def __init__(self, fn, base)`
- `close` (line 72) `def close(self)`
- `blk` (line 75) `def blk(self, n)`
- `__init__` (line 86) `def __init__(self, img)`
- `inode` (line 95) `def inode(self, i)`
- `is_dir` (line 110) `def is_dir(self, st)`
- `read_file` (line 113) `def read_file(self, ino)`
- `listdir` (line 146) `def listdir(self, ino)`
- `read_file_dir` (line 165) `def read_file_dir(self, ino)`
- `read_file_raw` (line 173) `def read_file_raw(self, st)`
- `resolve` (line 197) `def resolve(self, path)`

#### `minios_cli.py`
**Path:** `tools/minios_cli.py`
**File Doc:** *minios_cli.py — drive MiniOS through the MCP bridge, not by hand.  Starts mcp/minios_mcp.py (which owns the QEMU child and the serial console) over stdio JSON-RPC and executes a sequence of actions in one session, then powers the machine off. This is the hammer the minios skill wants: never boot QEMU by hand; every shell interaction goes through the bridge.  Usage: python3 tools/minios_cli.py ACTION [ARG] [ACTION [ARG] ...]  Actions: boot             boot the image, wait for the shell prompt status           {booted, pid, log_bytes} send LINE        send one shell line, wait for the next prompt, print output cat PATH         print a ramdisk file snapshot         print the unconsumed console tail expect MARKER    wait for a marker; print matched: true/false write PATH       send lines from stdin through minios_write poweroff         power off and assert QEMU exit  Example: python3 tools/minios_cli.py boot send "help" send "ls etc/" poweroff*

**Classes:**
- `Client` (line 38) `class Client`

**Functions:**
- `main` (line 100) `def main()`

**Methods:**
- `__init__` (line 39) `def __init__(self)`
- `request` (line 56) `def request(self, method, params)`
- `tool` (line 77) `def tool(self, name, params)`
- `close` (line 87) `def close(self)`

#### `minios_gui.py`
**Path:** `tools/minios_gui.py`
**File Doc:** *minios_gui.py — inject VGA-mode input and capture the framebuffer.  Boots MiniOS with the emulated std VGA device (the linear framebuffer the kernel's desktop renders into), a QMP socket to inject PS/2 mouse motion, clicks and keyboard, and a pty serial console to drive the shell. After each action it saves the current VGA framebuffer to a PNG via QMP `screendump`, so a desktop crash, a vanished mouse cursor or a corrupted window is visible without a physical display.  This is the tool for the VGA-mode bugs (mouse cursor vanishing, desktop crash after a ring-3 program): it triggers real input events in the VGA desktop and captures what the guest drew.  Usage: python3 tools/minios_gui.py [actions...]  Environment: MEM       guest RAM (default 1G, like boot_run.sh: the kernel heap alone ends at 384 MB, so a smaller guest never reaches the prompt) DISPLAY   X display for the SDL window (run under xvfb-run to stay headless)  Actions: send  LINE         send a shell line, wait for prompt mouse DX DY        inject relative mouse motion click              inject a left-button press+release key QCODE [up]     inject a keyboard key (qemu keycode, e.g. esc, return) dump NAME          screendump the VGA to $TMPDIR/gui_*/NAME.png sleep SECS         pause*

**Classes:**
- `QMP` (line 66) `class QMP`

**Functions:**
- `read_serial` (line 50) `def read_serial(master, timeout)`
- `main` (line 118) `def main()`

**Methods:**
- `__init__` (line 67) `def __init__(self, path)`
- `cmd` (line 79) `def cmd(self, obj)`
- `_recv` (line 83) `def _recv(self)`
- `mouse` (line 98) `def mouse(self, dx, dy, click)`
- `key` (line 108) `def key(self, qcode, up)`
- `screendump` (line 114) `def screendump(self, path)`

#### `minios_hyper.py`
**Path:** `tools/minios_hyper.py`
**File Doc:** *minios_hyper.py -- host-side ring-minus-one debugger for MiniOS.  QEMU already runs in host root mode above the guest kernel, so this tool does not implement a hypervisor. It fuses the three introspection channels QEMU exposes into one console: the serial shell, the QMP control socket and the gdb remote stub. From the host it can drive shell commands, trace syscalls, snapshot the VGA framebuffer and peek guest memory without any guest cooperation beyond the existing builtins.  Purpose: debug the whole system (VGA desktop, syscalls, hangs) from the host where qemu runs, with reproducible scripted checks instead of eyeballs.  Usage: python3 tools/minios_hyper.py --selftest python3 tools/minios_hyper.py --boot --check vga_idle [--check vga_cursor] [--check gfx_frames] [--check pixel_oob] [--shell "trace verbose"] [--hold] python3 tools/minios_hyper.py --boot --interactive  Inputs: --boot runs os.img from the repository root with display none. --check names one scripted VGA/syscall probe; repeatable. --shell sends one extra guest line after boot. --selftest runs host-only unit vectors, no QEMU needed. --interactive drops into a tiny repl (help lists commands).  Outputs: PASS/FAIL lines on stdout plus screendump PNGs in a mkdtemp work dir.*

**Classes:**
- `HyperConfig` (line 50) `class HyperConfig` - *Central tunable set for the host debugger, no magic numbers elsewhere.*
- `RspCodec` (line 73) `class RspCodec` - *Encode and decode gdb remote serial protocol packets.*
- `QmpChannel` (line 96) `class QmpChannel` - *Minimal QMP client over a unix socket.*
- `GdbChannel` (line 152) `class GdbChannel` - *Tiny gdb RSP client for QEMU -s, enough to read regs and memory.*
- `Guest` (line 211) `class Guest` - *Owns the QEMU child plus its serial, QMP and gdb channels.*
- `FrameDiff` (line 339) `class FrameDiff` - *Host-side pixel math over QMP screendumps.*
- `HyperChecks` (line 409) `class HyperChecks` - *Scripted bug-hunting probes, each returns (ok, detail).*

**Functions:**
- `run_selftest` (line 491) `def run_selftest()` - *Host-only vectors for the packet codec and pixel math, no QEMU.*
- `run_boot` (line 523) `def run_boot(checks, extra_shell, interactive)` - *Boot the guest and run the requested scripted checks.*
- `repl` (line 561) `def repl(guest)` - *Tiny interactive loop joining shell, QMP and gdb reads.*
- `main` (line 591) `def main(argv)` - *Parse argv and dispatch to selftest, boot checks or repl.*
- `check` (line 495) `def check(ok, msg)`

**Methods:**
- `encode` (line 77) `def encode(payload)` - *Wrap raw payload bytes into a $...#cs frame.*
- `decode` (line 85) `def decode(frame)` - *Extract payload from a $...#cs frame, empty bytes on malformed.*
- `__init__` (line 99) `def __init__(self, path)`
- `_roundtrip` (line 109) `def _roundtrip(self, obj)`
- `raw` (line 117) `def raw(self, obj)` - *Send one QMP object and return the raw reply bytes.*
- `screendump` (line 121) `def screendump(self, path)` - *Ask QEMU to write the VGA frame to path.*
- `rel` (line 126) `def rel(self, dx, dy)` - *Inject relative mouse motion.*
- `key` (line 132) `def key(self, qcode)` - *Tap one qemu keycode down and up.*
- `status` (line 141) `def status(self)` - *Query the VM run state.*
- `close` (line 145) `def close(self)`
- `__init__` (line 155) `def __init__(self, port)`
- `_drain` (line 162) `def _drain(self)`
- `_cmd` (line 168) `def _cmd(self, payload)`
- `regs` (line 181) `def regs(self)` - *Return raw g-packet bytes, empty on failure.*
- `read_mem` (line 185) `def read_mem(self, addr, length)` - *Read length bytes at addr, None on failure or malformed reply.*
- `halt` (line 195) `def halt(self)`
- `cont` (line 201) `def cont(self)`
- `close` (line 204) `def close(self)`
- `__init__` (line 214) `def __init__(self, with_gdb)`
- `_ser` (line 248) `def _ser(self)`
- `_reader` (line 260) `def _reader(self)`
- `snapshot` (line 276) `def snapshot(self)`
- `wait_for` (line 280) `def wait_for(self, marker, timeout)`
- `send` (line 288) `def send(self, line, settle)`
- `qmp_chan` (line 298) `def qmp_chan(self)`
- `gdb_chan` (line 303) `def gdb_chan(self)`
- `dump` (line 308) `def dump(self, name)`
- `stop` (line 314) `def stop(self)`
- `mean_diff` (line 343) `def mean_diff(a_path, b_path)` - *Mean absolute grey difference above the taskbar strip.*
- `cursor_positions` (line 356) `def cursor_positions(shot_path)` - *Clustered arrow-template hit positions, static-safe.*
- `count_cursors` (line 394) `def count_cursors(shot_path)` - *Clustered arrow-sprite count for one frame.*
- `moved_cursors` (line 399) `def moved_cursors(before_path, after_path)` - *Hits in after with no neighbour in before, the live pointer.*
- `__init__` (line 412) `def __init__(self, guest)`
- `vga_idle` (line 415) `def vga_idle(self)` - *Two idle frames must match, no unsolicited redraw or flicker.*
- `vga_cursor` (line 427) `def vga_cursor(self)` - *One live pointer must move, static template hits are ignored.*
- `gfx_frames` (line 439) `def gfx_frames(self)` - *The composited-frame counter must climb across a real present.*
- `pixel_oob` (line 452) `def pixel_oob(self)` - *Out-of-range pixel probes must diagnose, never wrap or crash.*
- `sys_trace` (line 465) `def sys_trace(self)` - *Verbose trace must show a named syscall for a real program.*
- `_last_frames` (line 476) `def _last_frames(self)`

#### `mkcpyzip.py`
**Path:** `tools/mkcpyzip.py`
**File Doc:** *mkcpyzip.py -- pack a CPython Lib tree into a zipimport stdlib.  Usage: mkcpyzip.py <lib_dir> <out_zip> [skip_dir ...]  CPython's sys.path already names <prefix>/lib/python312.zip, so one stored (uncompressed) zip carries the whole pure-Python standard library onto MiniFS as a single inode, and zipimport needs no zlib module inside the guest for stored entries. Directories named in skip (typically test, idlelib, tkinter, ensurepip, venv) and every __pycache__ are pruned; compiled .py/.pyo files are not shipped (zipimport compiles on the fly).  Exit 0 with one summary line on success; a missing input or an empty result exits 1 with the reason on stderr.*

**Functions:**
- `build_zip` (line 22) `def build_zip(lib_dir, out_zip, skip)` - *Write out_zip with the Lib tree minus skip dirs; return file count.*
- `main` (line 41) `def main()`

#### `mkfs.minifs.py`
**Path:** `tools/mkfs.minifs.py`
**File Doc:** *mkfs.minifs.py - Create a MiniFS filesystem image for MiniOS.  Usage: python3 mkfs.minifs.py <output_file> <total_blocks> [files...] python3 mkfs.minifs.py minifs.bin 32768 python3 mkfs.minifs.py minifs.bin 32768 -d files/*

**Classes:**
- `MiniFS` (line 56) `class MiniFS`

**Functions:**
- `roundup4` (line 28) `def roundup4(v)`
- `div_round_up` (line 31) `def div_round_up(n, d)`
- `crc16` (line 34) `def crc16(data)`
- `crc32` (line 42) `def crc32(data)`
- `count_free` (line 50) `def count_free(bitmap, count)` - *Clear bits among the first count bits of bitmap: the superblock free
counters must equal what the kernel allocator sees in the bitmaps.*
- `main` (line 280) `def main()`
- `pack_tree` (line 310) `def pack_tree(parent_ino, path, rel)`

**Methods:**
- `__init__` (line 57) `def __init__(self, total_blocks)`
- `mark_inodes_used` (line 80) `def mark_inodes_used(self, start, count)`
- `mark_blocks_used` (line 84) `def mark_blocks_used(self, start, count)`
- `alloc_inode` (line 88) `def alloc_inode(self)`
- `alloc_block` (line 94) `def alloc_block(self)`
- `create_root` (line 100) `def create_root(self)`
- `seal_inode` (line 108) `def seal_inode(self, ino)` - *Store the inode checksum over its first 124 bytes; every
mutation reseals, or the kernel rejects the inode on read.*
- `create_inode` (line 113) `def create_inode(self, mode, links)`
- `inode_set_size` (line 120) `def inode_set_size(self, ino, size)`
- `inode_set_block` (line 124) `def inode_set_block(self, ino, logblk, phys)`
- `add_dir_entry` (line 154) `def add_dir_entry(self, dir_ino, name, child_ino, ftype)`
- `claim_name` (line 192) `def claim_name(self, parent_ino, name, is_dir)` - *Record name in parent_ino. Returns the inode of an existing
directory when a directory of the same name is packed again (two
source trees merge, e.g. several etc/ roots); any other collision
is a build error, never a duplicate entry that shadows a file.*
- `write_file` (line 205) `def write_file(self, parent_ino, name, data)`
- `write_dir` (line 224) `def write_dir(self, parent_ino, name)`
- `serialize` (line 236) `def serialize(self)`

#### `mkpak1.py`
**Path:** `tools/mkpak1.py`
**File Doc:** *Build baseq2/pak1.pak carrying the player model.  The Quake 2 shareware pak0.pak omits the player model (players/male/tris.md2, grunt.pcx, weapon.md2, grunt_i.pcx are loose files in the retail game).  The q2generic client must find them in a pak, so this script packages the loose player model (from the Quake 2 install, held under progs/quake2generic/players) into a small second pak the game loads after pak0.pak.  Quake 2 pak format: 4-byte "PACK", u32 directory offset, u32 directory length, then 64-byte directory entries (56-byte NUL-padded name, u32 filepos, u32 filelen), then the concatenated file data.*

**Functions:**
- `main` (line 29) `def main()`

#### `mkramdisk.py`
**Path:** `tools/mkramdisk.py`
**File Doc:** *Build a MiniOS ramdisk image from files in a directory tree.  Each packed file is named by its path relative to the shared parent of all inputs, so progs/src/cp.c ships as src/cp.c and directories are carried as slashes inside flat names. Names longer than NAME_MAX or two inputs mapping to the same name are hard errors: a silently truncated or overwritten name would make every later lookup miss.  Payloads are deflate compressed (a zlib stream, exactly what the kernel miniz mz_uncompress consumes). The kernel decompresses every entry once at boot into its working ramdisk area, so runtime reads and writes see plain bytes and lose no performance; only the on-disk/embedded image shrinks. A payload that does not compress (tiny or incompressible) is stored raw and flagged so.  Layout (little endian): u32 magic, u32 count count * { char name[RAMDISK_FNAME_LEN]; u32 raw_size; u32 stored_size; u32 data_offset; u32 flags } payload area (concatenated, offsets relative to its start) flags bit 0: stored_size bytes are a zlib stream, else raw.  The name slot width is RAMDISK_FNAME_LEN parsed from headers/kernel.h (the single source of truth): the kernel's RDFile table reads the same width, and a mismatch silently misaligns every entry; changing the constant there and rebuilding is the only way to move it.*

**Functions:**
- `read_fname_bytes` (line 41) `def read_fname_bytes(kernel_h_path)` - *Parse RAMDISK_FNAME_LEN from headers/kernel.h; fail closed.*
- `pack_name` (line 64) `def pack_name(path, common)`
- `main` (line 74) `def main()`

#### `mkvocab.py`
**Path:** `tools/mkvocab.py`
**File Doc:** *Build progs/topogpt3/vocab.bin from the GPT-2 encoder.json.  Output format (little-endian, read by load_vocab in topogpt3.c): magic "VOCB", u32 token count, then per token: u16 byte length followed by the raw token bytes.  GPT-2 encoder keys are unicode strings using the bytes_to_unicode mapping, so each token is decoded back to raw bytes through the inverse map. Token 0-255 become the single bytes 0x00-0xFF.*

**Functions:**
- `bytes_to_unicode` (line 18) `def bytes_to_unicode()` - *Reversible byte to unicode map used by the GPT-2 encoder.*
- `main` (line 35) `def main(encoder_path, vocab_path)` - *Convert encoder.json to the VOCB binary vocabulary.

Args:
    encoder_path: Path to the GPT-2 encoder.json file.
    vocab_path: Destination path for the vocab.bin file.*

#### `probe_compute_vga.py`
**Path:** `tools/probe_compute_vga.py`
**File Doc:** *Docstring: VGA liveness probe during CPU-bound ring-3 compute. Boots os.img headless, runs a command, moves the PS/2 mouse through QMP mid-run and screendumps. A live guest repaints cursor and clock even while a ring-3 loop never blocks: consecutive dumps must differ. Usage: tools/probe_compute_vga.py "<guest cmd>" [settle_secs]*

**Functions:**
- `main` (line 22) `def main()`
- `send` (line 55) `def send(line)`
- `poll` (line 61) `def poll(timeout)`
- `qmp` (line 88) `def qmp(obj)`
- `rel` (line 97) `def rel(dx, dy)`
- `dump` (line 104) `def dump(name)`

#### `probe_minicraft.py`
**Path:** `tools/probe_minicraft.py`
**File Doc:** *probe_minicraft.py -- numeric minicraft probe without any PNG.  Boots os.img headless (display none), runs minicraft in the background so the shell stays usable, and verifies rendering + movement purely through serial-observable numbers:  - `gfx frames` must climb (real compositing, like DOOM autoframes) - `wm list` gives the gfx window rect; `gfx rect` over the upper and lower content halves reports histograms (sky vs ground orientation) - QMP holds `w` for 2s, then the `P` key tap makes minicraft print `minicraft: pos X Y Z ... wood N`; X must have advanced vs before  No PIL, no screendump, no PNG: everything is parsed serial text.  Usage: python3 tools/probe_minicraft.py [--hold SECS]*

**Functions:**
- `main` (line 34) `def main()`
- `send` (line 68) `def send(line)`
- `poll` (line 74) `def poll(timeout)`
- `grab` (line 85) `def grab(pat, timeout)`
- `qkey` (line 143) `def qkey(qcode, down)`
- `pos` (line 154) `def pos(tag)`

#### `qga_client.py`
**Path:** `tools/qga_client.py`
**File Doc:** *Minimal QEMU guest agent client for MiniOS.  Connects to the guest agent socket (a QEMU chardev mapped to the kernel's COM2 agent port), sends one QGA JSON request per line, and prints the JSON reply. Also drives the same protocol QEMU's own QMP guest-agent-command uses, because the framing is whitespace-delimited.  Usage: qga_client.py <command> [arguments_json] qga_client.py --sock <path> <command> [arguments_json]  Examples: qga_client.py guest-ping qga_client.py guest-exec '{"path":"echo hi > /tmp/x"}' qga_client.py guest-file-read '{"handle":0,"count":100}'  The socket path defaults to /tmp/minios-ga.sock and can be overridden with --sock or the MINIOS_GA_SOCK environment variable.*

**Functions:**
- `send_command` (line 33) `def send_command(sock, cmd, args)`
- `read_reply` (line 41) `def read_reply(sock, timeout)` - *Read one newline-terminated JSON object from the agent.*
- `connect` (line 57) `def connect(path)`
- `main` (line 74) `def main(argv)`

#### `repro_gui.py`
**Path:** `tools/repro_gui.py`
**File Doc:** *repro_gui.py — reproduce the VGA/mouse state bug after ring-3 programs.  Boots MiniOS with a QMP socket (to inject PS/2 mouse motion into the guest) and a pty serial console (to drive the shell), then runs a sequence of shell commands and reports the mouse_state visible through `gfx` plus any kernel EXCEPTION dump on the serial line. This is how the GUI-only bug (mouse cursor vanishing / VGA crash after DOOM, SYS_SPAWN, etc.) is observed without a physical display: the kernel desktop tick runs on the guest framebuffer, and its failures surface on serial.  Usage: python3 tools/repro_gui.py send "micropython src/test.py" [send ...]*

**Classes:**
- `QMP` (line 46) `class QMP`

**Functions:**
- `read_serial` (line 30) `def read_serial(master, timeout)`
- `main` (line 92) `def main()`
- `send` (line 113) `def send(line)`
- `mouse_state` (line 118) `def mouse_state()`

**Methods:**
- `__init__` (line 47) `def __init__(self, path)`
- `cmd` (line 59) `def cmd(self, obj)`
- `_recv` (line 63) `def _recv(self)`
- `mouse` (line 78) `def mouse(self, dx, dy, left)`
- `key` (line 87) `def key(self, qcode, down)`

#### `sign_elf.py`
**Path:** `tools/sign_elf.py`
**File Doc:** *Sign MiniOS user binaries with Ed25519 (development key). . Usage: python3 tools/sign_elf.py [--check] [--key-id N] FILE [FILE ...] python3 tools/sign_elf.py [--check] [--key-id N] --walk DIR [DIR ...] . Inputs: ET_EXEC/ET_DYN ELF files. Other files are skipped, never modified. Outputs: the same files with a signature note carrying one key id byte plus the 64-byte signature, either patched into an existing PT_NOTE/SHT_NOTE slot or appended as a new non-allocated .note.minios.sign section. With --check nothing is written; unsigned or badly signed images are reported and the exit status is 1. . Failure modes: non-ELF input skips silently; truncated headers, missing section tables on images without a note slot, and unknown key ids fail loudly with a non-zero exit. Signing is idempotent: an image whose current bytes already verify under the requested key is left untouched, so rebuilds stay mtime-stable. . The development seed below is a published test key for dogfood builds only (docs/spec/kernel.md). Production images use key id 1 with a key file passed through MINIOS_SIGN_KEY.*

**Classes:**
- `Config` (line 31) `class Config` - *Central configuration, no magic numbers outside this class.*

**Functions:**
- `sha512` (line 61) `def sha512(data)` - *One-shot SHA-512.*
- `encodepoint_raw` (line 66) `def encodepoint_raw(x, y)` - *Encode affine (x, y) to 32 bytes.*
- `edwards_add` (line 71) `def edwards_add(p, q)` - *Add two extended points, all math mod field_p.*
- `scalarmult` (line 88) `def scalarmult(p, e)` - *Multiply extended point p by scalar e.*
- `base_point` (line 99) `def base_point()` - *Recompute the base point from y = 4/5.*
- `publickey` (line 112) `def publickey(seed)` - *Derive the 32-byte public key from a 32-byte seed.*
- `sign_digest` (line 121) `def sign_digest(digest, seed)` - *Sign a 64-byte canonical digest, returning 64 signature bytes.*
- `pad_to` (line 135) `def pad_to(blob, alignment)` - *Pad blob with zero bytes up to alignment.*
- `parse_ehdr` (line 143) `def parse_ehdr(data)` - *Unpack the ELF header, raising ValueError when truncated.*
- `parse_phdrs` (line 158) `def parse_phdrs(data, ehdr)` - *Unpack the program headers, raising ValueError when out of range.*
- `canonical_digest` (line 172) `def canonical_digest(data, ehdr, phdrs)` - *Build the kernel-agreed digest: entry plus PT_LOAD segments.

File bytes below 64 (the ELF header) are excluded from the
segment feeds while the entry stays bound as a value: appending
the signature section rewrites the section index there, and a
digest covering it would invalidate its own signature.*
- `find_note_slots` (line 199) `def find_note_slots(data, ehdr, phdrs)` - *Locate patchable signature slots, returning file offsets of descs.*
- `find_section_slot` (line 222) `def find_section_slot(data, ehdr)` - *Locate the .note.minios.sign section descriptor, else -1.*
- `append_section` (line 257) `def append_section(data, ehdr, desc)` - *Append a .note.minios.sign section, returning the new image.*
- `pub_for_key` (line 305) `def pub_for_key(key_id)` - *Resolve the trusted public key for checking without secrets.*
- `key_material` (line 321) `def key_material(key_id)` - *Resolve the signing seed and public key for a key id.*
- `process` (line 341) `def process(path, key_id, check_only)` - *Sign or verify one file, returning (action, detail).*
- `verify_external` (line 395) `def verify_external(sig, digest, pub)` - *Verify with PyNaCl when present, else the local fallback.*
- `fallback_verify` (line 408) `def fallback_verify(sig, digest, pub)` - *Pure-python Ed25519 verify for hosts without PyNaCl.*
- `decode_point` (line 429) `def decode_point(raw)` - *Decode a point encoding to extended coordinates.*
- `points_equal` (line 447) `def points_equal(p, q)` - *Compare extended points by cross-multiplied coordinates.*
- `main` (line 454) `def main(argv)` - *Drive signing or checking over files and directory walks.*

#### `test_call_align.py`
**Path:** `tools/test_call_align.py`
**File Doc:** *test_call_align.py - verify stack alignment at call sites, both parities.  Compiles a probe with miniGCC whose callees read %rsp in their body and report rsp & 15. A System V callee entered with a correct call sequence sees (entry_rsp - 8 - frame) where frame is a multiple of 16, so the reported value is always 8 regardless of arity. An inverted spill pad or a missing align dance shows up as 0. No gcc reference is needed: the assertion is the ABI constant itself, which makes this probe immune to the host compiler's frame choices.  Covers 6-arg (no spill, even), 7-arg (spill, odd) and 8-arg (spill, even) callees through direct and indirect calls.  Usage: test_call_align.py [--minigcc DIR] [--keep] Exit 0 when every probe reports 0.*

**Classes:**
- `AlignConfig` (line 24) `class AlignConfig` - *Centralized tunables for the alignment probe.*

**Functions:**
- `find_minigcc` (line 59) `def find_minigcc(explicit)` - *Locate the miniGCC checkout without host assumptions.*
- `run` (line 74) `def run(argv)` - *Run a subprocess, returning CompletedProcess.*
- `main` (line 79) `def main(argv)` - *Build the probe with miniGCC and assert every report is eight.*

#### `test_gui_fashion.py`
**Path:** `tools/test_gui_fashion.py`
**File Doc:** *test_gui_fashion.py -- GUI proof for the cursor/flicker/quit fixes.  Boots the real image and judges pixels over QMP screendumps:  1. `run file &` (bg): two dumps 3s apart with zero input must be identical above the taskbar (single cursor owner: no trails, no present-vs-tick flicker). 2. Jiggle the mouse across the window, then idle: frames converge again (no stranded cursor sprites on hitboxes). 3. `run file` (fg) + QMP ESC: the shell prompt returns (ESC quit, no title-bar X needed). 4. `wm state` reports the active theme (`wm: theme dark`).  Fails loudly (exit 1) with the mean-abs-diff numbers. Dumps stay in the printed work dir for eyeballing.*

**Classes:**
- `Guest` (line 45) `class Guest`

**Functions:**
- `note` (line 39) `def note(ok, msg)`
- `meandiff` (line 190) `def meandiff(a_path, b_path)`
- `count_arrows` (line 206) `def count_arrows(shot_path)` - *Cursor sprites by template: every arrow-white pixel near-white,
and at least half the arrow-black pixels non-white (rejects text).
A single owner paints exactly 1; a cursor race strands 2+.*
- `main` (line 239) `def main()`

**Methods:**
- `__init__` (line 46) `def __init__(self)`
- `_ser` (line 70) `def _ser(self)`
- `_reader` (line 82) `def _reader(self)`
- `snapshot` (line 98) `def snapshot(self)`
- `wait_prompt` (line 102) `def wait_prompt(self, timeout)`
- `wait_for` (line 110) `def wait_for(self, marker, timeout)`
- `send` (line 118) `def send(self, line, settle)`
- `qmp_cmd` (line 128) `def qmp_cmd(self, obj)`
- `_qmp` (line 141) `def _qmp(self, obj)`
- `key` (line 149) `def key(self, qcode, down, up)`
- `rel` (line 161) `def rel(self, dx, dy)`
- `dump` (line 168) `def dump(self, name)`
- `stop` (line 175) `def stop(self)`

#### `test_gui_freedom.py`
**Path:** `tools/test_gui_freedom.py`
**File Doc:** *test_gui_freedom.py -- GUI proof that freedom-gui takes real input.  The BDD scenario proves the full FreeDom GUI presents a frame; it cannot prove that keys, chords, the clipboard and the mouse reach the browser through the MiniOS platform layer (progs/freedomui/platform_minios.c and ps2_keymap.c, docs/spec/network.md). This boots the real image headless (-display none), drives the shell over a unix-socket serial, injects PS/2 through QMP and judges pixels with PIL plus the kernel clipboard:  0. foreground run, the way a user (or the dock) starts it: the pointer parks on the wallpaper, bare `freedom-gui` runs as a process (process note), then the pointer moves over the idle browser -> the arrow follows (the desktop tick moves it while the app presents nothing) -> no dead arrow stays where it was parked serial Ctrl+C                          -> `exit code: 130`, prompt back 1. `clip abc`, then `run freedom-gui &` until `freedom: frame ok` 2. type `x` into the focused URL bar      -> URL bar pixels change 3. Ctrl+V pastes the kernel clipboard     -> bar holds `xabc` Ctrl+C copies the bar back             -> `clip` prints `xabc` 4. click the toolbar menu button          -> the menu panel paints  Usage: python3 tools/test_gui_freedom.py  Inputs: os.img in the repository root (built with freedom-gui on MiniFS). Outputs: PASS/FAIL lines, the work dir with every dump, exit 0 when all*

**Classes:**
- `Config` (line 45) `class Config` - *Every tunable of the proof in one place.*
- `Guest` (line 105) `class Guest` - *QEMU guest with a unix-socket serial console and a QMP socket.*

**Functions:**
- `note` (line 98) `def note(ok, msg)` - *Print one PASS/FAIL line and remember failures.*
- `region_diff` (line 256) `def region_diff(a_path, b_path, box)` - *Mean absolute luminance difference of one region of two dumps.*
- `content_origin` (line 264) `def content_origin(listing)` - *Parse `wm list` for the gfx window's content origin (cx, cy).*
- `changed_pixels` (line 273) `def changed_pixels(a_path, b_path, box)` - *Pixels of one region that differ between two dumps.*
- `around` (line 283) `def around(point)` - *Square region of Config.POINTER_BOX pixels from a pointer's tip.*
- `walk` (line 289) `def walk(g, delta)` - *Move the pointer by a screen-pixel delta in MOUSE_STEPS slices.*
- `foreground_phase` (line 300) `def foreground_phase(g)` - *Bare `freedom-gui` in the foreground with the pointer in use: the
arrow follows over the idle window, leaves no dead sprite on the
wallpaper, and serial Ctrl+C ends the run with the prompt back. The
pointer ends at the screen centre, where move_to expects it.*
- `screen_box` (line 332) `def screen_box(origin, box)`
- `move_to` (line 337) `def move_to(g, frame_size, target)` - *Walk the pointer from the screen centre (where it starts) to target.*
- `fb_move` (line 343) `def fb_move(g, pos, target)` - *Walk by an fb delta from a tracked position, then update the tracker.*
- `main` (line 350) `def main()`

**Methods:**
- `__init__` (line 108) `def __init__(self, work)`
- `_connect` (line 132) `def _connect(self, path)`
- `_serial` (line 141) `def _serial(self)`
- `_reader` (line 146) `def _reader(self)`
- `snapshot` (line 157) `def snapshot(self)`
- `wait_for` (line 161) `def wait_for(self, text, timeout, since)` - *Wait for text in the console output past offset `since`.*
- `send` (line 170) `def send(self, line, settle)` - *Pace bytes so the 16-byte UART FIFO never drops a line head.*
- `qmp_cmd` (line 181) `def qmp_cmd(self, obj)`
- `_qmp` (line 188) `def _qmp(self, obj)`
- `keys` (line 196) `def keys(self, events)` - *events: list of (qcode, down) pairs sent in one batch each.*
- `tap` (line 204) `def tap(self, qcode)`
- `chord` (line 207) `def chord(self, mod, qcode)`
- `rel` (line 210) `def rel(self, dx, dy)`
- `button` (line 215) `def button(self, down)`
- `wheel` (line 221) `def wheel(self, up)` - *One wheel tick; qemu maps the button pair to the PS/2 z axis.*
- `dump` (line 231) `def dump(self, name)`
- `stop` (line 237) `def stop(self)`

#### `test_gui_gfxview.py`
**Path:** `tools/test_gui_gfxview.py`
**File Doc:** *test_gui_gfxview.py -- pixel + serial proof of the graphics view contract.  Purpose Proves that the tiling WM governs graphics apps (headers/wm_gfxview.h, kernel/vga_fb.c): DOOM starts in true fullscreen (scaled to the whole display, aspect kept, taskbar hidden), Alt+Enter returns it to a floating window, `wm tile` places it in a layout cell scaled to fit beside the terminal, `wm minimize` hides it to the taskbar while it keeps running, `wm focus 2` restores it, and the title-bar close request still ends it with exit code 130.  Usage python3 tools/test_gui_gfxview.py Needs qemu-system-x86_64, Pillow and a built os.img (make).  Inputs os.img next to tools/, driven through the Guest harness of tools/test_gui_wm.py (QMP screendumps, unix-socket serial console).  Outputs PASS/FAIL lines per assertion, then GFXVIEW OK (exit 0) or GFXVIEW FAIL (exit 1). Screendumps land in the harness temp dir.  Failure modes No boot prompt, DOOM never composites, a `wm list` view that does not match the requested mode, or pixels that contradict it (a fullscreen frame that still shows the taskbar row, a floating frame that shows no desktop around the window).*

**Classes:**
- `Config` (line 39) `class Config` - *Every tunable of the run in one place.*

**Functions:**
- `note` (line 55) `def note(ok, msg)` - *Record one assertion.*
- `last_line` (line 62) `def last_line(g, prefix)` - *Last serial line starting with prefix, or an empty string.*
- `gfx_row` (line 72) `def gfx_row(g)` - *Fresh `win gfx` line from `wm list` as a dict of key=value fields.*
- `dark_share` (line 84) `def dark_share(img, box)` - *Fraction of near-black pixels inside box (x0, y0, x1, y1).*
- `wait_frames` (line 94) `def wait_frames(g, want)` - *Poll `gfx frames` until the counter reaches want.*
- `main` (line 109) `def main()`

#### `test_gui_icon_cwd.py`
**Path:** `tools/test_gui_icon_cwd.py`
**File Doc:** *test_gui_icon_cwd.py -- GUI proof that dock launches ignore shell cwd.  Boots the real image, `cd cvm` over serial (the exact trap from the bug report: `+set basedir .` resolving against the shell cwd), then clicks the Quake 2 dock icon with a real relative-mouse walk. The icon target is found by template-matching progs/icons/quake2.png in the dock strip of a screendump, so no layout math can drift.  PASS: serial shows the engine loading (ref_soft / Map:) with no `colormap.pcx` error. FAIL: the old `Couldn't load pics/colormap.pcx`. Dumps stay in the printed work dir for eyeballing.*

**Classes:**
- `Guest` (line 42) `class Guest`

**Functions:**
- `note` (line 36) `def note(ok, msg)`
- `find_icon` (line 180) `def find_icon(shot_path, icon_path)` - *Center of the dock icon: global best template match, strict bar.*
- `walk` (line 213) `def walk(g, tx, ty, fw, fh)` - *Relative walk from screen center (guest 2px per host unit).*
- `main` (line 228) `def main()`

**Methods:**
- `__init__` (line 43) `def __init__(self)`
- `_ser` (line 67) `def _ser(self)`
- `_reader` (line 79) `def _reader(self)`
- `snapshot` (line 95) `def snapshot(self)`
- `wait_prompt` (line 99) `def wait_prompt(self, timeout)`
- `send` (line 107) `def send(self, line, settle)`
- `qmp_cmd` (line 117) `def qmp_cmd(self, obj)`
- `_qmp` (line 130) `def _qmp(self, obj)`
- `rel` (line 138) `def rel(self, dx, dy)`
- `click` (line 145) `def click(self)`
- `dump` (line 155) `def dump(self, name)`
- `stop` (line 162) `def stop(self)`

#### `test_gui_menu.py`
**Path:** `tools/test_gui_menu.py`
**File Doc:** *test_gui_menu.py -- serial proof that the minicraft pause menu works.  ESC must open the pause menu even when QMP delivers down+up inside one guest frame (the old esc_prev edge dropped those); navigating to CREEPS and pressing right must print "creeps 4" via mobs_sync; ESC, up-wrap to QUIT and Enter must return to the shell prompt.  Usage: python3 tools/test_gui_menu.py Exits 0 printing MENU OK, 1 otherwise.*

**Functions:**
- `main` (line 20) `def main()`

#### `test_gui_wm.py`
**Path:** `tools/test_gui_wm.py`
**File Doc:** *test_gui_wm.py -- GUI proof that graphics windows survive the WM.  Serial `wm` commands call the same functions as the real paths, but they cannot prove what the user sees: a program blocked in read (vedit) stops compositing, so any desktop redraw used to bury it until the next keypress. This boots the real image headless (-display none), drives the shell over stdio pipes, injects PS/2 through QMP and judges pixels with PIL. Work dir (sockets, dumps) is a mkdtemp, printed at start for eyeballing.  1. split terminals, run vedit (foreground, shell blocked) 2. Alt+Tab -> vedit still painted (was: wiped until next key) 3. Super+Tab -> vedit still painted after tiling 4. quit, run vedit in background, click its taskbar button -> serial `wm state` reports focus 2 (the buried app comes back)  Fails loudly (exit 1) with the mean-abs-diff numbers. Dumps stay in the printed work dir for eyeballing.*

**Classes:**
- `Guest` (line 46) `class Guest`

**Functions:**
- `note` (line 40) `def note(ok, msg)`
- `meandiff` (line 204) `def meandiff(a_path, b_path)`
- `main` (line 214) `def main()`

**Methods:**
- `__init__` (line 47) `def __init__(self)`
- `_ser` (line 75) `def _ser(self)`
- `_reader` (line 87) `def _reader(self)`
- `snapshot` (line 103) `def snapshot(self)`
- `wait_prompt` (line 107) `def wait_prompt(self, timeout)`
- `send` (line 115) `def send(self, line, settle)`
- `qmp_cmd` (line 130) `def qmp_cmd(self, obj)`
- `_qmp` (line 143) `def _qmp(self, obj)`
- `key` (line 151) `def key(self, qcode, down, up)`
- `rel` (line 163) `def rel(self, dx, dy)`
- `btn` (line 170) `def btn(self, down)`
- `dump` (line 176) `def dump(self, name)`
- `stop` (line 183) `def stop(self)`

#### `test_gui_zoom.py`
**Path:** `tools/test_gui_zoom.py`
**File Doc:** *test_gui_zoom.py -- pixel proof that GFX_ZOOM doubles the game window.  Boots MiniOS headless (display none, QMP screendump), runs minicraft in the foreground with a fresh seed, dumps the 1:1 window, presses F11, dumps again and diffs the two frames. A working 2x zoom changes a ~648x416 bounding box; a dead toggle only moves pigs/the clock.  Usage: python3 tools/test_gui_zoom.py Exits 0 printing ZOOM OK, 1 otherwise.*

**Functions:**
- `main` (line 22) `def main()`

#### `test_http_server.py`
**Path:** `tools/test_http_server.py`
**File Doc:** *Host-side HTTP fixture for the freedom BDD scenarios.  Serves behaviours that python -m http.server cannot produce:  /chunked      Transfer-Encoding: chunked body split into three chunks /redirect302  302 with Location: /final (absolute-path redirect) /final        200 with Content-Length; the connection is then held open far beyond the BDD timeout, so a client that waits for EOF instead of honouring Content-Length stalls the scenario.  Usage: python3 test_http_server.py <port>*

**Classes:**
- `Handler` (line 21) `class Handler(BaseHTTPRequestHandler)`

**Methods:**
- `do_GET` (line 24) `def do_GET(self)`
- `log_message` (line 114) `def log_message(self, fmt)`

#### `test_lisp.py`
**Path:** `tools/test_lisp.py`
**File Doc:** *Host test suite for the MiniOS Lisp interpreter.  Builds progs/lisp/lisp.c with the host toolchain and drives the resulting binary through assertion vectors covering arithmetic, fail-closed errors, closures, strings, files, predicates, CLI flags and the in-OS suite file in language-only mode. Kernel-backed primitives (minios-run, time-ms, vol) are exercised for shape only: without a kernel they fail closed instead of crashing.  Usage: python3 tools/test_lisp.py [--binary PATH] [--lisp SRC]*

**Classes:**
- `LispConfig` (line 28) `class LispConfig` - *Central configuration for paths, flags and match expectations.*
- `LispTest` (line 37) `class LispTest` - *Builds the interpreter once and asserts vectors against it.*

**Functions:**
- `build_binary` (line 308) `def build_binary(source, output)` - *Compile the interpreter with warnings promoted to errors.*
- `main` (line 321) `def main()` - *Parse arguments, build the binary and drive the suite.*

**Methods:**
- `__init__` (line 40) `def __init__(self, binary, suite)`
- `check` (line 47) `def check(self, name, actual, expected)` - *Assert one observed value equals the expectation.*
- `run_expr` (line 58) `def run_expr(self, code)` - *Evaluate one inline expression and capture output.*
- `check_eval` (line 65) `def check_eval(self, name, code, stdout)` - *Assert an inline expression prints exactly the expectation.*
- `check_error` (line 70) `def check_error(self, name, code, fragment)` - *Assert an inline expression fails closed with a diagnostic.*
- `run_all` (line 76) `def run_all(self)` - *Drive every assertion vector in sequence.*
- `check_file_roundtrip` (line 121) `def check_file_roundtrip(self)` - *Assert a file write and read roundtrip through the interpreter.*
- `check_exit_code` (line 135) `def check_exit_code(self)` - *Assert a nonzero exit status survives the cleanup path.*
- `check_cli` (line 142) `def check_cli(self)` - *Assert version, help, unknown flag and missing file behaviors.*
- `check_suite_language_only` (line 159) `def check_suite_language_only(self)` - *Assert the shipped in-OS suite passes its language section.*
- `check_minigcc_subset` (line 177) `def check_minigcc_subset(self)` - *Assert the Lisp subset compiler covers expr codegen end to end.

Each vector compiles one tiny C source through minigcc.lisp, then
assembles and links the output with the host toolchain and checks
the process exit code. Vectors that need `as`/`ld` skip cleanly
when the host lacks them; the fail-closed vectors need no linker.*
- `report` (line 300) `def report(self)` - *Print the totals and return the process exit status.*

#### `test_net_fixture.py`
**Path:** `tools/test_net_fixture.py`
**File Doc:** *test_net_fixture.py -- host-side UDP and TCP echo fixture for lxnet.  The lxnet probe (progs/src/lxnet.c, docs/spec/network.md "Linux socket ABI") proves the guest's datagram and stream sockets against something the guest can reach through QEMU slirp (10.0.2.2 is the host). python -m http.server cannot echo datagrams or hold a raw stream, so this fixture serves both:  UDP <port>   echoes every datagram back to its sender, byte for byte TCP <port>   echoes every byte back on each accepted connection until the peer closes  Usage: python3 tools/test_net_fixture.py <port>  Inputs: one port number, used for both the UDP and the TCP listener. Outputs: none on success; runs until killed (the BDD harness stops it). Failure modes: exits 2 on a bad argument and 1 when either port cannot be bound (already in use).*

**Classes:**
- `Config` (line 26) `class Config` - *Every tunable of the fixture in one place.*

**Functions:**
- `serve_udp` (line 34) `def serve_udp(port)` - *Echo each datagram back to its sender.*
- `echo_stream` (line 43) `def echo_stream(conn)` - *Echo one accepted stream until the peer closes it.*
- `serve_tcp` (line 53) `def serve_tcp(port)` - *Accept streams forever, one echo thread each.*
- `main` (line 64) `def main()`

#### `tls_test.py`
**Path:** `tools/tls_test.py`
**File Doc:** *Host-side TLS test driver for the MiniOS kernel TLS client.  Generates a throwaway CA and server certificates with openssl (bounded, offline), emits tls_test_roots.h (test CA DER + RSA/ECDSA verify vectors) next to them under build/tls_test_work, then runs the compiled tls_test binary against python ssl servers: positive handshakes (RSA chain, ECDSA P-256 leaf over a P-384 CA) and the negative set (wrong hostname, unknown CA, expired cert).  The roots header lives in the same directory as the certificates on purpose: the binary embeds the roots while the servers use the certificates, so both must be generated together or the suite fails with an "unknown CA" that looks like a flaky test.*

**Classes:**
- `Server` (line 247) `class Server(Thread)`

**Functions:**
- `run` (line 32) `def run(cmd)`
- `check` (line 36) `def check(cmd)`
- `gen_certs` (line 43) `def gen_certs()`
- `der_bytes` (line 160) `def der_bytes(pem_path)`
- `rsa_params` (line 168) `def rsa_params(key_path)`
- `ec_pub` (line 178) `def ec_pub(key_path)`
- `c_bytes` (line 189) `def c_bytes(data, name)`
- `gen_header` (line 197) `def gen_header(p)`
- `serve` (line 286) `def serve(cert, key)`
- `serve_openssl` (line 294) `def serve_openssl(cert, key, chain)`
- `expect` (line 312) `def expect(bin_path, args, want_zero, marker)`
- `main` (line 325) `def main()`
- `server_cert` (line 67) `def server_cert(name, algo, curve, ca_name, ca_algo, curve_ca, extra, subj)`

**Methods:**
- `__init__` (line 248) `def __init__(self, cert, key, tls13_ok)`
- `run` (line 254) `def run(self)`

#### `update_sources.py`
**Path:** `tools/update_sources.py`
**File Doc:** *Update the sibling source checkouts MiniOS builds against.  MiniOS is built from this repository plus one checkout per external source: the toolchain trio (miniGCC, ld, cvm), the browser (FreeDom), the interpreters (micropython, cpython, lua), the UI and audio libraries (nuklear, nuked-opl3) and the reference sources (raycastlib, quake2generic, the gameboy recompiler). This tool refreshes any subset of them in place.  Safety contract (never violated):  - Local work is never discarded. A dirty worktree is reported and skipped, never reset, never stashed, never force-updated. - History is never rewritten and local commits are never dropped. A checkout that carries local commits is merged with the upstream tip; a merge that conflicts is aborted and reported, so the checkout stays clean. - Pinned checkouts stay pinned. A checkout bound to a release tag is verified against that tag and restored to it when it drifted. - Every update records the pre-update revision, so `make update-rollback` can put the fleet back exactly where it was.  Usage: python3 tools/update_sources.py [options] [NAME ...]  With no NAME every managed checkout is updated. With one or more NAMEs (or --only NAME) only those checkouts are touched.  Options: --status         report the state of every checkout, no network access --list           list the managed checkouts and exit*

**Classes:**
- `Repo` (line 96) `class Repo` - *A managed external checkout.*
- `GitResult` (line 203) `class GitResult` - *Outcome of one git invocation.*
- `Outcome` (line 216) `class Outcome` - *Result of handling one checkout.*
- `GitError` (line 232) `class GitError(RuntimeError)` - *Raised when git fails in a way the caller cannot recover from.*

**Functions:**
- `run_git` (line 236) `def run_git(git, cwd)` - *Run git in a directory and capture its output.*
- `git_out` (line 253) `def git_out(git, cwd)` - *Run git and return stdout, or the empty string on failure.*
- `head_sha` (line 261) `def head_sha(git, path)` - *Return the checked-out revision, or the empty string.*
- `short_sha` (line 266) `def short_sha(sha)` - *Shorten a revision for display.*
- `current_branch` (line 271) `def current_branch(git, path)` - *Return the checked-out branch name, empty when detached.*
- `is_dirty` (line 276) `def is_dirty(git, path)` - *Report whether the worktree carries uncommitted changes.*
- `is_shallow` (line 281) `def is_shallow(git, path)` - *Report whether the checkout is a shallow clone.*
- `resolve_path` (line 286) `def resolve_path(directory)` - *Resolve a checkout directory against the repository root.*
- `fetch_upstream` (line 294) `def fetch_upstream(git, path, branch, shallow_depth)` - *Fetch the upstream branch, optionally with a bounded depth.*
- `deepen_upstream` (line 306) `def deepen_upstream(git, path, branch, commits)` - *Deepen a shallow checkout so a fast-forward becomes provable.*
- `upstream_target` (line 316) `def upstream_target(git, path, branch)` - *Return the revision the upstream branch points at.*
- `ahead_behind` (line 325) `def ahead_behind(git, path, branch)` - *Return the (ahead, behind) commit counts against the upstream branch.*
- `fast_forward` (line 339) `def fast_forward(git, path, target)` - *Merge an upstream revision, refusing anything but a fast-forward.*
- `reconcile` (line 344) `def reconcile(git, path, target, strategy)` - *Integrate an upstream revision into a branch that carries local commits.*
- `abort_reconcile` (line 351) `def abort_reconcile(git, path, strategy)` - *Undo a failed reconciliation so the checkout stays clean.*
- `conflicted_files` (line 359) `def conflicted_files(git, path)` - *List the files a failed reconciliation left unmerged.*
- `update_submodules` (line 365) `def update_submodules(git, path, submodules)` - *Initialize and refresh the submodules of a checkout.*
- `handle_tracked` (line 375) `def handle_tracked(git, repo, path, dry_run, fetch_enabled, strategy)` - *Bring a tracked checkout to the upstream tip, keeping local commits.*
- `handle_pinned` (line 446) `def handle_pinned(git, repo, path, dry_run, fetch_enabled)` - *Hold a checkout at the release tag it is pinned to.*
- `handle_repo` (line 493) `def handle_repo(git, repo, directory, dry_run, fetch_enabled, strategy)` - *Dispatch one checkout to the handler its mode asks for.*
- `write_snapshot` (line 513) `def write_snapshot(path, outcomes)` - *Record the pre-update revision of every checkout that moved.*
- `rollback` (line 535) `def rollback(git, snapshot_path, directories)` - *Restore the revisions recorded by the last update.*
- `print_status` (line 572) `def print_status(git, selected, directories)` - *Print the revision of every managed checkout.*
- `print_outcome` (line 594) `def print_outcome(outcome)` - *Print one checkout result.*
- `select_repos` (line 599) `def select_repos(names)` - *Resolve the requested repository names, failing on unknown ones.*
- `parse_overrides` (line 614) `def parse_overrides(pairs)` - *Split the --repo overrides into directory and URL maps.*
- `main` (line 634) `def main(argv)` - *Run the updater and report what happened.*

**Methods:**
- `ok` (line 211) `def ok(self)`
- `changed` (line 228) `def changed(self)`

#### `wm_layout_sync.py`
**Path:** `tools/wm_layout_sync.py`
**File Doc:** *Docstring: Synchronize the WM layout manifest from source truth.  I read wm_layout.h and tests/test_wm.c and regenerate docs/wm_layout_manifest.md so documentation never drifts from code. I fail closed with nonzero exit on missing contracts or mode gaps.*

**Classes:**
- `WmLayoutSyncConfig` (line 17) `class WmLayoutSyncConfig` - *Docstring: Centralized paths and bounds for layout sync.*
- `WmLayoutSyncResult` (line 36) `class WmLayoutSyncResult` - *Docstring: Outcome of one manifest synchronization.*
- `WmLayoutSync` (line 46) `class WmLayoutSync` - *Docstring: Manifest builder driven only by source files.*

**Functions:**
- `parse_args` (line 151) `def parse_args(argv)` - *Docstring: Parse CLI flags for check or write modes.*
- `main` (line 159) `def main(argv)` - *Docstring: Run discovery and write or verify the manifest.*

**Methods:**
- `__init__` (line 20) `def __init__(self, root)` - *Docstring: Bind all paths to one repository root.*
- `__init__` (line 39) `def __init__(self, modes, symbols, checks)` - *Docstring: Store discovered modes, symbols and check count.*
- `__init__` (line 49) `def __init__(self, config)` - *Docstring: Hold config as the sole tunable source.*
- `discover` (line 53) `def discover(self)` - *Docstring: Extract modes, symbols and test checks from sources.*
- `render` (line 66) `def render(self, result)` - *Docstring: Build manifest markdown from discovery result.*
- `synchronize` (line 101) `def synchronize(self, write)` - *Docstring: Discover, render and optionally write the manifest.*
- `_read_text` (line 110) `def _read_text(self, path)` - *Docstring: Read one source file or fail with a clear error.*
- `_extract_modes` (line 116) `def _extract_modes(self, header_text)` - *Docstring: Collect layout mode names from the mode table.*
- `_extract_symbols` (line 125) `def _extract_symbols(self, header_text)` - *Docstring: Collect required public symbols present in header.*
- `_count_layout_checks` (line 133) `def _count_layout_checks(self, tests_text)` - *Docstring: Count layout assertions guarding the contract.*
- `_require_modes` (line 138) `def _require_modes(self, modes)` - *Docstring: Refuse a header missing any required mode.*
- `_require_symbols` (line 144) `def _require_symbols(self, symbols)` - *Docstring: Refuse a header missing any required symbol.*

### S (20 files)

#### `ap_entry.S`
**Path:** `arch/x86/ap_entry.S`
**File Doc:** *ap_entry.S - SMP application-processor bootstrap stub.*

**Functions:**
- `ap_stub_start` (line 21)
- `ap_pm` (line 39)
- `ap_lm` (line 62)
- `ap_patch_slot` (line 80)
- `ap_gdt32` (line 84)
- `ap_gdt32_ptr` (line 88) - *movw %ax, %ss /* Load smp_ap_entry()'s address from the BSP-patched slot and go. mov ap_patch_slot(%rip), %rax jmp *%rax .globl ap_patch_slot ap_patch_slot: .quad 0 .p2align 2 ap_gdt32: .quad 0x0000000000000000 .quad 0x00CF9A000000FFFF     /* code32 base 0 limit 4G .quad 0x00CF92000000FFFF     /* data32 base 0 limit 4G*
- `ap_gdt32_end` (line 91)
- `ap_gdt64_ptr` (line 93)
- `ap_stub_end` (line 98)

#### `stage1.S`
**Path:** `arch/x86/boot/stage1.S`
**File Doc:** *stage1.S - MiniOS boot sector.*

**Functions:**
- `main` (line 28)
- `normalize` (line 32)
- `no_extensions` (line 78)
- `read_failed` (line 82)
- `fail` (line 85)
- `halt` (line 88)
- `puts` (line 93)
- `puts_next` (line 97)
- `puts_done` (line 103)
- `msg_no_lba` (line 107)
- `msg_read` (line 109)

#### `stage2.S`
**Path:** `arch/x86/boot/stage2.S`
**File Doc:** *stage2.S - MiniOS second-stage loader.*

**Functions:**
- `stage2_main` (line 39)
- `a20_ready` (line 54)
- `load_chunk` (line 69)
- `chunk_size_ready` (line 74)
- `read_piece` (line 81)
- `piece_size_ready` (line 86)
- `chunk_copy` (line 118)
- `chunk_leave_pm` (line 131)
- `chunk_resume` (line 141)
- `enter_long_mode` (line 162)
- `fill_pt0_low` (line 190)
- `dma_uncache` (line 208)
- `fill_pt0_kernel` (line 216)
- `fill_pt1_kernel` (line 235)
- `fill_pt1_bss` (line 244)
- `fill_page_directory` (line 260) - *endif*
- `read_failed` (line 289)
- `halt` (line 293)
- `puts` (line 298)
- `puts_next` (line 302)
- `puts_done` (line 308)
- `msg_read` (line 312)
- `vbe_probe` (line 325) - *Probe VESA BIOS Extensions for a high-resolution linear framebuffer and record it for the kernel in the fixed VBE_INFO_ADDR struct. Tries 1024x768 (true color first, then 8-bit palette), then 800x600x32, 800x600x8, 640x480x32 and 640x480x8, then falls back to VGA Mode 13h. Runs in real mode (the kernel image is already fully loaded, so this scratch is safe) and must complete before the transition to long mode kills the BIOS video services. A true-color mode frees the desktop from the 256-entry VGA DAC palette; the 8-bit modes keep that path unchanged. The kernel maps the framebuffer slot by slot, so a multi-MB framebuffer * spanning two 2 MB PD slots is fully mapped.*
- `vbe_try_mode` (line 364) - *Try one VBE mode held in %bx. On success the mode is set with the linear framebuffer bit and carry is cleared; on any failure carry is set so the caller can try the next candidate. Only 8/24/32-bit modes are accepted: a 15/16-bit mode would need an RGB565 packer the kernel does not carry, * so it is skipped like an unsupported mode.*
- `vbe_try_bpp_ok` (line 395)
- `vbe_set_fail` (line 420)
- `vbe_try_fail` (line 423)
- `vbe_ok` (line 429)
- `kaslr_pick` (line 438) - *Pick the kernel's physical load base: a 2 MB-aligned address in the 64-position window above the kernel heap, seeded from the TSC and the RTC so consecutive boots land at different locations. Returns the base in eax. The virtual base stays at the link-time 0x100000, which PT0/PT1 map * to the returned physical base.*
- `gdt32_start` (line 475)
- `gdt32_end` (line 481)
- `gdt32_ptr` (line 482)
- `gdt64_image` (line 487)
- `gdt64_ptr` (line 493)
- `saved_gdtr` (line 497)
- `sectors_left` (line 500)
- `chunk_sectors` (line 502)
- `next_lba` (line 504)
- `dest_addr` (line 506)
- `kaslr_dest` (line 508)

#### `ctx_sw.S`
**Path:** `arch/x86/ctx_sw.S`

**Functions:**
- `sched_park_capture` (line 70) - *captured the rest. Offsets mirror CTX_*_OFF in headers/sched.h (asserted in C). Requires frame pointers (CFLAGS_KERN carries -fno-omit-frame-pointer; without it %rbp is meaningless here).  rip MUST be 8(%rbp) -- the return into schedule()'s CALLER (yield / do_waitpid / do_exit) -- never (%rsp), the return into schedule() itself. A resume into schedule's tail re-runs the publish/unlock/ switch sequence a second time (double unlock of sched_lock plus a switch to the stale nxt), which hangs the machine; a resume into the caller simply continues it (callees restore rsp from rbp with `leave`, so the parked rsp=rbp+16 is exact). This mirrors what GCC lowers __builtin_return_address(0) to (*(rbp+8)) and is the reason the old comment insists the tail must never run twice.*
- `switch_save_only` (line 82)
- `switch_to` (line 91)
- `switch_to_notrap` (line 134)
- `user_trampoline` (line 221)
- `fork_trampoline` (line 233)
- `exec_enter` (line 273)
- `resume_iretq` (line 302)
- `k_run_on_stack` (line 342)

#### `isr_stubs.S`
**Path:** `arch/x86/isr_stubs.S`

**Functions:**
- `tf_rax` (line 67)
- `tf_rbx` (line 68)
- `tf_rcx` (line 69)
- `tf_rdx` (line 70)
- `tf_rsi` (line 71)
- `tf_rdi` (line 72)
- `tf_rbp` (line 73)
- `tf_r8` (line 74)
- `tf_r9` (line 75)
- `tf_r10` (line 76)
- `tf_r11` (line 77)
- `tf_r12` (line 78)
- `tf_r13` (line 79)
- `tf_r14` (line 80)
- `tf_r15` (line 81)
- `tf_rip` (line 82)
- `tf_cs` (line 83)
- `tf_rflags` (line 84)
- `tf_rsp` (line 85)
- `tf_ss` (line 86)
- `tf_vector` (line 87)
- `tf_errcode` (line 88)
- `isr_common` (line 96)
- `isr_stub_table` (line 195)

#### `syscall_entry.S`
**Path:** `arch/x86/syscall_entry.S`

**Functions:**
- `syscall_kstack` (line 49)
- `kstack_base` (line 52)
- `sc_top_save_addr` (line 55)
- `syscall_entry` (line 65)

#### `tlb_nmi.S`
**Path:** `arch/x86/tlb_nmi.S`

**Functions:**
- `tlb_nmi_entry` (line 21)

#### `aes.s`
**Path:** `progs/asm/aes.s`

**Functions:**
- `aes_rk` (line 3)
- `aes_sb` (line 7)
- `aes_rc` (line 11)
- `aes_st` (line 15)
- `aes_iv` (line 19)
- `aes_read_all` (line 23)
- `aes_write_all` (line 238)
- `aes_has` (line 345)
- `hex_val` (line 498)
- `aes_parse_hex` (line 620)
- `aes_gf_mul` (line 783)
- `aes_xtime` (line 884)
- `aes_rotl8` (line 933)
- `aes_init_tables` (line 970)
- `aes_key_expand` (line 1197)
- `aes_add_round_key` (line 1646)
- `aes_sub_bytes` (line 1721)
- `aes_shift_rows` (line 1774)
- `aes_mix_columns` (line 1993)
- `aes_cipher` (line 2466)
- `aes_iv_increment` (line 2565)
- `aes_ctr_crypt` (line 2648)
- `aes_hdr_put` (line 2791)
- `aes_hdr_get` (line 2906)
- `aes_tool_name` (line 3059)
- `aes_run` (line 3077)
- `__sl_3` (line 3087)
- `__sl_4` (line 3091)
- `main` (line 3807)
- `_start` (line 4113)

#### `cp.s`
**Path:** `progs/asm/cp.s`

**Functions:**
- `main` (line 3)
- `_start` (line 322)

#### `cvmfmt.s`
**Path:** `progs/asm/cvmfmt.s`

**Functions:**
- `fwin` (line 3)
- `fcanary` (line 7)
- `main` (line 11)
- `_start` (line 245)

#### `fib.s`
**Path:** `progs/asm/fib.s`

**Functions:**
- `fib` (line 3)
- `main` (line 61)
- `_start` (line 82)

#### `freedom.s`
**Path:** `progs/asm/freedom.s`

**Functions:**
- `tls_close` (line 3)
- `f_host` (line 24)
- `f_path` (line 28)
- `f_port` (line 32)
- `f_secure` (line 36)
- `f_loc` (line 40)
- `f_redir` (line 44)
- `f_status` (line 48)
- `f_clen` (line 52)
- `f_has_clen` (line 56)
- `f_chunked` (line 60)
- `f_hdr` (line 64)
- `f_hlen` (line 68)
- `f_tag` (line 72)
- `f_suppress` (line 76)
- `f_comment` (line 80)
- `f_cmdash` (line 84)
- `f_tagn` (line 88)
- `f_tagnlen` (line 92)
- `f_ent` (line 96)
- `f_entlen` (line 100)
- `f_ws` (line 104)
- `f_utbuf` (line 108)
- `f_utlen` (line 112)
- `f_utrem` (line 116)
- `f_attr_on` (line 120)
- `f_waitq` (line 124)
- `f_inval` (line 128)
- `f_inval2` (line 132)
- `f_attr` (line 136)
- `f_attrlen` (line 140)
- `f_val` (line 144)
- `f_vallen` (line 148)
- `f_id` (line 152)
- `f_idlen` (line 156)
- `f_cls` (line 160)
- `f_clslen` (line 164)
- `f_href` (line 168)
- `f_hreflen` (line 172)
- `f_rel_ss` (line 176)
- `f_styleattr` (line 180)
- `f_stylelen` (line 184)
- `f_dump_css` (line 188)
- `f_dump_dom` (line 192)
- `f_mode` (line 196)
- `f_rawcap` (line 200)
- `f_depth` (line 204)
- `f_dom` (line 208)
- `f_domlen` (line 212)
- `f_css` (line 216)
- `f_csslen` (line 220)
- `f_linkhost` (line 224)
- `f_linkpath` (line 228)
- `f_linkn` (line 232)
- `f_cstage` (line 236)
- `f_csize` (line 240)
- `f_crem` (line 244)
- `f_bdone` (line 248)
- `atoi` (line 252)
- `append` (line 338)
- `ci_lower` (line 437)
- `ci_starts` (line 486)
- `ci_eq` (line 559)
- `ci_index` (line 656)
- `looks_like_url` (line 715)
- `has_scheme` (line 789)
- `make_search` (line 1064)
- `split_url` (line 1295)
- `resolve_redirect` (line 1810)
- `put_ws` (line 2333)
- `put_utf` (line 2379)
- `put_text` (line 2915)
- `put_entity` (line 3018)
- `css_append` (line 3849)
- `css_line` (line 3920)
- `dom_append` (line 3978)
- `dom_space` (line 4049)
- `dom_nl` (line 4083)
- `record_attr` (line 4117)
- `is_void_tag` (line 4449)
- `classify_tag` (line 4757)
- `body_byte` (line 5961)
- `head_line` (line 7203)
- `parse_head` (line 7460)
- `recv_body` (line 7676)
- `send_all` (line 7736)
- `fetch` (line 7810)
- `fetch_css` (line 9293)
- `print_css_dump` (line 10112)
- `print_dom_dump` (line 10212)
- `main` (line 10291)
- `_start` (line 11761)

#### `http.s`
**Path:** `progs/asm/http.s`

**Functions:**
- `atoi` (line 3)
- `main` (line 89)
- `_start` (line 709)

#### `json.s`
**Path:** `progs/asm/json.s`

**Functions:**
- `js_key` (line 3)
- `js_str` (line 7)
- `js_type` (line 11)
- `js_num` (line 15)
- `js_first` (line 19)
- `js_count` (line 23)
- `js_next` (line 27)
- `js_n` (line 31)
- `js_pool` (line 35)
- `js_plen` (line 39)
- `js_src` (line 43)
- `js_pos` (line 47)
- `js_len` (line 51)
- `js_err` (line 55)
- `js_read_all` (line 59)
- `js_new` (line 274)
- `js_skip_ws` (line 306)
- `js_peek` (line 397)
- `js_parse_string` (line 437)
- `js_parse_number` (line 851)
- `js_key_match` (line 947)
- `js_parse_object` (line 983)
- `js_parse_array` (line 1335)
- `js_parse_value` (line 1594)
- `js_indent` (line 2481)
- `js_print_str` (line 2524)
- `js_print_value` (line 2747)
- `js_find_member` (line 3313)
- `js_array_at` (line 3391)
- `js_query` (line 3460)
- `main` (line 3772)
- `_start` (line 4169)

#### `ldhello.s`
**Path:** `progs/asm/ldhello.s`

**Functions:**
- `main` (line 3)
- `_start` (line 14)

#### `lz4.s`
**Path:** `progs/asm/lz4.s`

**Functions:**
- `lz4_has` (line 3)
- `lz4_read_all` (line 156)
- `lz4_write_all` (line 371)
- `lz4_compress_file` (line 478)
- `lz4_decompress_file` (line 791)
- `main` (line 1228)
- `_start` (line 1535)

#### `lzss.s`
**Path:** `progs/asm/lzss.s`

**Functions:**
- `lz_win` (line 3)
- `lz_src` (line 7)
- `lz_srclen` (line 11)
- `lz_srcpos` (line 15)
- `lz_dst` (line 19)
- `lz_dstcap` (line 23)
- `lz_dstlen` (line 27)
- `lz_err` (line 31)
- `lz_buf` (line 35)
- `lz_mask` (line 39)
- `lz_in_getc` (line 43)
- `lz_out_put` (line 79)
- `lz_putbit1` (line 116)
- `lz_putbit0` (line 174)
- `lz_flush_bits` (line 223)
- `lz_out_literal` (line 251)
- `lz_out_pair` (line 321)
- `lz_next_mb` (line 447)
- `lz_encode` (line 451)
- `lz_getbit` (line 1051)
- `lz_decode` (line 1171)
- `lz_hdr_put` (line 1514)
- `lz_hdr_get` (line 1629)
- `lz_has` (line 1782)
- `lz_read_all` (line 1935)
- `lz_write_all` (line 2150)
- `lz_compress` (line 2257)
- `lz_decompress` (line 2628)
- `main` (line 3178)
- `_start` (line 3497)

#### `mtop.s`
**Path:** `progs/asm/mtop.s`

**Functions:**
- `h_cpu` (line 3)
- `h_mem` (line 7)
- `h_fill` (line 11)
- `last_dns` (line 15)
- `last_dns_ms` (line 19)
- `last_sock` (line 23)
- `prev_total` (line 27)
- `prev_idle` (line 31)
- `have_prev` (line 35)
- `disk_f` (line 39)
- `disk_path` (line 43)
- `sc3` (line 47)
- `mtop_time` (line 78)
- `mtop_rtc` (line 106)
- `mtop_key` (line 137)
- `mtop_minfo` (line 165)
- `emit` (line 206)
- `mtop_quit_key` (line 241)
- `mtop_clear_ansi` (line 317)
- `mtop_clear` (line 401)
- `mtop_atoi` (line 443)
- `mtop_putu` (line 569)
- `mtop_put2` (line 725)
- `mtop_put_kb` (line 765)
- `mtop_bar` (line 887)
- `mtop_hist_max` (line 1038)
- `mtop_hist_push` (line 1106)
- `mtop_spark` (line 1201)
- `mtop_mem` (line 1452)
- `mtop_cpu` (line 1556)
- `mtop_disk_open` (line 1842)
- `mtop_disk_read` (line 1966)
- `mtop_net_probe` (line 2128)
- `mtop_frame` (line 2275)
- `main` (line 3831)
- `_start` (line 4781)

#### `sign.s`
**Path:** `progs/asm/sign.s`

**Functions:**
- `sign_k0` (line 3)
- `sign_k1` (line 7)
- `sign_k2` (line 11)
- `sign_k3` (line 15)
- `sign_k4` (line 19)
- `sign_k5` (line 23)
- `sign_k6` (line 27)
- `sign_k7` (line 31)
- `sign_seed_hex` (line 35)
- `sign_bx_hex` (line 39)
- `sign_by_hex` (line 43)
- `sign_ax_hex` (line 47)
- `sign_ay_hex` (line 51)
- `sign_pub_hex` (line 55)
- `sign_note_name` (line 59)
- `sign_section_name` (line 63)
- `sign_k` (line 67)
- `sign_h` (line 71)
- `sign_w` (line 75)
- `sign_buf` (line 79)
- `sign_used` (line 83)
- `sign_nlo` (line 87)
- `sign_nhi` (line 91)
- `sign_q4` (line 95)
- `sign_l8` (line 99)
- `sign_gb` (line 103)
- `sign_ga` (line 107)
- `sign_hexval` (line 111)
- `sign_unhex` (line 232)
- `sign_byte` (line 325)
- `sign_copy` (line 363)
- `sign_strlen` (line 405)
- `sign_le16` (line 444)
- `sign_le32` (line 494)
- `sign_put32` (line 596)
- `sign_hexout` (line 688)
- `sign_offok` (line 866)
- `sign_rotr` (line 927)
- `sign_carry2` (line 1099)
- `sign_borrow2` (line 1158)
- `sign_add3` (line 1218)
- `sign_be32` (line 1292)
- `sign_block` (line 1394)
- `sign_sha_init` (line 3105)
- `sign_sha_update` (line 3287)
- `sign_sha_final` (line 3477)
- `sign_feed32` (line 3871)
- `sign_key_init` (line 3962)
- `fe_copy` (line 4387)
- `fe_zero` (line 4435)
- `fe_one` (line 4476)
- `fe_cmov` (line 4505)
- `fe_ge` (line 4589)
- `fe_rawsub` (line 4713)
- `fe_add` (line 4837)
- `fe_sub` (line 5031)
- `fe_rowadd` (line 5297)
- `fe_foldadd` (line 5426)
- `fe_mul` (line 5481)
- `fe_sq` (line 6109)
- `fe_inv` (line 6135)
- `fe_frombytes` (line 6284)
- `fe_tobytes` (line 6432)
- `fe_curved` (line 6586)
- `ge_copy` (line 6712)
- `fe_off` (line 6760)
- `ge_cmov` (line 6780)
- `ge_add` (line 6864)
- `ge_double` (line 7325)
- `ge_scalarmult` (line 7701)
- `sc_mod_l` (line 7916)
- `sc_mul_add` (line 8461)
- `sign_rev32` (line 9013)
- `sign_points_init` (line 9084)
- `sign_digest` (line 9485)
- `sign_read` (line 10733)
- `sign_write` (line 10972)
- `sign_note_span` (line 11061)
- `sign_digest_of` (line 11374)
- `sign_patch_notes` (line 11834)
- `sign_append` (line 12154)
- `sign_file` (line 13433)
- `sign_selftest` (line 14501)
- `main` (line 14647)
- `_start` (line 14926)

#### `w1.s`
**Path:** `progs/asm/w1.s`

**Functions:**
- `main` (line 3)
- `_start` (line 37)

### SH (17 files)

#### `mutate_mcp.sh`
**Path:** `mcp/mutate_mcp.sh`
**File Doc:** *Mutation testing for the MiniOS MCP bridge. Every mutant is injected into a private copy of minios_mcp.py and run against the unit and BDD suite. A mutant that survives (suite fully green) exposes a test gap.  Suites run in parallel (one worker per core, MUTATE_JOBS to override); each mutant gets its own pid file and addon state so the runs stay independent.  Mutation format: "name | sed -i expression | file"*

**Functions:**
- `run_one` (line 116) - *Each mutant runs the suite in its own directory with its own pid file and addon state, so the runs are independent and may execute in parallel. The worker writes the exit code; the loop below maps it onto the verdict.*

#### `fetch.sh`
**Path:** `progs/pokemon/fetch.sh`
**File Doc:** *fetch.sh - clone the gb-recompiled tool into progs/pokemon/upstream.  The upstream project ships the recompiler + runtime, but no ROMs and no pre-generated game code (see its README). You generate a project from a ROM you legally own, then point the MiniOS build at it. See README.md.  Usage: ./fetch.sh   (safe to re-run; never touches an existing checkout)*

*No symbols extracted*

#### `test_all.sh`
**Path:** `progs/src/test_all.sh`
**File Doc:** *test_all.sh -- comprehensive non-interactive test suite for MiniOS.  Run with:  sh src/test_all.sh  Every test prints a PASS: or FAIL: marker.  The host-side runner greps the QEMU serial log for these markers. No interactive commands, no external server dependencies.  === HELP & CLEAR ===*

*No symbols extracted*

#### `host_aes.sh`
**Path:** `tests/host_aes.sh`
**File Doc:** *host_aes.sh - host-side verification for the AES-256-CTR command tools.  The miniGCC-built tools are static Linux ELFs, so they run on the host. This script checks the cipher core against two independent references (NIST SP 800-38A F.5.5 CTR-AES256 and OpenSSL) plus roundtrip, dispatch, empty input and the fail-closed rejection paths.  Usage: tests/host_aes.sh <progs_dir>*

**Functions:**
- `ok` (line 23)
- `bad` (line 24)
- `rd` (line 25)

#### `host_codecs.sh`
**Path:** `tests/host_codecs.sh`
**File Doc:** *host_codecs.sh - reusable host-side verification for the in-OS codec tools.  The miniGCC-compiled tools are static Linux ELFs (the kernel runs Linux binaries unmodified), so they execute on the host too.  This script drives them with a host file: roundtrip, fail-closed rejection, and (for lzss) bidirectional interop against the reference Okumura codec in $LZSS_REF_SRC.  LZ4 cannot interop on the host because it goes through MiniOS syscalls 216/217, so only its lzss-style roundtrip + reject paths are exercised here; the kernel LZ4 roundtrip is covered by test_lz4_kernel.  Usage: host_codecs.sh <progs_dir> <progs_dir>  the miniOS progs/ dir containing bin/lzss, bin/unlzss, ... Environment: LZSS_REF_SRC (default ../../CompressLoader/lzss.c)*

**Functions:**
- `ok` (line 22)
- `bad` (line 23)
- `gen_input` (line 27)
- `roundtrip` (line 31)
- `reject` (line 40)

#### `boot_run.sh`
**Path:** `tools/boot_run.sh`
**File Doc:** *boot_run.sh -- boot the MiniOS image in QEMU and drive the shell over the serial console with a list of commands, capturing the full transcript.  This is the reusable harness behind the one-shot manual checks (lua in-OS suite, DOOM/Quake 2 autoquit render tests, toolchain compile/link/run) so a future run does not hand-roll a QEMU launch.  The guest powers itself off through the ACPI port; the timeout is only a safety net for hangs.  Usage: tools/boot_run.sh "cmd1" "cmd2" ... [--timeout N] [--log FILE]  - every non-option argument is a shell command sent to the guest in order - --timeout N   per-run timeout in seconds (default 200) - --log FILE    write the console transcript to FILE (default ./boot_run.log)  Examples: tools/boot_run.sh "lua src/test.lua" tools/boot_run.sh "gfx frames" "run doomgeneric.elf mini_autoframes 150" \ "gfx frames" --timeout 200 tools/boot_run.sh "gfx frames" \ "run bin/quake2generic.elf +set basedir . +set minios_autoframes 400" \ "gfx frames" --timeout 300*

*No symbols extracted*

#### `install.sh`
**Path:** `tools/install.sh`

*No symbols extracted*

#### `lisp_scoped.sh`
**Path:** `tools/lisp_scoped.sh`
**File Doc:** *Docstring: Scoped Lisp validation for the MiniOS interpreter contract. Builds the ring-3 static ELF with zero warnings, runs the host suite, and asserts each scoped mutant dies. Fails closed on first gap.*

**Functions:**
- `say` (line 8)
- `die` (line 9)
- `mutant` (line 20)
- `lisp_mut` (line 41)
- `mut_usage` (line 63)

#### `make_usb.sh`
**Path:** `tools/make_usb.sh`
**File Doc:** *Build the MiniOS bootable USB image and optionally write it to a device.  Wraps the Makefile targets so there is a single source of truth for the layout (os.usb.img), the distribution copy (os.iso) and the write safety checks (make usb): this script only orchestrates, it never writes bytes itself.  Usage: tools/make_usb.sh [--list] [--device /dev/sdX] [--yes] [--vdi]  With no arguments and a terminal on stdin, runs an interactive wizard that asks for every needed value step by step and ends with a bootable USB stick. With no arguments and no terminal (pipe, CI), builds the image, lists candidate devices and exits without writing anything.  Inputs: --list            print candidate target devices and exit. --device DEV      write the image to DEV after building it. --yes             answer the Makefile YES confirmation non-interactively. System-disk and size refusals still apply, they are never skipped. --vdi             also build os.vdi for VirtualBox (hard disk attach). --help            print this help and exit. USB=/dev/sdX      environment fallback for --device.  Outputs: os.usb.img, os.iso (and os.vdi with --vdi) in the repository root.  Failure modes:*

**Functions:**
- `usage` (line 40)
- `wizard` (line 56)

#### `mkroots.sh`
**Path:** `tools/mkroots.sh`
**File Doc:** *mkroots.sh - regenerate tls_roots.h from the DER files in tls_roots_src/.  Provenance of each root (2026 web PKI reality; everything a real site chains to is one of these):  isrg_root_x1.der          Let's Encrypt ISRG Root X1 (RSA, older chains) https://letsencrypt.org/certs/isrg-root-x1.pem isrg_root_x2.der          Let's Encrypt ISRG Root X2 (ECDSA P-384, current) https://letsencrypt.org/certs/isrg-root-x2.pem digicert_global_root_g2.der  DigiCert Global Root G2 (RSA) https://cacerts.digicert.com/DigiCertGlobalRootG2.crt globalsign_root_r3.der    GlobalSign Root CA R3 (RSA) https://secure.globalsign.com/cacert/root-r3.crt gts_root_r4.der           Google Trust Services Root R4 (ECDSA P-384) https://pki.goog/repo/certs/gtsr4.pem sslcom_ecc_2022.der       SSL.com TLS ECC Root CA 2022 (Cloudflare ECC chains) sslcom_rsa_2022.der       SSL.com TLS RSA Root CA 2022 (Cloudflare RSA chains)  The two SSL.com roots have no stable public URL; they are extracted from the certificate chain example.com serves (openssl s_client -showcerts, ECDHE-ECDSA and ECDHE-RSA respectively). The build never runs this script: tls_roots.h is a committed input, regenerated only when the root set changes.*

*No symbols extracted*

#### `mutate.sh`
**Path:** `tools/mutate.sh`
**File Doc:** *Mutation testing for MiniOS.  Each mutation is applied to the source in place, the disk image is rebuilt and the behavioural suite is run in fail-fast mode. A mutant that survives a full green suite exposes a gap that must be closed by adding a scenario, never by deleting the mutant.  The sources are backed up before the first mutation and restored on every exit path, including interrupts. A mutation whose expression matches nothing is reported as broken rather than surviving: `sed -i` exits zero when it changes nothing, which would otherwise rebuild pristine sources and look like a test gap.  Progress is persisted to a state file (default .mutate-state in the repo root, overridable with --state or MINIOS_MUTATE_STATE). A run therefore RESUMES where it left off: mutants already recorded are skipped, so a timed-out run can be picked up without re-running the finished ones. The state file is just a list of "name outcome" lines and can be edited by hand to re-target work.  Usage: mutate.sh                     full run, resuming from the first mutant not yet recorded in the state file mutate.sh --from NAME         force-run from the mutant NAME onward, ignoring recorded state for those mutants mutate.sh --match REGEX       only run mutants whose name matches REGEX mutate.sh --limit N           run at most N mutants this invocation mutate.sh --state FILE        use FILE as the progress file mutate.sh --reset             clear the state file and run the full suite*

**Functions:**
- `usage` (line 51)
- `restore_sources` (line 137)
- `cleanup` (line 144)
- `record` (line 536)
- `find_index` (line 542) - *Locate a mutant by name.*

#### `qga_test.sh`
**Path:** `tools/qga_test.sh`
**File Doc:** *Quick standalone smoke test for the QEMU guest agent: boots os.img once with the agent socket chardev, waits for the shell prompt, drives qga_client.py against the socket, and asserts the replies. Exits nonzero on any failure.  This is the low-cost (single boot) check used during development; the full end-to-end coverage lives as a scenario in test_bdd.sh.  Env overrides: QEMU, IMAGE, MEM, TMO, MINIOS_GA_SOCK.*

**Functions:**
- `cleanup` (line 25)
- `check` (line 31)
- `expect_in` (line 43)

#### `test_bdd.sh`
**Path:** `tools/test_bdd.sh`
**File Doc:** *BDD suite for MiniOS: boots the disk image in QEMU and drives the shell over the serial console (COM1). Every scenario sends a script of shell commands, then asserts that the expected markers appear in the console log.  The guest powers itself off through the ACPI port at the end of each scenario, which makes QEMU exit; the timeout is only a safety net for hangs. A stale-qemu guard prevents image-lock cascades between runs.  Environment overrides: QEMU, TMO (per-scenario timeout), KEEP_LOG=1 to keep the console log of the last scenario for inspection.*

**Functions:**
- `should_run` (line 35) - *MATCH filter: skip scenarios whose name lacks the substring (and make the following expects no-ops so a skipped boot can't fail on a stale log).*
- `cleanup_stale_qemu` (line 43)
- `scenario` (line 56) - *scenario <name> <script of shell commands> [timeout-seconds] The optional third argument overrides TMO for scenarios that boot the full interpreter several times (pip is slow under emulation).*
- `scenario_smp` (line 77) - *scenario_smp <name> <script> -- same as scenario but with -smp 2*
- `expect` (line 100) - *expect <marker> The marker is a grep BRE pattern, not a literal: never write [...] in one (a "[pid]" matches one char of {p,i,d}, never the brackets).*
- `expect_min` (line 123) - *expect_min <count> <marker>: the marker must appear at least that many times in the log. Used where the exact count depends on how much history the console holds (a scrollback view echoes the whole viewport, so the same line can show up once per page).*
- `expect_count` (line 148) - *expect_count <count> <marker>: the marker must appear exactly that many times in the log. Used where a single occurrence would also match the echoed command line, so only the output can prove the behaviour.*
- `refute` (line 171) - *refute <marker>: the marker must NOT appear (suppressed hostile content).*
- `scenario_uefi` (line 196)
- `usb_stick_ready` (line 672) - *A FAT32 data stick on xHCI becomes the block backend and reads through BOT: partition discovery, directory listing and file bytes all come off USB. The stick image is built on demand with the host tools (sfdisk, mkfs.vfat, mcopy) and the scenario skips cleanly when they are absent (same doctrine as the QEMU-absent and OVMF skips).*
- `http_server_start` (line 1487)
- `http_server_stop` (line 1494)
- `http_fixture_start` (line 1499)
- `http_fixture_stop` (line 1506)
- `net_fixture_start` (line 1511)
- `net_fixture_stop` (line 1518)

#### `test_codecs.sh`
**Path:** `tools/test_codecs.sh`
**File Doc:** *test_codecs.sh -- exercise the lzss/lz4/aes command-pair tools inside the OS.  The interpreter in-OS suites (test.lua / test.py) cannot run these ET_EXEC tools: SYS_SPAWN of an ET_EXEC child from inside an interpreter must save the parent's user window, which cannot fit the heap (a pre-existing limitation), so minios.run() returns nil and those tests report FAIL.  The shell CAN run ET_EXEC binaries, so this harness drives the real compress/decompress and encrypt/decrypt roundtrips through the serial console instead.  Usage: tools/test_codecs.sh  Exits 0 when every roundtrip checks out, 1 otherwise.*

*No symbols extracted*

#### `test_sb16.sh`
**Path:** `tools/test_sb16.sh`
**File Doc:** *test_sb16.sh — targeted BDD harness for the SB16 audio path.  Boots the disk image once with the SB16 device attached (headless, null audio backend) and drives the shell over the serial console:  run sbtone    streams 440 Hz PCM and reports how many buffers the ring actually accepted over a 3 s guest window; sb16          prints the driver's re-arm and submit/drop counters.  A healthy driver must drain the 7-slot ring via the timer watchdog (the null backend never raises a completion IRQ), so sbtone must accept ~32 of ~33 buffers and the counters must show poll arms > 0 and drops of 0.  This is the regression test for the wedge where the ring filled once and every later submit was refused.  Exits nonzero on any failed assertion.*

**Functions:**
- `fail_msg` (line 45)

#### `wl_scoped.sh`
**Path:** `tools/wl_scoped.sh`
**File Doc:** *Docstring: Scoped Wayland-mini validation for the tiled ring-3 compositor. Runs host wire, mailbox and palette tests, rebuilds the guest wlcomp binary with zero warnings, and asserts scoped mutants die. Fails closed.*

**Functions:**
- `say` (line 8)
- `die` (line 9)
- `mut` (line 77)
- `mutm` (line 84)

#### `wm_scoped.sh`
**Path:** `tools/wm_scoped.sh`
**File Doc:** *Docstring: Scoped WM validation for Alt-Tab and tile across all windows. Runs host WM unit tests, rebuilds touched kernel objects with zero warnings, and asserts scoped mutants die. Fails closed on first gap.*

**Functions:**
- `say` (line 8)
- `die` (line 9)
