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