File: sysid.x

package info (click to toggle)
iraf 2.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,000 kB
  • sloc: ansic: 115,890; fortran: 74,576; lisp: 18,888; yacc: 5,642; sh: 961; lex: 596; makefile: 509; asm: 159; csh: 54; xml: 33; sed: 4
file content (57 lines) | stat: -rw-r--r-- 1,616 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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