HL-HDF
HLHDF C-API Reference Manual

This is the currently provided APIs available in C. More...

Classes

struct  _HL_Node
 Represents a HDF5 object/attribute/reference/... More...
 
struct  _HL_NodeList
 Represents a HDF5 file. More...
 
struct  HL_PropertyVersion
 See hdf5 documentation for H5Pget_version for purpose. More...
 
struct  HL_PropertySize
 See hdf5 documentation for H5Pset_sizes and H5Pget_sizes for purpose. More...
 
struct  HL_PropertySymK
 See hdf5 documentation for H5Pset_sym_k and H5Pget_sym_k for purpose. More...
 
struct  HL_FileCreationProperty
 Properties that can be finely tuned when creating a HDF5 file. More...
 
struct  HL_Compression
 Compression properties. More...
 
struct  HL_CompoundTypeAttribute
 This type is designed to describe an individual node with a complicated structure, ie. More...
 
struct  HL_CompoundTypeDescription
 This type is a list of HL_CompoundTypeAttributes. More...
 

Typedefs

typedef enum HL_Debug HL_Debug
 Debug levels.
 
typedef enum HL_CompressionType HL_CompressionType
 Defines what type of compression that should be used.
 
typedef enum HL_Type HL_Type
 This is an enumeration variable designed to identify the type of a given node.
 
typedef enum HL_DataType HL_DataType
 This is an enumeration variable designed to identify the type of data in a given node.
 
typedef enum HL_NodeMark HL_NodeMark
 This is an enumeration variable designed to keep track of the status of a given node.
 
typedef struct _HL_Node HL_Node
 Each entry and type in a HDF5 file is represented by a HL_Node.
 
typedef struct _HL_NodeList HL_NodeList
 Represents a HDF5 file.
 

Enumerations

enum  HL_Debug {
  HLHDF_SPEWDEBUG =0 , HLHDF_DEBUG , HLHDF_DEPRECATED , HLHDF_INFO ,
  HLHDF_WARNING , HLHDF_ERROR , HLHDF_CRITICAL , HLHDF_SILENT
}
 Debug levels. More...
 
enum  HL_CompressionType { CT_NONE =0 , CT_ZLIB , CT_SZLIB }
 Defines what type of compression that should be used. More...
 
enum  HL_Type {
  UNDEFINED_ID =-1 , ATTRIBUTE_ID =0 , GROUP_ID , DATASET_ID ,
  TYPE_ID , REFERENCE_ID
}
 This is an enumeration variable designed to identify the type of a given node. More...
 
enum  HL_DataType { DTYPE_UNDEFINED_ID =-1 , HL_SIMPLE =0 , HL_ARRAY }
 This is an enumeration variable designed to identify the type of data in a given node. More...
 
enum  HL_NodeMark {
  NMARK_UNDEFINED =-1 , NMARK_ORIGINAL =0 , NMARK_CREATED , NMARK_CHANGED ,
  NMARK_SELECT , NMARK_SELECTMETA
}
 This is an enumeration variable designed to keep track of the status of a given node. More...
 

Functions

void HL_disableErrorReporting (void)
 Disables error reporting.
 
void HL_enableErrorReporting (void)
 Enables error reporting.
 
int HL_isErrorReportingEnabled (void)
 Returns if error reporting is enabled or not.
 
void HL_init (void)
 Initializes the HLHDF handler functions.
 
void HL_setDebugMode (int flag)
 Toggles the debug mode for HLHDF.
 
int HL_isHDF5File (const char *filename)
 Verifies if the provided filename is a valid HDF5 file or not.
 
HL_FileCreationPropertyHLFileCreationProperty_new (void)
 Creates a file property instance that can be passed on to createHlHdfFile when creating a HDF5 file.
 
void HLFileCreationProperty_free (HL_FileCreationProperty *prop)
 Deallocates the HL_FileCreationProperty instance.
 
int HL_sizeOfFormat (const char *format)
 Calculates the size in bytes of the provided format specifiers.
 
int HL_isFormatSupported (const char *format)
 Verifies if the format name is supported by HLHDF.
 
