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.h>
20 #include <med_config.h>
21 #include <med_outils.h>
22 
23 #include <string.h>
24 #include <stdlib.h>
25 
26 #include <2.3.6/med23v30.h>
27 #include <2.3.6/med23v30_proto.h>
28 #include "2.3.6/med23v30_misc.h"
29 
30 void
_MEDlocalizationRd236(int dummy,...)31 _MEDlocalizationRd236(int dummy, ...) {
32 
33 
34   med_err _ret = -1;
35   med_idt _lzid=0, _root=0;
36   med_int _nentity=0,_nipoint=0,_spacedimension=0;
37   med_int _intgeotype = -1;
38   char    _path[MED_LOCALIZATION_GRP_SIZE+MED_NAME_SIZE+1]=MED_LOCALIZATION_GRP;
39   med_filter     _filter        = MED_FILTER_INIT;
40 
41 
42   MED_VARGS_DECL(const, med_idt                 , , fid               );
43   MED_VARGS_DECL(const, char*            , const  , localizationname  );
44   MED_VARGS_DECL(const, med_switch_mode         , , switchmode        );
45   MED_VARGS_DECL(, med_float*      , const  , elementcoordinate       );
46   MED_VARGS_DECL(, med_float*      , const  , ipointcoordinate        );
47   MED_VARGS_DECL(, med_float*      , const  , weight                  );
48   MED_VARGS_DECL(, med_err *                     ,, fret              );
49 
50   va_list params;
51   va_start(params,dummy);
52 
53   MED_VARGS_DEF(const, med_idt                 , , fid               );
54   MED_VARGS_DEF(const, char*            , const  , localizationname  );
55   MED_VARGS_DEF(const, med_switch_mode         , , switchmode        );
56   MED_VARGS_DEF(, med_float*      , const  , elementcoordinate       );
57   MED_VARGS_DEF(, med_float*      , const  , ipointcoordinate        );
58   MED_VARGS_DEF(, med_float*      , const  , weight                  );
59   MED_VARGS_DEF(, med_err *                     ,, fret              );
60 
61   /*
62    * On inhibe le gestionnaire d'erreur HDF 5
63    */
64   _MEDmodeErreurVerrouiller();
65 
66   /*
67    * MED_GAUSS_ELNO est un mot cle reserve
68    */
69   if (! strcmp(localizationname,MED_GAUSS_ELNO)) {
70     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_LOCALIZATION,localizationname);
71     goto ERROR;
72   }
73 
74 
75   if ( MEDgaussLire(fid,
76 		    elementcoordinate,
77 		    ipointcoordinate,weight, switchmode, (char *) localizationname) < 0 ) {
78     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDgaussLire");
79     SSCRUTE(localizationname);
80     goto ERROR;
81   }
82 
83 
84   _ret = 0;
85 
86  ERROR:
87 
88   va_end(params);
89   *fret = _ret;
90 
91   return;
92 }
93