mirror of
https://github.com/rizinorg/rizin
synced 2026-08-22 20:26:16 -04:00
format.c can already turn an RzType into a pf format string. Add the inverse in the same file, next to its counterparts: rz_type_format_to_c_declaration() parses a pf format string with rz_pf_parse() and emits an equivalent C struct/union declaration built from the standard fixed-width types (uint8_t, int32_t, float, ...). The conversion is structural: it consumes only the parsed RzPfFormat (field kinds, widths, array counts, pointer flags), never a byte buffer, so it runs without any target data. Every field kind the engine produces is mapped; a handful of specifiers with no exact static C form are mapped best-effort (documented inline): @N alignment is dropped, an unknown-length inline z string becomes char *, LEB128 widens to its largest decoded integer, and ?(Name) / E(Name) emit struct/enum references that must themselves be defined to parse. Added new 'tdf' command that exposes that conversion to the user Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com> |
||
|---|---|---|
| .. | ||
| examples | ||
| img | ||
| asm_strings.md | ||
| avr.md | ||
| calling-conventions.md | ||
| crosscompile.md | ||
| debug-internals.md | ||
| debug.md | ||
| esil.md | ||
| fortunes.fun | ||
| fortunes.tips | ||
| gdb.md | ||
| hud | ||
| PACKAGERS.md | ||
| pf.md | ||
| register_profile.md | ||
| release-template.md | ||
| RELEASE.md | ||
| rzil.md | ||
| rzshell.md | ||
| siol.md | ||
| windbg.md | ||