Commit 4016225e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Record: changed srvp to void* exsep

parent aecd49df
......@@ -303,8 +303,8 @@ void printGridInfo(int vlistID)
int i;
double *xvals, *yvals;
double xfirst, xlast, yfirst, ylast;
xvals = malloc(gridsize*sizeof(double));
yvals = malloc(gridsize*sizeof(double));
xvals = (double*) malloc(gridsize*sizeof(double));
yvals = (double*) malloc(gridsize*sizeof(double));
gridInqXvals(gridID, xvals);
gridInqYvals(gridID, yvals);
......
......@@ -127,10 +127,10 @@ typedef struct
int sec3[2];
int sec4[512];
#if defined (HAVE_LIBSERVICE)
srvrec_t *srvp;
srvrec_t *srvp;
#endif
#if defined (HAVE_LIBEXTRA)
extrec_t *extp;
void *exsep;
#endif
#if defined (HAVE_LIBIEG)
iegrec_t *iegp;
......
......@@ -458,7 +458,7 @@ void streamDefByteorder(int streamID, int byteorder)
#if defined (HAVE_LIBSERVICE)
case FILETYPE_SRV:
{
srvrec_t *srvp = streamptr->record->srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
srvp->byteswap = getByteswap(byteorder);
break;
......@@ -467,7 +467,7 @@ void streamDefByteorder(int streamID, int byteorder)
#if defined (HAVE_LIBEXTRA)
case FILETYPE_EXT:
{
extrec_t *extp = streamptr->record->extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
extp->byteswap = getByteswap(byteorder);
break;
......@@ -662,7 +662,7 @@ int cdiStreamOpenDefaultDelegate(const char *filename, const char *filemode,
{
streamptr->record = (Record *) malloc(sizeof(Record));
streamptr->record->buffer = NULL;
streamptr->record->srvp = srvNew();
streamptr->record->exsep = srvNew();
}
break;
}
......@@ -676,7 +676,7 @@ int cdiStreamOpenDefaultDelegate(const char *filename, const char *filemode,
{
streamptr->record = (Record *) malloc(sizeof(Record));
streamptr->record->buffer = NULL;
streamptr->record->extp = extNew();
streamptr->record->exsep = extNew();
}
break;
}
......@@ -1074,7 +1074,7 @@ cdiStreamCloseDefaultDelegate(stream_t *streamptr, int recordBufIsToBeDeleted)
{
fileClose(fileID);
if (recordBufIsToBeDeleted)
srvDelete(streamptr->record->srvp);
srvDelete(streamptr->record->exsep);
break;
}
#endif
......@@ -1083,7 +1083,7 @@ cdiStreamCloseDefaultDelegate(stream_t *streamptr, int recordBufIsToBeDeleted)
{
fileClose(fileID);
if (recordBufIsToBeDeleted)
extDelete(streamptr->record->extp);
extDelete(streamptr->record->exsep);
break;
}
#endif
......
......@@ -78,11 +78,10 @@ int extInqRecord(stream_t *streamptr, int *varID, int *levelID)
int zaxisID = -1;
int header[4];
int vlistID;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
extp = streamptr->record->extp;
*varID = -1;
*levelID = -1;
......@@ -117,7 +116,7 @@ int extReadRecord(stream_t *streamptr, double *data, int *nmiss)
int varID, gridID;
int i, size;
double missval;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
......@@ -126,7 +125,6 @@ int extReadRecord(stream_t *streamptr, double *data, int *nmiss)
recID = streamptr->tsteps[tsID].recIDs[vrecID];
recpos = streamptr->tsteps[tsID].records[recID].position;
varID = streamptr->tsteps[tsID].records[recID].varID;
extp = streamptr->record->extp;
fileSetPos(fileID, recpos, SEEK_SET);
......@@ -204,10 +202,9 @@ int extDefRecord(stream_t *streamptr)
int header[4];
int status = 0;
int pdis, pcat, pnum;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
gridID = streamptr->record->gridID;
extp = streamptr->record->extp;
cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
header[0] = streamptr->record->date;
......@@ -225,12 +222,9 @@ int extDefRecord(stream_t *streamptr)
int extWriteRecord(stream_t *streamptr, const double *data)
{
int fileID;
int status = 0;
extrec_t *extp;
fileID = streamptr->fileID;
extp = streamptr->record->extp;
int fileID = streamptr->fileID;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
extDefDataDP(extp, data);
......@@ -335,11 +329,10 @@ void extScanTimestep1(stream_t *streamptr)
taxis_t *taxis;
int vlistID;
extcompvar_t compVar, compVar0;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
streamptr->curTsID = 0;
extp = streamptr->record->extp;
tsID = tstepsNewEntry(streamptr);
taxis = &streamptr->tsteps[tsID].taxis;
......@@ -469,13 +462,12 @@ int extScanTimestep2(stream_t *streamptr)
taxis_t *taxis;
int vlistID;
extcompvar_t compVar, compVar0;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
streamptr->curTsID = 1;
fileID = streamptr->fileID;
vlistID = streamptr->vlistID;
extp = streamptr->record->extp;
tsID = streamptr->rtsteps;
if ( tsID != 1 )
......@@ -645,7 +637,7 @@ int extScanTimestep(stream_t *streamptr)
taxis_t *taxis;
int rindex, nrecs = 0;
extcompvar_t compVar, compVar0;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
if ( CDI_Debug )
{
......@@ -658,7 +650,6 @@ int extScanTimestep(stream_t *streamptr)
if ( streamptr->rtsteps == 0 )
Error("Internal problem! Missing contents.");
extp = streamptr->record->extp;
tsID = streamptr->rtsteps;
taxis = &streamptr->tsteps[tsID].taxis;
......@@ -796,9 +787,8 @@ void extReadVarDP(stream_t *streamptr, int varID, double *data, int *nmiss)
int recID;
int i;
double missval;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
extp = streamptr->record->extp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
nlevs = streamptr->vars[varID].nlevs;
......@@ -855,9 +845,8 @@ void extReadVarSliceDP(stream_t *streamptr, int varID, int levID, double *data,
int recID;
int i;
double missval;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
extp = streamptr->record->extp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
nlevs = streamptr->vars[varID].nlevs;
......@@ -913,11 +902,10 @@ void extWriteVarDP(stream_t *streamptr, int varID, const double *data)
int tsID;
int vlistID;
int pdis, pcat, pnum;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
if ( CDI_Debug ) Message("streamID = %d varID = %d", streamptr->self, varID);
extp = streamptr->record->extp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
tsID = streamptr->curTsID;
......@@ -959,9 +947,8 @@ void extWriteVarSliceDP(stream_t *streamptr, int varID, int levID, const double
int tsID;
int vlistID;
int pdis, pcat, pnum;
extrec_t *extp;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
extp = streamptr->record->extp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
tsID = streamptr->curTsID;
......
......@@ -68,11 +68,10 @@ int srvInqRecord(stream_t *streamptr, int *varID, int *levelID)
int zaxisID = -1;
int header[8];
int vlistID;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
srvp = streamptr->record->srvp;
*varID = -1;
*levelID = -1;
......@@ -107,7 +106,7 @@ int srvReadRecord(stream_t *streamptr, double *data, int *nmiss)
int varID, gridID;
int i, size;
double missval;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
......@@ -116,7 +115,6 @@ int srvReadRecord(stream_t *streamptr, double *data, int *nmiss)
recID = streamptr->tsteps[tsID].recIDs[vrecID];
recpos = streamptr->tsteps[tsID].records[recID].position;
varID = streamptr->tsteps[tsID].records[recID].varID;
srvp = streamptr->record->srvp;
fileSetPos(fileID, recpos, SEEK_SET);
......@@ -184,10 +182,9 @@ int srvDefRecord(stream_t *streamptr)
int xsize, ysize;
int datatype;
int pdis, pcat, pnum;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
gridID = streamptr->record->gridID;
srvp = streamptr->record->srvp;
cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
header[0] = pnum;
......@@ -223,12 +220,9 @@ int srvDefRecord(stream_t *streamptr)
int srvWriteRecord(stream_t *streamptr, const double *data)
{
int fileID;
int status = 0;
srvrec_t *srvp;
fileID = streamptr->fileID;
srvp = streamptr->record->srvp;
int fileID = streamptr->fileID;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
srvDefDataDP(srvp, data);
......@@ -337,11 +331,10 @@ void srvScanTimestep1(stream_t *streamptr)
taxis_t *taxis;
int vlistID;
SRVCOMPVAR compVar, compVar0;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
streamptr->curTsID = 0;
srvp = streamptr->record->srvp;
tsID = tstepsNewEntry(streamptr);
taxis = &streamptr->tsteps[tsID].taxis;
......@@ -472,13 +465,12 @@ int srvScanTimestep2(stream_t *streamptr)
taxis_t *taxis;
int vlistID;
SRVCOMPVAR compVar, compVar0;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
streamptr->curTsID = 1;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
srvp = streamptr->record->srvp;
tsID = streamptr->rtsteps;
if ( tsID != 1 )
......@@ -647,7 +639,7 @@ int srvScanTimestep(stream_t *streamptr)
taxis_t *taxis;
int rindex, nrecs = 0;
SRVCOMPVAR compVar, compVar0;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
if ( CDI_Debug )
{
......@@ -660,7 +652,6 @@ int srvScanTimestep(stream_t *streamptr)
if ( streamptr->rtsteps == 0 )
Error("Internal problem! Missing contents.");
srvp = streamptr->record->srvp;
tsID = streamptr->rtsteps;
taxis = &streamptr->tsteps[tsID].taxis;
......@@ -799,9 +790,8 @@ void srvReadVarDP(stream_t *streamptr, int varID, double *data, int *nmiss)
int recID;
int i;
double missval;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
srvp = streamptr->record->srvp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
nlevs = streamptr->vars[varID].nlevs;
......@@ -847,9 +837,8 @@ void srvReadVarSliceDP(stream_t *streamptr, int varID, int levID, double *data,
int recID;
int i;
double missval;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
srvp = streamptr->record->srvp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
nlevs = streamptr->vars[varID].nlevs;
......@@ -896,12 +885,11 @@ void srvWriteVarDP(stream_t *streamptr, int varID, const double *data)
int tsID;
int vlistID;
int pdis, pcat, pnum;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
if ( CDI_Debug )
Message("streamID = %d varID = %d", streamptr->self, varID);
srvp = streamptr->record->srvp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
tsID = streamptr->curTsID;
......@@ -963,9 +951,8 @@ void srvWriteVarSliceDP(stream_t *streamptr, int varID, int levID, const double
int tsID;
int vlistID;
int pdis, pcat, pnum;
srvrec_t *srvp;
srvrec_t *srvp = (srvrec_t*) streamptr->record->exsep;
srvp = streamptr->record->srvp;
vlistID = streamptr->vlistID;
fileID = streamptr->fileID;
tsID = streamptr->curTsID;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment