mie: implement simple type comparison

This commit is contained in:
2025-09-08 15:39:55 +01:00
parent 5a56566939
commit 8c13fb88c0
2 changed files with 19 additions and 0 deletions

View File

@@ -36,5 +36,6 @@ struct mie_type {
extern struct mie_type *mie_type_create(void);
MIE_API void mie_type_to_string(const struct mie_type *type, char *out, size_t max);
MIE_API bool mie_type_compare(const struct mie_type *a, const struct mie_type *b);
#endif

View File

@@ -73,3 +73,21 @@ void mie_type_to_string(const struct mie_type *type, char *out, size_t max)
break;
}
}
bool mie_type_compare(const struct mie_type *a, const struct mie_type *b)
{
if (a->t_id != b->t_id) {
return false;
}
if (a->t_count != b->t_count) {
return false;
}
if (a->t_width != b->t_width) {
return false;
}
/* TODO compare complex types */
return true;
}