HL_CompressionHLCompression_new (HL_CompressionType type)
 Creates an allocated and initialized instance of HL_Compression.
 
HL_CompressionHLCompression_clone (HL_Compression *inv)
 Creates a copy of the provided HL_Compression instance.
 
void HLCompression_init (HL_Compression *inv, HL_CompressionType type)
 Initializes a HL_Compressiosn instance.
 
void HLCompression_free (HL_Compression *inv)
 Deallocates the HL_Compression instance.
 
HL_CompoundTypeDescriptionnewHL_CompoundTypeDescription (void)
 Creates a compound type description list.
 
void freeHL_CompoundTypeDescription (HL_CompoundTypeDescription *typelist)
 Frees the compound type, including all members.
 
HL_CompoundTypeAttributenewHL_CompoundTypeAttribute (char *attrname, size_t offset, const char *format, size_t size, int ndims, size_t *dims)
 Creates a compound attribute member node.
 
void freeHL_CompoundTypeAttribute (HL_CompoundTypeAttribute *attr)
 Frees one compound type attribute.
 
int addHL_CompoundTypeAttribute (HL_CompoundTypeDescription *typelist, HL_CompoundTypeAttribute *attribute)
 Adds a compound type attribute to the type description.
 
HL_CompoundTypeDescriptioncopyHL_CompoundTypeDescription (HL_CompoundTypeDescription *descr)
 Copies the compound type descriptor.
 
hid_t createCompoundType (size_t size)
 Creates a new compound type.
 
herr_t addAttributeToCompoundType (hid_t loc_id, const char *name, size_t offset, hid_t type_id)
 Adds one attribute to a compound type.
 
herr_t addAttributeToCompoundType_fmt (hid_t loc_id, const char *name, size_t offset, const char *fmt)
 Same as addAttributeToCompoundType, but instead of a type as hid_t a format specifier is provided.
 
herr_t addArrayToCompoundType (hid_t loc_id, const char *name, size_t offset, int ndims, size_t *dims, hid_t type_id)
 Adds an array attribute to a compound type.
 
herr_t addArrayToCompoundType_fmt (hid_t loc_id, const char *name, size_t offset, int ndims, size_t *dims, const char *fmt)
 Same as addArrayToCompoundType, but instead of a type as hid_t, the format is specified with a format specifier.
 
void HL_InitializeDebugger (void)
 Initializes the debugger structure, must have been called before executing the code.
 
void HL_setDebugLevel (HL_Debug lvl)
 Sets the debug level.
 
void HL_setDebugFunction (void(*dbgfun)(char *filename, int lineno, HL_Debug lvl, const char *fmt,...))
 Sets the debug function where the debug printouts should be routed.
 
void HL_setHdf5ErrorFunction (void(*hdf5fun)(unsigned n, const H5E_error_t *val))
 Sets the HDF5 error reporting function.
 
void HL_disableHdf5ErrorReporting (void)
 Disables the HDF5 error reporting.
 
void HL_enableHdf5ErrorReporting (void)
 Enables the HDF5 error reporting.
 
HL_NodeHLNode_new (const char *name)
 Creates a new HL_Node instance.
 
void HLNode_free (HL_Node *node)
 Deallocates the provided node.
 
HL_NodeHLNode_newGroup (const char *name)
 Creates an empty group HL_Node of type HL_Type::GROUP_ID.
 
HL_NodeHLNode_newAttribute (const char *name)
 Creates an empty attribute HL_Node of type HL_Type::ATTRIBUTE_ID.
 
HL_NodeHLNode_newDataset (const char *name)
 Creates an empty data set HL_Node of type HL_Type::DATASET_ID.
 
HL_NodeHLNode_newDatatype (const char *name)
 Creates an empty data type HL_Node of type HL_Type::TYPE_ID.
 
HL_NodeHLNode_newReference (const char *name)
 Creates an empty reference HL_Node of type HL_Type::REFERENCE_ID.
 
HL_NodeHLNode_copy (HL_Node *node)
 Copies an HL_Node.
 
int HLNode_setScalarValue (HL_Node *node, size_t sz, unsigned char *value, const char *fmt, hid_t typid)
 Sets a scalar value in the specified node.
 
