comp.lang.ada
 help / color / mirror / Atom feed
From: di98mase@hotmail.com (Sebastian)
Subject: Making ada (types) "visable" in C
Date: 27 Jan 2005 05:10:08 -0800
Date: 2005-01-27T05:10:08-08:00	[thread overview]
Message-ID: <6acda821.0501270510.1dbfe551@posting.google.com> (raw)

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



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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27 13:10 Sebastian [this message]
2005-01-27 13:36 ` Making ada (types) "visable" in C Lutz Donnerhacke
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