Generic serialisation and compression function.
Compresses given input and returns the result in allocatable string
output
. The actual length may be smaller than the string length
and is returned in output_len
.
The following compression types are supported:
Z_TYPE_NONE
– No compression (output equals input).Z_TYPE_ZLIB
– Deflate compression.Z_TYPE_ZSTD
– Zstandard compression.The function returns the following error codes:
E_INVALID
if compression type is invalid.E_ZLIB
if zlib library call failed.E_ZSTD
if zstd library call failed.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | input |
Uncompressed data. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Compressed data. |
|
integer(kind=i8), | intent(in), | optional | :: | input_len |
Actual input length. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Actual output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |
Serialises beat beat
to namelist format and compresses it
depending on z
. The serialised and compressed result is returned
in output
. The argument output_len
will equal the length of
output
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(beat_type), | intent(inout) | :: | beat |
Beat type to serialise and compress. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Serialised and compressed beat. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |
Serialises log log
to namelist format and compresses it depending
on z
. The serialised and compressed result is returned in
output
. The argument output_len
will equal the length of
output
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(log_type), | intent(inout) | :: | log |
Log type to serialise and compress. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Serialised and compressed log. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |
Serialises node node
to namelist format and compresses it
depending on z
. The serialised and compressed result is
returned in output
. The argument output_len
will equal the
length of output
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(node_type), | intent(inout) | :: | node |
Node type to serialise and compress. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Serialised and compressed node. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |
Serialises observation observ
to namelist format and compresses it
depending on z
. The serialised and compressed result is returned
in output
. The argument output_len
will equal the length of
output
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(inout) | :: | observ |
Observation type to serialise and compress. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Serialised and compressed observation. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |
Serialises sensor sensor
to namelist format and compresses it
depending on z
. The serialised and compressed result is
returned in output
. The argument output_len
will equal the
length of output
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sensor_type), | intent(inout) | :: | sensor |
Sensor type to serialise and compress. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Serialised and compressed sensor. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |
Serialises target target
to namelist format and compresses it
depending on z
. The serialised and compressed result is
returned in output
. The argument output_len
will equal the
length of output
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(target_type), | intent(inout) | :: | target |
Target type to serialise and compress. |
||
integer, | intent(in) | :: | z |
Output compression enumerator ( |
||
character(len=:), | intent(out), | allocatable | :: | output |
Serialised and compressed target. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Output length. |
|
type(zstd_context_type), | intent(inout), | optional | :: | context |
Zstandard compression context to use with type |