MED fichier
MEDfileObjectDescriptionWrByPath.c
Aller à la documentation de ce fichier.
1 /* This file is part of MED.
2  *
3  * COPYRIGHT (C) 1999 - 2023 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 
37 med_err
39  med_path * const medpath,
40  const char * const description)
41 {
42  med_err _ret = -1;
43  /* int _i = 0; */
44 
45  /*
46  * On inhibe le gestionnaire d'erreur HDF
47  */
49  if (_MEDcheckVersion30(fid) < 0) goto ERROR;
50 
51  if ( _MEDgetObjectStringPath(medpath) < 0 ) {
52  MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDgetObjectStringPath");
53  ISCRUTE(medpath->medclass);
54  ISCRUTE(medpath->nname);
55  /* for (_i=0;_i<medpath->nname;++_i) { */
56  /* SSCRUTE(medpath->name[_i]); */
57  /* } */
58  goto ERROR;
59  }
60 
62  medpath->_datagroupname,
65  description ) <0 ) {
66  MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDattributeStringWrByName");
67  SSCRUTE(medpath->_datagroupname);
69  goto ERROR;
70  }
71 
72  SORTIE:
73  _ret=0;
74 
75  ERROR:
76 
77  return _ret;
78 }
MED_ERR_API
#define MED_ERR_API
Definition: med_err.h:111
med_path
Aggrégation de noms medfichier pour définir un chemin d'accès aux objets med de type class med_class.
Definition: med.h:356
med_err
herr_t med_err
Definition: med.h:336
description
const char *const description
Definition: medfile.h:65
MED_COMMENT_SIZE
#define MED_COMMENT_SIZE
Definition: med.h:80
med_config.h
MED_ERR_
#define MED_ERR_(rt, r1, r2, r3)
Definition: med_utils.h:160
med_idt
hid_t med_idt
Definition: med.h:335
med_path::nname
med_int nname
Definition: med.h:359
med_path::medclass
med_class medclass
Definition: med.h:358
ISCRUTE
#define ISCRUTE(entier)
Definition: med_utils.h:313
MEDfileObjectDescriptionWrByPath
med_err MEDfileObjectDescriptionWrByPath(const med_idt fid, med_path *const medpath, const char *const description)
Ecrit une description associée à l'objet accessible par le chemin med_path dans le fichier fid .
Definition: MEDfileObjectDescriptionWrByPath.c:38
_MEDgetObjectStringPath
MEDC_EXPORT med_err _MEDgetObjectStringPath(med_path *const medpath)
MED_ERR_CALL
#define MED_ERR_CALL
Definition: med_err.h:48
med_outils.h
med_path::_datagroupname
char _datagroupname[MED_MAX_DATAGROUPNAME_IN_PATH+1]
Definition: med.h:362
_MEDcheckVersion30
MEDC_EXPORT med_err _MEDcheckVersion30(med_idt fid)
SSCRUTE
#define SSCRUTE(chaine)
Definition: med_utils.h:323
med.h
_MEDattributeStringWrByName
MEDC_EXPORT med_err _MEDattributeStringWrByName(med_idt pid, const char *const path, const char *const attname, const med_size attsize, const char *const val)
MED_NOM_DES
#define MED_NOM_DES
Definition: med_outils.h:53
_MEDmodeErreurVerrouiller
MEDC_EXPORT void _MEDmodeErreurVerrouiller(void)