From 40f087e0b29a57d01266d437c58d983f493a03b2 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 27 Jan 2025 16:16:06 +0100 Subject: [PATCH] scripts: gen-uuid-reg.py: Generate string identifier for toml files 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 --- scripts/gen-uuid-reg.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/gen-uuid-reg.py b/scripts/gen-uuid-reg.py index 3bdd7258cca9..ddd7f06658ea 100755 --- a/scripts/gen-uuid-reg.py +++ b/scripts/gen-uuid-reg.py @@ -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():