a0NewFunctionFormat()

Creates a new function format.


Syntax

a0tError a0NewFunctionFormat(
a0tFormat *newform,
a0tPackFunction packfun,
a0tPackFunction unpackfun,
a0tSizeFunction sizefun,
a0tOffsetFunction offsetfun );

Arguments

Namerd/wrDescription
newform write Format descriptor to set up.
packfun read Function to pack data.
unpackfun read Function to unpack data.
sizefun read Function to get format size.
offsetfun read Function to get element offset.

Description

This function composes a new function format descriptor. The first two functions given must pack and unpack the user defined complex format, by the means of more elementary formats, using the functions a0FPack() and a0FUnpack(). Two more functions must be supplied: the format size function and element offset function. The Athapascan-0 Formats functions that need to send, receive, pack, unpack, put or get the complex formatted data will call the given functions of the format. They must implement what follows:

On return of this function, the variable pointed by newform contains a format descriptor to the new function format created.


Return Values

If an error condition occurs, it returns the error code, otherwise it returns A0ErrOk. Possible values are as follows:
Error CodeDescription
A0ErrNoMem There is no memory to allocate new format.
A0ErrInvFormat The base format has an invalid type.
A0ErrNotImplem The new format has an unimplemented type.
A0ErrOkSuccessful completion.

See Also

a0UseFormats() a0NewMapFormat() a0DisposeFormat() a0FPack() a0FUnpack() a0FSend() a0FReceive() a0FPut() a0FGet() a0IFSend() a0IFReceive() a0IFPut() a0IFGet()