home *** CD-ROM | disk | FTP | other *** search
- 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);
- }
-