# MEDparameterInfo.c

Aller à la documentation de ce fichier.

    00001 /*  This file is part of MED.
    00002  *
    00003  *  COPYRIGHT (C) 1999 - 2012  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_config.h"
    00020 #include <med.h>
    00021 #include "med_outils.h"
    00022 #include <string.h>
    00023
    00037 med_err MEDparameterInfo(const med_idt            fid,
    00038                          const int                paramit,
    00039                          char   *             const paramname,
    00040                          med_parameter_type * const paramtype,
    00041                          char *               const description,
    00042                          char *               const dtunit,
    00043                          med_int *            const nstep)
    00044 {
    00045   med_err  _ret = -1;
    00046   char     _parampath[MED_TAILLE_NUM_DATA+MED_NAME_SIZE+1] = MED_NUM_DATA;
    00047   int      _num = paramit -1;
    00048
    00049   _MEDmodeErreurVerrouiller();
    00050
    00051   /* on recupere le nom du parametre */
    00052   if ( _MEDobjectGetName(fid, _parampath ,_num, paramname) < 0 ) {
    00053     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_parampath);ISCRUTE_int(paramit);
    00054     ISCRUTE_id(fid);
    00055     goto ERROR;
    00056   }
    00057   strcat(_parampath,paramname);
    00058
    00059   /* on lit le reste des infos */
    00060   if ( MEDparameterInfoByName(fid, paramname, paramtype, description,
    00061                              dtunit, nstep)  < 0) {
    00062     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,MED_ERR_PARAM_MSG);
    00063     SSCRUTE(paramname);SSCRUTE(_parampath);SSCRUTE("MEDparameterInfoByName");
    00064     goto ERROR;
    00065   }
    00066
    00067   _ret = 0;
    00068  ERROR:
    00069
    00070   return _ret;
    00071 }