# procf.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 <stdlib.h>
    00023 #include <string.h>
    00024
    00025
    00026 #define nedfnpro F77_FUNC(edfnpro,EDFNPRO)
    00027 #define nedfproi F77_FUNC(edfproi,EDFPROI)
    00028 #define nedfpfle F77_FUNC(edfpfle,EDFPFLE)
    00029 #define nedfnpfl F77_FUNC(edfnpfl,EDFNPFL)
    00030 #define nedfpfll F77_FUNC(edfpfll,EDFPFLL)
    00031
    00032
    00033 #ifdef PPRO_NT
    00034 med_int
    00035 __stdcall EDFPROI(med_int *fid, med_int *indice, char *pro,
    00036                   unsigned int bidon, med_int *n)
    00037 #else
    00038 med_int
    00039 nedfproi(med_int *fid,med_int *indice, char *pro,med_int *n)
    00040 #endif
    00041 {
    00042   med_int ret;
    00043   char fs1[MED_TAILLE_NOM+1];
    00044
    00045   ret = (med_int) MEDprofilInfo((med_idt)*fid,(med_int) *indice, (char *) fs1,
    00046                              (med_int *) n);
    00047
    00048   strncpy(pro,fs1,MED_TAILLE_NOM);
    00049   _MEDfstring(pro,MED_TAILLE_NOM);
    00050
    00051   return(ret);
    00052 }
    00053
    00054
    00055 #ifdef PPRO_NT
    00056 med_int
    00057 __stdcall EDFNPRO(med_int *fid)
    00058 #else
    00059 med_int
    00060 nedfnpro(med_int *fid)
    00061 #endif
    00062 {
    00063   med_int ret;
    00064
    00065   ret = (med_int) MEDnProfil((med_idt) *fid);
    00066
    00067   return(ret);
    00068 }
    00069
    00070
    00071 #ifdef PPRO_NT
    00072 med_int
    00073 __stdcall EDFPFLE(med_int *fid, med_int *pflval, med_int *n, char *nom,
    00074                   unsigned int bidon1, med_int *lon1)
    00075 #else
    00076 med_int
    00077 nedfpfle(med_int *fid, med_int *pflval, med_int *n,
    00078          char *nom, med_int *lon1)
    00079 #endif
    00080 {
    00081   med_int ret;
    00082   char *fn1;
    00083
    00084   fn1 = _MED2cstring(nom, (int) * lon1);
    00085
    00086   if (!fn1)
    00087     return(-1);
    00088
    00089   ret = (med_int) MEDprofilEcr((med_idt) *fid,(med_int *) pflval,
    00090                                (med_int) *n,(char *)fn1);
    00091
    00092   _MEDcstringFree(fn1);
    00093
    00094   return (ret);
    00095 }
    00096
    00097
    00098
    00099
    00100 #ifdef PPRO_NT
    00101 med_int
    00102 __stdcall EDFNPFL(med_int *fid,char *nom, unsigned int bidon1, med_int *lon1)
    00103 #else
    00104 med_int
    00105 nedfnpfl(med_int *fid,char *nom, med_int *lon1)
    00106 #endif
    00107 {
    00108   med_int ret;
    00109   char *fn1;
    00110
    00111   fn1 = _MED2cstring(nom, (int) * lon1);
    00112
    00113   if (!fn1)
    00114     return(-1);
    00115
    00116   ret = (med_int) MEDnValProfil((med_idt) *fid,(char *)fn1);
    00117
    00118   _MEDcstringFree(fn1);
    00119
    00120   return (ret);
    00121 }
    00122
    00123
    00124 #ifdef PPRO_NT
    00125 med_int
    00126 __stdcall EDFPFLL(med_int *fid, med_int *pflval,char *nom,
    00127                   unsigned int bidon1, med_int *lon1)
    00128 #else
    00129 med_int
    00130 nedfpfll(med_int *fid, med_int *pflval,
    00131          char *nom, med_int *lon1)
    00132 #endif
    00133 {
    00134   med_int ret;
    00135   char *fn1;
    00136
    00137   fn1 = _MED2cstring(nom, (int) * lon1);
    00138
    00139   if (!fn1)
    00140     return(-1);
    00141
    00142   ret = (med_int) MEDprofilLire((med_idt) *fid,(med_int *) pflval,
    00143                                 (char *)fn1);
    00144
    00145   _MEDcstringFree(fn1);
    00146
    00147   return (ret);
    00148 }
    00149