| 1 |
706 |
jeremybenn |
------------------------------------------------------------------------------
|
| 2 |
|
|
-- --
|
| 3 |
|
|
-- GNAT RUN-TIME COMPONENTS --
|
| 4 |
|
|
-- --
|
| 5 |
|
|
-- A D A . E N V I R O N M E N T _ V A R I A B L E S --
|
| 6 |
|
|
-- --
|
| 7 |
|
|
-- S p e c --
|
| 8 |
|
|
-- --
|
| 9 |
|
|
-- This specification is derived from the Ada Reference Manual for use with --
|
| 10 |
|
|
-- GNAT. In accordance with the copyright of that document, you can freely --
|
| 11 |
|
|
-- copy and modify this specification, provided that if you redistribute a --
|
| 12 |
|
|
-- modified version, any changes that you have made are clearly indicated. --
|
| 13 |
|
|
-- --
|
| 14 |
|
|
------------------------------------------------------------------------------
|
| 15 |
|
|
|
| 16 |
|
|
package Ada.Environment_Variables is
|
| 17 |
|
|
pragma Preelaborate (Environment_Variables);
|
| 18 |
|
|
|
| 19 |
|
|
function Value (Name : String) return String;
|
| 20 |
|
|
-- If the external execution environment supports environment variables,
|
| 21 |
|
|
-- then Value returns the value of the environment variable with the given
|
| 22 |
|
|
-- name. If no environment variable with the given name exists, then
|
| 23 |
|
|
-- Constraint_Error is propagated. If the execution environment does not
|
| 24 |
|
|
-- support environment variables, then Program_Error is propagated.
|
| 25 |
|
|
|
| 26 |
|
|
function Exists (Name : String) return Boolean;
|
| 27 |
|
|
-- If the external execution environment supports environment variables and
|
| 28 |
|
|
-- an environment variable with the given name currently exists, then
|
| 29 |
|
|
-- Exists returns True; otherwise it returns False.
|
| 30 |
|
|
|
| 31 |
|
|
procedure Set (Name : String; Value : String);
|
| 32 |
|
|
-- If the external execution environment supports environment variables,
|
| 33 |
|
|
-- then Set first clears any existing environment variable with the given
|
| 34 |
|
|
-- name, and then defines a single new environment variable with the given
|
| 35 |
|
|
-- name and value. Otherwise Program_Error is propagated.
|
| 36 |
|
|
-- If implementation-defined circumstances prohibit the definition of an
|
| 37 |
|
|
-- environment variable with the given name and value, then
|
| 38 |
|
|
-- Constraint_Error is propagated.
|
| 39 |
|
|
-- It is implementation defined whether there exist values for which the
|
| 40 |
|
|
-- call Set (Name, Value) has the same effect as Clear (Name).
|
| 41 |
|
|
|
| 42 |
|
|
procedure Clear (Name : String);
|
| 43 |
|
|
-- If the external execution environment supports environment variables,
|
| 44 |
|
|
-- then Clear deletes all existing environment variables with the given
|
| 45 |
|
|
-- name. Otherwise Program_Error is propagated.
|
| 46 |
|
|
|
| 47 |
|
|
procedure Clear;
|
| 48 |
|
|
-- If the external execution environment supports environment variables,
|
| 49 |
|
|
-- then Clear deletes all existing environment variables. Otherwise
|
| 50 |
|
|
-- Program_Error is propagated.
|
| 51 |
|
|
|
| 52 |
|
|
procedure Iterate
|
| 53 |
|
|
(Process : not null access procedure (Name, Value : String));
|
| 54 |
|
|
-- If the external execution environment supports environment variables,
|
| 55 |
|
|
-- then Iterate calls the subprogram designated by Process for each
|
| 56 |
|
|
-- existing environment variable, passing the name and value of that
|
| 57 |
|
|
-- environment variable. Otherwise Program_Error is propagated.
|
| 58 |
|
|
|
| 59 |
|
|
end Ada.Environment_Variables;
|