comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Ada to C Interface: Passing Pointers Via System.Address
Date: Wed, 12 Jan 2005 19:05:17 -0800
Date: 2005-01-12T19:05:17-08:00	[thread overview]
Message-ID: <18GdnfRhAsyreHjcRVn-vg@comcast.com> (raw)
In-Reply-To: 8e19522cfe30bb2ccbfe1393fdd6b235@localhost.talkaboutprogramming.com

I have had pretty good luck interfacing C/C++ with Ada.
My specific experience has been with Microsoft C and ObjectAda.

Things often don't work on my first try, but that's usually because I wasn't 
careful enough in setting up the C interface pragmas or didn't declare 
functions in C++ using "external C".

Steve
(The Duck)

"ReversedBias" <thehumblizer@hotmail.com> wrote in message 
news:8e19522cfe30bb2ccbfe1393fdd6b235@localhost.talkaboutprogramming.com...
>I am relatively new to Ada.  I am constructing an API so that my Ada
> clients can talk to my C code.  My C functions return pointers to data
> structures (very large structures).  I need to then pass the pointer to
> the data struct to the Ada code and back into other C functions.  There is
> no interaction with the data structure in the Ada code except to pass the
> pointer from one C function to another.  I have been trying to use the C
> interface pragma and return the pointers from C into an Ada System.Address
> and then pass that System.Address into the another pragma back down to the
> C functions.  My hope is that the C will be able to type cast the address
> back into the correct pointer type.  So far I have not been able to get
> this to work properly.  Please advise on another approach or post an
> example of how I could do this using the System.Address
>
> Thanks,
> 





      parent reply	other threads:[~2005-01-13  3:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-12  2:16 Ada to C Interface: Passing Pointers Via System.Address ReversedBias
2005-01-12  3:09 ` tmoran
2005-01-12  7:36   ` ReversedBias
2005-01-12  8:38     ` tmoran
2005-01-12 15:50       ` Mark Lorenzen
2005-01-13 17:14   ` Martin Krischik
2005-01-13  1:25 ` Jeffrey Carter
2005-01-13  3:05 ` Steve [this message]
replies disabled

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