SYSCLOCK.DEF 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FOREIGN DEFINITION MODULE SysClock;
  2. IMPORT IMPLEMENTATION FROM "sysclock.obj";
  3. (* ========================================================= *)
  4. (* Preliminary module for Gardens Point Modula *)
  5. (* Proposed BSI/ISO Standard Modula-2 Library *)
  6. (* copyright assigned by R. Sutcliffe to BSI *)
  7. (* version 1990 12 14 *)
  8. (* Permission is given to copy this Definition Module, with *)
  9. (* the copy right notice intact, for the purpose of *)
  10. (* evaluation and test. *)
  11. (* Status : for review by ISO/IEC STC1/SC22/WG13 *)
  12. (* Note : This module may change form in the future *)
  13. (* ========================================================= *)
  14. CONST
  15. maxSecondParts = 99; (* implementation defined constant *)
  16. (* The value here implies the clock delivers 0.01 second *)
  17. TYPE
  18. Month = [1 .. 12];
  19. Day = [1 ..31];
  20. Hour = [0 .. 23];
  21. Min = [0 .. 59];
  22. Sec = [0 .. 59];
  23. Fraction = [0 .. maxSecondParts]; (* parts of a second *)
  24. UTCDiff = [-780 .. 720]; (* Time zone Differential Factor *)
  25. (* the number of minutes that must be added to local time to
  26. obtain UTC. *)
  27. DateTime =
  28. RECORD
  29. year : CARDINAL;
  30. month : Month;
  31. day : Day;
  32. hour : Hour;
  33. minute : Min;
  34. second : Sec;
  35. fractions: Fraction;
  36. zone : UTCDiff;
  37. SummerTimeFlag : BOOLEAN; (* interpretation: local usage *)
  38. END;
  39. PROCEDURE CanGetClock () : BOOLEAN;
  40. (* Tests if a clock can be read *)
  41. PROCEDURE CanSetClock () : BOOLEAN;
  42. (* Tests if a clock can be set *)
  43. PROCEDURE IsValidDateTime (userData : DateTime) : BOOLEAN;
  44. (* Tests if the value of userData is a valid *)
  45. PROCEDURE GetClock (VAR userData : DateTime);
  46. (* Assigns local date and time of day to userData *)
  47. PROCEDURE SetClock (userData : DateTime);
  48. (* Sets the system clock to the given local date and time *)
  49. END SysClock.