#include <med.h>
#define MESGERR 1
#include <med_utils.h>
#include <string.h>
#include <med.h>
#define MESGERR 1
#include <med_utils.h>
#include <string.h>
int main (
int argc,
char **argv) {
char *componentname = NULL;
char *componentunit = NULL;
int ret=-1;
if (fid < 0) {
goto ERROR;
}
MESSAGE(
"ERROR : How many fields in the file ...");
goto ERROR;
}
for (i=0; i<nfield; i++) {
MESSAGE(
"ERROR : number of field component ...");
goto ERROR;
}
if ((componentname = (
char *) malloc(ncomponent*
MED_SNAME_SIZE+1)) == NULL) {
MESSAGE(
"ERROR : memory allocation ...");
goto ERROR;
}
if ((componentunit = (
char *) malloc(ncomponent*
MED_SNAME_SIZE+1)) == NULL) {
MESSAGE(
"ERROR : memory allocation ...");
goto ERROR;
}
if (
MEDfieldInfo(fid, i+1, fieldname, meshname, &localmesh, &fieldtype,
componentname, componentunit, dtunit, &nstep) < 0) {
free(componentname); free(componentunit);
goto ERROR;
}
free(componentname); free(componentunit);
MESSAGE(
"ERROR : read number of values ...");
goto ERROR;
}
if (nvalues) {
MESSAGE(
"ERROR : memory allocation ...");
goto ERROR;
}
MESSAGE(
"ERROR : read fields values defined on vertices ...");
free(values);
goto ERROR;
}
free(values);
}
geotype = geotypes[j];
geotype)) < 0) {
MESSAGE(
"ERROR : read number of values ...");
goto ERROR;
}
if (nvalues) {
MESSAGE(
"ERROR : memory allocation ...");
goto ERROR;
}
MESSAGE(
"ERROR : read fields values for cells ...");
free(values);
goto ERROR;
}
free(values);
}
}
}
ret=0;
ERROR:
ret=-1;
}
return ret;
}