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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6343ad227ef07794 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!npeer.de.kpn-eurorings.net!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Making ada (types) "visable" in C Date: Thu, 27 Jan 2005 13:36:38 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <6acda821.0501270510.1dbfe551@posting.google.com> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1106832998 1522 217.17.192.37 (27 Jan 2005 13:36:38 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Thu, 27 Jan 2005 13:36:38 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: g2news1.google.com comp.lang.ada:8016 Date: 2005-01-27T13:36:38+00:00 List-Id: * Sebastian wrote: > ------------------------------------------------------------ > ADA side: > > type State_Buff is (Ok, Failed); > > type Baud_Type is (R9600, R19200); > > type Parity_Type is (None, Odd, Even); > > type Stop_Bit_Type is (One, Two); > > Initialize ( > Baudrate : in Baud_Type; > Parity : in Parity_Type; > Stop_Bits : in Stop_Bit_Type; > Status : out State_Buff); > > pragma Export(C, Initialize, "MyInitializeInC"); pragma Export(C, Ok, "state_ok"); pragma Export(C, Failed, "state_failed"); ... pragma Export(C, Two, "stop_bit_two"); > ------------------------------------------------------------ > C side: extern void MyInitializeInC (int baudrate, int parity, int stop_bits, int * state); BTW: function Initialize (Baudrate ...) return State_Buff; becomes extern int MyInitializeInC (int baudrate, int parity, int stop_bits);