/*********************************************************/
/* */
/* PISTOL-Portably Implemented Stack Oriented Language */
/* Version 1.3 */
/* (C) 1982 by Ernest E. Bergmann */
/* Physics, Building #16 */
/* Lehigh Univerisity */
/* Bethlehem, Pa. 18015 */
/* */
/* Permission is hereby granted for all reproduction and */
/* distribution of this material provided this notice is */
/* is included. */
/* */
/*********************************************************/
/* sixth and final module in BDS 'C', February, 1982 */
spaces(num)
int num;
{ while(num>0){chout(' ');num--;}
}
cinline() /*input line from console*/
{ ram[-15].pc=&strings[LINEBUF+1];
ram[-16].in=1+strlen(gets(&strings[LINEBUF+1]));
Pc=&strings[LINEBUF];
*Pc=ram[-16].in;
Pc += ram[-16].in;
*Pc=NEWLINE; Pc++ ;
*Pc=10 ; Pc++ ;
*Pc = 0;
if(ram[-12].in)fputs(ram[-15].pc,list);
}
finline(iobuf,iostat)
char *iobuf;
int *iostat; /*not used anymore ???*/
{ ram[-15].pc=fgets(&strings[LINEBUF+1],iobuf);
if(!ram[-15].in) merr(feof);
ram[-16].in=strlen(ram[-15].pc);
Pc=&strings[LINEBUF];
*Pc=ram[-16].in;
Pc += ram[-16].in;
*Pc=NEWLINE; Pc++ ;
*Pc=10; Pc++ ;
*Pc=0 ;
}
eof(iobuf) /* used to test for eof status on */
char *iobuf; /* buffered i/o in analogy to PASCAL*/
{int c;
c=getc(iobuf);
if((c == ERROR) || (c== CPMEOF)) return(TRU);
ungetc(c,iobuf);
return(FALS);
}