comp.lang.ada
 help / color / mirror / Atom feed
From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: Re: Making ada (types) "visable" in C
Date: Thu, 27 Jan 2005 13:36:38 +0000 (UTC)
Date: 2005-01-27T13:36:38+00:00	[thread overview]
Message-ID: <slrncvhrj6.p0.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: 6acda821.0501270510.1dbfe551@posting.google.com

* 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);



  reply	other threads:[~2005-01-27 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27 13:10 Making ada (types) "visable" in C Sebastian
2005-01-27 13:36 ` Lutz Donnerhacke [this message]
2005-01-27 17:59 ` tmoran
2005-01-27 23:06 ` Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox