2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Read one C string from a streamhook
10 #include <exec/memory.h>
11 #include <proto/exec.h>
13 /******************************************************************************
18 #include <aros/bigendianio.h>
19 #include <proto/alib.h>
29 Reads one C string from a streamhook.
33 dataptr - Put the data here. If you don't need the string anymore,
34 call FreeVec() to free it.
35 stream - Read from this stream
38 The function returns TRUE on success. On success, the string
39 read is written into dataptr. On failure, FALSE is returned and the
40 contents of dataptr are not changed. The string must be freed with
44 This function reads big endian values from a streamhook even on
45 little endian machines.
52 ReadByte(), ReadWord(), ReadLong(), ReadFloat(), ReadDouble(),
53 ReadString(), ReadStruct(), WriteByte(), WriteWord(), WriteLong(),
54 WriteFloat(), WriteDouble(), WriteString(), WriteStruct()
59 ******************************************************************************/
70 struct BEIOM_Read rd
= {BEIO_READ
};
71 c
= CallHookA (hook
, stream
, &rd
);
83 tmp
= AllocVec (maxsize
+ 16, MEMF_ANY
);
93 memcpy (tmp
, buffer
, maxsize
);