Back to index

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

Go to the source code of this file.

Functions

hdf_type HDFarrayGetType (hdf_idt type_id)

Function Documentation

Definition at line 33 of file HDFarrayGetType.c.

{
  hdf_idt super;
  hdf_type type;
  hdf_size_type size;
  
  if(type_id < 0 )
    return HDF_NONE; 
  
  if((super = H5Tget_super(type_id))  < 0 )
    return HDF_NONE;
  
  switch (H5Tget_class(super))
    {
    case H5T_INTEGER :
      size = H5Tget_size(super);
      if(size == 1)
       type = HDF_CHAR;
      else if (size == 4)
        type = HDF_INT32;
      else
        type = HDF_INT64;
      break;
      
    case H5T_FLOAT :
      type = HDF_FLOAT64;
      break;
      
    case H5T_STRING :
      type = HDF_STRING;
      break;
      
    default :
      type = HDF_NONE;
    }
  
  H5Tclose(super);
  return type;
}