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.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,666ea7941e10cfc2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-11 08:10:54 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: Subject: Re: Mixed Ada and C program Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Mon, 11 Jun 2001 11:10:05 EDT Organization: http://www.newsranger.com Date: Mon, 11 Jun 2001 15:10:05 GMT Xref: archiver1.google.com comp.lang.ada:8551 Date: 2001-06-11T15:10:05+00:00 List-Id: In article , 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