1 /*
2  * Copyright 2013 University Corporation for Atmospheric Research
3  *
4  * This file is part of the UDUNITS-2 package.  See the file COPYRIGHT
5  * in the top-level source-directory of the package for copying and
6  * redistribution conditions.
7  */
8 #ifndef UT_UNIT_SEARCH_NODE_H_INCLUDED
9 #define UT_UNIT_SEARCH_NODE_H_INCLUDED
10 
11 #include "udunits2.h"
12 
13 typedef struct {
14     char*	id;
15     ut_unit*	unit;
16 } UnitAndId;
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 
23 /*
24  * Arguments:
25  *	id	The identifier (name or symbol).  May be freed upon return.
26  *	unit	The unit.  Must not be freed upon successful return until the
27  *		returned unit-search-node is no longer needed.
28  * Returns:
29  *	NULL	"id" is NULL.
30  *	NULL	"node" is NULL.
31  *	NULL	Out of memory.
32  *	else	Pointer to the new unit search node.
33  */
34 UnitAndId*
35 uaiNew(
36     const ut_unit* const	unit,
37     const char* const	id);
38 
39 
40 void
41 uaiFree(
42     UnitAndId* const	node);
43 
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif
50