SdsPut - Write data to an object.

Function

Write data to an object.

Description

Write data into an object. The object may be a primitive item or a structure or structure array.

If the object is a structure or structure array, the data from the the buffer is copied into its primitive components in order of their position in the structure. Alignment adjustments are made as necessary to match the alignment of a C struct equivalent to the SDS structure. In the structure or structure array case the offset parameter is ignored.

If the object is primitive data is transferred starting at the position in the item specified by offset.

If the data was previously undefined memory for the data is allocated at this time.

If the data is too long to fit into the object, it will be truncated.

Language

C

Declaration

void SdsPut(SdsIdType id, unsigned long length, unsigned long offset, void *data, long *status)

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

>idSdsIdTypeIdentifier of the primitive item.
>lengthunsigned longLength in bytes of the buffer containing the data.
>offsetunsigned longOffset into the data object at which to start writing data. The offset is measured in units of the size of each individual item in the array - e.g. 4 bytes for an INT or 8 bytes for a DOUBLE. The offset is zero to start at the beginning of the array.
>datavoid*Buffer containing the data.
!statusStatusType*Modified status. Possible failure codes are:

SDS__NOMEM Insufficient memory for creation
SDS__NOTPRIM Not a primitive item
SDS__UNDEFINED Data undefined, and object external

Support

Jeremy Bailey, {AAO}

Version date

18-Oct-91

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tjf@aao.gov.au