int HLNode_setArrayValue (HL_Node *node, size_t sz, int ndims, hsize_t *dims, unsigned char *value, const char *fmt, hid_t typid)
 Sets an array value in the specified node.
 
int HLNode_commitType (HL_Node *node, hid_t typid)
 Will mark the node to be committed, only applicable on type nodes.
 
HL_NodeListHLNodeList_new (void)
 Creates a new HL_NodeList instance.
 
void HLNodeList_free (HL_NodeList *nodelist)
 Releasing all resources associated with this node list including the node list itself.
 
int HLNodeList_addNode (HL_NodeList *nodelist, HL_Node *node)
 Adds a node to the nodelist.
 
HL_NodeHLNodeList_getNodeByName (HL_NodeList *nodelist, const char *nodeName)
 Locates a node called nodeName in the nodelist and returns a pointer to this node.
 
HL_CompoundTypeDescriptionHLNodeList_findCompoundDescription (HL_NodeList *nodelist, unsigned long objno0, unsigned long objno1)
 Searches the nodelist for any type node, that has got the same object id as objno0 and objno1.
 
HL_NodeListHLNodeList_readFrom (const char *filename, const char *fromPath)
 Reads an HDF5 file with name filename from the group fromPath and downwards.
 
HL_NodeListHLNodeList_read (const char *filename)
 Reads an HDF5 file with name filename from the root group ("/") and downwards.
 
int HLNodeList_selectNode (HL_NodeList *nodelist, const char *name)
 Selects the node named 'name' from which to fetch data.
 
int HLNodeList_selectAllNodes (HL_NodeList *nodelist)
 Marks all nodes in the nodelist for retrival.
 
int HLNodeList_selectMetadataNodes (HL_NodeList *nodelist)
 Selects all metadata nodes in the nodelist to be fetched, ie.
 
int HLNodeList_selectAllMetadataNodes (HL_NodeList *nodelist)
 Selects all metadata including metadata about datasets but will exclude data for datasets.
 
int HLNodeList_selectOnlyDatasetNodes (HL_NodeList *nodelist)
 Only select data set nodes for fetching.
 
int HLNodeList_deselectNode (HL_NodeList *nodelist, const char *name)
 De-selects the node named 'name' to be retrived when fetching data from the nodelist file.
 
int HLNodeList_fetchMarkedNodes (HL_NodeList *nodelist)
 Fills all nodes (marked as select) with data.
 
HL_NodeHLNodeList_fetchNode (HL_NodeList *nodelist, const char *name)
 Behaves as a combination of HLNodeList_selectNode()/fetch()/getNode().
 
int HLNodeList_write (HL_NodeList *nodelist, HL_FileCreationProperty *property, HL_Compression *compr)
 Writes a HDF5 file from a nodelist with the specified file properties and compression level/type.
 
int HLNodeList_update (HL_NodeList *nodelist, HL_Compression *compr)
 Updates a HDF5 file from a nodelist.
 

Detailed Description

This is the currently provided APIs available in C.

This group is a subset of all defined functions and if more information on all source code is wanted, please refer to the files section of the documentation.

Typedef Documentation

◆ HL_CompressionType

Defines what type of compression that should be used.

◆ HL_DataType

typedef enum HL_DataType HL_DataType

This is an enumeration variable designed to identify the type of data in a given node.

When new nodes are initiated, they are initialized with DTYPE_UNDEFINED_ID.

◆ HL_Debug

typedef enum HL_Debug HL_Debug

Debug levels.

The levels are defined so that if HLHDF_INFO debug level is turned on, all higher levels will also be printed except HLHDF_SILENT which means turn of logging.

◆ HL_Node

typedef struct _HL_Node HL_Node

Each entry and type in a HDF5 file is represented by a HL_Node.

◆ HL_NodeList

typedef struct _HL_NodeList HL_NodeList

Represents a HDF5 file.

◆ HL_NodeMark

typedef enum HL_NodeMark HL_NodeMark

This is an enumeration variable designed to keep track of the status of a given node.

◆ HL_Type

typedef enum HL_Type HL_Type

