]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/ada/fname.ads
Correct a function pre/postcondition [PR102403].
[thirdparty/gcc.git] / gcc / ada / fname.ads
CommitLineData
70482933
RK
1------------------------------------------------------------------------------
2-- --
3-- GNAT COMPILER COMPONENTS --
4-- --
5-- F N A M E --
6-- --
7-- S p e c --
8-- --
8d0d46f4 9-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
70482933
RK
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- --
748086b7 13-- ware Foundation; either version 3, or (at your option) any later ver- --
70482933
RK
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 --
b740cf28
AC
16-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17-- for more details. You should have received a copy of the GNU General --
18-- Public License distributed with GNAT; see file COPYING3. If not, go to --
19-- http://www.gnu.org/licenses for a complete copy of the license. --
70482933
RK
20-- --
21-- GNAT was originally developed by the GNAT team at New York University. --
71ff80dc 22-- Extensive contributions were provided by Ada Core Technologies Inc. --
70482933
RK
23-- --
24------------------------------------------------------------------------------
25
26-- This package, together with its child package Fname.UF define the
27-- association between source file names and unit names as defined
28-- (see package Uname for definition of format of unit names).
29
39f4e199 30with Namet; use Namet;
70482933
RK
31
32package Fname is
33
34 -- Note: this package spec does not depend on the Uname spec in the Ada
35 -- sense, but the comments and description of the semantics do depend on
36 -- the conventions established by Uname.
37
38 ---------------------------
39 -- File Name Conventions --
40 ---------------------------
41
42 -- GNAT requires that there be a one to one correspondence between source
43 -- file names (as used in the Osint package interface) and unit names as
44 -- defined by the Uname package. This correspondence is defined by the
45 -- two subprograms defined here in the Fname package.
46
47 -- For full rules of file naming, see GNAT User's Guide. Note that the
48 -- naming rules are affected by the presence of Source_File_Name pragmas
49 -- that have been previously processed.
50
51 -- Note that the file name does *not* include the directory name. The
52 -- management of directories is provided by Osint, and full file names
53 -- are used only for error message purposes within GNAT itself.
54
55 -----------------
56 -- Subprograms --
57 -----------------
58
70482933 59 function Is_Predefined_File_Name
b043ae01 60 (Fname : String;
fbf5a39b 61 Renamings_Included : Boolean := True) return Boolean;
fbf5a39b 62 function Is_Predefined_File_Name
b043ae01
AC
63 (Fname : File_Name_Type;
64 Renamings_Included : Boolean := True) return Boolean;
998429d6
AC
65 -- These functions determine if the given file name (which must be a simple
66 -- file name with no directory information) is the source or ALI file name
67 -- for one of the predefined library units (i.e. part of the Ada, System,
68 -- or Interface hierarchies). Note that units in the GNAT hierarchy are not
69 -- considered predefined (see Is_Internal_File_Name below).
70 --
71 -- The Renamings_Included parameter indicates whether annex J renamings
72 -- such as Text_IO are to be considered as predefined. If
73 -- Renamings_Included is True, then Text_IO will return True, otherwise
74 -- only children of Ada, Interfaces and System return True.
fbf5a39b 75
8ab31c0c
AC
76 function Is_Predefined_Renaming_File_Name
77 (Fname : String) return Boolean;
78 function Is_Predefined_Renaming_File_Name
79 (Fname : File_Name_Type) return Boolean;
80 -- True if Fname is the file name for a predefined renaming (the same file
81 -- names that are included if Renamings_Included => True is passed to
82 -- Is_Predefined_File_Name).
83
b043ae01
AC
84 function Is_Internal_File_Name
85 (Fname : String;
86 Renamings_Included : Boolean := True) return Boolean;
70482933
RK
87 function Is_Internal_File_Name
88 (Fname : File_Name_Type;
2820d220 89 Renamings_Included : Boolean := True) return Boolean;
b043ae01
AC
90 -- Same as Is_Predefined_File_Name, except units in the GNAT hierarchy are
91 -- included.
70482933 92
8ab31c0c
AC
93 function Is_GNAT_File_Name (Fname : String) return Boolean;
94 function Is_GNAT_File_Name (Fname : File_Name_Type) return Boolean;
95 -- True for units in the GNAT hierarchy
96
70482933 97end Fname;