converting typename to prefix now removes leading "enum " or "struct "
parent
675aadbe0d
commit
fdf11cec7a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue