(C) 1998 AROS - The Amiga Research OS


NAME
#include <stdio.h>
#include <aros/bigendianio.h>
#include <proto/alib.h>

BOOL WriteStruct ()

SYNOPSIS
struct Hook * hook
void * data
void * stream
const IPTR * sd

FUNCTION
Writes one big endian structure to a streamhook.

INPUTS
hook
Write to this streamhook
data
Data to be written
stream
Stream passed to streamhook
sd
Description of the structure to be written. The first element is the size of the structure.

RESULT
The function returns TRUE on success and FALSE otherwise. In error, you can examine IoErr() to find out what was wrong.

EXAMPLE
See ReadStruct()
SEE ALSO
ReadByte(), ReadWord(), ReadLong(), ReadFloat(), ReadDouble(), ReadString(), ReadStruct(), WriteByte(), WriteWord(), WriteLong(), WriteFloat(), WriteDouble(), WriteString(), WriteStruct()

NOTES
This function writes big endian values to a file even on little endian machines.

BUGS

INTERNALS
The function uses the Write*()-functions to write data into the file.

Pointers are written as <valid><data structure>, where valid is a byte with the values 1 (then the full data structure follows) or 0 (then nothing follows and the pointer will be intialized as NULL when the structure is read back).

HISTORY
20.10.1998 hkiel
Amiga Research OS
27.03.1997 ldp
libaros.a -> libarossupport.a