Initial revision
This commit is contained in:
19
lang/cem/libcc.ansi/misc/putw.c
Normal file
19
lang/cem/libcc.ansi/misc/putw.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* putw - write an word on a stream
|
||||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user