summaryrefslogtreecommitdiff
path: root/core/compress.h
blob: 4431eedb3d8063192dc74665f650b9ebc75ef331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// file    : core/compress.h
// project : Salis-VM
// author  : Paul Oliver <contact@pauloliver.dev>
//
// Utilities to help with zlib compression.

#pragma once

struct DeflateParams {
    z_stream strm;
    size_t size;
    Bytef *in;
    Bytef *out;
};

struct InflateParams {
    z_stream strm;
    size_t avail_in;
    size_t size;
    Bytef *in;
    Bytef *out;
};

int comp_deflate(struct DeflateParams *params);
int comp_inflate(struct InflateParams *params);
void comp_deflate_end(struct DeflateParams *params);
void comp_inflate_end(struct InflateParams *params);