ziglang/zig
resinator
Active contributors: squeek502, andrewrk
Purpose
lib/compiler/resinator/ is a complete Zig-language implementation of a Windows resource compiler — the .rc → .res pipeline historically owned by Microsoft's rc.exe. It backs zig rc and lets the Zig toolchain build Windows applications with embedded resources without depending on an external rc.exe.
Directory layout
lib/compiler/resinator/ contains the resource lexer, preprocessor (compatible with the rc.exe flavor of the C preprocessor), parser, AST, evaluator, code generator (producing .res), and link-side support. The directory is large; it is the entire project vendored into zig.
What zig rc does
zig rc <args> accepts the same flags as rc.exe and produces a .res (Windows binary resource) file from .rc input. It handles:
- The Microsoft preprocessor's quirks (token pasting,
#pragmahandling). - The
rc.exeparser (RC's grammar is its own, not C-compatible). - Generation of all standard resource types:
MENU,DIALOG,STRINGTABLE,VERSIONINFO,ACCELERATORS,ICON,BITMAP,CURSOR, custom data, etc. - Code-page conversion of strings.
- COFF object emission so the result can be linked directly by
zig/lld.
Integration points
zig rcdispatches insrc/main.zigto resinator.zig build-exe -fuse-rc=...and similar flags (insrc/main.zig) use it transparently when a Windows target is selected.std.Build.Stepfor resource compilation is built on top ofzig rc.
Tests
Tests for resinator live alongside the project (under lib/compiler/resinator/) and are wired into zig build test via test/tests.zig.
Key source files
| File / dir | Purpose |
|---|---|
lib/compiler/resinator/ |
The full project. |
src/main.zig (zig rc dispatch) |
Entry from the CLI. |
lib/std/coff.zig |
COFF reader/writer used to emit .res-derived sections. |
See Bundled libraries for the rest of the Windows toolchain story (mingw-w64 headers, libc, etc.).
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.