home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
unix
/
unixlib36d
/
src
/
stdio
/
c
/
getw
< prev
next >
Wrap
Text File
|
1994-03-08
|
476b
|
30 lines
static char sccs_id[] = "@(#) getw.c 1.1 " __DATE__ " HJR";
/* getw.c (c) Copyright 1990 H.Rogers */
#include <stdio.h>
#define INTSIZE 4
__STDIOLIB__
int
getw (register FILE * f)
{
register int i;
i = getc (f);
i |= (getc (f) << 8);
#if INTSIZE > 2
i |= (getc (f) << 16);
i |= (getc (f) << 24);
#if INTSIZE > 4
i |= (getc (f) << 32);
i |= (getc (f) << 40);
i |= (getc (f) << 48);
i |= (getc (f) << 56);
#endif
#endif
return (ferror (f) ? -1 : i);
}