# MEDnomDataset.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
    00020 #include <med.h>
    00021 #include <med_config.h>
    00022 #include <med_outils.h>
    00023 #include <string.h>
    00024
    00025 /*
    00026  * - Nom de la fonction : _MEDnomDataset
    00027  * - Description : fournit un nom de dataset
    00028  * - Parametres :
    00029  *     - nom_dataset (OUT) : le nom du data set
    00030  *     - quoi (IN)         : le type de table MED
    00031  *     - type_conn (IN)    : le type de connectivite
    00032  * - Resultat : 0 en cas de succes, -1 sinon
    00033  */
    00034 med_err _MEDnomDataset(char *nom_dataset,med_table quoi,med_connectivite type_conn)
    00035 {
    00036   switch(quoi)
    00037     {
    00038     case MED_COOR :
    00039       strcpy(nom_dataset,MED_NOM_COO);
    00040       break;
    00041
    00042     case MED_COOR_IND1 :
    00043       strcpy(nom_dataset,MED_NOM_IN1);
    00044       break;
    00045
    00046     case MED_COOR_IND2 :
    00047       strcpy(nom_dataset,MED_NOM_IN2);
    00048       break;
    00049
    00050     case MED_COOR_IND3 :
    00051       strcpy(nom_dataset,MED_NOM_IN3);
    00052       break;
    00053
    00054     case MED_CONN :
    00055       switch(type_conn)
    00056         {
    00057         case MED_NOD :
    00058           strcpy(nom_dataset,MED_NOM_NOD);
    00059           break;
    00060
    00061         case MED_DESC :
    00062           strcpy(nom_dataset,MED_NOM_DES);
    00063           break;
    00064
    00065         default :
    00066           return -1;
    00067         }
    00068       break;
    00069
    00070     case MED_NOM :
    00071       strcpy(nom_dataset,MED_NOM_NOM);
    00072       break;
    00073
    00074     case MED_NUM :
    00075       strcpy(nom_dataset,MED_NOM_NUM);
    00076       break;
    00077
    00078     case MED_FAM :
    00079       strcpy(nom_dataset,MED_NOM_FAM);
    00080       break;
    00081
    00082     default :
    00083       return -1;
    00084     }
    00085
    00086   return 0;
    00087 }
    00088