add helpers is_struct_type() & is_union_type()
PATCH 1/1 add helpers is_struct_type() & is_union_type()
From: Ilya Maximets <[email protected]>
Signed-off-by Ilya Maximets <[email protected]>
Signed-off-by Luc Van Oostenryck <[email protected]>
--- symbol.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
symbol.h +14 -0
@@ -425,6 +425,20 @@ static inline int is_array_type(struct symbol *type)return type->type ==SYM_ARRAY ; } +static inline int is_struct_type (struct symbol *type) +{ +if (type->type ==SYM_NODE ) + type = type->ctype.base_type; +return type->type ==SYM_STRUCT ; +} + +static inline int is_union_type (struct symbol *type) +{ +if (type->type ==SYM_NODE ) + type = type->ctype.base_type; +return type->type ==SYM_UNION ; +} +static inline int is_float_type (struct symbol *type) {if (type->type ==SYM_NODE )
Signature · 1 line
2.28.0