1------------------------------------------------------------------------------
2--                                                                          --
3--                         GNAT COMPILER COMPONENTS                         --
4--                                                                          --
5--                                F N A M E                                 --
6--                                                                          --
7--                                 S p e c                                  --
8--                                                                          --
9--          Copyright (C) 1992-2019, Free Software Foundation, Inc.         --
10--                                                                          --
11-- GNAT is free software;  you can  redistribute it  and/or modify it under --
12-- terms of the  GNU General Public License as published  by the Free Soft- --
13-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
17--                                                                          --
18-- As a special exception under Section 7 of GPL version 3, you are granted --
19-- additional permissions described in the GCC Runtime Library Exception,   --
20-- version 3.1, as published by the Free Software Foundation.               --
21--                                                                          --
22-- You should have received a copy of the GNU General Public License and    --
23-- a copy of the GCC Runtime Library Exception along with this program;     --
24-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
25-- <http://www.gnu.org/licenses/>.                                          --
26--                                                                          --
27-- GNAT was originally developed  by the GNAT team at  New York University. --
28-- Extensive contributions were provided by Ada Core Technologies Inc.      --
29--                                                                          --
30------------------------------------------------------------------------------
31
32--  This package, together with its child package Fname.UF define the
33--  association between source file names and unit names as defined
34--  (see package Uname for definition of format of unit names).
35
36with Namet; use Namet;
37
38package Fname is
39
40   --  Note: this package spec does not depend on the Uname spec in the Ada
41   --  sense, but the comments and description of the semantics do depend on
42   --  the conventions established by Uname.
43
44   ---------------------------
45   -- File Name Conventions --
46   ---------------------------
47
48   --  GNAT requires that there be a one to one correspondence between source
49   --  file names (as used in the Osint package interface) and unit names as
50   --  defined by the Uname package. This correspondence is defined by the
51   --  two subprograms defined here in the Fname package.
52
53   --   For full rules of file naming, see GNAT User's Guide. Note that the
54   --   naming rules are affected by the presence of Source_File_Name pragmas
55   --   that have been previously processed.
56
57   --  Note that the file name does *not* include the directory name. The
58   --  management of directories is provided by Osint, and full file names
59   --  are used only for error message purposes within GNAT itself.
60
61   -----------------
62   -- Subprograms --
63   -----------------
64
65   function Is_Predefined_File_Name
66     (Fname              : String;
67      Renamings_Included : Boolean := True) return Boolean;
68   function Is_Predefined_File_Name
69     (Fname              : File_Name_Type;
70      Renamings_Included : Boolean := True) return Boolean;
71   --  These functions determine if the given file name (which must be a simple
72   --  file name with no directory information) is the source or ALI file name
73   --  for one of the predefined library units (i.e. part of the Ada, System,
74   --  or Interface hierarchies). Note that units in the GNAT hierarchy are not
75   --  considered predefined (see Is_Internal_File_Name below).
76   --
77   --  The Renamings_Included parameter indicates whether annex J renamings
78   --  such as Text_IO are to be considered as predefined. If
79   --  Renamings_Included is True, then Text_IO will return True, otherwise
80   --  only children of Ada, Interfaces and System return True.
81
82   function Is_Predefined_Renaming_File_Name
83     (Fname : String) return Boolean;
84   function Is_Predefined_Renaming_File_Name
85     (Fname : File_Name_Type) return Boolean;
86   --  True if Fname is the file name for a predefined renaming (the same file
87   --  names that are included if Renamings_Included => True is passed to
88   --  Is_Predefined_File_Name).
89
90   function Is_Internal_File_Name
91     (Fname              : String;
92      Renamings_Included : Boolean := True) return Boolean;
93   function Is_Internal_File_Name
94     (Fname              : File_Name_Type;
95      Renamings_Included : Boolean := True) return Boolean;
96   --  Same as Is_Predefined_File_Name, except units in the GNAT hierarchy are
97   --  included.
98
99   function Is_GNAT_File_Name (Fname : String) return Boolean;
100   function Is_GNAT_File_Name (Fname : File_Name_Type) return Boolean;
101   --  True for units in the GNAT hierarchy
102
103   procedure Tree_Read;
104   --  Dummy procedure (reads dummy table values from tree file)
105
106   procedure Tree_Write;
107   --  Writes out internal tables to current tree file using Tree_Write
108   --  This is actually a dummy routine, since the relevant table is
109   --  no longer used, but we retain it for now, to avoid a tree file
110   --  incompatibility with the 3.13 compiler. Should be removed for
111   --  the 3.14a release ???
112
113end Fname;
114