From 15c7b7470e7f59a08df83daa6580c1eb7a60e5b9 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Mon, 8 Sep 2025 15:39:55 +0100 Subject: [PATCH] mie: implement simple type comparison --- mie/include/mie/type.h | 1 + mie/type.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/mie/include/mie/type.h b/mie/include/mie/type.h index 612bcea..a19b37a 100644 --- a/mie/include/mie/type.h +++ b/mie/include/mie/type.h @@ -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 diff --git a/mie/type.c b/mie/type.c index f205090..837b444 100644 --- a/mie/type.c +++ b/mie/type.c @@ -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; +}