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
00032 med_err _ret=-1,_err=0;
00033 med_idt _paramidt=0,_cpstid=0;
00034 char _path[MED_TAILLE_NUM_DATA+MED_TAILLE_NOM+1+1]=MED_NUM_DATA;
00035 char _cpstname[2*MED_MAX_PARA+1]="";
00036 med_size _nstep=0;
00037 med_int _intparamtype=0;
00038
00039 MED_VARGS_DECL(const, med_idt , , fid );
00040 MED_VARGS_DECL(const, char * , const , paramname );
00041 MED_VARGS_DECL(, med_parameter_type *, const , paramtype );
00042 MED_VARGS_DECL(, char * , const , description );
00043 MED_VARGS_DECL(, char * , const , dtunit );
00044 MED_VARGS_DECL(, med_int * , const , nstep );
00045 MED_VARGS_DECL(, med_err * ,, fret );
00046
00047 va_list params;
00048 va_start(params,dummy);
00049
00050 MED_VARGS_DEF(const, med_idt , , fid );
00051 MED_VARGS_DEF(const, char * , const , paramname );
00052 MED_VARGS_DEF(, med_parameter_type *, const , paramtype );
00053 MED_VARGS_DEF(, char * , const , description );
00054 MED_VARGS_DEF(, char * , const , dtunit );
00055 MED_VARGS_DEF(, med_int * , const , nstep );
00056 MED_VARGS_DEF(, med_err * ,, fret );
00057
00058
00059
00060
00061 _MEDmodeErreurVerrouiller();
00062
00063
00064
00065
00066 strcat(_path,paramname);
00067 strcat(_path,"/");
00068
00069 if ((_err=_MEDnObjects(fid, _path, &_nstep)) < 0 )
00070 if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
00071 MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_path);
00072 goto ERROR;
00073 }
00074 *nstep=(med_int) _nstep;
00075
00076 if ((_paramidt = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00077 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
00078 goto ERROR;
00079 }
00080
00081
00082
00083
00084 if ( _MEDattrEntierLire(_paramidt, MED_NOM_TYP, &_intparamtype) < 0) {
00085 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_path);
00086 SSCRUTE(MED_NOM_TYP);ISCRUTE(_intparamtype);
00087 goto ERROR;
00088 }
00089 *paramtype = (med_parameter_type) _intparamtype;
00090
00091
00092
00093
00094 if ( _MEDattrStringLire(_paramidt,MED_NOM_DES,MED_TAILLE_DESC,description) < 0) {
00095 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_path);
00096 SSCRUTE(MED_NOM_DES);SSCRUTE(description);
00097 goto ERROR;
00098 }
00099
00100 if ( _MEDobjectGetName( _paramidt,".",0,_cpstname) < 0 ) {
00101 MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);SSCRUTE(_cpstname);
00102 goto ERROR;
00103 }
00104
00105
00106
00107 if ( _MEDattributeStringRdByName(_paramidt,_cpstname,MED_NOM_UNI,MED_TAILLE_PNOM,dtunit) < 0) {
00108 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_path);
00109 SSCRUTE(_cpstname);SSCRUTE(MED_NOM_UNI);SSCRUTE(dtunit);goto ERROR;
00110 }
00111
00112 _ret = 0;
00113
00114 ERROR:
00115
00116
00117 if (_paramidt>0) if (_MEDdatagroupFermer(_paramidt) < 0) {
00118 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00119 ISCRUTE_id(_paramidt);
00120 }
00121
00122 va_end(params);
00123 *fret = _ret;
00124 return;
00125 }