1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495(*
* Copyright 2017-2019 Cedric LE MOIGNE, cedlemo@gmx.com
* This file is part of OCaml-GObject-Introspection.
*
* OCaml-GObject-Introspection is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OCaml-GObject-Introspection is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OCaml-GObject-Introspection. If not, see <http://www.gnu.org/licenses/>.
*)openCtypesopenForeigntypetletarginfo:tstructuretyp=structure"Arg_info"letget_direction=foreign"g_arg_info_get_direction"(ptrarginfo@->returningStubs.Arg_info.direction)letget_closure=foreign"g_arg_info_get_closure"(ptrarginfo@->returningint)letget_destroy=foreign"g_arg_info_get_destroy"(ptrarginfo@->returningint)letget_ownership_transfer=foreign"g_arg_info_get_ownership_transfer"(ptrarginfo@->returningStubs.Arg_info.transfer)letmay_be_null=foreign"g_arg_info_may_be_null"(ptrarginfo@->returningbool)letis_caller_allocates=foreign"g_arg_info_is_caller_allocates"(ptrarginfo@->returningbool)letis_optional=foreign"g_arg_info_is_optional"(ptrarginfo@->returningbool)letis_return_value=foreign"g_arg_info_is_return_value"(ptrarginfo@->returningbool)letis_skip=foreign"g_arg_info_is_skip"(ptrarginfo@->returningbool)letget_scope=foreign"g_arg_info_get_scope"(ptrarginfo@->returningStubs.Arg_info.scope_type)letget_typeinfo=letget_type_raw=foreign"g_arg_info_get_type"(ptrarginfo@->returning(ptrType_info.typeinfo))inletinfo'=get_type_rawinfoinType_info.add_unref_finaliserinfo'(* TODO : check that the info can be casted to arg info ? *)letcast_from_baseinfoinfo=coerce(ptrBase_info.baseinfo)(ptrarginfo)infoletcast_to_baseinfoinfo=coerce(ptrarginfo)(ptrBase_info.baseinfo)infoletadd_unref_finaliserinfo=let_=Gc.finalise(funi->leti'=cast_to_baseinfoiinBase_info.base_info_unrefi')infoininfoletfrom_baseinfoinfo=let_=Base_info.base_info_refinfoinletinfo'=cast_from_baseinfoinfoinadd_unref_finaliserinfo'letto_baseinfoinfo=letinfo'=cast_to_baseinfoinfoinlet_=Base_info.base_info_refinfo'inlet_=Gc.finalise(funi->Base_info.base_info_unrefi)info'ininfo'