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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: readbyte.c,v 1.5 1997/01/27 00:16:38 ldp Exp $
  4.  
  5.     Desc: Read a big endian byte 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 ReadByte (
  17.  
  18. /*  SYNOPSIS */
  19.     BPTR    fh,
  20.     UBYTE * dataptr)
  21.  
  22. /*  FUNCTION
  23.     Reads one big endian 8bit value from a file.
  24.  
  25.     INPUTS
  26.     fh - Read from this file
  27.     data - Put the data here
  28.  
  29.     RESULT
  30.     The function returns TRUE on success. On success, the value
  31.     read is written into dataptr. On failure, FALSE is returned and the
  32.     contents of dataptr are not changed.
  33.  
  34.     NOTES
  35.     This function reads big endian values from a file even on little
  36.     endian machines.
  37.  
  38.     EXAMPLE
  39.  
  40.     BUGS
  41.  
  42.     SEE ALSO
  43.     Open(), Close(), ReadWord(), ReadLong(), ReadFloat(),
  44.     ReadDouble(), ReadString(), WriteByte(), WriteWord(), WriteLong(),
  45.     WriteFloat(), WriteDouble(), WriteString()
  46.  
  47.     HISTORY
  48.     14.09.93    ada created
  49.  
  50. ******************************************************************************/
  51. {
  52.     LONG value;
  53.  
  54.     value = FGetC (fh);
  55.  
  56.     if (value != EOF)
  57.     {
  58.     *dataptr = value;
  59.     }
  60.  
  61.     return (value != EOF);
  62. } /* ReadByte */
  63.  
  64.