comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: Question about interfacing C and Ada95
Date: 1999/11/08
Date: 1999-11-08T00:00:00+00:00	[thread overview]
Message-ID: <3827068d_4@news1.prserv.net> (raw)
In-Reply-To: 806ud0$lu1$1@trog.dera.gov.uk

In article <806ud0$lu1$1@trog.dera.gov.uk> , "Hovers" 
<hovers@dera.gov.uk> wrote:

> if I have a c routine that returns more than one value what is thge best way
> to interface to Ada with it.
>
>
> e.g. int getX ( void **instance, int *float );

Just use access paramaters to pass data as an out parameter.

What kind of data is "instance"?  It looks like you have out param that
returns an array-of-void (or is it an array of pointer-to-void?).  Can
you be more specific about the type?

And why on earth did you name an out param (of type int) "float"?



> 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 );

This is incorrect.  Ada is *identical* to C wrt the fact that a function
has only one return value.  (A "return value" is not the same as an "out
parameter.")  So there was no reason to rewrite your C declaration as a
function that returns void; the original version was just fine.

--
The new standards [for science curricula in Kansas] do not forbid the
teaching of evolution, but the subject will no longer be included in
statewide tests for evaluating students--a virtual guarantee, given the
realities of education, that this central concept of biology will be
diluted or eliminated, thus reducing courses to something like chemistry
without the periodic table, or American history without Lincoln.

Stephen Jay Gould, Time, 23 Aug 1999




  parent reply	other threads:[~1999-11-08  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
1999-11-08  0:00 ` Matthew Heaney [this message]
1999-11-08  0:00 ` Robert Dewar
1999-11-09  0:00   ` Hovers
1999-11-09  0:00     ` Matthew Heaney
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
replies disabled

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