h33402
s 00027/00000/00000
d D 1.1 82/08/03 08:45:47 cecily 1 0
e
u
U
t
T
I 1
#include	<stdio.h>

getw(iop)
register struct _iobuf *iop;
{
	register i;
#ifndef pdp11
	union {
		int	word;
		char	bytes[sizeof(int)];
	} U;
#endif

#ifdef pdp11
	i = getc(iop);
	if (iop->_flag&_IOEOF)
		return(-1);
	return(i | (getc(iop)<<8));
#else
	for (i = 0; i < sizeof(int); i++) {
		U.bytes[i] = getc(iop);
		if (iop->_flag&_IOEOF)
			return(-1);
	}
	return(U.word);
#endif
}
E 1
