# med_hdfi.h

Aller à la documentation de ce fichier.

    00001 /*  This file is part of MED.
    00002  *
    00003  *  COPYRIGHT (C) 1999 - 2011  EDF R&D, CEA/DEN
    00004  *  MED is free software: you can redistribute it and/or modify
    00005  *  it under the terms of the GNU Lesser General Public License as published by
    00006  *  the Free Software Foundation, either version 3 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  MED is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Lesser General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Lesser General Public License
    00015  *  along with MED.  If not, see <http://www.gnu.org/licenses/>.
    00016  */
    00017
    00018 #ifndef MED_HDFI_H
    00019 #define MED_HDFI_H
    00020 #include <med.h>
    00021
    00022 #ifdef __cplusplus
    00023 extern "C" {
    00024 #endif
    00025
    00026
    00027 /* FONCTIONS INTERFACE MED/HDF */
    00028
    00029
    00030 /* Gestion des attributs HDF */
    00031 extern MEDC_EXPORT
    00032 med_idt _MEDattrOuvrir(med_idt pid,char * nom);
    00033
    00034 extern MEDC_EXPORT
    00035 med_err _MEDattributeExist(const med_idt        gid,
    00036                            const char * const   datagroupname,
    00037                            const char * const   attributename,
    00038                            med_bool *   const   attributeexist );
    00039 extern MEDC_EXPORT
    00040 med_err _MEDattrFermer(med_idt id);
    00041
    00042 extern MEDC_EXPORT
    00043 med_err _MEDattrNumEcrire(med_idt pere,med_field_type type,char *nom,unsigned char *val);
    00044
    00045 #define _MEDattributeIntWr(w,x,y)  _MEDattributeNumWr(w,x, MED_INTERNAL_INT, (unsigned char *) y)
    00046 #define _MEDattrFloatEcrire(w,x,y)   _MEDattrNumEcrire(w,MED_FLOAT64,x,(unsigned char *) y)
    00047
    00048 extern MEDC_EXPORT
    00049 med_err _MEDattributeNumWr(med_idt pid,
    00050                            const char * const attname,
    00051                            const med_internal_type type,
    00052                            const unsigned char * const  val);
    00053
    00054 extern MEDC_EXPORT
    00055 med_err _MEDattributeNumWrByName(med_idt pid,
    00056                                  const char * const path ,
    00057                                  const char * const attname,
    00058                                  const med_internal_type type,
    00059                                  const unsigned char * const  val);
    00060
    00061 extern MEDC_EXPORT
    00062 med_err _MEDattrNumLire(med_idt pere,med_field_type type,char *nom,unsigned char *val);
    00063
    00064 #define _MEDattrEntierLire(x,y,z) _MEDattrNumLire(x,MED_INT ,y,(unsigned char*)z)
    00065 #define _MEDattrFloatLire(x,y,z)  _MEDattrNumLire(x,MED_FLOAT64,y,(unsigned char*)z)
    00066
    00067 extern MEDC_EXPORT
    00068 med_err _MEDattributeNumRdByName(med_idt pid,
    00069                                  const char * const path ,
    00070                                  const char * const attname,
    00071                                  const med_internal_type type,
    00072                                  unsigned char * const val);
    00073
    00074 extern MEDC_EXPORT
    00075 med_err _MEDattrStringEcrire(med_idt pere,const char * const nom,int longueur,const char * const val);
    00076
    00077 extern MEDC_EXPORT
    00078 med_err _MEDattributeStringWrByName(med_idt pid,
    00079                                     const char * const path,
    00080                                     const char * const attname,
    00081                                     const med_size attsize,
    00082                                     const char * const val);
    00083 extern MEDC_EXPORT
    00084 med_err _MEDattributeStringWr(med_idt pid,
    00085                               const char * const attname,
    00086                               const med_size attsize,
    00087                               const char * const val);
    00088 extern MEDC_EXPORT
    00089
    00090 med_err _MEDattrStringLire(med_idt pere,char *nom,int longueur,char *val);
    00091
    00092 extern MEDC_EXPORT
    00093 med_err _MEDattributeStringRdByName(med_idt pid,
    00094                                     const char * const path ,
    00095                                     const char * const attname,
    00096                                     const med_size attsize,
    00097                                     char * const val);
    00098
    00099
    00100 /* Gestion des datagroups HDF */
    00101 extern MEDC_EXPORT
    00102 med_idt _MEDdatagroupCreer(med_idt pid, const char * const nom);
    00103
    00104 extern MEDC_EXPORT
    00105 med_idt _MEDdatagroupCrOrderCr(const med_idt pid, const char * const name);
    00106
    00107 extern MEDC_EXPORT
    00108 med_idt _MEDdatagroupOuvrir(med_idt pid, const char * const nom);
    00109
    00110 extern MEDC_EXPORT
    00111 med_idt _MEDdatagroupOpen(const med_idt pid, const char * const name);
    00112
    00113 extern MEDC_EXPORT
    00114 med_err _MEDdatagroupFermer(med_idt id);
    00115
    00116 extern MEDC_EXPORT
    00117 med_err _MEDdatagroupLienCreer(med_idt id,const char *nom, const char *nom_lien);
    00118
    00119 extern MEDC_EXPORT
    00120 med_err _MEDdatagroupLienSupprimer(med_idt id,const char *nom_lien);
    00121
    00122
    00123 /* Gestion des datasets HDF */
    00124
    00125 extern MEDC_EXPORT
    00126 med_idt _MEDdatasetOuvrir(med_idt pid,char *nom);
    00127
    00128 extern MEDC_EXPORT
    00129 med_err _MEDdatasetFermer(med_idt id);
    00130
    00131 extern MEDC_EXPORT
    00132 med_err _MEDdatasetWr(const med_idt               id,
    00133                          const char * const          datasetname,
    00134                          const med_internal_type     datatype,
    00135                          const med_filter* const     filter,
    00136                          const void * const value);
    00137 extern MEDC_EXPORT
    00138 med_err _MEDdatasetRd(const med_idt               id,
    00139                          const char * const          datasetname,
    00140                          const med_internal_type     datatype,
    00141                          const med_filter* const     filter,
    00142                          unsigned char * const value);
    00143
    00144 /* Gestion des fichiers HDF */
    00145 #ifdef MED_HAVE_MPI
    00146
    00147 extern MEDC_EXPORT
    00148 med_idt _MEDparFileOpen(const char * const filename,const med_access_mode accessmode,
    00149                         const MPI_Comm comm, const MPI_Info info);
    00150
    00151 extern MEDC_EXPORT
    00152 med_idt _MEDparFileCreate(const char * const filename, const med_access_mode accessmode,
    00153                           const MPI_Comm comm, const MPI_Info info);
    00154 #endif
    00155
    00156 extern MEDC_EXPORT
    00157 med_idt _MEDfileOpen(const char * const filename,const med_access_mode accessmode);
    00158
    00159 extern MEDC_EXPORT
    00160 med_idt _MEDfileCreate(const char * const filename, const med_access_mode accessmode);
    00161
    00162 extern MEDC_EXPORT
    00163 med_err _MEDfichierFermer(med_idt fid);
    00164
    00165 extern MEDC_EXPORT
    00166 med_err _MEDfichierMonter(med_idt pid, const char *nom, med_idt fid);
    00167
    00168 extern MEDC_EXPORT
    00169 med_err _MEDfichierDemonter(med_idt pid, const char *nom);
    00170
    00171 extern MEDC_EXPORT
    00172 med_err _MEDfichierNo(med_idt id, unsigned long * fileno);
    00173
    00174 /* Filtres */
    00175 extern MEDC_EXPORT
    00176 med_err _MEDfilterEntityFullIGlobalCr(const med_idt          fid,
    00177                                 const med_int          nbofentity,
    00178                                 const med_int          nbofvaluesperentity,
    00179                                 const med_int          nbofconstituentpervalue,
    00180                                 const med_int          constituentselect,
    00181                                 const med_storage_mode storagemode,
    00182                                 const char * const     profilename,
    00183                                 const med_int          filterarraysize,
    00184                                 const med_int* const   filterarray,
    00185                                 med_filter*    const filter);
    00186 extern MEDC_EXPORT
    00187 med_err _MEDfilterEntityFullICompactCr(const med_idt          fid,
    00188                                        const med_int          nbofentity,
    00189                                        const med_int          nbofvaluesperentity,
    00190                                        const med_int          nbofconstituentpervalue,
    00191                                        const med_int          constituentselect,
    00192                                        const med_storage_mode storagemode,
    00193                                        const char * const     profilename,
    00194                                        const med_int          filterarraysize,
    00195                                        const med_int* const   filterarray,
    00196                                        med_filter*    const   filter);
    00197 extern MEDC_EXPORT
    00198 med_err _MEDfilterEntityNoIGlobalCr(const med_idt          fid,
    00199                                     const med_int          nbofentity,
    00200                                     const med_int          nbofvaluesperentity,
    00201                                     const med_int          nbofconstituentpervalue,
    00202                                      const med_int          constituentselect,
    00203                                     const med_storage_mode storagemode,
    00204                                     const char * const     profilename,
    00205                                     const med_int          filterarraysize,
    00206                                     const med_int* const   filterarray,
    00207                                     med_filter* const      filter);
    00208
    00209 extern MEDC_EXPORT
    00210 med_err _MEDfilterEntityNoICompactCr(const med_idt          fid,
    00211                                      const med_int          nbofentity,
    00212                                      const med_int          nbofvaluesperentity,
    00213                                      const med_int          nbofconstituentpervalue,
    00214                                      const med_int          constituentselect,
    00215                                      const med_storage_mode storagemode,
    00216                                      const char * const     profilename,
    00217                                      const med_int          filterarraysize,
    00218                                      const med_int* const   filterarray,
    00219                                      med_filter* const      filter);
    00220
    00221 /* extern MEDC_EXPORT */
    00222 /* med_err _MEDselectAllEntities(const med_idt          fid, */
    00223 /*                            const med_int          nbofentity, */
    00224 /*                            const med_int          nbofvaluesperentity, */
    00225 /*                            const med_int          nbofconstituentpervalue, */
    00226 /*                            const med_int          constituentselect, */
    00227 /*                            med_filter*    const   filter); */
    00228
    00229
    00230 extern MEDC_EXPORT
    00231 med_err _MEDselectAllEntitiesFullI(const med_idt          fid,
    00232                                    const med_int          nbofentity,
    00233                                    const med_int          nbofvaluesperentity,
    00234                                    const med_int          nbofconstituentpervalue,
    00235                                    const med_int          constituentselect,
    00236                                    med_filter*    const   filter);
    00237
    00238 extern MEDC_EXPORT
    00239 med_err _MEDselectAllEntitiesNoI(const med_idt          fid,
    00240                                  const med_int          nbofentity,
    00241                                  const med_int          nbofvaluesperentity,
    00242                                  const med_int          nbofconstituentpervalue,
    00243                                  const med_int          constituentselect,
    00244                                  med_filter*    const   filter);
    00245
    00246 extern MEDC_EXPORT
    00247 med_err _MEDfilterBlockOfEntityFullICompactCr(const med_idt          fid,
    00248                                               const med_int          nbofentity,
    00249                                               const med_int          nbofvaluesperentity,
    00250                                               const med_int          nbofconstituentpervalue,
    00251                                               const med_int          constituentselect,
    00252                                               const med_storage_mode storagemode,
    00253                                               const char * const     profilename,
    00254                                               const med_size  start,
    00255                                               const med_size  stride,
    00256                                               const med_size  count,
    00257                                               const med_size  blocksize,
    00258                                               const med_size  lastblocksize,
    00259                                               med_filter*    const   filter);
    00260
    00261 extern MEDC_EXPORT
    00262 med_err _MEDfilterBlockOfEntityFullIGlobalCr(const med_idt          fid,
    00263                                               const med_int          nbofentity,
    00264                                               const med_int          nbofvaluesperentity,
    00265                                               const med_int          nbofconstituentpervalue,
    00266                                               const med_int          constituentselect,
    00267                                               const med_storage_mode storagemode,
    00268                                               const char * const     profilename,
    00269                                               const med_size  start,
    00270                                               const med_size  stride,
    00271                                               const med_size  count,
    00272                                               const med_size  blocksize,
    00273                                               const med_size  lastblocksize,
    00274                                               med_filter*    const   filter);
    00275 extern MEDC_EXPORT
    00276 med_err _MEDfilterBlockOfEntityNoIGlobalCr(const med_idt          fid,
    00277                                               const med_int          nbofentity,
    00278                                               const med_int          nbofvaluesperentity,
    00279                                               const med_int          nbofconstituentpervalue,
    00280                                               const med_int          constituentselect,
    00281                                               const med_storage_mode storagemode,
    00282                                               const char * const     profilename,
    00283                                               const med_size  start,
    00284                                               const med_size  stride,
    00285                                               const med_size  count,
    00286                                               const med_size  blocksize,
    00287                                               const med_size  lastblocksize,
    00288                                               med_filter*    const   filter);
    00289 extern MEDC_EXPORT
    00290 med_err _MEDfilterBlockOfEntityNoICompactCr(const med_idt          fid,
    00291                                               const med_int          nbofentity,
    00292                                               const med_int          nbofvaluesperentity,
    00293                                               const med_int          nbofconstituentpervalue,
    00294                                               const med_int          constituentselect,
    00295                                               const med_storage_mode storagemode,
    00296                                               const char * const     profilename,
    00297                                               const med_size  start,
    00298                                               const med_size  stride,
    00299                                               const med_size  count,
    00300                                               const med_size  blocksize,
    00301                                               const med_size  lastblocksize,
    00302                                               med_filter*    const   filter);
    00303
    00304
    00305 /* Divers */
    00306
    00307 extern MEDC_EXPORT
    00308 med_err _MEDnObjects(const med_idt fid,const char * const path,med_size *n);
    00309
    00310 extern MEDC_EXPORT
    00311 med_err _MEDobjectGetName(const med_idt fid,const char * const path,const med_size ind,char *name);
    00312
    00313 extern MEDC_EXPORT
    00314 med_err
    00315 _MEDobjectCrOrderGetName(const med_idt fid,const char * const path,const med_size ind,char *name);
    00316
    00317 extern MEDC_EXPORT
    00318 med_err
    00319 __MEDobjectGetName(const med_idt fid, const char * const path, const med_size ind, char *name,
    00320                    const H5_index_t index_type, const H5_iter_order_t order );
    00321
    00322
    00323 typedef struct {
    00324   char * srcpath;
    00325   char * dstpath;
    00326   med_idt gid1;
    00327   med_idt gid2;
    00328 } visitordatas;
    00329
    00330 typedef struct {
    00331   char *   attname;
    00332   char *   attval;
    00333   char *   attvalprec;
    00334   med_int  attsize;
    00335 } med_string_itdatas;
    00336
    00337
    00338 extern MEDC_EXPORT
    00339 void * _MEDcheckAttributeStringInit( med_string_itdatas * const itdatas, const char * const attname, med_int attsize);
    00340 extern MEDC_EXPORT
    00341 med_err _MEDcheckAttributeStringFunc(med_idt id,const char *lname, const H5L_info_t *linfo, med_string_itdatas *data);
    00342 extern MEDC_EXPORT
    00343 void  _MEDcheckAttributeStringFin( med_string_itdatas * const itdatas);
    00344
    00345 extern MEDC_EXPORT
    00346 med_err _MEDchecknSublinkFunc(med_idt id,const char *lname, const H5L_info_t *linfo, med_bool *data);
    00347
    00348 #define MED_CHECK_ATTRIBUTE_FUNC(_check_med_type_) _MEDcheckAttributeFunc##_check_med_type_
    00349 #define MED_CHECK_ATTRIBUTE_INIT(_check_med_type_,_check_med_itdata_,_check_med_attname_,_check_med_attsize_) _MEDcheckAttributeInit##_check_med_type_ (_check_med_itdata_,_check_med_attname_,_check_med_attsize_)
    00350
    00351
    00352 extern MEDC_EXPORT
    00353 med_err _MEDcopyName(med_idt id,const char *lname, const H5L_info_t *linfo, void *data);
    00354
    00355 extern MEDC_EXPORT
    00356 med_err _MEDlinkobjs(med_idt id,const char *lname, const H5L_info_t *linfo, visitordatas *data);
    00357
    00358 extern MEDC_EXPORT
    00359 med_err _MEDsoftlinkDel(const med_idt               id, const char * const          softlinkname,
    00360                         med_bool                    linkmustexist);
    00361 extern MEDC_EXPORT
    00362 med_err _MEDisasoftlink(const med_idt               id,
    00363                         const char * const          linkname,
    00364                         med_bool                    linkmustexist,
    00365                         med_bool *   const          isasoftlink
    00366                         );
    00367 extern MEDC_EXPORT
    00368 med_err _MEDgetDatasetChgt(const med_idt                       gid,
    00369                            const med_data_type                 meddatatype,
    00370                            const med_connectivity_mode         cmode,
    00371                            med_bool *                  const   isasoftlink,
    00372                            med_bool *                  const   chgt );
    00373
    00374 extern MEDC_EXPORT
    00375 med_err _MEDdatasetExistByMedtype(const med_idt                       gid,
    00376                          const med_data_type                 meddatatype,
    00377                          const med_connectivity_mode         cmode,
    00378                          med_bool *                  const   datasetexist,
    00379                          med_bool *                  const   isasoftlink );
    00380
    00381 extern MEDC_EXPORT
    00382 med_err _MEDdatagroupExist(const med_idt        gid,
    00383                            const char * const   datagroupname,
    00384                            med_bool *   const   datagroupexist,
    00385                            med_bool *   const   isasoftlink );
    00386 extern MEDC_EXPORT
    00387 med_err _MEDdatasetExist(const med_idt       gid,
    00388                          const char *  const datasetname,
    00389                          med_bool   *  const datasetexist,
    00390                          med_bool   *  const isasoftlink );
    00391
    00392 typedef herr_t (*medvisitorfunc)( hid_t g_id, const char *name, const H5L_info_t *info, void *op_data);
    00393 typedef medvisitorfunc mediteratorfunc;
    00394
    00395 extern MEDC_EXPORT
    00396 med_err _MEDvisit(const med_idt fid, const char * const srcpath, const char * const dstpath,
    00397                   medvisitorfunc);
    00398 extern MEDC_EXPORT
    00399 med_err _MEDiterate(const med_idt fid, herr_t (*func)(), void * itdatas );
    00400
    00401 extern MEDC_EXPORT
    00402 med_err
    00403 _MEDgetComputationStepName(const med_sorting_type sortingtype, const med_int numdt,
    00404                            const med_int numit, char * const datagroupname);
    00405
    00406 extern MEDC_EXPORT
    00407 void _MEDmodeErreurVerrouiller(void);
    00408
    00409 extern MEDC_EXPORT
    00410 void _MEDobjetsOuverts(med_idt fid);
    00411 #ifdef __cplusplus
    00412 }
    00413 #endif
    00414
    00415 #endif /* MED_HDFI_H */