comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lorenzen <mark.lorenzen@ofir.dk>
Subject: Re: Ada to C Interface: Passing Pointers Via System.Address
Date: 12 Jan 2005 16:50:46 +0100
Date: 2005-01-12T16:50:46+01:00	[thread overview]
Message-ID: <m3llaysl2h.fsf@0x53589c0c.boanxx18.adsl-dhcp.tele.dk> (raw)
In-Reply-To: hPCdnS-Jg6d2fHncRVn-3w@comcast.com

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



  reply	other threads:[~2005-01-12 15:50 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 [this message]
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