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