package Job_Accounting is

    --  This package provides an abstract interface for getting information
    --  from the job accounting log files created by the system in the
    --  directory !Machine.Accounting.
    --
    --  It is the intention that Report procedures will be built on top on
    --  this package to format the information in usable ways, or higher level
    --  interfaces that may visit all accounting files a provide a summary
    --  of a particular users activity.
    --
    --  The information in the accounting files has the following fields from
    --  left to right:
    --
    --   1) A Job ('J') or Session ('S') indicator
    --
    --   2) The Start date and time for the job or session
    --
    --   3) The End data and time for the job or session
    --
    --   4) The CPU utilization is absolute time for the job or session
    --
    --   5) The number of Disk_waits
    --
    --   6) The number of Jobs spawned by a session  (This number is always
    --      a 1 for a job).
    --
    --   7) The User name and Session name for the job or Session.
    --      These are separated by a '.'.  System jobs are user "*SYSTEM"
    --      and session "*SYSTEM".
    --
    --      The accounting files can be found in:
    --
    --          !Machine.Accounting
    --
    --      and are of the form:
    --
    --          Activity_DATE_At_TIME
    --

    type Entry_Type is private;

    type Kind is (Session, Job);

    function Entry_Kind (Log_Entry : Entry_Type) return Kind;

    function Elapsed_Time (Log_Entry : Entry_Type) return Duration;
    function Cpu_Time (Log_Entry : Entry_Type) return Duration;

    function User_Name (Log_Entry : Entry_Type) return String;
    function Session_Name (Log_Entry : Entry_Type) return String;

    function Jobs_Spawned (Log_Entry : Entry_Type) return Positive;
    function Disk_Io_Requests (Log_Entry : Entry_Type) return Natural;


    type Iterator is limited private;

    procedure Initialize (Log_File_Name : String; Iter : out Iterator);

    procedure Next (Iter : in out Iterator);
    function Value (Iter : Iterator) return Entry_Type;
    function Done (Iter : Iterator) return Boolean;


private
    type Entry_Type is new Boolean;

    type Iterator is new Boolean;

end Job_Accounting;
