# equcf.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 #define nedfequc F77_FUNC(edfequc,EDFEQUC)
    00026 #define nedfeque F77_FUNC(edfeque,EDFEQUE)
    00027 #define nedfequl F77_FUNC(edfequl,EDFEQUL)
    00028 #define nedfncor F77_FUNC(edfncor,EDFNCOR)
    00029 #define nedfnequ F77_FUNC(edfnequ,EDFNEQU)
    00030 #define nedfequi F77_FUNC(edfequi,EDFEQUI)
    00031
    00032
    00033 #ifdef PPRO_NT
    00034 med_int
    00035 __stdcall EDFEQUC (med_int *fid, char *maa, unsigned int bidon1, med_int *lon1,
    00036                    char *eq, unsigned int bidon2, med_int *lon2, char *desc,                        unsigned int bidon3, med_int *lon3)
    00037 #else
    00038 med_int
    00039 nedfequc (med_int *fid, char *maa,med_int *lon1,char *eq,med_int *lon2,
    00040           char *desc, med_int *lon3)
    00041 #endif
    00042 {
    00043   med_int ret;
    00044   char *fn1, *fn2, *fn3;
    00045
    00046   fn1 = _MED2cstring(maa, (int) * lon1);
    00047   fn2 = _MED2cstring(eq,  (int) * lon2);
    00048   fn3 = _MED1cstring(desc, (int) * lon3,MED_TAILLE_DESC);
    00049
    00050   if (!fn1 || !fn2 || !fn3)
    00051     return(-1);
    00052
    00053   ret = (med_int) MEDequivCr((med_idt) *fid,(char *)fn1,(char *)fn2,
    00054                              (char *)fn3);
    00055
    00056   _MEDcstringFree(fn1);
    00057   _MEDcstringFree(fn2);
    00058   _MEDcstringFree(fn3);
    00059
    00060   return(ret);
    00061 }
    00062
    00063 #ifdef PPRO_NT
    00064 med_int
    00065 __stdcall EDFEQUE (med_int *fid, char *maa, unsigned int bidon1, med_int *lon1,
    00066                    char *eq, unsigned int bidon2, med_int *lon2, med_int *corr,
    00067                    med_int *n, med_int *typ_ent,
    00068                    med_int *typ_geo)
    00069 #else
    00070 med_int
    00071 nedfeque (med_int *fid, char *maa,med_int *lon1, char *eq,med_int *lon2,
    00072           med_int *corr,med_int *n,
    00073           med_int *typ_ent,med_int *typ_geo)
    00074 #endif
    00075 {
    00076   med_int ret;
    00077   char *  fn1, *fn2;
    00078
    00079   fn1 = _MED2cstring(maa, (int) * lon1);
    00080   fn2 = _MED2cstring(eq, (int) * lon2);
    00081
    00082   if (!fn1 || !fn2)
    00083     return(-1);
    00084
    00085   ret = (med_int) MEDequivEcr((med_idt) *fid, (char *)fn1,(char *)fn2,
    00086                               (med_int *) corr, (med_int) *n,
    00087                               (med_entite_maillage) *typ_ent,
    00088                               (med_geometrie_element) *typ_geo);
    00089
    00090   _MEDcstringFree(fn1);
    00091   _MEDcstringFree(fn2);
    00092
    00093   return(ret);
    00094 }
    00095
    00096 #ifdef PPRO_NT
    00097 med_int
    00098 __stdcall EDFEQUL (med_int *fid, char *maa, unsigned int bidon1, med_int *lon1,
    00099                    char *eq, unsigned int bidon2, med_int *lon2,
    00100                    med_int *corr, med_int *n, med_int *typ_ent,
    00101                    med_int *typ_geo)
    00102 #else
    00103 med_int
    00104 nedfequl (med_int *fid, char *maa,med_int *lon1, char *eq,med_int *lon2,
    00105           med_int *corr,med_int *n,
    00106           med_int *typ_ent, med_int *typ_geo)
    00107 #endif
    00108 {
    00109   med_int ret;
    00110   char *  fn1, *fn2;
    00111
    00112   fn1 = _MED2cstring(maa, (int) * lon1);
    00113   fn2 = _MED2cstring(eq, (int) * lon2);
    00114
    00115   if (!fn1 || !fn2)
    00116     return(-1);
    00117
    00118   ret = (med_int) MEDequivLire((med_idt) *fid, (char *)fn1,(char *)fn2,
    00119                                (med_int *) corr, (med_int) *n,
    00120                                (med_entite_maillage) *typ_ent,
    00121                                (med_geometrie_element) *typ_geo);
    00122
    00123   _MEDcstringFree(fn1);
    00124   _MEDcstringFree(fn2);
    00125
    00126   return(ret);
    00127 }
    00128
    00129 #ifdef PPRO_NT
    00130 med_int
    00131 __stdcall EDFNCOR(med_int *fid, char *maa, unsigned int bidon1, med_int *lon1,
    00132                   char *eq, unsigned int bidon2, med_int *lon2,
    00133                   med_int *typ_ent, med_int *typ_geo)
    00134 #else
    00135 med_int
    00136 nedfncor(med_int *fid, char *maa,med_int *lon1, char *eq, med_int *lon2,
    00137          med_int *typ_ent, med_int *typ_geo)
    00138 #endif
    00139 {
    00140   med_int ret;
    00141   char *  fn1, *fn2;
    00142
    00143   fn1 = _MED2cstring(maa, (int) * lon1);
    00144   fn2 = _MED2cstring(eq, (int) * lon2);
    00145
    00146   if (!fn1 || !fn2)
    00147     return(-1);
    00148
    00149   ret = (med_int) MEDnCorres((med_idt) *fid,(char *)fn1,(char *)fn2,
    00150                              (med_entite_maillage) *typ_ent,
    00151                              (med_geometrie_element) *typ_geo);
    00152
    00153   _MEDcstringFree(fn1);
    00154   _MEDcstringFree(fn2);
    00155
    00156   return(ret);
    00157 }
    00158
    00159
    00160 #ifdef PPRO_NT
    00161 med_int
    00162 __stdcall EDFNEQU(med_int *fid, char *maa, unsigned int bidon, med_int *lon1)
    00163 #else
    00164 med_int
    00165 nedfnequ(med_int *fid, char *maa,med_int *lon1)
    00166 #endif
    00167 {
    00168   med_int ret;
    00169   char *  fn1;
    00170
    00171   fn1 = _MED2cstring(maa, (int) * lon1);
    00172
    00173   if (!fn1)
    00174     return(-1);
    00175
    00176   ret = (med_int) MEDnEquiv((med_idt) *fid,(char *)fn1);
    00177
    00178   _MEDcstringFree(fn1);
    00179
    00180   return(ret);
    00181 }
    00182
    00183
    00184
    00185 #ifdef PPRO_NT
    00186 med_int
    00187 __stdcall EDFEQUI(med_int *fid, char *maa, unsigned int bidon1, med_int *lon1,
    00188                   med_int *ind, char *eq, unsigned int bidon2, char *des,                          unsigned int bidon3)
    00189 #else
    00190 med_int
    00191 nedfequi(med_int *fid, char *maa,med_int *lon1,med_int *ind, char *eq,
    00192          char *des)
    00193 #endif
    00194 {
    00195   med_int ret;
    00196   char *  fn1, * fs2;
    00197   char fs1[MED_TAILLE_DESC+1];
    00198   fn1 = _MED2cstring(maa, (int) * lon1);
    00199   fs2 = malloc(sizeof(char)*MED_TAILLE_NOM);
    00200   if (!(fn1&&fs2))
    00201     return(-1);
    00202
    00203   ret = (med_int) MEDequivInfo((med_idt) *fid,(char *)fn1,(int) *ind,
    00204                                (char *)fs2, (char *)fs1);
    00205
    00206   strncpy(eq,fs2,MED_TAILLE_NOM);
    00207   _MEDfstring(eq,MED_TAILLE_NOM);
    00208   strncpy(des,fs1,MED_TAILLE_DESC);
    00209   _MEDfstring(des,MED_TAILLE_DESC);
    00210
    00211   _MEDcstringFree(fn1);
    00212   free(fs2);
    00213
    00214   return(ret);
    00215 }
    00216