Commit 2f72de35 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add namespace override for cdiStreamSetupVlist.

parent a9388432
......@@ -346,6 +346,8 @@ void streamDefineTaxis(int streamID);
int streamsNewEntry(int filetype);
void streamsInitEntry(int streamID);
void cdiStreamSetupVlist(stream_t *streamptr, int vlistID);
/* default implementation of the overridable function */
void cdiStreamSetupVlist_(stream_t *streamptr, int vlistID);
int stream_new_var(stream_t *streamptr, int gridID, int zaxisID, int tilesetID);
int tstepsNewEntry(stream_t *streamptr);
......
......@@ -46,6 +46,7 @@ static int activeNamespace = 0;
{ .func = (void (*)()) fileClose_serial }, \
{ .func = (void (*)()) cdiStreamOpenDefaultDelegate }, \
{ .func = (void (*)()) cdiStreamDefVlist_ }, \
{ .func = (void (*)()) cdiStreamSetupVlist_ }, \
{ .func = (void (*)()) cdiStreamWriteVar_ }, \
{ .func = (void (*)()) cdiStreamWriteVarChunk_ }, \
{ .func = (void (*)()) 0 }, \
......
......@@ -31,6 +31,7 @@ enum namespaceSwitch
NSSWITCH_FILE_CLOSE,
NSSWITCH_STREAM_OPEN_BACKEND,
NSSWITCH_STREAM_DEF_VLIST_,
NSSWITCH_STREAM_SETUP_VLIST,
NSSWITCH_STREAM_WRITE_VAR_,
NSSWITCH_STREAM_WRITE_VAR_CHUNK_,
NSSWITCH_STREAM_WRITE_VAR_PART_,
......
......@@ -2140,10 +2140,19 @@ int streamTxCode(void)
return STREAM;
}
void
cdiStreamSetupVlist(stream_t *streamptr, int vlistID)
{
void (*myStreamSetupVlist)(stream_t *streamptr, int vlistID)
= (void (*)(stream_t *, int))
namespaceSwitchGet(NSSWITCH_STREAM_SETUP_VLIST).func;
myStreamSetupVlist(streamptr, vlistID);
}
void
cdiStreamSetupVlist_(stream_t *streamptr, int vlistID)
{
vlist_lock(vlistID);
int nvars = vlistNvars(vlistID);
streamptr->vlistID = vlistID;
for (int varID = 0; varID < nvars; varID++ )
......@@ -2157,7 +2166,7 @@ cdiStreamSetupVlist(stream_t *streamptr, int vlistID)
vlistInqVarMissval(vlistID, varID));
}
if (streamptr->filemode == 'w' )
if (streamptr->filemode == 'w')
switch (streamptr->filetype)
{
#ifdef HAVE_LIBNETCDF
......
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