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 uuid 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 <[email protected]>
  • Loading branch information
softwarecki authored and kv2019i committed Feb 7, 2025
1 parent 26e0e36 commit 40f087e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/gen-uuid-reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ 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 40f087e

Please sign in to comment.