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; +}