Skip to content

Commit cc64452

Browse files
authored
Merge pull request #148 from HDFGroup/hdf5-1.10.3
HDF.PInvoke 1.10.3
2 parents 90b1c76 + fae9be0 commit cc64452

File tree

20 files changed

+335
-281
lines changed

20 files changed

+335
-281
lines changed

HDF5/H5Dpublic.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using htri_t = System.Int32;
2525
using size_t = System.IntPtr;
2626
using ssize_t = System.IntPtr;
27+
using uint32_t = System.UInt32;
2728

2829
#if HDF5_VER1_10
2930
using hid_t = System.Int64;
@@ -599,6 +600,27 @@ public static extern herr_t read
599600

600601
#if HDF5_VER1_10
601602

603+
/// <summary>
604+
/// Reads a raw data chunk directly from a dataset in a file into a buffer.
605+
/// See https://support.hdfgroup.org/HDF5/doc/HL/RM_HDF5Optimized.html#H5DOread_chunk
606+
/// </summary>
607+
/// <param name="dset_id">Identifier for the dataset to be read</param>
608+
/// <param name="dxpl_id">Transfer property list identifier for this
609+
/// I/O operation</param>
610+
/// <param name="filter_mask">Mask for identifying the filters used
611+
/// with the chunk</param>
612+
/// <param name="offset">Logical position of the chunk’s first element
613+
/// in the dataspace</param>
614+
/// <param name="buf">Buffer containing the chunk read from the dataset</param>
615+
/// <returns>Returns a non-negative value if successful; otherwise
616+
/// returns a negative value.</returns>
617+
[DllImport(Constants.HLDLLFileName, EntryPoint = "H5Dread_chunk",
618+
CallingConvention = CallingConvention.Cdecl),
619+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
620+
public static extern herr_t read_chunk
621+
(hid_t dset_id, hid_t dxpl_id, ref hsize_t offset,
622+
ref uint32_t filter_mask, IntPtr buf);
623+
602624
/// <summary>
603625
/// Refreshes all buffers associated with a dataset.
604626
/// See https://www.hdfgroup.org/HDF5/docNewFeatures/FineTuneMDC/H5Drefresh.htm
@@ -720,5 +742,30 @@ public static extern herr_t vlen_reclaim
720742
public static extern herr_t write
721743
(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
722744
hid_t file_space_id, hid_t plist_id, IntPtr buf);
745+
746+
#if HDF5_VER1_10
747+
748+
/// <summary>
749+
/// Writes a raw data chunk from a buffer directly to a dataset.
750+
/// See https://www.hdfgroup.org/HDF5/doc/HL/RM_HDF5Optimized.html
751+
/// </summary>
752+
/// <param name="dset_id">Identifier for the dataset to write to</param>
753+
/// <param name="dxpl_id">UNUSED</param>
754+
/// <param name="filter_mask">Mask for identifying the filters in use</param>
755+
/// <param name="offset">Logical position of the chunk’s first element
756+
/// in the dataspace</param>
757+
/// <param name="data_size">Size of the actual data to be written in
758+
/// bytes</param>
759+
/// <param name="buf">Buffer containing data to be written to the file</param>
760+
/// <returns>Returns a non-negative value if successful; otherwise
761+
/// returns a negative value.</returns>
762+
[DllImport(Constants.HLDLLFileName, EntryPoint = "H5Dwrite_chunk",
763+
CallingConvention = CallingConvention.Cdecl),
764+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
765+
public static extern herr_t write_chunk
766+
(hid_t dset_id, hid_t dxpl_id, uint32_t filter_mask,
767+
ref hsize_t offset, size_t data_size, IntPtr buf);
768+
769+
#endif
723770
}
724771
}

HDF5/H5Opublic.cs

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,114 @@ public extern static ssize_t get_comment_by_name
587587
(hid_t loc_id, string name, [In][Out]StringBuilder comment, size_t size,
588588
hid_t lapl_id = H5P.DEFAULT);
589589

