MED fichier: Fichier source de MEDfileStrVersionRd.c

MED fichier

MEDfileStrVersionRd.c
Aller à la documentation de ce fichier.
1 /* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2021 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 <stdio.h>
20
21 #include <med.h>
22 #include <med_config.h>
23 #include <med_outils.h>
24
25
34 med_err
35 MEDfileStrVersionRd(const med_idt fid,
36 char* const medversion)
37 {
38 med_err _ret = -1;
39
40 med_int major;
41 med_int minor;
42 med_int release;
43
44 int _intmajor;
45 int _intminor;
46 int _intrelease;
47
48 if ( MEDfileNumVersionRd(fid,&major,&minor,&release) < 0 ) {
49 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDfileNumVersionRd");
50 goto ERROR;
51 }
52
53 _intmajor = (int) major;
54 _intminor = (int) minor;
55 _intrelease= (int) release;
56
57 if (medversion)
58 sprintf(medversion,"MED-%d.%d.%d",_intmajor,_intminor,_intrelease);
59
60 _ret = 0;
61 ERROR :
62
63 /* the hdf group is closed */
64 return _ret;
65 }
MED_ERR_API
#define MED_ERR_API
Definition: med_err.h:111
med_idt
hid_t med_idt
Definition: med.h:331
MED_ERR_
#define MED_ERR_(rt, r1, r2, r3)
Definition: med_utils.h:160
med_err
herr_t med_err
Definition: med.h:332
MEDfileStrVersionRd
med_err MEDfileStrVersionRd(const med_idt fid, char *const medversion)
Lecture du numéro de version de la bibliothèque MED utilisée pour créer le fichier (renvoyé sous la f...
Definition: MEDfileStrVersionRd.c:35
med_int
int med_int
Definition: med.h:342
MED_ERR_CALL
#define MED_ERR_CALL
Definition: med_err.h:48
med.h
MEDfileNumVersionRd
MEDC_EXPORT med_err MEDfileNumVersionRd(const med_idt fid, med_int *const major, med_int *const minor, med_int *const release)
Lecture du numéro de version de la bibliothèque MED utilisée pour créer le fichier.
Definition: MEDfileNumVersionRd.c:34
med_outils.h
med_config.h