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,f6a8d0c42308d020 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: C Calling GNAT Date: 1996/07/03 Message-ID: #1/1 X-Deja-AN: 163603681 references: <836306640.0@cs.york.ac.uk> <836384269.1@cs.york.ac.uk> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-03T00:00:00+00:00 List-Id: Nigel asks "Can anybody provide me with an example of how to get a C function to call an Ada routine. All compiled with gcc and GNAT? I assume that this is possible. I know it is possible for Ada to call C routines, but I need to have a C routine call Ada. Also how would you go about passing parameters between the two such as enumerated types (I assume integers, etc are fairly straight-forward)" The reference manual provides a basic description of how parameters are passed, and how to use pragma Export to make an Ada routine that can be called from C. For information on how to setup GNAT with a non-Ada main program, see the specific section in gnatinfo.txt on this topic.