This is an enumeration variable designed to identify the type of a given node.

Enumeration Type Documentation

◆ HL_CompressionType

Defines what type of compression that should be used.

Enumerator
CT_NONE 

No compression.

CT_ZLIB 

ZLIB compression.

CT_SZLIB 

SZLIB compression.

◆ HL_DataType

This is an enumeration variable designed to identify the type of data in a given node.

When new nodes are initiated, they are initialized with DTYPE_UNDEFINED_ID.

Enumerator
DTYPE_UNDEFINED_ID 

Undefined data type.

HL_SIMPLE 

If the value is a scalar.

HL_ARRAY 

If the value is of array type.

◆ HL_Debug

enum HL_Debug

Debug levels.

The levels are defined so that if HLHDF_INFO debug level is turned on, all higher levels will also be printed except HLHDF_SILENT which means turn of logging.

Enumerator
HLHDF_SPEWDEBUG 

The most verbose printouts is turned on here.

Like entering functions and similar

HLHDF_DEBUG 

Basic debug functions.

HLHDF_DEPRECATED 

Print outs deprecated warnings.

HLHDF_INFO 

Informational messages.

HLHDF_WARNING 

Warnings.

HLHDF_ERROR 

Errors can be when memory not could be allocated or a file not could be created.

HLHDF_CRITICAL 

If this occurs, then something has gone very wrong or the code contains a bug, please report it to the HLHDF dev group for investigation.

HLHDF_SILENT 

Turns of debugging.

◆ HL_NodeMark

This is an enumeration variable designed to keep track of the status of a given node.

Enumerator
NMARK_UNDEFINED 

Undefined type.

NMARK_ORIGINAL 

Nothing has been done on the node, e.g.

it has been read but nothing else

NMARK_CREATED 

If a node has been created but not been written.

NMARK_CHANGED 

If a nodes value has been changed and needs to be written.

NMARK_SELECT 

The node has been marked for fetching but the read has not been performed yet.

NMARK_SELECTMETA 

Special variant for marking datasets that we are only interested in the metadata.

◆ HL_Type

enum HL_Type

This is an enumeration variable designed to identify the type of a given node.

Enumerator
UNDEFINED_ID 

An undefined type.

ATTRIBUTE_ID 

Attribute type (corresponds to H5A)

GROUP_ID 

Group type (corresponds to H5G)

DATASET_ID 

Data set type (corresponds to H5D)

TYPE_ID 

Type type (corresponds to H5T)

REFERENCE_ID 

Reference type (corresponds to H5R)

Function Documentation

◆ addArrayToCompoundType()

herr_t addArrayToCompoundType ( hid_t loc_id,
const char * name,
size_t offset,
int ndims,
size_t * dims,
hid_t type_id )

Adds an array attribute to a compound type.

Parameters
[in]loc_idThe type this attribute should be inserted in
[in]nameThe name of the attribute
[in]offsetOffset of this attribute
[in]ndimsThe rank of the array attribute (max 4)
[in]dimsThe dimension of the array attribute
[in]type_idThe type of the array attribute
Returns
<0 on failure, otherwise ok.

◆ addArrayToCompoundType_fmt()

herr_t addArrayToCompoundType_fmt ( hid_t loc_id,
const char * name,
size_t offset,
int ndims,
size_t * dims,
const char * fmt )

Same as addArrayToCompoundType, but instead of a type as hid_t, the format is specified with a format specifier.

Parameters
[in]loc_idThe type this attribute should be inserted in
[in]nameThe name of the attribute
[in]offsetOffset of this attribute
[in]ndimsThe rank of the array attribute (max 4)
[in]dimsThe dimension of the array attribute
[in]fmtThe type of the attribute. See format specifiers. Returns: <0 is failure, otherwise ok.

◆ addAttributeToCompoundType()

herr_t addAttributeToCompoundType ( hid_t loc_id,
const char * name,
size_t offset,
hid_t type_id )

Adds one attribute to a compound type.

Parameters
[in]loc_idThe type the attribute should be inserted in.
[in]nameThe name of the member attribute
[in]offsetOffset of this attribute
[in]type_idThe type of the attribute
Returns
<0 on failure, otherwise ok.

