From: "ReversedBias" <thehumblizer@hotmail.com>
Subject: Ada to C Interface: Passing Pointers Via System.Address
Date: Tue, 11 Jan 2005 21:16:18 -0500
Date: 2005-01-11T21:16:18-05:00 [thread overview]
Message-ID: <8e19522cfe30bb2ccbfe1393fdd6b235@localhost.talkaboutprogramming.com> (raw)
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,
next reply other threads:[~2005-01-12 2:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-12 2:16 ReversedBias [this message]
2005-01-12 3:09 ` Ada to C Interface: Passing Pointers Via System.Address 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox