aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/envgetr.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/etc/envgetr.x')
-rw-r--r--sys/etc/envgetr.x18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/etc/envgetr.x b/sys/etc/envgetr.x
new file mode 100644
index 00000000..5ec04d58
--- /dev/null
+++ b/sys/etc/envgetr.x
@@ -0,0 +1,18 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# ENVGETR -- Fetch an environment variable and try to interpret its value
+# as a real. Abort if variable is not found or cannot be converted to
+# a number.
+
+real procedure envgetr (varname)
+
+char varname[ARB]
+double val, envgetd()
+
+begin
+ val = envgetd (varname)
+ if (IS_INDEFD(val))
+ return (INDEFR)
+ else
+ return (val)
+end