dm_z_uncompress Interface

public interface dm_z_uncompress

Generic deserialisation and decompression function.


Module Procedures

private function z_uncompress(input, z, output, input_len, output_len, context) result(rc)

Uncompresses given input and returns the result in string output. The string must be allocated and large enough to hold the uncompressed data. The actual length may be smaller than the output 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.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed data.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

character(len=*), intent(inout) :: output

Uncompressed 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 decompression context to use with type Z_TYPE_ZSTD.

Return Value integer

private function z_uncompress_beat(input, z, beat, input_len, context) result(rc)

Uncompressed compressed beat namelist input and returns deserialised type in beat.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed and Namelist-serialised beat.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

type(beat_type), intent(out) :: beat

Uncompressed and deserialised beat.

integer(kind=i8), intent(in), optional :: input_len

Actual input length.

type(zstd_context_type), intent(inout), optional :: context

Zstandard decompression context to use with type Z_TYPE_ZSTD.

Return Value integer

private function z_uncompress_log(input, z, log, input_len, context) result(rc)

Uncompressed compressed log namelist input and returns deserialised type in log.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed and Namelist-serialised log.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

type(log_type), intent(out) :: log

Uncompressed and deserialised log.

integer(kind=i8), intent(in), optional :: input_len

Actual input length.

type(zstd_context_type), intent(inout), optional :: context

Zstandard decompression context to use with type Z_TYPE_ZSTD.

Return Value integer

private function z_uncompress_node(input, z, node, input_len, context) result(rc)

Uncompressed compressed node namelist input and returns deserialised type in node.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed and Namelist-serialised node.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

type(node_type), intent(out) :: node

Uncompressed and deserialised node.

integer(kind=i8), intent(in), optional :: input_len

Actual input length.

type(zstd_context_type), intent(inout), optional :: context

Zstandard decompression context to use with type Z_TYPE_ZSTD.

Return Value integer

private function z_uncompress_observ(input, z, observ, input_len, context) result(rc)

Uncompressed compressed observation namelist input and returns deserialised z in observ.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed and Namelist-serialised observation.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

type(observ_type), intent(out) :: observ

Uncompressed and deserialised observation.

integer(kind=i8), intent(in), optional :: input_len

Actual input length.

type(zstd_context_type), intent(inout), optional :: context

Zstandard decompression context to use with type Z_TYPE_ZSTD.

Return Value integer

private function z_uncompress_sensor(input, z, sensor, input_len, context) result(rc)

Uncompressed compressed sensor namelist input and returns deserialised type in sensor.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed and Namelist-serialised sensor.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

type(sensor_type), intent(out) :: sensor

Uncompressed and deserialised sensor.

integer(kind=i8), intent(in), optional :: input_len

Actual input length.

type(zstd_context_type), intent(inout), optional :: context

Zstandard decompression context to use with type Z_TYPE_ZSTD.

Return Value integer

private function z_uncompress_target(input, z, target, input_len, context) result(rc)

Uncompressed compressed target namelist input and returns deserialised type in target.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: input

Compressed and Namelist-serialised target.

integer, intent(in) :: z

Input compression enumerator (Z_TYPE_*).

type(target_type), intent(out) :: target

Uncompressed and deserialised target.

integer(kind=i8), intent(in), optional :: input_len

Actual input length.

type(zstd_context_type), intent(inout), optional :: context

Zstandard decompression context to use with type Z_TYPE_ZSTD.

Return Value integer