123456789101112131415161718192021222324252627282930313233343536373839[@@@warning"-9-27"]includeCtypesletliftx=xopenCtypes_staticletrecfield:typeta.ttyp->string->atyp->(a,t)field=funsfnameftype->matchs,fnamewith|View{ty;_},_->let{ftype;foffset;fname}=fieldtyfnameftypein{ftype;foffset;fname}|_->failwith("Unexpected field "^fname)letrecseal:typea.atyp->unit=function|Struct{tag;spec=Complete_;_}->raise(ModifyingSealedTypetag)|Union{utag;uspec=Some_;_}->raise(ModifyingSealedTypeutag)|View{ty;_}->sealty|_->raise(Unsupported"Sealing a non-structured type")type'aconst='aletconstant(typet)name(t:ttyp):t=matcht,namewith|Ctypes_static.PrimitiveCstubs_internals.Int64_t,"GI_VFUNC_THROWS"->8L|Ctypes_static.PrimitiveCstubs_internals.Int64_t,"GI_VFUNC_MUST_NOT_OVERRIDE"->4L|Ctypes_static.PrimitiveCstubs_internals.Int64_t,"GI_VFUNC_MUST_OVERRIDE"->2L|Ctypes_static.PrimitiveCstubs_internals.Int64_t,"GI_VFUNC_MUST_CHAIN_UP"->1L|_,s->failwith("unmatched constant: "^s)letenum(typea)name?typedef?unexpected(alist:(a*int64)list)=matchnamewith|"GIVFuncInfoFlags"->Cstubs_internals.build_enum_type"GIVFuncInfoFlags"Ctypes_static.Uint32?typedef?unexpectedalist|s->failwith("unmatched enum: "^s)