SdsGet - Read the data from an object

Function

Read the data from an object

Description

The object may be a primitive item or a structure or structure array. Read the data from an item into a buffer. If the object is primitive data is transferred starting at the position in the item specified by offset, until the buffer if filled, or the end of the data array is reached.

If the object is a structure or structure array, the data from all its primitive components are copied into the buffer in order of their position in the structure. Alignment adjustments are made as necessary to match the alignment of an C struct equivalent to the SDS structure. (Since these alignment requirements are machine dependent the actual sequence of bytes returned could be different on different machines). In the structure or structure array case the offset parameter is ignored.

If necessary (e.g. if the data originated on a machine with different architecture) the data for the object is converted (in place) from the format stored in the data item to that required for the local machine.

Language

C

Declaration

void SdsGet(SdsIdType id, unsigned long length, unsigned long offset, void *data, unsigned long *actlen, StatusType * SDSCONST status)

Parameters

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

>idSdsIdTypeIdentifier of the object.
>lengthunsigned longLength in bytes of the buffer supplied to receive the data.
>offsetunsigned longOffset into the data object at which to start reading 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. This parameter is ignored if the object is a structure or structure array.
<datavoid*Buffer to receive the data.
<actlenunsigned long*Actual number of bytes transferred.
!statusStatusType*Modified status. Possible failure codes are:

SDS__BADID Invalid identifier
SDS__UNDEFINED Data undefined

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 tony.farrell@mq.edu.au