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,a4ce2c0817cfc70b X-Google-Attributes: gid103376,public From: husseinp@logica.co.uk (Paul Hussein) Subject: Re: C to Ada interfacing Date: 1996/07/31 Message-ID: <4tnaod$d2n@romeo.logica.co.uk>#1/1 X-Deja-AN: 171234181 references: <4tm4mg$cjp@optional.cts.com> organization: Logica UK Ltd. newsgroups: comp.lang.ada Date: 1996-07-31T00:00:00+00:00 List-Id: lees@cts.com (Lee Slaughter) wrote: >Hi, >I'm not an Ada programmer but need to interface with Ada >routines from C (on a VxWorks platform). >I have searched here, FAQ and the Tartanworks Ada docs >and found a little, but I could use more. >I'd appreciate it, especially sample code. >In my probably naive view i'd make a call to someAdaFn( arg ) >and my Ada-programmer peer would define this function in some >.ada or whatever source file who's >object file would be linked in with the C .o stuff, and of >course have to take special care to be sure data types align, >are in the right order with right number of gaps and all. >Is that sort of sketchily it? >Thanks... >lee >--- > Lee Slaughter - network management development: submarine stuff > Navy R & D, Point Loma, San Diego, CA lees@nosc.mil > "Giving credence to his ramblings indicates a cognitive disorder..." > - Lee's psychiatrist, circa 1952 You really need to look in the LRM for your compiler for this sort of stuff. Pragma interface to and from C is very troublesome as their is little standard support for it. The best approaches are : 1. Avoid at alll costs. 2. Get someone else to do it. 3. Obtain some example bindings from somewhere ( e.g. X Bindings ), they must be for your specific target and compiler. 4. Read Appendix F ( or is it E ? ) of your LRM especially for exporting functions. Why don't you bung an example piece of code in the newsgroup and some kind sole might help you along.