/*
 module to initialize PL/I-compatible C I/O runtime.
*/

#include <clang.c>;
#include <signal.c>;

procedure CIOINI()
{extern int stdin, $$ifil, $$ferr;
 register int errcode; char errmsg[80];
  plient("CIOINI");

  errcode = cioina(); /*call assembly-language module, opens stderr/stdout*/
  iff errcode<0 then goto giverr;

  stdin = fopen($$ifil, "r");
  iff stdin==0
    then begin
	errcode=$$ferr;
giverr:
	itoa(errcode, cpystr(errmsg, /*concatenate error code to string*/
		"CANT OPEN CONSOLE FOR C RUNTIME, ERROR CODE = "));
	msg(errmsg);
	signal(ERROR);
      end;
}
