HL-HDF
hlhdf_nodelist.h File Reference

Functions for working with HL_NodeList's. More...

#include "hlhdf_types.h"

Go to the source code of this file.

Functions

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_setFileName (HL_NodeList *nodelist, const char *filename)
 Sets the filename in the HL_NodeList instance.
 
char * HLNodeList_getFileName (HL_NodeList *nodelist)
 Returns the filename of this nodelist.
 
int HLNodeList_getNumberOfNodes (HL_NodeList *nodelist)
 Returns the number of nodes that exists in the provided nodelist.
 
HL_NodeHLNodeList_getNodeByIndex (HL_NodeList *nodelist, int index)
 Returns the node at the specified index.
 
void HLNodeList_markNodes (HL_NodeList *nodelist, const HL_NodeMark mark)
 Marks all nodes in the nodelist with the provided mark.
 
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.
 
int HLNodeList_hasNodeByName (HL_NodeList *nodelist, const char *nodeName)
 Returns if the nodelist contains a node with the specified name or not.
 
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.
 

Detailed Description

Functions for working with HL_NodeList's.

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

Function Documentation

◆ HLNodeList_getFileName()

char * HLNodeList_getFileName ( HL_NodeList * nodelist)

Returns the filename of this nodelist.

Parameters
[in]nodelist- the nodelist
Returns
the filename for this nodelist or NULL if no filename is set or failed to allocate memory.

◆ HLNodeList_getNodeByIndex()

HL_Node * HLNodeList_getNodeByIndex ( HL_NodeList * nodelist,
int index )

Returns the node at the specified index.

Parameters
[in]nodelist- the node list
[in]index- the index of the node
Returns
the node if it exists, otherwise NULL. Do not free since it is an internal pointer

◆ HLNodeList_getNumberOfNodes()

int HLNodeList_getNumberOfNodes ( HL_NodeList * nodelist)

Returns the number of nodes that exists in the provided nodelist.

Parameters
[in]nodelist- the node list
Returns
the number of nodes or a negative value on failure.

◆ HLNodeList_hasNodeByName()

int HLNodeList_hasNodeByName ( HL_NodeList * nodelist,
const char * nodeName )

Returns if the nodelist contains a node with the specified name or not.

Parameters
[in]nodelist- the nodelist
[in]nodeName- the name of the node that is searched for
Returns
1 if the node could be found, otherwise 0

◆ HLNodeList_markNodes()

void HLNodeList_markNodes ( HL_NodeList * nodelist,
const HL_NodeMark mark )

Marks all nodes in the nodelist with the provided mark.

Parameters
[in]nodelist- the nodelist to be updated.
[in]mark- the mark each node should have.

◆ HLNodeList_setFileName()

int HLNodeList_setFileName ( HL_NodeList * nodelist,
const char * filename )

Sets the filename in the HL_NodeList instance.

Parameters
[in]nodelist- the nodelist
[in]filename- the filename that should be used
Returns
1 on success, otherwise 0