func DumpStructInfo(info *C.GIStructInfo) { align := C.g_struct_info_get_alignment(info) p("alignment %d bytes\n", align) size := C.g_struct_info_get_size(info) p("size %d bytes\n", size) isGtypeStruct := C.g_struct_info_is_gtype_struct(info) == C.gboolean(1) p("is gtype struct %v\n", isGtypeStruct) isForeign := C.g_struct_info_is_foreign(info) == C.gboolean(1) p("is foreign %v\n", isForeign) nFields := C.g_struct_info_get_n_fields(info) p("%d fields\n", nFields) for i := C.gint(0); i < nFields; i++ { field := C.g_struct_info_get_field(info, i) DumpFieldInfo(field) } nMethods := C.g_struct_info_get_n_methods(info) p("%d methods\n", nMethods) for i := C.gint(0); i < nMethods; i++ { f := C.g_struct_info_get_method(info, i) DumpFunctionInfo(f) } }
// g_struct_info_get_field func (si *StructInfo) Field(n int) *FieldInfo { ptr := &BaseInfo{(*C.GIBaseInfo)(C.g_struct_info_get_field((*C.GIStructInfo)(si.c), C.gint(n)))} return (*FieldInfo)(unsafe.Pointer(_SetBaseInfoFinalizer(ptr))) }
func (info *GiInfo) GetStructField(n int) *GiInfo { return NewGiInfo((*C.GIBaseInfo)(C.g_struct_info_get_field((*C.GIStructInfo)(info.ptr), GlibInt(n)))) }