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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6343ad227ef07794,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!not-for-mail From: di98mase@hotmail.com (Sebastian) Newsgroups: comp.lang.ada Subject: Making ada (types) "visable" in C Date: 27 Jan 2005 05:10:08 -0800 Organization: http://groups.google.com Message-ID: <6acda821.0501270510.1dbfe551@posting.google.com> NNTP-Posting-Host: 139.58.232.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1106831409 14882 127.0.0.1 (27 Jan 2005 13:10:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Jan 2005 13:10:09 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:8015 Date: 2005-01-27T05:10:08-08:00 List-Id: Hi, How shall I make specific Ada types visable in C code. E.g. If I want to call an Ada procedure from C that has own type defintions how do I do? In this example I want to call an Ada procedure that is called Initialize from a c-file/function. The Ada procedure has own types how shall I "convert" them to C-types? ------------------------------------------------------------ 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"); ------------------------------------------------------------ C side: ? ------------------------------------------------------------ Regards di98