RM A.17 provides access to environment variables.
This outputs all of them.
with Ada.Environment_Variables;
use Ada.Environment_Variables;
with Ada.Text_IO;
use Ada.Text_IO;
procedure Environment_Variables is
procedure Process (Name, Value : in String) is
begin
Put_Line (Name & " => " & Value);
end Process;
begin
Set (Name => "ALIRE_OS", Value => "Windows");
Iterate (Process'Access);
end Environment_Variables;
However, commenting out Set
and running it again, ALIRE_OS has disappeared.
There is documentation requirement A.17(30/2), but I cannot find anything about this in the GNAT Reference Manual.
There iis implementation advice A.17(33/2), but I cannot find anything either.