Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
4d9e7157
Commit
4d9e7157
authored
Oct 28, 2016
by
Uwe Schulzweida
Browse files
parse_buffer_to_pml: removed ':' from listkeyX string.
parent
100a03ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CMOR_lite.c
View file @
4d9e7157
...
...
@@ -279,12 +279,16 @@ void apply_cmor_table(const char *filename, int nvars, int vlistID2, var_t *vars
}
else
{
if
(
cdoVerbose
)
cdoPrint
(
"
Key >
%s
<
not supported!"
,
key
);
if
(
cdoVerbose
)
cdoPrint
(
"
Attribute %s:
%s not supported!"
,
varname
,
key
);
}
}
if
(
lvalid_min
&&
lvalid_max
)
vars
[
varID
].
checkvalid
=
true
;
}
else
{
cdoPrint
(
"Variable %s not found!"
,
varname
);
}
}
list_destroy
(
pml
);
...
...
src/parse_cmor_table.c
View file @
4d9e7157
...
...
@@ -73,7 +73,10 @@ char *getElementValue(char *pline)
{
while
(
isspace
((
int
)
*
pline
)
)
pline
++
;
size_t
len
=
strlen
(
pline
);
while
(
isspace
((
int
)
*
(
pline
+
len
-
1
))
&&
len
)
{
*
(
pline
+
len
-
1
)
=
0
;
len
--
;}
if
(
*
pline
!=
'"'
&&
*
pline
!=
'\''
)
for
(
size_t
i
=
1
;
i
<
len
;
++
i
)
if
(
pline
[
i
]
==
'!'
)
{
pline
[
i
]
=
0
;
len
=
i
;
break
;
}
while
(
isspace
((
int
)
*
(
pline
+
len
-
1
))
&&
len
)
{
*
(
pline
+
len
-
1
)
=
0
;
len
--
;
}
return
pline
;
}
...
...
@@ -84,8 +87,8 @@ void parse_buffer_to_pml(list_t *pml, size_t buffersize, char *buffer)
char
line
[
4096
];
char
name
[
256
];
char
*
pline
;
char
listkey1
[]
=
"axis_entry
:
"
;
char
listkey2
[]
=
"variable_entry
:
"
;
char
listkey1
[]
=
"axis_entry"
;
char
listkey2
[]
=
"variable_entry"
;
int
linenumber
=
0
;
int
listtype
=
0
;
list_t
*
kvl
=
NULL
;
...
...
@@ -345,8 +348,10 @@ list_t *cdo_parse_cmor_file(const char *filename)
if
(
buffer
[
0
]
==
'{'
)
parse_json_buffer_to_pml
(
pml
,
filesize
,
buffer
);
else
else
if
(
strncmp
(
buffer
,
"table_id:"
,
9
)
==
0
)
parse_buffer_to_pml
(
pml
,
filesize
,
buffer
);
else
cdoAbort
(
"Invalid CMOR table (file: %s)!"
,
filename
);
Free
(
buffer
);
...
...
Write
Preview
Supports
Markdown
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