def dereference_type(t):
    """ Removes everything after the last star character in a type string,
    except for 'void *' and 'char *`. """
    if t.strip() in ["void *", "char *"]:
        return t.strip()
    try:
        return t[:t.rindex("*")].strip()
    except:
        return t.strip()