590+
#if HDF5_VER1_10
591+
592+
/// <summary>
593+
/// Retrieves the metadata for an object specified by an identifier.
594+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
595+
/// </summary>
596+
/// <param name="loc_id">Identifier for object of type specified by
597+
/// <code>H5O.type_t</code></param>
598+
/// <param name="oinfo">Buffer in which to return object information</param>
599+
/// <returns>Returns a non-negative value if successful; otherwise
600+
/// returns a negative value.</returns>
601+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Oget_info1",
602+
CallingConvention = CallingConvention.Cdecl),
603+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
604+
public extern static herr_t get_info(hid_t loc_id, ref info_t oinfo);
605+
606+
/// <summary>
607+
/// Retrieves the metadata for an object, identifying the object by an
608+
/// index position.
609+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfoByIdx
610+
/// </summary>
611+
/// <param name="loc_id">File or group identifier specifying location
612+
/// of group in which object is located</param>
613+
/// <param name="group_name">Name of group in which object is located</param>
614+
/// <param name="idx_type">Index or field that determines the order</param>
615+
/// <param name="order">Order within field or index</param>
616+
/// <param name="n">Object for which information is to be returned</param>
617+
/// <param name="oinfo">Buffer in which to return object information</param>
618+
/// <param name="lapl_id">Link access property list</param>
619+
/// <returns>Returns a non-negative value if successful; otherwise
620+
/// returns a negative value.</returns>
621+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Oget_info_by_idx1",
622+
CallingConvention = CallingConvention.Cdecl),
623+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
624+
public extern static herr_t get_info_by_idx
625+
(hid_t loc_id, byte[] group_name, H5.index_t idx_type,
626+
H5.iter_order_t order, hsize_t n, ref info_t oinfo,
627+
hid_t lapl_id = H5P.DEFAULT);
628+
629+
/// <summary>
630+
/// Retrieves the metadata for an object, identifying the object by an
631+
/// index position.
632+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfoByIdx
633+
/// </summary>
634+
/// <param name="loc_id">File or group identifier specifying location
635+
/// of group in which object is located</param>
636+
/// <param name="group_name">Name of group in which object is located</param>
637+
/// <param name="idx_type">Index or field that determines the order</param>
638+
/// <param name="order">Order within field or index</param>
639+
/// <param name="n">Object for which information is to be returned</param>
640+
/// <param name="oinfo">Buffer in which to return object information</param>
641+
/// <param name="lapl_id">Link access property list</param>
642+
/// <returns>Returns a non-negative value if successful; otherwise
643+
/// returns a negative value.</returns>
644+
/// <remarks>ASCII strings ONLY!</remarks>
645+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Oget_info_by_idx1",
646+
CallingConvention = CallingConvention.Cdecl,
647+
CharSet = CharSet.Ansi),
648+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
649+
public extern static herr_t get_info_by_idx
650+
(hid_t loc_id, string group_name, H5.index_t idx_type,
651+
H5.iter_order_t order, hsize_t n, ref info_t oinfo,
652+
hid_t lapl_id = H5P.DEFAULT);
653+
654+
/// <summary>
655+
/// Retrieves the metadata for an object, identifying the object by
656+
/// location and relative name.
657+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfoByName
658+
/// </summary>
659+
/// <param name="loc_id">File or group identifier specifying location
660+
/// of group in which object is located</param>
661+
/// <param name="name">Name of object, relative to
662+
/// <paramref name="loc_id"/></param>
663+
/// <param name="oinfo">Buffer in which to return object information</param>
664+
/// <param name="lapl_id">Link access property list</param>
665+
/// <returns>Returns a non-negative value if successful; otherwise
666+
/// returns a negative value.</returns>
667+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Oget_info_by_name1",
668+
CallingConvention = CallingConvention.Cdecl),
669+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
670+
public extern static herr_t get_info_by_name
671+
(hid_t loc_id, byte[] name, ref info_t oinfo,
672+
hid_t lapl_id = H5P.DEFAULT);
673+
674+
/// <summary>
675+
/// Retrieves the metadata for an object, identifying the object by
676+
/// location and relative name.
677+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfoByName
678+
/// </summary>
679+
/// <param name="loc_id">File or group identifier specifying location
680+
/// of group in which object is located</param>
681+
/// <param name="name">Name of group, relative to
682+
/// <paramref name="loc_id"/></param>
683+
/// <param name="oinfo">Buffer in which to return object information</param>
684+
/// <param name="lapl_id">Link access property list</param>
685+
/// <returns>Returns a non-negative value if successful; otherwise
686+
/// returns a negative value.</returns>
687+
/// <remarks>ASCII strings ONLY!</remarks>
688+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Oget_info_by_name1",
689+
CallingConvention = CallingConvention.Cdecl,
690+
CharSet = CharSet.Ansi),
691+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
692+
public extern static herr_t get_info_by_name
693+
(hid_t loc_id, string name, ref info_t oinfo,
694+
hid_t lapl_id = H5P.DEFAULT);
695+
696+
#else
697+
590698
/// <summary>
591699
/// Retrieves the metadata for an object specified by an identifier.
592700
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
@@ -691,6 +799,8 @@ public extern static herr_t get_info_by_name
691799
(hid_t loc_id, string name, ref info_t oinfo,
692800
hid_t lapl_id = H5P.DEFAULT);
693801

