4#ifndef PROTOCORE_DEFLATE_H
5#define PROTOCORE_DEFLATE_H
54#define DEFLATE_SCRATCH_SIZE 4096
67 DeflateResult (*raw)(uint8_t *,
const uint8_t *, size_t, uint8_t *, size_t,
size_t *,
void *, size_t);
84 size_t *out_len,
void *scratch,
size_t scratch_len);
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
PROTOCORE_NS DeflateNs Deflate PROTOCORE_UNUSED
Module namespace.
DeflateResult protocore_deflate_raw(uint8_t *work, const uint8_t *src, size_t src_len, uint8_t *dst, size_t dst_cap, size_t *out_len, void *scratch, size_t scratch_len)
Compress src into a raw permessage-deflate payload (RFC 7692): a .
@ DEFLATE_ERR_SCRATCH
scratch_len < DEFLATE_SCRATCH_SIZE
@ DEFLATE_OK
success; *out_len holds the compressed length
@ DEFLATE_ERR_OVERFLOW
output would exceed dst_cap (incompressible)
enum PROTO_ENUM_PACKED DeflateResult
deflate_raw() return codes (mirror ::InflateResult).
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
DeflateResult(* raw)(uint8_t *, const uint8_t *, size_t, uint8_t *, size_t, size_t *, void *, size_t)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
#define PROTOCORE_END_DECLS