+static voidpf inflate_malloc(voidpf opaque, uInt items, uInt size)
+{
+ return malloc(items*size);
+}
+
+
+static void inflate_free(voidpf opaque, voidpf address)
+{
+ free(address);
+}
+
+#define OUTPUT_BUFFER_LEN 80
+#define INPUT_BUFFER_LEN 80
+
+//----------------------------------------------------------------------------
+// Initialize decompression of the respective (HF or LF) FPGA stream
+//----------------------------------------------------------------------------
+static void init_inflate(z_streamp compressed_stream, uint8_t *input_buffer, uint32_t insize, uint8_t *output_buffer, uint32_t outsize)
+{
+
+ // initialize z_stream structure for inflate:
+ compressed_stream->next_in = input_buffer;
+ compressed_stream->avail_in = insize;
+ compressed_stream->next_out = output_buffer;
+ compressed_stream->avail_out = outsize;
+ compressed_stream->zalloc = &inflate_malloc;
+ compressed_stream->zfree = &inflate_free;
+
+ inflateInit2(compressed_stream, 0);
+
+}
+
+