H5LTpublic.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. * Copyright by The HDF Group. *
  3. * Copyright by the Board of Trustees of the University of Illinois. *
  4. * All rights reserved. *
  5. * *
  6. * This file is part of HDF5. The full HDF5 copyright notice, including *
  7. * terms governing use, modification, and redistribution, is contained in *
  8. * the COPYING file, which can be found at the root of the source code *
  9. * distribution tree, or in https://www.hdfgroup.org/licenses. *
  10. * If you do not have access to either file, you may request a copy from *
  11. * help@hdfgroup.org. *
  12. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  13. #ifndef H5LTpublic_H
  14. #define H5LTpublic_H
  15. /* Flag definitions for H5LTopen_file_image() */
  16. #define H5LT_FILE_IMAGE_OPEN_RW 0x0001 /* Open image for read-write */
  17. #define H5LT_FILE_IMAGE_DONT_COPY 0x0002 /* The HDF5 lib won't copy */
  18. /* user supplied image buffer. The same image is open with the core driver. */
  19. #define H5LT_FILE_IMAGE_DONT_RELEASE 0x0004 /* The HDF5 lib won't */
  20. /* deallocate user supplied image buffer. The user application is responsible */
  21. /* for doing so. */
  22. #define H5LT_FILE_IMAGE_ALL 0x0007
  23. typedef enum H5LT_lang_t {
  24. H5LT_LANG_ERR = -1, /*this is the first*/
  25. H5LT_DDL = 0, /*for DDL*/
  26. H5LT_C = 1, /*for C*/
  27. H5LT_FORTRAN = 2, /*for Fortran*/
  28. H5LT_NO_LANG = 3 /*this is the last*/
  29. } H5LT_lang_t;
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /*-------------------------------------------------------------------------
  34. *
  35. * Make dataset functions
  36. *
  37. *-------------------------------------------------------------------------
  38. */
  39. H5_HLDLL herr_t H5LTmake_dataset(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  40. hid_t type_id, const void *buffer);
  41. H5_HLDLL herr_t H5LTmake_dataset_char(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  42. const char *buffer);
  43. H5_HLDLL herr_t H5LTmake_dataset_short(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  44. const short *buffer);
  45. H5_HLDLL herr_t H5LTmake_dataset_int(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  46. const int *buffer);
  47. H5_HLDLL herr_t H5LTmake_dataset_long(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  48. const long *buffer);
  49. H5_HLDLL herr_t H5LTmake_dataset_float(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  50. const float *buffer);
  51. H5_HLDLL herr_t H5LTmake_dataset_double(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims,
  52. const double *buffer);
  53. H5_HLDLL herr_t H5LTmake_dataset_string(hid_t loc_id, const char *dset_name, const char *buf);
  54. /*-------------------------------------------------------------------------
  55. *
  56. * Read dataset functions
  57. *
  58. *-------------------------------------------------------------------------
  59. */
  60. H5_HLDLL herr_t H5LTread_dataset(hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer);
  61. H5_HLDLL herr_t H5LTread_dataset_char(hid_t loc_id, const char *dset_name, char *buffer);
  62. H5_HLDLL herr_t H5LTread_dataset_short(hid_t loc_id, const char *dset_name, short *buffer);
  63. H5_HLDLL herr_t H5LTread_dataset_int(hid_t loc_id, const char *dset_name, int *buffer);
  64. H5_HLDLL herr_t H5LTread_dataset_long(hid_t loc_id, const char *dset_name, long *buffer);
  65. H5_HLDLL herr_t H5LTread_dataset_float(hid_t loc_id, const char *dset_name, float *buffer);
  66. H5_HLDLL herr_t H5LTread_dataset_double(hid_t loc_id, const char *dset_name, double *buffer);
  67. H5_HLDLL herr_t H5LTread_dataset_string(hid_t loc_id, const char *dset_name, char *buf);
  68. /*-------------------------------------------------------------------------
  69. *
  70. * Query dataset functions
  71. *
  72. *-------------------------------------------------------------------------
  73. */
  74. H5_HLDLL herr_t H5LTget_dataset_ndims(hid_t loc_id, const char *dset_name, int *rank);
  75. H5_HLDLL herr_t H5LTget_dataset_info(hid_t loc_id, const char *dset_name, hsize_t *dims,
  76. H5T_class_t *type_class, size_t *type_size);
  77. H5_HLDLL herr_t H5LTfind_dataset(hid_t loc_id, const char *name);
  78. /*-------------------------------------------------------------------------
  79. *
  80. * Set attribute functions
  81. *
  82. *-------------------------------------------------------------------------
  83. */
  84. H5_HLDLL herr_t H5LTset_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_name,
  85. const char *attr_data);
  86. H5_HLDLL herr_t H5LTset_attribute_char(hid_t loc_id, const char *obj_name, const char *attr_name,
  87. const char *buffer, size_t size);
  88. H5_HLDLL herr_t H5LTset_attribute_uchar(hid_t loc_id, const char *obj_name, const char *attr_name,
  89. const unsigned char *buffer, size_t size);
  90. H5_HLDLL herr_t H5LTset_attribute_short(hid_t loc_id, const char *obj_name, const char *attr_name,
  91. const short *buffer, size_t size);
  92. H5_HLDLL herr_t H5LTset_attribute_ushort(hid_t loc_id, const char *obj_name, const char *attr_name,
  93. const unsigned short *buffer, size_t size);
  94. H5_HLDLL herr_t H5LTset_attribute_int(hid_t loc_id, const char *obj_name, const char *attr_name,
  95. const int *buffer, size_t size);
  96. H5_HLDLL herr_t H5LTset_attribute_uint(hid_t loc_id, const char *obj_name, const char *attr_name,
  97. const unsigned int *buffer, size_t size);
  98. H5_HLDLL herr_t H5LTset_attribute_long(hid_t loc_id, const char *obj_name, const char *attr_name,
  99. const long *buffer, size_t size);
  100. H5_HLDLL herr_t H5LTset_attribute_long_long(hid_t loc_id, const char *obj_name, const char *attr_name,
  101. const long long *buffer, size_t size);
  102. H5_HLDLL herr_t H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
  103. const unsigned long *buffer, size_t size);
  104. H5_HLDLL herr_t H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
  105. const unsigned long long *buffer, size_t size);
  106. H5_HLDLL herr_t H5LTset_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
  107. const float *buffer, size_t size);
  108. H5_HLDLL herr_t H5LTset_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_name,
  109. const double *buffer, size_t size);
  110. /*-------------------------------------------------------------------------
  111. *
  112. * Get attribute functions
  113. *
  114. *-------------------------------------------------------------------------
  115. */
  116. H5_HLDLL herr_t H5LTget_attribute(hid_t loc_id, const char *obj_name, const char *attr_name,
  117. hid_t mem_type_id, void *data);
  118. H5_HLDLL herr_t H5LTget_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_name,
  119. char *data);
  120. H5_HLDLL herr_t H5LTget_attribute_char(hid_t loc_id, const char *obj_name, const char *attr_name, char *data);
  121. H5_HLDLL herr_t H5LTget_attribute_uchar(hid_t loc_id, const char *obj_name, const char *attr_name,
  122. unsigned char *data);
  123. H5_HLDLL herr_t H5LTget_attribute_short(hid_t loc_id, const char *obj_name, const char *attr_name,
  124. short *data);
  125. H5_HLDLL herr_t H5LTget_attribute_ushort(hid_t loc_id, const char *obj_name, const char *attr_name,
  126. unsigned short *data);
  127. H5_HLDLL herr_t H5LTget_attribute_int(hid_t loc_id, const char *obj_name, const char *attr_name, int *data);
  128. H5_HLDLL herr_t H5LTget_attribute_uint(hid_t loc_id, const char *obj_name, const char *attr_name,
  129. unsigned int *data);
  130. H5_HLDLL herr_t H5LTget_attribute_long(hid_t loc_id, const char *obj_name, const char *attr_name, long *data);
  131. H5_HLDLL herr_t H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name, const char *attr_name,
  132. long long *data);
  133. H5_HLDLL herr_t H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
  134. unsigned long *data);
  135. H5_HLDLL herr_t H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
  136. unsigned long long *data);
  137. H5_HLDLL herr_t H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
  138. float *data);
  139. H5_HLDLL herr_t H5LTget_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_name,
  140. double *data);
  141. /*-------------------------------------------------------------------------
  142. *
  143. * Query attribute functions
  144. *
  145. *-------------------------------------------------------------------------
  146. */
  147. H5_HLDLL herr_t H5LTget_attribute_ndims(hid_t loc_id, const char *obj_name, const char *attr_name, int *rank);
  148. H5_HLDLL herr_t H5LTget_attribute_info(hid_t loc_id, const char *obj_name, const char *attr_name,
  149. hsize_t *dims, H5T_class_t *type_class, size_t *type_size);
  150. /*-------------------------------------------------------------------------
  151. *
  152. * General functions
  153. *
  154. *-------------------------------------------------------------------------
  155. */
  156. H5_HLDLL hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type);
  157. H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len);
  158. /*-------------------------------------------------------------------------
  159. *
  160. * Utility functions
  161. *
  162. *-------------------------------------------------------------------------
  163. */
  164. H5_HLDLL herr_t H5LTfind_attribute(hid_t loc_id, const char *name);
  165. H5_HLDLL htri_t H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid);
  166. /*-------------------------------------------------------------------------
  167. *
  168. * File image operations functions
  169. *
  170. *-------------------------------------------------------------------------
  171. */
  172. H5_HLDLL hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags);
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176. #endif