isStructUnionClass reports whether the type described by the Go syntax x is a struct, union, or class with a tag.
(x ast.Expr)
| 2740 | // isStructUnionClass reports whether the type described by the Go syntax x |
| 2741 | // is a struct, union, or class with a tag. |
| 2742 | func isStructUnionClass(x ast.Expr) bool { |
| 2743 | id, ok := x.(*ast.Ident) |
| 2744 | if !ok { |
| 2745 | return false |
| 2746 | } |
| 2747 | name := id.Name |
| 2748 | return strings.HasPrefix(name, "_Ctype_struct_") || |
| 2749 | strings.HasPrefix(name, "_Ctype_union_") || |
| 2750 | strings.HasPrefix(name, "_Ctype_class_") |
| 2751 | } |
| 2752 | |
| 2753 | // FuncArg returns a Go type with the same memory layout as |
| 2754 | // dtype when used as the type of a C function argument. |