aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/types.c b/types.c
index c8cb4e33..c943eb85 100644
--- a/types.c
+++ b/types.c
@@ -105,6 +105,16 @@ CORD type_to_cord(type_t *t) {
}
}
+PUREFUNC const char *get_type_name(type_t *t)
+{
+ switch (t->tag) {
+ case TextType: return Match(t, TextType)->lang;
+ case StructType: return Match(t, StructType)->name;
+ case EnumType: return Match(t, EnumType)->name;
+ default: return NULL;
+ }
+}
+
int printf_pointer_size(const struct printf_info *info, size_t n, int argtypes[n], int sizes[n])
{
if (n < 1) return -1;