/usr/share/ada/adainclude/gnatprj/prj-env.ads is in libgnatprj4.6-dev 4.6.4-0ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . E N V --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements services for Project-aware tools, mostly related
-- to the environment (configuration pragma files, path files, mapping files).
with GNAT.Dynamic_HTables;
with GNAT.OS_Lib;
package Prj.Env is
procedure Initialize (In_Tree : Project_Tree_Ref);
-- Initialize global components relative to environment variables
procedure Print_Sources (In_Tree : Project_Tree_Ref);
-- Output the list of sources, after Project files have been scanned
procedure Create_Mapping (In_Tree : Project_Tree_Ref);
-- Create in memory mapping from the sources of all the projects (in body
-- of package Fmap), so that Osint.Find_File will find the correct path
-- corresponding to a source.
procedure Create_Temp_File
(In_Tree : Project_Tree_Ref;
Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type;
File_Use : String);
-- Create temporary file, and fail with an error if it could not be created
procedure Create_Mapping_File
(Project : Project_Id;
Language : Name_Id;
In_Tree : Project_Tree_Ref;
Name : out Path_Name_Type);
-- Create a temporary mapping file for project Project. For each source or
-- template of Language in the Project, put the mapping of its file
-- name and path name in this file.
--
-- Implementation note: we pass a language name, not a language_index here,
-- since the latter would have to match exactly the index of that language
-- for the specified project, and that is not information available in
-- buildgpr.adb.
--
-- See fmap for a description of the format of the mapping file
procedure Create_Config_Pragmas_File
(For_Project : Project_Id;
In_Tree : Project_Tree_Ref);
-- If there needs to have SFN pragmas, either for non standard naming
-- schemes or for individual units.
procedure Create_New_Path_File
(In_Tree : Project_Tree_Ref;
Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type);
-- Create a new temporary path file. Get the file name in Path_Name.
function Ada_Include_Path
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
Recursive : Boolean := False) return String;
-- Get the source search path of a Project file. If Recursive it True, get
-- all the source directories of the imported and modified project files
-- (recursively). If Recursive is False, just get the path for the source
-- directories of Project. Note: the resulting String may be empty if there
-- is no source directory in the project file.
function Ada_Objects_Path
(Project : Project_Id;
Including_Libraries : Boolean := True) return String_Access;
-- Get the ADA_OBJECTS_PATH of a Project file. For the first call, compute
-- it and cache it. When Including_Libraries is False, do not include the
-- object directories of the library projects, and do not cache the result.
procedure Set_Ada_Paths
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
Including_Libraries : Boolean;
Include_Path : Boolean := True;
Objects_Path : Boolean := True);
-- Set the environment variables for additional project path files, after
-- creating the path files if necessary.
function File_Name_Of_Library_Unit_Body
(Name : String;
Project : Project_Id;
In_Tree : Project_Tree_Ref;
Main_Project_Only : Boolean := True;
Full_Path : Boolean := False) return String;
-- Returns the file name of a library unit, in canonical case. Name may or
-- may not have an extension (corresponding to the naming scheme of the
-- project). If there is no body with this name, but there is a spec, the
-- name of the spec is returned.
--
-- If Full_Path is False (the default), the simple file name is returned.
--
-- If Full_Path is True, the absolute path name is returned.
--
-- If neither a body nor a spec can be found, an empty string is returned.
-- If Main_Project_Only is True, the unit must be an immediate source of
-- Project. If it is False, it may be a source of one of its imported
-- projects.
function Project_Of
(Name : String;
Main_Project : Project_Id;
In_Tree : Project_Tree_Ref) return Project_Id;
-- Get the project of a source. The source file name may be truncated
-- (".adb" or ".ads" may be missing). If the source is in a project being
-- extended, return the ultimate extending project. If it is not a source
-- of any project, return No_Project.
procedure Get_Reference
(Source_File_Name : String;
In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Path : out Path_Name_Type);
-- Returns the project of a source and its path in displayable form
generic
with procedure Action (Path : String);
procedure For_All_Source_Dirs
(Project : Project_Id;
In_Tree : Project_Tree_Ref);
-- Iterate through all the source directories of a project, including those
-- of imported or modified projects. Only returns those directories that
-- potentially contain Ada sources (ie ignore projects that have no Ada
-- sources
generic
with procedure Action (Path : String);
procedure For_All_Object_Dirs (Project : Project_Id);
-- Iterate through all the object directories of a project, including
-- those of imported or modified projects.
------------------
-- Project Path --
------------------
type Project_Search_Path is private;
-- An abstraction of the project path. This object provides subprograms to
-- search for projects on the path (and caches the results for more
-- efficiency).
procedure Free (Self : in out Project_Search_Path);
-- Free the memory used by Self
procedure Add_Directories
(Self : in out Project_Search_Path;
Path : String);
-- Add one or more directories to the path. Directories added with this
-- procedure are added in order after the current directory and before the
-- path given by the environment variable GPR_PROJECT_PATH. A value of "-"
-- will remove the default project directory from the project path.
--
-- Calls to this subprogram must be performed before the first call to
-- Find_Project below, or PATH will be added at the end of the search
-- path.
procedure Get_Path
(Self : in out Project_Search_Path;
Path : out String_Access);
-- Return the current value of the project path, either the value set
-- during elaboration of the package or, if procedure Set_Project_Path has
-- been called, the value set by the last call to Set_Project_Path.
-- The returned value must not be modified.
procedure Set_Path
(Self : in out Project_Search_Path; Path : String);
-- Override the value of the project path.
-- This also removes the implicit default search directories
procedure Find_Project
(Self : in out Project_Search_Path;
Project_File_Name : String;
Directory : String;
Path : out Namet.Path_Name_Type);
-- Search for a project with the given name either in Directory (which
-- often will be the directory contain the project we are currently parsing
-- and which we found a reference to another project), or in the project
-- path. Extra_Project_Path contains additional directories to search.
--
-- Project_File_Name can optionally contain directories, and the extension
-- (.gpr) for the file name is optional.
--
-- Returns No_Name if no such project was found
private
package Projects_Paths is new GNAT.Dynamic_HTables.Simple_HTable
(Header_Num => Header_Num,
Element => Path_Name_Type,
No_Element => No_Path,
Key => Name_Id,
Hash => Hash,
Equal => "=");
type Project_Search_Path is record
Path : GNAT.OS_Lib.String_Access;
-- As a special case, if the first character is '#:" or this variable is
-- unset, this means that the PATH has not been fully initialized yet
-- (although subprograms above will properly take care of that).
Cache : Projects_Paths.Instance;
end record;
end Prj.Env;
|