1989-12-18 14:40:54 +00:00
|
|
|
/*
|
|
|
|
* putw - write an word on a stream
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-12-18 14:40:54 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
putw(int w, register FILE *stream)
|
|
|
|
{
|
|
|
|
register int cnt = sizeof(int);
|
|
|
|
register char *p = (char *) &w;
|
|
|
|
|
|
|
|
while (cnt--) {
|
|
|
|
putc(*p++, stream);
|
|
|
|
}
|
|
|
|
if (ferror(stream)) return EOF;
|
|
|
|
return w;
|
|
|
|
}
|