home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / aros / writeword.c < prev   
Encoding:
C/C++ Source or Header  |  1997-01-28  |  1.1 KB  |  57 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: writeword.c,v 1.5 1997/01/27 00:16:40 ldp Exp $
  4.  
  5.     Desc: Write a big endian word (16bit) from a file
  6.     Lang: english
  7. */
  8. #include <proto/dos.h>
  9.  
  10. /******************************************************************************
  11.  
  12.     NAME */
  13. #include <stdio.h>
  14. #include <proto/alib.h>
  15.  
  16.     BOOL WriteWord (
  17.  
  18. /*  SYNOPSIS */
  19.     BPTR  fh,
  20.     UWORD data)
  21.  
  22. /*  FUNCTION
  23.     Writes one big endian 16bit value to a file.
  24.  
  25.     INPUTS
  26.     fh - Write to this file
  27.     data - Data to be written
  28.  
  29.     RESULT
  30.     The function returns TRUE on success and FALSE otherwise.
  31.     See IoErr() for the reason in case of an error.
  32.  
  33.     NOTES
  34.     This function writes big endian values to a file even on little
  35.     endian machines.
  36.  
  37.     EXAMPLE
  38.  
  39.     BUGS
  40.  
  41.     SEE ALSO
  42.     Open(), Close(), ReadByte(), ReadWord(), ReadLong(), ReadDouble(),
  43.     ReadString(), WriteWord(), WriteLong(), WriteDouble(),
  44.     WriteString()
  45.  
  46.     HISTORY
  47.     14.09.93    ada created
  48.  
  49. ******************************************************************************/
  50. {
  51.     if (FPutC (fh, data >> 8) == EOF)
  52.     return FALSE;
  53.  
  54.     return (FPutC (fh, data & 0xFF) != EOF);
  55. } /* WriteWord */
  56.  
  57.