padlock-output
Output formatters for padlock — a struct memory layout analyzer for C, C++, Rust, Go, and Zig.
This crate turns padlock-core Report and StructLayout types into human-readable or machine-readable output:
| Module | Function | Output |
|---|---|---|
summary |
render_report(&report) |
Terminal output, grouped by file with ── filename ── headers and :line locations; appends skipped-types and uncertain-fields notes |
project_summary |
render_project_summary(&input) |
Single-screen project health: weighted score, letter grade, severity bar chart, worst files/structs table |
explain |
render_explain(&layout) |
Visual field layout table with offset/size/align/CL columns, inline padding gaps, cache-line separators |
markdown |
to_markdown(&report) |
GitHub-Flavored Markdown report (score emoji, severity emoji, GFM tables) for $GITHUB_STEP_SUMMARY |
json |
to_json(&report) |
JSON serialization of the full report, including skipped and uncertain_fields |
sarif |
to_sarif(&report) |
SARIF 2.1.0 for GitHub/GitLab code-scanning; skipped types appear as notifications |
diff |
render_diff(&layout) |
Unified diff of current vs optimal field order |
Usage
padlock-output is an internal library crate. To get formatted output, use the CLI:
Part of padlock
padlock-cli— CLI (padlock+cargo-padlockbinaries)padlock-core— IR, analysis passes, findingspadlock-source— Source analysis (C/C++/Rust/Go)padlock-dwarf— Binary analysis (DWARF/PDB)padlock-output— Output formatters (terminal/JSON/SARIF/diff) (this crate)padlock-macros— Compile-time layout assertions