File:  [Research Unix] / researchv10no / cmd / cref / ind2.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

int	optr;

char	obuf[512];

int	nflush;

put(string,n)
	char	*string;
{
	extern	utmp;
	int	i;
	char	*o;

/*printf("%c %d\n",*string,n);/*DEBUG*/

	string--;

	if((i = optr + n - 512) >= 0) {
		n =- i;
		o = &obuf[optr] -1;
		while(--n >= 0)
			*++o = *++string;
		optr = 512;
		flsh(1);
		n = i;
	}

	o = &obuf[optr] - 1;
	optr =+ n;

	while(--n >= 0) {
		*++o = *++string;
	}
	return(0);
}

flsh(fil)
{
	extern	tp[],utmp;

	if(optr <= 0)	return(optr);

	nflush++;
	if(write(tp[0],obuf,optr) != optr)
		return(-1);
	optr = 0;
	return(0);
}


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.