Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
aa41a8d0
Commit
aa41a8d0
authored
Mar 23, 2007
by
Uwe Schulzweida
Browse files
add nfiles
parent
986f1012
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/stream.c
View file @
aa41a8d0
...
...
@@ -921,6 +921,7 @@ if ( streamID < 0 ) handle_error(streamID);
*/
int
streamOpenRead
(
const
char
*
filenames
)
{
static
char
func
[]
=
"streamOpenRead"
;
int
filetype
,
byteorder
;
int
streamID
;
int
num_fnames
;
...
...
@@ -949,6 +950,15 @@ int streamOpenRead(const char *filenames)
{
streamptr
=
stream_to_pointer
(
streamID
);
streamptr
->
byteorder
=
byteorder
;
if
(
num_fnames
>
0
)
{
int
i
;
streamptr
->
nfiles
=
num_fnames
;
streamptr
->
fnames
=
(
char
**
)
malloc
(
num_fnames
*
sizeof
(
char
*
));
for
(
i
=
0
;
i
<
num_fnames
;
++
i
)
streamptr
->
fnames
[
i
]
=
fnames
[
i
];
}
}
return
(
streamID
);
...
...
@@ -1125,7 +1135,7 @@ void streamClose(int streamID)
}
free
(
streamptr
->
vars
);
for
(
index
=
0
;
index
<
streamptr
->
ntsteps
;
index
++
)
for
(
index
=
0
;
index
<
streamptr
->
ntsteps
;
++
index
)
{
if
(
streamptr
->
tsteps
[
index
].
records
)
free
(
streamptr
->
tsteps
[
index
].
records
);
...
...
@@ -1135,6 +1145,14 @@ void streamClose(int streamID)
if
(
streamptr
->
tsteps
)
free
(
streamptr
->
tsteps
);
if
(
streamptr
->
nfiles
>
0
)
{
for
(
index
=
0
;
index
<
streamptr
->
nfiles
;
++
index
)
free
(
streamptr
->
fnames
[
index
]);
free
(
streamptr
->
fnames
);
}
stream_delete_entry
(
streamptr
);
if
(
vlistID
!=
-
1
)
...
...
src/stream_int.c
View file @
aa41a8d0
...
...
@@ -319,6 +319,10 @@ static void stream_init_entry(STREAM *streamptr)
for
(
i
=
0
;
i
<
MAX_GRIDS_PS
;
i
++
)
streamptr
->
ncxvarID
[
i
]
=
UNDEFID
;
for
(
i
=
0
;
i
<
MAX_GRIDS_PS
;
i
++
)
streamptr
->
ncyvarID
[
i
]
=
UNDEFID
;
for
(
i
=
0
;
i
<
MAX_GRIDS_PS
;
i
++
)
streamptr
->
ncavarID
[
i
]
=
UNDEFID
;
streamptr
->
curfile
=
0
;
streamptr
->
nfiles
=
0
;
streamptr
->
fnames
=
NULL
;
}
...
...
src/stream_int.h
View file @
aa41a8d0
...
...
@@ -215,6 +215,9 @@ typedef struct {
int
unreduced
;
int
compressType
;
int
compressLevel
;
int
curfile
;
int
nfiles
;
char
**
fnames
;
}
STREAM
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment