Skip to main content

Module fixgen

Module fixgen 

Source

Functionsยง

apply_fixes_c
Apply C/C++ struct reorderings in-place, returning the modified source. Each layout in layouts is looked up by name; matched structs are replaced with the optimally-ordered definition. Replacements are applied back-to-front so byte offsets remain valid.
apply_fixes_go
Apply Go struct reorderings in-place, returning the modified source.
apply_fixes_rust
Apply Rust struct reorderings in-place, returning the modified source.
apply_fixes_zig
Apply Zig struct reorderings in-place, returning the modified source.
find_c_struct_span
Find the byte range of a named struct/union in C/C++ source. The range covers from struct/union Name through the closing };.
find_go_struct_span
Find the byte range of a named struct in Go source (type Name struct { ... }).
find_rust_struct_span
Find the byte range of a named struct in Rust source (struct Name { ... }).
find_zig_struct_span
Find the byte range of a named Zig struct in source. Matches const Name = [packed|extern ]struct { ... };.
generate_c_fix
Render a reordered C/C++ struct definition as source text.
generate_go_fix
Render a reordered Go struct definition as source text.
generate_rust_fix
Render a reordered Rust struct definition as source text.
generate_zig_fix
Render a reordered Zig struct definition as source text. Zig structs are declared as const Name = struct { ... };. If the layout is packed, the output uses packed struct.
unified_diff
Produce a unified diff between original and fixed source text.