802+
#endif
803+
694804
/// <summary>
695805
/// Increments an object's reference count.
696806
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-IncrRefCount
@@ -858,6 +968,89 @@ public extern static hid_t open_by_idx
858968
(hid_t loc_id, string group_name, H5.index_t idx_type,
859969
H5.iter_order_t order, hsize_t n, hid_t lapl_id = H5P.DEFAULT);
860970

971+
#if HDF5_VER1_10
972+
973+
/// <summary>
974+
/// Recursively visits all objects accessible from a specified object.
975+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-Visit
976+
/// </summary>
977+
/// <param name="obj_id">Identifier of the object at which the
978+
/// recursive iteration begins.</param>
979+
/// <param name="idx_type">Type of index</param>
980+
/// <param name="order">Order in which index is traversed</param>
981+
/// <param name="op">Callback function passing data regarding the
982+
/// object to the calling application</param>
983+
/// <param name="op_data">User-defined pointer to data required by the
984+
/// application for its processing of the object</param>
985+
/// <returns>On success, returns the return value of the first operator
986+
/// that returns a positive value, or zero if all members were
987+
/// processed with no operator returning non-zero. On failure, returns
988+
/// a negative value if something goes wrong within the library, or the
989+
/// first negative value returned by an operator.</returns>
990+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Ovisit1",
991+
CallingConvention = CallingConvention.Cdecl),
992+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
993+
public extern static herr_t visit
994+
(hid_t obj_id, H5.index_t idx_type, H5.iter_order_t order,
995+
iterate_t op, IntPtr op_data);
996+
997+
/// <summary>
998+
/// Recursively visits all objects starting from a specified object.
999+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-VisitByName
1000+
/// </summary>
1001+
/// <param name="loc_id">Identifier of a file or group</param>
1002+
/// <param name="obj_name">Name of the object, generally relative to
1003+
/// <paramref name="loc_id"/>, that will serve as root of the iteration</param>
1004+
/// <param name="idx_type">Type of index</param>
1005+
/// <param name="order">Order in which index is traversed</param>
1006+
/// <param name="op">Callback function passing data regarding the
1007+
/// object to the calling application</param>
1008+
/// <param name="op_data">User-defined pointer to data required by the
1009+
/// application for its processing of the object</param>
1010+
/// <param name="lapl_id">Link access property list identifier</param>
1011+
/// <returns>On success, returns the return value of the first operator
1012+
/// that returns a positive value, or zero if all members were
1013+
/// processed with no operator returning non-zero. On failure, returns
1014+
/// a negative value if something goes wrong within the library, or the
1015+
/// first negative value returned by an operator.</returns>
1016+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Ovisit_by_name1",
1017+
CallingConvention = CallingConvention.Cdecl),
1018+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
1019+
public extern static herr_t visit_by_name
1020+
(hid_t loc_id, byte[] obj_name, H5.index_t idx_type,
1021+
H5.iter_order_t order, iterate_t op, IntPtr op_data,
1022+
hid_t lapl_id = H5P.DEFAULT);
1023+
1024+
/// <summary>
1025+
/// Recursively visits all objects starting from a specified object.
1026+
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-VisitByName
1027+
/// </summary>
1028+
/// <param name="loc_id">Identifier of a file or group</param>
1029+
/// <param name="obj_name">Name of the object, generally relative to
1030+
/// <paramref name="loc_id"/>, that will serve as root of the iteration</param>
1031+
/// <param name="idx_type">Type of index</param>
1032+
/// <param name="order">Order in which index is traversed</param>
1033+
/// <param name="op">Callback function passing data regarding the
1034+
/// object to the calling application</param>
1035+
/// <param name="op_data">User-defined pointer to data required by the
1036+
/// application for its processing of the object</param>
1037+
/// <param name="lapl_id">Link access property list identifier</param>
1038+
/// <returns>On success, returns the return value of the first operator
1039+
/// that returns a positive value, or zero if all members were
1040+
/// processed with no operator returning non-zero. On failure, returns
1041+
/// a negative value if something goes wrong within the library, or the
1042+
/// first negative value returned by an operator.</returns>
1043+
[DllImport(Constants.DLLFileName, EntryPoint = "H5Ovisit_by_name1",
1044+
CallingConvention = CallingConvention.Cdecl,
1045+
CharSet = CharSet.Ansi),
1046+
SuppressUnmanagedCodeSecurity, SecuritySafeCritical]
1047+
public extern static herr_t visit_by_name
1048+
(hid_t loc_id, string obj_name, H5.index_t idx_type,
1049+
H5.iter_order_t order, iterate_t op, IntPtr op_data,
1050+
hid_t lapl_id = H5P.DEFAULT);
1051+
1052+
#else
1053+
8611054
/// <summary>
8621055
/// Recursively visits all objects accessible from a specified object.
8631056
/// See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-Visit
@@ -936,5 +1129,8 @@ public extern static herr_t visit_by_name
9361129
(hid_t loc_id, string obj_name, H5.index_t idx_type,
9371130
H5.iter_order_t order, iterate_t op, IntPtr op_data,
9381131
hid_t lapl_id = H5P.DEFAULT);
1132+
1133+
#endif
1134+
9391135
}
9401136
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ of .NET bindings for HDF5, not the [LCM](https://en.wikipedia.org/wiki/Least_com
1616
| HDF5 Release Version | Assembly Version | Assembly File Version | Git Tag |
1717
| ---------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------- | ------- |
1818
| [1.8.20](https://portal.hdfgroup.org/display/support/Downloads) | 1.8.20.0 | [1.8.20.0](https://www.nuget.org/packages/HDF.PInvoke/1.8.20.0) | v1.8.20.0 |
19-
| [1.10.2](https://portal.hdfgroup.org/display/support/Downloads) | 1.10.2.0 | [1.10.2.0](https://www.nuget.org/packages/HDF.PInvoke/1.10.2.0) | v1.10.2.0 |
19+
| [1.10.3](https://portal.hdfgroup.org/display/support/Downloads) | 1.10.3.0 | [1.10.3.0](https://www.nuget.org/packages/HDF.PInvoke/1.10.3.0) | v1.10.3.0 |
2020

2121
[How "stuff" is versioned.](../../wiki/Versioning-and-Releases)
2222

@@ -30,7 +30,7 @@ To install the latest HDF.PInvoke 1.8, run the following command in the
3030
To install the latest HDF.PInvoke 1.10, run the following command in the
3131
[Package Manager Console](https://docs.nuget.org/docs/start-here/using-the-package-manager-console)
3232
```
33-
Install-Package HDF.PInvoke -Version 1.10.2.0
33+
Install-Package HDF.PInvoke -Version 1.10.3.0
3434
```
3535

3636
# Prerequisites

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
##### 1.10.3.0
2+
* Updated native dependencies (HDF5 1.10.3)
3+
* API versioning for H5O[get_info*,visit*]
4+
* Moved H5DO[read,write]_chunk to H5D[read,write]_chunk
5+
* General performance improvements (native library)
6+
17
##### 1.10.2.0
28
* Updated native dependencies (HDF5 1.10.2)
39
* VDS H5P.[g,s]et_virtual_prefix

images/The HDF Group.jpg

334 Bytes
Loading

images/hdf.png

-2.08 KB
Loading

0 commit comments

Comments
 (0)