comp.lang.ada
 help / color / mirror / Atom feed
From: David Kirkland <david@array.ca>
Subject: Re: C Interface question
Date: 1996/07/16
Date: 1996-07-16T00:00:00+00:00	[thread overview]
Message-ID: <31EBB8FB.35F7@array.ca> (raw)
In-Reply-To: DuDwCv.4p@jvdsys.nextjk.stuyts.nl


Jerry van Dijk wrote:
> 
> Laurent Guerby (guerby@gnat.com) wrote:
> 
> : Jerry>        int *function(int value, int *result);
> 
> :    type int_star is access C.int;
> :    pragma Convention (C, Int_Star);
> 
> :    function F (Value : C.int; Result : int_star) return int_star;
> :    pragma Convention (C, F);
> 
> Of course, why do I always overlook the obvious ? This way I will never
> become rich and famous :-)
> 
> Thanks!
> --
> -----------------------------------------------------------------------
> --  Jerry van Dijk       --   e-mail: jerry@jvdsys.nextjk.stuyts.nl  --
> --  Banking Consultant   --              Member Team-Ada             --
> --  Ordina Finance BV    --    Located at Haarlem, The Netherlands   --

Hi all,
I have a similar question. I'm using an Ada83 compiler and have to
interface to a C function similar to the above except it contains
a pointer to a pointer ie.)

int *function(int value, int **result);

Now obviously I can use an access type to an access type, an extention
of what was posted earlier. My question is this - Is an access type
guaranteed to be equal to a C pointer? I know it is the most obvious
implementation but like so many things! Does the Ada LRM specify how
the access type is implemented?

Is there any advantage to using System.Address and then calling
the function with Type'Address ??




  reply	other threads:[~1996-07-16  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-09  0:00 C Interface question Jerry van Dijk
1996-07-09  0:00 ` Laurent Guerby
1996-07-11  0:00   ` Jerry van Dijk
1996-07-16  0:00     ` David Kirkland [this message]
1996-07-09  0:00 ` Robert Dewar
1996-07-10  0:00   ` Theodore E. Dennison
1996-07-11  0:00     ` Robert Dewar
1996-07-11  0:00   ` Ken Garlington
1996-07-11  0:00     ` Robert Dewar
1996-07-11  0:00   ` Jerry van Dijk
1996-07-11  0:00 ` Kevin Krieser
1996-07-11  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox