From fdf11cec7a609dac3ec0ff9d1c6659bc07ee2be6 Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 13 Sep 2023 10:40:13 +0200 Subject: [PATCH] converting typename to prefix now removes leading "enum " or "struct " --- src/kwil_generate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kwil_generate.c b/src/kwil_generate.c index f0ed50e..453f257 100644 --- a/src/kwil_generate.c +++ b/src/kwil_generate.c @@ -15,6 +15,12 @@ int kwil_header_generated_file_name(struct kwil_header_t* self, char** out) { static int kwil_typename_to_prefix(const char* restrict type_name, char* out_prefix, size_t out_size) { + if(strncmp("enum ", type_name, 5) == 0) { + type_name += 5; + } else if(strncmp("struct ", type_name, 7) == 0) { + type_name += 7; + } + int len = strlen(type_name); if(len > out_size) { return 1;