Debian Codegraph @

source_2012/pre_environ.mss

raw
1 @comment{ $Source: e:\\cvsroot/ARM/Source/pre_environ.mss,v $ }
2 @comment{ $Revision: 1.13 $ $Date: 2012/03/20 06:13:59 $ $Author: randy $ }
3 @Part(predefenviron, Root="ada.mss")
4
5 @Comment{$Date: 2012/03/20 06:13:59 $}
6
7 @LabeledAddedClause{Version=[2],Name=[The Package Environment_Variables]}
8
9 @begin{Intro}
10 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
11 @ChgAdded{Version=[2],Text=[@Defn{environment variable}
12 The package Environment_Variables allows a program to
13 read or modify environment variables. Environment variables are name-value
14 pairs, where both the name and value are strings. The definition of what
15 constitutes an @i{environment variable}, and the meaning of the name and value,
16 are implementation defined.]}
17 @ChgImplDef{Version=[2],Kind=[AddedNormal],Text=[@Chg{Version=[2],New=[The
18 definition and meaning of an environment variable.],Old=[]}]}
19 @end{Intro}
20
21 @begin{StaticSem}
22 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
23 @ChgAdded{Version=[2],KeepNext=[T],Type=[Leading],Text=[The library package
24 Environment_Variables has the following declaration:]}
25 @begin{Example}
26 @ChgRef{Version=[2],Kind=[AddedNormal]}
27 @ChgAdded{Version=[2],Text=[@key{package} Ada.Environment_Variables @key{is}@ChildUnit{Parent=[Ada],Child=[Environment_Variables]}
28 @key{pragma} Preelaborate(Environment_Variables);]}
29
30 @ChgRef{Version=[2],Kind=[AddedNormal]}
31 @ChgAdded{Version=[2],Text=[ @key{function} @AdaSubDefn{Value} (Name : @key{in} String) @key{return} String;]}
32
33 @ChgRef{Version=[3],Kind=[Added],ARef=[AI05-0285-1]}
34 @ChgAdded{Version=[3],Text=[ @key{function} @AdaSubDefn{Value} (Name : @key{in} String; Default : @key{in} String) @key{return} String;]}
35
36 @ChgRef{Version=[2],Kind=[AddedNormal]}
37 @ChgAdded{Version=[2],Text=[ @key{function} @AdaSubDefn{Exists} (Name : @key{in} String) @key{return} Boolean;]}
38
39 @ChgRef{Version=[2],Kind=[AddedNormal]}
40 @ChgAdded{Version=[2],Text=[ @key{procedure} @AdaSubDefn{Set} (Name : @key{in} String; Value : @key{in} String);]}
41
42 @ChgRef{Version=[2],Kind=[AddedNormal]}
43 @ChgAdded{Version=[2],Text=[ @key{procedure} @AdaSubDefn{Clear} (Name : @key{in} String);
44 @key{procedure} @AdaSubDefn{Clear};]}
45
46 @ChgRef{Version=[2],Kind=[AddedNormal]}
47 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0248-1]}
48 @ChgAdded{Version=[2],Text=[ @key{procedure} @AdaSubDefn{Iterate}@Chg{Version=[3],New=[],Old=[ (]}
49 @Chg{Version=[3],New=[(],Old=[ ]}Process : @key{not null access procedure} (Name, Value : @key{in} String));]}
50
51 @ChgRef{Version=[2],Kind=[AddedNormal]}
52 @ChgAdded{Version=[2],Type=[Trailing],Text=[@key{end} Ada.Environment_Variables;]}
53 @end{Example}
54
55 @begin{DescribeCode}
56
57 @begin{Example}
58 @ChgRef{Version=[2],Kind=[AddedNormal]}
59 @ChgAdded{Version=[2],KeepNext=[T],Text=[@key{function} Value (Name : @key{in} String) @key{return} String;]}
60 @end{Example}
61
62 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
63 @ChgAdded{Version=[2],Type=[Trailing],Text=[If the external execution
64 environment supports environment variables, then Value returns the value of the
65 environment variable with the given name. If no environment variable with the
66 given name exists, then Constraint_Error is propagated. If the execution
67 environment does not support environment variables, then Program_Error is
68 propagated.]}
69
70 @begin{Example}
71 @ChgRef{Version=[3],Kind=[Added]}
72 @ChgAdded{Version=[3],KeepNext=[T],Text=[@key{function} Value (Name : @key{in} String; Default : @key{in} String) @key{return} String;]}
73 @end{Example}
74
75 @ChgRef{Version=[3],Kind=[Added],ARef=[AI05-0285-1]}
76 @ChgAdded{Version=[3],Type=[Trailing],Text=[If the external execution
77 environment supports environment variables and an environment variable with the
78 given name currently exists, then Value returns its value; otherwise, it returns
79 Default.]}
80
81 @begin{Example}
82 @ChgRef{Version=[2],Kind=[AddedNormal]}
83 @ChgAdded{Version=[2],KeepNext=[T],Text=[@key{function} Exists (Name : @key{in} String) @key{return} Boolean;]}
84 @end{Example}
85
86 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
87 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0264-1]}
88 @ChgAdded{Version=[2],Type=[Trailing],Text=[If the external execution environment
89 supports environment variables and an environment variable with the given name
90 currently exists, then Exists returns True;
91 otherwise@Chg{Version=[3],New=[,],Old=[]}
92 it returns False.]}
93
94 @begin{Example}
95 @ChgRef{Version=[2],Kind=[AddedNormal]}
96 @ChgAdded{Version=[2],KeepNext=[T],Text=[@key{procedure} Set (Name : @key{in} String; Value : @key{in} String);]}
97 @end{Example}
98
99 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
100 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0264-1]}
101 @ChgAdded{Version=[2],Text=[If the external execution
102 environment supports environment variables, then Set first clears any existing
103 environment variable with the given name, and then defines a single new
104 environment variable with the given name and value.
105 Otherwise@Chg{Version=[3],New=[,],Old=[]} Program_Error is
106 propagated.]}
107
108 @ChgRef{Version=[2],Kind=[AddedNormal]}
109 @ChgAdded{Version=[2],Text=[If implementation-defined circumstances prohibit
110 the definition of an environment variable with the given name and value, then
111 Constraint_Error is propagated.]}
112 @ChgImplDef{Version=[2],Kind=[AddedNormal],
113 Text=[@Chg{Version=[2],New=[The circumstances where an environment variable
114 cannot be defined.],Old=[]}]}
115
116 @ChgRef{Version=[2],Kind=[AddedNormal]}
117 @ChgAdded{Version=[2],Type=[Trailing],Text=[It is implementation defined
118 whether there exist values for which the call Set(Name, Value) has the same
119 effect as Clear (Name).]}
120 @ChgImplDef{Version=[2],Kind=[AddedNormal],
121 Text=[@Chg{Version=[2],New=[Environment names for which Set has the effect of
122 Clear.],Old=[]}]}
123
124 @begin{Example}
125 @ChgRef{Version=[2],Kind=[AddedNormal]}
126 @ChgAdded{Version=[2],KeepNext=[T],Text=[@key{procedure} Clear (Name : @key{in} String);]}
127 @end{Example}
128
129 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
130 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0264-1],ARef=[AI05-0269-1]}
131 @ChgAdded{Version=[2],Type=[Trailing],Text=[If the external execution
132 environment supports environment variables, then Clear deletes all existing
133 environment @Chg{Version=[3],New=[variables],Old=[variable]} with the given
134 name. Otherwise@Chg{Version=[3],New=[,],Old=[]} Program_Error is propagated.]}
135
136 @begin{Example}
137 @ChgRef{Version=[2],Kind=[AddedNormal]}
138 @ChgAdded{Version=[2],KeepNext=[T],Text=[@key{procedure} Clear;]}
139 @end{Example}
140
141 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
142 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0264-1]}
143 @ChgAdded{Version=[2],Type=[Trailing],Text=[If the external execution
144 environment supports environment variables,
145 then Clear deletes all existing environment variables.
146 Otherwise@Chg{Version=[3],New=[,],Old=[]} Program_Error is
147 propagated.]}
148
149 @begin{Example}
150 @ChgRef{Version=[2],Kind=[AddedNormal]}
151 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0248-1]}
152 @ChgAdded{Version=[2],Text=[@key{procedure} Iterate@Chg{Version=[3],New=[],Old=[ (]}
153 @Chg{Version=[3],New=[(],Old=[ ]}Process : @key{not null access procedure} (Name, Value : @key{in} String));]}
154 @end{Example}
155
156 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
157 @ChgRef{Version=[3],Kind=[Revised],ARef=[AI05-0264-1]}
158 @ChgAdded{Version=[2],Text=[If the external execution environment supports
159 environment variables, then Iterate calls the subprogram designated by Process
160 for each existing environment variable, passing the name and value of that
161 environment variable.
162 Otherwise@Chg{Version=[3],New=[,],Old=[]} Program_Error is
163 propagated.]}
164
165 @ChgRef{Version=[2],Kind=[AddedNormal]}
166 @ChgAdded{Version=[2],Text=[If several environment variables exist that have
167 the same name, Process is called once for each such variable.]}
168
169 @end{DescribeCode}
170 @end{StaticSem}
171
172 @begin{Bounded}
173 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
174 @ChgAdded{Version=[2],Type=[Leading],Text=[@PDefn2{Term=(bounded error),Sec=(cause)}
175 It is a bounded error to call Value if more than one environment variable
176 exists with the given name; the possible outcomes are that:]}
177 @begin{itemize}
178 @ChgRef{Version=[2],Kind=[AddedNormal]}
179 @ChgAdded{Version=[2],Text=[one of the values is returned, and that
180 same value is returned in subsequent calls in the absence of changes to
181 the environment; or]}
182
183 @ChgRef{Version=[2],Kind=[AddedNormal]}
184 @ChgAdded{Version=[2],Text=[Program_Error is propagated.]}
185 @end{Itemize}
186 @end{Bounded}
187
188 @begin{Erron}
189 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
190 @ChgAdded{Version=[2],Text=[@PDefn2{Term=(erroneous execution),Sec=(cause)}
191 Making calls to the procedures Set or Clear concurrently with calls to any
192 subprogram of package Environment_Variables, or to any instantiation of Iterate,
193 results in erroneous execution.]}
194
195 @ChgRef{Version=[2],Kind=[AddedNormal]}
196 @ChgAdded{Version=[2],Text=[Making calls to the procedures Set or Clear in the actual subprogram
197 corresponding to the Process parameter of Iterate results in erroneous
198 execution.]}
199 @end{Erron}
200
201 @begin{DocReq}
202 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
203 @ChgAdded{Version=[2],Text=[An implementation shall document how the
204 operations of this package behave if
205 environment variables are changed by external mechanisms (for instance,
206 calling operating system services).]}
207 @ChgDocReq{Version=[2],Kind=[AddedNormal],Text=[@ChgAdded{Version=[2],
208 Text=[The behavior of package Environment_Variables when environment variables
209 are changed by external mechanisms.]}]}
210 @end{DocReq}
211
212 @begin{ImplPerm}
213 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
214 @ChgAdded{Version=[2],Text=[An implementation running on a system that does
215 not support environment variables is permitted to define the operations of
216 package Environment_Variables with the semantics corresponding to the case
217 where the external execution environment does support environment variables. In
218 this case, it shall provide a mechanism to initialize a nonempty set of
219 environment variables prior to the execution of a partition.]}
220 @end{ImplPerm}
221
222 @begin{ImplAdvice}
223 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
224 @ChgAdded{Version=[2],Text=[If the execution environment supports subprocesses,
225 the currently defined environment variables should be used to initialize the
226 environment variables of a subprocess.]}
227 @ChgImplAdvice{Version=[2],Kind=[AddedNormal],Text=[@ChgAdded{Version=[2],
228 Text=[If the execution environment supports subprocesses,
229 the current environment variables should be used to initialize the
230 environment variables of a subprocess.]}]}
231
232 @ChgRef{Version=[2],Kind=[AddedNormal]}
233 @ChgAdded{Version=[2],Text=[Changes to the environment variables made outside the control of this package
234 should be reflected immediately in the effect of the operations of this package.
235 Changes to the environment variables made using this package should be reflected
236 immediately in the external execution environment. This package should not
237 perform any buffering of the environment variables.]}
238 @ChgImplAdvice{Version=[2],Kind=[AddedNormal],Text=[@ChgAdded{Version=[2],
239 Text=[Changes to the environment variables made outside the control of
240 Environment_Variables should be reflected immediately.]}]}
241
242 @end{ImplAdvice}
243
244 @begin{Extend95}
245 @ChgRef{Version=[2],Kind=[AddedNormal],ARef=[AI95-00370-01]}
246 @ChgAdded{Version=[2],Text=[@Defn{extensions to Ada 95}
247 Package Environment_Variables is new.]}
248 @end{Extend95}
249
250 @begin{Incompatible2005}
251 @ChgRef{Version=[3],Kind=[AddedNormal],ARef=[AI05-0285-1]}
252 @ChgAdded{Version=[3],Text=[@Defn{incompatibilities with Ada 2005}
253 A new overloaded function Value is added to Environment_Variables.
254 If Environment_Variables is referenced in a @nt{use_clause}, and an entity
255 @i<E> with the name Value is defined in a package that is also referenced in a
256 @nt{use_clause}, the entity @i<E> may no longer be use-visible, resulting in
257 errors. This should be rare and is easily fixed if it does occur.]}
258 @end{Incompatible2005}
259