Skip to content

Commit

Permalink
scripts: gen-uuid-reg.py: Generate string identifier for toml files
Browse files Browse the repository at this point in the history
Extend the script that generates the uuid-registry.h file to also generate
definitions containing the ID as a string. These definitions
(UUIDREG_STR_...) can be used in toml files, allowing get values from the
uuid-registry.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
  • Loading branch information
softwarecki committed Jan 27, 2025
1 parent c6a6e17 commit 837eabd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/gen-uuid-reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def emit_uuid_rec(uu, sym):
uuidinit = "{ " + ", ".join(wrecs) + ", { " + ", ".join(byts) + " } }"
out_recs.append(f"#define _UUIDREG_{sym} {uuidinit}")

uuidstr = uu[:23] + '-' + uu[23:]
out_recs.append(f'#define UUIDREG_STR_{sym.upper()} "{uuidstr}"')


def main():
with open(sys.argv[1]) as f:
for line in f.readlines():
Expand Down

0 comments on commit 837eabd

Please sign in to comment.