_MEDequivalenceCorrespondenceSizeInfo236.c

Aller à la documentation de ce fichier.
00001 /*  This file is part of MED.
00002  *
00003  *  COPYRIGHT (C) 1999 - 2011  EDF R&D, CEA/DEN
00004  *  MED is free software: you can redistribute it and/or modify
00005  *  it under the terms of the GNU Lesser General Public License as published by
00006  *  the Free Software Foundation, either version 3 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  MED is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Lesser General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Lesser General Public License
00015  *  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 
00019 #include <med.h>
00020 #include <med_config.h>
00021 #include <med_outils.h>
00022 #include <string.h>
00023 #include <stdlib.h>
00024 
00025 
00026 #include <2.3.6/med23v30.h>
00027 #include <2.3.6/med23v30_proto.h>
00028 #include "2.3.6/med23v30_misc.h"
00029 
00030 void _MEDequivalenceCorrespondenceSizeInfo236( int dummy, ...) {
00031 
00032 
00033   med_err   _ret=-1,_err=-1;
00034   char      _path[MED_TAILLE_MAA+MED_TAILLE_EQS+2*MED_TAILLE_NOM+1+
00035                  2*MED_TAILLE_NOM_ENTITE+1+1]=MED_MAA;
00036   char      _entgeoname[2*MED_TAILLE_NOM_ENTITE+2]="";
00037   med_size  _nocstpncorrespondence=0;
00038   med_int   _intentitytype;
00039   med_int   _intgeotype;
00040   int       _num;
00041 
00042   MED_VARGS_DECL(const, med_idt              , , fid      );
00043   MED_VARGS_DECL(const, char * , const         , meshname );
00044   MED_VARGS_DECL(const, char * , const         , equivname);
00045   MED_VARGS_DECL(const, med_int              , , numdt    );
00046   MED_VARGS_DECL(const, med_int              , , numit    );
00047   MED_VARGS_DECL(const, int                  , , corit    );
00048   MED_VARGS_DECL(, med_entity_type *, const    , entitype );
00049   MED_VARGS_DECL(, med_geometry_type*, const   , geotype  );
00050   MED_VARGS_DECL(, med_int *, const            , nentity  );
00051   MED_VARGS_DECL(, med_err *                  ,, fret     );
00052 
00053   va_list params;
00054   va_start(params,dummy);
00055 
00056   MED_VARGS_DEF(const, med_idt              , , fid      );
00057   MED_VARGS_DEF(const, char * , const         , meshname );
00058   MED_VARGS_DEF(const, char * , const         , equivname);
00059   MED_VARGS_DEF(const, med_int              , , numdt    );
00060   MED_VARGS_DEF(const, med_int              , , numit    );
00061   MED_VARGS_DEF(const, int                  , , corit    );
00062   MED_VARGS_DEF(, med_entity_type *, const    , entitype );
00063   MED_VARGS_DEF(, med_geometry_type*, const   , geotype  );
00064   MED_VARGS_DEF(, med_int *, const            , nentity  );
00065   MED_VARGS_DEF(, med_err *                  ,, fret     );
00066 
00067   _num = corit -1;
00068 
00069   if ( (numdt != MED_NO_DT) || (numit != MED_NO_IT) ) {
00070     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_PARAMETER,"");
00071     ISCRUTE(numdt);ISCRUTE(numit); goto ERROR;
00072   }
00073 
00074   /*
00075    * On inhibe le gestionnaire d'erreur
00076    */
00077   _MEDmodeErreurVerrouiller();
00078 
00079   strcat(_path,meshname);
00080   strcat(_path,MED_EQS);
00081   strcat(_path,equivname);
00082   strcat(_path,"/");
00083 
00084 
00085   /*
00086    * On recupere le nom de <entitype>[.<geotype>]
00087    */
00088   if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) {
00089     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit);
00090     goto ERROR;
00091   }
00092 
00093   if ( _MEDattributeNumRdByName(fid, _path, MED_NOM_ENT,MED_INTERNAL_INT,(unsigned char *)&_intentitytype) < 0 ) {
00094     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
00095     SSCRUTE(_path);ISCRUTE(_intentitytype);goto ERROR;
00096   }
00097   *entitype = (med_entity_type) _intentitytype;
00098 
00099   if ( _MEDattributeNumRdByName(fid, _path,MED_NOM_GEO,MED_INTERNAL_INT,(unsigned char *)&_intgeotype) < 0) {
00100     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
00101     SSCRUTE(_path);ISCRUTE(_intgeotype);goto ERROR;
00102   }
00103   *geotype = (med_geometry_type) _intgeotype;
00104 
00105 
00106   if (  _MEDattributeNumRdByName(fid, _path, MED_NOM_NBR,MED_INTERNAL_INT, (unsigned char *) nentity) < 0) {
00107     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
00108     SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentity);
00109     goto ERROR;
00110   }
00111 
00112   _ret = 0;
00113  ERROR:
00114 
00115   va_end(params);
00116   *fret = _ret;
00117 
00118   return;
00119 }

Généré le Mon Nov 7 16:21:23 2011 pour MED fichier par  doxygen 1.6.1