converting typename to prefix now removes leading "enum " or "struct "

main
Sara 2023-09-13 10:40:13 +02:00
parent 675aadbe0d
commit fdf11cec7a
1 changed files with 6 additions and 0 deletions

View File

@ -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;