mie: implement simple type comparison
This commit is contained in:
@@ -36,5 +36,6 @@ struct mie_type {
|
|||||||
extern struct mie_type *mie_type_create(void);
|
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 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
|
#endif
|
||||||
|
|||||||
18
mie/type.c
18
mie/type.c
@@ -73,3 +73,21 @@ void mie_type_to_string(const struct mie_type *type, char *out, size_t max)
|
|||||||
break;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user