-- This package conceals the library structure of the Software Catalog.
--
-- All returned strings are in uppercase.
--
with Subtypes;
use Subtypes;
package Pathnames is

    function Document_Setup_File_Template return Full_Name;
    --
    -- Returns the full name of the document setup file template common to all
    -- software catalogs.

    function Printer_Options_File_Template return Full_Name;
    --
    -- Returns the full name of the printer options file template common to all
    -- software catalogs.

    function Data_File_Template return Full_Name;
    --
    -- Returns the full name of the data file template common to all
    -- software catalogs.

    function Release_Notice_Template return Full_Name;
    --
    -- Returns the full name of the release notice template common to all
    -- software catalogs.

    function Browser_View_Name_File_Template return Full_Name;
    --
    -- Returns the full name of the browser view name file template common
    -- to all software catalogs.

    -- *****

    function Catalog_Containing_Version  
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the catalog containing the specified
    -- version.

    function Catalog_Containing_Section  
                (This_Section : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the catalog containing the specified
    -- section.

    function Catalog_Containing_Item
                (This_Item : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the catalog containing the specified item.

    function Section_Containing_Item
                (This_Item : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the section containing the specified item.

    -- *****

    function Full_Catalog_Name  
                (This_Catalog : in Simple_Name) return Full_Name;
    --
    -- Given the simple name of a catalog, returns its full name.

    function Full_Version_Name
                (This_Catalog : in Full_Name; This_Version : in Simple_Name)
                return Full_Name;
    --
    -- Given the full name of a catalog and the simple name of a
    -- version of the catalog, returns the full name of the version.

    function Full_Section_Name
                (This_Catalog : in Full_Name; This_Section : in Simple_Name)
                return Full_Name;
    --
    -- Given the full name of a catalog and the simple name of a
    -- section belonging to the catalog, returns the full name of
    -- the section.

    function Full_Item_Name
                (This_Section : in Full_Name; This_Item : in Simple_Name)
                return Full_Name;
    --
    -- Given the full name of a section and the simple name of an
    -- item belonging to the section, returns the full name of
    -- the item.

    function Full_View_Name
                (This_Item : in Full_Name; This_View : in Simple_Name)
                return Full_Name;
    --
    -- Given the full name of an item and the simple name of a view contained
    -- by the item, returns the full name of the view.

    -- *****

    function Versions_Context_For
                (This_Catalog : in Full_Name) return Full_Name;
    --
    -- Returns the context enclosing all versions of the catalog.

    function Sections_Context_For
                (This_Catalog : in Full_Name) return Full_Name;
    --
    -- Returns the context enclosing all sections of the catalog.

    -- *****

    function Is_Valid_Catalog_Name (This_Catalog : in Full_Name) return Boolean;
    --
    -- Returns True iff the specified catalog name is syntactically valid
    -- (a fully-qualified pathname with the correct context).

    function Is_Valid_Version_Name (This_Version : in Full_Name) return Boolean;
    --
    -- Returns True iff the specified version name is syntactically valid
    -- (a fully-qualified pathname with the correct context).

    function Is_Valid_Section_Name (This_Section : in Full_Name) return Boolean;
    --
    -- Returns True iff the specified section name is syntactically valid
    -- (a fully-qualified pathname with the correct context).

    function Is_Valid_Item_Name (This_Item : in Full_Name) return Boolean;
    --
    -- Returns True iff the specified item name is syntactically valid
    -- (a fully-qualified pathname with the correct context).

    -- *****

    procedure Assert_Is_Valid_Catalog_Name (This_Catalog : in Full_Name);
    --
    -- Raises "Invalid_Catalog_Name" if the specified catalog name is
    -- syntactically valid (a fully-qualified pathname with the correct
    -- context).

    procedure Assert_Is_Valid_Version_Name (This_Version : in Full_Name);
    --
    -- Raises "Invalid_Version_Name" if the specified version name is
    -- syntactically valid (a fully-qualified pathname with the correct
    -- context).

    procedure Assert_Is_Valid_Section_Name (This_Section : in Full_Name);
    --
    -- Raises "Invalid_Section_Name" if the specified section name is
    -- syntactically valid (a fully-qualified pathname with the correct
    -- context).

    procedure Assert_Is_Valid_Item_Name (This_Item : in Full_Name);
    --
    -- Raises "Invalid_Item_Name" if the specified item name is
    -- syntactically valid (a fully-qualified pathname with the correct
    -- context).

    -- *****

    function Version_Identifier_For
                (This_Version : in Full_Name) return Simple_Name;
    --
    -- Returns the simple name of the specified catalog version.

    function Data_File_For (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the data file for the specified catalog version.

    function Browser_Data_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the browser version of the data file for the
    -- specified catalog version.

    function Browser_Data_File_Markup_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the formatter markup of the browser version of
    -- the data file for the specified catalog version.

    function Browser_Data_File_Online_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the online version of the browser version
    -- of the data file for the specified catalog version.

    function Release_Notice_For (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the release notice for the specified catalog
    -- version.

    function Formatted_Release_Notice_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the formatted release notice for the specified
    -- catalog version.

    function Booklet_For (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the booklet for the specified catalog version.

    function Formatted_Booklet_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the formatted booklet for the specified
    -- catalog version.

    -- *****

    function Exports_File_For (This_View : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the exports file for the specified view.

    -- *****

    function Simple_Public_Domain_Boilerplate_File_Name return Simple_Name;
    --
    -- Returns the simple name common to all public domain boilerplate files.

    function Public_Domain_Boilerplate_File_Template return Full_Name;
    --
    -- Returns the full name of the public domain boilerplate file template.

    function Public_Domain_Boilerplate_File_For
                (This_View : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the public domain boilerplate file for the
    -- specified view.

    function Free_Form_Public_Domain_Boilerplate_File
                (For_Item : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the public domain boilerplate file for the
    -- specified free-form item.

    function Simple_Proprietary_Boilerplate_File_Name return Simple_Name;
    --
    -- Returns the simple name common to all proprietary boilerplate files.

    function Proprietary_Boilerplate_File_Template return Full_Name;
    --
    -- Returns the full name of the proprietary boilerplate file template.

    function Proprietary_Boilerplate_File_For
                (This_View : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the proprietary boilerplate file for the
    -- specified view.

    function Free_Form_Proprietary_Boilerplate_File
                (For_Item : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the proprietary boilerplate file for the
    -- specified free-form item.

    function All_Boilerplate_Files_In
                (This_View : in Full_Name) return Full_Name;
    --
    -- Returns a naming expresion that will resolve to any and all boilerplate
    -- files contained in the specified view.

    -- *****

    function All_Read_Me_Files_In
                (This_Free_Form_Item : in Full_Name) return Full_Name;
    --
    -- Returns a naming expression that will resolve to any and all Read_Me
    -- files contained in the specified free-form item.

    function Read_Me_File_For (This_View : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the Read_Me file for the specified view.

    function Archive_Data_For (This_Library : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the Data file for Archive commands for the
    -- specified library (NOTE: this is NOT the same as the data file used
    -- to create catalog structures).

    function Archive_Index_For (This_Library : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the Index file for Archive commands for the
    -- specified library.

    -- *****

    function Defaults_File_For (This_User : in User_Name) return Full_Name;
    --
    -- Returns the full name of the defaults file for the specified user.

    -- *****

    function Printer_Options_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the file which specifies the default
    -- options string for print commands for the specified version.

    function Document_Setup_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the file containing the default setup
    -- and macros for markup language documents for the specified version.

    -- *****

    function Workspace_For (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of a directory which can be used as a
    -- scratchpad for the specified version.

    -- *****

    function Parse_File_Name_For (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the file which should be used for parsing
    -- the load-proc for the specified version.

    function Simple_Main_Procedure_Name return Simple_Name;
    --
    -- Returns the simple name of the main procedure used to generate
    -- load-procs.

    function Main_Procedure_Name_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the name of the main procedure used to generate the load-proc
    -- for the specified version.

    function Simple_Load_Proc_Browser_Package_Name return Simple_Name;
    --
    -- Returns the simple name of the browser package which is "with"ed
    -- by the main procedure and load-proc.

    function Browser_View_Name_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the file containing the name of the view
    -- which contains the browser package for the specified version.

    function Load_Proc_Browser_Package_Name_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the browser package which is "with"ed
    -- by the main procedure and load-proc for the specified version.
    -- The view containing the package is derived from the browser view
    -- file for the specified version.
    --
    -- Raises "IO_Failure" if a problem is encountered accessing the
    -- file.

    function Simple_Load_Proc_Browser_Procedure_Name return Simple_Name;
    --
    -- Returns the simple name of the browser procedure which is
    -- contained in the browser package.

    function Load_Proc_Name_For (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the load-proc for the specified version.

    -- *****

    function Archive_Directives_File_For
                (This_Version : in Full_Name) return Full_Name;
    --
    -- Returns the full name of the file containing archive directives
    -- for the specified version.

    function Tape_Contents_For (This_Version : in Full_Name) return String;
    --
    -- Returns a naming expression which resolves to those objects which
    -- should be placed on a Software Catalog release tape.

    -- *****

    Invalid_Catalog_Name : exception;
    Invalid_Version_Name : exception;
    Invalid_Section_Name : exception;
    Invalid_Item_Name : exception;

    Io_Failure : exception;

end Pathnames;  