H5LTpublic.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 #ifndef _H5LTpublic_H
00017 #define _H5LTpublic_H
00018 
00019 typedef enum H5LT_lang_t {
00020     H5LT_LANG_ERR = -1, /*this is the first*/
00021     H5LT_DDL      = 0,  /*for DDL*/
00022     H5LT_C        = 1,  /*for C*/
00023     H5LT_FORTRAN  = 2,  /*for Fortran*/
00024     H5LT_NO_LANG  = 3   /*this is the last*/
00025 } H5LT_lang_t;
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 /*-------------------------------------------------------------------------
00032  *
00033  * Make dataset functions
00034  *
00035  *-------------------------------------------------------------------------
00036  */
00037 
00038 H5_HLDLL herr_t  H5LTmake_dataset( hid_t loc_id,
00039                          const char *dset_name,
00040                          int rank,
00041                          const hsize_t *dims,
00042                          hid_t type_id,
00043                          const void *buffer );
00044 
00045 H5_HLDLL herr_t  H5LTmake_dataset_char( hid_t loc_id,
00046                               const char *dset_name,
00047                               int rank,
00048                               const hsize_t *dims,
00049                               const char *buffer );
00050 
00051 H5_HLDLL herr_t  H5LTmake_dataset_short( hid_t loc_id,
00052                                const char *dset_name,
00053                                int rank,
00054                                const hsize_t *dims,
00055                                const short *buffer );
00056 
00057 H5_HLDLL herr_t  H5LTmake_dataset_int( hid_t loc_id,
00058                              const char *dset_name,
00059                              int rank,
00060                              const hsize_t *dims,
00061                              const int *buffer );
00062 
00063 H5_HLDLL herr_t  H5LTmake_dataset_long( hid_t loc_id,
00064                               const char *dset_name,
00065                               int rank,
00066                               const hsize_t *dims,
00067                               const long *buffer );
00068 
00069 H5_HLDLL herr_t  H5LTmake_dataset_float( hid_t loc_id,
00070                                const char *dset_name,
00071                                int rank,
00072                                const hsize_t *dims,
00073                                const float *buffer );
00074 
00075 H5_HLDLL herr_t  H5LTmake_dataset_double( hid_t loc_id,
00076                                 const char *dset_name,
00077                                 int rank,
00078                                 const hsize_t *dims,
00079                                 const double *buffer );
00080 
00081 H5_HLDLL herr_t  H5LTmake_dataset_string( hid_t loc_id,
00082                                const char *dset_name,
00083                                const char *buf );
00084 
00085 
00086 /*-------------------------------------------------------------------------
00087  *
00088  * Read dataset functions
00089  *
00090  *-------------------------------------------------------------------------
00091  */
00092 
00093 H5_HLDLL herr_t  H5LTread_dataset( hid_t loc_id,
00094                          const char *dset_name,
00095                          hid_t type_id,
00096                          void *buffer );
00097 
00098 H5_HLDLL herr_t  H5LTread_dataset_char( hid_t loc_id,
00099                               const char *dset_name,
00100                               char *buffer );
00101 
00102 H5_HLDLL herr_t  H5LTread_dataset_short( hid_t loc_id,
00103                                const char *dset_name,
00104                                short *buffer );
00105 
00106 H5_HLDLL herr_t  H5LTread_dataset_int( hid_t loc_id,
00107                              const char *dset_name,
00108                              int *buffer );
00109 
00110 H5_HLDLL herr_t  H5LTread_dataset_long( hid_t loc_id,
00111                               const char *dset_name,
00112                               long *buffer );
00113 
00114 H5_HLDLL herr_t  H5LTread_dataset_float( hid_t loc_id,
00115                                const char *dset_name,
00116                                float *buffer );
00117 
00118 H5_HLDLL herr_t  H5LTread_dataset_double( hid_t loc_id,
00119                                 const char *dset_name,
00120                                 double *buffer );
00121 
00122 H5_HLDLL herr_t  H5LTread_dataset_string( hid_t loc_id,
00123                                 const char *dset_name,
00124                                 char *buf );
00125 
00126 /*-------------------------------------------------------------------------
00127  *
00128  * Query dataset functions
00129  *
00130  *-------------------------------------------------------------------------
00131  */
00132 
00133 
00134 H5_HLDLL herr_t  H5LTget_dataset_ndims( hid_t loc_id,
00135                              const char *dset_name,
00136                              int *rank );
00137 
00138 H5_HLDLL herr_t  H5LTget_dataset_info( hid_t loc_id,
00139                              const char *dset_name,
00140                              hsize_t *dims,
00141                              H5T_class_t *type_class,
00142                              size_t *type_size );
00143 
00144 H5_HLDLL herr_t  H5LTfind_dataset( hid_t loc_id, const char *name );
00145 
00146 
00147 
00148 /*-------------------------------------------------------------------------
00149  *
00150  * Set attribute functions
00151  *
00152  *-------------------------------------------------------------------------
00153  */
00154 
00155 
00156 H5_HLDLL herr_t  H5LTset_attribute_string( hid_t loc_id,
00157                                  const char *obj_name,
00158                                  const char *attr_name,
00159                                  const char *attr_data );
00160 
00161 H5_HLDLL herr_t  H5LTset_attribute_char( hid_t loc_id,
00162                                const char *obj_name,
00163                                const char *attr_name,
00164                                const char *buffer,
00165                                size_t size );
00166 
00167 H5_HLDLL herr_t  H5LTset_attribute_uchar( hid_t loc_id,
00168                                const char *obj_name,
00169                                const char *attr_name,
00170                                const unsigned char *buffer,
00171                                size_t size );
00172 
00173 H5_HLDLL herr_t  H5LTset_attribute_short( hid_t loc_id,
00174                               const char *obj_name,
00175                               const char *attr_name,
00176                               const short *buffer,
00177                               size_t size );
00178 
00179 H5_HLDLL herr_t  H5LTset_attribute_ushort( hid_t loc_id,
00180                               const char *obj_name,
00181                               const char *attr_name,
00182                               const unsigned short *buffer,
00183                               size_t size );
00184 
00185 H5_HLDLL herr_t  H5LTset_attribute_int( hid_t loc_id,
00186                               const char *obj_name,
00187                               const char *attr_name,
00188                               const int *buffer,
00189                               size_t size );
00190 
00191 H5_HLDLL herr_t  H5LTset_attribute_uint( hid_t loc_id,
00192                               const char *obj_name,
00193                               const char *attr_name,
00194                               const unsigned int *buffer,
00195                               size_t size );
00196 
00197 H5_HLDLL herr_t  H5LTset_attribute_long( hid_t loc_id,
00198                                const char *obj_name,
00199                                const char *attr_name,
00200                                const long *buffer,
00201                                size_t size );
00202 
00203 H5_HLDLL herr_t  H5LTset_attribute_long_long( hid_t loc_id,
00204                                const char *obj_name,
00205                                const char *attr_name,
00206                                const long long *buffer,
00207                                size_t size );
00208 
00209 H5_HLDLL herr_t  H5LTset_attribute_ulong( hid_t loc_id,
00210                                const char *obj_name,
00211                                const char *attr_name,
00212                                const unsigned long *buffer,
00213                                size_t size );
00214 
00215 H5_HLDLL herr_t  H5LTset_attribute_float( hid_t loc_id,
00216                                 const char *obj_name,
00217                                 const char *attr_name,
00218                                 const float *buffer,
00219                                 size_t size );
00220 
00221 H5_HLDLL herr_t  H5LTset_attribute_double( hid_t loc_id,
00222                                  const char *obj_name,
00223                                  const char *attr_name,
00224                                  const double *buffer,
00225                                  size_t size );
00226 
00227 /*-------------------------------------------------------------------------
00228  *
00229  * Get attribute functions
00230  *
00231  *-------------------------------------------------------------------------
00232  */
00233 
00234 H5_HLDLL herr_t  H5LTget_attribute( hid_t loc_id,
00235                           const char *obj_name,
00236                           const char *attr_name,
00237                           hid_t mem_type_id,
00238                           void *data );
00239 
00240 H5_HLDLL herr_t  H5LTget_attribute_string( hid_t loc_id,
00241                                  const char *obj_name,
00242                                  const char *attr_name,
00243                                  char *data );
00244 
00245 H5_HLDLL herr_t  H5LTget_attribute_char( hid_t loc_id,
00246                                const char *obj_name,
00247                                const char *attr_name,
00248                                char *data );
00249 
00250 H5_HLDLL herr_t  H5LTget_attribute_uchar( hid_t loc_id,
00251                                const char *obj_name,
00252                                const char *attr_name,
00253                                unsigned char *data );
00254 
00255 H5_HLDLL herr_t  H5LTget_attribute_short( hid_t loc_id,
00256                                 const char *obj_name,
00257                                 const char *attr_name,
00258                                 short *data );
00259 
00260 H5_HLDLL herr_t  H5LTget_attribute_ushort( hid_t loc_id,
00261                                 const char *obj_name,
00262                                 const char *attr_name,
00263                                 unsigned short *data );
00264 
00265 H5_HLDLL herr_t  H5LTget_attribute_int( hid_t loc_id,
00266                               const char *obj_name,
00267                               const char *attr_name,
00268                               int *data );
00269 
00270 H5_HLDLL herr_t  H5LTget_attribute_uint( hid_t loc_id,
00271                               const char *obj_name,
00272                               const char *attr_name,
00273                               unsigned int *data );
00274 
00275 H5_HLDLL herr_t  H5LTget_attribute_long( hid_t loc_id,
00276                                const char *obj_name,
00277                                const char *attr_name,
00278                                long *data );
00279 
00280 H5_HLDLL herr_t  H5LTget_attribute_long_long( hid_t loc_id,
00281                                const char *obj_name,
00282                                const char *attr_name,
00283                                long long *data );
00284 
00285 H5_HLDLL herr_t  H5LTget_attribute_ulong( hid_t loc_id,
00286                                const char *obj_name,
00287                                const char *attr_name,
00288                                unsigned long *data );
00289 
00290 H5_HLDLL herr_t  H5LTget_attribute_float( hid_t loc_id,
00291                                 const char *obj_name,
00292                                 const char *attr_name,
00293                                 float *data );
00294 
00295 H5_HLDLL herr_t  H5LTget_attribute_double( hid_t loc_id,
00296                                  const char *obj_name,
00297                                  const char *attr_name,
00298                                  double *data );
00299 
00300 
00301 /*-------------------------------------------------------------------------
00302  *
00303  * Query attribute functions
00304  *
00305  *-------------------------------------------------------------------------
00306  */
00307 
00308 
00309 H5_HLDLL herr_t  H5LTget_attribute_ndims( hid_t loc_id,
00310                                 const char *obj_name,
00311                                 const char *attr_name,
00312                                 int *rank );
00313 
00314 H5_HLDLL herr_t  H5LTget_attribute_info( hid_t loc_id,
00315                                const char *obj_name,
00316                                const char *attr_name,
00317                                hsize_t *dims,
00318                                H5T_class_t *type_class,
00319                                size_t *type_size );
00320 
00321 
00322 
00323 
00324 
00325 /*-------------------------------------------------------------------------
00326  *
00327  * General functions
00328  *
00329  *-------------------------------------------------------------------------
00330  */
00331 
00332 H5_HLDLL hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type);
00333 H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len);
00334 
00335 
00336 /*-------------------------------------------------------------------------
00337  *
00338  * Utility functions
00339  *
00340  *-------------------------------------------------------------------------
00341  */
00342 
00343 H5_HLDLL herr_t  H5LTfind_attribute( hid_t loc_id, const char *name );
00344 
00345 
00346 #ifdef __cplusplus
00347 }
00348 #endif
00349 
00350 #endif
00351