1 /*  This file is part of MED.
2  *
3  *  COPYRIGHT (C) 1999 - 2019  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_config.h"
20 #include <med.h>
21 #include "med_outils.h"
22 #include <string.h>
23 
24 /**\ingroup MEDmesh
25    \brief \MEDmeshInfoByNameBrief
26    \param fid \fid
27    \param meshname \meshname
28    \param spacedim \spacedim
29    \param meshdim \meshdim
30    \param meshtype \meshtype
31    \param description \description
32    \param dtunit \dtunit
33    \param sortingtype \sortingtype
34    \param nstep \nstep
35    \param axistype \axistype
36    \param axisname \axisname
37    \param axisunit \axisunit
38    \retval med_err \error
39    \details \MEDmeshInfoByNameDetails
40 */
41 
MEDmeshInfoByName(const med_idt fid,const char * const meshname,med_int * const spacedim,med_int * const meshdim,med_mesh_type * const meshtype,char * const description,char * const dtunit,med_sorting_type * const sortingtype,med_int * const nstep,med_axis_type * const axistype,char * const axisname,char * const axisunit)42 med_err MEDmeshInfoByName  (const med_idt            fid,
43 			    const char *             const meshname,
44 			          med_int *          const spacedim,
45 			          med_int *          const meshdim,
46 			          med_mesh_type *    const meshtype,
47 			          char *             const description,
48 			          char *             const dtunit,
49 			          med_sorting_type * const sortingtype,
50 			          med_int *          const nstep,
51 			          med_axis_type *    const axistype,
52 			          char *             const axisname,
53 			          char *             const axisunit)
54 {
55   char *  name = "_MEDmeshInfoByName";
56   int     dummy=0;
57   med_err fret=-1;
58   med_int majeur, mineur, release;
59   MedFuncType func;
60 
61   MEDfileNumVersionRd(fid, &majeur, &mineur, &release);
62 
63   func = _MEDversionedApi3(name,majeur,mineur,release);
64   if ( func != (MedFuncType) NULL )
65     func (dummy,
66 	  fid,
67 	  meshname,
68 	  spacedim,
69 	  meshdim,
70 	  meshtype,
71 	  description,
72 	  dtunit,
73 	  sortingtype,
74 	  nstep,
75 	  axistype,
76 	  axisname,
77 	  axisunit
78 	  , &fret);
79 
80   return fret;
81 }
82