------------------------------------------------------------------------------ -- -- -- POSIX ADA LANGUAGE INTERFACES COMPONENTS -- -- -- -- P O S I X . T I M E R S -- -- -- -- S p e c -- -- -- -- $Revision: 1.3 $ -- -- -- -- -- -- This package specification is part of the Florida State -- -- University (FSU) prototype implementation of IEEE Draft Std -- -- 1003.5b, for use with the Gnu NYU Ada Translator (GNAT) and the -- -- FSU Gnu Ada Runtime Library (GNARL). -- -- -- -- This package specification contains some text extracted from IEEE -- -- Draft Std 1003.5b/D5 (August 1995), IEEE Draft Standard for -- -- Information Technology -- POSIX Ada Language Interfaces -- Part 1: -- -- Binding for System Application Program Interface, Amendment 1: -- -- Realtime Extensions, copyright 1995 by the Institute of Electrical -- -- and Electronics Engineers, Inc. -- -- -- -- This package specification differs from the package specifications -- -- in IEEE Draft Std 1003.5/D5 in several respects. For example, it -- -- includes additional with-clause dependences, comments, and -- -- complete definitions for certain types, ranges, and constants that -- -- are left implementation-defined in the draft standard. These -- -- differences appear to be within the scope of variation which the -- -- draft standard permits for implementations, but no warranty is -- -- made to that effect. -- -- -- -- These package specifications are distributed in the hope that they -- -- will be useful, but WITHOUT ANY WARRANTY; without even the implied -- -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- The package specifications in IEEE Draft Std 1003.5b/D5 represent -- -- only a portion of the document and are not to be interpreteted -- -- outside the context of the document, nor is the draft document to -- -- be interpreted as an approved consensus standard. -- -- -- -- When IEEE Std 1003.5b is approved, it must be used in conjunction -- -- with the final version of the package specifications contained in -- -- that document in order to claim conformance. The IEEE takes no -- -- responsibility for and will assume no liability for damages -- -- resulting from the reader's misinterpretation of said information -- -- resulting from its out-of-context nature. To order copies of the -- -- IEEE Draft Std 1003.5/D5, please contact the IEEE Service Center -- -- at 445 Hoes Lane, PO Box 1331, Piscataway, NJ 08855-1331; via -- -- phone at 1-800-678-IEEE, 908-981-1393; or via fax at 908-981-9667. -- -- -- -- For bodies to these packages, and other free products of the FSU -- -- POSIX/Ada Real-Time project, see the ftp site "ftp.cs.fsu.edu", -- -- subdirectory "pub/PART", or send e-mail to "part@ada.cs.fsu.edu". -- -- -- ------------------------------------------------------------------------------ with POSIX, Low_Levels, Implementation_Constants, Interfaces.C, POSIX.Signals; package POSIX.Timers is package IC renames Implementation_Constants; package LL renames Low_Levels; type Clock_ID is private; type Timer_ID is private; Clock_Realtime : constant Clock_ID; type Timer_State is private; type Timer_Options is new POSIX.Option_Set; function Int_To_TimerOpt is new Unchecked_Conversion (Integer, Timer_Options); Absolute_Timer : constant Timer_Options := Int_To_TimerOpt (IC.TIMER_ABSTIME); procedure Set_Initial (State : in out Timer_State; Initial : in POSIX.Timespec); function Get_Initial (State : Timer_State) return POSIX.Timespec; procedure Set_Interval (State : in out Timer_State; Interval : in POSIX.Timespec); function Get_Interval (State : Timer_State) return POSIX.Timespec; procedure Set_Time (Clock : in Clock_ID; Value : in POSIX.Timespec); procedure Set_Time (Value : in POSIX.Timespec); function Get_Time (Clock : Clock_ID := Clock_Realtime) return POSIX.Timespec; function Get_Time return POSIX.Timespec; function Get_Resolution (Clock : Clock_ID := Clock_Realtime) return POSIX.Timespec; function Create_Timer (Clock : Clock_ID; Event : POSIX.Signals.Signal_Event) return Timer_ID; procedure Delete_Timer (Timer : in out Timer_ID); procedure Arm_Timer (Timer : in Timer_ID; Options : in Timer_Options; New_State : in Timer_State; Old_State : out Timer_State); procedure Arm_Timer (Timer : in Timer_ID; Options : in Timer_Options; New_State : in Timer_State); function Get_Timer_State (Timer : Timer_ID) return Timer_State; procedure Disarm_Timer (Timer : in Timer_ID); function Get_Timer_Overruns (Timer : Timer_ID) return Natural; private type Clock_ID is new LL.clockid_t; Clock_Realtime : constant Clock_ID := IC.CLOCK_REALTIME; type Timer_ID is new LL.timer_t; type Timer_State is new LL.C_itimerspec; function Option_To_Int is new Unchecked_Conversion (Timer_Options, Interfaces.C.Int); end POSIX.Timers;