POK
apex-buffers.ads
1 -- ---------------------------------------------------------------------------
2 -- --
3 -- BUFFER constant and type definitions and management services --
4 -- --
5 -- ---------------------------------------------------------------------------
6 with APEX.Processes;
7 package APEX.Buffers is
8  Max_Number_Of_Buffers : constant := System_Limit_Number_Of_Buffers;
9  subtype Buffer_Name_Type is Name_Type;
10  type Buffer_Id_Type is private;
11  Null_Buffer_Id : constant Buffer_Id_Type;
12  type Buffer_Status_Type is record
13  Nb_Message : Message_Range_Type;
14  Max_Nb_Message : Message_Range_Type;
15  Max_Message_Size : Message_Size_Type;
16  Waiting_Processes : APEX.Processes.Waiting_Range_Type;
17  end record;
18  procedure Create_Buffer
19  (Buffer_Name : in Buffer_Name_Type;
20  Max_Message_Size : in Message_Size_Type;
21  Max_Nb_Message : in Message_Range_Type;
22  Queuing_Discipline : in Queuing_Discipline_Type;
23  Buffer_Id : out Buffer_Id_Type;
24  Return_Code : out Return_Code_Type);
25  procedure Send_Buffer
26  (Buffer_Id : in Buffer_Id_Type;
27  Message_Addr : in Message_Addr_Type;
28  Length : in Message_Size_Type;
29  Time_Out : in System_Time_Type;
30  Return_Code : out Return_Code_Type);
31  procedure Receive_Buffer
32  (Buffer_Id : in Buffer_Id_Type;
33  Time_Out : in System_Time_Type;
34  Message_Addr : in Message_Addr_Type;
35  -- The message address is passed IN, although the respective message is
36  -- passed OUT
37  Length : out Message_Size_Type;
38  Return_Code : out Return_Code_Type);
39  procedure Get_Buffer_Id
40  (Buffer_Name : in Buffer_Name_Type;
41  Buffer_Id : out Buffer_Id_Type;
42  Return_Code : out Return_Code_Type);
43  procedure Get_Buffer_Status
44  (Buffer_Id : in Buffer_Id_Type;
45  Buffer_Status : out Buffer_Status_Type;
46  Return_Code : out Return_Code_Type);
47 private
48  type Buffer_Id_Type is new APEX_Integer;
49  Null_Buffer_Id : constant Buffer_Id_Type := 0;
50  pragma Convention (C, Buffer_Status_Type);
51 
52  -- POK BINDINGS
53  pragma Import (C, Create_Buffer, "CREATE_BUFFER");
54  pragma Import (C, Send_Buffer, "SEND_BUFFER");
55  pragma Import (C, Receive_Buffer, "RECEIVE_BUFFER");
56  pragma Import (C, Get_Buffer_Id, "GET_BUFFER_ID");
57  pragma Import (C, Get_Buffer_Status, "GET_BUFFER_STATUS");
58  -- END OF POK BINDINGS
59 end APEX.Buffers;