home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / ISOsym / sysclock.def < prev    next >
Text File  |  1996-08-29  |  2KB  |  53 lines

  1. FOREIGN DEFINITION MODULE SysClock;
  2.   IMPORT IMPLEMENTATION FROM "sysclock.o";
  3.  
  4. (* Facilities for accessing a system clock that records the date and time of day *)
  5.  
  6.  
  7.   FROM Types IMPORT Card32;
  8.   (* For portability all GPM implementations store DateTime.year in 32 bits *)
  9.  
  10.   CONST
  11.    maxSecondParts = 0;  (* implementation defined constant *)
  12.    (* The value here implies the clock delivers only whole seconds *)
  13.   
  14.   TYPE
  15.    Month    = [1 .. 12];
  16.    Day      = [1 .. 31];
  17.    Hour     = [0 .. 23];
  18.    Min      = [0 .. 59];
  19.    Sec      = [0 .. 59];
  20.    Fraction = [0 .. maxSecondParts];    (* parts of a second *)
  21.    UTCDiff  = [-780 .. 720];        (* Time zone Differential Factor *)
  22. (* the number of minutes that must be added to local time to obtain UTC. *)
  23.  
  24.    DateTime =
  25.      RECORD
  26.        year     : Card32;
  27.        month    : Month;
  28.        day      : Day;
  29.        hour     : Hour;
  30.        minute   : Min;
  31.        second   : Sec;
  32.        fractions: Fraction;
  33.        zone     : UTCDiff;
  34.        SummerTimeFlag : BOOLEAN;  (* interpretation: local usage *)
  35.     END;
  36.   
  37.   PROCEDURE CanGetClock () : BOOLEAN;
  38.   (* Tests if a clock can be read *)
  39.   
  40.   PROCEDURE CanSetClock () : BOOLEAN;
  41.   (* Tests if a clock can be set *)
  42.   
  43.   PROCEDURE IsValidDateTime (userData : DateTime) : BOOLEAN;
  44.   (* Tests if the value of userData is a valid *)
  45.   
  46.   PROCEDURE GetClock (VAR userData : DateTime);
  47.   (* Assigns local date and time of day to userData *)
  48.   
  49.   PROCEDURE SetClock (userData : DateTime);
  50.   (* Sets the system clock to the given local date and time *)
  51.   
  52. END SysClock.
  53.