/* Copyright (C) 1981,1982 by Manx Software Systems and Thomas Fenwick */
#include "stdio.h"

agetc(ptr)
register FILE *ptr;
{
	register int c;

top:
	switch (c = getc(ptr)&127) {
	case 0x1a:
		--ptr->_bp;
		return EOF;
	case '\r':
	case 0:
		goto top;
	}
	return c;
}

aputc(c,ptr)
register int c; register FILE *ptr;
{
	c &= 127;
	if (c == '\n')
		if (putc('\r',ptr) < 0)
			return EOF;
	return putc(c,ptr);
}

