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=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,782d14fd472db944 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Question about interfacing C and Ada95 Date: 1999/11/08 Message-ID: <3827068d_4@news1.prserv.net>#1/1 X-Deja-AN: 545976900 Content-transfer-encoding: 7bit References: <806ud0$lu1$1@trog.dera.gov.uk> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 8 Nov 1999 17:21:17 GMT, 32.101.8.214 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-08T00:00:00+00:00 List-Id: In article <806ud0$lu1$1@trog.dera.gov.uk> , "Hovers" 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