- Documented /N/M.
[tangerine.git] / compiler / arossupport / readbyte.c
blobbbcd3698b5b3eae778c2ec1f84e44b76ae6df76f
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Read a big endian byte from a streamhook
6 Lang: english
7 */
9 #include <proto/dos.h>
11 /******************************************************************************
13 NAME */
14 #include <stdio.h>
15 #include <aros/bigendianio.h>
16 #include <proto/alib.h>
18 BOOL ReadByte (
20 /* SYNOPSIS */
21 struct Hook * hook,
22 UBYTE * dataptr,
23 void * stream)
25 /* FUNCTION
26 Reads one big endian 8bit value from a streamhook.
28 INPUTS
29 hook - Streamhook
30 dataptr - Put the data here
31 stream - Read from this stream
33 RESULT
34 The function returns TRUE on success. On success, the value
35 read is written into dataptr. On failure, FALSE is returned and the
36 contents of dataptr are not changed.
38 NOTES
39 This function reads big endian values from a streamhook even on
40 little endian machines.
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 ReadByte(), ReadWord(), ReadLong(), ReadFloat(), ReadDouble(),
48 ReadString(), ReadStruct(), WriteByte(), WriteWord(), WriteLong(),
49 WriteFloat(), WriteDouble(), WriteString(), WriteStruct()
51 HISTORY
52 14.09.93 ada created
54 ******************************************************************************/
56 LONG value;
58 struct BEIOM_Read rd = {BEIO_READ};
60 value = CallHookA (hook, stream, &rd);
62 if (value != EOF)
63 *dataptr = value;
65 return (value != EOF);
66 } /* ReadByte */