SdsFindByName - Accesses a descendent of a structured Sds item using the descendent's name only.

Function

Accesses a descendent of a structured Sds item using the descendent's name only.

Description

This function is passed the id of an Sds structure and a name of a descendent element of that structure. It returns the id of the element. For example, if we have a structure of the form

	  Version              		Float
	  FibreCentDist        		Float
    	  PlateArray           		Struct
          Bundle             		Struct
            Fibres           		Struct
                xposition            	Float
                yposition            	Float
                transmission         	Float
                bias                 	Float
                broken               	Short

Then the name "xposition" is a valid name and this routine will return an SdsId pointing at that element.

The skip parameter can be used to select elements other than the first encountered in the search. Setting skip to something other than zero on entry will return the skip+1'th occurance of the element in the structure. Note that skip is modified as a result of this routine, and so a copy should be made if it is used for anything else.

Language

C

Call

(void) = SdsFindByName (parent_id, name, &skip, &id,status)

Parameters

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

>parent_idSdsIdTypeIdentified of the structure
>namechar *Structured name of the item to find
!skipunsigned int *On entry, if this is > 0 the routine will bypass the first skip elements of the given name, and return the skip+1'th elemement. On exit, it will be zero or, if an error occurs, it will be decremented by the number of elements skipped. If it is a NULL pointer the first match will be returned.
<idSdsIdType *Identifier to the component
!statuslong*Modified status. Possible failure codes are:

SDS__NOMEM Insufficent memory for creation
SDS__NOITEM No item with the specified name.

Include files

sds.h

Support

Nick Rees, JAC

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

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