DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦74a766dbc⟧ Ada Source

    Length: 9216 (0x2400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Time_Utilities, pragma Module_Name 4 3972, pragma Subsystem Tools, seg_001c56

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Calendar;

package Time_Utilities is

    Minute : constant Duration := 60.0;
    Hour   : constant Duration := 3600.0;
    Day    : constant Duration := 86_400.0;

    --------------------------------------------------------------------
    -- Time_Utilities.Time is a segmented version of Calendar.Time
    --         with image and value functions
    --------------------------------------------------------------------

    type Years  is new Calendar.Year_Number;
    type Months is (January, February, March, April, May, June, July,
                    August, September, October, November, December);
    type Days   is new Calendar.Day_Number;

    type Hours   is new Integer range 1 .. 12;
    type Minutes is new Integer range 0 .. 59;
    type Seconds is new Integer range 0 .. 59;

    type Sun_Positions is (Am, Pm);

    type Time is
        record
            Year         : Years;
            Month        : Months;
            Day          : Days;
            Hour         : Hours;
            Minute       : Minutes;
            Second       : Seconds;
            Sun_Position : Sun_Positions;
        end record;

    function Get_Time return Time;

    function Convert_Time (Date : Calendar.Time) return Time;
    function Convert_Time (Date : Time)          return Calendar.Time;

    function Nil                  return Time;
    function Is_Nil (Date : Time) return Boolean;

    function Nil                           return Calendar.Time;
    function Is_Nil (Date : Calendar.Time) return Boolean;

    type Time_Format is (Expanded,  -- 11:00:00 PM
                         Military,  -- 23:00:00
                         Short,     -- 23:00
                         Ada        -- 23_00_00
                         );

    type Date_Format is (Expanded,        -- September 29, 1983
                         Month_Day_Year,  -- 09/29/83
                         Day_Month_Year,  -- 29-SEP-83
                         Year_Month_Day,  -- 83/09/29
                         Ada              -- 83_09_29
                         );

    type Image_Contents is (Both, Time_Only, Date_Only);

    function Image (Date       : Time;
                    Date_Style : Date_Format    := Time_Utilities.Expanded;
                    Time_Style : Time_Format    := Time_Utilities.Expanded;
                    Contents   : Image_Contents := Time_Utilities.Both)
                   return String;

    function Value (S : String) return Time;

    --------------------------------------------------------------------
    -- Time_Utilities.Interval is a segmented version of Duration
    --        with image and value functions
    --------------------------------------------------------------------

    type Day_Count      is new Integer range 0 .. Integer'Last;
    type Military_Hours is new Integer range 0 .. 23;
    type Milliseconds   is new Integer range 0 .. 999;

    type Interval is
        record
            Elapsed_Days         : Day_Count;
            Elapsed_Hours        : Military_Hours;
            Elapsed_Minutes      : Minutes;
            Elapsed_Seconds      : Seconds;
            Elapsed_Milliseconds : Milliseconds;
        end record;


    function Convert (I : Interval) return Duration;
    function Convert (D : Duration) return Interval;

    function Image (I : Interval) return String;
    function Value (S : String)   return Interval;

    function Image (D : Duration) return String;

    function Duration_Until (T : Time)          return Duration;
    function Duration_Until (T : Calendar.Time) return Duration;
    function Duration_Until_Next
                (H : Military_Hours; M : Minutes := 0; S : Seconds := 0)
                return Duration;

    -- Day of week support; Monday is 1.
    type Weekday is new Positive range 1 .. 7;

    function Day_Of_Week (T : Calendar.Time)                   return Weekday;
    function Day_Of_Week (T : Time := Time_Utilities.Get_Time) return Weekday;
    function Image       (D : Weekday)                         return String;

    function "+" (D : Weekday; I : Integer) return Weekday;
    function "-" (D : Weekday; I : Integer) return Weekday;

    pragma Subsystem (Tools);
    pragma Module_Name (4, 3972);

end Time_Utilities;

E3 Meta Data

    nblk1=8
    nid=0
    hdr6=10
        [0x00] rec0=1e rec1=00 rec2=01 rec3=026
        [0x01] rec0=01 rec1=00 rec2=05 rec3=010
        [0x02] rec0=1a rec1=00 rec2=08 rec3=022
        [0x03] rec0=00 rec1=00 rec2=02 rec3=03c
        [0x04] rec0=19 rec1=00 rec2=07 rec3=00e
        [0x05] rec0=01 rec1=00 rec2=03 rec3=026
        [0x06] rec0=19 rec1=00 rec2=06 rec3=09c
        [0x07] rec0=0a rec1=00 rec2=04 rec3=000
    tail 0x20100f6527da18daafa60 0x42a00088462065003