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,475c5685b75dee8a X-Google-Attributes: gid103376,public From: evans@evans.pgh.pa.us (Arthur Evans Jr) Subject: Re: External C functions and Ada Date: 1996/08/28 Message-ID: #1/1 X-Deja-AN: 177024918 references: <4vv2u4$fp8@news.sei.cmu.edu> organization: Ada Consulting newsgroups: comp.lang.ada Date: 1996-08-28T00:00:00+00:00 List-Id: In article <4vv2u4$fp8@news.sei.cmu.edu>, msb@sei.cmu.edu (Mark Bell) wrote: > 24-Aug-96 19:03 CrsadrJoe@gnn.com (Joseph Fabian) writes : > > >Hi. For the last week I've been trying desperately to figure out how to > >call a simple user defined C function from within an ADA program, without > >the slightest bit of success I might add. I'm using the Meridian compiler, > >which is an older ADA83 compliant program, because that happens to be the > >compiler of choice at the school I'll be attending next semester. In a > >package spec, I'm declaring the subprogram like this: > > Joe -- > > Try the following : > > Procedure Clrscrn; > Pragma Interface(C, Clrscrn); > Pragma Interface_Name(Clrscn,"_Clrscrn"); > > The last argument of Interface_Name is a string which denotes the name > of the external subprogram as defined in the other language (in > this case C). The first argument is the name by which the subprogram > is known to Ada. I'll assumme that Meridian Ada supports this... Close, but not quite right for Meridian Ada. The pragma is pragma interface ( , [ , "" ] (In the Meridian Ada documentation for the Macintosh, it's on page 91.) Thus you want procedure Clrscrn; pragma Interface(C, Clrscrn, "_Clrscrn"); Art Evans Arthur Evans Jr, PhD Phone: 412-963-0839 Ada Consulting FAX: 412-963-0927 461 Fairview Road Pittsburgh PA 15238-1933 evans@evans.pgh.pa.us