DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦ed2392c4f⟧ TextFile

    Length: 20050 (0x4e52)
    Types: TextFile
    Names: »V«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦12c68c704⟧ 
                └─⟦this⟧ 
└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦220843204⟧ 
                └─⟦this⟧ 

TextFile

with Directory;
with Simple_Status;

package Profile is

    pragma Subsystem (Directory);
    pragma Module_Name (4, 3219);

    -- A collection of job-related utilities for control of log generation,
    -- Activity files, and error reactions.  These facilities are used by
    -- most packages in !Commands, and may be used by user-written procedures.

    type Response_Profile is private;

    -- The aggregate of all components of the job response profile

    function Get return Response_Profile;
    -- Profile for the current job

    function Get_Default return Response_Profile;
    -- Profile for the Session (which is the default for a job that
    -- does not specify one)

    procedure Set (Profile : Response_Profile);
    -- Set profile for rest of current job

    procedure Set_Default (Profile : Response_Profile);
    -- Set profile for session; this is the value used for the job
    -- response profile if none is otherwise specified.

    function Default_Profile return Response_Profile;

    -- If the user has established no response profile for his session,
    -- this profile is used; it is the aggregate of all the Default_xxx
    -- constants defined in this package.

    subtype Name is String;  -- an unambiguous string name


    -- A map is maintained between a job id and the following values:

    -- The ERROR REACTION specifies which of several options a command is
    -- to follow in reacting to error situations.

    -- The LOG_FILTER specifies in some detail, the desired content of the
    -- log that is generated by the command.

    -- The LOG_PREFIXES specifies the format of messages entered into the log.

    -- The WIDTH specifies the number of columns in the log display.

    -- The LOG_FILE specifies the predefined file to be used by the Log
    -- package to generate output.

    -- The ACTIVITY specifies the activity file used for loading subsystems.


    -- The REMOTE_PASSWORDS specifies the file in which usernames and
    -- passwords for remote machines are stored.

    -- The REMOTE_SESSIONS specifies the file in which session names
    -- for remote machines are stored.

    -- Procedures are provided for setting each of these values into
    -- the map on a job or session basis, and functions are provided
    -- for retrieving the current value from these maps.

    -- Error_Reaction specifies how a command is to respond to errors
    -- along two dimensions:

    -- Perseverance    whether to continue processing or stop at the first
    --                 error.  (If a log is to be generated, the process
    --                 perseveres long enough to print an error message
    --                 regardless of the setting of this option.)

    -- Exception       whether or not a process is to propagate an
    -- Propagation     exception to its caller when it terminates a run in
    --                 which errors occurred. (If processing has
    --                 persevered, ERROR is raised.)

    type Error_Reaction is (Quit, Propagate, Persevere, Raise_Error);

    -- Quit        Command terminates at the first error. It may log
    --             the error in the job error map, but may not
    --             propagate an exception to its caller

    -- Propagate   Command terminates at the first error by raising
    --             an exception.  An entry should be made to the job
    --             error map. Profile.Error may be raised if no other
    --             exception is appropriate.

    -- Persevere   Command continues after errors at its discretion.
    --             Exceptions may not be propagated to its caller.

    -- Raise_Error Command continues after errors at its discretion.
    --             The command must raise an exception if it was unable
    --             to complete successfully.

    Default_Reaction : constant Error_Reaction := Persevere;

    procedure Set_Reaction (Reaction : Error_Reaction);

    procedure Set_Default_Reaction (Reaction : Error_Reaction);

    function Reaction (Response : Response_Profile := Profile.Get)
                      return Error_Reaction;
    function Persevere
                (Response : Response_Profile := Profile.Get) return Boolean;
    -- true if error reaction is Persevere or Raise_Error; i.e. if command
    -- is to continue after an error

    function Propagate
                (Response : Response_Profile := Profile.Get) return Boolean;
    -- true if error reaction is Propagate or Raise_Error; i.e., if a
    -- command is to raise an exception when it is done.

    -- Log Filter

    type Msg_Kind is (Auxiliary_Msg, Debug_Msg, Note_Msg, Positive_Msg,
                      Position_Msg, Negative_Msg, Warning_Msg, Error_Msg,
                      Exception_Msg, Sharp_Msg, At_Msg, Dollar_Msg);

    -- Log messages of any class can be filtered out of the log as it is
    -- being generated using the procedures defined below.

    type Log_Filter is array (Msg_Kind) of Boolean;

    -- The filter specifies what types of messages are to be printed.

    Quiet   : constant Log_Filter := Log_Filter'(others => False);
    Full    : constant Log_Filter := Log_Filter'
                                        (Debug_Msg => False, others => True);
    Terse   : constant Log_Filter := Log_Filter'
                                        (False, False, False, others => True);
    Errors  : constant Log_Filter :=
       Log_Filter'(Negative_Msg .. Exception_Msg => True, others => False);
    Summary : constant Log_Filter :=
       Log_Filter'(Positive_Msg | Negative_Msg => True, others => False);

    Default_Filter : constant Log_Filter := Full;

    function Filter (Response : Response_Profile := Profile.Get)
                    return Log_Filter;

    function Includes
                (Kind : Msg_Kind; Response : Response_Profile := Profile.Get)
                return Boolean;

    -- iff includes (Kind, Response) is true then messages of that Kind are
    -- sent to the log.

    procedure Include            (Kind : Msg_Kind; Value : Boolean := True);
    procedure Include_In_Default (Kind : Msg_Kind; Value : Boolean := True);
    -- Change the filter value for the given message kind

    procedure Set_Filter (Auxiliaries : Boolean := True;
                          Diagnostics : Boolean := True;
                          Notes       : Boolean := True;
                          Positives   : Boolean := True;
                          Negatives   : Boolean := True;
                          Positions   : Boolean := True;
                          Warnings    : Boolean := True;
                          Errors      : Boolean := True;
                          Exceptions  : Boolean := True;
                          Sharps      : Boolean := True;
                          Dollars     : Boolean := True;
                          Ats         : Boolean := True);

    procedure Set_Default_Filter (Auxiliaries : Boolean := True;
                                  Diagnostics : Boolean := True;
                                  Notes       : Boolean := True;
                                  Positives   : Boolean := True;
                                  Negatives   : Boolean := True;
                                  Positions   : Boolean := True;
                                  Warnings    : Boolean := True;
                                  Errors      : Boolean := True;
                                  Exceptions  : Boolean := True;
                                  Sharps      : Boolean := True;
                                  Dollars     : Boolean := True;
                                  Ats         : Boolean := True);

    procedure Set_Filter (Filter : Log_Filter);
    -- Establishes the given filter value(s) as the current filter value
    -- for the job.

    procedure Set_Default_Filter (Filter : Log_Filter);
    -- Establishes the given filter value(s) as the default filter value
    -- for the session.

    -- Log Format
    -- Specifies the prefixes desired for each message and the length of
    -- the line used in formating messages

    type Log_Prefix is (Nil, Time,       -- 11:00:00 PM
                        Hr_Mn_Sc,   -- 23:00:00
                        Hr_Mn,      -- 23:00
                        Date,       -- September 29, 1983
                        Mn_Dy_Yr,   -- 09/29/83
                        Dy_Mon_Yr,  -- 29-SEP-83
                        Yr_Mn_Dy,   -- 83/09/29
                        Symbols     -- +++, ++*, etc
                        );

    -- Each prefix (except Nil) is followed by a single blank

    type Log_Prefixes is array (1 .. 3) of Log_Prefix;

    -- Any combination of up to three prefixes may be specified

    Default_Prefixes : constant Log_Prefixes := (Yr_Mn_Dy, Hr_Mn_Sc, Symbols);

    function Prefixes (Response : Response_Profile := Profile.Get)
                      return Log_Prefixes;

    procedure Set_Prefixes (Prefixes : Log_Prefixes);
    procedure Set_Prefixes (Prefix1, Prefix2, Prefix3 : Log_Prefix := Nil);

    procedure Set_Default_Prefixes (Prefixes : Log_Prefixes);
    procedure Set_Default_Prefixes
                 (Prefix1, Prefix2, Prefix3 : Log_Prefix := Nil);

    Default_Width : constant Natural := 77;  -- default width of log display


    procedure Set_Width         (Width : Natural);
    procedure Set_Default_Width (Width : Natural);

    function Width (Response : Response_Profile := Profile.Get) return Natural;


    -- ACTIVITY:

    subtype Activity_Type is Directory.Object;

    function Default_Activity return Activity_Type;

    procedure Set_Activity         (Activity : Activity_Type);
    procedure Set_Default_Activity (Activity : Activity_Type);

    function Activity (Response : Response_Profile := Profile.Get)
                      return Activity_Type;


    -- LOG_FILE

    type Log_Output_File is (Use_Output, Use_Error,
                             Use_Standard_Output, Use_Standard_Error);

    Default_Log_File : constant Log_Output_File :=
       Use_Output;               -- default file for log

    procedure Set_Log_File         (Log_File : Log_Output_File);
    procedure Set_Default_Log_File (Log_File : Log_Output_File);

    function Log_File (Response : Response_Profile := Profile.Get)
                      return Log_Output_File;


    function Response (Reaction : Error_Reaction  := Profile.Reaction;
                       Filter   : Log_Filter      := Profile.Filter;
                       Prefixes : Log_Prefixes    := Profile.Prefixes;
                       Width    : Natural         := Profile.Width;
                       Activity : Activity_Type   := Profile.Activity;
                       Log_File : Log_Output_File := Profile.Log_File)
                      return Response_Profile;

    procedure Set_Response (Reaction : Error_Reaction  := Profile.Reaction;
                            Filter   : Log_Filter      := Profile.Filter;
                            Prefixes : Log_Prefixes    := Profile.Prefixes;
                            Width    : Natural         := Profile.Width;
                            Activity : Activity_Type   := Profile.Activity;
                            Log_File : Log_Output_File := Profile.Log_File);

    procedure Set_Default_Response
                 (Reaction : Error_Reaction :=
                     Profile.Reaction (Profile.Get_Default);
                  Filter   : Log_Filter := Profile.Filter (Profile.Get_Default);
                  Prefixes : Log_Prefixes :=
                     Profile.Prefixes (Profile.Get_Default);
                  Width    : Natural := Profile.Width (Profile.Get_Default);
                  Activity : Activity_Type :=
                     Profile.Activity (Profile.Get_Default);
                  Log_File : Log_Output_File :=
                     Profile.Log_File (Profile.Get_Default));


    function Ignore (Reaction : Error_Reaction  := Profile.Persevere;
                     Filter   : Log_Filter      := Profile.Quiet;
                     Prefixes : Log_Prefixes    := Profile.Prefixes;
                     Width    : Natural         := Profile.Width;
                     Activity : Activity_Type   := Profile.Activity;
                     Log_File : Log_Output_File := Profile.Log_File)
                    return Response_Profile renames Response;

    function Warn (Reaction : Error_Reaction  := Profile.Persevere;
                   Filter   : Log_Filter      := Profile.Full;
                   Prefixes : Log_Prefixes    := Profile.Prefixes;
                   Width    : Natural         := Profile.Width;
                   Activity : Activity_Type   := Profile.Activity;
                   Log_File : Log_Output_File := Profile.Log_File)
                  return Response_Profile renames Response;

    function Verbose (Reaction : Error_Reaction  := Profile.Reaction;
                      Filter   : Log_Filter      := Profile.Full;
                      Prefixes : Log_Prefixes    := Profile.Prefixes;
                      Width    : Natural         := Profile.Width;
                      Activity : Activity_Type   := Profile.Activity;
                      Log_File : Log_Output_File := Profile.Log_File)
                     return Response_Profile renames Response;

    function Raise_Exception (Reaction : Error_Reaction  := Profile.Propagate;
                              Filter   : Log_Filter      := Profile.Filter;
                              Prefixes : Log_Prefixes    := Profile.Prefixes;
                              Width    : Natural         := Profile.Width;
                              Activity : Activity_Type   := Profile.Activity;
                              Log_File : Log_Output_File := Profile.Log_File)
                             return Response_Profile renames Response;

    No_Prefixes : constant Log_Prefixes := (Nil, Nil, Nil);

    function Nil (Reaction : Error_Reaction  := Profile.Quit;
                  Filter   : Log_Filter      := Profile.Quiet;
                  Prefixes : Log_Prefixes    := Profile.No_Prefixes;
                  Width    : Natural         := Profile.Default_Width;
                  Activity : Activity_Type   := Profile.Default_Activity;
                  Log_File : Log_Output_File := Profile.Default_Log_File)
                 return Response_Profile renames Response;

    Error : exception;


    ----------------------
    -- String Interface --
    ----------------------

    -- The strings accepted and returned by the following subprograms obey
    -- the syntax for form parameters. The Option names and expected values
    -- are as follows:

    -- Option Name               Value

    -- REACTION                  QUIT, PROPAGATE, PERSEVERE, RAISE_ERROR
    --
    -- AUXILIARY_MSG, :::        TRUE or FALSE
    -- DEBUG_MSG, ???                 "
    -- NOTE_MSG, ---                  "
    -- POSITIVE_MSG, +++              "
    -- POSITION_MSG, >>>              "
    -- NEGATIVE_MSG, ++*              "
    -- WARNING_MSG, !!!               "
    -- ERROR_MSG, ***                 "
    -- EXCEPTION_MSG, %%%             "
    -- SHARP_MSG, ###                 "
    -- AT_MSG, @@@                    "
    -- DOLLAR_MSG, $$$                "
    --
    -- PREFIX                    (form[, form[, form]]) where form is one of
    --                           TIME, HR_MN_SC, HR_MN,
    --                           DATE, MN_DY_YR, DY_MON_YR, YR_MN_DY,
    --                           SYMBOLS
    --                           e.g. (TIME, DATE, SYMBOLS)
    --                                (HR_MN_SC, SYMBOLS)
    --
    -- LINE_WIDTH                positive integer in 1..1024
    --
    -- ACTIVITY                  name of activity file
    --
    -- LOG_FILE                  USE_OUTPUT, USE_ERROR, USE_STANDARD_OUTPUT, or
    --                           USE_STANDARD_ERROR


    -- The Options enclosed in "<>" brackets take no value, but denote the
    -- current value of the named profile.  These values may be used by
    -- themselves to denote all components of the named profile or as the value
    -- of one of the profile components to denote just that component of the
    -- named file, e.g. Activity=><DEFAULT>.  Where special symbols appear,
    -- e.g. +++, any symbols not mentioned are turned off.
    --
    -- <DEFAULT>                 System default, ignores user profile.
    --                           PERSEVERE, :::, ~???, ---..$$$, Width=>77
    --                           Prefix=>YR_MN_DY, HR_MN_SC SYMBOLS, USE_OUTPUT
    --
    -- <ERRORS>                  ++*, ***..%%%, <PROFILE>
    --
    -- <IGNORE>                  ~:::..$$$. <PROFILE>
    --
    -- <NIL>                     Empty, ignores user profile.
    --                           Quit, ~:::..$$$, Prefix=>, Width=>77, USE_OUTPUT
    --
    -- <PROFILE>                 Values set by job/session profile.
    --
    -- <QUIET>                   Equivalent of <NIL>
    --
    -- <PROGRESS>                +++, ++*, ***..%%%, <PROFILE>
    --
    -- <RAISE_EXCEPTION>         PROPAGATE, <PROFILE>
    --
    -- <SESSION_PROFILE>         Use session profile rather than job.
    --
    -- <WARN>                    ++*..%%%, <PROFILE>
    --
    -- <VERBOSE>                 :::, ~???, ---..$$$, <PROFILE>


    function Get return String;
    -- Profile for the current job as a form parameter

    function Get_Default return String;
    -- Profile for the Session (which is the default for a job that
    -- does not specify one) as a form parameter

    function Image (Profile : Response_Profile := Standard.Profile.Get)
                   return String;
    function Value (Image : String := Profile.Get) return Response_Profile;

    procedure Convert (Image    :        String;
                       Response : out    Response_Profile;
                       Status   : in out Simple_Status.Condition);

    -- Convert between form parameter representation of a profile and the
    -- internal representation.  The Value function ignores invalid options
    -- in the form parameter.

    procedure Set (Profile : String; Status : in out Simple_Status.Condition);

    -- Set profile for rest of current job; An error Status is returned and
    -- the profile is not changed if the profile string is invalid.

    procedure Set_Default (Profile :        String;
                           Status  : in out Simple_Status.Condition);
    -- Set profile for session; this is the value used for the job
    -- response profile if none is otherwise specified.


    procedure Get_Cached_Resolution
                 (Name            :     String;
                  The_Declaration : out Directory.Declaration;
                  The_Object      : out Directory.Object;
                  The_Version     : out Directory.Version;
                  Status          : out Directory.Naming.Name_Status);

    -- Retrieve the resolution of the Name as cached at job initiation. Only
    -- resolution of <IMAGE>, <CURSOR>, <REGION>, and <SELECTION> are cached.

    function Cached_Selected_Text return String;

    -- Retrieve the Selected text at job initiation.

    -- REMOTE_PASSWORDS:

    subtype Remote_Passwords_Type is Directory.Object;
    function  Remote_Passwords (Response : Response_Profile := Profile.Get)
                              return Remote_Passwords_Type;
    function  Default_Remote_Passwords return Remote_Passwords_Type;
    procedure Set_Remote_Passwords (Passwords : Remote_Passwords_Type);
    procedure Set_Default_Remote_Passwords (Passwords : Remote_Passwords_Type);

    -- REMOTE_SESSIONS:

    subtype Remote_Sessions_Type is Directory.Object;  -- text file
    function  Remote_Sessions (Response : Response_Profile := Profile.Get)
                             return Remote_Sessions_Type;
    function  Default_Remote_Sessions return Remote_Sessions_Type;
    procedure Set_Remote_Sessions (Sessions : Remote_Sessions_Type);
    procedure Set_Default_Remote_Sessions (Sessions : Remote_Sessions_Type);
end Profile;