POK
apex-events.ads
1 -- ---------------------------------------------------------------------------
2 -- --
3 -- EVENT constant and type definitions and management services --
4 -- --
5 -- ---------------------------------------------------------------------------
6 with APEX.Processes;
7 package APEX.Events is
8  Max_Number_Of_Events : constant := System_Limit_Number_Of_Events;
9  subtype Event_Name_Type is Name_Type;
10  type Event_Id_Type is private;
11  Null_Event_Id : constant Event_Id_Type;
12  type Event_State_Type is (Down, Up);
13  type Event_Status_Type is record
14  Event_State : Event_State_Type;
15  Waiting_Processes : APEX.Processes.Waiting_Range_Type;
16  end record;
17  procedure Create_Event
18  (Event_Name : in Event_Name_Type;
19  Event_Id : out Event_Id_Type;
20  Return_Code : out Return_Code_Type);
21  procedure Set_Event
22  (Event_Id : in Event_Id_Type;
23  Return_Code : out Return_Code_Type);
24  procedure Reset_Event
25  (Event_Id : in Event_Id_Type;
26  Return_Code : out Return_Code_Type);
27  procedure Wait_Event
28  (Event_Id : in Event_Id_Type;
29  Time_Out : in System_Time_Type;
30  Return_Code : out Return_Code_Type);
31  procedure Get_Event_Id
32  (Event_Name : in Event_Name_Type;
33  Event_Id : out Event_Id_Type;
34  Return_Code : out Return_Code_Type);
35  procedure Get_Event_Status
36  (Event_Id : in Event_Id_Type;
37  Event_Status : out Event_Status_Type;
38  Return_Code : out Return_Code_Type);
39 private
40  type Event_Id_Type is new APEX_Integer;
41  Null_Event_Id : constant Event_Id_Type := 0;
42  pragma Convention (C, Event_State_Type);
43  pragma Convention (C, Event_Status_Type);
44 
45  -- POK BINDINGS
46  pragma Import (C, Create_Event, "CREATE_EVENT");
47  pragma Import (C, Set_Event, "SET_EVENT");
48  pragma Import (C, Reset_Event, "RESET_EVENT");
49  pragma Import (C, Wait_Event, "WAIT_EVENT");
50  pragma Import (C, Get_Event_Id, "GET_EVENT_ID");
51  pragma Import (C, Get_Event_Status, "GET_EVENT_STATUS");
52  -- END OF POK BINDINGS
53 end APEX.Events;