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 <string.h>
22 #include <stdlib.h>
23 #include <med_outils.h>
24 
25 /**\ingroup MEDfield
26   \brief \MEDfieldnValueWithProfileBrief
27   \param fid \fid
28   \param fieldname \fieldname
29   \param numdt \numdt
30   \param numit \numit
31   \param entitype \entitype
32   \param geotype \geotype
33   \param profileit \profileit
34   \param storagemode \storagemode
35   \param profilename \profilename
36   \param profilesize \profilesize
37   \param localizationname \localizationname
38   \param nintegrationpoint \nintegrationpoint
39   \retval med_int \nvalue
40   \details \MEDfieldnValueWithProfileDetails
41   \par Remarques
42  */
43 
44 med_int
MEDfieldnValueWithProfile(const med_idt fid,const char * const fieldname,const med_int numdt,const med_int numit,const med_entity_type entitype,const med_geometry_type geotype,const int profileit,const med_storage_mode storagemode,char * const profilename,med_int * const profilesize,char * const localizationname,med_int * const nintegrationpoint)45 MEDfieldnValueWithProfile(const med_idt fid,
46 			  const char * const fieldname,
47 			  const med_int numdt,
48 			  const med_int numit,
49 			  const med_entity_type entitype,
50 			  const med_geometry_type geotype,
51 			  const int profileit,
52 			  const med_storage_mode storagemode,
53 			  char * const profilename,
54 			  med_int * const profilesize,
55 			  char * const localizationname,
56 			  med_int * const nintegrationpoint)
57 {
58  med_int  _ret=-1;
59  char     _profilename[MED_NAME_SIZE+1]="";
60  if ( (_ret = _MEDfieldnValue(fid,  fieldname, numdt, numit,
61 			      entitype,  geotype,
62 			      _profilename,profileit,
63 			      storagemode, profilesize,
64 			      localizationname, nintegrationpoint)) < 0) {
65     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,MED_ERR_FIELD_MSG);
66     SSCRUTE(fieldname);SSCRUTE("_MEDfieldnValue");
67     goto ERROR;
68   }
69 
70  strncpy(profilename,_profilename,MED_NAME_SIZE+1);
71  profilename[MED_NAME_SIZE]='\0';
72 
73  ERROR:
74 
75   return _ret;
76 
77 }
78 
79 
80 
81