MED fichier
MEDfileObjectDescriptionExistByPath.c
Aller à la documentation de ce fichier.
1/* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2025 EDF R&D, CEA/DEN
4 * MED is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * MED is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with MED. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18
19#include <med.h>
20#include <med_config.h>
21#include <med_outils.h>
22
23#include <string.h>
24
25
39 med_path * const medpath,
40 med_bool * const descriptionexist)
41{
42 med_err _ret = -1;
43 /* int _i = 0; */
44 med_bool _descriptionexist=MED_FALSE;
45 med_bool _datagroupexist = MED_FALSE;
46 med_bool _isasoftlink = MED_FALSE;
47
48 /*
49 * On inhibe le gestionnaire d'erreur HDF
50 */
52
53 *descriptionexist = MED_FALSE;
54
55 if ( _MEDgetObjectStringPath(medpath) < 0 ) {
56 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDgetObjectStringPath");
57 ISCRUTE(medpath->medclass);
58 ISCRUTE(medpath->nname);
59 /* for (_i=0;_i<medpath->nname;++_i) { */
60 /* SSCRUTE(medpath->name[_i]); */
61 /* } */
62 goto ERROR;
63 }
64
65 if (_MEDdatagroupExist(fid,
66 medpath->_datagroupname,
67 &_datagroupexist,
68 &_isasoftlink ) <0 ) {
69 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDdatagroupExist");
70 SSCRUTE(medpath->_datagroupname);
71 goto ERROR;
72 }
73
74 if ( !_datagroupexist ) goto SORTIE;
75
76 if ( _MEDattributeExist(fid,
77 medpath->_datagroupname,
79 &_descriptionexist ) <0 ) {
80 /* MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDattributeExist"); */
81 /* SSCRUTE(medpath->_datagroupname); */
82 goto SORTIE;
83 }
84
85 if ( _descriptionexist ) *descriptionexist = MED_TRUE;
86
87
88 SORTIE:
89
90 _ret=0;
91
92 ERROR:
93
94 return _ret;
95}
#define MED_ERR_(rt, r1, r2, r3)
#define SSCRUTE(chaine)
#define ISCRUTE(entier)
med_err MEDfileObjectDescriptionExistByPath(const med_idt fid, med_path *const medpath, med_bool *const descriptionexist)
Interroge le fichier fid pour tester l'existence d'une description associée à l'objet accessible par ...
#define MED_ERR_CALL
Definition med_err.h:48
#define MED_ERR_API
Definition med_err.h:111
MEDC_EXPORT med_err _MEDattributeExist(const med_idt gid, const char *const datagroupname, const char *const attributename, med_bool *const attributeexist)
MEDC_EXPORT void _MEDmodeErreurVerrouiller(void)
MEDC_EXPORT med_err _MEDdatagroupExist(const med_idt gid, const char *const datagroupname, med_bool *const datagroupexist, med_bool *const isasoftlink)
MEDC_EXPORT med_err _MEDgetObjectStringPath(med_path *const medpath)
#define MED_NOM_DES
Definition med_outils.h:54
char _datagroupname[MED_MAX_DATAGROUPNAME_IN_PATH+1]
Aggrégation de noms medfichier pour définir un chemin d'accès aux objets med de type class med_class.