From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9c274893e2f7e55,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!sn-xit-04!sn-xit-10!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "ReversedBias" Newsgroups: comp.lang.ada Subject: Ada to C Interface: Passing Pointers Via System.Address Date: Tue, 11 Jan 2005 21:16:18 -0500 Organization: www.talkaboutprogramming.com Message-ID: <8e19522cfe30bb2ccbfe1393fdd6b235@localhost.talkaboutprogramming.com> X-Newsreader: www.talkaboutprogramming.com Content-Type: text/plain; X-Complaints-To: abuse@supernews.com Xref: g2news1.google.com comp.lang.ada:7665 Date: 2005-01-11T21:16:18-05:00 List-Id: 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,