UnixEnvironImpl.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Willie-s, August 8, 1991 3:44 pm PDT
DIRECTORY
CStrings USING [CString],
Rope USING [ROPE],
UnixEnviron USING [],
UXEnviron,
UXStrings;
ROPE access to unix environment variables.
UnixEnvironImpl: CEDAR PROGRAM
IMPORTS UXEnviron, UXStrings
EXPORTS UnixEnviron
= BEGIN
ROPE: TYPE ~ Rope.ROPE;
Procedures.
FindEnv: PUBLIC PROC [ name: ROPE, offset: INT32 ] RETURNS [ value: ROPE ] ~ {
RETURN[UXStrings.ToRope[UXEnviron.FindEnv[UXStrings.Create[name], offset]]]
};
GetEnv: PUBLIC PROC [ name: ROPE ] RETURNS [ value: ROPE ] ~ {
RETURN[UXStrings.ToRope[UXEnviron.GetEnv[UXStrings.Create[name] ]]];
};
SetEnv: PUBLIC PROC [ name, value: ROPE, rewrite: BOOL ] RETURNS [ new: BOOL ] ~ {
RETURN[UXEnviron.SetEnv[UXStrings.Create[name], UXStrings.Create[value], rewrite]];
};
UnsetEnv: PUBLIC PROC [ name: ROPE ] ~ {
UXEnviron.UnsetEnv[UXStrings.Create[name]];
};
END.