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
9ef4ff35
Commit
9ef4ff35
authored
1 month ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
taxis_t: added cdi_keys_t
parent
46ebf9d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!136
M214003/develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/taxis.c
+15
-2
15 additions, 2 deletions
src/taxis.c
src/taxis.h
+3
-0
3 additions, 0 deletions
src/taxis.h
with
18 additions
and
2 deletions
src/taxis.c
+
15
−
2
View file @
9ef4ff35
...
...
@@ -102,7 +102,6 @@ void
ptaxisInit
(
taxis_t
*
taxisptr
)
{
taxisptr
->
self
=
CDI_UNDEFID
;
taxisptr
->
datatype
=
CDI_DATATYPE_FLT64
;
taxisptr
->
type
=
DefaultTimeType
;
taxisptr
->
calendar
=
CDI_Default_Calendar
;
taxisptr
->
unit
=
DefaultTimeUnit
;
...
...
@@ -120,6 +119,10 @@ ptaxisInit(taxis_t *taxisptr)
taxisptr
->
name
=
NULL
;
taxisptr
->
longname
=
NULL
;
taxisptr
->
units
=
NULL
;
cdiInitKeys
(
&
taxisptr
->
keys
);
cdiDefVarKeyInt
(
&
taxisptr
->
keys
,
CDI_KEY_DATATYPE
,
CDI_DATATYPE_FLT64
);
taxisptr
->
datatype
=
CDI_DATATYPE_FLT64
;
}
static
taxis_t
*
...
...
@@ -235,6 +238,7 @@ taxisDefType(int taxisID, int taxistype)
if
(
taxisptr
->
type
!=
taxistype
)
{
taxisptr
->
type
=
taxistype
;
cdiDefVarKeyInt
(
&
taxisptr
->
keys
,
CDI_KEY_DATATYPE
,
CDI_DATATYPE_FLT64
);
taxisptr
->
datatype
=
CDI_DATATYPE_FLT64
;
delete_refcount_string
(
taxisptr
->
units
);
taxisptr
->
units
=
NULL
;
...
...
@@ -849,6 +853,7 @@ taxisPtr(int taxisID)
void
ptaxisDefDatatype
(
taxis_t
*
taxisptr
,
int
datatype
)
{
cdiDefVarKeyInt
(
&
taxisptr
->
keys
,
CDI_KEY_DATATYPE
,
datatype
);
taxisptr
->
datatype
=
datatype
;
}
...
...
@@ -1349,7 +1354,6 @@ ptaxisCopy(taxis_t *dest, taxis_t *source)
reshLock
();
// memcpy(dest, source, sizeof(taxis_t));
dest
->
datatype
=
source
->
datatype
;
dest
->
type
=
source
->
type
;
dest
->
calendar
=
source
->
calendar
;
dest
->
unit
=
source
->
unit
;
...
...
@@ -1374,6 +1378,10 @@ ptaxisCopy(taxis_t *dest, taxis_t *source)
dest
->
units
=
dup_refcount_string
(
source
->
units
);
if
(
dest
->
self
!=
CDI_UNDEFID
)
reshSetStatus
(
dest
->
self
,
&
taxisOps
,
RESH_DESYNC_IN_USE
);
dest
->
datatype
=
source
->
datatype
;
cdiInitKeys
(
&
dest
->
keys
);
cdiCopyVarKeys
(
&
source
->
keys
,
&
dest
->
keys
);
reshUnlock
();
}
...
...
@@ -1480,6 +1488,7 @@ taxisGetPackSize(void *p, void *context)
+
(
taxisptr
->
longname
?
serializeGetSize
((
int
)
strlen
(
taxisptr
->
longname
),
CDI_DATATYPE_TXT
,
context
)
:
0
)
+
(
taxisptr
->
units
?
serializeGetSize
((
int
)
strlen
(
taxisptr
->
units
),
CDI_DATATYPE_TXT
,
context
)
:
0
)
+
serializeGetSize
(
1
,
CDI_DATATYPE_UINT32
,
context
);
packBufferSize
+=
serializeKeysGetPackSize
(
&
taxisptr
->
keys
,
context
);
return
packBufferSize
;
}
...
...
@@ -1546,6 +1555,8 @@ taxisUnpack(char *unpackBuffer, int unpackBufferSize, int *unpackBufferPos, int
taxisP
->
units
=
units
;
}
serializeKeysUnpack
(
unpackBuffer
,
unpackBufferSize
,
unpackBufferPos
,
&
taxisP
->
keys
,
context
);
reshSetStatus
(
taxisP
->
self
,
&
taxisOps
,
reshGetStatus
(
taxisP
->
self
,
&
taxisOps
)
&
~
RESH_SYNC_BIT
);
#undef adaptKey
...
...
@@ -1596,6 +1607,8 @@ taxisPack(void *voidP, void *packBuffer, int packBufferSize, int *packBufferPos,
if
(
taxisP
->
longname
)
serializePack
(
taxisP
->
longname
,
lnameLen
,
CDI_DATATYPE_TXT
,
packBuffer
,
packBufferSize
,
packBufferPos
,
context
);
if
(
taxisP
->
units
)
serializePack
(
taxisP
->
units
,
unitsLen
,
CDI_DATATYPE_TXT
,
packBuffer
,
packBufferSize
,
packBufferPos
,
context
);
serializeKeysPack
(
&
taxisP
->
keys
,
packBuffer
,
packBufferSize
,
packBufferPos
,
context
);
}
/*
...
...
This diff is collapsed.
Click to expand it.
src/taxis.h
+
3
−
0
View file @
9ef4ff35
...
...
@@ -4,6 +4,8 @@
#include
<stdbool.h>
#include
"cdi.h"
#include
"cdi_key.h"
#ifndef RESOURCE_HANDLE_H
#include
"resource_handle.h"
#endif
...
...
@@ -29,6 +31,7 @@ typedef struct
char
*
units
;
bool
climatology
;
bool
hasBounds
;
cdi_keys_t
keys
;
}
taxis_t
;
// taxisInqSdatetime: Get the start date/time
...
...
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