comp.lang.ada
 help / color / mirror / Atom feed
From: "M. A. Alves" <maa@liacc.up.pt>
To: <comp.lang.ada@ada.eu.org>
Subject: Re: Ada Address = C pointer ?
Date: Tue, 30 Oct 2001 18:01:16 +0000 (GMT)
Date: 2001-10-30T18:01:16+00:00	[thread overview]
Message-ID: <mailman.1004464900.6921.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <3BDEDF1D.14FE7197@Raytheon.com>

On Tue, 30 Oct 2001, Mark Johnson wrote:
> "M. A. Alves" wrote:
> > I am in fact using Address and Access_To_Address_Conversions(*) because I
> > simply did not find out how to do the trick otherwise.  For example, the C
> > function is returning an array of unsigned long.  I want to access that
> > array without copying it.  How can you do that with Interfaces.C.Strings
> > or even Interfaces.C.Pointers ?
>
> Reread the implementation advice in B.3....
>  An Ada parameter of an array type with component 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.

Yes, a very sensible _advice_ indeed. Somehow I feel more assured with
Address_To_Access_Conversions. Actually it is more than just a feeling,
according to http://adapower.com/lang/accessmem.html .

But adhering to the advice surely makes for the most elegant coding.

Note that by now, thanks to all, this thread has tutored all possible
idioms of C-interfacing namely:

  * using Address_To_Access_Conversions

  * using Interfaces.C.Pointers

  * commiting to implementation advice in B.3...

Well done guys!

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150 PORTO, Portugal        mob 351+939354002





  reply	other threads:[~2001-10-30 18:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-26 18:53 Ada Address = C pointer ? M. A. Alves
2001-10-26 18:09 ` Lutz Donnerhacke
2001-10-26 21:06   ` Florian Weimer
2001-10-26 19:34 ` Mark Johnson
2001-10-26 23:39   ` tmoran
2001-10-29 13:07     ` M. A. Alves
2001-10-29 20:19       ` Matthew Heaney
2001-10-29 23:15         ` tmoran
2001-10-30 10:30           ` M. A. Alves
2001-10-30 19:53             ` tmoran
2001-10-31 13:01               ` M. A. Alves
2001-10-31 14:44                 ` Marin David Condic
2001-10-30  9:58         ` M. A. Alves
2001-10-30 12:02           ` Lutz Donnerhacke
2001-10-30 12:53             ` M. A. Alves
2001-10-30 12:56               ` Lutz Donnerhacke
2001-10-30 14:26                 ` M. A. Alves
2001-10-30 14:19               ` Matthew Heaney
2001-10-30 14:41                 ` M. A. Alves
2001-10-30 17:10           ` Mark Johnson
2001-10-30 18:01             ` M. A. Alves [this message]
2001-10-30 20:23               ` tmoran
2001-10-31 13:13                 ` M. A. Alves
2001-10-30 19:53           ` tmoran
2001-10-29 23:15       ` tmoran
replies disabled

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