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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9c274893e2f7e55 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!not-for-mail Sender: malo@0x53589c0c.boanxx18.adsl-dhcp.tele.dk Newsgroups: comp.lang.ada Subject: Re: Ada to C Interface: Passing Pointers Via System.Address References: <70b31062323c157bbc6b42ccd0ca0945@localhost.talkaboutprogramming.com> From: Mark Lorenzen Date: 12 Jan 2005 16:50:46 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: TDC Totalloesninger NNTP-Posting-Host: 83.88.156.12 X-Trace: 1105545046 dtext01.news.tele.dk 170 83.88.156.12:28572 X-Complaints-To: abuse@post.tele.dk Xref: g2news1.google.com comp.lang.ada:7692 Date: 2005-01-12T16:50:46+01:00 List-Id: tmoran@acm.org writes: > > struct_ptr : system.address; > > > > struct_ptr := ada_cfunct1(input1, input2); > > > > cfunct2(struct_ptr, input3); > > ... > > at the value of the memory of the struct_ptr after it has gone to ada and > > back to c it says that it is null. I must not be using the system.address > Could you please post a small, but complete (ie, compiles, but fails to > run) program? I'm very confused by the above, not knowing which of the > functions are in Ada, which are imported from C, how is struct_ptr's value > created, what are the declarations of ada_cfunct1 and cfunct2, etc. I'm > guessing that both ada_cfunct1 and cfunct2 are imported C functions. How > about putting printout inside ada_cfunct1 just before it returns > struct_ptr, another printout just after the "struct_ptr := ...", and a > third printout at the beginning of cfunct2, showing the value passed in > for struct_ptr. And please post the C prototype for the function you want to call from Ada. - Mark Lorenzen