$ !     PDP11C.INS
$ !
$ !     PDP-11 C Startup Command File
$ !
$ !     Parameters passed:
$ !
$ !             none
$ !

$ ! Set up the environment.
$	_ON ERROR THEN GOTO ERROR
$	_ON CONTROL_C THEN GOTO ABORT

$	debug = p1

$ ! Set up local symbols
$	PRINT$ = "_WRITE 0"

$ ! Set up local boolean symbols
$	false = 0
$	true = .NOT. false
$	aborting = false

$START:
$	time = F$TIME()

$	PRINT$ time, "   Starting PDP-11 C"

$	_IF debug THEN _GOTO END

$	priv = F$PRIVILEGE("INSTAL,SWCFG")
$	   _IF priv THEN _GOTO REMOVE

$		PRINT$ "Insufficient privileges"
$		_GOTO ABORT

$REMOVE:
$ ! Remove old PDP-11 C CCLs.
$	_ON ERROR THEN _GOTO DEFINE             ! If not defined.
$	_SET NOECHO/NOWARNING
$	_DELETE/COMMAND/SYSTEM CCC

$DEFINE:
$ ! Define PDP-11 C CCLs.
$	_ON ERROR THEN _GOTO ERROR              ! Restore error handler.
$	_SET NOECHO/WARNING
$	_DEFINE/COMMAND/SYSTEM CC-C CC$:PDP11C.TSK

$	_GOTO END

$ABORT:
$	aborting = true

$ERROR:
$	time = F$TIME()
$	PRINT$ time, " Unable to start PDP-11 C"

$END:
$	status = $SEVERITY
$	   _IF aborting THEN status = 4         ! Force fatal.

$	time = F$TIME()
$	PRINT$ time, "   The PDP-11 C Startup Procedure is complete."

$	_EXIT status

