comp.lang.ada
 help / color / mirror / Atom feed
From: evans@evans.pgh.pa.us (Arthur Evans Jr)
Subject: Re: External C functions and Ada
Date: 1996/08/28
Date: 1996-08-28T00:00:00+00:00	[thread overview]
Message-ID: <evans-2808961010290001@ppp69.s5.pgh.net> (raw)
In-Reply-To: 4vv2u4$fp8@news.sei.cmu.edu


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 ( <language> , <subprogram> [ , "<link -name>" ]

(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




  reply	other threads:[~1996-08-28  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-27  0:00 External C functions and Ada Mark Bell
1996-08-28  0:00 ` Arthur Evans Jr [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-08-24  0:00 External C functions and ADA Joseph Fabian
1996-08-26  0:00 ` Jim Dorman
replies disabled

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