00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "med_config.h"
00020 #include <med.h>
00021 #include "med_outils.h"
00022 #include <string.h>
00023
00024 #include <2.3.6/med23v30.h>
00025 #include <2.3.6/med23v30_proto.h>
00026 #include "2.3.6/med23v30_misc.h"
00027
00028
00029 void _MEDparameterInfoByName236(int dummy, ...) {
00030
00031 va_list params;
00032 va_start(params,dummy);
00033
00034 const med_idt fid = va_arg(params,const med_idt );
00035 const char * const paramname = va_arg(params,const char * const );
00036 med_parameter_type * const paramtype = va_arg(params,med_parameter_type * const );
00037 char * const description = va_arg(params,char * const );
00038 char * const dtunit = va_arg(params,char * const );
00039 med_int * const nstep = va_arg(params,med_int * const );
00040 med_err * fret = va_arg(params,med_err *);
00041
00042
00043 med_err _ret=-1,_err=0;
00044 med_idt _paramidt=0,_cpstid=0;
00045 char _path[MED_TAILLE_NUM_DATA+MED_TAILLE_NOM+1+1]=MED_NUM_DATA;
00046 char _cpstname[2*MED_MAX_PARA+1]="";
00047 med_size _nstep=0;
00048 med_int _intparamtype=0;
00049
00050
00051
00052 _MEDmodeErreurVerrouiller();
00053
00054
00055
00056
00057 strcat(_path,paramname);
00058 strcat(_path,"/");
00059
00060 if ((_err=_MEDnObjects(fid, _path, &_nstep)) < 0 )
00061 if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
00062 MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_path);
00063 goto ERROR;
00064 }
00065 *nstep=(med_int) _nstep;
00066
00067 if ((_paramidt = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00068 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
00069 goto ERROR;
00070 }
00071
00072
00073
00074
00075 if ( _MEDattrEntierLire(_paramidt, MED_NOM_TYP, &_intparamtype) < 0) {
00076 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_path);
00077 SSCRUTE(MED_NOM_TYP);ISCRUTE(_intparamtype);
00078 goto ERROR;
00079 }
00080 *paramtype = (med_parameter_type) _intparamtype;
00081
00082
00083
00084
00085 if ( _MEDattrStringLire(_paramidt,MED_NOM_DES,MED_TAILLE_DESC,description) < 0) {
00086 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_path);
00087 SSCRUTE(MED_NOM_DES);SSCRUTE(description);
00088 goto ERROR;
00089 }
00090
00091 if ( _MEDobjectGetName( _paramidt,".",0,_cpstname) < 0 ) {
00092 MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);SSCRUTE(_cpstname);
00093 goto ERROR;
00094 }
00095
00096
00097
00098 if ( _MEDattributeStringRdByName(_paramidt,_cpstname,MED_NOM_UNI,MED_TAILLE_PNOM,dtunit) < 0) {
00099 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_path);
00100 SSCRUTE(_cpstname);SSCRUTE(MED_NOM_UNI);SSCRUTE(dtunit);goto ERROR;
00101 }
00102
00103 _ret = 0;
00104
00105 ERROR:
00106
00107
00108 if (_paramidt>0) if (_MEDdatagroupFermer(_paramidt) < 0) {
00109 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00110 ISCRUTE_id(_paramidt);
00111 }
00112
00113 va_end(params);
00114 *fret = _ret;
00115 return;
00116 }