HL-HDF
hlhdf_private.h File Reference

Private generic functions used within HLHDF that should not be exposed to the end-user. More...

#include "hlhdf.h"

Go to the source code of this file.

Functions

hid_t openHlHdfFile (const char *filename, const char *how)
 Opens a HDF5 file by specifying the file and an option mode.
 
hid_t createHlHdfFile (const char *filename, HL_FileCreationProperty *property)
 Creates a HDF5 file.
 
hid_t getFixedType (hid_t type)
 Translates a HDF5 type identifier into a native type identifier.
 
hid_t HL_translateFormatStringToDatatype (const char *dataType)
 Returns a native data type from the format specifier.
 
char * getTypeNameString (hid_t type)
 Returns the type as represented by HDF5.
 
HL_FormatSpecifier HL_getFormatSpecifierFromType (hid_t type)
 Returns the format specifier for the provided type identifier.
 
const char * getFormatNameString (hid_t type)
 Returns the format specifier as defined by HLHDF.
 
char * getStringPadName (hid_t type)
 Returns the String Pad name as represented by HDF5.
 
char * getStringCsetName (hid_t type)
 Returns the CSET name as represented in HDF5.
 
char * getStringCtypeName (hid_t type)
 Returns the CTYPE name as represented in HDF5.
 
int extractParentChildName (HL_Node *node, char **parent, char **child)
 Extracts the parent and child name from the node name.
 
int openGroupOrDataset (hid_t file_id, const char *name, hid_t *lid, HL_Type *type)
 Opens a group or dataset hid and returns the type as well.
 

Detailed Description

Private generic functions used within HLHDF that should not be exposed to the end-user.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2009-06-11

Function Documentation

◆ createHlHdfFile()

hid_t createHlHdfFile ( const char * filename,
HL_FileCreationProperty * property )

Creates a HDF5 file.

If the filename already exists this file will be truncated.

Parameters
[in]filenamethe name of the file to create
[in]propertyThe properties for trimming the filesize and structure. (May be NULL)
Returns
the file identifier or -1 on failure.

◆ extractParentChildName()

int extractParentChildName ( HL_Node * node,
char ** parent,
char ** child )

Extracts the parent and child name from the node name.

Example: '/group1/group2/group3' will be splitted into '/group1/group2' and 'group3'.

Parameters
[in]nodethe node containing the name that should be splitted
[out]parentthe parent path
[out]childthis nodes name.
Returns
1 on success, otherwise 0.

◆ getFixedType()

hid_t getFixedType ( hid_t type)

Translates a HDF5 type identifier into a native type identifier.

This identifier is used within the HLHDF library.

Parameters
[in]typethe type that should be translated
Returns
a reference to the native type identifier, <0 on failure. Remember to call H5Tclose on the returned type.

◆ getFormatNameString()

const char * getFormatNameString ( hid_t type)

Returns the format specifier as defined by HLHDF.

Parameters
[in]typethe type identifier, must be a native type.
Returns
the format specifier string or NULL on failure. See here for valid values.

◆ getStringCsetName()

char * getStringCsetName ( hid_t type)

Returns the CSET name as represented in HDF5.

Parameters
[in]typethe type identifier
Returns
the CSET name as represented in HDF5.

◆ getStringCtypeName()

char * getStringCtypeName ( hid_t type)

Returns the CTYPE name as represented in HDF5.

Parameters
[in]typethe type identifier
Returns
the CTYPE name as represented in HDF5.

◆ getStringPadName()

char * getStringPadName ( hid_t type)

Returns the String Pad name as represented by HDF5.

Parameters
[in]typethe type identifier
Returns
the String Pad name as defined in HDF5.

◆ getTypeNameString()

char * getTypeNameString ( hid_t type)

Returns the type as represented by HDF5.

For example 'H5T_STD_I8BE'.

Parameters
[in]typethe type identifier
Returns
an allocated string with the name or NULL upon failure.

◆ HL_getFormatSpecifierFromType()

HL_FormatSpecifier HL_getFormatSpecifierFromType ( hid_t type)

Returns the format specifier for the provided type identifier.

Parameters
[in]typethe type identifier, must be a native type.
Returns
the format specifier or HLHDF_UNDEFINED on error.

◆ HL_translateFormatStringToDatatype()

hid_t HL_translateFormatStringToDatatype ( const char * dataType)

Returns a native data type from the format specifier.

Parameters
[in]dataTypeFormat specifier. See here for valid format specifiers.
Returns
the reference to the type or <0 on failure.

◆ openGroupOrDataset()

int openGroupOrDataset ( hid_t file_id,
const char * name,
hid_t * lid,
HL_Type * type )

Opens a group or dataset hid and returns the type as well.

Parameters
[in]file_id- the file pointer
[in]name- the node name to open
[out]lid- the opened hid
[out]type- the type of the opened hid
Returns
0 on failure, otherwise 1

◆ openHlHdfFile()

hid_t openHlHdfFile ( const char * filename,
const char * how )

Opens a HDF5 file by specifying the file and an option mode.

Parameters
[in]filenamethe filename
[in]howhow the file should be opened, 'r', 'w' or 'rw'
Returns
the file identifier or -1 on failure.