summaryrefslogtreecommitdiffstats
path: root/generic/tclConfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclConfig.c')
-rw-r--r--generic/tclConfig.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/generic/tclConfig.c b/generic/tclConfig.c
index c65c501..291b781 100644
--- a/generic/tclConfig.c
+++ b/generic/tclConfig.c
@@ -9,13 +9,12 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclConfig.c,v 1.11 2006/09/22 18:13:28 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclConfig.c,v 1.12 2007/03/12 10:49:54 dkf Exp $
*/
#include "tclInt.h"
-
/*
* Internal structure to hold embedded configuration information.
*
@@ -27,7 +26,7 @@
* by the caller.
*/
-#define ASSOC_KEY "tclPackageAboutDict"
+#define ASSOC_KEY "tclPackageAboutDict"
/*
* Static functions in this file:
@@ -35,7 +34,7 @@
static int QueryConfigObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- struct Tcl_Obj * CONST * objv);
+ struct Tcl_Obj *CONST *objv);
static void QueryConfigDelete(ClientData clientData);
static Tcl_Obj * GetConfigDict(Tcl_Interp* interp);
static void ConfigDictDeleteProc(ClientData clientData,
@@ -68,17 +67,13 @@ Tcl_RegisterConfig(
CONST char *valEncoding) /* Name of the encoding used to store the
* configuration values, ASCII, thus UTF-8. */
{
- Tcl_Encoding venc;
- Tcl_Obj *pDB;
- Tcl_Obj *pkg;
- Tcl_Obj *pkgDict;
+ Tcl_Obj *pDB, *pkg, *pkgDict;
Tcl_DString cmdName;
Tcl_Config *cfg;
- int res;
+ Tcl_Encoding venc = Tcl_GetEncoding(NULL, valEncoding);
- venc = Tcl_GetEncoding(NULL, valEncoding);
- pDB = GetConfigDict(interp);
- pkg = Tcl_NewStringObj(pkgName, -1);
+ pDB = GetConfigDict(interp);
+ pkg = Tcl_NewStringObj(pkgName, -1);
/*
* Phase I: Adding the provided information to the internal database of
@@ -99,8 +94,8 @@ Tcl_RegisterConfig(
* Retrieve package specific configuration...
*/
- res = Tcl_DictObjGet(interp, pDB, pkg, &pkgDict);
- if ((TCL_OK != res) || (pkgDict == NULL)) {
+ if (Tcl_DictObjGet(interp, pDB, pkg, &pkgDict) != TCL_OK
+ || (pkgDict == NULL)) {
pkgDict = Tcl_NewDictObj();
} else if (Tcl_IsShared(pkgDict)) {
pkgDict = Tcl_DuplicateObj(pkgDict);
@@ -126,6 +121,12 @@ Tcl_RegisterConfig(
}
/*
+ * We're now done with the encoding, so drop it.
+ */
+
+ Tcl_FreeEncoding(venc);
+
+ /*
* Write the changes back into the overall database.
*/
@@ -148,10 +149,10 @@ Tcl_RegisterConfig(
if (Tcl_FindNamespace(interp, Tcl_DStringValue(&cmdName), NULL,
TCL_GLOBAL_ONLY) == NULL) {
if (Tcl_CreateNamespace(interp, Tcl_DStringValue(&cmdName),
- (ClientData) NULL, (Tcl_NamespaceDeleteProc *) NULL) == NULL) {
- Tcl_Panic("%s.\n%s %s", Tcl_GetStringResult(interp),
- "Tcl_RegisterConfig: Unable to create namespace for",
- "package configuration.");
+ NULL, NULL) == NULL) {
+ Tcl_Panic("%s.\n%s: %s",
+ Tcl_GetStringResult(interp), "Tcl_RegisterConfig",
+ "Unable to create namespace for package configuration.");
}
}
@@ -159,8 +160,8 @@ Tcl_RegisterConfig(
if (Tcl_CreateObjCommand(interp, Tcl_DStringValue(&cmdName),
QueryConfigObjCmd, (ClientData) pkg, QueryConfigDelete) == NULL) {
- Tcl_Panic("%s %s", "Tcl_RegisterConfig: Unable to create query",
- "command for package configuration");
+ Tcl_Panic("%s: %s", "Tcl_RegisterConfig",
+ "Unable to create query command for package configuration");
}
Tcl_DStringFree(&cmdName);
@@ -188,12 +189,11 @@ QueryConfigObjCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
- struct Tcl_Obj * CONST *objv)
+ struct Tcl_Obj *CONST *objv)
{
Tcl_Obj *pkgName = (Tcl_Obj *) clientData;
Tcl_Obj *pDB, *pkgDict, *val, *listPtr;
- int n, i, res, index;
-
+ int n, res, index;
static CONST char *subcmdStrings[] = {
"get", "list", NULL
};
@@ -258,14 +258,14 @@ QueryConfigObjCmd(
listPtr->internalRep.twoPtrValue.ptr1;
Tcl_DictSearch s;
Tcl_Obj *key, **vals;
- int done;
+ int done, i = 0;
listRepPtr->elemCount = n;
vals = &listRepPtr->elements;
- for (i=0, Tcl_DictObjFirst(interp, pkgDict, &s, &key, NULL, &done);
- !done; Tcl_DictObjNext(&s, &key, NULL, &done), i++) {
- vals[i] = key;
+ for (Tcl_DictObjFirst(interp, pkgDict, &s, &key, NULL, &done);
+ !done; Tcl_DictObjNext(&s, &key, NULL, &done)) {
+ vals[i++] = key;
Tcl_IncrRefCount(key);
}
}
span class="hl str">"lineno"> 17</span>&#160; <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; </div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; <span class="comment">// create an ID of a pre-defined ID type</span></div> <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; <span class="keywordflow">goto</span> fail_dcpl;</div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; }</div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="comment">// we can reliably predict the ID type</span></div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; assert(<a class="code" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a>(dcpl) == <a class="code" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832bab6161706783d4bca26a889f1ac0cf91a">H5I_GENPROP_LST</a>);</div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; printf(<span class="stringliteral">&quot;%d\n&quot;</span>, <a class="code" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a>(dcpl));</div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; </div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;fail_dcpl:;</div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; }</div> <div class="ttc" id="a_h5_ipublic_8h_html_a0045db7ff9c22ad35db6ae91662e1943"><div class="ttname"><a href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a></div><div class="ttdeci">int64_t hid_t</div><div class="ttdef"><b>Definition:</b> H5Ipublic.h:60</div></div> <div class="ttc" id="a_h5_ipublic_8h_html_a01eab13dccc91afd6909d74dccb780ba"><div class="ttname"><a href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a></div><div class="ttdeci">#define H5I_INVALID_HID</div><div class="ttdef"><b>Definition:</b> H5Ipublic.h:75</div></div> <div class="ttc" id="a_h5_ipublic_8h_html_a13afe14178faf81b89fa2167e7ab832bab6161706783d4bca26a889f1ac0cf91a"><div class="ttname"><a href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832bab6161706783d4bca26a889f1ac0cf91a">H5I_GENPROP_LST</a></div><div class="ttdeci">@ H5I_GENPROP_LST</div><div class="ttdef"><b>Definition:</b> H5Ipublic.h:47</div></div> <div class="ttc" id="a_h5_ppublic_8h_html_a6f9c8a5aba72c0445fff384bf418a80d"><div class="ttname"><a href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a></div><div class="ttdeci">#define H5P_DATASET_XFER</div><div class="ttdef"><b>Definition:</b> H5Ppublic.h:55</div></div> <div class="ttc" id="agroup___h5_i_html_ga4941435d4d64de3d7095d2316f415f2d"><div class="ttname"><a href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a></div><div class="ttdeci">H5I_type_t H5Iget_type(hid_t id)</div><div class="ttdoc">Retrieves the type of an object.</div></div> <div class="ttc" id="agroup___p_l_c_r_html_ga5dce61149211d3ef319452aa598887fb"><div class="ttname"><a href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a></div><div class="ttdeci">herr_t H5Pclose(hid_t plist_id)</div><div class="ttdoc">Terminates access to a property list.</div></div> <div class="ttc" id="agroup___p_l_c_r_html_gaf1b11da01d4d45d788c45f8bc5f0cbfa"><div class="ttname"><a href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a></div><div class="ttdeci">hid_t H5Pcreate(hid_t cls_id)</div><div class="ttdoc">Creates a new property list as an instance of a property list class.</div></div> </div><!-- fragment --> </td><td><div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; {</div> <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; __label__ fail_dcpl;</div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="comment">// create an ID of a pre-defined ID type</span></div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordflow">goto</span> fail_dcpl;</div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; }</div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="comment">// this better be valid</span></div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; assert(<a class="code" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a>(dcpl) &gt; 0);</div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="comment">// this ID is NOT associated with any HDF5 file;</span></div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="comment">// see the error message</span></div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; assert(<a class="code" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">H5Iget_file_id</a>(dcpl) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>);</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;fail_dcpl:;</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; }</div> <div class="ttc" id="agroup___h5_i_html_ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><div class="ttname"><a href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a></div><div class="ttdeci">htri_t H5Iis_valid(hid_t id)</div><div class="ttdoc">Determines whether an identifier is valid.</div></div> <div class="ttc" id="agroup___h5_i_html_ga6ce32e88051e4cdf7d02439d86e5e042"><div class="ttname"><a href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">H5Iget_file_id</a></div><div class="ttdeci">hid_t H5Iget_file_id(hid_t id)</div><div class="ttdoc">Retrieves an identifier for the file containing the specified object.</div></div> </div><!-- fragment --> </td></tr> <tr> <th>Update</th><th>Delete </th></tr> <tr valign="top"> <td><div class="fragment"><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; {</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; __label__ fail_rc, fail_dcpl;</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordtype">int</span> rc;</div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; </div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// create an ID of a pre-defined ID type</span></div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">goto</span> fail_dcpl;</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; }</div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="comment">// retrieve the IDs reference count</span></div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> ((rc = <a class="code" href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">H5Iget_ref</a>(dcpl)) &lt; 0) {</div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">goto</span> fail_rc;</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; printf(<span class="stringliteral">&quot;Reference count: %d\n&quot;</span>, rc);</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// bump its reference count (by 1)</span></div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">if</span> ((rc = <a class="code" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">H5Iinc_ref</a>(dcpl)) &lt; 0) {</div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">goto</span> fail_rc;</div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; }</div> <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; printf(<span class="stringliteral">&quot;Reference count: %d\n&quot;</span>, rc);</div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; </div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;fail_rc:</div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div> <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;fail_dcpl:;</div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; }</div> <div class="ttc" id="agroup___h5_i_html_ga3fd0c157704573965cafd6e1aa7f368f"><div class="ttname"><a href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">H5Iinc_ref</a></div><div class="ttdeci">int H5Iinc_ref(hid_t id)</div><div class="ttdoc">Increments the reference count for an object.</div></div> <div class="ttc" id="agroup___h5_i_html_gac9638ade14cc75b7b125b3723f319c81"><div class="ttname"><a href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">H5Iget_ref</a></div><div class="ttdeci">int H5Iget_ref(hid_t id)</div><div class="ttdoc">Retrieves the reference count for an object.</div></div> </div><!-- fragment --> </td><td><div class="fragment"><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; {</div> <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; __label__ fail_rc, fail_dcpl;</div> <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div> <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordtype">int</span> rc;</div> <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; </div> <div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="comment">// create an ID of a pre-defined ID type</span></div> <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div> <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordflow">goto</span> fail_dcpl;</div> <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; }</div> <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; </div> <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="comment">// decrease its reference count (from 1) to 0</span></div> <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">if</span> ((rc = <a class="code" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">H5Idec_ref</a>(dcpl)) &lt; 0) {</div> <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; ret_val = EXIT_FAILURE;</div> <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">goto</span> fail_rc;</div> <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; }</div> <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; printf(<span class="stringliteral">&quot;Reference count: %d\n&quot;</span>, rc);</div> <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div> <div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// at this point, the ID is no longer valid</span></div> <div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; assert(<a class="code" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a>(dcpl) == 0);</div> <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div> <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="comment">// dropping the ref. count to 0 has the side-effect of closing</span></div> <div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="comment">// the associated item, and calling H5Pclose would create an error</span></div> <div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">goto</span> fail_dcpl;</div> <div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div> <div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;fail_rc:</div> <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div> <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;fail_dcpl:;</div> <div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div> <div class="ttc" id="agroup___h5_i_html_gaea2aa78caea892edf2a6a6ac70486ed9"><div class="ttname"><a href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">H5Idec_ref</a></div><div class="ttdeci">int H5Idec_ref(hid_t id)</div><div class="ttdoc">Decrements the reference count for an object.</div></div> </div><!-- fragment --> </td></tr> </table> <div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for Identifiers (H5I):</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"><img src="group___h5_i.png" border="0" usemap="#agroup______h5__i" alt=""/></div> <map name="agroup______h5__i" id="agroup______h5__i"> <area shape="rect" title=" " alt="" coords="5,5,128,31"/> <area shape="rect" href="group___h5_i_u_d.html" title=" " alt="" coords="176,5,340,31"/> </map> </div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a> Modules</h2></td></tr> <tr class="memitem:group___h5_i_u_d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i_u_d.html">User-defined ID Types</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gad61703cd16f392fb194da648099e69a9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9">H5Iregister_future</a> (<a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a> type, const void *object, <a class="el" href="_h5_idevelop_8h.html#ab0f349ec701c3d8c6ded067f160da44c">H5I_future_realize_func_t</a> realize_cb, <a class="el" href="_h5_idevelop_8h.html#a127fbac3b8283a7804d8470676a65518">H5I_future_discard_func_t</a> discard_cb)</td></tr> <tr class="memdesc:gad61703cd16f392fb194da648099e69a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a "future" object under a type and returns an ID for it. <a href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9">More...</a><br /></td></tr> <tr class="separator:gad61703cd16f392fb194da648099e69a9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga4941435d4d64de3d7095d2316f415f2d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr> <tr class="memdesc:ga4941435d4d64de3d7095d2316f415f2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the type of an object. <a href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">More...</a><br /></td></tr> <tr class="separator:ga4941435d4d64de3d7095d2316f415f2d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga6ce32e88051e4cdf7d02439d86e5e042"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">H5Iget_file_id</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr> <tr class="memdesc:ga6ce32e88051e4cdf7d02439d86e5e042"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves an identifier for the file containing the specified object. <a href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">More...</a><br /></td></tr> <tr class="separator:ga6ce32e88051e4cdf7d02439d86e5e042"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9c84a8dc29566b82b6d1ff7a6e6828f1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#af629ed855824cf5955b54529adf78ad6">ssize_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1">H5Iget_name</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id, char *name, size_t size)</td></tr> <tr class="memdesc:ga9c84a8dc29566b82b6d1ff7a6e6828f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves a name of an object based on the object identifier. <a href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1">More...</a><br /></td></tr> <tr class="separator:ga9c84a8dc29566b82b6d1ff7a6e6828f1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga3fd0c157704573965cafd6e1aa7f368f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">H5Iinc_ref</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr> <tr class="memdesc:ga3fd0c157704573965cafd6e1aa7f368f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the reference count for an object. <a href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">More...</a><br /></td></tr> <tr class="separator:ga3fd0c157704573965cafd6e1aa7f368f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaea2aa78caea892edf2a6a6ac70486ed9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">H5Idec_ref</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr> <tr class="memdesc:gaea2aa78caea892edf2a6a6ac70486ed9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrements the reference count for an object. <a href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">More...</a><br /></td></tr> <tr class="separator:gaea2aa78caea892edf2a6a6ac70486ed9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac9638ade14cc75b7b125b3723f319c81"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">H5Iget_ref</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr> <tr class="memdesc:gac9638ade14cc75b7b125b3723f319c81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the reference count for an object. <a href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">More...</a><br /></td></tr> <tr class="separator:gac9638ade14cc75b7b125b3723f319c81"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#aa8f6c28736dbd0f18388c67911d38aca">htri_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr> <tr class="memdesc:ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines whether an identifier is valid. <a href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">More...</a><br /></td></tr> <tr class="separator:ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Function Documentation</h2> <a id="gaea2aa78caea892edf2a6a6ac70486ed9"></a> <h2 class="memtitle"><span class="permalink"><a href="#gaea2aa78caea892edf2a6a6ac70486ed9">&#9670;&nbsp;</a></span>H5Idec_ref()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int H5Idec_ref </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Decrements the reference count for an object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns a non-negative reference count of the object ID after decrementing it, if successful; otherwise a negative value is returned.</dd></dl> <p><a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9" title="Decrements the reference count for an object.">H5Idec_ref()</a> decrements the reference count of the object identified by <code>id</code>.</p> <p>The reference count for an object ID is attached to the information about an object in memory and has no relation to the number of links to an object on disk.</p> <p>The reference count for a newly created object will be 1. Reference counts for objects may be explicitly modified with this function or with <a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f" title="Increments the reference count for an object.">H5Iinc_ref()</a>. When an object identifier's reference count reaches zero, the object will be closed. Calling an object identifier's <code>close</code> function decrements the reference count for the identifier, which normally closes the object, but if the reference count for the identifier has been incremented with <a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f" title="Increments the reference count for an object.">H5Iinc_ref()</a>, the object will only be closed when the reference count reaches zero with further calls to this function or the object identifier's <code>close</code> function.</p> <p>If the object ID was created by a collective parallel call (such as <a class="el" href="group___h5_d.html#ga0647ba4bbd26d5230cc07f3a5685b2cf">H5Dcreate()</a>, <a class="el" href="group___h5_g.html#ga3eca6807deff4f9e51fc5fe0befc2245">H5Gopen()</a>, etc.), the reference count should be modified by all the processes which have copies of the ID. Generally, this means that group, dataset, attribute, file and named datatype IDs should be modified by all the processes and that all other types of IDs are safe to modify by individual processes.</p> <p>This function is of particular value when an application maintains multiple copies of an object ID. The object ID can be incremented when a copy is made. Each copy of the ID can then be safely closed or decremented and the HDF5 object will be closed when the reference count for that object drops to zero.</p> <dl class="section since"><dt>Since</dt><dd>1.6.2 </dd></dl> </div> </div> <a id="ga6ce32e88051e4cdf7d02439d86e5e042"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga6ce32e88051e4cdf7d02439d86e5e042">&#9670;&nbsp;</a></span>H5Iget_file_id()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> H5Iget_file_id </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Retrieves an identifier for the file containing the specified object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns a file identifier if successful; otherwise returns <a class="el" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>.</dd></dl> <p><a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042" title="Retrieves an identifier for the file containing the specified object.">H5Iget_file_id()</a> returns the identifier of the file associated with the object referenced by <code>id</code>.</p> <dl class="section note"><dt>Note</dt><dd>Note that the HDF5 library permits an application to close a file while objects within the file remain open. If the file containing the object <code>id</code> is still open, <a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042" title="Retrieves an identifier for the file containing the specified object.">H5Iget_file_id()</a> will retrieve the existing file identifier. If there is no existing file identifier for the file, i.e., the file has been closed, <a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042" title="Retrieves an identifier for the file containing the specified object.">H5Iget_file_id()</a> will reopen the file and return a new file identifier. In either case, the file identifier must eventually be released using <a class="el" href="group___h5_f.html#gac55cd91d80822e4f8c2a7f04ea71b124" title="Terminates access to an HDF5 file.">H5Fclose()</a>.</dd></dl> <dl class="section since"><dt>Since</dt><dd>1.6.3 </dd></dl> </div> </div> <a id="ga9c84a8dc29566b82b6d1ff7a6e6828f1"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga9c84a8dc29566b82b6d1ff7a6e6828f1">&#9670;&nbsp;</a></span>H5Iget_name()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="_h5public_8h.html#af629ed855824cf5955b54529adf78ad6">ssize_t</a> H5Iget_name </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char *&#160;</td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t&#160;</td> <td class="paramname"><em>size</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Retrieves a name of an object based on the object identifier. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>A buffer for the name associated with the identifier </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The size of the <code>name</code> buffer; usually the size of the name in bytes plus 1 for a NULL terminator</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>ssize_t</dd></dl> <p><a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> retrieves a name for the object identified by <code>id</code>.</p> <p>Up to size characters of the name are returned in <code>name</code>; additional characters, if any, are not returned to the user application.</p> <p>If the length of the name, which determines the required value of <code>size</code>, is unknown, a preliminary <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> call can be made. The return value of this call will be the size in bytes of the object name. That value, plus 1 for a NULL terminator, is then assigned to size for a second <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> call, which will retrieve the actual name.</p> <p>If the object identified by <code>id</code> is an attribute, as determined via <a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d" title="Retrieves the type of an object.">H5Iget_type()</a>, <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> retrieves the name of the object to which that attribute is attached. To retrieve the name of the attribute itself, use <a class="el" href="group___h5_a.html#ga05e195aabab8c623b1c52009aeb99674" title="Gets an attribute name.">H5Aget_name()</a>.</p> <p>If there is no name associated with the object identifier or if the name is NULL, <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> returns 0 (zero).</p> <dl class="section note"><dt>Note</dt><dd>Note that an object in an HDF5 file may have multiple paths if there are multiple links pointing to it. This function may return any one of these paths. When possible, <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> returns the path with which the object was opened.</dd></dl> <dl class="section since"><dt>Since</dt><dd>1.6.0 </dd></dl> </div> </div> <a id="gac9638ade14cc75b7b125b3723f319c81"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac9638ade14cc75b7b125b3723f319c81">&#9670;&nbsp;</a></span>H5Iget_ref()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int H5Iget_ref </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Retrieves the reference count for an object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns a non-negative current reference count of the object identifier if successful; otherwise a negative value is returned.</dd></dl> <p><a class="el" href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81" title="Retrieves the reference count for an object.">H5Iget_ref()</a> retrieves the reference count of the object identified by <code>id</code>.</p> <p>The reference count for an object identifier is attached to the information about an object in memory and has no relation to the number of links to an object on disk.</p> <p>The function <a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a> is used to determine whether a specific object identifier is valid.</p> <dl class="section since"><dt>Since</dt><dd>1.6.2 </dd></dl> </div> </div> <a id="ga4941435d4d64de3d7095d2316f415f2d"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga4941435d4d64de3d7095d2316f415f2d">&#9670;&nbsp;</a></span>H5Iget_type()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a> H5Iget_type </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Retrieves the type of an object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns the object type if successful; otherwise <a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832ba3e61c9654de6398dc9676ad37cbe6133">H5I_BADID</a>.</dd></dl> <p><a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d" title="Retrieves the type of an object.">H5Iget_type()</a> retrieves the type of the object identified by <code>id</code>. If no valid type can be determined or the identifier submitted is invalid, the function returns <a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832ba3e61c9654de6398dc9676ad37cbe6133">H5I_BADID</a>.</p> <p>This function is of particular use in determining the type of object closing function (<a class="el" href="group___h5_d.html#gae47c3f38db49db127faf221624c30609" title="Closes the specified dataset.">H5Dclose()</a>, <a class="el" href="group___h5_g.html#ga8dbe20b390d2504f0bd3589ed8f4e221" title="Closes the specified group.">H5Gclose()</a>, etc.) to call after a call to <a class="el" href="group___h5_r.html#ga5dc19b9d1833af66c5e1f819f2c05c4a">H5Rdereference()</a>.</p> <dl class="section note"><dt>Note</dt><dd>Note that this function returns only the type of object that <code>id</code> would identify if it were valid; it does not determine whether <code>id</code> is valid identifier. Validity can be determined with a call to <a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a>. </dd></dl> </div> </div> <a id="ga3fd0c157704573965cafd6e1aa7f368f"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga3fd0c157704573965cafd6e1aa7f368f">&#9670;&nbsp;</a></span>H5Iinc_ref()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int H5Iinc_ref </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Increments the reference count for an object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns a non-negative reference count of the object ID after incrementing it if successful; otherwise a negative value is returned.</dd></dl> <p><a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f" title="Increments the reference count for an object.">H5Iinc_ref()</a> increments the reference count of the object identified by <code>id</code>.</p> <p>The reference count for an object ID is attached to the information about an object in memory and has no relation to the number of links to an object on disk.</p> <p>The reference count for a newly created object will be 1. Reference counts for objects may be explicitly modified with this function or with <a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9" title="Decrements the reference count for an object.">H5Idec_ref()</a>. When an object ID's reference count reaches zero, the object will be closed. Calling an object ID's <code>close</code> function decrements the reference count for the ID which normally closes the object, but if the reference count for the ID has been incremented with this function, the object will only be closed when the reference count reaches zero with further calls to <a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9" title="Decrements the reference count for an object.">H5Idec_ref()</a> or the object ID's <code>close</code> function.</p> <p>If the object ID was created by a collective parallel call (such as <a class="el" href="group___h5_d.html#ga0647ba4bbd26d5230cc07f3a5685b2cf">H5Dcreate()</a>, <a class="el" href="group___h5_g.html#ga3eca6807deff4f9e51fc5fe0befc2245">H5Gopen()</a>, etc.), the reference count should be modified by all the processes which have copies of the ID. Generally this means that group, dataset, attribute, file and named datatype IDs should be modified by all the processes and that all other types of IDs are safe to modify by individual processes.</p> <p>This function is of particular value when an application is maintaining multiple copies of an object ID. The object ID can be incremented when a copy is made. Each copy of the ID can then be safely closed or decremented and the HDF5 object will be closed when the reference count for that that object drops to zero.</p> <dl class="section since"><dt>Since</dt><dd>1.6.2 </dd></dl> </div> </div> <a id="ga20eb10c559d9ed5ba6f77b31d6a3ba9a"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">&#9670;&nbsp;</a></span>H5Iis_valid()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="_h5public_8h.html#aa8f6c28736dbd0f18388c67911d38aca">htri_t</a> H5Iis_valid </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td> <td class="paramname"><em>id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Determines whether an identifier is valid. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns zero (false), a positive (true) or a negative (failure) value.</dd></dl> <p><a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a> determines whether the identifier <code>id</code> is valid.</p> <p>Valid identifiers are those that have been obtained by an application and can still be used to access the original target. Examples of invalid identifiers include: </p><ul> <li>Out-of-range values: negative, for example </li> <li>Previously-valid identifiers that have been released: for example, a dataset identifier for which the dataset has been closed</li> </ul> <p><a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a> can be used with any type of identifier: object identifier, property list identifier, attribute identifier, error message identifier, etc. When necessary, a call to <a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d" title="Retrieves the type of an object.">H5Iget_type()</a> can determine the type of object that the <code>id</code> identifies.</p> <dl class="section since"><dt>Since</dt><dd>1.8.3 </dd></dl> </div> </div> <a id="gad61703cd16f392fb194da648099e69a9"></a> <h2 class="memtitle"><span class="permalink"><a href="#gad61703cd16f392fb194da648099e69a9">&#9670;&nbsp;</a></span>H5Iregister_future()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> H5Iregister_future </td> <td>(</td> <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a>&#160;</td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const void *&#160;</td> <td class="paramname"><em>object</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="_h5_idevelop_8h.html#ab0f349ec701c3d8c6ded067f160da44c">H5I_future_realize_func_t</a>&#160;</td> <td class="paramname"><em>realize_cb</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="_h5_idevelop_8h.html#a127fbac3b8283a7804d8470676a65518">H5I_future_discard_func_t</a>&#160;</td> <td class="paramname"><em>discard_cb</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Registers a "future" object under a type and returns an ID for it. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>The identifier of the type of the new ID </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">object</td><td>Pointer to "future" object for which a new ID is created </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">realize_cb</td><td>Function pointer to realize a future object </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">discard_cb</td><td>Function pointer to destroy a future object</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Returns a object identifier if successful; otherwise returns <a class="el" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>.</dd></dl> <p><a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a &quot;future&quot; object under a type and returns an ID for it.">H5Iregister_future()</a> creates and returns a new ID for a "future" object. Future objects are a special kind of object and represent a placeholder for an object that has not yet been created or opened. The <code>realize_cb</code> will be invoked by the HDF5 library to 'realize' the future object as an actual object. A call to <a class="el" href="group___h5_i_u_d.html#gaafb1c684673762bc83546e1216fa6b10" title="Returns the object referenced by an ID.">H5Iobject_verify()</a> will invoke the <code>realize_cb</code> callback and if it successfully returns, will return the actual object, not the future object.</p> <p>The <code>type</code> parameter is the identifier for the ID type to which this new future ID will belong. This identifier may have been created by a call to <a class="el" href="group___h5_i_u_d.html#gae10d4baa1335b2d1f1aecffb305e1613" title="Creates and returns a new ID type.">H5Iregister_type()</a> or may be one of the HDF5 pre-defined ID classes (e.g. H5I_FILE, H5I_GROUP, H5I_DATASPACE, etc).</p> <p>The <code>object</code> parameter is a pointer to the memory which the new ID will be a reference to. This pointer will be stored by the library, but will not be returned to a call to <a class="el" href="group___h5_i_u_d.html#gaafb1c684673762bc83546e1216fa6b10" title="Returns the object referenced by an ID.">H5Iobject_verify()</a> until the <code>realize_cb</code> callback has returned the actual pointer for the object.</p> <p>A NULL value for <code>object</code> is allowed.</p> <p>The <code>realize_cb</code> parameter is a function pointer that will be invoked by the HDF5 library to convert a future object into an actual object. The <code>realize_cb</code> function may be invoked by <a class="el" href="group___h5_i_u_d.html#gaafb1c684673762bc83546e1216fa6b10" title="Returns the object referenced by an ID.">H5Iobject_verify()</a> to return the actual object for a user-defined ID class (i.e. an ID class registered with <a class="el" href="group___h5_i_u_d.html#gae10d4baa1335b2d1f1aecffb305e1613" title="Creates and returns a new ID type.">H5Iregister_type()</a>) or internally by the HDF5 library in order to use or get information from an HDF5 pre-defined ID type. For example, the <code>realize_cb</code> for a future dataspace object will be called during the process of returning information from <a class="el" href="group___h5_s.html#gac494409b615d8e67c5edd9eb2848b2f3" title="Retrieves dataspace dimension size and maximum size.">H5Sget_simple_extent_dims()</a>.</p> <p>Note that although the <code>realize_cb</code> routine returns an ID (as a parameter) for the actual object, the HDF5 library will swap the actual object in that ID for the future object in the future ID. This ensures that the ID value for the object doesn't change for the user when the object is realized.</p> <p>Note that the <code>realize_cb</code> callback could receive a NULL value for a future object pointer, if one was used when <a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a &quot;future&quot; object under a type and returns an ID for it.">H5Iregister_future()</a> was initially called. This is permitted as a means of allowing the <code>realize_cb</code> to act as a generator of new objects, without requiring creation of unnecessary future objects.</p> <p>It is an error to pass NULL for <code>realize_cb</code>.</p> <p>The <code>discard_cb</code> parameter is a function pointer that will be invoked by the HDF5 library to destroy a future object. This callback will always be invoked for <em>every</em> future object, whether the <code>realize_cb</code> is invoked on it or not. It's possible that the <code>discard_cb</code> is invoked on a future object without the <code>realize_cb</code> being invoked, e.g. when a future ID is closed without requiring the future object to be realized into an actual one.</p> <p>Note that the <code>discard_cb</code> callback could receive a NULL value for a future object pointer, if one was used when <a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a &quot;future&quot; object under a type and returns an ID for it.">H5Iregister_future()</a> was initially called.</p> <p>It is an error to pass NULL for <code>discard_cb</code>.</p> <dl class="section note"><dt>Note</dt><dd>The <a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a &quot;future&quot; object under a type and returns an ID for it.">H5Iregister_future()</a> function is primarily targeted at VOL connector authors and is <em>not</em> designed for general-purpose application use. </dd></dl> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li> </ul> </div> </body> </html>