SdsNew - Create a new object

Function

Create a new object

Description

Creates a new component in an existing internal structure or a new top level object. A top level object is created by specifying a parent_id of zero. The new object can be a structure, a structure array, or a primitive. A structure array is specified by means of a type code of SDS_STRUCT and a non-zero number for ndims. If the type code is SDS_STRUCT and ndims is zero an ordinary structure is created. A primitive type is specified by the appropriate type code.

Language

C

Declaration

void SdsNew(SdsIdType parent_id, char *name, long nextra, char *extra, SdsCodeType code, long ndims, unsigned long *dims, SdsIdType *id, StatusType * SDSCONST status)

Parameters

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

>parent_idSdsIdTypeThe identifier of the structure to which the object is to be added. Use a value of zero to create a new top level object.
>namechar*The name of the object to create. The name should be of maximum length 16 characters including the terminating null.
>nextralongThe number of bytes of extra information to be included (maximum 128).
>extrachar*The extra information to be included with the item. nextra bytes from here are copied into the structure.
>codeSdsCodeTypeThe type code for the item to be created. One of the following values (defined in sds.h):

SDS_STRUCT Structure
SDS_CHAR Character
SDS_BYTE Signed byte
SDS_UBYTE Unsigned byte
SDS_SHORT Signed short integer
SDS_USHORT Unsigned short integer
SDS_INT Signed long integer
SDS_UINT Unsigned long integer
SDS_I64 Signed 64 bit integer
SDS_UI64 Unsigned 64 bit integer
SDS_FLOAT Floating point
SDS_DOUBLE Double precision floating point

>ndimslongNumber of dimensions for the item. Zero to create a scalar item.
>dimsunsigned long*Array of dimensions for the item. Should be of size at least ndims. A NULL pointer may be used if the item is a scalar.
<idSdsIdType*Identifier to the created object.
!statusStatusType*Modified status. Possible failure codes are:

SDS__BADID Invalid identifier
SDS__NOMEM Insufficient memory for creation
SDS__LONGNAME name is too long
SDS__EXTRA Too much extra data
SDS__INVCODE Invalid type code
SDS__INVDIMS Invalid dimensions
SDS__NOTSTRUCT Parent is not a structure
SDS__EXTERN Parent is 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 tony.farrell@mq.edu.au