◆ addAttributeToCompoundType_fmt()

herr_t addAttributeToCompoundType_fmt ( hid_t loc_id,
const char * name,
size_t offset,
const char * fmt )

Same as addAttributeToCompoundType, but instead of a type as hid_t a format specifier is provided.

Parameters
[in]loc_idThe type the attribute should be inserted in.
[in]nameThe name of the member attribute
[in]offsetOffset of this attribute
[in]fmtThe type of the attribute. See format specifiers.
Returns
<0 on failure, otherwise ok.

◆ addHL_CompoundTypeAttribute()

int addHL_CompoundTypeAttribute ( HL_CompoundTypeDescription * typelist,
HL_CompoundTypeAttribute * attribute )

Adds a compound type attribute to the type description.

Parameters
[in]typelistthe descriptor that should get the new attribute
[in]attributethe attribute that should be added
Returns
0 on failure, 1 if success

◆ copyHL_CompoundTypeDescription()

HL_CompoundTypeDescription * copyHL_CompoundTypeDescription ( HL_CompoundTypeDescription * descr)

Copies the compound type descriptor.

Parameters
[in]descrthe descriptor that should be copied.
Returns
The type description on success, otherwise NULL

◆ createCompoundType()

hid_t createCompoundType ( size_t size)

Creates a new compound type.

Parameters
[in]sizeThe size of the compound type, usually sizeof(struct name).
Returns
<0 on failure, otherwise a reference to the created type.

◆ freeHL_CompoundTypeAttribute()

void freeHL_CompoundTypeAttribute ( HL_CompoundTypeAttribute * attr)

Frees one compound type attribute.

Parameters
[in]attrthe attribute that should be deallocated.

◆ freeHL_CompoundTypeDescription()

void freeHL_CompoundTypeDescription ( HL_CompoundTypeDescription * typelist)

Frees the compound type, including all members.

Parameters
[in]typelistthe descriptor that should be deleted.

◆ HL_disableErrorReporting()

void HL_disableErrorReporting ( void )

Disables error reporting.

◆ HL_disableHdf5ErrorReporting()

void HL_disableHdf5ErrorReporting ( void )

Disables the HDF5 error reporting.

◆ HL_enableErrorReporting()

void HL_enableErrorReporting ( void )

Enables error reporting.

◆ HL_enableHdf5ErrorReporting()

void HL_enableHdf5ErrorReporting ( void )

Enables the HDF5 error reporting.

◆ HL_init()

void HL_init ( void )

Initializes the HLHDF handler functions.

This always needs to be done before doing anything else when using HLHDF.

◆ HL_InitializeDebugger()

void HL_InitializeDebugger ( void )

Initializes the debugger structure, must have been called before executing the code.

◆ HL_isErrorReportingEnabled()

int HL_isErrorReportingEnabled ( void )

Returns if error reporting is enabled or not.

◆ HL_isFormatSupported()

int HL_isFormatSupported ( const char * format)

Verifies if the format name is supported by HLHDF.

Does not see string and compound as a supported format since they are not possible to determine without a hid.

Parameters
[in]formatthe format name string
Returns
TRUE if it is supported, otherwise FALSE.

◆ HL_isHDF5File()

int HL_isHDF5File ( const char * filename)

Verifies if the provided filename is a valid HDF5 file or not.

Parameters
[in]filenamethe full path of the file to check
Returns
TRUE if file is an HDF5 file, otherwise FALSE

◆ HL_setDebugFunction()

void HL_setDebugFunction ( void(* dbgfun )(char *filename, int lineno, HL_Debug lvl, const char *fmt,...))

Sets the debug function where the debug printouts should be routed.

Parameters
[in]dbgfunThe debug function.

◆ HL_setDebugLevel()

void HL_setDebugLevel ( HL_Debug lvl)

Sets the debug level.

Parameters
[in]lvlthe debug level. See HL_Debug.

◆ HL_setDebugMode()

void HL_setDebugMode ( int flag)

Toggles the debug mode for HLHDF.

