Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
cafd4e6a
Commit
cafd4e6a
authored
10 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Return constant file suffix string pointers.
parent
ea5bb1f1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cdi.h
+1
-1
1 addition, 1 deletion
src/cdi.h
src/stream.c
+6
-3
6 additions, 3 deletions
src/stream.c
with
7 additions
and
4 deletions
src/cdi.h
+
1
−
1
View file @
cafd4e6a
...
...
@@ -320,7 +320,7 @@ int streamInqTimestep(int streamID, int tsID);
int
streamInqCurTimestepID
(
int
streamID
);
char
*
streamFilename
(
int
streamID
);
char
*
streamFilesuffix
(
int
filetype
);
const
char
*
streamFilesuffix
(
int
filetype
);
off_t
streamNvals
(
int
streamID
);
int
streamInqNvars
(
int
streamID
);
...
...
This diff is collapsed.
Click to expand it.
src/stream.c
+
6
−
3
View file @
cafd4e6a
...
...
@@ -308,11 +308,14 @@ int streamInqByteorder(int streamID)
}
char
*
streamFilesuffix
(
int
filetype
)
const
char
*
streamFilesuffix
(
int
filetype
)
{
// static char *fileSuffix[] = {"", ".grb", ".g2", ".nc", ".nc", ".nc4", ".nc4", ".srv", ".ext", ".ieg"};
static
char
*
fileSuffix
[]
=
{
""
,
".grb"
,
".grb"
,
".nc"
,
".nc"
,
".nc"
,
".nc"
,
".srv"
,
".ext"
,
".ieg"
};
int
size
=
(
int
)
(
sizeof
(
fileSuffix
)
/
sizeof
(
char
*
));
/* note: the 2nd dimenstion of the fileSuffix array must be equal to or
* larger than the length of the longest suffix (dot and \0 terminator
* included) */
static
const
char
fileSuffix
[][
5
]
=
{
""
,
".grb"
,
".grb"
,
".nc"
,
".nc"
,
".nc"
,
".nc"
,
".srv"
,
".ext"
,
".ieg"
};
int
size
=
(
int
)(
sizeof
(
fileSuffix
)
/
sizeof
(
fileSuffix
[
0
]));
if
(
filetype
>
0
&&
filetype
<
size
)
return
(
fileSuffix
[
filetype
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment