aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/sysid.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/etc/sysid.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/etc/sysid.x')
-rw-r--r--sys/etc/sysid.x57
1 files changed, 57 insertions, 0 deletions
diff --git a/sys/etc/sysid.x b/sys/etc/sysid.x
new file mode 100644
index 00000000..94bd77bc
--- /dev/null
+++ b/sys/etc/sysid.x
@@ -0,0 +1,57 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# SYSID -- Return a line of text identifying the current user, machine, and
+# version of IRAF, and containing the current date and time. The format is
+# as follows:
+#
+# NOAO/IRAF V1.3 username@lyra Tue 09:47:50 27-Aug-85
+#
+# The string "NOAO/IRAF V1.3" is given by the value of the environment variable
+# "version", defined in lib$clpackage.cl (unless redefined by the user). The
+# string "username" is the value of the environment variable "userid", defined
+# by the user in the login.cl file. The output string is not terminated by a
+# newline.
+
+procedure sysid (outstr, maxch)
+
+char outstr[maxch] # receives id string
+int maxch
+
+pointer sp, buf
+int op, nchars
+int envfind(), gstrcpy()
+long clktime()
+
+begin
+ call smark (sp)
+ call salloc (buf, SZ_LINE, TY_CHAR)
+
+ nchars = envfind ("version", outstr, maxch)
+ if (nchars <= 0)
+ nchars = gstrcpy ("NOAO/IRAF", outstr, maxch)
+
+ op = nchars + 1
+ outstr[op] = ' '
+ op = op + 1
+
+ # The variable "userid" is defined in the user's login.cl file. This
+ # gives the user the opportunity to set the value of this string to
+ # something other than their host system login name.
+
+ nchars = envfind ("userid", Memc[buf], SZ_LINE)
+
+ op = op + gstrcpy (Memc[buf], outstr[op], maxch-op+1)
+ outstr[op] = '@'
+ op = op + 1
+
+ call gethost (Memc[buf], SZ_LINE)
+ op = op + gstrcpy (Memc[buf], outstr[op], maxch-op+1)
+ outstr[op] = ' '
+ op = op + 1
+
+ call cnvtime (clktime(long(0)), Memc[buf], SZ_LINE)
+ op = op + gstrcpy (Memc[buf], outstr[op], maxch-op+1)
+ outstr[op] = EOS
+
+ call sfree (sp)
+end