Back to index

salome-kernel  6.5.0
Functions
HDFarrayGetDim.c File Reference
#include <hdf5.h>
#include "hdfi.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

hdf_err HDFarrayGetDim (hdf_idt id, hdf_size dim[])

Function Documentation

hdf_err HDFarrayGetDim ( hdf_idt  id,
hdf_size  dim[] 
)

Definition at line 34 of file HDFarrayGetDim.c.

{
  hdf_err ret = 0;
  hdf_size *tmp;
  int ndim, i;

  if ( (ndim = H5Tget_array_ndims(id)) < 0 )
    return -1;

  tmp = (hdf_size *) malloc(sizeof(hdf_size)*ndim);

  ret = H5Tget_array_dims2(id, tmp);
  
  for( i=0 ; i < ndim ; i++)
    dim[i] = tmp[i];
  
  free (tmp);
  
  return ret;
}