X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Fada%2Fprj-util.ads;h=4163f98b2c88404b83d8ef868956f6d014940ddf;hb=39f4e199a51bc4ff869d273937d363902cc963c3;hp=57067e225f21cf5dd127a6753df42cf5137b6359;hpb=fbf5a39b3e101719c6bf03cf2cd013b4a312e275;p=gcc.git diff --git a/gcc/ada/prj-util.ads b/gcc/ada/prj-util.ads index 57067e225f2..4163f98b2c8 100644 --- a/gcc/ada/prj-util.ads +++ b/gcc/ada/prj-util.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2003 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2007, 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- -- @@ -16,8 +16,8 @@ -- 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 COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- +-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- +-- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- @@ -26,14 +26,14 @@ -- Utilities for use in processing project files -with Types; use Types; - -with GNAT.OS_Lib; use GNAT.OS_Lib; - package Prj.Util is function Executable_Of - (Project : Project_Id; Main : Name_Id) return Name_Id; + (Project : Project_Id; + In_Tree : Project_Tree_Ref; + Main : File_Name_Type; + Index : Int; + Ada_Main : Boolean := True) return File_Name_Type; -- Return the value of the attribute Builder'Executable for file Main in -- the project Project, if it exists. If there is no attribute Executable -- for Main, remove the suffix from Main; then, if the attribute @@ -42,15 +42,14 @@ package Prj.Util is function Value_Of (Variable : Variable_Value; - Default : String) - return String; + Default : String) return String; -- Get the value of a single string variable. If Variable is -- Nil_Variable_Value, is a string list or is defaulted, return Default. function Value_Of (Index : Name_Id; - In_Array : Array_Element_Id) - return Name_Id; + In_Array : Array_Element_Id; + In_Tree : Project_Tree_Ref) return Name_Id; -- Get a single string array component. Returns No_Name if there is no -- component Index, if In_Array is null, or if the component is a String -- list. Depending on the attribute (only attributes may be associative @@ -59,28 +58,28 @@ package Prj.Util is -- associative array. function Value_Of - (Index : Name_Id; - In_Array : Array_Element_Id) - return Variable_Value; - -- Get a string array component (single String or String list). - -- Returns Nil_Variable_Value if there is no component Index - -- or if In_Array is null. + (Index : Name_Id; + Src_Index : Int := 0; + In_Array : Array_Element_Id; + In_Tree : Project_Tree_Ref) return Variable_Value; + -- Get a string array component (single String or String list). Returns + -- Nil_Variable_Value if no component Index or if In_Array is null. -- -- Depending on the attribute (only attributes may be associative arrays) - -- the index may or may not be case sensitive. If the index is not - -- case sensitive, it is first set to lower case before the search - -- in the associative array. + -- the index may or may not be case sensitive. If the index is not case + -- sensitive, it is first set to lower case before the search in the + -- associative array. function Value_Of (Name : Name_Id; + Index : Int := 0; Attribute_Or_Array_Name : Name_Id; - In_Package : Package_Id) - return Variable_Value; + In_Package : Package_Id; + In_Tree : Project_Tree_Ref) return Variable_Value; -- In a specific package, - -- - if there exists an array Attribute_Or_Array_Name with an index - -- Name, returns the corresponding component (depending on the - -- attribute, the index may or may not be case sensitive, see previous - -- function), + -- - if there exists an array Attribute_Or_Array_Name with an index Name, + -- returns the corresponding component (depending on the attribute, the + -- index may or may not be case sensitive, see previous function), -- - otherwise if there is a single attribute Attribute_Or_Array_Name, -- returns this attribute, -- - otherwise, returns Nil_Variable_Value. @@ -89,32 +88,32 @@ package Prj.Util is function Value_Of (Index : Name_Id; In_Array : Name_Id; - In_Arrays : Array_Id) - return Name_Id; - -- Get a string array component in an array of an array list. - -- Returns No_Name if there is no component Index, if In_Arrays is null, if + In_Arrays : Array_Id; + In_Tree : Project_Tree_Ref) return Name_Id; + -- Get a string array component in an array of an array list. Returns + -- No_Name if there is no component Index, if In_Arrays is null, if -- In_Array is not found in In_Arrays or if the component is a String list. function Value_Of (Name : Name_Id; - In_Arrays : Array_Id) - return Array_Element_Id; + In_Arrays : Array_Id; + In_Tree : Project_Tree_Ref) return Array_Element_Id; -- Returns a specified array in an array list. Returns No_Array_Element -- if In_Arrays is null or if Name is not the name of an array in -- In_Arrays. The caller must ensure that Name is in lower case. function Value_Of (Name : Name_Id; - In_Packages : Package_Id) - return Package_Id; - -- Returns a specified package in a package list. Returns No_Package - -- if In_Packages is null or if Name is not the name of a package in + In_Packages : Package_Id; + In_Tree : Project_Tree_Ref) return Package_Id; + -- Returns a specified package in a package list. Returns No_Package if + -- In_Packages is null or if Name is not the name of a package in -- Package_List. The caller must ensure that Name is in lower case. function Value_Of (Variable_Name : Name_Id; - In_Variables : Variable_Id) - return Variable_Value; + In_Variables : Variable_Id; + In_Tree : Project_Tree_Ref) return Variable_Value; -- Returns a specified variable in a variable list. Returns null if -- In_Variables is null or if Variable_Name is not the name of a -- variable in In_Variables. Caller must ensure that Name is lower case. @@ -128,28 +127,28 @@ package Prj.Util is -- the last character of each line, if possible. type Text_File is limited private; - -- Represents a text file. Default is invalid text file. + -- Represents a text file. Default is invalid text file function Is_Valid (File : Text_File) return Boolean; -- Returns True if File designates an open text file that -- has not yet been closed. procedure Open (File : out Text_File; Name : String); - -- Open a text file. If this procedure fails, File is invalid. + -- Open a text file. If this procedure fails, File is invalid function End_Of_File (File : Text_File) return Boolean; - -- Returns True if the end of the text file File has been - -- reached. Fails if File is invalid. + -- Returns True if the end of the text file File has been reached. Fails if + -- File is invalid. procedure Get_Line (File : Text_File; Line : out String; Last : out Natural); - -- Reads a line from an open text file. Fails if File is invalid. + -- Reads a line from an open text file. Fails if File is invalid procedure Close (File : in out Text_File); - -- Close an open text file. File becomes invalid. - -- Fails if File is already invalid. + -- Close an open text file. File becomes invalid. Fails if File is already + -- invalid. private