Making ada (types) "visable" in C

From: Sebastian (di98mase_at_hotmail.com)
Date: 01/27/05

  • Next message: Lutz Donnerhacke: "Re: Making ada (types) "visable" in C"
    Date: 27 Jan 2005 05:10:08 -0800
    
    

    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


  • Next message: Lutz Donnerhacke: "Re: Making ada (types) "visable" in C"