POK
/home/jaouen/pok_official/pok/trunk/libpok/ada/arinc653/apex-buffers.ads
00001 -- ---------------------------------------------------------------------------
00002 -- --
00003 -- BUFFER constant and type definitions and management services --
00004 -- --
00005 -- ---------------------------------------------------------------------------
00006 with APEX.Processes;
00007 package APEX.Buffers is
00008    Max_Number_Of_Buffers : constant := System_Limit_Number_Of_Buffers;
00009    subtype Buffer_Name_Type is Name_Type;
00010    type Buffer_Id_Type is private;
00011    Null_Buffer_Id : constant Buffer_Id_Type;
00012    type Buffer_Status_Type is record
00013        Nb_Message         : Message_Range_Type;
00014        Max_Nb_Message     : Message_Range_Type;
00015        Max_Message_Size : Message_Size_Type;
00016        Waiting_Processes : APEX.Processes.Waiting_Range_Type;
00017    end record;
00018    procedure Create_Buffer
00019       (Buffer_Name         : in Buffer_Name_Type;
00020        Max_Message_Size    : in Message_Size_Type;
00021        Max_Nb_Message      : in Message_Range_Type;
00022        Queuing_Discipline :  in Queuing_Discipline_Type;
00023        Buffer_Id           : out Buffer_Id_Type;
00024        Return_Code         : out Return_Code_Type);
00025    procedure Send_Buffer
00026       (Buffer_Id    : in Buffer_Id_Type;
00027        Message_Addr : in Message_Addr_Type;
00028        Length       : in Message_Size_Type;
00029        Time_Out     : in System_Time_Type;
00030        Return_Code : out Return_Code_Type);
00031    procedure Receive_Buffer
00032       (Buffer_Id    : in Buffer_Id_Type;
00033        Time_Out     : in System_Time_Type;
00034        Message_Addr : in Message_Addr_Type;
00035    -- The message address is passed IN, although the respective message is
00036    -- passed OUT
00037        Length       : out Message_Size_Type;
00038        Return_Code : out Return_Code_Type);
00039    procedure Get_Buffer_Id
00040       (Buffer_Name : in Buffer_Name_Type;
00041        Buffer_Id   : out Buffer_Id_Type;
00042        Return_Code : out Return_Code_Type);
00043    procedure Get_Buffer_Status
00044       (Buffer_Id      : in Buffer_Id_Type;
00045        Buffer_Status : out Buffer_Status_Type;
00046        Return_Code    : out Return_Code_Type);
00047 private
00048    type Buffer_Id_Type is new APEX_Integer;
00049    Null_Buffer_Id : constant Buffer_Id_Type := 0;
00050    pragma Convention (C, Buffer_Status_Type);
00051 
00052    -- POK BINDINGS
00053    pragma Import (C, Create_Buffer, "CREATE_BUFFER");
00054    pragma Import (C, Send_Buffer, "SEND_BUFFER");
00055    pragma Import (C, Receive_Buffer, "RECEIVE_BUFFER");
00056    pragma Import (C, Get_Buffer_Id, "GET_BUFFER_ID");
00057    pragma Import (C, Get_Buffer_Status, "GET_BUFFER_STATUS");
00058    -- END OF POK BINDINGS
00059 end APEX.Buffers;