_MEDfieldValueAdvancedRd236.c
Aller à la documentation de ce fichier.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
00023 #include <string.h>
00024 #include <stdlib.h>
00025
00026 #include <2.3.6/med23v30.h>
00027 #include <2.3.6/med23v30_proto.h>
00028 #include "2.3.6/med23v30_misc.h"
00029
00030
00031 void _MEDfieldValueAdvancedRd236(int dummy,...) {
00032 va_list params;
00033 va_start(params,dummy);
00034
00035 const med_idt fid = va_arg(params, const med_idt);
00036 const char * const fieldname = va_arg(params, const char * const );
00037 const med_int numdt = va_arg(params, const med_int);
00038 const med_int numit = va_arg(params, const med_int);
00039 const med_entity_type entitytype = va_arg(params, const med_entity_type);
00040 const med_geometry_type geotype = va_arg(params, const med_geometry_type);
00041 const char * const meshname = va_arg(params, const char * const );
00042 const med_storage_mode storagemode = va_arg(params, const med_storage_mode);
00043 const char * const profilename = va_arg(params, const char * const );
00044 const med_switch_mode switchmode = va_arg(params, const med_switch_mode);
00045 const med_int componentselect = va_arg(params, const med_int);
00046 const med_filter* const filter = va_arg(params, const med_filter* const );
00047 unsigned char* const value = va_arg(params, unsigned char * const );
00048 med_err * fret = va_arg(params, med_err *);
00049
00050 med_err _ret=-1;
00051
00052
00053 med_bool _filterparameterexist=MED_FALSE;
00054
00055 char _localizationname [MED_NAME_SIZE+1]="";
00056 char _profilename [MED_NAME_SIZE+1]="";
00057 char _geotypename[MED_TAILLE_NOM_ENTITE+1]="";
00058 char _pfltmp [MED_NAME_SIZE+1]="";
00059 med_filter * _filter = NULL;
00060 med_filter _tmpfilter = MED_FILTER_INIT;
00061 med_filter _paramfilter = MED_FILTER_INIT;
00062
00063 if (filter) {
00064 _filter=(med_filter*)(filter); _filterparameterexist=MED_TRUE;
00065 }
00066 else {
00067 _filter=&_tmpfilter;
00068
00069
00070
00071 (*_filter).constituentselect = componentselect;
00072 (*_filter).switchmode = switchmode;
00073 (*_filter).storagemode = storagemode;
00074 strcpy((*_filter).profilename,profilename);
00075
00076 }
00077
00078
00079
00080
00081
00082 _MEDmodeErreurVerrouiller();
00083
00084
00085
00086
00087 if (_filterparameterexist)
00088 if ( (*_filter).filterarraysize ) {
00089 MED_ERR_(_ret,MED_ERR_NULL,MED_ERR_FILTER,MED_ERR_VALUE_MSG);
00090 ISCRUTE((*_filter).filterarraysize);
00091 goto ERROR;
00092 }
00093
00094 NOFINALBLANK(profilename,ERROR);
00095
00096 if ( strlen((*_filter).profilename) == 0 ) {
00097
00098 _profilename[0]='\0';
00099
00100 } else {
00101 strncpy(_profilename,(*_filter).profilename,MED_NAME_SIZE+1);
00102 _profilename[MED_NAME_SIZE]='\0';
00103
00104
00105
00106 }
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 #ifdef _DEBUG_
00120 ISCRUTE((*_filter).nbofentity );
00121 ISCRUTE((*_filter).nbofvaluesperentity );
00122 ISCRUTE((*_filter).nbofconstituentpervalue );
00123 ISCRUTE((*_filter).constituentselect );
00124 ISCRUTE_int((*_filter).switchmode );
00125 ISCRUTE((*_filter).filterarraysize );
00126 ISCRUTE((*_filter).profilearraysize );
00127 ISCRUTE_int((*_filter).storagemode );
00128 SSCRUTE((*_filter).profilename );
00129 #endif
00130
00131
00132
00133
00134 if ( MEDchampLire( fid, (char *) meshname, (char *) fieldname, (unsigned char *) value,
00135 (*_filter).switchmode, (*_filter).constituentselect,
00136 _localizationname, _pfltmp,
00137 (*_filter).storagemode,
00138 entitytype, geotype, numdt, numit) < 0 ) {
00139 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDchampLire");
00140 SSCRUTE(fieldname);SSCRUTE(_profilename);
00141 goto ERROR;
00142 }
00143
00144 if (strcmp(_profilename,_pfltmp)) {
00145 MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_PROFILE,MED_ERR_NAME_MSG);
00146 SSCRUTE(_profilename);SSCRUTE(_pfltmp);
00147 goto ERROR;
00148 }
00149
00150
00151
00152
00153
00154 _ret = 0;
00155
00156 ERROR:
00157
00158
00159
00160 va_end(params);
00161 *fret = _ret;
00162 return;
00163 }
00164
00165
00166
00167