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
8ae3f448
Commit
8ae3f448
authored
Feb 22, 2018
by
Uwe Schulzweida
Browse files
Added function cdiDelKeys().
parent
52c5ad8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdi_key.c
View file @
8ae3f448
...
...
@@ -111,6 +111,30 @@ int vlist_key_compare(vlist_t *a, int varIDA, vlist_t *b, int varIDB, int keynum
}
int
cdiDelKeys
(
int
cdiID
,
int
varID
)
{
int
status
=
CDI_NOERR
;
cdi_keys_t
*
keysp
=
cdi_get_keysp
(
cdiID
,
varID
);
xassert
(
keysp
!=
NULL
);
for
(
int
keyid
=
0
;
keyid
<
(
int
)
keysp
->
nelems
;
keyid
++
)
{
cdi_key_t
*
keyp
=
&
(
keysp
->
value
[
keyid
]);
if
(
keyp
->
length
&&
keyp
->
v
.
s
)
{
free
(
keyp
->
v
.
s
);
keyp
->
v
.
s
=
NULL
;
keyp
->
length
=
0
;
}
}
keysp
->
nelems
=
0
;
return
status
;
}
int
cdiCopyKeys
(
int
cdiID1
,
int
varID1
,
int
cdiID2
,
int
varID2
)
{
int
status
=
CDI_NOERR
;
...
...
src/vlist.c
View file @
8ae3f448
...
...
@@ -218,6 +218,7 @@ void vlist_delete(vlist_t *vlistptr)
int
vlistID
=
vlistptr
->
self
;
if
(
CDI_Debug
)
Message
(
"call to vlist_delete, vlistID = %d"
,
vlistID
);
cdiDelKeys
(
vlistID
,
CDI_GLOBAL
);
cdiDelAtts
(
vlistID
,
CDI_GLOBAL
);
int
nvars
=
vlistptr
->
nvars
;
...
...
@@ -244,6 +245,7 @@ void vlist_delete(vlist_t *vlistptr)
vlistptr
->
vars
[
varID
].
opt_grib_kvpair_size
=
0
;
vlistptr
->
vars
[
varID
].
opt_grib_kvpair
=
NULL
;
cdiDelKeys
(
vlistID
,
varID
);
cdiDelAtts
(
vlistID
,
varID
);
}
...
...
src/vlist.h
View file @
8ae3f448
...
...
@@ -132,6 +132,7 @@ void cdiVlistDestroy_(int vlistID);
int
vlistInqVarMissvalUsed
(
int
vlistID
,
int
varID
);
int
vlistHasTime
(
int
vlistID
);
int
cdiDelKeys
(
int
vlistID
,
int
varID
);
int
cdiDelAtts
(
int
vlistID
,
int
varID
);
void
vlistUnpack
(
char
*
buffer
,
int
bufferSize
,
int
*
pos
,
...
...
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