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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fc95c1889fbed9e5 X-Google-Attributes: gid103376,public From: David Kirkland Subject: Re: C Interface question Date: 1996/07/16 Message-ID: <31EBB8FB.35F7@array.ca>#1/1 X-Deja-AN: 169291703 references: content-type: text/plain; charset=us-ascii organization: Array Systems Computing mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (X11; I; SunOS 5.4 sun4m) Date: 1996-07-16T00:00:00+00:00 List-Id: Jerry van Dijk wrote: > > Laurent Guerby (guerby@gnat.com) wrote: > > : Jerry> int *function(int value, int *result); > > : type int_star is access C.int; > : pragma Convention (C, Int_Star); > > : function F (Value : C.int; Result : int_star) return int_star; > : pragma Convention (C, F); > > Of course, why do I always overlook the obvious ? This way I will never > become rich and famous :-) > > Thanks! > -- > ----------------------------------------------------------------------- > -- Jerry van Dijk -- e-mail: jerry@jvdsys.nextjk.stuyts.nl -- > -- Banking Consultant -- Member Team-Ada -- > -- Ordina Finance BV -- Located at Haarlem, The Netherlands -- Hi all, I have a similar question. I'm using an Ada83 compiler and have to interface to a C function similar to the above except it contains a pointer to a pointer ie.) int *function(int value, int **result); Now obviously I can use an access type to an access type, an extention of what was posted earlier. My question is this - Is an access type guaranteed to be equal to a C pointer? I know it is the most obvious implementation but like so many things! Does the Ada LRM specify how the access type is implemented? Is there any advantage to using System.Address and then calling the function with Type'Address ??