예제 #1
0
파일: dc.c 프로젝트: carriercomm/plan9-gpl
void
unreadc(char c)
{

	if((readptr != &readstk[0]) && (*readptr != 0)) {
		sungetc(*readptr,c);
	} else
		Bungetc(curfile);
	return;
}
예제 #2
0
/* <file> <int> .unread - */
static int
zunread(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    stream *s;
    ulong ch;

    check_read_file(s, op - 1);
    check_type(*op, t_integer);
    ch = op->value.intval;
    if (ch > 0xff)
	return_error(e_rangecheck);
    if (sungetc(s, (byte) ch) < 0)
	return_error(e_ioerror);
    pop(2);
    return 0;
}