SDSgetRank(3DTM)

NAME
SDSgetRank - Scientific data set function for retrieving the rank from the header.

SYNOPSIS
#include <sds.h>

int SDSgetRank(char *header, int *rank)

DESCRIPTION
SDSgetDimensions examines the header for the SDSdims flag and returns the following value as the value rank. This function is useful for determining in advance how many dimension values need be allocated for the call to SDSgetDimensions. If memory conservation is unimportant, or if it is guaranteed that the rank will always be less than a given value, then use SDSgetDimensions with a fixed size dims array since SDSgetDimensions reads the rank value automatically.

SEE ALSO
DTM, SDSclass, SDSsetDimensions

DIAGNOSTICS
SDSgetRank returns a value of 0 upon successful parsing of the header. If the tag SDSdims is not found within the header, the function returns the error DTMERROR and no values are assigned to the dimensions.

BUGS
SDSgetRank assumes that the rank immediately follows the SDSdims tag. If the rank is not present, the results are undefined.