From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Interface to C; Storage_Error
Date: Thu, 21 Dec 2000 11:38:59 GMT
Date: 2000-12-21T11:38:59+00:00 [thread overview]
Message-ID: <91sq4j$tpr$1@nnrp1.deja.com> (raw)
In-Reply-To: VKe06.176137$U46.5519033@news1.sttls1.wa.home.com
In article <VKe06.176137$U46.5519033@news1.sttls1.wa.home.com>,
"DuckE" <nospam_steved94@home.com> wrote:
> function GetNextVal( srv : access Srv_Handle;
> rslt : access Srv_Handle;
> ctx : access Ctx_Handle;
> name : C.Char_Array;
> dbl : access C.Double;
> flt : access Flt_Handle ) return
> C.Int;
> pragma Import( C, GetNextVal );
A general warning is the reminder that "access foo" is not
a generally usable translation of a pointer parameter in C,
since in the Ada case, null values would not be permitted.
> Since the "C" prototype is using "char *" I suspect you need
> to allocate the data to send to the function.
I see no reason for this suspicion, either on the basis of how
any compiler I know about works, or from the RM, please tell us
where you got this idea from :-)
> Also... beware of callbacks. I'm not sure if GNAT behaves
> the same, but with ObjectAd if you are inside of a callback
> from a "C" library and you attempt to perform an Ada tasking
> operation (ie: Rendevous or Protected Operation) bad things
> happen.
That sounds like a significant restriction. GNAT has no such
restriction.
Sent via Deja.com
http://www.deja.com/
next prev parent reply other threads:[~2000-12-21 11:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-19 22:28 Interface to C; Storage_Error Chris
2000-12-20 3:52 ` Ted Dennison
2000-12-20 8:55 ` Robert Dewar
2000-12-20 11:39 ` Thomas Wolf
2000-12-20 17:05 ` Chris
2000-12-20 23:57 ` Chris
2000-12-21 15:35 ` Thomas Wolf
2000-12-21 18:07 ` Chris
2000-12-21 3:25 ` DuckE
2000-12-21 11:38 ` Robert Dewar [this message]
2000-12-23 2:45 ` DuckE
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox