summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-util.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/prj-util.ads')
-rw-r--r--gcc/ada/prj-util.ads46
1 files changed, 32 insertions, 14 deletions
diff --git a/gcc/ada/prj-util.ads b/gcc/ada/prj-util.ads
index 4f1f64d7ad7..57067e225f2 100644
--- a/gcc/ada/prj-util.ads
+++ b/gcc/ada/prj-util.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2003 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- --
@@ -23,14 +23,23 @@
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
---
--- Utilities when using project files.
+
+-- Utilities for use in processing project files
+
+with Types; use Types;
with GNAT.OS_Lib; use GNAT.OS_Lib;
-with Types; use Types;
package Prj.Util is
+ function Executable_Of
+ (Project : Project_Id; Main : Name_Id) return Name_Id;
+ -- 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
+ -- Executable_Suffix is specified, add this suffix, otherwise add the
+ -- standard executable suffix for the platform.
+
function Value_Of
(Variable : Variable_Value;
Default : String)
@@ -42,9 +51,12 @@ package Prj.Util is
(Index : Name_Id;
In_Array : Array_Element_Id)
return Name_Id;
- -- Get a single string array component.
- -- Returns No_Name if there is no component Index (case sensitive),
- -- if In_Array is null, or if the component is a String list.
+ -- 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
+ -- 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.
function Value_Of
(Index : Name_Id;
@@ -52,7 +64,12 @@ package Prj.Util is
return Variable_Value;
-- Get a string array component (single String or String list).
-- Returns Nil_Variable_Value if there is no component Index
- -- (case sensitive), or if In_Array is null.
+ -- 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.
function Value_Of
(Name : Name_Id;
@@ -60,9 +77,11 @@ package Prj.Util is
In_Package : Package_Id)
return Variable_Value;
-- In a specific package,
- -- - if there exists an array Variable_Or_Array_Name with an index
- -- Name, returns the corresponding component,
- -- - otherwise if there is a attribute Attribute_Or_Array_Name,
+ -- - 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.
-- If In_Package is null, returns Nil_Variable_Value.
@@ -73,9 +92,8 @@ package Prj.Util is
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 (case sensitive),
- -- if In_Arrays is null, if In_Array is not found in In_Arrays,
- -- or if the component is a String 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;