comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Question about interfacing C and Ada95
Date: 1999/11/09
Date: 1999-11-09T00:00:00+00:00	[thread overview]
Message-ID: <8086rl$57n$1@nnrp1.deja.com> (raw)
In-Reply-To: zDFV3.101$Wi2.9657@typhoon-sf.snfc21.pbi.net

In article <zDFV3.101$Wi2.9657@typhoon-sf.snfc21.pbi.net>,
  tmoran@bix.com wrote:
> >we have recoded the c to this as Ada funcs do not allow more
than
> >one return val;
> >
> >void getX ( void **instance, int *float, int *error );
> >
> >How do I then write the Ada to interface to this in Ada 95.
>   procedure getX(M     : in out Matrix;
>                  Float : in out integer;
>                  Error : out integer);
> or so, depending on just what you want.
>   Actually, both Ada and C allow a single return value from a
> function, ie "result = getX(....);", but Ada in addition
allows
> "out" or "in out" parameters to procedures, which in C must be
> simulated by passing "in" a pointer to the target parameter.


Note incidentally, that, following the DEC ADa 83 design, GNAT
provides value returning procedures that allow modeling of
external functions with out parameters. See description of
Import_Valued_Procedure pragma in DEC or GNAT documentation.


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~1999-11-09  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-08  0:00 Question about interfacing C and Ada95 Hovers
1999-11-08  0:00 ` tmoran
1999-11-09  0:00   ` Robert Dewar [this message]
1999-11-08  0:00 ` Robert Dewar
1999-11-09  0:00   ` Hovers
1999-11-09  0:00     ` Ted Dennison
1999-11-12  0:00       ` Hovers
1999-11-12  0:00         ` Robert Dewar
1999-11-12  0:00           ` Ted Dennison
1999-11-13  0:00             ` Robert Dewar
1999-11-09  0:00     ` Matthew Heaney
1999-11-08  0:00 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox