comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Mixed Ada and C program
Date: Mon, 11 Jun 2001 15:10:05 GMT
Date: 2001-06-11T15:10:05+00:00	[thread overview]
Message-ID: <hb5V6.3894$pb1.144202@www.newsranger.com> (raw)
In-Reply-To: rF4V6.895$j6.75257@news

In article <rF4V6.895$j6.75257@news>, Joelle Lavergne says...
>I need to build an application using Ada and C. The main application is in
>Ada but I need to import C function to Ada and export Ada procedures to C.
>My problem is when exporting my Ada procedure to C.

Exporting is somewhat of an advanced topic, so its a shame you have to use this
to learn Ada. But it could have been worse...

Since your main is in Ada, it should be relatively easy. Just use "pragma Export
(C, subprogram_name);" to export subprogram_name to C, as detailed in Annex B,
section 1 of the LRM. If you have parameters to pass, a *thourough* reading of
the implementation advice in Annex B, section 3 of the LRM should tell you how
they will be mapped. If you don't have a dead-tree version of the LRM handy,
there's one online at http://www.ada-auth.org/arm-html/RM-TOC.html .

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



      parent reply	other threads:[~2001-06-11 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-11 14:33 Mixed Ada and C program Joelle Lavergne
2001-06-11 14:44 ` Marin David Condic
2001-06-11 15:03 ` Joelle Lavergne
2001-06-11 15:19   ` Ted Dennison
2001-06-12  2:40   ` DuckE
2001-06-11 15:10 ` Ted Dennison [this message]
replies disabled

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