aboutsummaryrefslogtreecommitdiff
path: root/sys/clio/clcmdw.x
blob: ca8dfc4c2f1cb204dbff3d2e6be6c58ebf1b65e0 (plain) (blame)
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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<syserr.h>
include	<clset.h>

# CLCMDW -- Send a command line to the CL and wait for completion.

procedure clcmdw (cmd)

char	cmd[ARB]
char	junkstr[1]

int	junk
int	oscmd(), clstati()
errchk	syserr

begin
	if (cmd[1] == '!')
	    junk = oscmd (cmd[2], "", "", "")
	else if (clstati (CL_PRTYPE) != PR_CONNECTED)
	    call syserr (SYS_CLCMDNC)
	else {
	    call flush (STDOUT)
	    call putline (CLOUT, cmd)
	    call putci (CLOUT, '\n')
	    call clgstr ("cl.version", junkstr, 1)	# wait for completion
	}
end