OSDN Git Service

2007-09-26 Thomas Quinot <quinot@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / fmap.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                                 F M A P                                  --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 2001-2007, 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.  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.          --
20 --                                                                          --
21 -- GNAT was originally developed  by the GNAT team at  New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
23 --                                                                          --
24 ------------------------------------------------------------------------------
25
26 --  This package keeps two mappings: from unit names to file names,
27 --  and from file names to path names.
28
29 with Namet; use Namet;
30
31 package Fmap is
32
33    procedure Initialize (File_Name : String);
34    --  Initialize the mappings from the mapping file File_Name.
35    --  If the mapping file is incorrect (non existent file, truncated file,
36    --  duplicate entries), output a warning and do not initialize the mappings.
37    --  Record the state of the mapping tables in case Update is called
38    --  later on.
39
40    function Mapped_Path_Name (File : File_Name_Type) return File_Name_Type;
41    --  Return the path name mapped to the file name File.
42    --  Return No_File if File is not mapped.
43
44    function Mapped_File_Name (Unit : Unit_Name_Type) return File_Name_Type;
45    --  Return the file name mapped to the unit name Unit.
46    --  Return No_File if Unit is not mapped.
47    --  Return Error_Name if it is forbidden.
48
49    procedure Add_To_File_Map
50      (Unit_Name : Unit_Name_Type;
51       File_Name : File_Name_Type;
52       Path_Name : File_Name_Type);
53    --  Add mapping of Unit_Name to File_Name and of File_Name to Path_Name
54
55    procedure Update_Mapping_File (File_Name : String);
56    --  If Add_To_File_Map has been called (after Initialize or any time
57    --  if Initialize has not been called), append the new entries to the
58    --  mapping file whose file name is File_Name.
59
60    procedure Reset_Tables;
61    --  Initialize all the internal data structures. This procedure is used
62    --  when several compilations are performed by the same process (by GNSA
63    --  for ASIS, for example) to remove any existing mappings from a previous
64    --  compilation.
65
66    procedure Add_Forbidden_File_Name (Name : File_Name_Type);
67    --  Indicate that a source file name is forbidden.
68    --  This is used by gnatmake when there are excluded sources in projects
69    --  (attributes Excluded_Source_Files or Locally_Removed_Files).
70
71    procedure Remove_Forbidden_File_Name (Name : File_Name_Type);
72    --  Indicate that a source file name that was forbidden is no longer
73    --  forbidden. Used by gnatmake when an excluded source is redefined
74    --  in another extending project.
75
76 end Fmap;