def _pointed_type(tp):
    """Return the pointed type if this is a pointer, otherwise None."""
    tp_nam = tp.__name__

    if tp_nam.startswith("LP_"):
        if tp_nam.startswith("LP_c_") or tp_nam.startswith("LP_4_") or tp_nam.startswith("LP_8_"):
            return tp_nam[5:]
        return None

    if tp_nam == "c_void_p":
        return "void"

    return None