Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content Layer
id1195548671
Content Column
width50.00001%
id1195578110
classrm_pagetree_col mobile-hide
Content Block
id1195578111
 
Content Column
width50.00001%
id1195548673
classhdf-rm-main-column
Content Block
id1195548672

Include Content
render-without-blockstrue
page.rm-navbar
HTML Wrap
classhdf-print-only

Page Title

HTML Wrap
classhdf-rm-summary-block

Hdf rm anchor
AnchorNamesummary

Excerpt

Determines whether the version of the library being used is less than or equal to the specified version

HTML Wrap
classhdf-rm-content-block

Hdf rm anchor
AnchorNameprocedure

Procedure:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf_procedure

H5_VERSION_LE(maj, min, rel)

Hdf rm anchor
AnchorNamesignature

Signature:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf-togglebox hdf-c

HTML Add Class
hdf-togglebutton-visible
hdf-togglebutton-visible
selector.hdf-togglebutton.hdf-c

HTML
<pre><code class="language-c">H5_VERSION_LE
(
    int maj,
    int min,
    int rel
)</code></pre>

Hdf rm anchor
AnchorNameparameters

Parameters:
HTML Wrap
classhdf-rm-section
int maj    IN: Major version number
A non-negative integer value
int minIN: Minor version number
A non-negative integer value
int relIN: Release number
A non-negative integer value

Hdf rm anchor
AnchorNamedescription

Description:
HTML Wrap
classhdf-rm-section

The H5_VERSION_GE and H5_VERSION_LE macros are used at compile time to conditionally include or exclude code based on the version of the HDF5 library against which an application will be linked.

The H5_VERSION_LE macro compares the version of the HDF5 library being used against the version number specified in the parameters.

For more information about release versioning, see HDF5 Library Release Version Numbers.

Hdf rm anchor
AnchorNamereturns

Returns:
If

A value of 1 is returned  if the library version is less than or equal to the version number specified

If

.

A value of 0 is returned if the library version is greater than the version number specified.

 A A library version is less than the specified version number if its major version is smaller than the specified major version number. If the major version numbers are the same, it is less than the specified version number if its minor version is smaller than the specified minor version number. If the minor version numbers are the same, then a library version would be less than the specified version number if its release number is smaller than the specified release number.

HTML Wrap
classhdf-rm-section
TRUEFALSE    

Hdf rm anchor
AnchorNameexample

Example:
HTML Wrap
classhdf-rm-section
Suppose an application wants to call different functions based on the version of the HDF5 library to which an application will be linked. For example, the link functions, H5Lxxx, are new in the 1.8 versions of HDF5, and some group functions, H5Gxxx, are deprecated in the 1.8 versions. The following code uses H5Gunlink if the library version is 1.6.10 or earlier or uses H5Ldelete if the library version is not 1.6.10 or earlier. Similarly, the code calls H5Gopen or H5Lexists to make sure the group has been deleted.

 

    #if H5_VERSION_LE(1,6,10)
        ret = H5Gunlink(file, "Group");
        CHECK(ret, FAIL, "H5Gunlink");

        H5E_BEGIN_TRY {
            grp = H5Gopen(file, "Group");
        } H5E_END_TRY;
        VERIFY(grp, FAIL, "H5Gopen");
    #else
        ret = H5Ldelete(file, "Group", H5P_DEFAULT);
        CHECK(ret, FAIL, "H5Lunlink");

        status = H5Lexists(file, "Group", H5P_DEFAULT);
        VERIFY(status, FALSE, "H5Lexists");
    #endif      
Comment
HTML Wrap
classhdf-togglebox hdf-c

Bitbucket Server file
repoSlughdf5
branchIdrefs/heads/1.10/master
projectKeyHDFFV
filepathexamples/h5_subset.c
showLineNumberstrue
lineStart32
progLangcpp
lineEnd42
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

Hdf rm anchor
AnchorNamehistory

History:
HTML Wrap
classhdf-rm-section
Release    Change
1.8.7C macro introduced in this release.