"Egil H. H�vik" wrote in message news:41342a34@193.71.169.73... > > "Jano" wrote in message > news:2ph6fjFkpsahU1@uni-berlin.de... > > Hi, > > > > > function Blah (Datum : access Data) return C.Int; > > pragma Import (C, Blah); > > > > > > Procedure Ada_Blah (Datum : out Data); > > -- May raise some exception > > > > And my doubt, finally, is: can I ensure somehow that Datum is passed by > > reference?, so I can do inside Ada_Blah [1]: > > > > Helper : aliased Datum; > > For Helper'Address use Datum'Address; > > if Thin_Package.Blah (Helper'Access) = Error_Value then > > raise My_Error; > > end if; > > > > Well, you say Data is a record type, so what's wrong with: > > procedure Ada_Blah( Datum : out Data ) is > function Blah( Datum : Data ) return C.int; > pragma Import( C, Blah ); > begin > if Thin_Package.Blah(Datum) = Error_Value then hmm... Copy-Paste error here... Should be Blah(Datum), minus Thin_Package > raise My_Error; > end if; > end Ada_Blah; > > > B.3(65): "An Ada function corresponds to a non-void C function" > B.3(69): "An Ada parameter of a record type T, of any mode, is passed as a > t* argument > to a C function, where t is the C type corresponding to the Ada type T." > > > ~egilhh > >