Possible values of flag are:

  • 0 = No debugging
  • 1 = Debug only the HLHDF library
  • 2 = Debug both HLHDF and HDF5 library
Parameters
[in]flagthe level of debugging

◆ HL_setHdf5ErrorFunction()

void HL_setHdf5ErrorFunction ( void(* hdf5fun )(unsigned n, const H5E_error_t *val))

Sets the HDF5 error reporting function.

Parameters
[in]hdf5funthe HDF5 error reporting function

◆ HL_sizeOfFormat()

int HL_sizeOfFormat ( const char * format)

Calculates the size in bytes of the provided format specifiers.

The exception is string and compound type since they needs to be analyzed to get the size.

Parameters
[in]formatThe format specifier.
Returns
the size in bytes or -1 on failure.

◆ HLCompression_clone()

HL_Compression * HLCompression_clone ( HL_Compression * inv)

Creates a copy of the provided HL_Compression instance.

Parameters
[in]invthe instance to be cloned
Returns
the cloned instance or NULL if parameter was NULL or memory not could be allocated.

◆ HLCompression_free()

void HLCompression_free ( HL_Compression * inv)

Deallocates the HL_Compression instance.

Parameters
invThe instance that should be deallocated

◆ HLCompression_init()

void HLCompression_init ( HL_Compression * inv,
HL_CompressionType type )

Initializes a HL_Compressiosn instance.

Parameters
[in]invThe compression object to be initialized
[in]typethe type of compression the object should be initialized with

◆ HLCompression_new()

HL_Compression * HLCompression_new ( HL_CompressionType type)

Creates an allocated and initialized instance of HL_Compression.

Parameters
[in]typethe compression type to use
Returns
the created instance, NULL on failure.

◆ HLFileCreationProperty_free()

void HLFileCreationProperty_free ( HL_FileCreationProperty * prop)

Deallocates the HL_FileCreationProperty instance.

Parameters
[in]propThe property to be deallocated

◆ HLFileCreationProperty_new()

HL_FileCreationProperty * HLFileCreationProperty_new ( void )

Creates a file property instance that can be passed on to createHlHdfFile when creating a HDF5 file.

Returns
the allocated file property instance, NULL on failure. See HLFileCreationProperty_free for deallocation.

◆ HLNode_commitType()

int HLNode_commitType ( HL_Node * node,
hid_t typid )

Will mark the node to be committed, only applicable on type nodes.

Parameters
[in]nodethe node that should be commited
[in]typidthe HDF5 type identifier
Returns
1 on success, otherwise 0
Deprecated
this function will be removed sooner or later.

◆ HLNode_copy()

HL_Node * HLNode_copy ( HL_Node * node)

Copies an HL_Node.

Parameters
[in]nodethe node that should be copied
Returns
the allocated node on success, otherwise NULL.

◆ HLNode_free()

void HLNode_free ( HL_Node * node)

Deallocates the provided node.

Parameters
[in]nodethe node that should be deallocated

◆ HLNode_new()

HL_Node * HLNode_new ( const char * name)

Creates a new HL_Node instance.

Parameters
[in]namethe name of this node, should be fully qualified name. I.e. /a/b/c
Returns
the allocated node on success, otherwise NULL.

◆ HLNode_newAttribute()

HL_Node * HLNode_newAttribute ( const char * name)

Creates an empty attribute HL_Node of type HL_Type::ATTRIBUTE_ID.

Parameters
[in]namethe fully qualified name
Returns
The allocated node on success, otherwise NULL.

◆ HLNode_newDataset()

HL_Node * HLNode_newDataset ( const char * name)

Creates an empty data set HL_Node of type HL_Type::DATASET_ID.

Parameters
[in]namethe fully qualified name
Returns
The allocated node on success, otherwise NULL.

◆ HLNode_newDatatype()

HL_Node * HLNode_newDatatype ( const char * name)

Creates an empty data type HL_Node of type HL_Type::TYPE_ID.

Parameters
[in]namethe fully qualified name
Returns
The allocated node on success, otherwise NULL.

◆ HLNode_newGroup()

HL_Node * HLNode_newGroup ( const char * name)

Creates an empty group HL_Node of type HL_Type::GROUP_ID.

