[Previous] [Contents] [Index] [Next]

PtAddData()

Add data to the provided data chain

Synopsis:

int PtAddData( PtDataHdr_t **ptr, 
               long type,
               long subtype, 
               void *data, 
               long len, 
               PtDataRemoveF_t *remove );

Description:

This function adds a piece of data to the provided data chain. The data provided must be in a block of memory created by malloc(). This data can be retrieved by calling PtFindData(), or PtFindNextData().

The arguments are:

ptr
The address of the pointer to the chain the data should be added to.
type
A unique data type.
subtype
Used to distinguish multiple blocks of data added as the same type. This argument shouldn't be -1 because -1 has special meaning when searching for a specific block within the provided data chain.
data
A pointer to the data to be added to the provided data chain.
len
The size of the block of data added, or 0 if it isn't required.

Returns:

0 on success, or -1 if an error (e.g. out of memory) occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtFindData(), PtFindNextData(), PtRemoveData(), PtUnlinkData()


[Previous] [Contents] [Index] [Next]