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
60804357
Commit
60804357
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
streamOpenReadQuery(): return CDI_EQNAVAIL for non NetCDF data.
parent
7219f044
No related branches found
No related tags found
2 merge requests
!34
Version 2.2.0
,
!27
M214003/develop
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cdi.h
+1
-0
1 addition, 0 deletions
src/cdi.h
src/cdi_error.c
+6
-4
6 additions, 4 deletions
src/cdi_error.c
src/stream.c
+2
-0
2 additions, 0 deletions
src/stream.c
with
9 additions
and
4 deletions
src/cdi.h
+
1
−
0
View file @
60804357
...
...
@@ -59,6 +59,7 @@ extern "C" {
#define CDI_EUNC4 -26 // Unsupported NetCDF4 structure
#define CDI_EDIMSIZE -27 // Invalid dimension size
#define CDI_EQENF -50 // Query entries not found
#define CDI_EQNAVAIL -51 // Query not available for file type
#define CDI_ELIMIT -99 // Internal limits exceeded
// File types
...
...
This diff is collapsed.
Click to expand it.
src/cdi_error.c
+
6
−
4
View file @
60804357
...
...
@@ -9,6 +9,7 @@ cdiStringError(int cdiErrno)
// clang-format off
static
const
char
UnknownError
[]
=
"Unknown Error"
;
static
const
char
_ETMOF
[]
=
"Too many open files"
;
static
const
char
_EINVAL
[]
=
"Invalid argument"
;
static
const
char
_EISDIR
[]
=
"Is a directory"
;
static
const
char
_EISEMPTY
[]
=
"File is empty"
;
static
const
char
_EUFTYPE
[]
=
"Unsupported file type"
;
...
...
@@ -16,9 +17,9 @@ cdiStringError(int cdiErrno)
static
const
char
_EUFSTRUCT
[]
=
"Unsupported file structure"
;
static
const
char
_EUNC4
[]
=
"Unsupported NetCDF4 structure"
;
static
const
char
_EDIMSIZE
[]
=
"Invalid dimension size"
;
static
const
char
_ELIMIT
[]
=
"Internal limits exceeded"
;
static
const
char
_EINVAL
[]
=
"Invalid argument"
;
static
const
char
_EQENF
[]
=
"Query entries not found"
;
static
const
char
_EQNAVAIL
[]
=
"Query not available for file type"
;
static
const
char
_ELIMIT
[]
=
"Internal limits exceeded"
;
switch
(
cdiErrno
)
{
case
CDI_ESYSTEM
:
...
...
@@ -28,6 +29,7 @@ cdiStringError(int cdiErrno)
return
cp
;
}
case
CDI_ETMOF
:
return
_ETMOF
;
case
CDI_EINVAL
:
return
_EINVAL
;
case
CDI_EISDIR
:
return
_EISDIR
;
case
CDI_EISEMPTY
:
return
_EISEMPTY
;
case
CDI_EUFTYPE
:
return
_EUFTYPE
;
...
...
@@ -35,9 +37,9 @@ cdiStringError(int cdiErrno)
case
CDI_EUFSTRUCT
:
return
_EUFSTRUCT
;
case
CDI_EUNC4
:
return
_EUNC4
;
case
CDI_EDIMSIZE
:
return
_EDIMSIZE
;
case
CDI_ELIMIT
:
return
_ELIMIT
;
case
CDI_EINVAL
:
return
_EINVAL
;
case
CDI_EQENF
:
return
_EQENF
;
case
CDI_EQNAVAIL
:
return
_EQNAVAIL
;
case
CDI_ELIMIT
:
return
_ELIMIT
;
}
// clang-format on
return
UnknownError
;
...
...
This diff is collapsed.
Click to expand it.
src/stream.c
+
2
−
0
View file @
60804357
...
...
@@ -846,6 +846,8 @@ streamOpenReadQuery(const char *filename, CdiQuery *query)
int
filetype
=
cdiGetFiletype
(
filename
,
&
byteorder
);
if
(
filetype
<
0
)
return
filetype
;
if
(
cdiBaseFiletype
(
filetype
)
!=
CDI_FILETYPE_NETCDF
)
return
CDI_EQNAVAIL
;
int
streamID
=
streamOpen
(
filename
,
"r"
,
filetype
);
if
(
streamID
>=
0
)
{
...
...
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