Parameters
[in]namethe fully qualified name
Returns
The allocated node on success, otherwise NULL.

◆ HLNode_newReference()

HL_Node * HLNode_newReference ( const char * name)

Creates an empty reference HL_Node of type HL_Type::REFERENCE_ID.

Parameters
[in]namethe fully qualified name
Returns
The allocated node on success, otherwise NULL.

◆ HLNode_setArrayValue()

int HLNode_setArrayValue ( HL_Node * node,
size_t sz,
int ndims,
hsize_t * dims,
unsigned char * value,
const char * fmt,
hid_t typid )

Sets an array value in the specified node.

Parameters
[in]nodethe node that should get its value set
[in]szthe size of the type
[in]ndimsthe rank
[in]dimsthe dimension
[in]valuethe data buffer
[in]fmtthe format specifier,
See also
ref Valid format specifiers "here" for valid formats.
Parameters
[in]typidif a custom made type should be used for writing the data, otherwise use -1.
Returns
1 if everything was ok, otherwise 0

◆ HLNode_setScalarValue()

int HLNode_setScalarValue ( HL_Node * node,
size_t sz,
unsigned char * value,
const char * fmt,
hid_t typid )

Sets a scalar value in the specified node.

Parameters
[in]nodethe node that should get its value set.
[in]szthe size of the data
[in]valuethe data
[in]fmtthe format specifier,
See also
ref Valid format specifiers "here" for valid formats.
Parameters
[in]typidif a custom made type should be used for writing the data, otherwise use -1.
Returns
1 if everything was ok, otherwise 0

◆ HLNodeList_addNode()

int HLNodeList_addNode ( HL_NodeList * nodelist,
HL_Node * node )

Adds a node to the nodelist.

Parameters
[in]nodelistthe nodelist that should get a node added
[in]nodethe node that should be added to the node list
Returns
1 On success, otherwise 0

◆ HLNodeList_deselectNode()

int HLNodeList_deselectNode ( HL_NodeList * nodelist,
const char * name )

De-selects the node named 'name' to be retrived when fetching data from the nodelist file.

Parameters
[in]nodelistthe node list
[in]namethe name that should be deselected
Returns
1 on success, otherwise 0.

◆ HLNodeList_fetchMarkedNodes()

int HLNodeList_fetchMarkedNodes ( HL_NodeList * nodelist)

Fills all nodes (marked as select) with data.

Parameters
[in]nodelistthe node list
Returns
1 on success, otherwise 0

◆ HLNodeList_fetchNode()

HL_Node * HLNodeList_fetchNode ( HL_NodeList * nodelist,
const char * name )

Behaves as a combination of HLNodeList_selectNode()/fetch()/getNode().

Parameters
[in]nodelistthe node list
[in]namethe name of the node that should be fetched.
Returns
the found node or NULL on failure.

◆ HLNodeList_findCompoundDescription()

HL_CompoundTypeDescription * HLNodeList_findCompoundDescription ( HL_NodeList * nodelist,
unsigned long objno0,
unsigned long objno1 )

Searches the nodelist for any type node, that has got the same object id as objno0 and objno1.

Parameters
[in]nodelistthe nodelist that should be searched
[in]objno0identifier 0
[in]objno1identifier 1
Returns
The compound type description if found, otherwise NULL.

◆ HLNodeList_free()

void HLNodeList_free ( HL_NodeList * nodelist)

Releasing all resources associated with this node list including the node list itself.

Parameters
[in]nodelistthe list that should be released.

◆ HLNodeList_getNodeByName()

HL_Node * HLNodeList_getNodeByName ( HL_NodeList * nodelist,
const char * nodeName )

Locates a node called nodeName in the nodelist and returns a pointer to this node.

I.e. Do not delete it!

Parameters
[in]nodelistthe nodelist that should be searched in
[in]nodeNamethe name of the node that should be located
Returns
the node if it could be found, otherwise NULL.

◆ HLNodeList_new()

HL_NodeList * HLNodeList_new ( void )

Creates a new HL_NodeList instance.

Returns
the allocated node list on success, otherwise NULL.

◆ HLNodeList_read()

