HDF5 Extras
0.0.1
Convenience Functions for using HDF5 Better
|
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <complex.h>
#include "bstrlib.h"
#include "gmalloc.h"
#include "H5ATTR.h"
#include "globals.h"
Macros | |
#define | RMIN 0 |
#define | RMAX 1 |
Functions | |
int | GS_InitializeNumberRanges (void) |
GS_InitializeNumberRanges initializes ranges for various types. More... | |
int | GS_DataConversion (int in_type, const void *in_buffer, int out_type, void *out_buffer, int nelements) |
GS_DataConversion converts a data buffer between different types. More... | |
Variables | |
long int | intranges [GS_DATATYPE_MAX+1][2] |
double | floatranges [GS_DATATYPE_MAX+1][2] |
int GS_DataConversion | ( | int | in_type, |
const void * | in_buffer, | ||
int | out_type, | ||
void * | out_buffer, | ||
int | nelements | ||
) |
GS_DataConversion converts a data buffer between different types.
[in] | in_type | The type of data in in_buffer . The valid datatypes are: GS_DATATYPE_UI1 (Unsigned Integer, 1-bit)GS_DATATYPE_UI8 (Unsigned Integer, 8-bit)GS_DATATYPE_SI8 (Signed Integer, 8-bit)GS_DATATYPE_CI8 (Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16 (Unsigned Integer, 16-bit)GS_DATATYPE_SI16 (Signed Integer, 16-bit)GS_DATATYPE_CI16 (Complex Integer, 16-bit)GS_DATATYPE_UI32 (Unsigned Integer, 32-bit)GS_DATATYPE_SI32 (Signed Integer, 32-bit)GS_DATATYPE_CI32 (Complex Integer, 32-bit)GS_DATATYPE_CI64 (Complex Integer, 64-bit)GS_DATATYPE_R32 (Real, 32-bit)GS_DATATYPE_R64 (Real, 64-bit)GS_DATATYPE_C64 (Complex, 64-bit)GS_DATATYPE_C128 (Complex, 128-bit)GS_DATATYPE_UI64 (Unsigned Integer, 64-bit)GS_DATATYPE_SI64 (Signed Integer, 64-bit) |
[in] | in_buffer | The data we want to convert to a different type. |
[in] | out_type | The type of data we want in out_buffer . Same valid datatypes as in in_type . |
[in] | out_buffer | The destination of the converted data from in_buffer . |
[in] | nelements | The number of elements to convert. |
TRUE
on sucess, FALSE
on failure.int GS_InitializeNumberRanges | ( | void | ) |
GS_InitializeNumberRanges initializes ranges for various types.
GS_InitializeNumberRanges() initializes the ranges for each of the scalar number types used in GeoSci. This is needed during type conversions to avoid creating variables whose value is out-of-range.
intranges
and floatranges
to contain the minimum and maximum numbers possible for each datatype that GeoSci supports.