HL_NodeList * HLNodeList_read ( const char * filename)

Reads an HDF5 file with name filename from the root group ("/") and downwards.

This function will not fetch the actual data but will only read the structure. Use selectAll/selectAllNodes and fetchMarkedNodes to retrieve the data.

Parameters
[in]filenamethe name of the HDF5 file
Returns
the read data structure on success, otherwise NULL.

◆ HLNodeList_readFrom()

HL_NodeList * HLNodeList_readFrom ( const char * filename,
const char * fromPath )

Reads an HDF5 file with name filename from the group fromPath and downwards.

This function will not fetch the actual data but will only read the structure. Use selectAll/selectAllNodes and fetchMarkedNodes to retrieve the data.

Parameters
[in]filenamethe name of the HDF5 file
[in]fromPaththe path from where the file should be read.
Returns
the read data structure on success, otherwise NULL.

◆ HLNodeList_selectAllMetadataNodes()

int HLNodeList_selectAllMetadataNodes ( HL_NodeList * nodelist)

Selects all metadata including metadata about datasets but will exclude data for datasets.

VOLATILE: Do not attempt to access dataset arrays after calling this.

Parameters
[in]nodelistthe node list
Returns
1 on success, otherwise 0

◆ HLNodeList_selectAllNodes()

int HLNodeList_selectAllNodes ( HL_NodeList * nodelist)

Marks all nodes in the nodelist for retrival.

Parameters
[in]nodelistthe node list
Returns
1 on success, otherwise 0

◆ HLNodeList_selectMetadataNodes()

int HLNodeList_selectMetadataNodes ( HL_NodeList * nodelist)

Selects all metadata nodes in the nodelist to be fetched, ie.

dataset attributes but no dataset arrays or arrays. VOLATILE: Do not attempt to access dataset arrays after calling this.

Parameters
[in]nodelistthe node list
Returns
1 on success, otherwise 0

◆ HLNodeList_selectNode()

int HLNodeList_selectNode ( HL_NodeList * nodelist,
const char * name )

Selects the node named 'name' from which to fetch data.

Parameters
[in]nodelistthe nodelist where the node named name should be marked for select
[in]namethe fully qualified name of the node that should be selected.
Returns
: 1 on success, otherwise 0

◆ HLNodeList_selectOnlyDatasetNodes()

int HLNodeList_selectOnlyDatasetNodes ( HL_NodeList * nodelist)

Only select data set nodes for fetching.

This is useful if for example wanting to first read metadata. Then depending on content fetch dataset nodes.

Parameters
[in]nodelistthe node list
Returns
1 on success, otherwise 0

◆ HLNodeList_update()

int HLNodeList_update ( HL_NodeList * nodelist,
HL_Compression * compr )

Updates a HDF5 file from a nodelist.

Parameters
[in]nodelistthe node list to update
[in]comprthe wanted compression type and level
Returns
TRUE on success otherwise failure.

◆ HLNodeList_write()

int HLNodeList_write ( HL_NodeList * nodelist,
HL_FileCreationProperty * property,
HL_Compression * compr )

Writes a HDF5 file from a nodelist with the specified file properties and compression level/type.

Parameters
[in]nodelistthe node list to write
[in]propertythe file creation properties
[in]comprthe wanted compression type and level
Returns
TRUE on success otherwise failure.

◆ newHL_CompoundTypeAttribute()

HL_CompoundTypeAttribute * newHL_CompoundTypeAttribute ( char * attrname,
size_t offset,
const char * format,
size_t size,
int ndims,
size_t * dims )

Creates a compound attribute member node.

Parameters
[in]attrnameThe name of this attribute
[in]offsetthe offset in the structure for this member (See HOFFSET in HDF5 documentation)
[in]formatFormat specifier.
[in]sizeThe size of this data type
[in]ndimsThe number of dimensions
[in]dimsThe dimensions
Returns
The compound member on success, otherwise NULL

◆ newHL_CompoundTypeDescription()

HL_CompoundTypeDescription * newHL_CompoundTypeDescription ( void )

Creates a compound type description list.

Returns
the compound type descriptor on success, otherwise NULL.